- fixing null pointer in edit form wizard

- getting edit form to show in the action list in the content forms directory as well

git-svn-id: https://svn.alfresco.com/repos/alfresco-enterprise/alfresco/HEAD/root@4685 c4b6b30b-aa2e-2d43-bbcb-ca4b014f7261
This commit is contained in:
Ariel Backenroth
2006-12-21 19:53:05 +00:00
parent e17d57a43b
commit ef77cd2a3e
3 changed files with 9 additions and 19 deletions

View File

@@ -16,17 +16,10 @@
*/
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.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
@@ -38,15 +31,9 @@ public class EditFormEvaluator implements ActionEvaluator
/**
* @see org.alfresco.web.action.ActionEvaluator#evaluate(org.alfresco.web.bean.repository.Node)
*/
public boolean evaluate(Node node)
public boolean evaluate(final Node node)
{
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 Node currentNode = navigator.getCurrentNode();
return (currentNode.hasAspect(WCMAppModel.ASPECT_FORM) &&
currentNode.hasPermission(PermissionService.ADD_CHILDREN));
return (node.hasAspect(WCMAppModel.ASPECT_FORM) &&
node.hasPermission(PermissionService.ADD_CHILDREN));
}
}

View File

@@ -152,9 +152,12 @@ public class EditFormWizard
fileInfo.getNodeRef());
}
for (RenderingEngineTemplateData retd : this.removedRenderingEngineTemplates)
if (this.removedRenderingEngineTemplates != null)
{
this.nodeService.removeChild(formNodeRef, retd.getNodeRef());
for (RenderingEngineTemplateData retd : this.removedRenderingEngineTemplates)
{
this.nodeService.removeChild(formNodeRef, retd.getNodeRef());
}
}
for (RenderingEngineTemplateData retd : this.renderingEngineTemplates)