Permalink
Browse files

Merge remote-tracking branch 'origin/appng-1.18.x'

  • Loading branch information...
appng-buildmaster committed Oct 22, 2018
2 parents c314faa + a259b95 commit e454b8c21f2f311ca962feea8fa30ec512b661ec
Showing with 7,599 additions and 552 deletions.
  1. +10 −3 README.adoc
  2. +1 −1 appng-api/pom.xml
  3. +1 −1 appng-api/src/main/java/org/appng/api/support/ApplicationResourceHolder.java
  4. +4 −1 appng-api/src/main/java/org/appng/api/support/ElementHelper.java
  5. +9 −1 appng-api/src/main/java/org/appng/api/support/FieldProcessorImpl.java
  6. +36 −1 appng-api/src/main/java/org/appng/api/support/OptionFactory.java
  7. +10 −10 appng-api/src/main/java/org/appng/api/support/OptionImpl.java
  8. +27 −2 appng-api/src/main/java/org/appng/api/support/OptionOwner.java
  9. +249 −0 appng-api/src/main/java/org/appng/api/support/OptionsBuilder.java
  10. +1 −1 appng-api/src/main/java/org/appng/api/support/OptionsImpl.java
  11. +157 −0 appng-api/src/main/java/org/appng/api/support/SelectionBuilder.java
  12. +7 −2 appng-api/src/main/java/org/appng/api/support/SiteAwareObjectInputStream.java
  13. +2 −6 appng-api/src/main/java/org/appng/api/support/environment/AttributeWrapper.java
  14. +5 −4 appng-api/src/main/java/org/appng/api/support/environment/DefaultEnvironment.java
  15. +9 −11 appng-api/src/main/java/org/appng/api/support/environment/SessionEnvironment.java
  16. +1 −1 appng-api/src/main/java/org/appng/api/support/field/DefaultFieldConverter.java
  17. +1 −3 appng-api/src/main/java/org/appng/api/support/field/ListFieldConverter.java
  18. +25 −0 appng-api/src/main/java/org/appng/api/support/field/ObjectFieldConverter.java
  19. +177 −66 appng-api/src/main/java/org/appng/api/support/validation/DefaultValidationProvider.java
  20. +57 −14 appng-api/src/main/java/org/appng/api/support/validation/LocalizedMessageInterpolator.java
  21. +3 −0 appng-api/src/test/java/org/appng/api/Person.java
  22. +31 −3 appng-api/src/test/java/org/appng/api/support/ElementHelperTest.java
  23. +111 −0 appng-api/src/test/java/org/appng/api/support/FieldProcessorTest.java
  24. +1 −1 appng-api/src/test/java/org/appng/api/support/OptionImplTest.java
  25. +85 −0 appng-api/src/test/java/org/appng/api/support/SelectionBuilderTest.java
  26. +17 −0 appng-api/src/test/java/org/appng/api/support/SelectionFactoryTest.java
  27. +44 −2 appng-api/src/test/java/org/appng/api/support/ValidationProviderTest.java
  28. +2 −1 appng-api/src/test/java/org/appng/api/support/environment/EnvironmentTest.java
  29. +50 −1 appng-api/src/test/java/org/appng/api/support/field/ListFieldConverterTest.java
  30. +1 −0 appng-api/src/test/java/org/appng/api/support/field/ObjectFieldConverterTest.java
  31. +76 −0 appng-api/src/test/java/org/appng/api/support/validation/LocalizedMessageInterpolatorTest.java
  32. +1 −0 appng-api/src/test/resources/ValidationMessages_en.properties
  33. +26 −0 appng-api/src/test/resources/xml/ListFieldConverterTest-testAddNestedFields-result.xml
  34. +14 −0 appng-api/src/test/resources/xml/ListFieldConverterTest-testAddNestedFields.xml
  35. +2 −1 appng-api/src/test/resources/xml/ValidationProviderTest-testAddValidationMetaData-before.xml
  36. +59 −19 appng-api/src/test/resources/xml/ValidationProviderTest-testAddValidationMetaData.xml
  37. +130 −107 appng-api/src/test/resources/xml/ValidationProviderTest-testAddValidationMetaDataAsRule.xml
  38. +11 −11 appng-api/src/test/resources/xml/ValidationProviderTest-testAddValidationMetaDataInnerClass.xml
  39. +24 −15 appng-api/src/test/resources/xml/ValidationProviderTest-testAddValidationMetaDataWithGroup.xml
  40. +47 −0 appng-api/src/test/resources/xml/ValidationProviderTest-testValidateWithChildFields-before.xml
  41. +64 −0 appng-api/src/test/resources/xml/ValidationProviderTest-testValidateWithChildFields.xml
  42. +1 −1 appng-application-assembly/pom.xml
  43. +21 −15 appng-application-bom/pom.xml
  44. +3 −3 appng-application-camunda/README.adoc
  45. +1 −1 appng-application-camunda/pom.xml
  46. +1 −1 appng-application-parent/pom.xml
  47. +3 −3 appng-application/README.adoc
  48. +5 −1 appng-application/pom.xml
  49. +3 −1 appng-application/src/main/webapp/WEB-INF/conf/platformContext.xml
  50. +1 −1 appng-appngizer-jaxb/pom.xml
  51. +1 −1 appng-appngizer-maven-plugin/pom.xml
  52. +1 −1 appng-appngizer/pom.xml
  53. +2 −0 appng-appngizer/src/main/asciidoc/appngizer-setup-guide.adoc
  54. +1 −1 appng-appngizer/src/main/webapp/WEB-INF/appNGizer-servlet.xml
  55. +1 −1 appng-archetype-application/pom.xml
  56. +1 −1 appng-archetype-application/readme.txt
  57. +1 −1 appng-archetype-application/src/main/resources/archetype-resources/pom.xml
  58. +1 −1 appng-camunda/pom.xml
  59. +1 −1 appng-cli/pom.xml
  60. +13 −4 appng-cli/src/main/java/org/appng/cli/commands/repository/CreateRepository.java
  61. +3 −1 appng-cli/src/main/resources/cliContext.xml
  62. +25 −0 appng-cli/src/test/java/org/appng/cli/commands/repository/CommandCreateRepositoryTest.java
  63. +3 −1 appng-cli/src/test/resources/cliContext-test.xml
  64. +26 −1 appng-core/pom.xml
  65. +24 −15 appng-core/src/main/java/org/appng/core/controller/RepositoryWatcher.java
  66. +1 −0 appng-core/src/main/java/org/appng/core/controller/SessionListener.java
  67. +6 −4 appng-core/src/main/java/org/appng/core/controller/filter/PageCacheFilter.java
  68. +1 −3 appng-core/src/main/java/org/appng/core/controller/messaging/RabbitMQBase.java
  69. +49 −17 appng-core/src/main/java/org/appng/core/controller/messaging/RabbitMQReceiver.java
  70. +559 −0 appng-core/src/main/java/org/appng/core/controller/rest/RestActionBase.java
  71. +338 −0 appng-core/src/main/java/org/appng/core/controller/rest/RestDataSourceBase.java
  72. +332 −0 appng-core/src/main/java/org/appng/core/controller/rest/RestOperation.java
  73. +105 −0 appng-core/src/main/java/org/appng/core/controller/rest/RestPostProcessor.java
  74. +32 −8 appng-core/src/main/java/org/appng/core/model/ApplicationProvider.java
  75. +1 −1 appng-core/src/main/java/org/appng/core/model/JarInfo.java
  76. +1 −1 appng-core/src/main/java/org/appng/core/model/RepositoryCacheSoap.java
  77. +15 −5 appng-core/src/main/java/org/appng/core/model/RepositoryUtils.java
  78. +7 −7 appng-core/src/main/java/org/appng/core/service/CoreService.java
  79. +6 −0 appng-core/src/main/java/org/appng/core/service/InitializerService.java
  80. +4 −1 appng-core/src/test/java/org/appng/core/controller/RepositoryWatcherTest.java
  81. +92 −0 appng-core/src/test/java/org/appng/core/controller/rest/RestActionTest.java
  82. +138 −0 appng-core/src/test/java/org/appng/core/controller/rest/RestDataSourceTest.java
  83. +95 −0 appng-core/src/test/java/org/appng/core/controller/rest/RestOperationTest.java
  84. +122 −0 appng-core/src/test/java/org/appng/core/controller/rest/model/Payment.java
  85. +116 −0 appng-core/src/test/java/org/appng/core/controller/rest/model/PaymentItem.java
  86. +52 −0 appng-core/src/test/java/org/appng/core/controller/rest/model/SiteForm.java
  87. +33 −3 appng-core/src/test/java/org/appng/core/model/RepositoryUtilsTest.java
  88. +3 −1 appng-core/src/test/resources/platformContext.xml
  89. +86 −0 appng-core/src/test/resources/rest/action-get-childfields-result.json
  90. +71 −0 appng-core/src/test/resources/rest/action-get-childfields.xml
  91. +97 −0 appng-core/src/test/resources/rest/action-get-result.json
  92. +87 −0 appng-core/src/test/resources/rest/action-get.xml
  93. +95 −0 appng-core/src/test/resources/rest/action-post-childfields-result.json
  94. +91 −0 appng-core/src/test/resources/rest/action-post-childfields.json
  95. +74 −0 appng-core/src/test/resources/rest/action-post-childfields.xml
  96. +101 −0 appng-core/src/test/resources/rest/action-post-result.json
  97. +75 −0 appng-core/src/test/resources/rest/action-post-validation-result.json
  98. +75 −0 appng-core/src/test/resources/rest/action-post-validation.json
  99. +77 −0 appng-core/src/test/resources/rest/action-post.json
  100. +94 −0 appng-core/src/test/resources/rest/action-post.xml
  101. +106 −0 appng-core/src/test/resources/rest/datasource-result.json
  102. +64 −0 appng-core/src/test/resources/rest/datasource-result.xml
  103. +270 −0 appng-core/src/test/resources/rest/datasource-resultset.json
  104. +198 −0 appng-core/src/test/resources/rest/datasource-resultset.xml
  105. +2 −2 appng-core/src/test/resources/xml/ApplicationProviderTest-testCallAction.xml
  106. +22 −22 appng-core/src/test/resources/xml/ApplicationProviderTest-testCreate.xml
  107. +33 −33 appng-core/src/test/resources/xml/ApplicationProviderTest-testUpdateExecute.xml
  108. +29 −29 appng-core/src/test/resources/xml/ApplicationProviderTest-testUpdateInclude.xml
  109. +30 −30 appng-core/src/test/resources/xml/ApplicationProviderTest-testUpdateValidationError.xml
  110. +1 −1 appng-documentation/pom.xml
  111. BIN appng-documentation/src/main/asciidoc/images/application-processing.jpg
  112. +4 −4 appng-documentation/src/main/asciidoc/listing/dependencies.txt
  113. +1 −1 appng-forms/pom.xml
  114. +1 −1 appng-formtags/pom.xml
  115. +1 −1 appng-mail/pom.xml
  116. +1 −1 appng-maven-plugin/README.adoc
  117. +1 −1 appng-maven-plugin/pom.xml
  118. +1 −1 appng-persistence/pom.xml
  119. +20 −5 appng-persistence/src/main/java/org/appng/persistence/repository/SearchRepository.java
  120. +10 −0 appng-persistence/src/main/java/org/appng/persistence/repository/SearchRepositoryImpl.java
  121. +8 −0 appng-persistence/src/test/java/org/appng/persistence/repository/SearchRepositoryTest.java
  122. +144 −0 appng-rest-api/pom.xml
  123. +118 −0 appng-rest-api/src/main/java/org/appng/api/rest/ActionHelper.java
  124. +95 −0 appng-rest-api/src/main/java/org/appng/api/rest/DataSourceHelper.java
  125. +576 −0 appng-rest-api/src/main/java/org/appng/api/rest/RestClient.java
  126. +74 −0 appng-rest-api/src/main/java/org/appng/api/rest/RestResponseEntity.java
  127. +543 −0 appng-rest-api/src/main/resources/org/appng/api/rest/appng-rest.yaml
  128. +151 −0 appng-rest-api/src/test/java/org/appng/api/rest/ActionHelperTest.java
  129. +75 −0 appng-rest-api/src/test/java/org/appng/api/rest/DataSourceHelperTest.java
  130. +85 −0 appng-rest-api/src/test/java/org/appng/api/rest/RestClientTest.java
  131. +7 −0 appng-rest-api/src/test/resources/log4j.properties
  132. +6 −0 appng-rest-api/src/test_/resources/log4j.properties
  133. +1 −1 appng-search/pom.xml
  134. +12 −7 appng-search/src/main/java/org/appng/search/indexer/FileSystemProvider.java
  135. +1 −1 appng-standalone/pom.xml
  136. +1 −1 appng-taglib/pom.xml
  137. +1 −1 appng-template-assembly/pom.xml
  138. +2 −2 appng-template-parent/pom.xml
  139. +1 −1 appng-testsupport/pom.xml
  140. +0 −1 appng-testsupport/src/main/java/org/appng/testsupport/validation/WritingJsonValidator.java
  141. +1 −1 appng-tomcat7/pom.xml
  142. +1 −1 appng-tomcat8/pom.xml
  143. +1 −1 appng-tools/pom.xml
  144. +1 −1 appng-upngizr/README.adoc
  145. +1 −1 appng-upngizr/pom.xml
  146. +1 −1 appng-xmlapi/pom.xml
  147. +1 −1 appng-xmlapi/src/main/java/org/appng/xml/transformation/StyleSheetProvider.java
  148. +27 −0 appng-xmlapi/src/main/xsd/appng-platform.xsd
  149. +7 −1 pom.xml
@@ -1,7 +1,14 @@
image::https://www.aiticon.com/assets/images/appng_logo_760px.jpg[]
:snapshot: 1.16.3-SNAPSHOT
:stable: 1.16.1
:current: {stable}
:snapshot: 1.18.0-SNAPSHOT
:stable: 1.17.1
:current: {snapshot}
ifdef::env-github[]
:caution-caption: :fire:
:important-caption: :exclamation:
:note-caption: :paperclip:
:tip-caption: :bulb:
:warning-caption: :warning:
endif::[]
[caption="Apache License 2.0",link=LICENSE]
image::https://img.shields.io/badge/License-Apache%202-blue.svg?style=flat-square[]
@@ -11,7 +11,7 @@
<parent>
<groupId>org.appng</groupId>
<artifactId>appng-parent</artifactId>
<version>1.16.3</version>
<version>1.18.0-SNAPSHOT</version>
<relativePath>../pom.xml</relativePath>
</parent>
@@ -35,7 +35,7 @@
import org.apache.commons.codec.digest.DigestUtils;
import org.apache.commons.io.FileUtils;
import org.apache.commons.io.FilenameUtils;
import org.apache.commons.io.IOUtils;
import org.appng.api.InvalidConfigurationException;
import org.appng.api.model.Application;
import org.appng.api.model.Resource;
@@ -161,6 +161,10 @@ private Linkpanel initLinkpanel(ApplicationRequest request, Path pathInfo, Linkp
newTarget = servicePath + SLASH + site.getName() + SLASH + application.getName() + SLASH
+ Platform.SERVICE_TYPE_WEBSERVICE + SLASH + newTarget;
}
if (link.getMode().equals(Linkmode.REST)) {
newTarget = servicePath + SLASH + site.getName() + SLASH + application.getName() + SLASH
+ Platform.SERVICE_TYPE_REST + SLASH + newTarget;
}
StringBuilder proposedPath = new StringBuilder();
proposedPath.append(guiPath).append(pathInfo.getOutputPrefix()).append(SLASH);
proposedPath.append(site.getName()).append(SLASH).append(application.getName());
@@ -509,7 +513,6 @@ public boolean isMessageParam(Object o) {
if (StringUtils.isBlank(expression) || conditionMatches(condition)) {
try {
groups.add(site.getSiteClassLoader().loadClass(group.getClazz()));
group.setCondition(null);
} catch (ClassNotFoundException e) {
LOGGER.error("validation group {} not found!", group.getClazz());
}
@@ -121,7 +121,15 @@ public boolean hasErrors() {
}
public boolean hasFieldErrors() {
for (FieldDef fieldDef : getFields()) {
return hasFieldErrors(getFields());
}
private boolean hasFieldErrors(List<FieldDef> fields) {
for (FieldDef fieldDef : fields) {
boolean errors = hasFieldErrors(fieldDef.getFields());
if (errors) {
return errors;
}
Messages messages = fieldDef.getMessages();
if (messages != null) {
for (Message m : messages.getMessageList()) {
@@ -22,6 +22,7 @@
import org.appng.api.model.Identifiable;
import org.appng.api.model.NameProvider;
import org.appng.api.model.Named;
import org.appng.api.support.OptionOwner.HitCounter;
import org.appng.api.support.OptionOwner.Selector;
import org.appng.xml.platform.Option;
@@ -424,7 +425,8 @@
* @return a new {@link OptionOwner} (actually a {@link org.appng.xml.platform.Selection} or a
* {@link org.appng.xml.platform.OptionGroup})
*/
public <S> T fromObjects(String id, String titleId, S[] allElements, Selector selector, NameProvider<S> nameProvider) {
public <S> T fromObjects(String id, String titleId, S[] allElements, Selector selector,
NameProvider<S> nameProvider) {
T owner = getOwner(id, titleId);
addOptions(allElements, new ArrayList<S>(), owner, nameProvider);
applySelector(owner, selector);
@@ -475,6 +477,38 @@
return owner;
}
/**
* Counts and sets the hits for the options based on their value.
*
* @param options
* some options
* @param counter
* a {@link HitCounter}
*
* @see Option#getValue()
* @see Option#getHits()
*/
public void countHits(Iterable<Option> options, HitCounter<String> counter) {
for (Option option : options) {
option.setHits(counter.count(option.getValue()));
}
}
/**
* Counts and sets the hits for the owner's options based on their value.
*
* @param optionOwner
* an {@link OptionOwner}
* @param counter
* a {@link HitCounter}
*
* @see Option#getValue()
* @see Option#getHits()
*/
public void countHits(OptionOwner optionOwner, HitCounter<String> counter) {
countHits(optionOwner.getOptions(), counter);
}
private <I extends Identifiable<?>> void addIdentifiableOptions(Iterable<? extends I> allElements,
Collection<? extends I> selectedElements, OptionOwner owner, NameProvider<I> nameProvider) {
for (I element : allElements) {
@@ -514,6 +548,7 @@
private void applySelector(OptionOwner owner, Selector selector) {
for (Option option : owner.getOptions()) {
selector.select(option);
option.setHits(selector.count(option.getValue()));
}
}
@@ -54,21 +54,21 @@ public OptionImpl addMap(Map<String, String> map) {
return this;
}
public OptionImpl addAttribute(String key, String value) {
attributeMap.put(key, value);
public OptionImpl addAttribute(String name, String value) {
attributeMap.put(name, value);
return this;
}
public boolean containsAttribute(String key) {
return attributeMap.containsKey(key);
public boolean containsAttribute(String name) {
return attributeMap.containsKey(name);
}
public String getAttribute(String key) {
return attributeMap.get(key);
public String getAttribute(String name) {
return getString(name);
}
public int getAttributeAsInteger(String key) {
return Integer.valueOf(attributeMap.get(key));
public int getAttributeAsInteger(String name) {
return Integer.valueOf(attributeMap.get(name));
}
public Set<String> getAttributeNames() {
@@ -80,7 +80,7 @@ public int getAttributeAsInteger(String key) {
}
public String getString(String name) {
return getAttribute(name);
return attributeMap.get(name);
}
public Integer getInteger(String name) {
@@ -99,7 +99,7 @@ public Boolean getBoolean(String name) {
public String toString() {
StringBuffer result = new StringBuffer(getName() + " [ ");
getAttributeNames().forEach(key -> result.append(key + "=\"" + getAttribute(key) + "\" "));
getAttributeNames().forEach(key -> result.append(key + "=\"" + getString(key) + "\" "));
result.append("]");
return result.toString();
}
@@ -28,16 +28,41 @@
org.appng.xml.platform.Option addOption(String name, String value, boolean selected);
/**
* A selector decides whether or not a given {@link Option} should be selected
* A selector decides whether or not a given {@link Option} should be selected. Also implements {@link HitCounter},
* using the options's value and returning {@code null} by default.
*
* @see Option#isSelected()
*/
public interface Selector {
public interface Selector extends HitCounter<String> {
/**
* Selects or de-selects an option by calling {@link Option#setSelected(Boolean)}.
*
* @param o
* the {@link Option} which might be selected
*/
void select(Option o);
default Integer count(String optionValue) {
return null;
}
}
/**
* Counts the hits for {@link Option}s.
*
* @param <T>
* the type of the elements to count
* @see Option#getHits()
*/
public interface HitCounter<T> {
/**
* Counts the hits for the option created from the given element.
*
* @param element
* the element to count the hits for
* @return the number of hits for this option
*/
Integer count(T element);
}
class OptionOwnerBase implements OptionOwner {
Oops, something went wrong.

0 comments on commit e454b8c

Please sign in to comment.