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


Java GroupLocalServiceUtil.dynamicQuery方法代码示例

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


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

示例1: existsCourseName

import com.liferay.portal.service.GroupLocalServiceUtil; //导入方法依赖的package包/类
@SuppressWarnings("unchecked")
public boolean existsCourseName(Long companyId, Long courseId, String groupName) throws SystemException, PortalException {
	
	DynamicQuery consulta = DynamicQueryFactoryUtil.forClass(Group.class, PortalClassLoaderUtil.getClassLoader());
	consulta.add(PropertyFactoryUtil.forName("name").eq(groupName));
	consulta.add(PropertyFactoryUtil.forName("companyId").eq(companyId));
	if (courseId != null) {
		Course course = CourseLocalServiceUtil.getCourse(courseId);
		consulta.add(PropertyFactoryUtil.forName("groupId").ne(course.getGroupCreatedId()));
	}
	
	List<Group> list = (List<Group>)GroupLocalServiceUtil.dynamicQuery(consulta);
	
	if(!list.isEmpty() && list.size() > 0){
		return true;
	}
	
	return false;
}
 
开发者ID:TelefonicaED,项目名称:liferaylms-portlet,代码行数:20,代码来源:CourseLocalServiceImpl.java

示例2: getComunidadesDisponiveis

import com.liferay.portal.service.GroupLocalServiceUtil; //导入方法依赖的package包/类
/**
 * Lista todas as comunidades públicas, privadas e restritas da companhia
 * 
 * @throws SystemException
 */
@SuppressWarnings("unchecked")
public List<Group> getComunidadesDisponiveis(final long companyId) throws SystemException {

	final long groupClassNameId = ClassNameLocalServiceUtil.getClassNameId(Group.class);

	final DynamicQuery query = DynamicQueryFactoryUtil.forClass(Group.class, PortalClassLoaderUtil.getClassLoader());
	query.add(RestrictionsFactoryUtil.eq("companyId", companyId));
	query.add(RestrictionsFactoryUtil.eq("classNameId", groupClassNameId));
	query.add(RestrictionsFactoryUtil.in("type", new Object[] { GroupConstants.TYPE_SITE_OPEN, GroupConstants.TYPE_SITE_PRIVATE,
			GroupConstants.TYPE_SITE_RESTRICTED }));
	query.add(RestrictionsFactoryUtil.eq("parentGroupId", GroupConstants.DEFAULT_PARENT_GROUP_ID));
	query.add(RestrictionsFactoryUtil.eq("active", true));
	query.add(RestrictionsFactoryUtil.ne("name", GroupConstants.CONTROL_PANEL));
	query.addOrder(OrderFactoryUtil.asc("name"));

	return (List<Group>) GroupLocalServiceUtil.dynamicQuery(query);
}
 
开发者ID:camaradosdeputadosoficial,项目名称:edemocracia,代码行数:23,代码来源:DashboardLocalServiceImpl.java

示例3: getComunidades

import com.liferay.portal.service.GroupLocalServiceUtil; //导入方法依赖的package包/类
/**
 * Lista todas as comunidades públicas, privadas e restritas da companhia
 * 
 * @throws SystemException
 */
private List<Group> getComunidades(long companyId) throws SystemException {

	long groupClassNameId = ClassNameLocalServiceUtil
			.getClassNameId(Group.class);

	DynamicQuery query = DynamicQueryFactoryUtil.forClass(Group.class,
			PortalClassLoaderUtil.getClassLoader());
	query.add(RestrictionsFactoryUtil.eq("companyId", companyId));
	query.add(RestrictionsFactoryUtil.eq("classNameId", groupClassNameId));
	query.add(RestrictionsFactoryUtil.in("type", new Object[] {
			GroupConstants.TYPE_SITE_OPEN,
			GroupConstants.TYPE_SITE_PRIVATE,
			GroupConstants.TYPE_SITE_RESTRICTED }));
	query.add(RestrictionsFactoryUtil.eq("parentGroupId",
			GroupConstants.DEFAULT_PARENT_GROUP_ID));
	query.add(RestrictionsFactoryUtil.eq("active", true));
	query.add(RestrictionsFactoryUtil.ne("name",
			GroupConstants.CONTROL_PANEL));
	query.addOrder(OrderFactoryUtil.asc("name"));

	@SuppressWarnings("unchecked")
	List<Group> ret = GroupLocalServiceUtil.dynamicQuery(query);
	return ret;
}
 
开发者ID:camaradosdeputadosoficial,项目名称:edemocracia,代码行数:30,代码来源:ContadorAcessoLocalServiceImpl.java

示例4: getGruposFilhos

import com.liferay.portal.service.GroupLocalServiceUtil; //导入方法依赖的package包/类
/**
 * @param group
 * 
 * @return
 * @throws SystemException
 */
private List<Long> getGruposFilhos(Group group) throws SystemException {
	List<Long> grupos = new ArrayList<Long>();

	long layoutClassNameId = ClassNameLocalServiceUtil
			.getClassNameId(Layout.class);
	DynamicQuery query = DynamicQueryFactoryUtil.forClass(Group.class);
	query.add(RestrictionsFactoryUtil.eq("companyId", group.getCompanyId()));
	query.add(RestrictionsFactoryUtil.eq("classNameId", layoutClassNameId));
	query.add(RestrictionsFactoryUtil.eq("parentGroupId",
			group.getGroupId()));
	query.add(RestrictionsFactoryUtil.eq("active", true));
	@SuppressWarnings("unchecked")
	List<Group> filhos = GroupLocalServiceUtil.dynamicQuery(query);
	for (Group filho : filhos)
		grupos.add(filho.getGroupId());
	return grupos;
}
 
开发者ID:camaradosdeputadosoficial,项目名称:edemocracia,代码行数:24,代码来源:ContadorAcessoLocalServiceImpl.java

示例5: getComunidadesDisponiveis

import com.liferay.portal.service.GroupLocalServiceUtil; //导入方法依赖的package包/类
/**
 * Lista todas as comunidades públicas, privadas e restritas da companhia
 * 
 * @throws SystemException
 */
@SuppressWarnings("unchecked")
public List<Group> getComunidadesDisponiveis(final long companyId)
		throws SystemException {

	final long groupClassNameId = ClassNameLocalServiceUtil
			.getClassNameId(Group.class);

	final DynamicQuery query = DynamicQueryFactoryUtil.forClass(
			Group.class, PortalClassLoaderUtil.getClassLoader());
	query.add(RestrictionsFactoryUtil.eq("companyId", companyId));
	query.add(RestrictionsFactoryUtil.eq("classNameId", groupClassNameId));
	query.add(RestrictionsFactoryUtil.in("type", new Object[] {
			GroupConstants.TYPE_SITE_OPEN,
			GroupConstants.TYPE_SITE_PRIVATE,
			GroupConstants.TYPE_SITE_RESTRICTED }));
	query.add(RestrictionsFactoryUtil.eq("parentGroupId",
			GroupConstants.DEFAULT_PARENT_GROUP_ID));
	query.add(RestrictionsFactoryUtil.eq("active", true));
	query.add(RestrictionsFactoryUtil.ne("name",
			GroupConstants.CONTROL_PANEL));
	query.addOrder(OrderFactoryUtil.asc("name"));

	return (List<Group>) GroupLocalServiceUtil.dynamicQuery(query);
}
 
开发者ID:camaradosdeputadosoficial,项目名称:edemocracia,代码行数:30,代码来源:ParticipacaoLocalServiceImpl.java

示例6: getComunidades

import com.liferay.portal.service.GroupLocalServiceUtil; //导入方法依赖的package包/类
@Override
protected List<Group> getComunidades(PortletRequest renderRequest, ThemeDisplay td) {
	List<Group> comunidades = Collections.<Group> emptyList();

	try {
		// Consulta feita na mão para evitar cache trashing
		DynamicQuery query = DynamicQueryFactoryUtil.forClass(Group.class, PortalClassLoaderUtil.getClassLoader());
		query.add(RestrictionsFactoryUtil.eq("companyId", td.getCompanyId()));
		query.add(RestrictionsFactoryUtil.eq("active", true));
		query.add(RestrictionsFactoryUtil.in("type", new Object[] {GroupConstants.TYPE_SITE_OPEN, GroupConstants.TYPE_SITE_RESTRICTED} ));
		query.add(RestrictionsFactoryUtil.not(RestrictionsFactoryUtil.in("name", new Object[] {GroupConstants.GUEST, GroupConstants.CONTROL_PANEL, ""})));
		query.add(RestrictionsFactoryUtil.ne("groupId", td.getScopeGroupId()));
		query.add(RestrictionsFactoryUtil.eq("classNameId", PortalUtil.getClassNameId(Group.class)));
		query.addOrder(OrderFactoryUtil.asc("name"));
		
		@SuppressWarnings("unchecked")
		List<Group> groups = GroupLocalServiceUtil.dynamicQuery(query) ;
		
		comunidades = new ArrayList<Group>(groups.size());
		for (Group grp : groups) {
			if (grp.getPublicLayoutsPageCount() != 0)
				comunidades.add(grp);
		}
	} catch (SystemException e) {
		_log.error(e);
	}
	return comunidades;
}
 
开发者ID:camaradosdeputadosoficial,项目名称:edemocracia,代码行数:29,代码来源:OutrasComunidades.java

示例7: getComunidadesAtivas

import com.liferay.portal.service.GroupLocalServiceUtil; //导入方法依赖的package包/类
private List<Group> getComunidadesAtivas(PortletRequest renderRequest, ThemeDisplay td) {

	List<Group> comunidades = Collections.<Group> emptyList();

	try {

	    DynamicQuery query = DynamicQueryFactoryUtil.forClass(Group.class, PortalClassLoaderUtil.getClassLoader());
	    query.add(RestrictionsFactoryUtil.eq("companyId", td.getCompanyId()));
	    query.add(RestrictionsFactoryUtil.eq("active", true));
	    query.add(RestrictionsFactoryUtil.in("type", new Object[] { GroupConstants.TYPE_SITE_OPEN, GroupConstants.TYPE_SITE_RESTRICTED }));
	    query.add(RestrictionsFactoryUtil.not(RestrictionsFactoryUtil.in("name", new Object[] { GroupConstants.GUEST, GroupConstants.CONTROL_PANEL, "" })));
	    // query.add(RestrictionsFactoryUtil.ne("groupId",
	    // td.getScopeGroupId()));
	    query.add(RestrictionsFactoryUtil.eq("classNameId", PortalUtil.getClassNameId(Group.class)));
	    query.addOrder(OrderFactoryUtil.desc("name"));

	    @SuppressWarnings("unchecked")
	    List<Group> groups = GroupLocalServiceUtil.dynamicQuery(query);

	    comunidades = new ArrayList<Group>(groups.size());

	    for (Group grp : groups) {

		if (grp.getPublicLayoutsPageCount() != 0) {
		    Boolean finished = (Boolean) grp.getExpandoBridge().getAttribute("Encerrada");
		    if (finished == null || !finished)
			comunidades.add(grp);
		}

	    }

	} catch (SystemException e) {
	    _log.error(e);
	}

	return comunidades;
    }
 
开发者ID:camaradosdeputadosoficial,项目名称:edemocracia,代码行数:38,代码来源:TodasComunidades.java

示例8: getComunidadesEncerradas

import com.liferay.portal.service.GroupLocalServiceUtil; //导入方法依赖的package包/类
private List<Group> getComunidadesEncerradas(PortletRequest renderRequest, ThemeDisplay td) {

	List<Group> comunidades = Collections.<Group> emptyList();

	try {

	    DynamicQuery query = DynamicQueryFactoryUtil.forClass(Group.class, PortalClassLoaderUtil.getClassLoader());
	    query.add(RestrictionsFactoryUtil.eq("companyId", td.getCompanyId()));
	    query.add(RestrictionsFactoryUtil.eq("active", true));
	    query.add(RestrictionsFactoryUtil.in("type", new Object[] { GroupConstants.TYPE_SITE_OPEN, GroupConstants.TYPE_SITE_RESTRICTED }));
	    query.add(RestrictionsFactoryUtil.not(RestrictionsFactoryUtil.in("name", new Object[] { GroupConstants.GUEST, GroupConstants.CONTROL_PANEL, "" })));
	    // query.add(RestrictionsFactoryUtil.ne("groupId",
	    // td.getScopeGroupId()));
	    query.add(RestrictionsFactoryUtil.eq("classNameId", PortalUtil.getClassNameId(Group.class)));
	    query.addOrder(OrderFactoryUtil.desc("name"));

	    @SuppressWarnings("unchecked")
	    List<Group> groups = GroupLocalServiceUtil.dynamicQuery(query);

	    comunidades = new ArrayList<Group>(groups.size());

	    for (Group grp : groups) {
		if (grp.getPublicLayoutsPageCount() != 0) {
		    Boolean finished = (Boolean) grp.getExpandoBridge().getAttribute("Encerrada");
		    if (finished != null && finished)
			comunidades.add(grp);
		}
	    }

	} catch (SystemException e) {
	    _log.error(e);
	}

	return comunidades;
    }
 
开发者ID:camaradosdeputadosoficial,项目名称:edemocracia,代码行数:36,代码来源:TodasComunidades.java

示例9: getGroups

import com.liferay.portal.service.GroupLocalServiceUtil; //导入方法依赖的package包/类
private List<Group> getGroups(long groupId) throws SystemException {
	DynamicQuery query = DynamicQueryFactoryUtil.forClass(GroupModel.class, PortalClassLoaderUtil.getClassLoader()).addOrder(OrderFactoryUtil.asc("groupId"));
	query.add(RestrictionsFactoryUtil.or(PropertyFactoryUtil.forName("groupId").eq(groupId), PropertyFactoryUtil.forName("parentGroupId").eq(groupId)));
	
	return (List<Group>) GroupLocalServiceUtil.dynamicQuery(query);
}
 
开发者ID:camaradosdeputadosoficial,项目名称:edemocracia,代码行数:7,代码来源:DadosForumServiceImpl.java


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