Make user select categories after adding content

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
11-22-2006 09:58 AM
- Labels:
-
Archive

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
11-23-2006 05:27 PM

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
12-07-2006 05:26 PM
You'll need to override the AddContentDialog bean and return a different outcome. Have a look at doPostCommitProcessing() for an example.

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
12-11-2006 04:59 AM
If you are launching the editCategory dialog from within the AddContent dialog i.e. before pressing finish, the Node object will not be created yet, which is more than likely the cause of the issue you are seeing.
Another way you could achieve the same thing is to setup the categories aspect in your bean when the node is created and then have the property sheet that shows up after adding content be configured to show categories?

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
12-11-2006 04:55 PM
So the node does not get created until the user selects the "Finish" button in the dialog? I am calling the "editCategories" dialog from my own "AddContentDialog" extended class.
I'm interested in pursuing this solution:
Another way you could achieve the same thing is to setup the categories aspect in your bean when the node is created and then have the property sheet that shows up after adding content be configured to show categories?
but I don't completely follow. Any chance you can expand?
Thanks!

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
12-12-2006 03:23 PM
Correct, the node is created during the processing of the Finish button, so if you call the editCategories dialog before the node will be null.
As for the other solution….in your finishImpl method you could add the "generalclassifiable" aspect to the node you created. This will add a cm:categories property to the new node.
Then in the property sheet configuration for your type (or for the standard content type) you could add the following:
<show-property name="categories" />
If you just use the standard Add Content dialog and allow it to show the set properties dilaog after Finish has been pressed you should see an entry titled "Categories".

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
12-19-2006 02:12 PM
Thanks Gavin!

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
12-19-2006 04:18 PM
So in this code in the JSP:
myAddContentDialog dialog = (myAddContentDialog)FacesHelper.getManagedBean(FacesContext.getCurrentInstance(), "myAddContentDialog");if (dialog != null && dialog.getFileName() != null) { fileUploaded = true;}
fileUploaded is always returning true after I upload a file. So I can't upload another one. In my finishImpl(), I'm calling saveContent then returning "browse".
Any ideas would be greatly appreciated.

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
01-03-2007 09:16 AM

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
01-08-2007 04:55 PM
Secondly, yes I have an idea!
In browse.jsp there is the line below (line 130):
<a:actionLink value="#{msg.add_content}" image="/images/icons/add.gif" padding="2" action="addContent" actionListener="#{AddContentDialog.start}" style="white-space:nowrap" id="link3" />
I'm guessing that you have not changed the AddContentDialog reference here to your dialog bean i.e. "myAddContentDialog". If this is the case the fileName property in your bean will not get reset and have the side effect you mention.
Also you shouldn't need to duplicate the code from AddContentDialog, just extend the class and override finishImpl() i.e.
@Overrideprotected String finishImpl(FacesContext context, String outcome) throws Exception{ super.finishImpl(context, outcome); // your code here return "browse";}
Hope that helps!
