alfresco - Is there way to get attachments details before starting the workflow? -


before start business process, select attachments. can many times, remove attachments , choose again.

i want display dynamic table information attachments.

for example, retrieve attachments details, use such code:

... var divwithanchors = yahoo.util.selector.query("#page_x002e_data-form_x002e_task-details_x0023_default_assoc_packageitems-cntrl")[0]; var anchors = divwithanchors.getelementsbytagname('a');  var attachments = new array(); for(var = 0; < anchors.length; i++) {     attachments[i] = anchors[i].href.split('=')[1]; } ... 

it gives me references nodes, example:

... workspace://spacesstore/c5a27463-c2aa-4c70-aca7-1f999d3ac76a workspace://spacesstore/29e9f035-403c-47b6-8421-624d584ff7eb workspace://spacesstore/712aaca2-9c90-4733-a690-bbf9bacb26e6 workspace://spacesstore/68893fde-ee7c-4ecb-a2df-d4953dc69439 ... 

then can ajax requests rest back-end (webscripts) , responses:

... for(var = 0; < attachments.length; i++) {     alfresco.util.ajax.jsonget(     ...     // parse json , fill table 

is correct way? i'm not sure id:

page_x002e_data-form_x002e_task-details_x0023_default_assoc_packageitems-cntrl 

is constant?.. can identifier changed?..

i grateful information. all.

in fact, these noderefs available in object selecteditems = {} , can obtained in method getaddeditems() (see object-finder.js):

...  /** * selected items. keeps list of selected items correct add button state. *  * @property selecteditems * @type object */ selecteditems: null,  ...  /** * returns items have been added current value * * @method getaddeditems * @return {array} */ getaddeditems: function objectfinder_getaddeditems() {     var addeditems = [],     currentitems = alfresco.util.arraytoobject(this.options.currentvalue.split(","));      (var item in this.selecteditems) {         if (this.selecteditems.hasownproperty(item)) {             if (!(item in currentitems)) {                 addeditems.push(item);             }         }     }      return addeditems; },  ... 

next, needed send these noderefs webscript , necessary properties using nodeservice service.


Comments

Popular posts from this blog

javascript - Clear button on addentry page doesn't work -

c# - Selenium Authentication Popup preventing driver close or quit -

tensorflow when input_data MNIST_data , zlib.error: Error -3 while decompressing: invalid block type -