cancel
Showing results for 
Search instead for 
Did you mean: 

Custom Dialog in WCM

tjholmes
Champ in-the-making
Champ in-the-making
I am trying to create a custom dialog under WCM as the title implies.   The SDK does have a sample for creating a custom dialog for Alfresco, and not the WCM.   I'd like to get an example for this.

I want to add the action to the webapp/folder list of actions under the Web-Project.  For example, they have "View Details", Create Webapp Folder,
Edit Web Project Settings, etc. and I want to add to this list.

There is a filed called: web-client-config-custom.xml, but I think I also need to update the other following files:
tomcat/webapps/alfresco/WEB-INF/classes/alfresco/messages/webclient.properties
tomcat/webapps/alfresco/WEB-INF/classes/alfresco/web-client-config-dialogs.xml
tomcat/webapps/alfresco/WEB-INF/classes/alfresco/web-client-config-wcm-actions.xml

Lastly, what about configuring the file: web-client-config-custom.xml
There are parameters like: <action-listener>#{BrowseBean.setupSpaceAction}</action-listener>
Which one do I use, and where are these defined.   When I look a wcm JSP pages, there are other parameters.
In the same file, there are parameters like:
<param name="id">#{actionContext.id}</param>
Where are these defined?   Which one do I use?

I think the documentation in th Wiki for the SDK needs to be way more extensive.

Thanks!
7 REPLIES 7

gavinc
Champ in-the-making
Champ in-the-making
Hi,

All the web-client-config-*.xml files get combined into one 'config' so you only need to change web-client-config-custom.xml. Basically you override and/or add to this file.

Therefore to add your action to one of the lists of actions you would override the relevant action-group config. For example to add your action to the menu you mention you would do the following:


<config>
  <actions>
    <action-group id="avm_create_menu">
      <show-link>false</show-link>
      <action idref="your_action" />
    </action-group>
  </actions>
</config>

As for what your action should look like and what it needs to setup depends on what you are trying to achieve. The parameters are all provided at runtime, but it depends where your action is invoked from as to what context it will get. If you can explain what you want your dialog to do we can go from there.

tjholmes
Champ in-the-making
Champ in-the-making
What I am trying to do is create a List Manager to other content items in Alfresco.   These lists are for a Web-Site (or web-project) and will be saved as a content item.  

The "List" content type will have 1-n relationships to other content items in the repository.   And will have to be sequenced 1-n.

So, the JSP page will have some fields to enter in like name and description of the web-site.  The web-site internal uuid will also be stored with this content.   We'll use the standard search to find content and add it to a list box.  We'll use UP and DOWN buttons to move the items in the list box to the way we want, and then when we file these associations, we also keep track of it's sequence in the list.

That's my ultimate goal.  Is this already built-in for Alfresco or he WCM?
If not, I'll continue on with my development process.

Thanks!

gavinc
Champ in-the-making
Champ in-the-making
No, this isn't a built in feature so you will need to continue with your development.

It doesn't sound like you need any context information setup so your action definition should be fairly straightforward i.e. you won't need to define an action listener or any params.

If you are creating objects at the web project level you should be able to get everything you need from AvmBrowseBean from within your dialog. Have a look at the existing AVM dialog implementatons for examples.

kvc
Champ in-the-making
Champ in-the-making
As a quick follow-up …

When you are done with this custom work, please share with others by opening a forge project!  This sounds useful; should we see others take interest in it, we'd be keen to evaluate inclusion in future distributions. 

Let us know how this goes.  Cheers.

Kevin

vijay_alfresco
Champ in-the-making
Champ in-the-making
Hi,

How far you got this to work, please upload or share your code

Thanks,
Vijay

tjholmes
Champ in-the-making
Champ in-the-making
We decided against the custom dialog for now.    We were talked into doing web-forms because all our metadata is versioned in the XML file and outside of WCM, the metadata is not version (but it should be IMHO).

So, we've decided to create a "List" in an XSD Web-Form, and the XML file it creates would be perfect for that.     However … when it comes to building a list with pointers to existing WCM content we rand into a few issues:
1) node-dbid changes with every version
2) paths can change and then you're list is pointing to content that has been moved.
3) there is no uuid or guid that positively identifies a piece of WCM content.
This gets back to Link Management and the RoadMap of how Alfresco is going to handle missing links.

So, we're looking at creating our own aspect, and adding a GUID to our xform with a new widget … but then you have to modify their xforms.js to add your own widget and then modify the XML file that contains the mapping.    I am not sure if custom widget creating is even possible right now.   If you update Alfresco files, then you have to worry about upgrades and your code breaking.

If we add our own GUID … then we can capture that GUID to an aspect … alledgedly when WCM content is moved to the staging sandbox in 2.1 … all the metadata is index so it can be lucene-searched … and we want to do that with a web-script.

Anyway, I've posted several messages on the forums about this stuff … and just waiting to hear back from some Alfresco engineers to my questions.

kvc
Champ in-the-making
Champ in-the-making
TJ:


Quick question:  were you looking to create this list to make it easy for a user to edit or delete existing content created via a web form?

In our December 2.2 release, next to the Create Content action, we add a Browse Content action.  This is a canned search to list all XMLs created using a web form.  That why, you can not only easily create new content, but also edit or delete.

You can see a sneak preview of this on our WCM page on our wiki.


Kevin