You are viewing a plain text version of this content. The canonical link for it is here.
Posted to user@forrest.apache.org by "Paterline, David L." <pa...@westinghouse.com> on 2005/06/17 20:50:35 UTC

Can I have two 'views' of a site?

Hello -

I'm a new user of Forrest, and am investigating its use as an interface for
our online computer code documentation. Unfortunately, we will need two
different 'views' of the site - one for internal users and a second, more
restricted version for external users.

Simply put, there will be some information (some links) which we only wish
to show to our internal users.

I'm hoping to be able to generate these two views without duplicating
information, to minimize maintenance cost and errors.

So, my question is, can I somehow mark certain portions of the information,
then do two builds - one for internal, with "include=all" and one for
external with "exclude=somestuff"?

Pointers to existing information or any other advice will be appreciated.

Thanks in advance.

-
David L. Paterline
Principal Engineer       
Westinghouse Electric Company
Nuclear Fuel Engineering
Engineering Computing
paterldl@westinghouse.com   
PH: 412-374-2286
FX: 412-374-2284

logic:filter (was Re: Can I have two 'views' of a site?)

Posted by Thorsten Scherler <th...@apache.org>.
Moved to dev (without copy to user) because this is dev pure. ;-)

On Tue, 2005-06-21 at 11:06 +0100, Ross Gardler wrote:
> Thorsten Scherler wrote:
> > On Fri, 2005-06-17 at 14:50 -0400, Paterline, David L. wrote:
> > 
> >>Hello -
> >>
> >>I'm a new user of Forrest, and am investigating its use as an interface for
> >>our online computer code documentation. Unfortunately, we will need two
> >>different 'views' of the site - one for internal users and a second, more
> >>restricted version for external users.
> >>
> >>Simply put, there will be some information (some links) which we only wish
> >>to show to our internal users.
> >>
> >>I'm hoping to be able to generate these two views without duplicating
> >>information, to minimize maintenance cost and errors.
> >>
> >>So, my question is, can I somehow mark certain portions of the information,
> >>then do two builds - one for internal, with "include=all" and one for
> >>external with "exclude=somestuff"?
> >>
> > 
> > 
> > I am answering you because you said you are in the process of evaluating
> > forrest. What I am going to write is *not* fully included in the 0.7
> > release (it is in the whiteboard) but will hopefully go officially into
> > 0.8.
> 
> Please, please, please can you provide an example or a brief document 
> for this when you get the time. I have a use case that I would like to 
> address in the next couple of weeks and was going to go with the two 
> site.xml files and a request parameter to select between them. Since the 
> site is views based I'd like to try out this new method.

Ok, the basic idea that I have for this use case is to use the infamous
logic: tag to have simple conditions that decide to include some
contracts or not.

The idea is to extend the "prepare.view.xsl" from the internal.view
plugin. This xslt we can extend for this condition. 

I have an old use case on which I want to explain what I mean. I needed
to make the processing page specific with the help of a variable last
page, that contains the max pages of the document:

In my view I added:
      <forrest:hook name="page" count="4">
        <logic:lastPage value="4">
          <forrest:contract type="img" name="top-image-bit-last"
objectId="411"/>
          <forrest:contract type="txt" name="footer-l-text"
objectId="441"/>
        </logic:lastPage>
        <logic:lastPage value="8">
          <forrest:contract type="img" name="top-image-bit"
objectId="411"/>
          <forrest:contract type="txt" name="footer-r-text"
objectId="441"/>
        </logic:lastPage>
        <forrest:fbits name="infobits" count="4"/>
      </forrest:hook>

Now in the "prepare.view.xsl" from the internal.view I added first the
variable for the lastPage:
<xsl:variable name="lastPage" select="count($model/folder/page)"/>

and then matched the logic tag:
  <xsl:template match="logic:lastPage">
    <xsl:comment>logic tag value: <xsl:value-of select="@value"/>
</xsl:comment>
    <xsl:if test="@value=$lastPage">
      <xsl:apply-templates/>
    </xsl:if>
  </xsl:template>

You see this example is *very* usecase specific and we need something
more flexible. To make it more flexible we need a mechanism where we can
define the needed variables like <xsl:variable name="lastPage"
select="count($model/folder/page)"/> in a view specific way. 

I mean something like 
<logic:filter name="role" value="user"/>

and in the "prepare.view.xsl"
<xsl:variable name="role" select="$model/session/role"/>

  <xsl:template match="logic:filter">
    <xsl:comment>logic tag <xsl:value-of select="@name"/> value:
<xsl:value-of select="@value"/> </xsl:comment>
    <xsl:if test="@value=$role">
      <xsl:apply-templates/>
    </xsl:if>
  </xsl:template>

...but that would look into the model and expect the xpath /session/role
in the presentation model. That means that we need to extend the model
with this information in an earlier stage.

This is just an idea who we can do it actually I reckon you may suggest
some enhancements and I will give it a go and make an example with your
use case.

The question we need to resolve how can we easily extend the logic
conditions?

WDYT?

salu2
-- 
thorsten

"Together we stand, divided we fall!" 
Hey you (Pink Floyd)


Re: Can I have two 'views' of a site?

Posted by Ross Gardler <rg...@apache.org>.
Thorsten Scherler wrote:
> On Fri, 2005-06-17 at 14:50 -0400, Paterline, David L. wrote:
> 
>>Hello -
>>
>>I'm a new user of Forrest, and am investigating its use as an interface for
>>our online computer code documentation. Unfortunately, we will need two
>>different 'views' of the site - one for internal users and a second, more
>>restricted version for external users.
>>
>>Simply put, there will be some information (some links) which we only wish
>>to show to our internal users.
>>
>>I'm hoping to be able to generate these two views without duplicating
>>information, to minimize maintenance cost and errors.
>>
>>So, my question is, can I somehow mark certain portions of the information,
>>then do two builds - one for internal, with "include=all" and one for
>>external with "exclude=somestuff"?
>>
> 
> 
> I am answering you because you said you are in the process of evaluating
> forrest. What I am going to write is *not* fully included in the 0.7
> release (it is in the whiteboard) but will hopefully go officially into
> 0.8.

Please, please, please can you provide an example or a brief document 
for this when you get the time. I have a use case that I would like to 
address in the next couple of weeks and was going to go with the two 
site.xml files and a request parameter to select between them. Since the 
site is views based I'd like to try out this new method.

Ross

Re: Can I have two 'views' of a site?

Posted by Thorsten Scherler <th...@apache.org>.
On Fri, 2005-06-17 at 14:50 -0400, Paterline, David L. wrote:
> Hello -
> 
> I'm a new user of Forrest, and am investigating its use as an interface for
> our online computer code documentation. Unfortunately, we will need two
> different 'views' of the site - one for internal users and a second, more
> restricted version for external users.
> 
> Simply put, there will be some information (some links) which we only wish
> to show to our internal users.
> 
> I'm hoping to be able to generate these two views without duplicating
> information, to minimize maintenance cost and errors.
> 
> So, my question is, can I somehow mark certain portions of the information,
> then do two builds - one for internal, with "include=all" and one for
> external with "exclude=somestuff"?
> 

I am answering you because you said you are in the process of evaluating
forrest. What I am going to write is *not* fully included in the 0.7
release (it is in the whiteboard) but will hopefully go officially into
0.8.

We have created a new skinning engine that we called "views". With this
engine it will be possible to define *role specific* views within *one*
file. Right now this new engine is only a prototype implementation but
we will work on it once we did the 0.7 release.

Like I stated in the introduction I just mention that because you said
you are evaluating forrest. ...and we already have one site that is
build with views: http://resolute.ucsd.edu/diwaker


salu2
-- 
thorsten

"Together we stand, divided we fall!" 
Hey you (Pink Floyd)


Re: Can I have two 'views' of a site?

Posted by Johannes Schaefer <jo...@uidesign.de>.
Paterline, David L. schrieb:
> Hello -
> 
> I'm a new user of Forrest, and am investigating its use as an interface for
> our online computer code documentation. Unfortunately, we will need two
> different 'views' of the site - one for internal users and a second, more
> restricted version for external users.

We came across a similar situation, too.
Publishing for two (or more) different
audiences.

Our "solution" has been to use different
project-specific sitemaps that tailor the
information passed on for each audience.
I guess this may be done with a plugin as
well.

You will have to mark the parts that you
want to remove in some way. We have an
internal DTD which contains the necessary
semantic information (e.g. about versions).

I admitt this is a sub-optimal solution
but it uses the very same XML sources.

Hope this helps and points you in the right
direction.

Johannes


> 
> Simply put, there will be some information (some links) which we only wish
> to show to our internal users.
> 
> I'm hoping to be able to generate these two views without duplicating
> information, to minimize maintenance cost and errors.
> 
> So, my question is, can I somehow mark certain portions of the information,
> then do two builds - one for internal, with "include=all" and one for
> external with "exclude=somestuff"?
> 
> Pointers to existing information or any other advice will be appreciated.
> 
> Thanks in advance.
> 
> -
> David L. Paterline
> Principal Engineer       
> Westinghouse Electric Company
> Nuclear Fuel Engineering
> Engineering Computing
> paterldl@westinghouse.com   
> PH: 412-374-2286
> FX: 412-374-2284
> 
> 


-- 
User Interface Design GmbH * Teinacher Str. 38 * D-71634 
Ludwigsburg
Fon +49 (0)7141 377 000 * Fax  +49 (0)7141 377 00-99
Geschäftsstelle: User Interface Design GmbH * 
Lehrer-Götz-Weg 11 * D-81825 München
www.uidesign.de

Buch "User Interface Tuning" von Joachim Machate & Michael 
Burmester
www.user-interface-tuning.de