. Checkpoint of the Clipboard refactoring for AVM nodes:

- Cut and Copy actions now appear for AVM nodes (as appropriate for user permissions)
 - AVM nodes now appear in the clipboard
 - All content nodes in the clipboard are now clickable links which display the content for the item
NOTE: avm nodes cannot be pasted anywhere yet :)
. Fixed 2.0 styles for Simple Search pop-up

git-svn-id: https://svn.alfresco.com/repos/alfresco-enterprise/alfresco/HEAD/root@4929 c4b6b30b-aa2e-2d43-bbcb-ca4b014f7261
This commit is contained in:
Kevin Roast
2007-01-25 18:51:10 +00:00
parent 1c966e9a71
commit 1e706a0d36
8 changed files with 80 additions and 5 deletions

View File

@@ -33,4 +33,12 @@ public class AVMClipboardItem extends AbstractClipboardItem
{
super(ref, mode);
}
/**
* @see org.alfresco.web.bean.clipboard.ClipboardItem#supportsLink()
*/
public boolean supportsLink()
{
return false;
}
}

View File

@@ -438,7 +438,7 @@ public class ClipboardBean
}
/**
* Add a clipboard node for an operation to the clipboard
* Add a clipboard node to the clipboard ready for a cut/copy operation
*
* @param ref NodeRef of the item for the operation
* @param mode ClipboardStatus for the operation

View File

@@ -44,4 +44,6 @@ public interface ClipboardItem
public String getId();
public NodeRef getNodeRef();
public boolean supportsLink();
}

View File

@@ -33,4 +33,12 @@ public class WorkspaceClipboardItem extends AbstractClipboardItem
{
super(ref, mode);
}
/**
* @see org.alfresco.web.bean.clipboard.ClipboardItem#supportsLink()
*/
public boolean supportsLink()
{
return true;
}
}

View File

@@ -194,6 +194,7 @@ public class AVMNode extends Node implements Map<String, Object>
}
this.properties.put("id", this.id);
this.properties.put("nodeRef", this.nodeRef);
this.properties.put("size", this.avmRef.getLength());
this.properties.put("name", this.avmRef.getName());
this.properties.put("created", this.avmRef.getCreateDate());

View File

@@ -195,7 +195,7 @@ public class UISimpleSearch extends UICommand
// dynamic DIV area containing search options
out.write("<br><div id='_alfsearch' style='position:absolute;display:none'>");
out.write("<table border=0 bgcolor='#eeeeee' style='border-top:thin solid #FFFFFF;border-left:thin solid #FFFFFF;border-right:thin solid #444444;border-bottom:thin solid #444444;' cellspacing=4 cellpadding=0>");
out.write("<table border=0 class='moreActionsMenu' cellspacing=4 cellpadding=0>");
// output each option - setting the current one to CHECKED
String optionFieldName = getClientId(context) + NamingContainer.SEPARATOR_CHAR + OPTION_PARAM;

View File

@@ -32,8 +32,10 @@ import javax.faces.event.ActionEvent;
import javax.faces.event.FacesEvent;
import org.alfresco.model.ContentModel;
import org.alfresco.repo.avm.AVMNodeConverter;
import org.alfresco.service.cmr.dictionary.DictionaryService;
import org.alfresco.web.app.Application;
import org.alfresco.web.app.servlet.DownloadContentServlet;
import org.alfresco.web.bean.clipboard.ClipboardItem;
import org.alfresco.web.bean.clipboard.ClipboardStatus;
import org.alfresco.web.bean.repository.Repository;
@@ -170,7 +172,8 @@ public class UIClipboardShelfItem extends UIShelfItem
}
out.write("</td><td width=16>");
if (dd.isSubClass(item.getType(), ContentModel.TYPE_FOLDER))
boolean isFolder = (dd.isSubClass(item.getType(), ContentModel.TYPE_FOLDER));
if (isFolder)
{
// start row with correct node icon
String icon = (String)item.getIcon();
@@ -193,14 +196,28 @@ public class UIClipboardShelfItem extends UIShelfItem
// output cropped item label - we also output with no breaks, this is ok
// as the copped label will ensure a sensible maximum width
out.write("</td><td width=100%><nobr>&nbsp;");
out.write(Utils.cropEncode(item.getName()));
if (isFolder)
{
out.write(Utils.cropEncode(item.getName()));
}
else
{
// output as a content download link
out.write("<a href='");
out.write(context.getExternalContext().getRequestContextPath());
out.write(DownloadContentServlet.generateBrowserURL(item.getNodeRef(), item.getName()));
out.write("' target='new'>");
out.write(Utils.cropEncode(item.getName()));
out.write("</a>");
}
// output actions
out.write("</nobr></td><td align=right><nobr>");
out.write(buildActionLink(ACTION_REMOVE_ITEM, i, bundle.getString(MSG_REMOVE_ITEM), WebResources.IMAGE_REMOVE));
out.write("&nbsp;");
out.write(buildActionLink(ACTION_PASTE_ITEM, i, bundle.getString(MSG_PASTE_ITEM), WebResources.IMAGE_PASTE));
if (item.getMode() == ClipboardStatus.COPY && dd.isSubClass(item.getType(), ContentModel.TYPE_LINK) == false)
if (item.supportsLink() && item.getMode() == ClipboardStatus.COPY &&
dd.isSubClass(item.getType(), ContentModel.TYPE_LINK) == false)
{
out.write("&nbsp;");
out.write(buildActionLink(ACTION_PASTE_LINK, i, bundle.getString(MSG_PASTE_LINK), WebResources.IMAGE_PASTE_LINK));