Merge V1.3 to HEAD (2976:3004)

svn merge svn://www.alfresco.org:3691/alfresco/BRANCHES/V1.3@2976 svn://www.alfresco.org:3691/alfresco/BRANCHES/V1.3@3004 .


git-svn-id: https://svn.alfresco.com/repos/alfresco-enterprise/alfresco/HEAD/root@3335 c4b6b30b-aa2e-2d43-bbcb-ca4b014f7261
This commit is contained in:
Derek Hulley
2006-07-18 14:50:00 +00:00
parent 1c5f72db89
commit c0a2579654
12 changed files with 238 additions and 35 deletions

View File

@@ -47,7 +47,7 @@ import org.apache.commons.logging.LogFactory;
* The 'processor-name' identifies the command processor to execute the command. For example the
* 'workflow' processor will execute workflow commands upon a node (e.g. "approve" or "reject").
* For example:
* <pre>/alfresco/command/workflow/approve/workspace/SpacesStore/0000-0000-0000-0000
* <pre>/alfresco/command/workflow/approve/workspace/SpacesStore/0000-0000-0000-0000</pre>
* The store protocol, followed by the store ID, followed by the content Node Id used to
* identify the node to execute the workflow action upon.
* <p>

View File

@@ -0,0 +1,128 @@
/*
* Copyright (C) 2005 Alfresco, Inc.
*
* Licensed under the Alfresco Network License. You may obtain a
* copy of the License at
*
* http://www.alfrescosoftware.com/legal/
*
* Please view the license relevant to your network subscription.
*
* BY CLICKING THE "I UNDERSTAND AND ACCEPT" BOX, OR INSTALLING,
* READING OR USING ALFRESCO'S Network SOFTWARE (THE "SOFTWARE"),
* YOU ARE AGREEING ON BEHALF OF THE ENTITY LICENSING THE SOFTWARE
* ("COMPANY") THAT COMPANY WILL BE BOUND BY AND IS BECOMING A PARTY TO
* THIS ALFRESCO NETWORK AGREEMENT ("AGREEMENT") AND THAT YOU HAVE THE
* AUTHORITY TO BIND COMPANY. IF COMPANY DOES NOT AGREE TO ALL OF THE
* TERMS OF THIS AGREEMENT, DO NOT SELECT THE "I UNDERSTAND AND AGREE"
* BOX AND DO NOT INSTALL THE SOFTWARE OR VIEW THE SOURCE CODE. COMPANY
* HAS NOT BECOME A LICENSEE OF, AND IS NOT AUTHORIZED TO USE THE
* SOFTWARE UNLESS AND UNTIL IT HAS AGREED TO BE BOUND BY THESE LICENSE
* TERMS. THE "EFFECTIVE DATE" FOR THIS AGREEMENT SHALL BE THE DAY YOU
* CHECK THE "I UNDERSTAND AND ACCEPT" BOX.
*/
package org.alfresco.web.bean;
import java.security.Principal;
import java.text.MessageFormat;
import java.util.Date;
import javax.faces.context.FacesContext;
import org.alfresco.service.descriptor.DescriptorService;
import org.alfresco.service.license.LicenseDescriptor;
import org.alfresco.web.app.Application;
/**
* Backing Bean for the License Management pages.
*
* @author David Caruana
*/
public class LicenseBean
{
/** The DescriptorService to be used by the bean */
private DescriptorService descriptorService;
// ------------------------------------------------------------------------------
// Bean property getters and setters
/**
* @param descriptorService The DescriptorService to set.
*/
public void setDescriptorService(DescriptorService descriptorService)
{
this.descriptorService = descriptorService;
}
/**
* Gets the License Description
*
* @return license description
*/
public String getLicenseDescription()
{
String description = "";
LicenseDescriptor descriptor = descriptorService.getLicenseDescriptor();
if (descriptor != null)
{
String subject = descriptor.getSubject();
String holder = getHolderOrganisation(descriptor.getHolder());
Date issued = descriptor.getIssued();
Date validUntil = descriptor.getValidUntil();
if (validUntil == null)
{
description = Application.getMessage(FacesContext.getCurrentInstance(), "admin_unlimited_license");
description = MessageFormat.format(description, new Object[] { subject, holder, issued });
}
else
{
int days = descriptor.getDays();
int remainingDays = descriptor.getRemainingDays();
description = Application.getMessage(FacesContext.getCurrentInstance(), "admin_limited_license");
description = MessageFormat.format(description, new Object[] { subject, holder, issued, days, validUntil, remainingDays });
}
}
else
{
description = Application.getMessage(FacesContext.getCurrentInstance(), "admin_invalid_license");
}
return description;
}
/**
* Get Organisation from Principal
*
* @param holderPrincipal
* @return organisation
*/
private String getHolderOrganisation(Principal holderPrincipal)
{
String holder = null;
if (holderPrincipal != null)
{
holder = holderPrincipal.getName();
if (holder != null)
{
String[] properties = holder.split(",");
for (String property : properties)
{
String[] parts = property.split("=");
if (parts[0].equals("O"))
{
holder = parts[1];
}
}
}
}
return holder;
}
}

View File

@@ -61,6 +61,8 @@ import org.alfresco.web.ui.common.component.UIModeList;
import org.alfresco.web.ui.common.component.data.UIRichList;
/**
* Backing bean for the Manage Deleted Items (soft delete and archiving) pages.
*
* @author Kevin Roast
*/
public class TrashcanBean implements IContextListener

View File

@@ -14,6 +14,7 @@ import org.alfresco.service.cmr.action.Action;
import org.alfresco.service.cmr.action.ActionDefinition;
import org.alfresco.service.cmr.repository.NodeRef;
import org.alfresco.web.app.Application;
import org.alfresco.web.bean.repository.Node;
import org.alfresco.web.bean.repository.Repository;
import org.alfresco.web.data.IDataContainer;
import org.alfresco.web.data.QuickSort;
@@ -89,7 +90,19 @@ public class RunActionWizard extends BaseActionWizard
{
// reset the current document properties/aspects in case we have changed them
// during the execution of the custom action
this.browseBean.getDocument().reset();
Node document = this.browseBean.getDocument();
if (document != null)
{
document.reset();
}
// reset the current space properties/aspects as well in case we have
// changed them during the execution of the custom action
Node space = this.browseBean.getActionSpace();
if (space != null)
{
space.reset();
}
return outcome;
}

View File

@@ -3,12 +3,17 @@ package org.alfresco.web.bean.content;
import java.io.File;
import java.io.Serializable;
import java.text.MessageFormat;
import java.util.ArrayList;
import java.util.HashMap;
import java.util.List;
import java.util.Map;
import javax.faces.context.FacesContext;
import javax.faces.event.ActionEvent;
import org.alfresco.config.Config;
import org.alfresco.config.ConfigElement;
import org.alfresco.config.ConfigService;
import org.alfresco.model.ContentModel;
import org.alfresco.repo.content.MimetypeMap;
import org.alfresco.repo.content.filestore.FileContentReader;
@@ -26,6 +31,7 @@ import org.alfresco.web.bean.repository.Repository;
*/
public class AddContentDialog extends BaseContentWizard
{
protected List<String> inlineEditableMimeTypes;
protected File file;
// ------------------------------------------------------------------------------
@@ -53,7 +59,16 @@ public class AddContentDialog extends BaseContentWizard
{
this.title = this.fileName;
}
// determine whether inline editing should be enabled by default.
// if the mime type of the added file is in the list of mime types
// configured in "Content Wizards" then enable inline editing
List<String> mimeTypes = getInlineEditableMimeTypes();
if (mimeTypes.contains(this.mimeType))
{
this.inlineEdit = true;
}
saveContent(this.file, null);
// return default outcome
@@ -71,6 +86,8 @@ public class AddContentDialog extends BaseContentWizard
@Override
protected String doPostCommitProcessing(FacesContext context, String outcome)
{
clearUpload();
// as we were successful, go to the set properties dialog if asked
// to otherwise just return
if (this.showOtherProperties)
@@ -214,4 +231,30 @@ public class AddContentDialog extends BaseContentWizard
FacesContext ctx = FacesContext.getCurrentInstance();
ctx.getExternalContext().getSessionMap().remove(FileUploadBean.FILE_UPLOAD_BEAN_NAME);
}
protected List<String> getInlineEditableMimeTypes()
{
if (this.inlineEditableMimeTypes == null)
{
this.inlineEditableMimeTypes = new ArrayList<String>(8);
// get the create mime types list from the config
ConfigService svc = Application.getConfigService(FacesContext.getCurrentInstance());
Config wizardCfg = svc.getConfig("Content Wizards");
if (wizardCfg != null)
{
ConfigElement typesCfg = wizardCfg.getConfigElement("create-mime-types");
if (typesCfg != null)
{
for (ConfigElement child : typesCfg.getChildren())
{
String currentMimeType = child.getAttribute("name");
this.inlineEditableMimeTypes.add(currentMimeType);
}
}
}
}
return this.inlineEditableMimeTypes;
}
}

View File

@@ -16,9 +16,10 @@
*/
package org.alfresco.web.config;
import java.util.Set;
import javax.faces.context.FacesContext;
import org.alfresco.config.evaluator.Evaluator;
import org.alfresco.service.cmr.dictionary.DictionaryService;
import org.alfresco.service.namespace.QName;
import org.alfresco.web.bean.repository.Node;
import org.alfresco.web.bean.repository.Repository;
@@ -28,7 +29,7 @@ import org.alfresco.web.bean.repository.Repository;
*
* @author gavinc
*/
public class AspectEvaluator implements Evaluator
public final class AspectEvaluator implements Evaluator
{
/**
* Determines whether the given aspect is applied to the given object
@@ -37,19 +38,19 @@ public class AspectEvaluator implements Evaluator
*/
public boolean applies(Object obj, String condition)
{
boolean result = false;
if (obj instanceof Node)
{
Set aspects = ((Node)obj).getAspects();
if (aspects != null)
DictionaryService dd = Repository.getServiceRegistry(FacesContext.getCurrentInstance()).getDictionaryService();
QName aspectQName = Repository.resolveToQName(condition);
for (QName aspect : ((Node)obj).getAspects())
{
QName spaceQName = Repository.resolveToQName(condition);
result = aspects.contains(spaceQName);
if (dd.isSubClass(aspect, aspectQName) == true)
{
return true;
}
}
}
return result;
return false;
}
}

View File

@@ -47,19 +47,9 @@ public class PageTag extends TagSupport
*/
private final static String ALF_URL = "http://www.alfresco.com";
private final static String ALF_LOGO = "http://www.alfresco.com/images/alfresco_community_horizont.gif";
private final static String SF_LOGO = "/images/logo/sflogo.php.png";
private final static String ALF_TEXT = "Alfresco Community";
private final static String ALF_COPY = "Supplied free of charge with " +
"<a class=footer href='http://www.alfresco.com/services/support/communityterms/#support'>no support</a>, " +
"<a class=footer href='http://www.alfresco.com/services/support/communityterms/#certification'>no certification</a>, " +
"<a class=footer href='http://www.alfresco.com/services/support/communityterms/#maintenance'>no maintenance</a>, " +
"<a class=footer href='http://www.alfresco.com/services/support/communityterms/#warranty'>no warranty</a> and " +
"<a class=footer href='http://www.alfresco.com/services/support/communityterms/#indemnity'>no indemnity</a> by " +
"<a class=footer href='http://www.alfresco.com'>Alfresco</a> or its " +
"<a class=footer href='http://www.alfresco.com/partners/'>Certified Partners</a>. " +
"<a class=footer href='http://www.alfresco.com/services/support/'>Click here for support</a>. " +
"Alfresco Software Inc. &copy; 2005-2006 All rights reserved.";
private final static String ALF_LOGO = "/images/logo/alfresco_enterprise.gif";
private final static String ALF_TEXT = "Alfresco Enterprise";
private final static String ALF_COPY = "Certified and supported. Alfresco Software Inc. &copy; 2005-2006 All rights reserved.";
private static Log logger = LogFactory.getLog(PageTag.class);
private static String alfresco = null;
@@ -211,11 +201,10 @@ public class PageTag extends TagSupport
String reqPath = ((HttpServletRequest)pageContext.getRequest()).getContextPath();
alfresco = "<center><table><tr><td>" +
"<a href='" + ALF_URL + "'>" +
"<img border=0 alt='' title='" + ALF_TEXT + "' align=absmiddle src='" + ALF_LOGO + "'>" +
"<img border=0 alt='' title='" + ALF_TEXT + "' align=absmiddle src='" + reqPath + ALF_LOGO + "'>" +
"</a></td><td align=center>" +
"<span class=footer>" + ALF_COPY +
"</span></td><td><a href='http://sourceforge.net/projects/alfresco'><img border=0 alt='' title='SourceForge' align=absmiddle src='" +
reqPath + SF_LOGO + "'></a>" +
"</span></td><td>" +
"</td></tr></table></center>";
}