AnsweredAssumed Answered

Show custom properties when creating space

Question asked by konsultex on Jul 15, 2011
Latest reply on Aug 28, 2013 by sindhu
I'm using Alfresco Explorer 3.4d for this project. I have a need to create project spaces (folders) inside a particular space with the requirement that the folder names have to be standardized by prefixing the project location code to the folder name.  I use the advanced space wizard to select a model which has a bunch of rules and permissions already set up. What the user would like to do while adding the folder is to select the location from a list. In order to do this I created an aspect ("custom:projects") with property "custom:location" and I already added it to the template. The property "custom:location" is a list of the simple LIST type. In the destination space where the new project folder has to be added I have a rule that runs a Javascript script to rename the folder accordingly and also to set additional permissions. So for example if I add a folder which I name as "router projetct" and I select location "SP", the final name of the folder would be "SP - router project". This works perfectly when the folder is updated, that is when I change the location.

My problem is that even though the template has the aspect and it's properties are visible in the template detail page, when I get to the add aspect screen where you can put in the name, title and description I don't see "custom:location" for input. I would like to see the location property BEFORE the space is saved so that it gets renamed correctly the first tiem. I tried to put this in web-client-config-custom.xml as follows but it didn't help


   <config evaluator="node-type" condition="cm:folder"  replace="true">
      <property-sheet>
         <separator name="sepFolder" display-label="Project Details" component-generator="HeaderSeparatorGenerator" />
         <show-property name="custom:location"/>
      </property-sheet>
   </config>

Since this didn't work I also created a custom folder type like this:

customModel.xml

<constraints>
   <constraint name="custom:locationlist" type="LIST">
      <parameter name="allowedValues">
         <list>
            <value>SP</value>
            <value>RJ</value>
            <value>BH</value>
         </list>
      </parameter>
   </constraint>
</constraints>   

<type name="custom:projectFolder">
    <title>Project Folder</title>
    <parent>cm:folder</parent>
    <properties>
       <property name="custom:location">
          <type>d:text</type>
          <constraints>
      <constraint ref="custom:locationlist"/>
     </constraints>
       </property>
    </properties>
</type>

web-client-config-custom.xml (I left the forum gif image)

   <config evaluator="string-compare" condition="Space Wizards">
      <folder-types>
         <type name="custom:projectFolder" icon="/images/icons/forums.gif" description-id="forums_desc" />
      </folder-types>
   </config>

   <config evaluator="string-compare" condition="Content Wizards">
   <folder-types>
      <type name="custom:projectFolder" />
   </folder-types>
   </config>

   <config evaluator="node-type" condition="custom:projectFolder" replace="true">
      <property-sheet>
         <separator name="sepFolder" display-label="Location" component-generator="HeaderSeparatorGenerator" />
         <show-property name="custom:location"/>
      </property-sheet>
   </config>

If I create a new space using the advanced space wizard "from scratch" option I can choose my custom type but the location field only shows up in the folder detail page, not while I'm creating the folder.

I hope that this can be configured one way or another. Can someone point me to the right syntax or extension xml files? Or does this problem have to be solved some other way?

Thanks.

Outcomes