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 2014/05/30 15:44:54 UTC

svn commit: r1598600 - in /syncope/trunk: console/ console/src/main/java/org/apache/syncope/console/pages/ console/src/main/resources/ core/src/main/java/org/apache/syncope/core/audit/

Author: ilgrosso
Date: Fri May 30 13:44:52 2014
New Revision: 1598600

URL: http://svn.apache.org/r1598600
Log:
Fixing various quirks

Modified:
    syncope/trunk/console/pom.xml
    syncope/trunk/console/src/main/java/org/apache/syncope/console/pages/NotificationModalPage.java
    syncope/trunk/console/src/main/java/org/apache/syncope/console/pages/ReportletConfModalPage.java
    syncope/trunk/console/src/main/resources/oryx.debug.js.patch
    syncope/trunk/core/src/main/java/org/apache/syncope/core/audit/AuditConnectionFactory.java

Modified: syncope/trunk/console/pom.xml
URL: http://svn.apache.org/viewvc/syncope/trunk/console/pom.xml?rev=1598600&r1=1598599&r2=1598600&view=diff
==============================================================================
--- syncope/trunk/console/pom.xml (original)
+++ syncope/trunk/console/pom.xml Fri May 30 13:44:52 2014
@@ -214,7 +214,7 @@ under the License.
         <executions>
           <execution>
             <id>setupActivitiModeler</id>
-            <phase>process-test-resources</phase>
+            <phase>process-resources</phase>
             <configuration>
               <target>
                 <unzip src="${settings.localRepository}/org/activiti/activiti-webapp-explorer2/${activiti.version}/activiti-webapp-explorer2-${activiti.version}.war"

Modified: syncope/trunk/console/src/main/java/org/apache/syncope/console/pages/NotificationModalPage.java
URL: http://svn.apache.org/viewvc/syncope/trunk/console/src/main/java/org/apache/syncope/console/pages/NotificationModalPage.java?rev=1598600&r1=1598599&r2=1598600&view=diff
==============================================================================
--- syncope/trunk/console/src/main/java/org/apache/syncope/console/pages/NotificationModalPage.java (original)
+++ syncope/trunk/console/src/main/java/org/apache/syncope/console/pages/NotificationModalPage.java Fri May 30 13:44:52 2014
@@ -67,8 +67,8 @@ class NotificationModalPage extends Base
     public NotificationModalPage(final PageReference pageRef, final ModalWindow window,
             final NotificationTO notificationTO, final boolean createFlag) {
 
-        final Form<NotificationTO> form
-                = new Form<NotificationTO>(FORM, new CompoundPropertyModel<NotificationTO>(notificationTO));
+        final Form<NotificationTO> form =
+                new Form<NotificationTO>(FORM, new CompoundPropertyModel<NotificationTO>(notificationTO));
 
         final AjaxTextFieldPanel sender = new AjaxTextFieldPanel("sender", getString("sender"),
                 new PropertyModel<String>(notificationTO, "sender"));
@@ -107,28 +107,25 @@ class NotificationModalPage extends Base
 
         form.add(aboutContainer);
 
-        final AjaxCheckBoxPanel checkAbout
-                = new AjaxCheckBoxPanel("checkAbout", "checkAbout",
-                        new Model<Boolean>(notificationTO.getUserAbout() == null && notificationTO.getRoleAbout() == null));
+        final AjaxCheckBoxPanel checkAbout = new AjaxCheckBoxPanel("checkAbout", "checkAbout", new Model<Boolean>(
+                notificationTO.getUserAbout() == null && notificationTO.getRoleAbout() == null));
         aboutContainer.add(checkAbout);
 
-        final AjaxCheckBoxPanel checkUserAbout
-                = new AjaxCheckBoxPanel("checkUserAbout", "checkUserAbout",
-                        new Model<Boolean>(notificationTO.getUserAbout() != null));
+        final AjaxCheckBoxPanel checkUserAbout = new AjaxCheckBoxPanel("checkUserAbout", "checkUserAbout",
+                new Model<Boolean>(notificationTO.getUserAbout() != null));
         aboutContainer.add(checkUserAbout);
 
-        final AjaxCheckBoxPanel checkRoleAbout
-                = new AjaxCheckBoxPanel("checkRoleAbout", "checkRoleAbout",
-                        new Model<Boolean>(notificationTO.getRoleAbout() != null));
+        final AjaxCheckBoxPanel checkRoleAbout = new AjaxCheckBoxPanel("checkRoleAbout", "checkRoleAbout",
+                new Model<Boolean>(notificationTO.getRoleAbout() != null));
         aboutContainer.add(checkRoleAbout);
 
-        final UserSearchPanel userAbout
-                = new UserSearchPanel.Builder("userAbout").fiql(notificationTO.getUserAbout()).build();
+        final UserSearchPanel userAbout =
+                new UserSearchPanel.Builder("userAbout").fiql(notificationTO.getUserAbout()).build();
         aboutContainer.add(userAbout);
         userAbout.setEnabled(checkUserAbout.getModelObject());
 
-        final RoleSearchPanel roleAbout
-                = new RoleSearchPanel.Builder("roleAbout").fiql(notificationTO.getRoleAbout()).build();
+        final RoleSearchPanel roleAbout =
+                new RoleSearchPanel.Builder("roleAbout").fiql(notificationTO.getRoleAbout()).build();
         aboutContainer.add(roleAbout);
         roleAbout.setEnabled(checkRoleAbout.getModelObject());
 
@@ -224,12 +221,12 @@ class NotificationModalPage extends Base
 
                     @Override
                     protected String[] getListRoles() {
-                        return new String[]{};
+                        return new String[] {};
                     }
 
                     @Override
                     protected String[] getChangeRoles() {
-                        return new String[]{};
+                        return new String[] {};
                     }
                 });
 
@@ -246,8 +243,8 @@ class NotificationModalPage extends Base
             checkStaticRecipients.getField().setDefaultModelObject(Boolean.FALSE);
         }
 
-        final AjaxTextFieldPanel staticRecipientsFieldPanel
-                = new AjaxTextFieldPanel("panel", "staticRecipients", new Model<String>(null));
+        final AjaxTextFieldPanel staticRecipientsFieldPanel =
+                new AjaxTextFieldPanel("panel", "staticRecipients", new Model<String>(null));
         staticRecipientsFieldPanel.addValidator(EmailAddressValidator.getInstance());
         staticRecipientsFieldPanel.setRequired(checkStaticRecipients.getModelObject());
 
@@ -255,13 +252,13 @@ class NotificationModalPage extends Base
             notificationTO.getStaticRecipients().add(null);
         }
 
-        final MultiFieldPanel staticRecipients = new MultiFieldPanel("staticRecipients",
+        final MultiFieldPanel<String> staticRecipients = new MultiFieldPanel<String>("staticRecipients",
                 new PropertyModel<List<String>>(notificationTO, "staticRecipients"), staticRecipientsFieldPanel);
         staticRecipients.setEnabled(checkStaticRecipients.getModelObject());
         form.add(staticRecipients);
 
-        final AjaxCheckBoxPanel checkRecipients
-                = new AjaxCheckBoxPanel("checkRecipients", "checkRecipients",
+        final AjaxCheckBoxPanel checkRecipients =
+                new AjaxCheckBoxPanel("checkRecipients", "checkRecipients",
                         new Model<Boolean>(notificationTO.getRecipients() == null ? false : true));
         recipientsContainer.add(checkRecipients);
 
@@ -269,8 +266,8 @@ class NotificationModalPage extends Base
             checkRecipients.getField().setDefaultModelObject(Boolean.TRUE);
         }
 
-        final UserSearchPanel recipients
-                = new UserSearchPanel.Builder("recipients").fiql(notificationTO.getRecipients()).build();
+        final UserSearchPanel recipients =
+                new UserSearchPanel.Builder("recipients").fiql(notificationTO.getRecipients()).build();
 
         recipients.setEnabled(checkRecipients.getModelObject());
         recipientsContainer.add(recipients);

Modified: syncope/trunk/console/src/main/java/org/apache/syncope/console/pages/ReportletConfModalPage.java
URL: http://svn.apache.org/viewvc/syncope/trunk/console/src/main/java/org/apache/syncope/console/pages/ReportletConfModalPage.java?rev=1598600&r1=1598599&r2=1598600&view=diff
==============================================================================
--- syncope/trunk/console/src/main/java/org/apache/syncope/console/pages/ReportletConfModalPage.java (original)
+++ syncope/trunk/console/src/main/java/org/apache/syncope/console/pages/ReportletConfModalPage.java Fri May 30 13:44:52 2014
@@ -24,7 +24,6 @@ import java.util.ArrayList;
 import java.util.Arrays;
 import java.util.Collections;
 import java.util.Date;
-import java.util.Iterator;
 import java.util.List;
 import org.apache.commons.lang3.ArrayUtils;
 import org.apache.syncope.common.SyncopeConstants;
@@ -63,6 +62,8 @@ import org.apache.wicket.model.Model;
 import org.apache.wicket.model.PropertyModel;
 import org.apache.wicket.model.ResourceModel;
 import org.apache.wicket.model.util.ListModel;
+import org.apache.wicket.util.visit.IVisit;
+import org.apache.wicket.util.visit.IVisitor;
 import org.springframework.beans.BeanWrapper;
 import org.springframework.beans.PropertyAccessorFactory;
 import org.springframework.util.ClassUtils;
@@ -154,21 +155,24 @@ public class ReportletConfModalPage exte
 
             @Override
             protected void onSubmit(final AjaxRequestTarget target, final Form<?> form) {
-                final BeanWrapper wrapper = PropertyAccessorFactory
-                        .forBeanPropertyAccess(ReportletConfModalPage.this.reportletConf);
+                final BeanWrapper wrapper = PropertyAccessorFactory.
+                        forBeanPropertyAccess(ReportletConfModalPage.this.reportletConf);
                 wrapper.setPropertyValue("name", name.getField().getInput());
 
                 // Iterate over properties in order to find UserSearchPanel instances and manually update
                 // this.reportletConf with select search criteria - this is needed because UserSearchPanel
                 // does not comply with usual Wicket model paradigm.
-                for (Iterator<Component> itor = ReportletConfModalPage.this.propView.visitChildren(); itor.hasNext();) {
-                    Component component = itor.next();
-                    if (component instanceof UserSearchPanel) {
-                        // using component.getDefaultModelObjectAsString() to fetch field name (set above)
-                        wrapper.setPropertyValue(component.getDefaultModelObjectAsString(),
-                                ((UserSearchPanel) component).buildFIQL());
+                ReportletConfModalPage.this.propView.visitChildren(new IVisitor<Component, Void>() {
+
+                    @Override
+                    public void component(final Component component, final IVisit<Void> ivisit) {
+                        if (component instanceof UserSearchPanel) {
+                            // using component.getDefaultModelObjectAsString() to fetch field name (set above)
+                            wrapper.setPropertyValue(component.getDefaultModelObjectAsString(),
+                                    ((UserSearchPanel) component).buildFIQL());
+                        }
                     }
-                }
+                });
 
                 ((ReportModalPage) pageRef.getPage())
                         .setModalReportletConf(ReportletConfModalPage.this.reportletConf);

Modified: syncope/trunk/console/src/main/resources/oryx.debug.js.patch
URL: http://svn.apache.org/viewvc/syncope/trunk/console/src/main/resources/oryx.debug.js.patch?rev=1598600&r1=1598599&r2=1598600&view=diff
==============================================================================
--- syncope/trunk/console/src/main/resources/oryx.debug.js.patch (original)
+++ syncope/trunk/console/src/main/resources/oryx.debug.js.patch Fri May 30 13:44:52 2014
@@ -14,27 +14,27 @@
 # KIND, either express or implied.  See the License for the
 # specific language governing permissions and limitations
 # under the License.
-1866c1866,1867
+1864c1864,1865
 < ORYX.CONFIG.ROOT_PATH =					"../editor/"; //TODO: Remove last slash!!
 ---
 > /*
 > ORYX.CONFIG.ROOT_PATH =					"../editor/";
-1868a1870,1875
+1866a1868,1873
 > */                  
 > BASE_PATH =                                     window.location.toString().substr(0, window.location.toString().indexOf('/wicket'));
 > 
 > ORYX.CONFIG.ROOT_PATH =				BASE_PATH + "/activiti-modeler/editor/"
 > ORYX.CONFIG.EXPLORER_PATH =			BASE_PATH + "/activiti-modeler/explorer"
 > ORYX.CONFIG.LIBS_PATH =				BASE_PATH + "/activiti-modeler/libs"
-1879c1886
+1877c1884
 < ORYX.CONFIG.PLUGINS_CONFIG =			ORYX.CONFIG.SERVER_HANDLER_ROOT + "/editor/plugins";
 ---
 > ORYX.CONFIG.PLUGINS_CONFIG =			ORYX.CONFIG.ROOT_PATH + "plugins.xml";
-2417c2424
+2416c2423
 < 						ORYX.Log.error("A plugin is not providing a name. Ingnoring this plugin.");
 ---
 > 						ORYX.Log.error("A plugin is not providing a name. Ignoring this plugin.");
-8472,8474c8479,8481
+8471,8473c8478,8480
 < 			this._baseUrl = "../editor/stencilsets/bpmn2.0/";
 < 			this._source = "../stencilsets/bpmn2.0/bpmn2.0.json";
 < 			new Ajax.Request("../service/editor/stencilset", {
@@ -42,60 +42,56 @@
 > 			this._baseUrl = ORYX.CONFIG.ROOT_PATH + "stencilsets/bpmn2.0/";
 > 			this._source = ORYX.CONFIG.ROOT_PATH + "stencilsets/bpmn2.0/bpmn2.0.json";
 > 			new Ajax.Request(ORYX.CONFIG.ROOT_PATH + "stencilset.json", {
-11200a11208
+11199a11207
 >         modelUrl = BASE_PATH + "/workflowDefGET";
-11568c11576
-<                     "<img src='../explorer/src/img/signavio/smoky/logo2.png' border=\"0\" usemap=\"#kisbpmmap\"/>" + 
----
->                     "<img src='"+ORYX.CONFIG.EXPLORER_PATH+"/src/img/signavio/smoky/logo2.png' border=\"0\" usemap=\"#kisbpmmap\"/>" + 
-11576,11577c11584,11585
+11574,11575c11582,11583
 <                   "<a href=\""+ORYX.CONFIG.WEB_URL+"\" target=\"_self\" title=\"close modeler\">" +
 <                     "<img src='../editor/images/close_button.png' border=\"0\" />" + 
 ---
 >                   "<a href=\"#\" title=\"close modeler\" onclick=\"window.close();\">" +
 >                     "<img src='"+ORYX.CONFIG.ROOT_PATH+"images/close_button.png' border=\"0\" />" + 
-18332c18339
+18331c18339
 < 		var sloading 	= "height:16px;width:16px;margin-bottom:-4px;background: transparent url(../libs/ext-2.0.2/resources/images/default/tree/loading.gif) no-repeat center;"
 ---
 > 		var sloading 	= "height:16px;width:16px;margin-bottom:-4px;background: transparent url("+ORYX.CONFIG.LIBS_PATH+"/ext-2.0.2/resources/images/default/tree/loading.gif) no-repeat center;"
-21911c21918
+21910c21918
 < 				icon: '../editor/images/add.png',
 ---
 > 				icon: ORYX.CONFIG.ROOT_PATH + 'images/add.png',
-21924c21931
+21923c21931
 < 				icon: '../editor/images/delete.png',
 ---
 > 				icon: ORYX.CONFIG.ROOT_PATH + 'images/delete.png',
-22451c22458
+22450c22458
 < 				icon: '../editor/images/add.png',
 ---
 > 				icon: ORYX.CONFIG.ROOT_PATH + 'images/add.png',
-22464c22471
+22463c22471
 < 				icon: '../editor/images/delete.png',
 ---
 > 				icon: ORYX.CONFIG.ROOT_PATH + 'images/delete.png',
-22524c22531
+22523c22531
 < 				icon: '../editor/images/add.png',
 ---
 > 				icon: ORYX.CONFIG.ROOT_PATH + 'images/add.png',
-22537c22544
+22536c22544
 < 				icon: '../editor/images/delete.png',
 ---
 > 				icon: ORYX.CONFIG.ROOT_PATH + 'images/delete.png',
-24531,24532c24537,24538
+24530,24531c24538,24539
 < 							'<p><label for="edit_model_title">' + ORYX.I18N.Save.dialogLabelTitle + '</label><input type="text" class="text" name="title" value="{title}" id="edit_model_title" onfocus="this.className = \'text activated\'" onblur="this.className = \'text\'"/></p>',
 < 							'<p><label for="edit_model_summary">' + ORYX.I18N.Save.dialogLabelDesc + '</label><textarea rows="5" name="summary" id="edit_model_summary" onfocus="this.className = \'activated\'" onblur="this.className = \'\'">{summary}</textarea></p>',
 ---
 > 							'<p><label for="edit_model_title">' + ORYX.I18N.Save.dialogLabelTitle + '</label><input type="text" class="text" name="title" value="{title}" id="edit_model_title" onfocus="this.className = \'text activated\'" onblur="this.className = \'text\'" readonly=\"readonly\"/></p>',
 > 							'<p><label for="edit_model_summary">' + ORYX.I18N.Save.dialogLabelDesc + '</label><textarea rows="5" name="summary" id="edit_model_summary" onfocus="this.className = \'activated\'" onblur="this.className = \'\'" readonly=\"readonly\">{summary}</textarea></p>',
-24813,24814c24819
+24812,24813c24820
 < 		
 < 		new Ajax.Request("../service/model/" + modelMeta.modelId + "/json", {
 ---
 > 		new Ajax.Request(BASE_PATH + "/workflowDefGET", {
-24876a24882
+24875a24883
 > 	        saveUri = BASE_PATH + "/workflowDefPUT";
-24884c24890
+24883c24891
 < 			headers			: {'Accept':"application/json", 'Content-Type':'charset=UTF-8'},
 ---
 > 			headers			: {'Accept':"application/json", 'Content-Type':'application/json'},

Modified: syncope/trunk/core/src/main/java/org/apache/syncope/core/audit/AuditConnectionFactory.java
URL: http://svn.apache.org/viewvc/syncope/trunk/core/src/main/java/org/apache/syncope/core/audit/AuditConnectionFactory.java?rev=1598600&r1=1598599&r2=1598600&view=diff
==============================================================================
--- syncope/trunk/core/src/main/java/org/apache/syncope/core/audit/AuditConnectionFactory.java (original)
+++ syncope/trunk/core/src/main/java/org/apache/syncope/core/audit/AuditConnectionFactory.java Fri May 30 13:44:52 2014
@@ -37,6 +37,7 @@ import org.springframework.core.io.Resou
 import org.springframework.core.io.support.PropertiesLoaderUtils;
 import org.springframework.jdbc.datasource.DataSourceUtils;
 import org.springframework.jdbc.datasource.init.ResourceDatabasePopulator;
+import org.springframework.jdbc.datasource.init.ScriptUtils;
 import org.w3c.dom.bootstrap.DOMImplementationRegistry;
 import org.w3c.dom.ls.DOMImplementationLS;
 import org.w3c.dom.ls.LSInput;
@@ -47,7 +48,7 @@ import org.w3c.dom.ls.LSParser;
  * configured in Spring or, when not found, builds a new {@link javax.sql.DataSource DataSource} via Commons DBCP; if
  * any datasource if found, the SQL init script is used to populate the database.
  */
-public class AuditConnectionFactory {
+public final class AuditConnectionFactory {
 
     private static DataSource datasource;
 
@@ -106,7 +107,7 @@ public class AuditConnectionFactory {
         ResourceDatabasePopulator populator = new ResourceDatabasePopulator();
         populator.setScripts(new Resource[] { new ClassPathResource("/audit/" + initSQLScript) });
         // forces no statement separation
-        populator.setSeparator("XXXXXXXXXXXXXXXXX");
+        populator.setSeparator(ScriptUtils.EOF_STATEMENT_SEPARATOR);
         Connection conn = DataSourceUtils.getConnection(datasource);
         try {
             populator.populate(conn);
@@ -122,4 +123,8 @@ public class AuditConnectionFactory {
 
         throw new IllegalStateException("Audit dataSource init failed: check logs");
     }
+
+    private AuditConnectionFactory() {
+        // empty constructor for static utility class
+    }
 }