Repository: syncope
Updated Branches:
  refs/heads/master 1e51b34ea -> c50dae60a


http://git-wip-us.apache.org/repos/asf/syncope/blob/c50dae60/client/console/src/main/java/org/apache/syncope/client/console/wizards/any/GroupWizardBuilder.java
----------------------------------------------------------------------
diff --git 
a/client/console/src/main/java/org/apache/syncope/client/console/wizards/any/GroupWizardBuilder.java
 
b/client/console/src/main/java/org/apache/syncope/client/console/wizards/any/GroupWizardBuilder.java
index 0d97893..f0f0760 100644
--- 
a/client/console/src/main/java/org/apache/syncope/client/console/wizards/any/GroupWizardBuilder.java
+++ 
b/client/console/src/main/java/org/apache/syncope/client/console/wizards/any/GroupWizardBuilder.java
@@ -16,16 +16,25 @@
 package org.apache.syncope.client.console.wizards.any;
 
 import java.util.Collections;
+import java.util.HashMap;
 import java.util.List;
+import java.util.Map;
+import org.apache.commons.collections4.CollectionUtils;
 import org.apache.syncope.client.console.commons.status.StatusBean;
+import org.apache.syncope.client.console.panels.search.SearchClause;
+import org.apache.syncope.client.console.panels.search.SearchUtils;
 import org.apache.syncope.client.console.rest.GroupRestClient;
+import org.apache.syncope.client.console.wizards.AjaxWizardBuilder;
+import org.apache.syncope.client.lib.SyncopeClient;
 import org.apache.syncope.common.lib.AnyOperations;
 import org.apache.syncope.common.lib.patch.GroupPatch;
+import org.apache.syncope.common.lib.search.AbstractFiqlSearchConditionBuilder;
 import org.apache.syncope.common.lib.to.GroupTO;
 import org.apache.syncope.common.lib.to.ProvisioningResult;
 import org.apache.wicket.PageReference;
 import org.apache.wicket.extensions.wizard.WizardModel;
 import org.apache.wicket.model.util.ListModel;
+import org.springframework.beans.BeanUtils;
 
 public class GroupWizardBuilder extends AnyWizardBuilder<GroupTO> {
 
@@ -46,14 +55,32 @@ public class GroupWizardBuilder extends 
AnyWizardBuilder<GroupTO> {
         super(id, groupTO, anyTypeClasses, pageRef);
     }
 
+    /**
+     * This method has been overridden to manage asynchronous translation of 
FIQL string to search clases list and
+     * viceversa.
+     *
+     * @param item wizard backend item.
+     * @return the current builder.
+     */
+    @Override
+    public AjaxWizardBuilder<GroupTO> setItem(final GroupTO item) {
+        final GroupTO actual = new GroupHandler();
+        BeanUtils.copyProperties(item == null ? getDefaultItem() : item, 
actual);
+        return super.setItem(actual);
+    }
+
     @Override
     protected void onApplyInternal(final GroupTO modelObject) {
         final ProvisioningResult<GroupTO> actual;
 
+        GroupTO toBeProcessed = modelObject instanceof GroupHandler
+                ? GroupHandler.class.cast(modelObject).toGroupTO()
+                : modelObject;
+
         if (modelObject.getKey() == 0) {
-            actual = groupRestClient.create(modelObject);
+            actual = groupRestClient.create(toBeProcessed);
         } else {
-            final GroupPatch patch = AnyOperations.diff(modelObject, 
getOriginalItem(), true);
+            final GroupPatch patch = AnyOperations.diff(toBeProcessed, 
getOriginalItem(), true);
 
             // update user just if it is changed
             if (!patch.isEmpty()) {
@@ -68,4 +95,75 @@ public class GroupWizardBuilder extends 
AnyWizardBuilder<GroupTO> {
                 new ListModel<>(Collections.<StatusBean>emptyList()), false, 
pageRef, modelObject.getKey() > 0));
         return this;
     }
+
+    /**
+     * Class tprovided to handle asychronous FIQL string translations.
+     */
+    public static class GroupHandler extends GroupTO {
+
+        private static final long serialVersionUID = 8058288034211558375L;
+
+        private List<SearchClause> uDynClauses;
+
+        private Map<String, List<SearchClause>> aDynClauses;
+
+        public List<SearchClause> getUDynClauses() {
+            if (this.uDynClauses == null) {
+                this.uDynClauses = 
SearchUtils.getSearchClauses(super.getUDynMembershipCond());
+            }
+            return this.uDynClauses;
+        }
+
+        public void setUDynClauses(final List<SearchClause> uDynClauses) {
+            this.uDynClauses = uDynClauses;
+        }
+
+        public Map<String, List<SearchClause>> getADynClauses() {
+            if (this.aDynClauses == null) {
+                this.aDynClauses = 
SearchUtils.getSearchClauses(super.getADynMembershipConds());
+            }
+            return this.aDynClauses;
+        }
+
+        public void setADynClauses(final Map<String, List<SearchClause>> 
aDynClauses) {
+            this.aDynClauses = aDynClauses;
+        }
+
+        @Override
+        public String getUDynMembershipCond() {
+            if (CollectionUtils.isEmpty(this.uDynClauses)) {
+                return super.getUDynMembershipCond();
+            } else {
+                return getFIQLString(this.uDynClauses, 
SyncopeClient.getUserSearchConditionBuilder());
+            }
+        }
+
+        @Override
+        public Map<String, String> getADynMembershipConds() {
+            if (this.aDynClauses == null || this.aDynClauses.isEmpty()) {
+                return super.getADynMembershipConds();
+            } else {
+                final Map<String, String> res = new HashMap<>();
+
+                for (Map.Entry<String, List<SearchClause>> entry : 
this.aDynClauses.entrySet()) {
+                    res.put(entry.getKey(), getFIQLString(entry.getValue(),
+                            
SyncopeClient.getAnyObjectSearchConditionBuilder(entry.getKey())));
+                }
+
+                return res;
+            }
+        }
+
+        private String getFIQLString(final List<SearchClause> clauses, final 
AbstractFiqlSearchConditionBuilder bld) {
+            return SearchUtils.buildFIQL(clauses, bld);
+        }
+
+        public GroupTO toGroupTO() {
+            final GroupTO res = new GroupTO();
+            BeanUtils.copyProperties(this, res, "uDynClauses", "aDynClauses");
+            res.setUDynMembershipCond(this.getUDynMembershipCond());
+            res.getADynMembershipConds().putAll(this.getADynMembershipConds());
+            return res;
+        }
+    }
 }

http://git-wip-us.apache.org/repos/asf/syncope/blob/c50dae60/client/console/src/main/resources/META-INF/resources/css/fieldstyle.css
----------------------------------------------------------------------
diff --git 
a/client/console/src/main/resources/META-INF/resources/css/fieldstyle.css 
b/client/console/src/main/resources/META-INF/resources/css/fieldstyle.css
deleted file mode 100644
index 3ff5c29..0000000
--- a/client/console/src/main/resources/META-INF/resources/css/fieldstyle.css
+++ /dev/null
@@ -1,62 +0,0 @@
-/*
- * Licensed to the Apache Software Foundation (ASF) under one
- * or more contributor license agreements.  See the NOTICE file
- * distributed with this work for additional information
- * regarding copyright ownership.  The ASF licenses this file
- * to you under the Apache License, Version 2.0 (the
- * "License"); you may not use this file except in compliance
- * with the License.  You may obtain a copy of the License at
- *
- *   http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing,
- * software distributed under the License is distributed on an
- * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
- * KIND, either express or implied.  See the License for the
- * specific language governing permissions and limitations
- * under the License.
- */
-.drop_button{
-  vertical-align: middle !important;
-}
-
-.add_button{
-  vertical-align: middle !important;
-  margin-left: 6px !important;
-}
-
-.date_size{
-  width: 90px !important;
-}
-
-.long_dynamicsize{
-  width: 80% !important;
-}
-
-.medium_dynamicsize{
-  width: 45% !important;
-}
-
-.short_dynamicsize{
-  width: 35% !important;
-}
-
-.long_fixedsize{
-  width: 500px !important;
-}
-
-.medium_fixedsize{
-  width: 300px !important;
-}
-
-.short_fixedsize{
-  width: 150px !important;
-}
-
-.veryshort_fixedsize{
-  width: 70px !important;
-}
-
-.all_dynamicsize{
-  width: 100% !important;
-}

http://git-wip-us.apache.org/repos/asf/syncope/blob/c50dae60/client/console/src/main/resources/META-INF/resources/css/search.css
----------------------------------------------------------------------
diff --git 
a/client/console/src/main/resources/META-INF/resources/css/search.css 
b/client/console/src/main/resources/META-INF/resources/css/search.css
new file mode 100644
index 0000000..29d152f
--- /dev/null
+++ b/client/console/src/main/resources/META-INF/resources/css/search.css
@@ -0,0 +1,75 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements.  See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership.  The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License.  You may obtain a copy of the License at
+ *
+ *   http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing,
+ * software distributed under the License is distributed on an
+ * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ * KIND, either express or implied.  See the License for the
+ * specific language governing permissions and limitations
+ * under the License.
+ */
+.searchBox .col-xs-12{
+  padding-left: 0px !important;
+  padding-right: 0px !important;
+}
+
+.clause{
+  display: block;
+  line-height: 34px;
+  width: 100%;
+}
+
+.clause .operator{
+  width: 65px !important;
+}
+
+.clause .operator .checkbox{
+  margin: 0px !important;
+}
+
+.clause .field {
+  line-height: 34px;
+  float: left;
+  padding: 0 3px 0px 0px;
+  display: inline-block !important;
+}
+.clause .type{
+  width: 120px !important;
+}
+
+.clause .property{
+  width: 190px;
+}
+
+.clause .comparator{
+  width: 100px;
+}
+
+.clause .comparator button{
+  width: 100px !important;
+}
+
+.clause .value{
+  width: 220px;
+}
+
+.clause .action{
+  float: left;
+  padding: 0px 7px 0px;
+}
+
+.searchBox .input-group-addon:last-child{
+  border: 1px solid #ccc !important;
+}
+
+.searchBox .input-group{
+  margin-top: 1px;
+}
\ No newline at end of file

http://git-wip-us.apache.org/repos/asf/syncope/blob/c50dae60/client/console/src/main/resources/META-INF/resources/css/syncopeConsole.css
----------------------------------------------------------------------
diff --git 
a/client/console/src/main/resources/META-INF/resources/css/syncopeConsole.css 
b/client/console/src/main/resources/META-INF/resources/css/syncopeConsole.css
index 122e5e2..41ae696 100644
--- 
a/client/console/src/main/resources/META-INF/resources/css/syncopeConsole.css
+++ 
b/client/console/src/main/resources/META-INF/resources/css/syncopeConsole.css
@@ -303,3 +303,4 @@ div.wrap{
 /**
 END - Style for Information panel
 */
+

http://git-wip-us.apache.org/repos/asf/syncope/blob/c50dae60/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 7314bb3..686d0be 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
@@ -32,7 +32,7 @@ under the License.
     <link href="css/AdminLTE_skins/skin-green.css" rel="stylesheet" 
type="text/css" />
     <link href="css/syncopeConsole.css" rel="stylesheet" type="text/css" />
     <link href="css/fieldstyle.css" rel="stylesheet" type="text/css" />
-    
+
     <script type="text/javascript" 
src="webjars/bootbox/${bootbox.version}/bootbox.js"></script>
 
     <script type="text/javascript">

http://git-wip-us.apache.org/repos/asf/syncope/blob/c50dae60/client/console/src/main/resources/org/apache/syncope/client/console/panels/search/AbstractSearchPanel.html
----------------------------------------------------------------------
diff --git 
a/client/console/src/main/resources/org/apache/syncope/client/console/panels/search/AbstractSearchPanel.html
 
b/client/console/src/main/resources/org/apache/syncope/client/console/panels/search/AbstractSearchPanel.html
new file mode 100644
index 0000000..4de4c23
--- /dev/null
+++ 
b/client/console/src/main/resources/org/apache/syncope/client/console/panels/search/AbstractSearchPanel.html
@@ -0,0 +1,36 @@
+<!--
+Licensed to the Apache Software Foundation (ASF) under one
+or more contributor license agreements.  See the NOTICE file
+distributed with this work for additional information
+regarding copyright ownership.  The ASF licenses this file
+to you under the Apache License, Version 2.0 (the
+"License"); you may not use this file except in compliance
+with the License.  You may obtain a copy of the License at
+
+  http://www.apache.org/licenses/LICENSE-2.0
+
+Unless required by applicable law or agreed to in writing,
+software distributed under the License is distributed on an
+"AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+KIND, either express or implied.  See the License for the
+specific language governing permissions and limitations
+under the License.
+-->
+<html xmlns="http://www.w3.org/1999/xhtml"; 
xmlns:wicket="http://wicket.apache.org";>
+  <head><title></title></head>
+  <body>
+    <wicket:head>
+      <link href="css/search.css" rel="stylesheet" type="text/css" />
+    </wicket:head>
+    <wicket:panel>
+      <span class="searchBox">
+        <div class="col-xs-12">
+          <div wicket:id="searchFeedback"></div>
+          <span wicket:id="searchFormContainer">
+            <span wicket:id="search">[SEARCH]</span>
+          </span>
+        </div>
+      </span>
+    </wicket:panel>
+  </body>
+</html>

http://git-wip-us.apache.org/repos/asf/syncope/blob/c50dae60/client/console/src/main/resources/org/apache/syncope/client/console/panels/search/SearchClausePanel.html
----------------------------------------------------------------------
diff --git 
a/client/console/src/main/resources/org/apache/syncope/client/console/panels/search/SearchClausePanel.html
 
b/client/console/src/main/resources/org/apache/syncope/client/console/panels/search/SearchClausePanel.html
new file mode 100644
index 0000000..5e25b0c
--- /dev/null
+++ 
b/client/console/src/main/resources/org/apache/syncope/client/console/panels/search/SearchClausePanel.html
@@ -0,0 +1,32 @@
+<!--
+Licensed to the Apache Software Foundation (ASF) under one
+or more contributor license agreements.  See the NOTICE file
+distributed with this work for additional information
+regarding copyright ownership.  The ASF licenses this file
+to you under the Apache License, Version 2.0 (the
+"License"); you may not use this file except in compliance
+with the License.  You may obtain a copy of the License at
+
+  http://www.apache.org/licenses/LICENSE-2.0
+
+Unless required by applicable law or agreed to in writing,
+software distributed under the License is distributed on an
+"AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+KIND, either express or implied.  See the License for the
+specific language governing permissions and limitations
+under the License.
+-->
+<html xmlns="http://www.w3.org/1999/xhtml"; 
xmlns:wicket="http://wicket.apache.org";>
+  <head><title></title></head>
+  <body>
+    <wicket:extend>
+      <span wicket:id="container"  class="clause">
+        <div wicket:id="operatorContainer" class="field operator"><span 
wicket:id="operator"/></div>
+        <span wicket:id="type" class="field type"/>
+        <span wicket:id="property" class="field property"/>
+        <span wicket:id="comparator" class="field comparator"/>
+        <span wicket:id="value" class="field value"/>
+      </span>
+    </wicket:extend>
+  </body>
+</html>

http://git-wip-us.apache.org/repos/asf/syncope/blob/c50dae60/client/console/src/main/resources/org/apache/syncope/client/console/wicket/markup/html/form/AjaxTextFieldPanel.html
----------------------------------------------------------------------
diff --git 
a/client/console/src/main/resources/org/apache/syncope/client/console/wicket/markup/html/form/AjaxTextFieldPanel.html
 
b/client/console/src/main/resources/org/apache/syncope/client/console/wicket/markup/html/form/AjaxTextFieldPanel.html
index 3168f31..b067820 100644
--- 
a/client/console/src/main/resources/org/apache/syncope/client/console/wicket/markup/html/form/AjaxTextFieldPanel.html
+++ 
b/client/console/src/main/resources/org/apache/syncope/client/console/wicket/markup/html/form/AjaxTextFieldPanel.html
@@ -27,7 +27,7 @@ under the License.
         <span wicket:id="externalAction"/>
       </wicket:enclosure>
       <fieldset class="input-group">
-        <input type="text" class="form-control" wicket:id="textField"/>
+        <input type="text" class="form-control" wicket:id="textField" 
placeholder=""/>
       </fieldset>
     </wicket:extend>
   </body>

http://git-wip-us.apache.org/repos/asf/syncope/blob/c50dae60/client/console/src/main/resources/org/apache/syncope/client/console/wizards/any/GroupDetails.html
----------------------------------------------------------------------
diff --git 
a/client/console/src/main/resources/org/apache/syncope/client/console/wizards/any/GroupDetails.html
 
b/client/console/src/main/resources/org/apache/syncope/client/console/wizards/any/GroupDetails.html
index f4792ed..6b99a49 100644
--- 
a/client/console/src/main/resources/org/apache/syncope/client/console/wizards/any/GroupDetails.html
+++ 
b/client/console/src/main/resources/org/apache/syncope/client/console/wizards/any/GroupDetails.html
@@ -36,21 +36,26 @@ under the License.
       </div>
 
       <div wicket:id="ownerContainer">
-        <div class="form-group">
+        <div class="form-group input-group">
           <span wicket:id="userOwner"/>
-          <a href="#" wicket:id="userOwnerSelect"><img 
src="img/actions/search.png" alt="select user owner" title="Search"/></a>
-          <a href="#" wicket:id="userOwnerReset"><img 
src="img/actions/delete.png" alt="reset user owner" title="Delete"/></a>
+          <a href="#" wicket:id="userOwnerSelect" class="input-group-addon"><i 
class="glyphicon glyphicon-search" alt="select group owner" 
title="Search"></i></a>
+          <a href="#" wicket:id="userOwnerReset" class="input-group-addon"><i 
class="glyphicon glyphicon-remove-circle" alt="reset user owner" 
title="Delete"></i></a>
         </div>
 
-        <div class="form-group">
+        <div class="form-group input-group">
           <span wicket:id="groupOwner"/>
-          <a href="#" wicket:id="groupOwnerSelect"><img 
src="img/actions/search.png" alt="select group owner" title="Search"/></a>
-          <a href="#" wicket:id="groupOwnerReset"><img 
src="img/actions/delete.png" alt="reset group owner" title="Delete"/></a>
+          <a href="#" wicket:id="groupOwnerSelect" 
class="input-group-addon"><i class="glyphicon glyphicon-search" alt="select 
group owner" title="Search"></i></a>
+          <a href="#" wicket:id="groupOwnerReset" class="input-group-addon"><i 
class="glyphicon glyphicon-remove-circle" alt="reset group owner" 
title="Delete"></i></a>
         </div>
       </div>
 
       <span wicket:id="userOwnerSelectWin"/>
       <span wicket:id="groupOwnerSelectWin"/>
+
+      <div wicket:id="uDynMembershipCond" />
+      <span wicket:id="aDynMembershipCond">
+        <div wicket:id="aDynMembershipCond"/>
+      </span>
     </wicket:extend>
   </body>
 </html>

http://git-wip-us.apache.org/repos/asf/syncope/blob/c50dae60/client/console/src/main/resources/org/apache/syncope/client/console/wizards/any/GroupDetails.properties
----------------------------------------------------------------------
diff --git 
a/client/console/src/main/resources/org/apache/syncope/client/console/wizards/any/GroupDetails.properties
 
b/client/console/src/main/resources/org/apache/syncope/client/console/wizards/any/GroupDetails.properties
index 13a8339..e40b2c6 100644
--- 
a/client/console/src/main/resources/org/apache/syncope/client/console/wizards/any/GroupDetails.properties
+++ 
b/client/console/src/main/resources/org/apache/syncope/client/console/wizards/any/GroupDetails.properties
@@ -14,3 +14,7 @@
 # KIND, either express or implied.  See the License for the
 # specific language governing permissions and limitations
 # under the License.
+uDynMembershipCond=Dynamic USER assignment
+aDynMembershipCond=Dynamic ${key} assignment
+On=AND
+Off=OR

http://git-wip-us.apache.org/repos/asf/syncope/blob/c50dae60/client/console/src/main/resources/org/apache/syncope/client/console/wizards/any/GroupDetails_it.properties
----------------------------------------------------------------------
diff --git 
a/client/console/src/main/resources/org/apache/syncope/client/console/wizards/any/GroupDetails_it.properties
 
b/client/console/src/main/resources/org/apache/syncope/client/console/wizards/any/GroupDetails_it.properties
index 13a8339..3c92bdc 100644
--- 
a/client/console/src/main/resources/org/apache/syncope/client/console/wizards/any/GroupDetails_it.properties
+++ 
b/client/console/src/main/resources/org/apache/syncope/client/console/wizards/any/GroupDetails_it.properties
@@ -14,3 +14,7 @@
 # KIND, either express or implied.  See the License for the
 # specific language governing permissions and limitations
 # under the License.
+On=AND
+Off=OR
+uDynMembershipCond=Assegnamento dinamico USER
+aDynMembershipCond=Assegnamento dinamico ${key}

http://git-wip-us.apache.org/repos/asf/syncope/blob/c50dae60/client/console/src/main/resources/org/apache/syncope/client/console/wizards/any/GroupDetails_pt_BR.properties
----------------------------------------------------------------------
diff --git 
a/client/console/src/main/resources/org/apache/syncope/client/console/wizards/any/GroupDetails_pt_BR.properties
 
b/client/console/src/main/resources/org/apache/syncope/client/console/wizards/any/GroupDetails_pt_BR.properties
index 13a8339..a07746b 100644
--- 
a/client/console/src/main/resources/org/apache/syncope/client/console/wizards/any/GroupDetails_pt_BR.properties
+++ 
b/client/console/src/main/resources/org/apache/syncope/client/console/wizards/any/GroupDetails_pt_BR.properties
@@ -14,3 +14,7 @@
 # KIND, either express or implied.  See the License for the
 # specific language governing permissions and limitations
 # under the License.
+On=AND
+Off=OR
+uDynMembershipCond=Dynamic USER assignment
+aDynMembershipCond=Dynamic ${key} assignment

Reply via email to