Skip to content

Commit

Permalink
Merge pull request #341 from xenit-eu/master
Browse files Browse the repository at this point in the history
Release 2.1.2
  • Loading branch information
evyrosseels committed Feb 4, 2022
2 parents f8c0ff8 + 600e5ed commit 0b3cffb
Show file tree
Hide file tree
Showing 4 changed files with 26 additions and 5 deletions.
6 changes: 5 additions & 1 deletion CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
---
title: Changelog - Dynamic Extensions for Alfresco
date: 10 May 2021
date: 03 February 2022
report: true
colorlinks: true
---
Expand All @@ -21,6 +21,10 @@ Version template:
-->
# Dynamic Extensions For Alfresco Changelog

## [2.1.2] - 2022-02-03
### Fixed
* [#338](https://github.com/xenit-eu/dynamic-extensions-for-alfresco/issues/338) DEVEM-499 Fix @ActionMethod usage on Alfresco 7.0

## [2.1.1] - 2021-09-08
### Fixed
* [#329](https://github.com/xenit-eu/dynamic-extensions-for-alfresco/issues/329) Reenable publishing of gradle plugin
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,6 @@
import org.alfresco.service.cmr.dictionary.DictionaryService;
import org.alfresco.service.cmr.repository.NodeRef;
import org.alfresco.service.namespace.QName;
import org.apache.commons.lang.StringUtils;
import org.springframework.beans.factory.BeanFactory;
import org.springframework.beans.factory.config.ConfigurableListableBeanFactory;
import org.springframework.core.LocalVariableTableParameterNameDiscoverer;
Expand All @@ -31,6 +30,7 @@
import org.springframework.util.ClassUtils;
import org.springframework.util.ReflectionUtils;
import org.springframework.util.ReflectionUtils.MethodCallback;
import org.springframework.util.StringUtils;

/**
* Manages annotation-based Actions in a {@link BeanFactory}.
Expand Down Expand Up @@ -229,7 +229,8 @@ protected ActionMethodMapping resolveActionMethodMapping(final Object bean, fina
}
final boolean mandatory = actionParameter.mandatory();
final String displayLabel = actionParameter.displayLabel();
final String constraintName = StringUtils.stripToNull(actionParameter.constraintName());
String trimmedConstraintName = StringUtils.trimWhitespace(actionParameter.constraintName());
final String constraintName = trimmedConstraintName.isEmpty() ? null : trimmedConstraintName;
final ParameterDefinition parameterDefinition = new ParameterDefinitionImpl(name,
dataType.getName(), mandatory, displayLabel, multivalued, constraintName);
parameterDefinitions.add(parameterDefinition);
Expand All @@ -249,7 +250,7 @@ protected ActionMethodMapping resolveActionMethodMapping(final Object bean, fina

private DataTypeDefinition getDataType(final Class<?> clazz, final ActionParam actionParameter) {
final DataTypeDefinition dataType;
if (StringUtils.isNotEmpty(actionParameter.type())) {
if (!StringUtils.isEmpty(actionParameter.type())) {
dataType = getDictionaryService().getDataType(parseQName(actionParameter.type(), actionParameter));
if (dataType == null) {
throw new RuntimeException(String.format("Invalid or unknown DataType: %s", actionParameter.type()));
Expand Down
2 changes: 1 addition & 1 deletion build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,7 @@ def copyPropertyValueIfExists(sourcePropertyName, targetPropertyName) {

allprojects {
group = 'eu.xenit.de'
version = '2.1.1'
version = '2.1.2'

boolean isRelease = ci.branch?.startsWith("release")
if (!isRelease) {
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,16 @@
package eu.xenit.de.testing.actions;

import com.github.dynamicextensionsalfresco.actions.annotations.ActionMethod;
import com.github.dynamicextensionsalfresco.actions.annotations.ActionParam;
import org.alfresco.service.cmr.repository.NodeRef;
import org.springframework.stereotype.Component;

@Component
public class TestAction {

@ActionMethod(value = "testAction")
public void testAction(final NodeRef nodeRef, @ActionParam("name") final String name) {
throw new UnsupportedOperationException();
}

}

0 comments on commit 0b3cffb

Please sign in to comment.