Author: julien(a)jboss.com
Date: 2007-04-29 18:11:01 -0400 (Sun, 29 Apr 2007)
New Revision: 7135
Added:
trunk/core/src/main/org/jboss/portal/core/impl/api/node/AbstractPortalNodeURL.java
trunk/core/src/main/org/jboss/portal/core/impl/api/node/PageURL.java
trunk/core/src/main/org/jboss/portal/core/impl/api/node/WindowURL.java
Modified:
trunk/core/src/main/org/jboss/portal/core/impl/api/node/PortalNodeURLFactory.java
Log:
transform inner classes into outter classes
Added: trunk/core/src/main/org/jboss/portal/core/impl/api/node/AbstractPortalNodeURL.java
===================================================================
--- trunk/core/src/main/org/jboss/portal/core/impl/api/node/AbstractPortalNodeURL.java
(rev 0)
+++
trunk/core/src/main/org/jboss/portal/core/impl/api/node/AbstractPortalNodeURL.java 2007-04-29
22:11:01 UTC (rev 7135)
@@ -0,0 +1,93 @@
+/******************************************************************************
+ * JBoss, a division of Red Hat *
+ * Copyright 2006, Red Hat Middleware, LLC, and individual *
+ * contributors as indicated by the @authors tag. See the *
+ * copyright.txt 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.portal.core.impl.api.node;
+
+import org.jboss.portal.api.node.PortalNodeURL;
+import org.jboss.portal.core.model.portal.PortalObjectId;
+import org.jboss.portal.core.controller.ControllerContext;
+import org.jboss.portal.portlet.PortletParametersStateString;
+import org.jboss.portal.server.request.URLContext;
+
+/**
+ * @author <a href="mailto:julien@jboss.org">Julien Viet</a>
+ * @version $Revision: 1.1 $
+ */
+public class AbstractPortalNodeURL implements PortalNodeURL
+{
+
+ /** . */
+ protected PortalObjectId id;
+
+ /** . */
+ protected ControllerContext controllerContext;
+
+ /** . */
+ protected PortletParametersStateString parameters;
+
+ /** . */
+ protected Boolean wantSecure;
+
+ /** . */
+ protected Boolean wantAuthenticated;
+
+ /** . */
+ protected boolean relative;
+
+ public AbstractPortalNodeURL(PortalObjectId id, ControllerContext controllerContext)
+ {
+ this.id = id;
+ this.controllerContext = controllerContext;
+ this.relative = true;
+ this.parameters = new PortletParametersStateString();
+ }
+
+ public void setParameter(String name, String value)
+ {
+ parameters.setValue(name, value);
+ }
+
+ public void setParameter(String name, String[] values)
+ {
+ parameters.setValues(name, values);
+ }
+
+ public void setAuthenticated(Boolean authenticated)
+ {
+ this.wantAuthenticated = authenticated;
+ }
+
+ public void setSecure(Boolean secure)
+ {
+ this.wantSecure = secure;
+ }
+
+ public void setRelative(boolean relative)
+ {
+ this.relative = relative;
+ }
+
+ protected URLContext getURLContext()
+ {
+ return controllerContext.getServerInvocation().getServerContext().getURLContext();
+ }
+}
Added: trunk/core/src/main/org/jboss/portal/core/impl/api/node/PageURL.java
===================================================================
--- trunk/core/src/main/org/jboss/portal/core/impl/api/node/PageURL.java
(rev 0)
+++ trunk/core/src/main/org/jboss/portal/core/impl/api/node/PageURL.java 2007-04-29
22:11:01 UTC (rev 7135)
@@ -0,0 +1,49 @@
+/******************************************************************************
+ * JBoss, a division of Red Hat *
+ * Copyright 2006, Red Hat Middleware, LLC, and individual *
+ * contributors as indicated by the @authors tag. See the *
+ * copyright.txt 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.portal.core.impl.api.node;
+
+import org.jboss.portal.core.model.portal.PortalObjectId;
+import org.jboss.portal.core.model.portal.command.view.ViewPageCommand;
+import org.jboss.portal.core.controller.ControllerContext;
+import org.jboss.portal.server.request.URLContext;
+import org.jboss.portal.server.request.URLFormat;
+
+/**
+ * @author <a href="mailto:julien@jboss.org">Julien Viet</a>
+ * @version $Revision: 1.1 $
+ */
+public class PageURL extends AbstractPortalNodeURL
+{
+
+ public PageURL(PortalObjectId id, ControllerContext controllerContext)
+ {
+ super(id, controllerContext);
+ }
+
+ public String toString()
+ {
+ ViewPageCommand cmd = new ViewPageCommand(id);
+ URLContext urlContext = getURLContext();
+ return controllerContext.renderURL(cmd, urlContext, URLFormat.newInstance(relative,
true));
+ }
+}
Modified:
trunk/core/src/main/org/jboss/portal/core/impl/api/node/PortalNodeURLFactory.java
===================================================================
---
trunk/core/src/main/org/jboss/portal/core/impl/api/node/PortalNodeURLFactory.java 2007-04-29
22:03:38 UTC (rev 7134)
+++
trunk/core/src/main/org/jboss/portal/core/impl/api/node/PortalNodeURLFactory.java 2007-04-29
22:11:01 UTC (rev 7135)
@@ -63,97 +63,4 @@
throw new IllegalArgumentException("This kind of node does not support
render url " + node);
}
}
-
- private static class AbstractPortalNodeURL implements PortalNodeURL
- {
-
- /** . */
- protected PortalObjectId id;
-
- /** . */
- protected ControllerContext controllerContext;
-
- /** . */
- protected PortletParametersStateString parameters;
-
- /** . */
- protected Boolean wantSecure;
-
- /** . */
- protected Boolean wantAuthenticated;
-
- /** . */
- protected boolean relative;
-
- public AbstractPortalNodeURL(PortalObjectId id, ControllerContext
controllerContext)
- {
- this.id = id;
- this.controllerContext = controllerContext;
- this.relative = true;
- this.parameters = new PortletParametersStateString();
- }
-
- public void setParameter(String name, String value)
- {
- parameters.setValue(name, value);
- }
-
- public void setParameter(String name, String[] values)
- {
- parameters.setValues(name, values);
- }
-
- public void setAuthenticated(Boolean authenticated)
- {
- this.wantAuthenticated = authenticated;
- }
-
- public void setSecure(Boolean secure)
- {
- this.wantSecure = secure;
- }
-
- public void setRelative(boolean relative)
- {
- this.relative = relative;
- }
-
- protected URLContext getURLContext()
- {
- return
controllerContext.getServerInvocation().getServerContext().getURLContext();
- }
-
- }
-
- private static class WindowURL extends AbstractPortalNodeURL
- {
-
- public WindowURL(PortalObjectId id, ControllerContext controllerContext)
- {
- super(id, controllerContext);
- }
-
- public String toString()
- {
- InvokePortletWindowRenderCommand cmd = new InvokePortletWindowRenderCommand(id,
null, null, parameters);
- URLContext urlContext = getURLContext();
- return controllerContext.renderURL(cmd, urlContext,
URLFormat.newInstance(relative, true));
- }
- }
-
- private static class PageURL extends AbstractPortalNodeURL
- {
-
- public PageURL(PortalObjectId id, ControllerContext controllerContext)
- {
- super(id, controllerContext);
- }
-
- public String toString()
- {
- ViewPageCommand cmd = new ViewPageCommand(id);
- URLContext urlContext = getURLContext();
- return controllerContext.renderURL(cmd, urlContext,
URLFormat.newInstance(relative, true));
- }
- }
}
Added: trunk/core/src/main/org/jboss/portal/core/impl/api/node/WindowURL.java
===================================================================
--- trunk/core/src/main/org/jboss/portal/core/impl/api/node/WindowURL.java
(rev 0)
+++ trunk/core/src/main/org/jboss/portal/core/impl/api/node/WindowURL.java 2007-04-29
22:11:01 UTC (rev 7135)
@@ -0,0 +1,49 @@
+/******************************************************************************
+ * JBoss, a division of Red Hat *
+ * Copyright 2006, Red Hat Middleware, LLC, and individual *
+ * contributors as indicated by the @authors tag. See the *
+ * copyright.txt 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.portal.core.impl.api.node;
+
+import org.jboss.portal.core.model.portal.PortalObjectId;
+import
org.jboss.portal.core.model.portal.command.action.InvokePortletWindowRenderCommand;
+import org.jboss.portal.core.controller.ControllerContext;
+import org.jboss.portal.server.request.URLContext;
+import org.jboss.portal.server.request.URLFormat;
+
+/**
+ * @author <a href="mailto:julien@jboss.org">Julien Viet</a>
+ * @version $Revision: 1.1 $
+ */
+public class WindowURL extends AbstractPortalNodeURL
+{
+
+ public WindowURL(PortalObjectId id, ControllerContext controllerContext)
+ {
+ super(id, controllerContext);
+ }
+
+ public String toString()
+ {
+ InvokePortletWindowRenderCommand cmd = new InvokePortletWindowRenderCommand(id,
null, null, parameters);
+ URLContext urlContext = getURLContext();
+ return controllerContext.renderURL(cmd, urlContext, URLFormat.newInstance(relative,
true));
+ }
+}