cancel
Showing results for 
Search instead for 
Did you mean: 

how to associate two types of web form content

glkev
Champ in-the-making
Champ in-the-making
How can I associate two different types of web form content?

Considering the following case:

1. I have defined an article content type, and I can use web form to enter the contents there.
2. I have a press release content type, and inside the press release, it might need to reference zero or many articles I have created in 1). Are there any widget types of interface that I can use to browse (quickly/simply) to find out the desired articles (without having to key in unique key in a text field, considering I have tons of articles). Keep in mind a press release can have 0 or more articles.

Thanks,

glkev
4 REPLIES 4

zaizi
Champ in-the-making
Champ in-the-making
You can use the file picker widget to allow your users to search for and select Articles. You can configure custom annotations to customise and restrict what content the widget can select. Details: http://wiki.alfresco.com/wiki/Forms_Authoring_Guide#XForm_User_interface_customization.

To define your custom file picker widget, take a look at the examples in web-client-config-wcm.xml and add your own. You can then reference this specific widget in your forms xsd. For convenience I've pasted two example below. First one can be used to restrict the items to the folder the articles will be created in. The other can restrict items to a saved search.

<widget xforms-type="xf:upload" 
                   javascript-class-name="alfresco.xforms.FilePicker">
             <param name="selectable_types">wcm:avmcontent,wcm:avmfolder</param>
           </widget>
           <widget xforms-type="xf:upload"
                   appearance="folder_restricted_file_picker"
                   javascript-class-name="alfresco.xforms.FilePicker">
             <param name="selectable_types">wcm:avmcontent,wcm:avmfolder</param>
             <!–
                Uncomment parameter and set to relative path of AVM folder
                to restrict file picker to.
               
             <param name="folder_restriction">some-relative-folder-path</param>
             –>
           </widget>
           <widget xforms-type="xf:upload"
                   appearance="search_restricted_file_picker"
                   javascript-class-name="alfresco.xforms.FilePicker">
             <!–
                Uncomment parameter and set to name of a configured
                search. The file picker will be restricted to the results
                of this configured search
               
             <param name="config_search_name">some-configured-search-name</param>
             –>
           </widget>

glkev
Champ in-the-making
Champ in-the-making
I assume there is a way to provide multiple file selector widget on the fly (an "add more file button" would add in more file selector widget), and is there a way to sort the associated files?

In Vignette content management server, we can associate multiple types of content together through relator widget, and for each association, we could specify some association attributes. I am not sure whether alfresco can do that, or at least the first step is to find out how to do the association.

Any suggestion is welcome.

glkev

zaizi
Champ in-the-making
Champ in-the-making
Yes. If you specify a maxOccurs value for a widget, it is rendered with a '+', so users can dynamically add widgets of that type.

You can try out the tutorial at http://wiki.alfresco.com/wiki/WSF to get to grips with creating a site using Alfresco WCM.

glkev
Champ in-the-making
Champ in-the-making
Very good. Thank you.

glkev