Commit 04522420 authored by Gaston Dombiak's avatar Gaston Dombiak Committed by gato

Updated 'creation of collection nodes' based on latest spec. JM-901

git-svn-id: http://svn.igniterealtime.org/svn/repos/wildfire/trunk@6179 b35dd754-fafc-0310-a699-88a17e54d16e
parent 97af9360
...@@ -1039,7 +1039,7 @@ public class PubSubEngine { ...@@ -1039,7 +1039,7 @@ public class PubSubEngine {
LeafNode leafNode = (LeafNode) node; LeafNode leafNode = (LeafNode) node;
// Get list of items to send to the user // Get list of items to send to the user
boolean forceToIncludePayload = false; boolean forceToIncludePayload = false;
List<PublishedItem> items = null; List<PublishedItem> items;
String max_items = itemsElement.attributeValue("max_items"); String max_items = itemsElement.attributeValue("max_items");
int recentItems = 0; int recentItems = 0;
if (max_items != null) { if (max_items != null) {
...@@ -1125,6 +1125,7 @@ public class PubSubEngine { ...@@ -1125,6 +1125,7 @@ public class PubSubEngine {
} }
while (service.getNode(newNodeID) != null); while (service.getNode(newNodeID) != null);
} }
boolean collectionType = false;
// Check if user requested to configure the node (using a data form) // Check if user requested to configure the node (using a data form)
Element configureElement = childElement.element("configure"); Element configureElement = childElement.element("configure");
if (configureElement != null) { if (configureElement != null) {
...@@ -1156,6 +1157,14 @@ public class PubSubEngine { ...@@ -1156,6 +1157,14 @@ public class PubSubEngine {
} }
} }
} }
field = completedForm.getField("pubsub#node_type");
if (field != null) {
// Check if user requested to create a new collection node
List<String> values = field.getValues();
if (!values.isEmpty()) {
collectionType = "collection".equals(values.get(0));
}
}
} }
} }
// If no parent was defined then use the root collection node // If no parent was defined then use the root collection node
...@@ -1174,9 +1183,6 @@ public class PubSubEngine { ...@@ -1174,9 +1183,6 @@ public class PubSubEngine {
return; return;
} }
// Check if user requested to create a new collection node
boolean collectionType = "collection".equals(createElement.attributeValue("type"));
if (collectionType && !service.isCollectionNodesSupported()) { if (collectionType && !service.isCollectionNodesSupported()) {
// Cannot create a collection node since the service doesn't support it // Cannot create a collection node since the service doesn't support it
Element pubsubError = DocumentHelper.createElement( Element pubsubError = DocumentHelper.createElement(
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment