Package com.liferay.portal.model

Examples of com.liferay.portal.model.User


*/
public abstract class BaseImporter implements Importer {


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

    userId = user.getUserId();

    if (isCompanyGroup()) {
      return;
    }

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

      long userId, long eventId, 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();

    Event event = EventLocalServiceUtil.fetchEvent(eventId);

    event.setModifiedDate(serviceContext.getModifiedDate(now));
    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);
View Full Code Here

      long userId, long groupId, String name, String description,
      String streetAddress, String city, String stateOrProvince,
      String country, ServiceContext serviceContext)
  throws PortalException, SystemException {

    User user = userPersistence.findByPrimaryKey(userId);

    Date now = new Date();

    long locationId = counterLocalService.increment(
      Location.class.getName());

    Location location = locationPersistence.create(locationId);

    location.setName(name);
    location.setDescription(description);
    location.setStreetAddress(streetAddress);
    location.setCity(city);
    location.setStateOrProvince(stateOrProvince);
    location.setCountry(country);

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

    super.addLocation(location);
View Full Code Here

      long userId, long locationId, String name, String description,
      String streetAddress, String city, String stateOrProvince,
      String country, ServiceContext serviceContext)
    throws PortalException, SystemException {

    User user = userPersistence.findByPrimaryKey(userId);

    Date now = new Date();

    Location location = locationPersistence.findByPrimaryKey(locationId);
View Full Code Here

  }

  public void user(long companyId, String emailAddress)
    throws PortalException, SystemException {

    User user = userLocalService.fetchUserByEmailAddress(
      companyId, emailAddress);

    if (user == null) {
      System.out.println(
        "There is no user with the company ID " + companyId +
          " and the email address " + emailAddress + ".");

      return;
    }

    System.out.println("Email address: " + user.getEmailAddress());
    System.out.println("First name: " + user.getFirstName());
    System.out.println("Last name: " + user.getLastName());
    System.out.println("Login: " + user.getLogin());
    System.out.println("Middle name: " + user.getMiddleName());
    System.out.println("Screen name: " + user.getScreenName());
    System.out.println("User ID: " + user.getUserId());
  }
View Full Code Here

      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.setUserId(userId);
    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);

    guestbookPersistence.update(guestbook);

    resourceLocalService.addResources(user.getCompanyId(), groupId, userId,
        Guestbook.class.getName(), guestbookId, false, true, true);
   
    AssetEntry assetEntry = assetEntryLocalService.updateEntry(userId,
        groupId, guestbook.getCreateDate(),
        guestbook.getModifiedDate(), Guestbook.class.getName(),
View Full Code Here

    validate(name);

    Guestbook guestbook = getGuestbook(guestbookId);
   
    User user = UserLocalServiceUtil.getUser(userId);

    guestbook.setUserId(userId);
    guestbook.setUserName(user.getFullName());
    guestbook.setModifiedDate(serviceContext.getModifiedDate(now));
    guestbook.setName(name);
    guestbook.setExpandoBridgeAttributes(serviceContext);

    guestbookPersistence.update(guestbook);
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.setUserId(userId);
    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);
    entry.setEmail(email);
    entry.setMessage(message);
   
    entryPersistence.update(entry);
   
    resourceLocalService.addResources(user.getCompanyId(), groupId, userId,
        Entry.class.getName(), entryId, false, true, true);
   
    AssetEntry assetEntry = assetEntryLocalService.updateEntry(userId,
        groupId, entry.getCreateDate(), entry.getModifiedDate(),
        Entry.class.getName(), entryId, entry.getUuid(), 0,
View Full Code Here

      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);

    Entry entry = getEntry(entryId);

    entry.setUserId(userId);
    entry.setUserName(user.getFullName());
    entry.setName(name);
    entry.setEmail(email);
    entry.setMessage(message);
    entry.setModifiedDate(serviceContext.getModifiedDate(now));
    entry.setExpandoBridgeAttributes(serviceContext);

    entryPersistence.update(entry);

    resourceLocalService.updateResources(user.getCompanyId(), groupId,
        Entry.class.getName(), entryId,
        serviceContext.getGroupPermissions(),
        serviceContext.getGuestPermissions());
   
    AssetEntry assetEntry = assetEntryLocalService.updateEntry(userId,
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.