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 2013/11/11 09:53:25 UTC

svn commit: r1540638 - in /syncope/trunk: archetype/ console/src/main/java/org/apache/syncope/console/pages/ console/src/main/resources/ console/src/main/resources/org/apache/syncope/console/pages/ core/ core/src/main/webapp/

Author: ilgrosso
Date: Mon Nov 11 08:53:25 2013
New Revision: 1540638

URL: http://svn.apache.org/r1540638
Log:
Removing obsolete version.jsp

Removed:
    syncope/trunk/core/src/main/webapp/version.jsp
Modified:
    syncope/trunk/archetype/pom.xml
    syncope/trunk/console/src/main/java/org/apache/syncope/console/pages/Configuration.java
    syncope/trunk/console/src/main/java/org/apache/syncope/console/pages/Login.java
    syncope/trunk/console/src/main/java/org/apache/syncope/console/pages/ReportModalPage.java
    syncope/trunk/console/src/main/resources/applicationContext.xml
    syncope/trunk/console/src/main/resources/org/apache/syncope/console/pages/WelcomePage.html
    syncope/trunk/core/pom.xml

Modified: syncope/trunk/archetype/pom.xml
URL: http://svn.apache.org/viewvc/syncope/trunk/archetype/pom.xml?rev=1540638&r1=1540637&r2=1540638&view=diff
==============================================================================
--- syncope/trunk/archetype/pom.xml (original)
+++ syncope/trunk/archetype/pom.xml Mon Nov 11 08:53:25 2013
@@ -148,9 +148,6 @@ under the License.
       <resource>
         <directory>../core/src/main/webapp</directory>
         <targetPath>${project.build.outputDirectory}/archetype-resources/core/src/main/webapp</targetPath>
-        <excludes>
-          <exclude>version.jsp</exclude>
-        </excludes>
       </resource>
       <resource>
         <directory>../core/src/test/resources</directory>

Modified: syncope/trunk/console/src/main/java/org/apache/syncope/console/pages/Configuration.java
URL: http://svn.apache.org/viewvc/syncope/trunk/console/src/main/java/org/apache/syncope/console/pages/Configuration.java?rev=1540638&r1=1540637&r2=1540638&view=diff
==============================================================================
--- syncope/trunk/console/src/main/java/org/apache/syncope/console/pages/Configuration.java (original)
+++ syncope/trunk/console/src/main/java/org/apache/syncope/console/pages/Configuration.java Mon Nov 11 08:53:25 2013
@@ -100,9 +100,6 @@ public class Configuration extends BaseP
     @SpringBean
     private WorkflowRestClient wfRestClient;
 
-    @SpringBean(name = "baseURL")
-    protected String baseURL;
-
     @SpringBean
     private PreferenceManager prefMan;
 
@@ -159,24 +156,24 @@ public class Configuration extends BaseP
         AjaxButton submit =
                 new ClearIndicatingAjaxButton(APPLY, new Model<String>(getString(SUBMIT)), getPageReference()) {
 
-            private static final long serialVersionUID = -958724007591692537L;
+                    private static final long serialVersionUID = -958724007591692537L;
 
-            @Override
-            protected void onSubmitInternal(final AjaxRequestTarget target, final Form<?> form) {
-                try {
-                    wfRestClient.updateDefinition(workflowDef);
-                    info(getString(Constants.OPERATION_SUCCEEDED));
-                } catch (SyncopeClientException scee) {
-                    error(getString(Constants.ERROR) + ": " + scee.getMessage());
-                }
-                target.add(feedbackPanel);
-            }
+                    @Override
+                    protected void onSubmitInternal(final AjaxRequestTarget target, final Form<?> form) {
+                        try {
+                            wfRestClient.updateDefinition(workflowDef);
+                            info(getString(Constants.OPERATION_SUCCEEDED));
+                        } catch (SyncopeClientException scee) {
+                            error(getString(Constants.ERROR) + ": " + scee.getMessage());
+                        }
+                        target.add(feedbackPanel);
+                    }
 
-            @Override
-            protected void onError(final AjaxRequestTarget target, final Form<?> form) {
-                target.add(feedbackPanel);
-            }
-        };
+                    @Override
+                    protected void onError(final AjaxRequestTarget target, final Form<?> form) {
+                        target.add(feedbackPanel);
+                    }
+                };
 
         MetaDataRoleAuthorizationStrategy.authorize(submit, ENABLE, xmlRolesReader.getAllAllowedRoles("Configuration",
                 "workflowDefUpdate"));

Modified: syncope/trunk/console/src/main/java/org/apache/syncope/console/pages/Login.java
URL: http://svn.apache.org/viewvc/syncope/trunk/console/src/main/java/org/apache/syncope/console/pages/Login.java?rev=1540638&r1=1540637&r2=1540638&view=diff
==============================================================================
--- syncope/trunk/console/src/main/java/org/apache/syncope/console/pages/Login.java (original)
+++ syncope/trunk/console/src/main/java/org/apache/syncope/console/pages/Login.java Mon Nov 11 08:53:25 2013
@@ -18,9 +18,6 @@
  */
 package org.apache.syncope.console.pages;
 
-import java.io.IOException;
-import java.net.URL;
-import java.net.URLConnection;
 import java.security.AccessControlException;
 import java.util.List;
 import java.util.Locale;
@@ -53,28 +50,20 @@ import org.apache.wicket.model.Model;
 import org.apache.wicket.model.ResourceModel;
 import org.apache.wicket.request.mapper.parameter.PageParameters;
 import org.apache.wicket.spring.injection.annot.SpringBean;
-import org.apache.wicket.util.io.IOUtils;
-import org.slf4j.Logger;
-import org.slf4j.LoggerFactory;
 
 /**
  * Syncope Login page.
  */
 public class Login extends WebPage {
 
-    /**
-     * Logger.
-     */
-    private static final Logger LOG = LoggerFactory.getLogger(Login.class);
-
     private static final long serialVersionUID = -3744389270366566218L;
 
     private final static int SELF_REG_WIN_HEIGHT = 550;
 
     private final static int SELF_REG_WIN_WIDTH = 800;
 
-    @SpringBean(name = "baseURL")
-    private String baseURL;
+    @SpringBean(name = "version")
+    private String version;
 
     @SpringBean(name = "anonymousUser")
     private String anonymousUser;
@@ -199,21 +188,7 @@ public class Login extends WebPage {
         SyncopeSession.get().setUsername(username);
         SyncopeSession.get().setPassword(password);
         SyncopeSession.get().setEntitlements(CollectionWrapper.unwrap(entitlements).toArray(new String[0]));
-        SyncopeSession.get().setVersion(getSyncopeVersion());
-    }
-
-    private String getSyncopeVersion() {
-        String version = "";
-        URLConnection conn = null;
-        try {
-            conn = new URL(baseURL + "../version.jsp").openConnection();
-            version = IOUtils.toString(conn.getInputStream());
-        } catch (IOException e) {
-            LOG.error("While fetching version from core", e);
-            getSession().error(e.getMessage());
-        }
-
-        return version;
+        SyncopeSession.get().setVersion(version);
     }
 
     /**

Modified: syncope/trunk/console/src/main/java/org/apache/syncope/console/pages/ReportModalPage.java
URL: http://svn.apache.org/viewvc/syncope/trunk/console/src/main/java/org/apache/syncope/console/pages/ReportModalPage.java?rev=1540638&r1=1540637&r2=1540638&view=diff
==============================================================================
--- syncope/trunk/console/src/main/java/org/apache/syncope/console/pages/ReportModalPage.java (original)
+++ syncope/trunk/console/src/main/java/org/apache/syncope/console/pages/ReportModalPage.java Mon Nov 11 08:53:25 2013
@@ -68,7 +68,6 @@ import org.apache.wicket.model.IModel;
 import org.apache.wicket.model.Model;
 import org.apache.wicket.model.PropertyModel;
 import org.apache.wicket.model.ResourceModel;
-import org.apache.wicket.spring.injection.annot.SpringBean;
 import org.apache.wicket.util.resource.IResourceStream;
 import org.springframework.util.StringUtils;
 
@@ -94,12 +93,9 @@ public class ReportModalPage extends Bas
 
     private static final int REPORTLET_CONF_WIN_WIDTH = 800;
 
-    @SpringBean(name = "baseURL")
-    protected String baseURL;
-
     private final ReportTO reportTO;
 
-    private Form<ReportTO> form;
+    private final Form<ReportTO> form;
 
     private ReportExecExportFormat exportFormat;
 
@@ -128,37 +124,37 @@ public class ReportModalPage extends Bas
         final AjaxButton submit =
                 new ClearIndicatingAjaxButton(APPLY, new ResourceModel(APPLY), getPageReference()) {
 
-            private static final long serialVersionUID = -958724007591692537L;
+                    private static final long serialVersionUID = -958724007591692537L;
 
-            @Override
-            protected void onSubmitInternal(final AjaxRequestTarget target, final Form<?> form) {
-                ReportTO reportTO = (ReportTO) form.getModelObject();
-                reportTO.setCronExpression(StringUtils.hasText(reportTO.getCronExpression())
-                        ? crontab.getCronExpression()
-                        : null);
-
-                try {
-                    if (reportTO.getId() > 0) {
-                        reportRestClient.update(reportTO);
-                    } else {
-                        reportRestClient.create(reportTO);
-                    }
+                    @Override
+                    protected void onSubmitInternal(final AjaxRequestTarget target, final Form<?> form) {
+                        ReportTO reportTO = (ReportTO) form.getModelObject();
+                        reportTO.setCronExpression(StringUtils.hasText(reportTO.getCronExpression())
+                                ? crontab.getCronExpression()
+                                : null);
 
-                    ((BasePage) callerPageRef.getPage()).setModalResult(true);
+                        try {
+                            if (reportTO.getId() > 0) {
+                                reportRestClient.update(reportTO);
+                            } else {
+                                reportRestClient.create(reportTO);
+                            }
 
-                    window.close(target);
-                } catch (SyncopeClientException e) {
-                    LOG.error("While creating or updating report", e);
-                    error(getString(Constants.ERROR) + ": " + e.getMessage());
-                    target.add(feedbackPanel);
-                }
-            }
+                            ((BasePage) callerPageRef.getPage()).setModalResult(true);
 
-            @Override
-            protected void onError(final AjaxRequestTarget target, final Form<?> form) {
-                target.add(feedbackPanel);
-            }
-        };
+                            window.close(target);
+                        } catch (SyncopeClientException e) {
+                            LOG.error("While creating or updating report", e);
+                            error(getString(Constants.ERROR) + ": " + e.getMessage());
+                            target.add(feedbackPanel);
+                        }
+                    }
+
+                    @Override
+                    protected void onError(final AjaxRequestTarget target, final Form<?> form) {
+                        target.add(feedbackPanel);
+                    }
+                };
 
         if (reportTO.getId() > 0) {
             MetaDataRoleAuthorizationStrategy.authorize(submit, RENDER, xmlRolesReader.getAllAllowedRoles("Reports",
@@ -173,13 +169,13 @@ public class ReportModalPage extends Bas
         final AjaxButton cancel =
                 new ClearIndicatingAjaxButton(CANCEL, new ResourceModel(CANCEL), getPageReference()) {
 
-            private static final long serialVersionUID = -958724007591692537L;
+                    private static final long serialVersionUID = -958724007591692537L;
 
-            @Override
-            protected void onSubmitInternal(final AjaxRequestTarget target, final Form<?> form) {
-                window.close(target);
-            }
-        };
+                    @Override
+                    protected void onSubmitInternal(final AjaxRequestTarget target, final Form<?> form) {
+                        window.close(target);
+                    }
+                };
 
         cancel.setDefaultFormProcessing(false);
         form.add(cancel);
@@ -250,26 +246,26 @@ public class ReportModalPage extends Bas
         reportlets = new ListChoice<AbstractReportletConf>("reportletConfs", new Model(), reportTO.getReportletConfs(),
                 new IChoiceRenderer<ReportletConf>() {
 
-            private static final long serialVersionUID = 1048000918946220007L;
+                    private static final long serialVersionUID = 1048000918946220007L;
 
-            @Override
-            public Object getDisplayValue(final ReportletConf object) {
-                return object.getName();
-            }
+                    @Override
+                    public Object getDisplayValue(final ReportletConf object) {
+                        return object.getName();
+                    }
 
-            @Override
-            public String getIdValue(final ReportletConf object, int index) {
-                return object.getName();
-            }
-        }) {
+                    @Override
+                    public String getIdValue(final ReportletConf object, int index) {
+                        return object.getName();
+                    }
+                }) {
 
-            private static final long serialVersionUID = 4022366881854379834L;
+                    private static final long serialVersionUID = 4022366881854379834L;
 
-            @Override
-            protected CharSequence getDefaultChoice(String selectedValue) {
-                return null;
-            }
-        };
+                    @Override
+                    protected CharSequence getDefaultChoice(String selectedValue) {
+                        return null;
+                    }
+                };
 
         reportlets.setNullValid(true);
         profile.add(reportlets);
@@ -537,7 +533,7 @@ public class ReportModalPage extends Bas
                             reportTO.getExecutions().addAll(currentReportTO.getExecutions());
                             final AjaxFallbackDefaultDataTable currentTable =
                                     new AjaxFallbackDefaultDataTable("executionsTable", columns,
-                                    new ReportExecutionsProvider(reportTO), 10);
+                                            new ReportExecutionsProvider(reportTO), 10);
                             currentTable.setOutputMarkupId(true);
                             target.add(currentTable);
                             executions.addOrReplace(currentTable);

Modified: syncope/trunk/console/src/main/resources/applicationContext.xml
URL: http://svn.apache.org/viewvc/syncope/trunk/console/src/main/resources/applicationContext.xml?rev=1540638&r1=1540637&r2=1540638&view=diff
==============================================================================
--- syncope/trunk/console/src/main/resources/applicationContext.xml (original)
+++ syncope/trunk/console/src/main/resources/applicationContext.xml Mon Nov 11 08:53:25 2013
@@ -44,8 +44,8 @@ under the License.
     </property>
   </bean>
 
-  <bean id="baseURL" class="java.lang.String">
-    <constructor-arg value="${scheme}://${host}:${port}${rootPath}"/>
+  <bean id="version" class="java.lang.String">
+    <constructor-arg value="${project.parent.version}"/>
   </bean>
 
   <bean id="site" class="java.lang.String">

Modified: syncope/trunk/console/src/main/resources/org/apache/syncope/console/pages/WelcomePage.html
URL: http://svn.apache.org/viewvc/syncope/trunk/console/src/main/resources/org/apache/syncope/console/pages/WelcomePage.html?rev=1540638&r1=1540637&r2=1540638&view=diff
==============================================================================
--- syncope/trunk/console/src/main/resources/org/apache/syncope/console/pages/WelcomePage.html (original)
+++ syncope/trunk/console/src/main/resources/org/apache/syncope/console/pages/WelcomePage.html Mon Nov 11 08:53:25 2013
@@ -40,15 +40,15 @@ under the License.
   <body style="text-align:center">
     <div id="splash">
       <img src="img/logo.png" alt="syncope" title="syncope" id="logo" />
-      <div style="display: table-row;">
-        <div id="username" style="display: table-cell; padding-left: 5px; cursor: pointer; width:100%;">          
-          <a href="#" wicket:id="editProfileLink" style="font-family: monospace;line-height: 20px;">
+      <div style="display: table-row;height: 20px;">
+        <div id="username" style="display: table-cell; padding-left: 5px; cursor: pointer; width: 100%;vertical-align: bottom;">          
+          <a href="#" wicket:id="editProfileLink" style="font-family: monospace;">
             <span style="color: #B9CFB3;"><wicket:message key="welcome"/>,
               <span wicket:id="username" style="color: #B9CFB3;text-decoration: underline;"/>
             </span>
           </a>
         </div>
-        <div style="display: table-cell; padding-right: 5px;">
+        <div style="display: table-cell; padding-right: 5px;vertical-align: bottom;">
           <div wicket:id="infoModal"/>
           <a wicket:id="infoLink"><img src="img/info.png" alt="info"/></a>
         </div>

Modified: syncope/trunk/core/pom.xml
URL: http://svn.apache.org/viewvc/syncope/trunk/core/pom.xml?rev=1540638&r1=1540637&r2=1540638&view=diff
==============================================================================
--- syncope/trunk/core/pom.xml (original)
+++ syncope/trunk/core/pom.xml Mon Nov 11 08:53:25 2013
@@ -492,7 +492,7 @@ under the License.
             </deployable>
             <deployable>
               <location>${cargo.run.dir}</location>
-              <pingURL>http://localhost:${cargo.servlet.port}/syncope/version.jsp</pingURL>
+              <pingURL>http://localhost:${cargo.servlet.port}/syncope/cacheStats.jsp</pingURL>
               <pingTimeout>60000</pingTimeout>
               <properties>
                 <context>syncope</context>
@@ -1198,7 +1198,7 @@ under the License.
               <deployables>
                 <deployable>
                   <location>${cargo.run.dir}</location>
-                  <pingURL>http://localhost:${cargo.servlet.port}/syncope/version.jsp</pingURL>
+                  <pingURL>http://localhost:${cargo.servlet.port}/syncope/cacheStats.jsp</pingURL>
                   <pingTimeout>1200000</pingTimeout>
                   <properties>
                     <context>syncope</context>
@@ -1339,7 +1339,7 @@ under the License.
                 </deployable>
                 <deployable>
                   <location>${cargo.run.dir}</location>
-                  <pingURL>http://localhost:${cargo.servlet.port}/syncope/version.jsp</pingURL>
+                  <pingURL>http://localhost:${cargo.servlet.port}/syncope/cacheStats.jsp</pingURL>
                   <pingTimeout>1200000</pingTimeout>
                   <properties>
                     <context>syncope</context>