added dummy gHN in gHN list

git-svn-id: http://svn.research-infrastructures.eu/public/d4science/gcube/trunk/portlets/admin/vre-deploy@118938 82a268e6-3cf1-43bd-a215-b396298e98cf
This commit is contained in:
Massimiliano Assante 2015-09-09 14:24:48 +00:00
parent 91545c0ff3
commit 7dee759b82
8 changed files with 62 additions and 30 deletions

View File

@ -1,6 +1,6 @@
<?xml version="1.0" encoding="UTF-8"?> <?xml version="1.0" encoding="UTF-8"?>
<classpath> <classpath>
<classpathentry kind="src" output="target/vre-deploy-3.3.0-SNAPSHOT/WEB-INF/classes" path="src/main/java"> <classpathentry kind="src" output="target/vre-deploy-3.4.0-SNAPSHOT/WEB-INF/classes" path="src/main/java">
<attributes> <attributes>
<attribute name="optional" value="true"/> <attribute name="optional" value="true"/>
<attribute name="maven.pomderived" value="true"/> <attribute name="maven.pomderived" value="true"/>
@ -31,5 +31,5 @@
<attribute name="maven.pomderived" value="true"/> <attribute name="maven.pomderived" value="true"/>
</attributes> </attributes>
</classpathentry> </classpathentry>
<classpathentry kind="output" path="target/vre-deploy-3.3.0-SNAPSHOT/WEB-INF/classes"/> <classpathentry kind="output" path="target/vre-deploy-3.4.0-SNAPSHOT/WEB-INF/classes"/>
</classpath> </classpath>

View File

@ -0,0 +1,3 @@
eclipse.preferences.version=1
validateFragments=false
validation.use-project-settings=true

View File

@ -1,8 +1,11 @@
<?xml version="1.0" encoding="UTF-8"?><project-modules id="moduleCoreId" project-version="1.5.0"> <?xml version="1.0" encoding="UTF-8"?><project-modules id="moduleCoreId" project-version="1.5.0">
<wb-module deploy-name="${module}"> <wb-module deploy-name="vre-deploy-portlet">
<wb-resource deploy-path="/" source-path="/target/m2e-wtp/web-resources"/> <wb-resource deploy-path="/" source-path="/target/m2e-wtp/web-resources"/>
<wb-resource deploy-path="/" source-path="/src/main/webapp" tag="defaultRootSource"/> <wb-resource deploy-path="/" source-path="/src/main/webapp" tag="defaultRootSource"/>
<wb-resource deploy-path="/WEB-INF/classes" source-path="/src/main/java"/> <wb-resource deploy-path="/WEB-INF/classes" source-path="/src/main/java"/>
<dependent-module archiveName="aslvre-5.1.0-SNAPSHOT.jar" deploy-path="/WEB-INF/lib" handle="module:/resource/asl-vre/asl-vre">
<dependency-type>uses</dependency-type>
</dependent-module>
<property name="java-output-path" value="/${module}/target/www/WEB-INF/classes"/> <property name="java-output-path" value="/${module}/target/www/WEB-INF/classes"/>
<property name="context-root" value="vre-deploy"/> <property name="context-root" value="vre-deploy"/>
</wb-module> </wb-module>

View File

@ -4,4 +4,5 @@
<installed facet="jst.web" version="2.3"/> <installed facet="jst.web" version="2.3"/>
<installed facet="wst.jsdt.web" version="1.0"/> <installed facet="wst.jsdt.web" version="1.0"/>
<installed facet="java" version="1.7"/> <installed facet="java" version="1.7"/>
<installed facet="liferay.portlet" version="6.0"/>
</faceted-project> </faceted-project>

View File

@ -12,7 +12,7 @@
<groupId>org.gcube.portlets.admin</groupId> <groupId>org.gcube.portlets.admin</groupId>
<artifactId>vre-deploy</artifactId> <artifactId>vre-deploy</artifactId>
<packaging>war</packaging> <packaging>war</packaging>
<version>3.3.0-SNAPSHOT</version> <version>3.4.0-SNAPSHOT</version>
<name>gCube VRE Deploy Wizard Portlet</name> <name>gCube VRE Deploy Wizard Portlet</name>
<description> <description>
gCube VRE Deploy Wizard Portlet. gCube VRE Deploy Wizard Portlet.
@ -49,6 +49,7 @@
<dependency> <dependency>
<groupId>com.google.gwt</groupId> <groupId>com.google.gwt</groupId>
<artifactId>gwt-user</artifactId> <artifactId>gwt-user</artifactId>
<version>${gwtVersion}</version>
<scope>provided</scope> <scope>provided</scope>
</dependency> </dependency>
<dependency> <dependency>

View File

@ -1,12 +1,16 @@
package org.gcube.portlets.admin.vredeployer.client.model; package org.gcube.portlets.admin.vredeployer.client.model;
import java.util.LinkedList;
import java.util.List; import java.util.List;
import org.gcube.portlets.admin.vredeployer.client.VredeployerService; import org.gcube.portlets.admin.vredeployer.client.VredeployerService;
import org.gcube.portlets.admin.vredeployer.client.VredeployerServiceAsync; import org.gcube.portlets.admin.vredeployer.client.VredeployerServiceAsync;
import org.gcube.portlets.admin.vredeployer.client.view.panels.MainContainer; import org.gcube.portlets.admin.vredeployer.client.view.panels.MainContainer;
import org.gcube.portlets.admin.vredeployer.shared.GHNBean; import org.gcube.portlets.admin.vredeployer.shared.GHNBean;
import org.gcube.portlets.admin.vredeployer.shared.GHNMemory;
import org.gcube.portlets.admin.vredeployer.shared.GHNProfile; import org.gcube.portlets.admin.vredeployer.shared.GHNProfile;
import org.gcube.portlets.admin.vredeployer.shared.GHNSite;
import org.gcube.portlets.admin.vredeployer.shared.RunningInstance;
import org.gcube.portlets.admin.vredeployer.shared.VREDeployerStatusType; import org.gcube.portlets.admin.vredeployer.shared.VREDeployerStatusType;
import org.gcube.portlets.admin.vredeployer.shared.VREDescrBean; import org.gcube.portlets.admin.vredeployer.shared.VREDescrBean;
@ -122,6 +126,14 @@ public class Model {
} }
public void onSuccess(List<GHNProfile> result) { public void onSuccess(List<GHNProfile> result) {
GHNMemory mem = new GHNMemory("9900000000", "990000000");
GHNSite site = new GHNSite("Lucca", "Italy", "d4science.org");
List<RunningInstance> run = new LinkedList<RunningInstance>();
List<String> libs = new LinkedList<String>();
GHNProfile dummy = new GHNProfile(
"13ea2882-97f7-4961-bae1-872fa2ff7157", "node-dummy",
run, false, mem, site, libs, false);
result.add(dummy);
mainContainer.getCenterPanel().showGHNList(result); mainContainer.getCenterPanel().showGHNList(result);
mainContainer.getCenterPanel().layout(); mainContainer.getCenterPanel().layout();
if (! isCloudSelected) if (! isCloudSelected)

View File

@ -139,7 +139,7 @@ import com.liferay.portal.theme.ThemeDisplay;
*/ */
@SuppressWarnings("serial") @SuppressWarnings("serial")
public class VREDeployerServiceImpl extends RemoteServiceServlet implements VredeployerService { public class VREDeployerServiceImpl extends RemoteServiceServlet implements VredeployerService {
private static final Logger log = LoggerFactory.getLogger(VREDeployerServiceImpl.class); private static final Logger log = LoggerFactory.getLogger(VREDeployerServiceImpl.class);
/** /**
@ -147,7 +147,7 @@ public class VREDeployerServiceImpl extends RemoteServiceServlet implements Vre
*/ */
private static final String CALENDAR_APPID = "org.gcube.portal.calendarwrapper.GCubeCalendarHandler"; private static final String CALENDAR_APPID = "org.gcube.portal.calendarwrapper.GCubeCalendarHandler";
private static final String NEWS_FEED_APPID = "org.gcube.portlets.user.newsfeed.server.NewsServiceImpl"; private static final String NEWS_FEED_APPID = "org.gcube.portlets.user.newsfeed.server.NewsServiceImpl";
protected static final String ORGANIZATION_DEFAULT_LOGO = "/org/gcube/portal/custom/communitymanager/resources/default_logo.png"; protected static final String ORGANIZATION_DEFAULT_LOGO = "/org/gcube/portal/custom/communitymanager/resources/default_logo.png";
protected static final String ORGANIZATION_DEFAULT_LOGO_URL = "http://ftp.d4science.org/apps/profiles/d4slogo.png"; protected static final String ORGANIZATION_DEFAULT_LOGO_URL = "http://ftp.d4science.org/apps/profiles/d4slogo.png";
@ -729,20 +729,35 @@ public class VREDeployerServiceImpl extends RemoteServiceServlet implements Vre
Organization vreCreated = createCommunityAndLayout(name); Organization vreCreated = createCommunityAndLayout(name);
if (vreCreated != null) { if (vreCreated != null) {
try { try {
log.info("--- CREATED LAYOUTS AND COMMUNITY OK, updating Calendar Application Profile."); log.info("--- CREATED LAYOUTS AND COMMUNITY OK, updating Calendar Application Profile.");
String vreScope = getScopeByOrganizationId(""+vreCreated.getOrganizationId()); String vreScope = getScopeByOrganizationId(""+vreCreated.getOrganizationId());
String vreUrl = "/group/"+vreCreated.getName().toLowerCase(); String vreUrl = "/group/"+vreCreated.getName().toLowerCase();
updateApplicationProfile(CALENDAR_APPID, vreScope, vreUrl+"/calendar"); boolean calandarAppProfileUpdated = false;
updateApplicationProfile(NEWS_FEED_APPID, vreScope, vreUrl); //assumes it is deployed in the home of the VRE try {
calandarAppProfileUpdated = updateApplicationProfile(CALENDAR_APPID, vreScope, vreUrl+"/calendar");
}
catch (Exception e) {
log.error("Something wrong in updateApplicationProfile for " + CALENDAR_APPID);
}
boolean newsFeedAppProfileUpdated = false;
try {
newsFeedAppProfileUpdated = updateApplicationProfile(NEWS_FEED_APPID, vreScope, vreUrl); //assumes it is deployed in the home of the VRE
}
catch (Exception e) {
log.error("Something wrong in updateApplicationProfile for " + NEWS_FEED_APPID);
}
log.info("updateApplicationProfile for " + CALENDAR_APPID + "="+calandarAppProfileUpdated);
log.info("updateApplicationProfile for " + NEWS_FEED_APPID + "="+newsFeedAppProfileUpdated);
log.info("--- creating VRE Group Folder");
log.info("Trying to create VRE Group Folder through HomeLibrary ...");
createVRESharedGroupFolder(vreCreated, designer, manager, description); createVRESharedGroupFolder(vreCreated, designer, manager, description);
log.info("--- createVRESharedGroupFolder OK, sending Message to designer."); log.info("--- createVRESharedGroupFolder OK, sending Message to designer.");
UserManager um = new LiferayUserManager(); UserManager um = new LiferayUserManager();
UserModel userDesigner = um.getUserByScreenName(designer); UserModel userDesigner = um.getUserByScreenName(designer);
UserModel userManager = um.getUserByScreenName(manager); UserModel userManager = um.getUserByScreenName(manager);
@ -758,9 +773,9 @@ public class VREDeployerServiceImpl extends RemoteServiceServlet implements Vre
if (nnm.notifyMessageReceived(designer, subject)) if (nnm.notifyMessageReceived(designer, subject))
log.trace("Sending Definition create notification: " + subject + " OK"); log.trace("Sending Definition create notification: " + subject + " OK");
} catch (Exception e) { } catch (Exception e) {
e.printStackTrace();
} }
log.info("--- Trying to share a news for this VRE"); //log.info("--- Trying to share a news for this VRE");
//shareCreatedVRENews(designer, manager, name, description); //shareCreatedVRENews(designer, manager, name, description);
@ -786,7 +801,7 @@ public class VREDeployerServiceImpl extends RemoteServiceServlet implements Vre
* @param vreScope the scope to add * @param vreScope the scope to add
* @param vreURL the absolute URL of the portlet * @param vreURL the absolute URL of the portlet
*/ */
private void updateApplicationProfile(String appId, String vreScope, String vreURL) { private boolean updateApplicationProfile(String appId, String vreScope, String vreURL) {
String currScope = ScopeProvider.instance.get(); String currScope = ScopeProvider.instance.get();
String scopeToQuery = PortalContext.getConfiguration().getInfrastructureName(); String scopeToQuery = PortalContext.getConfiguration().getInfrastructureName();
@ -799,10 +814,10 @@ public class VREDeployerServiceImpl extends RemoteServiceServlet implements Vre
query.addCondition("$resource/Profile/Body/AppId/text() eq '" + appId + "'"); query.addCondition("$resource/Profile/Body/AppId/text() eq '" + appId + "'");
DiscoveryClient<GenericResource> client = clientFor(GenericResource.class); DiscoveryClient<GenericResource> client = clientFor(GenericResource.class);
//
List<GenericResource> list = client.submit(query); List<GenericResource> list = client.submit(query);
if (list == null || list.isEmpty()) { if (list == null || list.isEmpty()) {
log.warn("Cannot retrieve the ApplicationProfile from IS for generic resource havin <Body><AppId> = " + appId); log.warn("Cannot retrieve the ApplicationProfile from IS for generic resource having <Body><AppId> = " + appId);
log.info("Triggering Creation of ApplicationProfile for " + appId); log.info("Triggering Creation of ApplicationProfile for " + appId);
GenericResource toCreate = new GenericResource(); GenericResource toCreate = new GenericResource();
toCreate.newProfile().name("Application Profile for " + appId); toCreate.newProfile().name("Application Profile for " + appId);
@ -812,9 +827,9 @@ public class VREDeployerServiceImpl extends RemoteServiceServlet implements Vre
RegistryPublisher rp=RegistryPublisherFactory.create(); RegistryPublisher rp=RegistryPublisherFactory.create();
rp.create(toCreate); rp.create(toCreate);
log.info("Creation of ApplicationProfile for " + appId + " OK!"); log.info("Creation of ApplicationProfile for " + appId + " OK!");
return; return false;
} }
GenericResource gr = list.get(0); GenericResource gr = list.get(0);
log.debug("updating ApplicationProfile for " + gr.profile().name()); log.debug("updating ApplicationProfile for " + gr.profile().name());
@ -827,12 +842,12 @@ public class VREDeployerServiceImpl extends RemoteServiceServlet implements Vre
elem.appendChild(fragmentNode); elem.appendChild(fragmentNode);
} catch (Exception e) { } catch (Exception e) {
//in case no xml is entered, just text //in case no xml is entered, just text
log.error("errore"); log.error("error");
} }
RegistryPublisher rp=RegistryPublisherFactory.create(); RegistryPublisher rp=RegistryPublisherFactory.create();
rp.update(gr); rp.update(gr);
ScopeProvider.instance.set(currScope); ScopeProvider.instance.set(currScope);
return true;
} }
@ -1213,7 +1228,7 @@ public class VREDeployerServiceImpl extends RemoteServiceServlet implements Vre
//however the VRE-Designer and the VRE-Manager persons of the VRE could be different and need to be created too //however the VRE-Designer and the VRE-Manager persons of the VRE could be different and need to be created too
UserManager uman = new LiferayUserManager(); UserManager uman = new LiferayUserManager();
//if the manager is not the one who triggered the creation //if the manager is not the one who triggered the creation
if (manager.compareTo(getASLSession().getUsername()) != 0) { if (manager.compareTo(getASLSession().getUsername()) != 0) {

View File

@ -10,12 +10,9 @@
<!-- <inherits name='com.google.gwt.user.theme.chrome.Chrome'/> --> <!-- <inherits name='com.google.gwt.user.theme.chrome.Chrome'/> -->
<!-- <inherits name='com.google.gwt.user.theme.dark.Dark'/> --> <!-- <inherits name='com.google.gwt.user.theme.dark.Dark'/> -->
<!-- To Comment out <set-property name="user.agent" value="gecko1_8,safari" />
<set-property name="user.agent" value="gecko1_8" />
-->
<!-- Other module inherits -->
<inherits name='com.extjs.gxt.ui.GXT' /> <inherits name='com.extjs.gxt.ui.GXT' />
<inherits name='com.extjs.gxt.themes.Themes' /> <inherits name='com.extjs.gxt.themes.Themes' />