Tapestry scheduler specify exact time

2012-06-26 Thread George Christman
Hello, I was wondering if you could specify an exact time for the Tapestry
Scheduler to run rather than simple intervals. 

--
View this message in context: 
http://tapestry.1045711.n5.nabble.com/Tapestry-scheduler-specify-exact-time-tp5714107.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: Eclipse: Can run against maven jar, can't run against local project

2012-06-26 Thread Kalle Korhonen
On Tue, Jun 26, 2012 at 12:00 PM, Lance Java  wrote:
>> if it's your own application, what's the point of avoiding @SubModule
> I wasn't sure what would happen when running against a jar. Would the
> submodule be loaded twice? (once for @SubModule, once for manifest)

No, that's all good.

Kalle

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



Re: Tapestry Tree Links with parameter

2012-06-26 Thread Lance Java
I didn't take the time to fully understand your code but there's a fairly
extensive tree example at jumpstart
http://jumpstart.doublenegative.com.au/jumpstart/examples/ajax/treefromdatabasewithzones

You can generate event links etc by setting the "label" block parameter of a
tree

--
View this message in context: 
http://tapestry.1045711.n5.nabble.com/Tapestry-Tree-Links-with-parameter-tp5714101p5714103.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: Eclipse: Can run against maven jar, can't run against local project

2012-06-26 Thread Lance Java
> if it's your own application, what's the point of avoiding @SubModule
I wasn't sure what would happen when running against a jar. Would the
submodule be loaded twice? (once for @SubModule, once for manifest)

--
View this message in context: 
http://tapestry.1045711.n5.nabble.com/Eclipse-Can-run-against-maven-jar-can-t-run-against-local-project-tp5714087p5714102.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



Tapestry Tree Links with parameter

2012-06-26 Thread tapestry.kung.fu
I am having trouble passing parameters to page link while creating Tree with
click-able links. This is how my code look like.

1) I have Pojo ValueWrapper which has two member variables label and
pageName.  Constructor of ValueWrapper takes label and pagename. I have one
RootNode with ValueWrapper("ROOT", null) and then i am appending many
children node which has clickable links.  The Tree component I have created
using tapestry Tree component looks like this.

public class PortalAccessTree extends UserSessionManagement {
   
@InjectComponent
private Tree tree;  

@SuppressWarnings("unused")
@Persist  
@Property
private ValueWrapper valueWrapper;
   
   
@SetupRender
void initializeValue() throws VCloudException
{
if(getUser().getRootNode().getChildren().size() == 0) {
   
   
PortalHelperUtil.prepareAccessTree(getUser().getRootNode(),
getUser().getPrimaryUser().getCloudManagerUsers());
   
}
   
}

public TreeModel getValueWrapperModel() {
ValueEncoder encoder = new
ValueEncoder() {

   
public String toClient(ValueWrapper value) {

   
return value.getUuid();

   
}
   

   
public ValueWrapper toValue(String clientValue) {

   
return getUser().getRootNode().seek(clientValue);

   
}

   
};

return new DefaultTreeModel(encoder, new
ValueWrapperTreeModelAdapter(), getUser().getRootNode().getChildren());
}

/**
 * Clear Action link on PortalAccessTree.tml invokes this method.
 */
void onActionFromClear() {
tree.clearExpansions();
}

}


2) I have 3 pages in code.  
   *  OrganizationPage
   *  OrganizationUsagePage
   *  OrganizationReportPage

3) What I want to do is pass parameters to the page link which I tried by
doing this.

 ValueWrapper("Manage Org", "OrganizationPage" + "?orgId=1");  
 
 When i start my application and try to expand tree. It immediately
gives me error message saying
 page cannot be found with pageName  "organizationpage?orgId=1".

 If I do this ValueWrapper("Manage Org", "OrganizationPage");  that
works perfectly fine but then I don't know how to pass orgId to
OrganizationPage in that case.

4) My OrganizationPage contains proper definition to accept request
parameter.

@Property
@ActivationRequestParameter("orgId")
private String orgId;
   

I want to pass parameters to the clickable link which should take me to my
desired tapestry page with request parameter/value passed on it. Is it
possible to do so? I couldn't find a single example on Tapestry Tree which
does that.   

--
View this message in context: 
http://tapestry.1045711.n5.nabble.com/Tapestry-Tree-Links-with-parameter-tp5714101.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: Eclipse: Can run against maven jar, can't run against local project

2012-06-26 Thread Kalle Korhonen
On Tue, Jun 26, 2012 at 2:04 AM, Lance Java  wrote:
> I thought of this approach but I'd be scared that I'd accidentally commit the
> change to git (which I would never want to do).

I use @SubModule regularly exactly for the case when both the library
and the application is in active development at the same time.
Especially if it's your own application, what's the point of avoiding
@SubModule? As an alternative, I suppose you could also create a
static META-INF/manifest.mf under the src/test/resources directory,
that might work for Eclipse.

Kalle

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



Re: AJAX Events

2012-06-26 Thread Ray Nicholus
Have a look at the RequestParameter annotation.

On Tue, Jun 26, 2012 at 11:05 AM, Gep  wrote:

> Sorry to dig out this post, but I'm having the exact same issue.
>
> After having a look at :
> http://samroyale.blogspot.fr/2009/11/controlling-ajax-in-tapestry.html I
> tried to use this trick, but I failed.
>
> In my page.java, I create a link this way:
>
>
> With a simple OnInc method in the same page:
>
>
> Whether I click on the link triggering the event or goes directly to the
> expected URL of the event, I get the same error message:
>
>
> Does anyone have an idea why I can't manage to access the event?
>
> Gep
>
> --
> View this message in context:
> http://tapestry.1045711.n5.nabble.com/AJAX-Events-tp2429263p5714097.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: AJAX Events

2012-06-26 Thread Gep
Sorry to dig out this post, but I'm having the exact same issue.

After having a look at :
http://samroyale.blogspot.fr/2009/11/controlling-ajax-in-tapestry.html I
tried to use this trick, but I failed.

In my page.java, I create a link this way:


With a simple OnInc method in the same page: 


Whether I click on the link triggering the event or goes directly to the
expected URL of the event, I get the same error message:


Does anyone have an idea why I can't manage to access the event?

Gep

--
View this message in context: 
http://tapestry.1045711.n5.nabble.com/AJAX-Events-tp2429263p5714097.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: How to create a tapestry - OSGI bundle project

2012-06-26 Thread Lenny Primak
This is more of a question for OSGi and looking at their documentation. This 
isn't really a tapestry question at all. 



On Jun 26, 2012, at 2:17 AM, karthi  wrote:

> Hi,
> 
> Using the below url sample project for tapestry, spring, hibernate 
> http://wiki.apache.org/tapestry/Tapstry5First_project_with_Tapestry5,_Spring_and_Hibernate,
> I have created one of that.
> 
> I integrated Postgres db and using tapestry through spring retrieved the db
> values successfully by hibernate criterias. Everything worked as expected
> and I was running in Jetty server, even exported my app as war and ran in
> tomcat virgo server successfully.
> 
> Now I want to change this project as a OSGI bundle project but I donno where
> to start. 
> I tried to import the dependencies org.apache.tapestry5 in MANIFEST file but
> there is no such option in the imported packages list?
> 
> Can anyone please help me
> 
> Regards,
> Karthi.
> 
> --
> View this message in context: 
> http://tapestry.1045711.n5.nabble.com/How-to-create-a-tapestry-OSGI-bundle-project-tp5714086.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
> 

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



Re: JSON request construct in Tapestry

2012-06-26 Thread bogdan_cm
Thank you for the reply. 

--
View this message in context: 
http://tapestry.1045711.n5.nabble.com/JSON-request-construct-in-Tapestry-tp5714075p5714095.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: exception in IE on ajax request

2012-06-26 Thread Ray Nicholus
Thanks for the info. I have added my votes to these cases.

On Tue, Jun 26, 2012 at 1:40 AM, Jochen Berger wrote:

> Oh, I should have continued reading, sorry. Then, it's most likely also
> TAP5-1882/TAP5-1907.
>
> Am 26.06.2012 05:58, schrieb Ray Nicholus:
>
>> Changing the following line in the addStylesheets function from:
>>
>> var loaded = _(document.styleSheets).chain(**).pluck("href").without("").
>> map(this.rebuildURLIfIE).**value();
>>
>>
>> to:
>>
>> var loaded = _(document.styleSheets).chain(
>> ).pluck("href").without("").**without(null).map(this.**
>> rebuildURLIfIE).value();
>>
>>
>> ...seems to fix the issue for me locally.  I did not do any extensive
>> testing though, but it seems simple enough.
>>
>>
>> On Mon, Jun 25, 2012 at 10:23 PM, Ray Nicholus
>>  wrote:
>>
>>  I would never even open IE if I had the choice.  The javascript console
>>> looks like someone's high school project.
>>>
>>> It turns out that IE's exception message was, as usual, misleading.  I
>>> should also mention that I was getting the same exception message when
>>> tapestry attempted to execute consolefn.call in this function:
>>>
>>> function level(className, consolefn) {
>>> return function (message) {
>>> display(className, message);
>>>
>>> // consolefn may be null when there is no native console, in
>>> which case
>>> // do nothing more
>>> consolefn&&  consolefn.call(console, message);
>>>
>>> }
>>> }
>>>
>>> But that's not the source of my problem.  Looking closer, it turns out
>>> that the real cause of the failure starts here in the addScripts
>>> function:
>>>
>>> addStylesheets: function (stylesheets) {
>>> if (!stylesheets)
>>> return;
>>>
>>> var _ = T5._;
>>>
>>> var loaded =
>>> _(document.styleSheets).chain(**).pluck("href").without("").**
>>> map(this.rebuildURLIfIE).**value();
>>>  ...
>>> }
>>>
>>> When running in IE, the StyleSheetList returned by document.styleSheets
>>> contained an entry with a null href attribute.  This results in a null
>>> "path" value passed to the rebuildURL function, which causes a failure on
>>> the first line of that function.
>>>
>>> That said, it looks to me like this is a bug in Tapestry.  The modernizr
>>> js library contributes a

Overriding/Decorating/Advising FieldValidatorSource

2012-06-26 Thread Emmanuel DEMEY
Hi everyone !!

Since this morning, I have some problems with the FieldValidatorSourceImpl.
In fact, I would like to override it, by using the ClientId of the field
instead of the Tapestry ID for the keys of the messages (the error message
and the constraint). For doing that, I decorated this service,  and change
the signature of the public FieldValidator createValidator(Field field,
String validatorType, String constraintValue, String overrideId,  Messages
overrideMessages, Locale locale) method by using my delegate object.

public FieldValidatorSource decorateFieldValidatorSource(final
FieldValidatorSource delegate)
{
  return new FieldValidatorSource() {

public FieldValidator createValidators(Field field, String 
specification)
{
return delegate.createValidators(field, specification);
}

public FieldValidator createValidator(Field field, String 
validatorType,
String constraintValue, String overrideId,
Messages overrideMessages, Locale locale) {
return delegate.createValidator(field, validatorType, 
constraintValue,
field.getClientId(),  , overrideMessages, locale);
}

public FieldValidator createValidator(Field field, String 
validatorType,
String constraintValue) {
return delegate.createValidator(field, validatorType, 
constraintValue);
}
};
}

But, this delegate is just called for validator defined with the @Validate
annotation. For the t:validate binding, using the createValidators of the
same service, my decorator is not called. Is it normal ? Or Do I forgot
something ? 

I have also tested with an advise, and the problem is the same : 

@Match("FieldValidatorSource")
public static void adviseValidator(MethodAdviceReceiver receiver)
throws SecurityException, NoSuchMethodException{

MethodAdvice advise = new MethodAdvice() {

public void advise(Invocation invocation) {
Field field = (Field) invocation.getParameter(0);
invocation.override(3, field.getClientId());
invocation.proceed();
}
};

receiver.adviseMethod(receiver.getInterface().getMethod("createValidator",
Field.class, String.class, String.class, String.class, Messages.class,
Locale.class),advise);

 }

So I succeeded by using the ServiceOverride, copy/paste the default
implementation and change the overrideId by field.getClientId(): 
public static void bind(ServiceBinder binder)
{
binder.bind(FieldValidatorSource.class,
MyFieldValidatorSourceImpl.class).withId("MyFieldValidatorSourceImpl");

}

@Contribute(ServiceOverride.class)
public static void
setupApplicationServiceOverrides(MappedConfiguration
configuration, @Local FieldValidatorSource override)
{
  configuration.add(FieldValidatorSource.class, override);
}

 But the problem is that the Validator Configuration (defined in the
TapestryModule) object is now empty ! If I had my own contribution for my
service it works. Is it normal ? How can I use the Configuration object of
the default implementation ? 

public static void
contributeMyFieldValidatorSourceImpl(MappedConfiguration
configuration)
{
configuration.add("required", new Required());
configuration.add("minlength", new MinLength());
configuration.add("maxlength", new MaxLength());
configuration.add("min", new Min());
configuration.add("max", new Max());
configuration.add("regexp", new Regexp());
configuration.add("email", new Email());
configuration.add("none", new None());
}

Thanks a lot.

Manu

--
View this message in context: 
http://tapestry.1045711.n5.nabble.com/Overriding-Decorating-Advising-FieldValidatorSource-tp5714093.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: How to create a tapestry - OSGI bundle project

2012-06-26 Thread karthi
Any one help me?


--
View this message in context: 
http://tapestry.1045711.n5.nabble.com/How-to-create-a-tapestry-OSGI-bundle-project-tp5714086p5714091.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: Eclipse: Can run against maven jar, can't run against local project

2012-06-26 Thread Lance Java
I thought of this approach but I'd be scared that I'd accidentally commit the
change to git (which I would never want to do).

--
View this message in context: 
http://tapestry.1045711.n5.nabble.com/Eclipse-Can-run-against-maven-jar-can-t-run-against-local-project-tp5714087p5714090.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: Eclipse: Can run against maven jar, can't run against local project

2012-06-26 Thread Guerin Laurent
Hi Lance, 
you can link your component lib module with you webapp with @SubModule 
annotation.

For example, in your AppModule of your webapp, add :

@SubModule(MyLibraryModule.class)
public class AppModule

>From the documentation : @SubModule
Attached to a module class, this annotation identifies other module classes 
that should also be added to the Registry. This is often easier than updating 
the JAR Manifest.

Laurent.


-Message d'origine-
De : Lance Java [mailto:lance.j...@googlemail.com] 
Envoyé : mardi 26 juin 2012 10:31
À : users@tapestry.apache.org
Objet : Re: Eclipse: Can run against maven jar, can't run against local project

I have a workaround which is to use a system property 
-Dtapestry.modules=foo.bar.MyModule

I'd prefer it if tapestry could find my manifest file (located in
src/main/resources/META_INF/MANIFEST.MF)

--
View this message in context: 
http://tapestry.1045711.n5.nabble.com/Eclipse-Can-run-against-maven-jar-can-t-run-against-local-project-tp5714087p5714088.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


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



Re: Eclipse: Can run against maven jar, can't run against local project

2012-06-26 Thread Lance Java
I have a workaround which is to use a system property
-Dtapestry.modules=foo.bar.MyModule

I'd prefer it if tapestry could find my manifest file (located in
src/main/resources/META_INF/MANIFEST.MF)

--
View this message in context: 
http://tapestry.1045711.n5.nabble.com/Eclipse-Can-run-against-maven-jar-can-t-run-against-local-project-tp5714087p5714088.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



Eclipse: Can run against maven jar, can't run against local project

2012-06-26 Thread Lance Java
I have two maven projects in eclipse using the m2e plugin.

Project A is a component library (jar) which includes a
"Tapestry-Module-Classes" entry in the manifest.
Project B is a webapp which uses Project A.

Case 1:
When I close Project A in eclipse. I am able to run the war (Project B) with
no worries using run-jetty-run. In this case, maven is finding Project A in
my local maven repo.

Case 2:
When Project A is open in eclipse, I can't run Project B. Tapestry does not
load Project A's AppModule and I get exceptions saying that I am
contributing to services which don't exist.

I'm pretty sure Case 1 works because Project A is a jar file and tapestry
can find the manifest (and load the "Tapestry-Module-Classes").

Does anyone have a solution where I can have both projects open in eclipse
and run Project B?

At the moment my workflow is this:
1. Make changes in Project A in eclipse
2. Close Project A in eclipse
3. mvn install (Project A)
4. Run Project B in eclipse

It's pretty annoying.

--
View this message in context: 
http://tapestry.1045711.n5.nabble.com/Eclipse-Can-run-against-maven-jar-can-t-run-against-local-project-tp5714087.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



How to create a tapestry - OSGI bundle project

2012-06-26 Thread karthi
Hi,

Using the below url sample project for tapestry, spring, hibernate 
http://wiki.apache.org/tapestry/Tapstry5First_project_with_Tapestry5,_Spring_and_Hibernate,
I have created one of that.

I integrated Postgres db and using tapestry through spring retrieved the db
values successfully by hibernate criterias. Everything worked as expected
and I was running in Jetty server, even exported my app as war and ran in
tomcat virgo server successfully.

Now I want to change this project as a OSGI bundle project but I donno where
to start. 
I tried to import the dependencies org.apache.tapestry5 in MANIFEST file but
there is no such option in the imported packages list?

Can anyone please help me

Regards,
Karthi.

--
View this message in context: 
http://tapestry.1045711.n5.nabble.com/How-to-create-a-tapestry-OSGI-bundle-project-tp5714086.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