You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@syncope.apache.org by il...@apache.org on 2017/08/08 12:53:49 UTC

[1/4] syncope git commit: [SYNCOPE-1192] Using the buildnumber-maven-plugin to fetch the latest GIT commit hash + rich display in Admin Console

Repository: syncope
Updated Branches:
  refs/heads/2_0_X 4af3c2175 -> 1855b0b4d
  refs/heads/master b7458d070 -> 1cd6154b5


[SYNCOPE-1192] Using the buildnumber-maven-plugin to fetch the latest GIT commit hash + rich display in Admin Console


Project: http://git-wip-us.apache.org/repos/asf/syncope/repo
Commit: http://git-wip-us.apache.org/repos/asf/syncope/commit/671780f5
Tree: http://git-wip-us.apache.org/repos/asf/syncope/tree/671780f5
Diff: http://git-wip-us.apache.org/repos/asf/syncope/diff/671780f5

Branch: refs/heads/2_0_X
Commit: 671780f583945c1c0ae4dc43490f187e755744b6
Parents: 4af3c21
Author: Francesco Chicchiriccò <il...@apache.org>
Authored: Tue Aug 8 14:12:39 2017 +0200
Committer: Francesco Chicchiriccò <il...@apache.org>
Committed: Tue Aug 8 14:19:30 2017 +0200

----------------------------------------------------------------------
 .../console/SyncopeConsoleApplication.java      |  8 -------
 .../syncope/client/console/pages/BasePage.java  | 12 ++++++++--
 .../syncope/client/console/panels/AnyPanel.java |  6 ++---
 .../src/main/resources/console.properties       |  1 -
 .../syncope/client/console/pages/BasePage.html  | 14 +++++++++---
 .../client/console/pages/BasePage.properties    |  2 +-
 .../client/console/pages/BasePage_it.properties |  2 +-
 .../console/pages/BasePage_pt_BR.properties     |  2 +-
 .../client/console/pages/BasePage_ru.properties |  2 +-
 .../enduser/SyncopeEnduserApplication.java      | 24 --------------------
 .../src/main/resources/enduser.properties       |  4 ----
 .../syncope/common/lib/info/PlatformInfo.java   | 10 ++++++++
 .../apache/syncope/core/logic/SyncopeLogic.java |  4 ++++
 core/logic/src/main/resources/logicContext.xml  |  3 +++
 .../src/main/resources/console.properties       |  1 -
 .../src/test/resources/console.properties       |  1 -
 .../src/main/resources/enduser.properties       |  4 ----
 .../src/test/resources/enduser.properties       |  4 ----
 pom.xml                                         | 18 +++++++++++++++
 19 files changed, 63 insertions(+), 59 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/syncope/blob/671780f5/client/console/src/main/java/org/apache/syncope/client/console/SyncopeConsoleApplication.java
----------------------------------------------------------------------
diff --git a/client/console/src/main/java/org/apache/syncope/client/console/SyncopeConsoleApplication.java b/client/console/src/main/java/org/apache/syncope/client/console/SyncopeConsoleApplication.java
index bd8ec60..fa7d2ef 100644
--- a/client/console/src/main/java/org/apache/syncope/client/console/SyncopeConsoleApplication.java
+++ b/client/console/src/main/java/org/apache/syncope/client/console/SyncopeConsoleApplication.java
@@ -85,8 +85,6 @@ public class SyncopeConsoleApplication extends AuthenticatedWebApplication {
         return (SyncopeConsoleApplication) WebApplication.get();
     }
 
-    private String version;
-
     private String site;
 
     private String anonymousUser;
@@ -141,8 +139,6 @@ public class SyncopeConsoleApplication extends AuthenticatedWebApplication {
         // read console.properties
         Properties props = PropertyUtils.read(getClass(), CONSOLE_PROPERTIES, "console.directory").getLeft();
 
-        version = props.getProperty("version");
-        Args.notNull(version, "<version>");
         site = props.getProperty("site");
         Args.notNull(site, "<site>");
         anonymousUser = props.getProperty("anonymousUser");
@@ -285,10 +281,6 @@ public class SyncopeConsoleApplication extends AuthenticatedWebApplication {
         return pageClasses.get(key);
     }
 
-    public String getVersion() {
-        return version;
-    }
-
     public String getSite() {
         return site;
     }

http://git-wip-us.apache.org/repos/asf/syncope/blob/671780f5/client/console/src/main/java/org/apache/syncope/client/console/pages/BasePage.java
----------------------------------------------------------------------
diff --git a/client/console/src/main/java/org/apache/syncope/client/console/pages/BasePage.java b/client/console/src/main/java/org/apache/syncope/client/console/pages/BasePage.java
index 371e425..815b29f 100644
--- a/client/console/src/main/java/org/apache/syncope/client/console/pages/BasePage.java
+++ b/client/console/src/main/java/org/apache/syncope/client/console/pages/BasePage.java
@@ -35,6 +35,7 @@ import org.apache.syncope.client.console.topology.Topology;
 import org.apache.syncope.client.console.wicket.markup.head.MetaHeaderItem;
 import org.apache.syncope.client.console.wicket.markup.html.bootstrap.dialog.BaseModal;
 import org.apache.syncope.client.console.widgets.ApprovalsWidget;
+import org.apache.syncope.common.lib.info.PlatformInfo;
 import org.apache.syncope.common.lib.info.SystemInfo;
 import org.apache.syncope.common.lib.types.StandardEntitlement;
 import org.apache.wicket.AttributeModifier;
@@ -98,13 +99,20 @@ public class BasePage extends WebPage implements IAjaxIndicatorAware {
         body.addOrReplace(notificationPanel.setOutputMarkupId(true));
 
         // header, footer
-        body.add(new Label("version", SyncopeConsoleApplication.get().getVersion()));
         body.add(new Label("username", SyncopeConsoleSession.get().getSelfTO().getUsername()));
 
         approvalsWidget = new ApprovalsWidget("approvalsWidget", getPageReference());
         body.add(approvalsWidget.setRenderBodyOnly(true));
 
         // right sidebar
+        PlatformInfo platformInfo = SyncopeConsoleSession.get().getPlatformInfo();
+        Label version = new Label("version", platformInfo.getVersion());
+        String versionLink = platformInfo.getVersion().endsWith("-SNAPSHOT")
+                ? "https://git-wip-us.apache.org/repos/asf?p=syncope.git;a=commit;h=" + platformInfo.getBuildNumber()
+                : "https://cwiki.apache.org/confluence/display/SYNCOPE/Jazz";
+        version.add(new AttributeModifier("onclick", "window.open('" + versionLink + "', '_blank')"));
+        body.add(version);
+
         SystemInfo systemInfo = SyncopeConsoleSession.get().getSystemInfo();
         body.add(new Label("hostname", systemInfo.getHostname()));
         body.add(new Label("processors", systemInfo.getAvailableProcessors()));
@@ -169,7 +177,7 @@ public class BasePage extends WebPage implements IAjaxIndicatorAware {
 
         liContainer = new WebMarkupContainer(getLIContainerId("workflow"));
         liContainer.setOutputMarkupPlaceholderTag(true);
-        liContainer.setVisible(SyncopeConsoleSession.get().getPlatformInfo().isUserWorkflowAdapterSupportEdit());
+        liContainer.setVisible(platformInfo.isUserWorkflowAdapterSupportEdit());
         confULContainer.add(liContainer);
         link = BookmarkablePageLinkBuilder.build("workflow", Workflow.class);
         MetaDataRoleAuthorizationStrategy.authorize(link, WebPage.RENDER, StandardEntitlement.WORKFLOW_DEF_GET);

http://git-wip-us.apache.org/repos/asf/syncope/blob/671780f5/client/console/src/main/java/org/apache/syncope/client/console/panels/AnyPanel.java
----------------------------------------------------------------------
diff --git a/client/console/src/main/java/org/apache/syncope/client/console/panels/AnyPanel.java b/client/console/src/main/java/org/apache/syncope/client/console/panels/AnyPanel.java
index de9aa11..d1aa9fc 100644
--- a/client/console/src/main/java/org/apache/syncope/client/console/panels/AnyPanel.java
+++ b/client/console/src/main/java/org/apache/syncope/client/console/panels/AnyPanel.java
@@ -250,7 +250,7 @@ public class AnyPanel extends Panel implements ModalPanel {
                 panel = new UserDirectoryPanel.Builder(
                         anyTypeClassRestClient.list(anyTypeTO.getClasses()),
                         anyTypeTO.getKey(),
-                        pageRef).setRealm(dynRealm != null ? dynRealm : realm).setFiltered(true).
+                        pageRef).setRealm(realm).setFiltered(true).
                         setFiql(fiql).setWizardInModal(true).addNewItemPanelBuilder(FormLayoutInfoUtils.instantiate(
                         userTO,
                         anyTypeTO.getClasses(),
@@ -269,7 +269,7 @@ public class AnyPanel extends Panel implements ModalPanel {
                 panel = new GroupDirectoryPanel.Builder(
                         anyTypeClassRestClient.list(anyTypeTO.getClasses()),
                         anyTypeTO.getKey(),
-                        pageRef).setRealm(dynRealm != null ? dynRealm : realm).setFiltered(true).
+                        pageRef).setRealm(realm).setFiltered(true).
                         setFiql(fiql).setWizardInModal(true).addNewItemPanelBuilder(FormLayoutInfoUtils.instantiate(
                         groupTO,
                         anyTypeTO.getClasses(),
@@ -291,7 +291,7 @@ public class AnyPanel extends Panel implements ModalPanel {
                 panel = new AnyObjectDirectoryPanel.Builder(
                         anyTypeClassRestClient.list(anyTypeTO.getClasses()),
                         anyTypeTO.getKey(),
-                        pageRef).setRealm(dynRealm != null ? dynRealm : realm).setFiltered(true).
+                        pageRef).setRealm(realm).setFiltered(true).
                         setFiql(fiql).setWizardInModal(true).addNewItemPanelBuilder(FormLayoutInfoUtils.instantiate(
                         anyObjectTO,
                         anyTypeTO.getClasses(),

http://git-wip-us.apache.org/repos/asf/syncope/blob/671780f5/client/console/src/main/resources/console.properties
----------------------------------------------------------------------
diff --git a/client/console/src/main/resources/console.properties b/client/console/src/main/resources/console.properties
index 803df03..574bbad 100644
--- a/client/console/src/main/resources/console.properties
+++ b/client/console/src/main/resources/console.properties
@@ -16,7 +16,6 @@
 # under the License.
 console.directory=${conf.directory}
 
-version=${syncope.version}
 site=${project.parent.url}
 
 anonymousUser=${anonymousUser}

http://git-wip-us.apache.org/repos/asf/syncope/blob/671780f5/client/console/src/main/resources/org/apache/syncope/client/console/pages/BasePage.html
----------------------------------------------------------------------
diff --git a/client/console/src/main/resources/org/apache/syncope/client/console/pages/BasePage.html b/client/console/src/main/resources/org/apache/syncope/client/console/pages/BasePage.html
index ed0444a..a8887cf 100644
--- a/client/console/src/main/resources/org/apache/syncope/client/console/pages/BasePage.html
+++ b/client/console/src/main/resources/org/apache/syncope/client/console/pages/BasePage.html
@@ -136,9 +136,6 @@ under the License.
       </div>
 
       <footer class="main-footer">
-        <div class="pull-right hidden-xs">
-          <b>Version</b> <label wicket:id="version"/>
-        </div>
         <strong>Copyright &copy; 2010&#45;<span id="spanYear"></span> 
           <a href="http://www.apache.org/" target="_blank">The Apache Software Foundation</a>.</strong>
         All rights reserved.
@@ -150,6 +147,17 @@ under the License.
           <ul class="control-sidebar-menu">
             <li>
               <a href="#">
+                <i class="menu-icon fa fa-code-fork bg-gray"></i>
+
+                <div class="menu-info">
+                  <h4 class="control-sidebar-subheading"><wicket:message key="version"/></h4>
+
+                  <p><span wicket:id="version" style="text-decoration: underline;"/></p>
+                </div>
+              </a>
+            </li>
+            <li>
+              <a href="#">
                 <i class="menu-icon fa fa-desktop bg-aqua"></i>
 
                 <div class="menu-info">

http://git-wip-us.apache.org/repos/asf/syncope/blob/671780f5/client/console/src/main/resources/org/apache/syncope/client/console/pages/BasePage.properties
----------------------------------------------------------------------
diff --git a/client/console/src/main/resources/org/apache/syncope/client/console/pages/BasePage.properties b/client/console/src/main/resources/org/apache/syncope/client/console/pages/BasePage.properties
index 98cee66..6bfa175 100644
--- a/client/console/src/main/resources/org/apache/syncope/client/console/pages/BasePage.properties
+++ b/client/console/src/main/resources/org/apache/syncope/client/console/pages/BasePage.properties
@@ -15,7 +15,7 @@
 # specific language governing permissions and limitations
 # under the License.
 home=Home
-version=VERSION
+version=Version
 domain=Domain
 
 systemInfo=System Information

http://git-wip-us.apache.org/repos/asf/syncope/blob/671780f5/client/console/src/main/resources/org/apache/syncope/client/console/pages/BasePage_it.properties
----------------------------------------------------------------------
diff --git a/client/console/src/main/resources/org/apache/syncope/client/console/pages/BasePage_it.properties b/client/console/src/main/resources/org/apache/syncope/client/console/pages/BasePage_it.properties
index 41b982a..fe10072 100644
--- a/client/console/src/main/resources/org/apache/syncope/client/console/pages/BasePage_it.properties
+++ b/client/console/src/main/resources/org/apache/syncope/client/console/pages/BasePage_it.properties
@@ -15,7 +15,7 @@
 # specific language governing permissions and limitations
 # under the License.
 home=Home
-version=VERSIONE
+version=Versione
 domain=Dom\u00ednio
 
 systemInfo=Informazioni di Sistema

http://git-wip-us.apache.org/repos/asf/syncope/blob/671780f5/client/console/src/main/resources/org/apache/syncope/client/console/pages/BasePage_pt_BR.properties
----------------------------------------------------------------------
diff --git a/client/console/src/main/resources/org/apache/syncope/client/console/pages/BasePage_pt_BR.properties b/client/console/src/main/resources/org/apache/syncope/client/console/pages/BasePage_pt_BR.properties
index 2a84a71..0c2da70 100644
--- a/client/console/src/main/resources/org/apache/syncope/client/console/pages/BasePage_pt_BR.properties
+++ b/client/console/src/main/resources/org/apache/syncope/client/console/pages/BasePage_pt_BR.properties
@@ -15,7 +15,7 @@
 # specific language governing permissions and limitations
 # under the License.
 home=In\u00edcio
-version=VERS\u00c3O
+version=Vers\u00e3o
 domain=Domain
 
 systemInfo=System Information

http://git-wip-us.apache.org/repos/asf/syncope/blob/671780f5/client/console/src/main/resources/org/apache/syncope/client/console/pages/BasePage_ru.properties
----------------------------------------------------------------------
diff --git a/client/console/src/main/resources/org/apache/syncope/client/console/pages/BasePage_ru.properties b/client/console/src/main/resources/org/apache/syncope/client/console/pages/BasePage_ru.properties
index 85c1c33..e6c6105 100644
--- a/client/console/src/main/resources/org/apache/syncope/client/console/pages/BasePage_ru.properties
+++ b/client/console/src/main/resources/org/apache/syncope/client/console/pages/BasePage_ru.properties
@@ -16,7 +16,7 @@
 # under the License.
 #
 home=\u0413\u043b\u0430\u0432\u043d\u0430\u044f
-version=\u0412\u0415\u0420\u0421\u0418\u042f
+version=\u0412\u0435\u0440\u0441\u0438\u044f
 domain=\u0414\u043e\u043c\u0435\u043d
 systemInfo=\u0418\u043d\u0444\u043e\u0440\u043c\u0430\u0446\u0438\u044f \u043e \u0441\u0438\u0441\u0442\u0435\u043c\u0435
 hostname=\u0418\u043c\u044f \u0445\u043e\u0441\u0442\u0430

http://git-wip-us.apache.org/repos/asf/syncope/blob/671780f5/client/enduser/src/main/java/org/apache/syncope/client/enduser/SyncopeEnduserApplication.java
----------------------------------------------------------------------
diff --git a/client/enduser/src/main/java/org/apache/syncope/client/enduser/SyncopeEnduserApplication.java b/client/enduser/src/main/java/org/apache/syncope/client/enduser/SyncopeEnduserApplication.java
index 5e42000..e35a166 100644
--- a/client/enduser/src/main/java/org/apache/syncope/client/enduser/SyncopeEnduserApplication.java
+++ b/client/enduser/src/main/java/org/apache/syncope/client/enduser/SyncopeEnduserApplication.java
@@ -71,12 +71,6 @@ public class SyncopeEnduserApplication extends WebApplication implements Seriali
         return (SyncopeEnduserApplication) WebApplication.get();
     }
 
-    private String version;
-
-    private String site;
-
-    private String license;
-
     private String domain;
 
     private String adminUser;
@@ -102,12 +96,6 @@ public class SyncopeEnduserApplication extends WebApplication implements Seriali
         // read enduser.properties
         Properties props = PropertyUtils.read(getClass(), ENDUSER_PROPERTIES, "enduser.directory").getLeft();
 
-        version = props.getProperty("version");
-        Args.notNull(version, "<version>");
-        site = props.getProperty("site");
-        Args.notNull(site, "<site>");
-        license = props.getProperty("license");
-        Args.notNull(license, "<license>");
         domain = props.getProperty("domain", SyncopeConstants.MASTER_DOMAIN);
         adminUser = props.getProperty("adminUser");
         Args.notNull(adminUser, "<adminUser>");
@@ -262,18 +250,6 @@ public class SyncopeEnduserApplication extends WebApplication implements Seriali
         return new SyncopeEnduserSession(request);
     }
 
-    public String getVersion() {
-        return version;
-    }
-
-    public String getSite() {
-        return site;
-    }
-
-    public String getLicense() {
-        return license;
-    }
-
     public String getDomain() {
         return domain;
     }

http://git-wip-us.apache.org/repos/asf/syncope/blob/671780f5/client/enduser/src/main/resources/enduser.properties
----------------------------------------------------------------------
diff --git a/client/enduser/src/main/resources/enduser.properties b/client/enduser/src/main/resources/enduser.properties
index 2e6fd9b..df51b73 100644
--- a/client/enduser/src/main/resources/enduser.properties
+++ b/client/enduser/src/main/resources/enduser.properties
@@ -16,10 +16,6 @@
 # under the License.
 enduser.directory=${conf.directory}
 
-version=${syncope.version}
-site=${project.parent.url}
-license=${licenseUrl}
-
 domain=Master
 
 anonymousUser=${anonymousUser}

http://git-wip-us.apache.org/repos/asf/syncope/blob/671780f5/common/lib/src/main/java/org/apache/syncope/common/lib/info/PlatformInfo.java
----------------------------------------------------------------------
diff --git a/common/lib/src/main/java/org/apache/syncope/common/lib/info/PlatformInfo.java b/common/lib/src/main/java/org/apache/syncope/common/lib/info/PlatformInfo.java
index 9dd0b87..e6abeaf 100644
--- a/common/lib/src/main/java/org/apache/syncope/common/lib/info/PlatformInfo.java
+++ b/common/lib/src/main/java/org/apache/syncope/common/lib/info/PlatformInfo.java
@@ -37,6 +37,8 @@ public class PlatformInfo extends AbstractBaseBean {
 
     private String version;
 
+    private String buildNumber;
+
     private boolean selfRegAllowed;
 
     private boolean pwdResetAllowed;
@@ -113,6 +115,10 @@ public class PlatformInfo extends AbstractBaseBean {
         return version;
     }
 
+    public String getBuildNumber() {
+        return buildNumber;
+    }
+
     public boolean isSelfRegAllowed() {
         return selfRegAllowed;
     }
@@ -332,6 +338,10 @@ public class PlatformInfo extends AbstractBaseBean {
         this.version = version;
     }
 
+    public void setBuildNumber(final String buildNumber) {
+        this.buildNumber = buildNumber;
+    }
+
     public void setSelfRegAllowed(final boolean selfRegAllowed) {
         this.selfRegAllowed = selfRegAllowed;
     }

http://git-wip-us.apache.org/repos/asf/syncope/blob/671780f5/core/logic/src/main/java/org/apache/syncope/core/logic/SyncopeLogic.java
----------------------------------------------------------------------
diff --git a/core/logic/src/main/java/org/apache/syncope/core/logic/SyncopeLogic.java b/core/logic/src/main/java/org/apache/syncope/core/logic/SyncopeLogic.java
index e51a449..26ed521 100644
--- a/core/logic/src/main/java/org/apache/syncope/core/logic/SyncopeLogic.java
+++ b/core/logic/src/main/java/org/apache/syncope/core/logic/SyncopeLogic.java
@@ -147,6 +147,9 @@ public class SyncopeLogic extends AbstractLogic<AbstractBaseBean> {
     @Resource(name = "version")
     private String version;
 
+    @Resource(name = "buildNumber")
+    private String buildNumber;
+
     @Autowired
     private ConnIdBundleManager bundleManager;
 
@@ -198,6 +201,7 @@ public class SyncopeLogic extends AbstractLogic<AbstractBaseBean> {
             if (PLATFORM_INFO == null) {
                 PLATFORM_INFO = new PlatformInfo();
                 PLATFORM_INFO.setVersion(version);
+                PLATFORM_INFO.setBuildNumber(buildNumber);
 
                 if (bundleManager.getLocations() != null) {
                     for (URI location : bundleManager.getLocations()) {

http://git-wip-us.apache.org/repos/asf/syncope/blob/671780f5/core/logic/src/main/resources/logicContext.xml
----------------------------------------------------------------------
diff --git a/core/logic/src/main/resources/logicContext.xml b/core/logic/src/main/resources/logicContext.xml
index 7faa00c..59066a9 100644
--- a/core/logic/src/main/resources/logicContext.xml
+++ b/core/logic/src/main/resources/logicContext.xml
@@ -31,6 +31,9 @@ under the License.
   <bean id="version" class="java.lang.String">
     <constructor-arg value="${syncope.version}"/>
   </bean>
+  <bean id="buildNumber" class="java.lang.String">
+    <constructor-arg value="${buildNumber}"/>
+  </bean>
 
   <aop:aspectj-autoproxy/>
 

http://git-wip-us.apache.org/repos/asf/syncope/blob/671780f5/fit/console-reference/src/main/resources/console.properties
----------------------------------------------------------------------
diff --git a/fit/console-reference/src/main/resources/console.properties b/fit/console-reference/src/main/resources/console.properties
index 8c2f235..a90631b 100644
--- a/fit/console-reference/src/main/resources/console.properties
+++ b/fit/console-reference/src/main/resources/console.properties
@@ -16,7 +16,6 @@
 # under the License.
 console.directory=${conf.directory}
 
-version=${syncope.version}
 site=${project.parent.url}
 
 anonymousUser=${anonymousUser}

http://git-wip-us.apache.org/repos/asf/syncope/blob/671780f5/fit/core-reference/src/test/resources/console.properties
----------------------------------------------------------------------
diff --git a/fit/core-reference/src/test/resources/console.properties b/fit/core-reference/src/test/resources/console.properties
index 51e6f95..23d4c37 100644
--- a/fit/core-reference/src/test/resources/console.properties
+++ b/fit/core-reference/src/test/resources/console.properties
@@ -16,7 +16,6 @@
 # under the License.
 console.directory=${conf.directory}
 
-version=${syncope.version}
 site=${project.parent.url}
 
 anonymousUser=${anonymousUser}

http://git-wip-us.apache.org/repos/asf/syncope/blob/671780f5/fit/enduser-reference/src/main/resources/enduser.properties
----------------------------------------------------------------------
diff --git a/fit/enduser-reference/src/main/resources/enduser.properties b/fit/enduser-reference/src/main/resources/enduser.properties
index 5f76958..b42cc34 100644
--- a/fit/enduser-reference/src/main/resources/enduser.properties
+++ b/fit/enduser-reference/src/main/resources/enduser.properties
@@ -16,10 +16,6 @@
 # under the License.
 enduser.directory=${conf.directory}
 
-version=${syncope.version}
-site=${project.parent.url}
-license=${licenseUrl}
-
 domain=Master
 
 anonymousUser=${anonymousUser}

http://git-wip-us.apache.org/repos/asf/syncope/blob/671780f5/fit/enduser-reference/src/test/resources/enduser.properties
----------------------------------------------------------------------
diff --git a/fit/enduser-reference/src/test/resources/enduser.properties b/fit/enduser-reference/src/test/resources/enduser.properties
index 58ed435..7387c0d 100644
--- a/fit/enduser-reference/src/test/resources/enduser.properties
+++ b/fit/enduser-reference/src/test/resources/enduser.properties
@@ -16,10 +16,6 @@
 # under the License.
 enduser.directory=${conf.directory}
 
-version=${syncope.version}
-site=${project.parent.url}
-license=${licenseUrl}
-
 domain=Master
 
 anonymousUser=${anonymousUser}

http://git-wip-us.apache.org/repos/asf/syncope/blob/671780f5/pom.xml
----------------------------------------------------------------------
diff --git a/pom.xml b/pom.xml
index 58ae149..36fafc0 100644
--- a/pom.xml
+++ b/pom.xml
@@ -2185,6 +2185,24 @@ under the License.
       </plugin>
       
       <plugin>
+        <groupId>org.codehaus.mojo</groupId>
+        <artifactId>buildnumber-maven-plugin</artifactId>
+        <version>1.4</version>
+        <configuration>
+          <doCheck>false</doCheck>
+          <doUpdate>false</doUpdate>
+        </configuration>
+        <executions>
+          <execution>
+            <phase>validate</phase>
+            <goals>
+              <goal>create</goal>
+            </goals>
+          </execution>
+        </executions>
+      </plugin>
+
+      <plugin>
         <groupId>org.apache.maven.plugins</groupId>
         <artifactId>maven-release-plugin</artifactId>
         <version>2.5.3</version>


[3/4] syncope git commit: [SYNCOPE-1192] Using the buildnumber-maven-plugin to fetch the latest GIT commit hash + rich display in Admin Console

Posted by il...@apache.org.
[SYNCOPE-1192] Using the buildnumber-maven-plugin to fetch the latest GIT commit hash + rich display in Admin Console


Project: http://git-wip-us.apache.org/repos/asf/syncope/repo
Commit: http://git-wip-us.apache.org/repos/asf/syncope/commit/d4a67d4f
Tree: http://git-wip-us.apache.org/repos/asf/syncope/tree/d4a67d4f
Diff: http://git-wip-us.apache.org/repos/asf/syncope/diff/d4a67d4f

Branch: refs/heads/master
Commit: d4a67d4fb69c6896d3c7cfffb01ed49c2ff13205
Parents: b7458d0
Author: Francesco Chicchiriccò <il...@apache.org>
Authored: Tue Aug 8 14:12:39 2017 +0200
Committer: Francesco Chicchiriccò <il...@apache.org>
Committed: Tue Aug 8 14:53:34 2017 +0200

----------------------------------------------------------------------
 .../console/SyncopeConsoleApplication.java      |  8 -------
 .../syncope/client/console/pages/BasePage.java  | 13 ++++++++---
 .../syncope/client/console/panels/AnyPanel.java |  6 ++---
 .../src/main/resources/console.properties       |  1 -
 .../syncope/client/console/pages/BasePage.html  | 14 +++++++++---
 .../client/console/pages/BasePage.properties    |  2 +-
 .../client/console/pages/BasePage_it.properties |  2 +-
 .../console/pages/BasePage_pt_BR.properties     |  2 +-
 .../client/console/pages/BasePage_ru.properties |  2 +-
 .../enduser/SyncopeEnduserApplication.java      | 24 --------------------
 .../src/main/resources/enduser.properties       |  4 ----
 .../syncope/common/lib/info/PlatformInfo.java   | 10 ++++++++
 .../apache/syncope/core/logic/SyncopeLogic.java |  4 ++++
 core/logic/src/main/resources/logicContext.xml  |  3 +++
 .../src/main/resources/console.properties       |  1 -
 .../src/test/resources/console.properties       |  1 -
 .../src/main/resources/enduser.properties       |  4 ----
 .../src/test/resources/enduser.properties       |  4 ----
 pom.xml                                         | 18 +++++++++++++++
 19 files changed, 63 insertions(+), 60 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/syncope/blob/d4a67d4f/client/console/src/main/java/org/apache/syncope/client/console/SyncopeConsoleApplication.java
----------------------------------------------------------------------
diff --git a/client/console/src/main/java/org/apache/syncope/client/console/SyncopeConsoleApplication.java b/client/console/src/main/java/org/apache/syncope/client/console/SyncopeConsoleApplication.java
index 427e364..9d04645 100644
--- a/client/console/src/main/java/org/apache/syncope/client/console/SyncopeConsoleApplication.java
+++ b/client/console/src/main/java/org/apache/syncope/client/console/SyncopeConsoleApplication.java
@@ -86,8 +86,6 @@ public class SyncopeConsoleApplication extends AuthenticatedWebApplication {
         return (SyncopeConsoleApplication) WebApplication.get();
     }
 
-    private String version;
-
     private String site;
 
     private String anonymousUser;
@@ -140,8 +138,6 @@ public class SyncopeConsoleApplication extends AuthenticatedWebApplication {
         // read console.properties
         Properties props = PropertyUtils.read(getClass(), CONSOLE_PROPERTIES, "console.directory").getLeft();
 
-        version = props.getProperty("version");
-        Args.notNull(version, "<version>");
         site = props.getProperty("site");
         Args.notNull(site, "<site>");
         anonymousUser = props.getProperty("anonymousUser");
@@ -267,10 +263,6 @@ public class SyncopeConsoleApplication extends AuthenticatedWebApplication {
         return pageClasses.get(key);
     }
 
-    public String getVersion() {
-        return version;
-    }
-
     public String getSite() {
         return site;
     }

http://git-wip-us.apache.org/repos/asf/syncope/blob/d4a67d4f/client/console/src/main/java/org/apache/syncope/client/console/pages/BasePage.java
----------------------------------------------------------------------
diff --git a/client/console/src/main/java/org/apache/syncope/client/console/pages/BasePage.java b/client/console/src/main/java/org/apache/syncope/client/console/pages/BasePage.java
index 55d8f9c..8a02ec9 100644
--- a/client/console/src/main/java/org/apache/syncope/client/console/pages/BasePage.java
+++ b/client/console/src/main/java/org/apache/syncope/client/console/pages/BasePage.java
@@ -35,6 +35,7 @@ import org.apache.syncope.client.console.topology.Topology;
 import org.apache.syncope.client.console.wicket.markup.head.MetaHeaderItem;
 import org.apache.syncope.client.console.wicket.markup.html.bootstrap.dialog.BaseModal;
 import org.apache.syncope.client.console.widgets.ApprovalsWidget;
+import org.apache.syncope.common.lib.info.PlatformInfo;
 import org.apache.syncope.common.lib.info.SystemInfo;
 import org.apache.syncope.common.lib.types.StandardEntitlement;
 import org.apache.wicket.AttributeModifier;
@@ -98,13 +99,20 @@ public class BasePage extends WebPage implements IAjaxIndicatorAware {
         body.addOrReplace(notificationPanel.setOutputMarkupId(true));
 
         // header, footer
-        body.add(new Label("version", SyncopeConsoleApplication.get().getVersion()));
         body.add(new Label("username", SyncopeConsoleSession.get().getSelfTO().getUsername()));
 
         approvalsWidget = new ApprovalsWidget("approvalsWidget", getPageReference());
         body.add(approvalsWidget.setRenderBodyOnly(true));
 
         // right sidebar
+        PlatformInfo platformInfo = SyncopeConsoleSession.get().getPlatformInfo();
+        Label version = new Label("version", platformInfo.getVersion());
+        String versionLink = platformInfo.getVersion().endsWith("-SNAPSHOT")
+                ? "https://git-wip-us.apache.org/repos/asf?p=syncope.git;a=commit;h=" + platformInfo.getBuildNumber()
+                : "https://cwiki.apache.org/confluence/display/SYNCOPE/Jazz";
+        version.add(new AttributeModifier("onclick", "window.open('" + versionLink + "', '_blank')"));
+        body.add(version);
+
         SystemInfo systemInfo = SyncopeConsoleSession.get().getSystemInfo();
         body.add(new Label("hostname", systemInfo.getHostname()));
         body.add(new Label("processors", systemInfo.getAvailableProcessors()));
@@ -171,8 +179,7 @@ public class BasePage extends WebPage implements IAjaxIndicatorAware {
 
         liContainer = new WebMarkupContainer(getLIContainerId("workflow"));
         liContainer.setOutputMarkupPlaceholderTag(true);
-        liContainer.setVisible(
-                SyncopeConsoleSession.get().getPlatformInfo().getUserWorkflowAdapter().contains("Activiti"));
+        liContainer.setVisible(platformInfo.getUserWorkflowAdapter().contains("Activiti"));
         confULContainer.add(liContainer);
         link = BookmarkablePageLinkBuilder.build("workflow", Workflow.class);
         MetaDataRoleAuthorizationStrategy.authorize(link, WebPage.RENDER, StandardEntitlement.WORKFLOW_DEF_GET);

http://git-wip-us.apache.org/repos/asf/syncope/blob/d4a67d4f/client/console/src/main/java/org/apache/syncope/client/console/panels/AnyPanel.java
----------------------------------------------------------------------
diff --git a/client/console/src/main/java/org/apache/syncope/client/console/panels/AnyPanel.java b/client/console/src/main/java/org/apache/syncope/client/console/panels/AnyPanel.java
index de9aa11..d1aa9fc 100644
--- a/client/console/src/main/java/org/apache/syncope/client/console/panels/AnyPanel.java
+++ b/client/console/src/main/java/org/apache/syncope/client/console/panels/AnyPanel.java
@@ -250,7 +250,7 @@ public class AnyPanel extends Panel implements ModalPanel {
                 panel = new UserDirectoryPanel.Builder(
                         anyTypeClassRestClient.list(anyTypeTO.getClasses()),
                         anyTypeTO.getKey(),
-                        pageRef).setRealm(dynRealm != null ? dynRealm : realm).setFiltered(true).
+                        pageRef).setRealm(realm).setFiltered(true).
                         setFiql(fiql).setWizardInModal(true).addNewItemPanelBuilder(FormLayoutInfoUtils.instantiate(
                         userTO,
                         anyTypeTO.getClasses(),
@@ -269,7 +269,7 @@ public class AnyPanel extends Panel implements ModalPanel {
                 panel = new GroupDirectoryPanel.Builder(
                         anyTypeClassRestClient.list(anyTypeTO.getClasses()),
                         anyTypeTO.getKey(),
-                        pageRef).setRealm(dynRealm != null ? dynRealm : realm).setFiltered(true).
+                        pageRef).setRealm(realm).setFiltered(true).
                         setFiql(fiql).setWizardInModal(true).addNewItemPanelBuilder(FormLayoutInfoUtils.instantiate(
                         groupTO,
                         anyTypeTO.getClasses(),
@@ -291,7 +291,7 @@ public class AnyPanel extends Panel implements ModalPanel {
                 panel = new AnyObjectDirectoryPanel.Builder(
                         anyTypeClassRestClient.list(anyTypeTO.getClasses()),
                         anyTypeTO.getKey(),
-                        pageRef).setRealm(dynRealm != null ? dynRealm : realm).setFiltered(true).
+                        pageRef).setRealm(realm).setFiltered(true).
                         setFiql(fiql).setWizardInModal(true).addNewItemPanelBuilder(FormLayoutInfoUtils.instantiate(
                         anyObjectTO,
                         anyTypeTO.getClasses(),

http://git-wip-us.apache.org/repos/asf/syncope/blob/d4a67d4f/client/console/src/main/resources/console.properties
----------------------------------------------------------------------
diff --git a/client/console/src/main/resources/console.properties b/client/console/src/main/resources/console.properties
index c9c0cdd..59c3c09 100644
--- a/client/console/src/main/resources/console.properties
+++ b/client/console/src/main/resources/console.properties
@@ -16,7 +16,6 @@
 # under the License.
 console.directory=${conf.directory}
 
-version=${syncope.version}
 site=${project.parent.url}
 
 anonymousUser=${anonymousUser}

http://git-wip-us.apache.org/repos/asf/syncope/blob/d4a67d4f/client/console/src/main/resources/org/apache/syncope/client/console/pages/BasePage.html
----------------------------------------------------------------------
diff --git a/client/console/src/main/resources/org/apache/syncope/client/console/pages/BasePage.html b/client/console/src/main/resources/org/apache/syncope/client/console/pages/BasePage.html
index ed0444a..a8887cf 100644
--- a/client/console/src/main/resources/org/apache/syncope/client/console/pages/BasePage.html
+++ b/client/console/src/main/resources/org/apache/syncope/client/console/pages/BasePage.html
@@ -136,9 +136,6 @@ under the License.
       </div>
 
       <footer class="main-footer">
-        <div class="pull-right hidden-xs">
-          <b>Version</b> <label wicket:id="version"/>
-        </div>
         <strong>Copyright &copy; 2010&#45;<span id="spanYear"></span> 
           <a href="http://www.apache.org/" target="_blank">The Apache Software Foundation</a>.</strong>
         All rights reserved.
@@ -150,6 +147,17 @@ under the License.
           <ul class="control-sidebar-menu">
             <li>
               <a href="#">
+                <i class="menu-icon fa fa-code-fork bg-gray"></i>
+
+                <div class="menu-info">
+                  <h4 class="control-sidebar-subheading"><wicket:message key="version"/></h4>
+
+                  <p><span wicket:id="version" style="text-decoration: underline;"/></p>
+                </div>
+              </a>
+            </li>
+            <li>
+              <a href="#">
                 <i class="menu-icon fa fa-desktop bg-aqua"></i>
 
                 <div class="menu-info">

http://git-wip-us.apache.org/repos/asf/syncope/blob/d4a67d4f/client/console/src/main/resources/org/apache/syncope/client/console/pages/BasePage.properties
----------------------------------------------------------------------
diff --git a/client/console/src/main/resources/org/apache/syncope/client/console/pages/BasePage.properties b/client/console/src/main/resources/org/apache/syncope/client/console/pages/BasePage.properties
index 98cee66..6bfa175 100644
--- a/client/console/src/main/resources/org/apache/syncope/client/console/pages/BasePage.properties
+++ b/client/console/src/main/resources/org/apache/syncope/client/console/pages/BasePage.properties
@@ -15,7 +15,7 @@
 # specific language governing permissions and limitations
 # under the License.
 home=Home
-version=VERSION
+version=Version
 domain=Domain
 
 systemInfo=System Information

http://git-wip-us.apache.org/repos/asf/syncope/blob/d4a67d4f/client/console/src/main/resources/org/apache/syncope/client/console/pages/BasePage_it.properties
----------------------------------------------------------------------
diff --git a/client/console/src/main/resources/org/apache/syncope/client/console/pages/BasePage_it.properties b/client/console/src/main/resources/org/apache/syncope/client/console/pages/BasePage_it.properties
index 41b982a..fe10072 100644
--- a/client/console/src/main/resources/org/apache/syncope/client/console/pages/BasePage_it.properties
+++ b/client/console/src/main/resources/org/apache/syncope/client/console/pages/BasePage_it.properties
@@ -15,7 +15,7 @@
 # specific language governing permissions and limitations
 # under the License.
 home=Home
-version=VERSIONE
+version=Versione
 domain=Dom\u00ednio
 
 systemInfo=Informazioni di Sistema

http://git-wip-us.apache.org/repos/asf/syncope/blob/d4a67d4f/client/console/src/main/resources/org/apache/syncope/client/console/pages/BasePage_pt_BR.properties
----------------------------------------------------------------------
diff --git a/client/console/src/main/resources/org/apache/syncope/client/console/pages/BasePage_pt_BR.properties b/client/console/src/main/resources/org/apache/syncope/client/console/pages/BasePage_pt_BR.properties
index 2a84a71..0c2da70 100644
--- a/client/console/src/main/resources/org/apache/syncope/client/console/pages/BasePage_pt_BR.properties
+++ b/client/console/src/main/resources/org/apache/syncope/client/console/pages/BasePage_pt_BR.properties
@@ -15,7 +15,7 @@
 # specific language governing permissions and limitations
 # under the License.
 home=In\u00edcio
-version=VERS\u00c3O
+version=Vers\u00e3o
 domain=Domain
 
 systemInfo=System Information

http://git-wip-us.apache.org/repos/asf/syncope/blob/d4a67d4f/client/console/src/main/resources/org/apache/syncope/client/console/pages/BasePage_ru.properties
----------------------------------------------------------------------
diff --git a/client/console/src/main/resources/org/apache/syncope/client/console/pages/BasePage_ru.properties b/client/console/src/main/resources/org/apache/syncope/client/console/pages/BasePage_ru.properties
index 85c1c33..e6c6105 100644
--- a/client/console/src/main/resources/org/apache/syncope/client/console/pages/BasePage_ru.properties
+++ b/client/console/src/main/resources/org/apache/syncope/client/console/pages/BasePage_ru.properties
@@ -16,7 +16,7 @@
 # under the License.
 #
 home=\u0413\u043b\u0430\u0432\u043d\u0430\u044f
-version=\u0412\u0415\u0420\u0421\u0418\u042f
+version=\u0412\u0435\u0440\u0441\u0438\u044f
 domain=\u0414\u043e\u043c\u0435\u043d
 systemInfo=\u0418\u043d\u0444\u043e\u0440\u043c\u0430\u0446\u0438\u044f \u043e \u0441\u0438\u0441\u0442\u0435\u043c\u0435
 hostname=\u0418\u043c\u044f \u0445\u043e\u0441\u0442\u0430

http://git-wip-us.apache.org/repos/asf/syncope/blob/d4a67d4f/client/enduser/src/main/java/org/apache/syncope/client/enduser/SyncopeEnduserApplication.java
----------------------------------------------------------------------
diff --git a/client/enduser/src/main/java/org/apache/syncope/client/enduser/SyncopeEnduserApplication.java b/client/enduser/src/main/java/org/apache/syncope/client/enduser/SyncopeEnduserApplication.java
index 5e42000..e35a166 100644
--- a/client/enduser/src/main/java/org/apache/syncope/client/enduser/SyncopeEnduserApplication.java
+++ b/client/enduser/src/main/java/org/apache/syncope/client/enduser/SyncopeEnduserApplication.java
@@ -71,12 +71,6 @@ public class SyncopeEnduserApplication extends WebApplication implements Seriali
         return (SyncopeEnduserApplication) WebApplication.get();
     }
 
-    private String version;
-
-    private String site;
-
-    private String license;
-
     private String domain;
 
     private String adminUser;
@@ -102,12 +96,6 @@ public class SyncopeEnduserApplication extends WebApplication implements Seriali
         // read enduser.properties
         Properties props = PropertyUtils.read(getClass(), ENDUSER_PROPERTIES, "enduser.directory").getLeft();
 
-        version = props.getProperty("version");
-        Args.notNull(version, "<version>");
-        site = props.getProperty("site");
-        Args.notNull(site, "<site>");
-        license = props.getProperty("license");
-        Args.notNull(license, "<license>");
         domain = props.getProperty("domain", SyncopeConstants.MASTER_DOMAIN);
         adminUser = props.getProperty("adminUser");
         Args.notNull(adminUser, "<adminUser>");
@@ -262,18 +250,6 @@ public class SyncopeEnduserApplication extends WebApplication implements Seriali
         return new SyncopeEnduserSession(request);
     }
 
-    public String getVersion() {
-        return version;
-    }
-
-    public String getSite() {
-        return site;
-    }
-
-    public String getLicense() {
-        return license;
-    }
-
     public String getDomain() {
         return domain;
     }

http://git-wip-us.apache.org/repos/asf/syncope/blob/d4a67d4f/client/enduser/src/main/resources/enduser.properties
----------------------------------------------------------------------
diff --git a/client/enduser/src/main/resources/enduser.properties b/client/enduser/src/main/resources/enduser.properties
index 2e6fd9b..df51b73 100644
--- a/client/enduser/src/main/resources/enduser.properties
+++ b/client/enduser/src/main/resources/enduser.properties
@@ -16,10 +16,6 @@
 # under the License.
 enduser.directory=${conf.directory}
 
-version=${syncope.version}
-site=${project.parent.url}
-license=${licenseUrl}
-
 domain=Master
 
 anonymousUser=${anonymousUser}

http://git-wip-us.apache.org/repos/asf/syncope/blob/d4a67d4f/common/lib/src/main/java/org/apache/syncope/common/lib/info/PlatformInfo.java
----------------------------------------------------------------------
diff --git a/common/lib/src/main/java/org/apache/syncope/common/lib/info/PlatformInfo.java b/common/lib/src/main/java/org/apache/syncope/common/lib/info/PlatformInfo.java
index 76495b7..f7f93d6 100644
--- a/common/lib/src/main/java/org/apache/syncope/common/lib/info/PlatformInfo.java
+++ b/common/lib/src/main/java/org/apache/syncope/common/lib/info/PlatformInfo.java
@@ -37,6 +37,8 @@ public class PlatformInfo extends AbstractBaseBean {
 
     private String version;
 
+    private String buildNumber;
+
     private boolean selfRegAllowed;
 
     private boolean pwdResetAllowed;
@@ -107,6 +109,10 @@ public class PlatformInfo extends AbstractBaseBean {
         return version;
     }
 
+    public String getBuildNumber() {
+        return buildNumber;
+    }
+
     public boolean isSelfRegAllowed() {
         return selfRegAllowed;
     }
@@ -314,6 +320,10 @@ public class PlatformInfo extends AbstractBaseBean {
         this.version = version;
     }
 
+    public void setBuildNumber(final String buildNumber) {
+        this.buildNumber = buildNumber;
+    }
+
     public void setSelfRegAllowed(final boolean selfRegAllowed) {
         this.selfRegAllowed = selfRegAllowed;
     }

http://git-wip-us.apache.org/repos/asf/syncope/blob/d4a67d4f/core/logic/src/main/java/org/apache/syncope/core/logic/SyncopeLogic.java
----------------------------------------------------------------------
diff --git a/core/logic/src/main/java/org/apache/syncope/core/logic/SyncopeLogic.java b/core/logic/src/main/java/org/apache/syncope/core/logic/SyncopeLogic.java
index eb33307..00a6592 100644
--- a/core/logic/src/main/java/org/apache/syncope/core/logic/SyncopeLogic.java
+++ b/core/logic/src/main/java/org/apache/syncope/core/logic/SyncopeLogic.java
@@ -147,6 +147,9 @@ public class SyncopeLogic extends AbstractLogic<AbstractBaseBean> {
     @Resource(name = "version")
     private String version;
 
+    @Resource(name = "buildNumber")
+    private String buildNumber;
+
     @Autowired
     private ConnIdBundleManager bundleManager;
 
@@ -198,6 +201,7 @@ public class SyncopeLogic extends AbstractLogic<AbstractBaseBean> {
             if (PLATFORM_INFO == null) {
                 PLATFORM_INFO = new PlatformInfo();
                 PLATFORM_INFO.setVersion(version);
+                PLATFORM_INFO.setBuildNumber(buildNumber);
 
                 if (bundleManager.getLocations() != null) {
                     for (URI location : bundleManager.getLocations()) {

http://git-wip-us.apache.org/repos/asf/syncope/blob/d4a67d4f/core/logic/src/main/resources/logicContext.xml
----------------------------------------------------------------------
diff --git a/core/logic/src/main/resources/logicContext.xml b/core/logic/src/main/resources/logicContext.xml
index 7faa00c..59066a9 100644
--- a/core/logic/src/main/resources/logicContext.xml
+++ b/core/logic/src/main/resources/logicContext.xml
@@ -31,6 +31,9 @@ under the License.
   <bean id="version" class="java.lang.String">
     <constructor-arg value="${syncope.version}"/>
   </bean>
+  <bean id="buildNumber" class="java.lang.String">
+    <constructor-arg value="${buildNumber}"/>
+  </bean>
 
   <aop:aspectj-autoproxy/>
 

http://git-wip-us.apache.org/repos/asf/syncope/blob/d4a67d4f/fit/console-reference/src/main/resources/console.properties
----------------------------------------------------------------------
diff --git a/fit/console-reference/src/main/resources/console.properties b/fit/console-reference/src/main/resources/console.properties
index 7515275..1453ad0 100644
--- a/fit/console-reference/src/main/resources/console.properties
+++ b/fit/console-reference/src/main/resources/console.properties
@@ -16,7 +16,6 @@
 # under the License.
 console.directory=${conf.directory}
 
-version=${syncope.version}
 site=${project.parent.url}
 
 anonymousUser=${anonymousUser}

http://git-wip-us.apache.org/repos/asf/syncope/blob/d4a67d4f/fit/core-reference/src/test/resources/console.properties
----------------------------------------------------------------------
diff --git a/fit/core-reference/src/test/resources/console.properties b/fit/core-reference/src/test/resources/console.properties
index 93f812c..6ed91a2 100644
--- a/fit/core-reference/src/test/resources/console.properties
+++ b/fit/core-reference/src/test/resources/console.properties
@@ -16,7 +16,6 @@
 # under the License.
 console.directory=${conf.directory}
 
-version=${syncope.version}
 site=${project.parent.url}
 
 anonymousUser=${anonymousUser}

http://git-wip-us.apache.org/repos/asf/syncope/blob/d4a67d4f/fit/enduser-reference/src/main/resources/enduser.properties
----------------------------------------------------------------------
diff --git a/fit/enduser-reference/src/main/resources/enduser.properties b/fit/enduser-reference/src/main/resources/enduser.properties
index 5f76958..b42cc34 100644
--- a/fit/enduser-reference/src/main/resources/enduser.properties
+++ b/fit/enduser-reference/src/main/resources/enduser.properties
@@ -16,10 +16,6 @@
 # under the License.
 enduser.directory=${conf.directory}
 
-version=${syncope.version}
-site=${project.parent.url}
-license=${licenseUrl}
-
 domain=Master
 
 anonymousUser=${anonymousUser}

http://git-wip-us.apache.org/repos/asf/syncope/blob/d4a67d4f/fit/enduser-reference/src/test/resources/enduser.properties
----------------------------------------------------------------------
diff --git a/fit/enduser-reference/src/test/resources/enduser.properties b/fit/enduser-reference/src/test/resources/enduser.properties
index 58ed435..7387c0d 100644
--- a/fit/enduser-reference/src/test/resources/enduser.properties
+++ b/fit/enduser-reference/src/test/resources/enduser.properties
@@ -16,10 +16,6 @@
 # under the License.
 enduser.directory=${conf.directory}
 
-version=${syncope.version}
-site=${project.parent.url}
-license=${licenseUrl}
-
 domain=Master
 
 anonymousUser=${anonymousUser}

http://git-wip-us.apache.org/repos/asf/syncope/blob/d4a67d4f/pom.xml
----------------------------------------------------------------------
diff --git a/pom.xml b/pom.xml
index 6c7bb02..23501fd 100644
--- a/pom.xml
+++ b/pom.xml
@@ -2111,6 +2111,24 @@ under the License.
       </plugin>
       
       <plugin>
+        <groupId>org.codehaus.mojo</groupId>
+        <artifactId>buildnumber-maven-plugin</artifactId>
+        <version>1.4</version>
+        <configuration>
+          <doCheck>false</doCheck>
+          <doUpdate>false</doUpdate>
+        </configuration>
+        <executions>
+          <execution>
+            <phase>validate</phase>
+            <goals>
+              <goal>create</goal>
+            </goals>
+          </execution>
+        </executions>
+      </plugin>
+
+      <plugin>
         <groupId>org.apache.maven.plugins</groupId>
         <artifactId>maven-release-plugin</artifactId>
         <version>2.5.3</version>


[2/4] syncope git commit: Raising exception when searching into invalid realms

Posted by il...@apache.org.
Raising exception when searching into invalid realms


Project: http://git-wip-us.apache.org/repos/asf/syncope/repo
Commit: http://git-wip-us.apache.org/repos/asf/syncope/commit/1855b0b4
Tree: http://git-wip-us.apache.org/repos/asf/syncope/tree/1855b0b4
Diff: http://git-wip-us.apache.org/repos/asf/syncope/diff/1855b0b4

Branch: refs/heads/2_0_X
Commit: 1855b0b4dd1d6d100663f04f1cec7a9cf5decad6
Parents: 671780f
Author: Francesco Chicchiriccò <il...@apache.org>
Authored: Tue Aug 8 14:41:19 2017 +0200
Committer: Francesco Chicchiriccò <il...@apache.org>
Committed: Tue Aug 8 14:41:19 2017 +0200

----------------------------------------------------------------------
 .../syncope/core/persistence/jpa/dao/JPAAnySearchDAO.java      | 6 +++++-
 1 file changed, 5 insertions(+), 1 deletion(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/syncope/blob/1855b0b4/core/persistence-jpa/src/main/java/org/apache/syncope/core/persistence/jpa/dao/JPAAnySearchDAO.java
----------------------------------------------------------------------
diff --git a/core/persistence-jpa/src/main/java/org/apache/syncope/core/persistence/jpa/dao/JPAAnySearchDAO.java b/core/persistence-jpa/src/main/java/org/apache/syncope/core/persistence/jpa/dao/JPAAnySearchDAO.java
index cc44ef8..6af5f27 100644
--- a/core/persistence-jpa/src/main/java/org/apache/syncope/core/persistence/jpa/dao/JPAAnySearchDAO.java
+++ b/core/persistence-jpa/src/main/java/org/apache/syncope/core/persistence/jpa/dao/JPAAnySearchDAO.java
@@ -31,8 +31,10 @@ import org.apache.commons.collections4.CollectionUtils;
 import org.apache.commons.lang3.StringUtils;
 import org.apache.commons.lang3.tuple.Pair;
 import org.apache.commons.lang3.tuple.Triple;
+import org.apache.syncope.common.lib.SyncopeClientException;
 import org.apache.syncope.common.lib.types.AnyTypeKind;
 import org.apache.syncope.common.lib.types.AttrSchemaType;
+import org.apache.syncope.common.lib.types.ClientExceptionType;
 import org.apache.syncope.core.provisioning.api.utils.RealmUtils;
 import org.apache.syncope.core.provisioning.api.utils.EntityUtils;
 import org.apache.syncope.core.persistence.api.dao.search.AttributeCond;
@@ -74,7 +76,9 @@ public class JPAAnySearchDAO extends AbstractAnySearchDAO {
             if (realmPath.startsWith("/")) {
                 Realm realm = realmDAO.findByFullPath(realmPath);
                 if (realm == null) {
-                    LOG.warn("Ignoring invalid realm {}", realmPath);
+                    SyncopeClientException noRealm = SyncopeClientException.build(ClientExceptionType.InvalidRealm);
+                    noRealm.getElements().add("Invalid realm specified: " + realmPath);
+                    throw noRealm;
                 } else {
                     CollectionUtils.collect(
                             realmDAO.findDescendants(realm), EntityUtils.<Realm>keyTransformer(), realmKeys);


[4/4] syncope git commit: Raising exception when searching into invalid realms

Posted by il...@apache.org.
Raising exception when searching into invalid realms


Project: http://git-wip-us.apache.org/repos/asf/syncope/repo
Commit: http://git-wip-us.apache.org/repos/asf/syncope/commit/1cd6154b
Tree: http://git-wip-us.apache.org/repos/asf/syncope/tree/1cd6154b
Diff: http://git-wip-us.apache.org/repos/asf/syncope/diff/1cd6154b

Branch: refs/heads/master
Commit: 1cd6154b5a026c3f0072b66fe056b53ed9f1d6ba
Parents: d4a67d4
Author: Francesco Chicchiriccò <il...@apache.org>
Authored: Tue Aug 8 14:41:19 2017 +0200
Committer: Francesco Chicchiriccò <il...@apache.org>
Committed: Tue Aug 8 14:53:40 2017 +0200

----------------------------------------------------------------------
 .../syncope/core/persistence/jpa/dao/JPAAnySearchDAO.java      | 6 +++++-
 1 file changed, 5 insertions(+), 1 deletion(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/syncope/blob/1cd6154b/core/persistence-jpa/src/main/java/org/apache/syncope/core/persistence/jpa/dao/JPAAnySearchDAO.java
----------------------------------------------------------------------
diff --git a/core/persistence-jpa/src/main/java/org/apache/syncope/core/persistence/jpa/dao/JPAAnySearchDAO.java b/core/persistence-jpa/src/main/java/org/apache/syncope/core/persistence/jpa/dao/JPAAnySearchDAO.java
index cc44ef8..6af5f27 100644
--- a/core/persistence-jpa/src/main/java/org/apache/syncope/core/persistence/jpa/dao/JPAAnySearchDAO.java
+++ b/core/persistence-jpa/src/main/java/org/apache/syncope/core/persistence/jpa/dao/JPAAnySearchDAO.java
@@ -31,8 +31,10 @@ import org.apache.commons.collections4.CollectionUtils;
 import org.apache.commons.lang3.StringUtils;
 import org.apache.commons.lang3.tuple.Pair;
 import org.apache.commons.lang3.tuple.Triple;
+import org.apache.syncope.common.lib.SyncopeClientException;
 import org.apache.syncope.common.lib.types.AnyTypeKind;
 import org.apache.syncope.common.lib.types.AttrSchemaType;
+import org.apache.syncope.common.lib.types.ClientExceptionType;
 import org.apache.syncope.core.provisioning.api.utils.RealmUtils;
 import org.apache.syncope.core.provisioning.api.utils.EntityUtils;
 import org.apache.syncope.core.persistence.api.dao.search.AttributeCond;
@@ -74,7 +76,9 @@ public class JPAAnySearchDAO extends AbstractAnySearchDAO {
             if (realmPath.startsWith("/")) {
                 Realm realm = realmDAO.findByFullPath(realmPath);
                 if (realm == null) {
-                    LOG.warn("Ignoring invalid realm {}", realmPath);
+                    SyncopeClientException noRealm = SyncopeClientException.build(ClientExceptionType.InvalidRealm);
+                    noRealm.getElements().add("Invalid realm specified: " + realmPath);
+                    throw noRealm;
                 } else {
                     CollectionUtils.collect(
                             realmDAO.findDescendants(realm), EntityUtils.<Realm>keyTransformer(), realmKeys);