. Dashboard views (templates) can now be applied to Documents through the Document Details View

- refactored DocumentDetailsBean and SpaceDetailsBean common code into BaseDetailsBase
. Fixed a couple of minor errors in example templates
. Preview in Template actions now launched as dialog actions

git-svn-id: https://svn.alfresco.com/repos/alfresco-enterprise/alfresco/HEAD/root@2586 c4b6b30b-aa2e-2d43-bbcb-ca4b014f7261
This commit is contained in:
Kevin Roast
2006-03-29 10:50:07 +00:00
parent 1caa065aba
commit 9c9a0d3d1b
13 changed files with 780 additions and 624 deletions

View File

@@ -519,6 +519,7 @@ success_inherit_permissions=Successfully changed Inherit Parent Permissions to '
success_not_inherit_permissions=Successfully changed Inherit Parent Permissions to 'No'
apply_dashboard=Apply Dashboard
apply_dashboard_info=Select a template to be applied to the Space as a Dashboard view.
apply_dashboard_doc_info=Select a template to be applied to the Document as a Dashboard view.
# Export messages
export_info=Exports metadata and content from this or all Spaces.
@@ -800,6 +801,7 @@ title_edit_simple_workflow=Edit Simple Workflow
title_edit_space=Edit Space Details
title_rules=Space Rules
title_space_details=Space Details
title_apply_template=Apply Template
title_system_info=System Information
title_undo_checkout=Undo Check Out
title_update_file=Update File Content

View File

@@ -4,9 +4,11 @@
<#if hasAspect(document, "cm:translatable") = 1>
Yes<br>
<table>
<#list document.assocs["cm:translations"] as t>
<tr><td>${t.content}</td></tr>
</#list>
<#if document.assocs["cm:translations"]?exists>
<#list document.assocs["cm:translations"] as t>
<tr><td>${t.content}</td></tr>
</#list>
</#if>
</table>
<#else>
No<br>

View File

@@ -1,8 +1,8 @@
<#-- Shows use of the childByNamePath, childrenByXPath and childrenByLuceneSearch API -->
<h3>Template Documents in 'Company Home/Data Dictionary/Content Templates':</h3>
<h3>Template Documents in 'Company Home/Data Dictionary/Presentation Templates':</h3>
<table>
<#list companyhome.childByNamePath["Data Dictionary/Content Templates"].children as child>
<#list companyhome.childByNamePath["Data Dictionary/Presentation Templates"].children as child>
<#if child.isDocument>
<tr><td><a href="/alfresco${child.url}" target="new">${child.properties.name}</a></td></tr>
</#if>

View File

@@ -142,7 +142,7 @@
<label-id>preview</label-id>
<image>/images/icons/preview.gif</image>
<action-listener>#{BrowseBean.setupContentAction}</action-listener>
<action>previewContent</action>
<action>dialog:previewContent</action>
<params>
<param name="id">#{actionContext.id}</param>
</params>
@@ -153,7 +153,7 @@
<label-id>preview</label-id>
<image>/images/icons/preview.gif</image>
<action-listener>#{BrowseBean.setupSpaceAction}</action-listener>
<action>previewSpace</action>
<action>dialog:previewSpace</action>
<params>
<param name="id">#{actionContext.id}</param>
</params>

View File

@@ -0,0 +1,370 @@
/*
* Copyright (C) 2005 Alfresco, Inc.
*
* Licensed under the Mozilla Public License version 1.1
* with a permitted attribution clause. You may obtain a
* copy of the License at
*
* http://www.alfresco.org/legal/license.txt
*
* Unless required by applicable law or agreed to in writing,
* software distributed under the License is distributed on an
* "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND,
* either express or implied. See the License for the specific
* language governing permissions and limitations under the
* License.
*/
package org.alfresco.web.bean;
import java.text.MessageFormat;
import java.util.HashMap;
import java.util.Map;
import javax.faces.application.FacesMessage;
import javax.faces.context.FacesContext;
import javax.faces.event.ActionEvent;
import javax.transaction.UserTransaction;
import org.alfresco.model.ContentModel;
import org.alfresco.service.cmr.repository.NodeRef;
import org.alfresco.service.cmr.repository.NodeService;
import org.alfresco.service.cmr.repository.TemplateImageResolver;
import org.alfresco.service.cmr.security.OwnableService;
import org.alfresco.web.app.Application;
import org.alfresco.web.bean.repository.Node;
import org.alfresco.web.bean.repository.Repository;
import org.alfresco.web.ui.common.Utils;
import org.alfresco.web.ui.common.Utils.URLMode;
import org.alfresco.web.ui.common.component.UIPanel.ExpandedEvent;
/**
* Backing bean provided access to the details of a Node
*
* @author Kevin Roast
*/
public abstract class BaseDetailsBean
{
private static final String MSG_SUCCESS_OWNERSHIP = "success_ownership";
/** BrowseBean instance */
protected BrowseBean browseBean;
/** The NavigationBean bean reference */
protected NavigationBean navigator;
/** NodeServuce bean reference */
protected NodeService nodeService;
/** OwnableService bean reference */
protected OwnableService ownableService;
/** Selected template Id */
protected String template;
protected Map<String, Boolean> panels = new HashMap<String, Boolean>(4, 1.0f);
// ------------------------------------------------------------------------------
// Bean property getters and setters
/**
* Sets the BrowseBean instance to use to retrieve the current Space
*
* @param browseBean BrowseBean instance
*/
public void setBrowseBean(BrowseBean browseBean)
{
this.browseBean = browseBean;
}
/**
* @param navigator The NavigationBean to set.
*/
public void setNavigator(NavigationBean navigator)
{
this.navigator = navigator;
}
/**
* @param nodeService The NodeService to set
*/
public void setNodeService(NodeService nodeService)
{
this.nodeService = nodeService;
}
/**
* Sets the ownable service instance the bean should use
*
* @param ownableService The OwnableService
*/
public void setOwnableService(OwnableService ownableService)
{
this.ownableService = ownableService;
}
/**
* @return Returns the panels expanded state map.
*/
public Map<String, Boolean> getPanels()
{
return this.panels;
}
/**
* @param panels The panels expanded state map.
*/
public void setPanels(Map<String, Boolean> panels)
{
this.panels = panels;
}
/**
* Returns the Node this bean is currently representing
*
* @return The Node
*/
public abstract Node getNode();
/**
* Returns the id of the current space
*
* @return The id
*/
public String getId()
{
return getNode().getId();
}
/**
* Returns the name of the current space
*
* @return Name of the current space
*/
public String getName()
{
return getNode().getName();
}
/**
* Return the Alfresco NodeRef URL for the current node
*
* @return the Alfresco NodeRef URL
*/
public String getNodeRefUrl()
{
return getNode().getNodeRef().toString();
}
/**
* Returns the WebDAV URL for the current node
*
* @return The WebDAV url
*/
public String getWebdavUrl()
{
Node space = getLinkResolvedNode();
return Utils.generateURL(FacesContext.getCurrentInstance(), space, URLMode.WEBDAV);
}
/**
* Returns the CIFS path for the current node
*
* @return The CIFS path
*/
public String getCifsPath()
{
Node space = getLinkResolvedNode();
return Utils.generateURL(FacesContext.getCurrentInstance(), space, URLMode.CIFS);
}
/**
* Returns the URL to access the details page for the current node
*
* @return The bookmark URL
*/
public String getBookmarkUrl()
{
return Utils.generateURL(FacesContext.getCurrentInstance(), getNode(), URLMode.SHOW_DETAILS);
}
/**
* Resolve the actual Node from any Link object that may be proxying it
*
* @return current Node or Node resolved from any Link object
*/
protected abstract Node getLinkResolvedNode();
/**
* @return Returns the template Id.
*/
public String getTemplate()
{
// return current template if it exists
NodeRef ref = (NodeRef)getNode().getProperties().get(ContentModel.PROP_TEMPLATE);
return ref != null ? ref.getId() : this.template;
}
/**
* @param template The template Id to set.
*/
public void setTemplate(String template)
{
this.template = template;
}
/**
* @return true if the current document has the 'templatable' aspect applied and
* references a template that currently exists in the system.
*/
public boolean isTemplatable()
{
NodeRef templateRef = (NodeRef)getNode().getProperties().get(ContentModel.PROP_TEMPLATE);
return (getNode().hasAspect(ContentModel.ASPECT_TEMPLATABLE) &&
templateRef != null && nodeService.exists(templateRef));
}
/**
* @return String of the NodeRef for the dashboard template used by the space if any
*/
public String getTemplateRef()
{
NodeRef ref = (NodeRef)getNode().getProperties().get(ContentModel.PROP_TEMPLATE);
return ref != null ? ref.toString() : null;
}
/**
* Returns a model for use by a template on the Details page.
*
* @return model containing current current node info.
*/
public abstract Map getTemplateModel();
/** Template Image resolver helper */
protected TemplateImageResolver imageResolver = new TemplateImageResolver()
{
public String resolveImagePathForName(String filename, boolean small)
{
return Utils.getFileTypeImage(filename, small);
}
};
// ------------------------------------------------------------------------------
// Action event handlers
/**
* Action handler to apply the selected Template and Templatable aspect to the current Space
*/
public String applyTemplate()
{
if (this.template != null && this.template.equals(TemplateSupportBean.NO_SELECTION) == false)
{
try
{
// apply the templatable aspect if required
if (getNode().hasAspect(ContentModel.ASPECT_TEMPLATABLE) == false)
{
this.nodeService.addAspect(getNode().getNodeRef(), ContentModel.ASPECT_TEMPLATABLE, null);
}
// get the selected template from the Template Picker
NodeRef templateRef = new NodeRef(Repository.getStoreRef(), this.template);
// set the template NodeRef into the templatable aspect property
this.nodeService.setProperty(getNode().getNodeRef(), ContentModel.PROP_TEMPLATE, templateRef);
// reset node details for next refresh of details page
getNode().reset();
}
catch (Exception e)
{
Utils.addErrorMessage(MessageFormat.format(Application.getMessage(
FacesContext.getCurrentInstance(), Repository.ERROR_GENERIC), e.getMessage()), e);
}
}
return getReturnOutcome();
}
/**
* Action handler to remove a dashboard template from the current Space
*/
public String removeTemplate()
{
try
{
// clear template property
this.nodeService.setProperty(getNode().getNodeRef(), ContentModel.PROP_TEMPLATE, null);
this.nodeService.removeAspect(getNode().getNodeRef(), ContentModel.ASPECT_TEMPLATABLE);
// reset node details for next refresh of details page
getNode().reset();
}
catch (Exception e)
{
Utils.addErrorMessage(MessageFormat.format(Application.getMessage(
FacesContext.getCurrentInstance(), Repository.ERROR_GENERIC), e.getMessage()), e);
}
return getReturnOutcome();
}
/**
* @return return to details page JSF navigation outcome
*/
protected abstract String getReturnOutcome();
/**
* Action Handler to take Ownership of the current Space
*/
public void takeOwnership(ActionEvent event)
{
FacesContext fc = FacesContext.getCurrentInstance();
UserTransaction tx = null;
try
{
tx = Repository.getUserTransaction(fc);
tx.begin();
this.ownableService.takeOwnership(getNode().getNodeRef());
String msg = Application.getMessage(fc, MSG_SUCCESS_OWNERSHIP);
FacesMessage facesMsg = new FacesMessage(FacesMessage.SEVERITY_INFO, msg, msg);
String formId = Utils.getParentForm(fc, event.getComponent()).getClientId(fc);
fc.addMessage(formId + ':' + getPropertiesPanelId(), facesMsg);
// commit the transaction
tx.commit();
}
catch (Throwable e)
{
// rollback the transaction
try { if (tx != null) {tx.rollback();} } catch (Exception ex) {}
Utils.addErrorMessage(MessageFormat.format(Application.getMessage(
fc, Repository.ERROR_GENERIC), e.getMessage()), e);
}
}
/**
* @return id of the properties panel component
*/
protected abstract String getPropertiesPanelId();
/**
* Save the state of the panel that was expanded/collapsed
*/
public void expandPanel(ActionEvent event)
{
if (event instanceof ExpandedEvent)
{
String id = event.getComponent().getId();
// we prefix some panels with "no-" which we remove to give consistent behaviour in the UI
if (id.startsWith("no-") == true)
{
id = id.substring(3);
}
this.panels.put(id, ((ExpandedEvent)event).State);
}
}
}

View File

@@ -24,7 +24,6 @@ import java.util.HashMap;
import java.util.List;
import java.util.Map;
import javax.faces.application.FacesMessage;
import javax.faces.context.FacesContext;
import javax.faces.event.ActionEvent;
import javax.transaction.UserTransaction;
@@ -37,10 +36,7 @@ import org.alfresco.service.cmr.lock.LockService;
import org.alfresco.service.cmr.repository.ContentData;
import org.alfresco.service.cmr.repository.CopyService;
import org.alfresco.service.cmr.repository.NodeRef;
import org.alfresco.service.cmr.repository.NodeService;
import org.alfresco.service.cmr.repository.TemplateImageResolver;
import org.alfresco.service.cmr.repository.TemplateNode;
import org.alfresco.service.cmr.security.OwnableService;
import org.alfresco.service.cmr.version.Version;
import org.alfresco.service.cmr.version.VersionHistory;
import org.alfresco.service.cmr.version.VersionService;
@@ -56,7 +52,6 @@ import org.alfresco.web.bean.wizard.NewRuleWizard;
import org.alfresco.web.ui.common.Utils;
import org.alfresco.web.ui.common.Utils.URLMode;
import org.alfresco.web.ui.common.component.UIActionLink;
import org.alfresco.web.ui.common.component.UIPanel.ExpandedEvent;
import org.apache.log4j.Logger;
/**
@@ -64,9 +59,10 @@ import org.apache.log4j.Logger;
*
* @author gavinc
*/
public class DocumentDetailsBean
public class DocumentDetailsBean extends BaseDetailsBean
{
private static final String MSG_SUCCESS_OWNERSHIP = "success_ownership";
private static final String OUTCOME_RETURN = "showDocDetails";
private static final String MSG_HAS_FOLLOWING_CATEGORIES = "has_following_categories";
private static final String MSG_NO_CATEGORIES_APPLIED = "no_categories_applied";
private static final String MSG_ERROR_ASPECT_INLINEEDITABLE = "error_aspect_inlineeditable";
@@ -79,22 +75,19 @@ public class DocumentDetailsBean
private static Logger logger = Logger.getLogger(DocumentDetailsBean.class);
protected BrowseBean browseBean;
protected NodeService nodeService;
protected LockService lockService;
protected CopyService copyService;
protected VersionService versionService;
protected OwnableService ownableService;
protected NavigationBean navigator;
protected CheckOutCheckInService cociService;
private Map<String, Boolean> panels = new HashMap<String, Boolean>(5, 1.0f);
private Map<String, Serializable> workflowProperties;
private NodeRef addedCategory;
private List categories;
// ------------------------------------------------------------------------------
// Construction
/**
* Default constructor
*/
@@ -106,6 +99,10 @@ public class DocumentDetailsBean
panels.put("version-history-panel", false);
}
// ------------------------------------------------------------------------------
// Bean property getters and setters
/**
* Resets any state that may be held by this bean
*/
@@ -119,26 +116,6 @@ public class DocumentDetailsBean
this.addedCategory = null;
}
/**
* Returns the id of the current document
*
* @return The id
*/
public String getId()
{
return getDocument().getId();
}
/**
* Returns the name of the current document
*
* @return Name of the current document
*/
public String getName()
{
return getDocument().getName();
}
/**
* Returns the URL to download content for the current document
*
@@ -156,7 +133,7 @@ public class DocumentDetailsBean
*/
public String getBrowserUrl()
{
Node doc = getLinkResolvedDocument();
Node doc = getLinkResolvedNode();
return Utils.generateURL(FacesContext.getCurrentInstance(), doc, URLMode.HTTP_INLINE);
}
@@ -167,48 +144,16 @@ public class DocumentDetailsBean
*/
public String getDownloadUrl()
{
Node doc = getLinkResolvedDocument();
Node doc = getLinkResolvedNode();
return Utils.generateURL(FacesContext.getCurrentInstance(), doc, URLMode.HTTP_DOWNLOAD);
}
/**
* Returns the WebDAV URL for the current document
*
* @return The WebDAV url
*/
public String getWebdavUrl()
{
Node doc = getLinkResolvedDocument();
return Utils.generateURL(FacesContext.getCurrentInstance(), doc, URLMode.WEBDAV);
}
/**
* Returns the CIFS path for the current document
*
* @return The CIFS path
*/
public String getCifsPath()
{
Node doc = getLinkResolvedDocument();
return Utils.generateURL(FacesContext.getCurrentInstance(), doc, URLMode.CIFS);
}
/**
* Returns the URL to access the details page for the current document
*
* @return The bookmark URL
*/
public String getBookmarkUrl()
{
return Utils.generateURL(FacesContext.getCurrentInstance(), getDocument(), URLMode.SHOW_DETAILS);
}
/**
* Resolve the actual document Node from any Link object that may be proxying it
*
* @return current document Node or document Node resolved from any Link object
*/
private Node getLinkResolvedDocument()
protected Node getLinkResolvedNode()
{
Node document = getDocument();
if (ContentModel.TYPE_FILELINK.equals(document.getType()))
@@ -219,16 +164,6 @@ public class DocumentDetailsBean
return document;
}
/**
* Return the Alfresco NodeRef URL for the current document
*
* @return the Alfresco NodeRef URL
*/
public String getNodeRefUrl()
{
return getDocument().getNodeRef().toString();
}
/**
* Determines whether the current document is versionable
*
@@ -307,7 +242,7 @@ public class DocumentDetailsBean
{
// we know for now that the general classifiable aspect only will be
// applied so we can retrive the categories property direclty
Collection categories = (Collection)this.nodeService.getProperty(this.browseBean.getDocument().getNodeRef(),
Collection categories = (Collection)this.nodeService.getProperty(getDocument().getNodeRef(),
ContentModel.PROP_CATEGORIES);
if (categories == null || categories.size() == 0)
@@ -348,7 +283,7 @@ public class DocumentDetailsBean
*/
public void setupCategoriesForEdit(ActionEvent event)
{
this.categories = (List)this.nodeService.getProperty(this.browseBean.getDocument().getNodeRef(),
this.categories = (List)this.nodeService.getProperty(getDocument().getNodeRef(),
ContentModel.PROP_CATEGORIES);
}
@@ -582,8 +517,7 @@ public class DocumentDetailsBean
}
/**
*
* @return
* Cancel Workflow Edit dialog
*/
public String cancelWorkflowEdit()
{
@@ -1006,7 +940,7 @@ public class DocumentDetailsBean
}
// force recreation of the details view - this means the properties sheet component will reinit
return "showDocDetails";
return OUTCOME_RETURN;
}
/**
@@ -1091,53 +1025,19 @@ public class DocumentDetailsBean
}
/**
* Action Handler to take Ownership of the current document
* @see org.alfresco.web.bean.BaseDetailsBean#getPropertiesPanelId()
*/
public void takeOwnership(ActionEvent event)
protected String getPropertiesPanelId()
{
FacesContext fc = FacesContext.getCurrentInstance();
UserTransaction tx = null;
try
{
tx = Repository.getUserTransaction(fc);
tx.begin();
this.ownableService.takeOwnership(getDocument().getNodeRef());
String msg = Application.getMessage(fc, MSG_SUCCESS_OWNERSHIP);
FacesMessage facesMsg = new FacesMessage(FacesMessage.SEVERITY_INFO, msg, msg);
String formId = Utils.getParentForm(fc, event.getComponent()).getClientId(fc);
fc.addMessage(formId + ":document-props", facesMsg);
// commit the transaction
tx.commit();
}
catch (Throwable e)
{
// rollback the transaction
try { if (tx != null) {tx.rollback();} } catch (Exception ex) {}
Utils.addErrorMessage(MessageFormat.format(Application.getMessage(
fc, Repository.ERROR_GENERIC), e.getMessage()), e);
}
return "document-props";
}
/**
* Save the state of the panel that was expanded/collapsed
* @see org.alfresco.web.bean.BaseDetailsBean#getReturnOutcome()
*/
public void expandPanel(ActionEvent event)
protected String getReturnOutcome()
{
if (event instanceof ExpandedEvent)
{
String id = event.getComponent().getId();
// we prefix some panels with "no-" which we remove to give consistent behaviour in the UI
if (id.startsWith("no-") == true)
{
id = id.substring(3);
}
this.panels.put(id, ((ExpandedEvent)event).State);
}
return OUTCOME_RETURN;
}
/**
@@ -1147,7 +1047,7 @@ public class DocumentDetailsBean
*/
public Map getTemplateModel()
{
HashMap model = new HashMap(2, 1.0f);
Map<String, Object> model = new HashMap<String, Object>(2, 1.0f);
FacesContext fc = FacesContext.getCurrentInstance();
TemplateNode documentNode = new TemplateNode(getDocument().getNodeRef(),
@@ -1160,15 +1060,6 @@ public class DocumentDetailsBean
return model;
}
/** Template Image resolver helper */
private TemplateImageResolver imageResolver = new TemplateImageResolver()
{
public String resolveImagePathForName(String filename, boolean small)
{
return Utils.getFileTypeImage(filename, small);
}
};
/**
* Returns whether the current document is locked
*
@@ -1218,6 +1109,16 @@ public class DocumentDetailsBean
return getDocument().isWorkingCopyOwner();
}
/**
* Returns the Node this bean is currently representing
*
* @return The Node
*/
public Node getNode()
{
return this.browseBean.getDocument();
}
/**
* Returns the document this bean is currently representing
*
@@ -1225,43 +1126,7 @@ public class DocumentDetailsBean
*/
public Node getDocument()
{
return this.browseBean.getDocument();
}
/**
* @return Returns the panels expanded state map.
*/
public Map<String, Boolean> getPanels()
{
return this.panels;
}
/**
* @param panels The panels expanded state map.
*/
public void setPanels(Map<String, Boolean> panels)
{
this.panels = panels;
}
/**
* Sets the BrowseBean instance to use to retrieve the current document
*
* @param browseBean BrowseBean instance
*/
public void setBrowseBean(BrowseBean browseBean)
{
this.browseBean = browseBean;
}
/**
* Sets the node service instance the bean should use
*
* @param nodeService The NodeService
*/
public void setNodeService(NodeService nodeService)
{
this.nodeService = nodeService;
return this.getNode();
}
/**
@@ -1294,16 +1159,6 @@ public class DocumentDetailsBean
this.copyService = copyService;
}
/**
* Sets the ownable service instance the bean should use
*
* @param ownableService The OwnableService
*/
public void setOwnableService(OwnableService ownableService)
{
this.ownableService = ownableService;
}
/**
* Sets the checkincheckout service instance the bean should use
*
@@ -1313,12 +1168,4 @@ public class DocumentDetailsBean
{
this.cociService = cociService;
}
/**
* @param navigator The NavigationBean to set.
*/
public void setNavigator(NavigationBean navigator)
{
this.navigator = navigator;
}
}

View File

@@ -43,36 +43,17 @@ import org.alfresco.web.ui.common.component.UIActionLink;
import org.alfresco.web.ui.common.component.UIPanel.ExpandedEvent;
/**
* Back bean provided access to the details of a Space
* Backing bean provided access to the details of a Space
*
* @author Kevin Roast
*/
public class SpaceDetailsBean
public class SpaceDetailsBean extends BaseDetailsBean
{
private static final String MSG_SUCCESS_OWNERSHIP = "success_ownership";
private static final String OUTCOME_RETURN = "showSpaceDetails";
/** BrowseBean instance */
protected BrowseBean browseBean;
/** The NavigationBean bean reference */
protected NavigationBean navigator;
/** PermissionService bean reference */
protected PermissionService permissionService;
/** OwnableService bean reference */
protected OwnableService ownableService;
/** NodeServuce bean reference */
protected NodeService nodeService;
/** Selected template Id */
private String template;
private Map<String, Boolean> panels = new HashMap<String, Boolean>(4, 1.0f);
// ------------------------------------------------------------------------------
// Construction
@@ -90,32 +71,6 @@ public class SpaceDetailsBean
// ------------------------------------------------------------------------------
// Bean property getters and setters
/**
* Sets the BrowseBean instance to use to retrieve the current Space
*
* @param browseBean BrowseBean instance
*/
public void setBrowseBean(BrowseBean browseBean)
{
this.browseBean = browseBean;
}
/**
* @param navigator The NavigationBean to set.
*/
public void setNavigator(NavigationBean navigator)
{
this.navigator = navigator;
}
/**
* @param nodeService The NodeService to set
*/
public void setNodeService(NodeService nodeService)
{
this.nodeService = nodeService;
}
/**
* @param permissionService The PermissionService to set.
*/
@@ -125,29 +80,13 @@ public class SpaceDetailsBean
}
/**
* Sets the ownable service instance the bean should use
* Returns the Node this bean is currently representing
*
* @param ownableService The OwnableService
* @return The Node
*/
public void setOwnableService(OwnableService ownableService)
public Node getNode()
{
this.ownableService = ownableService;
}
/**
* @return Returns the panels expanded state map.
*/
public Map<String, Boolean> getPanels()
{
return this.panels;
}
/**
* @param panels The panels expanded state map.
*/
public void setPanels(Map<String, Boolean> panels)
{
this.panels = panels;
return this.browseBean.getActionSpace();
}
/**
@@ -157,67 +96,15 @@ public class SpaceDetailsBean
*/
public Node getSpace()
{
return this.browseBean.getActionSpace();
return getNode();
}
/**
* Returns the id of the current space
* Resolve the actual document Node from any Link object that may be proxying it
*
* @return The id
* @return current document Node or document Node resolved from any Link object
*/
public String getId()
{
return getSpace().getId();
}
/**
* Returns the name of the current space
*
* @return Name of the current space
*/
public String getName()
{
return getSpace().getName();
}
/**
* Returns the WebDAV URL for the current space
*
* @return The WebDAV url
*/
public String getWebdavUrl()
{
Node space = getLinkResolvedSpace();
return Utils.generateURL(FacesContext.getCurrentInstance(), space, URLMode.WEBDAV);
}
/**
* Returns the CIFS path for the current space
*
* @return The CIFS path
*/
public String getCifsPath()
{
Node space = getLinkResolvedSpace();
return Utils.generateURL(FacesContext.getCurrentInstance(), space, URLMode.CIFS);
}
/**
* Returns the URL to access the details page for the current space
*
* @return The bookmark URL
*/
public String getBookmarkUrl()
{
return Utils.generateURL(FacesContext.getCurrentInstance(), getSpace(), URLMode.SHOW_DETAILS);
}
/**
* Resolve the actual space Node from any Link object that may be proxying it
*
* @return current space Node or space Node resolved from any Link object
*/
private Node getLinkResolvedSpace()
protected Node getLinkResolvedNode()
{
Node space = getSpace();
if (ContentModel.TYPE_FOLDERLINK.equals(space.getType()))
@@ -228,54 +115,6 @@ public class SpaceDetailsBean
return space;
}
/**
* Return the Alfresco NodeRef URL for the current space
*
* @return the Alfresco NodeRef URL
*/
public String getNodeRefUrl()
{
return getSpace().getNodeRef().toString();
}
/**
* @return Returns the template Id.
*/
public String getTemplate()
{
// return current template if it exists
NodeRef ref = (NodeRef)getSpace().getProperties().get(ContentModel.PROP_TEMPLATE);
return ref != null ? ref.getId() : this.template;
}
/**
* @param template The template Id to set.
*/
public void setTemplate(String template)
{
this.template = template;
}
/**
* @return true if the current document has the 'templatable' aspect applied and
* references a template that currently exists in the system.
*/
public boolean isTemplatable()
{
NodeRef templateRef = (NodeRef)getSpace().getProperties().get(ContentModel.PROP_TEMPLATE);
return (getSpace().hasAspect(ContentModel.ASPECT_TEMPLATABLE) &&
templateRef != null && nodeService.exists(templateRef));
}
/**
* @return String of the NodeRef for the dashboard template used by the space if any
*/
public String getTemplateRef()
{
NodeRef ref = (NodeRef)getSpace().getProperties().get(ContentModel.PROP_TEMPLATE);
return ref != null ? ref.toString() : null;
}
/**
* Returns a model for use by a template on the Space Details page.
*
@@ -287,121 +126,33 @@ public class SpaceDetailsBean
HashMap model = new HashMap(1, 1.0f);
FacesContext fc = FacesContext.getCurrentInstance();
TemplateNode spaceNode = new TemplateNode(getSpace().getNodeRef(), Repository.getServiceRegistry(fc),
new TemplateImageResolver() {
public String resolveImagePathForName(String filename, boolean small) {
return Utils.getFileTypeImage(filename, small);
}
});
TemplateNode spaceNode = new TemplateNode(getSpace().getNodeRef(),
Repository.getServiceRegistry(fc), imageResolver);
model.put("space", spaceNode);
return model;
}
/**
* @see org.alfresco.web.bean.BaseDetailsBean#getPropertiesPanelId()
*/
protected String getPropertiesPanelId()
{
return "space-props";
}
/**
* @see org.alfresco.web.bean.BaseDetailsBean#getReturnOutcome()
*/
protected String getReturnOutcome()
{
return OUTCOME_RETURN;
}
// ------------------------------------------------------------------------------
// Action event handlers
/**
* Action handler to apply the selected Template and Templatable aspect to the current Space
*/
public String applyTemplate()
{
if (this.template != null && this.template.equals(TemplateSupportBean.NO_SELECTION) == false)
{
try
{
// apply the templatable aspect if required
if (getSpace().hasAspect(ContentModel.ASPECT_TEMPLATABLE) == false)
{
this.nodeService.addAspect(getSpace().getNodeRef(), ContentModel.ASPECT_TEMPLATABLE, null);
}
// get the selected template from the Template Picker
NodeRef templateRef = new NodeRef(Repository.getStoreRef(), this.template);
// set the template NodeRef into the templatable aspect property
this.nodeService.setProperty(getSpace().getNodeRef(), ContentModel.PROP_TEMPLATE, templateRef);
// reset space details for next refresh of details page
getSpace().reset();
}
catch (Exception e)
{
Utils.addErrorMessage(MessageFormat.format(Application.getMessage(
FacesContext.getCurrentInstance(), Repository.ERROR_GENERIC), e.getMessage()), e);
}
}
return OUTCOME_RETURN;
}
/**
* Action handler to remove a dashboard template from the current Space
*/
public String removeTemplate()
{
try
{
// clear template property
this.nodeService.setProperty(getSpace().getNodeRef(), ContentModel.PROP_TEMPLATE, null);
this.nodeService.removeAspect(getSpace().getNodeRef(), ContentModel.ASPECT_TEMPLATABLE);
// reset space details for next refresh of details page
getSpace().reset();
}
catch (Exception e)
{
Utils.addErrorMessage(MessageFormat.format(Application.getMessage(
FacesContext.getCurrentInstance(), Repository.ERROR_GENERIC), e.getMessage()), e);
}
return OUTCOME_RETURN;
}
/**
* Action Handler to take Ownership of the current Space
*/
public void takeOwnership(ActionEvent event)
{
FacesContext fc = FacesContext.getCurrentInstance();
UserTransaction tx = null;
try
{
tx = Repository.getUserTransaction(fc);
tx.begin();
this.ownableService.takeOwnership(getSpace().getNodeRef());
String msg = Application.getMessage(fc, MSG_SUCCESS_OWNERSHIP);
FacesMessage facesMsg = new FacesMessage(FacesMessage.SEVERITY_INFO, msg, msg);
String formId = Utils.getParentForm(fc, event.getComponent()).getClientId(fc);
fc.addMessage(formId + ":space-props", facesMsg);
// commit the transaction
tx.commit();
}
catch (Throwable e)
{
// rollback the transaction
try { if (tx != null) {tx.rollback();} } catch (Exception ex) {}
Utils.addErrorMessage(MessageFormat.format(Application.getMessage(
fc, Repository.ERROR_GENERIC), e.getMessage()), e);
}
}
/**
* Save the state of the panel that was expanded/collapsed
*/
public void expandPanel(ActionEvent event)
{
if (event instanceof ExpandedEvent)
{
String id = event.getComponent().getId();
this.panels.put(id, ((ExpandedEvent)event).State);
}
}
/**
* Navigates to next item in the list of Spaces
*/

View File

@@ -273,7 +273,7 @@
</navigation-case>
<navigation-case>
<from-outcome>applyTemplate</from-outcome>
<to-view-id>/jsp/dialog/apply-template.jsp</to-view-id>
<to-view-id>/jsp/dialog/apply-space-template.jsp</to-view-id>
</navigation-case>
<navigation-case>
<from-outcome>previewSpace</from-outcome>
@@ -359,6 +359,10 @@
<from-outcome>manageContentUsers</from-outcome>
<to-view-id>/jsp/roles/manage-content-users.jsp</to-view-id>
</navigation-case>
<navigation-case>
<from-outcome>applyTemplate</from-outcome>
<to-view-id>/jsp/dialog/apply-doc-template.jsp</to-view-id>
</navigation-case>
</navigation-rule>
<navigation-rule>

View File

@@ -0,0 +1,149 @@
<%--
Copyright (C) 2005 Alfresco, Inc.
Licensed under the Mozilla Public License version 1.1
with a permitted attribution clause. You may obtain a
copy of the License at
http://www.alfresco.org/legal/license.txt
Unless required by applicable law or agreed to in writing,
software distributed under the License is distributed on an
"AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND,
either express or implied. See the License for the specific
language governing permissions and limitations under the
License.
--%>
<%@ taglib uri="http://java.sun.com/jsf/html" prefix="h" %>
<%@ taglib uri="http://java.sun.com/jsf/core" prefix="f" %>
<%@ taglib uri="http://java.sun.com/jsp/jstl/core" prefix="c" %>
<%@ taglib uri="/WEB-INF/alfresco.tld" prefix="a" %>
<%@ taglib uri="/WEB-INF/repo.tld" prefix="r" %>
<%@ page buffer="64kb" contentType="text/html;charset=UTF-8" %>
<%@ page isELIgnored="false" %>
<%@ page import="org.alfresco.web.ui.common.PanelGenerator" %>
<r:page titleId="title_apply_template">
<f:view>
<%-- load a bundle of properties with I18N strings --%>
<f:loadBundle basename="alfresco.messages.webclient" var="msg"/>
<h:form acceptCharset="UTF-8" id="apply-template">
<%-- Main outer table --%>
<table cellspacing="0" cellpadding="2">
<%-- Title bar --%>
<tr>
<td colspan="2">
<%@ include file="../parts/titlebar.jsp" %>
</td>
</tr>
<%-- Main area --%>
<tr valign="top">
<%-- Shelf --%>
<td>
<%@ include file="../parts/shelf.jsp" %>
</td>
<%-- Work Area --%>
<td width="100%">
<table cellspacing="0" cellpadding="0" width="100%">
<%-- Breadcrumb --%>
<%@ include file="../parts/breadcrumb.jsp" %>
<%-- Status and Actions --%>
<tr>
<td style="background-image: url(<%=request.getContextPath()%>/images/parts/statuspanel_4.gif)" width="4"></td>
<td bgcolor="#EEEEEE">
<%-- Status and Actions inner contents table --%>
<%-- Generally this consists of an icon, textual summary and actions for the current object --%>
<table cellspacing="4" cellpadding="0" width="100%">
<tr>
<td width="32">
<h:graphicImage url="/images/icons/preview_large.gif"/>
</td>
<td>
<div class="mainTitle"><h:outputText value="#{msg.apply_dashboard}" /> '<h:outputText value="#{DocumentDetailsBean.name}" />'</div>
<div class="mainSubText"><h:outputText value="#{msg.apply_dashboard_doc_info}" /></div>
</td>
</tr>
</table>
</td>
<td style="background-image: url(<%=request.getContextPath()%>/images/parts/statuspanel_6.gif)" width="4"></td>
</tr>
<%-- separator row with gradient shadow --%>
<tr>
<td><img src="<%=request.getContextPath()%>/images/parts/statuspanel_7.gif" width="4" height="9"></td>
<td style="background-image: url(<%=request.getContextPath()%>/images/parts/statuspanel_8.gif)"></td>
<td><img src="<%=request.getContextPath()%>/images/parts/statuspanel_9.gif" width="4" height="9"></td>
</tr>
<%-- Details --%>
<tr valign=top>
<td style="background-image: url(<%=request.getContextPath()%>/images/parts/whitepanel_4.gif)" width="4"></td>
<td>
<table cellspacing="0" cellpadding="3" border="0" width="100%">
<tr>
<td width="100%" valign="top">
<% PanelGenerator.generatePanelStart(out, request.getContextPath(), "white", "white"); %>
<table cellpadding="2" cellspacing="2" border="0" width="100%">
<tr>
<td><h:outputText value="#{msg.template}"/>:</td>
<td width=100%>
<%-- Templates drop-down selector --%>
<h:selectOneMenu value="#{DocumentDetailsBean.template}">
<f:selectItems value="#{TemplateSupportBean.contentTemplates}" />
</h:selectOneMenu>
</td>
</tr>
</table>
<% PanelGenerator.generatePanelEnd(out, request.getContextPath(), "white"); %>
</td>
<td valign="top">
<% PanelGenerator.generatePanelStart(out, request.getContextPath(), "blue", "#D3E6FE"); %>
<table cellpadding="1" cellspacing="1" border="0">
<tr>
<td align="center">
<h:commandButton value="#{msg.ok}" action="#{DocumentDetailsBean.applyTemplate}" styleClass="wizardButton" />
</td>
</tr>
<tr>
<td align="center">
<h:commandButton value="#{msg.cancel}" action="showDocDetails" styleClass="wizardButton" />
</td>
</tr>
</table>
<% PanelGenerator.generatePanelEnd(out, request.getContextPath(), "blue"); %>
</td>
</tr>
</table>
</td>
<td style="background-image: url(<%=request.getContextPath()%>/images/parts/whitepanel_6.gif)" width="4"></td>
</tr>
<%-- separator row with bottom panel graphics --%>
<tr>
<td><img src="<%=request.getContextPath()%>/images/parts/whitepanel_7.gif" width="4" height="4"></td>
<td width="100%" align="center" style="background-image: url(<%=request.getContextPath()%>/images/parts/whitepanel_8.gif)"></td>
<td><img src="<%=request.getContextPath()%>/images/parts/whitepanel_9.gif" width="4" height="4"></td>
</tr>
</table>
</td>
</tr>
</table>
</h:form>
</f:view>
</r:page>

View File

@@ -1,149 +1,149 @@
<%--
Copyright (C) 2005 Alfresco, Inc.
Licensed under the Mozilla Public License version 1.1
with a permitted attribution clause. You may obtain a
copy of the License at
http://www.alfresco.org/legal/license.txt
Unless required by applicable law or agreed to in writing,
software distributed under the License is distributed on an
"AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND,
either express or implied. See the License for the specific
language governing permissions and limitations under the
License.
--%>
<%@ taglib uri="http://java.sun.com/jsf/html" prefix="h" %>
<%@ taglib uri="http://java.sun.com/jsf/core" prefix="f" %>
<%@ taglib uri="http://java.sun.com/jsp/jstl/core" prefix="c" %>
<%@ taglib uri="/WEB-INF/alfresco.tld" prefix="a" %>
<%@ taglib uri="/WEB-INF/repo.tld" prefix="r" %>
<%@ page buffer="64kb" contentType="text/html;charset=UTF-8" %>
<%@ page isELIgnored="false" %>
<%@ page import="org.alfresco.web.ui.common.PanelGenerator" %>
<r:page titleId="title_space_details">
<f:view>
<%-- load a bundle of properties with I18N strings --%>
<f:loadBundle basename="alfresco.messages.webclient" var="msg"/>
<h:form acceptCharset="UTF-8" id="document-details">
<%-- Main outer table --%>
<table cellspacing="0" cellpadding="2">
<%-- Title bar --%>
<tr>
<td colspan="2">
<%@ include file="../parts/titlebar.jsp" %>
</td>
</tr>
<%-- Main area --%>
<tr valign="top">
<%-- Shelf --%>
<td>
<%@ include file="../parts/shelf.jsp" %>
</td>
<%-- Work Area --%>
<td width="100%">
<table cellspacing="0" cellpadding="0" width="100%">
<%-- Breadcrumb --%>
<%@ include file="../parts/breadcrumb.jsp" %>
<%-- Status and Actions --%>
<tr>
<td style="background-image: url(<%=request.getContextPath()%>/images/parts/statuspanel_4.gif)" width="4"></td>
<td bgcolor="#EEEEEE">
<%-- Status and Actions inner contents table --%>
<%-- Generally this consists of an icon, textual summary and actions for the current object --%>
<table cellspacing="4" cellpadding="0" width="100%">
<tr>
<td width="32">
<h:graphicImage url="/images/icons/preview_large.gif"/>
</td>
<td>
<div class="mainTitle"><h:outputText value="#{msg.apply_dashboard}" /> '<h:outputText value="#{SpaceDetailsBean.name}" />'</div>
<div class="mainSubText"><h:outputText value="#{msg.apply_dashboard_info}" /></div>
</td>
</tr>
</table>
</td>
<td style="background-image: url(<%=request.getContextPath()%>/images/parts/statuspanel_6.gif)" width="4"></td>
</tr>
<%-- separator row with gradient shadow --%>
<tr>
<td><img src="<%=request.getContextPath()%>/images/parts/statuspanel_7.gif" width="4" height="9"></td>
<td style="background-image: url(<%=request.getContextPath()%>/images/parts/statuspanel_8.gif)"></td>
<td><img src="<%=request.getContextPath()%>/images/parts/statuspanel_9.gif" width="4" height="9"></td>
</tr>
<%-- Details --%>
<tr valign=top>
<td style="background-image: url(<%=request.getContextPath()%>/images/parts/whitepanel_4.gif)" width="4"></td>
<td>
<table cellspacing="0" cellpadding="3" border="0" width="100%">
<tr>
<td width="100%" valign="top">
<% PanelGenerator.generatePanelStart(out, request.getContextPath(), "white", "white"); %>
<table cellpadding="2" cellspacing="2" border="0" width="100%">
<tr>
<td><h:outputText value="#{msg.template}"/>:</td>
<td width=100%>
<%-- Templates drop-down selector --%>
<h:selectOneMenu value="#{SpaceDetailsBean.template}">
<f:selectItems value="#{TemplateSupportBean.contentTemplates}" />
</h:selectOneMenu>
</td>
</tr>
</table>
<% PanelGenerator.generatePanelEnd(out, request.getContextPath(), "white"); %>
</td>
<td valign="top">
<% PanelGenerator.generatePanelStart(out, request.getContextPath(), "blue", "#D3E6FE"); %>
<table cellpadding="1" cellspacing="1" border="0">
<tr>
<td align="center">
<h:commandButton value="#{msg.ok}" action="#{SpaceDetailsBean.applyTemplate}" styleClass="wizardButton" />
</td>
</tr>
<tr>
<td align="center">
<h:commandButton value="#{msg.cancel}" action="showSpaceDetails" styleClass="wizardButton" />
</td>
</tr>
</table>
<% PanelGenerator.generatePanelEnd(out, request.getContextPath(), "blue"); %>
</td>
</tr>
</table>
</td>
<td style="background-image: url(<%=request.getContextPath()%>/images/parts/whitepanel_6.gif)" width="4"></td>
</tr>
<%-- separator row with bottom panel graphics --%>
<tr>
<td><img src="<%=request.getContextPath()%>/images/parts/whitepanel_7.gif" width="4" height="4"></td>
<td width="100%" align="center" style="background-image: url(<%=request.getContextPath()%>/images/parts/whitepanel_8.gif)"></td>
<td><img src="<%=request.getContextPath()%>/images/parts/whitepanel_9.gif" width="4" height="4"></td>
</tr>
</table>
</td>
</tr>
</table>
</h:form>
</f:view>
<%--
Copyright (C) 2005 Alfresco, Inc.
Licensed under the Mozilla Public License version 1.1
with a permitted attribution clause. You may obtain a
copy of the License at
http://www.alfresco.org/legal/license.txt
Unless required by applicable law or agreed to in writing,
software distributed under the License is distributed on an
"AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND,
either express or implied. See the License for the specific
language governing permissions and limitations under the
License.
--%>
<%@ taglib uri="http://java.sun.com/jsf/html" prefix="h" %>
<%@ taglib uri="http://java.sun.com/jsf/core" prefix="f" %>
<%@ taglib uri="http://java.sun.com/jsp/jstl/core" prefix="c" %>
<%@ taglib uri="/WEB-INF/alfresco.tld" prefix="a" %>
<%@ taglib uri="/WEB-INF/repo.tld" prefix="r" %>
<%@ page buffer="64kb" contentType="text/html;charset=UTF-8" %>
<%@ page isELIgnored="false" %>
<%@ page import="org.alfresco.web.ui.common.PanelGenerator" %>
<r:page titleId="title_apply_template">
<f:view>
<%-- load a bundle of properties with I18N strings --%>
<f:loadBundle basename="alfresco.messages.webclient" var="msg"/>
<h:form acceptCharset="UTF-8" id="apply-template">
<%-- Main outer table --%>
<table cellspacing="0" cellpadding="2">
<%-- Title bar --%>
<tr>
<td colspan="2">
<%@ include file="../parts/titlebar.jsp" %>
</td>
</tr>
<%-- Main area --%>
<tr valign="top">
<%-- Shelf --%>
<td>
<%@ include file="../parts/shelf.jsp" %>
</td>
<%-- Work Area --%>
<td width="100%">
<table cellspacing="0" cellpadding="0" width="100%">
<%-- Breadcrumb --%>
<%@ include file="../parts/breadcrumb.jsp" %>
<%-- Status and Actions --%>
<tr>
<td style="background-image: url(<%=request.getContextPath()%>/images/parts/statuspanel_4.gif)" width="4"></td>
<td bgcolor="#EEEEEE">
<%-- Status and Actions inner contents table --%>
<%-- Generally this consists of an icon, textual summary and actions for the current object --%>
<table cellspacing="4" cellpadding="0" width="100%">
<tr>
<td width="32">
<h:graphicImage url="/images/icons/preview_large.gif"/>
</td>
<td>
<div class="mainTitle"><h:outputText value="#{msg.apply_dashboard}" /> '<h:outputText value="#{SpaceDetailsBean.name}" />'</div>
<div class="mainSubText"><h:outputText value="#{msg.apply_dashboard_info}" /></div>
</td>
</tr>
</table>
</td>
<td style="background-image: url(<%=request.getContextPath()%>/images/parts/statuspanel_6.gif)" width="4"></td>
</tr>
<%-- separator row with gradient shadow --%>
<tr>
<td><img src="<%=request.getContextPath()%>/images/parts/statuspanel_7.gif" width="4" height="9"></td>
<td style="background-image: url(<%=request.getContextPath()%>/images/parts/statuspanel_8.gif)"></td>
<td><img src="<%=request.getContextPath()%>/images/parts/statuspanel_9.gif" width="4" height="9"></td>
</tr>
<%-- Details --%>
<tr valign=top>
<td style="background-image: url(<%=request.getContextPath()%>/images/parts/whitepanel_4.gif)" width="4"></td>
<td>
<table cellspacing="0" cellpadding="3" border="0" width="100%">
<tr>
<td width="100%" valign="top">
<% PanelGenerator.generatePanelStart(out, request.getContextPath(), "white", "white"); %>
<table cellpadding="2" cellspacing="2" border="0" width="100%">
<tr>
<td><h:outputText value="#{msg.template}"/>:</td>
<td width=100%>
<%-- Templates drop-down selector --%>
<h:selectOneMenu value="#{SpaceDetailsBean.template}">
<f:selectItems value="#{TemplateSupportBean.contentTemplates}" />
</h:selectOneMenu>
</td>
</tr>
</table>
<% PanelGenerator.generatePanelEnd(out, request.getContextPath(), "white"); %>
</td>
<td valign="top">
<% PanelGenerator.generatePanelStart(out, request.getContextPath(), "blue", "#D3E6FE"); %>
<table cellpadding="1" cellspacing="1" border="0">
<tr>
<td align="center">
<h:commandButton value="#{msg.ok}" action="#{SpaceDetailsBean.applyTemplate}" styleClass="wizardButton" />
</td>
</tr>
<tr>
<td align="center">
<h:commandButton value="#{msg.cancel}" action="showSpaceDetails" styleClass="wizardButton" />
</td>
</tr>
</table>
<% PanelGenerator.generatePanelEnd(out, request.getContextPath(), "blue"); %>
</td>
</tr>
</table>
</td>
<td style="background-image: url(<%=request.getContextPath()%>/images/parts/whitepanel_6.gif)" width="4"></td>
</tr>
<%-- separator row with bottom panel graphics --%>
<tr>
<td><img src="<%=request.getContextPath()%>/images/parts/whitepanel_7.gif" width="4" height="4"></td>
<td width="100%" align="center" style="background-image: url(<%=request.getContextPath()%>/images/parts/whitepanel_8.gif)"></td>
<td><img src="<%=request.getContextPath()%>/images/parts/whitepanel_9.gif" width="4" height="4"></td>
</tr>
</table>
</td>
</tr>
</table>
</h:form>
</f:view>
</r:page>

View File

@@ -116,6 +116,37 @@
<table cellspacing="0" cellpadding="3" border="0" width="100%">
<tr>
<td width="100%" valign="top">
<%-- wrapper comment used by the panel to add additional component facets --%>
<h:panelGroup id="dashboard-panel-facets">
<f:facet name="title">
<r:permissionEvaluator value="#{DocumentDetailsBean.document}" allow="Write" id="evalChange">
<a:actionLink id="actModify" value="#{msg.modify}" action="applyTemplate" showLink="false" image="/images/icons/preview.gif" style="padding-right:8px" />
<a:actionLink id="actRemove" value="#{msg.remove}" action="#{DocumentDetailsBean.removeTemplate}" showLink="false" image="/images/icons/delete.gif" />
</r:permissionEvaluator>
</f:facet>
</h:panelGroup>
<a:panel label="#{msg.dashboard_view}" id="dashboard-panel" progressive="true" facetsId="dashboard-panel-facets"
border="white" bgcolor="white" titleBorder="blue" titleBgcolor="#D3E6FE"
expanded='#{DocumentDetailsBean.panels["dashboard-panel"]}' expandedActionListener="#{DocumentDetailsBean.expandPanel}">
<table width=100% cellspacing=0 cellpadding=0 border=0>
<tr>
<td align=left>
<r:permissionEvaluator value="#{DocumentDetailsBean.document}" allow="Write" id="evalApply">
<a:actionLink id="actDashboard" value="#{msg.apply_dashboard}" rendered="#{DocumentDetailsBean.templatable == false}"
action="applyTemplate" />
</r:permissionEvaluator>
<a:panel id="template-panel" rendered="#{DocumentDetailsBean.templatable == true}">
<div style="padding:4px;border: 1px dashed #cccccc">
<r:template id="dashboard" template="#{DocumentDetailsBean.templateRef}" model="#{DocumentDetailsBean.templateModel}" />
</div>
</a:panel>
</td>
</tr>
</table>
</a:panel>
<div style="padding:4px"></div>
<a:panel label="#{msg.view_links}" id="preview-panel" progressive="true"
border="white" bgcolor="white" titleBorder="blue" titleBgcolor="#D3E6FE"
expanded='#{DocumentDetailsBean.panels["preview-panel"]}' expandedActionListener="#{DocumentDetailsBean.expandPanel}">

View File

@@ -128,7 +128,7 @@
<table cellpadding="1" cellspacing="1" border="0">
<tr>
<td align="center">
<h:commandButton value="#{msg.close}" action="browse" styleClass="wizardButton" />
<h:commandButton value="#{msg.close}" action="dialog:close" styleClass="wizardButton" />
</td>
</tr>
</table>

View File

@@ -128,7 +128,7 @@
<table cellpadding="1" cellspacing="1" border="0">
<tr>
<td align="center">
<h:commandButton value="#{msg.close}" action="browse" styleClass="wizardButton" />
<h:commandButton value="#{msg.close}" action="dialog:close" styleClass="wizardButton" />
</td>
</tr>
</table>