Package org.jayasoft.woj.portal.model

Examples of org.jayasoft.woj.portal.model.ClufImpl


        String language = request.getParameter(Params.CLUF.PARAMS.LANGUAGE);
        if (language==null) {
            language = "en";
        }
       
        ClufImpl cluf = ServiceFactory.getLicenseService().getActiveCluf(language.toLowerCase());
        XMLResponseHelper.writeXMLResponse(response, cluf.toCluf());
       
        return null;
    }
View Full Code Here


      int nb = order.getSubscribedUsers();
      int duration = order.getSubscribedYears();
      UserDao userDao = DaoFactory.getUserDao();
      LicenseDao licenseDao = DaoFactory.getLicenseDao();
      try {
            ClufImpl cluf = getActiveCluf();
           
        userDao.fetch(u);
        UserImpl user = (UserImpl)userDao.findUser(u.getLogin());
        userDao.fetch(user);

            if ((user.getLastAcceptedCluf() == null) || !cluf.getVersion().equals(user.getLastAcceptedCluf().getVersion())) {
                user.setLastAcceptedCluf(cluf);
            }

            for (int i = 0; i < nb; i++) {
          License l = (License) licenseDao.newHandledObject();
View Full Code Here

        }
    }

    private void addFreeLicense(User u, License l) throws DaoException, ServiceException {
        UserDao userDao = DaoFactory.getUserDao();
        ClufImpl cluf = getActiveCluf();
        UserImpl user = (UserImpl)userDao.findUser(u.getLogin());
        userDao.fetch(user);
        if ((user.getLastAcceptedCluf() == null) || !cluf.getVersion().equals(user.getLastAcceptedCluf().getVersion())) {
            user.setLastAcceptedCluf(cluf);
        }
        user.getBuyedLicenses().add(l);
        l.setBuyer(user);
       
View Full Code Here

            language = getCurrentLanguage();
        }

        LOGGER.info("retrieving CLUF for " + language + " language code");
       
        ClufImpl c = DaoFactory.getClufDao().getCurrentVersion(language);
        LOGGER.info("CLUF " + c.getVersion() + " will be shown");
       
        return c;
    }
View Full Code Here

    public String getActiveClufHTMLFormatted() {
        return getActiveClufHTMLFormatted(getCurrentLanguage());
    }
   
  public String getActiveClufHTMLFormatted(String lang) {
    ClufImpl cluf = getActiveCluf(lang);
    if(cluf != null) {
      String content = cluf.getContent();
      if(content != null) {
        return StringUtils.replace(content, "\n", "<br/>");
      }
    }
    return null;
View Full Code Here

  }
 
  public void acceptInvitation(InvitationInfo invitInfo) throws ServiceException {
    String mail = invitInfo.getMail();
    try {
      ClufImpl cluf = ServiceFactory.getLicenseService().getActiveCluf();
      License licenseToAffect = (License) DaoFactory.getLicenseDao().find(new Long(Long.parseLong(invitInfo.getLicenseId())));
      User userToAffect = invitInfo.getUser();
      if (mail == null || !mail.equals(licenseToAffect.getInvitedMail())) {
        throw new IllegalArgumentException("Failed to accept invitation for user with mail : " + mail + ". This user hasn't been invited");
       
View Full Code Here

        LicenseDao licenseDao = DaoFactory.getLicenseDao();
        GroupDao groupDao = DaoFactory.getGroupDao();
        LOGGER.info("adding trial to user " + userLogged.getLogin() + " registring for a group: " + groupId);

        try {
            ClufImpl cluf = ServiceFactory.getLicenseService().getActiveCluf();
            License l = licenseDao.createTrial();
           
            Group group = (Group) groupDao.find(groupId);
//            l.setHostId(hostId); No Host
            UserImpl user = (UserImpl)userDao.findUser(userLogged.getLogin());
            userDao.fetch(user);
            if ((user.getLastAcceptedCluf() == null) ||
                cluf.getVersion().equals(user.getLastAcceptedCluf().getVersion())) {
                user.setLastAcceptedCluf(cluf);
            }
            user.getBuyedLicenses().add(l);
            l.setValidUntil(user.getLicenseUsed().getValidUntil());
            l.setBuyer(user);
View Full Code Here

                            request.setAttribute(Params.USER_ADMIN.SHOW.PARAMS.HIDE_REPOSITORY_MANAGEMENT, "true");
                        }
                        if (l != null && License.TRIAL.equals(l.getProductCode())) {
                          request.setAttribute(Params.USER_ADMIN.SHOW.PARAMS.SHOW_BUY, "true");
                        }
                        ClufImpl lastAcceptedCluf = ((UserImpl)userLogged).getLastAcceptedCluf();
            if (lastAcceptedCluf == null || ServiceFactory.getLicenseService().getCurrentClufVersion().equals(lastAcceptedCluf.getVersion())) {
                            request.setAttribute(Params.USER_LICENSE.SHOW.REQUEST.ACCEPTED_LAST_CLUF, Boolean.TRUE);
                        }
                        return null;
                    }
                }
View Full Code Here

TOP

Related Classes of org.jayasoft.woj.portal.model.ClufImpl

Copyright © 2018 www.massapicom. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.