10-08-2007 11:30 AM
protected String doPostCommitProcessing(FacesContext context, String outcome) {
………………………………………………….
this.showOtherProperties = true;
this.avmBrowseBean.setAvmActionNode(new AVMNode(this.avmService.lookup(-1, this.path)));
return "dialog:avmEditContentProperties1";}
package org.alfresco.web.bean.wcm;
import java.util.Map;
import org.alfresco.model.ContentModel;
import org.alfresco.service.cmr.avm.AVMService;
import org.alfresco.service.cmr.repository.ContentData;
import org.alfresco.web.bean.content.EditContentPropertiesDialog;
import org.alfresco.web.bean.repository.Node;
public class AVMEditContentPropertiesDialog extends EditContentPropertiesDialog {
/** AVM Browse Bean reference */
protected AVMBrowseBean avmBrowseBean;
protected AVMService avmService;
@Override
public void init(Map<String, String> parameters)
{
super.init(parameters);
// setup the editable node
this.editableNode = initEditableNode();
// special case for Mimetype - since this is a sub-property of the ContentData object
// we must extract it so it can be edited in the client, then we check for it later
// and create a new ContentData object to wrap it and it's associated URL
ContentData content = (ContentData)this.editableNode.getProperties().get(ContentModel.PROP_CONTENT);
if (content != null)
{
this.editableNode.getProperties().put(TEMP_PROP_MIMETYPE, content.getMimetype());
this.editableNode.getProperties().put(TEMP_PROP_ENCODING, content.getEncoding());
}
}
/**
* Init the editable Node
*/
protected Node initEditableNode()
{
//get the AVM path that will contain the content
String parent = this.avmBrowseBean.getCurrentPath();
return new AVMNode(this.avmService.lookup(-1, parent));
}
// public void start(ActionEvent event)
// {
// // NOTE: this is a temporary solution to allow us to use the new dialog
// // framework beans outside of the dialog framework, we need to do
// // this because the uploading requires a separate non-JSF form, this
// // approach can not be used in the current dialog framework. Until
// // we have a pure JSF upload solution we need this initialisation
//
// init(null);
// }
/**
* @param avmService The AVMService to set.
*/
public void setAvmService(AVMService avmService)
{
this.avmService = avmService;
}
/**
* @param avmBrowseBean The AVMBrowseBean to set.
*/
public void setAvmBrowseBean(AVMBrowseBean avmBrowseBean)
{
this.avmBrowseBean = avmBrowseBean;
}
}
<managed-bean>
<description>
The bean that backs up the AVM Add Content Dialog
</description>
<managed-bean-name>AVMEditContentPropertiesDialog</managed-bean-name>
<managed-bean-class>org.alfresco.web.bean.wcm.AVMEditContentPropertiesDialog</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>dictionaryService</property-name>
<value>#{DictionaryService}</value>
</managed-property>
<managed-property>
<property-name>avmService</property-name>
<value>#{AVMLockingAwareService}</value>
</managed-property>
<managed-property>
<property-name>avmBrowseBean</property-name>
<value>#{AVMBrowseBean}</value>
</managed-property>
</managed-bean>
<!– Definition of the edit content properties dialog –>
<dialog name="editContentProperties1" page="/jsp/content/wcm/edit-content-properties.jsp"
managed-bean="AVMEditContentPropertiesDialog" icon="/images/icons/edit_properties_large.gif"
title-id="modify_content_properties" description-id="edit_content_description" />
<action id="edit_content">
<permissions>
<permission allow="true">CreateChildren</permission>
</permissions>
<label-id>edit_content</label-id>
<image>/images/icons/add.gif</image>
<action>dialog:editContentProperties1</action>
<action-listener>#{AvmEditContentPropertiesDialog.start}</action-listener>
</action>
10-09-2007 12:19 PM
Tags
Find what you came for
We want to make your experience in Hyland Connect as valuable as possible, so we put together some helpful links.