Hivemind eager loading of a service which references tapestry services is not possible

2007-04-22 Thread Paul Stanton
I'm trying to avoid Spring and use Hivemind to manage my Hibernate 
service. It's pretty basic stuff but one basic feature is proving very 
hard to achieve: eager load startup.


In my case I need to reference WebContext (the tapestry component) in my 
initialisation procedure, but it seems to be 'unresolved' at that point 
and I get a NullPointerException.


As a result, I'm starting to think there is a gap in how Tapestry and 
Hivemind are integrated, in that tapestry components cannot be 
referenced in eager loading services.


It's possible that changing service loading order (in 
ApplicationServlet.init) solves this, and equally possible that I've 
missed an obvious alternative.


I've got a thread with all the relevant details:
http://www.tapestryforums.com/can-hivemind-call-something-after-all-set-objects-vt9931.html 



--
Paul Stanton
Gunn Software
PH: (02) 9918 3666 (ext 503)




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



Re: Tree w/Checkbox on each node--Way to Fix Indent?

2007-04-22 Thread tapuser

Hi Ty,
 I am trying to implement Tree Table with add node, delete node and
edit node functionality using a employee table.  Could you please some
guidelines to implement the treeManager. I am getting null pointer
exceptions. 

Thanks.
Sri.


Tyrone Hed wrote:
 
 
 
Folks,
  I have developed a Tapestry app (4.0.1) that uses the Tree in
 four places. It works great in three of those places but not in the one
 that includes a checkbox on each node of the tree. The problem is that it
 loses track of the indent and gives all nodes of the tree the same indent
 as the right-most node. So, as the user opens each node, the tree marches
 from left to right. In short, it looks like hell. I've looked at the
 generated source but it just piles on divs and spans to get the indent.
 The margin indent, in short, is broken when you have to enclose a tree in
 a FORM. Any suggestions? Here is my code. 
   Thank you,
  
 Ty
 
 
 Files included:
 
 userEnterprises.page
 userEnterprises.html
 UserEnterprises.java
 
 ---
 userEnterprises.page
 ---
 
 page-specification
 class=com.tyco.web.pages.authorization.UserEnterprises
   
 descriptionTree/description
   property name=item /
 bean name=evenOdd class=org.apache.tapestry.bean.EvenOdd/
   
 component id=tree type=tacos:Tree
   binding name=value   value=item/
   binding name=nodeLinkAjax   value=ognl:false /
   binding name=evenOdd  value=ognl:page.beans.evenOdd
 /
   binding name=rowStyle  value=ognl:beans.evenOdd/   
   binding name=state   
 value=enterpriseTreeState/
 /component
   
   component id=submitEditUserUpdateEnterprises type=ClickSubmit
 binding name=selected value=submitAction/
 binding name=tag value='EDIT_USER_UPDATE_ENTERPRISES'/
   /component
   
   component id=submitCancel type=ClickSubmit
 binding name=selected value=submitAction/
 binding name=tag value='CANCEL'/
   /component
 
 /page-specification
 
 
 ---
 userEnterprises.html
 ---
 
   table width=90% class=body border=1  
 TR
   TD
 div 
   jwcid=tree 
   id=tree 
   keyProvider=ognl:keyProvider
   contentProvider=ognl:contentProvider  
 
   style=overflow: auto; width: auto; height: auto;
   
 input jwcid=[EMAIL PROTECTED]
 value=ognl:item.checked /
   
   
 
   
   
 
   
 /div
   /TD
 /TR
   /TABLE
 
 
 ---
 UserEnterprises.java
 
  (I doubt this class will we useful in solving this problem
  but just in case I am doing so for completeness.)
 ---
 
 /*
  * Created on Jan 17, 2006
  *
  * Copyright 2005 Ingenix, Inc. All rights reserved.
  * This file contains CONFIDENTIAL and PROPRIETARY information
  * and should not be distributed without prior written permission.
  */
 package com.ingenix.freya.web.pages.authorization;
 
 import java.util.ArrayList;
 import java.util.HashSet;
 import java.util.Iterator;
 import java.util.List;
 import java.util.Set;
 
 import org.apache.commons.logging.Log;
 import org.apache.commons.logging.LogFactory;
 import org.apache.tapestry.IRequestCycle;
 import org.apache.tapestry.annotations.InjectState;
 import org.apache.tapestry.event.PageBeginRenderListener;
 import org.apache.tapestry.event.PageEvent;
 
 import com.tyco.api.authorization.AuthorizationFactory;
 import com.tyco.api.authorization.User;
 import com.tyco.api.enterprise.Enterprise;
 import
 com.tyco.web.components.authorization.AuthenticationListComponentBase;
 import com.tyco.web.components.enterprise.EnterpriseTreeContentProvider;
 import com.tyco.web.components.enterprise.Folder;
 import com.tyco.web.components.enterprise.Item;
 
 public abstract class UserEnterprises extends UserControllerPage
 implements PageBeginRenderListener
 {
   private List mPermissions;
   private Enterprise mEnterprise;  
 
   @InjectState( contentProvider )
   public abstract EnterpriseTreeContentProvider getContentProvider();
   public abstract void 

@Meta and @InjectMeta with a boolean type

2007-04-22 Thread Paul Stanton
I saw a neat solution to meta data using annotations in the Vlib example 
that comes bundled with Tapestry 4.1.1.

*Code:*
@Meta({anonymous-access=false, admin-page=false})
public abstract class VlibPage extends BasePage implements IErrorProperty,
   IMessageProperty, PageValidateListener, OperationsUser
{
...
   @InjectMeta(anonymous-access)
   public abstract boolean getAllowAnonymousAccess();

   @InjectMeta(admin-page)
   public abstract boolean isAdminPage();
...
   public void pageValidate(PageEvent event)
   {
   if (isAdminPage()) ensureUserIsLoggedInAsAdmin();

   if (!getAllowAnonymousAccess()) ensureUserIsLoggedIn();
   }
...
}

Subclasses of VlibPage can over-ride the value for anonymous-access or 
admin-page using the same @Meta annotation:

*Code:*
@Meta( { page-type=Search, anonymous-access=true })
public abstract class Home extends VlibPage
...



I thought I'd give it a go:

base class for pages, defaults meta value to true
*Code:*
@Meta({meta-secure=true})
public abstract class BasePage extends org.apache.tapestry.html.BasePage 
implements PageValidateListener

{
  @InjectMeta(meta-secure)
  public abstract boolean isMetaSecure();
...
  public boolean isSecure()
  {
 return true;
  }
...
  public void pageValidate(PageEvent event)
  {
 System.out.println(this.getClass().getName() +  - method: + 
isSecure() +  - meta: + isMetaSecure());

  }
...
}



home page over-rides meta value to false
*Code:*
@Meta({meta-secure=false})
public abstract class Home extends BasePage
{
  @Override
  public boolean isSecure()
  {
 return false;
  }
}



list clients page over-rides value to true (for testing purposes)
*Code:*
@Meta({meta-secure=true})
public abstract class ListClients extends BasePage
...



list projects page does not over-ride super value
*Code:*
public abstract class ListProjects extends BasePage



unfortunately, it doesn't seem to work. The value always reads false.
*Code:*
$Home_84 - method:false - meta:false
$ListProjects_95 - method:true - meta:false
$ListClients_137 - method:true - meta:false



I've stepped through some stacks and have found that the value is being 
correctly set to the String true and false in the components 
properties, but somewhere between 
ComponentPropertySourceImpl.getComponentProperty and my property 
injected method isMetaSecure, true is not being converted to boolean 
true.


Has anyone come across this problem?

Has anyone successfully used booleans in meta data via the page 
specification as opposed to class annotations?


--
Paul Stanton
Gunn Software
PH: (02) 9918 3666 (ext 503)




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



[no subject]

2007-04-22 Thread Donyee

--
Chinese name:徐 依伟
English name: will


Re: Tapestry 5 and URL encoding

2007-04-22 Thread Nick Westgate

@Inject
private RequestGlobals _globals;

Then you can use _globals.getHTTPServletRequest().getRequestURL()
and other methods from javax.servlet.http.HttpServletRequest.

Cheers,
Nick.


Hans Braxmeier wrote:

Hello together,

Today I installed T5 and it's a great
tool. Is there something like an URL
encoder implemented in Tapestry 5 and
how can the current URL be shown on a
page?

Thanks for any help,

Hans Braxmeier

--

Abteilungen SAI
und Stochastik

Universität Ulm
Helmholtzstr. 18
Raum E22
0731/50-23575

-
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: @Meta and @InjectMeta with a boolean type

2007-04-22 Thread Paul Stanton
If I change the accessor method boolean isMetaSecure to String 
getMetaSecure it works fine.


So the problem can be defined as: @InjectMeta only works with String 
types. This is obvious after reading the documentation, but the Vlib 
example (written by howard?) is misleading as it suggests usage with 
booleans works.


Paul Stanton wrote:
I saw a neat solution to meta data using annotations in the Vlib 
example that comes bundled with Tapestry 4.1.1.

*Code:*
@Meta({anonymous-access=false, admin-page=false})
public abstract class VlibPage extends BasePage implements 
IErrorProperty,

   IMessageProperty, PageValidateListener, OperationsUser
{
...
   @InjectMeta(anonymous-access)
   public abstract boolean getAllowAnonymousAccess();

   @InjectMeta(admin-page)
   public abstract boolean isAdminPage();
...
   public void pageValidate(PageEvent event)
   {
   if (isAdminPage()) ensureUserIsLoggedInAsAdmin();

   if (!getAllowAnonymousAccess()) ensureUserIsLoggedIn();
   }
...
}

Subclasses of VlibPage can over-ride the value for anonymous-access 
or admin-page using the same @Meta annotation:

*Code:*
@Meta( { page-type=Search, anonymous-access=true })
public abstract class Home extends VlibPage
...



I thought I'd give it a go:

base class for pages, defaults meta value to true
*Code:*
@Meta({meta-secure=true})
public abstract class BasePage extends 
org.apache.tapestry.html.BasePage implements PageValidateListener

{
  @InjectMeta(meta-secure)
  public abstract boolean isMetaSecure();
...
  public boolean isSecure()
  {
 return true;
  }
...
  public void pageValidate(PageEvent event)
  {
 System.out.println(this.getClass().getName() +  - method: + 
isSecure() +  - meta: + isMetaSecure());

  }
...
}



home page over-rides meta value to false
*Code:*
@Meta({meta-secure=false})
public abstract class Home extends BasePage
{
  @Override
  public boolean isSecure()
  {
 return false;
  }
}



list clients page over-rides value to true (for testing purposes)
*Code:*
@Meta({meta-secure=true})
public abstract class ListClients extends BasePage
...



list projects page does not over-ride super value
*Code:*
public abstract class ListProjects extends BasePage



unfortunately, it doesn't seem to work. The value always reads false.
*Code:*
$Home_84 - method:false - meta:false
$ListProjects_95 - method:true - meta:false
$ListClients_137 - method:true - meta:false



I've stepped through some stacks and have found that the value is 
being correctly set to the String true and false in the components 
properties, but somewhere between 
ComponentPropertySourceImpl.getComponentProperty and my property 
injected method isMetaSecure, true is not being converted to boolean 
true.


Has anyone come across this problem?

Has anyone successfully used booleans in meta data via the page 
specification as opposed to class annotations?




--
Paul Stanton
Gunn Software
PH: (02) 9918 3666 (ext 503)




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



Re: @Meta and @InjectMeta with a boolean type

2007-04-22 Thread Jesse Kuhnert

Ah...I knew this sounded familiar.

I think it's fixed in 4.1.2-snapshot

https://issues.apache.org/jira/browse/TAPESTRY-1204

On 4/22/07, Paul Stanton [EMAIL PROTECTED] wrote:


If I change the accessor method boolean isMetaSecure to String
getMetaSecure it works fine.

So the problem can be defined as: @InjectMeta only works with String
types. This is obvious after reading the documentation, but the Vlib
example (written by howard?) is misleading as it suggests usage with
booleans works.

Paul Stanton wrote:
 I saw a neat solution to meta data using annotations in the Vlib
 example that comes bundled with Tapestry 4.1.1.
 *Code:*
 @Meta({anonymous-access=false, admin-page=false})
 public abstract class VlibPage extends BasePage implements
 IErrorProperty,
IMessageProperty, PageValidateListener, OperationsUser
 {
 ...
@InjectMeta(anonymous-access)
public abstract boolean getAllowAnonymousAccess();

@InjectMeta(admin-page)
public abstract boolean isAdminPage();
 ...
public void pageValidate(PageEvent event)
{
if (isAdminPage()) ensureUserIsLoggedInAsAdmin();

if (!getAllowAnonymousAccess()) ensureUserIsLoggedIn();
}
 ...
 }

 Subclasses of VlibPage can over-ride the value for anonymous-access
 or admin-page using the same @Meta annotation:
 *Code:*
 @Meta( { page-type=Search, anonymous-access=true })
 public abstract class Home extends VlibPage
 ...



 I thought I'd give it a go:

 base class for pages, defaults meta value to true
 *Code:*
 @Meta({meta-secure=true})
 public abstract class BasePage extends
 org.apache.tapestry.html.BasePage implements PageValidateListener
 {
   @InjectMeta(meta-secure)
   public abstract boolean isMetaSecure();
 ...
   public boolean isSecure()
   {
  return true;
   }
 ...
   public void pageValidate(PageEvent event)
   {
  System.out.println(this.getClass().getName() +  - method: +
 isSecure() +  - meta: + isMetaSecure());
   }
 ...
 }



 home page over-rides meta value to false
 *Code:*
 @Meta({meta-secure=false})
 public abstract class Home extends BasePage
 {
   @Override
   public boolean isSecure()
   {
  return false;
   }
 }



 list clients page over-rides value to true (for testing purposes)
 *Code:*
 @Meta({meta-secure=true})
 public abstract class ListClients extends BasePage
 ...



 list projects page does not over-ride super value
 *Code:*
 public abstract class ListProjects extends BasePage



 unfortunately, it doesn't seem to work. The value always reads false.
 *Code:*
 $Home_84 - method:false - meta:false
 $ListProjects_95 - method:true - meta:false
 $ListClients_137 - method:true - meta:false



 I've stepped through some stacks and have found that the value is
 being correctly set to the String true and false in the components
 properties, but somewhere between
 ComponentPropertySourceImpl.getComponentProperty and my property
 injected method isMetaSecure, true is not being converted to boolean
 true.

 Has anyone come across this problem?

 Has anyone successfully used booleans in meta data via the page
 specification as opposed to class annotations?


--
Paul Stanton
Gunn Software
PH: (02) 9918 3666 (ext 503)




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





--
Jesse Kuhnert
Tapestry/Dojo team member/developer

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


hello

2007-04-22 Thread Donyee

hello

--
Chinese name:徐 依伟
English name: will


Re: @Meta and @InjectMeta with a boolean type

2007-04-22 Thread Paul Stanton

Thanks Jesse! I'll upgrade as soon as 4.1.2 is released.

http://www.tapestryforums.com/

Jesse Kuhnert wrote:

Ah...I knew this sounded familiar.

I think it's fixed in 4.1.2-snapshot

https://issues.apache.org/jira/browse/TAPESTRY-1204

On 4/22/07, Paul Stanton [EMAIL PROTECTED] wrote:


If I change the accessor method boolean isMetaSecure to String
getMetaSecure it works fine.

So the problem can be defined as: @InjectMeta only works with String
types. This is obvious after reading the documentation, but the Vlib
example (written by howard?) is misleading as it suggests usage with
booleans works.

Paul Stanton wrote:
 I saw a neat solution to meta data using annotations in the Vlib
 example that comes bundled with Tapestry 4.1.1.
 *Code:*
 @Meta({anonymous-access=false, admin-page=false})
 public abstract class VlibPage extends BasePage implements
 IErrorProperty,
IMessageProperty, PageValidateListener, OperationsUser
 {
 ...
@InjectMeta(anonymous-access)
public abstract boolean getAllowAnonymousAccess();

@InjectMeta(admin-page)
public abstract boolean isAdminPage();
 ...
public void pageValidate(PageEvent event)
{
if (isAdminPage()) ensureUserIsLoggedInAsAdmin();

if (!getAllowAnonymousAccess()) ensureUserIsLoggedIn();
}
 ...
 }

 Subclasses of VlibPage can over-ride the value for anonymous-access
 or admin-page using the same @Meta annotation:
 *Code:*
 @Meta( { page-type=Search, anonymous-access=true })
 public abstract class Home extends VlibPage
 ...



 I thought I'd give it a go:

 base class for pages, defaults meta value to true
 *Code:*
 @Meta({meta-secure=true})
 public abstract class BasePage extends
 org.apache.tapestry.html.BasePage implements PageValidateListener
 {
   @InjectMeta(meta-secure)
   public abstract boolean isMetaSecure();
 ...
   public boolean isSecure()
   {
  return true;
   }
 ...
   public void pageValidate(PageEvent event)
   {
  System.out.println(this.getClass().getName() +  - method: +
 isSecure() +  - meta: + isMetaSecure());
   }
 ...
 }



 home page over-rides meta value to false
 *Code:*
 @Meta({meta-secure=false})
 public abstract class Home extends BasePage
 {
   @Override
   public boolean isSecure()
   {
  return false;
   }
 }



 list clients page over-rides value to true (for testing purposes)
 *Code:*
 @Meta({meta-secure=true})
 public abstract class ListClients extends BasePage
 ...



 list projects page does not over-ride super value
 *Code:*
 public abstract class ListProjects extends BasePage



 unfortunately, it doesn't seem to work. The value always reads false.
 *Code:*
 $Home_84 - method:false - meta:false
 $ListProjects_95 - method:true - meta:false
 $ListClients_137 - method:true - meta:false



 I've stepped through some stacks and have found that the value is
 being correctly set to the String true and false in the components
 properties, but somewhere between
 ComponentPropertySourceImpl.getComponentProperty and my property
 injected method isMetaSecure, true is not being converted to boolean
 true.

 Has anyone come across this problem?

 Has anyone successfully used booleans in meta data via the page
 specification as opposed to class annotations?


--
Paul Stanton
Gunn Software
PH: (02) 9918 3666 (ext 503)




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







--
Paul Stanton
Gunn Software
PH: (02) 9918 3666 (ext 503)




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



Re: hello

2007-04-22 Thread Jesse Kuhnert

stop it.

On 4/22/07, Donyee [EMAIL PROTECTED] wrote:


hello

--
Chinese name:徐 依伟
English name: will





--
Jesse Kuhnert
Tapestry/Dojo team member/developer

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