本文整理汇总了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;
}
示例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);
}
示例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;
}
示例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;
}
示例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);
}
示例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;
}
示例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;
}
示例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;
}
示例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);
}