You are viewing a plain text version of this content. The canonical link for it is here.
Posted to jetspeed-user@portals.apache.org by Marina <pp...@yahoo.com> on 2004/12/17 02:30:32 UTC

Re: J2 Profiler

Randy, Doug,
I'm very happy to see the continuation of the thread -
profiling and page layout is exactly what I was trying
to figure out next!

I followed Randy's advise and tried to investigate
more the differences in the portal page layout for
different users.
Here are some of my notes (sorry, they are long...) -
I hope you could correct me where my guesses were too
wild and answer some questions:

When user is not logged in, he is a �guest� user by
default.
According to the �j1� profiling rule (???), pages for
the �guest� user should be taken from the
�\pages\_user\guest\ directory.
However, since this directory does not exist, a
default fallback (is that right?) rule is used and the
default pages/directories are used:
�\pages\default-page.psml


When logged in as a �user� user:

-- Everything from the �\pages\ directory is used;
stuff from the \pages\_user\user\ is used in addition
to that
-- �user�-specific content comes from the
�\pages\_user\user , for example, new .psml files and
corresponding Tabs that are displayed for the �user�
user only: 
p003.psml --> �[USER 003] PSML page� tab
nested-layout.psml --> �Nested Layout� tab

-- �user� user also has the �user� role (I wish the
names would be somewhat different :-) ). Additional
�user�-role-specific stuff comes from the
\pages\_role\user\ directory. It has only one
directory - �\top-links\ , which is referenced from
the 
 �\pages\_user\user\top-pages.ds file:
<document-set>
  <title>[USER] Top Pages</title>
  <profile-locator>docset</profile-locator>
  <document-path
regexp="true">/top-links/*.*</document-path>
</document-set>
(see questions on that below)

When logged in as �admin� user:
-- you see everything that the �guest� user can see,
but in addition, you also see the �Jetspeed
Administrative Portlets� link under the �Folders and
Pages� header in the left-side menu
-- there is also a top-pages.ds file in the �\pages\
dir that defines this:

<?xml version="1.0" encoding="UTF-8"?>
<document-set>
  <title>Top Pages</title>
  <metadata name="title" xml:lang="fr">Page
haut</metadata>
  <profile-locator>docset</profile-locator>
  <document-path>/Administrative</document-path>
</document-set>

In addition, �admin� user also has the �manager� role,
so the �\pages\_role\manager\ dir is used for the
�manager�-specific content:
the folder.metadata determines what is included into
the page. It has:
  <document-order>Administrative</document-order>

My guess: this is why only a user in the �manager�
role can see the �Administrative Portlets� link (is
this right?)

But then, the �\pages\_role\manager\folder.metadata
also has:
  <document-order>Google.link</document-order>
  <document-order>p001.psml</document-order>
  <document-order>p002.psml</document-order>
  <document-order>p003.psml</document-order>
  <document-order>p004.psml</document-order>

but none of them (links for .link and tabs for .psml)
is displayed on the page.
I would guess that all pxxx.psml are not displayed
simply because they do not exist in the
�\pages\_role\manager\ folder.
What about the Google.link though? It does exist in
the directory�

Questions: 
How are xxxx.ds files (docset definitions ??) and the
role-specific folders (like �\pages\_role\manager )
are related?
Do top-pages.ds  files under a \_user\username or
..\pages\ directories always reference resources in
the \_role\rolename directory? 

Thanks a lot!
Marina


--- Randy Watler <rw...@finali.com> wrote:

> Doug Schnelzer wrote:
> 
> >Randy,
> >
> >Thanks for the guidance.  Putting the login portlet
> in a plain page in the
> >guest directory and protecting everything else
> works well.  In the future,
> >it would be nice to dynamically show/hide portlets
> on a page based on a
> >user's role.
> >
> It is definitely under consideration... odds are it
> will be there in M2 
> if I had to guess, but others need to weigh in.
> 
> >
> >As I dig in further, can you point me in the right
> direction for learning
> >more about how the profiler works?  Should I just
> follow the Jetspeed2
> >source code?  If so, can you point me at a Java
> class to start with?
> >
> First, look and understand the examples shipped with
> J2. Try logging in 
> as user/user and jetspeed/jetspeed. Compare what you
> see with the 
> various content pages and other elements in the
> pages directories. For 
> more detail, check out this document:
> 
>
http://cvs.apache.org/viewcvs.cgi/jakarta-jetspeed-2/design-docs/src/profiler/J2-page-manager-profiling.sxw
> 
> This is an OpenOffice document. I can email you
> another format if you'd 
> like. The source code for all of this resides in
> /components/profiler 
> and /components/page-manager, but it is not trivial.
> Feel free to ask 
> questions here so that others can read about the
> profiler and how to 
> configure it!
> 
> >  
> >
> >Also as I browse through the WEB-INF/pages
> directory structure, there seems
> >to be psml files that aren't displayed (e.g.
> pages/_user/user/p003.psml and
> >pages/_user/user/nested-layout.psml).
> >
> These are simply user files for 'user', (instead of
> 'guest')! Login as 
> user/user.
> 
> >  I'd like to learn more about how this
> >works.  Is the psml documentation for Jetspeed 1
> applicable?
> >
> Personally, I'd prefer if you stick with J2
> resources and asking 
> questions here. We can also contribute to the wiki
> as we go, (if nothing 
> else we can link back to user list threads).
> 
> >  If not can you
> >recommend a better starting point (part of the
> source code is fine) for some
> >self-study on overall navigation and layout?
> >
> The easiest thing is to look at the examples. For a
> better understanding 
> of navigations/layout, look at the Velocity, (*.vm),
> templates in the 
> WEB-INF/decorations/layout/html/tigris and 
> WEB-INF/decorations/portlet/html/tigris directories.
> Most of all, don't 
> be shy on this list!
> 
> >
> >Thanks very much,
> >Doug
> >  
> >
> No problem... good luck with J2!
> 
> Randy
> 
> 
>
---------------------------------------------------------------------
> To unsubscribe, e-mail:
> jetspeed-user-unsubscribe@jakarta.apache.org
> For additional commands, e-mail:
> jetspeed-user-help@jakarta.apache.org
> 
> 



		
__________________________________ 
Do you Yahoo!? 
Take Yahoo! Mail with you! Get it on your mobile phone. 
http://mobile.yahoo.com/maildemo 

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


Re: J2 Profiler

Posted by Randy Watler <rw...@finali.com>.
Marina,

Feedback inline below...

Marina wrote:

>When user is not logged in, he is a guest user by
>default.
>According to the j1 profiling rule (???), pages for
>the guest user should be taken from the
>&\pages\_user\guest\ directory.
>However, since this directory does not exist, a
>default fallback (is that right?) rule is used and the
>default pages/directories are used:
>&\pages\default-page.psml
>
Yes. The 'j1' search/fallback rule for '/some-page.psml' request for 'fred'
using a 'html' browser in the 'en_US' locale would be:

/_user/fred/_mediatype/html/_language/en/_country/US/some-page.psml
/_user/fred/_mediatype/html/_language/en/some-page.psml
/_user/fred/_mediatype/html/some-page.psml
/_user/fred/some-page.psml
/some-page.psml
/

Other search/fallback profiling rules are available for 'role-fallback',
'group-fallback', and 'role-group'. One can also define their own
custom profiling rules and assign them to users and document sets.

>When logged in as a user user:
>
>-- Everything from the &\pages\ directory is used;
>stuff from the \pages\_user\user\ is used in addition
>to that
>-- user-specific content comes from the
>&\pages\_user\user , for example, new .psml files and
>corresponding Tabs that are displayed for the user
>user only: 
>p003.psml --> [USER 003] PSML page tab
>nested-layout.psml --> Nested Layout tab
>
Yes. Most navigations that are specific to the user are prefixed with
a '[USER]' tag for this test case.

>-- user user also has the user role (I wish the
>names would be somewhat different :-) ). Additional
>user-role-specific stuff comes from the
>\pages\_role\user\ directory. It has only one
>directory - &\top-links\ , which is referenced from
>the 
> &\pages\_user\user\top-pages.ds file:
><document-set>
>  <title>[USER] Top Pages</title>
>  <profile-locator>docset</profile-locator>
>  <document-path
>regexp="true">/top-links/*.*</document-path>
></document-set>
>(see questions on that below)
>
Yes.

>When logged in as admin user:
>-- you see everything that the guest user can see,
>but in addition, you also see the Jetspeed
>Administrative Portlets link under the Folders and
>Pages header in the left-side menu
>-- there is also a top-pages.ds file in the &\pages\
>dir that defines this:
>
><?xml version="1.0" encoding="UTF-8"?>
><document-set>
>  <title>Top Pages</title>
>  <metadata name="title" xml:lang="fr">Page
>haut</metadata>
>  <profile-locator>docset</profile-locator>
>  <document-path>/Administrative</document-path>
></document-set>
>
>In addition, admin user also has the manager role,
>so the &\pages\_role\manager\ dir is used for the
>manager-specific content:
>
Actually, the 'manager' user does NOT use this directory because it uses
the default 'j1' rule. This directory content and its effect on navigations
can be seen using the jetspeed/jetspeed login: it uses the 'role-fallback'
for 'page' profiling.

>the folder.metadata determines what is included into
>the page. It has:
>  <document-order>Administrative</document-order>
>
>My guess: this is why only a user in the manager
>role can see the Administrative Portlets link (is
>this right?)
>
No. Security constraints in the Administrative folder.metadata enforce
that. Document order is strictly used to control the ordering of
navigational elements... but only if they are otherwise accessible. All
documents that are explicitly ordered appear first. The remaining
follow sorted alphabetically. The first folder found according to the
profiling search/fallback rules with metadata that contains any document
ordering is used for ALL document navigations in the page.

>But then, the &\pages\_role\manager\folder.metadata
>also has:
>  <document-order>Google.link</document-order>
>  <document-order>p001.psml</document-order>
>  <document-order>p002.psml</document-order>
>  <document-order>p003.psml</document-order>
>  <document-order>p004.psml</document-order>
>
>but none of them (links for .link and tabs for .psml)
>is displayed on the page.
>I would guess that all pxxx.psml are not displayed
>simply because they do not exist in the
>&\pages\_role\manager\ folder.
>What about the Google.link though? It does exist in
>the directory&
>
Again, these are not seen for manager/manager, but can by jetspeed/jetspeed.
Pages, links, and other documents are ALWAYS aggregated unless
filtered by profiling or security constraints.

>
>Questions: 
>How are xxxx.ds files (docset definitions ??) and the
>role-specific folders (like &\pages\_role\manager )
>are related?
>
Document sets are populated using a specified profile locator name. This
name defaults to 'docset' and falls back to 'page' if not specified. Profile
locator names are used to specify profiling rules for individual user
principals. Pages and other documents are always profiled using the rule
assigned to the 'page' locator name for the current user. If a user does
not have a rule assigned for 'page', the default 'j1' profiling rule is 
used.

So, for the user/user login, 'page' is set to 'j1' and 'docset' is set to
'role-group'. This means that the profiling search paths I outlined above
for 'guest' are used to locate pages. However, the the document set
is assembled using these search paths from 'role-group':

/_role/user
/_group/accounting
/

If a user des not have a profile rule defined for a document set locator,
the document set is ignored and is not added to the page navigation
elements.

>Do top-pages.ds  files under a \_user\username or
>..\pages\ directories always reference resources in
>the \_role\rolename directory? 
>
No. For example, the pages.ds document set uses the 'page' profile
locator which uses the 'j1' rule for user/user. Note that the
jetspeed/jetspeed user uses the 'role-fallback' rule for 'page', but
since the p*.psml pages exist in the '/' directory they still
appear in the document set ordered by the '_role/manager/folder.metadata'
document ordering. Yes, this is an obscure test case! In practice,
document sets are often used with the 'role-fallback', 'group-fallback',
or 'role-group' profiling rules.

HTH,

Randy



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