Re: Tapestry 5.4-beta-6 No service implements the interface org.slf4j.Logger.

2014-07-03 Thread Manuel Sugawara
On Wed, Jul 2, 2014 at 8:36 PM, Thiago H de Paula Figueiredo <
thiag...@gmail.com> wrote:

> On Wed, 02 Jul 2014 21:29:03 -0300, Manuel Sugawara <
> manuel.sugaw...@gmail.com> wrote:
>
>  Hi,
>>
>
> Hello, Manuel!
>
>
>  I'm trying to play a little bit with 5.4-beta-6 but our application that
>> runs on tapestry 5.3.7 isn't starting, the error is:
>>
>> org.apache.tapestry5.ioc.internal.OperationException: No service
>> implements the interface org.slf4j.Logger.
>>
>
> Full stack trace please. :)


I found out the problem, or kind of. I have a contribution to the periodic
executor with an @Startup annotation, this contribution uses another
service which is build using @Autobuild. This last service has a
constructor which expects a Logger as parameter and this is what is
failing, something like:

@Startup
public static void scheduleTrigger(PeriodicExecutor executor,
   @Autobuild
   final CalendarioEventsTriggerer
triggerer) {

public CalendarioEventsTriggerer(..., Logger log) {

This is working perfectly in 5.3.

Regards,
Manuel.


Tapestry 5.4-beta-6 No service implements the interface org.slf4j.Logger.

2014-07-02 Thread Manuel Sugawara
Hi,

I'm trying to play a little bit with 5.4-beta-6 but our application that
runs on tapestry 5.3.7 isn't starting, the error is:

org.apache.tapestry5.ioc.internal.OperationException: No service implements
the interface org.slf4j.Logger.

Any clues on what I am missing?

Regards,
Manuel.


Re: PerThread service unique?

2012-04-30 Thread Manuel Sugawara
On Mon, Apr 30, 2012 at 11:32 AM, Thiago H. de Paula Figueiredo <
thiag...@gmail.com> wrote:

>
> One per thread (maybe zero, if it ends up not being used in a given
>> thread). If you take a look at them in a debugger, the injected service
>> object may look like there's a single shared instance, but actually it acts
>> as a proxy and delegates method calls to the appropriate service instance
>> for that thread.
>
>
I was trying to explain the symptoms with a colleague and all the sudden I
learnt where the problem was, and of course, It was not tapestry. Sorry
about the noise

Regards,
Manuel.


PerThread service unique?

2012-04-30 Thread Manuel Sugawara
Hi all,

I have a service that is marked with @Scope(ScopeConstants.PERTHREAD). Can
I assume that there will be just *one* instance of this service per thread
or there may be multiple instances?. I was under the impression that this
service will be unique per thread but am facing a problem that might be
explained if there are multiple instances of it. Any pointers to the
documentation will be appreciated. My reading of
http://tapestry.apache.org/defining-tapestry-ioc-services.html suggests me
that there will be just one instance but wanted to be sure.

Regards,
Manuel.


Re: RequestFilter running after serving assets

2012-04-04 Thread Manuel Sugawara
On Wed, Apr 4, 2012 at 6:48 PM, Thiago H. de Paula Figueiredo <
thiag...@gmail.com> wrote:

> On Wed, 04 Apr 2012 19:47:48 -0300, Manuel Sugawara <
> manuel.sugaw...@gmail.com> wrote:
>
>  Hi all,
>>
>
> Hi!
>
>
>  I have a RequestFilter that serves some content from the database and I
>> would like that  it run after the assets dispatcher in order to avoid the
>> creation of the service that access the database. Is this possible?.
>>
>
> Why don't you write it as a Dispatcher instead?


Yeah, I guess that will work. So, let me rephrase, When is appropriate to
use a dispatcher and when a filter?

Thanks.

Regards,
Manuel.


RequestFilter running after serving assets

2012-04-04 Thread Manuel Sugawara
Hi all,

I have a RequestFilter that serves some content from the database and I
would like that  it run after the assets dispatcher in order to avoid the
creation of the service that access the database. Is this possible?. How
are dispatchers and filters related?. Any pointers to the docs would also
be appreciated.

Regards,
Manuel.


Re: Show your Tapestry support!

2011-12-05 Thread Manuel Sugawara
On Mon, Dec 5, 2011 at 9:16 AM, Howard Lewis Ship  wrote:

> Actually, I'm not entirely satisfied with the result ... thanks to
> everyone who'se posted SO FAR, but I'd like to see more, and less
> familiar, names up on the JavaLobby announcements page.
>

Oh, well, I tried, really I did, but come on, the register form is sooo
long, and they require mi phone number and address WTF?, what for?. Jesus,
sorry guys, you have my full support but I can't stand registering.

Regards,
Manuel.


Re: An Appeal To Use the Latest Betas

2011-10-24 Thread Manuel Sugawara
Hi all,

A member of my team tried to upgrade our application and almost everything
worked out except for one bit: classes for services which name contain
accents are not longer accepted (ej, HorarioSalón). This is a big problem
for us since many classes have accents in theirs names. Hope this can be
solved.

Regards,
Manuel.


Re: ApplicationStateManager throws an exception when an object is requested

2010-10-14 Thread Manuel Sugawara
On Wed, Oct 13, 2010 at 2:30 PM, Howard Lewis Ship  wrote:

> See https://issues.apache.org/jira/browse/TAP5-1304
>
> Basically, the Request service isn't set up yet in the method you are
> invoking.
>
> Most likely, you want to contribute a filter to the RequestHandler
> service pipeline, not the HttpServletRequestHandler pipeline.
>

Thank you Howard, that was helpful.

Regards,
Manuel.


ApplicationStateManager throws an exception when an object is requested

2010-10-13 Thread Manuel Sugawara
Hi all,

Using tapestry 5.2.1. I have a filter that serves resources to clients
(images, documents, etc). This filter uses an injected service to check if
the user has the required permission to download the resource, but this is
not working as expected. The authorization filter throws an exception when
the following line is executed (full stack trace below):

stateManager.getIfExists(Session.class);

where stateManager is an ApplicationStateManager instance. The filter is
build by the application module using:

public static void
contributeHttpServletRequestHandler(OrderedConfiguration
configuration, @Autobuild FileFilter fileFilter) {
configuration.add("FileFilter", fileFilter);
}


The stack trace is:

java.lang.NullPointerException
at $Request_12ba6e8f229.getSession($Request_12ba6e8f229.java)
at $Request_12ba6e8f207.getSession($Request_12ba6e8f207.java)
at
org.apache.tapestry5.internal.services.SessionApplicationStatePersistenceStrategy.exists(SessionApplicationStatePersistenceStrategy.java:80)
at
$ApplicationStatePersistenceStrategy_12ba6e8f228.exists($ApplicationStatePersistenceStrategy_12ba6e8f228.java)
at
org.apache.tapestry5.internal.services.ApplicationStateManagerImpl$ApplicationStateAdapter.exists(ApplicationStateManagerImpl.java:60)
at
org.apache.tapestry5.internal.services.ApplicationStateManagerImpl.getIfExists(ApplicationStateManagerImpl.java:140)
at
$ApplicationStateManager_12ba6e8f226.getIfExists($ApplicationStateManager_12ba6e8f226.java)
at
mx.unam.xfc.auth.services.impl.SessionServiceImpl.authenticated(SessionServiceImpl.java:65)
at
$SessionService_12ba6e8f223.authenticated($SessionService_12ba6e8f223.java)
at
mx.unam.xfc.auth.services.impl.AuthorizationServiceImpl.authorized(AuthorizationServiceImpl.java:33)
at
$AuthorizationService_12ba6e8f21c.authorized($AuthorizationService_12ba6e8f21c.java)
at mx.unam.xfc.escuela.web.internal.FileFilter.service(FileFilter.java:89)
at
$HttpServletRequestHandler_12ba6e8f221.service($HttpServletRequestHandler_12ba6e8f221.java)
at
org.apache.tapestry5.services.TapestryModule$2.service(TapestryModule.java:915)
at
$HttpServletRequestHandler_12ba6e8f221.service($HttpServletRequestHandler_12ba6e8f221.java)
at
$HttpServletRequestHandler_12ba6e8f217.service($HttpServletRequestHandler_12ba6e8f217.java)
at org.apache.tapestry5.TapestryFilter.doFilter(TapestryFilter.java:147)
at
org.mortbay.jetty.servlet.ServletHandler$CachedChain.doFilter(ServletHandler.java:1084)
at org.mortbay.jetty.servlet.ServletHandler.handle(ServletHandler.java:360)
at
org.mortbay.jetty.security.SecurityHandler.handle(SecurityHandler.java:216)
at org.mortbay.jetty.servlet.SessionHandler.handle(SessionHandler.java:181)
at org.mortbay.jetty.handler.ContextHandler.handle(ContextHandler.java:726)
at org.mortbay.jetty.webapp.WebAppContext.handle(WebAppContext.java:405)
at
org.mortbay.jetty.handler.ContextHandlerCollection.handle(ContextHandlerCollection.java:206)
at
org.mortbay.jetty.handler.HandlerCollection.handle(HandlerCollection.java:114)
at org.mortbay.jetty.handler.HandlerWrapper.handle(HandlerWrapper.java:152)
at org.mortbay.jetty.Server.handle(Server.java:324)
at org.mortbay.jetty.HttpConnection.handleRequest(HttpConnection.java:505)
at
org.mortbay.jetty.HttpConnection$RequestHandler.headerComplete(HttpConnection.java:829)
at org.mortbay.jetty.HttpParser.parseNext(HttpParser.java:514)
at org.mortbay.jetty.HttpParser.parseAvailable(HttpParser.java:211)
at org.mortbay.jetty.HttpConnection.handle(HttpConnection.java:380)
at
org.mortbay.io.nio.SelectChannelEndPoint.run(SelectChannelEndPoint.java:395)
at
org.mortbay.thread.QueuedThreadPool$PoolThread.run(QueuedThreadPool.java:488)

Any idea what can be wrong?. If there are more details needed to debug this
please just let me know. Thanks in advance.

Regards,
Manuel.


Re: Is there any way to render the "get" method of form?

2010-09-28 Thread Manuel Sugawara
On Tue, Sep 28, 2010 at 11:24 AM, Martin Strand <
do.not.eat.yellow.s...@gmail.com> wrote:
>
> Of course is a matter of taste but I rather have
>> http://localhost/?q=c%E1lculo+diferencial<
>> http://localhost/?q=c%C3%A1lculo+diferencial>than
>>
>> http://localhost:8080/C$00e1lculo$0020diferencial
>>
>
> I happen to prefer the second URL so I am doing this with an activation
> context, just as you describe:
>
> POST /search.form
> redirects to
> GET /search/my-search-query
>

Which requires an extra round trip to the server that is not needed at all.
See
http://royal.pingdom.com/2010/09/22/is-the-web-heading-toward-redirect-hell/

Regards,
Manuel.


Re: Is there any way to render the "get" method of form?

2010-09-28 Thread Manuel Sugawara
On Tue, Sep 28, 2010 at 7:08 AM, Thiago H. de Paula Figueiredo <
thiag...@gmail.com> wrote:

> On Tue, 28 Sep 2010 05:41:50 -0300, Lutz Hühnken <
> lh.tapestry.l...@googlemail.com> wrote:
>
>  Dear Thiago,
>>
>
> Hi, Lutz!
>
>
>  now this - the lack of  - is something that has been
>> puzzling me in Tapestry 5 for a long time.
>
>
Oh well, I'm not alone ;-). Particulary because doing this by hand is too
much burden and you cannot use any of the components already provided by
tapestry.



> Why would you say using
>> "GET" is a bad idea?
>>
>
> Because all field values end up in the URL.


That's exactly what makes it a good idea, in particular for the case
described below. Also this allows the application to easily interoperate.
Think all those sites that provides a GET interface to search that can be
easily integrated with browsers (ej, the search box in firefox).


>  The use case I think of is a search field. You enter a search term,
>> submit the form, get the result. I think using a form with method=get
>> is the absolutely correct thing to do to achieve this.
>>
>
> I disagree 100%. Why not POST?
> GET was always meant to be used in request that don't change the state of
> the application (including database), while POST for requests that change
> the state. In addition, Tapestry uses redirect-after-post by default (a very
> good thing), so using GET would be useless anyway. Search Google for "get vs
> post security" for some info and "redirect-after-post".


Note the use case, is a search which will not change the database or
application state. I do agree with Lutz, there are cases where GET is much
more appropriate than POST. Not just because it makes more sense but also
because it gives you a bookmarkable URL. That being said, I just love
default redirect-after-post for those forms that *actually* modifies the
application state, just this is not the only use case.


>  Of course I am willing to learn. What would be the "Tapestry way" of
>> implementing this?
>>
>
> Use Form and leave it using POST. If you want a bookmarkable URL, use the
> page activation context instead. Tapestry and the form field components do
> all the value handling for you.


Of course is a matter of taste but I rather have
http://localhost/?q=cálculo+diferencialthan
http://localhost:8080/C$00e1lculo$0020diferencial

Regards,
Manuel.


Re: Complex Question about Templates and Inheritance

2010-06-11 Thread Manuel Sugawara
On Fri, Jun 11, 2010 at 4:35 PM, Josh Canfield wrote:

> Read the bit about template inheritance at the bottom of this page:
> http://tapestry.apache.org/tapestry5.1/guide/templates.html
> Although I agree with the sentiment in that page about not overusing
> these features and preferring composition over inheritance.
>
> If you map your PlatformModule to "core" then your components and
> pages can be accessed without a prefix. Your page classes would live
> in x.y.platform.pages.
>

Just be careful that this might not work in the upcoming tapestry release.
See this 
link
.

Regards,
Manuel.


Libarary "core" mapping not working in 5.2.0-SNAPSHOT

2010-06-02 Thread Manuel Sugawara
Hi,

I have a library that uses the core mapping but a few days ago
this stopped working. Tapestry throws an exception saying "Package names for
library folder 'core' (mx.unam.xfc.escuela.t5, org.apache.tapestry5.corelib)
can not be reduced to a common base package (of at least two terms)." As
this was reported before but got no answer I will try again. Is this not
supported anymore?, Is this a bug?, Should I create a Jira issue?.

Regards,
Manuel.


Forms and overlays

2010-05-20 Thread Manuel Sugawara
Hi all,

I'm writing a form that has a select with an special option "other...". When
this option is selected another form is show in an overlay to allow the user
to provide the "other.." option info. I have solved this using two forms in
the same template one of them is hidden and is only show when the clients
select the other option. When this is done I sent the form using prototype's
request on the form and waiting for its JSON response, same that I use to
populate the new option. Everything is working more or less fine but I would
really love to hear you insights in this solution. Is this approach
correct?, Is there any better way to accomplish this?. Any library out there
that does this?.

Best regards,
Manuel.


Re: Empty body?

2010-03-16 Thread Manuel Sugawara
On Mon, Mar 15, 2010 at 5:07 PM, Robert Hailey wrote:

>
> On Mar 12, 2010, at 1:20 PM, Manuel Sugawara wrote:
>
>  Hi
>>
>> I'm working in a menu component, similar to the one in the howtos. The
>> menuItem template looks like:
>>
>
> I am not able to find such a menu component in the howtos. Can you provide
> a link please?
>

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

Regards,
Manuel.


Empty body?

2010-03-12 Thread Manuel Sugawara
Hi

I'm working in a menu component, similar to the one in the howtos. The
menuItem template looks like:


  

  ${pageTitle}
  
${pageTitle}
  


  

  


however this template still renders an empty  if there is no body. I
would like to conditionally display the ul depending if there is a body or
not. Something like:


  

  


Now, I have solved this implementing the hasBody method like:

@Inject
private ComponentResources resources;

public boolean getHasBody() {
Block block = resources.getBody();
if ("".equals(block.toString())) {
return false;
}
return true;
}

This works but seems a bit flaky. Is there a better way to figure out if a
block is empty?

Regards,
Manuel.


Re: How to synchronize a service

2007-09-13 Thread Manuel Sugawara
"Renat Zubairov" <[EMAIL PROTECTED]> writes:
> Hi
>
> If you are refering to a "service" as a hivemind service, then you can
> hava  look on the service modles which are threaded, pooled, primitive
> and singleton. 

Yes, as a hivemind service. Didn't know of the different models
tough. I guess I have to check out the docs.

> But I guess better approach would be to put non-multithreaded part
> of your functionality to the singleton service and have other
> threaded services reading data prepared by singleton service.

I did something like this, thanks for the answer anyway.

Regards,
Manuel.

-
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]



Re: How to synchronize a service

2007-09-12 Thread Manuel Sugawara
Manuel Sugawara <[EMAIL PROTECTED]> writes:

> So, can I safely assume that there is only one instance of the
> service running?

No, of course not. For set-object to work there should be an instance
for client.

Regards,
Manuel.

-
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]



How to synchronize a service

2007-09-12 Thread Manuel Sugawara
Hi all, I'm using tapestry 4.0 and have a service that what roughly
does is create a PDF file in the tmp dir if it does not exists. If the
file exists or after its creation the service returns its contents to
the client. Now I'm worried about synchronization issues in this
code. Mi first idea was synchronize the method that looks for the file
and creates one if none exists, but this will not work if multiple
instances of the service are concurrently running. So, can I safely
assume that there is only one instance of the service running?, I
think not but wanted to be sure. If there may be many instances of the
service running, is Ok to synchronize on some global object? (global
as in 

Re: Getting all page names

2007-08-06 Thread Manuel Sugawara
Manuel Sugawara <[EMAIL PROTECTED]> writes:

> Hi all, 
>
> Working on Tapestry 4.0. I know that calling getPageNames from the
> INamespace interface I can get all the page names. What I don't know
> is how to get the INamespace object from a IPage. Ideas?.

It's part of IComponent. Sorry, didn't search enough :-(

Regards,
Manuel.

-
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]



Getting all page names

2007-08-06 Thread Manuel Sugawara
Hi all, 

Working on Tapestry 4.0. I know that calling getPageNames from the
INamespace interface I can get all the page names. What I don't know
is how to get the INamespace object from a IPage. Ideas?.

BTW This was answered some time ago in this list but google didn't
help and I couldn't find an interface to search the list archives, so
guys, how do you search the list archives?.

Regards,
Manuel.

-
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]



Problems using UTF-8 encoding and forms using the GET method

2006-10-25 Thread Manuel Sugawara
Hi all, 

I'm having problems using Tapestry4 with UTF-8 encoding and forms that
use the GET method (using POST works as expected). The form submits a
keyword and when the user puts a one with acute accent, like
topología, my listener reads that as topología. Any ideas on what's
going on and how to solve it?

Regards,
Manuel.


-
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]



How to obtain the servlet instance?

2006-09-21 Thread Manuel Sugawara
Hi all, I would like to obtain the servlet instance from within my
pages in order to call the HttpSevlet methods for logging. My first
cut was injecting it using something like:

@InjectObject("service:tapestry.globals.HttpServlet")
public abstract HttpServlet getHttpServlet();

To my surprise this didn't work :-(, Is there any way to get the
servlet instance?, if not, How can I write to the servlet log from
within my pages?.

Regards,
Manuel.


-
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]



DirectLinks failing

2006-08-04 Thread Manuel Sugawara
Hi all, we have created 3 sites using tapestry and we have seen
intermittently that some direct links are failing to set its
parameters before calling its listener methods. We have logged the
referer header when this happens and indeed the parameters are sent to
the server. Since this problem appears randomly I can't provide a test
case. Is this a know issue?, Any advice to track this down?.

Regards,
Manuel.

-
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]