You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@directory.apache.org by sm...@apache.org on 2014/11/11 21:35:25 UTC
[15/27] directory-fortress-commander git commit: change package
structure and names, pom improvements, license
http://git-wip-us.apache.org/repos/asf/directory-fortress-commander/blob/547b9ccd/src/main/java/org/openldap/commander/PwPolicyPage.java
----------------------------------------------------------------------
diff --git a/src/main/java/org/openldap/commander/PwPolicyPage.java b/src/main/java/org/openldap/commander/PwPolicyPage.java
deleted file mode 100644
index 16d6eaf..0000000
--- a/src/main/java/org/openldap/commander/PwPolicyPage.java
+++ /dev/null
@@ -1,70 +0,0 @@
-/*
- * This work is part of OpenLDAP Software <http://www.openldap.org/>.
- *
- * Copyright 1998-2014 The OpenLDAP Foundation.
- * All rights reserved.
- *
- * Redistribution and use in source and binary forms, with or without
- * modification, are permitted only as authorized by the OpenLDAP
- * Public License.
- *
- * A copy of this license is available in the file LICENSE in the
- * top-level directory of the distribution or, alternatively, at
- * <http://www.OpenLDAP.org/license.html>.
- */
-
-package org.openldap.commander;
-
-import org.apache.wicket.Component;
-import org.apache.wicket.extensions.ajax.markup.html.AjaxLazyLoadPanel;
-import org.apache.wicket.markup.html.WebMarkupContainer;
-import org.apache.wicket.markup.html.basic.Label;
-import org.openldap.commander.panel.Displayable;
-import org.openldap.commander.panel.InfoPanel;
-import org.openldap.commander.panel.NavPanel;
-import org.openldap.commander.panel.PwPolicyDetailPanel;
-import org.openldap.commander.panel.PwPolicyListPanel;
-
-/**
- * @author Shawn McKinney
- * @version $Rev$
- * Date: 6/12/13
- */
-public class PwPolicyPage extends CommanderBasePage
-{
- public PwPolicyPage()
- {
- add(new Label(GlobalIds.PAGE_HEADER, "Password Policy Administration"));
- WebMarkupContainer container = new WebMarkupContainer(GlobalIds.LAYOUT);
- FourWaySplitter splitter = new FourWaySplitter("72", "28");
- splitter.addBorderLayout(container);
-
- // Add the four necessary panels for Commander Page: 1. Nav,, 2. List, 3. Info, 4. Detail.
- // Nav and Info are generic and work across all entities, the others are specific to this entity type.
-
- // 1. Nav Panel:
- NavPanel navPanel = new NavPanel(GlobalIds.NAVPANEL);
-
- // 2. List Panel:
- container.add(new AjaxLazyLoadPanel("policylistpanel")
- {
- @Override
- public Component getLazyLoadComponent(String id)
- {
- return new PwPolicyListPanel(id);
- }
- });
-
- // 3. Info Panel:
- InfoPanel infoPanel = new InfoPanel(GlobalIds.INFOPANEL);
- container.add(infoPanel);
-
- // 4. Detail Panel:
- Displayable display = infoPanel.getDisplay();
- PwPolicyDetailPanel policyDetail = new PwPolicyDetailPanel("policydetailpanel", display);
- container.add(policyDetail);
-
- container.add(navPanel);
- this.add(container);
- }
-}
http://git-wip-us.apache.org/repos/asf/directory-fortress-commander/blob/547b9ccd/src/main/java/org/openldap/commander/RbacSession.java
----------------------------------------------------------------------
diff --git a/src/main/java/org/openldap/commander/RbacSession.java b/src/main/java/org/openldap/commander/RbacSession.java
deleted file mode 100644
index 412c4e4..0000000
--- a/src/main/java/org/openldap/commander/RbacSession.java
+++ /dev/null
@@ -1,67 +0,0 @@
-/*
- * This work is part of OpenLDAP Software <http://www.openldap.org/>.
- *
- * Copyright 1998-2014 The OpenLDAP Foundation.
- * All rights reserved.
- *
- * Redistribution and use in source and binary forms, with or without
- * modification, are permitted only as authorized by the OpenLDAP
- * Public License.
- *
- * A copy of this license is available in the file LICENSE in the
- * top-level directory of the distribution or, alternatively, at
- * <http://www.OpenLDAP.org/license.html>.
- */
-package org.openldap.commander;
-
-
-import org.apache.wicket.protocol.http.WebSession;
-import org.apache.wicket.request.Request;
-import org.openldap.fortress.rbac.Permission;
-import org.openldap.fortress.rbac.Session;
-
-import java.util.List;
-
-
-/**
- * ...
- *
- * @author Shawn McKinney
- * @version $Rev$
- */
-public class RbacSession extends WebSession
-{
- private Session session;
- private List<Permission> permissions;
-
- /**
- * Constructor. Note that {@link org.apache.wicket.request.cycle.RequestCycle} is not available until this
- * constructor returns.
- *
- * @param request The current request
- */
- public RbacSession( Request request )
- {
- super( request );
- }
-
- public Session getRbacSession()
- {
- return session;
- }
-
- public void setSession( Session session )
- {
- this.session = session;
- }
-
- public List<Permission> getPermissions()
- {
- return permissions;
- }
-
- public void setPermissions( List<Permission> permissions )
- {
- this.permissions = permissions;
- }
-}
http://git-wip-us.apache.org/repos/asf/directory-fortress-commander/blob/547b9ccd/src/main/java/org/openldap/commander/RoleAdminPage.java
----------------------------------------------------------------------
diff --git a/src/main/java/org/openldap/commander/RoleAdminPage.java b/src/main/java/org/openldap/commander/RoleAdminPage.java
deleted file mode 100644
index 5bf0d58..0000000
--- a/src/main/java/org/openldap/commander/RoleAdminPage.java
+++ /dev/null
@@ -1,81 +0,0 @@
-/*
- * This work is part of OpenLDAP Software <http://www.openldap.org/>.
- *
- * Copyright 1998-2014 The OpenLDAP Foundation.
- * All rights reserved.
- *
- * Redistribution and use in source and binary forms, with or without
- * modification, are permitted only as authorized by the OpenLDAP
- * Public License.
- *
- * A copy of this license is available in the file LICENSE in the
- * top-level directory of the distribution or, alternatively, at
- * <http://www.OpenLDAP.org/license.html>.
- */
-
-package org.openldap.commander;
-
-import org.apache.log4j.Logger;
-import org.apache.wicket.Component;
-import org.apache.wicket.extensions.ajax.markup.html.AjaxLazyLoadPanel;
-import org.apache.wicket.markup.html.WebMarkupContainer;
-import org.apache.wicket.markup.html.basic.Label;
-import org.apache.wicket.request.mapper.parameter.PageParameters;
-import org.openldap.commander.panel.Displayable;
-import org.openldap.commander.panel.InfoPanel;
-import org.openldap.commander.panel.NavPanel;
-import org.openldap.commander.panel.RoleDetailPanel;
-import org.openldap.commander.panel.RoleListPanel;
-
-/**
- * @author Shawn McKinney
- * @version $Rev$
- */
-public class RoleAdminPage extends CommanderBasePage
-{
- private boolean isAdmin = true;
- private String label = "Admin Role Administration";
- private static final Logger LOG = Logger.getLogger( RoleAdminPage.class.getName() );
-
- /**
- * @author Shawn McKinney
- * @version $Rev$
- * @param parameters
- */
- public RoleAdminPage(PageParameters parameters)
- {
- String type = GlobalUtils.getPageType(parameters);
- add( new Label( GlobalIds.PAGE_HEADER, label ) );
- WebMarkupContainer container = new WebMarkupContainer( GlobalIds.LAYOUT );
- FourWaySplitter splitter = new FourWaySplitter();
- splitter.addBorderLayout( container );
-
- // Add the four necessary panels for Commander Page: 1. Nav,, 2. List, 3. Info, 4. Detail
- // Nav and Info are generic and work across all entities, the others are specific to this entity type.
-
- // 1. Nav Panel:
- NavPanel navPanel = new NavPanel( GlobalIds.NAVPANEL );
-
- // 2. List Panel:
- container.add(new AjaxLazyLoadPanel( GlobalIds.ROLELISTPANEL )
- {
- @Override
- public Component getLazyLoadComponent(String id)
- {
- return new RoleListPanel(id, isAdmin);
- }
- });
-
- // 3. Info Panel:
- InfoPanel infoPanel = new InfoPanel( GlobalIds.INFOPANEL );
- container.add( infoPanel );
-
- // 4. Detail Panel:
- Displayable display = infoPanel.getDisplay();
- RoleDetailPanel roleDetail = new RoleDetailPanel( GlobalIds.ROLEDETAILPANEL, display, isAdmin );
- container.add( roleDetail );
-
- container.add( navPanel );
- this.add( container );
- }
-}
\ No newline at end of file
http://git-wip-us.apache.org/repos/asf/directory-fortress-commander/blob/547b9ccd/src/main/java/org/openldap/commander/RoleListModel.java
----------------------------------------------------------------------
diff --git a/src/main/java/org/openldap/commander/RoleListModel.java b/src/main/java/org/openldap/commander/RoleListModel.java
deleted file mode 100644
index d6027c5..0000000
--- a/src/main/java/org/openldap/commander/RoleListModel.java
+++ /dev/null
@@ -1,149 +0,0 @@
-/*
- * This work is part of OpenLDAP Software <http://www.openldap.org/>.
- *
- * Copyright 1998-2014 The OpenLDAP Foundation.
- * All rights reserved.
- *
- * Redistribution and use in source and binary forms, with or without
- * modification, are permitted only as authorized by the OpenLDAP
- * Public License.
- *
- * A copy of this license is available in the file LICENSE in the
- * top-level directory of the distribution or, alternatively, at
- * <http://www.OpenLDAP.org/license.html>.
- */
-
-package org.openldap.commander;
-
-import org.apache.log4j.Logger;
-import org.apache.wicket.injection.Injector;
-import org.apache.wicket.model.Model;
-import org.apache.wicket.spring.injection.annot.SpringBean;
-import org.openldap.fortress.DelReviewMgr;
-import org.openldap.fortress.ReviewMgr;
-import org.openldap.fortress.rbac.AdminRole;
-import org.openldap.fortress.rbac.Role;
-import org.openldap.fortress.rbac.Session;
-
-import java.io.Serializable;
-import java.util.ArrayList;
-import java.util.List;
-
-/**
- * @author Shawn McKinney
- * @version $Rev$
- * @param <T>
- */
-public class RoleListModel<T extends Serializable> extends Model
-{
- @SpringBean
- private ReviewMgr reviewMgr;
- @SpringBean
- private DelReviewMgr delReviewMgr;
- private static final Logger log = Logger.getLogger(RoleListModel.class.getName());
- private transient T role;
- private transient List<T> roles = null;
- private boolean isAdmin;
-
-
- public RoleListModel(final boolean isAdmin, final Session session )
- {
- Injector.get().inject(this);
- this.isAdmin = isAdmin;
- this.reviewMgr.setAdmin( session );
- }
-
- /**
- * User contains the search arguments.
- *
- * @param role
- */
- public RoleListModel(T role, final boolean isAdmin, final Session session )
- {
- Injector.get().inject(this);
- this.role = role;
- this.isAdmin = isAdmin;
- this.reviewMgr.setAdmin( session );
- }
-
- /**
- * This data is bound for RoleListPanel
- *
- * @return T extends List<Role> roles data will be bound to panel data view component.
- */
- @Override
- public T getObject()
- {
- if (roles != null)
- {
- log.debug(".getObject count: " + role != null ? roles.size() : "null");
- return (T) roles;
- }
- if (role == null)
- {
- log.debug(".getObject null");
- roles = new ArrayList<T>();
- }
- else
- {
- log.debug(".getObject roleNm: " + role != null ? ((Role)role).getName() : "null");
- if(isAdmin)
- {
- roles = getAdminList( ( (AdminRole)role ).getName() );
- }
- else
- {
- roles = getList( ( (Role)role ).getName() );
- }
-
- }
- return (T) roles;
- }
-
- @Override
- public void setObject(Object object)
- {
- log.debug(".setObject count: " + object != null ? ((List<Role>)object).size() : "null");
- this.roles = (List<T>) object;
- }
-
- @Override
- public void detach()
- {
- //log.debug(".detach");
- this.roles = null;
- this.role = null;
- }
-
- private List<T> getList(String szRoleNm)
- {
- List<T> rolesList = null;
- try
- {
- log.debug(".getList roleNm: " + szRoleNm);
- rolesList = (List<T>)reviewMgr.findRoles(szRoleNm);
- }
- catch (org.openldap.fortress.SecurityException se)
- {
- String error = ".getList caught SecurityException=" + se;
- log.warn(error);
- }
- return rolesList;
- }
-
- private List<T> getAdminList(String szRoleNm)
- {
- List<T> rolesList = null;
- try
- {
- log.debug(".getList roleNm: " + szRoleNm);
- rolesList = (List<T>)delReviewMgr.findRoles(szRoleNm);
- }
- catch (org.openldap.fortress.SecurityException se)
- {
- String error = ".getAdminList caught SecurityException=" + se;
- log.warn(error);
- }
- return rolesList;
- }
-}
http://git-wip-us.apache.org/repos/asf/directory-fortress-commander/blob/547b9ccd/src/main/java/org/openldap/commander/RolePage.java
----------------------------------------------------------------------
diff --git a/src/main/java/org/openldap/commander/RolePage.java b/src/main/java/org/openldap/commander/RolePage.java
deleted file mode 100644
index 2552abe..0000000
--- a/src/main/java/org/openldap/commander/RolePage.java
+++ /dev/null
@@ -1,75 +0,0 @@
-/*
- * This work is part of OpenLDAP Software <http://www.openldap.org/>.
- *
- * Copyright 1998-2014 The OpenLDAP Foundation.
- * All rights reserved.
- *
- * Redistribution and use in source and binary forms, with or without
- * modification, are permitted only as authorized by the OpenLDAP
- * Public License.
- *
- * A copy of this license is available in the file LICENSE in the
- * top-level directory of the distribution or, alternatively, at
- * <http://www.OpenLDAP.org/license.html>.
- */
-
-package org.openldap.commander;
-
-import org.apache.log4j.Logger;
-import org.apache.wicket.Component;
-import org.apache.wicket.extensions.ajax.markup.html.AjaxLazyLoadPanel;
-import org.apache.wicket.markup.html.WebMarkupContainer;
-import org.apache.wicket.markup.html.basic.Label;
-import org.apache.wicket.request.mapper.parameter.PageParameters;
-import org.openldap.commander.panel.Displayable;
-import org.openldap.commander.panel.InfoPanel;
-import org.openldap.commander.panel.NavPanel;
-import org.openldap.commander.panel.RoleDetailPanel;
-import org.openldap.commander.panel.RoleListPanel;
-
-/**
- * @author Shawn McKinney
- * @version $Rev$
- */
-public class RolePage extends CommanderBasePage
-{
- private boolean isAdmin = false;
- private String label = "RBAC Role Administration";
- private static final Logger LOG = Logger.getLogger( RolePage.class.getName() );
-
- public RolePage(PageParameters parameters)
- {
- add( new Label( GlobalIds.PAGE_HEADER, label ) );
- WebMarkupContainer container = new WebMarkupContainer( GlobalIds.LAYOUT );
- FourWaySplitter splitter = new FourWaySplitter();
- splitter.addBorderLayout( container );
-
- // Add the four necessary panels for Commander Page: 1. Nav,, 2. List, 3. Info, 4. Detail
- // Nav and Info are generic and work across all entities, the others are specific to this entity type.
-
- // 1. Nav Panel:
- NavPanel navPanel = new NavPanel( GlobalIds.NAVPANEL );
-
- // 2. List Panel:
- container.add(new AjaxLazyLoadPanel(GlobalIds.ROLELISTPANEL)
- {
- @Override
- public Component getLazyLoadComponent(String id)
- {
- return new RoleListPanel(id, isAdmin);
- }
- });
-
- // 3. Info Panel:
- InfoPanel infoPanel = new InfoPanel( GlobalIds.INFOPANEL );
- container.add( infoPanel );
-
- // 4. Detail Panel:
- Displayable display = infoPanel.getDisplay();
- RoleDetailPanel roleDetail = new RoleDetailPanel( GlobalIds.ROLEDETAILPANEL, display, isAdmin );
- container.add( roleDetail );
-
- container.add( navPanel );
- this.add( container );
- }
-}
\ No newline at end of file
http://git-wip-us.apache.org/repos/asf/directory-fortress-commander/blob/547b9ccd/src/main/java/org/openldap/commander/SDListModel.java
----------------------------------------------------------------------
diff --git a/src/main/java/org/openldap/commander/SDListModel.java b/src/main/java/org/openldap/commander/SDListModel.java
deleted file mode 100644
index 920ffab..0000000
--- a/src/main/java/org/openldap/commander/SDListModel.java
+++ /dev/null
@@ -1,143 +0,0 @@
-/*
- * This work is part of OpenLDAP Software <http://www.openldap.org/>.
- *
- * Copyright 1998-2014 The OpenLDAP Foundation.
- * All rights reserved.
- *
- * Redistribution and use in source and binary forms, with or without
- * modification, are permitted only as authorized by the OpenLDAP
- * Public License.
- *
- * A copy of this license is available in the file LICENSE in the
- * top-level directory of the distribution or, alternatively, at
- * <http://www.OpenLDAP.org/license.html>.
- */
-
-package org.openldap.commander;
-
-import org.apache.log4j.Logger;
-import org.apache.wicket.injection.Injector;
-import org.apache.wicket.model.Model;
-import org.apache.wicket.spring.injection.annot.SpringBean;
-import org.openldap.fortress.ReviewMgr;
-import org.openldap.fortress.rbac.Role;
-import org.openldap.fortress.rbac.SDSet;
-import org.openldap.fortress.rbac.Session;
-import org.openldap.fortress.util.attr.VUtil;
-
-import java.io.Serializable;
-import java.util.ArrayList;
-import java.util.List;
-
-/**
- * @author Shawn McKinney
- * @version $Rev$
- * @param <T>
- */
-public class SDListModel<T extends Serializable> extends Model
-{
- @SpringBean
- private ReviewMgr reviewMgr;
- private static final Logger log = Logger.getLogger(SDListModel.class.getName());
- private transient SDSet sdSet;
- private transient List<SDSet> sdSets = null;
-
- /**
- * Default constructor
- */
- public SDListModel(boolean isStatic, final Session session )
- {
- Injector.get().inject(this);
- this.reviewMgr.setAdmin( session );
- }
-
- /**
- * User contains the search arguments.
- *
- * @param sdSet
- */
- public SDListModel(SDSet sdSet, final Session session )
- {
- Injector.get().inject(this);
- this.sdSet = sdSet;
- this.reviewMgr.setAdmin( session );
- }
-
- /**
- * This data is bound for SDListPanel
- *
- * @return T extends List<SDSet> sdSets data will be bound to panel data view component.
- */
- @Override
- public T getObject()
- {
- if (sdSets != null)
- {
- log.debug(".getObject count: " + sdSet != null ? sdSets.size() : "null");
- return (T) sdSets;
- }
- if (sdSet == null)
- {
- log.debug(".getObject null");
- sdSets = new ArrayList<SDSet>();
- }
- else
- {
- log.debug(".getObject sdSetNm: " + sdSet != null ? sdSet.getName() : "null");
- sdSets = getList(sdSet);
- }
- return (T) sdSets;
- }
-
- @Override
- public void setObject(Object object)
- {
- log.debug(".setObject count: " + object != null ? ((List<SDSet>)object).size() : "null");
- this.sdSets = (List<SDSet>) object;
- }
-
- @Override
- public void detach()
- {
- //log.debug(".detach");
- this.sdSets = null;
- this.sdSet = null;
- }
-
- private List<SDSet> getList(SDSet sdSet)
- {
- List<SDSet> sdSetList = null;
- try
- {
- String szSdSetNm = sdSet != null && sdSet.getName() != null ? sdSet.getName() : "";
- log.debug(".getList sdSetNm: " + szSdSetNm);
- if(VUtil.isNotNullOrEmpty(sdSet.getMembers()))
- {
- Object[] roleNms = sdSet.getMembers().toArray();
- String szRoleNm = (String)roleNms[0];
- Role role = new Role(szRoleNm);
- if(sdSet.getType().equals(SDSet.SDType.STATIC))
- {
- sdSetList = reviewMgr.ssdRoleSets(role);
- }
- else
- {
- sdSetList = reviewMgr.dsdRoleSets(role);
- }
- }
- else
- {
- if(sdSet.getType().equals(SDSet.SDType.STATIC))
- sdSetList = reviewMgr.ssdSets(sdSet);
- else
- sdSetList = reviewMgr.dsdSets(sdSet);
- }
- }
- catch (org.openldap.fortress.SecurityException se)
- {
- String error = ".getList caught SecurityException=" + se;
- log.warn(error);
- }
- return sdSetList;
- }
-}
http://git-wip-us.apache.org/repos/asf/directory-fortress-commander/blob/547b9ccd/src/main/java/org/openldap/commander/SaveModelEvent.java
----------------------------------------------------------------------
diff --git a/src/main/java/org/openldap/commander/SaveModelEvent.java b/src/main/java/org/openldap/commander/SaveModelEvent.java
deleted file mode 100644
index 22a4760..0000000
--- a/src/main/java/org/openldap/commander/SaveModelEvent.java
+++ /dev/null
@@ -1,231 +0,0 @@
-/*
- * This work is part of OpenLDAP Software <http://www.openldap.org/>.
- *
- * Copyright 1998-2014 The OpenLDAP Foundation.
- * All rights reserved.
- *
- * Redistribution and use in source and binary forms, with or without
- * modification, are permitted only as authorized by the OpenLDAP
- * Public License.
- *
- * A copy of this license is available in the file LICENSE in the
- * top-level directory of the distribution or, alternatively, at
- * <http://www.OpenLDAP.org/license.html>.
- */
-
-package org.openldap.commander;
-
-import org.apache.wicket.Component;
-import org.apache.wicket.MarkupContainer;
-import org.apache.wicket.Page;
-import org.apache.wicket.ajax.AjaxRequestTarget;
-import org.apache.wicket.event.Broadcast;
-import org.apache.wicket.markup.head.IHeaderResponse;
-import org.apache.wicket.request.ILogData;
-import org.apache.wicket.request.IRequestCycle;
-import org.apache.wicket.request.component.IRequestablePage;
-import org.apache.wicket.request.mapper.parameter.PageParameters;
-import org.openldap.fortress.rbac.FortEntity;
-
-import java.util.Collection;
-
-/**
- *
- * @author Shawn McKinney
- * @version $Rev$
- */
-public class SaveModelEvent extends AjaxUpdateEvent
-{
- private int index = 0;
- private FortEntity entity;
-
- public Operations getOperation()
- {
- return operation;
- }
-
- public void setOperation(Operations operation)
- {
- this.operation = operation;
- }
-
- private Operations operation;
-
- public enum Operations
- {
- ADD,
- UPDATE,
- SEARCH,
- DELETE
- }
-
- public SaveModelEvent(AjaxRequestTarget target)
- {
- super(target);
- }
-
- public SaveModelEvent(AjaxRequestTarget target, int index)
- {
- super(target);
- this.index = index;
- }
-
- public SaveModelEvent(AjaxRequestTarget target, FortEntity entity)
- {
- super(target);
- this.entity = entity;
- }
-
- public SaveModelEvent(AjaxRequestTarget target, FortEntity entity, Operations operation)
- {
- super(target);
- this.entity = entity;
- this.operation = operation;
- }
-
- public int getIndex()
- {
- return index;
- }
-
- public void setIndex(int index)
- {
- this.index = index;
- }
-
- public FortEntity getEntity()
- {
- return entity;
- }
-
- public void setEntity(FortEntity entity)
- {
- this.entity = entity;
- }
-
- public static void send(Page page, Component component, FortEntity entity, AjaxRequestTarget target, Operations operation)
- {
- component.send(page, Broadcast.BREADTH, new SaveModelEvent(target, entity, operation));
- }
-
- public static void send(Page page, Component component, FortEntity entity, AjaxRequestTarget target)
- {
- component.send(page, Broadcast.BREADTH, new SaveModelEvent(target, entity));
- }
-
- public static void send(Page page, Component component, FortEntity entity)
- {
- AjaxRequestTarget target = new AjaxRequestTarget()
- {
- @Override
- public void add(Component component, String markupId)
- {
- //To change body of implemented methods use File | Settings | File Templates.
- //component.
- }
- @Override
- public void add(Component... components)
- {
- //To change body of implemented methods use File | Settings | File Templates.
- }
- @Override
- public void addChildren(MarkupContainer parent, Class<?> childCriteria)
- {
- //To change body of implemented methods use File | Settings | File Templates.
- }
- @Override
- public void addListener(IListener listener)
- {
- //To change body of implemented methods use File | Settings | File Templates.
- }
- @Override
- public void appendJavaScript(CharSequence javascript)
- {
- //To change body of implemented methods use File | Settings | File Templates.
- }
- @Override
- public void prependJavaScript(CharSequence javascript)
- {
- //To change body of implemented methods use File | Settings | File Templates.
- }
- @Override
- public void registerRespondListener(ITargetRespondListener listener)
- {
- //To change body of implemented methods use File | Settings | File Templates.
- }
- @Override
- public Collection<? extends Component> getComponents()
- {
- return null; //To change body of implemented methods use File | Settings | File Templates.
- }
- @Override
- public void focusComponent(Component component)
- {
- //To change body of implemented methods use File | Settings | File Templates.
- }
- @Override
- public IHeaderResponse getHeaderResponse()
- {
- return null; //To change body of implemented methods use File | Settings | File Templates.
- }
- @Override
- public String getLastFocusedElementId()
- {
- return null; //To change body of implemented methods use File | Settings | File Templates.
- }
- @Override
- public Page getPage()
- {
- return null; //To change body of implemented methods use File | Settings | File Templates.
- }
- @Override
- public ILogData getLogData()
-
- {
- return null; //To change body of implemented methods use File | Settings | File Templates.
- }
- @Override
- public Integer getPageId()
- {
- return null; //To change body of implemented methods use File | Settings | File Templates.
- }
- @Override
- public boolean isPageInstanceCreated()
- {
- return false; //To change body of implemented methods use File | Settings | File Templates.
- }
- @Override
- public Integer getRenderCount()
- {
- return null; //To change body of implemented methods use File | Settings | File Templates.
- }
- @Override
- public Class<? extends IRequestablePage> getPageClass()
- {
- return null; //To change body of implemented methods use File | Settings | File Templates.
- }
- @Override
- public PageParameters getPageParameters()
- {
- return null; //To change body of implemented methods use File | Settings | File Templates.
- }
- @Override
- public void respond(IRequestCycle iRequestCycle)
- {
- //To change body of implemented methods use File | Settings | File Templates.
- }
- @Override
- public void detach(IRequestCycle iRequestCycle)
- {
- //To change body of implemented methods use File | Settings | File Templates.
- }
- };
-/*
- //AjaxRequestTarget target = AjaxRequestTarget.get();
- if (target != null) { //...then this is an ajax request, not a static one
- target.addComponent(myComponent);
- }
-*/
- component.send(page, Broadcast.BREADTH, new SaveModelEvent(target, entity));
- }
-}
\ No newline at end of file
http://git-wip-us.apache.org/repos/asf/directory-fortress-commander/blob/547b9ccd/src/main/java/org/openldap/commander/SdDynamicPage.java
----------------------------------------------------------------------
diff --git a/src/main/java/org/openldap/commander/SdDynamicPage.java b/src/main/java/org/openldap/commander/SdDynamicPage.java
deleted file mode 100644
index cac5895..0000000
--- a/src/main/java/org/openldap/commander/SdDynamicPage.java
+++ /dev/null
@@ -1,73 +0,0 @@
-/*
- * This work is part of OpenLDAP Software <http://www.openldap.org/>.
- *
- * Copyright 1998-2014 The OpenLDAP Foundation.
- * All rights reserved.
- *
- * Redistribution and use in source and binary forms, with or without
- * modification, are permitted only as authorized by the OpenLDAP
- * Public License.
- *
- * A copy of this license is available in the file LICENSE in the
- * top-level directory of the distribution or, alternatively, at
- * <http://www.OpenLDAP.org/license.html>.
- */
-
-package org.openldap.commander;
-
-import org.apache.wicket.Component;
-import org.apache.wicket.extensions.ajax.markup.html.AjaxLazyLoadPanel;
-import org.apache.wicket.markup.html.WebMarkupContainer;
-import org.apache.wicket.markup.html.basic.Label;
-import org.apache.wicket.request.mapper.parameter.PageParameters;
-import org.openldap.commander.panel.Displayable;
-import org.openldap.commander.panel.InfoPanel;
-import org.openldap.commander.panel.NavPanel;
-import org.openldap.commander.panel.SDDetailPanel;
-import org.openldap.commander.panel.SDListPanel;
-
-/**
- * @author Shawn McKinney
- * @version $Rev$
- */
-public class SdDynamicPage extends CommanderBasePage
-{
- private boolean isStatic = false;
- private String label = "Dynamic Separation of Duties Administration";;
-
- public SdDynamicPage( PageParameters parameters )
- {
- add(new Label(GlobalIds.PAGE_HEADER, label));
- WebMarkupContainer container = new WebMarkupContainer(GlobalIds.LAYOUT);
- FourWaySplitter splitter = new FourWaySplitter();
- splitter.addBorderLayout(container);
-
- // Add the four necessary panels for Commander Page: 1. Nav,, 2. List, 3. Info, 4. Detail
- // Nav and Info are generic and work across all entities, the others are specific to this entity type.
-
- // 1. Nav Panel:
- NavPanel navPanel = new NavPanel(GlobalIds.NAVPANEL);
-
- // 2. List Panel:
- container.add(new AjaxLazyLoadPanel( GlobalIds.SDLISTPANEL )
- {
- @Override
- public Component getLazyLoadComponent(String id)
- {
- return new SDListPanel(id, isStatic);
- }
- });
-
- // 3. Info Panel:
- InfoPanel infoPanel = new InfoPanel(GlobalIds.INFOPANEL);
- container.add(infoPanel);
-
- // 4. Detail Panel:
- Displayable display = infoPanel.getDisplay();
- SDDetailPanel sdDetail = new SDDetailPanel( GlobalIds.SDDETAILPANEL, display, isStatic);
- container.add(sdDetail);
-
- container.add(navPanel);
- this.add(container);
- }
-}
http://git-wip-us.apache.org/repos/asf/directory-fortress-commander/blob/547b9ccd/src/main/java/org/openldap/commander/SdStaticPage.java
----------------------------------------------------------------------
diff --git a/src/main/java/org/openldap/commander/SdStaticPage.java b/src/main/java/org/openldap/commander/SdStaticPage.java
deleted file mode 100644
index ca61100..0000000
--- a/src/main/java/org/openldap/commander/SdStaticPage.java
+++ /dev/null
@@ -1,72 +0,0 @@
-/*
- * This work is part of OpenLDAP Software <http://www.openldap.org/>.
- *
- * Copyright 1998-2014 The OpenLDAP Foundation.
- * All rights reserved.
- *
- * Redistribution and use in source and binary forms, with or without
- * modification, are permitted only as authorized by the OpenLDAP
- * Public License.
- *
- * A copy of this license is available in the file LICENSE in the
- * top-level directory of the distribution or, alternatively, at
- * <http://www.OpenLDAP.org/license.html>.
- */
-
-package org.openldap.commander;
-
-import org.apache.wicket.Component;
-import org.apache.wicket.extensions.ajax.markup.html.AjaxLazyLoadPanel;
-import org.apache.wicket.markup.html.WebMarkupContainer;
-import org.apache.wicket.markup.html.basic.Label;
-import org.apache.wicket.request.mapper.parameter.PageParameters;
-import org.openldap.commander.panel.Displayable;
-import org.openldap.commander.panel.InfoPanel;
-import org.openldap.commander.panel.NavPanel;
-import org.openldap.commander.panel.SDDetailPanel;
-import org.openldap.commander.panel.SDListPanel;
-
-/**
- * @author Shawn McKinney
- * @version $Rev$
- */
-public class SdStaticPage extends CommanderBasePage
-{
- private boolean isStatic = true;
- private String label = "Static Separation of Duties Administration";
- public SdStaticPage( PageParameters parameters )
- {
- add(new Label(GlobalIds.PAGE_HEADER, label));
- WebMarkupContainer container = new WebMarkupContainer( GlobalIds.LAYOUT );
- FourWaySplitter splitter = new FourWaySplitter();
- splitter.addBorderLayout(container);
-
- // Add the four necessary panels for Commander Page: 1. Nav,, 2. List, 3. Info, 4. Detail
- // Nav and Info are generic and work across all entities, the others are specific to this entity type.
-
- // 1. Nav Panel:
- NavPanel navPanel = new NavPanel(GlobalIds.NAVPANEL);
-
- // 2. List Panel:
- container.add(new AjaxLazyLoadPanel(GlobalIds.SDLISTPANEL)
- {
- @Override
- public Component getLazyLoadComponent(String id)
- {
- return new SDListPanel(id, isStatic);
- }
- });
-
- // 3. Info Panel:
- InfoPanel infoPanel = new InfoPanel(GlobalIds.INFOPANEL);
- container.add(infoPanel);
-
- // 4. Detail Panel:
- Displayable display = infoPanel.getDisplay();
- SDDetailPanel sdDetail = new SDDetailPanel(GlobalIds.SDDETAILPANEL, display, isStatic);
- container.add(sdDetail);
-
- container.add(navPanel);
- this.add(container);
- }
-}
http://git-wip-us.apache.org/repos/asf/directory-fortress-commander/blob/547b9ccd/src/main/java/org/openldap/commander/SecureBookmarkablePageLink.java
----------------------------------------------------------------------
diff --git a/src/main/java/org/openldap/commander/SecureBookmarkablePageLink.java b/src/main/java/org/openldap/commander/SecureBookmarkablePageLink.java
deleted file mode 100644
index 4844264..0000000
--- a/src/main/java/org/openldap/commander/SecureBookmarkablePageLink.java
+++ /dev/null
@@ -1,54 +0,0 @@
-/*
- * This work is part of OpenLDAP Software <http://www.openldap.org/>.
- *
- * Copyright 1998-2014 The OpenLDAP Foundation.
- * All rights reserved.
- *
- * Redistribution and use in source and binary forms, with or without
- * modification, are permitted only as authorized by the OpenLDAP
- * Public License.
- *
- * A copy of this license is available in the file LICENSE in the
- * top-level directory of the distribution or, alternatively, at
- * <http://www.OpenLDAP.org/license.html>.
- */
-package org.openldap.commander;
-
-import org.apache.wicket.Page;
-import org.apache.wicket.markup.html.link.BookmarkablePageLink;
-import org.apache.wicket.request.mapper.parameter.PageParameters;
-
-import javax.servlet.http.HttpServletRequest;
-
-/**
- * ...
- *
- * @author Shawn McKinney
- * @version $Rev$
- */
-public class SecureBookmarkablePageLink extends BookmarkablePageLink
-{
- public <C extends Page> SecureBookmarkablePageLink( String id, Class<C> pageClass, String roleName )
- {
- super( id, pageClass );
- if(!isAuthorized( roleName ))
- {
- setVisible( false );
- }
- }
-
- public <C extends Page> SecureBookmarkablePageLink( String id, Class<C> pageClass, PageParameters parameters, String roleName )
- {
- super( id, pageClass, parameters );
- if(!isAuthorized( roleName ))
- {
- setVisible( false );
- }
- }
-
- private boolean isAuthorized( String roleName )
- {
- HttpServletRequest servletReq = ( HttpServletRequest ) getRequest().getContainerRequest();
- return GlobalUtils.isAuthorized( roleName, servletReq );
- }
-}
http://git-wip-us.apache.org/repos/asf/directory-fortress-commander/blob/547b9ccd/src/main/java/org/openldap/commander/SecureIndicatingAjaxButton.java
----------------------------------------------------------------------
diff --git a/src/main/java/org/openldap/commander/SecureIndicatingAjaxButton.java b/src/main/java/org/openldap/commander/SecureIndicatingAjaxButton.java
deleted file mode 100644
index c4a142b..0000000
--- a/src/main/java/org/openldap/commander/SecureIndicatingAjaxButton.java
+++ /dev/null
@@ -1,45 +0,0 @@
-/*
- * This work is part of OpenLDAP Software <http://www.openldap.org/>.
- *
- * Copyright 1998-2014 The OpenLDAP Foundation.
- * All rights reserved.
- *
- * Redistribution and use in source and binary forms, with or without
- * modification, are permitted only as authorized by the OpenLDAP
- * Public License.
- *
- * A copy of this license is available in the file LICENSE in the
- * top-level directory of the distribution or, alternatively, at
- * <http://www.OpenLDAP.org/license.html>.
- */
-package org.openldap.commander;
-
-import com.googlecode.wicket.jquery.ui.form.button.IndicatingAjaxButton;
-import org.openldap.fortress.rbac.Permission;
-
-import javax.servlet.http.HttpServletRequest;
-
-/**
- * ...
- *
- * @author Shawn McKinney
- * @version $Rev$
- */
-@Authorizable
-public class SecureIndicatingAjaxButton extends IndicatingAjaxButton
-{
- public SecureIndicatingAjaxButton( String id, String objName, String opName )
- {
- super( id );
- if(!GlobalUtils.isFound( new Permission(objName, opName), this ))
- setVisible( false );
- }
-
- public SecureIndicatingAjaxButton( String id, String roleName )
- {
- super( id );
- HttpServletRequest servletReq = ( HttpServletRequest ) getRequest().getContainerRequest();
- if( ! GlobalUtils.isAuthorized( roleName, servletReq ) )
- setVisible( false );
- }
-}
\ No newline at end of file
http://git-wip-us.apache.org/repos/asf/directory-fortress-commander/blob/547b9ccd/src/main/java/org/openldap/commander/SecureIndicatingAjaxLink.java
----------------------------------------------------------------------
diff --git a/src/main/java/org/openldap/commander/SecureIndicatingAjaxLink.java b/src/main/java/org/openldap/commander/SecureIndicatingAjaxLink.java
deleted file mode 100644
index dab7c4e..0000000
--- a/src/main/java/org/openldap/commander/SecureIndicatingAjaxLink.java
+++ /dev/null
@@ -1,41 +0,0 @@
-/*
- * This work is part of OpenLDAP Software <http://www.openldap.org/>.
- *
- * Copyright 1998-2014 The OpenLDAP Foundation.
- * All rights reserved.
- *
- * Redistribution and use in source and binary forms, with or without
- * modification, are permitted only as authorized by the OpenLDAP
- * Public License.
- *
- * A copy of this license is available in the file LICENSE in the
- * top-level directory of the distribution or, alternatively, at
- * <http://www.OpenLDAP.org/license.html>.
- */
-package org.openldap.commander;
-
-import org.apache.wicket.ajax.AjaxRequestTarget;
-import org.apache.wicket.extensions.ajax.markup.html.IndicatingAjaxLink;
-import org.openldap.fortress.rbac.Permission;
-
-/**
- * ...
- *
- * @author Shawn McKinney
- * @version $Rev$
- */
-public class SecureIndicatingAjaxLink extends IndicatingAjaxLink
-{
- public SecureIndicatingAjaxLink( String id, String objName, String opName )
- {
- super( id );
- if(!GlobalUtils.isFound( new Permission(objName, opName), this ))
- setEnabled( false );
- }
-
- @Override
- public void onClick( AjaxRequestTarget target )
- {
- //To change body of implemented methods use File | Settings | File Templates.
- }
-}
http://git-wip-us.apache.org/repos/asf/directory-fortress-commander/blob/547b9ccd/src/main/java/org/openldap/commander/SelectModelEvent.java
----------------------------------------------------------------------
diff --git a/src/main/java/org/openldap/commander/SelectModelEvent.java b/src/main/java/org/openldap/commander/SelectModelEvent.java
deleted file mode 100644
index 2acfef5..0000000
--- a/src/main/java/org/openldap/commander/SelectModelEvent.java
+++ /dev/null
@@ -1,192 +0,0 @@
-/*
- * This work is part of OpenLDAP Software <http://www.openldap.org/>.
- *
- * Copyright 1998-2014 The OpenLDAP Foundation.
- * All rights reserved.
- *
- * Redistribution and use in source and binary forms, with or without
- * modification, are permitted only as authorized by the OpenLDAP
- * Public License.
- *
- * A copy of this license is available in the file LICENSE in the
- * top-level directory of the distribution or, alternatively, at
- * <http://www.OpenLDAP.org/license.html>.
- */
-
-package org.openldap.commander;
-
-import org.apache.wicket.Component;
-import org.apache.wicket.MarkupContainer;
-import org.apache.wicket.Page;
-import org.apache.wicket.ajax.AjaxRequestTarget;
-import org.apache.wicket.event.Broadcast;
-import org.apache.wicket.markup.head.IHeaderResponse;
-import org.apache.wicket.request.ILogData;
-import org.apache.wicket.request.IRequestCycle;
-import org.apache.wicket.request.component.IRequestablePage;
-import org.apache.wicket.request.mapper.parameter.PageParameters;
-import org.openldap.fortress.rbac.FortEntity;
-
-import java.util.Collection;
-
-/**
- * @author Shawn McKinney
- * @version $Rev$
- */
-public class SelectModelEvent extends AjaxUpdateEvent
-{
- private int index = 0;
- private FortEntity entity;
-
- public SelectModelEvent(AjaxRequestTarget target)
- {
- super(target);
- }
-
- public SelectModelEvent(AjaxRequestTarget target, int index)
- {
- super(target);
- this.index = index;
- }
-
- public SelectModelEvent(AjaxRequestTarget target, FortEntity entity)
- {
- super(target);
- this.entity = entity;
- }
-
- public int getIndex()
- {
- return index;
- }
-
- public void setIndex(int index)
- {
- this.index = index;
- }
-
- public FortEntity getEntity()
- {
- return entity;
- }
-
- public void setEntity(FortEntity entity)
- {
- this.entity = entity;
- }
-
- public static void send(Page page, Component component, FortEntity entity)
- {
- AjaxRequestTarget target = new AjaxRequestTarget()
- {
- @Override
- public void add(Component component, String markupId)
- {
- //To change body of implemented methods use File | Settings | File Templates.
- //component.
- }
- @Override
- public void add(Component... components)
- {
- //To change body of implemented methods use File | Settings | File Templates.
- }
- @Override
- public void addChildren(MarkupContainer parent, Class<?> childCriteria)
- {
- //To change body of implemented methods use File | Settings | File Templates.
- }
- @Override
- public void addListener(IListener listener)
- {
- //To change body of implemented methods use File | Settings | File Templates.
- }
- @Override
- public void appendJavaScript(CharSequence javascript)
- {
- //To change body of implemented methods use File | Settings | File Templates.
- }
- @Override
- public void prependJavaScript(CharSequence javascript)
- {
- //To change body of implemented methods use File | Settings | File Templates.
- }
- @Override
- public void registerRespondListener(ITargetRespondListener listener)
- {
- //To change body of implemented methods use File | Settings | File Templates.
- }
- @Override
- public Collection<? extends Component> getComponents()
- {
- return null; //To change body of implemented methods use File | Settings | File Templates.
- }
- @Override
- public void focusComponent(Component component)
- {
- //To change body of implemented methods use File | Settings | File Templates.
- }
- @Override
- public IHeaderResponse getHeaderResponse()
- {
- return null; //To change body of implemented methods use File | Settings | File Templates.
- }
- @Override
- public String getLastFocusedElementId()
- {
- return null; //To change body of implemented methods use File | Settings | File Templates.
- }
- @Override
- public Page getPage()
- {
- return null; //To change body of implemented methods use File | Settings | File Templates.
- }
- @Override
- public ILogData getLogData()
-
- {
- return null; //To change body of implemented methods use File | Settings | File Templates.
- }
- @Override
- public Integer getPageId()
- {
- return null; //To change body of implemented methods use File | Settings | File Templates.
- }
- @Override
- public boolean isPageInstanceCreated()
- {
- return false; //To change body of implemented methods use File | Settings | File Templates.
- }
- @Override
- public Integer getRenderCount()
- {
- return null; //To change body of implemented methods use File | Settings | File Templates.
- }
- @Override
- public Class<? extends IRequestablePage> getPageClass()
- {
- return null; //To change body of implemented methods use File | Settings | File Templates.
- }
- @Override
- public PageParameters getPageParameters()
- {
- return null; //To change body of implemented methods use File | Settings | File Templates.
- }
- @Override
- public void respond(IRequestCycle iRequestCycle)
- {
- //To change body of implemented methods use File | Settings | File Templates.
- }
- @Override
- public void detach(IRequestCycle iRequestCycle)
- {
- //To change body of implemented methods use File | Settings | File Templates.
- }
- };
- component.send(page, Broadcast.BREADTH, new SelectModelEvent(target, entity));
- }
-
- public static void send(Page page, Component component, FortEntity entity, AjaxRequestTarget target)
- {
- component.send(page, Broadcast.BREADTH, new SaveModelEvent(target, entity));
- }
-}
\ No newline at end of file
http://git-wip-us.apache.org/repos/asf/directory-fortress-commander/blob/547b9ccd/src/main/java/org/openldap/commander/SixWaySplitter.java
----------------------------------------------------------------------
diff --git a/src/main/java/org/openldap/commander/SixWaySplitter.java b/src/main/java/org/openldap/commander/SixWaySplitter.java
deleted file mode 100644
index d33324b..0000000
--- a/src/main/java/org/openldap/commander/SixWaySplitter.java
+++ /dev/null
@@ -1,80 +0,0 @@
-/*
- * This work is part of OpenLDAP Software <http://www.openldap.org/>.
- *
- * Copyright 1998-2014 The OpenLDAP Foundation.
- * All rights reserved.
- *
- * Redistribution and use in source and binary forms, with or without
- * modification, are permitted only as authorized by the OpenLDAP
- * Public License.
- *
- * A copy of this license is available in the file LICENSE in the
- * top-level directory of the distribution or, alternatively, at
- * <http://www.OpenLDAP.org/license.html>.
- */
-
-package org.openldap.commander;
-
-import com.googlecode.wicket.kendo.ui.widget.splitter.IBorderLayout;
-import com.googlecode.wicket.kendo.ui.widget.splitter.SplitterBehavior;
-import org.apache.wicket.MarkupContainer;
-
-/**
- * @author Shawn McKinney
- * @version $Rev$
- * Date: 5/21/13
- */
-public class SixWaySplitter implements IBorderLayout
-{
- public void addBorderLayout(MarkupContainer container)
- {
- container.add(new SplitterBehavior("#vertical").setOption("panes", this.getVerticalPanes()).setOption("orientation", "'vertical'"));
- container.add(new SplitterBehavior("#horizontal").setOption("panes", this.getHorizontalPanes()));
-
- /*
- SplitterBehavior verticalSplitter = new SplitterBehavior("#vertical");
- verticalSplitter.setOption("orientation", "'vertical'");
- verticalSplitter.setOption("min", "'400px'");
- verticalSplitter.setOption("max", "'800px'");
- verticalSplitter.setOption("height", "'100%'");
- verticalSplitter.setOption("size", "'60px'");
- verticalSplitter.setOption("collapsible", "'false'");
- container.add(verticalSplitter);
- */
-
- /*
- SplitterBehavior horizontalSplitter = new SplitterBehavior("#horizontal");
- horizontalSplitter.setOption("orientation", "'horizontal'");
- horizontalSplitter.setOption("min", "'400px'");
- horizontalSplitter.setOption("max", "'800px'");
- horizontalSplitter.setOption("height", "'100%'");
- horizontalSplitter.setOption("size", "'20%'");
- horizontalSplitter.setOption("collapsible", "'true'");
- container.add(horizontalSplitter);
- */
-
-
- //container.add(new SplitterBehavior("#vertical").setOption("panes", this.getVerticalPanes()).setOption("orientation", "'vertical'"));
- //container.add(new SplitterBehavior("#horizontal").setOption("panes", this.getHorizontalPanes()));
- }
-
-
- @Override
- public String getVerticalPanes()
- {
- System.out.println("getVerticalPanes");
- //return "[ { resizable: false, size: '25%' }, { }, { collapsible: true, size: '25%' } ]";
- //return "[ { resizable: false, size: '15%' }, { resizable: true, size: '70%' }, { collapsible: true, size: '15%' } ]";
- return "[ { collapsible: true, resizable: false, size: '50px', min: '50px', max: '50px', scrollable: false }, { resizable: true, size: '80%' }, { collapsible: true, size: '5%', min: '50px'} ]";
- }
-
- @Override
- public String getHorizontalPanes()
- {
- System.out.println("getHorizontalPanes");
- //return "[ { size: '15%' }, { }, { size: '15%' } ]";
- //return "[ { collapsible: true, size: '78%' }, { size: '20%', max: '300px' } ]";
- //return "[ { collapsible: true, size: '78%' }, { collapsible: true, size: '20%', min: '200px', max: '300px' } ]";
- return "[ { collapsible: true, size: '8%'}, { collapsible: true, size: '70%' }, { collapsible: true, size: '18%'} ]";
- }
-}
http://git-wip-us.apache.org/repos/asf/directory-fortress-commander/blob/547b9ccd/src/main/java/org/openldap/commander/TestAuthorization.java
----------------------------------------------------------------------
diff --git a/src/main/java/org/openldap/commander/TestAuthorization.java b/src/main/java/org/openldap/commander/TestAuthorization.java
deleted file mode 100644
index feace77..0000000
--- a/src/main/java/org/openldap/commander/TestAuthorization.java
+++ /dev/null
@@ -1,56 +0,0 @@
-/*
- * This work is part of OpenLDAP Software <http://www.openldap.org/>.
- *
- * Copyright 1998-2014 The OpenLDAP Foundation.
- * All rights reserved.
- *
- * Redistribution and use in source and binary forms, with or without
- * modification, are permitted only as authorized by the OpenLDAP
- * Public License.
- *
- * A copy of this license is available in the file LICENSE in the
- * top-level directory of the distribution or, alternatively, at
- * <http://www.OpenLDAP.org/license.html>.
- */
-package org.openldap.commander;
-
-import org.apache.wicket.injection.Injector;
-import org.apache.wicket.spring.injection.annot.SpringBean;
-import org.slf4j.Logger;
-import org.slf4j.LoggerFactory;
-import org.openldap.fortress.AccessMgr;
-import org.openldap.fortress.rbac.Permission;
-import org.openldap.fortress.rbac.Session;
-
-/**
- * ...
- *
- * @author Shawn McKinney
- * @version $Rev$
- */
-public class TestAuthorization
-{
- @SpringBean
- AccessMgr accessMgr;
-
- public TestAuthorization()
- {
- Injector.get().inject(this);
- }
-
- private static final Logger LOG = LoggerFactory.getLogger( TestAuthorization.class.getName() );
-
- public boolean checkAccess( Session session, String objName, String opName )
- {
- boolean result = false;
- try
- {
- result = accessMgr.checkAccess( session, new Permission(objName, opName) );
- }
- catch ( org.openldap.fortress.SecurityException se )
- {
- LOG.warn( "SecurityException=" + se );
- }
- return result;
- }
-}
\ No newline at end of file
http://git-wip-us.apache.org/repos/asf/directory-fortress-commander/blob/547b9ccd/src/main/java/org/openldap/commander/UserListModel.java
----------------------------------------------------------------------
diff --git a/src/main/java/org/openldap/commander/UserListModel.java b/src/main/java/org/openldap/commander/UserListModel.java
deleted file mode 100644
index 086c201..0000000
--- a/src/main/java/org/openldap/commander/UserListModel.java
+++ /dev/null
@@ -1,170 +0,0 @@
-/*
- * This work is part of OpenLDAP Software <http://www.openldap.org/>.
- *
- * Copyright 1998-2014 The OpenLDAP Foundation.
- * All rights reserved.
- *
- * Redistribution and use in source and binary forms, with or without
- * modification, are permitted only as authorized by the OpenLDAP
- * Public License.
- *
- * A copy of this license is available in the file LICENSE in the
- * top-level directory of the distribution or, alternatively, at
- * <http://www.OpenLDAP.org/license.html>.
- */
-
-package org.openldap.commander;
-
-import org.apache.log4j.Logger;
-import org.apache.wicket.injection.Injector;
-import org.apache.wicket.model.Model;
-import org.apache.wicket.spring.injection.annot.SpringBean;
-import org.openldap.commander.panel.UserListPanel;
-import org.openldap.fortress.DelReviewMgr;
-import org.openldap.fortress.ReviewMgr;
-import org.openldap.fortress.rbac.AdminRole;
-import org.openldap.fortress.rbac.OrgUnit;
-import org.openldap.fortress.rbac.Permission;
-import org.openldap.fortress.rbac.Role;
-import org.openldap.fortress.rbac.Session;
-import org.openldap.fortress.rbac.User;
-import org.openldap.fortress.util.attr.VUtil;
-
-import java.io.Serializable;
-import java.util.ArrayList;
-import java.util.List;
-import java.util.Set;
-
-/**
- * @author Shawn McKinney
- * @version $Rev$
- * @param <T>
- */
-public class UserListModel<T extends Serializable> extends Model
-{
- @SpringBean
- private ReviewMgr reviewMgr;
- @SpringBean
- private DelReviewMgr delReviewMgr;
- private static final Logger log = Logger.getLogger(UserListModel.class.getName());
- private transient User user;
- private transient Permission perm;
- private transient List<User> users = null;
-
- /**
- * Default constructor
- */
- public UserListModel( final Session session )
- {
- init( session );
- }
-
- /**
- * User contains the search arguments.
- *
- * @param user
- */
- public UserListModel(User user, final Session session )
- {
- this.user = user;
- init( session );
- log.debug( "constructor userId: " + user != null ? user.getUserId() : "null" );
- }
-
- public UserListModel(Permission perm, final Session session )
- {
- this.perm = perm;
- init( session );
- log.debug( "constructor perm: " + perm != null ? perm.getObjName() : "null" );
- }
-
- private void init(final Session session )
- {
- Injector.get().inject( this );
- this.reviewMgr.setAdmin( session );
- }
-
- /**
- * This data is bound for {@link UserListPanel}
- *
- * @return T extends List<User> users data will be bound to panel data view component.
- */
- @Override
- public T getObject()
- {
- if (users != null)
- {
- log.debug(".getObject count: " + user != null ? users.size() : "null");
- return (T) users;
- }
- if (user == null && perm == null)
- {
- log.debug(".getObject null");
- users = new ArrayList<User>();
- }
- else
- {
- //log.debug(".getObject userId: " + user != null ? user.getUserId() : "null");
- users = getList(user);
- }
- return (T) users;
- }
-
- @Override
- public void setObject(Object object)
- {
- log.debug(".setObject count: " + object != null ? ((List<User>)object).size() : "null");
- this.users = (List<User>) object;
- }
-
- @Override
- public void detach()
- {
- //log.debug(".detach");
- this.users = null;
- this.user = null;
- }
-
- public List<User> getList(User user)
- {
- List<User> usersList = null;
- try
- {
- if(perm != null)
- {
- Set<String> users = reviewMgr.authorizedPermissionUsers( perm );
- if(VUtil.isNotNullOrEmpty( users ))
- {
- usersList = new ArrayList<User>();
- for(String userId : users)
- {
- User user1 = reviewMgr.readUser( new User(userId) );
- usersList.add( user1 );
- }
- }
- }
- else if(VUtil.isNotNullOrEmpty(user.getOu()))
- {
- usersList = reviewMgr.findUsers(new OrgUnit(user.getOu(), OrgUnit.Type.USER));
- }
- else if(VUtil.isNotNullOrEmpty(user.getRoles()))
- {
- usersList = reviewMgr.assignedUsers(new Role(user.getRoles().get(0).getName()));
- }
- else if(VUtil.isNotNullOrEmpty(user.getAdminRoles()))
- {
- usersList = delReviewMgr.assignedUsers(new AdminRole(user.getAdminRoles().get(0).getName()));
- }
- else
- {
- usersList = reviewMgr.findUsers(user);
- }
- }
- catch (org.openldap.fortress.SecurityException se)
- {
- String error = ".getList caught SecurityException=" + se;
- log.warn(error);
- }
- return usersList;
- }
-}
http://git-wip-us.apache.org/repos/asf/directory-fortress-commander/blob/547b9ccd/src/main/java/org/openldap/commander/UserPage.java
----------------------------------------------------------------------
diff --git a/src/main/java/org/openldap/commander/UserPage.java b/src/main/java/org/openldap/commander/UserPage.java
deleted file mode 100644
index 2c6dbb9..0000000
--- a/src/main/java/org/openldap/commander/UserPage.java
+++ /dev/null
@@ -1,70 +0,0 @@
-/*
- * This work is part of OpenLDAP Software <http://www.openldap.org/>.
- *
- * Copyright 1998-2014 The OpenLDAP Foundation.
- * All rights reserved.
- *
- * Redistribution and use in source and binary forms, with or without
- * modification, are permitted only as authorized by the OpenLDAP
- * Public License.
- *
- * A copy of this license is available in the file LICENSE in the
- * top-level directory of the distribution or, alternatively, at
- * <http://www.OpenLDAP.org/license.html>.
- */
-
-package org.openldap.commander;
-
-import org.apache.wicket.Component;
-import org.apache.wicket.extensions.ajax.markup.html.AjaxLazyLoadPanel;
-import org.apache.wicket.markup.html.WebMarkupContainer;
-import org.apache.wicket.markup.html.basic.Label;
-import org.openldap.commander.panel.Displayable;
-import org.openldap.commander.panel.InfoPanel;
-import org.openldap.commander.panel.NavPanel;
-import org.openldap.commander.panel.UserDetailPanel;
-import org.openldap.commander.panel.UserListPanel;
-
-/**
- * @author Shawn McKinney
- * @version $Rev$
- */
-public class UserPage extends CommanderBasePage
-{
-
- public UserPage()
- {
- add(new Label(GlobalIds.PAGE_HEADER, "User Administration"));
- WebMarkupContainer container = new WebMarkupContainer(GlobalIds.LAYOUT);
- FourWaySplitter splitter = new FourWaySplitter();
- splitter.addBorderLayout(container);
-
- // Add the four necessary panels for Commander Page: 1. Nav,, 2. List, 3. Info, 4. Detail.
- // Nav and info are generic and work across all entities, the others are specific to this entity type.
-
- // 1. Nav Panel:
- NavPanel navPanel = new NavPanel(GlobalIds.NAVPANEL);
- container.add(navPanel);
-
- // 2. List Panel:
- container.add(new AjaxLazyLoadPanel("userlistpanel")
- {
- @Override
- public Component getLazyLoadComponent(String id)
- {
- return new UserListPanel(id);
- }
- });
-
- // 3. Info Panel:
- InfoPanel infoPanel = new InfoPanel( GlobalIds.INFOPANEL );
- Displayable display = infoPanel.getDisplay();
- container.add(infoPanel);
-
- // 4. Detail Panel:
- UserDetailPanel userDetail = new UserDetailPanel("userdetailpanel", display );
- container.add(userDetail);
-
- this.add(container);
- }
-}
\ No newline at end of file
http://git-wip-us.apache.org/repos/asf/directory-fortress-commander/blob/547b9ccd/src/main/java/org/openldap/commander/overview.html
----------------------------------------------------------------------
diff --git a/src/main/java/org/openldap/commander/overview.html b/src/main/java/org/openldap/commander/overview.html
deleted file mode 100755
index 1b9120f..0000000
--- a/src/main/java/org/openldap/commander/overview.html
+++ /dev/null
@@ -1,56 +0,0 @@
-<!--
- ~ This work is part of OpenLDAP Software <http://www.openldap.org/>.
- ~
- ~ Copyright 1998-2014 The OpenLDAP Foundation.
- ~ All rights reserved.
- ~
- ~ Redistribution and use in source and binary forms, with or without
- ~ modification, are permitted only as authorized by the OpenLDAP
- ~ Public License.
- ~
- ~ A copy of this license is available in the file LICENSE in the
- ~ top-level directory of the distribution or, alternatively, at
- ~ <http://www.OpenLDAP.org/license.html>.
- -->
-<html>
- <head>
- <title>Overview of the org.openldap.commander component</title>
- </head>
- <body>
- Commander is a web application that interface with <A HREF="http://www.jts.us/iamfortress/javadocs/api/index.html">Fortress</A> and <A HREF="http://www.openldap.org/">OpenLDAP</A>.
-
- <h2>What technologies are in use?</h2>
-
- Commander was built using established <A HREF="http://www.opensource.org/">Open Source</A> technologies including
- <A HREF="http://wicket.apache.org//">Apache Wicket</A> (Web UI framework), <A HREF="http://www.springsource.org/">Spring Framework</A> (glue), <A HREF="http://maven.apache.org/">Maven</A> (dependencies)
- and runs inside any reasonably compliant Java Servlets container.
-
- Access control decisions are enforced using <A HREF="http://www.jts.us/iamfortress/javadocs/api-sentry/index.html?overview-summary.html">Sentry</A> which itself
- uses declarative <A HREF="http://docs.oracle.com/javaee/5/tutorial/doc/bnbwk.html">Java EE Security</A> and <A HREF="http://static.springsource.org/spring-security/site/">Spring Security</A> policy hooks that are wired to
- connect back to the <A HREF="org/openldap/fortress/rbac/package-summary.html">Fortress</A> <A HREF="http://en.wikipedia.org/wiki/Role-based_access_control">RBAC</A> component.
-
- Fine-grained access control decisions are enforced using <A HREF="http://www.jts.us/iamfortress/javadocs/api/org/openldap/fortress/DelAccessMgr.html">Fortress ARBAC delegated access management.</A>
-
- Commander server-side is a <a href="http://java.sun.com/developer/technicalArticles/tools/webapps_1/">Java Web program</a> artifact and is wholly dependent on <A HREF="http://www.jts.us/iamfortress/javadocs/api/index.html">Fortress</A>
- but also needs a <A HREF="http://en.wikipedia.org/wiki/Lightweight_Directory_Access_Protocol">V3 compliant LDAP</A> server like OpenLDAP. For more information on installing and setting up OpenLDAP check out
- <A HREF="http://www.jts.us/iamfortress/guides/README-QUICKSTART.html">Fortress Quickstart</A>
-
- <h2>What can Commander do?</h2>
-
- Contained within this application are Web pages to perform ANSI RBAC administration along with IETF password policies and viewing the security audit trail and history of changes.
-
- <h2>What are the conditions of use?</h2>
- <p>
- This software development kit is open source, thus free to use and distribute via the <a href="http://www.OpenLDAP.org/license.html">OpenLDAP Public License</a>.
- It was developed and tested on open systems like <a href="http://www.ubuntu.com/">Ubuntu</a> and <a href="http://www.centos.org/">Centos</a> and was helped along
- by the following open source products:
- <ol>
- <li><a href="http://www.openldap.org/project/">The OpenLDAP Project</a></li>
- <li><a href="http://www.apache.org/">The Apache Software Foundation</a></li>
- <li><a href="http://www.unboundid.com/">UnboundID</a></li>
- <li><a href="http://www.eigenbase.org/">The Eigenbase Project</a></li>
- <li><a href="http://ehcache.org/">Ehcache</a></li>
- </ol>
- </p>
- </body>
-</html>
\ No newline at end of file
http://git-wip-us.apache.org/repos/asf/directory-fortress-commander/blob/547b9ccd/src/main/java/org/openldap/commander/panel/AuditAuthzDetailPanel.java
----------------------------------------------------------------------
diff --git a/src/main/java/org/openldap/commander/panel/AuditAuthzDetailPanel.java b/src/main/java/org/openldap/commander/panel/AuditAuthzDetailPanel.java
deleted file mode 100644
index f59a4f9..0000000
--- a/src/main/java/org/openldap/commander/panel/AuditAuthzDetailPanel.java
+++ /dev/null
@@ -1,138 +0,0 @@
-/*
- * This work is part of OpenLDAP Software <http://www.openldap.org/>.
- *
- * Copyright 1998-2014 The OpenLDAP Foundation.
- * All rights reserved.
- *
- * Redistribution and use in source and binary forms, with or without
- * modification, are permitted only as authorized by the OpenLDAP
- * Public License.
- *
- * A copy of this license is available in the file LICENSE in the
- * top-level directory of the distribution or, alternatively, at
- * <http://www.OpenLDAP.org/license.html>.
- */
-
-package org.openldap.commander.panel;
-
-import org.apache.log4j.Logger;
-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.model.CompoundPropertyModel;
-import org.apache.wicket.model.IModel;
-import org.apache.wicket.spring.injection.annot.SpringBean;
-import org.openldap.commander.*;
-import org.openldap.commander.GlobalIds;
-import org.openldap.fortress.*;
-import org.openldap.fortress.rbac.AuthZ;
-import org.openldap.fortress.rbac.User;
-import org.openldap.fortress.util.attr.VUtil;
-
-/**
- * @author Shawn McKinney
- * @version $Rev$
- * Date: 8/6/13
- */
-public class AuditAuthzDetailPanel extends FormComponentPanel
-{
- @SpringBean
- private AuditMgr auditMgr;
- @SpringBean
- private ReviewMgr reviewMgr;
- private static final Logger LOG = Logger.getLogger(AuditAuthzDetailPanel.class.getName());
- private Form detailForm;
- private Displayable display;
- private UserAuditDetailPanel userPanel;
-
- public Form getForm()
- {
- return this.detailForm;
- }
-
- public AuditAuthzDetailPanel( String id, Displayable display )
- {
- super(id);
- this.auditMgr.setAdmin( GlobalUtils.getRbacSession( this ) );
- this.reviewMgr.setAdmin( GlobalUtils.getRbacSession( this ) );
- this.detailForm = new AuditAuthzDetailForm(GlobalIds.DETAIL_FIELDS, new CompoundPropertyModel<AuthZ>(new AuthZ()));
- this.display = display;
- add( detailForm );
- }
-
- public class AuditAuthzDetailForm extends Form
- {
- private Component component;
-
- public AuditAuthzDetailForm(String id, final IModel<AuthZ> model)
- {
- super(id, model);
- add( new Label( GlobalIds.REQ_RESULT ) );
- add( new Label( GlobalIds.REQ_START ) );
- add( new Label( GlobalIds.REQ_ATTR ) );
- add( new Label( GlobalIds.REQ_ATTRS_ONLY ) );
- add( new Label( GlobalIds.REQ_DEREF_ALIASES ) );
- userPanel = new UserAuditDetailPanel( GlobalIds.USERAUDITDETAILPANEL, new CompoundPropertyModel<User>(new User()) );
- add( userPanel );
- setOutputMarkupId( true );
- }
-
- @Override
- public void onEvent(final IEvent<?> event)
- {
- if (event.getPayload() instanceof SelectModelEvent)
- {
- SelectModelEvent modelEvent = (SelectModelEvent) event.getPayload();
- AuthZ authZ = (AuthZ) modelEvent.getEntity();
- this.setModelObject(authZ);
- String msg = "AuthZ: " + authZ.getReqAuthzID() + " has been selected";
- LOG.debug( ".onEvent SelectModelEvent: " + authZ.getReqAuthzID() );
- GlobalUtils.getAuthZPerm(authZ.getReqDN() );
- display.setMessage(msg);
- component = detailForm;
-
- }
- else if (event.getPayload() instanceof AjaxRequestTarget)
- {
- // only add the form to ajax target if something has changed...
- if (component != null)
- {
- AjaxRequestTarget target = ((AjaxRequestTarget) event.getPayload());
- LOG.debug( ".onEvent AjaxRequestTarget: " + target.toString() );
- target.add(component);
- component = null;
- }
- display.display((AjaxRequestTarget) event.getPayload());
- }
- }
-
- @Override
- protected void onBeforeRender()
- {
- if ( getModel() != null )
- {
- User user = null;
- // necessary to push the 'changed' model down into the aggregated panel:
- AuthZ authZ = (AuthZ)detailForm.getModelObject();
- if( VUtil.isNotNullOrEmpty( authZ.getReqAuthzID() ))
- {
- user = GlobalUtils.getUser(reviewMgr, authZ.getReqAuthzID());
- }
- if(user == null)
- {
- user = new User();
- }
- IModel<User> userModel = new CompoundPropertyModel<User>(user);
- userPanel.setDefaultModel( userModel );
- }
- else
- {
- LOG.info( ".onBeforeRender null model object" );
- }
- super.onBeforeRender();
- }
- }
-}