Re: external link to a tapestry page

2006-07-19 Thread Aleksej
Maybe I didn't understand something. You want to send email from the 
same webapp or from totally
different application? In other words, can you access and work Hivemind 
registry of webapp where

your targeted page is?

Valdemaras Repšys wrote:

Thanks for the answer, Aleksej.

The problem is, this URL must be generated on a java thread (or class) 
that
is not an instance of BasePage and is not a tapestry page. That means 
i have

no access to ExternalService, right?
Also, I can't use @Any component because this url will be sent as an 
email

to the user (as a simple text).

Valdemaras Repšys

On 7/18/06, Aleksej [EMAIL PROTECTED] wrote:


Valdemaras Repšys wrote:
 Hi,
 i need my application to send emails with the link to the specific
 tapestry
 page. How would i generate a link?

 I tried extending a page with IExternalPage and using the address:
 http://localhost:8080/BioJazz/app?service=external/HitList
 What i get is RuntimeException: No engine service named
 'external/HitList'
 is available.

 Link (as in ExternalService API doc):
 http://localhost:8080/BioJazz/app?service=externalcontext=HitList
 gives a
 null pointer exception:

   - org.apache.hivemind.util.Defense.notNull(Defense.java:41)
   -
 org.apache.tapestry.engine.RequestCycle.getPage(RequestCycle.java:242)

   - org.apache.tapestry.engine.ExternalService.service(
   ExternalService.java:144)
   -
$IEngineService_10c8121ee8c.service($IEngineService_10c8121ee8c.java)


 Any hint?
 Thanks,
 Valdemaras Repšys

Do not form links manually, use tapestry.services.External service (
in your case ).
First inject it into your page with something like:
inject property=externalService
object=service:tapestry.services.External / in your page file.
Be sure that you have a externalService property getter like:
public abstract IEngineService getExternalService();
Then, when you need to generate link, just use
org.apache.tapestry.engine.ExternalServiceParameter
to generate your page parameters ( name and Object[] ) and call
getExternalService().getLink(  your parameter object ).
This will return ILink object and you will be able to call
getAbsoluteURL on it, which will return required Link as a string.
On the page you can probably put it using @Any component, like:
a jwcid=@Any href=yourLinkgo go go/a
-
GL




-
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: external link to a tapestry page

2006-07-19 Thread Valdemaras Repšys

I can access the hivemind registry, i'm sending emails from the same
application where the page is (a separate thread).

I accessed the externalService on a mailsender thread, thou sometimes i get
exceptions when invoking externalService.getLink:
tapestry.url.LinkFactory: Error building service tapestry.url.LinkFactory..
Caused by: java.lang.NullPointerException : Property 'webRequest' of
OuterProxy for
tapestry.globals.RequestGlobals(org.apache.tapestry.services.RequestGlobals)
is null.

Valdemaras Repšys

On 7/19/06, Aleksej [EMAIL PROTECTED] wrote:


Maybe I didn't understand something. You want to send email from the
same webapp or from totally
different application? In other words, can you access and work Hivemind
registry of webapp where
your targeted page is?

Valdemaras Repšys wrote:
 Thanks for the answer, Aleksej.

 The problem is, this URL must be generated on a java thread (or class)
 that
 is not an instance of BasePage and is not a tapestry page. That means
 i have
 no access to ExternalService, right?
 Also, I can't use @Any component because this url will be sent as an
 email
 to the user (as a simple text).

 Valdemaras Repšys

 On 7/18/06, Aleksej [EMAIL PROTECTED] wrote:

 Valdemaras Repšys wrote:
  Hi,
  i need my application to send emails with the link to the specific
  tapestry
  page. How would i generate a link?
 
  I tried extending a page with IExternalPage and using the address:
  http://localhost:8080/BioJazz/app?service=external/HitList
  What i get is RuntimeException: No engine service named
  'external/HitList'
  is available.
 
  Link (as in ExternalService API doc):
  http://localhost:8080/BioJazz/app?service=externalcontext=HitList
  gives a
  null pointer exception:
 
- org.apache.hivemind.util.Defense.notNull(Defense.java:41)
-
  org.apache.tapestry.engine.RequestCycle.getPage(RequestCycle.java
:242)
 
- org.apache.tapestry.engine.ExternalService.service(
ExternalService.java:144)
-
 $IEngineService_10c8121ee8c.service($IEngineService_10c8121ee8c.java)
 
 
  Any hint?
  Thanks,
  Valdemaras Repšys
 
 Do not form links manually, use tapestry.services.External service (
 in your case ).
 First inject it into your page with something like:
 inject property=externalService
 object=service:tapestry.services.External / in your page file.
 Be sure that you have a externalService property getter like:
 public abstract IEngineService getExternalService();
 Then, when you need to generate link, just use
 org.apache.tapestry.engine.ExternalServiceParameter
 to generate your page parameters ( name and Object[] ) and call
 getExternalService().getLink(  your parameter object ).
 This will return ILink object and you will be able to call
 getAbsoluteURL on it, which will return required Link as a string.
 On the page you can probably put it using @Any component, like:
 a jwcid=@Any href=yourLinkgo go go/a
 -
 GL




 -
 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: external link to a tapestry page

2006-07-19 Thread Shing Hing Man
You could trying setting the property webRequest in
requestGlobals manually before invoking
 externalService.getLink().


// The following few lines of code set up the property
// webRequest and webResponse in requestGlobals.
//
HttpServletRequest req =(HttpServletRequest)request;
HttpServletResponse resp =
(HttpServletResponse)response;
RequestGlobals requestGlobals = (RequestGlobals)
registry.getService(tapestry.globals.RequestGlobals,RequestGlobals.class);
WebRequest webRequest = new
ServletWebRequest(req,resp);
WebResponse webResponse = new
ServletWebResponse(resp);
requestGlobals.store(webRequest,webResponse); 

Usually, the webRequest (and webResponse) in
requestGlobal is set 
in WebRequestServicerPipelineBridge.java.
Here is the route to
WebRequestServicerPipelineBridge.java :
ApplicationServlet.doService - 
WebRequestServicerPipelineBridge.service.


Shing

--- Valdemaras Repšys [EMAIL PROTECTED] wrote:

 I managed to get the Registry by overriding the
 ApplicationServlet and i'm
 able to get the external service.
 However, it is not clear, when it is correct to
 invoke
 externalService.getLink(). If it is invoked just
 after
 ApplicationServlet.init() it fails with exception:
 org.apache.hivemind.ApplicationRuntimeException:
 Unable to construct service
 tapestry.url.LinkFactory: Error building service
 tapestry.url.LinkFactory
 Caused by:
 org.apache.hivemind.ApplicationRuntimeException:
 Unable to read
 property contextPath of object SingletonProxy for
 tapestry.Infrastructure(
 org.apache.tapestry.services.Infrastructure):...
 java.lang.reflect.InvocationTargetException...
 Caused by: java.lang.NullPointerException: Property
 'webRequest' of
 OuterProxy for tapestry.globals.RequestGlobals(
 org.apache.tapestry.services.RequestGlobals) is
 null.
 
 I can get the link if i invoke getLink later.. when
 some page was
 initialized.
 
 Valdemaras Repšys
 
 On 7/18/06, James Carman
 [EMAIL PROTECTED] wrote:
 
  If you can get to the HiveMind registry, you can
 lookup the
  ExternalService
  and use it.
 
  -Original Message-
  From: Valdemaras Repšys [mailto:[EMAIL PROTECTED]
  Sent: Tuesday, July 18, 2006 8:27 AM
  To: Tapestry users
  Subject: Re: external link to a tapestry page
 
  Thanks for the answer, Aleksej.
 
  The problem is, this URL must be generated on a
 java thread (or class)
  that
  is not an instance of BasePage and is not a
 tapestry page. That means i
  have
  no access to ExternalService, right?
  Also, I can't use @Any component because this url
 will be sent as an email
  to the user (as a simple text).
 
  Valdemaras Repšys
 
  On 7/18/06, Aleksej [EMAIL PROTECTED] wrote:
  
   Valdemaras Repšys wrote:
Hi,
i need my application to send emails with the
 link to the specific
tapestry
page. How would i generate a link?
   
I tried extending a page with IExternalPage
 and using the address:
   

http://localhost:8080/BioJazz/app?service=external/HitList
What i get is RuntimeException: No engine
 service named
'external/HitList'
is available.
   
Link (as in ExternalService API doc):
   

http://localhost:8080/BioJazz/app?service=externalcontext=HitList
gives a
null pointer exception:
   
  -

org.apache.hivemind.util.Defense.notNull(Defense.java:41)
  -
   

org.apache.tapestry.engine.RequestCycle.getPage(RequestCycle.java:242)
   
  -
 org.apache.tapestry.engine.ExternalService.service(
  ExternalService.java:144)
  -
  

$IEngineService_10c8121ee8c.service($IEngineService_10c8121ee8c.java)
   
   
Any hint?
Thanks,
Valdemaras Repšys
   
   Do not form links manually, use
 tapestry.services.External service (
   in your case ).
   First inject it into your page with something
 like:
   inject property=externalService
   object=service:tapestry.services.External /
 in your page file.
   Be sure that you have a externalService property
 getter like:
   public abstract IEngineService
 getExternalService();
   Then, when you need to generate link, just use
  

org.apache.tapestry.engine.ExternalServiceParameter
   to generate your page parameters ( name and
 Object[] ) and call
   getExternalService().getLink(  your parameter
 object ).
   This will return ILink object and you will be
 able to call
   getAbsoluteURL on it, which will return required
 Link as a string.
   On the page you can probably put it using @Any
 component, like:
   a jwcid=@Any href=yourLinkgo go go/a
   -
   GL
  
  
  
  
  

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


Home page :
  http://uk.geocities.com/matmsh/index.html

Re: external link to a tapestry page

2006-07-19 Thread Jesse Kuhnert

The LinkFactory service is completely reliant on the servlet container it is
running in. It's really not intended to be used outside of a specific http
request.

For your use-case friendly urls sure would make a huge difference.

On 7/19/06, Shing Hing Man [EMAIL PROTECTED] wrote:


You could trying setting the property webRequest in
requestGlobals manually before invoking
externalService.getLink().


// The following few lines of code set up the property
// webRequest and webResponse in requestGlobals.
//
HttpServletRequest req =(HttpServletRequest)request;
HttpServletResponse resp =
(HttpServletResponse)response;
RequestGlobals requestGlobals = (RequestGlobals)
registry.getService(tapestry.globals.RequestGlobals,RequestGlobals.class
);
WebRequest webRequest = new
ServletWebRequest(req,resp);
WebResponse webResponse = new
ServletWebResponse(resp);
requestGlobals.store(webRequest,webResponse);

Usually, the webRequest (and webResponse) in
requestGlobal is set
in WebRequestServicerPipelineBridge.java.
Here is the route to
WebRequestServicerPipelineBridge.java :
ApplicationServlet.doService -
WebRequestServicerPipelineBridge.service.


Shing

--- Valdemaras Repšys [EMAIL PROTECTED] wrote:

 I managed to get the Registry by overriding the
 ApplicationServlet and i'm
 able to get the external service.
 However, it is not clear, when it is correct to
 invoke
 externalService.getLink(). If it is invoked just
 after
 ApplicationServlet.init() it fails with exception:
 org.apache.hivemind.ApplicationRuntimeException:
 Unable to construct service
 tapestry.url.LinkFactory: Error building service
 tapestry.url.LinkFactory
 Caused by:
 org.apache.hivemind.ApplicationRuntimeException:
 Unable to read
 property contextPath of object SingletonProxy for
 tapestry.Infrastructure(
 org.apache.tapestry.services.Infrastructure):...
 java.lang.reflect.InvocationTargetException...
 Caused by: java.lang.NullPointerException: Property
 'webRequest' of
 OuterProxy for tapestry.globals.RequestGlobals(
 org.apache.tapestry.services.RequestGlobals) is
 null.

 I can get the link if i invoke getLink later.. when
 some page was
 initialized.

 Valdemaras Repšys

 On 7/18/06, James Carman
 [EMAIL PROTECTED] wrote:
 
  If you can get to the HiveMind registry, you can
 lookup the
  ExternalService
  and use it.
 
  -Original Message-
  From: Valdemaras Repšys [mailto:[EMAIL PROTECTED]
  Sent: Tuesday, July 18, 2006 8:27 AM
  To: Tapestry users
  Subject: Re: external link to a tapestry page
 
  Thanks for the answer, Aleksej.
 
  The problem is, this URL must be generated on a
 java thread (or class)
  that
  is not an instance of BasePage and is not a
 tapestry page. That means i
  have
  no access to ExternalService, right?
  Also, I can't use @Any component because this url
 will be sent as an email
  to the user (as a simple text).
 
  Valdemaras Repšys
 
  On 7/18/06, Aleksej [EMAIL PROTECTED] wrote:
  
   Valdemaras Repšys wrote:
Hi,
i need my application to send emails with the
 link to the specific
tapestry
page. How would i generate a link?
   
I tried extending a page with IExternalPage
 and using the address:
   

http://localhost:8080/BioJazz/app?service=external/HitList
What i get is RuntimeException: No engine
 service named
'external/HitList'
is available.
   
Link (as in ExternalService API doc):
   

http://localhost:8080/BioJazz/app?service=externalcontext=HitList
gives a
null pointer exception:
   
  -

org.apache.hivemind.util.Defense.notNull(Defense.java:41)
  -
   

org.apache.tapestry.engine.RequestCycle.getPage(RequestCycle.java:242)
   
  -
 org.apache.tapestry.engine.ExternalService.service(
  ExternalService.java:144)
  -
  

$IEngineService_10c8121ee8c.service($IEngineService_10c8121ee8c.java)
   
   
Any hint?
Thanks,
Valdemaras Repšys
   
   Do not form links manually, use
 tapestry.services.External service (
   in your case ).
   First inject it into your page with something
 like:
   inject property=externalService
   object=service:tapestry.services.External /
 in your page file.
   Be sure that you have a externalService property
 getter like:
   public abstract IEngineService
 getExternalService();
   Then, when you need to generate link, just use
  

org.apache.tapestry.engine.ExternalServiceParameter
   to generate your page parameters ( name and
 Object[] ) and call
   getExternalService().getLink(  your parameter
 object ).
   This will return ILink object and you will be
 able to call
   getAbsoluteURL on it, which will return required
 Link as a string.
   On the page you can probably put it using @Any
 component, like:
   a jwcid=@Any href=yourLinkgo go go/a
   -
   GL
  
  
  
  
  

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

Re: external link to a tapestry page

2006-07-18 Thread Aleksej

Valdemaras Repšys wrote:

Hi,
i need my application to send emails with the link to the specific 
tapestry

page. How would i generate a link?

I tried extending a page with IExternalPage and using the address:
http://localhost:8080/BioJazz/app?service=external/HitList
What i get is RuntimeException: No engine service named 
'external/HitList'

is available.

Link (as in ExternalService API doc):
http://localhost:8080/BioJazz/app?service=externalcontext=HitList 
gives a

null pointer exception:

  - org.apache.hivemind.util.Defense.notNull(Defense.java:41)
  - 
org.apache.tapestry.engine.RequestCycle.getPage(RequestCycle.java:242)


  - org.apache.tapestry.engine.ExternalService.service(
  ExternalService.java:144)
  - $IEngineService_10c8121ee8c.service($IEngineService_10c8121ee8c.java)


Any hint?
Thanks,
Valdemaras Repšys

Do not form links manually, use tapestry.services.External service ( 
in your case ).

First inject it into your page with something like:
inject property=externalService 
object=service:tapestry.services.External / in your page file.

Be sure that you have a externalService property getter like:
public abstract IEngineService getExternalService();
Then, when you need to generate link, just use 
org.apache.tapestry.engine.ExternalServiceParameter
to generate your page parameters ( name and Object[] ) and call 
getExternalService().getLink(  your parameter object ).
This will return ILink object and you will be able to call 
getAbsoluteURL on it, which will return required Link as a string.

On the page you can probably put it using @Any component, like:
a jwcid=@Any href=yourLinkgo go go/a
-
GL




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



Re: external link to a tapestry page

2006-07-18 Thread Valdemaras Repšys

Thanks for the answer, Aleksej.

The problem is, this URL must be generated on a java thread (or class) that
is not an instance of BasePage and is not a tapestry page. That means i have
no access to ExternalService, right?
Also, I can't use @Any component because this url will be sent as an email
to the user (as a simple text).

Valdemaras Repšys

On 7/18/06, Aleksej [EMAIL PROTECTED] wrote:


Valdemaras Repšys wrote:
 Hi,
 i need my application to send emails with the link to the specific
 tapestry
 page. How would i generate a link?

 I tried extending a page with IExternalPage and using the address:
 http://localhost:8080/BioJazz/app?service=external/HitList
 What i get is RuntimeException: No engine service named
 'external/HitList'
 is available.

 Link (as in ExternalService API doc):
 http://localhost:8080/BioJazz/app?service=externalcontext=HitList
 gives a
 null pointer exception:

   - org.apache.hivemind.util.Defense.notNull(Defense.java:41)
   -
 org.apache.tapestry.engine.RequestCycle.getPage(RequestCycle.java:242)

   - org.apache.tapestry.engine.ExternalService.service(
   ExternalService.java:144)
   -
$IEngineService_10c8121ee8c.service($IEngineService_10c8121ee8c.java)


 Any hint?
 Thanks,
 Valdemaras Repšys

Do not form links manually, use tapestry.services.External service (
in your case ).
First inject it into your page with something like:
inject property=externalService
object=service:tapestry.services.External / in your page file.
Be sure that you have a externalService property getter like:
public abstract IEngineService getExternalService();
Then, when you need to generate link, just use
org.apache.tapestry.engine.ExternalServiceParameter
to generate your page parameters ( name and Object[] ) and call
getExternalService().getLink(  your parameter object ).
This will return ILink object and you will be able to call
getAbsoluteURL on it, which will return required Link as a string.
On the page you can probably put it using @Any component, like:
a jwcid=@Any href=yourLinkgo go go/a
-
GL




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




RE: external link to a tapestry page

2006-07-18 Thread James Carman
If you can get to the HiveMind registry, you can lookup the ExternalService
and use it.

-Original Message-
From: Valdemaras Repšys [mailto:[EMAIL PROTECTED] 
Sent: Tuesday, July 18, 2006 8:27 AM
To: Tapestry users
Subject: Re: external link to a tapestry page

Thanks for the answer, Aleksej.

The problem is, this URL must be generated on a java thread (or class) that
is not an instance of BasePage and is not a tapestry page. That means i have
no access to ExternalService, right?
Also, I can't use @Any component because this url will be sent as an email
to the user (as a simple text).

Valdemaras Repšys

On 7/18/06, Aleksej [EMAIL PROTECTED] wrote:

 Valdemaras Repšys wrote:
  Hi,
  i need my application to send emails with the link to the specific
  tapestry
  page. How would i generate a link?
 
  I tried extending a page with IExternalPage and using the address:
  http://localhost:8080/BioJazz/app?service=external/HitList
  What i get is RuntimeException: No engine service named
  'external/HitList'
  is available.
 
  Link (as in ExternalService API doc):
  http://localhost:8080/BioJazz/app?service=externalcontext=HitList
  gives a
  null pointer exception:
 
- org.apache.hivemind.util.Defense.notNull(Defense.java:41)
-
  org.apache.tapestry.engine.RequestCycle.getPage(RequestCycle.java:242)
 
- org.apache.tapestry.engine.ExternalService.service(
ExternalService.java:144)
-
 $IEngineService_10c8121ee8c.service($IEngineService_10c8121ee8c.java)
 
 
  Any hint?
  Thanks,
  Valdemaras Repšys
 
 Do not form links manually, use tapestry.services.External service (
 in your case ).
 First inject it into your page with something like:
 inject property=externalService
 object=service:tapestry.services.External / in your page file.
 Be sure that you have a externalService property getter like:
 public abstract IEngineService getExternalService();
 Then, when you need to generate link, just use
 org.apache.tapestry.engine.ExternalServiceParameter
 to generate your page parameters ( name and Object[] ) and call
 getExternalService().getLink(  your parameter object ).
 This will return ILink object and you will be able to call
 getAbsoluteURL on it, which will return required Link as a string.
 On the page you can probably put it using @Any component, like:
 a jwcid=@Any href=yourLinkgo go go/a
 -
 GL




 -
 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: external link to a tapestry page

2006-07-18 Thread Brian Duchek
You're on the right track by using an External link. Make sure your page 
implements IExternalPage. 

We do something similar with one page that we wanted to be bookmarkable and 
the URL Format is quite similar to what you're trying.  

You'll still have to workaround problems of interdependency between apps if the 
URL format changes on a different version of Tapestry, and this doesn't account 
for authentication/security measures, but it's a start.

/bd

-Original Message-
From: Valdemaras Repšys [mailto:[EMAIL PROTECTED] 
Sent: Tuesday, July 18, 2006 5:27 AM
To: Tapestry users
Subject: Re: external link to a tapestry page

Thanks for the answer, Aleksej.

The problem is, this URL must be generated on a java thread (or class) that
is not an instance of BasePage and is not a tapestry page. That means i have
no access to ExternalService, right?
Also, I can't use @Any component because this url will be sent as an email
to the user (as a simple text).

Valdemaras Repšys

On 7/18/06, Aleksej [EMAIL PROTECTED] wrote:

 Valdemaras Repšys wrote:
  Hi,
  i need my application to send emails with the link to the specific
  tapestry
  page. How would i generate a link?
 
  I tried extending a page with IExternalPage and using the address:
  http://localhost:8080/BioJazz/app?service=external/HitList
  What i get is RuntimeException: No engine service named
  'external/HitList'
  is available.
 
  Link (as in ExternalService API doc):
  http://localhost:8080/BioJazz/app?service=externalcontext=HitList
  gives a
  null pointer exception:
 
- org.apache.hivemind.util.Defense.notNull(Defense.java:41)
-
  org.apache.tapestry.engine.RequestCycle.getPage(RequestCycle.java:242)
 
- org.apache.tapestry.engine.ExternalService.service(
ExternalService.java:144)
-
 $IEngineService_10c8121ee8c.service($IEngineService_10c8121ee8c.java)
 
 
  Any hint?
  Thanks,
  Valdemaras Repšys
 
 Do not form links manually, use tapestry.services.External service (
 in your case ).
 First inject it into your page with something like:
 inject property=externalService
 object=service:tapestry.services.External / in your page file.
 Be sure that you have a externalService property getter like:
 public abstract IEngineService getExternalService();
 Then, when you need to generate link, just use
 org.apache.tapestry.engine.ExternalServiceParameter
 to generate your page parameters ( name and Object[] ) and call
 getExternalService().getLink(  your parameter object ).
 This will return ILink object and you will be able to call
 getAbsoluteURL on it, which will return required Link as a string.
 On the page you can probably put it using @Any component, like:
 a jwcid=@Any href=yourLinkgo go go/a
 -
 GL




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