As we transition to the new Hyland Community, some post links may be temporarily disrupted as we finalize redirects. We apologize for the inconvenience and are working to resolve this as quickly as possible. Details.
You'll need to override the AddContentDialog bean and return a different outcome. Have a look at doPostCommitProcessing() for an example.
<show-property name="categories" />
myAddContentDialog dialog = (myAddContentDialog)FacesHelper.getManagedBean(FacesContext.getCurrentInstance(), "myAddContentDialog"); if (dialog != null && dialog.getFileName() != null) { fileUploaded = true; }
<a:actionLink value="#{msg.add_content}" image="/images/icons/add.gif" padding="2" action="addContent" actionListener="#{AddContentDialog.start}" style="white-space:nowrap" id="link3" />
@Override protected String finishImpl(FacesContext context, String outcome) throws Exception { super.finishImpl(context, outcome); // your code here return "browse"; }
/* * Copyright (C) 2005-2007 Alfresco Software Limited. * * This program is free software; you can redistribute it and/or modify it under the terms of the GNU General Public * License as published by the Free Software Foundation; either version 2 of the License, or (at your option) any later * version. * * This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied * warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details. * * You should have received a copy of the GNU General Public License along with this program; if not, write to the Free * Software Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. * * As a special exception to the terms and conditions of version 2.0 of the GPL, you may redistribute this Program in * connection with Free/Libre and Open Source Software ("FLOSS") applications as described in Alfresco's FLOSS * exception. You should have recieved a copy of the text describing the FLOSS exception, and it is also available here: * http://www.alfresco.com/legal/licensing" */ package org.alfresco.web.bean.content; import javax.faces.context.FacesContext; import org.alfresco.model.ContentModel; import org.alfresco.service.cmr.repository.NodeRef; /** * Custom bean implementation for the "Add Content" dialog. Overrides the AddContentDialog * add categories to content upon upload. * * @author hodsons */ public class WWTAddContentDialog extends AddContentDialog { @Override protected String finishImpl(FacesContext context, String outcome) throws Exception { super.finishImpl(context, outcome); // Adding the generalclassifiable aspect to the document NodeRef nodeRef = this.createdNode; if (nodeService.hasAspect(nodeRef, ContentModel.ASPECT_GEN_CLASSIFIABLE) == false) { nodeService.addAspect(nodeRef, ContentModel.ASPECT_GEN_CLASSIFIABLE, null); } return "browse"; } }
<faces-config> <!– *************************************************************** –> <!– Empty JSF config file to prevent errors being thrown during JSF –> <!– initialisation. Overwrite this file with your custom version. –> <!– *************************************************************** –> <!– WWT added to add categories to the add content dialog –> <managed-bean> <description> The bean that backs up the Add Content Dialog </description> <managed-bean-name>WWTContentDialog</managed-bean-name> <managed-bean-class>org.alfresco.web.bean.content.WWTAddContentDialog</managed-bean-class> <managed-bean-scope>session</managed-bean-scope> <managed-property> <property-name>nodeService</property-name> <value>#{NodeService}</value> </managed-property> <managed-property> <property-name>fileFolderService</property-name> <value>#{FileFolderService}</value> </managed-property> <managed-property> <property-name>searchService</property-name> <value>#{SearchService}</value> </managed-property> <managed-property> <property-name>navigator</property-name> <value>#{NavigationBean}</value> </managed-property> <managed-property> <property-name>browseBean</property-name> <value>#{BrowseBean}</value> </managed-property> <managed-property> <property-name>contentService</property-name> <value>#{ContentService}</value> </managed-property> <managed-property> <property-name>dictionaryService</property-name> <value>#{DictionaryService}</value> </managed-property> </managed-bean> </faces-config>
<td style="padding-left:4px" width=80> <a:actionLink value="#{msg.add_content}" image="/images/icons/add.gif" padding="2" action="addContent" actionListener="#{WWTAddContentDialog.start}" style="white-space:nowrap" id="link3" /> </td>
WWTAddContentDialog dialog = (WWTAddContentDialog)FacesHelper.getManagedBean(FacesContext.getCurrentInstance(), "WWTAddContentDialog");
Usability issue: Given that we're requiring categorization for every document, the five mouse clicks it takes to select each category (Select button, "Click here…" link, radio button, OK button, Add to List button) is a lot if someone is importing a number of documents with possibly multiple categories per document. Is there a way to get the GUI to display checkboxes or radio buttons and just an "Add to list" button or something so that it only requires one or two mouse clicks per category?