pom fixes
git-svn-id: http://svn.research-infrastructures.eu/public/d4science/gcube/trunk/portlets/user/gcube-loggedin@82737 82a268e6-3cf1-43bd-a215-b396298e98cf
This commit is contained in:
parent
ae511ccb07
commit
95968f729d
19
pom.xml
19
pom.xml
|
@ -101,25 +101,6 @@
|
||||||
<groupId>org.slf4j</groupId>
|
<groupId>org.slf4j</groupId>
|
||||||
<artifactId>slf4j-api</artifactId>
|
<artifactId>slf4j-api</artifactId>
|
||||||
</dependency>
|
</dependency>
|
||||||
<dependency>
|
|
||||||
<groupId>junit</groupId>
|
|
||||||
<artifactId>junit</artifactId>
|
|
||||||
<version>4.7</version>
|
|
||||||
<scope>provided</scope>
|
|
||||||
</dependency>
|
|
||||||
<dependency>
|
|
||||||
<groupId>javax.validation</groupId>
|
|
||||||
<artifactId>validation-api</artifactId>
|
|
||||||
<version>1.0.0.GA</version>
|
|
||||||
<scope>test</scope>
|
|
||||||
</dependency>
|
|
||||||
<dependency>
|
|
||||||
<groupId>javax.validation</groupId>
|
|
||||||
<artifactId>validation-api</artifactId>
|
|
||||||
<version>1.0.0.GA</version>
|
|
||||||
<classifier>sources</classifier>
|
|
||||||
<scope>test</scope>
|
|
||||||
</dependency>
|
|
||||||
</dependencies>
|
</dependencies>
|
||||||
|
|
||||||
<build>
|
<build>
|
||||||
|
|
|
@ -95,59 +95,9 @@ public class LoggedinServiceImpl extends RemoteServiceServlet implements Loggedi
|
||||||
if (currOrg.getComments() != null)
|
if (currOrg.getComments() != null)
|
||||||
desc = currOrg.getComments();
|
desc = currOrg.getComments();
|
||||||
VREClient vre = new VREClient(name, "", desc, logoURL, "", UserBelongingClient.BELONGING);
|
VREClient vre = new VREClient(name, "", desc, logoURL, "", UserBelongingClient.BELONGING);
|
||||||
setVREBelonginApplication(vre);
|
|
||||||
return vre;
|
return vre;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
/**
|
|
||||||
* recursive method which list the portlets belonging to the current VO/VRE whole layout
|
|
||||||
*
|
|
||||||
* @param layouts
|
|
||||||
* @param themeDisplay
|
|
||||||
* @param belongingPortletNames
|
|
||||||
* @throws SystemException
|
|
||||||
*/
|
|
||||||
private void findLayoutPortlets(List<Layout> layouts, ThemeDisplay themeDisplay, List<String> belongingPortletNames ) throws SystemException {
|
|
||||||
if (layouts == null)
|
|
||||||
return;
|
|
||||||
for (Layout curLayout : layouts) {
|
|
||||||
LayoutTypePortlet layoutTypePortlet = (LayoutTypePortlet)curLayout.getLayoutType();
|
|
||||||
List<String> actualPortletList = layoutTypePortlet.getPortletIds();
|
|
||||||
for (String portletID : actualPortletList) {
|
|
||||||
String pname = LanguageUtil.get(themeDisplay.getLocale(), portletID);
|
|
||||||
//adding the portlet name cutting the not need part e.g. WorkspacePortlet_WAR_WorkspacePortlet
|
|
||||||
if (pname.indexOf("WAR") > 0) {
|
|
||||||
pname = pname.substring(0, pname.indexOf("WAR")-1);
|
|
||||||
}
|
|
||||||
belongingPortletNames.add(pname);
|
|
||||||
}
|
|
||||||
findLayoutPortlets(curLayout.getChildren(), themeDisplay, belongingPortletNames);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
/**
|
|
||||||
* TODO: Look which portlets are in the current VRE layout and create a List of names with them
|
|
||||||
* @param vre
|
|
||||||
*/
|
|
||||||
private void setVREBelonginApplication(VREClient vre) {
|
|
||||||
|
|
||||||
List<String> belongingPortletNames = new ArrayList<String>();
|
|
||||||
ThemeDisplay themeDisplay = (ThemeDisplay) this.getThreadLocalRequest().getSession().getAttribute(WebKeys.THEME_DISPLAY);
|
|
||||||
|
|
||||||
_log.debug("Reading Layouts...");
|
|
||||||
|
|
||||||
List<Layout> layouts = themeDisplay.getLayouts();
|
|
||||||
try {
|
|
||||||
findLayoutPortlets(layouts, themeDisplay, belongingPortletNames);
|
|
||||||
} catch (SystemException e) {
|
|
||||||
e.printStackTrace();
|
|
||||||
}
|
|
||||||
Collections.sort(belongingPortletNames);
|
|
||||||
_log.debug("AvailablePortlets STORE IN SESSION \n" + belongingPortletNames.toString());
|
|
||||||
getASLSession().setAttribute("availablePortlets", belongingPortletNames);
|
|
||||||
}
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* The Default Community is a community where all portal user belong to
|
* The Default Community is a community where all portal user belong to
|
||||||
* @return the default community URL
|
* @return the default community URL
|
||||||
|
|
Loading…
Reference in New Issue