Merged V2.0 to HEAD

svn merge svn://svn.alfresco.com:3691/alfresco/BRANCHES/V2.0@5146 svn://svn.alfresco.com:3691/alfresco/BRANCHES/V2.0@5147 .
      - WCM-225
   svn merge svn://svn.alfresco.com:3691/alfresco/BRANCHES/V2.0@5149 svn://svn.alfresco.com:3691/alfresco/BRANCHES/V2.0@5151 .
      - WCM-339
      - 2 revisions


git-svn-id: https://svn.alfresco.com/repos/alfresco-enterprise/alfresco/HEAD/root@5170 c4b6b30b-aa2e-2d43-bbcb-ca4b014f7261
This commit is contained in:
Derek Hulley
2007-02-16 15:56:51 +00:00
parent aa5f666c21
commit c202a2221c
6 changed files with 61 additions and 34 deletions

View File

@@ -359,7 +359,7 @@
<!-- Edit XML content type --> <!-- Edit XML content type -->
<action id="edit_form"> <action id="edit_form">
<permissions> <permissions>
<permission allow="true">Write,CreateChildren</permission> <permission allow="true">Write,AddChildren</permission>
</permissions> </permissions>
<evaluator>org.alfresco.web.action.evaluator.EditFormEvaluator</evaluator> <evaluator>org.alfresco.web.action.evaluator.EditFormEvaluator</evaluator>
<label-id>edit_form</label-id> <label-id>edit_form</label-id>
@@ -607,7 +607,6 @@
<action-group id="space_browse"> <action-group id="space_browse">
<show-link>false</show-link> <show-link>false</show-link>
<style-class>inlineAction</style-class> <style-class>inlineAction</style-class>
<action idref="edit_form"/>
<action idref="cut_node" /> <action idref="cut_node" />
<action idref="copy_node" /> <action idref="copy_node" />
<action idref="details_space" /> <action idref="details_space" />
@@ -632,7 +631,6 @@
<!-- Actions Menu for More Actions in Browse screen --> <!-- Actions Menu for More Actions in Browse screen -->
<action-group id="browse_actions_menu"> <action-group id="browse_actions_menu">
<action idref="edit_form" />
<action idref="details_space" /> <action idref="details_space" />
<action idref="delete_space" /> <action idref="delete_space" />
<action idref="cut_node" /> <action idref="cut_node" />

View File

@@ -400,5 +400,39 @@
</actions> </actions>
</config> </config>
<config evaluator="node-type" condition="wca:formfolder">
<actions>
<!-- Override actions for WCM Form container type in the Browse screen -->
<action-group id="space_browse">
<show-link>false</show-link>
<!-- add the edit form action -->
<action idref="edit_form"/>
<!-- hide the cut and copy operations for web form -->
<action idref="cut_node" hide="true" />
<action idref="copy_node" hide="true" />
</action-group>
<!-- Override actions for current node More Actions menu in Browse screen -->
<action-group id="browse_actions_menu">
<!-- add the edit form action -->
<action idref="edit_form" />
<!-- hide the cut and copy operations for web form -->
<action idref="cut_node" hide="true" />
<action idref="copy_node" hide="true" />
</action-group>
<!-- Override actions Menu for Space Details screen -->
<action-group id="space_details_actions">
<!-- add the edit form action -->
<action idref="edit_form" />
<!-- hide the cut and copy operations for web form -->
<action idref="cut_node" hide="true" />
<action idref="copy_node" hide="true" />
</action-group>
</actions>
</config>
</alfresco-config> </alfresco-config>

View File

@@ -22,18 +22,10 @@
* http://www.alfresco.com/legal/licensing" */ * http://www.alfresco.com/legal/licensing" */
package org.alfresco.web.action.evaluator; package org.alfresco.web.action.evaluator;
import javax.faces.context.FacesContext;
import org.alfresco.model.WCMAppModel; import org.alfresco.model.WCMAppModel;
import org.alfresco.service.ServiceRegistry;
import org.alfresco.service.cmr.repository.Path;
import org.alfresco.service.cmr.security.PermissionService; import org.alfresco.service.cmr.security.PermissionService;
import org.alfresco.web.action.ActionEvaluator; import org.alfresco.web.action.ActionEvaluator;
import org.alfresco.web.app.Application;
import org.alfresco.web.app.servlet.FacesHelper;
import org.alfresco.web.bean.NavigationBean;
import org.alfresco.web.bean.repository.Node; import org.alfresco.web.bean.repository.Node;
import org.alfresco.web.bean.repository.Repository;
/** /**
* UI Action Evaluator - Edit Web Form in the Forms DataDictionary folder * UI Action Evaluator - Edit Web Form in the Forms DataDictionary folder
@@ -47,23 +39,6 @@ public class EditFormEvaluator implements ActionEvaluator
*/ */
public boolean evaluate(final Node node) public boolean evaluate(final Node node)
{ {
if (node.hasAspect(WCMAppModel.ASPECT_FORM) && node.hasPermission(PermissionService.ADD_CHILDREN)) return node.hasAspect(WCMAppModel.ASPECT_FORM);
{
final FacesContext fc = FacesContext.getCurrentInstance();
final ServiceRegistry services = Repository.getServiceRegistry(fc);
final NavigationBean navigator = (NavigationBean)FacesHelper.getManagedBean(fc, NavigationBean.BEAN_NAME);
// get the path to the current name - compare last element with the Website folder assoc name
final Path path = navigator.getCurrentNode().getNodePath();
final Path.Element element = path.get(path.size() - 1);
final String endPath = element.getPrefixedString(services.getNamespaceService());
// check we have the permission to create nodes in that Website folder
return (Application.getContentFormsFolderName(fc).equals(endPath));
}
else
{
return false;
}
} }
} }

View File

@@ -285,7 +285,7 @@ public class Node implements Serializable
/** /**
* @return Returns the type. * @return Returns the type.
*/ */
public final QName getType() public QName getType()
{ {
if (this.type == null) if (this.type == null)
{ {

View File

@@ -29,7 +29,9 @@ import java.util.Map;
import java.util.Set; import java.util.Set;
import javax.faces.context.FacesContext; import javax.faces.context.FacesContext;
import org.alfresco.model.WCMModel;
import org.alfresco.repo.avm.AVMNodeConverter; import org.alfresco.repo.avm.AVMNodeConverter;
import org.alfresco.repo.avm.AVMNodeType;
import org.alfresco.repo.domain.PropertyValue; import org.alfresco.repo.domain.PropertyValue;
import org.alfresco.service.cmr.avm.AVMNodeDescriptor; import org.alfresco.service.cmr.avm.AVMNodeDescriptor;
import org.alfresco.service.cmr.dictionary.DataTypeDefinition; import org.alfresco.service.cmr.dictionary.DataTypeDefinition;
@@ -174,6 +176,24 @@ public class AVMNode extends Node implements Map<String, Object>
return this.avmRef.getName(); return this.avmRef.getName();
} }
@Override
public QName getType()
{
if (this.type == null)
{
if (this.deleted == false)
{
this.type = getServiceRegistry().getNodeService().getType(this.nodeRef);
}
else
{
this.type = avmRef.isDeletedDirectory() ? WCMModel.TYPE_AVM_FOLDER : WCMModel.TYPE_AVM_CONTENT;
}
}
return type;
}
public final boolean isDirectory() public final boolean isDirectory()
{ {
return this.avmRef.isDirectory(); return this.avmRef.isDirectory();

View File

@@ -229,9 +229,7 @@ public class CreateFormWizard
throws Exception throws Exception
{ {
if (LOGGER.isDebugEnabled()) if (LOGGER.isDebugEnabled())
{
LOGGER.debug("creating form " + this.getFormName()); LOGGER.debug("creating form " + this.getFormName());
}
// get the node ref of the node that will contain the content // get the node ref of the node that will contain the content
final NodeRef contentFormsNodeRef = FormsService.getInstance().getContentFormsNodeRef(); final NodeRef contentFormsNodeRef = FormsService.getInstance().getContentFormsNodeRef();
@@ -239,11 +237,13 @@ public class CreateFormWizard
final FileInfo folderInfo = final FileInfo folderInfo =
this.fileFolderService.create(contentFormsNodeRef, this.fileFolderService.create(contentFormsNodeRef,
this.getFormName(), this.getFormName(),
ContentModel.TYPE_FOLDER); WCMAppModel.TYPE_FORMFOLDER);
FileInfo fileInfo =
final FileInfo fileInfo =
this.fileFolderService.create(folderInfo.getNodeRef(), this.fileFolderService.create(folderInfo.getNodeRef(),
this.getSchemaFileName(), this.getSchemaFileName(),
ContentModel.TYPE_CONTENT); ContentModel.TYPE_CONTENT);
// get a writer for the content and put the file // get a writer for the content and put the file
final ContentWriter writer = this.contentService.getWriter(fileInfo.getNodeRef(), final ContentWriter writer = this.contentService.getWriter(fileInfo.getNodeRef(),
ContentModel.PROP_CONTENT, ContentModel.PROP_CONTENT,