load : function(){
this.getView().setViewTitle("Execution Launcher");
this.addListener("changeRegisteredTopics", function(event){
- this._refreshTopicsSubscriptions(event);
+ //this._refreshTopicsSubscriptions(event);
this._feedSelector(event);
}, this);
var reloadHandler = function(message){
formObject.pane.add(entryPane);
},
+ /*
_refreshTopicsSubscriptions : function(changeTopicsEvent){
var oldTopics = changeTopicsEvent.getOldData() || {};
var newTopics = changeTopicsEvent.getData();
}
}
},
+ */
_feedSelector : function(changeTopicsEvent){
var topics = changeTopicsEvent.getData();
}
},
+ /*
_addAmqListener: function(uuid){
this._amqClient.addListener("slcExec", "topic://agent."+uuid+".newExecution", function(response){
var message = org.argeo.ria.util.Element.selectSingleNode(response, "slc:slc-execution");
_removeAmqListener : function(uuid){
this._amqClient.removeListener("slcExec", "topic://agent."+uuid+".newExecution");
},
+ */
_prepareSlcExecutionMessage : function(crtPartId, slcExec, fields, hiddenFields, freeFields){
if(crtPartId == "standard"){
}
this._prepareSlcExecutionMessage(crtPartId, slcExec, fields, hiddenFields, freeFields);
-
- var destination = "topic://agent."+currentUuid+".newExecution";
- this._amqClient.sendMessage(destination, slcExec.toXml());
+
+ this._amqClient.sendMessage(
+ "topic://agent.newExecution",
+ slcExec.toXml(),
+ {"slc-agentId":currentUuid}
+ );
// Force logs refresh right now!
qx.event.Timer.once(function(){
var command = org.argeo.ria.event.CommandsManager.getInstance().getCommandById("reloadlogs");
REMOVE_RESULT_FROM_COLL_SERVICE : "removeResultFromCollection.service",\r
ADD_RESULT_TO_COLL_SERVICE : "addResultToCollection.service",\r
LIST_COLLECTIONS_SERVICE : "listCollectionRefs.service",\r
+ COPY_COLLECTION_TO_COLL_SERVICE : "copyCollectionToCollection.service",\r
LIST_RESULTS_SERVICE : "listResultAttributes.service",\r
GET_RESULT_SERVICE : "getResult.service",\r
LIST_SLCEXEC_SERVICE : "listSlcExecutions.service",\r
return request;\r
},\r
\r
+ /**\r
+ * Remove a set of results from a collection. Either filtered by a given pattern, or the whole collection.\r
+ * @param collectionId {String} The id of the collection\r
+ * @param patternAttribute {String} An optional attribute name on which to filter\r
+ * @param patternValue {String} The pattern to use for filtering a subset of result\r
+ * @param fireReloadEventType {String} Whether query should trigger a ReloadEvent\r
+ * @param iLoadStatusables {org.argeo.ria.components.ILoadStatusables[]} Gui parts to update\r
+ * @return {qx.io.remote.Request} The Request object\r
+ */\r
+ getRemoveFromCollectionService : function(collectionId, patternAttribute, patternValue, fireReloadEventType, iLoadStatusables){\r
+ var request = org.argeo.slc.ria.SlcApi.getServiceRequest(\r
+ org.argeo.slc.ria.SlcApi.REMOVE_RESULT_FROM_COLL_SERVICE, \r
+ fireReloadEventType, \r
+ iLoadStatusables\r
+ );\r
+ request.setParameter("collectionId", collectionId);\r
+ if(patternAttribute && patternValue){\r
+ request.setParameter("attrName", patternAttribute);\r
+ request.setParameter("attrPattern", patternValue);\r
+ }\r
+ return request;\r
+ },\r
+ \r
/**\r
* Add a result to a given collection\r
* @param collectionId {String} Id of the destination collection\r
);\r
},\r
\r
+ /**\r
+ * Copy a whole collection or a subset of it to another collection. If a new id is provided for the target, it will be created.\r
+ * @param sourceCollectionId {String} The current collection from which to copy\r
+ * @param targetCollectionId {String} The target collection. If unknown, it will be created.\r
+ * @param patternAttribute {String} An optional attribute on which a filter can be applied to create a subset.\r
+ * @param patternValue {String} The associated pattern to filter on the atttribute's value.\r
+ * @param fireReloadEventType {String} Whether query should trigger a ReloadEvent\r
+ * @param iLoadStatusables {org.argeo.ria.components.ILoadStatusables[]} Gui parts to update\r
+ * @return {qx.io.remote.Request} The request object\r
+ */\r
+ getCopyCollectionService : function(sourceCollectionId, targetCollectionId, patternAttribute, patternValue, fireReloadEventType, iLoadStatusables){\r
+ var request = org.argeo.slc.ria.SlcApi.getServiceRequest(\r
+ org.argeo.slc.ria.SlcApi.COPY_COLLECTION_TO_COLL_SERVICE, \r
+ fireReloadEventType, \r
+ iLoadStatusables \r
+ );\r
+ request.setParameter("sourceCollectionId", sourceCollectionId);\r
+ request.setParameter("targetCollectionId", targetCollectionId);\r
+ if(patternAttribute && patternValue){\r
+ request.setParameter("attrName", patternAttribute);\r
+ request.setParameter("attrPattern", patternValue);\r
+ }\r
+ return request;\r
+ },\r
+ \r
/**\r
* List all results or results of a given collection \r
* @param collectionId {String} Id of the collection to load\r
},\r
members : {\r
// The URI of the MessageListenerServlet\r
- uri : '../amq', \r
+ uri : '../amqMessage', \r
\r
// Polling. Set to true (default) if waiting poll for messages is needed\r
poll : true,\r
\r
// Send a JMS message to a destination (eg topic://MY.TOPIC). Message should be xml or encoded\r
// xml content.\r
- sendMessage : function(destination, message) {\r
- this._sendMessage(destination, message, 'send');\r
+ sendMessage : function(destination, message, properties) {\r
+ this._sendMessage(destination, message, 'send', properties);\r
},\r
\r
// Listen on a channel or topic. handler must be a function taking a message arguement\r
this._sendMessage(destination, id, 'unlisten');\r
},\r
\r
- _sendMessage : function(destination, message, type) {\r
+ _sendMessage : function(destination, message, type, properties) {\r
var req = new qx.io.remote.Request(this.uri, "POST", "text/plain");\r
req.setParameter("destination", destination);\r
req.setParameter("message", message);\r
req.setParameter("type", type);\r
+ if(properties){\r
+ for(var key in properties){\r
+ req.setParameter(key, properties[key]);\r
+ }\r
+ }\r
//req.addListener("completed", this.endBatch, this);\r
req.send();\r
},\r