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 2022/04/11 03:56:12 UTC
[directory-fortress-commander] branch wicket9 updated: more cleanup, remove extraneous jetty and other artifacts
This is an automated email from the ASF dual-hosted git repository.
smckinney pushed a commit to branch wicket9
in repository https://gitbox.apache.org/repos/asf/directory-fortress-commander.git
The following commit(s) were added to refs/heads/wicket9 by this push:
new cbb36ca more cleanup, remove extraneous jetty and other artifacts
cbb36ca is described below
commit cbb36caf918e7cdabc602bf400b48c5349f2eb1e
Author: Shawn McKinney <sm...@symas.com>
AuthorDate: Sun Apr 10 22:56:06 2022 -0500
more cleanup, remove extraneous jetty and other artifacts
---
.../directory/fortress/web/ContextMenuPage.java | 127 ---------------------
.../fortress/web/FortressWebBasePage.java | 25 +---
.../directory/fortress/web/common/GlobalIds.java | 1 -
.../directory/fortress/web/ContextMenuPage.html | 51 ---------
src/test/resources/jetty-users.properties | 38 ------
.../wicketPathLocatorBuilder/user-extension.js | 29 -----
6 files changed, 6 insertions(+), 265 deletions(-)
diff --git a/src/main/java/org/apache/directory/fortress/web/ContextMenuPage.java b/src/main/java/org/apache/directory/fortress/web/ContextMenuPage.java
deleted file mode 100644
index a7dcd33..0000000
--- a/src/main/java/org/apache/directory/fortress/web/ContextMenuPage.java
+++ /dev/null
@@ -1,127 +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.
- *
- */
-package org.apache.directory.fortress.web;
-
-
-import com.googlecode.wicket.jquery.ui.JQueryIcon;
-import com.googlecode.wicket.jquery.ui.widget.menu.MenuItem;
-import org.apache.wicket.Component;
-import org.apache.wicket.ajax.AjaxRequestTarget;
-import org.apache.wicket.markup.html.basic.Label;
-
-import com.googlecode.wicket.jquery.ui.widget.menu.ContextMenu;
-import com.googlecode.wicket.jquery.ui.widget.menu.ContextMenuBehavior;
-import com.googlecode.wicket.jquery.ui.widget.menu.IMenuItem;
-import org.apache.wicket.model.Model;
-
-import java.util.ArrayList;
-import java.util.List;
-
-/**
- *
- * @author Kevin McKinney
- * @version $Rev$
- */
-public class ContextMenuPage extends FortressWebBasePage
-{
- private static final long serialVersionUID = 1L;
-
- public ContextMenuPage()
- {
- // Menu //
- final ContextMenu menu = new ContextMenu( "menu", newMenuList() )
- {
-
- private static final long serialVersionUID = 1L;
-
- @Override
- protected void onContextMenu( AjaxRequestTarget target, Component component )
- {
- //the menu-item list can be modified here
- //this.getItemList().add(new MenuItem("my new item"));
- }
-
- @Override
- public void onClick( AjaxRequestTarget target, IMenuItem item )
- {
- this.debug( "Clicked " + item.getTitle().getObject() );
-
- target.add( this );
- //target.add(feedback);
- }
- };
-
- this.add( menu );
-
- // Labels //
- final Label label1 = new Label( "label1", "my label 1" );
- label1.add( new ContextMenuBehavior( menu ) );
- this.add( label1 );
-
- final Label label2 = new Label( "label2", "my label 2" );
- label2.add( new ContextMenuBehavior( menu ) );
- this.add( label2 );
- }
-
- private List<IMenuItem> newMenuList()
- {
- List<IMenuItem> list = new ArrayList<>();
-
- list.add( new MenuItem( "Item with icon", JQueryIcon.FLAG ) );
- list.add( new MenuItem( "Change the title" )
- {
-
- private static final long serialVersionUID = 1L;
-
- @Override
- public void onClick( AjaxRequestTarget target )
- {
- this.setTitle( Model.of( "Title changed!" ) );
- }
- } );
- list.add( new MenuItem( "Another menu item" ) );
- list.add( new MenuItem( "Menu item, with sub-menu", JQueryIcon.BOOKMARK,
- this.newSubMenuList() ) ); // css-class are also allowed
- list.add( new MenuItem( "Desactivate me" )
- {
-
- private static final long serialVersionUID = 1L;
-
- @Override
- public void onClick( AjaxRequestTarget target )
- {
- this.setEnabled( false );
- }
- } );
-
- return list;
- }
-
- private List<IMenuItem> newSubMenuList()
- {
- List<IMenuItem> list = new ArrayList<>();
-
- list.add( new MenuItem( "Sub-menu #1" ) );
- list.add( new MenuItem( "Sub-menu #2" ) );
- list.add( new MenuItem( "Sub-menu #3" ) );
-
- return list;
- }
-}
diff --git a/src/main/java/org/apache/directory/fortress/web/FortressWebBasePage.java b/src/main/java/org/apache/directory/fortress/web/FortressWebBasePage.java
index da6134a..67354ff 100644
--- a/src/main/java/org/apache/directory/fortress/web/FortressWebBasePage.java
+++ b/src/main/java/org/apache/directory/fortress/web/FortressWebBasePage.java
@@ -186,28 +186,15 @@ public abstract class FortressWebBasePage extends WebPage
// Here the principal was created by fortress realm and is a serialized instance of {@link Session}.
String szPrincipal = principal.toString();
Session session = null;
-
- String szIsJetty = System.getProperty( org.apache.directory.fortress.web.common.GlobalIds.IS_JETTY_SERVER );
- boolean isJetty = false;
- if( StringUtils.isNotEmpty( szIsJetty ))
+ try
{
- if ( szIsJetty.equalsIgnoreCase( "true" ) )
- {
- isJetty = true;
- }
+ // Deserialize the principal string into a fortress session:
+ session = j2eePolicyMgr.deserialize( szPrincipal );
}
- if( !isJetty )
+ catch(SecurityException se)
{
- try
- {
- // Deserialize the principal string into a fortress session:
- session = j2eePolicyMgr.deserialize( szPrincipal );
- }
- catch(SecurityException se)
- {
- // Can't recover....
- throw new RuntimeException( se );
- }
+ // Can't recover....
+ throw new RuntimeException( se );
}
// If this is null, it means this app cannot share an rbac session with container and must now (re)create session here:
diff --git a/src/main/java/org/apache/directory/fortress/web/common/GlobalIds.java b/src/main/java/org/apache/directory/fortress/web/common/GlobalIds.java
index af1b6f1..8036954 100644
--- a/src/main/java/org/apache/directory/fortress/web/common/GlobalIds.java
+++ b/src/main/java/org/apache/directory/fortress/web/common/GlobalIds.java
@@ -233,6 +233,5 @@ public class GlobalIds
public static final String ROLES_SEARCH = "roles.search";
public static final String FIELD_2 = "field2";
public static final String FIELD_1 = "field1";
- public static final String IS_JETTY_SERVER = "is-jetty-server";
public static final String CONTEXT_ID_PROPERTY = "contextId";
}
diff --git a/src/main/resources/org/apache/directory/fortress/web/ContextMenuPage.html b/src/main/resources/org/apache/directory/fortress/web/ContextMenuPage.html
deleted file mode 100644
index dbf4ce9..0000000
--- a/src/main/resources/org/apache/directory/fortress/web/ContextMenuPage.html
+++ /dev/null
@@ -1,51 +0,0 @@
-<!DOCTYPE html>
-<!--
- 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:wicket="http://wicket.apache.org">
-<head>
- <wicket:head>
- <title>Wicket - jQuery UI: Context Menu</title>
- <style type="text/css">
- /* labels */
- .label {
- margin: 10px;
- text-decoration: underline;
- }
-
- /* sub menus */
- .ui-menu .ui-menu {
- width: 150px;
- }
- </style>
- </wicket:head>
-</head>
-<body>
-
-<wicket:extend>
- <div id="wrapper-panel-frame" class="ui-corner-all">
- <span wicket:id="label1" class="label"></span> <span wicket:id="label2" class="label"></span><br/>
-
- <div wicket:id="menu" style="width: 200px;"></div>
- <br/>
- </div>
-
-</wicket:extend>
-</body>
-</html>
diff --git a/src/test/resources/jetty-users.properties b/src/test/resources/jetty-users.properties
deleted file mode 100644
index d9f7ac8..0000000
--- a/src/test/resources/jetty-users.properties
+++ /dev/null
@@ -1,38 +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.
-#
-
-test: password,ROLE_ADMIN,ROLE_USERS,ROLE_ROLES,ROLE_PERMS,ROLE_SSDS,ROLE_DSDS,ROLE_POLICIES,ROLE_USEROUS,ROLE_PERMOUS,ROLE_PERMOBJS,ROLE_ADMINOBJS,ROLE_ADMINPERMS,ROLE_ADMINROLES,ROLE_AUDIT_AUTHZS,ROLE_AUDIT_MODS,ROLE_AUDIT_BINDS,ROLE_GROUPS
-foo1: password,ROLE_ADMIN,ROLE_USERS,ROLE_ROLES,ROLE_PERMS,ROLE_SSDS,ROLE_DSDS,ROLE_POLICIES,ROLE_USEROUS,ROLE_PERMOUS,ROLE_PERMOBJS,ROLE_ADMINOBJS,ROLE_ADMINPERMS,ROLE_ADMINROLES,ROLE_AUDIT_AUTHZS,ROLE_AUDIT_MODS,ROLE_AUDIT_BINDS
-foo2: password,ROLE_ADMIN,ROLE_USERS,ROLE_ROLES,ROLE_PERMS,ROLE_SSDS,ROLE_DSDS,ROLE_POLICIES,ROLE_USEROUS,ROLE_PERMOUS,ROLE_PERMOBJS,ROLE_ADMINOBJS,ROLE_ADMINPERMS,ROLE_ADMINROLES,ROLE_AUDIT_AUTHZS,ROLE_AUDIT_MODS,ROLE_AUDIT_BINDS
-foo3: password,ROLE_ADMIN,ROLE_USERS,ROLE_ROLES,ROLE_PERMS,ROLE_SSDS,ROLE_DSDS,ROLE_POLICIES,ROLE_USEROUS,ROLE_PERMOUS,ROLE_PERMOBJS,ROLE_ADMINOBJS,ROLE_ADMINPERMS,ROLE_ADMINROLES,ROLE_AUDIT_AUTHZS,ROLE_AUDIT_MODS,ROLE_AUDIT_BINDS
-user: user,ROLE_USERS
-role: role,ROLE_ROLES
-perm: perm,ROLE_PERMS
-ssd: ssd,ROLE_SSDS
-dsd: dsd,ROLE_DSDS
-policy: policy,ROLE_POLICIES
-userou: userou,ROLE_USEROUS
-permou: permou,ROLE_PERMOUS
-permobj: permobj,ROLE_PERMOBJS
-adminobj: adminobj,ROLE_ADMINOBJS
-adminperm: adminperm,ROLE_ADMINPERMS
-adminrole: adminrole,ROLE_ADMINROLES
-authzs: authz,ROLE_AUDIT_AUTHZS
-mods: mod,ROLE_AUDIT_MODS
-binds: bind,ROLE_AUDIT_BINDS
\ No newline at end of file
diff --git a/src/test/resources/wicketPathLocatorBuilder/user-extension.js b/src/test/resources/wicketPathLocatorBuilder/user-extension.js
deleted file mode 100644
index 035fa93..0000000
--- a/src/test/resources/wicketPathLocatorBuilder/user-extension.js
+++ /dev/null
@@ -1,29 +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.
-#
-LocatorBuilders.add('wicketpath', function(e) {
- this.log.debug("wicketpath: e=" + e);
- if (e.attributes && e.hasAttribute("wicketpath")) {
- this.log.info("found attribute " + e.getAttribute("wicketpath"));
- return "//" + this.xpathHtmlElement(e.nodeName.toLowerCase()) +
- "[@wicketpath=" + this.attributeValue(e.getAttribute("wicketpath")) + "]";
- }
- return null;
- });
-
-LocatorBuilders.order.unshift(LocatorBuilders.order.pop());
\ No newline at end of file