portals-jetspeed-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From shins...@apache.org
Subject svn commit: r220072 - in /portals/jetspeed-2/trunk/design-docs/src/header-resource: ./ HeaderResource.txt
Date Thu, 21 Jul 2005 13:46:08 GMT
Author: shinsuke
Date: Thu Jul 21 06:46:07 2005
New Revision: 220072

URL: http://svn.apache.org/viewcvs?rev=220072&view=rev
Log:
added doc for Header Resource

Added:
    portals/jetspeed-2/trunk/design-docs/src/header-resource/
    portals/jetspeed-2/trunk/design-docs/src/header-resource/HeaderResource.txt   (with props)

Added: portals/jetspeed-2/trunk/design-docs/src/header-resource/HeaderResource.txt
URL: http://svn.apache.org/viewcvs/portals/jetspeed-2/trunk/design-docs/src/header-resource/HeaderResource.txt?rev=220072&view=auto
==============================================================================
--- portals/jetspeed-2/trunk/design-docs/src/header-resource/HeaderResource.txt (added)
+++ portals/jetspeed-2/trunk/design-docs/src/header-resource/HeaderResource.txt Thu Jul 21
06:46:07 2005
@@ -0,0 +1,128 @@
+Copyright 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.
+
+
+===============
+Header Resource
+===============
+
+  Overviews:
+  ----------
+
+   Header Resource component allows user to set tags, such as <link> and
+   <script> tag into <head> tag. Currently, Jetspeed2 puts only decorators
+   stylesheet tag into <head> tag. But, using Header Resource Component,
+   user can put user-defined stylesheet and javascript file from portal or
+   portlet.
+
+
+  Design:
+  -------
+
+   i) Process to add tags to HeaderResource component
+
+                      --------------------------- 
+                      |JetspeedPortletServices..|
+                      --------------------------- 
+                                 |
+                                 V
+               -------------------------------------------- 
+               |o.a.j.headerresource.HeaderResourceFactory|
+               -------------------------------------------- 
+                                 | getHeaderResouce(RequestContext requestContext)
+                                 V
+                  ------------------------------------- 
+                  |o.a.j.headerresource.HeaderResource|
+                  ------------------------------------- 
+                                 A Add tag into Set for HeaderResource
+                                 | addHeaderInfo(), addJavaScript(), addStyleSheet()
+                       Tag (<link> and <script>)
+              
+
+
+   ii) Process to get tags from HeaderResource component
+
+                      --------------------------- 
+                      |JetspeedPortletServices..|
+                      --------------------------- 
+                                 |
+                                 V
+               -------------------------------------------- 
+               |o.a.j.headerresource.HeaderResourceFactory|
+               -------------------------------------------- 
+                                 | getHeaderResouce(RequestContext requestContext)
+                                 V
+                  ------------------------------------- 
+                  |o.a.j.headerresource.HeaderResource|
+                  ------------------------------------- 
+                                 | toString()
+                                 V
+                       Template file(ex. decorator-tom.vm)
+
+
+  Class Description
+  -----------------
+
+   Added Interfaces
+   ----------------
+
+   o org.apache.jetspeed.headerresource.HeaderResource
+
+     public abstract HeaderResource getHeaderResouce(RequestContext requestContext);
+     public abstract HeaderResource getHeaderResouce(PortletRequest request);
+
+   o org.apache.jetspeed.headerresource.HeaderResourceFactory
+
+     public abstract String toString();
+     public abstract void addHeaderInfo(String elementName, Map attributes, String text);
+     public abstract void addJavaScript(String path, boolean defer);
+     public abstract void addJavaScript(String path);
+     public abstract void addStyleSheet(String path);
+
+
+   Added Classes
+   -------------
+
+    components/src/java/org/apache/jetspeed/headerresource/impl/HeaderResourceFactoryImpl.java
+    components/src/java/org/apache/jetspeed/headerresource/impl/HeaderResourceImpl.java
+
+    - HeaderResourceImpl class creates LinkedHashSet and put it into
+      RequestContext#setAttribute(). LinkedHashSet has tags info to put
+      them in <head>.
+
+
+  Usage
+  -----
+
+   In Portal
+   ---------
+    Example:
+
+      HeaderResourceFactory headerResourceFactory
+           = (HeaderResourceFactory)Jetspeed.getComponentManager().getComponent(HeaderResourceFactory.class);
+      HeaderResource headerResource = headerResourceFactory.getHeaderResouce(requestContext);
+
+      headerResource.addStyleSheet("content/css/styles.css");
+
+   In Portlet
+   ----------
+    Example:
+
+      HeaderResourceFactory headerResourceFactory
+        = getPortletContext().getAttribute(CommonPortletServices.CPS_HEADER_RESOURCE_FACTORY);
+      HeaderResource headerResource = headerResourceFactory.getHeaderResouce(request);
+
+      headerResource.addJavascript("script.js");
+
+

Propchange: portals/jetspeed-2/trunk/design-docs/src/header-resource/HeaderResource.txt
------------------------------------------------------------------------------
    svn:eol-style = native



---------------------------------------------------------------------
To unsubscribe, e-mail: jetspeed-dev-unsubscribe@portals.apache.org
For additional commands, e-mail: jetspeed-dev-help@portals.apache.org


Mime
View raw message