当前位置: 首页>>代码示例>>Java>>正文


Java Group.getGroupId方法代码示例

本文整理汇总了Java中com.liferay.portal.kernel.model.Group.getGroupId方法的典型用法代码示例。如果您正苦于以下问题:Java Group.getGroupId方法的具体用法?Java Group.getGroupId怎么用?Java Group.getGroupId使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在com.liferay.portal.kernel.model.Group的用法示例。


在下文中一共展示了Group.getGroupId方法的6个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。

示例1: addSiteMultiSelect

import com.liferay.portal.kernel.model.Group; //导入方法依赖的package包/类
public void addSiteMultiSelect(String name) throws SystemException {
	List<Group> groups =
		GroupLocalServiceUtil.getGroups(
			QueryUtil.ALL_POS, QueryUtil.ALL_POS);

	List<KeyValuePair> values = new ArrayList<KeyValuePair>(groups.size());

	for (Group group : groups) {
		//if ((group.isCommunity() || group.isSite()) &&
		//	!group.isControlPanel() && !group.isStaged()) {
           if (group.isRegularSite() && !group.isControlPanel() && !group.isStaged()) {
			long siteId = group.getGroupId();
			String siteName = group.getName();

			if (Validator.isNull(siteId) || Validator.isNull(siteName)) {
				continue;
			}

			values.add(new KeyValuePair(siteName, String.valueOf(siteId)));
		}
	}

	addMultiSelectList(name, values);
}
 
开发者ID:sorin-pop,项目名称:data-manipulator,代码行数:25,代码来源:DisplayFields.java

示例2: dumpToLog

import com.liferay.portal.kernel.model.Group; //导入方法依赖的package包/类
public static void dumpToLog(
		boolean groupBySite,
		Map<Long, List<Comparison>> comparisonDataMap)
	throws SystemException {

	if (!_log.isInfoEnabled()) {
		return;
	}

	for (
		Entry<Long, List<Comparison>> entry :
			comparisonDataMap.entrySet()) {

		String groupTitle = null;
		Group group = GroupLocalServiceUtil.fetchGroup(entry.getKey());

		if ((group == null) && groupBySite) {
			groupTitle = "N/A";
		}
		else if (group != null) {
			groupTitle = group.getGroupId() + " - " + group.getName();
		}

		if (groupTitle != null) {
			_log.info("");
			_log.info("---------------");
			_log.info("GROUP: " + groupTitle);
			_log.info("---------------");
		}

		for (Comparison comparison : entry.getValue()) {
			comparison.dumpToLog();
		}
	}
}
 
开发者ID:jorgediaz-lr,项目名称:staging-checker,代码行数:36,代码来源:StagingCheckerPortlet.java

示例3: getGroupIds

import com.liferay.portal.kernel.model.Group; //导入方法依赖的package包/类
public List<Long> getGroupIds(Company company, String[] filterGroupIdArr)
	throws SystemException {

	if ((filterGroupIdArr != null) && (filterGroupIdArr.length == 1) &&
		filterGroupIdArr[0].equals("-1000")) {

		filterGroupIdArr = null;
	}

	List<Group> groups =
		GroupLocalServiceUtil.getCompanyGroups(
			company.getCompanyId(), QueryUtil.ALL_POS, QueryUtil.ALL_POS);

	List<Long> groupIds = new ArrayList<Long>();

	for (Group group : groups) {
		if (!group.hasStagingGroup()) {
			continue;
		}

		if (filterGroupIdArr == null) {
			groupIds.add(group.getGroupId());
			continue;
		}

		String groupIdStr = "" + group.getGroupId();

		for (int i = 0; i < filterGroupIdArr.length; i++) {
			if (groupIdStr.equals(filterGroupIdArr[i])) {
				groupIds.add(group.getGroupId());
				break;
			}
		}
	}

	return groupIds;
}
 
开发者ID:jorgediaz-lr,项目名称:staging-checker,代码行数:38,代码来源:StagingCheckerPortlet.java

示例4: getGroupIds

import com.liferay.portal.kernel.model.Group; //导入方法依赖的package包/类
public List<Long> getGroupIds(
		Company company, Set<ExecutionMode> executionMode,
		String[] filterGroupIdArr)
	throws SystemException {

	if ((filterGroupIdArr != null) && (filterGroupIdArr.length == 1) &&
		filterGroupIdArr[0].equals("-1000")) {

		filterGroupIdArr = null;
	}

	boolean queryBySite = executionMode.contains(
		ExecutionMode.QUERY_BY_SITE);

	if (!queryBySite && (filterGroupIdArr == null)) {
		return null;
	}

	List<Group> groups =
		GroupLocalServiceUtil.getCompanyGroups(
			company.getCompanyId(), QueryUtil.ALL_POS, QueryUtil.ALL_POS);

	List<Long> groupIds = new ArrayList<Long>();

	boolean allSites = false;
	boolean userSites = false;

	if (filterGroupIdArr != null) {
		for (String filterGroupId : filterGroupIdArr) {
			if ("0".equals(filterGroupId)) {
				groupIds.add(0L);
			}

			if ("-1".equals(filterGroupId)) {
				allSites = true;
			}

			if ("-2".equals(filterGroupId)) {
				userSites = true;
			}
		}
	}

	if (filterGroupIdArr == null) {
		groupIds.add(0L);
	}

	for (Group group : groups) {
		if (filterGroupIdArr == null) {
			groupIds.add(group.getGroupId());
			continue;
		}

		if (allSites && (group.isSite() || group.isStagingGroup() ||
			 group.isCompany())) {

			groupIds.add(group.getGroupId());
			continue;
		}

		if (userSites && (group.isUser() || group.isUserGroup())) {
			groupIds.add(group.getGroupId());
			continue;
		}

		String groupIdStr = "" + group.getGroupId();

		for (int i = 0; i < filterGroupIdArr.length; i++) {
			if (groupIdStr.equals(filterGroupIdArr[i])) {
				groupIds.add(group.getGroupId());
				break;
			}
		}
	}

	return groupIds;
}
 
开发者ID:jorgediaz-lr,项目名称:index-checker,代码行数:78,代码来源:IndexCheckerPortlet.java

示例5: setupPortal

import com.liferay.portal.kernel.model.Group; //导入方法依赖的package包/类
public static void setupPortal(final Setup setup) {
    long defaultUserId = 0;
    long companyId = PortalUtil.getDefaultCompanyId();
    try {
        defaultUserId = UserLocalServiceUtil.getDefaultUserId(companyId);
    } catch (PortalException e1) {
        LOG.error("default user not found", e1);
    }
    long groupId = 0;
    Group g;
    try {
        g = GroupLocalServiceUtil.getGroup(companyId, "Guest");
        groupId = g.getGroupId();
    } catch (PortalException e) {
        LOG.error("Default site not found", e);
    }

    if (setup.getDeleteLiferayObjects() != null) {
        LOG.info("Deleting : " + setup.getDeleteLiferayObjects().getObjectsToBeDeleted().size()
                + " objects");
        deleteObjects(setup.getDeleteLiferayObjects().getObjectsToBeDeleted());
    }

    if (setup.getCustomFields() != null) {
        LOG.info("Setting up " + setup.getCustomFields().getField().size() + " custom fields");
        SetupCustomFields.setupExpandoFields(setup.getCustomFields().getField());
    }

    if (setup.getRoles() != null) {
        LOG.info("Setting up " + setup.getRoles().getRole().size() + " roles");
        SetupRoles.setupRoles(setup.getRoles().getRole(), runAsUserId, groupId, companyId);
    }
    if (setup.getUsers() != null) {
        LOG.info("Setting up " + setup.getUsers().getUser().size() + " users");
        SetupUsers.setupUsers(setup.getUsers().getUser(), defaultUserId, groupId);
    }

    if (setup.getOrganizations() != null) {
        LOG.info("Setting up " + setup.getOrganizations().getOrganization().size()
            + " organizations");
        SetupOrganizations.setupOrganizations(setup.getOrganizations().getOrganization(), null,
            null);
    }

    if (setup.getUserGroups() != null) {
        LOG.info("Setting up " + setup.getUserGroups().getUserGroup().size() + " User Groups");
        SetupUserGroups.setupUserGroups(setup.getUserGroups().getUserGroup());
    }


    if (setup.getPortletPermissions() != null) {
        LOG.info("Setting up " + setup.getPortletPermissions().getPortlet().size() + " roles");
        SetupPermissions.setupPortletPermissions(setup.getPortletPermissions());
    }

    if (setup.getSites() != null) {
        LOG.info("Setting up " + setup.getSites().getSite().size() + " sites");
        SetupSites.setupSites(setup.getSites().getSite(), null);
    }


    if (setup.getPageTemplates() != null) {
        SetupPages.setupPageTemplates(setup.getPageTemplates(), groupId, companyId,
                defaultUserId);
    }

    LOG.info("Setup finished");
}
 
开发者ID:mimacom,项目名称:liferay-db-setup-core,代码行数:69,代码来源:LiferaySetup.java

示例6: getSites

import com.liferay.portal.kernel.model.Group; //导入方法依赖的package包/类
@Override
public JSONObject getSites(long id, long groupId, ServiceContext serviceContext) {
	JSONObject result = JSONFactoryUtil.createJSONObject();

	try {
		List<Group> listGroup = GroupLocalServiceUtil.getUserSitesGroups(id);

		List<Document> list = new ArrayList<>();

		for (Group group : listGroup) {

			Document document = new DocumentImpl();

			OfficeSite officeSite = OfficeSiteLocalServiceUtil.fetchF_groupId_siteGroupId(groupId,
					group.getGroupId());

			if(Validator.isNotNull(officeSite)){
				
				document.addNumberSortable("entryClassPK", officeSite.getOfficeSiteId());
				document.addTextSortable("siteName", officeSite.getName());
				
			} else {
				
				document.addNumberSortable("entryClassPK", 0);
				document.addTextSortable("siteName", group.getName(locale));
				
			}
			
			document.addNumberSortable("siteGroupId", group.getGroupId());
			
			boolean isCurrent = false;

			if (group.getGroupId() == groupId) {

				isCurrent = true;

			}
			document.addTextSortable("currentSite", String.valueOf(isCurrent));

			list.add(document);

		}

		result.put("data", list);

		long total = listGroup.size();

		result.put("total", total);

	} catch (PortalException e) {
		e.printStackTrace();
	}

	return result;

}
 
开发者ID:VietOpenCPS,项目名称:opencps-v2,代码行数:57,代码来源:UserActions.java


注:本文中的com.liferay.portal.kernel.model.Group.getGroupId方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。