Merged V2.0 to HEAD

svn merge svn://svn.alfresco.com:3691/alfresco/BRANCHES/V2.0@5104 svn://svn.alfresco.com:3691/alfresco/BRANCHES/V2.0@5105 .
   svn merge svn://svn.alfresco.com:3691/alfresco/BRANCHES/V2.0@5107 svn://svn.alfresco.com:3691/alfresco/BRANCHES/V2.0@5108 .


git-svn-id: https://svn.alfresco.com/repos/alfresco-enterprise/alfresco/HEAD/root@5114 c4b6b30b-aa2e-2d43-bbcb-ca4b014f7261
This commit is contained in:
Derek Hulley
2007-02-13 12:47:46 +00:00
parent b3569e440a
commit 103e3f9cef
5 changed files with 70 additions and 25 deletions

View File

@@ -862,6 +862,25 @@ public class AVMBrowseBean implements IContextListener
this.allItemsAction = true;
}
/**
* Refresh Sandbox in the virtualisation server
*/
public void refreshSandbox(ActionEvent event)
{
UIActionLink link = (UIActionLink)event.getComponent();
Map<String, String> params = link.getParameterMap();
String store = params.get("store");
if (store == null)
{
store = getStagingStore();
}
// update the specified webapp in the store
String webappPath = AVMConstants.buildStoreWebappPath(store, getWebapp());
AVMConstants.updateVServerWebapp(webappPath, true);
}
/**
* Undo changes to a single node
*/

View File

@@ -35,6 +35,7 @@ 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.service.cmr.repository.NodeService;
import org.alfresco.web.app.Application;
import org.alfresco.web.app.servlet.DownloadContentServlet;
import org.alfresco.web.bean.clipboard.ClipboardItem;
@@ -154,6 +155,7 @@ public class UIClipboardShelfItem extends UIShelfItem
if (items.size() != 0)
{
DictionaryService dd = Repository.getServiceRegistry(context).getDictionaryService();
NodeService nodeService = Repository.getServiceRegistry(context).getNodeService();
ResourceBundle bundle = Application.getBundle(context);
@@ -161,6 +163,14 @@ public class UIClipboardShelfItem extends UIShelfItem
{
ClipboardItem item = items.get(i);
// check that the item has not been deleted since added to the clipboard
if (nodeService.exists(item.getNodeRef()) == false)
{
// remove from clipboard
items.remove(i--);
continue;
}
// start row with cut/copy state icon
out.write("<tr><td width=16>");
if (item.getMode() == ClipboardStatus.COPY)

View File

@@ -99,6 +99,7 @@ public class UIUserSandboxes extends SelfRenderingComponent
private static final String ACT_SANDBOX_PREVIEW = "sandbox_preview";
private static final String ACT_SANDBOX_ICON = "sandbox_icon";
private static final String ACT_REMOVE_SANDBOX = "sandbox_remove";
private static final String ACT_SANDBOX_REFRESH = "sandbox_refresh";
private static final String ACTIONS_FILE = "avm_file_modified";
private static final String ACTIONS_FOLDER = "avm_folder_modified";
@@ -362,12 +363,14 @@ public class UIUserSandboxes extends SelfRenderingComponent
out.write(bundle.getString(userrole));
out.write(")</td><td><nobr>");
// direct actions for a sandbox
// Direct actions for a sandbox...
// Browse Sandbox
Utils.encodeRecursive(context, aquireAction(
context, mainStore, username, ACT_SANDBOX_BROWSE, "/images/icons/space_small.gif",
"#{AVMBrowseBean.setupSandboxAction}", "browseSandbox"));
out.write("&nbsp;&nbsp;");
// Preview Website
String websiteUrl = AVMConstants.buildWebappUrl(mainStore, getWebapp());
Map requestMap = context.getExternalContext().getRequestMap();
requestMap.put(REQUEST_PREVIEW_REF, websiteUrl);
@@ -375,18 +378,28 @@ public class UIUserSandboxes extends SelfRenderingComponent
context, mainStore, username, ACT_SANDBOX_PREVIEW, "/images/icons/preview_website.gif",
null, null, "#{" + REQUEST_PREVIEW_REF + "}", null));
requestMap.remove(REQUEST_PREVIEW_REF);
out.write("&nbsp;");
Utils.encodeRecursive(context, aquireAction(
context, mainStore, username, ACT_SANDBOX_SUBMITALL, "/images/icons/submit_all.gif",
"#{AVMBrowseBean.setupAllItemsAction}", "dialog:submitSandboxItems"));
out.write("&nbsp;&nbsp;");
// Refresh Sandbox
Utils.encodeRecursive(context, aquireAction(
context, mainStore, username, ACT_SANDBOX_REFRESH, "/images/icons/reset.gif",
"#{AVMBrowseBean.refreshSandbox}", null));
out.write("&nbsp;&nbsp;");
// Submit All Items
// NOTE: removed for 2.0 final
/*Utils.encodeRecursive(context, aquireAction(
context, mainStore, username, ACT_SANDBOX_SUBMITALL, "/images/icons/submit_all.gif",
"#{AVMBrowseBean.setupAllItemsAction}", "dialog:submitSandboxItems"));
out.write("&nbsp;&nbsp;");*/
// Revert All Items
Utils.encodeRecursive(context, aquireAction(
context, mainStore, username, ACT_SANDBOX_REVERTALL, "/images/icons/revert_all.gif",
"#{AVMBrowseBean.setupAllItemsAction}", "dialog:revertAllItems"));
out.write("&nbsp;&nbsp;");
// Delete Sandbox
if (AVMConstants.ROLE_CONTENT_MANAGER.equals(currentUserRole))
{
Utils.encodeRecursive(context, aquireAction(
@@ -589,6 +602,24 @@ public class UIUserSandboxes extends SelfRenderingComponent
// TODO: apply tag style - removed hardcoded
out.write("<table class='modifiedItemsList' cellspacing=2 cellpadding=1 border=0 width=100%>");
// output multi-select actions for this user
out.write("<tr><td colspan=8>");
out.write(bundle.getString(MSG_SELECTED));
out.write(":&nbsp;&nbsp;");
NodeRef userStoreRef = AVMNodeConverter.ToNodeRef(-1, AVMConstants.buildSandboxRootPath(userStore));
if (permissionService.hasPermission(userStoreRef, PermissionService.WRITE) == AccessStatus.ALLOWED ||
permissionService.hasPermission(userStoreRef, PermissionService.ADD_CHILDREN) == AccessStatus.ALLOWED)
{
Utils.encodeRecursive(fc, aquireAction(
fc, userStore, username, ACT_SANDBOX_SUBMITSELECTED, "/images/icons/submit_all.gif",
"#{AVMBrowseBean.setupSandboxAction}", "dialog:submitSandboxItems"));
out.write("&nbsp;&nbsp;");
Utils.encodeRecursive(fc, aquireAction(
fc, userStore, username, ACT_SANDBOX_REVERTSELECTED, "/images/icons/revert_all.gif",
"#{AVMBrowseBean.setupSandboxAction}", "dialog:revertSelectedItems"));
}
out.write("</td></tr>");
// header row
out.write("<tr align=left><th>");
// multi-select checkbox
@@ -745,24 +776,6 @@ public class UIUserSandboxes extends SelfRenderingComponent
out.write("</td></tr>");
}
// output multi-select actions for this user
out.write("<tr><td colspan=8>");
out.write(bundle.getString(MSG_SELECTED));
out.write(":&nbsp;&nbsp;");
NodeRef userStoreRef = AVMNodeConverter.ToNodeRef(-1, AVMConstants.buildSandboxRootPath(userStore));
if (permissionService.hasPermission(userStoreRef, PermissionService.WRITE) == AccessStatus.ALLOWED ||
permissionService.hasPermission(userStoreRef, PermissionService.ADD_CHILDREN) == AccessStatus.ALLOWED)
{
Utils.encodeRecursive(fc, aquireAction(
fc, userStore, username, ACT_SANDBOX_SUBMITSELECTED, "/images/icons/submit_all.gif",
"#{AVMBrowseBean.setupSandboxAction}", "dialog:submitSandboxItems"));
out.write("&nbsp;&nbsp;");
Utils.encodeRecursive(fc, aquireAction(
fc, userStore, username, ACT_SANDBOX_REVERTSELECTED, "/images/icons/revert_all.gif",
"#{AVMBrowseBean.setupSandboxAction}", "dialog:revertSelectedItems"));
}
out.write("</td></tr>");
// end table
out.write("</table>");
}