本文整理汇总了Java中com.liferay.portal.service.GroupLocalServiceUtil.getGroup方法的典型用法代码示例。如果您正苦于以下问题:Java GroupLocalServiceUtil.getGroup方法的具体用法?Java GroupLocalServiceUtil.getGroup怎么用?Java GroupLocalServiceUtil.getGroup使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类com.liferay.portal.service.GroupLocalServiceUtil
的用法示例。
在下文中一共展示了GroupLocalServiceUtil.getGroup方法的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。
示例1: checkgroups
import com.liferay.portal.service.GroupLocalServiceUtil; //导入方法依赖的package包/类
@ProcessAction(name="checkgroups")
public void checkgroups(ActionRequest actionRequest, ActionResponse actionResponse) throws Exception {
ThemeDisplay themeDisplay = (ThemeDisplay) actionRequest.getAttribute(WebKeys.THEME_DISPLAY);
List<Course> courses = CourseLocalServiceUtil.findByCompanyId(themeDisplay.getCompanyId());
int counter = 0;
for(Course course: courses){
if(log.isDebugEnabled())log.debug("Course::"+course.getCourseId());
Group group = GroupLocalServiceUtil.getGroup(course.getGroupCreatedId());
ClassName cn = ClassNameLocalServiceUtil.getClassName(Course.class.getName());
if(!group.getClassName().equals(Course.class.getName())){
if(log.isDebugEnabled())log.debug("Change!"+group.getGroupId());
group.setClassNameId(cn.getClassNameId());
group.setClassPK(course.getCourseId());
GroupLocalServiceUtil.updateGroup(group);
counter++;
}
}
actionResponse.setRenderParameter("counter", String.valueOf(counter));
SessionMessages.add(actionRequest, "ok");
}
示例2: assinaturasThreadForum
import com.liferay.portal.service.GroupLocalServiceUtil; //导入方法依赖的package包/类
/**
* @param userId
* @throws SystemException
*/
private void assinaturasThreadForum(long userId) throws SystemException {
List<Subscription> subscricoes;
// Threads de forum
subscricoes = SubscriptionLocalServiceUtil.getUserSubscriptions(userId,
MBThread.class.getName());
for (Subscription subscricao : subscricoes) {
try {
MBThread thread = MBThreadLocalServiceUtil
.getMBThread(subscricao.getClassPK());
MBMessage mensagemRaiz = MBMessageLocalServiceUtil
.getMBMessage(thread.getRootMessageId());
if (mensagemRaiz.getClassPK() != 0)
continue;
Group grupo = GroupLocalServiceUtil.getGroup(thread
.getGroupId());
adicionaAssinatura(assinaturas, subscricao,
TipoAssinatura.FORUM_THREAD, grupo,
mensagemRaiz.getSubject());
} catch (PortalException e) {
// TODO log
}
}
}
示例3: assinaturasNoWiki
import com.liferay.portal.service.GroupLocalServiceUtil; //导入方法依赖的package包/类
/**
* @param userId
* @throws SystemException
*/
private void assinaturasNoWiki(long userId) throws SystemException {
List<Subscription> subscricoes;
// Nós de wiki
subscricoes = SubscriptionLocalServiceUtil.getUserSubscriptions(userId,
WikiNode.class.getName());
for (Subscription subscricao : subscricoes) {
try {
WikiNode noWiki = WikiNodeLocalServiceUtil
.getWikiNode(subscricao.getClassPK());
Group grupo = GroupLocalServiceUtil.getGroup(noWiki
.getGroupId());
adicionaAssinatura(assinaturas, subscricao,
TipoAssinatura.WIKI_NODE, grupo,
noWiki.getDescription());
} catch (PortalException e) {
// TODO log
}
}
}
示例4: assinaturasPaginaWiki
import com.liferay.portal.service.GroupLocalServiceUtil; //导入方法依赖的package包/类
/**
* @param userId
* @throws SystemException
*/
private void assinaturasPaginaWiki(long userId) throws SystemException {
List<Subscription> subscricoes;
// Páginas wiki
subscricoes = SubscriptionLocalServiceUtil.getUserSubscriptions(userId,
WikiPage.class.getName());
for (Subscription subscricao : subscricoes) {
try {
WikiPage paginaWiki = WikiPageLocalServiceUtil
.getWikiPage(subscricao.getClassPK());
Group grupo = GroupLocalServiceUtil.getGroup(paginaWiki
.getGroupId());
adicionaAssinatura(assinaturas, subscricao,
TipoAssinatura.WIKI_PAGE, grupo, paginaWiki.getTitle());
} catch (PortalException e) {
// TODO log
}
}
}
示例5: getMicroSiteURL
import com.liferay.portal.service.GroupLocalServiceUtil; //导入方法依赖的package包/类
public static String getMicroSiteURL(PortletRequest request, long groupId)
throws PortalException, SystemException {
String scheme = request.getScheme();
String serverName = request.getServerName();
int serverPort = request.getServerPort();
Group liveGroup = GroupLocalServiceUtil.getGroup(groupId);
int layoutCount = LayoutLocalServiceUtil.getLayoutsCount(liveGroup, false);
if(layoutCount > 0) {
return scheme + HTTP_PREFIX + serverName + StringPool.COLON + serverPort + StringPool.FORWARD_SLASH
+ PUBLIC_PAGE_PREFIX + liveGroup.getFriendlyURL();
}
layoutCount = LayoutLocalServiceUtil.getLayoutsCount(liveGroup, true);
if(layoutCount > 0) {
return scheme + HTTP_PREFIX + serverName + StringPool.COLON + serverPort + StringPool.FORWARD_SLASH
+ PRIVATE_PAGE_PREFIX + liveGroup.getFriendlyURL();
}
return StringPool.POUND;
}
示例6: closeCourse
import com.liferay.portal.service.GroupLocalServiceUtil; //导入方法依赖的package包/类
@Indexable(type=IndexableType.REINDEX)
public Course closeCourse(long courseId) throws SystemException,
PortalException {
Course course=CourseLocalServiceUtil.getCourse(courseId);
if(!course.getClosed()){
course.setClosed(true);
course.setModifiedDate(new Date());
Group courseGroup=GroupLocalServiceUtil.getGroup(course.getGroupCreatedId());
courseGroup.setActive(false);
GroupLocalServiceUtil.updateGroup(courseGroup);
coursePersistence.update(course, true);
AssetEntry courseAsset=AssetEntryLocalServiceUtil.getEntry(Course.class.getName(), course.getCourseId());
courseAsset.setVisible(false);
AssetEntryLocalServiceUtil.updateAssetEntry(courseAsset);
CourseEval courseEval=new CourseEvalRegistry().getCourseEval(course.getCourseEvalId());
if(Validator.isNotNull(courseEval)) {
courseEval.onCloseCourse(course);
}
//auditing
AuditingLogFactory.audit(course.getCompanyId(), course.getGroupId(), Course.class.getName(),
courseId, PrincipalThreadLocal.getUserId(), AuditConstants.CLOSE, null);
}
return course;
}
示例7: openCourse
import com.liferay.portal.service.GroupLocalServiceUtil; //导入方法依赖的package包/类
@Indexable(type=IndexableType.REINDEX)
public Course openCourse(long courseId) throws SystemException,
PortalException {
Course course=CourseLocalServiceUtil.getCourse(courseId);
if(course.getClosed()){
course.setClosed(false);
course.setModifiedDate(new Date());
Group courseGroup=GroupLocalServiceUtil.getGroup(course.getGroupCreatedId());
courseGroup.setActive(true);
GroupLocalServiceUtil.updateGroup(courseGroup);
coursePersistence.update(course, true);
AssetEntry courseAsset=AssetEntryLocalServiceUtil.getEntry(Course.class.getName(), course.getCourseId());
courseAsset.setVisible(true);
AssetEntryLocalServiceUtil.updateAssetEntry(courseAsset);
CourseEval courseEval=new CourseEvalRegistry().getCourseEval(course.getCourseEvalId());
if(Validator.isNotNull(courseEval)) {
courseEval.onOpenCourse(course);
}
//auditing
AuditingLogFactory.audit(course.getCompanyId(), course.getGroupId(), Course.class.getName(),
course.getCourseId(), PrincipalThreadLocal.getUserId(), AuditConstants.OPEN, null);
}
return course;
}
示例8: existsCourseName
import com.liferay.portal.service.GroupLocalServiceUtil; //导入方法依赖的package包/类
public boolean existsCourseName(long companyId, long classNameId, long liveGroupId, String name){
boolean res = false;
try {
Group group = GroupLocalServiceUtil.getGroup(companyId, name);
if(group != null && group.getClassNameId() == classNameId && group.getLiveGroupId() == liveGroupId ){
res = true;
}
} catch (Exception e) {
res = false;
}
return res;
}
示例9: getURLView
import com.liferay.portal.service.GroupLocalServiceUtil; //导入方法依赖的package包/类
@Override
public final PortletURL getURLView(LiferayPortletResponse liferayPortletResponse,
WindowState windowState) throws Exception {
Group courseGroup= GroupLocalServiceUtil.getGroup(_course.getGroupCreatedId());
PortletURL portletURL = liferayPortletResponse.createLiferayPortletURL(courseGroup.getDefaultPublicPlid(), StringPool.BLANK, PortletRequest.RENDER_PHASE);
return portletURL;
}
示例10: getURLViewInContext
import com.liferay.portal.service.GroupLocalServiceUtil; //导入方法依赖的package包/类
@Override
public final String getURLViewInContext(
LiferayPortletRequest liferayPortletRequest,
LiferayPortletResponse liferayPortletResponse,
String noSuchEntryRedirect) throws Exception {
ThemeDisplay themeDisplay = (ThemeDisplay)liferayPortletRequest.getAttribute(WebKeys.THEME_DISPLAY);
Group courseGroup= GroupLocalServiceUtil.getGroup(_course.getGroupCreatedId());
return PortalUtil.getGroupFriendlyURL(courseGroup, false, themeDisplay);
}
示例11: listaEstruturaFilhos
import com.liferay.portal.service.GroupLocalServiceUtil; //导入方法依赖的package包/类
/**
* Lista os nós filhos da estrutura
*
* @param groupId
* @param paiEstruturaId
* @return
* @throws SystemException
* @throws PortalException
*/
@Override
public List<Estrutura> listaEstruturaFilhos(long groupId,
long paiEstruturaId) throws PortalException, SystemException {
// TODO: Verificar permissões
User user = getGuestOrUser();
Group group = GroupLocalServiceUtil.getGroup(groupId);
return EstruturaLocalServiceUtil.listaFilhos(groupId, paiEstruturaId);
}
示例12: listaArtigos
import com.liferay.portal.service.GroupLocalServiceUtil; //导入方法依赖的package包/类
/**
* Lista os artigos filhos do nó de estrutura especificado
*
* @param groupId
* @param paiEstruturaId
* @return
* @throws PortalException
* @throws SystemException
*/
@Override
public List<Artigo> listaArtigos(long groupId, long paiEstruturaId)
throws PortalException, SystemException {
// TODO: Verificar permissões
User user = getGuestOrUser();
Group group = GroupLocalServiceUtil.getGroup(groupId);
return ArtigoLocalServiceUtil.listaArtigos(groupId, paiEstruturaId);
}
示例13: getUltimaPaginaVisitada
import com.liferay.portal.service.GroupLocalServiceUtil; //导入方法依赖的package包/类
/**
* Obtem a última URL acessada pelo usuário, antes da página de cadastro
*
* @param req
* @return
* @throws SystemException
* @throws PortalException
*/
public static long getUltimaPaginaVisitada() throws PortalException, SystemException {
LiferayFacesContext facesContext = LiferayFacesContext.getInstance();
long companyId = facesContext.getCompanyId();
PortletRequest req = facesContext.getPortletRequest();
LastPath lp = (LastPath) req.getPortletSession().getAttribute(WebKeys.LAST_PATH, PortletSession.APPLICATION_SCOPE);
// Plid da página para onde redirecionar de volta: ou para a
// página de onde veio
// ou para a página incial
long plid = LayoutConstants.DEFAULT_PLID;
if (lp != null) {
plid = getPlidFromFriendlyURL(companyId, lp.getContextPath() + lp.getPath());
_log.info("PLID : " + plid + " lp " + lp.getContextPath() + lp.getPath());
} else {
_log.info("LP NULL");
}
// Página inicial
if (plid == LayoutConstants.DEFAULT_PLID) {
Group grupoGuest = GroupLocalServiceUtil.getGroup(companyId, GroupConstants.GUEST);
try {
Layout layout = LayoutLocalServiceUtil.getFriendlyURLLayout(grupoGuest.getGroupId(), false, "/principal");
plid = layout.getPlid();
} catch (NoSuchLayoutException e) {
plid = LayoutLocalServiceUtil.getDefaultPlid(grupoGuest.getGroupId(), false);
}
}
return plid;
}
示例14: getChatRoomCommunityName
import com.liferay.portal.service.GroupLocalServiceUtil; //导入方法依赖的package包/类
/**
* Obtém o nome da comunidade em que a sala está
*
* @param roomId
* @return
* @throws PortalException
* @throws SystemException
*/
@Override
public final String getChatRoomCommunityName(long roomId) throws PortalException, SystemException {
ChatRoom chatRoom = ChatRoomLocalServiceUtil.getChatRoom(roomId);
try {
Group group = GroupLocalServiceUtil.getGroup(chatRoom.getGroupId());
return group.getName();
} catch (PortalException e) {
return null;
}
}
示例15: constroiNomeGrupo
import com.liferay.portal.service.GroupLocalServiceUtil; //导入方法依赖的package包/类
private String constroiNomeGrupo(Group grupo) throws PortalException,
SystemException {
String nomeGrupo;
if (!grupo.isLayout())
nomeGrupo = grupo.getDescriptiveName();
else {
Group grupoPai = GroupLocalServiceUtil.getGroup(grupo.getClassPK());
nomeGrupo = grupoPai.getDescriptiveName() + " / "
+ grupo.getDescriptiveName();
}
return nomeGrupo;
}