RE: Clay templating

2007-03-06 Thread Bernhard Slominski
 -Ursprüngliche Nachricht-
 Von: [EMAIL PROTECTED] [mailto:[EMAIL PROTECTED]
 
 I'll try to give you some more background.  There are three 
 types of clay templates.
 
  
 !-- Clay HTML View Suffix (default .html) --
  context-param
   param-name
org.apache.shale.clay.XML_TEMPLATE_SUFFIX
   /param-name
   param-value.fhtml/param-value
  /context-param
  
 Html templates use and extend common elements.  This type of 
 template can be a fragment or the entire page.  If the 
 template is the entry point to the page, it must be a 
 physical resource meaning that it can't be a pseudo tiles 
 like resource that doesn't exist.
 
 *  The next type of template are what we call full XML views. 
  For this type of template, the page entry point is a clay 
 XML configuration definition.  The default suffix of a full 
 XML view is .xml but can be changed using a web.xml context param.
 
 
  !-- Clay XML View Suffix (default .xml) --
  context-param
   param-name
org.apache.shale.clay.XML_TEMPLATE_SUFFIX
   /param-name
   param-value.html/param-value
  /context-param
 
 
  !-- Clay Configuration Full XML view Resources --
  context-param
   param-name
org.apache.shale.clay.FULLXML_CONFIG_FILES
   /param-name
   param-value/WEB-INF/clay-tiles-config.xml/param-value
  /context-param
  
 This option is similar to Tiles.  The page entry point is not 
 a physical resource but a metadata definition.   
 

Gary, thanks a lot for the answer.
This is nearly a full blonw tutorial you gave me here.
I was trying it out and it's working fine.
So I use one configuration file /WEB-INF/clay-config.xml for both my common
and
my full XML view resources.

!-- Clay Common Configuration Resources --
context-param
param-name
org.apache.shale.clay.COMMON_CONFIG_FILES
/param-name
param-value
/WEB-INF/clay-config.xml
/param-value
/context-param

!-- Clay Configuration Full XML view Resources --
context-param
param-name
org.apache.shale.clay.FULLXML_CONFIG_FILES
/param-name
param-value
/WEB-INF/clay-config.xml
/param-value
/context-param

The former start.html is replaced by an entry in the jsfid in my component
defintion.

component jsfid=/start.xml extends=basePage
symbols
set name=@title value=Application Home /
set name=@bodycontent value=/startBody.html /
/symbols
/component
 
One small thing, I guess it's a typing or copy and paste error.
You metioned the same context parameter for the HTML views and for
the full XML views, I guess the HTML view parameter is wrong.
But in the turtorial I couldn't find the name of the context parameter
of the HTML view suffix. What is it?

!-- Clay HTML View Suffix (default .html) --
 context-param
  param-name
   org.apache.shale.clay.XML_TEMPLATE_SUFFIX
  /param-name
  param-value.fhtml/param-value
 /context-param

Bernhard



RE: no converters/validators exist in jar - only Integer found...

2007-03-06 Thread hermod.opstvedt
Hi

You should find them in shale-validator.jar of from subversion [1]

[1] https://svn.apache.org/repos/asf/shale/framework/trunk/shale-validator

Hermod

-Original Message-
From: Hasan Turksoy [mailto:[EMAIL PROTECTED]
Sent: Tuesday, March 06, 2007 9:15 AM
To: user@shale.apache.org
Subject: no converters/validators exist in jar - only Integer found...


hi all,

i'm using shale.1.0.4 version... when i looked at converters.tld, javadocs,
etc.. it seems there should be DoubleConverterTag, FloatConverterTag, etc..
but i can not find any converter/validator tags inside my jar file... looked
into nightly jars, but no success... does anybody know what's wrong? why
those converter tags not in jar? if i'm looking at wrong path, somebody
please direct me to the correct jar/path?

thanks in advance,

hasan..


* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * *

This email with attachments is solely for the use of the individual or
entity to whom it is addressed. Please also be aware that the DnB NOR Group
cannot accept any payment orders or other legally binding correspondence with
customers as a part of an email. 

This email message has been virus checked by the anti virus programs used
in the DnB NOR Group.

* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * *



RE: no converters/validators exist in jar - only Integer found...

2007-03-06 Thread hermod.opstvedt
Hi

It's here: https://issues.apache.org/struts/browse/SHALE-420

Hermod

-Original Message-
From: Hasan Turksoy [mailto:[EMAIL PROTECTED]
Sent: Tuesday, March 06, 2007 2:07 PM
To: user@shale.apache.org
Subject: Re: no converters/validators exist in jar - only Integer
found...


thanks Hermod for your responsiveness... i'm looking for your patch...

hasan..


On 3/6/07, [EMAIL PROTECTED] [EMAIL PROTECTED] wrote:

 Hi

 I have created a patch that contains these and will upload it shortly.

 Hermod

 -Original Message-
 From: Hasan Turksoy [mailto:[EMAIL PROTECTED]
 Sent: Tuesday, March 06, 2007 9:19 AM
 To: user@shale.apache.org
 Subject: Re: no converters/validators exist in jar - only Integer
 found...


 sorry for wrong subject sentence... i meant converter/validator TAGS...
 converters/validators already exist with no problem...


 On 3/6/07, Hasan Turksoy [EMAIL PROTECTED] wrote:
 
 
  hi all,
 
  i'm using shale.1.0.4 version... when i looked at converters.tld,
  javadocs, etc.. it seems there should be DoubleConverterTag,
  FloatConverterTag, etc.. but i can not find any converter/validator
  tags inside my jar file... looked into nightly jars, but no success...
 does
  anybody know what's wrong? why those converter tags not in jar? if i'm
  looking at wrong path, somebody please direct me to the correct
 jar/path?
 
  thanks in advance,
 
  hasan..
 
 
 


 * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * *
 *

 This email with attachments is solely for the use of the individual or
 entity to whom it is addressed. Please also be aware that the DnB NOR
 Group
 cannot accept any payment orders or other legally binding correspondence
 with
 customers as a part of an email.

 This email message has been virus checked by the anti virus programs used
 in the DnB NOR Group.

 * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * *
 *




RE: Clay templating

2007-03-06 Thread Gary VanMatre
From: Bernhard Slominski [EMAIL PROTECTED] 

 -Ursprüngliche Nachricht-
 Von: [EMAIL PROTECTED] [mailto:[EMAIL PROTECTED]
 
 I'll try to give you some more background.  There are three 
 types of clay templates.
 
  
 !-- Clay HTML View Suffix (default .html) --
  context-param
   param-name
org.apache.shale.clay.XML_TEMPLATE_SUFFIX
   /param-name
   param-value.fhtml/param-value
  /context-param
  
 Html templates use and extend common elements.  This type of 
 template can be a fragment or the entire page.  If the 
 template is the entry point to the page, it must be a 
 physical resource meaning that it can't be a pseudo tiles 
 like resource that doesn't exist.
 
 *  The next type of template are what we call full XML views. 
  For this type of template, the page entry point is a clay 
 XML configuration definition.  The default suffix of a full 
 XML view is .xml but can be changed using a web.xml context param.
 
 
  !-- Clay XML View Suffix (default .xml) --
  context-param
   param-name
org.apache.shale.clay.XML_TEMPLATE_SUFFIX
   /param-name
   param-value.html/param-value
  /context-param
 
 
  !-- Clay Configuration Full XML view Resources --
  context-param
   param-name
org.apache.shale.clay.FULLXML_CONFIG_FILES
   /param-name
   param-value/WEB-INF/clay-tiles-config.xml/param-value
  /context-param
  
 This option is similar to Tiles.  The page entry point is not 
 a physical resource but a metadata definition.   
 

Gary, thanks a lot for the answer.
This is nearly a full blonw tutorial you gave me here.
I was trying it out and it's working fine.
So I use one configuration file /WEB-INF/clay-config.xml for both my common
and my full XML view resources.


Interesting, I've not tried using the same file for both handlers but I don't 
see why
it wouldn't work.

 !-- Clay Common Configuration Resources --
 context-param
  param-name
   org.apache.shale.clay.COMMON_CONFIG_FILES
  /param-name
  param-value
   /WEB-INF/clay-config.xml
  /param-value
 /context-param

!-- Clay Configuration Full XML view Resources --
context-param
param-name
org.apache.shale.clay.FULLXML_CONFIG_FILES
/param-name
param-value
/WEB-INF/clay-config.xml
/param-value
/context-param

The former start.html is replaced by an entry in the jsfid in my component
defintion.

component jsfid=/start.xml extends=basePage
symbols
set name=@title value=Application Home /
set name=@bodycontent value=/startBody.html /
/symbols
/component
 
One small thing, I guess it's a typing or copy and paste error.
You metioned the same context parameter for the HTML views and for
the full XML views, I guess the HTML view parameter is wrong.
But in the turtorial I couldn't find the name of the context parameter
of the HTML view suffix. What is it?

!-- Clay HTML View Suffix (default .html) --
 context-param
  param-name
   org.apache.shale.clay.XML_TEMPLATE_SUFFIX
  /param-name
  param-value.fhtml/param-value
 /context-param


Sorry about that.  The two params are very similar.

context-param
  param-name
   org.apache.shale.clay.HTML_TEMPLATE_SUFFIX
  /param-name
  param-value.fhtml/param-value
/context-param

Bernhard

Gary

Re: [shale-validator] view controller – site navigation

2007-03-06 Thread Craig McClanahan

On 3/6/07, [EMAIL PROTECTED] [EMAIL PROTECTED] wrote:

Hi

Welcome to JavaServer Faces and post :)  - The post goes back to the current 
page  but you render a diferent page on return. So you will most likely always 
be one page behind in the url. The exception to the case is when you submit to 
the same page twice.



You can also get the URL in the browser to change by doing a redirect
(embed redirect/ inside your navigation case), at the cost that you
cannot use request scope to pass information from the origin page to
the destination page.


Hermod



Craig



-Original Message-
From: gerrit [mailto:[EMAIL PROTECTED]
Sent: Tuesday, March 06, 2007 10:04 AM
To: user@shale.apache.org
Subject: Re: [shale-validator] view controller – site navigation



Hi

If I output the view root ViewId I get the following:
ViewRoot1: /faces/projekte.jsp
ViewRoot2: /faces/aufgaben.jsp

  FacesContext facesContext = FacesContext.getCurrentInstance();
  log.debug(ViewRoot1: +facesContext.getViewRoot().getViewId());
  NavigationHandler navigationHandler =
facesContext.getApplication().getNavigationHandler();
  navigationHandler.handleNavigation(facesContext,
#{/faces/projekte.jsp},successAufgaben);
  log.debug(ViewRoot2: +facesContext.getViewRoot().getViewId());
  facesContext.renderResponse();

So in my mind the navigation handler works correct. But on the browser
projekte.jsp is shown. If I press any button on this site, the navigation
behind this button is ignored and aufgaben.jsp is shown.

Gerrit


craigmcc wrote:

 On 3/2/07, [EMAIL PROTECTED] [EMAIL PROTECTED] wrote:
 Hi

 I think the best way to achieve what you want is to raise a flag in the
 viewcontrollers init method. Then when the method that is supposed to be
 executed is called, you check for the flag at the beginning and return
 the outcome that corresponds to the error situatiuon.


 It actually is possible to navigate from init(), but you have to do a
 bit more work:

 FacesContext context = FacesContext.getCurrentInstance();
 NavigationHandler nh =
 context.getApplication().getNavigationHandler();
 String fromAction = #{...}; // Fake expression for the action
 you pretend executed
 String outcome = ...; // Fake outcome from the fake action
 nh.handleNavigation(context, fromAction, outcome);
 context.renderResponse(); // Skip directly to Render Response phase

 The current view, plus the values you specify for fromAction and
 outcome, are fed into the standard navigation rules processing and a
 new view will be selected based on those rules (or the current view
 redisplayed if no rule matches).  The call to renderResponse() causes
 the remainder of the lifecycle for the current page to be skipped.

 From an architectural viewpoint, something to consider is whether it
 makes sense to load data in the prerender() event instead of init().
 The advantage is that this will only be executed if this is the page
 that will really be rendered -- if you navigated elsewhere, you won't
 pay the performance cost of loading data that will not be used.  The
 disadvantage is that, by the time prerender() is called, you are
 committed to rendering this page and you cannot navigate anywhere
 else.

 Craig


 -Original Message-
 From: gerrit [mailto:[EMAIL PROTECTED]
 Sent: Friday, March 02, 2007 9:51 AM
 To: user@shale.apache.org
 Subject: view controller – site navigation



 I use the shale view controller init() method to make standard site
 validations and load data.
 The init-Method has no return value and so no navigation rule is
 executed.
 If one of my validation methods or the load data method returns an error
 I'd
 like execute navigation rules. The reason is to go to a special error
 page.
 Is there a possibility to navigate to another page from the init-method?

 --
 View this message in context:
 
http://www.nabble.com/view-controller-%E2%80%93-site-navigation-tf3332431.html#a9266099
 Sent from the Shale - User mailing list archive at Nabble.com.



 * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * *
 *

 This email with attachments is solely for the use of the individual or
 entity to whom it is addressed. Please also be aware that DnB NOR cannot
 accept any payment orders or other legally binding correspondence with
 customers as a part of an email.

 This email message has been virus checked by the anti virus programs used
 in the DnB NOR Group.

 * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * *
 *





--
View this message in context: 
http://www.nabble.com/view-controller-%E2%80%93-site-navigation-tf3332431.html#a9328354
Sent from the Shale - User mailing list archive at Nabble.com.