mirror of
https://github.com/Alfresco/alfresco-community-repo.git
synced 2025-10-08 14:51:49 +00:00
Merged 5.1.N (5.1.2) to 5.2.N (5.2.1)
124303 rneamtu: MNT-15881 : CLONE - Share rule constraints missing due to ActionExecuterAbstractBase's regression Merged 5.0.N (5.0.4) to 5.1.N (5.1.2) 124129 rneamtu: Merged DEV to 5.0.N (5.0.4) 124118 rneamtu: MNT-15802: Share rule constraints missing due to ActionExecuterAbstractBase's regression - Set parameter constraint name for localized parameters - Added unit test for case git-svn-id: https://svn.alfresco.com/repos/alfresco-enterprise/alfresco/BRANCHES/DEV/5.2.N/root@124310 c4b6b30b-aa2e-2d43-bbcb-ca4b014f7261
This commit is contained in:
@@ -122,7 +122,8 @@ public abstract class ParameterizedItemAbstractBase extends CommonResourceAbstra
|
|||||||
definition.getType(),
|
definition.getType(),
|
||||||
definition.isMandatory(),
|
definition.isMandatory(),
|
||||||
paramDisplayLabel,
|
paramDisplayLabel,
|
||||||
definition.isMultiValued()
|
definition.isMultiValued(),
|
||||||
|
definition.getParameterConstraintName()
|
||||||
));
|
));
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@@ -45,6 +45,7 @@ public class AddFeaturesActionExecuter extends ActionExecuterAbstractBase
|
|||||||
*/
|
*/
|
||||||
public static final String NAME = "add-features";
|
public static final String NAME = "add-features";
|
||||||
public static final String PARAM_ASPECT_NAME = "aspect-name";
|
public static final String PARAM_ASPECT_NAME = "aspect-name";
|
||||||
|
public static final String PARAM_CONSTRAINT = "ac-aspects";
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* The node service
|
* The node service
|
||||||
|
@@ -18,15 +18,21 @@
|
|||||||
*/
|
*/
|
||||||
package org.alfresco.repo.action.executer;
|
package org.alfresco.repo.action.executer;
|
||||||
|
|
||||||
|
import java.util.List;
|
||||||
|
import java.util.Locale;
|
||||||
|
|
||||||
import org.alfresco.model.ContentModel;
|
import org.alfresco.model.ContentModel;
|
||||||
import org.alfresco.repo.action.ActionImpl;
|
import org.alfresco.repo.action.ActionImpl;
|
||||||
import org.alfresco.repo.security.authentication.AuthenticationComponent;
|
import org.alfresco.repo.security.authentication.AuthenticationComponent;
|
||||||
|
import org.alfresco.service.cmr.action.ActionDefinition;
|
||||||
|
import org.alfresco.service.cmr.action.ParameterDefinition;
|
||||||
import org.alfresco.service.cmr.repository.NodeRef;
|
import org.alfresco.service.cmr.repository.NodeRef;
|
||||||
import org.alfresco.service.cmr.repository.NodeService;
|
import org.alfresco.service.cmr.repository.NodeService;
|
||||||
import org.alfresco.service.cmr.repository.StoreRef;
|
import org.alfresco.service.cmr.repository.StoreRef;
|
||||||
import org.alfresco.service.namespace.QName;
|
import org.alfresco.service.namespace.QName;
|
||||||
import org.alfresco.util.BaseSpringTest;
|
import org.alfresco.util.BaseSpringTest;
|
||||||
import org.alfresco.util.GUID;
|
import org.alfresco.util.GUID;
|
||||||
|
import org.springframework.extensions.surf.util.I18NUtil;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Add features action execution test
|
* Add features action execution test
|
||||||
@@ -109,4 +115,37 @@ public class AddFeaturesActionExecuterTest extends BaseSpringTest
|
|||||||
// Check that the node now has the classifiable aspect applied
|
// Check that the node now has the classifiable aspect applied
|
||||||
assertTrue(this.nodeService.hasAspect(this.nodeRef, ContentModel.ASPECT_CLASSIFIABLE));
|
assertTrue(this.nodeService.hasAspect(this.nodeRef, ContentModel.ASPECT_CLASSIFIABLE));
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* MNT-15802
|
||||||
|
*/
|
||||||
|
public void testCheckLocalizedParamDefintionWithConstraint()
|
||||||
|
{
|
||||||
|
// test for other than default locale
|
||||||
|
I18NUtil.setLocale(Locale.GERMAN);
|
||||||
|
|
||||||
|
ActionDefinition actionDef = executer.getActionDefinition();
|
||||||
|
|
||||||
|
List<ParameterDefinition> paramDef = actionDef.getParameterDefinitions();
|
||||||
|
assertNotNull(paramDef);
|
||||||
|
|
||||||
|
String constraintName = paramDef.get(0).getParameterConstraintName();
|
||||||
|
assertNotNull(constraintName);
|
||||||
|
assertEquals(AddFeaturesActionExecuter.PARAM_CONSTRAINT, constraintName);
|
||||||
|
|
||||||
|
// test for other than default locale
|
||||||
|
I18NUtil.setLocale(Locale.ITALY);
|
||||||
|
|
||||||
|
actionDef = executer.getActionDefinition();
|
||||||
|
|
||||||
|
paramDef = actionDef.getParameterDefinitions();
|
||||||
|
assertNotNull(paramDef);
|
||||||
|
|
||||||
|
constraintName = paramDef.get(0).getParameterConstraintName();
|
||||||
|
assertNotNull(constraintName);
|
||||||
|
assertEquals(AddFeaturesActionExecuter.PARAM_CONSTRAINT, constraintName);
|
||||||
|
|
||||||
|
I18NUtil.setLocale(Locale.getDefault());
|
||||||
|
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
Reference in New Issue
Block a user