Re: Mouse tracking with Tapestry

2017-04-11 Thread Daniel Jue
Glad to hear you got everything working!

On Tue, Apr 11, 2017 at 5:09 AM, Phyambre  wrote:

> Ok,
>
> So finally I could transform my JS libraries into modules and now
> everything is super-modular.
>
> I also replaced mousemove by mouseover because it is less demanding.
>
> When Tapestry 5.4.2 is released and "Invoking server-side event handler
> methods from JavaScript" is available, I will replace the ZoneUpdater by
> this kind of call.
>
> Everything is running well, so now I am working in the cache, but that
> is out of the scope of this question.
>
> Thank you all for your help
>
> Phy
>
>
> El 10/04/17 a las 23:39, Thiago H. de Paula Figueiredo escribió:
> > On Sat, Apr 8, 2017 at 11:13 AM, Phyambre  wrote:
> >
> >> Hi Thiago,
> >>
> > Hi!
> >
> > So if I move the code of the task from onActivate() to setupRender() as
> >> Geoff suggested, I will not have the task on onSubmit() anymore, so I
> >> cannot check whether the user finished before the deadline. A solution
> >> is getting the task from database both on setupRender() and onSubmit(),
> >> but I don't know if this is more efficient than leave the code in
> >> onActivate().
> >>
> > Yes, it is more efficient, because that code will only be called when you
> > actually need it.
> >
> >
> >> The point is, I wanted the task and the stage and the text/quiz to be
> >> obtained only once from the database, and kept in memory until the user
> >> finishes the stage. The objects are big and storing them in the session
> >> may be a bit overkill. Maybe make a cache in the server (concurrent
> >> HashMap) is the solution? In principle, the number
> >> of users that can use my app is limited let us say less than 300 so
> >> maybe such a cache is viable.
> >>
> > In both cases, you're storing this big object in the process' memory. I'd
> > go for a cache.
> >
>
>
> -
> To unsubscribe, e-mail: users-unsubscr...@tapestry.apache.org
> For additional commands, e-mail: users-h...@tapestry.apache.org
>
>


Re: Mouse tracking with Tapestry

2017-04-07 Thread Daniel Jue
Hi, I'm not sure this is what you need, but here is a library we used
during a DARPA program to collect UI statistics including hovering, etc:
https://github.com/draperlaboratory/User-ALE

On the browser side it's fire and forget, and there is a separate server
set up to collect the stats information (i.e. it is transparent to your web
app/tapestry app server)

You the developer add in the places you want events to fire, such as on
buttons, or mouse tracking in general.

Here's a demo page:
http://draperlaboratory.github.io/user-ale/test_app/index.html



On Fri, Apr 7, 2017 at 2:12 AM, JumpStart <
geoff.callender.jumpst...@gmail.com> wrote:

> I’ll answer it this way:
>
> http://jumpstart.doublenegative.com.au/jumpstart7/examples/
> navigation/onactivateandonpassivate/3  doublenegative.com.au/jumpstart7/examples/navigation/
> onactivateandonpassivate/3>
>
> Hope this helps,
>
> Geoff
>
> > On 7 Apr 2017, at 2:07 PM, Phyambre  wrote:
> >
> > Hi,
> >
> > I would like to do mouse tracking with tapestry (know the coordinates of
> > the mouse, the path of the DOM tree to the element that is being pointed
> > and the text of that element).
> >
> > Currently I have a solution that works, but I think it is terribly
> > inefficient and I hope you can make any suggestions to improve it.
> >
> > I have a JS library that calculates all those values and writes them to
> > "input hidden" form fields in my .tml
> >
> > Then I used the ZoneUpdater mixin:
> >
> > http://jumpstart.doublenegative.com.au/jumpstart/examples/ajax/onevent
> >
> > I modified ZoneUpdater.java by adding a List attribute. That list will
> > contain the ids of the "input hidden fields" as you can see below.
> >
> > Then, in the TML file, instead of
> >
> > | > t:clientEvent="keyup" t:event="firstNameChanged" t:zone="nameZone"
> />|
> >
> > I have
> >
> >  > ZoneUpdater.clientEvent="mousemove" ZoneUpdater.event="track"
> >ZoneUpdater.zone="textZone"
> > ZoneUpdater.fields="['documentHeightVal', 'documentWidthVal',
> > 'windowHeightVal',
> >'windowWidthVal', 'windowOffsetYVal', 'windowOffsetXVal',
> > 'mouseYVal','mouseXVal', 'domPathVal',
> > 'overTextVal']">${currentParagraph}
> >
> > then in zone-updater.js I add all those values to the URL.
> >
> > Finally, in my page file, the onTrack() method is executed.
> >
> > The problem here is that onActivate() is also being exectued, and
> > onActivate() has a lot of stuff that I want to execute only once (when
> > the page loads) and not every time the user moves the mouse.
> >
> > Is there any other solution that does not trigger onActivate() every
> > time that the user moves the mouse on a component?
> >
> > Regards,
> >
> > Phy.
> >
> >
>
>


Module-auto-loading not working when Manifest.mf line is wrapped

2015-05-12 Thread Daniel Jue
Hi, I recently ran into this problem that causes my module to not
auto-load, and in fact prevents the Tomcat server from starting my T5 war
file.

The error starts with
Exception loading module(s) from manifest
jar:file:/path-to-jar-file-in-web-inf-lib/MANIFEST.MF: Failure loading
Tapestry IoC module class:
stack trace starts at IOCUtilities.java:123


The culprit was that the MANIFEST.MF can't have lines longer than 72
characters, and if it is longer it [Maven] will wrap on the next line
including an additional space.  The total of my manifest is right at 72,
but it wrapped it at 70 characters anyway.  This is strange since I didn't
have problems with it last week.

The relevant lines of my manifest.mf for the pluggable module looks like
this:

Tapestry-Module-Classes: graphene.augment.mitie.web.services.MITIEModu
 le


I'm using Maven 3.0.4, Tapestry 5.3.7, Jdk 1.7.0

I'm not sure if Tapestry could be made to take that into account and
coalesce the Strings.
I did discover it's part of the Java spec though:

http://docs.oracle.com/javase/7/docs/technotes/guides/jar/jar.html#Notes_on_Manifest_and_Signature_Files


T5.3.7 + Tynamo Security - User ASO creation after authc/authz

2015-04-29 Thread Daniel Jue
Hi, I'm getting hung up on something that's probably really simple to fix.
I have a Tomcat+LDAP configuration that is doing Authc and Authz for
me--All I have to do is look in the request header to see the user
principal and log the dude/dudette in.

So I'm using the built in factory.authc filter on some of my paths that
need protecting.

Here's where I'm at:  In the legacy code I have now, the user would have a
G_User.class ASO created on the Layout component (my own class to hold user
stuff).  I'd like to move that ASO creation closer to the code where the
user is deemed authenticated (i.e. outside of a particular component or
page).   I feel like this is possible, I'm just missing something.

There's some user class creation stuff going on inside of the
FederatedAccounts test application UserRealm, but it's not setting an ASO.

Should I be setting the ASO in a custom Realm or ??

Also, I've added the code in my module for contributing to the
ApplicationStateManager for creating/retrieving a G_User.  However it
doesn't seem to be affecting anything.

Some assumptions for our case:
By the time the user gets to our T5 app, they have already been authc/authz
by the external SSO provider.

If the user has never logged in before (ie.
UserDAO.getUser(username)==null) then we register the new guy
(UserDAO.registerNewUser(foo))  and then set his ASO to the newly created
one.  If his account was not null, then we set it as the ASO.



Thanks,

Dan


Re: AW: Splitting a tapestry web app into modules

2015-04-22 Thread Daniel Jue
I make extensive use of multi maven modules (even a war overlay!) in my
project. Maybe browsing through the code can help you.

Since we are making a reusable core set of modules (under graphene-parent),
each customer implementation gets it's own separate maven project that uses
our stuff as dependencies and as a war overlay.  Then the customer wires up
the bindings to some default DAO implmentations we provide, or they can
wire their own.
(Unfortunately the current customer implementation demo is not yet public,
and the Kiva/Enron/Walker versions are deprecated)

We're now experimenting with plugin modules that contain their own pages
and modules, which are wired in soley through listing the jar in your
pom.xml.  (i.e. our augment-mitie module)

https://github.com/Sotera/graphene

https://github.com/Sotera/graphene/tree/4.1.2-SNAPSHOT/graphene-parent


On Wed, Apr 22, 2015 at 9:53 AM, Poggenpohl, Daniel 
daniel.poggenp...@isst.fraunhofer.de wrote:

 Hello,

 I'm gonna pick up this strand because more problems seem to arise when
 splitting the application...

 Okay, right now I have 5 modules/projects:
 1) model (the data model for the application; annotated using the Bean
 Validation API)
 2) dao-interfaces (the DAO interface layer for the data model)
 3) dao-hibernate (the DAO interface implementation, name is probably not
 right because I don't use Hibernate-specific stuff right now...)
 4) webui (containing Tapestry pages, components etc.)
 5) controller (at the moment processes methods like resetTestdata, which
 clears the database and stores the testdata)

 Dependencies are:
 dao-interfaces - model
 dao-hibernate - dao-interfaces, model
 controller - dao-interfaces, model
 webui - controller, model

 Several things:
 a) I have problems making appropriate splits or rather putting code in the
 right module. What I do at the moment is coding a page, and when an entity
 is needed, I call the controller to fetch the entity. The controller uses a
 DAO object to fetch the entity and returns the entity to the webui.
 In a single module tapestry web application, I declared the DAO layer to
 be services in the AppModule. Then
 I could inject the DAO class into a page or component and queried for the
 entity directly.
 How do I do this with a controller doing the fetching? Do I declare the
 controller as a service?

 b) The persistence.xml is still placed in the webui module, isn't it? My
 first instinct was to place it in the model module, but now I'm not
 sure...

 c) Say I click a button on a page. Doing this ultimately changes the state
 of an entity in the database.
 - The e.g. ActionLink  method onActionFromButton() calls the Controller
 method doStuff(Entity toSomeEntity).
 - The Controller changes the entity and then updates the database to
 reflect the changes using the DAO interfaces.
 - The Controller then returns the changed entity to the webui.
 - The webui receivers the entity and reloads the page or updates the zone
 or whatever.
 Before splitting, my DAO interface methods always were annotated with
 @CommitAfter.
 First, to be generic with my DAO interfaces, I can't use @CommitAfter on
 them, because then I'd need a dependency to tapestry-jpa.
 Second, I've read that having a controller, it is always more logical to
 commit after the end of the controller method, as this is a more logical
 point in time.
 So do I add the tapestry-jpa dependency to my controller methods? And what
 then? Do I have to register my controller as a service with Tapestry?

 Hope you can help me, as I'm a little bit confused.

 Regards,
 Daniel P.
 -Ursprüngliche Nachricht-
 Von: Thiago H de Paula Figueiredo [mailto:thiag...@gmail.com]
 Gesendet: Donnerstag, 16. April 2015 18:08
 An: Tapestry users
 Betreff: Re: AW: Splitting a tapestry web app into modules

 On Thu, 16 Apr 2015 11:09:53 -0300, Poggenpohl, Daniel 
 daniel.poggenp...@isst.fraunhofer.de wrote:

  Hello again,
 
  I think I understand now.
 
  The only problem I see at the moment is that once I split the app into
  model and tapestry app, I can't use e.g. @NonVisual  or @Validate
  anymore because those are Tapestry-specific. Or could I add a
  dependency to the annotation packages? If the model would be used in a
  non-Tapestry application, the annotations would be ignored, wouldn't
 they?

 These annotations are in the tapestry5-annotations package, not
 tapestry-core, so you can add a tapestry5-annotations depenency to your
 non-web packages/modules/projects without bringing the web-related classes
 (i.e. tapestry-core).

 --
 Thiago H. de Paula Figueiredo
 Tapestry, Java and Hibernate consultant and developer
 http://machina.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: 

Custom complex grid / search results page

2015-03-09 Thread Daniel Jue
Hi, I have a reusable war overlay project where the omnipresent search bar
component is in a layout and search results page is defined in a core
library (These are hooked together via @InjectPage in the search bar
component so i can set the page's parameters and then send the user there)

The search results page uses a grid to display results. (Actually T5
JQueryDatatables, but let's just say its a plain grid)

Each customer implementation wants complete control over the contents of
the search results.

There were a couple ways I thought of doing this but they all seemed to
fight Tapestry's static structure paradigm.
The first way would be to let the customer completely define the search
results page and tml, and then have a proxy interface that could let my
omni-search box redirect the user there.

The second way would be to have each customer supply a component that did
the templating and grid logic.

These first two thoughts allow me to simply define the beanmodel, and
handle complex cell values in the customer implementation of the page.
I don't see how I could get either of those to work.  I was thinking
something like making an interface for a page and then binding a certain
page implementation to that interface?


A third way, which is the most complex but gives us static structure at a
cost of customizing, is to pass a list of very flexible object containers
that will turn into the right kind of cells.  I'd also have to pass the
beanmodel and any table options, and have a way of iterating over the
contents of complex cells, etc.

The problem arises because any of the cells can be complex; for instance a
single cell might have a list of contextualized page links back into the
search page (allowing the user to pivot his search in the results), or it
might be a list of icons or an action button, or an image, links to
external urls, etc.

I think to do the above I'd have to have display blocks defined in the core
library to anticipate how each cell datatype would be handled.


All of this starts from needing a similar look and feel for all
implementations of our app, and the implementations benefit from new and
improved features of the core application.  So that's why we provide a
standard layout and set of navigation components, including the search bar
component that needs to talk to a search results page, somewhere.

Any other ideas?


Dan


Re: How to use font awesome with Tapestry

2014-12-19 Thread Daniel Jue
Hi George, I'm not really sure what the .eot file does.

My assets are under src/main/webapp in my maven module:

i.e.
https://github.com/Sotera/graphene/tree/master/graphene-parent/graphene-web/src/main/webapp/core/fonts
https://github.com/Sotera/graphene/tree/master/graphene-parent/graphene-web/src/main/webapp/core/css

My layout component loads the files used by FA and other parts of the
templates I use:

https://github.com/Sotera/graphene/blob/master/graphene-parent/graphene-web/src/main/java/graphene/web/components/Layout.java



On Fri, Dec 19, 2014 at 1:50 AM, George Christman gchrist...@cardaddy.com
wrote:

 Hi Daniel, how do you have your assets setup?

 I added font-awesome-min.css to my META-INF/assets/css

 I'm then importing it.

 @Import(stylesheet = {css/font-awesome.min.css}

 I added a directory called fonts to assets like so META-INF/assets/fonts/..
 all the font files example fontawesome-webfont.eot

 Within font-awesome.min.css I see this url
 '../fonts/fontawesome-webfont.eot?v=4.2.0'

 I am seeing fonts added correctly in the app container.

 Any thoughts in comparison to your setup what I may be missing?

 On Fri, Dec 19, 2014 at 1:21 AM, Daniel Jue teamp...@gmail.com wrote:
 
  Just to be sure, are you seeing the file correctly in the deployment
  directory of your application container?
 
  I am using fontawesome as well in my T5 app, and, well, it's awesome!
  Never ran into issues with that file though.
 
  Dan
 
  On Fri, Dec 19, 2014 at 12:52 AM, George Christman 
  gchrist...@cardaddy.com
  wrote:
  
   Hi guys, I'm trying to use font-awesome with tapestry. I'm getting the
   following error,
  
   Unable to locate asset
   'classpath:META-INF/assets/fonts/fontawesome-webfont.eot' (the file
 does
   not exist).
  
   I have placed the fonts in the fonts directory within assets, any
  thoughts
   on how to get this to work?
  
   --
   George Christman
   CEO
   www.CarDaddy.com
   P.O. Box 735
   Johnstown, New York
  
 


 --
 George Christman
 CEO
 www.CarDaddy.com
 P.O. Box 735
 Johnstown, New York



Re: How to use font awesome with Tapestry

2014-12-19 Thread Daniel Jue
Forgot to mention, I am using T5.3.7

On Fri, Dec 19, 2014 at 2:59 AM, Daniel Jue teamp...@gmail.com wrote:

 Hi George, I'm not really sure what the .eot file does.

 My assets are under src/main/webapp in my maven module:

 i.e.

 https://github.com/Sotera/graphene/tree/master/graphene-parent/graphene-web/src/main/webapp/core/fonts

 https://github.com/Sotera/graphene/tree/master/graphene-parent/graphene-web/src/main/webapp/core/css

 My layout component loads the files used by FA and other parts of the
 templates I use:


 https://github.com/Sotera/graphene/blob/master/graphene-parent/graphene-web/src/main/java/graphene/web/components/Layout.java



 On Fri, Dec 19, 2014 at 1:50 AM, George Christman gchrist...@cardaddy.com
  wrote:

 Hi Daniel, how do you have your assets setup?

 I added font-awesome-min.css to my META-INF/assets/css

 I'm then importing it.

 @Import(stylesheet = {css/font-awesome.min.css}

 I added a directory called fonts to assets like so
 META-INF/assets/fonts/..
 all the font files example fontawesome-webfont.eot

 Within font-awesome.min.css I see this url
 '../fonts/fontawesome-webfont.eot?v=4.2.0'

 I am seeing fonts added correctly in the app container.

 Any thoughts in comparison to your setup what I may be missing?

 On Fri, Dec 19, 2014 at 1:21 AM, Daniel Jue teamp...@gmail.com wrote:
 
  Just to be sure, are you seeing the file correctly in the deployment
  directory of your application container?
 
  I am using fontawesome as well in my T5 app, and, well, it's awesome!
  Never ran into issues with that file though.
 
  Dan
 
  On Fri, Dec 19, 2014 at 12:52 AM, George Christman 
  gchrist...@cardaddy.com
  wrote:
  
   Hi guys, I'm trying to use font-awesome with tapestry. I'm getting the
   following error,
  
   Unable to locate asset
   'classpath:META-INF/assets/fonts/fontawesome-webfont.eot' (the file
 does
   not exist).
  
   I have placed the fonts in the fonts directory within assets, any
  thoughts
   on how to get this to work?
  
   --
   George Christman
   CEO
   www.CarDaddy.com
   P.O. Box 735
   Johnstown, New York
  
 


 --
 George Christman
 CEO
 www.CarDaddy.com
 P.O. Box 735
 Johnstown, New York




Re: How to use font awesome with Tapestry

2014-12-18 Thread Daniel Jue
Just to be sure, are you seeing the file correctly in the deployment
directory of your application container?

I am using fontawesome as well in my T5 app, and, well, it's awesome!
Never ran into issues with that file though.

Dan

On Fri, Dec 19, 2014 at 12:52 AM, George Christman gchrist...@cardaddy.com
wrote:

 Hi guys, I'm trying to use font-awesome with tapestry. I'm getting the
 following error,

 Unable to locate asset
 'classpath:META-INF/assets/fonts/fontawesome-webfont.eot' (the file does
 not exist).

 I have placed the fonts in the fonts directory within assets, any thoughts
 on how to get this to work?

 --
 George Christman
 CEO
 www.CarDaddy.com
 P.O. Box 735
 Johnstown, New York



Re: Stacktrace when on Tomcat server

2014-11-14 Thread Daniel Jue
Yes, I'm guessing it's something malformed in your page template.

On Fri, Nov 14, 2014 at 2:03 PM, Andreas Ernst a...@ae-online.de wrote:

 Am 14.11.14 um 13:44 schrieb Nathan Quirynen:

 Maybe this helps... it's not much more than what I originally sent, but
 there is no more...
 This is all I see in the tomcat logs:

 [ERROR] ioc.Registry java.lang.ArrayIndexOutOfBoundsException
 [ERROR] ioc.Registry Operations trace:
 [ERROR] ioc.Registry [ 1] Constructing instance of page class
 com.example.pages.Index
 [ERROR] ioc.Registry [ 2] Creating ComponentAssembler for
 com.example.pages.Index
 [ERROR] ioc.Registry [ 3] Parsing component template
 classpath:com/example/pages/Index.tml


 Show your Index.tml

 --
 ae | Andreas Ernst | IT Spektrum
 Postfach 5, 65612 Beselich
 Schupbacher Str. 32, 65614 Beselich, Germany
 Tel: +49-6484-91002 Fax: +49-6484-91003
 a...@ae-online.de | www.ae-online.de
 www.tachyon-online.de


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




Re: [OT] Any static code analysis tool?

2014-10-09 Thread Daniel Jue
I like Findbugs, I use it on every Java project.  It has IDE integration as
well as Bamboo.

https://marketplace.atlassian.com/plugins/com.atlassian.bamboo.plugins.findbugs

On Thu, Oct 9, 2014 at 11:49 AM, Muhammad Gelbana m.gelb...@gmail.com
wrote:

 I would use Google's
 https://developers.google.com/java-dev-tools/codepro/doc/

 *-*
 *Muhammad Gelbana*
 http://www.linkedin.com/in/mgelbana

 On Thu, Oct 9, 2014 at 4:56 PM, Dmitry Gusev dmitry.gu...@gmail.com
 wrote:

  Hello,
 
  Just wondering if anybody can recommend any static code analysis tool
 based
  on his personal experience? Maybe some of them play better with T5
  projects...
 
  I'm looking for one to integrate with Bamboo CI on Gradle T5 project.
 
  --
  Dmitry Gusev
 
  AnjLab Team
  http://anjlab.com
 



Re: Splitting Tapestry IOC out as a separate project

2014-10-02 Thread Daniel Jue
Try Tynamo Resteasy! I think you'll like it.  We use it to support a extjs
front end we have (served in its raw form (html and js) as part of a
Tapestry web application.  We jave tapestry pages working right alongside
the raw html/js page.  Even better is that our rest resources use the same
services that our tapestry pages use!
On Oct 2, 2014 11:10 AM, Thiago H de Paula Figueiredo thiag...@gmail.com
wrote:

 On Thu, 02 Oct 2014 11:38:39 -0300, raygarsta...@gmail.com wrote:

  I expect to use something like Jersey to support a REST API (both
 internal and external) instead of Tapestry pages to handle requests.


 Ok! Just giving an suggestion. :) Have you seen
 http://tynamo.org/tapestry-resteasy+guide?

  Perhaps I worded my question incorrectly.  I’m really wondering if IOC
 will always be tied to Tapestry core in terms of releases, or will it be
 spun off into its own self-contained project with a release cycle
 independent of Tapestry core?


 We have no plans of spinning it off nor having a independent release cycle
 because, so far, we haven't felt the need for that. Tapestry-IoC is mature
 and very flexible, so almost all new features you could think won't need
 changes to T-IoC code itself, so they can be implemented in separate
 projects. In the last years, the only major changes were live class
 reloading for services and copying service implementation class annotations
 to its proxies (both at class- and method-level). For example, I've
 implemented the support of JCache (JSR 107) annotations as a separate
 projects because since the latest betas it didn't need anything
 Tapestry-IoC already provides. In addition, nothing prevents us from
 generating a new Tapestry release because of a Tapestry-IoC new feature or
 improvement.

 Any suggestions on how to improve Tapestry-IoC? We'd love to hear them. :)

 --
 Thiago H. de Paula Figueiredo
 Tapestry, Java and Hibernate consultant and developer
 http://machina.com.br

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




Re: Getting BeanDisplay to skip empty fields altogether

2014-09-24 Thread Daniel Jue
Thanks Lance, I think on the surface my problem seems like the one you gave
the answer for, but in my case it's different.  I don't know which fields
I'll need to exclude until I know whether the value is null or empty-string
for the instance of the bean.  For example, one of my classes is a POJO
generated from elsewhere which has dozens of fields.  For any given
instance of that POJO, only 30% of the field might be filled with
meaningful, non blank data.  But it's not always the same columns/fields
that need to be skipped/excluded.  I don't want to write manual glue code
for these, because they are code generated from a schema that changes
often. (not to mention I have close to 100 of these bean types already)

My first attempt at using my own MeaningfulBeanDisplay component based off
BeanDisplay is not doing what I want yet.  Seems like it's hard to get a
handle on the value that the propertyModel is going to try and resolve,
since it needs to go through the BeanDisplay's PropertyDisplay component
before we start to touch the actual value.

On Wed, Sep 24, 2014 at 1:40 AM, Lance Java lance.j...@googlemail.com
wrote:

 BeanDisplay, BeanEditor and Grid all use a BeanModel to show the fields.

 You could either set the exclude parameter to the component. Or you can
 call BeanModel.exclude(...) explicitly.

 It might be easiest to decorate the BeanModelSource service in tapestry-ioc
 (used when you don't explicitly provide a BeanModel).



Re: Getting BeanDisplay to skip empty fields altogether

2014-09-24 Thread Daniel Jue
Thiago, that was perfect!  I had in-fact gone down the reflection route and
was getting into trouble since the propertyNames aren't really the method
or field names.   I forgot about using conduits manually that way!

Your code works as is, but I still stuck it in a custom
MeaningfulBeanDisplay component in it's setupRender method, because I don't
want to write this logic for every model for every POJO.  Sometimes I'll
have 5-10 of these POJOs on one page.

Great job Thiago, thank you thank you!

On Wed, Sep 24, 2014 at 10:52 AM, Thiago H de Paula Figueiredo 
thiag...@gmail.com wrote:

 On Wed, 24 Sep 2014 10:59:50 -0300, Chris Mylonas ch...@opencsta.org
 wrote:

  Hi Daniel,


 Hi, guys!

  Disclaimer:  I don't pretend to know anything about BeanModels,
 BeanModelSources and Grids.however


 I know a thing or two about them. :)

  Sounds like a bit of reflection to get field names on your POJOs and
 BeanModel.exclude().exclude().exclude().exclude() or a bit of
 recursion til the end of an arraylist of empty/whitespace field values is
 reached.


 Actually, no reflection needed. BeanModelSource already does this part for
 you.

 Not tested code below. Code could be more concise, but I wanted to show
 the parts involved.

 @Property
 private Object object; // actually, it can be any type

 @Inject
 private BeanModelSource beanModelSource;

 @Inject
 private Messages messages;

 BeanModel getModel() {
 BeanModel beanModel = 
 beanModelSource.createDisplayModel(object.getClass(),
 messages);
 ListString propertyNames = beanModel.getPropertyNames();
 for (String propertyName : propertyNames) {
 PropertyModel propertyModel = beanModel.get(propertyName);
 PropertyConduit conduit = propertyModel.getConduit();
 Object propertyValue = conduit.get(object);
 if (propertyValue == null) { // or any other logic you want
 beanModel.remove(propertyName)
 }
 }
 }

 t:beandisplay object=object model=model/

 --
 Thiago H. de Paula Figueiredo
 Tapestry, Java and Hibernate consultant and developer
 http://machina.com.br

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




Getting BeanDisplay to skip empty fields altogether

2014-09-23 Thread Daniel Jue
Hey list!  I have several dozen code-generated beans that I'd like to
display as bean models.  Problem is, many of the beans' fields are either
null or empty string, so I don't want their dt labels to even show up,
much less the NotEmpty mixin putting a nbsp;

The idea is to skip rendering any fields that would have output equal to
the empty string or null (and possibly even skipping if it were only
whitespace)

So far I've gone down the path of overriding the BeanDisplay class and
using my own tml file to try and wrap the dt/dd in a t:if with a test
on the object.  It's not working quite yet, but I think this might work.  I
need to get a handle on what the property value is going to be so I can
test against that.

Is anything else you would suggest?

Thanks,

Dan


Re: Tynamo-Conversations + Tapestry-Atmosphere

2014-09-05 Thread Daniel Jue
Lance, I'm also starting to use your work in my application.  I think it's
important to note that your code on github works with
atmosphere-runtime-native 2.1.0-RC2 from Dec 2013.  Later versions of
Atmosphere seem to need different dependencies included, and also the
contribute method fails because some method signature in Atmosphere changed
after the version above.

Since we're not using build profiles like in your example, I've had to
manually include

dependency
groupIdorg.atmosphere/groupId
artifactIdatmosphere-runtime-native/artifactId
version2.1.0-RC2/version
/dependency

in addition to

org.lanzan
tapestry-atmosphere

in my POM.



On Tue, Sep 2, 2014 at 2:33 PM, Lance Java lance.j...@googlemail.com
wrote:

 Wrong link, make sure your dependencies match the table here

 https://github.com/Atmosphere/atmosphere/wiki/Installing-AtmosphereServlet-with-or-without-native-support#quick-dependency-reference
  On 2 Sep 2014 19:31, Lance Java lance.j...@googlemail.com wrote:

  Run mvn:dependency tree from the command line and make sure your
  dependencies match the table here
  http://tapestry-atmosphere.uklance.cloudbees.net/. You might need to
  exclude a dependency? Not sure.
 
  I had troubles with tomcat and apache on cloudbees and had to upgrade to
  http 1.1. Does it work on jetty (runjettyrun plugin?).
 
  Possibly best to ask further questions on atmosphere users list if it's
  more relevant there.
 



Re: Tapestry in distributed environment

2014-08-29 Thread Daniel Jue
Another good place to look is in any of the unit or integration tests for
frameworks or apps that use Tapestry.  You often want to start up a
registry there so you can import modules to wire up DAOs, services, etc.


On Fri, Aug 29, 2014 at 8:50 AM, Thiago H de Paula Figueiredo 
thiag...@gmail.com wrote:

 On Fri, 29 Aug 2014 08:39:50 -0300, Mugat Gurkowsky zenpunk...@gmail.com
 wrote:

  hello,


 Hi!


  i would like to be able to use tapestry IoC (especially injections) in
 the drone-clients, but i have run into problems with that. in the
 documentations i have not seen any way which would make use of Tapestry
 IoC from a java-main without the ise of a web-server, so i wanted to ask you
 how i could do that best.


 Have you seen http://tapestry.apache.org/starting-the-ioc-registry.html?
 :D

 --
 Thiago H. de Paula Figueiredo
 Tapestry, Java and Hibernate consultant and developer
 http://machina.com.br


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




Re: Tapestry in distributed environment

2014-08-29 Thread Daniel Jue
For instance, in my project, see this BeforeSuite annotated method:

https://github.com/Sotera/graphene/blob/master/graphene-parent/graphene-util/src/test/java/graphene/util/fs/PropertiesFileSymbolProviderTest.java


On Fri, Aug 29, 2014 at 10:24 AM, Daniel Jue teamp...@gmail.com wrote:

 Another good place to look is in any of the unit or integration tests for
 frameworks or apps that use Tapestry.  You often want to start up a
 registry there so you can import modules to wire up DAOs, services, etc.


 On Fri, Aug 29, 2014 at 8:50 AM, Thiago H de Paula Figueiredo 
 thiag...@gmail.com wrote:

 On Fri, 29 Aug 2014 08:39:50 -0300, Mugat Gurkowsky zenpunk...@gmail.com
 wrote:

  hello,


 Hi!


  i would like to be able to use tapestry IoC (especially injections) in
 the drone-clients, but i have run into problems with that. in the
 documentations i have not seen any way which would make use of Tapestry
 IoC from a java-main without the ise of a web-server, so i wanted to ask you
 how i could do that best.


 Have you seen http://tapestry.apache.org/starting-the-ioc-registry.html?
 :D

 --
 Thiago H. de Paula Figueiredo
 Tapestry, Java and Hibernate consultant and developer
 http://machina.com.br


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





Re: [T5.4] split Tapestry application into separate modules

2014-07-10 Thread Daniel Jue
Yes, it could be an issue using an external maven.  I let Eclipse handle
the build while I'm developing, and I don't do a full external maven
rebuild unless I need to deploy war files.  Sometimes it helps to know the
art of the possible, and myself and my team have it working this way.  :-)
 Hopefully you find a development procedure that is right for you.




On Thu, Jul 10, 2014 at 6:04 AM, Ilya Obshadko ilya.obsha...@gmail.com
wrote:

  For your last question, if you are using Eclipse Kepler or better, the
  maven integration should be good enough to allow workspace resolution of
  the other modules, as long as they are open.
  i.e. you can change something in one module and have the dependent
 modules
  pick up the changes, without needing to do a separate maven build or
  install.  This even works between overlays and the main web app project.
 

 I've been expecting it should work that way, but it doesn't.

 Unless I perform mvn clean install inside the module project, I receive
 build error

 [WARNING] The POM for my.package:module-name:jar:0.0.1-SNAPSHOT is
 missing, no dependency information available

 I suppose it has something to do with external Maven installation that I'm
 using instead of embedded one, but I'm not sure.



  On Wed, Jul 9, 2014 at 4:38 PM, Ilya Obshadko ilya.obsha...@gmail.com
  wrote:
 
   I would like to modularize my application into several modules, so that
   each one of them would be a separate Maven artifact. I'm trying to
   reproduce what I can borrow from tapestry-upload module source, but
 still
   have questions:
  
   - component that was moved into separate module can't be loaded by main
   application using standard namespace; is there any way to fix that?
 (that
   is, t:mycomponent/ results in UknownValueException);
   contributeComponentClassResolver() (like in tapestry-upload) doesn't
 help
   (or I just use it incorrectly)
  
   - is that possible to run the whole thing within Eclipse without having
  to
   install 'module' project into local repository?
  
   Thanks in advance.
  
   --
   Ilya Obshadko
  
 



 --
 Ilya Obshadko



Re: [T5.4] split Tapestry application into separate modules

2014-07-09 Thread Daniel Jue
I think in T 5.4 @Submodule has been deprecated in favor of @ImportModule


On Wed, Jul 9, 2014 at 6:05 PM, Thiago H de Paula Figueiredo 
thiag...@gmail.com wrote:

 On Wed, 09 Jul 2014 17:38:04 -0300, Ilya Obshadko ilya.obsha...@gmail.com
 wrote:

  - component that was moved into separate module can't be loaded by main
 application using standard namespace; is there any way to fix that? (that
 is, t:mycomponent/ results in UknownValueException);


 That's expected: When you changed the component from the application to a
 component library, you've changed its namespace. You can advise or decorate
 ComponentClassResolver.resolveComponentTypeToClassName() and
 resolveMixinTypeToClassName() (for mixins), which are the methods which map
 logical names to component or mixin class names.


  - is that possible to run the whole thing within Eclipse without having
 to install 'module' project into local repository?


 Yes. Just make sure the webapp module has the component modules in its
 classpath. Module class autoloading won't work, as there's no JAR for the
 component libraries included in this way, but then you can use the
 tapestry.modules VM argument to specify comma-separated fully qualified
 module class names to be loaded. Another option is to use @Submodule in
 your AppModule.

 --
 Thiago H. de Paula Figueiredo
 Tapestry, Java and Hibernate consultant and developer
 http://machina.com.br

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




Re: Modules Executing in the Wrong Order? Service Bindings Not Around When Expected?

2014-06-25 Thread Daniel Jue
My intuition says the same thing.  Try forcing a mvn clean or the
equivalent.
On Jun 25, 2014 7:57 AM, Thiago H de Paula Figueiredo thiag...@gmail.com
wrote:

 On Wed, 25 Jun 2014 08:46:45 -0300, Peter Hvass pe...@theru.in wrote:

  Digging further I discovered RegistryBuilder and output during startup
 looks like;

 [INFO] ioc.RegistryBuilder Adding module definition for class
 org.apache.tapestry5.ioc.modules.TapestryIOCModule
 [INFO] ioc.RegistryBuilder Adding module definition for class
 org.apache.tapestry5.hibernate.modules.HibernateModule
 [INFO] ioc.RegistryBuilder Adding module definition for class
 org.apache.tapestry5.json.modules.JSONModule
 [INFO] ioc.RegistryBuilder Adding module definition for class
 org.apache.tapestry5.hibernate.modules.HibernateCoreModule
 [INFO] ioc.RegistryBuilder Adding module definition for class
 org.tynamo.security.services.SecurityModule
 [INFO] ioc.RegistryBuilder Adding module definition for class
 org.apache.tapestry5.modules.TapestryModule


 Starting with Tapestry 5.4, some parts of TapestryModule were broken into
 other modules. Some of them are missing in the listing above, something
 which corroborates my guess that have more than one Tapestry version in
 your classpath.

 --
 Thiago H. de Paula Figueiredo
 Tapestry, Java and Hibernate consultant and developer
 http://machina.com.br

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




Re: Preload All Pages On Startup

2014-06-25 Thread Daniel Jue
Just wanted to comment that I do the same thing at startup and look at
annotations attached to the pages, and construct menu items for the pages
which have the right kind of annotation.  The annotation I made also has a
parameter fir the type of page, so the menu items get a corresponding
icon.  :-)
On Jun 25, 2014 7:49 AM, Thiago H de Paula Figueiredo thiag...@gmail.com
wrote:

 On Wed, 25 Jun 2014 05:58:36 -0300, Net Dawg net.d...@yahoo.com.invalid
 wrote:

  On server startup, what is the best way to preload all *.tml under
 [...]resources[...]pages?With all defaults - locale, etc.


 Templates themselves are tightly tied to their class counterparts, so
 preloading just templates wouldn't make a difference. Dmitry's solution
 should work for preloading classes and templats.

  In other words, how are tapestry (5.3.x) pages mapped to servlets so that
 something like this may be attempted in web.xml?


 Tapestry doesn't map pages to servlets. Tapestry isn't implemented as a
 servlet, but as a servlet filter, so every request passes through it, even
 when Tapestry itself doesn't generate the response.

 --
 Thiago H. de Paula Figueiredo
 Tapestry, Java and Hibernate consultant and developer
 http://machina.com.br

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




Re: T5.3.7+Tynamo Security 5.1 SavedRequest redirect issues

2014-06-24 Thread Daniel Jue
It figures that after I sent the email I would find a way to fix it.  :-)

I saw that the url that was getting requested had the word 'unauthenticated
http://localhost:8080/etss/login/unauthenticated' added to it, and the
response, for some reason, was the first asset listed in the Layout.
Re-reading some other threads on the subject, notably here:

http://markmail.org/message/y52ttlk63gcvirq2#query:+page:1+mid:vrzxrs4rpmqjx727+state:results

^^ that gave me the suggestion to remove a few instances of the
@RequiresAuthentication annotations off some pages, and JUST use the
modules' configuration:


configuration.add(factory.createChain(/graphene/pub/**)
.add(factory.anon()).build());
configuration.add(factory.createChain(/).add(factory.roles(),
user).build());
configuration.add(factory.createChain(/graphene/**).add(factory.authc())
.build());
configuration.add(factory.createChain(/assets/**).add(factory.anon())
.build());
configuration.add(factory.createChain(/core/**).add(factory.anon())
.build());
configuration.add(factory.createChain(/**).add(factory.authc())
.build());


Now it seems to work as it should.


Crisis averted, until I add the federated login plugin.

:-)


On Tue, Jun 24, 2014 at 12:48 PM, Daniel Jue teamp...@gmail.com wrote:

 Hi, I'm having trouble with the feature for redirecting to the previous
 request after a successful form login.

 I've read the thread and poked around in the 5.1 and later source code for
 the default Tynamo login component, and my login component is essentially
 the same.  It is mentioned that Tynamo now uses cookies to store the
 savedRequest (for good reason), however the code for dealing with cookies
 in the Tynamo LoginForm component is commented out.

 Here is my situation:

 I have a protected page called event viewer at
 http://localhost:8080/graphene-enron-web/eventviewer
 This page uses a layout component common to all authenticated pages, which
 should be fine.

 (The login and registration pages use a separate layout component, for
 unauthenticated access.)


 After successful login, howerever, I am sent to this URL:


 http://localhost:8080/graphene-enron-web/graphene/pub/core/js/plugin/pace/pace.min.js

 The core/js/plugin/pace/pace.min.js is one of the assets loaded by the
 common Layout component.

 Actually, what I've found is that the request is taking whatever first
 asset is used in the Layout.
 Previously to this, it would try to redirect to my favicon.ico, which was
 being included in the Layout's header!

 Do I need to somehow make my components or certain assets anonymously
 available?



 Here are some relevant snippets:

 public static void contributeApplicationDefaults(
 MappedConfigurationString, String configuration) {
  configuration.add(SecuritySymbols.LOGIN_URL, /graphene/pub/login);

 configuration.add(SecuritySymbols.UNAUTHORIZED_URL,
  /graphene/infrastructure/pagedenied);
 configuration.add(SecuritySymbols.SUCCESS_URL, /graphene/index);
  configuration.add(SecuritySymbols.REDIRECT_TO_SAVED_URL, true);
 }

  @Contribute(WebSecurityManager.class) public static void
 contributeWebSecurityManager( ConfigurationRealm configuration, Realm
 grapheneSecurityRealm) { configuration.add(grapheneSecurityRealm); }

 @Contribute(HttpServletRequestFilter.class)
 @Marker(Security.class)
 public static void setupSecurity(
  ConfigurationSecurityFilterChain configuration,
 SecurityFilterChainFactory factory,
 WebSecurityManager securityManager) {

 // Allow access to the login and registration pages
 configuration.add(factory.createChain(/graphene/pub/**)
  .add(factory.anon()).build());

 configuration.add(factory.createChain(/assets/**).add(factory.anon())
  .build());
 configuration.add(factory.createChain(/**).add(factory.user())
 .build());

 }



 From my login form, which is nearly identical to the Tynamo one:


 public Object onActionFromGrapheneLoginForm() throws IOException {

 Subject currentUser = securityService.getSubject();

 if (currentUser == null) {
 logger.error(Subject can`t be null);
 // throw new IllegalStateException(Subject can`t be null);
  loginMessage = messages.get(AuthenticationError);
 return null;
 }
  if (grapheneLogin.contains(@)) {
 grapheneLogin = grapheneLogin.split(@)[0];
  }

 /**
  * We store the password entered into this token. It will later be
  * compared to the hashed version using whatever hashing routine is set
  * in the Realm.
  */
  UsernamePasswordToken token = new UsernamePasswordToken(grapheneLogin,
 graphenePassword);
 token.setRememberMe(grapheneRememberMe);

 try {
 currentUser.login(token);
 } catch (UnknownAccountException e) {
  loginMessage = messages.get(AccountDoesNotExists);
 return null;
 } catch (IncorrectCredentialsException e) {
  loginMessage = messages.get(WrongPassword);
 return null;
 } catch (LockedAccountException e) {
  loginMessage = messages.get(AccountLocked);
 return null;
 } catch (AuthenticationException e) {
  loginMessage = messages.get(AuthenticationError);
 return

Re: Angular/TapestryJS

2014-06-08 Thread Daniel Jue
Nice Francois!  Is there a document or tutorial that goes with the files
named Step7 or 8?

Thanks for the demo.


On Sat, Jun 7, 2014 at 11:39 AM, françois facon fra.fa...@gmail.com wrote:

 Hello all,

 Here is a link to a AngularJs Page served by Tapestry5.3.7.

 http://tapestryangular-frafac.rhcloud.com/#/phones
 the related code is available at
 https://github.com/ffacon/tapestry5-angular-demo/tree/VO.1

 Next use tapestry-resteasy to handle form submission, and http verb like
 delete etc...

 Any feedback is welcome.
 Best Regards
 François



Re: Does Tapestry and Tomcat work together?

2014-06-06 Thread Daniel Jue
Hi Jeremias,

I'm sorry about the difficulties you're having.  It seems to me the real
issue is dependency resolution, and then making sure those dependencies get
seen by Tomcat.  Neither of those are a Tapestry problem -- it's just a
task inherent in all Maven or Gradle based projects.  Tapestry, along with
thousands of other libraries, is meant to be used with dependency
resolution tools like Maven or Gradle or Ant+Ivy.  You essentially MUST use
Maven or Gradle to avoid the pain of downloading all those jars manually.

I'm also sorry that you felt you needed to switch your IDE to Eclipse.  I
love Eclipse, but I didn't mean to say you couldn't use your favorite IDE!
 All the popular IDEs have some level of Maven support, and even if it did
not, there is always the command line.  Maven (or Gradle) is the key to
making Tapestry projects work.  If Eclipse makes you uncomfortable, you
should be able to use the IDE of your choice.  Do you have Maven installed?

Don't get too frustrated over this, please have faith that plenty of us are
using Tapestry with Tomcat--I've been doing so for over 8 years now.
 Please know that it was a challenge for me as well--My first Tapestry
project was the first experience with Maven, and I had to learn a little
bit of Maven to get started.  I was overwhelmed on that first day (some 8
years ago) but I bit the bullet and learned a little about how and why
Maven works.  Let me tell you--it's a great thing to grow into a Maven
expert over time--I use it in all my projects, now that I've paid my dues
and I can wield it with some power.  :-)   Gradle is great too, and is
often recognized as the successor to Maven.  However Maven is still very
widely used and supported.

What it comes down to is A depends on B, B depends on C, C depends on D and
E, etc.  For Maven, in your pom you just specify that you need A, and Maven
will seek out appropriate versions of B, C,D,E, etc.

In addition to the Jars Tapestry needs for a web application, it is my
experience that there are almost the same number of jars that are used for
the testing phase!  So not all the jars Maven uses end up in your .war file.

By the way, are you packaging your application into a war file?  If so, how?

If you use Maven or Gradle to also build your war file (recommended), Maven
will stick the jars you need in the appropriate place in the war file, and
then Tomcat will get everything it needs in the war file.  Just make sure
that something you include doesn't also include a *servlet*.jar, because
that will cause Tomcat to not load your app.  (That's where my first email
applies, using the excludes tag in your Maven pom to remove conflicting
jars)


Sometimes problems like this come about because you are at a point in life
where you are able to grow and overcome the obstacles.  Once you overcome
this problem you will gain intuition that will really help later on.  Just
face it with the right attitude: there is a solution to the problem and
it's within your abilities to figure it out.  :-)

I hope you were able to understand my message here -- I'm trying to use
terms that would translate easily.

I wish you success.

Dan


On Fri, Jun 6, 2014 at 8:05 AM, Thiago H de Paula Figueiredo 
thiag...@gmail.com wrote:

 On Fri, 06 Jun 2014 05:51:08 -0300, jeremias.epp...@web.de 
 jeremias.epp...@web.de wrote:

java.lang.ClassNotFoundException: org.apache.tapestry5.TapestryFilter

 That error Message is absolutly bullshit, it  totally missleading me.
 The real problem is that tapestry depends on a lot of jars and some of
 jars from tapestry have dependencies to some other libraries like
 hibernate, mongodb and spring and are not needed for the helloworld
 example.


 I'm sorry, but you're the one saying BS here. :P The error message, which
 isn't from Tapestry, but from Tomcat, is absolutely clear: you mentioned a
 class in your web.xml which isn't in the webapp classpath. Tapestry-core
 (the web framework) doesn't not depend on Hibernate, MongoDB nor Spring.
 Some optional stuff do. tapestry-core has exactly 5 runtime dependencies,
 including transitive ones which don't come from the Tapestry project
 itself: commons-codec, Antlr, SLF4J (which is also used by an awful lot of
 other libraries), javax.inject (a Java SSR), Servlet API (which will
 actually be provided by your servlet container).

 You were having a dependency problem and that's exactly why you should
 some tool to handle it. Maven and Gradle are quite good for that and have
 support from IDEs. Just use one of them.

 --
 Thiago H. de Paula Figueiredo
 Tapestry, Java and Hibernate consultant and developer
 http://machina.com.br


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




Re: Possible to use a tapestry application for webservice and web front end development

2014-05-16 Thread Daniel Jue
We are using Tynamo's RESTEasy integration with various js libraries,
including ExtJs.  We deploy it as a single war, however our build is a bit
more complicated since our main codebase is more of a skeleton, and we use
War overlays for specific implementations.  In the end it's all one war
with all our html and js front end code living under the webapps directory.
 It can make testing front end code a little tricky.


On Wed, May 7, 2014 at 12:04 AM, Anbazhagan.G anbazhaga...@snovabits.netwrote:

 Hi All,

 Thanks for your valuable suggestions. I will try and let you know.

 Regards,
 G.Anbazhagan

 On Saturday 03 May 2014 04:05 PM, Taha Siddiqi wrote:

 Hi

 If you are still looking at things , you can give
 http://facebook.github.io/react/ a try. And if you like functional
 programming try https://github.com/swannodette/om.

 regards
 Taha

 On May 3, 2014, at 11:16 AM, Kalle Korhonen wrote:

  On Fri, May 2, 2014 at 5:33 PM, Chris Mylonas ch...@opencsta.org
 wrote:

  Yesterday I would have said that I keep them separate in my ear file,
 however I'm looking at angularjs for something to spend a rainy day on
 and
 came across this tutorial.

 http://killertilapia.blogspot.com.au/2013/06/easy-restful-
 services-with-tapestry-and.html
 I will probably port an existing webservice over today to try it out.
 If
 you are not from around here, the tynamo project has several popular
 tapestry modules, I use tapestry-security from them.

  Yeah, angular is solid and works nicely together with Tynamo's
 tapestry-resteasy. And you can use tapestry-security to secure it all, I
 have one T5.4 app with this exact setup.

 Kalle



  On May 2, 2014 7:27 PM, Anbazhagan.G anbazhaga...@snovabits.net
 wrote:

  Hi All,

 I want to use tapestry application for both web-services and front end
 development. Is it possible to achieve in a single tapestry
 application.

 I am using tapestry5.3.1

 Please give me your valuable suggestions.

 Regards,
 G.Anbazhagan




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




Re: Tapestry5 - Weaves 3.0 repository

2014-03-25 Thread Daniel Jue
I had to do something like this recently for a piece of Neo4J that had no
repo -- I forked the project I was interested in (and also made my fixes to
it) then looked on stack overflow for instructions on creating a maven repo
on github.
The posts I used to do this:
http://stackoverflow.com/questions/14013644/hosting-a-maven-repository-on-github
http://blog.rueedlinger.ch/2012/09/use-github-as-maven-remote-repository/

My example:
https://github.com/danieljue/batch-import-graphene

You can copy most of the relevant pieces out of the POM there.

There was also a piece in my settings.xml that lists the server name that
the property github points to, along with my user and password for
deployment.  Then a simple

mvn clean compile deploy

will put the maven pieces on github in a branch of the project.  The
instructions on my readme show what to put in your POM to create a
dependency that downloads from github.

I also submit a pull request so the original project creator can just merge
the changes.





On Tue, Mar 25, 2014 at 5:20 PM, Boris Horvat horvat.z.bo...@gmail.comwrote:

 Hi everyone,

 Does anyone know if Weaves 3.0 (https://github.com/intercommit/Weaves) has
 a maven repositroy somewhere?

 I can download it from git and build it so I can mange but I would be more
 happy if I can just add dependency in .pom and be done with it (this is
 somewhat needed if one wants to automate the build).

 Cheers

 --
 Sincerely
 *Boris Horvat*



Re: [tynamo-user] Tynamo goes Github!

2014-03-20 Thread Daniel Jue
Great news!  Having the 'brand name' of github has also quelled some fears
about code adoption among my software engineers who are less familiar with
open source repos.  BTW, our Graphene software library is making use of
Tynamo, even more so once we switch to 5.4.   Thanks Kalle!!


On Thu, Mar 20, 2014 at 3:49 PM, Kalle Korhonen
kalle.o.korho...@gmail.comwrote:

 GitHub is cool and we so desperately want to be cool too that we decided
 Tynamo needs to be there as well. In all seriousness, Dragan Sahpaski wrote
 up a whizbang script to import all of the Tynamo's SVN history, branches
 etc. to a Git repo so it made the move a no-brainer. Thanks Dragan. We
 still love Codehaus though and they'll continue providing a lot of the
 infrastructure support, like CI builds and Confluence space but we are
 going to moving issue management over to Github as well so we can be ready
 for your pull requests instead of writing the code ourselves :) Also
 because we are good Git citizens, each Tynamo module now has its own Git
 repo. Checkout the Github organization page at https://github.com/tynamoand 
 navigate from there to your preferred module and start forking away!

 Now that a public beta of Tapestry 5.4 is out, we are also starting a
 module upgrade and release cycle for 5.4 compatibility. Tapestry-security
 0.6.0 is first in line, watch for the release announcement later!






Re: Show and tell / New 5.4 app live.

2014-03-19 Thread Daniel Jue
I also checked out the link when you sent it, nice job!  I found myself
imagining how you laid out the components. =)


On Wed, Mar 19, 2014 at 10:46 PM, Chris Mylonas ch...@opencsta.org wrote:

 mate, she's a super fast website and i've gotta say looks better than the
 previous version.
 i noticed the images.cardaddy.com resolves to AWS.  out of curiousity, was
 this hard to configure?

 i am interested in things breaking, so - where exactly did the exploit for
 bringing down the old service come from?
 apache http - app server?   and what version of apache were you using?

 i have just deployed version-1.0.9 of an internal ip address app that is
 written on tapestry-5.3 and am FINALLY getting onto a simple tapestry 5.4
 project from scratch.


 congratulations,
 chris


 On Sat, Mar 15, 2014 at 12:59 AM, George Christman
 gchrist...@cardaddy.comwrote:

  I'd like to first say thanks to all who have contributed to the on going
  evolution of Tapestry and it's support. I'm a long time user of Tapestry
  starting with version 3 in 2005 and I must say leaps and bounds have been
  made since then. I'd also like to say thanks to all who have continued to
  answer my never ending array of questions ;-) Thanks guys! It has been a
  pleasure working with you all.
 
  In 2008 we took a risk and decided to move forward with t5 beta over
 spring
  with the development of our new app. We experienced some short lived
  glorious times as we successfully processed hundreds of thousands of
 users
  and cars, however do to our nations elected official and his cash for
  clunkers program, it destroyed our market place forcing me to have to
  change our brand to CarDaddy.com.
 
  With the lack of success with the new brand I eventually had to move on
 to
  other opportunities.  I ended up taking a job with our state government
 and
  some contract work for a hotel wireless company, however along with my
  move, I decided to bring along my dear friend Tapestry5. Tapestry5 has
  ended up becoming an active platform within my organizations which we are
  now actively focused on building 5.4 apps. :)
 
  While being focused with my other work, my personal app which was still
  being ran on T5.1 was lacking support and ended up getting hacked
 (apache)
  three weeks ago by the Chinese bringing down my servers. This forced me
 to
  have to whip up a new application over the past three weeks by myself in
  5.4 and yup, that wasn't a typo, only three weeks and that includes
 mobile
  too, okay maybe they were 3 very long weeks, but I still managed to
 pulled
  it off and I don't think I could have without the help of T5.4, jquery,
  bootstrap etc :) Well I'd like to share my new app with the community
 while
  once again pushing out a beta app into production :) I realize there is a
  lot of room for improvement, so feel free to suggest away. Growth seems
 to
  be on the rise as traffic / inventory continue to increase daily and I
  don't have a doubt in my mind that Tapestry won't be up for the job.
 
  Once again, thank you guys for all you have done.
 
  New 5.4-beta3 site
  www.cardaddy.com
 
 
  Cheers,
  George
 
  --
  George Christman
  www.CarDaddy.com
  P.O. Box 735
  Johnstown, New York
 



Re: Custom symbol in AppModule fetched from another service

2014-03-04 Thread Daniel Jue
First, I'd make your own enum so you don't have misspellings of the keys.

public enum MyEnum{
MYKEY
}

Then:
contributeApplicationDefaults(MyEnum.MYKEY,)

Then you can do this elsewhere:

@Symbol(MyEnum.MYKEY)
private boolean theKey;






On Tue, Mar 4, 2014 at 5:17 AM, Emmanuel DEMEY demey.emman...@gmail.comwrote:

 Just use a constant java class like the Tapestry SymbolConstants.


 2014-03-04 10:38 GMT+01:00 Chris Mylonas ch...@opencsta.org:

  Hi All,
 
  I want to want to
  contributeApplicationDefaults(myKey,) in
 AppModule
  for use across the application.
 
  How do i get myKey out of my configuration?
 
  Is that what it's there for, custom stuff as well as the tapestry
 symbols?
 
  Cheers
  Chris
 



 --
 Emmanuel DEMEY
 Ingénieur Etude et Développement
 Worldline, an atos company
 +33 (0)6 47 47 42 02
 demey.emman...@gmail.com


 Twitter : @EmmanuelDemey



Re: Tapestry App Not booting right - dependency tree help

2014-03-02 Thread Daniel Jue
I have a spare minute so I'll share:

Your intuiition is currently at the same stage as mine.  If I come across
this error, I would first look for the missing class, then google to see
what jars include it.  If I don't have that Jar I'll grab the maven
dependency tag for that Jar.  It can also help to look at the dependency
tree in Eclipse (open the POM in a recent Eclipse that has Maven support,
click on the dependency hierarchy tab)  The most insidious errors I've
found were caused by transient dependencies being overridden because you
included a newer version higher up in the tree, and the newer jar doesn't
have the class you were expecting, or some method signature changed.

The dependency hierarchy tab is also good for finding duplicates of things
like log4j or other logger bindings.   Once you know which jars have
offending transitive dependencies, you can go in and start putting
excludes tags on those.


On Sat, Mar 1, 2014 at 9:17 AM, nhhockeyplayer nashua 
nhhockeypla...@hotmail.com wrote:

 Hi Folks,

 As applications become more involved, so do the dependencies. And I am
 finding myself moreso needing to examine the dependency tree to determine
 what is tripping things up.

 But the talent of identification is something that comes with field
 experience.

 I was hoping I could get some help with this one.

 first the error... then the tree...

 either something is tripping something up or I forgot to include a
 library... which leaves me to grab a class file name and search for who it
 is owned by and then include that library ? Search and Grab ?

 Thanks in advance...

 2014-03-01 09:03:09.234:WARN::failed app: java.lang.RuntimeException:
 Exception constructing service 'SeedEntity': Error invoking constructor
 public org.tynamo.seedentity
 .hibernate.services.SeedEntityImpl(org.slf4j.Logger,org.apache.tapestry5.hibernate.HibernateSessionSource,java.util.List):
 Exception constructing service 'HibernateSessio
 nSource': Error invoking constructor public
 org.apache.tapestry5.internal.hibernate.HibernateSessionSourceImpl(org.slf4j.Logger,java.util.List):
 org.hibernate.integrator.
 spi.Integrator: Provider
 org.hibernate.search.hcore.impl.MassIndexerFactoryIntegrator could not be
 instantiated: java.lang.NoClassDefFoundError: org/hibernate/service/spi
 /BasicServiceInitiator
 2014-03-01 09:03:09.238:WARN::Failed startup of context
 org.mortbay.jetty.plugin.Jetty6PluginWebAppContext@11ce012
 {/pphl,C:\Prototype\Mavenized\Product\tynamo\trunk\tynam
 o-examples\pphl\src\main\webapp}
 java.lang.RuntimeException: Exception constructing service 'SeedEntity':
 Error invoking constructor public
 org.tynamo.seedentity.hibernate.services.SeedEntityImpl(org.slf
 4j.Logger,org.apache.tapestry5.hibernate.HibernateSessionSource,java.util.List):
 Exception constructing service 'HibernateSessionSource': Error invoking
 constructor publi
 c
 org.apache.tapestry5.internal.hibernate.HibernateSessionSourceImpl(org.slf4j.Logger,java.util.List):
 org.hibernate.integrator.spi.Integrator: Provider org.hibernate.sea
 rch.hcore.impl.MassIndexerFactoryIntegrator could not be instantiated:
 java.lang.NoClassDefFoundError:
 org/hibernate/service/spi/BasicServiceInitiator
 at
 org.apache.tapestry5.ioc.internal.services.JustInTimeObjectCreator.obtainObjectFromCreator(JustInTimeObjectCreator.java:75)
 at
 org.apache.tapestry5.ioc.internal.services.JustInTimeObjectCreator.createObject(JustInTimeObjectCreator.java:54)
 at
 org.apache.tapestry5.ioc.internal.services.JustInTimeObjectCreator.eagerLoadService(JustInTimeObjectCreator.java:86)
 at
 org.apache.tapestry5.ioc.internal.RegistryImpl.performRegistryStartup(RegistryImpl.java:318)



 == dependency tree follows ==

 [INFO] Scanning for projects...
 [INFO]
 [INFO]
 
 [INFO] Building Tynamo Example - pphl 1.0-SNAPSHOT
 [INFO]
 
 [INFO]
 [INFO] --- maven-dependency-plugin:2.4:tree (default-cli) @ pphl ---
 [INFO] org.tynamo.examples:pphl:war:1.0-SNAPSHOT
 [INFO] +- org.tynamo:tapestry-model-hibernate:jar:0.6.0-SNAPSHOT:compile
 [INFO] |  +- org.tynamo:tapestry-model-core:jar:0.6.0-SNAPSHOT:compile
 [INFO] |  |  +-
 org.tynamo:tapestry-model-annotations:jar:0.6.0-SNAPSHOT:compile
 [INFO] |  |  \- org.tynamo:tapestry-ckeditor:jar:0.0.1:compile
 [INFO] |  +- org.apache.tapestry:tapestry-hibernate:jar:5.4-beta-2:compile
 [INFO] |  |  +- org.jboss.logging:jboss-logging:jar:3.1.0.GA:compile
 [INFO] |  |  \-
 org.apache.tapestry:tapestry-hibernate-core:jar:5.4-beta-2:compile
 [INFO] |  | +-
 org.hibernate.javax.persistence:hibernate-jpa-2.0-api:jar:1.0.0.Final:compile
 [INFO] |  | +- geronimo-spec:geronimo-spec-jta:jar:1.0-M1:runtime
 [INFO] |  | \- javassist:javassist:jar:3.12.1.GA:runtime
 [INFO] |  +- org.hibernate:hibernate-validator:jar:4.3.0.Final:compile
 [INFO] |  |  

Re: Tapestry App Not booting right - dependency tree help

2014-03-02 Thread Daniel Jue
Hi, I hope my choice of words didn't cause some unintentional conclusions.
 :-)  By insidious, I mean the problem was difficult for me to track
down--although now that I make use of the Eclipse dependency hierarchy
view, I can see which transitive dependencies are overriding each other--so
it's not a big problem for me anymore.

I often have to explain our use of Maven to people working on our project
(who are not that adept at Maven): We senior developers have sunk a
considerable part of our careers fighting and wooing Maven to do our
wishes--it's like a bad relationship you can't get out of.  Some of us are
so out of patience with Maven that we don't want to talk about it--just
google it they'll say.  I'm stuck with Maven on our current project,
because moving to something like Gradle, although better, would cause
people's heads to explode.  And I don't want to clean up that mess.

With regards to your other comments, I think you might get higher quality
venting of your frustrations on a site like
http://www.reddit.com/r/programming/
The subscribers to of this list prefer to stay on Tapestry topics, and I've
admittedly strayed from that course here.  t:inline type=Apology
context=mine/



On Sun, Mar 2, 2014 at 1:50 PM, Jon Williams williams.jonat...@gmail.comwrote:

 Seeing as this thread is way off topic already...

 Software is writing. Any one with 5 or 6 years of basic schooling can
 right. Like anything, the more you right, the better you get. It's stupid
 to state that American's are better writers than the rest of the world.
 There's no evidence of that.
 Also, next time, take a look around a typical American code shop, many
 American software writers are off the boat immigrants.



Re: Problem by editing form in loop

2014-03-02 Thread Daniel Jue
gameResult is not being set.  So calling gameResult.firstTeamGoals gives
you the NPE.




On Sun, Mar 2, 2014 at 2:12 PM, Lance Java lance.j...@googlemail.comwrote:

 I think the error message provided by Tapestry is telling you exactly what
 you need to know. Have you read it?



Re: Tapestry with Jetty behind https frontend

2014-02-17 Thread Daniel Jue
I don't have the full solution here in front of me, but I know I've done
this in the past with the Tapestry Spring Security integration, and I'm
sure the Tynamo Shiro integration for T5 also does this.  You could snoop
around the code in there until someone here gets you an answer that meets
your needs.


On Mon, Feb 17, 2014 at 5:52 PM, Ilya Obshadko ilya.obsha...@gmail.comwrote:

 I've researched a little bit more and found BaseURLSource service which is
 responsible for URL construction.

 But overriding BaseURLSource doesn't work because of circular dependency
 during initialization, while trying to alter BaseURLSource using advisors
 simply doesn't work at all (advisor never gets called).

 I'm stuck.



 On Tue, Feb 18, 2014 at 8:34 AM, Ilya Obshadko ilya.obsha...@gmail.com
 wrote:

  I have already implemented it using method advice, so that
  Request.isSecure () returns true when frontend sets appropriate header.
 
  However things turn strange at this point. All links rendered by PageLink
  component now look like:
 
  http://servername:443/context/page
 
  Note plain http instead of https in front. So the port does change, but
  protocol does not. What am I doing wrong? Could you point me in a right
  direction?
 
  This is very strange, because PageLink rendering uses the same mechanisms
  Link.toAbsoluteURI () does, and the latter works, while the former
 doesn't.
 
 
 
 
  On Tue, Feb 18, 2014 at 8:03 AM, Thiago H de Paula Figueiredo 
  thiag...@gmail.com wrote:
 
  On Mon, 17 Feb 2014 17:31:53 -0300, Ilya Obshadko 
  ilya.obsha...@gmail.com wrote:
 
   I understand how to do that with service advisors, but decoration
 remains
  unclear. How do I override a single method from the interface using
  decoration? Could you provide a brief example?
 
 
  See http://tapestry.apache.org/tapestry-ioc-decorators.html,
  AspectDecorator, its method AspectInterceptorBuilder
 createBuilder(ClassT
  serviceInterface, T delegate, String description),
  AspectInterceptorBuilder, which is a subinterface of
 MethodAdviceReceiver,
  which has the adviseMethod(Method, MethodAdvice) method.
 
  Summary: in almost the same way as advice.
 
  --
  Thiago H. de Paula Figueiredo
  Tapestry, Java and Hibernate consultant and developer
  http://machina.com.br
 
  -
  To unsubscribe, e-mail: users-unsubscr...@tapestry.apache.org
  For additional commands, e-mail: users-h...@tapestry.apache.org
 
 
 
 
  --
  Ilya Obshadko
 
 


 --
 Ilya Obshadko



Specify SymbolProvider at runtime

2014-02-14 Thread Daniel Jue
Hi, I was wondering what is the best way of doing this:

From the JVM arguments, I want our developers to specify a location to a
properties file, which will be treated as a symbol source.  I tried a naive
approach and got a recursion error on SymbolSource.

In one of my modules I have this:

@Contribute(SymbolSource.class)
public void contributePropertiesFileAsSymbols(
OrderedConfigurationSymbolProvider configuration) {
configuration.add(DatabaseConfiguration,
new ClasspathResourceSymbolProvider(dbPropertiesFileLocation),
after:SystemProperties, before:ApplicationDefaults);
}

and essentially I'd like the variable dbPropertiesFileLocation to be
something provided on the command line, i.e.
 -Dmyapp.db-properties-file-location=C:\mydatabase.properties

Inside the properties file are several settings that I want to use as
inject-able Symbols.  That part already working when I provide the location
in the contribute method, but now I want to tell Tapestry where that file
lives on startup.


Re: Specify SymbolProvider at runtime

2014-02-14 Thread Daniel Jue
Thanks Thiago, you are right.  I was so caught up in trying to use the
Symbols that I forgot the obvious.  :-)




On Fri, Feb 14, 2014 at 2:38 PM, Thiago H de Paula Figueiredo 
thiag...@gmail.com wrote:

 On Fri, 14 Feb 2014 15:24:53 -0200, Daniel Jue teamp...@gmail.com wrote:

  Hi, I was wondering what is the best way of doing this:


 Hi!



  From the JVM arguments, I want our developers to specify a location to a
 properties file, which will be treated as a symbol source.  I tried a
 naive
 approach and got a recursion error on SymbolSource.

 In one of my modules I have this:

 @Contribute(SymbolSource.class)
 public void contributePropertiesFileAsSymbols(
 OrderedConfigurationSymbolProvider configuration) {
 configuration.add(DatabaseConfiguration,
 new ClasspathResourceSymbolProvider(dbPropertiesFileLocation),
 after:SystemProperties, before:ApplicationDefaults);
 }


 Why don't you use System.getProperty() to get the value passed as a
 command-line parameter?

 --
 Thiago H. de Paula Figueiredo
 Tapestry, Java and Hibernate consultant and developer
 http://machina.com.br

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




Re: [ANN] JumpStart Preview: for Tapestry 5.4

2014-01-20 Thread Daniel Jue
Thanks for your efforts Geoff, I'll be using this reference for sure.  So
much new stuff to catch up on.


On Mon, Jan 20, 2014 at 6:19 PM, Geoff Callender 
geoff.callender.jumpst...@gmail.com wrote:

 JumpStart 7 Preview 3 is now up.

 http://jumpstart.doublenegative.com.au/jumpstart7/

 Forgot to mention that JumpStart 7 also embraces T5.4's new Form error
 handling (in which Tap doesn't redirect to display form errors)

 Cheers,

 Geoff.

 On 06/01/2014, at 7:43 PM, Geoff Callender wrote:

  Hi all,
 
  There's a new JumpStart demo, built for T5.4. It fully embraces:
 
  * Bootstrap.
  * jQuery.
  * RequireJS.
  * JSR-303 Bean Validation.
 
  You can use it here:
 
  http://jumpstart.doublenegative.com.au/jumpstart7/
 
  I hope you like it. As always, your comments and corrections are
 encouraged.
 
  Cheers,
 
  Geoff
 
  P.S. I hope to have a final release ready when T5.4 goes final.
 




Re: Neo4J 2.0 transactions on domain objects with T5.3.x

2014-01-15 Thread Daniel Jue
Thanks++;
I kinda of had it working, but it was too much trouble to maintain which
classes were getting advised.  Also I had the issue of talking to multiple
embedded Neo4J instances (something not many people do), and different
transactional advice is needed depending on where the attached Node came
from. (i.e. a Neo4J Node from database A needs transactional advise from
database A).  This worked as well using Markers but further complicated the
issue, and it wouldn't scale well when we have several graph databases to
talk to at once.

Here's what I ended up doing in case people follow in my footsteps with
embedded Neo4J and T5:

In the end I just created detached domain POJOs, and adjusted my DAOs to
return those instead.  Now I explicitly save the detached by
dao.update(myDetachedObj), and the DAO worries about the transaction, etc.
 It's very simple, seems that's the way nature intended.  Hahaha

In other exciting news, I received official word that the particular set of
code I've been working on will be released as open source on Github.  So
I've got that going for me.  :-)



On Tue, Jan 14, 2014 at 6:49 AM, Thiago H de Paula Figueiredo 
thiag...@gmail.com wrote:

 On Mon, 13 Jan 2014 22:20:41 -0200, Daniel Jue teamp...@gmail.com wrote:

  Thanks Thiago!


 My pleasure!


  Now I want to apply it to all my pages and components in my web module
 using @Match(*).  It causes a recursion error since it sees the
 services in the DAO module which are needed to create the transaction!


 Pages and components aren't services, so I don't think using @Match(*)
 will work for them. I guess you'll need to write a
 ComponentClassTransformWorker to advise page and component methods. See the
 source of CachedWorker for an example.


  One more thing:  When I have one of these Neo4J-backed domain objects
 (let's say User.class), I might have something like this in a page:

 @Property
 private User theUser;

 In my template, if I do ${theUser.firstName}, will the transactional
 advise be applied to the automatically constructed getters and setters for
 that
 property?


 No.


 --
 Thiago H. de Paula Figueiredo
 Tapestry, Java and Hibernate consultant and developer
 http://machina.com.br

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




Re: Tapestry 5.4 require.js modules

2014-01-15 Thread Daniel Jue
I don't have input on the question of additional scope, but thanks for
letting us know that the upgrade went pretty smoothly-- I'm eager to use
5.4 but I can't change right now.


On Mon, Jan 13, 2014 at 3:25 PM, Kristian Marinkovic 
kristian.marinko...@gmail.com wrote:

 Hi all,

 why are tapestry's requirejs modules nested in an anonymous javascript
 function:

 (function() {
define(['jquery'], function($) {
})
 }).call(this);

 isn't it enough to just write define(, function() {})? Is there a
 reason for this additional scope?

 cheers,
 Kris



 BTW, i just migrated an existing T5.3.7 application to T5.4-beta-2 with
 almost no hassle. i'm really impressed.



Re: Neo4J 2.0 transactions on domain objects with T5.3.x

2014-01-13 Thread Daniel Jue
Thanks Thiago!

I have it working for my tests in my DAOModule (no classes, just services
that are explicitly advised via @Match(prefix*)


Now I want to apply it to all my pages and components in my web module
using @Match(*).  It causes a recursion error since it sees the services
in the DAO module which are needed to create the transaction!

I could do this for all my pages and components:
@Match({ Page1, Page2, Page3,...
Component1,Component2,Component3... })

But that smells bad.  Would that be your choice?

I could also do @Advise(serviceInterface = Page1.class) , but that's even
worse because @Advise only takes one class at a time.

What I kind of want is to advise all my pages and components.


One more thing:  When I have one of these Neo4J-backed domain objects
(let's say User.class), I might have something like this in a page:

@Property
private User theUser;

In my template, if I do ${theUser.firstName}, will the transactional advise
be applied to the automatically constructed getters and setters for that
property?





BTW My annotation looks like this:

package org.apache.tapestry5.neo4j.annotation;

import static java.lang.annotation.ElementType.*;
import static java.lang.annotation.RetentionPolicy.RUNTIME;
import static
org.apache.tapestry5.ioc.annotations.AnnotationUseContext.BEAN;
import static
org.apache.tapestry5.ioc.annotations.AnnotationUseContext.COMPONENT;
import static
org.apache.tapestry5.ioc.annotations.AnnotationUseContext.MIXIN;
import static
org.apache.tapestry5.ioc.annotations.AnnotationUseContext.PAGE;
import static
org.apache.tapestry5.ioc.annotations.AnnotationUseContext.SERVICE;

import java.lang.annotation.Documented;
import java.lang.annotation.Retention;
import java.lang.annotation.Target;

import org.apache.tapestry5.ioc.annotations.UseWith;

/**
 * Marks a method of a service (or a component method) as transactional: the
 * call will create a tx, invoke the method, and then should call
tx.success()
 * after invoking the method. Failure through exception will cause Neo4J to
abort the commit.
 *
 * @author djue
 *
 */
@Target({METHOD})
@Retention(RUNTIME)
@Documented
@UseWith({ COMPONENT, MIXIN, PAGE, SERVICE, BEAN })
public @interface Neo4JTransactional {

}








On Mon, Jan 13, 2014 at 6:35 AM, Thiago H de Paula Figueiredo 
thiag...@gmail.com wrote:

 On Fri, 10 Jan 2014 23:01:50 -0200, Daniel Jue teamp...@gmail.com wrote:

  Hello friends,


  The Question:
 So does a custom Advise annotation seem like the right way to go?


 Yes! Just remember that Tapestry-IoC 5.3 doesn't copy the annotations from
 service implementation and its methods to the service proxy, but that
 limitation was already fixed in 5.4. For 5.3, you'll need to put your
 annotation in the service interface.

 --
 Thiago H. de Paula Figueiredo
 Tapestry, Java and Hibernate consultant and developer
 http://machina.com.br

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




Neo4J 2.0 transactions on domain objects with T5.3.x

2014-01-10 Thread Daniel Jue
Hello friends,

I'm upgrading some code of mine to use Neo4J 2.0, which now requires a
transaction on _reads_ as well as writes for anything dealing with
Node/Relationships.  (It used to be reading didn't require a tx)

For those that don't know Neo4J nodes and edges have a MapString,Object
property inside them, and that's where you keep your data that would
normally end up in a domain object as fields.

A recent suggestion from the Neo4J site for working with Domain objects
(Let's say, User.class for example) is to store the underlying node in the
domain object and have getters/setters that work on the underlying node's
property map.  I've used that suggestion this evening and I'm wondering if
this is the right decision.  Here's more information:

A graph service is required to create transactions.  I have this available
by IOC, no problem.
I also have an IOC'd UserDAO which generates User.class objects from the
graph database. Again, no problem there.  Once the UserDAO returns a
User.class to whoever asked for it, that User.class can't be read/written
to without a transaction from the graph service.

I don't want the domain objects to have a handle on the graph service, that
doesn't seem right to me. I can't advise the domain objects because they
are not covered by the IOC framework.

Basically anything that can touch the domain object now has to have the
ability to create a transaction.  This seems like an ideal job for a custom
@Neo4JTransactional, which I'd have to add to every page/component/service
that might touch a User.class.

Whereas with T5Hibernate, @CommitAfter is optional, this new
@Neo4JTransactional would be required or else it will fail.  There are
plenty of times I just needed to read fields from a bean when using
Hibernate, and I didn't have to worry about a transaction.

For classes that are not 'covered' by IOC, such as Test classes, I'd have
to get my transaction elsewhere, probably from the same DAO I get the
User.class from.

The Question:
So does a custom Advise annotation seem like the right way to go?  I'd
create a tx before the method invocation, invoke it and then call
tx.success afterwards, for all methods in a class.  It would be a pain (and
intrusive) to have to mark each method that could possibly read or write to
the domain object, so I'd want to Advise the class on all methods.  Luckily
Neo4J doesn't seem to care about nested tx, so that shouldn't be a problem!

I've looked briefly at how Spring's Neo4J Data framework handles this.
 Looks like it might work, but I can't add that dependency to the project
right now.  I could maybe borrow some code though.


The other option, which I had been using previously, is this:
===
The DAO returns a User.class that has no idea what a Neo4J Node is.  Neo4J
can't 'detach' a node it seems, so I iterated through the
MapString,Object and set all the properties manually in the User.class

Now a T5 page or service comes along and mucks with the User object, but to
save it back to the graph db I have to essentially give the User object
back to the DAO and manually reattach it (lookup the original node and
update properties).

1) This creates a lot of boiler plate for the detach/re-attach.
2) This becomes messy if the property that is getting updated is the same
one we used to look up the Node (i.e. if the lookup value was the email
address, which can be changed)  I don't really have that case now, but I
could foresee that problem with the other domain objects.
===


Thanks for any tips or wisdom,

Dan


T5 Tynamo RestEasy, discovering all rest resources and paths

2013-10-31 Thread Daniel Jue
Hi,  I have a bunch of rest services, across a couple modules.  One of the
rest services is a meta type of service, where the methods (via
parameter-less @Get requests) return things like canonical values/enums
used as query values elsewhere in the system.


Anyway, some member(s) of our team like to change the rest paths around and
this breaks the JS front end of course.

Is there a way to collect:

1) The rest services paths for each service (i.e. the @Path value on the
class)
2) The individual resources' paths (i.e. the @Path on the methods)

Oh and I guess knowing the root rest path as defined in your module would
be nice too.


If I had the complete or relative paths to the individual methods, that
would solve my problem 100%.

The plan is to then expose the available paths through a method under the
meta rest service.

It's not really HATEOAS, I just want to keep the JS guys and back end guys
from stabbing each other (myself included)


Re: html+js+css resources in a discovered module

2013-09-24 Thread Daniel Jue
Ok, I made some progress in the meantime, preparing the code to be split up
for different and future customers.  To me it looks like whatever I want to
be in the root of the web app, I just stick under
/src/main/resources/com/customer/app/ , based on how I see it being done
with tapestry bootstrap (for example)
https://github.com/trsvax/tapestry-bootstrap/tree/master/src/main/resources/com/trsvax/bootstrap

My intended goal is to cobble together a customer specific web app, with
the customer specific pieces being in a jar file. (just as in Igor's blog
post)  This is the inverse of how a T5 library is usually used, to my
knowledge.

*Usually (for me anyway) I'm writing a web app and include pieces from 3rd
party modules, like pre built components.  In this case I'm setting up the
main web app as a core of basic functionality, that has the ability to find
other pages in other modules and add them to menus, etc.  The core web app
has the web.xml and filter definition, and the customer jar file should
just contribute extra pages and services.

*I'm using the term 'customers' here because it translates well.  In
reality these add on modules are more closely tied to specific datasets.  A
com.company may have one, two or ten datasets, and that would mean
dataset1.jar  dataset10.jar
would be packaged in an app's war file.  Each datasetX.jar has it's
supporting pages and services (DAOs, etc)   Many customers have just one
dataset at the moment, but more could be added.


My next question is more of a maven one:  What's a good way to set up the
pom?  I want the core module (com.mycompany.web) to have the web.xml
servlet filter definition, AppModule.class etc.  I want each module
(com.othercompany.datasetX) to be a jar.  But in the end I want to build
individual war files for each customer.
Edit: looks like this may help me, when i get to that point:
http://stackoverflow.com/questions/7897114/how-to-assemble-multimodule-maven-project-into-one-war

I guess it's really no different than what I was doing before, except:
For the core module, that can be spit out as a war file that does stuff
(just no customer specifc stuff)
For each customer module, it will spit out a war file using the core plus a
jar for each dataset that customer has.

Sometimes it just helps to type things out.  If anyone has any suggestions,
or has had to do this sort of setup, please, please drop your $0.02 here!

Thanks


On Mon, Sep 23, 2013 at 11:17 PM, Daniel Jue teamp...@gmail.com wrote:

 Hi, I was reading over this older blog link


 http://blog.tapestry5.de/index.php/2010/01/19/tapestry-ioc-modularization-of-web-applications-without-osgi/

 now that I have to architect our app to work for other customers.  We want
 to keep the core parts together and refactor out the customer specific
 parts to their own JARs, which can then be added into a WAR file.

 I'm still in the middle of changing the code, but...

 1) I'm assuming this is still the way to roll out customer specific WARs
 when you have a core set of pages/services. (The customer specific portion
 becomes a JAR with a module that is discovered by the core WAR file you
 launch)

 2) For some of my customers I have REST resources using Tynamo+RESTEasy,
 and I also have static HTML+JS+CSS files that are customer specific, which
 talk to those REST resources.  How/where should I package those in my JAR
 file, so that they'll end up in the right place in one big, exploded WAR
 file?  It would be easiest if those HTML+JS+CSS files are just served up
 instead of being converted to TML files, because the developer in charge of
 those files doesn't want to adopt anything new.

 Can I just lay out my customer specific maven module in the same way as a
 normal T5 App, but package it as a JAR and without any web.xml (since it
 would use the core app's T5 ServletFilter)

 I'm using Tomcat, if that matters--hopefully it doesn't.





Re: html+js+css resources in a discovered module

2013-09-24 Thread Daniel Jue
Thanks for the recommendation to peek into tapestry-security, I hadn't
thought to look there but I'm definitely looking for those types of
examples.

I'll definitely be using the MANIFEST.MF method of discovery, since the
core module will have no idea about the customer/dataset specific modules
until startup.




On Tue, Sep 24, 2013 at 3:33 PM, Thiago H de Paula Figueiredo 
thiag...@gmail.com wrote:

 For Tapestry 5.4, the location in the classpath you put assets may have
 changed, but everything else didn't, so I see no reason for what you
 describe not working. This isn't any different from what happens in
 tapestry-security, for example. It includes pages, components, etc.

 As long there's a WAR with a web.xml in the end, you can package the
 customer-specific parts as Tapestry component libraries in JARs and it'll
 work. The only difference between a WAR project (with a web.xml) and a JAR
 one (without) is that in the WAR project the component library containing
 your classes is added automatically, while in the JAR you need to do it
 through MANIFEST.MF entry or @SubModule.


 On Tue, 24 Sep 2013 00:17:51 -0300, Daniel Jue teamp...@gmail.com wrote:

  Hi, I was reading over this older blog link

 http://blog.tapestry5.de/**index.php/2010/01/19/tapestry-**
 ioc-modularization-of-web-**applications-without-osgi/http://blog.tapestry5.de/index.php/2010/01/19/tapestry-ioc-modularization-of-web-applications-without-osgi/

 now that I have to architect our app to work for other customers.  We want
 to keep the core parts together and refactor out the customer specific
 parts to their own JARs, which can then be added into a WAR file.

 I'm still in the middle of changing the code, but...

 1) I'm assuming this is still the way to roll out customer specific WARs
 when you have a core set of pages/services. (The customer specific portion
 becomes a JAR with a module that is discovered by the core WAR file you
 launch)

 2) For some of my customers I have REST resources using Tynamo+RESTEasy,
 and I also have static HTML+JS+CSS files that are customer specific, which
 talk to those REST resources.  How/where should I package those in my JAR
 file, so that they'll end up in the right place in one big, exploded WAR
 file?  It would be easiest if those HTML+JS+CSS files are just served up
 instead of being converted to TML files, because the developer in charge
 of
 those files doesn't want to adopt anything new.

 Can I just lay out my customer specific maven module in the same way as a
 normal T5 App, but package it as a JAR and without any web.xml (since it
 would use the core app's T5 ServletFilter)

 I'm using Tomcat, if that matters--hopefully it doesn't.



 --
 Thiago H. de Paula Figueiredo

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




Re: html+js+css resources in a discovered module

2013-09-24 Thread Daniel Jue
Thanks Thiago!!  Good to hear from you.

One of my little concerns with the location of html and js files is that
the developer who's writing those doesn't want to have anything to do with
Tapestry.  He's a bit challenging to work with (in an old school, hand
crafted servlet kind of way), and I'm trying to make this the least painful
for him.  So hopefully all the static js and html files he's writing can be
served up out of an Assets directory without T5 touching them, and it'll
look like it coming out of a WEB-INF directory (where they are now).


On Tue, Sep 24, 2013 at 3:41 PM, Daniel Jue teamp...@gmail.com wrote:

 Ok, I made some progress in the meantime, preparing the code to be split
 up for different and future customers.  To me it looks like whatever I want
 to be in the root of the web app, I just stick under
 /src/main/resources/com/customer/app/ , based on how I see it being done
 with tapestry bootstrap (for example)

 https://github.com/trsvax/tapestry-bootstrap/tree/master/src/main/resources/com/trsvax/bootstrap

 My intended goal is to cobble together a customer specific web app, with
 the customer specific pieces being in a jar file. (just as in Igor's blog
 post)  This is the inverse of how a T5 library is usually used, to my
 knowledge.

 *Usually (for me anyway) I'm writing a web app and include pieces from 3rd
 party modules, like pre built components.  In this case I'm setting up the
 main web app as a core of basic functionality, that has the ability to find
 other pages in other modules and add them to menus, etc.  The core web app
 has the web.xml and filter definition, and the customer jar file should
 just contribute extra pages and services.

 *I'm using the term 'customers' here because it translates well.  In
 reality these add on modules are more closely tied to specific datasets.  A
 com.company may have one, two or ten datasets, and that would mean
 dataset1.jar  dataset10.jar
 would be packaged in an app's war file.  Each datasetX.jar has it's
 supporting pages and services (DAOs, etc)   Many customers have just one
 dataset at the moment, but more could be added.


 My next question is more of a maven one:  What's a good way to set up the
 pom?  I want the core module (com.mycompany.web) to have the web.xml
 servlet filter definition, AppModule.class etc.  I want each module
 (com.othercompany.datasetX) to be a jar.  But in the end I want to build
 individual war files for each customer.
 Edit: looks like this may help me, when i get to that point:

 http://stackoverflow.com/questions/7897114/how-to-assemble-multimodule-maven-project-into-one-war

 I guess it's really no different than what I was doing before, except:
 For the core module, that can be spit out as a war file that does stuff
 (just no customer specifc stuff)
 For each customer module, it will spit out a war file using the core plus
 a jar for each dataset that customer has.

 Sometimes it just helps to type things out.  If anyone has any
 suggestions, or has had to do this sort of setup, please, please drop your
 $0.02 here!

 Thanks


 On Mon, Sep 23, 2013 at 11:17 PM, Daniel Jue teamp...@gmail.com wrote:

 Hi, I was reading over this older blog link


 http://blog.tapestry5.de/index.php/2010/01/19/tapestry-ioc-modularization-of-web-applications-without-osgi/

 now that I have to architect our app to work for other customers.  We
 want to keep the core parts together and refactor out the customer specific
 parts to their own JARs, which can then be added into a WAR file.

 I'm still in the middle of changing the code, but...

 1) I'm assuming this is still the way to roll out customer specific WARs
 when you have a core set of pages/services. (The customer specific portion
 becomes a JAR with a module that is discovered by the core WAR file you
 launch)

 2) For some of my customers I have REST resources using Tynamo+RESTEasy,
 and I also have static HTML+JS+CSS files that are customer specific, which
 talk to those REST resources.  How/where should I package those in my JAR
 file, so that they'll end up in the right place in one big, exploded WAR
 file?  It would be easiest if those HTML+JS+CSS files are just served up
 instead of being converted to TML files, because the developer in charge of
 those files doesn't want to adopt anything new.

 Can I just lay out my customer specific maven module in the same way as a
 normal T5 App, but package it as a JAR and without any web.xml (since it
 would use the core app's T5 ServletFilter)

 I'm using Tomcat, if that matters--hopefully it doesn't.






Re: Testing Tapestry

2013-09-23 Thread Daniel Jue
You'll probably find better examples online, but in my Test classes I
usually have a method like this:


private MyDAOMyPojo,MyQueryObject dao;
@BeforeClass
public void beforeClass() {

// TODO Auto-generated constructor stub
System.out.println(MyDAOTest);
Registry registry;
RegistryBuilder builder = new RegistryBuilder();
builder.add(MyDAOModule.class);
registry = builder.build();
registry.performRegistryStartup();
dao = registry.getService(MyDAO.class);

}

@Test
public void f() {
MyQueryObject q = new MyQueryObject();
q.setAttribute(Martin);
ListMyPojo = dao.findByQuery(q);
//assert something here
}


In MyDAOModule.class, you can set up your services to build via
auto-binding, interface binding, or using a build method (public static
MyDAO buildMyDAO() { ... }  )
depending on your needs.


On Mon, Sep 23, 2013 at 2:58 PM, Martin Kersten martin.kersten...@gmail.com
 wrote:

 Is there anything to aid me with the usual service test. Currently I use
 constructors to ease setup of the services. I will try out providing a test
 module setting up the services and use tapestry IOC to create those. Should
 have done so more early on, but wanted it simple first. But now when I have
 three or four services to setup it becomes cumbersome.


 2013/9/23 Martin Kersten martin.kersten...@gmail.com

  Thanks daniel. I will check the testify stuff in a real example.
 
 
  2013/9/23 Daniel Jue teamp...@gmail.com
 
  I don't have spare minutes at the moment, I just want to drop these
 links
  for you to look at (if you haven't seen them already).  Hope it helps.
 
 
 http://blog.tapestry5.de/index.php/2010/11/16/improved-testing-facilities/
 
  and then this one
 
  http://blog.tapestry5.de/index.php/2010/11/18/find-your-elements/
 
 
  Dan
 
 
  On Mon, Sep 23, 2013 at 12:49 PM, Martin Kersten 
  martin.kersten...@gmail.com wrote:
 
   Problems nope. I just habe to overhowle the system and wonder what
  people
   nicht use. I will check your base clase out. Thanks for sharing.
   Am 23.09.2013 18:12 schrieb Dmitry Gusev dmitry.gu...@gmail.com:
  
I use JUnit for unit testing with T5 services, and TestNG for
 (smoke)
integration testing my apps with URLs.
   
All my JUnit test classes inherited from BaseIntegrationTest (
https://gist.github.com/dmitrygusev/6672859),
all TestNG classes inherited from a copy of SeleniumTestCase with
 with
   this
patch applied:
https://issues.apache.org/jira/browse/TAP5-2107
   
Which is something you may already read while browsing the web.
   
Do you have any problems with this?
   
   
On Mon, Sep 23, 2013 at 7:02 PM, Martin Kersten 
martin.kersten...@gmail.com
 wrote:
   
 I want some real hands on experiences. So please if you have any
  please
 provide.

 I am currently reworking the testing settup since the maven stuff
  is to
 slow for my program test cycle.

 Since I wont use testng I need to rewrite some test code. I need
 to
  do
unit
 testing in java
 since I program in java. Integration test and Acceptance test may
 be
   done
 in groovy
 but I am in doupt this would be such a gain.

 Well the unit testing I want to elaborate the IOC directly using
  only a
 fraction of the
 services the application is about. The IOC setup seams to be
 fairly
   fast
so
 it is ok
 (Hibernate takes way longer)

 I use a embedded jetty for the integration testing with a presetup
  in
 memory database (h2).

 I dont use mvn jetty:run since it is dead slow with all the
  dependency
 setup and stuff.

 So in the end I want to hear what you use for testing, what speed
  means
and
 if you
 use IOC, jetty or something else.


 And yes I searched the web high and low, I want just personal
   experiences
 with
 the background of embedding either a web application server or an
  IOC.


 Cheers,

 Martin (Kersten)

   
   
   
--
Dmitry Gusev
   
AnjLab Team
http://anjlab.com
   
  
 
 
 



Re: Testing Tapestry

2013-09-23 Thread Daniel Jue
I don't have spare minutes at the moment, I just want to drop these links
for you to look at (if you haven't seen them already).  Hope it helps.

http://blog.tapestry5.de/index.php/2010/11/16/improved-testing-facilities/

and then this one

http://blog.tapestry5.de/index.php/2010/11/18/find-your-elements/


Dan


On Mon, Sep 23, 2013 at 12:49 PM, Martin Kersten 
martin.kersten...@gmail.com wrote:

 Problems nope. I just habe to overhowle the system and wonder what people
 nicht use. I will check your base clase out. Thanks for sharing.
 Am 23.09.2013 18:12 schrieb Dmitry Gusev dmitry.gu...@gmail.com:

  I use JUnit for unit testing with T5 services, and TestNG for (smoke)
  integration testing my apps with URLs.
 
  All my JUnit test classes inherited from BaseIntegrationTest (
  https://gist.github.com/dmitrygusev/6672859),
  all TestNG classes inherited from a copy of SeleniumTestCase with with
 this
  patch applied:
  https://issues.apache.org/jira/browse/TAP5-2107
 
  Which is something you may already read while browsing the web.
 
  Do you have any problems with this?
 
 
  On Mon, Sep 23, 2013 at 7:02 PM, Martin Kersten 
  martin.kersten...@gmail.com
   wrote:
 
   I want some real hands on experiences. So please if you have any please
   provide.
  
   I am currently reworking the testing settup since the maven stuff is to
   slow for my program test cycle.
  
   Since I wont use testng I need to rewrite some test code. I need to do
  unit
   testing in java
   since I program in java. Integration test and Acceptance test may be
 done
   in groovy
   but I am in doupt this would be such a gain.
  
   Well the unit testing I want to elaborate the IOC directly using only a
   fraction of the
   services the application is about. The IOC setup seams to be fairly
 fast
  so
   it is ok
   (Hibernate takes way longer)
  
   I use a embedded jetty for the integration testing with a presetup in
   memory database (h2).
  
   I dont use mvn jetty:run since it is dead slow with all the dependency
   setup and stuff.
  
   So in the end I want to hear what you use for testing, what speed means
  and
   if you
   use IOC, jetty or something else.
  
  
   And yes I searched the web high and low, I want just personal
 experiences
   with
   the background of embedding either a web application server or an IOC.
  
  
   Cheers,
  
   Martin (Kersten)
  
 
 
 
  --
  Dmitry Gusev
 
  AnjLab Team
  http://anjlab.com
 



Re: Testing Tapestry

2013-09-23 Thread Daniel Jue
You can still use a constructor/constructor injection when registering your
service in your module, if you want. (In fact the auto binding looks for
the constructor with the most parameters, if none are marked with @Inject.)
 Or, you can use Field Injection.  Not sure if you can use both, probably
not.

If you have @Inject in your class X, and then register the class X in your
module, Tapestry should throw an error if it can't find the class Y to
inject into X.

HOWEVER, if you are instantiating the class outside of the registry, the
@Inject annotations are ignored.  I know this because I have an old-school
coworker who does not believe in Injection, and I have to make some
services construct-able by him.. *le sigh*






On Mon, Sep 23, 2013 at 4:07 PM, Martin Kersten martin.kersten...@gmail.com
 wrote:

 Yeah thats what I was thinking about exactly. This way I can get rid of the
 pesti constructor injection.

 Does anyone knows if the autobuild / build process fails if a property
 annotated @inject could not be injected? Kind of should be but I am quite
 not sure... .


 2013/9/23 Daniel Jue teamp...@gmail.com

  You'll probably find better examples online, but in my Test classes I
  usually have a method like this:
 
 
  private MyDAOMyPojo,MyQueryObject dao;
  @BeforeClass
  public void beforeClass() {
 
  // TODO Auto-generated constructor stub
  System.out.println(MyDAOTest);
  Registry registry;
  RegistryBuilder builder = new RegistryBuilder();
  builder.add(MyDAOModule.class);
  registry = builder.build();
  registry.performRegistryStartup();
  dao = registry.getService(MyDAO.class);
 
  }
 
  @Test
  public void f() {
  MyQueryObject q = new MyQueryObject();
  q.setAttribute(Martin);
  ListMyPojo = dao.findByQuery(q);
  //assert something here
  }
 
 
  In MyDAOModule.class, you can set up your services to build via
  auto-binding, interface binding, or using a build method (public static
  MyDAO buildMyDAO() { ... }  )
  depending on your needs.
 
 
  On Mon, Sep 23, 2013 at 2:58 PM, Martin Kersten 
  martin.kersten...@gmail.com
   wrote:
 
   Is there anything to aid me with the usual service test. Currently I
 use
   constructors to ease setup of the services. I will try out providing a
  test
   module setting up the services and use tapestry IOC to create those.
  Should
   have done so more early on, but wanted it simple first. But now when I
  have
   three or four services to setup it becomes cumbersome.
  
  
   2013/9/23 Martin Kersten martin.kersten...@gmail.com
  
Thanks daniel. I will check the testify stuff in a real example.
   
   
2013/9/23 Daniel Jue teamp...@gmail.com
   
I don't have spare minutes at the moment, I just want to drop these
   links
for you to look at (if you haven't seen them already).  Hope it
 helps.
   
   
  
 
 http://blog.tapestry5.de/index.php/2010/11/16/improved-testing-facilities/
   
and then this one
   
http://blog.tapestry5.de/index.php/2010/11/18/find-your-elements/
   
   
Dan
   
   
On Mon, Sep 23, 2013 at 12:49 PM, Martin Kersten 
martin.kersten...@gmail.com wrote:
   
 Problems nope. I just habe to overhowle the system and wonder what
people
 nicht use. I will check your base clase out. Thanks for sharing.
 Am 23.09.2013 18:12 schrieb Dmitry Gusev 
 dmitry.gu...@gmail.com
  :

  I use JUnit for unit testing with T5 services, and TestNG for
   (smoke)
  integration testing my apps with URLs.
 
  All my JUnit test classes inherited from BaseIntegrationTest (
  https://gist.github.com/dmitrygusev/6672859),
  all TestNG classes inherited from a copy of SeleniumTestCase
 with
   with
 this
  patch applied:
  https://issues.apache.org/jira/browse/TAP5-2107
 
  Which is something you may already read while browsing the web.
 
  Do you have any problems with this?
 
 
  On Mon, Sep 23, 2013 at 7:02 PM, Martin Kersten 
  martin.kersten...@gmail.com
   wrote:
 
   I want some real hands on experiences. So please if you have
 any
please
   provide.
  
   I am currently reworking the testing settup since the maven
  stuff
is to
   slow for my program test cycle.
  
   Since I wont use testng I need to rewrite some test code. I
 need
   to
do
  unit
   testing in java
   since I program in java. Integration test and Acceptance test
  may
   be
 done
   in groovy
   but I am in doupt this would be such a gain.
  
   Well the unit testing I want to elaborate the IOC directly
 using
only a
   fraction of the
   services the application is about. The IOC setup seams to be
   fairly
 fast
  so
   it is ok
   (Hibernate takes way longer)
  
   I use a embedded jetty for the integration testing with a
  presetup
in
   memory database (h2).
  
   I dont use mvn jetty:run since it is dead slow with all

html+js+css resources in a discovered module

2013-09-23 Thread Daniel Jue
Hi, I was reading over this older blog link

http://blog.tapestry5.de/index.php/2010/01/19/tapestry-ioc-modularization-of-web-applications-without-osgi/

now that I have to architect our app to work for other customers.  We want
to keep the core parts together and refactor out the customer specific
parts to their own JARs, which can then be added into a WAR file.

I'm still in the middle of changing the code, but...

1) I'm assuming this is still the way to roll out customer specific WARs
when you have a core set of pages/services. (The customer specific portion
becomes a JAR with a module that is discovered by the core WAR file you
launch)

2) For some of my customers I have REST resources using Tynamo+RESTEasy,
and I also have static HTML+JS+CSS files that are customer specific, which
talk to those REST resources.  How/where should I package those in my JAR
file, so that they'll end up in the right place in one big, exploded WAR
file?  It would be easiest if those HTML+JS+CSS files are just served up
instead of being converted to TML files, because the developer in charge of
those files doesn't want to adopt anything new.

Can I just lay out my customer specific maven module in the same way as a
normal T5 App, but package it as a JAR and without any web.xml (since it
would use the core app's T5 ServletFilter)

I'm using Tomcat, if that matters--hopefully it doesn't.


Re: Loading JSON into a JS var

2013-07-16 Thread Daniel Jue
Thiago, thanks.  I feel that is very close to working.  I've tried out
that example in a few ways and I still have some issues:
Without anything in the TML, there is nothing to click on, so I tried
adding an event link in the tml, like this


a t:type=eventlink t:event='myCustomEventName' t:id='linkId' id='linkId'
Click this
link to
generate SUCCESS!
/a

In the code you provided, when onMyCustomEventName() is called, there
is no differentiation that it is an XHR call or not.  That's fine but
when onMyCustomEventName() returns the JSON, I get

An unexpected application exception has occurred.
A component event handler method returned the value { message :
This is the message:SUCCESS }. Return type
org.apache.tapestry5.json.JSONObject can not be handled.

The javascript for setupEvent() seems to be initializing ok, in my
page it's this:

script type=text/javascriptvar $ = jQuery; Tapestry.JQUERY=true;
Tapestry.onDOMLoaded(function() {
setupEvent('linkId', /newajax:mycustomeventname);
});
/script


So it seems like the javascript itself is not catching the response.
Is it a problem that there is a ':' in the response url?
(newajax:mycustomeventname)


On Tue, Jul 16, 2013 at 8:58 AM, Thiago H de Paula Figueiredo
thiag...@gmail.com wrote:
 You don't need Zone nor EventLink for that, so don't use them. Here's
 another way (not tested):

 @Inject
 private ComponentResources resources;

 @Inject
 private Request request;

 @Inject
 private JavaScriptSupport javaScriptSupport;

 public String getEventLink() {
 return resources.createEventLink(MyCustomEventName);
 }

 void afterRender() {
 javaScriptSupport.addScript(setupEvent('%s', %s);, linkId,
 getEventLink());
 }

 JSONObject onMyCustomEventName() {
 String queryParameter1 = request.getParameter(queryParameter1);
 String queryParameter2 = request.getParameter(queryParameter2);
 JSONObject object = new JSONObject();
 object.put(message, getMessage());
 (...)
 return object;
 }

 function setupEvent(id, url) {
 $(id).observe(click, function(event) {
 new Ajax.Request(url, {
 onSuccess: function(response) {
 var returnedObject = response.responseJSON;
 window.alert(returnedObject);
 },
 parameters : {
 queryParameter1: 'valueOfqueryParameter1',
 queryParameter2: 'valueOfqueryParameter2',
 }
 )};
 });

 }


 On Tue, 16 Jul 2013 02:13:51 -0300, Daniel Jue teamp...@gmail.com wrote:

 Ugh, still not working for me yet.  Once I get it though, things should
 really get moving.
 Here's what I have.  The intent is a simple event link on a page, that,
 when click on, performs an ajax call to get a json payload, and then
 displays the payload as the contents to a javascript alert().
 I figure from this simplified problem I can create real payloads and
 assign
 them to meaningful javascript variables.

 Something is obviously missing, but I'm at a loss for what.  This is
 probably my 20th iteration of it since the last email.  Of note is that in
 sendJson(), the request is NOT XHR, even though it's being called from an
 event link with a zone.
 Any ideas?  I'd really like to just get this working.  It seems like this
 would be a very common need, to provide json to js visualizations from
 pages without having to stand up separate REST services.  I poked around
 in
 tapestry5-jquery and tapestry5-highcharts, but didn't see an obvious
 example.

 NewAjax.java:


 @Import(library = context:/js/testJSON.js)
 public class NewAjax {
 @Inject
 private AjaxResponseRenderer ajaxResponseRenderer;

 @Inject
 @Property
 private JavaScriptSupport javaScriptSupport;
 @Inject
 private ComponentResources resources;

 @InjectComponent
 private Zone someZone;

 @InjectComponent
 private EventLink jsonCallbackLink;

 @AfterRender
 private void addJavaScript() {
 javaScriptSupport.addInitializerCall(testJSON,
 jsonCallbackLink.getClientId());
 }

 @Inject
 private Request request;

 @OnEvent(sendJSON)
 void sendJSON() {
 if (request.isXHR()) {
 // use AjaxResponseRenderer
 ajaxResponseRenderer.addCallback(new JSONCallback() {
 public void run(JSONObject reply) {
 // generate my custom JSON payload here
 reply.put(message, my message);
 }
 });
 }
 }
 }



 NewAjax.tml

 html title=New Ajax xmlns:t=
 http://tapestry.apache.org/schema/tapestry_5_3.xsd;
 xmlns:p=tapestry:parameter
 body
 t:zone t:id='someZone'
 This is someZone
 /t:zone
 a t:type='eventLink' t:zone=someZone t:id='jsonCallbackLink'
 t:event='sendJSON'
 Click this link to generate JSON!
 /a
 /body
 /html


 testJSON.js:

 Tapestry.Initializer.testJSON = function(elementId){
 $(elementId).observe(click, function(event){

 Tapestry.ajaxRequest($(elementId).href, function(response

Re: Loading JSON into a JS var

2013-07-16 Thread Daniel Jue
If it's the javascript that's at fault one thing that may be causing
it is that I'm using Tapestry5-JQuery, which requires a different
syntax than prototype's 'observe' and 'click'.

I'm still trying to figure this out--obviously I'm not a JS expert yet.

On Tue, Jul 16, 2013 at 1:11 PM, Daniel Jue teamp...@gmail.com wrote:
 Thiago, thanks.  I feel that is very close to working.  I've tried out
 that example in a few ways and I still have some issues:
 Without anything in the TML, there is nothing to click on, so I tried
 adding an event link in the tml, like this


 a t:type=eventlink t:event='myCustomEventName' t:id='linkId' id='linkId'
 Click this
 link to
 generate SUCCESS!
 /a

 In the code you provided, when onMyCustomEventName() is called, there
 is no differentiation that it is an XHR call or not.  That's fine but
 when onMyCustomEventName() returns the JSON, I get

 An unexpected application exception has occurred.
 A component event handler method returned the value { message :
 This is the message:SUCCESS }. Return type
 org.apache.tapestry5.json.JSONObject can not be handled.

 The javascript for setupEvent() seems to be initializing ok, in my
 page it's this:

 script type=text/javascriptvar $ = jQuery; Tapestry.JQUERY=true;
 Tapestry.onDOMLoaded(function() {
 setupEvent('linkId', /newajax:mycustomeventname);
 });
 /script


 So it seems like the javascript itself is not catching the response.
 Is it a problem that there is a ':' in the response url?
 (newajax:mycustomeventname)


 On Tue, Jul 16, 2013 at 8:58 AM, Thiago H de Paula Figueiredo
 thiag...@gmail.com wrote:
 You don't need Zone nor EventLink for that, so don't use them. Here's
 another way (not tested):

 @Inject
 private ComponentResources resources;

 @Inject
 private Request request;

 @Inject
 private JavaScriptSupport javaScriptSupport;

 public String getEventLink() {
 return resources.createEventLink(MyCustomEventName);
 }

 void afterRender() {
 javaScriptSupport.addScript(setupEvent('%s', %s);, linkId,
 getEventLink());
 }

 JSONObject onMyCustomEventName() {
 String queryParameter1 = request.getParameter(queryParameter1);
 String queryParameter2 = request.getParameter(queryParameter2);
 JSONObject object = new JSONObject();
 object.put(message, getMessage());
 (...)
 return object;
 }

 function setupEvent(id, url) {
 $(id).observe(click, function(event) {
 new Ajax.Request(url, {
 onSuccess: function(response) {
 var returnedObject = response.responseJSON;
 window.alert(returnedObject);
 },
 parameters : {
 queryParameter1: 'valueOfqueryParameter1',
 queryParameter2: 'valueOfqueryParameter2',
 }
 )};
 });

 }


 On Tue, 16 Jul 2013 02:13:51 -0300, Daniel Jue teamp...@gmail.com wrote:

 Ugh, still not working for me yet.  Once I get it though, things should
 really get moving.
 Here's what I have.  The intent is a simple event link on a page, that,
 when click on, performs an ajax call to get a json payload, and then
 displays the payload as the contents to a javascript alert().
 I figure from this simplified problem I can create real payloads and
 assign
 them to meaningful javascript variables.

 Something is obviously missing, but I'm at a loss for what.  This is
 probably my 20th iteration of it since the last email.  Of note is that in
 sendJson(), the request is NOT XHR, even though it's being called from an
 event link with a zone.
 Any ideas?  I'd really like to just get this working.  It seems like this
 would be a very common need, to provide json to js visualizations from
 pages without having to stand up separate REST services.  I poked around
 in
 tapestry5-jquery and tapestry5-highcharts, but didn't see an obvious
 example.

 NewAjax.java:


 @Import(library = context:/js/testJSON.js)
 public class NewAjax {
 @Inject
 private AjaxResponseRenderer ajaxResponseRenderer;

 @Inject
 @Property
 private JavaScriptSupport javaScriptSupport;
 @Inject
 private ComponentResources resources;

 @InjectComponent
 private Zone someZone;

 @InjectComponent
 private EventLink jsonCallbackLink;

 @AfterRender
 private void addJavaScript() {
 javaScriptSupport.addInitializerCall(testJSON,
 jsonCallbackLink.getClientId());
 }

 @Inject
 private Request request;

 @OnEvent(sendJSON)
 void sendJSON() {
 if (request.isXHR()) {
 // use AjaxResponseRenderer
 ajaxResponseRenderer.addCallback(new JSONCallback() {
 public void run(JSONObject reply) {
 // generate my custom JSON payload here
 reply.put(message, my message);
 }
 });
 }
 }
 }



 NewAjax.tml

 html title=New Ajax xmlns:t=
 http://tapestry.apache.org/schema/tapestry_5_3.xsd;
 xmlns:p=tapestry:parameter
 body
 t:zone t:id='someZone

Re: Loading JSON into a JS var

2013-07-16 Thread Daniel Jue
Hey Thiago, I got it working.  Here is the full working code for
anyone else using T5 + JQuery + ajax

NewAjax.class:

import java.util.Date;

import org.apache.tapestry5.ComponentResources;
import org.apache.tapestry5.annotations.Import;
import org.apache.tapestry5.annotations.OnEvent;
import org.apache.tapestry5.ioc.annotations.Inject;
import org.apache.tapestry5.json.JSONObject;
import org.apache.tapestry5.services.Request;
import org.apache.tapestry5.services.javascript.JavaScriptSupport;

@Import(library = context:/js/testJSON.js)
public class NewAjax {
@Inject
private ComponentResources resources;

@Inject
private Request request;

@Inject
private JavaScriptSupport javaScriptSupport;

public String getEventLink() {
return resources.createEventLink(MyCustomEventName).toURI();
}

void afterRender() {
javaScriptSupport.addScript(setupEvent('%s', '%s');, linkId,
getEventLink());
}

@OnEvent(value = MyCustomEventName)
JSONObject myEventHandler() {
// check if this is a AJAX request
if (request.isXHR()) {
String queryParameter1 = request.getParameter(queryParameter1);
String queryParameter2 = request.getParameter(queryParameter2);
JSONObject object = new JSONObject();
object.put(var1, \n + queryParameter1.toUpperCase());
object.put(var2, \n + queryParameter2.toUpperCase());
object.put(message, getMessage());
// Make your real payload
return object;
}
return null;
}

private String getMessage() {
return SUCCESS at  + (new Date()).toString();
}
}



NewAjax.tml
html title=New Ajax
xmlns:t=http://tapestry.apache.org/schema/tapestry_5_3.xsd;
xmlns:p=tapestry:parameter
body
a id=linkIdClick this Tapestry Link/a
/body
/html


testJSON.js:

function setupEvent(id, theurl) {
alert(here with +#+id);
$(#+id).click(function() {
var dataObj = {};
dataObj[queryParameter1] = Daniel;
dataObj[queryParameter2] = Jue;
$.ajax({
url : theurl,
data : dataObj,
dataType: json,
complete : function() {
alert(AJAX - complete setup by T5());
},
success : function(result) {
alert(AJAX - success setup by T5()  + result.message+result.var1+result.var2);
}
});
});
}


Of special note are the changes to testJSON.js to make it work with JQuery.
The id must have a '#' symbol.  Also the datatype is set to 'json',
but it could be 'html', etc.

Thanks also to Taha and Howard for their input.

On Tue, Jul 16, 2013 at 2:11 PM, Thiago H de Paula Figueiredo
thiag...@gmail.com wrote:
 On Tue, 16 Jul 2013 14:31:27 -0300, Daniel Jue teamp...@gmail.com wrote:

 If it's the javascript that's at fault one thing that may be causing
 it is that I'm using Tapestry5-JQuery, which requires a different
 syntax than prototype's 'observe' and 'click'.


 You used Prototype in the code you posted, so I thought you were using it
 instead of jQuery. Of course, you'll need to adapt the JS part for jQuery.


 --
 Thiago H. de Paula Figueiredo

 -
 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



Loading JSON into a JS var

2013-07-15 Thread Daniel Jue
Hi, I'm getting back into Tapestry development, specifically needing to do
some dynamic front end work I haven't attempted before.

I have a 3rd party JS library (Infovis) which draws a graph using JSON data.
http://philogb.github.io/jit/static/v20/Jit/Examples/ForceDirected/example1.html

The starter example uses

var json = ...the sample graph data..

and then later on there is call to

   1. fd.loadJSON(json);


What I'd like to do is have the user click on an action/event link and then
have the var json variable returned from the server side, and then have
fd.loadJSON() called.

What is the most direct and preferred way of doing this? (Preferably
without extra dependencies)


Thanks


Re: Loading JSON into a JS var

2013-07-15 Thread Daniel Jue
Thanks Taha and Howard!  Looks like I have some more learning to do, which
is always great.
BTW, I'm on T5.3.6.


Howard, for my purposes the JSON payload for the visualization needs to be
generated at runtime when the user clicks (I'll eventually have dozens of
clickable links, each one a costly calculation)--your solution sounds like
the json is getting pre-calculated (unless I am interpreting it wrong,
which is likely)

I was trying one of Taha's old examples that seemed similar (
http://apache-tapestry-mailing-list-archives.1045711.n5.nabble.com/Updating-a-page-with-a-JSONObject-td3339940.html
)
But I'm getting an error with that.  Possibly because I'm trying to trigger
the Ajax response through an eventlink I added to the TML, with no Zone.
Do I need to make use of a zone component at all?  I'm getting an
error of Page
must be specified before initializing for partial page render.




On Mon, Jul 15, 2013 at 7:30 PM, Howard Lewis Ship hls...@gmail.com wrote:

 Build a URL using resources.createEventLink() and pass this down to the
 browser.

 From the event handler, construct and return a JSONObject.

 Have the client trigger the provided URL, then pass the response.json to
 the fd.loadJSON() method.

 There's a bunch of other variations on this; for instance, you can create a
 initializer function (in 5.3) or a module (in 5.4) and pass the JSON object
 to the initalize function, or the module, via JavaScriptSupport.


 On Mon, Jul 15, 2013 at 4:21 PM, Daniel Jue teamp...@gmail.com wrote:

  Hi, I'm getting back into Tapestry development, specifically needing to
 do
  some dynamic front end work I haven't attempted before.
 
  I have a 3rd party JS library (Infovis) which draws a graph using JSON
  data.
 
 
 http://philogb.github.io/jit/static/v20/Jit/Examples/ForceDirected/example1.html
 
  The starter example uses
 
  var json = ...the sample graph data..
 
  and then later on there is call to
 
 1. fd.loadJSON(json);
 
 
  What I'd like to do is have the user click on an action/event link and
 then
  have the var json variable returned from the server side, and then have
  fd.loadJSON() called.
 
  What is the most direct and preferred way of doing this? (Preferably
  without extra dependencies)
 
 
  Thanks
 



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



Re: Loading JSON into a JS var

2013-07-15 Thread Daniel Jue
Ugh, still not working for me yet.  Once I get it though, things should
really get moving.
Here's what I have.  The intent is a simple event link on a page, that,
when click on, performs an ajax call to get a json payload, and then
displays the payload as the contents to a javascript alert().
I figure from this simplified problem I can create real payloads and assign
them to meaningful javascript variables.

Something is obviously missing, but I'm at a loss for what.  This is
probably my 20th iteration of it since the last email.  Of note is that in
sendJson(), the request is NOT XHR, even though it's being called from an
event link with a zone.
Any ideas?  I'd really like to just get this working.  It seems like this
would be a very common need, to provide json to js visualizations from
pages without having to stand up separate REST services.  I poked around in
tapestry5-jquery and tapestry5-highcharts, but didn't see an obvious
example.

NewAjax.java:


@Import(library = context:/js/testJSON.js)
public class NewAjax {
@Inject
private AjaxResponseRenderer ajaxResponseRenderer;

@Inject
@Property
private JavaScriptSupport javaScriptSupport;
@Inject
private ComponentResources resources;

@InjectComponent
private Zone someZone;

@InjectComponent
private EventLink jsonCallbackLink;

@AfterRender
private void addJavaScript() {
javaScriptSupport.addInitializerCall(testJSON,
jsonCallbackLink.getClientId());
}

@Inject
private Request request;

@OnEvent(sendJSON)
void sendJSON() {
if (request.isXHR()) {
// use AjaxResponseRenderer
ajaxResponseRenderer.addCallback(new JSONCallback() {
public void run(JSONObject reply) {
// generate my custom JSON payload here
reply.put(message, my message);
}
});
}
}
}



NewAjax.tml

html title=New Ajax xmlns:t=
http://tapestry.apache.org/schema/tapestry_5_3.xsd;
xmlns:p=tapestry:parameter
body
t:zone t:id='someZone'
This is someZone
/t:zone
a t:type='eventLink' t:zone=someZone t:id='jsonCallbackLink'
t:event='sendJSON'
Click this link to generate JSON!
/a
/body
/html


testJSON.js:

Tapestry.Initializer.testJSON = function(elementId){
$(elementId).observe(click, function(event){

Tapestry.ajaxRequest($(elementId).href, function(response){
alert(response.responseJSON.message);
});

event.preventDefault();
});
};








On Mon, Jul 15, 2013 at 9:08 PM, Taha Hafeez Siddiqi 
tawus.tapes...@gmail.com wrote:

 EventLink must have its zone parameter set to a zone for it to use ajax.
 Remember not to use an empty zone(because of a bug in 5.3). If you want to
 use an empty zone just add nbsp; to it.


 On 16-Jul-2013, at 6:30 AM, Daniel Jue teamp...@gmail.com wrote:

  Thanks Taha and Howard!  Looks like I have some more learning to do,
 which
  is always great.
  BTW, I'm on T5.3.6.
 
 
  Howard, for my purposes the JSON payload for the visualization needs to
 be
  generated at runtime when the user clicks (I'll eventually have dozens of
  clickable links, each one a costly calculation)--your solution sounds
 like
  the json is getting pre-calculated (unless I am interpreting it wrong,
  which is likely)
 
  I was trying one of Taha's old examples that seemed similar (
 
 http://apache-tapestry-mailing-list-archives.1045711.n5.nabble.com/Updating-a-page-with-a-JSONObject-td3339940.html
  )
  But I'm getting an error with that.  Possibly because I'm trying to
 trigger
  the Ajax response through an eventlink I added to the TML, with no Zone.
  Do I need to make use of a zone component at all?  I'm getting an
  error of Page
  must be specified before initializing for partial page render.
 
 
 
 
  On Mon, Jul 15, 2013 at 7:30 PM, Howard Lewis Ship hls...@gmail.com
 wrote:
 
  Build a URL using resources.createEventLink() and pass this down to the
  browser.
 
  From the event handler, construct and return a JSONObject.
 
  Have the client trigger the provided URL, then pass the response.json to
  the fd.loadJSON() method.
 
  There's a bunch of other variations on this; for instance, you can
 create a
  initializer function (in 5.3) or a module (in 5.4) and pass the JSON
 object
  to the initalize function, or the module, via JavaScriptSupport.
 
 
  On Mon, Jul 15, 2013 at 4:21 PM, Daniel Jue teamp...@gmail.com wrote:
 
  Hi, I'm getting back into Tapestry development, specifically needing to
  do
  some dynamic front end work I haven't attempted before.
 
  I have a 3rd party JS library (Infovis) which draws a graph using JSON
  data.
 
 
 
 http://philogb.github.io/jit/static/v20/Jit/Examples/ForceDirected/example1.html
 
  The starter example uses
 
  var json = ...the sample graph data..
 
  and then later on there is call to
 
1. fd.loadJSON(json);
 
 
  What I'd like to do is have the user click on an action/event link and
  then
  have the var json variable returned from the server side, and then have
  fd.loadJSON() called.
 
  What is the most direct and preferred way of doing this? (Preferably
  without extra dependencies

Re: Tapestry IOC - Should it have it's own name?

2012-09-12 Thread Daniel Jue
I'd say keep the same name but market the IOC more heavily, with tutorials
and demos (a quickstart, perhaps) of it being used in a non web app.  (I
don't think this is out there, right?  If it is, it wasn't in-my-face
enough. :-)  )  A T5 IOC quickstart might work well with an Apache Shiro
example, since that can also be used outside of a web app.

I use the T5 IOC as a major selling point to using T5 as a web framework,
because they work so well together, and I'm loving the common version
numbering.  HiveMind just makes me think of StarCraft. ;-)

On Wed, Sep 12, 2012 at 12:26 PM, Howard Lewis Ship hls...@gmail.comwrote:

 On Wed, Sep 12, 2012 at 2:59 AM, Lance Java lance.j...@googlemail.com
 wrote:
  I've often had a conversation like this in the workplace:
 
  colleague: Let's start a new spring project
  me:  I hate spring, how about we use Tapestry IOC instead?
  colleague: Tapestry, isn't that a web framework?
  me:  Well... yes, but Tapestry (the web framework) is build on
 top
  of Tapestry IOC which can be used without the web framework
  colleague: Oh, I didn't know that.

 Maybe we could resurrect the HiveMind name?  I always loved that name!

 
  Does anyone else think that Tapestry IOC should have it's own name? (and
  possibly it's own release cycle)

 HiveMind had its own release cycle; this wasn't quite a disaster, but
 it made things much more difficult. I really like that in Tapestry you
 don't need a cheat sheet to figure out which versions of the main
 libraries work together: they all have the same version number.  This
 means that for some libraries that don't change from release to
 release you have virtually identical binaries with different version
 numbers, but that's more than acceptable to me.

 
 
 
  --
  View this message in context:
 http://tapestry.1045711.n5.nabble.com/Tapestry-IOC-Should-it-have-it-s-own-name-tp5716228.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
 



 --
 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.3 application level singleton cache with Hibernate injection

2012-08-09 Thread Daniel Jue
Thanks Kalle, that was the example I wanted to see.  Is there a way to
force my tapestry-hibernate module to load before my CacheModule , so I can
grab it's configuration?  Right now I'm spinning up a separate hibernate
configuration, and then manually loading classes into that configuration.


On Thu, Aug 9, 2012 at 1:05 AM, Kalle Korhonen
kalle.o.korho...@gmail.comwrote:

 On Wed, Aug 8, 2012 at 9:46 PM, Daniel Jue teamp...@gmail.com wrote:
  Problem:
  I want to initialize this cache on server startup, before any pages are
  served, since it can take a few minutes.
  I want to pass it session from tapestry hibernate, since I use that
  configuration in the pages (I'm guessing there is some way to get an
  instance of HibernateSessionSource)
  I'm sure I could brute force a way to load it's own
 HibernateSessionManager
  and then read stuff into memory, but I wanted to see if I could
  @injectservice somehow.
  The objects being stored in memory are not necessarily hibernate objects,
  but we want to use hibernate to construct the caches.
  Once the in memory cache is created, the session it used to communicate
  with the DB is no longer needed.
  Looking around online, it seems that what I want is closest to a service
  and something like a DAO+Cache.  Again, the DAO part is understandable,
 but
  is there a proper way to get a Hibernate session injected into it at
  startup so it can be built, without having to access any web resource to
  kick it off?

 Yes, create your service (or create a helper service) to start with
 @EagerLoad. Lots of things use this but for an example, you could take
 a look at SeedEntityImpl, an implementation class in Tynamo's
 seedentity module
 (http://tynamo.org/tapestry-hibernate-seedentity+guide).

 Kalle

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




T5.3 application level singleton cache with Hibernate injection

2012-08-08 Thread Daniel Jue
After a long hiatus from web development, I have a chance to get back into
Tapestry for a small project.  I kind of need a refresher for an approach I
haven't had to do before:

Context note: Running T5.3 on Tomcat or Jetty, from latest Tynamo release
with Tynamo hibernate/resteasy modules.

Application:
I'm adapting/restructuring an existing application where I have an in
memory, RO cache of several GB in a singleton object.  Requests hit this
cache for some things, and my plan is to have my tapestry pages and rest
services bounce against that.
A call to the custom cache from a page/rest service will take a session in
case it needs to forward the request to databases, etc.
Access from rest services/pages are not a problem because I can just inject
a session and pass it to the cache.
It's a requirement that this cache be in memory.

Problem:
I want to initialize this cache on server startup, before any pages are
served, since it can take a few minutes.
I want to pass it session from tapestry hibernate, since I use that
configuration in the pages (I'm guessing there is some way to get an
instance of HibernateSessionSource)

I'm sure I could brute force a way to load it's own HibernateSessionManager
and then read stuff into memory, but I wanted to see if I could
@injectservice somehow.
The objects being stored in memory are not necessarily hibernate objects,
but we want to use hibernate to construct the caches.
Once the in memory cache is created, the session it used to communicate
with the DB is no longer needed.


Looking around online, it seems that what I want is closest to a service
and something like a DAO+Cache.  Again, the DAO part is understandable, but
is there a proper way to get a Hibernate session injected into it at
startup so it can be built, without having to access any web resource to
kick it off?

Thanks


Re: Tapestry Spring Security for 5.4-SNAPSHOT

2012-07-27 Thread Daniel Jue
Sure, just don't break it too bad. ;-)  I'd like to see your improvements.
 Make sure your T5.4 Snapshot is up to date.



On Fri, Jul 27, 2012 at 6:32 AM, wout86 wouter.amerij...@gmail.com wrote:

 Hi Daniel,

 Do you allow others to commit to your fork as well? Otherwise, I'd be
 interested as I still have an improvement on the latest
 tapestry-spring-security which is apparently not yet present in the fork.

 Best Regards,
 Wouter



 --
 View this message in context:
 http://tapestry.1045711.n5.nabble.com/Tapestry-Spring-Security-for-5-4-SNAPSHOT-tp5714817p5714830.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 Spring Security for 5.4-SNAPSHOT

2012-07-26 Thread Daniel Jue
I forked lltyk's latest version and made some changes, as I wanted to use
T5.4 for a project I am rewriting.

Uses Tapestry 5.4-SNAPSHOT
Uses Spring 3.1.1-RELEASE
Removed most of the deprecation.

https://github.com/danieljue/tapestry-spring-security

Enjoy.


Deprecation I didn't overcome:
AnonymousAuthenticationFilter.setUserAttribute(UserAttribute a) is
deprecated, but I didn't see a way to set it in a constructor.


Re: Wanted: New title for the Tapestry book

2011-12-05 Thread Daniel Jue
How about naming it after a famous tapestry?
I Googled 'famous tapestry' and found this one, and it even has a UNICORN!

http://en.wikipedia.org/wiki/The_Lady_and_the_Unicorn

On Mon, Dec 5, 2011 at 11:18 AM, Borut Bolcina borut.bolc...@gmail.com wrote:
 That is funny, with a grain of salt.


 Sent from my iPad

 On 5. dec. 2011, at 13:22, Koka Kiknadze 226...@gmail.com wrote:

 Is there any timetable? I think it's the most awaited manual on java web
 development - so you could just name it accordingly :)

 Tapetry 5 Guide:  The Most Awaited Manual For Java Web Development

 -
 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: [ANNOUNCE] Apache Tapestry 5.3

2011-11-28 Thread Daniel Jue
Congrats Howard!  I can't wait to get back into using Tapestry and see
all the progress that's been made.

On Mon, Nov 28, 2011 at 1:20 PM, Howard Lewis Ship hls...@gmail.com wrote:
 Great, so use Maven. The quickstart archetype gives you the option.

 On Mon, Nov 28, 2011 at 10:07 AM, SeleniuM invest-in...@hotmail.com wrote:
 Yes, but I don't have plugin for gradle in Netbeans, so I need first to
 import an Eclipse project with all gradle dependencies and then apply
 project in NetBeans to have the working project in NetBeans. If I would use
 Maven, then I will need to write down all dependencies in my web.xml or
 create single instances in poms, which isn't so hard, but takes too much
 time.

 --
 View this message in context: 
 http://tapestry.1045711.n5.nabble.com/ANNOUNCE-Apache-Tapestry-5-3-tp5029536p5029612.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





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



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



Re: Should Tapestry phone home?

2010-10-11 Thread Daniel Jue
I don't think this is a good idea.  I understand that it would satisfy
a lot of curiosity.  Not that it could phone home on the networks I
deal with.  There would have to be value-add for the end user, such as
checking for a newer version, etc.

Is there precedent for this in other Apache projects?


On Mon, Oct 11, 2010 at 12:49 PM, Howard Lewis Ship hls...@gmail.com wrote:
 This came up during my training class this week.

 What would be the repercussions if Tapestry included a start-up filter
 that reported the application startup back to some central location,
 so that we could get some idea of where and how Tapestry is being
 used?  Obviously, this would be documented, in such a way that it
 would be easy to turn off for the privacy-minded.

 It would be interesting to know how many apps are running in the wild,
  and details about how many pages  components  services, JVM
 version, and OS and hardware configuration.

 Asking people to do this manually is a non-starter, I'm constantly
 surprised by people telling me they are using Tapestry in visible
 places.

 Thoughts?


 -- Forwarded message --
 From: Alessio Gambi agamb...@gmail.com
 Date: Mon, Oct 11, 2010 at 9:18 AM
 Subject: Re: Monitoring/statistics
 To: Tapestry users users@tapestry.apache.org


 Hi,
 Please think also about some way to obtain (meta) statistics about
 Tapestry itself. Something that can be used to track how many people
 are actually using tapestry as platform for their applications.

 -- Alessio

 On 11-ott-2010, at 18:05, Howard Lewis Ship hls...@gmail.com wrote:

 I've been thinking about this kind of thing as well; having a JMX bean
 for each Page instance and tracking number of render requests, number
 of event requests, number of ajax even requests, and ellapsed
 processing time for each.

 Obviously, it's a bit late for 5.2 ... it may be time to cut a 5.3 dev
 branch off the current 5.2 code base.

 On Sun, Oct 10, 2010 at 2:05 PM, Josh Canfield joshcanfi...@gmail.com 
 wrote:
 I'm thinking about rolling my own generic monitoring/statistics solution for
 tapestry 5 and I figured I should see if something is out there already
 before I spent too much time on it.

 This is to be used in production and connected to an external monitoring
 system, probably via JMX, but we might be flexible.

 Anything come to mind?




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


 -
 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



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



Re: Import and Export to .xls in Tapestry 5

2010-03-29 Thread Daniel Jue
IMHO, you should really have an intermediate model (with column
definitions, and a list of rows containing a list of cells)
From there you can pretty much load it into anything (including your
Tapestry Grid).  You're going to want this when you eventually need
cell styles/formatting/borders/etc that are beyond what you need for
the web interface.

I often bring up DynamicJasper as a means of XLS/PDF/CSV export, but
that's just because I like it.  You can also just use JasperReports
(the api) or POI, but some of the details can be scary looking if you
don't need all the options.  DynamicJasper hide that complexity with
sensible defaults for creating a decent looking report.

There are two different XLS exporters available to use with
DynamicJasper/JasperReports
There may be more.


On Mon, Mar 29, 2010 at 7:43 PM, Thiago H. de Paula Figueiredo
thiag...@gmail.com wrote:
 Hi!

 On Mon, 29 Mar 2010 16:55:18 -0300, faye alaska haifeizh...@gmail.com
 wrote:

 Does anyone here have experience of import and exporting to an .xls form
 the grid component in Tapestry5 or point me to a good example?

 The import part would need some library to do the file parsing. Apache has
 one: http://poi.apache.org/spreadsheet/index.html.
 The export part would need some part to generate a .xls you you could just
 output a .csv. I guess POI could help you in this front too.
 Grid can be used to shown anything as long as you pass the data as a List or
 a GridDataSource. This component does no conversion itself.

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



Re: Import and Export to .xls in Tapestry 5

2010-03-29 Thread Daniel Jue
Sorry, for importing I would suggest using POI.

On Mon, Mar 29, 2010 at 8:40 PM, Daniel Jue teamp...@gmail.com wrote:
 IMHO, you should really have an intermediate model (with column
 definitions, and a list of rows containing a list of cells)
 From there you can pretty much load it into anything (including your
 Tapestry Grid).  You're going to want this when you eventually need
 cell styles/formatting/borders/etc that are beyond what you need for
 the web interface.

 I often bring up DynamicJasper as a means of XLS/PDF/CSV export, but
 that's just because I like it.  You can also just use JasperReports
 (the api) or POI, but some of the details can be scary looking if you
 don't need all the options.  DynamicJasper hide that complexity with
 sensible defaults for creating a decent looking report.

 There are two different XLS exporters available to use with
 DynamicJasper/JasperReports
 There may be more.


 On Mon, Mar 29, 2010 at 7:43 PM, Thiago H. de Paula Figueiredo
 thiag...@gmail.com wrote:
 Hi!

 On Mon, 29 Mar 2010 16:55:18 -0300, faye alaska haifeizh...@gmail.com
 wrote:

 Does anyone here have experience of import and exporting to an .xls form
 the grid component in Tapestry5 or point me to a good example?

 The import part would need some library to do the file parsing. Apache has
 one: http://poi.apache.org/spreadsheet/index.html.
 The export part would need some part to generate a .xls you you could just
 output a .csv. I guess POI could help you in this front too.
 Grid can be used to shown anything as long as you pass the data as a List or
 a GridDataSource. This component does no conversion itself.

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



Re: IOC Service Survey

2009-12-02 Thread Daniel Jue
My latest use of IoC was to rewire my DAOs so that they accept a
DbConnectionFactory I @Inject in pages.
When a DAO method is called with an ASO holding a user's DB Connection
info, the injected factory's getConnection() is used.

For some factories, getConnection() will create a small connection
pool as necessary, linked to the user's id and some other stuff.  Then
he can run reports against / select items from one of 160 other
databases that all have the same schema (someone stop the madness!!)

For other factories, getConnection() will use a application wide
connection pool to a central db.

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



Slightly OT: Ad hoc connection pools

2009-10-16 Thread Daniel Jue
Hi all, I'm hoping someone might have a suggestion for a strange
challenge.  I'm using both T5 and GWT for the app, but I imagine the
core solution to be independent of either, although for implementation
T5 IOC may be called in.

OK here it is:
I am working on a web app where the app's server side makes
connections to hundreds of databases.
Yes, that's right.

Use case is like this:
User logs into main app, gets a user ASO, etc.
User can enter their personal login/password info for a database, and
select a database from a list.
(The database list items correspond to some hard coded connection
info, like the machine and port, etc.)
Once the connection info has been verified to work by making a test
connection, the connection info is saved as an ASO.
Then for each request, whatever DAO is being used will create a
connection using the info, do stuff, and then close the connection.
A user can only be logged into one of these databases at a time, and
they can change the settings to log into a different db, etc.
The database username and password is different for each user and each database.
There would probably be about 20 users online on average, with a peak of 100.

Right now I'm making Ad Hoc connections using a handmade jdbc
connection factory, and then i close the connection after each
request.
It's painfully slow and error prone, since the connections sometimes
fail to get created.

What I am wondering about is a way to assign a (small) connection pool
for each user that's logged into the system, which at the very least
would be discarded when they timeout or logout.   Custom use of DBCP?
Custom connection pool?  I'm thinking one or two connections per pool,
because I fear the memory requirements.

I'm using Tomcat, which has a read only JNDI, afaict.

Please let me know if you've faced a problem like this before, or how
you would approach it.

Thanks, Dan

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



Re: A survey about redeployment time in the Java EE world

2009-09-24 Thread Daniel Jue
 And that is for development, for deployment I have a bigger problem because
 it is under Tomcat 6 which is behind AJP fronted by MS IIS.
 And if the application is packaged from maven as a WAR, then all the classes
 are inside packed in a JAR, which Tomcat extracts in a temporary place and
 sometimes is not refreshed even if you bring a newer WAR.
 So I have to stop the application, clean the WAR, clean the extracted
 folders, clean the temp and work folders ...



^
I have exactly this scenario and it's a PITFA.  Another option is to
use eclipse's Export to War feature if you are using WTP.  It
doesn't bundle your classes into a jar first.  There's probably also a
maven option to leave your classes un-jarred, if that saves you time.
(I don't know for sure)

In any case, class reloading and war redeploys have always been harder
than they should be, especially if you're trying to get the tomcat
manager to stop the web app and redeploy.  I have a batch file to
delete the old war and exploded war and copy over the new one.  Then I
start up the service again and it explodes my war.

Daniel

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



Re: Please help

2009-09-24 Thread Daniel Jue
I agree, while the trolls on here tend to use a similar technique to
bring up moot points (especially things that were answered in the
previous few days), we should not jump to conclusions about someone
with a genuinely reluctant team.

Here is a tip: Have the developers who opposed the use of Tapestry
actually used Tapestry?  At all?  Even just building from the
archetype sample should give them a good feel as to whether they want
to spend a part of their life with it.  It's hard to quell the fears
of developers who themselves don't bother to dabble in new
technologies.  As others have pointed out in past threads, it's silly
for us (especially Howard) to put blinders on with regards to new
technologies.  It's much more efficient to incorporate / learn from
the ingenuity of others, rather than just rely on ourselves.

It's like saying I don't want to eat at an Italian restaurant because
their new dishes don't taste great with their old dishes, and I heard
the lead chef was eating at a French restaurant the other day instead
of being locked in his kitchen making new recipes.  So we're gonna go
with Hot Pockets instead.

On Thu, Sep 24, 2009 at 2:43 PM, Howard Lewis Ship hls...@gmail.com wrote:
 It's a little early to start dropping the T bomb.
 I'd like to thank Thiago for his response ... it's dead on.

 Although the upgrade from 5.0 to 5.1 was not quite as seamless as I would
 have liked, for the majority of users it represented a simple switch in
 dependencies, with a number of new features (and speed improvements) for
 free.

 That is the pattern for the future ... 5.2 will add new features and should
 be an even easier upgrade than 5.0 to 5.1.

 Right now stability (the stable 5.1 release) is a good thing.  No version of
 Tapestry, or any other web framework, will ever be complete -- there's
 always more to add, more to refine. There are a few annoyances and gaps in
 5.1 that will be addressed in 5.2 but the best thing I can do for the
 community is work on documentation.

 Right now, I'm a bit busy helping two teams upgrade 4.1 apps to 5.1, and
 doing some additional support besides, not to mention training engagements
 and speaking engagements (NFJS, ApacheCon, Devoxx, with more coming). So
 don't expect me to maintain the level of commits I did leading up to the 5.1
 release!

 In fact, I've been purposefully staying away from coding 5.2, because once I
 get working on the code, it will be that much harder to stay disciplined and
 work on the book.

 On Thu, Sep 24, 2009 at 9:03 AM, Angelo Turetta 
 aturetta+apa...@bestunion.it aturetta%2bapa...@bestunion.it wrote:

 On 24/09/2009 16:40, Gerald Bauer wrote:

 They presented evidence that Tapestry has a bad track record on
 backwards compatibility. They also mentioned that the fact that Tapestry
 is
 a one man project it is too risky to adopt in our company.


 Can you please provide some additional reference about your company, or
 your project.

 I don't know, something tells me we have another email address to add to
 http://wiki.apache.org/tapestry/Tapestry5Trolls

 Angelo.


 -
 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



Re: How coooooooooool is this !!!

2009-09-24 Thread Daniel Jue
Great to hear about your technological metamorphosis!  Let me know
when you make a new Mafia Wars type app. =)
And don't forget to lock down your app, security-wise.

On Thu, Sep 24, 2009 at 4:14 PM, Gunnar Eketrapp
gunnar.eketr...@gmail.com wrote:
 Hi all!

 I started fresh with T5 about a week ago and have some weeks in order to
 transfer a huge existing JSP/Spring-MVC solution to T5.

 The site is a poker site with over 100 pages (most of them dynamic) in 4
 different languages. There is a lot of admin pages and quite complex
 shares and commissioning support pages. I.e. players earn shares by playing
 and by refering other players. On top of this we have the
 integration with the poker network.

 We are upgrading the look and feel of the site completely plus adding casino
 and academy functions.

 I felt that it should be hard to develop/support the site without upgrading
 the technology so I decided to give T5 a shot.
 In the same time I upgraded MySql, Hibernate, Spring, Debian. CVS to SVN.
 Ant to Mvn. And so on ...

 Of course I have undertaken a much too big job and the risk is huge! But
 what the heck! Hacking has never ever been so fun!
 Let's get fired in style!

 T5 is my friend and I am very very much in love with the error page. The
 time that is saved by those lovely precise and concise error messages is
 uncountable!

 If and when i succeed i promise to produce a report on the winnings by
 moving from the jsp/spring-mvc kludge.

 The TapestrySpringFilter let me access all of the existing spring beans with
 just a simple @Inject annotation. And it just works!

 My eyes are bleeding with jsp infection but my heart is full of T5 hope !

 Wish me luck!

 Great Work Folks!

 Gunnar Eketrap,
 Stockholm Sweden


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



Re: Tapestry 6: Famous last words?

2009-06-26 Thread Daniel Jue
Heh..the first release of Windows NT was v3.1, so I guess there is
nothing sacred with version numbers.  Not to mention Sun marketing.
;-)

I imagine once the paradigms shift enough because of new
innovations/evolution of standards, a new product will have to emerge
to support it.  It just won't be named Tapestry. (TapestryNT? Magic
Carpet? Berber? Astroturf?)  I'm talking about far into the future.  I
expect the T5 IOC to live well beyond the web framework portion.

On Fri, Jun 26, 2009 at 4:11 PM, Thiago H. de Paula
Figueiredothiag...@gmail.com wrote:
 Em Fri, 26 Jun 2009 17:03:13 -0300, Michael Gentry mgen...@masslight.net
 escreveu:

 I just felt the need to reiterate that I don't see there ever being a
 T6;...

 Simple: T5.0 = T5.1 = ... = T5.9 = T7.0

 hehehe :)

 Another path would be T5.0 = T5.1 = ... = T5.9 = ... T5.10 ...
 (supposing backward-compatility is kept besides for minor things, of course)
 Or do it the Sun way: T5.0 = T5.1 = ... = T5.4 = ... T9 :P

 --
 Thiago H. de Paula Figueiredo
 Independent Java consultant, developer, and instructor
 http://www.arsmachina.com.br/thiago

 -
 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: How big is the Tapestry community?

2009-06-06 Thread Daniel Jue
Here is my cup 'o coffee estimate...

For people using it professionally, what is their propensity for being
on this official mailing list?  (It's good that there is only one, and
there are not forums dedicated to Tapestry (aside from those that
mirror the mailing list))

M = mailing list population, including lurkers
P = propensity coefficient for users being on the mailing list where 0  P =1
U = number of Tapestry users = M/P

Or

T = median size of a team (# developers)
W = median of team members subscribed to the mailing list where 1 = W = T
U = number of Tapestry users = MT/W

(simpson's paradox here?  maybe)

Or

U = M [sum T*Wt, T=1 to max team size, Wt = propensity for a team
member to be subscribed for team size T, 0Wt1]
'Team' might be better described as the subset of the team working on
the web tier of an application.

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



Re: t5: printing?

2009-05-21 Thread Daniel Jue
I also like Dynamic Jasper, mostly because I find procedurally
generated reports less fragile than using templates.  It does a decent
job and gets the info into the user's hands, and is easier than
straight Jasper Reports.  Also I use the same algorithm to generate
PDF and XLS reports (Dynamic Jasper uses JR underneath).

Most of the solutions I looked into used iText directly or indirectly.


 If your layout demands are very simple DynamicJasper might also be worth a
 look. You don't need xml templates for that but can generate a simple report
 from pure Java.

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



Re: T5: What is NOT beautiful about Tapestry?

2009-04-29 Thread Daniel Jue
I agree, I think this will be a constructive thread.

So things that are not beautiful yet are a lack of tooling, aside from the
helpful Loom plugin.  I only use eclipse here, so I'm not sure if there are
plugins for other IDEs.

Sometimes I wish there were more industry type examples out there, since I
often find myself writing something that is overly verbose.  I find myself
looking at code on http://www.google.com/codesearch .  Maybe a reproduction
of the T4 Showcase app would make a good archetype.

Maven usage used to be a problem for some, but I think most of us have
gotten used to it or have worked around it.

On Wed, Apr 29, 2009 at 4:19 PM, Inge Solvoll inge.tapes...@gmail.comwrote:

 Hi!

 I have been reading the beautiful thread and added my opinion about
 what's
 great about Tapestry. It's nice to sum up why we all are so excited about
 this, it obviously makes both us and the creator(s) feel good about
 ourselves. But for a little while, I challenge us all to stop tapping each
 others' backs and go into depth about what's not to like about our beloved
 framework.

 The most obvious questions that could be asked probably have some very
 obvious answers. But T5, as I see it, is all about addressing stuff that
 other frameworks have given up on and create excellent implementations
 rather than just looking the other way. Difficult and uncomfortable
 questions should be addressed the same way.

 So:

 What are the main reasons that T5 isn't one of the big ones, when we all
 seem to agree that it is so much better than most other frameworks out
 there? Why is T5 NOT beautiful?

 Hope I'm not insulting anyone, I'm a big fan too, I just think this
 actually
 could lead to significant insight :)

 Regards

 Inge



Re: Best practices dev vs. prod configurations?

2009-04-13 Thread Daniel Jue
I was doing this at first, hinging many things on the production mode
symbol.  But things got hairy and I needed more flexibility.
I wanted a central place where settings based on production mode were
being decided, and that was taking place either the app module or a child
module.  Even using a central location to keep things consistent, I ended up
with very verbose code.  Maybe that's just me, but I was trying my best.

Now I have reordered my symbol providers so that it looks in a context.xml
that resides in a separate place from my deployed war.  Those context files
hardly change on production, but for test/development it's nice to flip just
a few switches to turn on certain features in the app.  (I do restart the
app container so the changes take effect)

I probably have 20 to 25 symbols that get looked up by Tapestry for doing
things like displaying cookie values in a grid (as a bean!),
enabling/disabling menu items and certain parts of the app, disabling
regular user logins, and performing startup functions (such as how the app
should behave if it can't connect to the db on startup), etc.

Anyway, it's nice to have

@Inject
@Property(${helpdesk.email}}
private String helpdeskemail

Now a sys-admin can go in there and change the email address, etc, restart
the service and no have to bother me about it.

If it helps any, you can group your production/dev symbols into a similar
area of your context/property file so it's easy to make the changes you
want.

On Mon, Apr 13, 2009 at 4:25 PM, Markus Joschko markus.josc...@gmail.comwrote:

 Hi list,
 I have a couple of settings which are dependent on the environment I am in.
 E.g. pathes that are different on my dev environment compared with the
 prod environment.

 Normally I would use symbols to store the values but I don't want to
 make all of them SystemProperties
 but rather base them on the Production_mode symbol of tapestry. Is
 there a way to specify new symbols which are different based on
 another symbol?
 Or how do you manage these settings?

 Thanks,
  Markus

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




Re: Core dump when debugging @OnEvent methods on Page (JDK 1.6.0_10, Eclipse 3.3.2)

2009-03-30 Thread Daniel Jue
It's 6 months later and I ran into this problem too.  Except that the
breakpoint cause the debugger/tomcat seems to fail/stop in _any_
annotated method, even those using @Log.

Is there a better solution to this problem than delegating to non
annotated methods?

Tomcat 6.0.14, 6.0.18
Tapestry 5.0.18 (Stable)
Eclipse Ganymede, Ganymede SR2
Java 1.6.0_13

i.e. if my breakpoint is inside of Border.setupUser (annotated with only @Log)
I get this in my console:

[DEBUG] Border [ENTER] setupUser()
#
# An unexpected error has been detected by Java Runtime Environment:
#
#  EXCEPTION_ACCESS_VIOLATION (0xc005) at pc=0x6da2d93d, pid=2388, tid=4016
#
# Java VM: Java HotSpot(TM) Client VM (11.3-b02 mixed mode windows-x86)
# Problematic frame:
# V  [jvm.dll+0x17d93d]
#
# An error report file with more information is saved as:
# C:\WINDOWS\Fonts\hs_err_pid2388.log
#
# If you would like to submit a bug report, please visit:
#   http://java.sun.com/webapps/bugreport/crash.jsp
#


On Wed, Oct 22, 2008 at 3:37 PM, Steven Woolley woob...@gmail.com wrote:
 Me too, eclipse 3.1/jdk 1.5 on Mac, thought maybe it was 1.6, i didn't check
 which one eclipse/maven/jetty were using.  It was unpleasant, shall we
 say...Steve

 On Tue, Oct 21, 2008 at 2:29 AM, Stephane Decleire 
 sdecle...@cariboo-networks.com wrote:

 Yes, i've got the same error yesterday on Eclipse 3.3.1.1/jdk1.6.0_03.

 Joel Halbert a écrit :

 Hi,

 Has anyone experienced core dumps when trying to debug T5 Page Event
 handler methods using a 1.6.0_10 jdk, on eclipse 3.3.2 ?
 I keep getting the following dump when my breakpoint is hit :


 #
 # An unexpected error has been detected by Java Runtime Environment:
 #
 #  Internal Error (javaCalls.cpp:38), pid=2564, tid=4068
 *#  Error: guarantee(thread-is_Java_thread(),crucial check - the VM
 thread cannot and must not escape to Java code)*
 #
 # Java VM: Java HotSpot(TM) Client VM (11.0-b15 mixed mode windows-x86)
 # If you would like to submit a bug report, please visit:
 #   http://java.sun.com/webapps/bugreport/crash.jsp
 #

 ---  T H R E A D  ---

 Current thread (0x0cac6400):  VMThread [stack: 0x0cb5,0x0cba]
 [id=4068]

 Stack: [0x0cb5,0x0cba]
 [error occurred during error reporting (printing stack bounds), id
 0x8001]

 VM_Operation (0x0f27e0b4): GenCollectForAllocation, mode: safepoint,
 requested by thread 0x0dca8000



 The full dump is attached (for anyone who is really interested!).

 Thx,
 Joel

 

 -
 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: [OT] By boss decided

2009-02-18 Thread Daniel Jue
Then that would imply that at least the RPC side is still in Java, and
the developer side source code for the GUI is actually Java.

Have you seen that recent article called Competence: Is your boss faking it?
http://www.time.com/time/health/article/0,8599,1878358,00.html

Not to be harsh on your boss...Maybe he thinks Java websites look
like Java applets from 15 years ago.  As far as productivity, well
that depends on the programmer(s).

Daniel


On Wed, Feb 18, 2009 at 7:01 AM, Thiago H. de Paula Figueiredo
thiag...@gmail.com wrote:
 2009/2/18 Otho taa...@googlemail.com:
 Yup, no websites in java. Googlemail doesn't count. And german Telekom and
 Postbank are totally niche companies. :)

 I'm 99.9% sure that Gmail is written in GWT. I had a job interview at
 Google once. I asked if Google was written in GWT. The guy gave me a
 you bastard! you are right, but I can't tell you that! look and told
 me that he couldn't tell me that. :)

 --
 Thiago

 -
 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: How Can I not hardcode value in contributeApplicationDefaults method.

2009-01-28 Thread Daniel Jue
In the case of Tomcat, you can also store these in a Context.xml file,
which can be configured differently for each server (including your
development machine).  The context.xml file can be unique to each
Tomcat instance, and live in Tomcat/conf/context.xml or
Tomcat/conf/Catalina/localhost/context.xml.default

See the docs here:
http://tomcat.apache.org/tomcat-6.0-doc/config/context.html

Then you can do things like this in the xml file:

Context
Environment name=useHTTP type=java.lang.String value=true /
Environment name=PRODUCTION_MODE type=java.lang.String 
value=false /
Environment name=HELP_DESK_EMAIL type=java.lang.String
value=m...@sekritsqrl.gov /
/Context

I read these values in a Module, and set the corresponding values in
the place Tapestry reads it.  For instance, when I read the useHTTP
value it might also force the user to use SSO coming into the app,
besides just changing the metadata locator for the entire app.

You can also put your JNDI resources in this context file, just beware
that you may need to jump through a hoop if you can't have plain text
passwords--Tomcat Realms don't work here.
You at least need the JNDI references in your web.xml, but the actual
configuration can go in the context file.

Daniel
On Thu, Jan 29, 2009 at 12:56 AM, Geoff Callender
geoff.callender.jumpst...@gmail.com wrote:
 Whether you use AppModule.java, app.properties, or web.xml, it's still
 hard-coding. Only constants belong in there.

 Environment-specific properties can be set as system properties before
 starting the server,
 eg. for JBoss on Unix: setenv JAVA_OPTS '-Dtapestry.production-mode=false
 -Dtapestry.compress-whitespace=false'
 eg. for Tomcat in Windows: set JAVA_OPTS=-Dtapestry.production-mode=false
 -Dtapestry.compress-whitespace=false

 Or you can pick them up in the app from a file in the classpath, eg. in the
 JBoss server's conf/ directory or Tomcat's server/lib/ (is that right for
 Tomcat?); with this solution:
 http://wiki.apache.org/tapestry/Tapestry5HowToReadSymbolsFromPropertiesFile

 Geoff

 On 29/01/2009, at 1:06 PM, bongosdude wrote:


 How are about other values like production_mode, cookie age which have
 different values in DEV, QA and Production environments?

 Even put it in the web.xml is not good either? I cannot change web.xml
 when
 we release software to QA and production.

 Thanks
 -B


 Harald Geritzer-2 wrote:


 you can put them into your web.xml file:

 ?xml version=1.0 encoding=UTF-8?
 !DOCTYPE web-app
PUBLIC -//Sun Microsystems, Inc.//DTD Web Application 2.3//EN
http://java.sun.com/dtd/web-app_2_3.dtd;
 web-app
display-nameMyApp/display-name
context-param
param-nametapestry.supported-locales/param-name
param-valuede/param-value
/context-param
 ..
 /web-app

 bongosdude schrieb:

 hardcoded value in AppModule.contributeApplicationDefaults method is not
 a
 best practice.

 class AppModule {
 ..
   public static void contributeApplicationDefaults(
   MappedConfigurationString, String configuration ) {

   configuration.add( SymbolConstants.SUPPORTED_LOCALES, de,en );
   configuration.add( tapestry.default-cookie-max-age, 31536000
 );
   configuration.add( SymbolConstants.PRODUCTION_MODE, false );
   }

 }

 I would like to put those values: PRODUCTION_MODE, cookie-max-age and
 SUPPORTED_LOCALES in a properties file (i.e. app.properties) and then
 get
 the values from that file. So in QA, dev, the value of PRODUCTION_MODE
 should be false, but in production the value should be true.

 How can I inject appropriate value from app.properties file?

 i.e @Inject Message message;

 Thank for any suggestion
 -B



 -
 B Amigo:super:


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





 -
 B Amigo:super:
 --
 View this message in context:
 http://www.nabble.com/How-Can-I-not-hardcode-value-in-contributeApplicationDefaults-method.-tp21716553p21719510.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



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



Re: Tapestry Hibernate configuration

2009-01-26 Thread Daniel Jue
Aside from a purely T5 way of doing it,

*You can also look up a JNDI source, configured in your web.xml and in a
context.xml, and then have a different context.xml on each server you deploy
to.  (This is assuming you can use the same dialect and options.)  I used to
switch back and forth between JavaDB (Derby) and Oracle, but the Oracle
stuff got so hairy I ended up just installing Oracle on a VM so the app
would behave.
You can specify the JNDI source in your hibernate.cfg.xml, etc.  A
server-specific context.xml can live on each app server.  If eclipse tries
to erase your context file, try defining it somewhere else, like a
server.xml or context.xml.default.  (at least in Tomcat)

*I bet you could do all sorts of maven/ant kung-fu packaging different
hibernate configs for different profiles.

*You can use a context.xml type file to store variables that your App
modules can load, for doing such useful things like turning on HTTPS only,
production mode, etc.  Then that over-the-phone-sys-admin can just poke
around the context.xml, instead of in your WAR directory, when the
servername needs to be switched, or a password changes.

Daniel

On Mon, Jan 26, 2009 at 5:38 PM, Howard Lewis Ship hls...@gmail.com wrote:

 You can contribute to the HibernateSessionSource service. Your
 contributions are objects that are used to configure the Hibernate.
 Such objects can decide what mode (production vs. development) you
 are in, and set the correct values for various Hibernate Configuration
 properties.

 On Mon, Jan 26, 2009 at 12:39 PM, Graham Ford grahamjf...@gmail.com
 wrote:
  Hi,
 
  Is there a way of setting the hibernate configuration file for the
  HibernateModule? For example in my src/main/resources I want the config
 to
  point to a live database, but for testing a different database. Is there
 a
  way of doing this, without having to configure hibernate myself and then
  adding it to the HibernateModule?
 
  Thanks,
  Graham
 
  -
  To unsubscribe, e-mail: users-unsubscr...@tapestry.apache.org
  For additional commands, e-mail: users-h...@tapestry.apache.org
 
 



 --
 Howard M. Lewis Ship

 Creator Apache Tapestry and Apache HiveMind

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




Re: [DISCUSS] Should the quickstart archetype include tapestry-hibernate?

2009-01-23 Thread Daniel Jue
I don't think Hibernate should be added in the quickstart.  Just having an
in-memory DAO is good enough, and a wiki page on adding t5-hibernate to the
vanilla (plain) quickstart can be added.

On Fri, Jan 23, 2009 at 10:16 AM, Robert, Brice 
brice.rob...@alliancebernstein.com wrote:

 -- No -- Hibernate dependency

 But sample class using an annotation to access a service DAO that uses
 Mock Objects (Using Spring or Juice) would be great.

 I use:
 - T5 for HTML/CSS/JavaScript,
 - SmartGwt (SmartClient / GWT) for AJAX
 - Spring for DI (Using Annotations)
 - DAO Access through JPA, JMS, JAXB (used to be XmlBeans)
 - DTO Objects are copied from JPA classes or JMS result using
 BeanUtils.copyProperties
 - JPA implementation is either Hibernate or Toplink
 - JMS implementation is either ActiveMQ or WebSphere MQ

 Beauty is, with DAO Access I just can use whatever integration
 (data)layer I need.

 I am now in the process of creating a T5/GWT OSGI bundle for OSGI
 servers (springsource-DM or ServiceMix)
 Goal is to dynamically load and change the UI according to business
 needs -- total separation of concern -- and to finally use cloud/grid
 computing like Amazon and Google. So my customers don't have to waste
 money by buying hardware pretexting Java is too heavy.

 Brice

 -Original Message-
 From: Howard Lewis Ship [mailto:hls...@gmail.com]
 Sent: Thursday, January 22, 2009 7:32 PM
 To: Tapestry users
 Subject: [DISCUSS] Should the quickstart archetype include
 tapestry-hibernate?

 The title says it all.  It would be very easy to include
 tapestry-hibernate as a dependency, and a minimal hibernate.cfg.xml
 file as well.  Thoughts?

 --
 Howard M. Lewis Ship

 Creator Apache Tapestry and Apache HiveMind

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


 ---
 The information contained in the linked e-mail transmission and any
 attachments may be privileged and confidential and is intended only for
 the use of the person(s) named in the linked e-mail transmission. If you
 are not the intended recipient, or an employee or agent responsible for
 delivering this message to the intended recipient, you should not
 review, disseminate, distribute or duplicate this e-mail transmission or
 any attachments. If you are not the intended recipient, please contact
 the sender immediately by reply e-mail and destroy all copies of the
 original message. We do not accept account orders and/or instructions
 related to AllianceBernstein products or services by e-mail, and
 therefore will not be responsible for carrying out such orders and/or
 instructions. The linked e-mail transmission and any attachments are
 provided for informational purposes only and should not be construed in
 any manner as any solicitation or offer to buy or sell any investment
 opportunities or any related financial instruments and should not be
 construed in any manner as a public offer of any investment
 opportunities or any related financial instruments.  If you, as the
 intended recipient of the linked e-mail transmission, the purpose of
 which is to inform and update our clients, prospects and consultants of
 developments relating to our services and products, would not like to
 receive further e-mail correspondence from the sender, please reply
 to the sender indicating your wishes.  Although we attempt to sweep
 e-mail and attachments for viruses, we will not be liable for any
 damages arising from the alteration of the contents of this linked e-mail
 transmission and any attachments by a third party or as a result of any
 virus being passed on. Please note: Trading instructions sent
 electronically to Bernstein shall not be deemed accepted until a
 representative of Bernstein acknowledges receipt electronically or by
 telephone. Comments in the linked e-mail transmission and any
 attachments are part of a larger body of investment analysis. For our
 research reports, which contain information that may be used to
 support investment decisions, and disclosures, see our website at
 www.bernsteinresearch.com.


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




Re: T5 GWT Integration

2009-01-15 Thread Daniel Jue
Thanks!  I hope it's useful.  The one thing that I haven't tried yet is
getting the GWT hosted mode to work in the same project, since that's a
really rapid way of seeing what you're doing.  Also the way the GWT compiler
has to output into the webapp source directory is a little flaky (you have
to refresh eclipse, and maybe even delete the old gwt compiled js code if
the hash is different).  Maybe Maven Assembly could be used.  I'm very happy
with T5 being the parent web app, and just having GWT components.  As much
as the GWT hardliners want to believe it, multi-page web apps are not dead.
:-)

Daniel

On Thu, Jan 15, 2009 at 4:34 AM, Peter Stavrinides 
p.stavrini...@albourne.com wrote:

 Thanks Daniel!!

 I have always been curious about this but shied away as free time is short
 supply these days, so when I get through my TO DO list (only 1 million
 things left), I will give it a bash.

 much appreciated,
 Peter


 - Original Message -
 From: Daniel Jue teamp...@gmail.com
 To: Tapestry users users@tapestry.apache.org
 Sent: Wednesday, 31 December, 2008 10:01:13 PM GMT +02:00 Athens, Beirut,
 Bucharest, Istanbul
 Subject: T5 GWT Integration

 Hi all,

 Happy New Year!

 I have created a new wiki page that shows how to use Tapestry 5 and GWT.
 It's based on the example from Pär Dahlberg's blog, but this time it
 uses Eclipse.  I've kept his package naming in honor if his example.

 Also it uses T5 features to add in the Javascript code, and the code
 is streamlined a bit.
 The example shows multiple entrypoints, and a parent T5 component that
 handles the inclusion of the GWTSupport Javascript loader.

 There is also a screen shot showing a couple buttons and two instances
 of a component that use a GWT service, each acting independently from
 each other.  (Although they auto-refresh at the same time, they could
 be made different)

 The entrypoint that uses a service is called StockWatcher. I'm not
 sure where I got it from, it may have been source code from a book or
 website.  It's been modified slightly so it can be inside a T5
 Component, and works with multiple instances on one page.

 You can find the wiki article here:

 http://wiki.apache.org/tapestry/Tapestry5GWTIntegration

 The source code link is at the top.

 Regards,

 Daniel Jue

 -
 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: dynamic components in page

2009-01-12 Thread Daniel Jue
Hi,

Your wording is a little vague.  You probably want to use the Block
component.  For pages from onEvent, they can be anything, and you can return
Strings or MyPage.class to get to the new page.  For components, you have to
list them in the source of your page class and/or page template.
When you stick them inside a Block tag in your template, they are not
rendered until specified elsewhere.
The ChenilleKit Tab Panel is a good example of using this.

Also look at the Delegate component.
http://tapestry.apache.org/tapestry5/tapestry-core/ref/org/apache/tapestry5/corelib/components/Delegate.html

This is about as Dynamic as it gets, without a fair amount of
warranty-voiding magic.

Static Structure, Dynamic Content


2009/1/12 Radek Terber lst@post.cz

 Hi

 Is there possibility to render components in T5 page dynamically (in
 dependency on return value of any method in page´s class for example,
 or so) ?
 Methods onEvent... return pages whose are rendered dynamically too -
 each method can return many pages. I thing it would be possible allow
 dynamic including components similar way, but i am not able to do it.

 Thanks.

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




Re: Keep It Sweet and Simple

2009-01-07 Thread Daniel Jue
Does AppFuse count?

On Wed, Jan 7, 2009 at 8:31 AM, Sid Ferreira sid@gmail.com wrote:
 Hi all!Few days ago I've met Tapestry in wikipedia... After it, Ive joined
 the #tapestry @ freenode trying to know more about the technology.

 I've been talking with Fanf about how tapestry works and got really
 interested on it, but once Im coming from PHP/Symfony, I obviously found
 some things that I would love to have.

 I can't agree that a powerfull tool must abandon ease of use, so, Im
 wandering:
 Symfony and Ruby have some easy generators... Based in symfony, we can
 really easilly create the basics of a full application in 5 minutes
 (really).
 Using propel, we can (based in a xml/yml file) generate models and database
 with one command in the shell. With another, we can generate the basic CRUD
 module of this model, with basic database connections and queries.

 So, im wandering if is there a way to have it in java?

 Here, a small sample of a blog in symfony

 mkdir demo

 cd projeto

 symfony generate:project Demo

 symfony generate:app frontend

 symfony configure:database dsn=dbname=test host=localhost root null

 in config/schema.yml:

 ===

 propel:

  posts:

id: ~

text: { type: longvarchar }

created_at: ~

  comments:

id: ~

post_id: { type: integer, foreignTable: posts, foreignColumn: id,
 required: true }

email: { type: varchar(64) }

comment: { type: varchar(256) }

created_at: ~

 ===

 symfony propel:build-all

 symfony propel:generate-module frontend posts Posts

 symfony propel:generate-module frontend comments Comments

 in apps/frontend/config/routing.yml: the module in homepage change from
 default to posts

 symfony cc

 localhost/demo/web


 It's not tested, but create database connections, crud, models and stuff.
 Pretty easy... Do Tapestry offer something like that?

 Thanks.


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



T5 GWT Integration

2008-12-31 Thread Daniel Jue
Hi all,

Happy New Year!

I have created a new wiki page that shows how to use Tapestry 5 and GWT.
It's based on the example from Pär Dahlberg's blog, but this time it
uses Eclipse.  I've kept his package naming in honor if his example.

Also it uses T5 features to add in the Javascript code, and the code
is streamlined a bit.
The example shows multiple entrypoints, and a parent T5 component that
handles the inclusion of the GWTSupport Javascript loader.

There is also a screen shot showing a couple buttons and two instances
of a component that use a GWT service, each acting independently from
each other.  (Although they auto-refresh at the same time, they could
be made different)

The entrypoint that uses a service is called StockWatcher. I'm not
sure where I got it from, it may have been source code from a book or
website.  It's been modified slightly so it can be inside a T5
Component, and works with multiple instances on one page.

You can find the wiki article here:

http://wiki.apache.org/tapestry/Tapestry5GWTIntegration

The source code link is at the top.

Regards,

Daniel Jue

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



Re: Persistance

2008-12-12 Thread Daniel Jue
In the past I manually implemented this behavior by mixing server side and
client side persistence.  My code-fu was probably not very elegant.

In my case, a user could open a report page after filling out a page of
variables.  These report pages would open in a new browser window/tab. So
instantly you have the situation where two reports can be open but use
different data.  I would store a client side string on each report page, and
LRU hash map on the ASO side would match it to the relative data, just
before the report was run and a new page opened.  If it was in the LRU, I
could grab the cached report.  If not, I still had enough information to run
the report again.  If the report page needed to be refreshed (such as
sorting something on the page, non-async), the client side key would look up
the data.

I used a small LRU limit (like 5) to keep the size down.

Daniel

On Fri, Nov 28, 2008 at 10:18 PM, thermus msch...@gmail.com wrote:


 I'm interested in this as well.  Specifically if a user has two page
 instances open, how can T5 persistence be used reliably?

 I found on Safari and Firefox (not sure about IE, but likely a problem
 there
 as well) that the persisted session properties are shared between page
 instances and each page can overwrite the another.  My searches didn't come
 up with a definitive answer although I did see that the question has been
 asked several times.  Can anyone comment on this or provide a workaround?



 Peter Stavrinides wrote:
 
  ... but what would be ideal in my humble view is a proper page
 persistence
  Strategy, where a value is retained until the user leaves the page. In
  truth someone posted such a solution which used a cookie, and it seemed
 to
  behave exactly as it should, nevertheless I am still against relying on a
  cookie. I understand this may be difficult to implement due to Tapestry's
  inner workings, particularly the way pages are pooled, but since
  conversational state covers some of this ground (the difference being a
  conversation is tied to not only the page, but the window so each tab is
  treated as a new conversation)...
 

 --
 View this message in context:
 http://www.nabble.com/Persistance-tp20732003p20743522.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: AW: AW: Advantages of various .tml storage locations?

2008-12-11 Thread Daniel Jue
+1 to that.  I have also been using the src/main/resources dir since cutting
my teeth with Maven and T5.  The Tapestry related directories there mirror
the packages under src/main/java, for both page classes and component
classes.
In eclipse the src/main/java and src/main/resources are both listed as
source directories, so the tml files will get copied out to the same
location as the .class files.  (I think this works just using the Eclipse
java builder, and may not even need the maven builder)

The Loom plugin for Eclipse/T5 supports this structure.

On Thu, Dec 11, 2008 at 7:26 AM, Otho [EMAIL PROTECTED] wrote:

 Uhm... I use the resource folder since the beginning of dabbling around
 with
 Tap5 and never had any issues. In fact it's the first thing I do when
 creating a new app via the archetype to create the packages under the
 resource directory and moving Index.tml there.



Re: Global (application state) data

2008-11-24 Thread Daniel Jue
On Mon, Nov 24, 2008 at 1:55 PM,  [EMAIL PROTECTED] wrote:
 What about an IOC singleton service? Would that work?

Yes, a singleton should work, and may very well use static modifiers
in it's definition.

-
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]



Re: Tapestry 5.0.16 (Release Candidate) now available

2008-11-18 Thread Daniel Jue
Thanks to everyone involved in getting T5 to this point--

To Howard, for having the courage to break with tradition and making T5
radically different;
To all the participants on the Tapestry Users list who have helped others,
submitted and fix bugs in JIRA.
And to all the 3rd party libraries and frameworks T5 borrows from and builds
on.

On Tue, Nov 18, 2008 at 11:51 AM, Howard Lewis Ship [EMAIL PROTECTED]wrote:

  The latest release of Tapestry, Tapestry 5.0.16 (Release Candidate),
 is now available.

 Tapestry 5.0.16 is the release candidate; we encourage users to
 download this version. In about a month, the Tapestry PMC will run a
 vote to grant it release status, barring any blocker bugs (critical
 bugs with no workaround).

 In the two months since the previous release, we've addressed over 80
 issues, including many bugs and a few last minute improvements. New
 features include a LinkSubmit component (dearly missed from Tapestry
 4), new support for reporting Ajax errors on the client side, smarter
 client-side validation, support for several new locales, and much new
 documentation.




 With a release candidate out, and a final release reasonably immanent
 (that is, 5.0.16 will likely be the final release as well) it's time
 to start publicizing Tapestry.  Any of you who blog should start
 blogging about Tapestry 5. Anybody who has thought of speaking to a
 Java User's Group: now's a good time, and help in presenting is
 available. Now that 5.0 is effectively a done deal, it's time to start
 making the Java world more aware of what Tapestry has to offer!


 --
 Howard M. Lewis Ship

 Creator Apache Tapestry and Apache HiveMind

 -
 To unsubscribe, e-mail: [EMAIL PROTECTED]
 For additional commands, e-mail: [EMAIL PROTECTED]




Re: T5: @ApplicationState is misleading - voters wanted!

2008-11-05 Thread Daniel Jue
Good Suggestion for ApplicationSessionObject.

I usually don't like it when such a commonly used feature is changed this
late in the game.
My suggestion would be to have the old annotation deprecated for a while,
with the new Annotation in place.

Furthermore, if a new annotation for Application State is created, don't
re-use the old name!

On Wed, Nov 5, 2008 at 12:04 PM, César Lesc [EMAIL PROTECTED] wrote:

 I think we must support both @ApplicationStateObject and the new
 annotation, but i suggest not to change de acronym ASO because is so
 widely used that would break a lot of useful searchs and is a common
 lingo in tapestry, so the new annotation may be
 @ApplicationSessionObject.

 César.

 -
 To unsubscribe, e-mail: [EMAIL PROTECTED]
 For additional commands, e-mail: [EMAIL PROTECTED]




Re: Why would you use a web framework?

2008-11-05 Thread Daniel Jue
Also consider the Hit by a bus factor.  We recently had this issue come up
at my company, although it was a metaphorical bus.
Do not expect the people designing your app now to be around in the future
or even 6 months from now.  So pick something that is maintainable and can
be picked up by a junior to mid-level programmer.

If you want something that is more heavily client side (lots of JS) and
handles browser quirks and localization well, GWT is also an option.

For reports and exporting, I've had great success with DynamicJasper
(JasperReports+a layer of simplifying sugar) and T5.  The DynamicJasper demo
uses GWT.

Also, are you serious about using C?  As in the language C, with no garbage
collector?  I think that's one too many hurdles, even for a pro-level team.

Why use a web framework?  They exist because they solve the hard problems.
This is the same reason you'd use standard libraries--no sensible person
wants to write things from scratch.  In fact, I would argue that higher
level frameworks (like web frameworks and ORMs) are OOP on a library level.
If you're developers don't respect the benefits of OOP, this project will
only end in pain and suffering.  If they have evolved to something beyond
OOP, you wouldn't have mentioned C.  It sounds like your developers grew up
programming machine language.

On Wed, Nov 5, 2008 at 12:28 PM, devilabit [EMAIL PROTECTED] wrote:



 I apologize in advance if this is a little off topic.

 I recently started work for a new company and they are looking at moving
 some of their desktop apps to web apps.  I have been tasked with
 investigating how we would go about this.  The web app in question will
 need
 a rich interface but I would not consider it a Rich Internet Application.
 Without going into too much detail this app will be used to search a large
 archive and display the results. A user can drill down into these results
 and apply filters client side. Additionally it will be necessary to save
 searches, tag, rate, comment on results and export to PDF/word etc. The
 look
 and feel will be familiar to something like outlook web access.

 Now this to me sounds like a normal web app with some extra bits of
 JavaScript to make it feel like a desktop app.  Thats why I started to
 consider Tapestry5.  We could build our own custom widgets and reuse would
 be easy.

 However the architecture that the developers here have in mind is to write
 everything client side in javascript and html and use our own custom web
 server to serve the application. Communication is JSON over http.  The idea
 is to write our own custom modules for the web server to handle things like
 saving searches, tagging, templates, ajax.  This architecture doesnt even
 consider the concept of a web application, its built more around the idea
 of
 a an ajax request going to the ajax module as an example.  It like a C
 design a web app.  Even the document structure will require us to have a
 separate version for each localized html page instead of having one master
 version and a properties file.  For now they have a couple of simple web
 apps using this design.  However I feel that for feature rich web
 applications with a lot of functionality we will need to write many custom
 modules(things that come for free in tapestry like template's, components,
 client/server side validation) and it will be a nightmare to develop and
 maintain.  Eventually after a long difficult struggle we will end up having
 written our own web framework written in C with little library support(no
 tool support) that is not as good as a mature framework thats taken a web
 framework expert 2 and half years to write.  Productivity will be low, the
 company will have to hire many more people and these will be expensive
 because they will have to be C and JavaScript gurus!

 I dont think the people here really understand the concept of a web
 application and how much work it takes to develop one.  Its difficult to
 change peoples ideas when your new and have yet to earn your colleagues
 respect so thats why I need your help. My question is how do I sell them
 the
 idea of using a web framework?  Any comments, suggestions, arguments,
 links,
 advantages/disadvantages to using web frameworks etc would be very welcome.

 Thanks.
 --
 View this message in context:
 http://www.nabble.com/Why-would-you-use-a-web-framework--tp20343460p20343460.html
 Sent from the Tapestry - User mailing list archive at Nabble.com.


 -
 To unsubscribe, e-mail: [EMAIL PROTECTED]
 For additional commands, e-mail: [EMAIL PROTECTED]




Re: Session bleedings in Tapestry5

2008-10-20 Thread Daniel Jue
I've also never come across this kind of problem.  It would be
interesting to see the code that caused what the developer said was
happening.
As others have suggested, it's easy to do this if you are using
statics (or if your private vars get initialized by statics in the
setup phase).


On Mon, Oct 20, 2008 at 8:41 AM, Peter Stavrinides
[EMAIL PROTECTED] wrote:
 I have never come across such a problem either, and we have done a lot of 
 testing for this. Your problem sounds like it has little to do with the 
 session and more to do with page pooling, i.e.: how you initialize your 
 pages. The golden rule there is that your fields must always be private, and 
 then should be referenced by public accessors, having a public field in a 
 page is like using a static variable which may explain your problem.

 --
 If you are not an intended recipient of this e-mail, please notify the 
 sender, delete it and do not read, act upon, print, disclose, copy, retain or 
 redistribute it. Please visit http://www.albourne.com/email.html for 
 important additional terms relating to this e-mail.

 - Original Message -
 From: [EMAIL PROTECTED]
 To: users@tapestry.apache.org
 Sent: Monday, 20 October, 2008 2:53:17 PM GMT +02:00 Athens, Beirut, 
 Bucharest, Istanbul
 Subject: Re: Session bleedings in Tapestry5

 I quote from a chat protocol with a developer:

 Take for eg, if there are 10 users at present using our website, then first 
 user clicks  on 1st page, and 5th user clicks on 2nd page, and 3 rd person 
 clicks on 3 page and using it.
 And if the user 1 is clcked on 8 page at that time user 3 want to goto 
 another page say 5, then he also gets 8 instead of 5. As first user requested 
 that page. :( 


  Original-Nachricht 
 Datum: Mon, 20 Oct 2008 13:32:16 +0200
 Von: Tobias Wehrum [EMAIL PROTECTED]
 An: Tapestry users users@tapestry.apache.org
 Betreff: Re: Session bleedings in Tapestry5

 Hello namesake,

 Since I've never heared about this too, I searched the Mailing List and
 JIRA and didn't find any issue which you could've meant.
 Where did you hear that?

 - Tobias

 [EMAIL PROTECTED] schrieb:
  I have heard there are some issues with Session bleedings in
 Tapestry5.
 
  Will those issues be fixed by November?
 
  I would like to go live with a T5 application by November/December
 
  Thanks!
 
  Tobias
 
  -
  To unsubscribe, e-mail: [EMAIL PROTECTED]
  For additional commands, e-mail: [EMAIL PROTECTED]
 
 


 -
 To unsubscribe, e-mail: [EMAIL PROTECTED]
 For additional commands, e-mail: [EMAIL PROTECTED]

 -
 To unsubscribe, e-mail: [EMAIL PROTECTED]
 For additional commands, e-mail: [EMAIL PROTECTED]


 -
 To unsubscribe, e-mail: [EMAIL PROTECTED]
 For additional commands, e-mail: [EMAIL PROTECTED]



-
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]



Fwd: [Comment] Re: Tapestry 5 and GWT - part 2

2008-10-08 Thread Daniel Jue
Pär Dahlberg has added the source code link to his article on T5 and
GWT using the NetBeans IDE.

Daniel

-- Forwarded message --
From: pmd/blog [EMAIL PROTECTED]
Date: Wed, Oct 8, 2008 at 6:03 PM
Subject: [Comment] Re: Tapestry 5 and GWT - part 2
To: [EMAIL PROTECTED]


Comment from Pär Dahlberg on 09 Oct 2008 00:03:56 CEST in response to
Tapestry 5 and GWT - part 2

Source is available here now:
http://www.pmdit.se/blog/2008/10/08/tapestry_5_and_gwt_part_2_5.html
Thanks for pointing out that the Google cache link was dead. I've
updated it with the Internet Archive instead.

Permalink | Opt-out

-
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]



Re: October release for v5?

2008-10-07 Thread Daniel Jue
Currently, 5.0.15 is a good one to start with.  You can get a head start on
developing now, and when the production version comes out your changes
should be minimal to none, depending on how deep you get into it.  It seems
class and package name changes are done, and that was the most disruptive
change that I've had in the last few months --it was fixed with a
find/replace.

Don't forget to look at the 3rd party libraries that are being developed
along side T5 versions.  In particular, I make use of Sven Homburg's T5
Components.  They may keep you from reinventing the wheel, and the
components are a bit simpler than say, T5's Grid component.
http://213.160.23.119:8080/t5components/

Daniel

On Tue, Oct 7, 2008 at 9:30 AM, Jonathan Barker [EMAIL PROTECTED]
 wrote:


 I've had production apps in place since 5.0.5.  Actually, I have one
 that's
 still running on 5.0.5.

 Anything I have in active development just follows the most current
 release,
 or snapshot.  Hop on the bandwagon.  If you are looking to move, there's no
 time like the present.

 Jonathan


  -Original Message-
  From: Joel Halbert [mailto:[EMAIL PROTECTED]
  Sent: Tuesday, October 07, 2008 07:59
  To: users@tapestry.apache.org
  Subject: October release for v5?
 
  Hi Tapestry Community,
 
  Apologies if this question has been answered elsewhere many times, but I
  wanted to get a feel for when the final production ready release of
  Tapestry 5 might be available? Is this still scheduled for October?
  (I've been keenly anticipating Tapestry 5 since May, currently we use
  Wicket but I'm frustrated with the hoops that developers must jump
  through to build stateless pages in Wicket).
 
  I get the feeling that the current 5.0.15 is a good version to develop
  against for the time being? Can anyone confirm this?
 
  Thanks,
 
  Joel
 
  --
  SU3 Analytics Ltd
  61b Oxford Gardens
  W10 5UJ
  London
 
  Tel: +44 20 8960 2634
  Mob: +44 75 2501 0825
  www.su3analytics.com
 
  SU3 Analytics Ltd is a company registered in England and Wales under
  company number 06639473 at registered address 61b Oxford Gardens, London
  W10 5UJ, United Kingdom.
 
 
 
  -
  To unsubscribe, e-mail: [EMAIL PROTECTED]
  For additional commands, e-mail: [EMAIL PROTECTED]


 -
 To unsubscribe, e-mail: [EMAIL PROTECTED]
 For additional commands, e-mail: [EMAIL PROTECTED]




Re: My Tapestry5 suggestion list

2008-10-02 Thread Daniel Jue
On Wed, Oct 1, 2008 at 4:38 AM, Tobias Marx [EMAIL PROTECTED] wrote:

 Hi there!

 Here is my list of Tapestry5 suggestions:


 Tapestry5 Suggestions:

 1. User .tpl instead of .tml. This way there is also no problem with syntax
 highlighting in most editors.


We already voted a while back to change the templates from .html to .tml, so
there would be no conflicts with other file extensions, and you can
associate the editor for Tapestry templates vs static html.  I think there
was another, more professional sounding reason, but that's the one that
mattered to me.  It's up to you to make the file associations work in your
IDE, I see no reason to change it again unless you are Rob Smeets. ;-)

2.  Make those templates compatible with SSI templates.

This is because most HTMLers will slice PSD files to SSI templates.
This way, they could directly be used in a Tapestry project


If the SSI code that is generated is valid XML, it may make it easy to wrap
with a T5 dtd and call it done.  It seems that T5 goes above and beyond what
SSI can do. You would want to change all absolute or relative links to media
in the SSI code to use a T5 calculated path to the Asset (done by Injecting
the asset in the page/component class).  You could make it work with the
links as is, it will just be fragile like a 1990's web page.  Note that any
repeated use of the SSI (which is it's strength) is handled by making that
collection of items a component, which can then be added to any page.

If enough people use it, it may meet HLS's requirement of Developers
First.




 3. Make the Layout component the default component that is always used if
 not otherwise specified.
This saves 2 lines of code in all page templates.


IMHO, It doesn't save any lines, and just makes more majic for little
benefit.  The line that lists your DTD can be used to include your layout or
border, and I have multiple border type components for different sets of
pages.  Having one default is just an extra caveat for newcomers.




 4.  Allow the use of templates without having to have a corresponding Java
 class for it.
 Otherwise you  to generate tons of stupid empty Java classes.


This might be useful, say if you have a bunch of help pages or static text.
The converse is true--Java classes don't need a corresponding tml in order
to be useful.  If the Loom plugin could be modified to auto create the dummy
class for you, then that would help speed things up.  One caveat is that
html files don't have the naming restrictions that Java classes do.  For now
I'm happy having the 1kB .class files.  I usually end up injecting images or
css anyway.






 What do you think?

 Thanks!

 Toby

 -
 To unsubscribe, e-mail: [EMAIL PROTECTED]
 For additional commands, e-mail: [EMAIL PROTECTED]




T5 OnException or page redirection fails when using Grid inPlace

2008-09-25 Thread Daniel Jue
Using T5.0.14

Just found this after a couple hours.

Case:

User Logs on login page, user ASO created
Page with Grid is rendered, using inPlace, all is well.
User session times out, or logs out in another window. (doesn't matter
which)
User clicks on a sort button on the Grid, and the page hosting the grid
requires the user session.

We expect that the page with a grid would allow redirection to the login
page, but when using inPlace, we get a  Page must be specified before root
render command. error when an onActivate or onException page redirection
occurs.

We actually get the same page, with no changes.

[DEBUG] BaseReportPage [ EXIT] onActivate
[EMAIL PROTECTED]
[DEBUG] SOCMPPage Dispatch event: ComponentEvent[exception from (self)]
[INFO] TimingFilter Request time: 15 ms
[ERROR] RequestExceptionHandler Processing of request failed with uncaught
exception: Page must be specified before root render command.
org.apache.tapestry5.runtime.ComponentEventException: Page must be specified
before root render command.
at
org.apache.tapestry5.internal.structure.ComponentPageElementImpl.triggerContextEvent(ComponentPageElementImpl.java:1054)
at
org.apache.tapestry5.internal.services.AjaxComponentEventRequestHandler.handle(AjaxComponentEventRequestHandler.java:68)
at
$ComponentEventRequestHandler_11c9acea066.handle($ComponentEventRequestHandler_11c9acea066.java)
at
org.apache.tapestry5.internal.services.AjaxFilter.handle(AjaxFilter.java:42)
at
$ComponentEventRequestHandler_11c9acea067.handle($ComponentEventRequestHandler_11c9acea067.java)
at
org.apache.tapestry5.services.TapestryModule$38.handle(TapestryModule.java:1974)
at
$ComponentEventRequestHandler_11c9acea067.handle($ComponentEventRequestHandler_11c9acea067.java)
at
$ComponentEventRequestHandler_11c9ace9e6d.handle($ComponentEventRequestHandler_11c9ace9e6d.java)
at
org.apache.tapestry5.internal.services.ComponentEventDispatcher.dispatch(ComponentEventDispatcher.java:130)
at $Dispatcher_11c9ace9e6f.dispatch($Dispatcher_11c9ace9e6f.java)
at $Dispatcher_11c9ace9e60.dispatch($Dispatcher_11c9ace9e60.java)
at
org.apache.tapestry5.services.TapestryModule$13.service(TapestryModule.java:953)
...


Re: T5: Ajax Examples/Tutorials

2008-09-22 Thread Daniel Jue
These are listed on the Tapestry web page and in the Tapestry 5 wiki.

Here is a 3rd party library demo:
http://87.193.218.134:8080/t5c-demo/


On Mon, Sep 22, 2008 at 10:16 AM, James Sherwood [EMAIL PROTECTED]
 wrote:

 Hello,

 I was wondering if anyone knew of any good ajax Examples/Tutorials with T5?

 Things such as text fields that do not require form submits to change data.

 Thanks in advance,
 --James


Re: Integration with GWT

2008-09-22 Thread Daniel Jue
I am also interested in a basic but complete tutorial on using GWT in T5.
Anyone want to share some sample setup/source code or give some pointers?

On Sun, Sep 21, 2008 at 1:13 PM, Alexey Frishman
[EMAIL PROTECTED]wrote:

 Hi,

 I use T5 in my project as main web framework. The project itself is a sort
 of simple web GIS, based on Google Maps. There is great widget library for
 GWT to serve Google Maps with all their AJAX stuff, so I decided to use it
 also.

 Please, give me some information whether it's possible to integrate full
 lifecycle of GWT component with T5 as main framework? What I actually need
 is to be able to share some objects between Tapestry and GWT, but without
 page reload. So my GWT component should make its RPCs as usual, but these
 calls should be made after pressing button in Tapestry component and
 information should be got from that component too (@ApplicationState may
 be,
 but how to integrate it with GWT?)



Re: T5: Using Maven and recent version of Eclipse?

2008-09-16 Thread Daniel Jue
A few of us here are using Eclipse Ganymede (the largest, J2ee version).  It
has the bells and whistles of WTP, and takes some of the pain out of getting
compatible plugins.
You can add the m2Eclipse plugin in the standard eclipse way, from this
update site:
http://m2eclipse.codehaus.org/update/
I'm on 0.0.12., and I haven't needed to update since I installed it
months ago.

The wiki is still a great place to look on configuration, even though some
of it is out-dated.


On Tue, Sep 16, 2008 at 3:03 PM, Rick Gruber-Riemer [EMAIL PROTECTED]wrote:

 Hi

 I am soon going crazy about my environment setup. So I would like to know
 whether anyone is successfully using one of the version below (eventually
 not all of them)
 # Eclipse 3.4
 # WTP 3.0
 # m2eclipse 0.0.12

 Or should I just stick to the setup in
 http://tapestry.apache.org/tapestry5/tutorial1/env.html as a save bet,
 because the most recent version probably just do not work?



T5 Persistence issue appears when using Firefox with YSlow

2008-09-03 Thread Daniel Jue
This is really weird and I've spend all day trying to fix it.  I believe
this started a couple days ago.

I noticed that my Tapestry-acegi interception code started asking me to
reauthenticate on every page navigation to a new page, or form submission.

Then I noticed my grid tables columns could only be sorted in ascending
order, and only once--after the first sort on that column I could not
reverse the sort.  Sorting on another column would sort that column in
ascending order, and so on.

Here is what I've tried:
I've tried stopping Tomcat and deleting all the deployed stuff, then
redeploying.

Since I have a funky custom Grid Model and Grid Source in most of my app, I
copied over the very basic Grid sample from here:
http://tapestry.apache.org/tapestry5/tapestry-core/ref/org/apache/tapestry5/corelib/components/Grid.html

Except instead of using a DAO, I made a method in the page class:

private ArrayListListableObject getAll() {
ArrayListListableObject lo = new ArrayListListableObject();
for (int i = 0; i  10; i++) {
lo.add(new ListableObject(i, Name + i, 5 * i, Name2 + i));
}
return lo;
}

(I also renamed the tutorial's User class to ListableObject, since I already
have a user class)



What is really strange is that I'm not getting this problem if I use the
IEtab plugin inside Firefox, which makes IE render the tab.


Update:
I seemed to have narrowed down the reason, and I can see my sanity at the
end of the tunnel!  I had the Yahoo YSlow plugin on Autorun, and that seemed
to be the cause of all this.  Now that I've disabled the Autorun feature of
YSlow, the site loads much faster and the problem instantly disappeared!

-Daniel


Re: T5: pagelink

2008-08-06 Thread Daniel Jue
You could also change the default HTTPS port in your app server
configuration, and then your don't have to worry about modifying the
URIs.  The default is of course 443.

The https:// protocol can be used in exactly the same way as the
http:// protocol.
The differences are that HTTPS uses a default port number of 443 (80
for HTTP) and that
HTTPS automatically performs SSL negotiation and thus always sends
data in encrypted form,
i.e. web servers accessed through https:// have to be secure web servers.

For me, my development is always HTTP, and the deployed is always
using HTTPS (for everything)
So in the module that contributes these settings (for most people
that's the AppModule), I look up a value stored in the local JNDI
which tells me if I should use https or not

public void contributeMetaDataLocator(MappedConfigurationString,String
configuration)
{
  if(thisIsDeploymentServer())
  {
configuration.put(TapestryConstants.SECURE_PAGE, true);
  }
}

On Tue, Aug 5, 2008 at 11:35 PM, tapestry5 [EMAIL PROTECTED] wrote:

 I have the same issue. I tried using it.
 It won't open the landing page. Infact if i don't put @Secure and also donot
 contribute it opens the landing page as https and further the links were
 http.

 Even if i make it work but still contributeAlias is good for testing but not
 for production.

 Is there any other way to get https and not http.

 As my page can be used for http and https. So if i put @Secure then it won't
 work for any http call.



 9902468 wrote:
 
  Hi,
 
  Use @Secure annotation and add this to your appmodule: (Also use whatever
  ports you wish.)
 
  public void contributeAlias(ConfigurationAliasContribution
  configuration)
  {
  BaseURLSource source = new BaseURLSource()
  {
  public String getBaseURL(boolean secure)
  {
  String protocol = secure ? https : http;
 
  int port = secure ? 443 : 80;
 
  if(port == 80 || port == 443){
  return String.format(%s://localhost, protocol);
  }
 
  return String.format(%s://localhost:%d, protocol, port);
  }
  };
 
  configuration.add(AliasContribution.create(BaseURLSource.class,
  source));
  }
 
 
 
  Argo Vilberg wrote:
 
  hi,
 
 
  I want use pagelink with port 8443 and https protocol.
 
  If i use:
  t:pagelink page=Start context=currentRole.roleId
  ${currentRole.roleName}
  /t:pagelink
 
  then tapestry generate
  http://localhost/app/start/4
 
 
  But i want
  https://localhost:8443/app/start4
 
 
  Argo
 
 
 
 

 --
 View this message in context: 
 http://www.nabble.com/T5%3A-pagelink-tp18796163p18843725.html
 Sent from the Tapestry - User mailing list archive at Nabble.com.


 -
 To unsubscribe, e-mail: [EMAIL PROTECTED]
 For additional commands, e-mail: [EMAIL PROTECTED]


-
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]



  1   2   3   4   >