Package com.liferay.portal.model

Examples of com.liferay.portal.model.User


    if (warrants != null) {     
      for (Warrant warrant : warrants) {
        log.info(String.format("Warrant [id=%d] created on %tF", warrant.getId(), warrant.getCreateDate()));
        String to = null;
        try {
          User user = UserLocalServiceUtil.getUserById(warrant.getUserId());
          to = user.getEmailAddress();
          String subject = processTemplate(type.subjectTemplate, warrant, user);
          String body = processTemplate(type.bodyTemplate, warrant, user);
          sendEmail(warrant, to, subject, body);
          switch (type) {
          case WARNING:
View Full Code Here


      String jobTitle, long[] groupIds, long[] organizationIds,
      long[] roleIds, long[] userGroupIds, boolean sendEmail,
      ServiceContext serviceContext) throws PortalException,
      SystemException {
    // TODO Auto-generated method stub
    User user = super.addUser(creatorUserId, companyId, autoPassword, password1,
        password2, autoScreenName, screenName, emailAddress, facebookId,
        openId, locale, firstName, middleName, lastName, prefixId, suffixId,
        male, birthdayMonth, birthdayDay, birthdayYear, jobTitle, groupIds,
        organizationIds, roleIds, userGroupIds, sendEmail, serviceContext);
    log.debug("Adding user: "+user+", expando: "+user.getExpandoBridge());
    return user;
  }
View Full Code Here

        originalStrutsPortletAction.processAction(originalStrutsPortletAction,
            portletConfig, actionRequest, actionResponse);

        String screenName = ParamUtil.getString(actionRequest, "screenName");

        User fetchUserByScreenName = UserLocalServiceUtil.fetchUserByScreenName(company.getCompanyId(), screenName);

        long userId = fetchUserByScreenName.getUserId();

        System.out.println("userId: " + userId);

        updateWarrantUserUniqueId(actionRequest, actionResponse, warrantUserUniqueID, userId);
      }else{
View Full Code Here

        WebKeys.THEME_DISPLAY);

    long entryId = ParamUtil.getLong(actionRequest, "entryId");
    long userId = themeDisplay.getUserId();
   
    User currentUser = UserLocalServiceUtil.getUser(userId);
   
    Warrant warrant = WarrantLocalServiceUtil.getWarrant(entryId);
    boolean isAdmin = false;
   
    List<Role> roles = currentUser.getRoles();
   
    for(Role r : roles){
      if(!"WC Admin".equalsIgnoreCase(r.getName())){
          isAdmin = true;
        }
View Full Code Here

    long entryId = ParamUtil.getLong(actionRequest, "entryId");
    long userId = themeDisplay.getUserId();

    Warrant warrant;
    User currentUser;
    User sellingUser;
    try {
      warrant = WarrantLocalServiceUtil.getWarrant(entryId);
     
      currentUser = UserLocalServiceUtil.getUser(userId);

      sellingUser = UserLocalServiceUtil.getUser(warrant.getUserId());

      MailMessage mailMessageS = new MailMessage();
      mailMessageS.setBody(mailMessage);
      mailMessageS.setFrom(new InternetAddress(currentUser.getEmailAddress()));
      String subject = "Warrant interest";
      mailMessageS.setSubject(subject);
      mailMessageS.setTo(new InternetAddress(sellingUser.getEmailAddress()));
      MessageBusUtil.sendMessage(DestinationNames.MAIL, mailMessageS);
     
     
      logEmailMessageSent(subject, mailMessage);
View Full Code Here

  public List getUserRoles(String userId, SourceBean passwd) {
    logger.debug("IN");
    ArrayList roles = new ArrayList();
    try {
      logger.info("UserID=" + userId);
      User user = UserServiceUtil.getUserById(Integer.parseInt(userId));
      if (user != null) {
        List ruoli = RoleServiceUtil.getUserRoles(user.getUserId());
        if (ruoli != null) {
          Iterator iter = ruoli.iterator();
          while (iter.hasNext()) {
            com.liferay.portal.model.Role ruolo = (com.liferay.portal.model.Role) iter
                .next();
View Full Code Here

  public Guestbook addGuestbook(long userId, String name,
      ServiceContext serviceContext) throws SystemException, PortalException {
   
    long groupId = serviceContext.getScopeGroupId();
   
    User user = userPersistence.findByPrimaryKey(userId);
   
    Date now = new Date();
   
    validate(name);
   
    long guestbookId = counterLocalService.increment();
   
    Guestbook guestbook = guestbookPersistence.create(guestbookId);
   
    guestbook.setUuid(serviceContext.getUuid());
    guestbook.setGroupId(groupId);
    guestbook.setCompanyId(user.getCompanyId());
    guestbook.setUserName(user.getFullName());
    guestbook.setCreateDate(serviceContext.getCreateDate(now));
    guestbook.setModifiedDate(serviceContext.getModifiedDate(now));
    guestbook.setName(name);
    guestbook.setExpandoBridgeAttributes(serviceContext);
   
View Full Code Here

  public Entry addEntry(long userId, long guestbookId, String name,
      String email, String message, ServiceContext serviceContext) throws PortalException, SystemException {
    long groupId = serviceContext.getScopeGroupId();
   
    User user = userPersistence.findByPrimaryKey(userId);
   
    Date now = new Date();
   
    validate(name, email, message);
   
    long entryId = counterLocalService.increment();
   
    Entry entry = entryPersistence.create(entryId);
   
    entry.setUuid(serviceContext.getUuid());
    entry.setGroupId(groupId);
    entry.setCompanyId(user.getCompanyId());
    entry.setUserName(user.getFullName());
    entry.setCreateDate(serviceContext.getCreateDate(now));
    entry.setModifiedDate(serviceContext.getModifiedDate(now));
    entry.setExpandoBridgeAttributes(serviceContext);
    entry.setGuestbookId(guestbookId);
    entry.setName(name);
View Full Code Here

*/
public abstract class BaseImporter implements Importer {

  @Override
  public void afterPropertiesSet() throws Exception {
    User user = UserLocalServiceUtil.getDefaultUser(companyId);

    userId = user.getUserId();

    Group group = null;

    if (targetClassName.equals(LayoutSetPrototype.class.getName())) {
      LayoutSetPrototype layoutSetPrototype = getLayoutSetPrototype(
View Full Code Here

      long userId, long groupId, String name, String description,
      int month, int day, int year, int hour, int minute, long locationId,
      ServiceContext serviceContext)
    throws PortalException, SystemException {

    User user = userPersistence.findByPrimaryKey(userId);

    Date now = new Date();

    long eventId = counterLocalService.increment(Event.class.getName());

    Event event = eventPersistence.create(eventId);

    event.setName(name);
    event.setDescription(description);

    Calendar dateCal = CalendarFactoryUtil.getCalendar(user.getTimeZone());
    dateCal.set(year, month, day, hour, minute);
    Date date = dateCal.getTime();
    event.setDate(date);

    event.setLocationId(locationId);

    event.setGroupId(groupId);
    event.setCompanyId(user.getCompanyId());
    event.setUserId(user.getUserId());
    event.setCreateDate(serviceContext.getCreateDate(now));
    event.setModifiedDate(serviceContext.getModifiedDate(now));

    super.addEvent(event);
View Full Code Here

TOP

Related Classes of com.liferay.portal.model.User

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.