Re: [SOLVED] T5.1.0.5 on JBoss 5.1.0 = no standard components

2009-10-31 Thread Janko Muzykant

ok, I found solution for JBoss 5.1.0. It's enough to use the same url
converter that Geoff pointed out and add "-Djboss.vfs.forceCopy=false" to
JBoss JAVA_OPTS. At least, it solved the problem for me :)

enjoy,
m.



Janko Muzykant wrote:
> 
> thanks for this hint. i tried to adjust ClassPathURLConverter for JB 5.1
> but i'm not really sure what URL should I return to make it all working.
> this is how sample incoming url looks like:
> 
> vfszip:/Users/janko/jboss-5.1.0.GA/server/myapp/deploy/myapp-ear.ear/myapp-webapp-1.0-SNAPSHOT.war/WEB-INF/classes/org/myapp/web/tapestry/pages/
> 
> i may extract the "real" path:
> 
> /Users/janko/jboss-5.1.0.GA/server/myapp/tmp/a12x-5le7zb-g1f16qd9-1-g1f17m6c-9i/myapp-webapp-1.0-SNAPSHOT.war/WEB-INF/classes/org/myapp/web/tapestry/pages/
> 
> and how should I construct target URL now?
> 
> cheers,
> m.
> 
> 
> Geoff Callender-2 wrote:
>> 
>> I don't of any a solution to making T5 work with JBoss 5.1.*, but it's  
>> fine with 5.0.1 if you follow
>> http://wiki.apache.org/tapestry/HowToRunTapestry5OnJBoss5 
>> 
>> 
>> On 30/10/2009, at 11:42 AM, Thiago H. de Paula Figueiredo wrote:
>> 
>>> It's just a wild guess, but check if the Tapestry JARs are  
>>> corrupted. This can cause all sorts of strange behaviour.
>>>
>>> -- 
>>> 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
>>>
>> 
>> 
>> -
>> 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.1.0.5-on-JBoss-5.1.0-%3D-no-standard-components-tp26123165p26146824.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:how to support AJAX submit

2009-10-31 Thread Inge Solvoll
You can't use Ajax.PeriodicalUpdater, you need to submit the zone form the
tapestry way, doing the periodical stuff manually. See:
http://api.prototypejs.org/language/periodicalexecuter.html

I created a javascript function for manually submitting a zone form. These 2
things together should get you what you want. I actually implemented the
same you are describing here just recently, so I've done it and it works.

See my blog for the javascript you need.

http://tinybits.blogspot.com/2009/10/missing-javascript.html



On Fri, Oct 30, 2009 at 2:29 PM, cleverpig  wrote:

> thanks! it's really good solution!
>
> in another side:
> if we do some background-process such as "autosave" when user input a long
> form.
> we should use ajax.periodUpdater method to save data automaticly,but
> this way only can use url as target without ability to submit form.
> so where can we get the form submitted data?
> in ajax way,it could be done with serialized form into json format,but
> in the page event handle hwo to identify and process them?
>
> On Fri, Oct 30, 2009 at 4:43 PM, Ulrich Stärk  wrote:
> > "Binding the zone parameter will cause the form submission to be handled
> as
> > an Ajax request that updates the indicated zone. Often a Form will update
> > the same zone that contains it."
> >
> >
> http://tapestry.apache.org/tapestry5.1/tapestry-core/ref/org/apache/tapestry5/corelib/components/Form.html
> >
> > So just put a zone component around your form and point the form's zone
> > attribute to that zone.
> >
> > Uli
> >
> > Am 30.10.2009 05:55 schrieb cleverpig:
> >>
> >> Currently the Editor component does not support an asynchronous submit
> >> (AJAX).
> >>
> >> for example:
> >> 1.build a form with submit button to save data to database.
> >> 2.add a mixins which listening click event to this submit button with
> >> ajax request & callback.
> >> 3.when user click this submit button,the form will submit & return.
> >> 4.so ajax request maybe be handled,but callback will lost,since the form
> >> submit.
> >>
> >> and how to use post way in ajax, so that tapestry event handler counld
> >> accept the ajax post?
> >>
> >> do you have idea on it?
> >>
> >>
> >
> > -
> > To unsubscribe, e-mail: users-unsubscr...@tapestry.apache.org
> > For additional commands, e-mail: users-h...@tapestry.apache.org
> >
> >
>
>
>
> --
> cleverpig(Dan)
> Location: Beijing
> Address: Room 4018,No.A2 South Avenue Fuxingmen Beijing,P.R.China
> Zipcode: 100031
> MSN: great_liu...@hotmail.com
> QQ: 149291732
> Skype: cleverpigatmatrix
> Facebook ID:cleverpig
> Blog: www.cleverpig.name
> Tags: del.icio.us/cleverpig
> Twitter: twitter.com/cleverpig
> 新浪微博: t.sina.com.cn/cleverpig
> Organization: www.beijing-open-party.org
> or...@facebook: http://www.facebook.com/group.php?gid=8159558294
>
> -
> To unsubscribe, e-mail: users-unsubscr...@tapestry.apache.org
> For additional commands, e-mail: users-h...@tapestry.apache.org
>
>


Re: Getting ServletContext inside service

2009-10-31 Thread Benny Law
That depends on how your service is managed. I bind my service using the
static binder in AppModule and use constructor arguments to inject what I
need into my service object, and this works for me.

Benny

On Sat, Oct 31, 2009 at 4:47 AM, Stefan  wrote:

> Thanks Benny,
>
> i've tried that too, but it does not work.
> The context is null.
>
> Here's how i do it:
>
> @Inject
> private org.apache.tapestry5.services.Context context;
>
> Should that work?
>
> Stefan
>
>
>
> Am 30.10.2009 um 23:50 schrieb Benny Law:
>
>
>  Hi Stefan,
>>
>> Try injecting org.apache.tapestry5.services.Context into your service and
>> use its getInitParameter() method to retrieve your context parameters.
>>
>> Regards,
>>
>> Benny Law
>>
>> On Fri, Oct 30, 2009 at 3:56 PM, Stefan  wrote:
>>
>>  Hi,
>>>
>>> is there a way to get access to the ServletContext inside a service bean?
>>>
>>> I like to configure some parameters within the web.xml which i need in
>>> some
>>> services.
>>> How can i retrieve these parameters?
>>> Injecting "ApplicationGlobals" does not work.
>>>
>>> Where is my mistake?
>>>
>>> Thanks in advance.
>>> Stefan
>>>
>>
>


Re: Tapestry 5 and Clojure

2009-10-31 Thread Howard Lewis Ship
I suppose you could use Clojure for back end logic that is
traditionally implemented as IoC services.  Using proxy and/or
genclass, you might even be able to have Clojure functions be the
implementation of service interfaces.

If you are saying "can I implement pages and components in Clojure" I
would say that is a signficant dead-end.  Clojure is about avoiding
state, Tapestry is about embracing state.

Also check out http://github.com/hlship/cascade

On Sat, Oct 31, 2009 at 2:53 AM, Sergey Didenko
 wrote:
> Can anyone advise best practices on using Tapestry 5 with Clojure?
>
> Tapestry 5 is a good choice if I want to use Clojure widely, isn't it?
>
> -
> To unsubscribe, e-mail: users-unsubscr...@tapestry.apache.org
> For additional commands, e-mail: users-h...@tapestry.apache.org
>
>



-- 
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



Tapestry 5 and Clojure

2009-10-31 Thread Sergey Didenko
Can anyone advise best practices on using Tapestry 5 with Clojure?

Tapestry 5 is a good choice if I want to use Clojure widely, isn't it?

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



Re: Getting ServletContext inside service

2009-10-31 Thread Stefan

Thanks Benny,

i've tried that too, but it does not work.
The context is null.

Here's how i do it:

@Inject
private org.apache.tapestry5.services.Context context;

Should that work?

Stefan



Am 30.10.2009 um 23:50 schrieb Benny Law:


Hi Stefan,

Try injecting org.apache.tapestry5.services.Context into your  
service and

use its getInitParameter() method to retrieve your context parameters.

Regards,

Benny Law

On Fri, Oct 30, 2009 at 3:56 PM, Stefan  wrote:


Hi,

is there a way to get access to the ServletContext inside a service  
bean?


I like to configure some parameters within the web.xml which i need  
in some

services.
How can i retrieve these parameters?
Injecting "ApplicationGlobals" does not work.

Where is my mistake?

Thanks in advance.
Stefan




smime.p7s
Description: S/MIME cryptographic signature


Re: currentLocale vs persistentLocale

2009-10-31 Thread Gunnar Eketrapp
And here is the relevant part from PPGK

/**
 * Check the rights of the user for the page requested
 *
 * @throws IOException
 */
public boolean checkAccess(String pageName, Request request, Response
response) throws IOException {
boolean canAccess = true;


/* Is the requested page private ? */
Component page = componentSource.getPage(pageName);
ProtectedPage pp =
page.getClass().getAnnotation(ProtectedPage.class);
boolean protectedPage = pp != null;

if (protectedPage) {
// logger.debug("checkAccess: " + pageName);
canAccess = false;

// If User exists and he has the required role give him access
if (sessionStateManager.exists(User.class)) {
User user = sessionStateManager.get(User.class);
canAccess = user.isSuperAdmin() || user.hasRole(pp.role());
if (!canAccess)
logger.debug("User " + user + " Role " + pp.role() + "
needed by page " + pageName);
}
}

/*
 * This page can't be requested by a non-authenticated user => we
redirect him to the LogIn page
 */
if (!canAccess) {
if (page != null) {
// Setup Login page to redirect to the secured page after
the login
Object obj = componentSource.getPage(Login.class);
ILogin login = (ILogin) obj;
login.setRedirectTo(page);
}
response.sendRedirect(request.getContextPath() + LOGIN_PAGE);
return true; // Make sure to leave the chain
}

return false;
}


2009/10/31 Gunnar Eketrapp 

> Hi!
>
> This morning I made a test since I suspected that it was the introduction
> of the ProtectedPageGateKeeper that hade sideeffects on the locale handling.
>
> When I removed the PPGK everyhting worked as normal!
>
> So now I am investigating why the PPGK dispacther interferes with T5's
> locale handling.
>
> A clue anyone?
>
>
> /Gunnar
>
> 2009/10/30 Gunnar Eketrapp 
>
>> Hi !
>>
>> Given these injections ...
>>
>> @Inject
>> private PersistentLocale persistentLocale;
>>
>> @Inject
>> private Locale currentLocale;
>>
>> ... what should be the value of currentLocale. I.e. after that the
>> persistent locale has been set, should curentLocale follow?
>>
>> I will conduct tests tomorrow with a minimal project but the locale
>> handling in my project is quite fucked up right now and it is driving me
>> crazy.
>>
>> I assume that it should just be to call persistentLocale.set() in an
>> action link method and after that things should work. But for me they are
>> not ...
>>
>> /Gunnar
>>
>>
>>
>> 2009/10/30 Gunnar Eketrapp 
>>
>>> Hi!
>>>
>>> The code below is not PROD ready yet. The first section is to setup input
>>> fields with label inside them.
>>> Something that our "designers" seems slick!
>>>
>>> The state locale is used it to remember the locale when called from a
>>> flash menu
>>> that "discarded" the persistent locale. The flash menu is feeded with
>>> special pages
>>> that resets the persitent locale ... and redirects to the actial page.
>>>
>>> Shit this seems messy ...
>>>
>>> Thanks for the help anyway!
>>>
>>> /Gunnar
>>>
>>>   @SetupRender
>>> void setupComponent()
>>> {
>>> if (!userExists) {
>>> username = messages.get("username");
>>> password = messages.get("password");
>>> } else {
>>> username = user.getUsername();
>>> password = messages.get("password");
>>> }
>>>
>>> language = currentLocale.getLanguage();
>>>
>>> log.debug(LOGPRE + "1:
>>> TellLayout.setupComponent(currentLocale.language=" + language + ")");
>>> if ((null == state.getLocale()) && (language != null)) {
>>> state.setLocale(new Locale(language));
>>> log.debug(LOGPRE + "2: TellLayout.setupComponent(state.locale
>>> initiated to " + state.getLocale() + ")");
>>> }
>>>
>>> if (!persistentLocale.isSet()) {
>>> persistentLocale.set(state.getLocale());
>>> log.debug(LOGPRE + "3:
>>> TellLayout.setupComponent(persistentLocale.set(" + persistentLocale.get() +
>>> ")");
>>> } else {
>>> log.debug(LOGPRE + "4:
>>> TellLayout.setupComponent(persistentLocale=" + persistentLocale.get() +
>>> ")");
>>> }
>>>
>>> // -- Localize account menu texts. --
>>> createAccountMenu();
>>>
>>> }
>>>
>>>
>>> 2009/10/30 cordenier christophe 
>>>
 To what corresponds exactly this logs in your rendering scenario ?

 [DEBUG] components.TellLayout <<< --- TELLGAMING --- >>>: 1:
 TellLayout.setupComponent(
 currentLocale.language=sv)
 [DEBUG] components.TellLayout <<< --- TELLGAMING --- >>>: 4:
 TellLayout.setupComponent(persistentLocale=en)


 2009/10/30 cordenier christophe 

 > Sorry i

Re: currentLocale vs persistentLocale

2009-10-31 Thread Gunnar Eketrapp
Hi!

This morning I made a test since I suspected that it was the introduction of
the ProtectedPageGateKeeper that hade sideeffects on the locale handling.

When I removed the PPGK everyhting worked as normal!

So now I am investigating why the PPGK dispacther interferes with T5's
locale handling.

A clue anyone?

/Gunnar

2009/10/30 Gunnar Eketrapp 

> Hi !
>
> Given these injections ...
>
> @Inject
> private PersistentLocale persistentLocale;
>
> @Inject
> private Locale currentLocale;
>
> ... what should be the value of currentLocale. I.e. after that the
> persistent locale has been set, should curentLocale follow?
>
> I will conduct tests tomorrow with a minimal project but the locale
> handling in my project is quite fucked up right now and it is driving me
> crazy.
>
> I assume that it should just be to call persistentLocale.set() in an action
> link method and after that things should work. But for me they are not ...
>
> /Gunnar
>
>
>
> 2009/10/30 Gunnar Eketrapp 
>
>> Hi!
>>
>> The code below is not PROD ready yet. The first section is to setup input
>> fields with label inside them.
>> Something that our "designers" seems slick!
>>
>> The state locale is used it to remember the locale when called from a
>> flash menu
>> that "discarded" the persistent locale. The flash menu is feeded with
>> special pages
>> that resets the persitent locale ... and redirects to the actial page.
>>
>> Shit this seems messy ...
>>
>> Thanks for the help anyway!
>>
>> /Gunnar
>>
>>   @SetupRender
>> void setupComponent()
>> {
>> if (!userExists) {
>> username = messages.get("username");
>> password = messages.get("password");
>> } else {
>> username = user.getUsername();
>> password = messages.get("password");
>> }
>>
>> language = currentLocale.getLanguage();
>>
>> log.debug(LOGPRE + "1:
>> TellLayout.setupComponent(currentLocale.language=" + language + ")");
>> if ((null == state.getLocale()) && (language != null)) {
>> state.setLocale(new Locale(language));
>> log.debug(LOGPRE + "2: TellLayout.setupComponent(state.locale
>> initiated to " + state.getLocale() + ")");
>> }
>>
>> if (!persistentLocale.isSet()) {
>> persistentLocale.set(state.getLocale());
>> log.debug(LOGPRE + "3:
>> TellLayout.setupComponent(persistentLocale.set(" + persistentLocale.get() +
>> ")");
>> } else {
>> log.debug(LOGPRE + "4:
>> TellLayout.setupComponent(persistentLocale=" + persistentLocale.get() +
>> ")");
>> }
>>
>> // -- Localize account menu texts. --
>> createAccountMenu();
>>
>> }
>>
>>
>> 2009/10/30 cordenier christophe 
>>
>>> To what corresponds exactly this logs in your rendering scenario ?
>>>
>>> [DEBUG] components.TellLayout <<< --- TELLGAMING --- >>>: 1:
>>> TellLayout.setupComponent(
>>> currentLocale.language=sv)
>>> [DEBUG] components.TellLayout <<< --- TELLGAMING --- >>>: 4:
>>> TellLayout.setupComponent(persistentLocale=en)
>>>
>>>
>>> 2009/10/30 cordenier christophe 
>>>
>>> > Sorry i have missed
>>> >
>>> > [DEBUG] AppModule.
>>> > ProtectedPageGateKeeper PPGK.path=/en/tellfriends
>>> >
>>> >
>>> > 2009/10/30 Gunnar Eketrapp 
>>> >
>>> >> Hi!
>>> >>
>>> >> Well I have read that page over and over ...
>>> >>
>>> >> I am calling persistentLocale.set() in the action link connected to my
>>> >> language selector.
>>> >>
>>> >> But for some reasons the persistentLocale is not used when rendering
>>> 
>>> >>
>>> >> The page below is rendered in swedish even if the persistentLocale is
>>> >> english.
>>> >>
>>> >> [DEBUG] AppModule.ProtectedPageGateKeeper PPGK.path=/en/tellfriends
>>> >> [DEBUG] components.TellLayout <<< --- TELLGAMING --- >>>: 1:
>>> >> TellLayout.setupComponent(currentLocale.language=sv)
>>> >> [DEBUG] components.TellLayout <<< --- TELLGAMING --- >>>: 4:
>>> >> TellLayout.setupComponent(persistentLocale=en)
>>> >>
>>> >>
>>> >> To this I have ...
>>> >>
>>> >> TellFriends_en.properties
>>> >> TellFriends_sv.properties
>>> >>
>>> >> ... and "sv" is the default language.
>>> >>
>>> >> /Gunnar
>>> >>
>>> >> 2009/10/30 cordenier christophe 
>>> >>
>>> >> > Hi
>>> >> >
>>> >> > Have a look at 'Changing the Locale' here
>>> >> > http://tapestry.apache.org/tapestry5.1/guide/localization.html
>>> >> > to check if your are using the good scenario to change locale, since
>>> >> > Tapestry 5.1 uses URL to store Local and not a cookie (like in
>>> 5.0.18)
>>> >> >
>>> >> > Christophe.
>>> >> >
>>> >> > 2009/10/30 Gunnar Eketrapp 
>>> >> >
>>> >> > > Hi!
>>> >> > >
>>> >> > > For some reason my pages are rendered accoring to currentLocale
>>> and
>>> >> not
>>> >> > > persistentLocale.
>>> >> > >
>>> >> > > Is there something I should now?
>>> >> > >
>>> >> > > Thanks in advance,
>>> >> > > Gunnar Eketrapp
>>> >> > >
>>> >> >
>>> >>
>>> >>
>>> >>
>>> >> --
>>> >> [Hem: 08-715 59 57, Mo