Number Formatting in TextField (T5)

2010-01-04 Thread Benny Law
This was my first day of work after a long holiday break, and I finally got
something reasonably clean that I can share. To recap, my goal was to create
a generic solution for allowing precise control of the number format used in
a TextField that can be customized per field instance. The approach I came
up with is to create a special binding prefix that interprets the binding
expression as a number pattern string (a non-localized pattern string as per
DecimalFormat). The result is that I can now do things like

  and


with no custom code required in the page class, and the error messages can
be overridden in the standard fashion if desired. The solution consists of 3
new classes: NumberFormatBindingFactory, NumberFormatBinding, and
NumberTranslator. Here is the code:


public class NumberFormatBindingFactory implements BindingFactory {

private final FieldTranslatorSource fieldTranslatorSource;
private final TypeCoercer typeCoercer;

public NumberFormatBindingFactory( FieldTranslatorSource
fieldTranslatorSource,
TypeCoercer typeCoercer ) {

this.fieldTranslatorSource = fieldTranslatorSource;
this.typeCoercer = typeCoercer;
}

public Binding newBinding( String description, ComponentResources
containerResources,
ComponentResources fieldResources, String expression, Location
location ) {

return new NumberFormatBinding( fieldResources, expression,
location,
fieldTranslatorSource, typeCoercer );
}
}

public class NumberFormatBinding extends BaseLocatable implements Binding {

private final Translator translator;
private final FieldTranslatorSource fieldTranslatorSource;
private final Field field;
private final String overrideId;
private final Messages overrideMessages;
private final Locale locale;

private FieldTranslator fieldTranslator;

public NumberFormatBinding( ComponentResources fieldResources, String
formatPattern,
Location location, FieldTranslatorSource fieldTranslatorSource,
TypeCoercer typeCoercer ) {

super( location );

this.translator = createTranslator( fieldResources, formatPattern,
typeCoercer );
this.fieldTranslatorSource = fieldTranslatorSource;
this.field = (Field) fieldResources.getComponent();
this.overrideId = fieldResources.getId();
this.overrideMessages = fieldResources.getContainerMessages();
this.locale = fieldResources.getLocale();
}

public Object get() {
if (fieldTranslator == null) {
// Create the FieldTranslator lazily to ensure FormSupport is
present.
fieldTranslator = fieldTranslatorSource.createTranslator(
field, overrideId, overrideMessages, locale, translator
);
}
return fieldTranslator;
}

public void set( Object value ) {
throw new UnsupportedOperationException();
}

public Class getBindingType() {
return get().getClass();
}

public boolean isInvariant() {
return true;
}

public  A getAnnotation( Class annotationClass
) {
return null;
}

private NumberFormat createNumberFormat( String pattern, Locale locale )
{
DecimalFormatSymbols symbols = new DecimalFormatSymbols( locale );
DecimalFormat format = new DecimalFormat( pattern, symbols );
if (pattern.indexOf('.') < 0) {
format.setParseIntegerOnly( true );
}
return format;
}

@SuppressWarnings("unchecked")
private  Translator createTranslator(
ComponentResources fieldResources,
String formatPattern, TypeCoercer typeCoercer ) {

NumberFormat numberFormat = createNumberFormat( formatPattern,
fieldResources.getLocale() );

Class numberType = fieldResources.getBoundType("value");
if (numberType == null) {
throw new IllegalStateException("'value' parameter not bound for
"
+ fieldResources.getId() +"; numeric type unknown.");
}
return new NumberTranslator( numberType, numberFormat,
typeCoercer );
}
}

public class NumberTranslator implements Translator {

private static final List> INTEGER_TYPES = Arrays.asList( new
Class[] {
Byte.class, Short.class, Integer.class, Long.class, BigInteger.class

});

private final Class type;
private final NumberFormat formatter;
private final TypeCoercer typeCoercer;
private final String messageKey;

public NumberTranslator( Class type, NumberFormat formatter,
TypeCoercer typeCoercer ) {
this.type = type;
this.formatter = formatter;
this.typeCoercer = typeCoercer;
this.messageKey = INTEGER_TYPES.contains(type) ?
 

Re: SEO and duplicate content due to language prefix

2010-01-04 Thread Stephan Schwab


Thiago H. de Paula Figueiredo wrote:
> 
>> According to SEO people that are involved in this project that behavior
>> creates an issue. They say search engines will detect duplicate content  
>> and punish that. Their suggestion is:
> 
> If all content is translated, would your pages still be considered  
> duplicated?
> 

/url and /en/url would be considered to be duplicate.


Thiago H. de Paula Figueiredo wrote:
> 
>> Do you think it is necessary and can be done to have intra-page links -  
>> and probably those for component events as well - go to /url instead of  
>> /en/url?
> 
> You can disable the locale prefix by setting the  
> SymbolConstants.ENCODE_LOCALE_INTO_PATH symbol to false.
> 

That seems to avoid the problem altogether. Where is that documented?

Thanks for that.

Stephan


-
--
http://www.caimito.net - Caimito One Team - Agile Collaboration and Planning
tool
http://www.stephan-schwab.com - Personal blog
http://code.google.com/p/tapestry-sesame - Authentication extension for
Tapestry 5

-- 
View this message in context: 
http://old.nabble.com/SEO-and-duplicate-content-due-to-language-prefix-tp27019442p27023179.html
Sent from the Tapestry - User mailing list archive at Nabble.com.


-
To unsubscribe, e-mail: users-unsubscr...@tapestry.apache.org
For additional commands, e-mail: users-h...@tapestry.apache.org



Re: demo aplication

2010-01-04 Thread Alex Kotchnev
Geoff,
   very cool ! I've known about jumpstart for a while ( admittedly, I never
downloaded the source) but I didn't realize there was the "application"
aspect to it. Awesome !

Regards,

Alex K

On Mon, Jan 4, 2010 at 7:07 PM, Geoff Callender <
geoff.callender.jumpst...@gmail.com> wrote:

> Hi Alfonso,
>
> You say that jumpstart is not an app. Maybe you haven't logged in to the
> app part?
>
>http://jumpstart.doublenegative.com.au:8080/jumpstart/theapp/login
>
> Or maybe you did and you found it lacking?
>
> Cheers,
>
> Geoff
>
> On 31/12/2009, at 4:54 AM, Alfonso Quiroga wrote:
>
> > I know about jumpstart, but that's like different solutions for
> > specifics things, not a complete app.
> > I think it would be fine to have a complete demo app, maybe using
> > hibernate + hsqldb, some custom component, etc, for a begginer
> >
> > On Wed, Dec 30, 2009 at 12:42 PM, Ashwanth Kumar
> >  wrote:
> >> Well, Do we need a Demo app?? I mean, we already've one: JumpStart(
> >> http://jumpstart.doublenegative.com.au:8080/jumpstart/) hosted, so..
> >>
> >> Do u wish to re-consider ur idea??
> >>
> >>  - Ashwanth Kumar
> >>
> >> On Wed, Dec 30, 2009 at 9:09 PM, Alfonso Quiroga <
> alfonsose...@gmail.com>wrote:
> >>
> >>> Hi! going back again to the idea of publishing demo aplication for
> >>> starters (always is easier to see something working and copy from
> >>> that, than building an app from scratch, looking for docs, etc).
> >>>
> >>> Is there some idea of how the demo app should be? I'm NOT a T5 expert
> >>> but I can do it if it's simple.
> >>> a) The first question is... if we have a t5-starter-demo-app, where
> >>> will be hosted?
> >>> b) What does the app need? I was thinking in very basic, 2 o 3 pages,
> >>> using web-security with annotations, storing data in session... a
> >>> t:zone example.. and I don't know what else, any suggestions?
> >>>
> >>> I think this idea contribute to new users adopting t5, maybe sounds
> >>> stupid, but when you start.. if you have almost nothing to see, a lot
> >>> of users can be discarding t5.
> >>> thanks
> >>>
> >>> -
> >>> To unsubscribe, e-mail: users-unsubscr...@tapestry.apache.org
> >>> For additional commands, e-mail: users-h...@tapestry.apache.org
> >>>
> >>>
> >>
> >
> > -
> > To unsubscribe, e-mail: users-unsubscr...@tapestry.apache.org
> > For additional commands, e-mail: users-h...@tapestry.apache.org
> >
>
>
> -
> To unsubscribe, e-mail: users-unsubscr...@tapestry.apache.org
> For additional commands, e-mail: users-h...@tapestry.apache.org
>
>


Re: SEO and duplicate content due to language prefix

2010-01-04 Thread Christian Riedel
yes, of course! the default language is available under '/' and '/en' 
(assuming it defaults to 'en'). google is checking every language, so 
I'd rather use the canonical tag.



Am 05.01.10 01:11, schrieb Thiago H. de Paula Figueiredo:
Em Mon, 04 Jan 2010 19:15:49 -0200, Stephan Schwab  
escreveu:



According to SEO people that are involved in this project that behavior
creates an issue. They say search engines will detect duplicate 
content and punish that. Their suggestion is:


If all content is translated, would your pages still be considered 
duplicated?


Do you think it is necessary and can be done to have intra-page links 
- and probably those for component events as well - go to /url 
instead of /en/url?


You can disable the locale prefix by setting the 
SymbolConstants.ENCODE_LOCALE_INTO_PATH symbol to false.




-
To unsubscribe, e-mail: users-unsubscr...@tapestry.apache.org
For additional commands, e-mail: users-h...@tapestry.apache.org



Re: SEO and duplicate content due to language prefix

2010-01-04 Thread Thiago H. de Paula Figueiredo
Em Mon, 04 Jan 2010 19:15:49 -0200, Stephan Schwab   
escreveu:



According to SEO people that are involved in this project that behavior
creates an issue. They say search engines will detect duplicate content  
and punish that. Their suggestion is:


If all content is translated, would your pages still be considered  
duplicated?


Do you think it is necessary and can be done to have intra-page links -  
and probably those for component events as well - go to /url instead of  
/en/url?


You can disable the locale prefix by setting the  
SymbolConstants.ENCODE_LOCALE_INTO_PATH symbol to false.


--
Thiago H. de Paula Figueiredo
Independent Java, Apache Tapestry 5 and Hibernate consultant, developer,  
and instructor
Owner, software architect and developer, Ars Machina Tecnologia da  
Informação Ltda.

http://www.arsmachina.com.br

-
To unsubscribe, e-mail: users-unsubscr...@tapestry.apache.org
For additional commands, e-mail: users-h...@tapestry.apache.org



Re: demo aplication

2010-01-04 Thread Geoff Callender
Hi Alfonso,

You say that jumpstart is not an app. Maybe you haven't logged in to the app 
part?

http://jumpstart.doublenegative.com.au:8080/jumpstart/theapp/login

Or maybe you did and you found it lacking?

Cheers,

Geoff

On 31/12/2009, at 4:54 AM, Alfonso Quiroga wrote:

> I know about jumpstart, but that's like different solutions for
> specifics things, not a complete app.
> I think it would be fine to have a complete demo app, maybe using
> hibernate + hsqldb, some custom component, etc, for a begginer
> 
> On Wed, Dec 30, 2009 at 12:42 PM, Ashwanth Kumar
>  wrote:
>> Well, Do we need a Demo app?? I mean, we already've one: JumpStart(
>> http://jumpstart.doublenegative.com.au:8080/jumpstart/) hosted, so..
>> 
>> Do u wish to re-consider ur idea??
>> 
>>  - Ashwanth Kumar
>> 
>> On Wed, Dec 30, 2009 at 9:09 PM, Alfonso Quiroga 
>> wrote:
>> 
>>> Hi! going back again to the idea of publishing demo aplication for
>>> starters (always is easier to see something working and copy from
>>> that, than building an app from scratch, looking for docs, etc).
>>> 
>>> Is there some idea of how the demo app should be? I'm NOT a T5 expert
>>> but I can do it if it's simple.
>>> a) The first question is... if we have a t5-starter-demo-app, where
>>> will be hosted?
>>> b) What does the app need? I was thinking in very basic, 2 o 3 pages,
>>> using web-security with annotations, storing data in session... a
>>> t:zone example.. and I don't know what else, any suggestions?
>>> 
>>> I think this idea contribute to new users adopting t5, maybe sounds
>>> stupid, but when you start.. if you have almost nothing to see, a lot
>>> of users can be discarding t5.
>>> thanks
>>> 
>>> -
>>> To unsubscribe, e-mail: users-unsubscr...@tapestry.apache.org
>>> For additional commands, e-mail: users-h...@tapestry.apache.org
>>> 
>>> 
>> 
> 
> -
> To unsubscribe, e-mail: users-unsubscr...@tapestry.apache.org
> For additional commands, e-mail: users-h...@tapestry.apache.org
> 


-
To unsubscribe, e-mail: users-unsubscr...@tapestry.apache.org
For additional commands, e-mail: users-h...@tapestry.apache.org



Installing easyfckeditor

2010-01-04 Thread oskar_a

Hi, 
I'm really new in Tapestry and try to install the easyfckeditor component
http://code.google.com/p/easyfckeditor/
(I don't used maven to create my project and also don't have the maven
eclipse plugin.)

I downloaded the jar-file (Tapestry5EasyFckEditor-1.0-Beta-2.jar) and added
it to the build path. But when I try to use it with 


tapestry means:

Unable to resolve 'easyfck/fckeditor' to a component class name.

Regards Oskar
-- 
View this message in context: 
http://old.nabble.com/Installing-easyfckeditor-tp27020854p27020854.html
Sent from the Tapestry - User mailing list archive at Nabble.com.


-
To unsubscribe, e-mail: users-unsubscr...@tapestry.apache.org
For additional commands, e-mail: users-h...@tapestry.apache.org



SEO and duplicate content due to language prefix

2010-01-04 Thread Stephan Schwab

The webapp I'm currently working on supports two languages and the user can
choose the preferred language from a menu. By default Tapestry shows pages
based on browser language settings. If the user selects a different
language, then URLs become prefixed with /en/ or /es/.

According to SEO people that are involved in this project that behavior
creates an issue. They say search engines will detect duplicate content and
punish that. Their suggestion is:

- hide the /es/ path via robots.txt
- use the new canonical tag to have each page tell the search engine the URL
without /en/
- make sure that all links from one page to another should not include the
/en/ but rather refer to the base version

What experiences have others made with Tapestry in a SEO context?

Do you think it is necessary and can be done to have intra-page links - and
probably those for component events as well - go to /url instead of /en/url?

Stephan


-
--
http://www.caimito.net - Caimito One Team - Agile Collaboration and Planning
tool
http://www.stephan-schwab.com - Personal blog
http://code.google.com/p/tapestry-sesame - Authentication extension for
Tapestry 5

-- 
View this message in context: 
http://old.nabble.com/SEO-and-duplicate-content-due-to-language-prefix-tp27019442p27019442.html
Sent from the Tapestry - User mailing list archive at Nabble.com.


-
To unsubscribe, e-mail: users-unsubscr...@tapestry.apache.org
For additional commands, e-mail: users-h...@tapestry.apache.org



Re: [T5.0.18] @InjectedPage does not have access to it's own layout

2010-01-04 Thread Howard Lewis Ship
When an event bubbles up, the origin of the event changes.

Initially, the success event occurs from the form inside the layout component.

If the event is not handled there, it becomes a success event *from
the layout component* (at the page).

On Mon, Jan 4, 2010 at 12:11 PM, Igor Drobiazko
 wrote:
> Your explanation is unclear. This way you never get an answer. Please be
> more precise and post more of your code.
>
> On Mon, Jan 4, 2010 at 11:07 AM, lebenski  wrote:
>
>>
>> I have a layout component that contains a login form:
>>
>> 
>>        > height="30"/>
>>        
>>        
>> 
>>
>> Page Class:
>>
>> Object onSuccessFromLoginForm() {
>>        try{
>>            loggedInMember = loginManager.logUserIn(new Login(memberName,
>> password));
>>        } catch(LoginException e) {
>>            //Login Error Processing
>>        }
>>
>>        return Index.class;
>> }
>>
>> I also have a generic confirmation page which I use for page flows where I
>> need to present some message to the user.  For example "Thanks for
>> submitting a question"
>>
>> SubmitQuestion.java
>>
>> @InjectPage
>> private Confirmation confirmation;
>>
>> Object onSuccessFromQuestionForm() {
>>        //processing
>>        confirmation.setType(ConfirmationType.SUCCESS);
>>        confirmation.setMessage(Messages.get("question-submit"));
>>
>>        return confirmation;
>> }
>>
>> The confirmation template itself is inside the layout:
>>
>> http://tapestry.apache.org/schema/tapestry_5_1_0.xsd";>
>>        ${type}
>>        ${message}
>> 
>>
>> However, for some reason I don't seem to have access to the layout from
>> this
>> confirmation page.  If I try to use the login form, the Index page is
>> loaded
>> but the user is not logged in.  In fact as far as I can see (through
>> debugging), the onSuccessFromLoginForm() method in the Layout is never
>> called.
>>
>> I'm at a bit of a loss as to why this is happening, as this is working on
>> all other pages in my application.  Is there some specific nuance of using
>> @InjectPage that could be causing this issue?
>> --
>> View this message in context:
>> http://old.nabble.com/-T5.0.18--%40InjectedPage-does-not-have-access-to-it%27s-own-layout-tp27010913p27010913.html
>> Sent from the Tapestry - User mailing list archive at Nabble.com.
>>
>>
>> -
>> To unsubscribe, e-mail: users-unsubscr...@tapestry.apache.org
>> For additional commands, e-mail: users-h...@tapestry.apache.org
>>
>>
>
>
> --
> Best regards,
>
> Igor Drobiazko
> http://tapestry5.de/blog
>



-- 
Howard M. Lewis Ship

Creator of Apache Tapestry

The source for Tapestry training, mentoring and support. Contact me to
learn how I can get you up and productive in Tapestry fast!

(971) 678-5210
http://howardlewisship.com

-
To unsubscribe, e-mail: users-unsubscr...@tapestry.apache.org
For additional commands, e-mail: users-h...@tapestry.apache.org



Re: [T5.0.18] @InjectedPage does not have access to it's own layout

2010-01-04 Thread Igor Drobiazko
Your explanation is unclear. This way you never get an answer. Please be
more precise and post more of your code.

On Mon, Jan 4, 2010 at 11:07 AM, lebenski  wrote:

>
> I have a layout component that contains a login form:
>
> 
> height="30"/>
>
>
> 
>
> Page Class:
>
> Object onSuccessFromLoginForm() {
>try{
>loggedInMember = loginManager.logUserIn(new Login(memberName,
> password));
>} catch(LoginException e) {
>//Login Error Processing
>}
>
>return Index.class;
> }
>
> I also have a generic confirmation page which I use for page flows where I
> need to present some message to the user.  For example "Thanks for
> submitting a question"
>
> SubmitQuestion.java
>
> @InjectPage
> private Confirmation confirmation;
>
> Object onSuccessFromQuestionForm() {
>//processing
>confirmation.setType(ConfirmationType.SUCCESS);
>confirmation.setMessage(Messages.get("question-submit"));
>
>return confirmation;
> }
>
> The confirmation template itself is inside the layout:
>
> http://tapestry.apache.org/schema/tapestry_5_1_0.xsd";>
>${type}
>${message}
> 
>
> However, for some reason I don't seem to have access to the layout from
> this
> confirmation page.  If I try to use the login form, the Index page is
> loaded
> but the user is not logged in.  In fact as far as I can see (through
> debugging), the onSuccessFromLoginForm() method in the Layout is never
> called.
>
> I'm at a bit of a loss as to why this is happening, as this is working on
> all other pages in my application.  Is there some specific nuance of using
> @InjectPage that could be causing this issue?
> --
> View this message in context:
> http://old.nabble.com/-T5.0.18--%40InjectedPage-does-not-have-access-to-it%27s-own-layout-tp27010913p27010913.html
> Sent from the Tapestry - User mailing list archive at Nabble.com.
>
>
> -
> To unsubscribe, e-mail: users-unsubscr...@tapestry.apache.org
> For additional commands, e-mail: users-h...@tapestry.apache.org
>
>


-- 
Best regards,

Igor Drobiazko
http://tapestry5.de/blog


Re: [T416] Javascript and html templates questions

2010-01-04 Thread Ivano Luberti
Sorry the ml server has cut the attachments (I should have known)
Andreas, if you don't mind I can send you them to your personal address.

Ivano Luberti ha scritto:
> Andreas, thanks.  About my HTML template here it is (not sure what you
> mean with border).
> The homelogged user include a barCode component, that has its own html.
>
>
> Andreas Andreou ha scritto:
>   
>> Last, i'm not sure how you've managed to get 2  tags in the same
>> page! Perhaps if you can show a minimal example of your page + border
>> component we could help...
>>
>> On Mon, Jan 4, 2010 at 18:49, Ivano Luberti  wrote:
>>   
>> 
>>> Hi all.
>>>
>>> I'm trying to use javascript with Tapestry 4.1.6 and I'm stumbling at
>>> the very first steps.
>>>
>>> First of all I see that whenever a form component is specified in the
>>> template Tapestry put a script at the end of the generated html that set
>>> the focus on the first control of the form. If I try to put my specific
>>> function to give focus to a control of my choice, the automatically
>>> generated script is put as the last statement hence overruling my script.
>>>
>>> Secondly (I need a log introduction) I have used the example given in
>>>
>>> http://tapestry.apache.org/tapestry4.1/components/general/script.html
>>>
>>> to give focus to a control of my choice, but it fails: the problem is
>>> that when executed
>>>
>>> function setFocus() {
>>>  var inputField = document.barCodeForm_0.barCode;
>>>
>>>  if (inputField.type != "hidden") {
>>>  if (inputField.disabled != true) {
>>>  inputField.focus();
>>>  }
>>>  } else {
>>>  window.alert('InputFocus.script cannot set focus on a hidden field');
>>>  }
>>> }
>>>
>>> I debugged it using firebug and it seems then document.barCodeForm_0 is
>>> undefined.
>>> Actually looking at the generated html , barCodeForm_0 is there.
>>> But the html as a whole is a little weird. I attach it to the end of
>>> this message: the point is that html tag is closed and reopened several
>>> times.  I'm not enough javascript expert to understand if this is could
>>> cause my problem but looks anyeay bad to me.
>>> Here is my question: I had read that T416 templates have to be well
>>> formed HTML files but looking at the Tapestry Bench application I see
>>> that html templates don't include ,  and  tags.
>>> May I include them ?
>>>
>>> -generated html--
>>>
>>> 
>>> >> "http://www.w3.org/TR/html4/loose.dtd";>
>>> 
>>> 
>>> 
>>> 
>>> 
>>> 
>>> 
>>> Home Guide
>>> djConfig = 
>>> {"baseRelativePath":"/METGestioneIngressi/app?service=asset&path=%2Fdojo-0.4.3-custom-4.1.6%2F","preventBackButtonFix":false,"parseWidgets":false,"locale":"it-it"}
>>>  
>>>
>>> >> src="/METGestioneIngressi/app?service=asset&path=%2Fdojo-0.4.3-custom-4.1.6%2Fdojo.js
>>>  
>>> http://localhost:8081/METGestioneIngressi/app?service=asset&path=%2Fdojo-0.4.3-custom-4.1.6%2Fdojo.js>">>>  type="text/javascript" 
>>> src="/METGestioneIngressi/app?service=asset&path=%2Fdojo-0.4.3-custom-4.1.6%2Fdojo2.js
>>>  
>>> http://localhost:8081/METGestioneIngressi/app?service=asset&path=%2Fdojo-0.4.3-custom-4.1.6%2Fdojo2.js>">
>>>
>>> 
>>> dojo.registerModulePath("tapestry", 
>>> "/METGestioneIngressi/app?service=asset&path=%2Ftapestry-4.1.6%2F");
>>> 
>>> >> src="/METGestioneIngressi/app?service=asset&path=%2Ftapestry-4.1.6%2Fcore.js
>>>  
>>> http://localhost:8081/METGestioneIngressi/app?service=asset&path=%2Ftapestry-4.1.6%2Fcore.js>">
>>> 
>>> dojo.require("tapestry.namespace");
>>> tapestry.requestEncoding='UTF-8';
>>> 
>>> 
>>> MET Online
>>> 
>>> http://localhost:8081/METGestioneIngressi/css/stile_palmare.css>"
>>>  rel="stylesheet" type="text/css">
>>> 
>>> 
>>>
>>>
>>> 
>>> 
>>>
>>>
>>>Battistero
>>>
>>>  
>>> 
>>> MET Online
>>> 
>>> http://localhost:8081/METGestioneIngressi/css/stile_palmare.css>"
>>>  rel="stylesheet" type="text/css">
>>> 
>>> 
>>>
>>>
>>>Lettura BarCode
>>>
>>>
>>>passare il barcode sotto il lettore ottico
>>>
>>> >> name="formids" value="barCode" />
>>> >> value="BrO0ABXdtAGssc2VydmljZSQwLHBhZ2UkMCxjb21wb25lbnQkMCxjb250YWluZXIkMCxzZXNzaW9uJDAsc3AkMCx0YXBTaGVsbCQwLHRhcEJvZHkkMCxub2

Re: [T416] Javascript and html templates questions

2010-01-04 Thread Ivano Luberti
Andreas, thanks.  About my HTML template here it is (not sure what you
mean with border).
The homelogged user include a barCode component, that has its own html.


Andreas Andreou ha scritto:
> Last, i'm not sure how you've managed to get 2  tags in the same
> page! Perhaps if you can show a minimal example of your page + border
> component we could help...
>
> On Mon, Jan 4, 2010 at 18:49, Ivano Luberti  wrote:
>   
>> Hi all.
>>
>> I'm trying to use javascript with Tapestry 4.1.6 and I'm stumbling at
>> the very first steps.
>>
>> First of all I see that whenever a form component is specified in the
>> template Tapestry put a script at the end of the generated html that set
>> the focus on the first control of the form. If I try to put my specific
>> function to give focus to a control of my choice, the automatically
>> generated script is put as the last statement hence overruling my script.
>>
>> Secondly (I need a log introduction) I have used the example given in
>>
>> http://tapestry.apache.org/tapestry4.1/components/general/script.html
>>
>> to give focus to a control of my choice, but it fails: the problem is
>> that when executed
>>
>> function setFocus() {
>>  var inputField = document.barCodeForm_0.barCode;
>>
>>  if (inputField.type != "hidden") {
>>  if (inputField.disabled != true) {
>>  inputField.focus();
>>  }
>>  } else {
>>  window.alert('InputFocus.script cannot set focus on a hidden field');
>>  }
>> }
>>
>> I debugged it using firebug and it seems then document.barCodeForm_0 is
>> undefined.
>> Actually looking at the generated html , barCodeForm_0 is there.
>> But the html as a whole is a little weird. I attach it to the end of
>> this message: the point is that html tag is closed and reopened several
>> times.  I'm not enough javascript expert to understand if this is could
>> cause my problem but looks anyeay bad to me.
>> Here is my question: I had read that T416 templates have to be well
>> formed HTML files but looking at the Tapestry Bench application I see
>> that html templates don't include ,  and  tags.
>> May I include them ?
>>
>> -generated html--
>>
>> 
>> > "http://www.w3.org/TR/html4/loose.dtd";>
>> 
>> 
>> 
>> 
>> 
>> 
>> 
>> Home Guide
>> djConfig = 
>> {"baseRelativePath":"/METGestioneIngressi/app?service=asset&path=%2Fdojo-0.4.3-custom-4.1.6%2F","preventBackButtonFix":false,"parseWidgets":false,"locale":"it-it"}
>>  
>>
>> > src="/METGestioneIngressi/app?service=asset&path=%2Fdojo-0.4.3-custom-4.1.6%2Fdojo.js
>>  
>> http://localhost:8081/METGestioneIngressi/app?service=asset&path=%2Fdojo-0.4.3-custom-4.1.6%2Fdojo.js>">>  type="text/javascript" 
>> src="/METGestioneIngressi/app?service=asset&path=%2Fdojo-0.4.3-custom-4.1.6%2Fdojo2.js
>>  
>> http://localhost:8081/METGestioneIngressi/app?service=asset&path=%2Fdojo-0.4.3-custom-4.1.6%2Fdojo2.js>">
>>
>> 
>> dojo.registerModulePath("tapestry", 
>> "/METGestioneIngressi/app?service=asset&path=%2Ftapestry-4.1.6%2F");
>> 
>> > src="/METGestioneIngressi/app?service=asset&path=%2Ftapestry-4.1.6%2Fcore.js 
>> http://localhost:8081/METGestioneIngressi/app?service=asset&path=%2Ftapestry-4.1.6%2Fcore.js>">
>> 
>> dojo.require("tapestry.namespace");
>> tapestry.requestEncoding='UTF-8';
>> 
>> 
>> MET Online
>> 
>> http://localhost:8081/METGestioneIngressi/css/stile_palmare.css>"
>>  rel="stylesheet" type="text/css">
>> 
>> 
>>
>>
>> 
>> 
>>
>>
>>Battistero
>>
>>  
>> 
>> MET Online
>> 
>> http://localhost:8081/METGestioneIngressi/css/stile_palmare.css>"
>>  rel="stylesheet" type="text/css">
>> 
>> 
>>
>>
>>Lettura BarCode
>>
>>
>>passare il barcode sotto il lettore ottico
>>
>> > name="formids" value="barCode" />
>> > value="BrO0ABXdtAGssc2VydmljZSQwLHBhZ2UkMCxjb21wb25lbnQkMCxjb250YWluZXIkMCxzZXNzaW9uJDAsc3AkMCx0YXBTaGVsbCQwLHRhcEJvZHkkMCxub21lTW9udW1lbnRvJDAsYmFyQ29kZUZvcm0kMQ=="
>>  />
>> 
>> 
>> 
>> 
>> 
>> 
>> 
>>> class="text_box" />
>>
>>
>>
>>
>>
>>
>>   
>>
>> 
>> 
>>
>>
>> 
>>
>>
>>  
>> > href="/METGestioneIngressi/app?component=menu.linklogout&page=Home

Re: [T416] Javascript and html templates questions

2010-01-04 Thread Andreas Andreou
For the first question, there's a focus parameter in @Form
http://tapestry.apache.org/tapestry4.1/components/form/form.html

Just set it to false

For the js problems, perhaps that example is obsolete? Something
tells me it only works in IE... Anyway, there's a
tapestry.form.focusField() method in tapestry's js - you
could pass the html id of the control you want to focus to it
and it should just work.

Last, i'm not sure how you've managed to get 2  tags in the same
page! Perhaps if you can show a minimal example of your page + border
component we could help...

On Mon, Jan 4, 2010 at 18:49, Ivano Luberti  wrote:
> Hi all.
>
> I'm trying to use javascript with Tapestry 4.1.6 and I'm stumbling at
> the very first steps.
>
> First of all I see that whenever a form component is specified in the
> template Tapestry put a script at the end of the generated html that set
> the focus on the first control of the form. If I try to put my specific
> function to give focus to a control of my choice, the automatically
> generated script is put as the last statement hence overruling my script.
>
> Secondly (I need a log introduction) I have used the example given in
>
> http://tapestry.apache.org/tapestry4.1/components/general/script.html
>
> to give focus to a control of my choice, but it fails: the problem is
> that when executed
>
> function setFocus() {
>  var inputField = document.barCodeForm_0.barCode;
>
>  if (inputField.type != "hidden") {
>  if (inputField.disabled != true) {
>  inputField.focus();
>  }
>  } else {
>  window.alert('InputFocus.script cannot set focus on a hidden field');
>  }
> }
>
> I debugged it using firebug and it seems then document.barCodeForm_0 is
> undefined.
> Actually looking at the generated html , barCodeForm_0 is there.
> But the html as a whole is a little weird. I attach it to the end of
> this message: the point is that html tag is closed and reopened several
> times.  I'm not enough javascript expert to understand if this is could
> cause my problem but looks anyeay bad to me.
> Here is my question: I had read that T416 templates have to be well
> formed HTML files but looking at the Tapestry Bench application I see
> that html templates don't include ,  and  tags.
> May I include them ?
>
> -generated html--
>
> 
>  "http://www.w3.org/TR/html4/loose.dtd";>
> 
> 
> 
> 
> 
> 
> 
> Home Guide
> djConfig = 
> {"baseRelativePath":"/METGestioneIngressi/app?service=asset&path=%2Fdojo-0.4.3-custom-4.1.6%2F","preventBackButtonFix":false,"parseWidgets":false,"locale":"it-it"}
>  
>
>  src="/METGestioneIngressi/app?service=asset&path=%2Fdojo-0.4.3-custom-4.1.6%2Fdojo.js
>  
> http://localhost:8081/METGestioneIngressi/app?service=asset&path=%2Fdojo-0.4.3-custom-4.1.6%2Fdojo.js>">  type="text/javascript" 
> src="/METGestioneIngressi/app?service=asset&path=%2Fdojo-0.4.3-custom-4.1.6%2Fdojo2.js
>  
> http://localhost:8081/METGestioneIngressi/app?service=asset&path=%2Fdojo-0.4.3-custom-4.1.6%2Fdojo2.js>">
>
> 
> dojo.registerModulePath("tapestry", 
> "/METGestioneIngressi/app?service=asset&path=%2Ftapestry-4.1.6%2F");
> 
>  src="/METGestioneIngressi/app?service=asset&path=%2Ftapestry-4.1.6%2Fcore.js 
> http://localhost:8081/METGestioneIngressi/app?service=asset&path=%2Ftapestry-4.1.6%2Fcore.js>">
> 
> dojo.require("tapestry.namespace");
> tapestry.requestEncoding='UTF-8';
> 
> 
> MET Online
> 
> http://localhost:8081/METGestioneIngressi/css/stile_palmare.css>"
>  rel="stylesheet" type="text/css">
> 
> 
>
>
> 
> 
>
>        
>                Battistero
>
>  
> 
> MET Online
> 
> http://localhost:8081/METGestioneIngressi/css/stile_palmare.css>"
>  rel="stylesheet" type="text/css">
> 
> 
>
>    
>        Lettura BarCode
>                
>
>                passare il barcode sotto il lettore ottico
>    
>  name="formids" value="barCode" />
>  value="BrO0ABXdtAGssc2VydmljZSQwLHBhZ2UkMCxjb21wb25lbnQkMCxjb250YWluZXIkMCxzZXNzaW9uJDAsc3AkMCx0YXBTaGVsbCQwLHRhcEJvZHkkMCxub21lTW9udW1lbnRvJDAsYmFyQ29kZUZvcm0kMQ=="
>  />
> 
> 
> 
> 
> 
> 
> 
>                 class="text_box" />
>                
>
>        
>
>
>        
>   
>
> 
> 
>        
>
> 
>        
>                
>          
>                  href="/METGestione

Re: Workflow Engine for tapestry

2010-01-04 Thread Toby Hobson
Yeah jBPM is both appserver and web agnostic. It uses hibernate for ORM so
if you're already using hibernate in your app you can use the same session
factory and take advantage of caching, transaction management etc. Unlike
the commercial workflow products (Oracle etc) its very lightweight so
integration is a breeze

Toby

2010/1/4 abangkis 

> Hi juan,
>
> thanks a lot for the Info :)
>
> cheers,
>
> Abangkis
>
> On Mon, Jan 4, 2010 at 11:21 PM, Juan E. Maya  wrote:
> > I have used Jboss on tomcat and jetty without any problems. It should
> > run fine with any other app server. U just need to put the jar inside
> > ur classpath and start playing with it.
> >
> > To integrate with tapestry i guess u could have a tapestry service to
> > control the movement of the token between the workflow. Basically U
> > will use the service to move around the workflow graph.
> >
> > This article on TSS is a bit old but should give u a feeling of how is
> > to work with jbpm. It uses spring but it's practically the same with
> > tapestry.
> >
> > http://www.theserverside.com/tt/articles/article.tss?l=jBPMandSpring
> >
> >
> > On Mon, Jan 4, 2010 at 11:10 AM, abangkis  wrote:
> >> Hi toby, thanks for the info. jBPM is very popular, its a jboss
> >> product right. Are you deploying under jboss ? Can it be deployed in a
> >> different app server like Glassfish or Weblogic ?
> >>
> >> Can you give me some hint how you integrate it with tapestry. I'm
> >> still in the inception process between using a workflow engine or not.
> >>
> >>
> >> Thanks a lot,
> >> Cheers,
> >>
> >> Abangkis
> >>
> >>
> >> On Mon, Jan 4, 2010 at 10:52 PM, Toby Hobson <
> toby.hob...@googlemail.com> wrote:
> >>> If it's pure workflow (as opposed to SOA orchestration) I would
> recommend
> >>> jBPM, I have used it alongside T5 with great success.
> >>>
> >>> Toby
> >>>
> >>> 2010/1/4 abangkis 
> >>>
>  Dear all, i have a questions.
> 
>  Is there any recommendation for a workflow engine that would work well
>  with tapestry. Or is it using the Tapestry IOC is enough ?
> 
> 
>  TIA
> 
>  Abangkis
> 
>  -
>  To unsubscribe, e-mail: users-unsubscr...@tapestry.apache.org
>  For additional commands, e-mail: users-h...@tapestry.apache.org
> 
> 
> >>>
> >>
> >> -
> >> To unsubscribe, e-mail: users-unsubscr...@tapestry.apache.org
> >> For additional commands, e-mail: users-h...@tapestry.apache.org
> >>
> >>
> >
> > -
> > To unsubscribe, e-mail: users-unsubscr...@tapestry.apache.org
> > For additional commands, e-mail: users-h...@tapestry.apache.org
> >
> >
>
> -
> To unsubscribe, e-mail: users-unsubscr...@tapestry.apache.org
> For additional commands, e-mail: users-h...@tapestry.apache.org
>
>


[T416] Javascript and html templates questions

2010-01-04 Thread Ivano Luberti
Hi all.

I'm trying to use javascript with Tapestry 4.1.6 and I'm stumbling at
the very first steps.

First of all I see that whenever a form component is specified in the
template Tapestry put a script at the end of the generated html that set
the focus on the first control of the form. If I try to put my specific
function to give focus to a control of my choice, the automatically
generated script is put as the last statement hence overruling my script.

Secondly (I need a log introduction) I have used the example given in

http://tapestry.apache.org/tapestry4.1/components/general/script.html

to give focus to a control of my choice, but it fails: the problem is
that when executed

function setFocus() {
  var inputField = document.barCodeForm_0.barCode;

  if (inputField.type != "hidden") {
  if (inputField.disabled != true) {
  inputField.focus();
  }
  } else {
 window.alert('InputFocus.script cannot set focus on a hidden field');
  }
}

I debugged it using firebug and it seems then document.barCodeForm_0 is
undefined.
Actually looking at the generated html , barCodeForm_0 is there.
But the html as a whole is a little weird. I attach it to the end of
this message: the point is that html tag is closed and reopened several
times.  I'm not enough javascript expert to understand if this is could
cause my problem but looks anyeay bad to me.
Here is my question: I had read that T416 templates have to be well
formed HTML files but looking at the Tapestry Bench application I see
that html templates don't include ,  and  tags.
May I include them ?

-generated html--


http://www.w3.org/TR/html4/loose.dtd";>







Home Guide
djConfig = 
{"baseRelativePath":"/METGestioneIngressi/app?service=asset&path=%2Fdojo-0.4.3-custom-4.1.6%2F","preventBackButtonFix":false,"parseWidgets":false,"locale":"it-it"}
 

http://localhost:8081/METGestioneIngressi/app?service=asset&path=%2Fdojo-0.4.3-custom-4.1.6%2Fdojo.js>">http://localhost:8081/METGestioneIngressi/app?service=asset&path=%2Fdojo-0.4.3-custom-4.1.6%2Fdojo2.js>">


dojo.registerModulePath("tapestry", 
"/METGestioneIngressi/app?service=asset&path=%2Ftapestry-4.1.6%2F");

http://localhost:8081/METGestioneIngressi/app?service=asset&path=%2Ftapestry-4.1.6%2Fcore.js>">

dojo.require("tapestry.namespace");
tapestry.requestEncoding='UTF-8';


MET Online

http://localhost:8081/METGestioneIngressi/css/stile_palmare.css>" 
rel="stylesheet" type="text/css">








Battistero 

  

MET Online

http://localhost:8081/METGestioneIngressi/css/stile_palmare.css>" 
rel="stylesheet" type="text/css">



 
Lettura BarCode


passare il barcode sotto il lettore ottico















 

  


 
 





 http://localhost:8081/METGestioneIngressi/app?component=menu.linklogout&page=HomeLoggedUser&service=direct&session=T>">LogOut 
   
  
















-- 
==
dott. Ivano Mario Luberti
Archimede Informatica societa' cooperativa a r. l.
Sede Operativa
Via Gereschi 36 - 56126- Pisa
tel.: +39-050- 580959
tel/fax: +39-050-9711344
web: www.archicoop.it
==


-
To unsubscribe, e-mail: users-unsubscr...@tapestry.apache.org
For additional commands, e-mail: users-h...@tapestry.apache.org



Re: Workflow Engine for tapestry

2010-01-04 Thread abangkis
Hi juan,

thanks a lot for the Info :)

cheers,

Abangkis

On Mon, Jan 4, 2010 at 11:21 PM, Juan E. Maya  wrote:
> I have used Jboss on tomcat and jetty without any problems. It should
> run fine with any other app server. U just need to put the jar inside
> ur classpath and start playing with it.
>
> To integrate with tapestry i guess u could have a tapestry service to
> control the movement of the token between the workflow. Basically U
> will use the service to move around the workflow graph.
>
> This article on TSS is a bit old but should give u a feeling of how is
> to work with jbpm. It uses spring but it's practically the same with
> tapestry.
>
> http://www.theserverside.com/tt/articles/article.tss?l=jBPMandSpring
>
>
> On Mon, Jan 4, 2010 at 11:10 AM, abangkis  wrote:
>> Hi toby, thanks for the info. jBPM is very popular, its a jboss
>> product right. Are you deploying under jboss ? Can it be deployed in a
>> different app server like Glassfish or Weblogic ?
>>
>> Can you give me some hint how you integrate it with tapestry. I'm
>> still in the inception process between using a workflow engine or not.
>>
>>
>> Thanks a lot,
>> Cheers,
>>
>> Abangkis
>>
>>
>> On Mon, Jan 4, 2010 at 10:52 PM, Toby Hobson  
>> wrote:
>>> If it's pure workflow (as opposed to SOA orchestration) I would recommend
>>> jBPM, I have used it alongside T5 with great success.
>>>
>>> Toby
>>>
>>> 2010/1/4 abangkis 
>>>
 Dear all, i have a questions.

 Is there any recommendation for a workflow engine that would work well
 with tapestry. Or is it using the Tapestry IOC is enough ?


 TIA

 Abangkis

 -
 To unsubscribe, e-mail: users-unsubscr...@tapestry.apache.org
 For additional commands, e-mail: users-h...@tapestry.apache.org


>>>
>>
>> -
>> To unsubscribe, e-mail: users-unsubscr...@tapestry.apache.org
>> For additional commands, e-mail: users-h...@tapestry.apache.org
>>
>>
>
> -
> To unsubscribe, e-mail: users-unsubscr...@tapestry.apache.org
> For additional commands, e-mail: users-h...@tapestry.apache.org
>
>

-
To unsubscribe, e-mail: users-unsubscr...@tapestry.apache.org
For additional commands, e-mail: users-h...@tapestry.apache.org



Re: Workflow Engine for tapestry

2010-01-04 Thread Juan E. Maya
I have used Jboss on tomcat and jetty without any problems. It should
run fine with any other app server. U just need to put the jar inside
ur classpath and start playing with it.

To integrate with tapestry i guess u could have a tapestry service to
control the movement of the token between the workflow. Basically U
will use the service to move around the workflow graph.

This article on TSS is a bit old but should give u a feeling of how is
to work with jbpm. It uses spring but it's practically the same with
tapestry.

http://www.theserverside.com/tt/articles/article.tss?l=jBPMandSpring


On Mon, Jan 4, 2010 at 11:10 AM, abangkis  wrote:
> Hi toby, thanks for the info. jBPM is very popular, its a jboss
> product right. Are you deploying under jboss ? Can it be deployed in a
> different app server like Glassfish or Weblogic ?
>
> Can you give me some hint how you integrate it with tapestry. I'm
> still in the inception process between using a workflow engine or not.
>
>
> Thanks a lot,
> Cheers,
>
> Abangkis
>
>
> On Mon, Jan 4, 2010 at 10:52 PM, Toby Hobson  
> wrote:
>> If it's pure workflow (as opposed to SOA orchestration) I would recommend
>> jBPM, I have used it alongside T5 with great success.
>>
>> Toby
>>
>> 2010/1/4 abangkis 
>>
>>> Dear all, i have a questions.
>>>
>>> Is there any recommendation for a workflow engine that would work well
>>> with tapestry. Or is it using the Tapestry IOC is enough ?
>>>
>>>
>>> TIA
>>>
>>> Abangkis
>>>
>>> -
>>> To unsubscribe, e-mail: users-unsubscr...@tapestry.apache.org
>>> For additional commands, e-mail: users-h...@tapestry.apache.org
>>>
>>>
>>
>
> -
> To unsubscribe, e-mail: users-unsubscr...@tapestry.apache.org
> For additional commands, e-mail: users-h...@tapestry.apache.org
>
>

-
To unsubscribe, e-mail: users-unsubscr...@tapestry.apache.org
For additional commands, e-mail: users-h...@tapestry.apache.org



Re: Workflow Engine for tapestry

2010-01-04 Thread abangkis
Hi toby, thanks for the info. jBPM is very popular, its a jboss
product right. Are you deploying under jboss ? Can it be deployed in a
different app server like Glassfish or Weblogic ?

Can you give me some hint how you integrate it with tapestry. I'm
still in the inception process between using a workflow engine or not.


Thanks a lot,
Cheers,

Abangkis


On Mon, Jan 4, 2010 at 10:52 PM, Toby Hobson  wrote:
> If it's pure workflow (as opposed to SOA orchestration) I would recommend
> jBPM, I have used it alongside T5 with great success.
>
> Toby
>
> 2010/1/4 abangkis 
>
>> Dear all, i have a questions.
>>
>> Is there any recommendation for a workflow engine that would work well
>> with tapestry. Or is it using the Tapestry IOC is enough ?
>>
>>
>> TIA
>>
>> Abangkis
>>
>> -
>> To unsubscribe, e-mail: users-unsubscr...@tapestry.apache.org
>> For additional commands, e-mail: users-h...@tapestry.apache.org
>>
>>
>

-
To unsubscribe, e-mail: users-unsubscr...@tapestry.apache.org
For additional commands, e-mail: users-h...@tapestry.apache.org



Re: Workflow Engine for tapestry

2010-01-04 Thread Toby Hobson
If it's pure workflow (as opposed to SOA orchestration) I would recommend
jBPM, I have used it alongside T5 with great success.

Toby

2010/1/4 abangkis 

> Dear all, i have a questions.
>
> Is there any recommendation for a workflow engine that would work well
> with tapestry. Or is it using the Tapestry IOC is enough ?
>
>
> TIA
>
> Abangkis
>
> -
> To unsubscribe, e-mail: users-unsubscr...@tapestry.apache.org
> For additional commands, e-mail: users-h...@tapestry.apache.org
>
>


RE: Spring Security with T5RESTful Services

2010-01-04 Thread Jim O'Callaghan
Bent - apologies - seems to be some issue - even with new mail I seem to be
unintentionally posting under the same thread.

Regards,
Jim.

-Original Message-
From: Jim O'Callaghan [mailto:jc1000...@yahoo.co.uk]
Sent: 04 January 2010 10:42
To: users@tapestry.apache.org
Subject: Spring Security with T5RESTful Services


Has anyone got Spring Security annotations (@Secured("ROLE_XYZ") etc.)
working with the restful web services implementation
http://code.google.com/p/t5-restful-webservices - I'd rather not alter the
source if someone already has a workaround (ordering filters?) would love to
hear from you - thanks.

Regards,
Jim.


-
To unsubscribe, e-mail: users-unsubscr...@tapestry.apache.org
For additional commands, e-mail: users-h...@tapestry.apache.org



Spring Security with T5RESTful Services

2010-01-04 Thread Jim O'Callaghan
Has anyone got Spring Security annotations (@Secured("ROLE_XYZ") etc.)
working with the restful web services implementation
http://code.google.com/p/t5-restful-webservices - I'd rather not alter the
source if someone already has a workaround (ordering filters?) would love to
hear from you - thanks.

Regards,
Jim.


-
To unsubscribe, e-mail: users-unsubscr...@tapestry.apache.org
For additional commands, e-mail: users-h...@tapestry.apache.org



Re: Spring Security with T5RESTful Services

2010-01-04 Thread lebenski

Think you might've put this in the wrong place Jim!  I assume you mean't to
start a new thread?


jc1001 wrote:
> 
> Has anyone got Spring Security annotations (@Secured("ROLE_XYZ") etc.)
> working with the restful web services implementation
> http://code.google.com/p/t5-restful-webservices - I'd rather not alter the
> source if someone already has a workaround (ordering filters?) would love
> to
> hear from you - thanks.
> 
> Regards,
> Jim.
> 
> 
> -
> To unsubscribe, e-mail: users-unsubscr...@tapestry.apache.org
> For additional commands, e-mail: users-h...@tapestry.apache.org
> 
> 
> 

-- 
View this message in context: 
http://old.nabble.com/-T5.0.18--%40InjectedPage-does-not-have-access-to-it%27s-own-layout-tp27010913p27011077.html
Sent from the Tapestry - User mailing list archive at Nabble.com.


-
To unsubscribe, e-mail: users-unsubscr...@tapestry.apache.org
For additional commands, e-mail: users-h...@tapestry.apache.org



Spring Security with T5RESTful Services

2010-01-04 Thread Jim O'Callaghan
Has anyone got Spring Security annotations (@Secured("ROLE_XYZ") etc.)
working with the restful web services implementation
http://code.google.com/p/t5-restful-webservices - I'd rather not alter the
source if someone already has a workaround (ordering filters?) would love to
hear from you - thanks.

Regards,
Jim.


-
To unsubscribe, e-mail: users-unsubscr...@tapestry.apache.org
For additional commands, e-mail: users-h...@tapestry.apache.org



[T5.0.18] @InjectedPage does not have access to it's own layout

2010-01-04 Thread lebenski

I have a layout component that contains a login form:







Page Class:

Object onSuccessFromLoginForm() {
try{
loggedInMember = loginManager.logUserIn(new Login(memberName,
password));
} catch(LoginException e) {
//Login Error Processing
}
   
return Index.class;
}

I also have a generic confirmation page which I use for page flows where I
need to present some message to the user.  For example "Thanks for
submitting a question"

SubmitQuestion.java

@InjectPage
private Confirmation confirmation;

Object onSuccessFromQuestionForm() {
//processing
confirmation.setType(ConfirmationType.SUCCESS);
confirmation.setMessage(Messages.get("question-submit"));

return confirmation;
}

The confirmation template itself is inside the layout:

http://tapestry.apache.org/schema/tapestry_5_1_0.xsd";>
${type}
${message}


However, for some reason I don't seem to have access to the layout from this
confirmation page.  If I try to use the login form, the Index page is loaded
but the user is not logged in.  In fact as far as I can see (through
debugging), the onSuccessFromLoginForm() method in the Layout is never
called.

I'm at a bit of a loss as to why this is happening, as this is working on
all other pages in my application.  Is there some specific nuance of using
@InjectPage that could be causing this issue?
-- 
View this message in context: 
http://old.nabble.com/-T5.0.18--%40InjectedPage-does-not-have-access-to-it%27s-own-layout-tp27010913p27010913.html
Sent from the Tapestry - User mailing list archive at Nabble.com.


-
To unsubscribe, e-mail: users-unsubscr...@tapestry.apache.org
For additional commands, e-mail: users-h...@tapestry.apache.org



Workflow Engine for tapestry

2010-01-04 Thread abangkis
Dear all, i have a questions.

Is there any recommendation for a workflow engine that would work well
with tapestry. Or is it using the Tapestry IOC is enough ?


TIA

Abangkis

-
To unsubscribe, e-mail: users-unsubscr...@tapestry.apache.org
For additional commands, e-mail: users-h...@tapestry.apache.org



Re: Number Formatting in TextField (T5)

2010-01-04 Thread Ville Virtanen

Hi,

we actually made it the hard way and currently we have our own
BigDecimalFieldTranslatorImpl, which takes care of the actual validation, as
seen here:

public class BigDecimalFieldTranslatorImpl extends
FieldTranslatorImpl {

private final Locale locale;
private final int numberOfDecimals;
private final Field field;
private final MessageFormatter messageFormatter;
private final Messages messages;
private final boolean useGrouping;

public BigDecimalFieldTranslatorImpl(int numberOfDecimals, boolean
useGrouping, Locale locale, Field field, Translator translator,
MessageFormatter formatter, FormSupport formSupport, Messages messages) {
super(field, translator, formatter, formSupport);
this.locale = locale;
this.numberOfDecimals = numberOfDecimals;
this.field = field;
this.messageFormatter = formatter;
this.messages = messages;
this.useGrouping = useGrouping;
}

@Override
public String toClient(BigDecimal value)
{
if(useGrouping){
return NumberFormatUtility.formatWithGrouping(value,
numberOfDecimals, locale);
}
return NumberFormatUtility.format(value, numberOfDecimals, locale);
}

@Override
public BigDecimal parse(String input) throws ValidationException {

if(input != null) {
input = input.replaceAll("\\s", "");
}

BigDecimal result = super.parse(input);

if(NumberFormatUtility.hasTooManyDecimals(input, numberOfDecimals,
locale)) {
throw new ValidationException(formatMessage());
}

return result;
}

private String formatMessage()
{
if(numberOfDecimals == 0) {
return messages.format("integer-format-exception",
field.getLabel());
} else {
return
messages.format("fi.cerion.common.too-many-decimal-places",
field.getLabel(), numberOfDecimals);
}
}

}

However, to supply per field validation data to the validator we opted to
make our own service that is used to get the field translator:
public class CerionFieldTranslatorSourceImpl implements
CerionFieldTranslatorSource {

private final PersistentLocale persistentLocale;
private final TranslatorSource translatorSource;
private final FieldTranslatorSource fieldTranslatorSource;
private final ValidationMessagesSource validationMessagesSource;
private final FormSupport formSupport;

public CerionFieldTranslatorSourceImpl(PersistentLocale
persistentLocale, TranslatorSource translatorSource, FieldTranslatorSource
fieldTranslatorSource, ValidationMessagesSource validationMessagesSource,
FormSupport formSupport) {
this.persistentLocale = persistentLocale;
this.translatorSource = translatorSource;
this.fieldTranslatorSource = fieldTranslatorSource;
this.validationMessagesSource = validationMessagesSource;
this.formSupport = formSupport;
}

@Override
public FieldTranslator createBigDecimalTranslator(Field
field, int numberOfDecimals)
{
ComponentResources resources =
((ComponentResourcesAware)field).getComponentResources();
Translator translator =
translatorSource.getByType(BigDecimal.class);

return createTranslator(field, resources.getId(),
resources.getContainerMessages(), resources.getLocale(), translator,
numberOfDecimals, false);
}

@Override
public FieldTranslator createBigDecimalTranslator(Field
field, int numberOfDecimals, boolean useGrouping)
{
ComponentResources resources =
((ComponentResourcesAware)field).getComponentResources();
Translator translator =
translatorSource.getByType(BigDecimal.class);

return createTranslator(field, resources.getId(),
resources.getContainerMessages(), resources.getLocale(), translator,
numberOfDecimals, useGrouping);
}

private FieldTranslator createTranslator(Field field, String overrideId,
Messages overrideMessages, Locale locale, Translator translator, int
numberOfDecimals, boolean useGrouping)
{
MessageFormatter formatter = findFormatter(overrideId,
overrideMessages, locale, translator);
return new BigDecimalFieldTranslatorImpl(numberOfDecimals,
useGrouping, locale, field, translator, formatter, formSupport,
overrideMessages);
}

private MessageFormatter findFormatter(String overrideId, Messages
overrideMessages, Locale locale,
   Translator translator)
{
// TAP5-228: Try to distinguish message overrides by form id and
overrideId (i.e., property name) first.

String translatorName = translator.getName();

String overrideKey = formSupport.getFormValidationId() + "-" +
overrideId + "-" + translatorName + "-message";

if (overrideMessages.contains(overrideKey))
return overrideMessages.getFormatter(overrideKey);

// Ok, look for a simpler name that om