Question tapestry service

2012-08-18 Thread George Christman
I have a few questions about the tapestry services. I'd like to be able to
Inject services in these classes, however I'm a little confused. I
understand if you want to be able to Inject a service, you must first bind
the service in the app module. However, I'm not sure if I would need to
first bind the class I'm trying to Inject the service into. 

I'm also uncertain how I would go about binding an abstract class like
below, or is it inherited from the base class. 

Lastly is there away to setup an entire package to work with services like
tapestry pages and components work without having to bind every class within
the task. Perhaps my understanding isn't completely clear. 

A few classes and some sample code below to hopefully help clarify what I'm
trying to do. 

Thanks. 

public class DMSImport {

Parser parser = DMSFactory.getParser(value1, value2, value3);

}

 public abstract class Parser {

@Inject
private VehicleDAO vehicleDAO;

public Parser(String value1, String value2, String value3) {
//Sets attributes
vehicleDAO.setVehicle(value1);
}

 protected abstract void parse(Reader dataReader, ParserCallback
callback) throws IOException;

}

public class AutoMateParser extends Parser {
public AutoMateParser (String  value1, String value2, String value3) {
super(value1, value3, value3);
}

protected void parse(Reader dataReader, ParserCallback callback) throws
IOException {
//some code
}
}

public class DMSFactory {

public static Parser getParser(String value1, String value2, String
value3) {
switch (dms) {
case DatabaseConstants.INTEGRATION_IMPORTSYSTEM_AUTOMATE:
return new AutoMateParser(value1, value2, value3);
case 
//many other parsers that are setup identical to the
AutoMateParser
 }
}
}



--
View this message in context: 
http://tapestry.1045711.n5.nabble.com/Question-tapestry-service-tp5715573.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



[ANN] Version 1.9 of tapestry-breadcrumbs is released

2012-08-18 Thread Joakim Olsson
Hi,

Just wanted to mention that I have released version 1.9 of
tapestry-breadcrumbs and it should be available from Maven Central
within an hour or so.

New in this version:
- Changed from using Referrer-header to actually keep track of all
page requests to the application.
- Possibility to change the title of a crumb from within the page by
adding @SessionState BreadCrumbList breadCrumbList and then in one of
the render-methods do breadCrumbList.getLastCrumb().setTitle("") (thanks to Barry Books)
- Fixed concurrency issues during high load (thanks to Nelson Rodrigues)
- Fixed issue with dispatcher not always being called.

See https://github.com/argoyle/tapestry-breadcrumbs for usage instructions.

Regards,
Joakim

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



Re: Dispatcher not always called

2012-08-18 Thread Joakim Olsson
Hi again,

After some more investigation I've found out that I obviously is
unable to read written documentation. :-)

The ordering constraints should not be one string like this
"after:ComponentEvent,before:PageRender" but rather two strings like
"after:ComponentEvent", "before:PageRender".

Sorry about the noise. :-) Hopefully it helps someone else.

Regards,
Joakim


On Sat, Aug 18, 2012 at 7:51 PM, Joakim Olsson  wrote:
> Hi,
>
> For some time now I (and other users of my tapestry-breadcrumbs
> module) have seen issues with my BreadCrumbDispatcher not always being
> called.
>
> I took some time now to try to find out what the reason is.
>
> I'm adding my dispatcher between the ComponentEvent and PageRender
> dispatchers since I'm really only interested in the page render
> requests.
>
> I can see that my module is called and my dispatcher is successfully
> contributed to the MasterDispatcher but when the requests are being
> processed I can see that the ComponentEventDispatcher receives the
> request and then the PageRenderDispatcher but my BreadCrumbDispatcher
> gets no call.
>
> The orderables in the OrderedConfiguration looks like this after my
> dispatcher has been contributed (according to the Eclipse debugger at
> least):
> [Orderable[RootPath before:Asset
> org.apache.tapestry5.internal.services.RootPathDispatcher@199d4a86],
> Orderable[Asset before:ComponentEvent  AssetDispatcher(org.apache.tapestry5.services.Dispatcher)>],
> Orderable[ComponentEvent before:PageRender
> org.apache.tapestry5.internal.services.ComponentEventDispatcher@2587b08d],
> Orderable[PageRender after:ComponentEvent
> org.apache.tapestry5.internal.services.PageRenderDispatcher@6f580c3a],
> Orderable[BreadCrumbDispatcher after:ComponentEvent,before:PageRender
> se.unbound.tapestry.breadcrumbs.BreadCrumbDispatcher@2bca029b]]
>
> Anyone have any idea why my dispatcher is not called?
>
> Regards,
> Joakim

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



Dispatcher not always called

2012-08-18 Thread Joakim Olsson
Hi,

For some time now I (and other users of my tapestry-breadcrumbs
module) have seen issues with my BreadCrumbDispatcher not always being
called.

I took some time now to try to find out what the reason is.

I'm adding my dispatcher between the ComponentEvent and PageRender
dispatchers since I'm really only interested in the page render
requests.

I can see that my module is called and my dispatcher is successfully
contributed to the MasterDispatcher but when the requests are being
processed I can see that the ComponentEventDispatcher receives the
request and then the PageRenderDispatcher but my BreadCrumbDispatcher
gets no call.

The orderables in the OrderedConfiguration looks like this after my
dispatcher has been contributed (according to the Eclipse debugger at
least):
[Orderable[RootPath before:Asset
org.apache.tapestry5.internal.services.RootPathDispatcher@199d4a86],
Orderable[Asset before:ComponentEvent ],
Orderable[ComponentEvent before:PageRender
org.apache.tapestry5.internal.services.ComponentEventDispatcher@2587b08d],
Orderable[PageRender after:ComponentEvent
org.apache.tapestry5.internal.services.PageRenderDispatcher@6f580c3a],
Orderable[BreadCrumbDispatcher after:ComponentEvent,before:PageRender
se.unbound.tapestry.breadcrumbs.BreadCrumbDispatcher@2bca029b]]

Anyone have any idea why my dispatcher is not called?

Regards,
Joakim

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



Re: redirecting in the same page class

2012-08-18 Thread Angelo C.
https://issues.apache.org/jira/browse/TAP5-1990



--
View this message in context: 
http://tapestry.1045711.n5.nabble.com/redirecting-in-the-same-page-class-tp5715525p5715567.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: redirecting in the same page class

2012-08-18 Thread Thiago H de Paula Figueiredo
On Fri, 17 Aug 2012 22:29:24 -0300, Angelo C.   
wrote:



could have been nice if setAnchor returns Link instead of void so we can
have:

return renderLinkSource.createPageRenderLinkWithContext(MyClass.class,
code).setAnchor(entry)


Sounds like a good, harmless (aka backward-compatible) change. JIRA  
please? :)


--
Thiago H. de Paula Figueiredo

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



Re: tapestry by JEE standard

2012-08-18 Thread Thiago H de Paula Figueiredo
On Fri, 17 Aug 2012 20:40:59 -0300, Jay Ginete   
wrote:


I have always thought that Tapestry5 was classified as a  
"Compontent-oriented" web framework and not as "MVC" web framework.


Tapestry 5 is definetely a component-oriented framework. Whether it is  
also MVC or not depends on the meaning you give to the term MVC. It seems  
you're considering MVC as the same as request-oriented. I don't think that  
way.


According to Wikipedia and its sources, "Model–View–Controller (MVC) is a  
type of computer user interface that separates the representation of  
information from the user's interaction with it.[1][2] The model consists  
of application data and business rules, and the controller mediates input,  
converting it to commands for the model or view.[3] A view can be any  
output representation of data, such as a chart or a diagram. Multiple  
views of the same data are possible, such as a pie chart for management  
and a tabular view for accountants. The central idea behind MVC is code  
reusability and separation of concerns."  
(http://en.wikipedia.org/wiki/Model–view–controller) I think Tapestry fits  
in this description, even considering it itself doesn't implement business  
rules, just uses them. In other words, it can be used to implement the V  
and the C. And some components, by themselves, are implemented following  
the MVC pattern.


I tend to think that each page in a Tapestry5 app is a single stand  
alone app that has components within it that respond to events. I even  
sometimes think of Tapestry5 apps as RIA without the "R" if you use the  
"zone" component in almost (or all) of your use cases.


As far as I know (and I may be completely wrong, as always), the term RIA  
is usually used in the sense that view logic is placed mostly in the  
client, not in the server. Here's the Wikipedia definition: "A Rich  
Internet Application (RIA) is a Web application that has many of the  
characteristics of desktop application software, typically delivered by  
way of a site-specific browser, a browser plug-in, an independent sandbox,  
extensive use of JavaScript, or a virtual machine.[1] Adobe Flash, JavaFX,  
and Microsoft Silverlight are currently the three most common  
platforms,...". Tapestry can be used to create RIAs, but I wouldn't  
consider itself a RIA. In the Java world, I'd consider the single page  
frameworks RIAs: GWT, Vaadin, Echo2, Echo3, etc.


PS: I love tilapia (the fish). It's sold and eaten a lot in Capitólio,  
Minas Gerais, Brazil, where I grew up. :)


--
Thiago H. de Paula Figueiredo

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