mirror of
https://github.com/Alfresco/alfresco-community-repo.git
synced 2025-08-07 17:49:17 +00:00
Deleted items can now be passed to the submit dialog without blowing it up
git-svn-id: https://svn.alfresco.com/repos/alfresco-enterprise/alfresco/HEAD/root@4554 c4b6b30b-aa2e-2d43-bbcb-ca4b014f7261
This commit is contained in:
@@ -123,7 +123,7 @@ public class AVMBrowseBean implements IContextListener
|
|||||||
private UIRichList filesRichList;
|
private UIRichList filesRichList;
|
||||||
private UIUserSandboxes userSandboxes;
|
private UIUserSandboxes userSandboxes;
|
||||||
|
|
||||||
/* transient lists of files/folders for a directory */
|
/** transient lists of files/folders for a directory */
|
||||||
private List<Map> files = null;
|
private List<Map> files = null;
|
||||||
private List<Map> folders = null;
|
private List<Map> folders = null;
|
||||||
|
|
||||||
|
@@ -48,7 +48,9 @@ import org.alfresco.service.namespace.QName;
|
|||||||
import org.alfresco.service.namespace.RegexQNamePattern;
|
import org.alfresco.service.namespace.RegexQNamePattern;
|
||||||
import org.alfresco.util.ISO8601DateFormat;
|
import org.alfresco.util.ISO8601DateFormat;
|
||||||
import org.alfresco.util.NameMatcher;
|
import org.alfresco.util.NameMatcher;
|
||||||
|
import org.alfresco.web.app.Application;
|
||||||
import org.alfresco.web.app.servlet.DownloadContentServlet;
|
import org.alfresco.web.app.servlet.DownloadContentServlet;
|
||||||
|
import org.alfresco.web.bean.BrowseBean;
|
||||||
import org.alfresco.web.bean.dialog.BaseDialogBean;
|
import org.alfresco.web.bean.dialog.BaseDialogBean;
|
||||||
import org.alfresco.web.forms.Form;
|
import org.alfresco.web.forms.Form;
|
||||||
import org.alfresco.web.forms.FormsService;
|
import org.alfresco.web.forms.FormsService;
|
||||||
@@ -62,6 +64,9 @@ import org.alfresco.web.ui.wcm.WebResources;
|
|||||||
*/
|
*/
|
||||||
public class SubmitDialog extends BaseDialogBean
|
public class SubmitDialog extends BaseDialogBean
|
||||||
{
|
{
|
||||||
|
private static final String SPACE_ICON = "/images/icons/" + BrowseBean.SPACE_SMALL_DEFAULT + ".gif";
|
||||||
|
private static final String MSG_DELETED_ITEM = "avm_node_deleted";
|
||||||
|
|
||||||
private String comment;
|
private String comment;
|
||||||
private String label;
|
private String label;
|
||||||
private String[] workflowSelectedValue;
|
private String[] workflowSelectedValue;
|
||||||
@@ -371,7 +376,7 @@ public class SubmitDialog extends BaseDialogBean
|
|||||||
selected = new ArrayList<AVMNodeDescriptor>(diffs.size());
|
selected = new ArrayList<AVMNodeDescriptor>(diffs.size());
|
||||||
for (AVMDifference diff : diffs)
|
for (AVMDifference diff : diffs)
|
||||||
{
|
{
|
||||||
AVMNodeDescriptor node = this.avmService.lookup(-1, diff.getSourcePath());
|
AVMNodeDescriptor node = this.avmService.lookup(-1, diff.getSourcePath(), true);
|
||||||
selected.add(node);
|
selected.add(node);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@@ -388,11 +393,13 @@ public class SubmitDialog extends BaseDialogBean
|
|||||||
{
|
{
|
||||||
if (hasAssociatedWorkflow(AVMNodeConverter.ToNodeRef(-1, node.getPath())) == false)
|
if (hasAssociatedWorkflow(AVMNodeConverter.ToNodeRef(-1, node.getPath())) == false)
|
||||||
{
|
{
|
||||||
// lookup if this item was created via a form - then lookup the workflow defaults
|
|
||||||
// for that form and store into the list of available workflows
|
|
||||||
NodeRef ref = AVMNodeConverter.ToNodeRef(-1, node.getPath());
|
NodeRef ref = AVMNodeConverter.ToNodeRef(-1, node.getPath());
|
||||||
if (submittedPaths.contains(node.getPath()) == false)
|
if (submittedPaths.contains(node.getPath()) == false)
|
||||||
{
|
{
|
||||||
|
if (node.isDeleted() == false)
|
||||||
|
{
|
||||||
|
// lookup if this item was created via a form - then lookup the workflow defaults
|
||||||
|
// for that form and store into the list of available workflows
|
||||||
if (this.nodeService.hasAspect(ref, WCMAppModel.ASPECT_FORM_INSTANCE_DATA))
|
if (this.nodeService.hasAspect(ref, WCMAppModel.ASPECT_FORM_INSTANCE_DATA))
|
||||||
{
|
{
|
||||||
NodeRef formInstanceDataRef = ref;
|
NodeRef formInstanceDataRef = ref;
|
||||||
@@ -440,13 +447,20 @@ public class SubmitDialog extends BaseDialogBean
|
|||||||
this.workflows.add(wrapper);
|
this.workflows.add(wrapper);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
// found a deleted node for submit
|
||||||
|
this.submitItems.add(new ItemWrapper(node));
|
||||||
|
submittedPaths.add(node.getPath());
|
||||||
|
}
|
||||||
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
this.submitItems.add(new ItemWrapper(node));
|
this.submitItems.add(new ItemWrapper(node));
|
||||||
submittedPaths.add(node.getPath());
|
submittedPaths.add(node.getPath());
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
this.warningItems.add(new ItemWrapper(node));
|
this.warningItems.add(new ItemWrapper(node));
|
||||||
@@ -551,10 +565,23 @@ public class SubmitDialog extends BaseDialogBean
|
|||||||
this.descriptor = descriptor;
|
this.descriptor = descriptor;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
public boolean getDeleted()
|
||||||
|
{
|
||||||
|
return descriptor.isDeleted();
|
||||||
|
}
|
||||||
|
|
||||||
public String getName()
|
public String getName()
|
||||||
|
{
|
||||||
|
if (descriptor.isDeleted() == false)
|
||||||
{
|
{
|
||||||
return descriptor.getName();
|
return descriptor.getName();
|
||||||
}
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
return descriptor.getName() + " [" +
|
||||||
|
Application.getMessage(FacesContext.getCurrentInstance(), MSG_DELETED_ITEM) + "]";
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
public String getModifiedDate()
|
public String getModifiedDate()
|
||||||
{
|
{
|
||||||
@@ -562,10 +589,17 @@ public class SubmitDialog extends BaseDialogBean
|
|||||||
}
|
}
|
||||||
|
|
||||||
public String getDescription()
|
public String getDescription()
|
||||||
|
{
|
||||||
|
if (descriptor.isDeleted() == false)
|
||||||
{
|
{
|
||||||
return (String)nodeService.getProperty(
|
return (String)nodeService.getProperty(
|
||||||
AVMNodeConverter.ToNodeRef(-1, descriptor.getPath()), ContentModel.PROP_DESCRIPTION);
|
AVMNodeConverter.ToNodeRef(-1, descriptor.getPath()), ContentModel.PROP_DESCRIPTION);
|
||||||
}
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
return "";
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
public String getPath()
|
public String getPath()
|
||||||
{
|
{
|
||||||
@@ -579,9 +613,17 @@ public class SubmitDialog extends BaseDialogBean
|
|||||||
}
|
}
|
||||||
|
|
||||||
public String getIcon()
|
public String getIcon()
|
||||||
|
{
|
||||||
|
// TODO: handle deleted file types here once implemented in the AVMNodeType enum
|
||||||
|
if (descriptor.isFile())
|
||||||
{
|
{
|
||||||
return Utils.getFileTypeImage(descriptor.getName(), true);
|
return Utils.getFileTypeImage(descriptor.getName(), true);
|
||||||
}
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
return SPACE_ICON;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public boolean equals(Object obj)
|
public boolean equals(Object obj)
|
||||||
|
@@ -623,6 +623,7 @@ public class UIUserSandboxes extends SelfRenderingComponent
|
|||||||
// must have been deleted from this sandbox - show as ghosted
|
// must have been deleted from this sandbox - show as ghosted
|
||||||
String name = node.getName();
|
String name = node.getName();
|
||||||
out.write("<td width=16>");
|
out.write("<td width=16>");
|
||||||
|
// TODO: need new solution - isFile() and isFolder() both return false for a deleted node!
|
||||||
if (node.isFile())
|
if (node.isFile())
|
||||||
{
|
{
|
||||||
out.write(Utils.buildImageTag(fc, Utils.getFileTypeImage(fc, name, true), ""));
|
out.write(Utils.buildImageTag(fc, Utils.getFileTypeImage(fc, name, true), ""));
|
||||||
|
@@ -83,9 +83,10 @@
|
|||||||
<a:sortLink label="#{msg.name}" value="name" mode="case-insensitive" styleClass="header"/>
|
<a:sortLink label="#{msg.name}" value="name" mode="case-insensitive" styleClass="header"/>
|
||||||
</f:facet>
|
</f:facet>
|
||||||
<f:facet name="small-icon">
|
<f:facet name="small-icon">
|
||||||
<a:actionLink id="col1-icon" value="#{r.name}" href="#{r.url}" target="new" image="#{r.icon}" showLink="false" styleClass="inlineAction" />
|
<a:actionLink id="col1-icon1" value="#{r.name}" href="#{r.url}" target="new" image="#{r.icon}" showLink="false" styleClass="inlineAction" rendered="#{!r.deleted}" />
|
||||||
</f:facet>
|
</f:facet>
|
||||||
<a:actionLink id="col1-name" value="#{r.name}" href="#{r.url}" target="new" />
|
<a:actionLink id="col1-name1" value="#{r.name}" href="#{r.url}" target="new" rendered="#{!r.deleted}" />
|
||||||
|
<h:outputText id="col1-name2" value="#{r.name}" rendered="#{r.deleted}" />
|
||||||
</a:column>
|
</a:column>
|
||||||
|
|
||||||
<%-- Description columns --%>
|
<%-- Description columns --%>
|
||||||
@@ -136,9 +137,10 @@
|
|||||||
<a:sortLink label="#{msg.name}" value="name" mode="case-insensitive" styleClass="header"/>
|
<a:sortLink label="#{msg.name}" value="name" mode="case-insensitive" styleClass="header"/>
|
||||||
</f:facet>
|
</f:facet>
|
||||||
<f:facet name="small-icon">
|
<f:facet name="small-icon">
|
||||||
<a:actionLink id="col10-icon" value="#{r.name}" href="#{r.url}" target="new" image="#{r.icon}" showLink="false" styleClass="inlineAction" />
|
<a:actionLink id="col10-icon1" value="#{r.name}" href="#{r.url}" target="new" image="#{r.icon}" showLink="false" styleClass="inlineAction" rendered="#{!r.deleted}" />
|
||||||
</f:facet>
|
</f:facet>
|
||||||
<a:actionLink id="col10-name" value="#{r.name}" href="#{r.url}" target="new" />
|
<a:actionLink id="col10-name1" value="#{r.name}" href="#{r.url}" target="new" rendered="#{!r.deleted}" />
|
||||||
|
<h:outputText id="col10-name2" value="#{r.name}" rendered="#{r.deleted}" />
|
||||||
</a:column>
|
</a:column>
|
||||||
|
|
||||||
<%-- Description columns --%>
|
<%-- Description columns --%>
|
||||||
|
Reference in New Issue
Block a user