Re: form validation question

2006-07-03 Thread Paul Cantrell
I'll throw in my endorsement for (1). Often, we programmers get too  
wrapped up in try to use some clever framework feature for every  
minute detail ... when sometimes, it's simpler just to write a few  
lines of code.


A listener which first performs validation before processing is easy  
to write, easy to read, and extremely flexible. I'm not saying it's  
the best way to do everything; it's just an option people often  
overlook.


Here's a more complete example:

@Bean( value=ValidationDelegate.class )
public abstract IValidationDelegate getValidation();

@Component(
type=TextField, id=email,
bindings = { value=email } )
public abstract TextField getEmailComponent();
public abstract String getEmail();
public abstract void setEmail(String value);

@Component(
type=TextField, id=password,
bindings = { value=password, hidden=true } )
public abstract TextField getPasswordComponent();
public abstract String getPassword();
public abstract void setPassword(String value);

public IPage logIn()
{
if(isBlank(getEmail()))
getValidation().record(
getEmailComponent(),
Please enter the email address for your account.);

if(!matchPassword(getEmail(), getPassword()))
getValidation().record(
getPasswordComponent(),
Sorry, this is the wrong password.);

if(getValidation().getHasErrors())
{
// take action to prevent commit if necessary
return this;
}

// --- Success ---

// ... do work ...
// ... commit work ...

return successPage;
}

Cheers, P


On Jul 3, 2006, at 1:46 PM, Richard Clark wrote:


You can either:
1) Do all the validation in your listener (on the Java side), or
2) Write your own client-side valdation code in JavaScript.

The server-side validation would look like this:

ValidationDelegate delegate = (ValidationDelegate)getComponent 
(delegate);

if (!getCheckbox()) {
 String firstName = getFirstName(); // @Text component bound to  
firstName

 if (firstName == null || firstName.length() == 0) {
   delegate.setFormComponent((IFormComponent)getComponent 
(inputFirstName));

   delegate.record(Please supply a first name,
ValidationConstraint.REQUIRED);
 }
}
if (delegate.getHasErrors()) return;


...Richard

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




_
Piano music podcast: http://inthehands.com
Other interesting stuff: http://innig.net



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



Listener delegating causes NullPointerException

2006-06-23 Thread Paul Cantrell
The basic problem: one page's listener calls another page's listener  
(after activating the other page). The other page records a  
validation error, and that causes a NullPointerException deep in  
Tapestry's guts.


The details:

I have two pages (Subscribe and SubscribeAlternateLink), both of  
which involve the user entering/selecting a URL. Once the URL is  
entered, they share the same logic -- and I want either one of them  
to end up on the Subscribe page in case of an error.


So I have this page delegate its subscribe() listener to the other page:

public abstract class SubscribeAlternateLink extends MyBasePage {
...
public IPage subscribe(String url) {
Subscribe subscribePage = getPage(Subscribe.class);
subscribePage.setUrl(url);
getRequestCycle().activate(subscribePage);
return subscribePage.subscribe();
}
...
}

And the other page has a URL field, which will show the URL the user  
entered, with an error:


public abstract class Subscribe
extends MyBasePage {

@Bean( value=ReaderValidation.class )
public abstract IValidationDelegate getFormValidation();

@Component(type=TextField, bindings = {
value=ognl:url,
validators=validators:required } )
public abstract TextField getUrlField();
public abstract String getUrl();
public abstract void setUrl(String url);

public IPage subscribe() {

if(getFormValidation().getHasErrors())
return this;

try {
// ... do subscription ...
} catch(SubscriptionException e) {
getFormValidation().record(getUrlField(),  
e.getMessage()); // ***

return this;
}
// ... follow-up stuff ...
}
}

When submitting from the Subscribe page, errors get recorded fine.

When submitting from the SubscribeAlternateLink, I get an exception  
on the line marked ***:


java.lang.NullPointerException: Parameter fieldName must not be  
null.

• org.apache.hivemind.util.Defense.notNull(Defense.java:41)
• org.apache.tapestry.valid.FieldTracking.init(FieldTracking.java:59)
	• org.apache.tapestry.valid.ValidationDelegate.findCurrentTracking 
(ValidationDelegate.java:279)
	• org.apache.tapestry.valid.ValidationDelegate.record 
(ValidationDelegate.java:225)
	• org.apache.tapestry.valid.ValidationDelegate.record 
(ValidationDelegate.java:207)
	• org.apache.tapestry.valid.ValidationDelegate.record 
(ValidationDelegate.java:240)

• com.dci.cyclonereader.web.Subscribe.subscribe(Subscribe.java:41)
	• com.dci.cyclonereader.web.SubscribeAlternateLink.subscribe 
(SubscribeAlternateLink.java:28)


It looks like the URL component on the Subscribe page isn't fully  
initialized. Is this a bug? Or do I need to do something more to  
initialize the Subscribe page?


Cheers,

Paul


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



Re: HTML editor for tapestry

2006-05-31 Thread Paul Cantrell
It is worth pointing out that neither of these works in Safari, the  
default browser on the Mac. FCK blames Safari:


http://www.fckeditor.net/safari.html

...but the bottom line is, it's probably not a good idea to use these  
for a public site.


Of course, if you're doing an internal app, it may not matter.

P

On May 31, 2006, at 1:04 PM, Shing Hing Man wrote:


There are a couple  (FCKEditor and JSEditor) in tassle


http://equalitylearning.org/Tassel/app

Both of them have online demos at the following
respectively.

http://www.hannebauer.org/jseditordemo/
http://lombok.demon.co.uk/tapestry4Demo/app


Shing




--- Carl Pelletier [EMAIL PROTECTED] wrote:


Hi everyone, I looking for a HTML editor component.
Someone can point me on where I can find that
information ? I search on google and found that
somebody have port FCK Editor to Tapestry, but The
link doesnt work anymore.

Thanks for any help !

Carl Pelletier




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

Send instant messages to your online friends http:// 
uk.messenger.yahoo.com


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




_
Piano music podcast: http://inthehands.com
Other interesting stuff: http://innig.net



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



Re: Does Tapestry work with XHTML?

2006-05-29 Thread Paul Cantrell
Right. And just to be clear: the .xhtml is not necessary for XHTML,  
not just for Tapestry, but in *any* content -- and I don't think the  
text/xml mime type is necessary either. It's the DOCTYPE that has  
the last word.


Use the W3C validator when in doubt! Use it when not in doubt, too.

Cheers,

Paul


On May 29, 2006, at 2:11 AM, Kristian Marinkovic wrote:


hi,

to use XHTML it is NOT necessary to rename the .html file  
to .xhtml. all

you
have to do is to add the dtd and the ?xml. the only reason i  
could

imagine you want to rename it to .xhtml is because you could configure
your webserver to set the correct mime-type (text/xml). but if you  
do so

IE6 (and before) won't be able to display your document correctly.

btw. if you put ?xml version=1.0 encoding=UTF-8? into
your document IE6 will run in quirksmode and not in standard compliant
mode! this may cause some misbehaviours when using css :)  
(boxmodel...)

 although it is not absolutly correct you may omit
?xml version=1.0 encoding=UTF-8?
completly (or you generate it depending on the current
browser :)).


regards,
kris





 Galam
 [EMAIL PROTECTED]
  
omAn

Tapestry users
 29.05.2006 04:32   users@tapestry.apache.org
 K 
opie


  Bitte  
antwortenThema

an  Does Tapestry work with XHTML?
 Tapestry users
 [EMAIL PROTECTED]
pache.org







Hi all,

Does Tapestry work with XHTML?

I renamed Home.html to Home.xhtml in my test application, but I  
got an

exception saying that

Could not find template for page Home in locale en_US.


---

org.apache.hivemind.ApplicationRuntimeException Could not find  
template for

page Home in locale en_US. component: [EMAIL PROTECTED]  location:
context:/WEB-INF/Home.page,
line 4, column 55
  1 ?xml version=1.0 encoding=UTF-8? 2 !DOCTYPE page- 
specification
PUBLIC -//Apache Software Foundation//Tapestry Specification 4.0// 
EN 3 

http://jakarta.apache.org/tapestry/dtd/Tapestry_4_0.dtd; 4
page-specification
class=com.ttdev.HelloWorld.Home 5 component id=subject  
type=Insert

6 binding name=value value=greetingSubject/ 7 /component 8
/page-specification



Thanks!



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




_
Piano music podcast: http://inthehands.com
Other interesting stuff: http://innig.net



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



@Meta doesn't allow different template extension

2006-05-28 Thread Paul Cantrell
I expected that adding this annotation would allow me to name the  
template Foo.xml instead of Foo.html:


@Meta(org.apache.tapestry.template-extension=xml)
public class Foo extends BasePage { ... }

However, when I do this, Tapestry gives a PageNotFoundException. It  
looks like it never finds the class to find the annotation in the  
first place.


Am I missing something stupid, or should I file this in JIRA?

Cheers,

Paul

_
Piano music podcast: http://inthehands.com
Other interesting stuff: http://innig.net



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



Re: Template parser chokes on CDATA?

2006-05-24 Thread Paul Cantrell
This is the best thing to do. It buys you some excellent (though very  
poorly documented) functionality for doing substitutions in your JS  
code, too.


In spite of this good solution, it is really unfortunate that the  
Tapestry parser doesn't understand CDATA.


P

On May 24, 2006, at 2:59 PM, Erik Husby wrote:

Or choose the simple way out and put the javascript into a Tapestry  
Script file.


span jwcid=@Script script=MyJavascript.script/
---
Erik Husby
Senior Software Engineer
Broad Institute of MIT and Harvard
Rm. 2192, 320 Charles St, Cambridge, MA 02141-2023
mobile: 781.354.6669, office: 617.258.9227
email: [EMAIL PROTECTED] AIM: ErikAtBroad



_
Piano music podcast: http://inthehands.com
Other interesting stuff: http://innig.net



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



Re: Google Web Toolkit

2006-05-21 Thread Paul Cantrell
Horrible, horrible, GridBagLayout I loathe it. What an awful  
mess. CSS is so many thousands of times nicer for doing layout


I am sympathetic to the applets not Javascript argument, though.  
Applets with CSS layout would be especially nice.


But applets don't integrate well with the flow of the web: like Flash- 
based sites, you can't bookmark them, search engines can't index  
them, etc. There are limits to what they're good for. If there were a  
good way to attach Java to a page's DOM, then we'd be cooking.


I wonder how limited GWT is in this respect? Tapestry works very hard  
to respect the client's control of their browser.


P


On May 21, 2006, at 12:47 PM, Konstantin Ignatyev wrote:


http://www.swixml.org/
http://www.java2s.com/Product/Swing/LookAndFeel.htm

And Swing can support any kind of layout managers but I have found  
GridBagLayout to be very flexible and good for nearly everything I  
do with Swing.


Therefore I think it does not make sense to try (re)creating Swing  
in browsers. Applets is what we really need :).



Norbert S�ndor [EMAIL PROTECTED] wrote:The good thing in  
GWT is to use the efficient development style of Swing

(I mean Java only, easy to debug/test) but allow to use the underlying
browser's HTML+CSS capatibilites for layout.



Konstantin Ignatyev




PS: If this is a typical day on planet earth, humans will add  
fifteen million tons of carbon to the atmosphere, destroy 115  
square miles of tropical rainforest, create seventy-two miles of  
desert, eliminate between forty to one hundred species, erode  
seventy-one million tons of topsoil, add 2,700 tons of CFCs to the  
stratosphere, and increase their population by 263,000


Bowers, C.A.  The Culture of Denial:  Why the Environmental  
Movement Needs a Strategy for Reforming Universities and Public  
Schools.  New York:  State University of New York Press, 1997: (4)  
(5) (p.206)


_
Piano music podcast: http://inthehands.com
Other interesting stuff: http://innig.net



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



Re: Google Web Toolkit

2006-05-20 Thread Paul Cantrell
I completely agree with about 90% of what Todd writes. This is  
definitely not a flash in the pan, and the idea of using an  
intermediate language (Java, in this case) that compiles to client- 
side code is a brilliant and revolutionary one.


Finally, there was nothing wrong with the original MVCs. Swing (or  
any other traditional MVC) worked.


Actually, I think Swing kind of sucks, and looked good when it came  
out only because MFC, X, and AWT were so much worse. Swing ain't no  
Cocoa. And honestly, I still kind of miss Metrowerks Powerplant.


But my real concern about GWT is that it appears to bring us back to  
the world where everything is just a mess of one-size-fits-all  
widgets. Konstantin is right, of course -- there is no web text  
editor than can compare to a dedicated text editor rich GUI. The  
reason for that, however, is because people took a *lot* of time to  
work out all the minutiae of making a good UI for editing text.


By contrast, most desktop apps stick their domain into existing  
widgets (one of which is a text editor) instead of going to the  
enormous trouble of build a new, highly specialized UI with custom  
graphics.


DHTML+CSS is quite expressive, but much lower cost, than build a  
custom desktop UI component pixel by pixel. Right now, GWT seems to  
lead away from some of that flexibility, and put us back in the world  
of predefined widgets.


Note that this concern does *not* depend on GWT's fundamental  
architecture, which is quite promising. Rather, it's a complaint  
about GWT's emphasis on widgets and widgety UIs. One need only look  
at Google Maps to see that GWT does not imply ultra-modal widget  
overload hell But will GWT really lead us to fine apps like that?  
Or will it lead us to apps that look like the config dialogs for Word  
(bleah)?


Regardless, it's exciting to live in a world where all these great  
technologies are pushing and learning from one another. Compare that  
to the stagnant software world of ten years ago!


Cheers,

Paul


On May 20, 2006, at 4:12 PM, Todd Orr wrote:


This isn't really a Tapestry vs GWT thing. This is the latest
(greatest?) push to remove the application-web disconnect. If this
means that other frameworks are rendered less effective by comparison,
then so be it. This is evolution at work.

Some posts seem to indicate that this is just some flash in the pan
technology, but there is far more at work here. The development time
may be able to be accelerated to very a large degree thanks to the
traditional java based GUI paradigm being exploited here. This
technology also has the backing of google. At the end of the day, this
is more than just an ajaxy flash in the pan. Look around you. Apps
utilizing this technology are on a very sharp incline. Not because
they are flashy, or at least not just for that reason. These ajaxified
components allow developers to make better use of available bandwidth
at the same time as building more responsive GUIs. Yes, tacos (and
others) have been enabling this, but the leap here is in the learning
curve, time to market, and testability. These are where GWT seems to
be able to shine.

Whether you like the ajax stuff or you prefer the old webapp view is
immaterial. It is happening. It will likely shape the web 2.0 world.
How you make use of these components is up to you, but there hasn't
been anything like this available in such a clean package with such a
major player backing it ever before. If you do not want to leverage
these types of (maybe rehashed) technologies, that's fine. There are a
lot of apps out there that do and there're not all just desktop app
imitators. Check out http://techcrunch.com. There are many, many very
interesting projects that are more than just desktop app wannabes.
Most of these wouldn't be what they are without the aid of ajax and
related technologies.

GWT is compelling and doesn't sit well with devs that have finally
mastered framework X. Sure, it is encouraging a change in design
paradigms. That's the best part. I see the same convo popping up on
many forums. Will there be competitors? Maybe, yes, who cares. IMHO,
one of jee's shortcomings is the lack of focus, but that's another
debate altogether. This is here. It's only in beta and it rocks
already. It hits at an ideal time when development focus is on writing
more efficient and more responsive, and more flashy apps. Few other
frameworks are addressing this. As good as Tacos is, it's clunky by
comparison.

The code in java ideal is the next logical step. I remember how hard
it was for my coworkers to deal with the abstractions that Tapestry
offered over dealing with the servlet api directly. Eventually, these
same people came to appreciate this. The technique that GWT employs is
the same level of shift. We're not only going to isolate you from the
servlet, we're going to isolate you from the web. This is a logical
evolution. The Web is just another view technology. I should be able
to work with 

Re: Persistence misbehavior in T4

2006-05-19 Thread Paul Cantrell
Is the Bean shared across pages? If it is a Tapestry @Bean, I really  
don't think you need to synchronize on it, either. You may, however,  
need to clear it out between requests.


Maybe others can clarify: does Tapestry pool bean instances?

P

On May 19, 2006, at 2:48 AM, Firas A. wrote:



Paul: You should generally not need to synchronize access to instance
fields of a page.
Firas: The synchronized methods are in the JavaBean class  
containing the

subCategories field, not in a page class. Which answers your question.

A little clarification:
CategoryBrowser is a page class (typeof BasePage).
CategoryBrowser uses an instance field, ProductCategory (a javabean)
ProductCategory uses an instance field, subCategories of type List
All operations on subCategories (in ProductCategory!) are synchronized

It's the subCategories that's been kept in memory.

Regards,

/Firas

-Original Message-
From: Paul Cantrell [mailto:[EMAIL PROTECTED]
Sent: den 18 maj 2006 19:39
To: Tapestry users
Subject: Re: Persistence misbehavior in T4

A few general points:

-- An = null initializer for a non-final field is redundant in  
all cases.
-- You should generally not need to synchronize access to instance  
fields of

a page.

Now a question:


In the CategoryBrowser.pageDetached() the ProductCategory property is
set to null.


Don't you mean subCategories is set to null? If it's not, then  
that's your

problem. Page objects get reused.

Cheers,

Paul

On May 18, 2006, at 12:26 PM, Firas A. wrote:


Hello Everyone!

I have a class, CategoryBrowser of type BasePage which has a  
transient
property, a JavaBean called ProductCategory. ProductCategory makes  
use

of an instance field:
private ListCategory subCategories = null;

This list is initialized in CategoryBrowser upon every request.
Every access
to subCategories is synchronized. In the
CategoryBrowser.pageDetached() the
ProductCategory property is set to null.

The problem:
The state of the subCategories field is retained between requests.
During
all subsequent requests after the 1st one, the initial value of
subCategories is not null (dispite the declaration above).

And when this happens the current state of subCategories may even be
observed in another browser/session. Here's the test that I  
performed:


1.  initiate the misbehavior in Firefox

2.  close Firefox and start Opera

3.  browse to the page where subCategories is first initialized

The result: the state of subCategories reflects the state it got in
Firefox (1), i.e. it is was not null upon first request and already
contained some values from the session in Firefox.

Any idea on what's going on?

My platform:
Tapestry 4.0.1 (started with -Dorg.apache.tapestry.disable-
caching=true)
JVM 1.5.0_06-b05 / WinXP SP2
Tomcat 5.5.9
Latest Firefox, Opera and MSIE


Thank you for your time!

/Firas



_
Piano music podcast: http://inthehands.com Other interesting stuff:
http://innig.net




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




_
Piano music podcast: http://inthehands.com
Other interesting stuff: http://innig.net



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



Re: Persistence misbehavior in T4

2006-05-18 Thread Paul Cantrell

A few general points:

-- An = null initializer for a non-final field is redundant in all  
cases.
-- You should generally not need to synchronize access to instance  
fields of a page.


Now a question:

In the CategoryBrowser.pageDetached() the ProductCategory property  
is set to null.


Don't you mean subCategories is set to null? If it's not, then that's  
your problem. Page objects get reused.


Cheers,

Paul

On May 18, 2006, at 12:26 PM, Firas A. wrote:


Hello Everyone!

I have a class, CategoryBrowser of type BasePage which has a transient
property, a JavaBean called ProductCategory. ProductCategory makes  
use of an

instance field:
private ListCategory subCategories = null;

This list is initialized in CategoryBrowser upon every request.  
Every access
to subCategories is synchronized. In the  
CategoryBrowser.pageDetached() the

ProductCategory property is set to null.

The problem:
The state of the subCategories field is retained between requests.  
During

all subsequent requests after the 1st one, the initial value of
subCategories is not null (dispite the declaration above).

And when this happens the current state of subCategories may even be
observed in another browser/session. Here's the test that I performed:

1.  initiate the misbehavior in Firefox

2.  close Firefox and start Opera

3.  browse to the page where subCategories is first initialized

The result: the state of subCategories reflects the state it got in  
Firefox
(1), i.e. it is was not null upon first request and already  
contained some

values from the session in Firefox.

Any idea on what's going on?

My platform:
Tapestry 4.0.1 (started with -Dorg.apache.tapestry.disable- 
caching=true)

JVM 1.5.0_06-b05 / WinXP SP2
Tomcat 5.5.9
Latest Firefox, Opera and MSIE


Thank you for your time!

/Firas



_
Piano music podcast: http://inthehands.com
Other interesting stuff: http://innig.net



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



Re: new logo for Tapestry

2006-05-18 Thread Paul Cantrell

You mean like Ant, Tomcat, Cocoon, Excalibur, and SpamAssassin?

Oh, wait, *none* of them do

http://ant.apache.org/images/ant_logo_large.gif
http://tomcat.apache.org/images/tomcat.gif
http://cocoon.apache.org/images/cocoon-logo.gif
http://excalibur.apache.org/logo.gif
http://spamassassin.apache.org/images/arrowlogo.png

I don't like the version with the feather. It's awkward.

On May 18, 2006, at 3:26 PM, James Carman wrote:


Well, tapestry *is* an Apache top-level project now (and an Apache
product).  I think it's very important that we include the apache
feather.

-Original Message-
From: Konstantin Ignatyev [mailto:[EMAIL PROTECTED]
Sent: Thursday, May 18, 2006 4:22 PM
To: Tapestry users
Subject: Re: new logo for Tapestry

I think the first image is just fine.

IMO logo should be free of any references to Apache or any other  
projects or
organizations for that matter. If there will be Apache feather then  
why now
add that cup of cofee, or make it cup of ink and put the feather in  
it ;).




Borut Bolčina [EMAIL PROTECTED] wrote: Here, I took the liberty of  
recreating

the background. Geoff, I hope you
dont't mind.
http://svarog.homeip.net/tapestry-logo/logo.png

What do you say?

-Borut


Geoff Longman pravi:

Have a look at the Spindle logo at http://spindle.sf.net

Behind the swoopy S is a version of the old T logo I like a lot -
looks like an architectural drawing.

Alas, I lost the original vector artwork for that logo long ago.

Geoff

On 5/17/06, Steven Bell  wrote:

I must say I like Dwi Ardi Irawan's logo for three main reasons.

It's simple.
It scales nicely. (I think this is very important!)
It looks professional.

And on top of that it looks really good.

On 5/17/06, Fernando Padilla  wrote:


I sort of like the basic T logo, this one is along the same lines.

another brainstorm: take a weave pattern like old windows  
background,

but highlight a few bits of the weave to have a T come out of it.
Basically take the current logo, but add a weave pattern in the
background in very light grey..

Dwi Ardi Irawan wrote:

it's just my opinion.
tapestry logo

i think
tapestry logo competition just use for the best logo and

represent the

tapestry meaning

cmiiw






--- 
--

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





--
Regards,

Steven Bell








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




_
Piano music podcast: http://inthehands.com
Other interesting stuff: http://innig.net



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



Re: Integration With EJB3

2006-05-15 Thread Paul Cantrell
This project of mine (in early development) uses EJB3 annotations  
(though it uses Hibernate APIs, *not* EJB3's entity manager):


   http://sourceforge.net/projects/imre

View source here:

http://svn.sourceforge.net/viewcvs.cgi/imre/trunk/imre/
http://svn.sourceforge.net/viewcvs.cgi/innig-util/trunk/innig- 
framework/


Or check out a local copy if you have Subversion:

svn co https://svn.sourceforge.net/svnroot/imre/trunk/imre/
svn co https://svn.sourceforge.net/svnroot/innig-util/trunk/ 
innig-framework/


For the answer to your include question, read the docs and scan the  
list archives for directions on create components. Components are  
essentially includes that are optionally backed by additional code.


Cheers,

Paul


On May 12, 2006, at 5:14 AM, Ing.Stefano Girotti wrote:


Hi to all i'm new to the use of Tapestry,
i'm looking for someone/something about Java enterprise with  
Tapestry  EJB3,
cookbook, tutorial, examples, best practices, jsp equivalent... for  
example how
i can include a tapestry sub page in a tapestry page like i did in  
a jsp with:


jsp:include page=

Thanks in advice
Stefano


_
Piano music podcast: http://inthehands.com
Other interesting stuff: http://innig.net



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



Re: component that will get localized resources from database?

2006-05-15 Thread Paul Cantrell
There is no obligation to use Hivemind if it is not appropriate to  
your problem. Hivemind is useful for decoupling parts of the system,  
and for making aspecty customization that cut across the framework.  
If you don't need decoupling, and don't need to customize across the  
whole framework, perhaps you don't need to bother with Hivemind.


So there may be a Hivemind way to inject a different message worker  
into only certain classes, but I would guess overriding getMessages()  
is probably just fine. Did you try it? Does it work? Is it simple? If  
so, no worries!


Cheers, P

On May 15, 2006, at 10:57 AM, Lutz Hühnken wrote:


Hi there,

assume you want to create a localized tapestry application, but there
are localized messages that you don't want to store in a properties
file / text file.

In a plain Java application, you could just write your own
implementation of ResourceBundle, that could take the messages from
anywhere, e.g., a database, and use that instead of
PropertyResourceBundle.

With Tapestry, it seems to be more complicated, though. If I
understand correctly, the AbstractComponent is enhanced by an
InjectMessagesWorker, as defined in tapestry.enhance.xml. The
InjectMessagesWorker will inject a getMessages() method that will
return the result of ComponentMessagesSource.getMessages(IComponent).

Now, that's not what I want...

A straight-forward approach would be to override getMessages() in my
own component. Would that work? To me it seems to collide with the
Hivemind enhancement/injection approach.

Alternatively, I could probably change the InjectMessagesWorker to
something of my own liking. But that would affect *all* components
(that inherit from AbstractComponent), while I would like the modified
behaviour just for my own. Plus, I don't really want to mess with the
tapestry.enhance.xml, since it is part of the packaged Tapestry
distribution.

So what would be the proper way to do it? Can I override the
inject-messages command from tapestry.enhance.xml for my own
components? How?

Thanks in advance,

Lutz

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




_
Piano music podcast: http://inthehands.com
Other interesting stuff: http://innig.net



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



Re: listeners in component

2006-05-15 Thread Paul Cantrell
Make your component accept the listener as a parameter. Listeners can  
be passed just like any other component parameter.


P

On May 15, 2006, at 3:23 PM, Carl Pelletier wrote:

Hi, How can I call the listener of a button in a form when I am in  
the listener of my component ?


Thanks !

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




_
Piano music podcast: http://inthehands.com
Other interesting stuff: http://innig.net



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



Re: Setting system configuration for components

2006-05-15 Thread Paul Cantrell
If a value is only used by one component, put the default in the  
component spec.


If a value is shared across components, you could create an ASO with  
global scope and inject it into your components -- or you could go  
old-school, and just create a MyComponentSettings singleton and use it.


P

On May 15, 2006, at 3:04 PM, Dan Adams wrote:


I have a library of components that are used by a couple different
projects. One of the things I would like to do is to set system-wide
defaults for each project that would be used by the components so they
didn't have to be specified each time the component was used. I could
also create a wrapper component to set the properties but in this case
that is not optimal. Anyone know of a way other than setting system
properties that could do this? Something like setting it in a  
properties

or config file somewhere.

--
Dan Adams
Software Engineer
Interactive Factory
617.235.5857


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




_
Piano music podcast: http://inthehands.com
Other interesting stuff: http://innig.net



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



Re: JCaptcha Integration...

2006-05-12 Thread Paul Cantrell
Cool! Can you post a link? http://tapestry.javaforge.com/ is coming  
up blank from here.


On May 12, 2006, at 1:22 PM, James Carman wrote:


The application has changed a bit.  I've now made the JCaptcha stuff a
component library.  The example application uses it as a component  
library.
The code is available in the tapestry-javaforge project as a  
submodule.


-Original Message-
From: James Carman [mailto:[EMAIL PROTECTED]
Sent: Friday, May 12, 2006 11:50 AM
To: 'Tapestry users'
Subject: JCaptcha Integration...

Just for fun (man I need a life), I tried out integrating JCaptcha
(jcaptcha.sourceforge.net) into my tapernate-example  
application.  If

anyone's interested in the code, it's available via SVN at:

www.carmanconsulting.com/svn/public/tapernate-example

It defines a new validator type for input fields called captcha  
and a

JCaptchaImageService engine service for rendering the CAPTCHA images.
Enjoy!

James

p.s. I'll probably make this a component library and make it  
available at

the tapestry-javaforge project.



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




_
Piano music podcast: http://inthehands.com
Other interesting stuff: http://innig.net



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



Re: [Tapestry]

2006-05-10 Thread Paul Cantrell
Filter on the List-Id header (it should be  
users.tapestry.apache.org).


I'd rather not have the [Tapestry] prefix, since the header is there.

P

On May 10, 2006, at 10:48 AM, Mark Stang wrote:


Could we get a tag in the Subject for Tapestry?

All of my filters are looking for it and now that it is gone, my in- 
box is starting to look like a Tapestry Meeting Room.


thanks,

Mark


_
Piano music podcast: http://inthehands.com
Other interesting stuff: http://innig.net



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