本文整理汇总了Java中com.liferay.portal.model.Group.getGroupId方法的典型用法代码示例。如果您正苦于以下问题:Java Group.getGroupId方法的具体用法?Java Group.getGroupId怎么用?Java Group.getGroupId使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类com.liferay.portal.model.Group
的用法示例。
在下文中一共展示了Group.getGroupId方法的6个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。
示例1: makeElementoComunidade
import com.liferay.portal.model.Group; //导入方法依赖的package包/类
private ElementoComunidade makeElementoComunidade(Group grp,
ThemeDisplay td)
throws SystemException, PortalException {
long plid;
long grpId = grp.getGroupId();
if (grp.getPrivateLayoutsPageCount() > 0)
plid = LayoutLocalServiceUtil.getDefaultPlid(grpId, true);
else
plid = LayoutLocalServiceUtil.getDefaultPlid(grpId, false);
Layout layout = LayoutLocalServiceUtil.getLayout(plid);
String grpUrl = PortalUtil.getLayoutURL(layout, td, true);
String grpName = grp.getName();
String grpImgUrl = CommunityIconFinder.findUrl(td, grpId);
return new ElementoComunidade(grpUrl, grpName, grpImgUrl);
}
示例2: MoveTopicosWizard
import com.liferay.portal.model.Group; //导入方法依赖的package包/类
public MoveTopicosWizard(String id, Group comunidadeOrigem, long idUsuario) {
super(id);
info = new InfoMoverTopico(idUsuario, comunidadeOrigem.getGroupId(), comunidadeOrigem.getName(),comunidadeOrigem.getFriendlyURL());
modelo = new DynamicWizardModel(new ForumOrigemStep()) {
/**
*
*/
private static final long serialVersionUID = 472362717938017089L;
@Override
public void finish() {
try {
MoveTopicoLocalServiceUtil.moveTopico(info);
setResponsePage(new SucessoAoMoverPage());
} catch (PortalException e) {
e.printStackTrace();
setResponsePage(new FalhaAoMoverPage());
} catch (SystemException e) {
e.printStackTrace();
setResponsePage(new FalhaAoMoverPage());
}
super.finish();
}
};
modelo.setLastVisible(false);
init(modelo);
}
示例3: makeElementoComunidade
import com.liferay.portal.model.Group; //导入方法依赖的package包/类
private ElementoComunidade makeElementoComunidade(Group grp, ThemeDisplay td) throws SystemException, PortalException {
long plid;
long grpId = grp.getGroupId();
if (grp.getPrivateLayoutsPageCount() > 0)
plid = LayoutLocalServiceUtil.getDefaultPlid(grpId, true);
else
plid = LayoutLocalServiceUtil.getDefaultPlid(grpId, false);
Layout layout = LayoutLocalServiceUtil.getLayout(plid);
String grpUrl = PortalUtil.getLayoutURL(layout, td, true);
String grpName = grp.getName();
String grpImgUrl = CommunityIconFinder.findUrl(td, grpId);
return new ElementoComunidade(grpUrl, grpName, grpImgUrl);
}
示例4: afterPropertiesSet
import com.liferay.portal.model.Group; //导入方法依赖的package包/类
public void afterPropertiesSet() throws Exception {
User user = UserLocalServiceUtil.getDefaultUser(companyId);
userId = user.getUserId();
Group group = null;
if (targetClassName.equals(LayoutSetPrototype.class.getName())) {
LayoutSetPrototype layoutSetPrototype = getLayoutSetPrototype(
companyId, targetValue);
if (layoutSetPrototype != null) {
existing = true;
}
else {
layoutSetPrototype =
LayoutSetPrototypeLocalServiceUtil.addLayoutSetPrototype(
userId, companyId, getTargetValueMap(),
StringPool.BLANK, true, true, new ServiceContext());
}
group = layoutSetPrototype.getGroup();
targetClassPK = layoutSetPrototype.getLayoutSetPrototypeId();
}
else if (targetClassName.equals(Group.class.getName())) {
if (targetValue.equals(GroupConstants.GUEST)) {
group = GroupLocalServiceUtil.getGroup(
companyId, GroupConstants.GUEST);
List<Layout> layouts = LayoutLocalServiceUtil.getLayouts(
group.getGroupId(), false,
LayoutConstants.DEFAULT_PARENT_LAYOUT_ID, false, 0, 1);
if (!layouts.isEmpty()) {
Layout layout = layouts.get(0);
LayoutTypePortlet layoutTypePortlet =
(LayoutTypePortlet)layout.getLayoutType();
List<String> portletIds = layoutTypePortlet.getPortletIds();
if (portletIds.size() != 2) {
existing = true;
}
for (String portletId : portletIds) {
if (!portletId.equals("47") &&
!portletId.equals("58")) {
existing = true;
}
}
}
}
else {
group = GroupLocalServiceUtil.fetchGroup(
companyId, targetValue);
if (group != null) {
existing = true;
}
else {
group = GroupLocalServiceUtil.addGroup(
userId, GroupConstants.DEFAULT_PARENT_GROUP_ID,
StringPool.BLANK,
GroupConstants.DEFAULT_PARENT_GROUP_ID,
GroupConstants.DEFAULT_LIVE_GROUP_ID, targetValue,
StringPool.BLANK, GroupConstants.TYPE_SITE_OPEN, true,
GroupConstants.DEFAULT_MEMBERSHIP_RESTRICTION, null,
true, true, new ServiceContext());
}
}
targetClassPK = group.getGroupId();
}
if (group != null) {
groupId = group.getGroupId();
}
}
示例5: setupPortletSpec3IssuesSite
import com.liferay.portal.model.Group; //导入方法依赖的package包/类
protected void setupPortletSpec3IssuesSite(long companyId, long userId) throws Exception {
Group site = getSiteForSetup(companyId, userId, "PORTLETSPEC3 Issues");
long groupId = site.getGroupId();
addAllUsersToSite(companyId, groupId);
for (PortalPage portalPage : TestPages.PORTLETSPEC3_ISSUE_PAGES) {
setupPublicPage(userId, groupId, portalPage);
}
}
示例6: createPortalUser
import com.liferay.portal.model.Group; //导入方法依赖的package包/类
/**
* Creates a new portal user
*
* @param firstName the first name
* @param lastName the last name
* @param mail the email address
* @param companyId the company id
* @param locale the user's locale
* @return the user object
*/
public static User createPortalUser(final String firstName,
final String lastName, final String mail, final long companyId, final long groupId,
final Locale locale, boolean sendMail, String password, boolean isAdmin, E_Role defaultRole) {
User user = null;
try {
if (defaultRole == null)
defaultRole = E_Role.ORG;
final Role defRole = checkRole(0, companyId, defaultRole);
try {
user = UserLocalServiceUtil.getUserByEmailAddress(companyId,
mail);
} catch (final Throwable t) {
}
if (user == null) {
long[] userGroups = new long[1];
Group guestSite = GroupLocalServiceUtil.getGroup(companyId, GroupConstants.GUEST);
if (guestSite != null) {
userGroups = new long[2];
userGroups[1] = guestSite.getGroupId();
}
userGroups[0] = groupId;
//long[] userGroups = new long[]{groupId, guestSite.getGroupId()};
long[] roles = new long[2];
roles[0] = defRole.getRoleId();
if (isAdmin) {
final Role adminRole = checkRole(0, companyId,
RoleConstants.ADMINISTRATOR, RoleConstants.TYPE_REGULAR);
roles[0] = adminRole.getRoleId();
}
final Role memberRole = checkRole(0, companyId,
RoleConstants.SITE_MEMBER, RoleConstants.TYPE_SITE);
roles[1] = memberRole.getRoleId();
user = UserLocalServiceUtil.addUser(0, companyId, password == null, password,
password,
true, null, mail, 0L, "", locale, firstName, "",
lastName,
0, 0, false, 0, 1, 1970, "", userGroups, null,
roles, null, sendMail,
new ServiceContext());
}
} catch (final Exception e) {
m_objLog.error(e);
}
return user;
}