directory-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From smckin...@apache.org
Subject directory-fortress-commander git commit: FC-177 - remove kendo UI datatable control
Date Wed, 31 Aug 2016 02:04:00 GMT
Repository: directory-fortress-commander
Updated Branches:
  refs/heads/master d95afe8c8 -> 323bcd8cd


FC-177 - remove kendo UI datatable control


Project: http://git-wip-us.apache.org/repos/asf/directory-fortress-commander/repo
Commit: http://git-wip-us.apache.org/repos/asf/directory-fortress-commander/commit/323bcd8c
Tree: http://git-wip-us.apache.org/repos/asf/directory-fortress-commander/tree/323bcd8c
Diff: http://git-wip-us.apache.org/repos/asf/directory-fortress-commander/diff/323bcd8c

Branch: refs/heads/master
Commit: 323bcd8cd635c4d0064742c980278c737325d629
Parents: d95afe8
Author: Shawn McKinney <smckinney@apache.org>
Authored: Tue Aug 30 06:08:45 2016 -0500
Committer: Shawn McKinney <smckinney@apache.org>
Committed: Tue Aug 30 06:08:45 2016 -0500

----------------------------------------------------------------------
 .../fortress/web/panel/AuditModDetailPanel.java | 71 +++++++++++---------
 .../fortress/web/panel/AuditModDetailPanel.html | 39 +++++++++--
 .../fortress/web/panel/GroupDetailPanel.html    |  2 +-
 3 files changed, 75 insertions(+), 37 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/directory-fortress-commander/blob/323bcd8c/src/main/java/org/apache/directory/fortress/web/panel/AuditModDetailPanel.java
----------------------------------------------------------------------
diff --git a/src/main/java/org/apache/directory/fortress/web/panel/AuditModDetailPanel.java
b/src/main/java/org/apache/directory/fortress/web/panel/AuditModDetailPanel.java
index 7c19697..f29e0ea 100644
--- a/src/main/java/org/apache/directory/fortress/web/panel/AuditModDetailPanel.java
+++ b/src/main/java/org/apache/directory/fortress/web/panel/AuditModDetailPanel.java
@@ -22,20 +22,24 @@ package org.apache.directory.fortress.web.panel;
 
 
 import com.googlecode.wicket.jquery.core.Options;
-import com.googlecode.wicket.kendo.ui.datatable.DataTable;
 import com.googlecode.wicket.kendo.ui.datatable.column.IColumn;
-import com.googlecode.wicket.kendo.ui.datatable.column.PropertyColumn;
 import org.apache.commons.collections.CollectionUtils;
 import org.apache.commons.lang.StringUtils;
+import org.apache.directory.fortress.core.*;
 import org.apache.log4j.Logger;
+import org.apache.wicket.AttributeModifier;
 import org.apache.wicket.Component;
 import org.apache.wicket.ajax.AjaxRequestTarget;
 import org.apache.wicket.event.IEvent;
 import org.apache.wicket.markup.html.basic.Label;
 import org.apache.wicket.markup.html.form.Form;
 import org.apache.wicket.markup.html.form.FormComponentPanel;
+import org.apache.wicket.markup.html.navigation.paging.PagingNavigator;
+import org.apache.wicket.markup.repeater.Item;
+import org.apache.wicket.markup.repeater.data.DataView;
 import org.apache.wicket.markup.repeater.data.IDataProvider;
 import org.apache.wicket.markup.repeater.data.ListDataProvider;
+import org.apache.wicket.model.AbstractReadOnlyModel;
 import org.apache.wicket.model.CompoundPropertyModel;
 import org.apache.wicket.model.IModel;
 import org.apache.wicket.model.PropertyModel;
@@ -43,8 +47,6 @@ import org.apache.wicket.spring.injection.annot.SpringBean;
 import org.apache.directory.fortress.web.common.GlobalIds;
 import org.apache.directory.fortress.web.control.SecUtils;
 import org.apache.directory.fortress.web.event.SelectModelEvent;
-import org.apache.directory.fortress.core.AuditMgr;
-import org.apache.directory.fortress.core.ReviewMgr;
 import org.apache.directory.fortress.core.model.Mod;
 import org.apache.directory.fortress.core.model.User;
 
@@ -99,29 +101,18 @@ public class AuditModDetailPanel extends FormComponentPanel
         private String ftModId;
         private String userId;
         private byte[] modPhoto;
-        private DataTable<RequestMod> table;
         private List<IColumn> columns;
         private Options options;
 
-
         public AuditAuthzDetailForm( String id, final IModel<Mod> model )
         {
             super( id, model );
             add( new Label( GlobalIds.FT_MOD_ID, new PropertyModel<String>( this, GlobalIds.FT_MOD_ID
) ) );
             add( new Label( GlobalIds.FT_MOD_CODE, new PropertyModel<String>( this,
GlobalIds.FT_MOD_CODE ) ) );
-            // DataTable //
-            columns = newColumnList();
-            options = new Options();
-            options.set( "height", 240 );
-            options.set( "pageable", "{ pageSizes: [ 5, 10, 15, 20 ] }" );
-            //table2 = new DataTable("modstable", columns, createDataProvider( null ), ROWS,
options);
-
-            table = new DataTable<>( "modstable", columns, createDataProvider( null
), ROWS, options );
-            table.setOutputMarkupId( true );
-            add( table );
             add( new Label( "reqType" ) );
             add( new Label( GlobalIds.REQ_DN ) );
             add( new Label( GlobalIds.REQ_START ) );
+            createDataTable( null );
             userPanel = new UserAuditDetailPanel( GlobalIds.USERAUDITDETAILPANEL, new CompoundPropertyModel<>(
                 new User()
                 ) );
@@ -130,6 +121,38 @@ public class AuditModDetailPanel extends FormComponentPanel
         }
 
 
+        private void createDataTable( List<RequestMod> mods )
+        {
+            DataView< RequestMod > view = new DataView<RequestMod>("modstable",
createDataProvider( mods ) )
+            {
+                private static final long serialVersionUID = 1L;
+
+                @Override
+                protected void populateItem(final Item<RequestMod> item)
+                {
+
+                    RequestMod mod = item.getModelObject();
+                    item.add( new Label( "index", mod.getIndex() ) );
+                    item.add( new Label( "type", mod.getType() ) );
+                    item.add( new Label( "name", mod.getName() ) );
+                    item.add( new Label( "value", mod.getValue() ) );
+                    item.add( AttributeModifier.replace( "class", new AbstractReadOnlyModel<String>()
+                    {
+                        private static final long serialVersionUID = 1L;
+
+                        @Override
+                        public String getObject()
+                        {
+                            return ( item.getIndex() % 2 == 1 ) ? "even" : "odd";
+                        }
+                    } ));
+                }
+            };
+            view.setItemsPerPage( 5L );
+            addOrReplace( view );
+            addOrReplace( new PagingNavigator( "navigator", view ) );
+        }
+
         @Override
         public void onEvent( final IEvent<?> event )
         {
@@ -141,8 +164,7 @@ public class AuditModDetailPanel extends FormComponentPanel
                 String msg = "Mod: " + mod.getReqAuthzID() + " has been selected";
                 LOG.debug( ".onEvent SelectModelEvent: " + mod.getReqAuthzID() );
                 List<RequestMod> modifications = parseRequestMods( mod.getReqMod()
);
-                table = new DataTable<>( "modstable", columns, createDataProvider(
modifications ), ROWS,
-                    options );
+                createDataTable( modifications );
                 User user = null;
                 // necessary to push the 'changed' model down into the aggregated panel:
                 int indx = modifications.indexOf( new RequestMod( GlobalIds.FT_MODIFIER )
);
@@ -172,8 +194,6 @@ public class AuditModDetailPanel extends FormComponentPanel
                 }
                 IModel<User> userModel = new CompoundPropertyModel<>( user );
                 userPanel.setDefaultModel( userModel );
-
-                addOrReplace( table );
                 display.setMessage( msg );
                 component = detailForm;
             }
@@ -254,15 +274,4 @@ public class AuditModDetailPanel extends FormComponentPanel
         }
         return results;
     }
-
-
-    private List<IColumn> newColumnList()
-    {
-        List<IColumn> columns = new ArrayList<>();
-        columns.add( new PropertyColumn( "#", "index", 30 ) );
-        columns.add( new PropertyColumn( "Op", "type", 50 ) );
-        columns.add( new PropertyColumn( "Name", "name", 80 ) );
-        columns.add( new PropertyColumn( "Value", "value", 200 ) );
-        return columns;
-    }
 }

http://git-wip-us.apache.org/repos/asf/directory-fortress-commander/blob/323bcd8c/src/main/resources/org/apache/directory/fortress/web/panel/AuditModDetailPanel.html
----------------------------------------------------------------------
diff --git a/src/main/resources/org/apache/directory/fortress/web/panel/AuditModDetailPanel.html
b/src/main/resources/org/apache/directory/fortress/web/panel/AuditModDetailPanel.html
index 1c43aa0..6215956 100644
--- a/src/main/resources/org/apache/directory/fortress/web/panel/AuditModDetailPanel.html
+++ b/src/main/resources/org/apache/directory/fortress/web/panel/AuditModDetailPanel.html
@@ -69,13 +69,42 @@
                             <span wicket:id="ftModId"></span>
                         </td>
                     </tr>
+                    <tr>
+                        <td colspan="3"><hr/></td>
+                    </tr>
+                    <tr>
+                        <td>
+                            <label>Modifications</label>
+                        </td>
+                        <td>
+                            <span wicket:id="navigator">[dataview navigator]</span>
+                            <table cellspacing="0" class="dataview">
+                                <tr>
+                                    <th></th>
+                                    <th></th>
+                                    <th>Type</th>
+                                    <th></th>
+                                    <th>Name</th>
+                                    <th></th>
+                                    <th>Value</th>
+                                </tr>
+                                <tr wicket:id="modstable">
+                                    <td><span wicket:id="index">[Index]</span>
</td>
+                                    <td><span>        </span></td>
+                                    <td><span wicket:id="type">[Type]</span></td>
+                                    <td><span>        </span></td>
+                                    <td><span wicket:id="name">[Name]</span></td>
+                                    <td><span>        </span></td>
+                                    <td><span wicket:id="value">[Value]</span></td>
+                                </tr>
+                            </table>
+                        </td>
+                    </tr>
+                    <tr>
+                        <td colspan="3"><hr/></td>
+                    </tr>
                 </table>
-
               </fieldset>
-
-                <h3>Modifications</h3>
-                <div wicket:id="modstable" id="modstable" style="width: 720px;"></div>
-
             </div>
             <div wicket:id="userauditdetailpanel" id="userauditdetailpanel"></div>
         </div>

http://git-wip-us.apache.org/repos/asf/directory-fortress-commander/blob/323bcd8c/src/main/resources/org/apache/directory/fortress/web/panel/GroupDetailPanel.html
----------------------------------------------------------------------
diff --git a/src/main/resources/org/apache/directory/fortress/web/panel/GroupDetailPanel.html
b/src/main/resources/org/apache/directory/fortress/web/panel/GroupDetailPanel.html
index 9cae4cb..975f197 100644
--- a/src/main/resources/org/apache/directory/fortress/web/panel/GroupDetailPanel.html
+++ b/src/main/resources/org/apache/directory/fortress/web/panel/GroupDetailPanel.html
@@ -89,7 +89,7 @@
                 </tr>
                 <tr>
                     <td>
-                        <label for="memberAssign">User DN</label>
+                        <label for="memberAssign">Member DN</label>
                     </td>
                     <td>
                         <input type="text" wicket:id="memberAssign" id="memberAssign"
class="formLarge" style="width: 250px"/>


Mime
View raw message