Esempio n. 1
0
  public List<Group> getMySites(String[] classNames, boolean includeControlPanel, int max)
      throws PortalException, SystemException {

    ThreadLocalCache<List<Group>> threadLocalCache =
        ThreadLocalCacheManager.getThreadLocalCache(Lifecycle.REQUEST, UserImpl.class.getName());

    String key = StringUtil.toHexString(max);

    if ((classNames != null) && (classNames.length > 0)) {
      key = StringUtil.merge(classNames).concat(StringPool.POUND).concat(key);
    }

    key = key.concat(StringPool.POUND).concat(String.valueOf(includeControlPanel));

    List<Group> myPlaces = threadLocalCache.get(key);

    if (myPlaces != null) {
      return myPlaces;
    }

    myPlaces = GroupServiceUtil.getUserPlaces(getUserId(), classNames, includeControlPanel, max);

    threadLocalCache.put(key, myPlaces);

    return myPlaces;
  }
  public static com.liferay.portal.model.GroupSoap[] getUserPlaces(
      long userId, java.lang.String[] classNames, int max) throws RemoteException {
    try {
      java.util.List<com.liferay.portal.model.Group> returnValue =
          GroupServiceUtil.getUserPlaces(userId, classNames, max);

      return com.liferay.portal.model.GroupSoap.toSoapModels(returnValue);
    } catch (Exception e) {
      _log.error(e, e);

      throw new RemoteException(e.getMessage());
    }
  }