cancel
Showing results for 
Search instead for 
Did you mean: 

Association control and startLocation

orichaud
Champ in-the-making
Champ in-the-making
Hi,
In my form, I have a field which refers to an association. When using the picker, I I need to select documents in a specific space and for this I need to change the parentNodeRef parameter.
I read the wiki (see http://wiki.alfresco.com/wiki/Forms#association.ftl and found that I can define the startLocation parameter. I passed an XPath expression. But it had no effect.  Unfortunately, looking at association.ftl, this is hardcoded to "alfreco://company/home".

Finally, I have started to provide a custom form as described here: http://wiki.alfresco.com/wiki/Forms_Examples#Providing_A_Custom_Form_Template. I copied association.ftl and tried to change the parentNodeRef. But I was not successful and an Xpath expression like
/app:company_home/st:sites/cm:acme
led to an error.
It seems that workspace://<ANY NODE REF> works, but I cannot hard code the reference and must rely on a logical name, thus an expression. I wonder which service I could invoke to convert the xpath expression into a valid node reference.

Any help would be appreciated.

Regards.

Olivier
2 REPLIES 2

mikeh
Star Contributor
Star Contributor
…led to an error.
It would perhaps be useful if you described the error in more detail.

Thanks,
Mike

orichaud
Champ in-the-making
Champ in-the-making
In my share-config-custom.xml, I define the appearance of the field:


   <config evaluator="node-type" condition="ahp:photo">
      <forms>
         <form>

            <appearance>

               <field id="ahp:copyrightDocument" set="copyright-set">
                  <control template="/org/alfresco/components/form/controls/ahp_association.ftl">
                     <control-param name="showTargetLink">true</control-param>
                     <!–<control-param name="startLocation">alfresco://company/home/sites</control-param>–>
                     <control-param name="startLocation">/app:company_home/st:sites/cm:acme</control-param>
                  </control>
               </field>


The ahp_association?ftl control is a simple modification of association.ftl where I modified the parentNodeRef paramaters:

parentNodeRef: "${field.control.params.startLocation}",

Now, when I choose the edition mode and want to edit the association, I can see in the selector:

org.alfresco.error.AlfrescoRuntimeException: 10150001 Failed to execute search: ID:app\:company_home\://st\:sites/cm\:acme

With firebug, I can see that
http://localhost:8080/share/proxy/alfresco/api/forms/picker/node//app:company_home/st:sites/cm:acme/...
got the following response:

{
    "status" :
  {
    "code" : 500,
    "name" : "Internal Error",
    "description" : "An error inside the HTTP server which prevented it from fulfilling the request."
  }, 
 
  "message" : "org.alfresco.error.AlfrescoRuntimeException: 10150001 Failed to execute search: ID:app\\:company_home\\:\/\/st\\:sites\/cm\\:acme", 
  "exception" : "",
 
  "callstack" :
  [
       
  ],
 
  "server" : "Community v3.3.0 (g 2860) schema 4,100",
  "time" : "Nov 15, 2010 1:04:11 PM"
}