AnsweredAssumed Answered

Document Details View - Properties Tab

Question asked by stephenl on Aug 26, 2015
Hi,

I've been trying to find out why I'm seeing different panel layouts for a newly created node based on whether or not I create the node. The key difference is when I supply '<form submission-url="/modeltest/{documentName}">' webscript to create and populate the node (including adding the association manually).
I am using a 'Create Content' drop down menu which launches the form defined below (share-config-custom.xml), if I exclude the submission-url then all seems fine. Node created, document-details-panel contains the node name & the association which I entered in the form and the association is hyperlinked to the folder that was selected.

If I supply the submission-url webscript, the form is displayed, I can enter the same details as before, when I click the 'Create' button my webscript is launched. My webscript creates a node of my custom type, adds an association, sets the new noderef as a return param so that the auto-navigation to the details view of the new node is displayed. However, the document-details-panel (properties) of the new node seems to display a different format of side panel (where the association is displayed slightly differently and is not hyperlinked).

Is there anyway to display the automatically displayed panel if I don't use a webscript to generate the node so that the associated file is hyperlinked? (I need the webscript to populate the file at creation time)

EDIT: image on the left is the result after I use my webscript & on the right is what happens if I use the form->Create button automatic process.

<strong>Custom model definition</strong>

<type name="elab-em:modeltest">
            <title>Someco Document</title>
            <parent>cm:content</parent>
            <associations>
              <association name="elab-em:relatedDocuments">
                    <title>Related Documents</title>
                    <source>
                        <mandatory>false</mandatory>
                        <many>true</many>
                    </source>
                    <target>
                        <class>cm:folder</class>
                        <mandatory>true</mandatory>
                        <many>false</many>
                   
                    </target>
                </association>  
            </associations>
       <!–       <mandatory-aspects>
                <aspect>cm:generalclassifiable</aspect>
            </mandatory-aspects> –>
        </type>


<strong>share-config-custom.xml</strong>

<config evaluator="model-type" condition="elab-em:modeltest">
               <forms>
                       <form submission-url="/modeltest/{documentName}">
                               <field-visibility>
                                      <show id="cm:name" />
                                      <show id="elab-em:relatedDocuments" />
                               </field-visibility>
                               <appearance>
                                  <field id="elab-em:relatedDocuments" label="Code Folder">
                              <control>
                              <control-param name="displayMode">items</control-param>
                              <control-param name="showTargetLink">true</control-param>
                              <control-param name="forceEditable">false</control-param>
                              </control>
                        </field>
                               </appearance>
                       </form>
               </forms>
        </config>
       
        <config evaluator="node-type" condition="elab-em:modeltest">
               <forms>
                       <form>
                               <field-visibility>
                                      <show id="cm:name" />
                                      <show id="elab-em:relatedDocuments" />
                               </field-visibility>
                               <appearance>
                                     <field id="elab-em:relatedDocuments" label="Code Folder" read-only="true">
                              <control>
                              <control-param name="displayMode">items</control-param>
                              <control-param name="showTargetLink">true</control-param>
                              <control-param name="forceEditable">false</control-param>
                              </control>
                        </field>
                               </appearance>                 
                       </form>
               </forms>
        </config>


<strong>section of Java webscript</strong>

Map<QName, Serializable> props = new HashMap<QName, Serializable>(1);
props.put(ContentModel.PROP_NAME, filename); 

QName nodeType = QName.createQName("http://www.chi.man.ac.uk/exemanager_model/content/1.0", "modeltest");
             
// use the node service to create a new node
NodeRef node = this.nodeService.createNode(
      new NodeRef(destFolder),
           ContentModel.ASSOC_CONTAINS,
          QName.createQName(/*NamespaceService.CONTENT_MODEL_1_0_URI*/"http://www.chi.man.ac.uk/exemanager_model/content/1.0", filename),
                                    nodeType,
                                    props).getChildRef();
               
              
               
      QName oneMany = QName.createQName("http://www.chi.man.ac.uk/exemanager_model/content/1.0", "relatedDocuments");
             
              
      nodeService.createAssociation(node, new NodeRef(codeFolder), oneMany);


res.getWriter().write("{\"persistedObject\": \"" + nodeRef + "\"}");



[SOLVED] Looks like a mvn clean of both share and the repo solved this, all I did this morning was to remove some dead code, rename a webscript & clean everything ready to submit into our repo. Now doesn't display what seems to be the default UI layout instead of my updated one defined via the model & share evaluator.

Attachments

Outcomes