properties = getGcubeItemProperties(wsItem);
-
- if(properties!=null){
-
- if(properties.size()==0){
- logger.warn("Map of Gcube Item Properties is empty for item: "+wsItem.getId());
+
+ if (properties != null) {
+
+ if (properties.size() == 0) {
+ logger.warn("Map of Gcube Item Properties is empty for item: " + wsItem.getId());
return null;
}
-
+
String html = "";
-
+
for (String key : properties.keySet()) {
String value = properties.get(key);
- logger.trace("Getting property: ["+key+","+properties.get(key)+"]");
- html+=""+key+": ";
- html+="";
- html+=value;
- html+="
";
+ logger.trace("Getting property: [" + key + "," + properties.get(key) + "]");
+ html += "" + key + ": ";
+ html += "";
+ html += value;
+ html += "
";
}
-
- html+="
";
-
+
+ html += "";
+
return html;
- }else {
- logger.warn("Gcube Item Properties not found for item: "+wsItem.getId());
+ } else {
+ logger.warn("Gcube Item Properties not found for item: " + wsItem.getId());
return null;
}
}
-
/**
* Gets the gcube item properties.
*
@@ -807,10 +819,10 @@ public class StorageHubToWorkpaceConverter implements Serializable{
*/
public Map getGcubeItemProperties(WorkspaceItem wsItem) {
- if(wsItem instanceof org.gcube.common.storagehubwrapper.shared.tohl.items.GCubeItem){
+ if (wsItem instanceof org.gcube.common.storagehubwrapper.shared.tohl.items.GCubeItem) {
GCubeItem gItem = (GCubeItem) wsItem;
try {
- if(gItem.getProperties()!=null){
+ if (gItem.getProperties() != null) {
PropertyMap map = gItem.getProperty();
return toSimpleMap(map);
}
@@ -820,6 +832,75 @@ public class StorageHubToWorkpaceConverter implements Serializable{
}
}
return null;
-
+
+ }
+
+ /**********************************************************************************************************************************************
+ *
+ *
+ *
+ *
+ * TESTING MODE METHODS
+ *
+ *
+ *
+ *
+ ***********************************************************************************************************************************************/
+ protected static HashMap hashTestUser = null;
+
+ /**
+ * Used in test mode.
+ *
+ * @return the hash test users
+ */
+ public static HashMap getHashTestUsers() {
+
+ if (hashTestUser == null) {
+ hashTestUser = new HashMap();
+
+ // USERS
+ hashTestUser.put("federico.defaveri",
+ new InfoContactModel("federico.defaveri", "federico.defaveri", "Federico de Faveri", null, false));
+ hashTestUser.put("antonio.gioia",
+ new InfoContactModel("antonio.gioia", "antonio.gioia", "Antonio Gioia", null, false));
+ hashTestUser.put("fabio.sinibaldi",
+ new InfoContactModel("fabio.sinibaldi", "fabio.sinibaldi", "Fabio Sinibaldi", null, false));
+ hashTestUser.put("pasquale.pagano",
+ new InfoContactModel("pasquale.pagano", "pasquale.pagano", "Pasquale Pagano", null, false));
+ hashTestUser.put("valentina.marioli",
+ new InfoContactModel("valentina.marioli", "valentina.marioli", "Valentina Marioli", null, false));
+ hashTestUser.put("roberto.cirillo",
+ new InfoContactModel("roberto.cirillo", "roberto.cirillo", "Roberto Cirillo", null, false));
+ hashTestUser.put("francesco.mangiacrapa", new InfoContactModel("francesco.mangiacrapa",
+ "francesco.mangiacrapa", "Francesco Mangiacrapa", null, false));
+ hashTestUser.put("massimiliano.assante", new InfoContactModel("massimiliano.assante",
+ "massimiliano.assante", "Massimiliano Assante", null, false));
+
+ }
+
+ return hashTestUser;
}
+
+ public static List buildGxtInfoContactFromPortalLoginTestMode(List listPortalLogin) {
+
+ List listContact = new ArrayList();
+
+ for (String portalLogin : listPortalLogin)
+ listContact.add(getHashTestUsers().get(portalLogin));
+
+ return listContact;
+ }
+
+ /**********************************************************************************************************************************************
+ *
+ *
+ *
+ *
+ * END TESTING MODE
+ *
+ *
+ *
+ *
+ ***********************************************************************************************************************************************/
+
}