Re: Accessing an application state object from a service

2006-10-12 Thread Hajaansh

Perfect example. Is there any documentation where you would find such
explanation about the applicationStateManager? I googled for
infrastructure:applicationStateManager and there were 39 results (6
displayed). No too amazing ;-)

Thanks again!

On 10/12/06, Patrick Moore [EMAIL PROTECTED] wrote:


Inject the application state manager object. Then in the thread get
the actual state object.

service-point id=sessionFactory
interface=com.transparentpolitics.core.appstate.TransPolSessionManager
invoke-factory
construct class=
com.transparentpolitics.core.appstate.TransPolSessionManagerImpl
initialize-method=init
set-object property=stateManager
value=infrastructure:applicationStateManager/
/construct
/invoke-factory
/service-point

and then :
transPolSession = (TransPolSession) stateManager.get
(USER_INFORMATION);

On 10/11/06, Hajaansh [EMAIL PROTECTED] wrote:
 I have an application state object whos scope is session and I have a
 service object whos scope is threaded. Is it possible to inject the
 application state object into the service object via hivemind? If then
how?

 Cheers,

 Hajaansh



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




Accessing an application state object from a service

2006-10-11 Thread Hajaansh

I have an application state object whos scope is session and I have a
service object whos scope is threaded. Is it possible to inject the
application state object into the service object via hivemind? If then how?

Cheers,

Hajaansh


Re: How do I create a link...

2006-10-10 Thread Hajaansh

This is also how I do it but I thought I read in a previous post that this
is not the best way of doing it. Is this correct?


On 10/4/06, Jesse Kuhnert [EMAIL PROTECTED] wrote:


That depends on what you want to happen when they click on that asset?

I've found the ServiceLink component indispensable in this regard. You
can
create a simple little arbitrary engine service without the hassle of
creating new link components to run it...So..In your case you could:

Define a new engine service that serves files to people in such a way that
it'll correctly invoke their browsers application content handling type -
or
download if none is found...(Ie setting response type , etc..)

Then use a simple ServiceLink to pass in what you want to give the
service,
which is presumably a local asset you have defined.

On 10/3/06, Mark Stang [EMAIL PROTECTED] wrote:

 I need to create a link to an asset in Tapestry 3.

 Basically, I have a .pdf which isn't in my context.

 Thoughts on how to link to it?

 thanks,

 mark

 Mark J. Stang
 Senior Engineer/Architect
 office: +1 303.468.2900
 mobile: +1 303.507.2833
 Ping Identity





--
Jesse Kuhnert
Tapestry/Dojo/(and a dash of TestNG), team member/developer

Open source based consulting work centered around
dojo/tapestry/tacos/hivemind. http://blog.opencomponentry.com




Re: DatePicker error

2006-09-27 Thread Hajaansh

Hi again DJ,

I am just looking at the versions I have. I am using Hibernate 3.1.3.

Are you using Java 1.5? I saw in the readme for hibernate that I have:

xerces-2.6.2.jar (2.6.2)
- SAX parser
- runtime, required for JDK  1.4

So maybe the problem could be that I am using JDK 1.5... any thoughts? I
will try to remove the jar and see if this makes any difference.

My version of xml-apis.jar  is unknown (lol) - I guess this is what you
meant by the XML Parser APIs?

I dont have saxpath (could that be part of your Maven installation(if you
are using that?))

All these different libraries are starting to make my head spin... ;-)

Thanks again!

On 9/26/06, DJ Gredler [EMAIL PROTECTED] wrote:


I'm using Tap4 with Hibernate 3.1.2 without a problem and I see the
following XML-related JARS in my lib directory: dom4j 1.6.1, saxpath
1.0FCS, Xerces Impl
2.6.2, XML Parser APIs 2.2.1. Not sure how you would find out what the
official dependencies are.

On 9/26/06, Hajaansh [EMAIL PROTECTED] wrote:

 Ah, so that is the reason that no one answered :-) That might have been
a
 good tip from you though! I have found a Xerces 2.6.2 jar which came
with
 hibernate and I dont really have a clue if Tapestry (4.0) is using that
 one.


 I have also found one which came with my Java 1.5 installation.

 Any way to find out which Tapestry is using? I am not sure if just
 deleting
 the version that came with Hibernate would be a good idea or?

 Thanks for your quick response!


 On 9/26/06, DJ Gredler [EMAIL PROTECTED] wrote:
 
  I really have no idea, but maybe you have multiple versions of Xerces
  running around on your classpath, or just a single (wrong) version?
 These
  kinds of errors are always hard to debug...
 
  On 9/26/06, Hajaansh [EMAIL PROTECTED] wrote:
  
   No one knows what the problem could be? Each time a restart Tomcat
it
   seems
   to be fine. Maybe it is so obvious no one is responding?
  
   On 9/19/06, Hajaansh [EMAIL PROTECTED] wrote:
   
Sorry, the error message was formatted strangely the last time.
This
   time
I hope it is better... Any ideas anyone?
Could it be how I started Tomcat? I started it with:
   
set JAVA_OPTS=-Dorg.apache.tapestry.disable-caching=true
set JPDA_ADDRESS=9045
set JPDA_TRANSPORT=dt_socket
C:\Tomcat\apache-tomcat-5.5.17\bin\catalina jpda start
   
and the error I got from the DatePicker is as follows (i hope this
  time
the formating is not as bad as the last time...)
   
   
org.apache.hivemind.ApplicationRuntimeException
org.apache.xerces.parsers.XML11Configuration  location:
classpath:/org/apache/tapestry/form/DatePicker.jwc, line 36,
column
 71
31 parameter name=validators/ 32 parameter name=id
property=idParameter default-value=id/ 33
34 asset name=defaultIcon path=DatePickerIcon.png/ 35
36 inject property=script type=script object=
DatePicker.script
  /
   37inject property=translatedFieldSupport object=service:
tapestry.form.TranslatedFieldSupport/ 38 inject
property=validatableFieldSupport object=service:
tapestry.form.ValidatableFieldSupport/ 39
40/component-specification  java.lang.ClassCastException
org.apache.xerces.parsers.XML11Configuration  Stack Trace:
   
   - org.apache.xerces.parsers.SAXParser.init(Unknown Source)
   - org.apache.xerces.parsers.SAXParser.init(Unknown Source)
   - org.apache.xerces.jaxp.SAXParserImpl.init(Unknown Source)
   - org.apache.xerces.jaxp.SAXParserFactoryImpl.newSAXParser
 (Unknown
   Source)
   -
org.apache.tapestry.util.xml.RuleDirectedParser.constructParser
 (
   RuleDirectedParser.java:426)
   - org.apache.tapestry.util.xml.RuleDirectedParser.parse(
   RuleDirectedParser.java:155)
   - org.apache.tapestry.util.xml.RuleDirectedParser.parse(
   RuleDirectedParser.java:130)
   - org.apache.tapestry.script.ScriptParser.parse(
ScriptParser.java
   :105)
   
   - org.apache.tapestry.engine.DefaultScriptSource.parse(
   DefaultScriptSource.java:88)
   - org.apache.tapestry.engine.DefaultScriptSource.getScript(
   DefaultScriptSource.java:74)
   -
  
$IScriptSource_10dc21a16a2.getScript($IScriptSource_10dc21a16a2.java)
   
   - org.apache.tapestry.enhance.DeferredScriptImpl.getScript(
   DeferredScriptImpl.java:54)
   - $DatePicker_699.getScript($DatePicker_699.java)
   - org.apache.tapestry.form.DatePicker.renderFormComponent(
   DatePicker.java:129)
   
   -
org.apache.tapestry.form.AbstractFormComponent.renderComponent(
   AbstractFormComponent.java:126)
   - org.apache.tapestry.AbstractComponent.render(
   AbstractComponent.java:617)
   - org.apache.tapestry.AbstractComponent.renderBody(
   AbstractComponent.java:434)
   - org.apache.tapestry.form.FormSupportImpl.render(
   FormSupportImpl.java:486)
   - org.apache.tapestry.form.Form.renderComponent(Form.java:250)
   - org.apache.tapestry.AbstractComponent.render

Re: DatePicker error

2006-09-27 Thread Hajaansh

Thanks anyway!

I will just have to try out different libs and see if the problem somehow
sorts itself out ;-) It does not feel like a stable way of doing things but
I guess I have no alternative...

Thanks again!


On 9/27/06, DJ Gredler [EMAIL PROTECTED] wrote:


I'm on JDK 1.5, so that shouldn't be an issue.

The saxpath jar may very well be a dependency of one of the other
gazillion
libraries I'm using :-)

I don't know what else to suggest...

On 9/27/06, Hajaansh [EMAIL PROTECTED] wrote:

 Hi again DJ,

 I am just looking at the versions I have. I am using Hibernate 3.1.3.

 Are you using Java 1.5? I saw in the readme for hibernate that I have:

 xerces-2.6.2.jar (2.6.2)
 - SAX parser
 - runtime, required for JDK  1.4

 So maybe the problem could be that I am using JDK 1.5... any thoughts? I
 will try to remove the jar and see if this makes any difference.

 My version of xml-apis.jar  is unknown (lol) - I guess this is what
you
 meant by the XML Parser APIs?

 I dont have saxpath (could that be part of your Maven installation(if
you
 are using that?))

 All these different libraries are starting to make my head spin... ;-)

 Thanks again!

 On 9/26/06, DJ Gredler [EMAIL PROTECTED] wrote:
 
  I'm using Tap4 with Hibernate 3.1.2 without a problem and I see the
  following XML-related JARS in my lib directory: dom4j 1.6.1, saxpath
  1.0FCS, Xerces Impl
  2.6.2, XML Parser APIs 2.2.1. Not sure how you would find out what the
  official dependencies are.
 
  On 9/26/06, Hajaansh [EMAIL PROTECTED] wrote:
  
   Ah, so that is the reason that no one answered :-) That might have
 been
  a
   good tip from you though! I have found a Xerces 2.6.2 jar which came
  with
   hibernate and I dont really have a clue if Tapestry (4.0) is using
 that
   one.
  
  
   I have also found one which came with my Java 1.5 installation.
  
   Any way to find out which Tapestry is using? I am not sure if just
   deleting
   the version that came with Hibernate would be a good idea or?
  
   Thanks for your quick response!
  
  
   On 9/26/06, DJ Gredler [EMAIL PROTECTED] wrote:
   
I really have no idea, but maybe you have multiple versions of
 Xerces
running around on your classpath, or just a single (wrong)
version?
   These
kinds of errors are always hard to debug...
   
On 9/26/06, Hajaansh [EMAIL PROTECTED] wrote:

 No one knows what the problem could be? Each time a restart
Tomcat
  it
 seems
 to be fine. Maybe it is so obvious no one is responding?

 On 9/19/06, Hajaansh [EMAIL PROTECTED] wrote:
 
  Sorry, the error message was formatted strangely the last
time.
  This
 time
  I hope it is better... Any ideas anyone?
  Could it be how I started Tomcat? I started it with:
 
  set JAVA_OPTS=-Dorg.apache.tapestry.disable-caching=true
  set JPDA_ADDRESS=9045
  set JPDA_TRANSPORT=dt_socket
  C:\Tomcat\apache-tomcat-5.5.17\bin\catalina jpda start
 
  and the error I got from the DatePicker is as follows (i hope
 this
time
  the formating is not as bad as the last time...)
 
 
  org.apache.hivemind.ApplicationRuntimeException
  org.apache.xerces.parsers.XML11Configuration  location:
  classpath:/org/apache/tapestry/form/DatePicker.jwc, line 36,
  column
   71
  31 parameter name=validators/ 32 parameter name=id
  property=idParameter default-value=id/ 33
  34 asset name=defaultIcon path=DatePickerIcon.png/ 35
  36 inject property=script type=script object=
  DatePicker.script
/
 37inject property=translatedFieldSupport object=service:
  tapestry.form.TranslatedFieldSupport/ 38 inject
  property=validatableFieldSupport object=service:
  tapestry.form.ValidatableFieldSupport/ 39
  40/component-specification  java.lang.ClassCastException
  org.apache.xerces.parsers.XML11Configuration  Stack Trace:
 
 - org.apache.xerces.parsers.SAXParser.init(Unknown
Source)
 - org.apache.xerces.parsers.SAXParser.init(Unknown
Source)
 - org.apache.xerces.jaxp.SAXParserImpl.init(Unknown
Source)
 - org.apache.xerces.jaxp.SAXParserFactoryImpl.newSAXParser
   (Unknown
 Source)
 -
  org.apache.tapestry.util.xml.RuleDirectedParser.constructParser
   (
 RuleDirectedParser.java:426)
 - org.apache.tapestry.util.xml.RuleDirectedParser.parse(
 RuleDirectedParser.java:155)
 - org.apache.tapestry.util.xml.RuleDirectedParser.parse(
 RuleDirectedParser.java:130)
 - org.apache.tapestry.script.ScriptParser.parse(
  ScriptParser.java
 :105)
 
 - org.apache.tapestry.engine.DefaultScriptSource.parse(
 DefaultScriptSource.java:88)
 - org.apache.tapestry.engine.DefaultScriptSource.getScript(
 DefaultScriptSource.java:74)
 -

  $IScriptSource_10dc21a16a2.getScript($IScriptSource_10dc21a16a2.java

Re: DatePicker error

2006-09-26 Thread Hajaansh

No one knows what the problem could be? Each time a restart Tomcat it seems
to be fine. Maybe it is so obvious no one is responding?

On 9/19/06, Hajaansh [EMAIL PROTECTED] wrote:


Sorry, the error message was formatted strangely the last time. This time
I hope it is better... Any ideas anyone?
Could it be how I started Tomcat? I started it with:

set JAVA_OPTS=-Dorg.apache.tapestry.disable-caching=true
set JPDA_ADDRESS=9045
set JPDA_TRANSPORT=dt_socket
C:\Tomcat\apache-tomcat-5.5.17\bin\catalina jpda start

and the error I got from the DatePicker is as follows (i hope this time
the formating is not as bad as the last time...)


org.apache.hivemind.ApplicationRuntimeException
org.apache.xerces.parsers.XML11Configuration  location:
classpath:/org/apache/tapestry/form/DatePicker.jwc, line 36, column 71
31 parameter name=validators/ 32 parameter name=id
property=idParameter default-value=id/ 33
34 asset name=defaultIcon path=DatePickerIcon.png/ 35
36 inject property=script type=script object=DatePicker.script/ 37inject 
property=translatedFieldSupport object=service:
tapestry.form.TranslatedFieldSupport/ 38 inject
property=validatableFieldSupport object=service:
tapestry.form.ValidatableFieldSupport/ 39
40/component-specification  java.lang.ClassCastException
org.apache.xerces.parsers.XML11Configuration  Stack Trace:

   - org.apache.xerces.parsers.SAXParser.init(Unknown Source)
   - org.apache.xerces.parsers.SAXParser.init(Unknown Source)
   - org.apache.xerces.jaxp.SAXParserImpl.init(Unknown Source)
   - org.apache.xerces.jaxp.SAXParserFactoryImpl.newSAXParser(Unknown
   Source)
   - org.apache.tapestry.util.xml.RuleDirectedParser.constructParser(
   RuleDirectedParser.java:426)
   - org.apache.tapestry.util.xml.RuleDirectedParser.parse(
   RuleDirectedParser.java:155)
   - org.apache.tapestry.util.xml.RuleDirectedParser.parse(
   RuleDirectedParser.java:130)
   - org.apache.tapestry.script.ScriptParser.parse(ScriptParser.java:105)

   - org.apache.tapestry.engine.DefaultScriptSource.parse(
   DefaultScriptSource.java:88)
   - org.apache.tapestry.engine.DefaultScriptSource.getScript(
   DefaultScriptSource.java:74)
   - $IScriptSource_10dc21a16a2.getScript($IScriptSource_10dc21a16a2.java)

   - org.apache.tapestry.enhance.DeferredScriptImpl.getScript(
   DeferredScriptImpl.java:54)
   - $DatePicker_699.getScript($DatePicker_699.java)
   - 
org.apache.tapestry.form.DatePicker.renderFormComponent(DatePicker.java:129)

   - org.apache.tapestry.form.AbstractFormComponent.renderComponent(
   AbstractFormComponent.java:126)
   - org.apache.tapestry.AbstractComponent.render(
   AbstractComponent.java:617)
   - org.apache.tapestry.AbstractComponent.renderBody(
   AbstractComponent.java:434)
   - org.apache.tapestry.form.FormSupportImpl.render(
   FormSupportImpl.java:486)
   - org.apache.tapestry.form.Form.renderComponent(Form.java:250)
   - org.apache.tapestry.AbstractComponent.render(
   AbstractComponent.java:617)
   - org.apache.tapestry.AbstractComponent.renderBody(
   AbstractComponent.java:434)
   - org.apache.tapestry.components.RenderBody.renderComponent(
   RenderBody.java:44)
   - org.apache.tapestry.AbstractComponent.render(
   AbstractComponent.java:617)
   - org.apache.tapestry.AbstractComponent.renderBody(
   AbstractComponent.java:434)
   - org.apache.tapestry.html.Body.renderComponent(Body.java:129)
   - org.apache.tapestry.AbstractComponent.render(
   AbstractComponent.java:617)
   - org.apache.tapestry.AbstractComponent.renderBody(
   AbstractComponent.java:434)
   - org.apache.tapestry.html.Shell.renderComponent(Shell.java:114)
   - org.apache.tapestry.AbstractComponent.render(
   AbstractComponent.java:617)
   - org.apache.tapestry.BaseComponent.renderComponent(
   BaseComponent.java:92)
   - org.apache.tapestry.AbstractComponent.render(
   AbstractComponent.java:617)
   - org.apache.tapestry.BaseComponent.renderComponent(
   BaseComponent.java:92)
   - org.apache.tapestry.AbstractComponent.render(
   AbstractComponent.java:617)
   - org.apache.tapestry.AbstractPage.renderPage(AbstractPage.java:275)

   - org.apache.tapestry.engine.RequestCycle.renderPage(
   RequestCycle.java:366)
   -
   org.apache.tapestry.services.impl.ResponseRendererImpl.renderResponse
   (ResponseRendererImpl.java:71)
   - 
$ResponseRenderer_10dc21a16ae.renderResponse($ResponseRenderer_10dc21a16ae.java)

   - org.apache.tapestry.engine.HomeService.service(HomeService.java:65)

   - $IEngineService_10dc21a1719.service($IEngineService_10dc21a1719.java)

   - org.apache.tapestry.services.impl.EngineServiceOuterProxy.service(
   EngineServiceOuterProxy.java:66)
   - org.apache.tapestry.engine.AbstractEngine.service(
   AbstractEngine.java:248)
   - org.apache.tapestry.services.impl.InvokeEngineTerminator.service(
   InvokeEngineTerminator.java:60)
   - 
$WebRequestServicer_10dc21a16f8.service($WebRequestServicer_10dc21a16f8.java)

   - org.apache.tapestry.services.impl.DisableCachingFilter.service

Re: DatePicker error

2006-09-26 Thread Hajaansh

Ah, so that is the reason that no one answered :-) That might have been a
good tip from you though! I have found a Xerces 2.6.2 jar which came with
hibernate and I dont really have a clue if Tapestry (4.0) is using that one.


I have also found one which came with my Java 1.5 installation.

Any way to find out which Tapestry is using? I am not sure if just deleting
the version that came with Hibernate would be a good idea or?

Thanks for your quick response!


On 9/26/06, DJ Gredler [EMAIL PROTECTED] wrote:


I really have no idea, but maybe you have multiple versions of Xerces
running around on your classpath, or just a single (wrong) version? These
kinds of errors are always hard to debug...

On 9/26/06, Hajaansh [EMAIL PROTECTED] wrote:

 No one knows what the problem could be? Each time a restart Tomcat it
 seems
 to be fine. Maybe it is so obvious no one is responding?

 On 9/19/06, Hajaansh [EMAIL PROTECTED] wrote:
 
  Sorry, the error message was formatted strangely the last time. This
 time
  I hope it is better... Any ideas anyone?
  Could it be how I started Tomcat? I started it with:
 
  set JAVA_OPTS=-Dorg.apache.tapestry.disable-caching=true
  set JPDA_ADDRESS=9045
  set JPDA_TRANSPORT=dt_socket
  C:\Tomcat\apache-tomcat-5.5.17\bin\catalina jpda start
 
  and the error I got from the DatePicker is as follows (i hope this
time
  the formating is not as bad as the last time...)
 
 
  org.apache.hivemind.ApplicationRuntimeException
  org.apache.xerces.parsers.XML11Configuration  location:
  classpath:/org/apache/tapestry/form/DatePicker.jwc, line 36, column 71
  31 parameter name=validators/ 32 parameter name=id
  property=idParameter default-value=id/ 33
  34 asset name=defaultIcon path=DatePickerIcon.png/ 35
  36 inject property=script type=script object=DatePicker.script
/
 37inject property=translatedFieldSupport object=service:
  tapestry.form.TranslatedFieldSupport/ 38 inject
  property=validatableFieldSupport object=service:
  tapestry.form.ValidatableFieldSupport/ 39
  40/component-specification  java.lang.ClassCastException
  org.apache.xerces.parsers.XML11Configuration  Stack Trace:
 
 - org.apache.xerces.parsers.SAXParser.init(Unknown Source)
 - org.apache.xerces.parsers.SAXParser.init(Unknown Source)
 - org.apache.xerces.jaxp.SAXParserImpl.init(Unknown Source)
 - org.apache.xerces.jaxp.SAXParserFactoryImpl.newSAXParser(Unknown
 Source)
 - org.apache.tapestry.util.xml.RuleDirectedParser.constructParser(
 RuleDirectedParser.java:426)
 - org.apache.tapestry.util.xml.RuleDirectedParser.parse(
 RuleDirectedParser.java:155)
 - org.apache.tapestry.util.xml.RuleDirectedParser.parse(
 RuleDirectedParser.java:130)
 - org.apache.tapestry.script.ScriptParser.parse(ScriptParser.java
 :105)
 
 - org.apache.tapestry.engine.DefaultScriptSource.parse(
 DefaultScriptSource.java:88)
 - org.apache.tapestry.engine.DefaultScriptSource.getScript(
 DefaultScriptSource.java:74)
 -
 $IScriptSource_10dc21a16a2.getScript($IScriptSource_10dc21a16a2.java)
 
 - org.apache.tapestry.enhance.DeferredScriptImpl.getScript(
 DeferredScriptImpl.java:54)
 - $DatePicker_699.getScript($DatePicker_699.java)
 - org.apache.tapestry.form.DatePicker.renderFormComponent(
 DatePicker.java:129)
 
 - org.apache.tapestry.form.AbstractFormComponent.renderComponent(
 AbstractFormComponent.java:126)
 - org.apache.tapestry.AbstractComponent.render(
 AbstractComponent.java:617)
 - org.apache.tapestry.AbstractComponent.renderBody(
 AbstractComponent.java:434)
 - org.apache.tapestry.form.FormSupportImpl.render(
 FormSupportImpl.java:486)
 - org.apache.tapestry.form.Form.renderComponent(Form.java:250)
 - org.apache.tapestry.AbstractComponent.render(
 AbstractComponent.java:617)
 - org.apache.tapestry.AbstractComponent.renderBody(
 AbstractComponent.java:434)
 - org.apache.tapestry.components.RenderBody.renderComponent(
 RenderBody.java:44)
 - org.apache.tapestry.AbstractComponent.render(
 AbstractComponent.java:617)
 - org.apache.tapestry.AbstractComponent.renderBody(
 AbstractComponent.java:434)
 - org.apache.tapestry.html.Body.renderComponent(Body.java:129)
 - org.apache.tapestry.AbstractComponent.render(
 AbstractComponent.java:617)
 - org.apache.tapestry.AbstractComponent.renderBody(
 AbstractComponent.java:434)
 - org.apache.tapestry.html.Shell.renderComponent(Shell.java:114)
 - org.apache.tapestry.AbstractComponent.render(
 AbstractComponent.java:617)
 - org.apache.tapestry.BaseComponent.renderComponent(
 BaseComponent.java:92)
 - org.apache.tapestry.AbstractComponent.render(
 AbstractComponent.java:617)
 - org.apache.tapestry.BaseComponent.renderComponent(
 BaseComponent.java:92)
 - org.apache.tapestry.AbstractComponent.render(
 AbstractComponent.java:617)
 - org.apache.tapestry.AbstractPage.renderPage

Re: How to listent for the Request Cycle End

2006-09-20 Thread Hajaansh

I have used a custom engine for displaying images as is described in Enjoy
Web development with Tapestry. Is there an alternative (better) way of
doing this?

Cheers,

On 9/20/06, James Carman [EMAIL PROTECTED] wrote:


To plug into the WebRequestServicerPipeline, you implement the
WebRequestServicerFilter interface:

public class MyFilter implements WebRequestServicerFilter
{
}

Then, in your hivemodule.xml you plug it into the pipeline:

contribution
configuration-id=hivemind.request.WebRequestServicerPipeline
  filter name=MyFilter object=instance:MyFilter /
/contribution

That's off the top of my head, but you get the idea.  This basically acts
like a servlet filter, but you can plug hivemind-managed filters in (so
you
can inject stuff into your implementation objects).


-Original Message-
From: Dobrin Ivanov [mailto:[EMAIL PROTECTED]
Sent: Wednesday, September 20, 2006 1:30 PM
To: Tapestry users
Subject: Re: How to listent for the Request Cycle End

I do not know about this custom Engine classes changes
(frowned)...
  is there some information about this topic?

.. and also the other one with the
pipelines/WebRequestServicerPipeline/interceptors?

--- James Carman [EMAIL PROTECTED] wrote:

 You can plugin to the webrequest servicer pipeline.

  Ummm... you could do that too.  You're correct
 that it would avoid the
  visit-from-session inelegant bit.  It would be
 conceptually similar to
  the servlet filter approach.  The downside would
 be that custom Engine
  classes are frowned upon as Tapestry goes forward.
  I'm not sure there
  is an Engine.getVisit() in 4.1.
 
  None of the approaches is perfect since Tapestry
 doesn't provide a
  built-in end-of-request hook.  Well, there is a
 call to
  monitor.serviceEnd() that you could use without
 subclassing Engine.
 
 
  Dobrin Ivanov wrote:
  Hi,
  Thanks Bryan, this looks like a hack:)
 
  What do you think if I override the Engine's
 method:
 
public void service(WebRequest request,
 WebResponse
  response) throws IOException {
  super.service(request, response);
  // insert code here
  }
 
  Is this a bad approach?
 
 
  --- Bryan Lewis [EMAIL PROTECTED] wrote:
 
 
  It sounds like a servlet listener method could
 work
  for you.  Or a
  servlet filter as in the previous suggestion.
 Both
  would give you a
  hook into the end-of-request, and you can get to
 the
  Visit via the
  session.  Here's a listener approach.
 
 
  public class EventListener implements
  ServletRequestListener
  {
  public void
  requestInitialized(ServletRequestEvent sre) {
  // This method might not need to do
  anything.
  }
 
  public void
 requestDestroyed(ServletRequestEvent
  sre)
  {
  // Call a static method in your
  thread-storage class to get your
  data.
 
  // The slightly messy part is getting
 the
  Visit from the session.
  HttpSession session =
  sre.getServletRequest().getSession(false);
  String visitKey = state: + appName +
  :visit;
  Visit visit = (Visit)
  session.getAttribute(visitKey);
  }
  }
 
  In your web.xml:
 
  listener
 
 
 
 

listener-classyour.package.EventListener/listener-class
 
  /listener
 
 
  Dobrin Ivanov wrote:
 
  I have designed some small API in order to
 provide
 
  the
 
  session persistance of the presentation layer
  (Tapestry - Visit object/HttpSession) to the
 model
  layer (in order to be able to cache some
 session
  related stuff without being aware of how the
 above
  layer is doing it). So the data is attached to
 the
  thread and at the end of the request cycle I
 want
 
  to
 
  save it into the Visit object.
 
  --- Martin Strand [EMAIL PROTECTED]
 wrote:
 
 
 
  Exactly what do you need this for?
  If you don't need any Tapestry logic, there
 might
 
  be
 
  other ways to do it -
  like a servlet filter or a threaded service
 that
  implements Discardable.
 
  On Tue, 19 Sep 2006 21:58:20 +0200, Jesse
 Kuhnert
  [EMAIL PROTECTED]
  wrote:
 
 
 
  It might not be super fun to learn, but I
 think
 
 
  the tapestry way of
 
 
  doing
  this would be to contribute something to the
 
 
  WebRequestServicerPipeline
 
 
  so
  that you know definitively when the cycle
 ends
 
 
  regardless of what
 
 
  services/engines are involved..
 
 
 
 
 


http://tapestry.apache.org/tapestry4/tapestry/hivedocs/config/tapestry.reque
st.WebRequestServicerPipeline.html
 
 
 
  On 9/19/06, Dobrin Ivanov
 
 
  [EMAIL PROTECTED] wrote:
 
 
  Hi,
 
  I want some advise of which is the best way
 to
 
 
  catch
 
 
  the end of the request cycly. I have tried
 it
 
 
  using a
 
 
  PageDetachListener, but the problem is that
 
 
  sometimes
 
 
  there is more than one page involved into
 the

=== message truncated ===


__
Do You Yahoo!?
Tired of spam?  Yahoo! Mail has the best spam protection around
http://mail.yahoo.com


DatePicker error

2006-09-19 Thread Hajaansh

Sorry, the error message was formatted strangely the last time. This time I
hope it is better... Any ideas anyone?
Could it be how I started Tomcat? I started it with:

set JAVA_OPTS=-Dorg.apache.tapestry.disable-caching=true
set JPDA_ADDRESS=9045
set JPDA_TRANSPORT=dt_socket
C:\Tomcat\apache-tomcat-5.5.17\bin\catalina jpda start

and the error I got from the DatePicker is as follows (i hope this time the
formating is not as bad as the last time...)


org.apache.hivemind.ApplicationRuntimeException
org.apache.xerces.parsers.XML11Configuration  location:
classpath:/org/apache/tapestry/form/DatePicker.jwc,
line 36, column 71
31 parameter name=validators/ 32 parameter name=id
property=idParameter default-value=id/ 33
34 asset name=defaultIcon path=DatePickerIcon.png/ 35
36 inject property=script type=script
object=DatePicker.script/ 37inject
property=translatedFieldSupport object=service:
tapestry.form.TranslatedFieldSupport/ 38 inject
property=validatableFieldSupport object=service:
tapestry.form.ValidatableFieldSupport/ 39
40/component-specification   java.lang.ClassCastException
org.apache.xerces.parsers.XML11Configuration  Stack Trace:

  - org.apache.xerces.parsers.SAXParser.init(Unknown Source)
  - org.apache.xerces.parsers.SAXParser.init(Unknown Source)
  - org.apache.xerces.jaxp.SAXParserImpl.init(Unknown Source)
  - org.apache.xerces.jaxp.SAXParserFactoryImpl.newSAXParser(Unknown
  Source)
  - org.apache.tapestry.util.xml.RuleDirectedParser.constructParser(
  RuleDirectedParser.java:426)
  - org.apache.tapestry.util.xml.RuleDirectedParser.parse(
  RuleDirectedParser.java:155)
  - org.apache.tapestry.util.xml.RuleDirectedParser.parse(
  RuleDirectedParser.java:130)
  - org.apache.tapestry.script.ScriptParser.parse(ScriptParser.java:105)

  - org.apache.tapestry.engine.DefaultScriptSource.parse(
  DefaultScriptSource.java:88)
  - org.apache.tapestry.engine.DefaultScriptSource.getScript(
  DefaultScriptSource.java:74)
  - $IScriptSource_10dc21a16a2.getScript($IScriptSource_10dc21a16a2.java)

  - org.apache.tapestry.enhance.DeferredScriptImpl.getScript(
  DeferredScriptImpl.java:54)
  - $DatePicker_699.getScript($DatePicker_699.java)
  - org.apache.tapestry.form.DatePicker.renderFormComponent(
  DatePicker.java:129)
  - org.apache.tapestry.form.AbstractFormComponent.renderComponent(
  AbstractFormComponent.java:126)
  - org.apache.tapestry.AbstractComponent.render(AbstractComponent.java:617)

  - org.apache.tapestry.AbstractComponent.renderBody(
  AbstractComponent.java:434)
  - org.apache.tapestry.form.FormSupportImpl.render(FormSupportImpl.java:486)

  - org.apache.tapestry.form.Form.renderComponent(Form.java:250)
  - org.apache.tapestry.AbstractComponent.render(AbstractComponent.java:617)

  - org.apache.tapestry.AbstractComponent.renderBody(
  AbstractComponent.java:434)
  - org.apache.tapestry.components.RenderBody.renderComponent(
  RenderBody.java:44)
  - org.apache.tapestry.AbstractComponent.render(AbstractComponent.java:617)

  - org.apache.tapestry.AbstractComponent.renderBody(
  AbstractComponent.java:434)
  - org.apache.tapestry.html.Body.renderComponent(Body.java:129)
  - org.apache.tapestry.AbstractComponent.render(AbstractComponent.java:617)

  - org.apache.tapestry.AbstractComponent.renderBody(
  AbstractComponent.java:434)
  - org.apache.tapestry.html.Shell.renderComponent(Shell.java:114)
  - org.apache.tapestry.AbstractComponent.render(AbstractComponent.java:617)

  - org.apache.tapestry.BaseComponent.renderComponent(BaseComponent.java:92)

  - org.apache.tapestry.AbstractComponent.render(AbstractComponent.java:617)

  - org.apache.tapestry.BaseComponent.renderComponent(BaseComponent.java:92)

  - org.apache.tapestry.AbstractComponent.render(AbstractComponent.java:617)

  - org.apache.tapestry.AbstractPage.renderPage(AbstractPage.java:275)
  - org.apache.tapestry.engine.RequestCycle.renderPage(RequestCycle.java:366)

  -
  org.apache.tapestry.services.impl.ResponseRendererImpl.renderResponse(
  ResponseRendererImpl.java:71)
  - 
$ResponseRenderer_10dc21a16ae.renderResponse($ResponseRenderer_10dc21a16ae.java)

  - org.apache.tapestry.engine.HomeService.service(HomeService.java:65)
  - $IEngineService_10dc21a1719.service($IEngineService_10dc21a1719.java)

  - org.apache.tapestry.services.impl.EngineServiceOuterProxy.service(
  EngineServiceOuterProxy.java:66)
  - org.apache.tapestry.engine.AbstractEngine.service(
  AbstractEngine.java:248)
  - org.apache.tapestry.services.impl.InvokeEngineTerminator.service(
  InvokeEngineTerminator.java:60)
  - 
$WebRequestServicer_10dc21a16f8.service($WebRequestServicer_10dc21a16f8.java)

  - org.apache.tapestry.services.impl.DisableCachingFilter.service(
  DisableCachingFilter.java:48)
  - 
$WebRequestServicerFilter_10dc21a16fa.service($WebRequestServicerFilter_10dc21a16fa.java)

  - 
$WebRequestServicer_10dc21a16fc.service($WebRequestServicer_10dc21a16fc.java)

  - 
$WebRequestServicer_10dc21a16f4.service($WebRequestServicer_10dc21a16f4.java)

  

Re: How to send or save into a file a tapestry page

2006-09-19 Thread Hajaansh

Perfect! I needed this too! Cheers!

On 9/19/06, Stephane Decleire [EMAIL PROTECTED] wrote:


Here it is :


http://mail-archives.apache.org/mod_mbox/jakarta-tapestry-user/200503.mbox/[EMAIL
 PROTECTED]

-

Assuming you are already familiar with the Javamail API, it sounds like
all
you really need is the Tapestry-rendered data stream.  This is actually
really easy:

EmailPage next = (EmailPage) cycle.getPage(EmailPage);
next.setSomeProperty(getSomeProperty());

ByteArrayOutputStream baos = new ByteArrayOutputStream();
HTMLWriter writer = new HTMLWriter(baos);
cycle.activate(next);
cycle.renderPage(writer);
writer.flush();

You can then do whatever you want with baos.  I can give you more details
if
you would like.

Shawn

-



Peter Dawn a écrit :
 can you share the link/info for implementing this in tap3

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


--
Stéphane Decleire

05 56 57 99 20
06 63 78 69 06





DirectArea component in Tapestry 4

2006-09-01 Thread Hajaansh

I was wondering how to make a DirectArea component (getting callbacks on
Image Maps) for Tapestry 4 as the implementation for Tapestry 3 does not
work in Tapestry 4.

And clues? I was looking at using the ILinkRenderer but to be honest I am
just getting in a muddle.

Cheers,

Hajaash


Re: DirectArea component in Tapestry 4

2006-09-01 Thread Hajaansh

Perfect.

Where did you find that the name for the engine service was
engine-service:direct ?



On 9/1/06, Brian Long [EMAIL PROTECTED] wrote:


Hajaansh,

had the same problem myself when moving from 3 to 4, so here are the
updated
AreaLink.jwc and AreaLink.java that I use. The main difference in the use
of
property injection for the engine service.

AreaLink.jwc

?xml version=1.0 encoding=UTF-8?
!DOCTYPE component-specification PUBLIC
  -//Apache Software Foundation//Tapestry Specification 4.0//EN
  http://jakarta.apache.org/tapestry/dtd/Tapestry_4_0.dtd;

component-specification
class=com.yourProject.web.page.AreaLink
allow-body=no
allow-informal-parameters=yes

!--inject property=directService object=engine-service:direct/--

description
Creates a non-contextual link.  Non-persistent state can be stored within
the link
using the context.
/description

parameter name=listener required=yes /

parameter name=parameters 
description
An object, or list of objects, encoded into the URL
as service parameters.
/description
/parameter

reserved-parameter name=href/

/component-specification

AreaLink.java

package com.annadaletech.yourProject.web.jwc;

import org.apache.tapestry.AbstractComponent;
import org.apache.tapestry.IActionListener;
import org.apache.tapestry.IDirect;
import org.apache.tapestry.IMarkupWriter;
import org.apache.tapestry.IRequestCycle;
import org.apache.tapestry.Tapestry;
import org.apache.tapestry.annotations.InjectObject;
import org.apache.tapestry.engine.DirectServiceParameter;
import org.apache.tapestry.engine.IEngineService;
import org.apache.tapestry.engine.ILink;
import org.apache.tapestry.link.DirectLink;

public abstract class AreaLink extends AbstractComponent implements
IDirect
{

public abstract Object getParameters();
public abstract IActionListener getListener();

@InjectObject(engine-service:direct)
public abstract IEngineService getDirectService();

public void renderComponent(IMarkupWriter writer, IRequestCycle cycle)
{
  if (cycle.isRewinding())
   return;

  Object[] parameters = DirectLink.constructServiceParameters
(getParameters());

  //IEngineService service = getDirectService();
  DirectServiceParameter dsParam = new
DirectServiceParameter(this,parameters);
  ILink link = getDirectService().getLink(false,dsParam);

  writer.beginEmpty(area);
  writer.attribute(href,link.getURL());

  renderInformalParameters(writer,cycle);
}

public void trigger(IRequestCycle cycle)
{
IActionListener listener = getListener();

if (listener == null)
 throw Tapestry.createRequiredParameterException(this,
listener);

listener.actionTriggered(this, cycle);
}

public boolean isStateful()
{
 return false;
}

}

hivemodule.xml

contribution configuration-id=tapestry.url.ServiceEncoders
   direct-service-encoder id=direct stateless-extension=direct
 stateful-extension=sdirect/
/contribution

yourProject.application

component-type type=AreaLink specification-path=jwc/AreaLink.jwc /

I hope this helps . . .

/Brian.

On 9/1/06, Hajaansh [EMAIL PROTECTED] wrote:
 I was wondering how to make a DirectArea component (getting callbacks on
 Image Maps) for Tapestry 4 as the implementation for Tapestry 3 does not
 work in Tapestry 4.

 And clues? I was looking at using the ILinkRenderer but to be honest I
am
 just getting in a muddle.

 Cheers,

 Hajaash






Re: DirectArea component in Tapestry 4

2006-09-01 Thread Hajaansh

I meant the direct part not the engine-service:  part.

Cheers,



On 9/1/06, James Carman [EMAIL PROTECTED] wrote:


It's a HiveMind object provider.


http://tapestry.apache.org/tapestry4/tapestry/hivedocs/service/tapestry.serv
ices.EngineServiceObjectProvider.html



-Original Message-
From: Hajaansh [mailto:[EMAIL PROTECTED]
Sent: Friday, September 01, 2006 7:21 AM
To: Tapestry users
Subject: Re: DirectArea component in Tapestry 4

Perfect.

Where did you find that the name for the engine service was
engine-service:direct ?



On 9/1/06, Brian Long [EMAIL PROTECTED] wrote:

 Hajaansh,

 had the same problem myself when moving from 3 to 4, so here are the
 updated
 AreaLink.jwc and AreaLink.java that I use. The main difference in the
use
 of
 property injection for the engine service.

 AreaLink.jwc

 ?xml version=1.0 encoding=UTF-8?
 !DOCTYPE component-specification PUBLIC
   -//Apache Software Foundation//Tapestry Specification 4.0//EN
   http://jakarta.apache.org/tapestry/dtd/Tapestry_4_0.dtd;

 component-specification
 class=com.yourProject.web.page.AreaLink
 allow-body=no
 allow-informal-parameters=yes

 !--inject property=directService object=engine-service:direct/--

 description
 Creates a non-contextual link.  Non-persistent state can be stored
within
 the link
 using the context.
 /description

 parameter name=listener required=yes /

 parameter name=parameters 
 description
 An object, or list of objects, encoded into the URL
 as service parameters.
 /description
 /parameter

 reserved-parameter name=href/

 /component-specification

 AreaLink.java

 package com.annadaletech.yourProject.web.jwc;

 import org.apache.tapestry.AbstractComponent;
 import org.apache.tapestry.IActionListener;
 import org.apache.tapestry.IDirect;
 import org.apache.tapestry.IMarkupWriter;
 import org.apache.tapestry.IRequestCycle;
 import org.apache.tapestry.Tapestry;
 import org.apache.tapestry.annotations.InjectObject;
 import org.apache.tapestry.engine.DirectServiceParameter;
 import org.apache.tapestry.engine.IEngineService;
 import org.apache.tapestry.engine.ILink;
 import org.apache.tapestry.link.DirectLink;

 public abstract class AreaLink extends AbstractComponent implements
 IDirect
 {

 public abstract Object getParameters();
 public abstract IActionListener getListener();

 @InjectObject(engine-service:direct)
 public abstract IEngineService getDirectService();

 public void renderComponent(IMarkupWriter writer, IRequestCycle
cycle)
 {
   if (cycle.isRewinding())
return;

   Object[] parameters = DirectLink.constructServiceParameters
 (getParameters());

   //IEngineService service = getDirectService();
   DirectServiceParameter dsParam = new
 DirectServiceParameter(this,parameters);
   ILink link = getDirectService().getLink(false,dsParam);

   writer.beginEmpty(area);
   writer.attribute(href,link.getURL());

   renderInformalParameters(writer,cycle);
 }

 public void trigger(IRequestCycle cycle)
 {
 IActionListener listener = getListener();

 if (listener == null)
  throw Tapestry.createRequiredParameterException(this,
 listener);

 listener.actionTriggered(this, cycle);
 }

 public boolean isStateful()
 {
  return false;
 }

 }

 hivemodule.xml

 contribution configuration-id=tapestry.url.ServiceEncoders
direct-service-encoder id=direct stateless-extension=direct
  stateful-extension=sdirect/
 /contribution

 yourProject.application

 component-type type=AreaLink specification-path=jwc/AreaLink.jwc /

 I hope this helps . . .

 /Brian.

 On 9/1/06, Hajaansh [EMAIL PROTECTED] wrote:
  I was wondering how to make a DirectArea component (getting callbacks
on
  Image Maps) for Tapestry 4 as the implementation for Tapestry 3 does
not
  work in Tapestry 4.
 
  And clues? I was looking at using the ILinkRenderer but to be honest I
 am
  just getting in a muddle.
 
  Cheers,
 
  Hajaash
 
 





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