[syncope] branch master updated: Restoring JAXB features
This is an automated email from the ASF dual-hosted git repository. ilgrosso pushed a commit to branch master in repository https://gitbox.apache.org/repos/asf/syncope.git The following commit(s) were added to refs/heads/master by this push: new 9ae2e69 Restoring JAXB features 9ae2e69 is described below commit 9ae2e69cbcba4c246de31711159172dc9136ba3a Author: Francesco Chicchiriccò AuthorDate: Thu Nov 22 17:56:11 2018 +0100 Restoring JAXB features --- .../org/apache/syncope/common/lib/BaseBean.java| 27 ++ .../common/lib/to/AbstractAnnotatedBean.java | 3 ++- .../common/lib/to/AbstractStartEndBean.java| 4 ++-- .../syncope/common/lib/to/AccessTokenTO.java | 3 ++- .../apache/syncope/common/lib/to/PagedResult.java | 3 ++- .../syncope/common/lib/to/RemediationTO.java | 3 ++- .../core/rest/cxf/service/AbstractServiceImpl.java | 4 ++-- .../apache/syncope/common/lib/to/UserRequest.java | 4 ++-- .../syncope/common/lib/to/UserRequestForm.java | 4 ++-- 9 files changed, 43 insertions(+), 12 deletions(-) diff --git a/common/lib/src/main/java/org/apache/syncope/common/lib/BaseBean.java b/common/lib/src/main/java/org/apache/syncope/common/lib/BaseBean.java new file mode 100644 index 000..edfbeff --- /dev/null +++ b/common/lib/src/main/java/org/apache/syncope/common/lib/BaseBean.java @@ -0,0 +1,27 @@ +/* + * Licensed to the Apache Software Foundation (ASF) under one + * or more contributor license agreements. See the NOTICE file + * distributed with this work for additional information + * regarding copyright ownership. The ASF licenses this file + * to you under the Apache License, Version 2.0 (the + * "License"); you may not use this file except in compliance + * with the License. You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, + * software distributed under the License is distributed on an + * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY + * KIND, either express or implied. See the License for the + * specific language governing permissions and limitations + * under the License. + */ +package org.apache.syncope.common.lib; + +import java.io.Serializable; + +public abstract class BaseBean implements Serializable { + +private static final long serialVersionUID = 8243277089603485380L; + +} diff --git a/common/lib/src/main/java/org/apache/syncope/common/lib/to/AbstractAnnotatedBean.java b/common/lib/src/main/java/org/apache/syncope/common/lib/to/AbstractAnnotatedBean.java index 741083c..7a4df9e 100644 --- a/common/lib/src/main/java/org/apache/syncope/common/lib/to/AbstractAnnotatedBean.java +++ b/common/lib/src/main/java/org/apache/syncope/common/lib/to/AbstractAnnotatedBean.java @@ -25,12 +25,13 @@ import javax.xml.bind.annotation.XmlType; import org.apache.commons.lang3.StringUtils; import org.apache.commons.lang3.builder.EqualsBuilder; import org.apache.commons.lang3.builder.HashCodeBuilder; +import org.apache.syncope.common.lib.BaseBean; /** * Abstract wrapper for common system information. */ @XmlType -public abstract class AbstractAnnotatedBean implements EntityTO { +public abstract class AbstractAnnotatedBean extends BaseBean implements EntityTO { private static final long serialVersionUID = -930797879027642457L; diff --git a/common/lib/src/main/java/org/apache/syncope/common/lib/to/AbstractStartEndBean.java b/common/lib/src/main/java/org/apache/syncope/common/lib/to/AbstractStartEndBean.java index f6fb7aa..e1bbe0f 100644 --- a/common/lib/src/main/java/org/apache/syncope/common/lib/to/AbstractStartEndBean.java +++ b/common/lib/src/main/java/org/apache/syncope/common/lib/to/AbstractStartEndBean.java @@ -19,14 +19,14 @@ package org.apache.syncope.common.lib.to; import io.swagger.v3.oas.annotations.media.Schema; -import java.io.Serializable; import java.util.Date; import javax.xml.bind.annotation.XmlType; import org.apache.commons.lang3.builder.EqualsBuilder; import org.apache.commons.lang3.builder.HashCodeBuilder; +import org.apache.syncope.common.lib.BaseBean; @XmlType -public class AbstractStartEndBean implements Serializable { +public class AbstractStartEndBean extends BaseBean { private static final long serialVersionUID = 2399577415544539917L; diff --git a/common/lib/src/main/java/org/apache/syncope/common/lib/to/AccessTokenTO.java b/common/lib/src/main/java/org/apache/syncope/common/lib/to/AccessTokenTO.java index 6dd39b3..c553e5d 100644 --- a/common/lib/src/main/java/org/apache/syncope/common/lib/to/AccessTokenTO.java +++ b/common/lib/src/main/java/org/apache/syncope/common/lib/to/AccessTokenTO.java @@ -21,10 +21,11 @@ package org.apache.syncope.common.lib.to; import java.util.Date; import javax.xml.bind.annotation.XmlRootElement; import javax.xml.bind.annotation.XmlType; +import org.apache.syncope.common.lib.BaseBean;
[syncope] branch 2_1_X updated: Restoring JAXB features
This is an automated email from the ASF dual-hosted git repository. ilgrosso pushed a commit to branch 2_1_X in repository https://gitbox.apache.org/repos/asf/syncope.git The following commit(s) were added to refs/heads/2_1_X by this push: new 987ee59 Restoring JAXB features 987ee59 is described below commit 987ee59e5f02e3cd7b51542fe92b0de0816812fe Author: Francesco Chicchiriccò AuthorDate: Thu Nov 22 17:56:11 2018 +0100 Restoring JAXB features --- .../org/apache/syncope/common/lib/BaseBean.java| 27 ++ .../common/lib/to/AbstractAnnotatedBean.java | 3 ++- .../common/lib/to/AbstractStartEndBean.java| 4 ++-- .../syncope/common/lib/to/AccessTokenTO.java | 3 ++- .../apache/syncope/common/lib/to/PagedResult.java | 3 ++- .../syncope/common/lib/to/RemediationTO.java | 3 ++- .../core/rest/cxf/service/AbstractServiceImpl.java | 4 ++-- .../apache/syncope/common/lib/to/UserRequest.java | 4 ++-- .../syncope/common/lib/to/UserRequestForm.java | 4 ++-- 9 files changed, 43 insertions(+), 12 deletions(-) diff --git a/common/lib/src/main/java/org/apache/syncope/common/lib/BaseBean.java b/common/lib/src/main/java/org/apache/syncope/common/lib/BaseBean.java new file mode 100644 index 000..edfbeff --- /dev/null +++ b/common/lib/src/main/java/org/apache/syncope/common/lib/BaseBean.java @@ -0,0 +1,27 @@ +/* + * Licensed to the Apache Software Foundation (ASF) under one + * or more contributor license agreements. See the NOTICE file + * distributed with this work for additional information + * regarding copyright ownership. The ASF licenses this file + * to you under the Apache License, Version 2.0 (the + * "License"); you may not use this file except in compliance + * with the License. You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, + * software distributed under the License is distributed on an + * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY + * KIND, either express or implied. See the License for the + * specific language governing permissions and limitations + * under the License. + */ +package org.apache.syncope.common.lib; + +import java.io.Serializable; + +public abstract class BaseBean implements Serializable { + +private static final long serialVersionUID = 8243277089603485380L; + +} diff --git a/common/lib/src/main/java/org/apache/syncope/common/lib/to/AbstractAnnotatedBean.java b/common/lib/src/main/java/org/apache/syncope/common/lib/to/AbstractAnnotatedBean.java index 741083c..7a4df9e 100644 --- a/common/lib/src/main/java/org/apache/syncope/common/lib/to/AbstractAnnotatedBean.java +++ b/common/lib/src/main/java/org/apache/syncope/common/lib/to/AbstractAnnotatedBean.java @@ -25,12 +25,13 @@ import javax.xml.bind.annotation.XmlType; import org.apache.commons.lang3.StringUtils; import org.apache.commons.lang3.builder.EqualsBuilder; import org.apache.commons.lang3.builder.HashCodeBuilder; +import org.apache.syncope.common.lib.BaseBean; /** * Abstract wrapper for common system information. */ @XmlType -public abstract class AbstractAnnotatedBean implements EntityTO { +public abstract class AbstractAnnotatedBean extends BaseBean implements EntityTO { private static final long serialVersionUID = -930797879027642457L; diff --git a/common/lib/src/main/java/org/apache/syncope/common/lib/to/AbstractStartEndBean.java b/common/lib/src/main/java/org/apache/syncope/common/lib/to/AbstractStartEndBean.java index f6fb7aa..e1bbe0f 100644 --- a/common/lib/src/main/java/org/apache/syncope/common/lib/to/AbstractStartEndBean.java +++ b/common/lib/src/main/java/org/apache/syncope/common/lib/to/AbstractStartEndBean.java @@ -19,14 +19,14 @@ package org.apache.syncope.common.lib.to; import io.swagger.v3.oas.annotations.media.Schema; -import java.io.Serializable; import java.util.Date; import javax.xml.bind.annotation.XmlType; import org.apache.commons.lang3.builder.EqualsBuilder; import org.apache.commons.lang3.builder.HashCodeBuilder; +import org.apache.syncope.common.lib.BaseBean; @XmlType -public class AbstractStartEndBean implements Serializable { +public class AbstractStartEndBean extends BaseBean { private static final long serialVersionUID = 2399577415544539917L; diff --git a/common/lib/src/main/java/org/apache/syncope/common/lib/to/AccessTokenTO.java b/common/lib/src/main/java/org/apache/syncope/common/lib/to/AccessTokenTO.java index 6dd39b3..c553e5d 100644 --- a/common/lib/src/main/java/org/apache/syncope/common/lib/to/AccessTokenTO.java +++ b/common/lib/src/main/java/org/apache/syncope/common/lib/to/AccessTokenTO.java @@ -21,10 +21,11 @@ package org.apache.syncope.common.lib.to; import java.util.Date; import javax.xml.bind.annotation.XmlRootElement; import javax.xml.bind.annotation.XmlType; +import org.apache.syncope.common.lib.BaseBean;
[syncope] branch 2_1_X updated: Attempt to increase readability
This is an automated email from the ASF dual-hosted git repository. ilgrosso pushed a commit to branch 2_1_X in repository https://gitbox.apache.org/repos/asf/syncope.git The following commit(s) were added to refs/heads/2_1_X by this push: new 2de3bc2 Attempt to increase readability 2de3bc2 is described below commit 2de3bc29de75da530c799e98680fabf17e166047 Author: Francesco Chicchiriccò AuthorDate: Thu Nov 22 15:32:13 2018 +0100 Attempt to increase readability --- .../client/console/wizards/any/PlainAttrs.java | 23 ++ 1 file changed, 10 insertions(+), 13 deletions(-) diff --git a/client/console/src/main/java/org/apache/syncope/client/console/wizards/any/PlainAttrs.java b/client/console/src/main/java/org/apache/syncope/client/console/wizards/any/PlainAttrs.java index b767910..a9e1f90 100644 --- a/client/console/src/main/java/org/apache/syncope/client/console/wizards/any/PlainAttrs.java +++ b/client/console/src/main/java/org/apache/syncope/client/console/wizards/any/PlainAttrs.java @@ -411,26 +411,23 @@ public class PlainAttrs extends AbstractAttrs { } item.add(panel); -Optional previousPlainAttr = previousObject == null +Optional prevAttr = previousObject == null ? Optional.empty() : previousObject.getPlainAttr(attrTO.getSchema()); if (previousObject != null -&& ((!previousPlainAttr.isPresent() && isNotEmptyOrBlank(attrTO.getValues())) -|| (previousPlainAttr.isPresent() && !ListUtils.isEqualList( - ListUtils.select(previousPlainAttr.get().getValues(), -object -> StringUtils.isNotEmpty(object)), -ListUtils.select(attrTO.getValues(), object -> StringUtils.isNotEmpty(object)) { - -List oldValues = previousPlainAttr.isPresent() -? previousPlainAttr.get().getValues() +&& ((!prevAttr.isPresent() && attrTO.getValues().stream().anyMatch(StringUtils::isNotBlank)) +|| (prevAttr.isPresent() && !ListUtils.isEqualList( +prevAttr.get().getValues().stream(). + filter(StringUtils::isNotBlank).collect(Collectors.toList()), +attrTO.getValues().stream(). + filter(StringUtils::isNotBlank).collect(Collectors.toList()) { + +List oldValues = prevAttr.isPresent() +? prevAttr.get().getValues() : Collections.emptyList(); panel.showExternAction(new LabelInfo("externalAction", oldValues)); } } - -protected boolean isNotEmptyOrBlank(final List values) { -return values.stream().anyMatch(value -> StringUtils.isNotBlank(value)); -} }); } }
[syncope] branch master updated: Attempt to increase readability
This is an automated email from the ASF dual-hosted git repository. ilgrosso pushed a commit to branch master in repository https://gitbox.apache.org/repos/asf/syncope.git The following commit(s) were added to refs/heads/master by this push: new 68d0739 Attempt to increase readability 68d0739 is described below commit 68d0739a95d3ffad98e6326bfc37d6846dec4d56 Author: Francesco Chicchiriccò AuthorDate: Thu Nov 22 15:32:13 2018 +0100 Attempt to increase readability --- .../client/console/wizards/any/PlainAttrs.java | 23 ++ 1 file changed, 10 insertions(+), 13 deletions(-) diff --git a/client/console/src/main/java/org/apache/syncope/client/console/wizards/any/PlainAttrs.java b/client/console/src/main/java/org/apache/syncope/client/console/wizards/any/PlainAttrs.java index b767910..a9e1f90 100644 --- a/client/console/src/main/java/org/apache/syncope/client/console/wizards/any/PlainAttrs.java +++ b/client/console/src/main/java/org/apache/syncope/client/console/wizards/any/PlainAttrs.java @@ -411,26 +411,23 @@ public class PlainAttrs extends AbstractAttrs { } item.add(panel); -Optional previousPlainAttr = previousObject == null +Optional prevAttr = previousObject == null ? Optional.empty() : previousObject.getPlainAttr(attrTO.getSchema()); if (previousObject != null -&& ((!previousPlainAttr.isPresent() && isNotEmptyOrBlank(attrTO.getValues())) -|| (previousPlainAttr.isPresent() && !ListUtils.isEqualList( - ListUtils.select(previousPlainAttr.get().getValues(), -object -> StringUtils.isNotEmpty(object)), -ListUtils.select(attrTO.getValues(), object -> StringUtils.isNotEmpty(object)) { - -List oldValues = previousPlainAttr.isPresent() -? previousPlainAttr.get().getValues() +&& ((!prevAttr.isPresent() && attrTO.getValues().stream().anyMatch(StringUtils::isNotBlank)) +|| (prevAttr.isPresent() && !ListUtils.isEqualList( +prevAttr.get().getValues().stream(). + filter(StringUtils::isNotBlank).collect(Collectors.toList()), +attrTO.getValues().stream(). + filter(StringUtils::isNotBlank).collect(Collectors.toList()) { + +List oldValues = prevAttr.isPresent() +? prevAttr.get().getValues() : Collections.emptyList(); panel.showExternAction(new LabelInfo("externalAction", oldValues)); } } - -protected boolean isNotEmptyOrBlank(final List values) { -return values.stream().anyMatch(value -> StringUtils.isNotBlank(value)); -} }); } }
[syncope] branch master updated: fixes tests and avoids NPE while showing plain attribuest wizard
This is an automated email from the ASF dual-hosted git repository. andreapatricelli pushed a commit to branch master in repository https://gitbox.apache.org/repos/asf/syncope.git The following commit(s) were added to refs/heads/master by this push: new 5476771 fixes tests and avoids NPE while showing plain attribuest wizard 5476771 is described below commit 54767715466da6cdcd4eac8150672e9065f2407c Author: Andrea Patricelli AuthorDate: Thu Nov 22 14:44:07 2018 +0100 fixes tests and avoids NPE while showing plain attribuest wizard --- .../syncope/client/console/wizards/any/PlainAttrs.java | 16 +--- 1 file changed, 9 insertions(+), 7 deletions(-) diff --git a/client/console/src/main/java/org/apache/syncope/client/console/wizards/any/PlainAttrs.java b/client/console/src/main/java/org/apache/syncope/client/console/wizards/any/PlainAttrs.java index fb9c7c6..b767910 100644 --- a/client/console/src/main/java/org/apache/syncope/client/console/wizards/any/PlainAttrs.java +++ b/client/console/src/main/java/org/apache/syncope/client/console/wizards/any/PlainAttrs.java @@ -410,24 +410,26 @@ public class PlainAttrs extends AbstractAttrs { ((MultiFieldPanel) panel).setReadOnly(schemas.get(attrTO.getSchema()).isReadonly()); } item.add(panel); -Optional previousPlainAttr = previousObject.getPlainAttr(attrTO.getSchema()); +Optional previousPlainAttr = previousObject == null +? Optional.empty() +: previousObject.getPlainAttr(attrTO.getSchema()); if (previousObject != null -&& ((!previousPlainAttr.isPresent() && !isEmptyOrBlank(attrTO.getValues())) +&& ((!previousPlainAttr.isPresent() && isNotEmptyOrBlank(attrTO.getValues())) || (previousPlainAttr.isPresent() && !ListUtils.isEqualList( ListUtils.select(previousPlainAttr.get().getValues(), object -> StringUtils.isNotEmpty(object)), ListUtils.select(attrTO.getValues(), object -> StringUtils.isNotEmpty(object)) { -List oldValues = !previousPlainAttr.isPresent() -? Collections.emptyList() -: previousPlainAttr.get().getValues(); +List oldValues = previousPlainAttr.isPresent() +? previousPlainAttr.get().getValues() +: Collections.emptyList(); panel.showExternAction(new LabelInfo("externalAction", oldValues)); } } -protected boolean isEmptyOrBlank(final List values) { -return values.stream().allMatch(value -> StringUtils.isBlank(value)); +protected boolean isNotEmptyOrBlank(final List values) { +return values.stream().anyMatch(value -> StringUtils.isNotBlank(value)); } }); }
[syncope] branch 2_1_X updated: fixes tests and avoids NPE while showing plain attribuest wizard
This is an automated email from the ASF dual-hosted git repository. andreapatricelli pushed a commit to branch 2_1_X in repository https://gitbox.apache.org/repos/asf/syncope.git The following commit(s) were added to refs/heads/2_1_X by this push: new ace95c3 fixes tests and avoids NPE while showing plain attribuest wizard ace95c3 is described below commit ace95c35795a1b2ee1017fe2b05013b4f6d35fd2 Author: Andrea Patricelli AuthorDate: Thu Nov 22 14:44:07 2018 +0100 fixes tests and avoids NPE while showing plain attribuest wizard --- .../syncope/client/console/wizards/any/PlainAttrs.java | 16 +--- 1 file changed, 9 insertions(+), 7 deletions(-) diff --git a/client/console/src/main/java/org/apache/syncope/client/console/wizards/any/PlainAttrs.java b/client/console/src/main/java/org/apache/syncope/client/console/wizards/any/PlainAttrs.java index fb9c7c6..b767910 100644 --- a/client/console/src/main/java/org/apache/syncope/client/console/wizards/any/PlainAttrs.java +++ b/client/console/src/main/java/org/apache/syncope/client/console/wizards/any/PlainAttrs.java @@ -410,24 +410,26 @@ public class PlainAttrs extends AbstractAttrs { ((MultiFieldPanel) panel).setReadOnly(schemas.get(attrTO.getSchema()).isReadonly()); } item.add(panel); -Optional previousPlainAttr = previousObject.getPlainAttr(attrTO.getSchema()); +Optional previousPlainAttr = previousObject == null +? Optional.empty() +: previousObject.getPlainAttr(attrTO.getSchema()); if (previousObject != null -&& ((!previousPlainAttr.isPresent() && !isEmptyOrBlank(attrTO.getValues())) +&& ((!previousPlainAttr.isPresent() && isNotEmptyOrBlank(attrTO.getValues())) || (previousPlainAttr.isPresent() && !ListUtils.isEqualList( ListUtils.select(previousPlainAttr.get().getValues(), object -> StringUtils.isNotEmpty(object)), ListUtils.select(attrTO.getValues(), object -> StringUtils.isNotEmpty(object)) { -List oldValues = !previousPlainAttr.isPresent() -? Collections.emptyList() -: previousPlainAttr.get().getValues(); +List oldValues = previousPlainAttr.isPresent() +? previousPlainAttr.get().getValues() +: Collections.emptyList(); panel.showExternAction(new LabelInfo("externalAction", oldValues)); } } -protected boolean isEmptyOrBlank(final List values) { -return values.stream().allMatch(value -> StringUtils.isBlank(value)); +protected boolean isNotEmptyOrBlank(final List values) { +return values.stream().anyMatch(value -> StringUtils.isNotBlank(value)); } }); }
[syncope] branch 2_0_X updated: Enable the secure processing feature
This is an automated email from the ASF dual-hosted git repository. ilgrosso pushed a commit to branch 2_0_X in repository https://gitbox.apache.org/repos/asf/syncope.git The following commit(s) were added to refs/heads/2_0_X by this push: new 5d02fc2 Enable the secure processing feature 5d02fc2 is described below commit 5d02fc26b9d8f3705a57d15fd4c1ee1f90bb96d4 Author: Francesco Chicchiriccò AuthorDate: Thu Nov 22 12:56:53 2018 +0100 Enable the secure processing feature --- .../apache/syncope/core/persistence/jpa/content/XMLContentLoader.java | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/core/persistence-jpa/src/main/java/org/apache/syncope/core/persistence/jpa/content/XMLContentLoader.java b/core/persistence-jpa/src/main/java/org/apache/syncope/core/persistence/jpa/content/XMLContentLoader.java index 63a6089..e6e4531 100644 --- a/core/persistence-jpa/src/main/java/org/apache/syncope/core/persistence/jpa/content/XMLContentLoader.java +++ b/core/persistence-jpa/src/main/java/org/apache/syncope/core/persistence/jpa/content/XMLContentLoader.java @@ -24,6 +24,7 @@ import java.util.Map; import java.util.Properties; import javax.annotation.Resource; import javax.sql.DataSource; +import javax.xml.XMLConstants; import javax.xml.parsers.SAXParser; import javax.xml.parsers.SAXParserFactory; import org.apache.syncope.core.spring.ApplicationContextProvider; @@ -100,8 +101,8 @@ public class XMLContentLoader extends AbstractContentDealer implements ContentLo throws Exception { SAXParserFactory factory = SAXParserFactory.newInstance(); +factory.setFeature(XMLConstants.FEATURE_SECURE_PROCESSING, Boolean.TRUE); try (InputStream in = contentXML.getResource().getInputStream()) { - SAXParser parser = factory.newSAXParser(); parser.parse(in, new ContentLoaderHandler(dataSource, ROOT_ELEMENT, true)); LOG.debug("[{}] Default content successfully loaded", domain);
[syncope] branch master updated: Enable the secure processing feature
This is an automated email from the ASF dual-hosted git repository. coheigea pushed a commit to branch master in repository https://gitbox.apache.org/repos/asf/syncope.git The following commit(s) were added to refs/heads/master by this push: new 720b253 Enable the secure processing feature 720b253 is described below commit 720b2538d58833629497beecd1f2de04a7624ba4 Author: Colm O hEigeartaigh AuthorDate: Thu Nov 22 11:51:41 2018 + Enable the secure processing feature --- .../apache/syncope/core/persistence/jpa/content/XMLContentLoader.java | 2 ++ 1 file changed, 2 insertions(+) diff --git a/core/persistence-jpa/src/main/java/org/apache/syncope/core/persistence/jpa/content/XMLContentLoader.java b/core/persistence-jpa/src/main/java/org/apache/syncope/core/persistence/jpa/content/XMLContentLoader.java index 8b59615..4adfde6 100644 --- a/core/persistence-jpa/src/main/java/org/apache/syncope/core/persistence/jpa/content/XMLContentLoader.java +++ b/core/persistence-jpa/src/main/java/org/apache/syncope/core/persistence/jpa/content/XMLContentLoader.java @@ -23,6 +23,7 @@ import java.io.InputStream; import java.util.Properties; import javax.annotation.Resource; import javax.sql.DataSource; +import javax.xml.XMLConstants; import javax.xml.parsers.ParserConfigurationException; import javax.xml.parsers.SAXParser; import javax.xml.parsers.SAXParserFactory; @@ -101,6 +102,7 @@ public class XMLContentLoader extends AbstractContentDealer implements ContentLo throws IOException, ParserConfigurationException, SAXException { SAXParserFactory factory = SAXParserFactory.newInstance(); +factory.setFeature(XMLConstants.FEATURE_SECURE_PROCESSING, Boolean.TRUE); try (InputStream in = contentXML.getResource().getInputStream()) { SAXParser parser = factory.newSAXParser(); parser.parse(in, new ContentLoaderHandler(dataSource, ROOT_ELEMENT, true));
[syncope] branch master updated: [SYNCOPE-1397] Now plain attributes are shown in approval, removed unwanted changed flags on empty attributes
This is an automated email from the ASF dual-hosted git repository. andreapatricelli pushed a commit to branch master in repository https://gitbox.apache.org/repos/asf/syncope.git The following commit(s) were added to refs/heads/master by this push: new b7f9a4b [SYNCOPE-1397] Now plain attributes are shown in approval, removed unwanted changed flags on empty attributes b7f9a4b is described below commit b7f9a4b864f0e093618f1791de5b626db5e6a3cf Author: Andrea Patricelli AuthorDate: Thu Nov 22 10:17:27 2018 +0100 [SYNCOPE-1397] Now plain attributes are shown in approval, removed unwanted changed flags on empty attributes --- .../client/console/wizards/any/PlainAttrs.java | 20 +--- 1 file changed, 13 insertions(+), 7 deletions(-) diff --git a/client/console/src/main/java/org/apache/syncope/client/console/wizards/any/PlainAttrs.java b/client/console/src/main/java/org/apache/syncope/client/console/wizards/any/PlainAttrs.java index 7357313..fb9c7c6 100644 --- a/client/console/src/main/java/org/apache/syncope/client/console/wizards/any/PlainAttrs.java +++ b/client/console/src/main/java/org/apache/syncope/client/console/wizards/any/PlainAttrs.java @@ -23,6 +23,7 @@ import java.util.Collections; import java.util.HashMap; import java.util.List; import java.util.Map; +import java.util.Optional; import java.util.stream.Collectors; import org.apache.commons.collections4.ListUtils; import org.apache.commons.lang3.StringUtils; @@ -409,20 +410,25 @@ public class PlainAttrs extends AbstractAttrs { ((MultiFieldPanel) panel).setReadOnly(schemas.get(attrTO.getSchema()).isReadonly()); } item.add(panel); +Optional previousPlainAttr = previousObject.getPlainAttr(attrTO.getSchema()); if (previousObject != null -&& (previousObject.getPlainAttr(attrTO.getSchema()) == null -|| !ListUtils.isEqualList( - ListUtils.select(previousObject.getPlainAttr(attrTO.getSchema()).get().getValues(), -object -> StringUtils.isNotEmpty(object)), -ListUtils.select(attrTO.getValues(), object -> StringUtils.isNotEmpty(object) { +&& ((!previousPlainAttr.isPresent() && !isEmptyOrBlank(attrTO.getValues())) +|| (previousPlainAttr.isPresent() && !ListUtils.isEqualList( + ListUtils.select(previousPlainAttr.get().getValues(), +object -> StringUtils.isNotEmpty(object)), +ListUtils.select(attrTO.getValues(), object -> StringUtils.isNotEmpty(object)) { -List oldValues = previousObject.getPlainAttr(attrTO.getSchema()) == null +List oldValues = !previousPlainAttr.isPresent() ? Collections.emptyList() -: previousObject.getPlainAttr(attrTO.getSchema()).get().getValues(); +: previousPlainAttr.get().getValues(); panel.showExternAction(new LabelInfo("externalAction", oldValues)); } } + +protected boolean isEmptyOrBlank(final List values) { +return values.stream().allMatch(value -> StringUtils.isBlank(value)); +} }); } }
[syncope] branch 2_1_X updated: [SYNCOPE-1397] Now plain attributes are shown in approval, removed unwanted changed flags on empty attributes
This is an automated email from the ASF dual-hosted git repository. andreapatricelli pushed a commit to branch 2_1_X in repository https://gitbox.apache.org/repos/asf/syncope.git The following commit(s) were added to refs/heads/2_1_X by this push: new 2181fc4 [SYNCOPE-1397] Now plain attributes are shown in approval, removed unwanted changed flags on empty attributes 2181fc4 is described below commit 2181fc4b8538c379f650e975306749d887953c18 Author: Andrea Patricelli AuthorDate: Thu Nov 22 10:17:27 2018 +0100 [SYNCOPE-1397] Now plain attributes are shown in approval, removed unwanted changed flags on empty attributes --- .../client/console/wizards/any/PlainAttrs.java | 20 +--- 1 file changed, 13 insertions(+), 7 deletions(-) diff --git a/client/console/src/main/java/org/apache/syncope/client/console/wizards/any/PlainAttrs.java b/client/console/src/main/java/org/apache/syncope/client/console/wizards/any/PlainAttrs.java index 7357313..fb9c7c6 100644 --- a/client/console/src/main/java/org/apache/syncope/client/console/wizards/any/PlainAttrs.java +++ b/client/console/src/main/java/org/apache/syncope/client/console/wizards/any/PlainAttrs.java @@ -23,6 +23,7 @@ import java.util.Collections; import java.util.HashMap; import java.util.List; import java.util.Map; +import java.util.Optional; import java.util.stream.Collectors; import org.apache.commons.collections4.ListUtils; import org.apache.commons.lang3.StringUtils; @@ -409,20 +410,25 @@ public class PlainAttrs extends AbstractAttrs { ((MultiFieldPanel) panel).setReadOnly(schemas.get(attrTO.getSchema()).isReadonly()); } item.add(panel); +Optional previousPlainAttr = previousObject.getPlainAttr(attrTO.getSchema()); if (previousObject != null -&& (previousObject.getPlainAttr(attrTO.getSchema()) == null -|| !ListUtils.isEqualList( - ListUtils.select(previousObject.getPlainAttr(attrTO.getSchema()).get().getValues(), -object -> StringUtils.isNotEmpty(object)), -ListUtils.select(attrTO.getValues(), object -> StringUtils.isNotEmpty(object) { +&& ((!previousPlainAttr.isPresent() && !isEmptyOrBlank(attrTO.getValues())) +|| (previousPlainAttr.isPresent() && !ListUtils.isEqualList( + ListUtils.select(previousPlainAttr.get().getValues(), +object -> StringUtils.isNotEmpty(object)), +ListUtils.select(attrTO.getValues(), object -> StringUtils.isNotEmpty(object)) { -List oldValues = previousObject.getPlainAttr(attrTO.getSchema()) == null +List oldValues = !previousPlainAttr.isPresent() ? Collections.emptyList() -: previousObject.getPlainAttr(attrTO.getSchema()).get().getValues(); +: previousPlainAttr.get().getValues(); panel.showExternAction(new LabelInfo("externalAction", oldValues)); } } + +protected boolean isEmptyOrBlank(final List values) { +return values.stream().allMatch(value -> StringUtils.isBlank(value)); +} }); } }