mirror of
https://github.com/Alfresco/alfresco-community-repo.git
synced 2025-08-07 17:49:17 +00:00
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:
@@ -359,7 +359,7 @@
|
||||
<!-- Edit XML content type -->
|
||||
<action id="edit_form">
|
||||
<permissions>
|
||||
<permission allow="true">Write,CreateChildren</permission>
|
||||
<permission allow="true">Write,AddChildren</permission>
|
||||
</permissions>
|
||||
<evaluator>org.alfresco.web.action.evaluator.EditFormEvaluator</evaluator>
|
||||
<label-id>edit_form</label-id>
|
||||
@@ -607,7 +607,6 @@
|
||||
<action-group id="space_browse">
|
||||
<show-link>false</show-link>
|
||||
<style-class>inlineAction</style-class>
|
||||
<action idref="edit_form"/>
|
||||
<action idref="cut_node" />
|
||||
<action idref="copy_node" />
|
||||
<action idref="details_space" />
|
||||
@@ -632,7 +631,6 @@
|
||||
|
||||
<!-- Actions Menu for More Actions in Browse screen -->
|
||||
<action-group id="browse_actions_menu">
|
||||
<action idref="edit_form" />
|
||||
<action idref="details_space" />
|
||||
<action idref="delete_space" />
|
||||
<action idref="cut_node" />
|
||||
|
@@ -401,4 +401,38 @@
|
||||
</actions>
|
||||
</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>
|
||||
|
@@ -22,18 +22,10 @@
|
||||
* http://www.alfresco.com/legal/licensing" */
|
||||
package org.alfresco.web.action.evaluator;
|
||||
|
||||
import javax.faces.context.FacesContext;
|
||||
|
||||
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.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.Repository;
|
||||
|
||||
/**
|
||||
* 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)
|
||||
{
|
||||
if (node.hasAspect(WCMAppModel.ASPECT_FORM) && node.hasPermission(PermissionService.ADD_CHILDREN))
|
||||
{
|
||||
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;
|
||||
}
|
||||
return node.hasAspect(WCMAppModel.ASPECT_FORM);
|
||||
}
|
||||
}
|
||||
|
@@ -285,7 +285,7 @@ public class Node implements Serializable
|
||||
/**
|
||||
* @return Returns the type.
|
||||
*/
|
||||
public final QName getType()
|
||||
public QName getType()
|
||||
{
|
||||
if (this.type == null)
|
||||
{
|
||||
|
@@ -29,7 +29,9 @@ import java.util.Map;
|
||||
import java.util.Set;
|
||||
import javax.faces.context.FacesContext;
|
||||
|
||||
import org.alfresco.model.WCMModel;
|
||||
import org.alfresco.repo.avm.AVMNodeConverter;
|
||||
import org.alfresco.repo.avm.AVMNodeType;
|
||||
import org.alfresco.repo.domain.PropertyValue;
|
||||
import org.alfresco.service.cmr.avm.AVMNodeDescriptor;
|
||||
import org.alfresco.service.cmr.dictionary.DataTypeDefinition;
|
||||
@@ -174,6 +176,24 @@ public class AVMNode extends Node implements Map<String, Object>
|
||||
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()
|
||||
{
|
||||
return this.avmRef.isDirectory();
|
||||
|
@@ -229,9 +229,7 @@ public class CreateFormWizard
|
||||
throws Exception
|
||||
{
|
||||
if (LOGGER.isDebugEnabled())
|
||||
{
|
||||
LOGGER.debug("creating form " + this.getFormName());
|
||||
}
|
||||
|
||||
// get the node ref of the node that will contain the content
|
||||
final NodeRef contentFormsNodeRef = FormsService.getInstance().getContentFormsNodeRef();
|
||||
@@ -239,11 +237,13 @@ public class CreateFormWizard
|
||||
final FileInfo folderInfo =
|
||||
this.fileFolderService.create(contentFormsNodeRef,
|
||||
this.getFormName(),
|
||||
ContentModel.TYPE_FOLDER);
|
||||
FileInfo fileInfo =
|
||||
WCMAppModel.TYPE_FORMFOLDER);
|
||||
|
||||
final FileInfo fileInfo =
|
||||
this.fileFolderService.create(folderInfo.getNodeRef(),
|
||||
this.getSchemaFileName(),
|
||||
ContentModel.TYPE_CONTENT);
|
||||
|
||||
// get a writer for the content and put the file
|
||||
final ContentWriter writer = this.contentService.getWriter(fileInfo.getNodeRef(),
|
||||
ContentModel.PROP_CONTENT,
|
||||
|
Reference in New Issue
Block a user