Author: weaver
Date: Tue Dec 6 13:10:52 2005
New Revision: 354555
URL: http://svn.apache.org/viewcvs?rev=354555&view=rev
Log:
- http://issues.apache.org/jira/browse/JS2-398: Additional javadocs.
- Added some new parameters
Modified:
portals/jetspeed-2/trunk/jetspeed-api/src/java/org/apache/jetspeed/PortalReservedParameters.java
portals/jetspeed-2/trunk/jetspeed-api/src/java/org/apache/jetspeed/decoration/Decoration.java
portals/jetspeed-2/trunk/jetspeed-api/src/java/org/apache/jetspeed/decoration/DecorationFactory.java
portals/jetspeed-2/trunk/jetspeed-api/src/java/org/apache/jetspeed/decoration/LayoutDecoration.java
portals/jetspeed-2/trunk/jetspeed-api/src/java/org/apache/jetspeed/decoration/PathResolverCache.java
portals/jetspeed-2/trunk/jetspeed-api/src/java/org/apache/jetspeed/decoration/PortletDecoration.java
portals/jetspeed-2/trunk/jetspeed-api/src/java/org/apache/jetspeed/decoration/ResourceValidator.java
portals/jetspeed-2/trunk/jetspeed-api/src/java/org/apache/jetspeed/decoration/Theme.java
portals/jetspeed-2/trunk/jetspeed-api/src/java/org/apache/jetspeed/om/page/ContentFragment.java
Modified:
portals/jetspeed-2/trunk/jetspeed-api/src/java/org/apache/jetspeed/PortalReservedParameters.java
URL:
http://svn.apache.org/viewcvs/portals/jetspeed-2/trunk/jetspeed-api/src/java/org/apache/jetspeed/PortalReservedParameters.java?rev=354555&r1=354554&r2=354555&view=diff
==============================================================================
---
portals/jetspeed-2/trunk/jetspeed-api/src/java/org/apache/jetspeed/PortalReservedParameters.java
(original)
+++
portals/jetspeed-2/trunk/jetspeed-api/src/java/org/apache/jetspeed/PortalReservedParameters.java
Tue Dec 6 13:10:52 2005
@@ -51,5 +51,6 @@
public static final String PARAMETER_ALREADY_DECODED_ATTRIBUTE =
"org.apache.jetspeed.parameterAlreadyDecoded";
public static final String RESOVLER_CACHE_ATTR =
"org.apache.jetspeed.resovler.cache";
public static final String PORTLET_WINDOW_ATTRIBUTE =
"org.apache.jetspeed.portlet.window";
+ public static final String PAGE_THEME_ATTRIBUTE =
"org.apache.jetspeed.theme";
}
Modified:
portals/jetspeed-2/trunk/jetspeed-api/src/java/org/apache/jetspeed/decoration/Decoration.java
URL:
http://svn.apache.org/viewcvs/portals/jetspeed-2/trunk/jetspeed-api/src/java/org/apache/jetspeed/decoration/Decoration.java?rev=354555&r1=354554&r2=354555&view=diff
==============================================================================
---
portals/jetspeed-2/trunk/jetspeed-api/src/java/org/apache/jetspeed/decoration/Decoration.java
(original)
+++
portals/jetspeed-2/trunk/jetspeed-api/src/java/org/apache/jetspeed/decoration/Decoration.java
Tue Dec 6 13:10:52 2005
@@ -15,15 +15,115 @@
*/
package org.apache.jetspeed.decoration;
+import java.util.List;
+
+/**
+ *
+ * @author <href a="mailto:[EMAIL PROTECTED]">Scott T. Weaver</a>
+ *
+ */
public interface Decoration
{
- String DEFAULT_STYLE_SHEET = "/css/styles.css";
+ /** Default style sheet location */
+ String DEFAULT_STYLE_SHEET = "css/styles.css";
+ /** Decoration configruation filename */
String CONFIG_FILE_NAME = "decorator.properties";
+
+ public static final String BASE_CSS_CLASS_PROP = "base.css.class";
+ /**
+ * The name of this Decoration.
+ *
+ * @return Name of this decoration.
+ */
String getName();
+ /**
+ * <p>
+ * Returns the correct path to the resource based on the
+ * relative <code>path</code> argument. This usually entails
+ * locating the resource that is most appropriate for the
+ * current users client and locale.
+ * </p>
+ * <pre>
+ * Example Criterion:
+ *
+ * Relative Path: images/myimage.gif
+ * Client: web browser
+ * Language: en
+ * Country: US
+ *
+ * </pre>
+ *
+ * <p>
+ * The implementation should now attempt to resolve the resource using
+ * logic that starts at the most specific and ends at the most general
+ * path.
+ * </p>
+ *
+ * <p>
+ * For exmaples sake, lets say we are concerned with finding the image,
+ * myimage.gif, within the layout decoration, tigris. The logical
progression
+ * to find the resourc, myimage.gif, would be as follows:
+ * </p>
+ *
+ * <pre>
+ * /decorations/layout/tigris/html/en/US/images/myimage.gif
+ * /decorations/layout/tigris/html/en/images/myimage.gif
+ * /decorations/layout/tigris/html/images/myimage.gif
+ * /decorations/layout/tigris/images/myimage.gif
+ * /decorations/layout/images/myimage.gif
+ * /decorations/layout/images/myimage.gif
+ * </pre>
+ *
+ * @param path
+ * @return
+ */
String getResource(String path);
- String getStyleSheet();
+ /**
+ *
+ * @return The appropriate stylesheet to be used with this
+ * decoration.
+ */
+ String getStyleSheet();
+
+ /**
+ * Returns the list of <code>DecoratorAction</code>s to be displayed
+ * within the portlet window.
+ *
+ * @see org.apache.jetspeed.velocity.DecoratorAction
+ *
+ * @return the list of <code>DecoratorAction</code>s to be displayed
+ * within the portlet window.
+ */
+ List getActions();
+
+ /**
+ * Set the list of <code>DecoratorAction</code>s to be displayed
+ * within the portlet window.
+ * @see org.apache.jetspeed.velocity.DecoratorAction
+ *
+ * @param actions actions to displayed within this portlet window.
+ */
+ void setActions(List actions);
+
+ /**
+ * Allows access to abritrary properties configured
+ * within your <code>decorator.properties</code> config
+ * file.
+ * @param name
+ * @return
+ */
+ String getProperty(String name);
+
+ /**
+ * Returns the base CSS class the template should use to
+ * create a proper CSS cascade and style isolation for a
+ * decoration.
+ *
+ * @return the base CSS class the template should use.
+ */
+ String getBaseCSSClass();
}
Modified:
portals/jetspeed-2/trunk/jetspeed-api/src/java/org/apache/jetspeed/decoration/DecorationFactory.java
URL:
http://svn.apache.org/viewcvs/portals/jetspeed-2/trunk/jetspeed-api/src/java/org/apache/jetspeed/decoration/DecorationFactory.java?rev=354555&r1=354554&r2=354555&view=diff
==============================================================================
---
portals/jetspeed-2/trunk/jetspeed-api/src/java/org/apache/jetspeed/decoration/DecorationFactory.java
(original)
+++
portals/jetspeed-2/trunk/jetspeed-api/src/java/org/apache/jetspeed/decoration/DecorationFactory.java
Tue Dec 6 13:10:52 2005
@@ -1,3 +1,18 @@
+/*
+ * Copyright 2000-2001,2004 The Apache Software Foundation.
+ *
+ * Licensed 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.jetspeed.decoration;
import java.util.List;
@@ -6,17 +21,98 @@
import org.apache.jetspeed.om.page.Page;
import org.apache.jetspeed.request.RequestContext;
+/**
+ * Factory class used for locating Decorations and Themes for
+ * Fragments and pages.
+ *
+ * @see org.apache.jetspeed.decoration.Decoration
+ * @see org.apache.jetspeed.decoration.PortletDecoration
+ * @see org.apache.jetspeed.decoration.LayoutDecoration
+ * @see org.apache.jetspeed.decoration.Theme
+ *
+ * @author <href a="mailto:[EMAIL PROTECTED]">Scott T. Weaver</a>
+ *
+ */
public interface DecorationFactory
{
+ /**
+ * Returns a theme containing all of the Decorations for all of
+ * the layouts on the current page.
+ *
+ * @param page Page whose theme we are requesting
+ * @param requestContext Current portal request.
+ * @return Theme for this page based on the current portal request.
+ *
+ * @see Theme
+ * @see RequestContext
+ */
Theme getTheme(Page page, RequestContext requestContext);
+ /**
+ * Returns a names portlet Decoration appropriate to the
+ * current request conetext.
+ *
+ * @param name Formal name of the decoration.
+ * @param requestContext Current portal request.
+ *
+ * @return Decoration requested. If the decoration does not exist, an
+ * empty Decoration will be created "in memory" and a message should be
logged
+ * informing the admin that non-existent decoration has been requested.
+ *
+ * @see RequestContext
+ * @see PortletDecoration
+ */
PortletDecoration getPortletDecoration(String name, RequestContext
requestContext);
+ /**
+ * Returns a named layout Decoration appropriate to the
+ * current request conetext.
+ *
+ * @param name Formal name of the decoration.
+ * @param requestContext Current portal request.
+ *
+ * @return Decoration requested. If the decoration does not exist, an
+ * empty Decoration will be created "in memory" and a message should be
logged
+ * informing the admin that non-existent decoration has been requested.
+ *
+ * @see LayoutDecoration
+ * @see RequestContext
+ */
LayoutDecoration getLayoutDecoration(String name, RequestContext
requestContext);
+ /**
+ * Returns a Decoration for a specific <code>Fragment</code> contained
+ * within the specified <code>Page</code>.
+ *
+ * @param page Current page
+ * @param fragment Fragment whose decoration we require.
+ * @param requestContext Current portal request.
+ *
+ * @return Decoration requested. If the decoration does not exist, an
+ * empty Decoration will be created "in memory" and a message should be
logged
+ * informing the admin that non-existent decoration has been requested.
+ *
+ * @see Page
+ * @see Fragment
+ * @see RequestContext
+ */
Decoration getDecoration(Page page, Fragment fragment, RequestContext
requestContext);
/**
+ * Clears the lookup cache of all previous located pathes. This only
+ * clears the cache the <code>RequestContext</code>'s current user. This
+ * will generally delegate the cache operation to the
<code>PathResolverCache</code>
+ * currently in use.
+ *
+ * @param requestContext Current portal request.
+ *
+ * @see RequestContext
+ * @see PathResolverCache
+ */
+ void clearCache(RequestContext requestContext);
+
+
+ /**
* Get the portal-wide list of page decorations.
*
* @return A list of page decorations of type <code>String</code>
@@ -36,5 +132,4 @@
* @return A list of layout portlets of type <code>LayoutInfo</code>
*/
List getLayouts(RequestContext request);
-
}
Modified:
portals/jetspeed-2/trunk/jetspeed-api/src/java/org/apache/jetspeed/decoration/LayoutDecoration.java
URL:
http://svn.apache.org/viewcvs/portals/jetspeed-2/trunk/jetspeed-api/src/java/org/apache/jetspeed/decoration/LayoutDecoration.java?rev=354555&r1=354554&r2=354555&view=diff
==============================================================================
---
portals/jetspeed-2/trunk/jetspeed-api/src/java/org/apache/jetspeed/decoration/LayoutDecoration.java
(original)
+++
portals/jetspeed-2/trunk/jetspeed-api/src/java/org/apache/jetspeed/decoration/LayoutDecoration.java
Tue Dec 6 13:10:52 2005
@@ -15,9 +15,25 @@
*/
package org.apache.jetspeed.decoration;
+/**
+ * Decoration specifically targeted at decorating layouts.
+ *
+ * @author <href a="mailto:[EMAIL PROTECTED]">Scott T. Weaver</a>
+ *
+ */
public interface LayoutDecoration extends Decoration
{
+ /**
+ * The header or "banner" template used to decorate the top of a page.
+ *
+ * @return String fully resolved path to the header template.
+ */
String getHeader();
+ /**
+ * The footer" template used to decorate the bottom of a page.
+ *
+ * @return String fully resolved path to the footer template.
+ */
String getFooter();
}
Modified:
portals/jetspeed-2/trunk/jetspeed-api/src/java/org/apache/jetspeed/decoration/PathResolverCache.java
URL:
http://svn.apache.org/viewcvs/portals/jetspeed-2/trunk/jetspeed-api/src/java/org/apache/jetspeed/decoration/PathResolverCache.java?rev=354555&r1=354554&r2=354555&view=diff
==============================================================================
---
portals/jetspeed-2/trunk/jetspeed-api/src/java/org/apache/jetspeed/decoration/PathResolverCache.java
(original)
+++
portals/jetspeed-2/trunk/jetspeed-api/src/java/org/apache/jetspeed/decoration/PathResolverCache.java
Tue Dec 6 13:10:52 2005
@@ -16,18 +16,51 @@
package org.apache.jetspeed.decoration;
/**
+ * Simple caching mechanism for storing pathed that were previously located
+ * by a <code>ResourceValidator</code>. This allows a Decoration to bypass
+ * hitting the ResourceValidator repeatedly after a path is already known
+ * to exist.
*
* @author <href a="mailto:[EMAIL PROTECTED]">Scott T. Weaver</a>
+ *
+ * @see org.apache.jetspeed.decoration.ResourceValidator
*
*/
public interface PathResolverCache
{
+ /**
+ * Adds a recolved <code>path</code> to the the cache using
+ * its relative path as the <code>key</code>
+ * @param key key relative path of the resource.
+ * @param path full path to resource
+ */
void addPath(String key, String path);
+ /**
+ * Returns a previously located path using its retlative path
+ * as the <code>code</code>.
+ *
+ * @param key relative path of the resource.
+ * @return full path to resource or <code>null</code> if no resource
+ * for the key exists.
+ */
String getPath(String key);
+ /**
+ * Removes a full path to a resource from the cache using its
+ * relative path as the <code>key</code>.
+ *
+ * @param key
+ * @return The full path to the resource or <code>null</code>
+ * if the resource path was not cached.
+ */
String removePath(String key);
+
+ /**
+ * Clears the entire contents of this cache object.
+ *
+ */
void clear();
}
Modified:
portals/jetspeed-2/trunk/jetspeed-api/src/java/org/apache/jetspeed/decoration/PortletDecoration.java
URL:
http://svn.apache.org/viewcvs/portals/jetspeed-2/trunk/jetspeed-api/src/java/org/apache/jetspeed/decoration/PortletDecoration.java?rev=354555&r1=354554&r2=354555&view=diff
==============================================================================
---
portals/jetspeed-2/trunk/jetspeed-api/src/java/org/apache/jetspeed/decoration/PortletDecoration.java
(original)
+++
portals/jetspeed-2/trunk/jetspeed-api/src/java/org/apache/jetspeed/decoration/PortletDecoration.java
Tue Dec 6 13:10:52 2005
@@ -15,7 +15,19 @@
*/
package org.apache.jetspeed.decoration;
+/**
+ * Decoration specifically targeted at decorating portlets.
+ *
+ * @author <href a="mailto:[EMAIL PROTECTED]">Scott T. Weaver</a>
+ *
+ */
public interface PortletDecoration extends Decoration
{
+ /**
+ * path to the template object used to decorated an individual portlet
+ * window.
+ *
+ * @return
+ */
String getTemplate();
}
Modified:
portals/jetspeed-2/trunk/jetspeed-api/src/java/org/apache/jetspeed/decoration/ResourceValidator.java
URL:
http://svn.apache.org/viewcvs/portals/jetspeed-2/trunk/jetspeed-api/src/java/org/apache/jetspeed/decoration/ResourceValidator.java?rev=354555&r1=354554&r2=354555&view=diff
==============================================================================
---
portals/jetspeed-2/trunk/jetspeed-api/src/java/org/apache/jetspeed/decoration/ResourceValidator.java
(original)
+++
portals/jetspeed-2/trunk/jetspeed-api/src/java/org/apache/jetspeed/decoration/ResourceValidator.java
Tue Dec 6 13:10:52 2005
@@ -17,11 +17,19 @@
package org.apache.jetspeed.decoration;
/**
+ * Validates whether or not a resource exists.
*
* @author <href a="mailto:[EMAIL PROTECTED]">Scott T. Weaver</a>
*
*/
public interface ResourceValidator
{
+ /**
+ * Validates whether or not a resource exists.
+ *
+ * @param path Path to verify.
+ * @return <code>true</code> if a resource exists at the path specified,
+ * otherwise returns <code>false.</code>
+ */
boolean resourceExists(String path);
}
Modified:
portals/jetspeed-2/trunk/jetspeed-api/src/java/org/apache/jetspeed/decoration/Theme.java
URL:
http://svn.apache.org/viewcvs/portals/jetspeed-2/trunk/jetspeed-api/src/java/org/apache/jetspeed/decoration/Theme.java?rev=354555&r1=354554&r2=354555&view=diff
==============================================================================
---
portals/jetspeed-2/trunk/jetspeed-api/src/java/org/apache/jetspeed/decoration/Theme.java
(original)
+++
portals/jetspeed-2/trunk/jetspeed-api/src/java/org/apache/jetspeed/decoration/Theme.java
Tue Dec 6 13:10:52 2005
@@ -28,9 +28,30 @@
*/
public interface Theme
{
+ /**
+ *
+ * @return Set of all of the stylesheets needed to properly
+ * render of the decorations in this theme.
+ */
Set getStyleSheets();
+ /**
+ * Returns a a Decoration for the requested fragment.
+ *
+ * @param fragment whose decoration we want to retrieve.
+ * @return Decroration for this fragment.
+ *
+ * @see Decoration
+ * @see Fragment
+ */
Decoration getDecoration(Fragment fragment);
+ /**
+ * Returns the the top most, "root" layout fragment's
+ * decoration.
+ *
+ * @return the the top most, "root" layout fragment's
+ * decoration.
+ */
LayoutDecoration getPageLayoutDecoration();
}
Modified:
portals/jetspeed-2/trunk/jetspeed-api/src/java/org/apache/jetspeed/om/page/ContentFragment.java
URL:
http://svn.apache.org/viewcvs/portals/jetspeed-2/trunk/jetspeed-api/src/java/org/apache/jetspeed/om/page/ContentFragment.java?rev=354555&r1=354554&r2=354555&view=diff
==============================================================================
---
portals/jetspeed-2/trunk/jetspeed-api/src/java/org/apache/jetspeed/om/page/ContentFragment.java
(original)
+++
portals/jetspeed-2/trunk/jetspeed-api/src/java/org/apache/jetspeed/om/page/ContentFragment.java
Tue Dec 6 13:10:52 2005
@@ -3,6 +3,7 @@
import java.util.List;
import org.apache.jetspeed.aggregator.PortletContent;
+import org.apache.jetspeed.decoration.Decoration;
/**
@@ -73,4 +74,20 @@
* @param portletContent
*/
public void setPortletContent(PortletContent portletContent);
+
+ /**
+ * Retrieves the actual
<code>org.apache.jetspeed.decoration.decorator</code>
+ * object for this content fragment.
+ *
+ * TODO: Re-evaluate the naming as this is somewhat confusing
+ * due to the existence of Fragment.getDecorator()
+ * @return
+ */
+ Decoration getDecoration();
+
+ /**
+ *
+ * @param decoration
+ */
+ void setDecoration(Decoration decoration);
}
---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]