mirror of
https://github.com/Alfresco/alfresco-community-repo.git
synced 2025-08-07 17:49:17 +00:00
Merged 5.1.N (5.1.2) to 5.2.N (5.2.1)
125605 rmunteanu: Merged 5.1.1 (5.1.1) to 5.1.N (5.1.2) 125498 slanglois: MNT-16155 Update source headers - remove svn:eol-style property on Java and JSP source files git-svn-id: https://svn.alfresco.com/repos/alfresco-enterprise/alfresco/BRANCHES/DEV/5.2.N/root@125783 c4b6b30b-aa2e-2d43-bbcb-ca4b014f7261
This commit is contained in:
@@ -1,107 +1,107 @@
|
||||
package org.alfresco.web.bean.rules.handlers;
|
||||
|
||||
import java.io.Serializable;
|
||||
import java.text.MessageFormat;
|
||||
import java.util.List;
|
||||
import java.util.Map;
|
||||
|
||||
import javax.faces.context.FacesContext;
|
||||
|
||||
import org.alfresco.repo.action.ActionModel;
|
||||
import org.alfresco.web.app.Application;
|
||||
import org.alfresco.web.bean.wizard.IWizardBean;
|
||||
import org.apache.commons.logging.Log;
|
||||
import org.apache.commons.logging.LogFactory;
|
||||
|
||||
/**
|
||||
* @author Jean Barmash
|
||||
* This class has no equivalent evaluator, since it
|
||||
*
|
||||
*/
|
||||
public class CompositeConditionHandler extends BaseConditionHandler
|
||||
{
|
||||
public static final String NAME = "composite-condition";
|
||||
public static final String PROP_COMPOSITE_CONDITION = "composite-condition";
|
||||
|
||||
private static final Log logger = LogFactory.getLog(CompositeConditionHandler.class);
|
||||
|
||||
public static final String PROP_CONDITION_OR = "orconditions";
|
||||
|
||||
/* (non-Javadoc)
|
||||
* @see org.alfresco.web.bean.actions.IHandler#generateSummary(javax.faces.context.FacesContext, org.alfresco.web.bean.wizard.IWizardBean, java.util.Map)
|
||||
*/
|
||||
public String generateSummary(FacesContext context, IWizardBean wizard,
|
||||
Map<String, Serializable> props)
|
||||
{
|
||||
List<Object> conditionPropertiesList = (List<Object>) props.get(PROP_COMPOSITE_CONDITION);
|
||||
if (conditionPropertiesList == null )
|
||||
{
|
||||
logger.error("Error - composite condition has no sub-conditions");
|
||||
|
||||
if (logger.isDebugEnabled())
|
||||
{
|
||||
for (String str : props.keySet())
|
||||
{
|
||||
logger.debug("\t key - "+ str + " value " + props.get(str));
|
||||
}
|
||||
}
|
||||
|
||||
return Application.getMessage(context, "condition_composite_error");
|
||||
}
|
||||
|
||||
Boolean not = (Boolean) props.get(PROP_CONDITION_NOT);
|
||||
Boolean orconditions = (Boolean) props.get(PROP_CONDITION_OR);
|
||||
|
||||
String msgId = not.booleanValue() ? "condition_composite_summary_not" : "condition_composite_summary";
|
||||
return MessageFormat.format(Application.getMessage(context, msgId),
|
||||
new Object[] {conditionPropertiesList.size(), orconditions.booleanValue()?"ORed":"ANDed"});
|
||||
}
|
||||
|
||||
/* (non-Javadoc)
|
||||
* @see org.alfresco.web.bean.actions.IHandler#getJSPPath()
|
||||
*/
|
||||
public String getJSPPath()
|
||||
{
|
||||
return getJSPPath(CompositeConditionHandler.NAME);
|
||||
}
|
||||
|
||||
/* (non-Javadoc)
|
||||
* @see org.alfresco.web.bean.actions.IHandler#prepareForEdit(java.util.Map, java.util.Map)
|
||||
*/
|
||||
public void prepareForEdit(Map<String, Serializable> uiConditionProps,
|
||||
Map<String, Serializable> repoProps)
|
||||
{
|
||||
if (logger.isDebugEnabled())
|
||||
logger.debug("Preparing Composite Condition for Edit");
|
||||
|
||||
Boolean orconditions = (Boolean) repoProps.get(PROP_CONDITION_OR);
|
||||
if (orconditions == null)
|
||||
{
|
||||
if (logger.isWarnEnabled())
|
||||
logger.warn("orconditions is NULL, it should not be. Defaulting to false");
|
||||
|
||||
orconditions = Boolean.FALSE;
|
||||
}
|
||||
|
||||
uiConditionProps.put(PROP_CONDITION_OR, orconditions);
|
||||
}
|
||||
|
||||
public void prepareForSave(Map<String, Serializable> uiConditionProps,
|
||||
Map<String, Serializable> repoProps)
|
||||
{
|
||||
if (logger.isDebugEnabled())
|
||||
logger.debug("Saving Composite Condition");
|
||||
|
||||
// put the selected category in the condition params
|
||||
Boolean orconditions = (Boolean)uiConditionProps.get(PROP_CONDITION_OR);
|
||||
if (orconditions == null)
|
||||
{
|
||||
if (logger.isWarnEnabled())
|
||||
logger.warn("orconditions is NULL, it should not be. Defaulting to false");
|
||||
|
||||
orconditions = Boolean.FALSE;
|
||||
}
|
||||
|
||||
repoProps.put(PROP_CONDITION_OR, orconditions);
|
||||
}
|
||||
}
|
||||
package org.alfresco.web.bean.rules.handlers;
|
||||
|
||||
import java.io.Serializable;
|
||||
import java.text.MessageFormat;
|
||||
import java.util.List;
|
||||
import java.util.Map;
|
||||
|
||||
import javax.faces.context.FacesContext;
|
||||
|
||||
import org.alfresco.repo.action.ActionModel;
|
||||
import org.alfresco.web.app.Application;
|
||||
import org.alfresco.web.bean.wizard.IWizardBean;
|
||||
import org.apache.commons.logging.Log;
|
||||
import org.apache.commons.logging.LogFactory;
|
||||
|
||||
/**
|
||||
* @author Jean Barmash
|
||||
* This class has no equivalent evaluator, since it
|
||||
*
|
||||
*/
|
||||
public class CompositeConditionHandler extends BaseConditionHandler
|
||||
{
|
||||
public static final String NAME = "composite-condition";
|
||||
public static final String PROP_COMPOSITE_CONDITION = "composite-condition";
|
||||
|
||||
private static final Log logger = LogFactory.getLog(CompositeConditionHandler.class);
|
||||
|
||||
public static final String PROP_CONDITION_OR = "orconditions";
|
||||
|
||||
/* (non-Javadoc)
|
||||
* @see org.alfresco.web.bean.actions.IHandler#generateSummary(javax.faces.context.FacesContext, org.alfresco.web.bean.wizard.IWizardBean, java.util.Map)
|
||||
*/
|
||||
public String generateSummary(FacesContext context, IWizardBean wizard,
|
||||
Map<String, Serializable> props)
|
||||
{
|
||||
List<Object> conditionPropertiesList = (List<Object>) props.get(PROP_COMPOSITE_CONDITION);
|
||||
if (conditionPropertiesList == null )
|
||||
{
|
||||
logger.error("Error - composite condition has no sub-conditions");
|
||||
|
||||
if (logger.isDebugEnabled())
|
||||
{
|
||||
for (String str : props.keySet())
|
||||
{
|
||||
logger.debug("\t key - "+ str + " value " + props.get(str));
|
||||
}
|
||||
}
|
||||
|
||||
return Application.getMessage(context, "condition_composite_error");
|
||||
}
|
||||
|
||||
Boolean not = (Boolean) props.get(PROP_CONDITION_NOT);
|
||||
Boolean orconditions = (Boolean) props.get(PROP_CONDITION_OR);
|
||||
|
||||
String msgId = not.booleanValue() ? "condition_composite_summary_not" : "condition_composite_summary";
|
||||
return MessageFormat.format(Application.getMessage(context, msgId),
|
||||
new Object[] {conditionPropertiesList.size(), orconditions.booleanValue()?"ORed":"ANDed"});
|
||||
}
|
||||
|
||||
/* (non-Javadoc)
|
||||
* @see org.alfresco.web.bean.actions.IHandler#getJSPPath()
|
||||
*/
|
||||
public String getJSPPath()
|
||||
{
|
||||
return getJSPPath(CompositeConditionHandler.NAME);
|
||||
}
|
||||
|
||||
/* (non-Javadoc)
|
||||
* @see org.alfresco.web.bean.actions.IHandler#prepareForEdit(java.util.Map, java.util.Map)
|
||||
*/
|
||||
public void prepareForEdit(Map<String, Serializable> uiConditionProps,
|
||||
Map<String, Serializable> repoProps)
|
||||
{
|
||||
if (logger.isDebugEnabled())
|
||||
logger.debug("Preparing Composite Condition for Edit");
|
||||
|
||||
Boolean orconditions = (Boolean) repoProps.get(PROP_CONDITION_OR);
|
||||
if (orconditions == null)
|
||||
{
|
||||
if (logger.isWarnEnabled())
|
||||
logger.warn("orconditions is NULL, it should not be. Defaulting to false");
|
||||
|
||||
orconditions = Boolean.FALSE;
|
||||
}
|
||||
|
||||
uiConditionProps.put(PROP_CONDITION_OR, orconditions);
|
||||
}
|
||||
|
||||
public void prepareForSave(Map<String, Serializable> uiConditionProps,
|
||||
Map<String, Serializable> repoProps)
|
||||
{
|
||||
if (logger.isDebugEnabled())
|
||||
logger.debug("Saving Composite Condition");
|
||||
|
||||
// put the selected category in the condition params
|
||||
Boolean orconditions = (Boolean)uiConditionProps.get(PROP_CONDITION_OR);
|
||||
if (orconditions == null)
|
||||
{
|
||||
if (logger.isWarnEnabled())
|
||||
logger.warn("orconditions is NULL, it should not be. Defaulting to false");
|
||||
|
||||
orconditions = Boolean.FALSE;
|
||||
}
|
||||
|
||||
repoProps.put(PROP_CONDITION_OR, orconditions);
|
||||
}
|
||||
}
|
||||
|
Reference in New Issue
Block a user