EMBJOPR SVN: r185 - trunk/jbas4.
by embjopr-commits@lists.jboss.org
Author: charles.crouch(a)jboss.com
Date: 2009-03-05 18:07:24 -0500 (Thu, 05 Mar 2009)
New Revision: 185
Modified:
trunk/jbas4/pom.xml
Log:
update to correct version: 1.2.0-SNAPSHOT
Modified: trunk/jbas4/pom.xml
===================================================================
--- trunk/jbas4/pom.xml 2009-03-05 23:07:22 UTC (rev 184)
+++ trunk/jbas4/pom.xml 2009-03-05 23:07:24 UTC (rev 185)
@@ -5,7 +5,7 @@
<parent>
<groupId>org.jboss.jopr</groupId>
<artifactId>jopr-embedded-parent</artifactId>
- <version>1.1.1-SNAPSHOT</version>
+ <version>1.2.0-SNAPSHOT</version>
</parent>
<groupId>org.jboss.jopr</groupId>
15 years, 10 months
EMBJOPR SVN: r184 - trunk/jbas5.
by embjopr-commits@lists.jboss.org
Author: charles.crouch(a)jboss.com
Date: 2009-03-05 18:07:22 -0500 (Thu, 05 Mar 2009)
New Revision: 184
Modified:
trunk/jbas5/pom.xml
Log:
update to correct version: 1.2.0-SNAPSHOT
Modified: trunk/jbas5/pom.xml
===================================================================
--- trunk/jbas5/pom.xml 2009-03-05 23:07:20 UTC (rev 183)
+++ trunk/jbas5/pom.xml 2009-03-05 23:07:22 UTC (rev 184)
@@ -5,7 +5,7 @@
<parent>
<groupId>org.jboss.jopr</groupId>
<artifactId>jopr-embedded-parent</artifactId>
- <version>1.1.1-SNAPSHOT</version>
+ <version>1.2.0-SNAPSHOT</version>
</parent>
<groupId>org.jboss.jopr</groupId>
15 years, 10 months
EMBJOPR SVN: r183 - trunk/core.
by embjopr-commits@lists.jboss.org
Author: charles.crouch(a)jboss.com
Date: 2009-03-05 18:07:20 -0500 (Thu, 05 Mar 2009)
New Revision: 183
Modified:
trunk/core/pom.xml
Log:
update to correct version: 1.2.0-SNAPSHOT
Modified: trunk/core/pom.xml
===================================================================
--- trunk/core/pom.xml 2009-03-05 22:18:16 UTC (rev 182)
+++ trunk/core/pom.xml 2009-03-05 23:07:20 UTC (rev 183)
@@ -23,12 +23,12 @@
<parent>
<groupId>org.jboss.jopr</groupId>
<artifactId>jopr-embedded-parent</artifactId>
- <version>1.1.1-SNAPSHOT</version>
+ <version>1.2.0-SNAPSHOT</version>
</parent>
<groupId>org.jboss.jopr</groupId>
<artifactId>jopr-embedded-core</artifactId>
- <version>1.1.1-SNAPSHOT</version>
+ <version>1.2.0-SNAPSHOT</version>
<packaging>war</packaging>
<name>Embedded Jopr Core</name>
<description>a web application that provides administration and monitoring of the app server instance to which it is deployed</description>
@@ -263,7 +263,7 @@
</execution>
</executions>
</plugin>
-
+
<plugin>
<artifactId>maven-war-plugin</artifactId>
<configuration>
15 years, 10 months
EMBJOPR SVN: r182 - trunk/jsfunit/testdata/jboss-configuration/conf/props.
by embjopr-commits@lists.jboss.org
Author: ozizka(a)redhat.com
Date: 2009-03-05 17:18:16 -0500 (Thu, 05 Mar 2009)
New Revision: 182
Added:
trunk/jsfunit/testdata/jboss-configuration/conf/props/jmx-console-roles.properties
Modified:
trunk/jsfunit/testdata/jboss-configuration/conf/props/jmx-console-users.properties
Log:
* Added admin2/admin2 user with same roles as admin
Added: trunk/jsfunit/testdata/jboss-configuration/conf/props/jmx-console-roles.properties
===================================================================
--- trunk/jsfunit/testdata/jboss-configuration/conf/props/jmx-console-roles.properties (rev 0)
+++ trunk/jsfunit/testdata/jboss-configuration/conf/props/jmx-console-roles.properties 2009-03-05 22:18:16 UTC (rev 182)
@@ -0,0 +1,3 @@
+# A sample roles.properties file for use with the UsersRolesLoginModule
+admin=JBossAdmin,HttpInvoker
+admin2=JBossAdmin,HttpInvoker
\ No newline at end of file
Modified: trunk/jsfunit/testdata/jboss-configuration/conf/props/jmx-console-users.properties
===================================================================
--- trunk/jsfunit/testdata/jboss-configuration/conf/props/jmx-console-users.properties 2009-03-05 22:16:11 UTC (rev 181)
+++ trunk/jsfunit/testdata/jboss-configuration/conf/props/jmx-console-users.properties 2009-03-05 22:18:16 UTC (rev 182)
@@ -1,2 +1,3 @@
# A sample users.properties file for use with the UsersRolesLoginModule
admin=admin
+admin2=admin2
15 years, 10 months
EMBJOPR SVN: r181 - in trunk/jsfunit/testdata/jboss-configuration/conf: props and 1 other directory.
by embjopr-commits@lists.jboss.org
Author: ozizka(a)redhat.com
Date: 2009-03-05 17:16:11 -0500 (Thu, 05 Mar 2009)
New Revision: 181
Added:
trunk/jsfunit/testdata/jboss-configuration/conf/props/
trunk/jsfunit/testdata/jboss-configuration/conf/props/jmx-console-users.properties
Log:
* Added jmx-console-users.properties for Cargo JBoss conf
Added: trunk/jsfunit/testdata/jboss-configuration/conf/props/jmx-console-users.properties
===================================================================
--- trunk/jsfunit/testdata/jboss-configuration/conf/props/jmx-console-users.properties (rev 0)
+++ trunk/jsfunit/testdata/jboss-configuration/conf/props/jmx-console-users.properties 2009-03-05 22:16:11 UTC (rev 181)
@@ -0,0 +1,2 @@
+# A sample users.properties file for use with the UsersRolesLoginModule
+admin=admin
15 years, 10 months
EMBJOPR SVN: r180 - trunk/jsfunit/testdata/ear.
by embjopr-commits@lists.jboss.org
Author: ozizka(a)redhat.com
Date: 2009-03-05 17:13:41 -0500 (Thu, 05 Mar 2009)
New Revision: 180
Added:
trunk/jsfunit/testdata/ear/unpacked-ear1.ear.zip
Log:
* Added unpacked ear in zip
Added: trunk/jsfunit/testdata/ear/unpacked-ear1.ear.zip
===================================================================
(Binary files differ)
Property changes on: trunk/jsfunit/testdata/ear/unpacked-ear1.ear.zip
___________________________________________________________________
Name: svn:mime-type
+ application/octet-stream
15 years, 10 months
EMBJOPR SVN: r179 - trunk/core/src/main/java/org/jboss/on/embedded/ui/configuration/resource.
by embjopr-commits@lists.jboss.org
Author: charles.crouch(a)jboss.com
Date: 2009-03-05 16:42:33 -0500 (Thu, 05 Mar 2009)
New Revision: 179
Modified:
trunk/core/src/main/java/org/jboss/on/embedded/ui/configuration/resource/ResourceConfigurationUIBean.java
Log:
EMBJOPR-86 @End(ifOutcome... wasnt working so replace it with Conversation.end()
Modified: trunk/core/src/main/java/org/jboss/on/embedded/ui/configuration/resource/ResourceConfigurationUIBean.java
===================================================================
--- trunk/core/src/main/java/org/jboss/on/embedded/ui/configuration/resource/ResourceConfigurationUIBean.java 2009-03-05 19:01:00 UTC (rev 178)
+++ trunk/core/src/main/java/org/jboss/on/embedded/ui/configuration/resource/ResourceConfigurationUIBean.java 2009-03-05 21:42:33 UTC (rev 179)
@@ -41,6 +41,7 @@
import org.jboss.seam.annotations.Name;
import org.jboss.seam.annotations.Out;
import org.jboss.seam.annotations.Scope;
+import org.jboss.seam.core.Conversation;
import org.jboss.seam.faces.FacesMessages;
import javax.faces.application.FacesMessage;
@@ -157,7 +158,6 @@
*
* @return String Results of the save success or failure.
*/
- @End(ifOutcome={"success, cancel"}, beforeRedirect = true)
public String saveConfiguration()
{
String result = Constants.OUTCOME_FAILURE;
@@ -174,6 +174,10 @@
break;
}
}
+
+ if (result == "success") {
+ Conversation.instance().end(true);
+ }
return result;
}
15 years, 10 months
EMBJOPR SVN: r178 - trunk/core/src/main/webapp/include.
by embjopr-commits@lists.jboss.org
Author: ozizka(a)redhat.com
Date: 2009-03-05 14:01:00 -0500 (Thu, 05 Mar 2009)
New Revision: 178
Modified:
trunk/core/src/main/webapp/include/header.xhtml
Log:
* ID added to the logout link
Modified: trunk/core/src/main/webapp/include/header.xhtml
===================================================================
--- trunk/core/src/main/webapp/include/header.xhtml 2009-03-05 18:37:15 UTC (rev 177)
+++ trunk/core/src/main/webapp/include/header.xhtml 2009-03-05 19:01:00 UTC (rev 178)
@@ -45,7 +45,7 @@
</h:outputText>
<h:outputText rendered="#{empty identity.username}">
#{messages['security.NotLoggedIn']}
- [<s:link action="/login.xhtml">#{messages['security.login']}</s:link>]
+ [<s:link id="logoutLink" action="/login.xhtml">#{messages['security.login']}</s:link>]
</h:outputText>
<ui:remove>
<!-- Disable the Help link until we actually have some online help to link to. -->
15 years, 10 months
EMBJOPR SVN: r177 - trunk/jsfunit/src/test/java/org/jboss/jopr/jsfunit.
by embjopr-commits@lists.jboss.org
Author: ozizka(a)redhat.com
Date: 2009-03-05 13:37:15 -0500 (Thu, 05 Mar 2009)
New Revision: 177
Added:
trunk/jsfunit/src/test/java/org/jboss/jopr/jsfunit/MultipleUserLoginTest.java
Log:
* Multiple login test; JBQA-1939
Added: trunk/jsfunit/src/test/java/org/jboss/jopr/jsfunit/MultipleUserLoginTest.java
===================================================================
--- trunk/jsfunit/src/test/java/org/jboss/jopr/jsfunit/MultipleUserLoginTest.java (rev 0)
+++ trunk/jsfunit/src/test/java/org/jboss/jopr/jsfunit/MultipleUserLoginTest.java 2009-03-05 18:37:15 UTC (rev 177)
@@ -0,0 +1,149 @@
+/*
+ * JBoss, Home of Professional Open Source.
+ * Copyright 2008, Red Hat Middleware LLC, and individual contributors
+ * as indicated by the @author tags. See the copyright.txt file in the
+ * distribution for a full listing of individual contributors.
+ *
+ * This is free software; you can redistribute it and/or modify it
+ * under the terms of the GNU Lesser General Public License as
+ * published by the Free Software Foundation; either version 2.1 of
+ * the License, or (at your option) any later version.
+ *
+ * This software is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ * Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public
+ * License along with this software; if not, write to the Free
+ * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
+ * 02110-1301 USA, or see the FSF site: http://www.fsf.org.
+ */
+
+package org.jboss.jopr.jsfunit;
+
+import com.gargoylesoftware.htmlunit.BrowserVersion;
+import java.io.IOException;
+import junit.framework.Test;
+import junit.framework.TestSuite;
+import org.jboss.jsfunit.framework.WebClientSpec;
+import org.jboss.jsfunit.jsfsession.JSFClientSession;
+import org.jboss.jsfunit.jsfsession.JSFServerSession;
+import org.jboss.jsfunit.jsfsession.JSFSession;
+
+/**
+ * Test of multiple user parallel login.
+ *
+ * @author Ondrej Zizka
+ */
+public class MultipleUserLoginTest extends EmbjoprTestCase
+{
+
+ // Credentials
+ private static final String USER_A = "admin";
+ private static final String PASS_A = "admin";
+ private static final String USER_B = "admin2";
+ private static final String PASS_B = "admin2";
+
+
+ /**
+ * @return the suite of tests being tested
+ */
+ public static Test suite() {
+ return new TestSuite( MultipleUserLoginTest.class );
+ }
+
+ public void setUp() throws IOException
+ {
+
+ // Announce this test in the JBoss log.
+ log.info("========================================================================================");
+ log.info(" Setting up test "+this.getClass().getName()+"#"+this.getName());
+ log.info("========================================================================================");
+
+
+ // JVM version
+ log.info("Java version: "+System.getProperty("java.version") + "," +
+ " vendor: " +System.getProperty("java.vendor"));
+ log.info("Java home: " +System.getProperty("java.home"));
+
+ // JBoss AS version
+ String version = Package.getPackage("org.jboss.system.server")
+ .getImplementationVersion();
+ log.info("Detected AS version: " + version);
+ isJBoss4 = version.startsWith("4");
+
+ // Contrary to super class, skip the session creation in setUp().
+
+ }
+
+ /**
+ * Instance of JSF session. Keeps server and client session parts, and user's name and pass.
+ */
+ class SessionInstance {
+
+ protected JSFClientSession client;
+ protected JSFServerSession server;
+ protected String user;
+ protected String pass;
+
+ /** Creates new JSF session, using JoprLoginStrategy. */
+ public SessionInstance(String user, String pass) throws IOException {
+
+ // Code taken from EmbJoprTestCase.java.
+ // Initial JSF request
+ WebClientSpec wcSpec = new WebClientSpec("/", BrowserVersion.FIREFOX_3);
+ wcSpec.getWebClient().setThrowExceptionOnFailingStatusCode(false);
+ wcSpec.getWebClient().setConfirmHandler(new SimpleConfirmHandler(true));
+ wcSpec.setInitialRequestStrategy(new JoprLoginStrategy(user, pass)); // logs in
+ JSFSession jsfSession = new JSFSession(wcSpec);
+ this.client = jsfSession.getJSFClientSession();
+ this.server = jsfSession.getJSFServerSession();
+ }
+
+ public JSFClientSession getClient() { return client; }
+ public JSFServerSession getServer() { return server; }
+ public String getUser() { return user; }
+ public String getPass() { return pass; }
+
+ }
+
+
+ /**
+ * Logs in using several
+ * @throws java.io.IOException
+ */
+ public void testMultipleUsersLogin() throws IOException
+ {
+
+ // USER A.
+
+ log.info("Logging in with first user, '"+USER_A+"'");
+
+ SessionInstance sessA = new SessionInstance(USER_A, PASS_A);
+
+ assertTrue( sessA.client.getPageAsText().contains(USER_A) );
+ assertTrue( sessA.client.getPageAsText().contains("Logout") );
+
+ assertEquals("JSF's '#{identity.username}' should be the user name.",
+ USER_A, sessA.server.getManagedBeanValue("#{identity.username}") );
+
+
+ // USER B.
+
+ log.info("Logging in with second user, '"+USER_B+"'");
+
+ SessionInstance sessB = new SessionInstance(USER_B, PASS_B);
+
+ assertTrue("Page doesn't contain user's name.", sessB.client.getPageAsText().contains(USER_B) );
+ assertTrue("Page doesn't contain 'Logout'.", sessB.client.getPageAsText().contains("Logout") );
+
+ assertEquals("JSF's '#{identity.username}' should be the user name.",
+ USER_B, sessB.server.getManagedBeanValue("#{identity.username}") );
+
+ }
+
+
+
+
+}
\ No newline at end of file
15 years, 10 months
EMBJOPR SVN: r176 - trunk/core/src/main/java/org/jboss/on/embedded/ui.
by embjopr-commits@lists.jboss.org
Author: charles.crouch(a)jboss.com
Date: 2009-03-04 18:31:10 -0500 (Wed, 04 Mar 2009)
New Revision: 176
Added:
trunk/core/src/main/java/org/jboss/on/embedded/ui/NavigationContent.java
Modified:
trunk/core/src/main/java/org/jboss/on/embedded/ui/NavigationAction.java
Log:
EMBJOPR-62 make rootNode APPLICATION scoped
Modified: trunk/core/src/main/java/org/jboss/on/embedded/ui/NavigationAction.java
===================================================================
--- trunk/core/src/main/java/org/jboss/on/embedded/ui/NavigationAction.java 2009-03-03 21:39:27 UTC (rev 175)
+++ trunk/core/src/main/java/org/jboss/on/embedded/ui/NavigationAction.java 2009-03-04 23:31:10 UTC (rev 176)
@@ -121,10 +121,8 @@
return baseUrl;
}
-
- // used by resourceNavigation.xhtml to render the nav
- @In(value = "rootNode", create=true)
- @Out(value = "rootNode", scope = ScopeType.SESSION)
+
+ @In(value = "rootNode", create=true)
private JONTreeNode rootNode;
// Its only SummaryAction.getResourceTypePath which needs this to be public
@@ -134,34 +132,24 @@
return rootNode;
}
- @Factory(value = "rootNode", scope=ScopeType.SESSION)
- public JONTreeNode createJONTreeNode() {
- log.debug("createJONTreeNode factory method being called.");
- DummyTreeNode dummy = new DummyTreeNode();
- PlatformResourceTreeNode platform = new PlatformResourceTreeNode(ResourceManagerFactory.resourceManager().getPlatform());
- dummy.addChild(platform);
- Events.instance().raiseEvent(ResourceManager.NAV_TREE_INITIALIZED);
- return dummy;
- }
+// @Out(value = "navTree", required = false, scope = ScopeType.EVENT)
+// public HtmlTree getNavTree()
+// {
+//// if (navTree == null)
+//// {
+//// navTree = buildNavTree();
+//// }
+// return navTree;
+// }
+//
+// @In(value = "navTree", required = false, scope = ScopeType.EVENT)
+// public void setNavTree(HtmlTree navTree)
+// {
+// this.navTree = navTree;
+// }
+//
+// private HtmlTree navTree;
- @Out(value = "navTree", required = false, scope = ScopeType.EVENT)
- public HtmlTree getNavTree()
- {
-// if (navTree == null)
-// {
-// navTree = buildNavTree();
-// }
- return navTree;
- }
-
- @In(value = "navTree", required = false, scope = ScopeType.EVENT)
- public void setNavTree(HtmlTree navTree)
- {
- this.navTree = navTree;
- }
-
- private HtmlTree navTree;
-
// @Factory("navTree")
// public HtmlTree buildNavTree()
// {
@@ -441,39 +429,7 @@
{
return getResourcePath(resource.getId());
}
-
- @Observer(ResourceManager.RESOURCE_CREATED_EVENT)
- public void updateNavWithNewResource(ResourceType typeOfNewResource, Resource parentResource)
- {
- log.info("Resource of type [" + typeOfNewResource + "] added beneath Resource [" + parentResource + "].");
- JONTreeNode parentNode = findNode(getResourcePath(parentResource));
- JONTreeNode node = findNodeByResourceTypeAndParent(typeOfNewResource, parentNode);
- node.reInitializeChildrenMap();
- }
-
- @Observer(ResourceManager.RESOURCE_DELETED_EVENT)
- public void updateNavWithDeletedResource(Resource deletedResource)
- {
- log.info("Resource [" + deletedResource + "] deleted.");
- JONTreeNode node = findNode(getResourcePath(deletedResource));
- if (node == null)
- {
- log.warn("Unable to find node for deleted resource [" + deletedResource + "].");
- return;
- }
- JONTreeNode parentNode = node.getParent();
- parentNode.reInitializeChildrenMap();
- }
- @Observer(ResourceManager.RESOURCE_UPDATED_EVENT)
- public void updateNavWithUpdatedResource(Resource updatedResource)
- {
- // doesn't do anything right now, but in the future this could
- // regenerate the nav similar to how updateNavWithDeletedResource
- // does it. This would catch any resource renames that happened
- // as part of the update
- }
-
// TODO consider have this return TreeNodeWithResourceType
public ResourceTypeTreeNode findNodeByResourceTypeAndParent(ResourceType resourceType, JONTreeNode parentResourceNode)
{
Added: trunk/core/src/main/java/org/jboss/on/embedded/ui/NavigationContent.java
===================================================================
--- trunk/core/src/main/java/org/jboss/on/embedded/ui/NavigationContent.java (rev 0)
+++ trunk/core/src/main/java/org/jboss/on/embedded/ui/NavigationContent.java 2009-03-04 23:31:10 UTC (rev 176)
@@ -0,0 +1,128 @@
+/*
+ * Embedded Jopr Project
+ * Copyright (C) 2006-2008 Red Hat, Inc.
+ * All rights reserved.
+ *
+ * This program is free software; you can redistribute it and/or modify
+ * it under the terms of the GNU Lesser General Public License as
+ * published by the Free Software Foundation; either version 2.1 of
+ * the License, or (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ * Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public
+ * License along with this program; if not, write to the Free Software
+ * Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
+ */
+package org.jboss.on.embedded.ui;
+
+import org.apache.commons.logging.Log;
+import org.apache.commons.logging.LogFactory;
+import org.jboss.on.embedded.manager.ResourceManager;
+import org.jboss.on.embedded.manager.ResourceManagerFactory;
+import org.jboss.on.embedded.ui.nav.BaseTreeNode;
+import org.jboss.on.embedded.ui.nav.DummyTreeNode;
+import org.jboss.on.embedded.ui.nav.JONTreeNode;
+import org.jboss.on.embedded.ui.nav.PlatformResourceTreeNode;
+import org.jboss.on.embedded.ui.nav.ResourceTypeTreeNode;
+import org.jboss.seam.ScopeType;
+import org.jboss.seam.annotations.Factory;
+import org.jboss.seam.annotations.In;
+import org.jboss.seam.annotations.Name;
+import org.jboss.seam.annotations.Observer;
+import org.jboss.seam.annotations.Out;
+import org.jboss.seam.core.Events;
+import org.rhq.core.domain.resource.Resource;
+import org.rhq.core.domain.resource.ResourceType;
+
+/**
+ * NavigationContent class encapsulates the JONTreeNode object which
+ * contains the objects rendered in the navigation tree.
+ * Contains the methods which will update this structure as resources are added/deleted
+ *
+ * @author Charles Crouch
+ */
+@Name("navigationContent")
+public class NavigationContent
+{
+ private static final Log log = LogFactory.getLog(NavigationContent.class);
+
+ // used by resourceNavigation.xhtml to render the nav
+ @In(value = "rootNode", create=true)
+ @Out(value = "rootNode", scope = ScopeType.APPLICATION)
+ private JONTreeNode rootNode;
+
+ @Factory(value = "rootNode")
+ public JONTreeNode createJONTreeNode() {
+ log.debug("createJONTreeNode factory method being called.");
+ DummyTreeNode dummy = new DummyTreeNode();
+ PlatformResourceTreeNode platform = new PlatformResourceTreeNode(ResourceManagerFactory.resourceManager().getPlatform());
+ dummy.addChild(platform);
+ Events.instance().raiseEvent(ResourceManager.NAV_TREE_INITIALIZED);
+ return dummy;
+ }
+
+ @Observer(ResourceManager.RESOURCE_CREATED_EVENT)
+ public void updateNavWithNewResource(ResourceType typeOfNewResource, Resource parentResource)
+ {
+ log.info("Resource of type [" + typeOfNewResource + "] added beneath Resource [" + parentResource + "].");
+ JONTreeNode parentNode = findNode(getResourcePath(parentResource));
+ JONTreeNode node = findNodeByResourceTypeAndParent(typeOfNewResource, parentNode);
+ node.reInitializeChildrenMap();
+ }
+
+ @Observer(ResourceManager.RESOURCE_DELETED_EVENT)
+ public void updateNavWithDeletedResource(Resource deletedResource)
+ {
+ log.info("Resource [" + deletedResource + "] deleted.");
+ JONTreeNode node = findNode(getResourcePath(deletedResource));
+ if (node == null)
+ {
+ log.warn("Unable to find node for deleted resource [" + deletedResource + "].");
+ return;
+ }
+ JONTreeNode parentNode = node.getParent();
+ parentNode.reInitializeChildrenMap();
+ }
+
+ @Observer(ResourceManager.RESOURCE_UPDATED_EVENT)
+ public void updateNavWithUpdatedResource(Resource updatedResource)
+ {
+ // doesn't do anything right now, but in the future this could
+ // regenerate the nav similar to how updateNavWithDeletedResource
+ // does it. This would catch any resource renames that happened
+ // as part of the update
+ }
+
+ // the following methods are all copied from NavigationAction
+
+ private JONTreeNode findNode(String path)
+ {
+ return rootNode.findNode(path);
+ }
+
+ // TODO consider have this return TreeNodeWithResourceType
+ private ResourceTypeTreeNode findNodeByResourceTypeAndParent(ResourceType resourceType, JONTreeNode parentResourceNode)
+ {
+ return ((BaseTreeNode) parentResourceNode).findNodeByType(resourceType);
+ }
+
+ private String getResourcePath(Resource resource)
+ {
+ return getResourcePath(resource.getId());
+ }
+
+ private String getResourcePath(Integer resourceId)
+ {
+ // this just happens to be the current implementation for generating the path
+ // if we wanted to change it, we just need to change the methods in this class
+ // and ResourceTreeNode
+ // TODO this could call a static method on ResourceTreeNode to keep this
+ // implementation better encapsulated
+ return String.valueOf(resourceId);
+ }
+
+}
15 years, 10 months