Tuesday, February 16, 2010

Using the Alfresco Share Forms Test Page

In the previous post we created a custom document type for the content model and defined a web form to display the content for the custom metadata within Alfresco Share.

Share 3.2 also has a cool little utility called the form test page.  The Alfresco wiki indicates that this page may be plugged into the Share Administration page as a module at some point in the future.  For now, you can see it here:


After checking in a document as the new custom type, you can go to the node browser in the Administration pages of the Alfresco explorer client and grab it's node path reference.

Using that path on the test form page, we can preview the form.

Now, we can play a bit with the tag for the form.  Consider the following changes to appearance (compared to the appearance tag definition of the form defined in yesterday's blog):

             <set id="builtin" appearance="fieldset" label="Built In" />
             <set id="custom" appearance="fieldset" label="Custom Data" />
             <set id="mandatory" parent="builtin" appearance="panel" label="Mandatory" />
             <set id="optional" parent="builtin" appearance="panel" label="Optional" />
             <field id="cm:name" set="mandatory" />
             <field id="cm:title" set="optional" />
             <field id="cm:description" set="optional" />
             <field id="mimetype" set="optional" />
             <field id="cm:author" set="optional" />
             <field id="size" set="optional" />
             <field id="cm:creator" set="optional" />
             <field id="cm:created" set="optional" />
             <field id="cm:modified" set="optional" />        
             <field id="cm:modifier" set="optional" />
             <field id="mm:relatedDocuments" label="Related Docs" set="custom"/>
             <field id="mm:freeText" label="More Information" set="custom"/>
             <field id="mm:color" label="Color" set="custom">
                <control template="controls/selectone.ftl">
                   <control-param name="options">Red,Orange,Yellow,Green,Blue,Indigo,Violet</control-param>

Here we separate the metadata into groups or 'sets'. For this example, we divide the metadata into two types: builtin and custom. And of the builtin fields, we further divide the fields into 'mandatory' or 'optional'. After making those changes (and restarting the server -- 'boo'), we're able to see the changes:

No comments:

Post a Comment