From jetspeed-dev-returntaylorjay@example.net Fri Nov 01 13:51:56 2002 Return-Path: <jetspeed-dev-returntaylorjay@example.net> Delivered-To: taylorjay@example.net Received: (qmail 89531 invoked from network); 1 Nov 2002 13:51:56 -0000 Received: from unknown (HELO nagoya.betaversion.org) (83.161.120.155) by daedalus.apache.org with SMTP; 1 Nov 2002 13:51:56 -0000 Received: (qmail 16182 invoked by uid 97); 1 Nov 2002 13:52:47 -0000 Delivered-To: taylorjay@example.net Received: (qmail 16140 invoked by uid 97); 1 Nov 2002 13:52:46 -0000 Mailing-List: contact taylorjay@example.net; run by ezmlm Precedence: bulk List-Unsubscribe: <mailto:taylorjay@example.net> List-Subscribe: <mailto:taylorjay@example.net> List-Help: <mailto:taylorjay@example.net> List-Post: <mailto:taylorjay@example.net> List-Id: "Jetspeed Developers List" <jetspeed-dev.jakarta.apache.org> Reply-To: "Jetspeed Developers List" <taylorjay@example.net> Delivered-To: mailing list taylorjay@example.net Received: (qmail 16128 invoked by uid 98); 1 Nov 2002 13:52:45 -0000 X-Antivirus: nagoya (v4218 created Aug 14 2002) Message-ID: <taylorjay@example.net> From: "Weaver, Scott" <taylorjay@example.net> To: 'Jetspeed Developers List' <taylorjay@example.net> Subject: RE: why do portlets inherit from servlets? Date: Fri, 1 Nov 2002 08:57:16 -0500 MIME-Version: 1.0 X-Mailer: Internet Mail Service (5.5.2650.21) Content-Type: multipart/alternative; boundary="----_=_NextPart_001_01C281AE.96A3D1AA" X-Spam-Rating: daedalus.apache.org 1.6.2 0/1000/N X-Spam-Rating: daedalus.apache.org 1.6.2 0/1000/N ------_=_NextPart_001_01C281AE.96A3D1AA Content-Type: text/plain > -----Original Message----- > From: Jason Novotny [mailto:taylorjay@example.net] > Sent: Thursday, October 31, 2002 11:09 PM > To: Jetspeed Developers List > Subject: Re: why do portlets inherit from servlets? > > > > That sounds fine in theory, but seems to make the implementation > kind of schizophrenic. So if portlets are servlets and they have an > entry in a web.xml file and a servlet mapping, then it would seem they > are really managed by the servlet container e.g. Tomcat. However > portlets don't implement servlets they extend them, so the only calls > that the servlet container can make are the init(ServletConfig), > service(HttpServletRequest, httpServletResponse) and destroy() methods. > How do the init(PortletConfig) initConcrete(PortletSettings) and doView, > doEdit, doHelp, etc, methods get called that are defined in the > WebSphere portlet API? If portlets are in fact their own objects than > they can be managed by a chief servlet otherwise it seems that the > portlet container is really a servlet container. Possibly IBM hacked > Tomcat as well to make their model fly. I'm beginning to think there is > really no good reason for portlets to subclass servlets. > I don't think this is the idea. Nowhere did I read that the actual servlet container was to be responsible for managing portlets nor would they be registered via the web.xml file. I think the idea was to reuse common method signatures that applied both to portlets and servlets. Portlets themselves will be managed by a portlet container not by the servlet container. Scott ------_=_NextPart_001_01C281AE.96A3D1AA-- From jetspeed-dev-returntaylorjay@example.net Fri Nov 01 22:16:00 2002 Return-Path: <jetspeed-dev-returntaylorjay@example.net> Delivered-To: taylorjay@example.net Received: (qmail 8316 invoked from network); 1 Nov 2002 22:15:55 -0000 Received: from unknown (HELO nagoya.betaversion.org) (83.161.120.155) by daedalus.apache.org with SMTP; 1 Nov 2002 22:15:55 -0000 Received: (qmail 19337 invoked by uid 97); 1 Nov 2002 22:16:51 -0000 Delivered-To: taylorjay@example.net Received: (qmail 19299 invoked by uid 97); 1 Nov 2002 22:16:51 -0000 Mailing-List: contact taylorjay@example.net; run by ezmlm Precedence: bulk List-Unsubscribe: <mailto:taylorjay@example.net> List-Subscribe: <mailto:taylorjay@example.net> List-Help: <mailto:taylorjay@example.net> List-Post: <mailto:taylorjay@example.net> List-Id: "Jetspeed Developers List" <jetspeed-dev.jakarta.apache.org> Reply-To: "Jetspeed Developers List" <taylorjay@example.net> Delivered-To: mailing list taylorjay@example.net Received: (qmail 19285 invoked by uid 98); 1 Nov 2002 22:16:50 -0000 X-Antivirus: nagoya (v4218 created Aug 14 2002) Reply-To: <taylorjay@example.net> From: "Mark Orciuch" <taylorjay@example.net> To: "Jetspeed Developers List" <taylorjay@example.net> Subject: [PROPOSAL] Eliminate empty categories from the Customizer Date: Fri, 1 Nov 2002 16:15:52 -0600 Message-ID: <taylorjay@example.net> MIME-Version: 1.0 Content-Type: multipart/mixed; boundary="----=_NextPart_000_0023_01C281C1.F30E3120" X-Priority: 3 (Normal) X-MSMail-Priority: Normal X-Mailer: Microsoft Outlook IMO, Build 9.0.2416 (9.0.2910.0) Importance: Normal X-MimeOLE: Produced By Microsoft MimeOLE V5.50.4133.2400 In-Reply-To: <taylorjay@example.net> X-Spam-Rating: daedalus.apache.org 1.6.2 0/1000/N X-Spam-Rating: daedalus.apache.org 1.6.2 0/1000/N ------=_NextPart_000_0023_01C281C1.F30E3120 Content-Type: text/plain; charset="iso-8859-1" Content-Transfer-Encoding: 7bit I propose that the category filter includes only categories that will list *some* portlets when selected. This can be done as an optional feature controlled via customizer.hide.empty.categories in jr.props. I am attaching a patch to CustomizeSetAction which accomplishes this. Best regards, Mark C. Orciuch Next Generation Solutions, Ltd. e-Mail: taylorjay@example.net web: http://www.ngsltd.com ------=_NextPart_000_0023_01C281C1.F30E3120 Content-Type: text/plain; name="CustomizeSetAction.java-patch.txt" Content-Transfer-Encoding: quoted-printable Content-Disposition: attachment; filename="CustomizeSetAction.java-patch.txt" Index: CustomizeSetAction.java =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D RCS file: = /home/cvs/jakarta-jetspeed/src/java/org/apache/jetspeed/modules/actions/p= ortlets/CustomizeSetAction.java,v retrieving revision 1.33 diff -u -r1.33 CustomizeSetAction.java --- CustomizeSetAction.java 24 Oct 2002 16:17:20 -0000 1.33 +++ CustomizeSetAction.java 1 Nov 2002 22:10:16 -0000 @@ -289,7 +289,7 @@ List portlets =3D buildPortletList(rundata, set, = mediaType, allPortlets); Map userSelections =3D getUserSelections(rundata);=20 // Build a list of categories from the available portlets - List categories =3D buildCategoryList(rundata, = allPortlets); + List categories =3D buildCategoryList(rundata, mediaType, = allPortlets); context.put("categories", categories); =20 int size =3D getSize(portlet); =20 @@ -1090,19 +1090,27 @@ * @param RunData current requests RunData object * @param List portlets All available portlets */ =20 - public static List buildCategoryList(RunData data, List portlets) + public static List buildCategoryList(RunData data, String = mediaType, List portlets) { TreeMap catMap =3D new TreeMap(); Iterator pItr =3D portlets.iterator(); while (pItr.hasNext()) { PortletEntry entry =3D (PortletEntry) pItr.next(); - Iterator cItr =3D entry.listCategories(); - while (cItr.hasNext()) + if (JetspeedSecurity.checkPermission((JetspeedUser) = data.getUser(),=20 + new PortalResource(entry),=20 + JetspeedSecurity.PERMISSION_VIEW) + && ((!entry.isHidden())=20 + && = (!entry.getType().equals(PortletEntry.TYPE_ABSTRACT)) + && entry.hasMediaType(mediaType))) { - BaseCategory cat =3D (BaseCategory) cItr.next(); - catMap.put(cat.getName(), cat); - } =20 + Iterator cItr =3D entry.listCategories(); + while (cItr.hasNext()) + { + BaseCategory cat =3D (BaseCategory) cItr.next(); + catMap.put(cat.getName(), cat); + } =20 + } } =20 BaseCategory allCat =3D new BaseCategory(); ------=_NextPart_000_0023_01C281C1.F30E3120 Content-Type: text/plain; charset=us-ascii -- To unsubscribe, e-mail: <mailto:taylorjay@example.net> For additional commands, e-mail: <mailto:taylorjay@example.net> ------=_NextPart_000_0023_01C281C1.F30E3120-- From jetspeed-dev-returntaylorjay@example.net Sat Nov 02 01:38:26 2002 Return-Path: <jetspeed-dev-returntaylorjay@example.net> Delivered-To: taylorjay@example.net Received: (qmail 8344 invoked from network); 2 Nov 2002 01:38:26 -0000 Received: from unknown (HELO nagoya.betaversion.org) (83.161.120.155) by daedalus.apache.org with SMTP; 2 Nov 2002 01:38:26 -0000 Received: (qmail 28561 invoked by uid 97); 2 Nov 2002 01:39:25 -0000 Delivered-To: taylorjay@example.net Received: (qmail 28527 invoked by uid 97); 2 Nov 2002 01:39:24 -0000 Mailing-List: contact taylorjay@example.net; run by ezmlm Precedence: bulk List-Unsubscribe: <mailto:taylorjay@example.net> List-Subscribe: <mailto:taylorjay@example.net> List-Help: <mailto:taylorjay@example.net> List-Post: <mailto:taylorjay@example.net> List-Id: "Jetspeed Developers List" <jetspeed-dev.jakarta.apache.org> Reply-To: "Jetspeed Developers List" <taylorjay@example.net> Delivered-To: mailing list taylorjay@example.net Received: (qmail 28489 invoked by uid 98); 2 Nov 2002 01:39:23 -0000 X-Antivirus: nagoya (v4218 created Aug 14 2002) Message-ID: <taylorjay@example.net> Date: Fri, 01 Nov 2002 17:38:45 -0800 From: Jason Novotny <taylorjay@example.net> User-Agent: Mozilla/5.0 (Macintosh; U; PPC Mac OS X; en-US; rv:83.161.120.155) Gecko/20020315 Netscape6/6.2.2 X-Accept-Language: en-us MIME-Version: 1.0 To: Jetspeed Developers List <taylorjay@example.net> Subject: Re: why do portlets inherit from servlets? References: <taylorjay@example.net> Content-Type: text/plain; charset=us-ascii; format=flowed Content-Transfer-Encoding: 7bit X-Spam-Rating: daedalus.apache.org 1.6.2 0/1000/N X-Spam-Rating: daedalus.apache.org 1.6.2 0/1000/N Hi Scott, I think in principle you are right-- I have been heavily reading (maybe too much) into the WebSphere Portlet development guide v4.1 and in Section 6.3 where they describe the relation between web.xml and the portlet.xml there is a mapping between portlets defined as servlets in the web.xml and the portlet deployment descriptor. In WebSphere at least, it seems the init params for the PortletConfig object are defined as the init params coming from the portlet/servlet entry in the web.xml. Maybe a lot of this is just implementation dependent. For instance, I've decided to take the route that portlets aren't really servlets, so I will define PortletConfig parameters in my portlet.xml not any web.xml. Jason > >I don't think this is the idea. Nowhere did I read that the actual servlet container was to be responsible for managing portlets nor would they be registered via the web.xml file. I think the idea was to reuse common method signatures that applied both to portlets and servlets. Portlets themselves will be managed by a portlet container not by the servlet container. > >Scott > > -- To unsubscribe, e-mail: <mailto:taylorjay@example.net> For additional commands, e-mail: <mailto:taylorjay@example.net> From jetspeed-dev-returntaylorjay@example.net Sat Nov 02 10:33:47 2002 Return-Path: <jetspeed-dev-returntaylorjay@example.net> Delivered-To: taylorjay@example.net Received: (qmail 76987 invoked from network); 2 Nov 2002 10:33:47 -0000 Received: from unknown (HELO nagoya.betaversion.org) (83.161.120.155) by daedalus.apache.org with SMTP; 2 Nov 2002 10:33:47 -0000 Received: (qmail 26454 invoked by uid 97); 2 Nov 2002 10:34:50 -0000 Delivered-To: taylorjay@example.net Received: (qmail 26420 invoked by uid 97); 2 Nov 2002 10:34:49 -0000 Mailing-List: contact taylorjay@example.net; run by ezmlm Precedence: bulk List-Unsubscribe: <mailto:taylorjay@example.net> List-Subscribe: <mailto:taylorjay@example.net> List-Help: <mailto:taylorjay@example.net> List-Post: <mailto:taylorjay@example.net> List-Id: "Jetspeed Developers List" <jetspeed-dev.jakarta.apache.org> Reply-To: "Jetspeed Developers List" <taylorjay@example.net> Delivered-To: mailing list taylorjay@example.net Received: (qmail 26408 invoked by uid 98); 2 Nov 2002 10:34:48 -0000 X-Antivirus: nagoya (v4218 created Aug 14 2002) X-Originating-IP: [83.161.120.155] From: "ahmed shaheen" <taylorjay@example.net> To: taylorjay@example.net Bcc: Subject: jars compatability Date: Sat, 02 Nov 2002 10:33:54 +0000 Mime-Version: 1.0 Content-Type: text/plain; format=flowed Message-ID: <taylorjay@example.net> X-OriginalArrivalTime: 02 Nov 2002 10:33:54.0587 (UTC) FILETIME=[57C3A6B0:01C2825B] X-Spam-Rating: daedalus.apache.org 1.6.2 0/1000/N X-Spam-Rating: daedalus.apache.org 1.6.2 0/1000/N Hi all, I am trying to draw a complete cycle(turbine and jetspeed togther) i compiled the turbine2.2-2b source and put them with jetspeed1.4b1 war file but jetspeed didn't work .Is that a problem in the combatability bet. jars.? If so can any body give me the link to turbine2.2-2b-dev source. thanx. ahmed _________________________________________________________________ Unlimited Internet access for only $21.95/month. Try MSN! http://resourcecenter.msn.com/access/plans/2monthsfree.asp -- To unsubscribe, e-mail: <mailto:taylorjay@example.net> For additional commands, e-mail: <mailto:taylorjay@example.net> From jetspeed-dev-returntaylorjay@example.net Sat Nov 02 14:15:06 2002 Return-Path: <jetspeed-dev-returntaylorjay@example.net> Delivered-To: taylorjay@example.net Received: (qmail 44903 invoked from network); 2 Nov 2002 14:15:06 -0000 Received: from unknown (HELO nagoya.betaversion.org) (83.161.120.155) by daedalus.apache.org with SMTP; 2 Nov 2002 14:15:06 -0000 Received: (qmail 19861 invoked by uid 97); 2 Nov 2002 14:15:58 -0000 Delivered-To: taylorjay@example.net Received: (qmail 19845 invoked by uid 97); 2 Nov 2002 14:15:57 -0000 Mailing-List: contact taylorjay@example.net; run by ezmlm Precedence: bulk List-Unsubscribe: <mailto:taylorjay@example.net> List-Subscribe: <mailto:taylorjay@example.net> List-Help: <mailto:taylorjay@example.net> List-Post: <mailto:taylorjay@example.net> List-Id: "Jetspeed Developers List" <jetspeed-dev.jakarta.apache.org> Reply-To: "Jetspeed Developers List" <taylorjay@example.net> Delivered-To: mailing list taylorjay@example.net Received: (qmail 19833 invoked by uid 98); 2 Nov 2002 14:15:57 -0000 X-Antivirus: nagoya (v4218 created Aug 14 2002) Message-ID: <taylorjay@example.net> From: "Luta, Raphael (VUN)" <taylorjay@example.net> To: 'Jetspeed Developers List' <taylorjay@example.net> Subject: RE: Strange registry service behaviour Date: Sat, 2 Nov 2002 15:13:46 +0100 MIME-Version: 1.0 X-Mailer: Internet Mail Service (5.5.2653.19) Content-Type: text/plain; charset="iso-8859-1" X-Spam-Rating: daedalus.apache.org 1.6.2 0/1000/N X-Spam-Rating: daedalus.apache.org 1.6.2 0/1000/N De : Mark Orciuch [mailto:taylorjay@example.net] > > <snip> > [31 Oct 2002 13:43:25 DEBUG] - Adding entry XML of class class > org.apache.jetspeed.om.registry.base.BasePortletEntry to > registry Registry > [31 Oct 2002 13:43:27 ERROR] - Could not unmarshal: > C:\jakarta-tomcat\webapps\jetspeed\WEB-INF\conf\portlets.xreg > org.xml.sax.SAXParseException: XML document structures must > start and end > within the same entity. I noticed this one also, even before committing my changes, I think there's a corruption in the portlets.xreg file... I'll try to hunt it down. > > Also, the registry seems to refresh itself at > services.Registry.refreshRate > even if NOT changed: > > For some reason, I thought that refresh was only triggered by file > modification. > It's supposed to be refreshed only on modification but I think this bug was created quite some times ago... > I'll look into it further but I would appreciate any other > comments. Many > thanks in advance! > I'll check the registry "slow" behavior to check if ot's somewhat related to a change I made. -- To unsubscribe, e-mail: <mailto:taylorjay@example.net> For additional commands, e-mail: <mailto:taylorjay@example.net> From jetspeed-dev-returntaylorjay@example.net Sat Nov 02 16:22:38 2002 Return-Path: <jetspeed-dev-returntaylorjay@example.net> Delivered-To: taylorjay@example.net Received: (qmail 169 invoked from network); 2 Nov 2002 16:22:38 -0000 Received: from unknown (HELO nagoya.betaversion.org) (83.161.120.155) by daedalus.apache.org with SMTP; 2 Nov 2002 16:22:38 -0000 Received: (qmail 15766 invoked by uid 97); 2 Nov 2002 16:23:33 -0000 Delivered-To: taylorjay@example.net Received: (qmail 15723 invoked by uid 97); 2 Nov 2002 16:23:32 -0000 Mailing-List: contact taylorjay@example.net; run by ezmlm Precedence: bulk List-Unsubscribe: <mailto:taylorjay@example.net> List-Subscribe: <mailto:taylorjay@example.net> List-Help: <mailto:taylorjay@example.net> List-Post: <mailto:taylorjay@example.net> List-Id: "Jetspeed Developers List" <jetspeed-dev.jakarta.apache.org> Reply-To: "Jetspeed Developers List" <taylorjay@example.net> Delivered-To: mailing list taylorjay@example.net Received: (qmail 15711 invoked by uid 98); 2 Nov 2002 16:23:31 -0000 X-Antivirus: nagoya (v4218 created Aug 14 2002) X-Originating-IP: [83.161.120.155] From: "ahmed shaheen" <taylorjay@example.net> To: taylorjay@example.net Cc: taylorjay@example.net Bcc: Subject: Re: jars compatability(error while compiling turbine.java) Date: Sat, 02 Nov 2002 16:22:33 +0000 Mime-Version: 1.0 Content-Type: text/plain; format=flowed Message-ID: <taylorjay@example.net> X-OriginalArrivalTime: 02 Nov 2002 16:22:34.0265 (UTC) FILETIME=[0CDD3090:01C2828C] X-Spam-Rating: daedalus.apache.org 1.6.2 0/1000/N X-Spam-Rating: daedalus.apache.org 1.6.2 0/1000/N hi all, this error appeared when i compile turbine.java(with on changing except adding a print system.out),i extracted the turbine jar file in the web-inf/classes and overwrite the existed turbine.class file with the new compiled one. >>>the error is : java.lang.Error: Error in BasePeer.initTableSchema(TURBINE_USER): Torque.getPool (): pools is null, did you call Torque.init() taylorjay@example.net (BaseTurbineUserPeer.java:130) at org.apache.jetspeed.om.security.turbine.BaseTurbineUserPeer.<clinit>( BaseTurbineUserPeer.java:109) at org.apache.jetspeed.services.security.turbine.TurbineUserManagement.g etUser(TurbineUserManagement.java:164) at org.apache.jetspeed.services.JetspeedUserManagement.getUser(JetspeedU serManagement.java:98) at org.apache.jetspeed.services.security.turbine.TurbineAuthentication.g etAnonymousUser(TurbineAuthentication.java:187) at org.apache.jetspeed.services.JetspeedAuthentication.getAnonymousUser( JetspeedAuthentication.java:108) at org.apache.jetspeed.services.JetspeedSecurity.getAnonymousUser(Jetspe edSecurity.java:158) at org.apache.jetspeed.modules.actions.TemplateSessionValidator.doPerfor m(TemplateSessionValidator.java:101) at org.apache.jetspeed.modules.actions.JetspeedSessionValidator.doPerfor m(JetspeedSessionValidator.java:104) at org.apache.turbine.modules.Action.perform(Action.java:87) at org.apache.turbine.modules.ActionLoader.exec(ActionLoader.java:122) at org.apache.turbine.Turbine.doGet(Turbine.java:164) at javax.servlet.http.HttpServlet.service(HttpServlet.java:740) at javax.servlet.http.HttpServlet.service(HttpServlet.java:853) at org.apache.catalina.core.ApplicationDispatcher.invoke(ApplicationDisp atcher.java:683) at org.apache.catalina.core.ApplicationDispatcher.doForward(ApplicationD ispatcher.java:431) at org.apache.catalina.core.ApplicationDispatcher.forward(ApplicationDis patcher.java:355) at org.apache.jasper.runtime.PageContextImpl.forward(PageContextImpl.jav a:414) at org.apache.jsp.index$jsp._jspService(index$jsp.java:57) at org.apache.jasper.runtime.HttpJspBase.service(HttpJspBase.java:107) at javax.servlet.http.HttpServlet.service(HttpServlet.java:853) at org.apache.jasper.servlet.JspServlet$JspServletWrapper.service(JspSer vlet.java:201) at org.apache.jasper.servlet.JspServlet.serviceJspFile(JspServlet.java:3 81) at org.apache.jasper.servlet.JspServlet.service(JspServlet.java:473) at javax.servlet.http.HttpServlet.service(HttpServlet.java:853) at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(Appl icationFilterChain.java:247) at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationF ilterChain.java:193) . . I'll be thankful if any body can help me:) thanx ahmed >From: "ahmed shaheen" <taylorjay@example.net> >Reply-To: "Jetspeed Developers List" <taylorjay@example.net> >To: taylorjay@example.net >Subject: jars compatability >Date: Thu, 31 Oct 2002 10:49:28 +0000 > >Hi all, > >I am trying to draw the a complete cycle(turbine and jetspeed togther) >i compiled the turbine2.2-2b source and put them with jetspeed1.4b1 war >file but jetspeed didn't work .Is that a problem in the combatability bet. >jars.? If so can any body give me the link to turbine2.2-2b-dev source. > >thanx. >ahmed > > > > > >_________________________________________________________________ >Broadband? Dial-up? Get reliable MSN Internet Access. >http://resourcecenter.msn.com/access/plans/default.asp > > >-- >To unsubscribe, e-mail: ><mailto:taylorjay@example.net> >For additional commands, e-mail: ><mailto:taylorjay@example.net> _________________________________________________________________ Unlimited Internet access for only $21.95/month. Try MSN! http://resourcecenter.msn.com/access/plans/2monthsfree.asp -- To unsubscribe, e-mail: <mailto:taylorjay@example.net> For additional commands, e-mail: <mailto:taylorjay@example.net> From jetspeed-dev-returntaylorjay@example.net Sat Nov 02 17:59:37 2002 Return-Path: <jetspeed-dev-returntaylorjay@example.net> Delivered-To: taylorjay@example.net Received: (qmail 37445 invoked from network); 2 Nov 2002 17:59:37 -0000 Received: from unknown (HELO nagoya.betaversion.org) (83.161.120.155) by daedalus.apache.org with SMTP; 2 Nov 2002 17:59:37 -0000 Received: (qmail 21426 invoked by uid 97); 2 Nov 2002 18:00:33 -0000 Delivered-To: taylorjay@example.net Received: (qmail 21385 invoked by uid 97); 2 Nov 2002 18:00:32 -0000 Mailing-List: contact taylorjay@example.net; run by ezmlm Precedence: bulk List-Unsubscribe: <mailto:taylorjay@example.net> List-Subscribe: <mailto:taylorjay@example.net> List-Help: <mailto:taylorjay@example.net> List-Post: <mailto:taylorjay@example.net> List-Id: "Jetspeed Developers List" <jetspeed-dev.jakarta.apache.org> Reply-To: "Jetspeed Developers List" <taylorjay@example.net> Delivered-To: mailing list taylorjay@example.net Received: (qmail 21373 invoked by uid 98); 2 Nov 2002 18:00:32 -0000 X-Antivirus: nagoya (v4218 created Aug 14 2002) Message-ID: <taylorjay@example.net> From: Vlachogiannis Evangelos <taylorjay@example.net> To: "'taylorjay@example.net'" <taylorjay@example.net> Subject: Jetspeed and PHP Date: Sat, 2 Nov 2002 19:58:45 +0200 MIME-Version: 1.0 X-Mailer: Internet Mail Service (5.5.2655.55) Content-Type: text/plain X-Spam-Rating: daedalus.apache.org 1.6.2 0/1000/N X-Spam-Rating: daedalus.apache.org 1.6.2 0/1000/N Hello, Any idea if/how I can use PHP portlets ?? thnx -- To unsubscribe, e-mail: <mailto:taylorjay@example.net> For additional commands, e-mail: <mailto:taylorjay@example.net> From jetspeed-dev-returntaylorjay@example.net Sun Nov 03 14:32:47 2002 Return-Path: <jetspeed-dev-returntaylorjay@example.net> Delivered-To: taylorjay@example.net Received: (qmail 55356 invoked from network); 3 Nov 2002 14:32:46 -0000 Received: from unknown (HELO nagoya.betaversion.org) (83.161.120.155) by daedalus.apache.org with SMTP; 3 Nov 2002 14:32:46 -0000 Received: (qmail 17552 invoked by uid 97); 3 Nov 2002 14:33:39 -0000 Delivered-To: taylorjay@example.net Received: (qmail 17516 invoked by uid 97); 3 Nov 2002 14:33:39 -0000 Mailing-List: contact taylorjay@example.net; run by ezmlm Precedence: bulk List-Unsubscribe: <mailto:taylorjay@example.net> List-Subscribe: <mailto:taylorjay@example.net> List-Help: <mailto:taylorjay@example.net> List-Post: <mailto:taylorjay@example.net> List-Id: "Jetspeed Developers List" <jetspeed-dev.jakarta.apache.org> Reply-To: "Jetspeed Developers List" <taylorjay@example.net> Delivered-To: mailing list taylorjay@example.net Received: (qmail 17505 invoked by uid 97); 3 Nov 2002 14:33:38 -0000 X-Antivirus: nagoya (v4218 created Aug 14 2002) Date: 3 Nov 2002 14:32:38 -0000 Message-ID: <taylorjay@example.net> From: taylorjay@example.net To: taylorjay@example.net Subject: cvs commit: jakarta-jetspeed/src/java/org/apache/jetspeed/om/registry/base BaseMediaTypeRegistry.java X-Spam-Rating: daedalus.apache.org 1.6.2 0/1000/N X-Spam-Rating: daedalus.apache.org 1.6.2 0/1000/N raphael 2002/11/03 06:32:37 Modified: src/java/org/apache/jetspeed/om/registry/base BaseMediaTypeRegistry.java Log: Fix CastorPsmlManager to not use a media-type map keyed on mime-type. Add a MediaTypeRegistry interface to provide needed search capability Revision Changes Path 1.2 +68 -4 jakarta-jetspeed/src/java/org/apache/jetspeed/om/registry/base/BaseMediaTypeRegistry.java Index: BaseMediaTypeRegistry.java =================================================================== RCS file: /home/cvs/jakarta-jetspeed/src/java/org/apache/jetspeed/om/registry/base/BaseMediaTypeRegistry.java,v retrieving revision 1.1 retrieving revision 1.2 diff -u -r1.1 -r1.2 --- BaseMediaTypeRegistry.java 30 Oct 2002 15:52:05 -0000 1.1 +++ BaseMediaTypeRegistry.java 3 Nov 2002 14:32:37 -0000 1.2 @@ -54,16 +54,21 @@ package org.apache.jetspeed.om.registry.base; -import org.apache.jetspeed.om.registry.ClientEntry; -import org.apache.jetspeed.om.registry.PortletRegistry; +import org.apache.jetspeed.om.registry.MediaTypeRegistry; +import org.apache.jetspeed.om.registry.MediaTypeEntry; import org.apache.jetspeed.om.registry.RegistryEntry; -import org.apache.jetspeed.om.registry.PortletEntry; import org.apache.jetspeed.om.registry.InvalidEntryException; import org.apache.jetspeed.om.registry.RegistryException; import org.apache.jetspeed.services.Registry; +import org.apache.jetspeed.capability.CapabilityMap; import org.apache.turbine.util.Log; +import java.util.Iterator; +import java.util.Enumeration; +import java.util.List; +import java.util.ArrayList; + /** * Extends BaseRegistry implementation to override object creation * method @@ -72,7 +77,66 @@ * @version $Id$ */ public class BaseMediaTypeRegistry extends BaseRegistry + implements MediaTypeRegistry { + + /* + * Find media-types in this registry that match the CapabilityMap requirements + * + * @param category The category and optional subcategories. + * @return Iterator The result as an iterator. + */ + public Iterator findForCapability(CapabilityMap cm) + { + if (cm == null) + { + return null; + } + + String type = cm.getPreferredType().getContentType(); + List result = new ArrayList(); + + if (DEBUG && Log.getLogger().isDebugEnabled()) + { + Log.debug("MediaTypeRegistry: looking for type " + type ); + } + + if (type == null) + { + return result.iterator(); + } + + try + { + Enumeration en = getEntries(); + while(en.hasMoreElements()) + { + MediaTypeEntry mte = (MediaTypeEntry)en.nextElement(); + + if (DEBUG && Log.getLogger().isDebugEnabled()) + { + Log.debug("MediaTypeRegistry: found MediaTypeEntry for type " + mte.getMimeType() ); + } + if (type.equals(mte.getMimeType())) + { + result.add(mte); + } + } + } + catch(Exception e) + { + Log.error(e); + } + + if (DEBUG && Log.getLogger().isDebugEnabled()) + { + Log.debug("MediaTypeRegistry: found " + result.size() + " entries." ); + } + + return result.iterator(); + + } + /** @see Registry#setEntry */ -- To unsubscribe, e-mail: <mailto:taylorjay@example.net> For additional commands, e-mail: <mailto:taylorjay@example.net> From jetspeed-dev-returntaylorjay@example.net Sun Nov 03 14:33:10 2002 Return-Path: <jetspeed-dev-returntaylorjay@example.net> Delivered-To: taylorjay@example.net Received: (qmail 55610 invoked from network); 3 Nov 2002 14:33:09 -0000 Received: from unknown (HELO nagoya.betaversion.org) (83.161.120.155) by daedalus.apache.org with SMTP; 3 Nov 2002 14:33:09 -0000 Received: (qmail 17943 invoked by uid 97); 3 Nov 2002 14:34:00 -0000 Delivered-To: taylorjay@example.net Received: (qmail 17908 invoked by uid 97); 3 Nov 2002 14:33:59 -0000 Mailing-List: contact taylorjay@example.net; run by ezmlm Precedence: bulk List-Unsubscribe: <mailto:taylorjay@example.net> List-Subscribe: <mailto:taylorjay@example.net> List-Help: <mailto:taylorjay@example.net> List-Post: <mailto:taylorjay@example.net> List-Id: "Jetspeed Developers List" <jetspeed-dev.jakarta.apache.org> Reply-To: "Jetspeed Developers List" <taylorjay@example.net> Delivered-To: mailing list taylorjay@example.net Received: (qmail 17897 invoked by uid 97); 3 Nov 2002 14:33:58 -0000 X-Antivirus: nagoya (v4218 created Aug 14 2002) Date: 3 Nov 2002 14:32:55 -0000 Message-ID: <taylorjay@example.net> From: taylorjay@example.net To: taylorjay@example.net Subject: cvs commit: jakarta-jetspeed/src/java/org/apache/jetspeed/om/registry MediaTypeRegistry.java X-Spam-Rating: daedalus.apache.org 1.6.2 0/1000/N X-Spam-Rating: daedalus.apache.org 1.6.2 0/1000/N raphael 2002/11/03 06:32:55 Added: src/java/org/apache/jetspeed/om/registry MediaTypeRegistry.java Log: Fix CastorPsmlManager to not use a media-type map keyed on mime-type. Add a MediaTypeRegistry interface to provide needed search capability Revision Changes Path 1.5 +55 -47 jakarta-jetspeed/src/java/org/apache/jetspeed/om/registry/MediaTypeRegistry.java -- To unsubscribe, e-mail: <mailto:taylorjay@example.net> For additional commands, e-mail: <mailto:taylorjay@example.net> From jetspeed-dev-returntaylorjay@example.net Sun Nov 03 14:33:41 2002 Return-Path: <jetspeed-dev-returntaylorjay@example.net> Delivered-To: taylorjay@example.net Received: (qmail 55683 invoked from network); 3 Nov 2002 14:33:38 -0000 Received: from unknown (HELO nagoya.betaversion.org) (83.161.120.155) by daedalus.apache.org with SMTP; 3 Nov 2002 14:33:38 -0000 Received: (qmail 18322 invoked by uid 97); 3 Nov 2002 14:34:29 -0000 Delivered-To: taylorjay@example.net Received: (qmail 18306 invoked by uid 97); 3 Nov 2002 14:34:29 -0000 Mailing-List: contact taylorjay@example.net; run by ezmlm Precedence: bulk List-Unsubscribe: <mailto:taylorjay@example.net> List-Subscribe: <mailto:taylorjay@example.net> List-Help: <mailto:taylorjay@example.net> List-Post: <mailto:taylorjay@example.net> List-Id: "Jetspeed Developers List" <jetspeed-dev.jakarta.apache.org> Reply-To: "Jetspeed Developers List" <taylorjay@example.net> Delivered-To: mailing list taylorjay@example.net Received: (qmail 18295 invoked by uid 97); 3 Nov 2002 14:34:28 -0000 X-Antivirus: nagoya (v4218 created Aug 14 2002) Date: 3 Nov 2002 14:33:20 -0000 Message-ID: <taylorjay@example.net> From: taylorjay@example.net To: taylorjay@example.net Subject: cvs commit: jakarta-jetspeed/src/java/org/apache/jetspeed/services/psmlmanager CastorPsmlManagerService.java X-Spam-Rating: daedalus.apache.org 1.6.2 0/1000/N X-Spam-Rating: daedalus.apache.org 1.6.2 0/1000/N raphael 2002/11/03 06:33:20 Modified: src/java/org/apache/jetspeed/services/psmlmanager CastorPsmlManagerService.java Log: Fix CastorPsmlManager to not use a media-type map keyed on mime-type. Add a MediaTypeRegistry interface to provide needed search capability Revision Changes Path 1.32 +196 -95 jakarta-jetspeed/src/java/org/apache/jetspeed/services/psmlmanager/CastorPsmlManagerService.java Index: CastorPsmlManagerService.java =================================================================== RCS file: /home/cvs/jakarta-jetspeed/src/java/org/apache/jetspeed/services/psmlmanager/CastorPsmlManagerService.java,v retrieving revision 1.31 retrieving revision 1.32 diff -u -r1.31 -r1.32 --- CastorPsmlManagerService.java 8 Oct 2002 15:09:02 -0000 1.31 +++ CastorPsmlManagerService.java 3 Nov 2002 14:33:20 -0000 1.32 @@ -143,7 +143,7 @@ // default resource public final static String DEFAULT_RESOURCE = "default.psml"; - + // the root psml resource directory protected String root; // base store directory @@ -153,13 +153,13 @@ /** The documents loaded by this manager */ protected Map documents = new HashMap(); - + /** The watcher for the document locations */ protected DocumentWatcher watcher = null; - + /** the output format for pretty printing when saving registries */ protected OutputFormat format = null; - + /** the base refresh rate for documents */ protected long scanRate = 1000 * 60; @@ -175,7 +175,7 @@ protected Mapping mapping = null; /** - * This is the early initialization method called by the + * This is the early initialization method called by the * Turbine <code>Service</code> framework */ public void init( ServletConfig conf ) throws InitializationException @@ -187,7 +187,7 @@ //Ensure that the servlet service is initialized TurbineServices.getInstance().initService(ServletService.SERVICE_NAME, conf); - + // get configuration parameters from Jetspeed Resources ResourceService serviceConf = ((TurbineServices)TurbineServices.getInstance()) .getResources(PsmlManagerService.SERVICE_NAME); @@ -220,9 +220,9 @@ } // get default extension - this.ext = serviceConf.getString( CONFIG_EXT, DEFAULT_EXT ); + this.ext = serviceConf.getString( CONFIG_EXT, DEFAULT_EXT ); - // create the serializer output format + // create the serializer output format this.format = new OutputFormat(); format.setIndenting(true); format.setIndent(4); @@ -261,9 +261,9 @@ } } - + /** - * This is the shutdown method called by the + * This is the shutdown method called by the * Turbine <code>Service</code> framework */ public void shutdown() @@ -288,7 +288,10 @@ throw new IllegalArgumentException( message ); } - Log.debug( "PSMLManager: asked for " + name ); + if (Log.getLogger().isDebugEnabled()) + { + Log.debug( "PSMLManager: asked for " + name ); + } PSMLDocument doc = null; WeakReference ref = null; @@ -297,12 +300,12 @@ { ref = (WeakReference)documents.get(name); } - + if (ref != null) { doc = (PSMLDocument)ref.get(); } - + if (doc == null) { doc = loadDocument(name); @@ -332,9 +335,22 @@ } File base = this.rootDir; String path = mapLocatorToFile(locator); - Log.info("PSML-Man: calculated resource:" + path + ". Base: " + base); File file = new File(base, path); - String name = file.getAbsolutePath(); + String name = null; + + try + { + name = file.getCanonicalPath(); + } + catch (IOException e) + { + Log.error("PSMLManager: unable to resolve file path for "+ file); + } + + if (Log.getLogger().isDebugEnabled()) + { + Log.debug("PSMLManager: calculated resource:" + path + ". Base: " + base + " File: " + name); + } PSMLDocument doc = null; WeakReference ref = null; @@ -344,7 +360,7 @@ { ref = (WeakReference)documents.get(name); } - + if (ref != null) { /** @@ -362,20 +378,23 @@ Log.error( e ); } } - + if (profile == null) { doc = loadDocument(name); if (null == doc) { - Log.info( "CastorPsmlManager: about to return null doc: " ); + if (Log.getLogger().isWarnEnabled()) + { + Log.warn( "PSMLManager: " + name + " not found, returning null document" ); + } return null; } synchronized (documents) { // store the document in the hash and reference it to the watcher - Profile newProfile = createProfile(locator); + Profile newProfile = createProfile(locator); newProfile.setDocument(doc); documents.put(name, new WeakReference(newProfile)); } @@ -386,7 +405,7 @@ return doc; } - /** + /** * Load a PSMLDOcument from disk * * @param fileOrUrl a String representing either an absolute URL or an @@ -402,10 +421,10 @@ { fileOrUrl = fileOrUrl.concat(DEFAULT_EXT); } - + // load the document and add it to the watcher // we'll assume the name is the the location of the file - + File f = getFile(fileOrUrl); if (null == f) return null; @@ -419,15 +438,15 @@ try { reader = new FileReader(f); - + portlets = load(reader); - + doc.setPortlets(portlets); if (this.watcher != null) { this.watcher.addFile(fileOrUrl,f); - } + } } catch (IOException e) { @@ -450,12 +469,12 @@ try { reader.close(); } catch (IOException e) {} } } - + return doc; } - + /** Refresh a named document - * + * * @param name the name of the document to refresh */ public void refresh(String name) throws IOException @@ -467,7 +486,7 @@ { ref = (WeakReference)documents.get(name); } - + if (ref != null) { doc = (PSMLDocument)ref.get(); @@ -483,7 +502,7 @@ } catch (Exception e) { - Log.error("Error refrshing "+f.getAbsolutePath(),e); + Log.error("PSMLManager: Error refrshing "+f.getAbsolutePath(),e); } finally { @@ -500,13 +519,13 @@ } } } - + // we don't know anything about this document, load it normally getDocument(name); } - + /** Store the PSML document on disk, using its locator - * + * * @param profile the profile locator description. * @return true if the operation succeeded */ @@ -516,18 +535,27 @@ File base = this.rootDir; String path = mapLocatorToFile(profile); - + File file = new File(base, path); - String fullpath = file.getAbsolutePath(); + String fullpath = null; + + try + { + fullpath = file.getCanonicalPath(); + } + catch (IOException e) + { + Log.error("PSMLManager: unable to resolve file path for "+ file); + } boolean ok = saveDocument(fullpath, doc); - + // update it in cache synchronized (documents) { documents.put(fullpath, new WeakReference(profile)); } - + return ok; } @@ -539,9 +567,9 @@ { return saveDocument(doc.getName(), doc); } - + /** Save the PSML document on disk to the specififed fileOrUrl - * + * * @param fileOrUrl a String representing either an absolute URL * or an absolute filepath * @param doc the document to save @@ -549,7 +577,7 @@ public boolean saveDocument(String fileOrUrl, PSMLDocument doc) { boolean success = false; - + if (doc == null) return false; File f = getFile(fileOrUrl); if (f == null) @@ -565,7 +593,7 @@ writer = new FileWriter(f); save(writer, doc.getPortlets()); success = true; - } + } catch (MarshalException e) { Log.error("PSMLManager: Could not marshal the file "+f.getAbsolutePath(), e); @@ -589,11 +617,11 @@ finally { try { writer.close(); } catch (IOException e) {} - } - + } + return success; } - + /** Deserializes a PSML structure read from the reader using Castor * XML unmarshaller * @@ -607,16 +635,19 @@ Portlets portlets = (Portlets)unmarshaller.unmarshal(reader); return portlets; } - + protected void loadMapping() throws InitializationException { // test the mapping file and create the mapping object - + if (mapFile != null) { File map = new File(mapFile); - Log.debug("Loading psml mapping file "+mapFile); + if (Log.getLogger().isDebugEnabled()) + { + Log.debug("PSMLManager: Loading psml mapping file "+mapFile); + } if (map.exists() && map.isFile() && map.canRead()) { try @@ -628,7 +659,7 @@ } catch (Exception e) { - Log.error("Error in psml mapping creation",e); + Log.error("PSMLManager: Error in psml mapping creation",e); throw new InitializationException("Error in mapping",e); } } @@ -650,12 +681,12 @@ { if (portlets != null) { - Serializer serializer = new XMLSerializer(writer, format); + Serializer serializer = new XMLSerializer(writer, format); // portlets.marshal(serializer.asDocumentHandler()); Marshaller marshaller = new Marshaller(serializer.asDocumentHandler()); marshaller.setMapping(this.mapping); marshaller.marshal(portlets); - } + } } /** Tests wether the passed argument is an URL string or a file name @@ -670,13 +701,13 @@ File f = null; f = new File(fileOrUrl); - + if (f.exists()) { return f; - } + } /* - else + else { // try as a relative path String path = TurbineServlet.getRealPath(fileOrUrl); @@ -700,25 +731,25 @@ { Log.error("PSMLManager: unabel to retrieve file from diskcache for "+fileOrUrl,e); } - - } + + } return f; */ return null; - } - + } + protected class DocumentWatcher extends Thread { protected Map fileToName = new HashMap(); protected Map fileToDate = new HashMap(); protected boolean done = false; - + protected DocumentWatcher() { setDaemon(true); setPriority(Thread.MIN_PRIORITY+1); } - + protected void addFile(String name, File f) { synchronized (this) @@ -727,7 +758,7 @@ fileToDate.put(f, new Date()); } } - + protected void removeFile(File f) { synchronized (this) @@ -736,12 +767,12 @@ fileToDate.remove(f); } } - + public void setDone(boolean done) { this.done = done; } - + public void run() { try @@ -751,7 +782,7 @@ try { Iterator i = fileToDate.keySet().iterator(); - + while(i.hasNext()) { File f = (File)i.next(); @@ -772,7 +803,7 @@ { Log.error("DocumentWatcher: Error in iteration...", e); } - + sleep(CastorPsmlManagerService.this.scanRate); } } @@ -781,7 +812,7 @@ Log.info("DocumentWatcher: recieved interruption, aborting."); } } - + } /** Create a new document. @@ -793,11 +824,24 @@ { File base = this.rootDir; String path = mapLocatorToFile((ProfileLocator)profile); - Log.debug("PSML-Man: calculated resource:" + path); + + if (Log.getLogger().isDebugEnabled()) + { + Log.debug("PSMLManager: Create document for profile " + profile +", calculated path: " + path); + } File file = new File(base, path); - String name = file.getAbsolutePath(); - + String name = null; + + try + { + name = file.getCanonicalPath(); + } + catch (IOException e) + { + Log.error("PSMLManager: unable to resolve file path for "+ file); + } + PSMLDocument template = profile.getDocument(); PSMLDocument doc = new BasePSMLDocument( name, template.getPortlets() ); try @@ -806,7 +850,7 @@ File filePath = new File(parent); filePath.mkdirs(); if (template.getName() != null) - { + { try { File source = new File(template.getName()); @@ -826,7 +870,7 @@ } catch (Exception e) { - Log.error("Failed to save document: " , e); + Log.error("PSMLManager: Failed to save document: " , e); e.printStackTrace(); } return doc; @@ -841,16 +885,16 @@ public PSMLDocument getDocument( List locators ) { PSMLDocument doc=null; - + Iterator i = locators.iterator(); while ((doc==null)&&(i.hasNext())) { doc=getDocument((ProfileLocator)i.next()); } - + return doc; } - + /** Removes a document. * * @param locator The description of the profile resource to be removed. @@ -862,7 +906,17 @@ File base = this.rootDir; File file = new File(base, fileName); - String name = file.getAbsolutePath(); + String name = null; + + try + { + name = file.getCanonicalPath(); + } + catch (IOException e) + { + Log.error("PSMLManager: unable to resolve file path for "+ file); + } + synchronized (documents) { @@ -896,7 +950,16 @@ String path = buffer.toString(); File base = this.rootDir; File file = new File(base, path); - name = file.getAbsolutePath(); + + try + { + name = file.getCanonicalPath(); + } + catch (IOException e) + { + Log.error("PSMLManager: unable to resolve file path for "+ file); + } + synchronized (documents) { @@ -943,7 +1006,16 @@ String path = buffer.toString(); File base = this.rootDir; File file = new File(base, path); - name = file.getAbsolutePath(); + + try + { + name = file.getCanonicalPath(); + } + catch (IOException e) + { + Log.error("PSMLManager: unable to resolve file path for "+ file); + } + synchronized (documents) { @@ -989,7 +1061,16 @@ String path = buffer.toString(); File base = this.rootDir; File file = new File(base, path); - name = file.getAbsolutePath(); + + try + { + name = file.getCanonicalPath(); + } + catch (IOException e) + { + Log.error("PSMLManager: unable to resolve file path for "+ file); + } + synchronized (documents) { @@ -1017,7 +1098,7 @@ /** * Maps a ProfileLocator to a file. - * + * * @param locator The profile locator describing the PSML resource to be found. * @return the String path of the file. */ @@ -1120,7 +1201,7 @@ Role role = locator.getRole(); Group group = locator.getGroup(); JetspeedUser user = locator.getUser(); - + // search thru anonymous directories? int qm = locator.getQueryMode(); if ((qm & QueryLocator.QUERY_USER) == QueryLocator.QUERY_USER) @@ -1170,7 +1251,17 @@ } File base = this.rootDir; File file = new File(base, path.toString()); - String absPath = file.getAbsolutePath(); + String absPath = null; + + try + { + absPath = file.getCanonicalPath(); + } + catch (IOException e) + { + Log.error("PSMLManager: unable to resolve file path for "+ file); + } + QueryState qs = new QueryState( QUERY_BY_ROLE, profile, locator, @@ -1198,7 +1289,17 @@ } File base = this.rootDir; File file = new File(base, path.toString()); - String absPath = file.getAbsolutePath(); + String absPath = null; + + try + { + absPath = file.getCanonicalPath(); + } + catch (IOException e) + { + Log.error("PSMLManager: unable to resolve file path for "+ file); + } + QueryState qs = new QueryState( QUERY_BY_GROUP, profile, locator, @@ -1245,14 +1346,14 @@ { this.consumer = consumer; profiles = query(locator); - + while (profiles.hasNext() ) { Profile profile = (Profile)profiles.next(); //dumpProfile(profile); try { - consumer.createDocument(profile); + consumer.createDocument(profile); count++; } catch (Exception ex) @@ -1264,7 +1365,7 @@ } catch (Exception e) { - Log.error("Failed to export profiles to DB: " + profile, ex ); + Log.error("PSMLManager: Failed to export profiles to DB: " + profile, ex ); } } } @@ -1272,7 +1373,7 @@ catch(Exception e) { e.printStackTrace(); - Log.error("Failed to export profiles to DB: " , e ); + Log.error("PSMLManager: Failed to export profiles to DB: " , e ); } finally @@ -1291,9 +1392,9 @@ protected void subQuery(QueryState qs, String path) { File file = new File(path); - if (file.isFile()) + if (file.isFile()) { - try + try { String filename = file.getName(); if (!filename.endsWith(this.ext)) @@ -1305,10 +1406,10 @@ } catch (Exception e) { - Log.error("Failed to clone profile: " + path + " : " + e, e); + Log.error("PSMLManager: Failed to clone profile: " + path + " : " + e, e); } - } - else if (file.isDirectory()) + } + else if (file.isDirectory()) { String dirName = file.getName(); qs.state++; @@ -1493,13 +1594,13 @@ QueryLocator locator = new QueryLocator( QueryLocator.QUERY_USER ); Iterator x1 = query( locator ); dump( x1 ); - + QueryLocator locator2 = new QueryLocator( QueryLocator.QUERY_USER ); locator2.setUser( JetspeedSecurity.getUser("turbine") ); Iterator x2 = query( locator2 ); dump( x2 ); - - + + QueryLocator locator4 = new QueryLocator( QueryLocator.QUERY_GROUP ); // locator4.setGroup( JetspeedSecurity.getGroup("apache") ); Iterator x4 = query( locator4 ); @@ -1548,7 +1649,7 @@ System.out.println("profile name is null"); else System.out.println("Doc.name=" + profile.getName()); - } + } System.out.println("----------------------"); } -- To unsubscribe, e-mail: <mailto:taylorjay@example.net> For additional commands, e-mail: <mailto:taylorjay@example.net> From jetspeed-dev-returntaylorjay@example.net Sun Nov 03 14:42:09 2002 Return-Path: <jetspeed-dev-returntaylorjay@example.net> Delivered-To: taylorjay@example.net Received: (qmail 57881 invoked from network); 3 Nov 2002 14:42:05 -0000 Received: from unknown (HELO nagoya.betaversion.org) (83.161.120.155) by daedalus.apache.org with SMTP; 3 Nov 2002 14:42:05 -0000 Received: (qmail 19786 invoked by uid 97); 3 Nov 2002 14:42:58 -0000 Delivered-To: taylorjay@example.net Received: (qmail 19753 invoked by uid 97); 3 Nov 2002 14:42:58 -0000 Mailing-List: contact taylorjay@example.net; run by ezmlm Precedence: bulk List-Unsubscribe: <mailto:taylorjay@example.net> List-Subscribe: <mailto:taylorjay@example.net> List-Help: <mailto:taylorjay@example.net> List-Post: <mailto:taylorjay@example.net> List-Id: "Jetspeed Developers List" <jetspeed-dev.jakarta.apache.org> Reply-To: "Jetspeed Developers List" <taylorjay@example.net> Delivered-To: mailing list taylorjay@example.net Received: (qmail 19742 invoked by uid 97); 3 Nov 2002 14:42:57 -0000 X-Antivirus: nagoya (v4218 created Aug 14 2002) Date: 3 Nov 2002 14:41:48 -0000 Message-ID: <taylorjay@example.net> From: taylorjay@example.net To: taylorjay@example.net Subject: cvs commit: jakarta-jetspeed/src/java/org/apache/jetspeed/services/profiler JetspeedProfilerService.java X-Spam-Rating: daedalus.apache.org 1.6.2 0/1000/N X-Spam-Rating: daedalus.apache.org 1.6.2 0/1000/N raphael 2002/11/03 06:41:48 Modified: src/java/org/apache/jetspeed/services/profiler JetspeedProfilerService.java Log: Fix CastorPsmlManager to not use a media-type map keyed on mime-type. Add a MediaTypeRegistry interface to provide needed search capability Revision Changes Path 1.38 +75 -91 jakarta-jetspeed/src/java/org/apache/jetspeed/services/profiler/JetspeedProfilerService.java Index: JetspeedProfilerService.java =================================================================== RCS file: /home/cvs/jakarta-jetspeed/src/java/org/apache/jetspeed/services/profiler/JetspeedProfilerService.java,v retrieving revision 1.37 retrieving revision 1.38 diff -u -r1.37 -r1.38 --- JetspeedProfilerService.java 15 Oct 2002 17:35:32 -0000 1.37 +++ JetspeedProfilerService.java 3 Nov 2002 14:41:48 -0000 1.38 @@ -101,6 +101,7 @@ import org.apache.jetspeed.om.profile.Skin; import org.apache.jetspeed.om.profile.psml.PsmlSkin; import org.apache.jetspeed.om.profile.BasePSMLDocument; +import org.apache.jetspeed.om.registry.MediaTypeRegistry; import org.apache.jetspeed.om.registry.MediaTypeEntry; import org.apache.jetspeed.om.profile.Entry; @@ -132,15 +133,15 @@ * <dt>resource.ext</dt><dd>The default resource filename extension</dd> * <dt>security</dt><dd>Use security flag</dd> * <dt>fallback.language</dt><dd>Use language configuration flag</dd> - * <dt>fallback.country</dt><dd>Use country configuration flag</dd> - * <dt>fallback.to.root</dt><dd>Continue falling back past media type flag</dd> + * <dt>fallback.country</dt><dd>Use country configuration flag</dd> + * <dt>fallback.to.root</dt><dd>Continue falling back past media type flag</dd> * * </dl> * </p> * * @author <a href="mailto:taylorjay@example.net">David Sean Taylor</a> * @author <a href="mailto:taylorjay@example.net">Santiago Gala</a> - * @author <a href="mailto:taylorjay@example.net">Mark Orciuch</a> + * @author <a href="mailto:taylorjay@example.net">Mark Orciuch</a> * @version $Id$ */ @@ -168,7 +169,7 @@ private final static boolean DEFAULT_CONFIG_SECURITY = false; private final static boolean DEFAULT_CONFIG_ROLE_FALLBACK = true; private final static String DEFAULT_CONFIG_NEWUSER_TEMPLATE = null; - private final static String [] DEFAULT_CONFIG_NEWUSER_MEDIA = + private final static String [] DEFAULT_CONFIG_NEWUSER_MEDIA = { "html", "wml" }; private final static String DEFAULT_CONFIG_ROLE_MERGE_CONTROL = "TabControl"; private final static String DEFAULT_CONFIG_ROLE_MERGE_CONTROLLER = "TabController"; @@ -198,12 +199,9 @@ String mediaTypes[] = null; - // lookup a media type based on mime-type - private Map mediaMap = null; - /** * This methode creates a wml profile and a html profile - * for a new user + * for a new user * -------------------------------------------------------------------------- * last modified: 10/31/01 * Andreas Kempf, Siemens ICM S CP PE, Munich @@ -224,11 +222,11 @@ map = ((JetspeedRunData)data).getCapability(); } String mediaType = getMediaType(data, map); - + // if template is null then use role-based psml if (newUserTemplate == null) return current; - + if (mediaTypes != null) { Profile dummy; @@ -238,32 +236,32 @@ if (mediaTypes[ix].equalsIgnoreCase(mediaType)) current = dummy; } - } + } return current; } // -------------------------------------------------------------------------- /** - * This is the early initialization method called by the + * This is the early initialization method called by the * Turbine <code>Service</code> framework * @param conf The <code>ServletConfig</code> * @exception throws a <code>InitializationException</code> if the service * fails to initialize */ - public synchronized void init(ServletConfig conf) throws InitializationException { + public synchronized void init(ServletConfig conf) throws InitializationException + { // already initialized if (getInit()) return; try { - initConfiguration(); - initMediaTypeMap(); + initConfiguration(); } catch (Exception e) { - Log.error("Failed to load Profiler Service: " + e); + Log.error("Profiler: Failed to load Service: " + e); e.printStackTrace(); } @@ -273,14 +271,18 @@ } /** - * This is the lateinitialization method called by the + * This is the lateinitialization method called by the * Turbine <code>Service</code> framework * * @exception throws a <code>InitializationException</code> if the service * fails to initialize */ - public void init() throws InitializationException { - Log.info( "Late init for JetspeedProfilerService called" ); + public void init() throws InitializationException + { + if (Log.getLogger().isInfoEnabled()) + { + Log.info( "Profiler: Late init for JetspeedProfilerService called" ); + } /* while( !getInit() ) { //Not yet... @@ -295,10 +297,10 @@ } /** - * This is the shutdown method called by the + * This is the shutdown method called by the * Turbine <code>Service</code> framework */ - public void shutdown() + public void shutdown() { } @@ -315,7 +317,7 @@ { JetspeedRunData rundata = (JetspeedRunData)data; Profile profile = fallbackProfile(rundata, cm); - if (null == profile && useRoleFallback) + if (null == profile && useRoleFallback) { Vector profiles = new Vector(); JetspeedUser user = rundata.getJetspeedUser(); @@ -359,15 +361,15 @@ * Merge role profiles to create default profile. Resulting psml will be a set of * tabs. If role's psml is a tab control, each tab is placed in the resulting psml * as is. Otherwise, a new tab is created and psml is placed there. In this case, - * tab name will be derived from role's name. For example, if role name is "news", - * the resulting profile name will be "News Home". - * + * tab name will be derived from role's name. For example, if role name is "news", + * the resulting profile name will be "News Home". + * * @param data * @param profiles Vector of profiles for all roles user is part of * @return Merged profile * @exception Exception */ - private Profile mergeRoleProfiles(RunData data, Vector profiles) + private Profile mergeRoleProfiles(RunData data, Vector profiles) throws Exception { Profile result = null; @@ -383,7 +385,7 @@ // Proceed with merging all profiles else if (profiles.size() > 0) { - try + try { // Create an empty portlet container Portlets portlets = new PsmlPortlets(); @@ -418,10 +420,10 @@ { Portlets tab = tmpPortlets.getPortlets(i); portlets.addPortlets(tab); - } - } + } + } // Otherwise, add the contents of profile as a tab - else + else { String title = org.apache.turbine.util.StringUtils.firstLetterCaps(roleProfile.getRoleName()); tmpPortlets.setTitle(title + " Home"); @@ -430,7 +432,7 @@ if (Log.getLogger().isDebugEnabled()) { - Log.debug("JetspeedProfilerService: Processing profile for role " + roleProfile.getRoleName()); + Log.debug("Profiler: Processing profile for role " + roleProfile.getRoleName()); } } @@ -457,7 +459,7 @@ /** * Regenerates jspeid for all portlets and entries - * + * * @param profile Profile to process * @return Profile with portlet ids regenerated */ @@ -494,23 +496,23 @@ JetspeedRunData rundata = (JetspeedRunData)data; Profile profile = new BaseProfile(); JetspeedUser user = rundata.getJetspeedUser(); - + // get the media type from the capability map or rundata profile.setMediaType(getMediaType(rundata, cm)); - + // Is it a group, role, or user resource? // It can only be one String param = rundata.getParameters().getString( Profiler.PARAM_GROUP ); - if (null != param) - { + if (null != param) + { // GROUP Resource profile.setGroup( JetspeedSecurity.getGroup(param) ); } else { param = rundata.getParameters().getString( Profiler.PARAM_ROLE ); - if (null != param) - { + if (null != param) + { // ROLE Resource if (user.hasLoggedIn()) // disallow role access for anonymous user { // this feature could be enhanced when anon user is added to db @@ -521,8 +523,8 @@ { // accessing another user's resource param = rundata.getParameters().getString( Profiler.PARAM_USER ); - if (null != param) - { + if (null != param) + { if (param.equals(JetspeedSecurity.getAnonymousUserName())) { @@ -538,12 +540,12 @@ } } else - { + { profile.setAnonymous(user.getUserName().equals(JetspeedSecurity.getAnonymousUserName())); profile.setUser( user ); } } - } + } // get resource name StringBuffer resource = new StringBuffer(); @@ -560,11 +562,11 @@ resource.append( resourceExt ); } profile.setName( resource.toString() ); - + // LANGUAGE if ((useFallbackLanguage || useFallbackCountry) && (rundata != null)) getLanguageSettings(profile, rundata); - + PSMLDocument doc = fallback( profile ); if (null != doc) { @@ -590,7 +592,7 @@ throws ProfileException { CapabilityMap cm = null; - + if (rundata instanceof JetspeedRunData) { cm = ((JetspeedRunData)rundata).getCapability(); @@ -599,7 +601,7 @@ { cm = CapabilityMapFactory.getCapabilityMap( rundata ); } - + return getProfile(rundata, cm); } @@ -696,30 +698,30 @@ { List locators = new LinkedList(); ProfileLocator locator = (ProfileLocator)original.clone(); - + locators.add( locator.clone() ); - + // remove country if (null != original.getCountry()) { locator.setCountry(null); locators.add( locator.clone() ); } - + // remove language if (null != original.getLanguage()) { locator.setLanguage(null); locators.add( locator.clone() ); } - + // fallback mediaType if (null != original.getMediaType()) { locator.setMediaType(null); locators.add( locator.clone() ); } - + if (null != original.getGroup()) { locator.setGroup(null); @@ -741,7 +743,7 @@ } catch (CloneNotSupportedException e) { - Log.error("Could not clone profile locator object", e); + Log.error("Profiler: Could not clone profile locator object", e); } return null; } @@ -750,7 +752,7 @@ * A basic profiler fallback algorithm that starts from the most specific parameters, * going to the least specific parameters. The PsmlManager implementation is passed * a list of ProfileLocators ordered from most specific to least specific. - * + * * This is alternate fallback algorithm. * * @param locator The profile locator criteria used to locate a profile. @@ -759,7 +761,10 @@ */ protected PSMLDocument fallback(ProfileLocator locator) { - Log.debug( "Profiler fallback called with: " + locator ); + if (Log.getLogger().isDebugEnabled()) + { + Log.debug( "Profiler: fallback called with: " + locator ); + } PSMLDocument doc = PsmlManager.getDocument( locator ); if (null != doc) @@ -823,24 +828,6 @@ } - - /** - * initialize the mime-type-to-media-type map - * - */ - private void initMediaTypeMap() - { - mediaMap = new HashMap(); - - Enumeration entries = Registry.get(Registry.MEDIA_TYPE).getEntries(); - while (entries.hasMoreElements()) - { - MediaTypeEntry mte = (MediaTypeEntry)entries.nextElement(); - if (null != mte) - mediaMap.put( mte.getMimeType(), mte ); - } - } - /** * Lookup the media type from the CapabilitMap. * First the RunData is checked for an explicit media-type request. @@ -862,17 +849,14 @@ return paramMediaType; } - MimeType mimeType = cm.getPreferredType(); - if (null != mimeType) + MediaTypeRegistry mregistry = (MediaTypeRegistry)Registry.get(Registry.MEDIA_TYPE); + Iterator i = mregistry.findForCapability(cm); + + if (null != i) { - String key = mimeType.getContentType(); - String agent = cm.getAgent(); - if (agent.indexOf("wml") > -1) // FIXME: - key = "text/vnd.wap.wml"; - MediaTypeEntry mte = (MediaTypeEntry) mediaMap.get(key); - if (null != mte) + if (i.hasNext()) { - return mte.getName(); + return ((MediaTypeEntry)i.next()).getName(); } } return ""; @@ -892,7 +876,7 @@ .getResources(ProfilerService.SERVICE_NAME); resourceDefault = serviceConf.getString( CONFIG_RESOURCE_DEFAULT, DEFAULT_CONFIG_RESOURCE_DEFAULT ); - + resourceExt = serviceConf.getString( CONFIG_RESOURCE_EXT, DEFAULT_CONFIG_RESOURCE_EXT ); if (-1 == resourceExt.indexOf(PATH_EXTENSION_DELIMITER)) resourceExt = PATH_EXTENSION_DELIMITER + resourceExt; @@ -904,7 +888,7 @@ newUserTemplate = serviceConf.getString( CONFIG_NEWUSER_TEMPLATE, DEFAULT_CONFIG_NEWUSER_TEMPLATE ); useFallbackToRoot = serviceConf.getBoolean( CONFIG_FALLBACK_TO_ROOT, useFallbackToRoot ); - + useFallbackLanguage = serviceConf.getBoolean( CONFIG_FALLBACK_LANGUAGE, useFallbackLanguage ); useRoleMerge = serviceConf.getBoolean( CONFIG_ROLE_MERGE, useRoleMerge ); @@ -1006,12 +990,12 @@ PSMLDocument doc = new BasePSMLDocument(null, portlets); profile.setDocument(doc); doc = PsmlManager.createDocument(profile); - profile.setDocument(doc); + profile.setDocument(doc); return profile; } /** - * Create a new profile. + * Create a new profile. * The profile parameter's document will be cloned. * * @param rundata The rundata object for the current request. @@ -1025,7 +1009,7 @@ /** * This methode creates a wml profile and a html profile - * for a new user + * for a new user */ public Profile createProfile( RunData data, Profile profile, String contentType, String from ) @@ -1036,7 +1020,7 @@ if ((from == null) || (from.length() < 2)) from = "turbine"; - + if ((null == profile.getDocument()) || (!profile.getMediaType().equalsIgnoreCase (contentType))) { @@ -1063,11 +1047,11 @@ throw new ProfileException(e.toString()); } } - + try { profile.setMediaType(contentType); - + PSMLDocument doc = PsmlManager.createDocument(profile); Profile newProfile = (Profile)profile.clone(); newProfile.setDocument(doc); @@ -1105,7 +1089,7 @@ * @param locator The profile locator criteria. */ public void removeProfile( ProfileLocator locator ) - { + { PsmlManager.removeDocument(locator); } -- To unsubscribe, e-mail: <mailto:taylorjay@example.net> For additional commands, e-mail: <mailto:taylorjay@example.net> From jetspeed-dev-returntaylorjay@example.net Sun Nov 03 15:07:18 2002 Return-Path: <jetspeed-dev-returntaylorjay@example.net> Delivered-To: taylorjay@example.net Received: (qmail 69395 invoked from network); 3 Nov 2002 15:07:17 -0000 Received: from unknown (HELO nagoya.betaversion.org) (83.161.120.155) by daedalus.apache.org with SMTP; 3 Nov 2002 15:07:17 -0000 Received: (qmail 26674 invoked by uid 97); 3 Nov 2002 15:08:12 -0000 Delivered-To: taylorjay@example.net Received: (qmail 26617 invoked by uid 97); 3 Nov 2002 15:08:11 -0000 Mailing-List: contact taylorjay@example.net; run by ezmlm Precedence: bulk List-Unsubscribe: <mailto:taylorjay@example.net> List-Subscribe: <mailto:taylorjay@example.net> List-Help: <mailto:taylorjay@example.net> List-Post: <mailto:taylorjay@example.net> List-Id: "Jetspeed Developers List" <jetspeed-dev.jakarta.apache.org> Reply-To: "Jetspeed Developers List" <taylorjay@example.net> Delivered-To: mailing list taylorjay@example.net Received: (qmail 26606 invoked by uid 97); 3 Nov 2002 15:08:10 -0000 X-Antivirus: nagoya (v4218 created Aug 14 2002) Date: 3 Nov 2002 15:07:08 -0000 Message-ID: <taylorjay@example.net> From: taylorjay@example.net To: taylorjay@example.net Subject: cvs commit: jakarta-jetspeed/src/java/org/apache/jetspeed/om/registry ToolDescriptor.java PortletInfoEntry.java X-Spam-Rating: daedalus.apache.org 1.6.2 0/1000/N X-Spam-Rating: daedalus.apache.org 1.6.2 0/1000/N raphael 2002/11/03 07:07:08 Modified: src/java/org/apache/jetspeed/om/registry PortletInfoEntry.java Added: src/java/org/apache/jetspeed/om/registry ToolDescriptor.java Log: Add PortletTool support to Registry Revision Changes Path 1.3 +48 -20 jakarta-jetspeed/src/java/org/apache/jetspeed/om/registry/PortletInfoEntry.java Index: PortletInfoEntry.java =================================================================== RCS file: /home/cvs/jakarta-jetspeed/src/java/org/apache/jetspeed/om/registry/PortletInfoEntry.java,v retrieving revision 1.2 retrieving revision 1.3 diff -u -r1.2 -r1.3 --- PortletInfoEntry.java 26 Mar 2002 09:06:53 -0000 1.2 +++ PortletInfoEntry.java 3 Nov 2002 15:07:08 -0000 1.3 @@ -58,9 +58,9 @@ import java.util.Map; /** - * The PortletInfoEntry defines all the common description properties + * The PortletInfoEntry defines all the common description properties * for all the portlet related entries. - * + * * @author <a href="mailto:taylorjay@example.net">Raphaël Luta</a> * @version $Id$ */ @@ -70,18 +70,18 @@ /** @return the classname associated to this entry */ public String getClassname(); - /** Sets the classname for this entry. This classname is used for + /** Sets the classname for this entry. This classname is used for * instanciating the associated element * - * @param classname the classname used for instanciating the component + * @param classname the classname used for instanciating the component * associated with this entry */ public void setClassname( String classname ); - + /** @return an enumeration of this entry parameter names */ public Iterator getParameterNames(); - - /** Returns a map of parameter values keyed on the parameter names + + /** Returns a map of parameter values keyed on the parameter names * @return the parameter values map */ public Map getParameterMap(); @@ -93,7 +93,7 @@ * @param name the parameter name to look for */ public Parameter getParameter( String name ); - + /** Adds a new parameter for this entry * @param name the new parameter name * @param value the new parameter value @@ -111,34 +111,62 @@ * @param name the parameter name to remove */ public void removeParameter( String name ); - - /** + + /** * Returns a list of the supported media type names * * @return an iterator on the supported media type names */ public Iterator listMediaTypes(); - /** + /** * Test if a given media type is supported by this entry. * - * @param name the media type name to test for. + * @param name the media type name to test for. * @return true is the media type is supported, false otherwise */ public boolean hasMediaType(String name); - - /** + + /** * Add a new supported media type * - * @param name the media type name to add. + * @param name the media type name to add. */ public void addMediaType(String name); - - /** + + /** * Remove support for a given media type * - * @param name the media type name to remove. + * @param name the media type name to remove. */ public void removeMediaType(String name); - + + /** @return an enumeration of this entry tool names */ + public Iterator getToolNames(); + + /** Returns a map of tool descriptors keyed on the tool names + * @return the tool descriptor map + */ + public Map getToolMap(); + + /** Search for a named tool and return the associated + * ToolDescriptor. The search is case sensitive. + * + * @return the ToolDescriptor for a given name + * @param name the tool name to look for + */ + public ToolDescriptor getTool( String name ); + + /** Adds a new tool to this entry + * @param tool the new tool to add + */ + public void addTool( ToolDescriptor tool ); + + /** Removes the tool associated with the + * name + * + * @param name the name of the tool to
{'source': 'Apache Software Foundation Public Mail Archives'}