diff --git a/.classpath b/.classpath
index 768d24e..58ffa9f 100644
--- a/.classpath
+++ b/.classpath
@@ -1,27 +1,13 @@
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
+
+
+
-
+
diff --git a/.project b/.project
index 7060748..017948d 100644
--- a/.project
+++ b/.project
@@ -31,12 +31,12 @@
- org.eclipse.m2e.core.maven2Builder
+ org.eclipse.wst.validation.validationbuilder
- org.eclipse.wst.validation.validationbuilder
+ org.eclipse.m2e.core.maven2Builder
diff --git a/.settings/com.google.gwt.eclipse.core.prefs b/.settings/com.google.gwt.eclipse.core.prefs
index b6f4d0c..9898e9b 100644
--- a/.settings/com.google.gwt.eclipse.core.prefs
+++ b/.settings/com.google.gwt.eclipse.core.prefs
@@ -1,5 +1,4 @@
-#Fri Dec 28 17:26:46 CET 2012
eclipse.preferences.version=1
entryPointModules=
-filesCopiedToWebInfLib=
+filesCopiedToWebInfLib=gwt-servlet.jar
gwtCompileSettings=PGd3dC1jb21waWxlLXNldHRpbmdzPjxsb2ctbGV2ZWw+SU5GTzwvbG9nLWxldmVsPjxvdXRwdXQtc3R5bGU+T0JGVVNDQVRFRDwvb3V0cHV0LXN0eWxlPjxleHRyYS1hcmdzPjwhW0NEQVRBW11dPjwvZXh0cmEtYXJncz48dm0tYXJncz48IVtDREFUQVstWG14NTEybV1dPjwvdm0tYXJncz48ZW50cnktcG9pbnQtbW9kdWxlPm9yZy5nY3ViZS5yZXNvdXJjZW1hbmFnZW1lbnQuc3VwcG9ydC5SZXNvdXJjZV9zdXBwb3J0PC9lbnRyeS1wb2ludC1tb2R1bGU+PC9nd3QtY29tcGlsZS1zZXR0aW5ncz4\=
diff --git a/.settings/org.eclipse.core.resources.prefs b/.settings/org.eclipse.core.resources.prefs
index eb22c70..f9fe345 100644
--- a/.settings/org.eclipse.core.resources.prefs
+++ b/.settings/org.eclipse.core.resources.prefs
@@ -1,4 +1,4 @@
-#Wed Dec 19 12:49:25 CET 2012
eclipse.preferences.version=1
encoding//src/main/java=UTF-8
+encoding//src/test/java=UTF-8
encoding/=UTF-8
diff --git a/src/main/java/org/gcube/resourcemanagement/support/server/gcube/ISClientRequester.java b/src/main/java/org/gcube/resourcemanagement/support/server/gcube/ISClientRequester.java
index e327432..2fd15cf 100644
--- a/src/main/java/org/gcube/resourcemanagement/support/server/gcube/ISClientRequester.java
+++ b/src/main/java/org/gcube/resourcemanagement/support/server/gcube/ISClientRequester.java
@@ -70,7 +70,7 @@ import org.w3c.dom.NodeList;
*/
public class ISClientRequester {
static GCUBEClientLog _log = new GCUBEClientLog(ISClientRequester.class);
-
+
private static final ISQueryCache CACHE = new ISQueryCache();
private static final String LOG_PREFIX = "[ISCLIENT-REQS]";
@@ -500,7 +500,6 @@ public class ISClientRequester {
}
List results = client.execute(isQuery, queryScope);
- List retval = new Vector();
//ServerConsole.trace(LOG_PREFIX, "Retrieved (" + retval.size() + ") Resource for ID: " + resID);
@@ -531,9 +530,10 @@ public class ISClientRequester {
Map retval = new HashMap();
gonext: for (XMLResult plugin : results) {
- //System.out.println(plugin.toString());
+
try {
for (String entry : plugin.evaluate("/CMPlugins/Plugin/Entry")) {
+
Document doc = ScopeManager.getDocumentGivenXML(entry);
String name = doc.getElementsByTagName("name").item(0).getFirstChild().getNodeValue();
_log.trace("[LOAD-PLUGIN] found: *** name " + name);
@@ -635,9 +635,10 @@ public class ISClientRequester {
HashMap> retval = new HashMap>();
gonext: for (XMLResult plugin : results) {
- //System.out.println(plugin.toString());
- try {
+ try {
for (String entry : plugin.evaluate("/TMPlugins/Plugin/Entry")) {
+ String requestName = null;
+ boolean foundRequest = false;
Document doc = ScopeManager.getDocumentGivenXML(entry);
String name = doc.getElementsByTagName("name").item(0).getFirstChild().getNodeValue();
_log.trace("[LOAD-PLUGIN] found: *** name " + name);
@@ -655,6 +656,7 @@ public class ISClientRequester {
NodeList params = doc.getElementsByTagName("param");
ArrayList formFields = new ArrayList();
+
for (int i = 0; i < params.getLength(); i++) {
NodeList paramTree = params.item(i).getChildNodes();
@@ -664,22 +666,31 @@ public class ISClientRequester {
for (int j = 0; j < paramTree.getLength(); j++) {
if (paramTree.item(j).getNodeName().equals("param-name")) {
paramName = paramTree.item(j).getFirstChild().getNodeValue();
+
if (paramName.compareTo("requestSample") == 0) {
foundSample = true;
+ foundRequest = true;
}
}
if (paramTree.item(j).getNodeName().equals("param-definition") && foundSample) {
xmlToParse = paramTree.item(j).getFirstChild().getNodeValue();
xmlToParse = xmlToParse.replaceAll("<", "<");
xmlToParse = xmlToParse.replaceAll(">", "<");
- //System.out.println("toParse:" + xmlToParse);
- foundSample = false;
+ foundSample = false;
+
+ requestName = getRequestName(xmlToParse);
+
formFields = getPluginFormFromXml(xmlToParse);
}
-
}
+// if (params.getLength()>1)
+ retval.put(name + ":" + requestName, formFields);
+
}
+ if (foundRequest == false){
retval.put(name, formFields);
+ }
+
}
} catch (RuntimeException e) {
continue gonext;
@@ -688,6 +699,21 @@ public class ISClientRequester {
return retval;
}
+
+ /**
+ * get Request Name
+ *
+ *
+ * @param xmlToParse
+ * @return the list
+ */
+ private static String getRequestName(String xmlToParse) {
+ Document doc = ScopeManager.getDocumentGivenXML(xmlToParse);
+
+ return doc.getDocumentElement().getNodeName();
+
+ }
+
/**
* parses the following and return the list to generate the form automatically
*
@@ -708,7 +734,9 @@ public class ISClientRequester {
private static ArrayList getPluginFormFromXml(String xmlToParse) {
ArrayList toReturn = new ArrayList();
Document doc = ScopeManager.getDocumentGivenXML(xmlToParse);
- Node root = doc.getElementsByTagName("speciesRequest").item(0);
+ // Node root = doc.getElementsByTagName("request").item(0);
+
+ Node root = doc.getDocumentElement();
NodeList children = root.getChildNodes();
for (int i = 0; i < children.getLength(); i++) {
String label = children.item(i).getNodeName();
diff --git a/src/main/java/org/gcube/resourcemanagement/support/shared/plugins/GenericResourcePlugin.java b/src/main/java/org/gcube/resourcemanagement/support/shared/plugins/GenericResourcePlugin.java
index 3ac3b32..6aaa333 100644
--- a/src/main/java/org/gcube/resourcemanagement/support/shared/plugins/GenericResourcePlugin.java
+++ b/src/main/java/org/gcube/resourcemanagement/support/shared/plugins/GenericResourcePlugin.java
@@ -123,7 +123,8 @@ public class GenericResourcePlugin implements Serializable, IsSerializable {
private String description = null;
private String type = null;
private List params = new Vector();
- private String namespace = "xmlns:ns4=\"http://gcube-system.org/namespaces/contentmanagement/contentmanager/oaiplugin\"";
+// private String namespace = null;
+ private String namespace = "xmlns:ns4=\"http://gcube-system.org/namespaces/data/oaiplugin\"";
/**
diff --git a/war/WEB-INF/lib/gwt-servlet.jar b/war/WEB-INF/lib/gwt-servlet.jar
new file mode 100644
index 0000000..b3c62e4
Binary files /dev/null and b/war/WEB-INF/lib/gwt-servlet.jar differ