コード例 #1
0
ファイル: LinkProvider.java プロジェクト: VeryCompany/social
 /**
  * Gets the uri link to space profile by its pretty name.
  *
  * @param prettyName The pretty name of space.
  * @return the uri link to space @LevelAPI Platform
  * @since 1.2.0 GA
  */
 public static String getSpaceUri(final String prettyName) {
   SpaceService spaceService = getSpaceService();
   Space space = spaceService.getSpaceByPrettyName(prettyName);
   RequestContext ctx = RequestContext.getCurrentInstance();
   if (ctx != null) {
     NodeURL nodeURL = ctx.createURL(NodeURL.TYPE);
     NavigationResource resource =
         new NavigationResource(SiteType.GROUP, space.getGroupId(), space.getUrl());
     return nodeURL.setResource(resource).toString();
   } else {
     return null;
   }
 }