public abstract Boolean isQuery()

2007-03-13 Thread Murray Collingwood
Hi all

Just trying to clarify my understanding.  I had some code that looked like the
following:

@Persist
public abstract Boolean isQuery();

The above code gives me an error, 'no implementation in class', and it took me a
while but I finally figured the problem that the enhanced class was not
identifying the Boolean.  It took a while longer for me to realise it was
because I didn't have a valid 'getter'.  I had to change the above to:

@Persist
public abstract Boolean getQuery();

Suddenly everything started working!  

So, why doesn't the enhanced class identify these boolean style function names.
 I thought this was some standard that ALL property functions were fetched using
get* and ALL boolean values fetched using is*.

Question:

1. Should I code all of my booleans using get* in future?

2. How does OGNL now deal with a boolean value returned via a get*?  Do I need
to modify my OGNL conditions?

Cheers
mc



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



Re: Record locking

2007-02-20 Thread Murray Collingwood
Wow - what a lot of responses.

First a little more detail - use case (for example):

Take a customer record, a basic record has previously been created and the
customer has completed some forms so we are now wanting to complete all of the
details about contact information, financial details, key assets, health
information, etc, etc.  The system relies on a number of classifications which
need to be looked up, anyways, editing this record can take upto 20 minutes. 
The size of this record certainly justifies breaking it up into a number of
smaller records stored in separate tables, however the same problem remains
because the user wants to see all of this information on 1 (scrollable) web
page, we are still holding a lock on the information for the duration of the
request.

Potentially there are maybe 700 people who could be editing this record for
different reasons.  Accuracy of the information is critical - we don't want
personal details being sent to a neighbour.

The nature of the application means that users will be reviewing a record each
year, and if any changes are made they are often made to the same record around
the same time of the year - increasing the possibility of two people wanting to
edit the record at the same time.

Besides all of the above, the user has asked for exclusive editing of a record -
such that other users can still read the existing record but nobody else can
update the record while it is locked.  The user understands the concept of
networks issues and broken connections and therefore accepts a timeout condition
on the lock of say 20 minutes.

Next, how I will do this:

1. To establish a lock:
 a. I need a LOCK table: foreign-key, timestamp, userid
 b. In my Session I need a collection of timestamps
 c. Create a timestamp value - add it to my collection of timestamps
 d. Add a record to the LOCK table using my timestamp value
 e. Select from the lock table by foreign-key - if mine is the only record then
read the record and begin editing, the lock was successful

2. Release the lock: (PS This is the difficult bit)
 a. Retrieve the LOCK records by foreign-key and userid, hopefully there should
only be one.
 b. Check the timestamp value against my Session collection of timestamp values
 c. If the timestamp is in my collection then save the edited record and delete
my LOCK record
 d. If the timestamp is not in my collection then the save has failed - tell the
user gently

3. Dealing with an existing lock:
 a. While trying to establish a lock I find 2 LOCK records
 b. The latest record is mine, ignore that and look at the earlier record
 c. Look at the timestamp on the earlier record, if older than 20 minutes then
delete this record and continue as normal
 d. Look at the userid on the earlier record, if it is mine then delete it and
continue as normal (assumes my browser died, rebooted my computer, whatever,
it's very typical for people to go straight back to what they were doing when
their system crashed)
 e. If the timestamp is less than 20 minutes old then delete my LOCK record and
report to the user that the record is locked by another user

4. You may want a maintenance process that cleans up broken locks, automatically
deleting locks with a timestamp older than 24 hours.  You could schedule this
nightly or weekly - it's not critical.


Why the collection of timestamps?

1. It allows the user to use the back button on the browser, either during
editing or after editing (if it didn't save correctly the first time).

2. They might need to edit a related record in a different table as part of
updating the main record - by storing each timestamp in a session collection we
don't need to maintain these timestamps on our forms.


Why add the lock record first?

To avoid sequence problems like:
a: User 1 looks for lock on id=1 - none found
b: User 2 looks for lock on id=1 - none found
c: User 1 adds a lock record
d: user 2 adds a lock record 

Now the worst possible outcome is:
a: User 1 adds a lock record on id=1
b: User 2 adds a lock record on id=1
c: Both users read and find two records with short timestamps - they are both
informed the record is in use and to try again later - both records are deleted.


Finally - the weakness:

1. The lock this gives you is only guaranteed for 20 minutes.  Once that time is
up somebody else can overwrite your lock with their own.  It is better to set
this timeout higher rather than lower.

2. You can overwrite your own lock.  A user could open two browsers and edit the
same record in each, the latter save overwriting the first.  Hmmm, I think this
comes under 'user error'.


I think that explains it fairly well.

Cheers
mc



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



Re: Record locking

2007-02-19 Thread Murray Collingwood
James Carman james at carmanconsulting.com writes:
 You can use optimistic locking.  When the user submits and they have
 outdated data, then you just merge the object's data with what is in
 the data store and show it back to the user for them to confirm it.

In an application where the user can spend 20 minutes completing the information
in a row, they are not going to be happy when they find out somebody else has
been updating this same row and the information has all been merged.  They then
spend another 10 minutes cleaning up all of the duplicated changes.

Even pessimistic locking is not sufficient.  

I need guaranteed write-exclusive locking for the duration of the request. ie
when I read-for-update the record should be locked against all other
read-for-update requests until I save my changes and release the lock.

It sounds as though I'm going to have to write my own...again.

Cheers
mc





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



Record locking

2007-02-18 Thread Murray Collingwood
Hi all

Many years ago I wrote a web application that utilitised a proprietary database.
 The database supported record locking however it was not suitable for a web
application.  So, I wrote a facility I called 'Long Locks'.  It required a
timestamp field be added to each table.  When a web user wanted to edit a record
they would check if the timestamp field was null, if so they wrote a timestamp
into the record and sent this along with the data to the user (the timestamp was
not visible by the user).  After they had completed updating the details (which
could take upto 20 minutes) they could then save the record, the timestamp would
be compared with the entry on the record and if they matched the update would be
committed.

This enabled a number of key features:

1. I was able to guarantee write access for a user when they requested a record
for update.  (If the record was already long-locked I would inform the user the
record was locked by another user).

2. I was always able to read the record

3. If a user abandoned a long-locked record the lock would eventually expire (we
set this to 20 minutes for our application)

I have been reading through a number of record-locking strategies but it seems
most of them are optimistic in that they hope nobody else has updated the record
since it was read, and in the event that it was all of your changes are lost. 
This is very frustrating for the user has just spent 20 minutes entering data!

I'm happy to write my own locking system again.  I was just wondering if anybody
knew of a better way - something to save me writing my own system again?

Cheers
mc



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



Re: Record locking

2007-02-18 Thread Murray Collingwood
Hi

Jesse Kuhnert jkuhnert at gmail.com writes:
 hibernate.org

This is a rather simplistic answer, however I have been away and read the
documentation and am not convinced that this is providing a method that will
warn a user if somebody else if already updating a record.

Even this example of pessimistic locking appears to allow for previous data
changes to be overwritten:
http://forum.springframework.org/archive/index.php/t-10188.html

What would convince me?

An example of a read-for-update operation that returned a condition (or
exception) indicating that the requested object was currently locked by another
user.  I'm yet to find that in Hibernate.

Cheers
mc



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



Re: Example tapestry 4.1 with ajax style calls

2007-02-16 Thread Murray Collingwood
Hi guys

Great responses - both were exactly right.

However both lacked any reference to a simple example to get Ajax calls working
in Tapestry 4.1.  If anybody has one I'd be keen to see it?

I have watched this list long enough to know it is possible yet as much as I try
I'm still not getting the page portion updating - and worse, there are no
obvious errors happening either.

I'm using Firefox/Firebug which is really helpful:

I'm sending:
GET http://localhost:8080/cabs/order/Main,$DirectLink_1.sdirect?
  sp=S3updateParts=orderareabeventtarget.id=DirectLink_1
  beventname=onClickdojo.preventCache=1171662192656

And being returned is:
ajax-response/ajax-response

As background, this is supposedly creating a tab style page, and when a tab is
clicked the area inside div id='orderarea'the tabs area included in here along
with the main tab area/div should be updated.  

So, I'm going to assume my html is correct, however just for the record:
div id='orderarea'
...
a jwcid=@DirectLink listener=listener:changeTab 
   parameters=4 async='true' class=tab
span jwcid='@Insert' value='ognl:getTabtext(4)'Dates/span
/a
...
/div

Most of the action happens in the java file associated with this page:

public abstract class Main {

private static final String tabtext[] = { 
   Customer,
   Style,
   Components,
   Dates  };

public String getTabtext(Integer ix) {
return tabtext[ix.intValue()-1];
}

public void changeTab(IRequestCycle cycle) {
Object[] parameters = cycle.getListenerParameters();
Integer iix = new Integer((String) parameters[0]);
setCurrentTab(iix);
System.err.println(Set tab to  + iix.intValue());
cycle.getResponseBuilder().updateComponent(orderarea);
System.err.println(Requested update to 'orderarea');
}

public abstract Integer getCurrentTab();
public abstract void setCurrentTab(Integer ct);

// Plus some other stuff which is irrelevant
}

Is there something I'm missing here?  All of the log messages appear as expected
when I click the tab, so I know it's running, there's just no content coming
back in the response.

Cheers
mc



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



Re: Example tapestry 4.1 with ajax style calls

2007-02-16 Thread Murray Collingwood
Thank you once again - another perfect answer.

 div jwcid=orderarea at Any
 // content
 /div

In deed the use of div id=orderarea was not sufficient.  I updated it as
suggested and suddenly I began getting ajax responses as expected.

Cheers
mc


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



Re: My crap development environment

2007-02-15 Thread Murray Collingwood
Hi all

Does anybody else find this hellishly confusing?  It makes me want to throw
everything out and go back to a nice simple DOS system and a Turbo C compiler! 
How much simpler it was back then...

Okay, I downloaded the latest Eclipse system, copied my project into a fresh
workspace.  Saving a file was back to a sub-second response.  Actually I tried
saving a second file to make sure it wasn't a fluke the first time.  There was
definitely a problem somewhere and it has now gone away.

Okay, now the second part of the problem.

Tomcat or Jetty???

I don't want to package every time I make a small change to a config file or
HTML, so I want the servlet engine to use my files from my development area.  My
previous frustrations with restarting tomcat have encouraged me down the Jetty
track - I downloaded Jetty 6 yesterday and the test system was working in about
5 minutes, pretty good.  I then added a context.xml for my application and now
when I start Jetty it simple crashes and refuses to start the application.  I
get an error like:  'No class for Servlet or Filter'

I haven't been able to find any help on this error.

I did find information on a Jetty-Maven-Plugin but form my reading this is all
about packaging the application - I don't want to go there.  I also found a
number of recent comments about Maven2 saying it was still quite buggy.

Do I press ahead trying to solve the Jetty stuff or do I revert back to a Tomcat
system???

I'm developing in a Windows XP environment so this may limit me from some of the
options suggested here.

PS Thanks to everybody who has contributed so far - I really appreciate your
ideas and suggestions.  You really are a very friendly bunch of people.

PPS My computer is an Intel 2.8ghz processor with 1gb ram and 80gb harddrive. 
It's not slow with other stuff.

Cheers
Murray

Some of my understandings:
Sysdeo-tomcat-plugin - packages app and restarts Tomcat
WTP - packages app and restarts Tomcat
Web Standard Tools - I was using this
AJDT - never used it
Jetty6 plugin - is this the Jetty-maven-plugin referred above of different?


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



Tapestry 4.1 startup errors

2007-02-14 Thread Murray Collingwood
Hi all

I'm getting this error:
 Error: An error occured processing annotation
@org.apache.tapestry.annotations.InjectObject(value=spring:userService) of
public abstract com.cabs.services.UserService
com.cabs.pages.Home.getUserService(): Property 'beanFactory' of 
SingletonProxy for hivemind.lib.DefaultSpringBeanFactoryHolder(
org.apache.hivemind.lib.SpringBeanFactoryHolder) is null.

I'm getting really frustrated with Eclipse.  I started by adding a user 
library called Tapestry411 and placing all of the JARs in this user library.
Eclipse would say that it was publishing the application but the user library
was never copied over.

So, I moved all of the jars to the WEB-INF/lib folder in my development area,
however Eclipse doesn't recognise the WEB-INF/lib folder as a library of jars
and so it reports all of these errors that it can't find classes.  So I left all
of the jars in the WEB-INF/lib folder in my dev area and created a user library
that located the jars in the WEB-INF/lib folder (I feel like I'm jumping through
hoops because Eclipse isn't working like it should).  Finally I publish the
application and everything gets copied except for the jars.  I start tearing my
hair out at this point.

In utter frustration I then manually copy all of the jars into the WEB-INF/lib
folder of the server.  

The server now starts up without any obvious errors.  When I try to use the
application the above error occurs (before the first screen is displayed).

Cheers
mc



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



Re: Tapestry 4.1 startup errors

2007-02-14 Thread Murray Collingwood
James Carman james at carmanconsulting.com writes:
 Have you tried maven2?  It, along with its Jetty launcher for testing,
 might help your situation.  As for the error you're getting, are you
 using tapestry-spring?

Thanks James

Adding the tapestry-spring.jar file to the other jars solved the problem.  I
kind of assumed anything with Tapestry in the name would be downloaded in a new
version.

Next problem:

My first page now appears but I get these error messages appearing at the end:

FATAL exception raised: Could not load 'dojo.logging.Logger'; 
  last tried '__package__.js'
FATAL exception raised: Could not load 'dojo.logging.Logger'; 
  last tried '__package__.js'
FATAL exception raised: Could not load 'dojo.html.selection'; 
  last tried '__package__.js'

Cheers
Murray

PS What's maven2?  And if I install it what can I uninstall - or what does it
replace?





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



Re: Tapestry 4.1 startup errors

2007-02-14 Thread Murray Collingwood
Murray Collingwood murray.collingwood at gmail.com writes:
 FATAL exception raised: Could not load 'dojo.logging.Logger'; 
   last tried '__package__.js'
 FATAL exception raised: Could not load 'dojo.logging.Logger'; 
   last tried '__package__.js'
 FATAL exception raised: Could not load 'dojo.html.selection'; 
   last tried '__package__.js'

I found a previous entry with this error and a link to a small sample
TimeTracker app that Jesse had done.  Okay, so we now drop all of the dojoBlock
stuff - it's all automatic.

So far it seems to be working.

Cheers
mc


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



My crap development environment

2007-02-14 Thread Murray Collingwood
Hi all

I have suffered long and hard under Eclipse and Tomcat.  Is it really necessary
for me to wait so long while a file is saved or an application is published???

Saving a .java file: 15 seconds
Saving a .html file: 15 seconds
Saving a .jwc file: 28 seconds

Stopping the tomcat server: 2 seconds (acceptable)
Publishing to the tomcat server: 45 seconds
Starting the tomcat server: 54 seconds (it insists on publishing first)

Does everybody else experience these delays or is it just me?

It was suggested that I use maven2 - however I looked through the maven2
flash presentation and it didn't mention anything about making my development
work in Eclipse faster - it was more focused on pulling dependencies and 
easing the build process.  And if I were to install maven2 would it change any
of the above anyway???

Cheers
mc


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



Example tapestry 4.1 with ajax style calls

2007-02-14 Thread Murray Collingwood
Hi all

I hunted for ages and haven't been able to find any simple examples of how to
use the Ajax features of Tapestry 4.1.  Sorry guys, it's just not obvious from
the documentation how it works.

You would think a basic @DirectLink with updateComponents and async=true would
do it - nah, didn't work for me:

a jwcid=@DirectLink listener=listener:changeTab 
   parameters=2 
   updateComponents=orderarea 
   async='true' 
   class=tab
Text/a

public void changeTab(IRequestCycle cycle) {
Object[] parameters = cycle.getListenerParameters();
Integer iix = (Integer) parameters[0];
setCurrentTab(iix);
System.err.println(Set tab to  + iix.intValue());
}

The page displays but when I click the above link it disappears and I see part
of an exception output display.

If somebody can point me at a simple Ajax enabled app using Tap 4.1 would
probably help me greatly.

Cheers
mc


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



What's with the library directory structure?

2007-02-13 Thread Murray Collingwood
Hi all

I'm in the midst of upgrading from Tap 4.0 to 4.1.

I downloaded the Tapestry 4.1 binaries, however what I found was a directory
called 'modules' with subdirectories for a whole bunch of things like,
'backport-util-concurrent', 'commons-beanutils', 'hivemind', 'hivemind-lib', etc
etc.  I'm sure you know what I'm talking about.  Every Jar is in a different
sub-directory.

My question is, why is the distribution split up this way? Aren't we all simply
copying them into a single directory ('WEB-INF/lib')?  Is there some purpose to
this directory structure that I'm not aware of???

Cheers
mc


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



IPropertySelectionModel - what they don't write in the documentation

2007-02-12 Thread Murray Collingwood
Hello tapestry experts

The API documentation for IPropertySelectionModel is lacking key information. 
In particular how the initial value is defined.

What it should say is stuff like:

To set the initial value of the HTML select element you need to bind a value to
this control.  The type of value bound is important  [This is where somebody
else needs to take over.]

I have spent all day trying to initialise a value in my HTML select element.  I
had searched through the lists and the web but I didn't find anything like what
I was experiencing.  Check out this:

I had a static list of security levels:
private static final String[] textOptions = new String[]{
(none),
Quoting,
Ordering,
Shop manager,
Manages all shops,
Office staff,
Administrator
};

and some standard functions in my selection model:
public int getOptionCount() {
return textOptions.length;
}

public Object getOption(int index) {
return new Integer(index);
}

public String getLabel(int index) {
return textOptions[index];
}

public String getValue(int index) {
return String.valueOf(index);
}

public Object translateValue(String value){
return Integer.parseInt(value);
}   


and very normal stuff in my .page file:
component id=securityField type=PropertySelection
binding name=model   value=bean:securitySelectionModel/
binding name=value   value=user.security/
/component

bean name=securitySelectionModel class=SecuritySelectionModel/

All of this I had done before and everywhere else it was working fine.  But
suddenly this one didn't work.  Then it occured to me, maybe the value from
user.security wasn't being passed correctly.

public void setSecurity(short security) {
this.security = security;
}
public short getSecurity() {
return security;
}


It's a short!  Okay, so how does that affect setting the initial value for my
select.  I read through the documentation over and again, search the lists,
absolutely nothing.  It shouldn't affect it.  My other examples were of type
'int' and my guess is that Tapestry would cope with translating a short to an
int - not a chance.  I tried adapting the translateValue() function to return
Short.parseShort(value) but this still didn't work.  What else am I supposed to
change???

It appears that IPropertySelectionModel only works with integer values!  I
finally made a work around that looks like this:

binding name=value   value=user.securityint/
and
public int getSecurityint() {
return (int) security;
}
public void setSecurityint(int sec) {
this.security = (short) sec;
}

How sad is that!

Okay, what should I have done?

Cheers
Murray



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



Re: Contrib:Table problems with layout

2006-08-10 Thread Murray Collingwood
This sounds like an HTML issue.

Tapestry components are added into standard HTML, they do not generate any 
different 
HTML than you have already specified.

For example, you say the contribTable appears at the right of the page, perhaps 
you are 
specifying widths on your static tables - maybe you need to add the width 
parameter to your 
contribTable.

Cheers
mc

On 10 Aug 2006 at 18:48, Vinicius Carvalho wrote:

 Hello there! *I've seen some discussions regarding this topic but
 didn't find one that could help* I was having problems with the layout
 of my table, but I was ignoring, thinking that might have been a tag
 opened that I left open. Today I look it closer and found out that
 seems to be a bug. My page uses a template with
 renderbody/renderblock, it's something like this., really simple:
 
 html @shell
 body @body
 table
 tr
 td//header goes here/td
 /tr
 tr
 tdspan [EMAIL PROTECTED]//td
 /tr
 /table
 
 That's it for the template. The page I insert the table has a table and a 
 form:
 
 span jwcid=@MyLayout
 span @Form
 table .../table
 br
 table jwcid=contribTable/table
 /span
 /span
 
 What's happening is that the contrib table is being displayed totally
 out of place, on the right side of the page.
 I've replaced the dynamic generated table by a static one, and It is
 laid on the correct place.
 
 Any ideas?
 
 PS:Hope get some answers on this post (after so many empty :( ) :P
 
 -
 To unsubscribe, e-mail: [EMAIL PROTECTED]
 For additional commands, e-mail: [EMAIL PROTECTED]
 



FOCUS Computing - web design
Mob: 0415 24 26 24
[EMAIL PROTECTED]
http://www.focus-computing.com.au




-- 
No virus found in this outgoing message.
Checked by AVG Free Edition.
Version: 7.1.405 / Virus Database: 268.10.8/415 - Release Date: 9/08/2006


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



Re: Best Practise for Web Application Development

2006-08-08 Thread Murray Collingwood
Go to the source for all web usability information... 

http://www.useit.com

Cheers 
mc


On 8 Aug 2006 at 14:49, Peter Dawn wrote:

 hi guys,
 
 i bring you the ultimate question, Whats the best practise for
 tapestry web development? What I am implying is, how do we convince
 our boses that web applications are like web sites and follow the same
 rules as web sites.
 
 For example, the best font for a tapestry web app would be in my
 humble opinion verdana. Now how can I prove this?
 
 Have others come across this issue too. Is there some best practise
 for UI for tapestry web applications.
 
 thanks.
 
 -
 To unsubscribe, e-mail: [EMAIL PROTECTED]
 For additional commands, e-mail: [EMAIL PROTECTED]
 



FOCUS Computing - web design
Mob: 0415 24 26 24
[EMAIL PROTECTED]
http://www.focus-computing.com.au




-- 
No virus found in this outgoing message.
Checked by AVG Free Edition.
Version: 7.1.405 / Virus Database: 268.10.7/411 - Release Date: 7/08/2006


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



Re: I want my HTML *that* way

2006-08-04 Thread Murray Collingwood
Here's a simple example - an extra /span where I hadn't intended one.  This 
could easily 
have been ignored (maybe a warning).

org.apache.tapestry.parse.TemplateParseException 
Closing tag /span on line 82 is improperly nested with tag div on line 3. 
location: context:/WEB-INF/pages/cart/Viewcart.html, line 82
77  
78 div style=text-align: left; padding: 10px; 
79 span jwcid=@PageLink page=Home 
80 span key=cart_keepshoppingKeep shopping/span 
81 /span 
82 /span 
83 /div 
84  
 
Cheers
mc


On 4 Aug 2006 at 9:31, hv @ Fashion Content wrote:

 I never had that problem could you be a bit more specific
 
 Rui Pacheco [EMAIL PROTECTED] skrev i en meddelelse 
 news:[EMAIL PROTECTED]
  Hi all
 
  I have a template, designed under DreamWeaver with loads of randomly 
  placed
  HTML tags, and Tapestry won't parse it. It chockes on tags that don't 
  open,
  it chockes on form tags placed at the same level as tables, etc.
 
  Is there a way to tell Tapestry's HTML parser to be a bit more relaxed? I
  mean, I still have a couple of pages to go through, and its going to be 
  hell
  if he complains about every bit of malformed HTML.
 
  -- 
  Cumprimentos,
  Rui Pacheco
  
 
 
 
 
 -
 To unsubscribe, e-mail: [EMAIL PROTECTED]
 For additional commands, e-mail: [EMAIL PROTECTED]
 



FOCUS Computing - web design
Mob: 0415 24 26 24
[EMAIL PROTECTED]
http://www.focus-computing.com.au




-- 
No virus found in this outgoing message.
Checked by AVG Free Edition.
Version: 7.1.394 / Virus Database: 268.10.5/407 - Release Date: 3/08/2006


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



RE: Streaming files from Tapestry

2006-07-28 Thread Murray Collingwood
Hi Ezra

I did look at doing this as a work around, however it has one major flaw - it 
doesn't provide 
any security.

In a CRM system, for example, if the document download link is 
http://webserver/MyOtherWebContext/images/01.doc then it's not going to 
take 
somebody long to realise they can type in other numbers and retrieve documents 
that they 
may not have access to.

With a servlet running inside my application I can check the users security 
immediately 
before I stream the document.

The other benefit of keeping the servlet as part of my application is that I 
can store the 
external directory name in one location rather than two.  A small benefit.

My final argument is that the faq should be providing the recommended solution. 
 Obviously 
lots of people have already asked for this (that's why it's in a faq) so I'm 
not alone out here...

I have written a small servlet to do what I want.  It has limited functionality 
but it serves my 
immediate purpose.  I am still hopeful that somebody will deliver a servlet or 
library that does 
serve this purpose in a better and generic method, I am happy to be the first 
to test and 
implement it.

Cheers
mc


On 28 Jul 2006 at 9:53, Epstein, Ezra wrote:

 I'm not sure I really followed, but your option c doesn't seem to have 
 anything to do with a web framework (tapestry or otherwise).  Rather you're 
 just dynamically generating some text a la:
 
 img src=/MyOtherWebContext/images/my-dynamically-named-image.gif /
 
 Or whatever.  The only part of that which is dynamic is the image name.  And 
 Any tag can give you this no sweat.  Maybe the name of the other web 
 context is a config param and so is dynamic too.  Again, no sweat.
 
 As for the serving of the static files themselves (the name of a given file 
 is dynamic in that if you're showing the details of a CD then the image 
 name may depend on the product, but the image itself is in a web servers file 
 system) any web server will do.  Apache, Tomcat, JBoss, etc.   I think the 
 problem is with the word stream.  Stream implies dynamically feeding data 
 into the response.  I think your question is about serving images.  If so, 
 it's a snap.  For example, I serve my Tapestry javascript files (same 
 applies to images) simply as:
 
 script type=text/javascript 
 src=/MyTapestryAppName/js/myJavaScriptFile.js/script
 
 Works great.
 
 Perhaps I misread the question.
 
 Thanks, 
 
 Ezra Epstein 
 
 



-- 
No virus found in this outgoing message.
Checked by AVG Free Edition.
Version: 7.1.394 / Virus Database: 268.10.4/402 - Release Date: 27/07/2006


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



Streaming files from Tapestry

2006-07-27 Thread Murray Collingwood
Hi all

This faq page http://tapestry.apache.org/tapestry4/faq.html answers a common 
question 
people have about how to serve images or other binary files from a Tapestry 
application.  
The details are provided under:

2.6. How do I stream a file to the user from Tapestry?

The example that follows works for a 'Document' type which is fine, however the 
'disowner' at 
the bottom of the answer indicates that this is not the way this should be 
done.  Also, recently 
in the forum when somebody tried this they found it only worked if you were 
sending this 
document as the only result (not as an image or other object type in the midst 
of a page).

So, can somebody please document the answer to this question how it should be 
done?  And 
of course - update the faq.

Cheers
mc



FOCUS Computing - web design
Mob: 0415 24 26 24
[EMAIL PROTECTED]
http://www.focus-computing.com.au




-- 
No virus found in this outgoing message.
Checked by AVG Free Edition.
Version: 7.1.394 / Virus Database: 268.10.4/401 - Release Date: 26/07/2006


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



RE: Streaming files from Tapestry

2006-07-27 Thread Murray Collingwood
 
 -Original Message-
 From: Murray Collingwood [mailto:[EMAIL PROTECTED] 
 Sent: Donnerstag, 27. Juli 2006 09:49
 To: tapestry users
 Subject: Streaming files from Tapestry
 
 Hi all
 
 This faq page http://tapestry.apache.org/tapestry4/faq.html answers a
 common question 
 people have about how to serve images or other binary files from a
 Tapestry application.  
 The details are provided under:
 
 2.6. How do I stream a file to the user from Tapestry?
 
 The example that follows works for a 'Document' type which is fine,
 however the 'disowner' at 
 the bottom of the answer indicates that this is not the way this should
 be done.  Also, recently 
 in the forum when somebody tried this they found it only worked if you
 were sending this 
 document as the only result (not as an image or other object type in the
 midst of a page).
 
 So, can somebody please document the answer to this question how it
 should be done?  And 
 of course - update the faq.
 
 Cheers
 mc
 
 
 
 FOCUS Computing - web design
 Mob: 0415 24 26 24
 [EMAIL PROTECTED]
 http://www.focus-computing.com.au
 
 
 
 
 -- 
 No virus found in this outgoing message.
 Checked by AVG Free Edition.
 Version: 7.1.394 / Virus Database: 268.10.4/401 - Release Date:
 26/07/2006
 
 
 -
 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]
 



FOCUS Computing - web design
Mob: 0415 24 26 24
[EMAIL PROTECTED]
http://www.focus-computing.com.au




-- 
No virus found in this outgoing message.
Checked by AVG Free Edition.
Version: 7.1.394 / Virus Database: 268.10.4/401 - Release Date: 26/07/2006


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



RE: Overriding the maximum file upload size

2006-07-27 Thread Murray Collingwood
Hi Ben

The change made to the documentation:

From: implementation service-id=tapestry.multipart.MultipartDecoder

To:  implementation service-id=tapestry.multipart.ServletMultipartDecoder

solves the problem.  Specifying MultipartDecoder was generating some 
initialisation error - 
Tapestry simply wouldn't load.

I'm glad the limit is 10mb - that seems very reasonable as a default.

Cheers
mc


On 27 Jul 2006 at 8:59, Ben Dotte wrote:

 Unless something has changed recently, the limit is 10MB, not 10KB. Try
 it for yourself. I'm a little surprised the override in hivemodule.xml
 isn't working for you. We have had that line in for some time and
 haven't had any trouble with it. I just uploaded a 25MB image to make
 sure.
 
 We are also on 4.0.2 so the version shouldn't be a problem. What is the
 problem you are experiencing when you have the line in hivemodule.xml?
 
 Ben
 
 -Original Message-
 From: Jesse Kuhnert [mailto:[EMAIL PROTECTED] 
 Sent: Wednesday, July 26, 2006 9:33 PM
 To: Tapestry users
 Subject: Re: Overriding the maximum file upload size
 
 It's the default value used by commons-fileupload from jakarta, which
 this
 functionality is based on. You may want to ask them about it.
 
 On 7/26/06, Murray Collingwood [EMAIL PROTECTED] wrote:
 
  Hi Jesse
 
  Thanks for this info.
 
  Do you think 10kb is a useful default?  This seems very small minded -
  what can you upload
  with 10kb
 
  Why not make the default limit 10mb?  We can at least make it sound as
  though Tapestry is
  an industrial strength product !  (Ohhh, wonder if this will generate
 some
  fun discussion???)
 
  Cheers
  mc
 
 
 
  On 26 Jul 2006 at 21:36, Jesse Kuhnert wrote:
 
   The error referenced in that ticket was a documentation error, it
 has
  since
   been fixed here
   http://tapestry.apache.org/tapestry4.1/components/Upload.html .
  
   The 10kb vs 10 (mil?) sounds pretty annoying. I think 10kb is the
  default
   limit. The maxSize parameter is taken in units of byte, so maybe
 it
  should
   read 10,000 instead.
  
 
 
  FOCUS Computing - web design
  Mob: 0415 24 26 24
  [EMAIL PROTECTED]
  http://www.focus-computing.com.au
 
 
 
 
  --
  No virus found in this outgoing message.
  Checked by AVG Free Edition.
  Version: 7.1.394 / Virus Database: 268.10.4/401 - Release Date:
 26/07/2006
 
 
  -
  To unsubscribe, e-mail: [EMAIL PROTECTED]
  For additional commands, e-mail: [EMAIL PROTECTED]
 
 
 
 
 -- 
 Jesse Kuhnert
 Tacos/Tapestry, team member/developer
 
 Open source based consulting work centered around
 dojo/tapestry/tacos/hivemind.
 
 -
 To unsubscribe, e-mail: [EMAIL PROTECTED]
 For additional commands, e-mail: [EMAIL PROTECTED]
 



FOCUS Computing - web design
Mob: 0415 24 26 24
[EMAIL PROTECTED]
http://www.focus-computing.com.au




-- 
No virus found in this outgoing message.
Checked by AVG Free Edition.
Version: 7.1.394 / Virus Database: 268.10.4/401 - Release Date: 26/07/2006


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



Overriding the maximum file upload size

2006-07-26 Thread Murray Collingwood
Hi all

I am using Tapestry 4.0.2

In the documentation on the 'Upload' component it mentions a default upload 
size of 
10,000,000 (10 million) and in brackets 10kb.  I'm not sure how that works.  
Which is 
correct?

Assuming all my worst nightmares are coming true and that the limit is 10kb 
(although I 
would much prefer a 10mb default limit) I went blindly ahead and added the 
multipartdecoder 
stuff to my hivemodule.xml file.  Alas it fails miserably.  All is not lost 
though as I found a bug 
had been reported and fixed as documented here...

http://issues.apache.org/jira/browse/TAPESTRY-995?page=all

Well, the bug is fixed for Tapestry 4.1 but there is little detail about what 
the problem was and 
whether it can be avoided in 4.0.2.

While I am new to Tapestry I am not new to the huge number of issues that can 
result in 
trying to upgrade one library in an application.

1. Is there a way of avoiding this bug in 4.0.2? 

2. Is the default limit 10kb or 10mb?  
PS Can the documentation be corrected for this please?

Cheers
mc


FOCUS Computing - web design
Mob: 0415 24 26 24
[EMAIL PROTECTED]
http://www.focus-computing.com.au




-- 
No virus found in this outgoing message.
Checked by AVG Free Edition.
Version: 7.1.394 / Virus Database: 268.10.4/401 - Release Date: 26/07/2006


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



Re: Overriding the maximum file upload size

2006-07-26 Thread Murray Collingwood
Hi Jesse

Thanks for this info.

Do you think 10kb is a useful default?  This seems very small minded - what can 
you upload 
with 10kb

Why not make the default limit 10mb?  We can at least make it sound as though 
Tapestry is 
an industrial strength product !  (Ohhh, wonder if this will generate some fun 
discussion???)

Cheers
mc



On 26 Jul 2006 at 21:36, Jesse Kuhnert wrote:

 The error referenced in that ticket was a documentation error, it has since
 been fixed here
 http://tapestry.apache.org/tapestry4.1/components/Upload.html .
 
 The 10kb vs 10 (mil?) sounds pretty annoying. I think 10kb is the default
 limit. The maxSize parameter is taken in units of byte, so maybe it should
 read 10,000 instead.
 


FOCUS Computing - web design
Mob: 0415 24 26 24
[EMAIL PROTECTED]
http://www.focus-computing.com.au




-- 
No virus found in this outgoing message.
Checked by AVG Free Edition.
Version: 7.1.394 / Virus Database: 268.10.4/401 - Release Date: 26/07/2006


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



contrib:Table column not sorting

2006-07-19 Thread Murray Collingwood
Hi  all

If the displayed text comes from the current table the sorting is working fine. 
 If however the 
displayed text comes from an object referenced from a connected table it 
doesn't work at all.  
In the following example if my variationText refers to 'option.desc' then the 
sorting works fine 
on this value.  When I specify 'option.variation.desc' the text is displayed 
but the sorting 
doesn't work.

table class=mytable jwcid=optionTable width=100%
span jwcid=[EMAIL PROTECTED] 
span jwcid=variationText / 
/span
/table

component id=optionTable type=contrib:Table
binding name=source value=options/
binding name=columnsliteral:
variation
/binding
binding name=pageSize value=literal:10/
binding name=initialSortColumn value=component:variationText/
binding name=row value=option/
binding name=columnsClass value=literal:labels/
/component
component id=variationText type=InsertText
binding name=value value=option.variation.desc/
/component

Any suggestions?

Cheers
mc



FOCUS Computing - web design
Mob: 0415 24 26 24
[EMAIL PROTECTED]
http://www.focus-computing.com.au




-- 
No virus found in this outgoing message.
Checked by AVG Free Edition.
Version: 7.1.394 / Virus Database: 268.10.1/391 - Release Date: 18/07/2006


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



Generic application wide formats

2006-07-17 Thread Murray Collingwood
Hi all

I'm a little new to Tapestry so I may be missing something, happy for anybody 
to point me in 
the right direction.  I'm currently running Tapestry 4.0.2

I want to standardise my date format for the entire application to dd/MM/.  
I decided that 
the best place to do this while allowing for internationalisation is to add it 
to my app.properties 
file.  I added a few other formats while I was there, so I had something like 
the following:

# Generic formats
format_date=dd/MM/
format_time=HH:mm
format_pct0=##0%
format_pct2=##0.##%
format_currency=$#,###,##0.00

Then I found that in order to display a date in this format I was writing 7 
lines of java code for 
each page where a date was displayed (most of them)...along with 1 more line in 
the .page 
file for each date to be displayed.

When I wanted to edit a date again using this format I had 4 lines per page and 
1 line per 
field.

This only provides the most basic of editing (I haven't allowed for any error 
processing yet) 
and while the number of lines is not large it did seem to me that there were 
different methods 
being employed to format the date for display and others for edit and 
validation.

As I began, I may have missed something but it does seem a little messy at the 
moment.  
Does anybody have a better method of achieving this generic formating?

Wouldn't it be nice ifI could specify formats in my message catalogue and 
then simply 
apply them to my components with a single line of code?  eg

a) displaying a date value:

component id=dateField type=Insert
binding name=value value=myclass.mydate/
binding name=format value=message:format_date/
/component

b) editing a date value:

component id=dateField type=DatePicker
binding name=displayName value=message:mydate_label/
binding name=value   value=myclass.mydate/
binding name=format value=message:format_date/
binding name=validators  value=validators:required/
/component


Is this possible?


FOCUS Computing - web design
Mob: 0415 24 26 24
[EMAIL PROTECTED]
http://www.focus-computing.com.au




-- 
No virus found in this outgoing message.
Checked by AVG Free Edition.
Version: 7.1.394 / Virus Database: 268.10.1/389 - Release Date: 14/07/2006


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



Re: Navigational Menu

2006-07-17 Thread Murray Collingwood
Dump Krysalis and use JS Cook Menu.  It is much easier to customise and also 
allows better 
integration with your java code for generation.  

I tried Kysalis initially but then I wanted to show different options for 
different users - it was 
very difficult to customise.  I then tried JS Cook Menu and have never looked 
back.  So much 
easier to use.

Cheers
mc


On 17 Jul 2006 at 15:15, Peter Dawn wrote:

 I have been trying to integrate the krysalis menu for the last few
 days. however its proving to be a real pain. customisation is so
 difficult and i dont know how to link to pages in other frames. if
 were using html i would specify the frame name, but how should i do
 that here.
 
 so i have decided to go with a plain straightforward javascript menu.
 now the question is how can i link to my tapestry pages using normal
 links. has anybody experienced the same issues and is there another
 fix. navigation through a complex site is pretty important, so without
 a navigational menu the site is un-usable.
 
 any thoughts guys.
 
 -
 To unsubscribe, e-mail: [EMAIL PROTECTED]
 For additional commands, e-mail: [EMAIL PROTECTED]
 



FOCUS Computing - web design
Mob: 0415 24 26 24
[EMAIL PROTECTED]
http://www.focus-computing.com.au




-- 
No virus found in this outgoing message.
Checked by AVG Free Edition.
Version: 7.1.394 / Virus Database: 268.10.1/389 - Release Date: 14/07/2006


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



Re: Template header DOCTYPE

2006-07-17 Thread Murray Collingwood
If you are writing data to a table use contrib:Table and never look back.  
Another absolutely 
fabulous component that I now use on every single table I ever create.

Cheers
mc

On 17 Jul 2006 at 15:47, Blackwings wrote:

 Ok for the select ;-)
 But what about the tr in a table?
 
 table
 tr
 tdHeader 1/td
 tdHeader 2/td
 tdHeader 3/td
   /tr
   span jwcid=@My2TrJwc
   tr
 tdsomething/td
 tdto put/td
 tdsomewhere here/td
   /tr
   tr
 tdData info 1/td
 tdData info M/td
 tdData info 3X/td
   /tr
   /span
   tr
 td colspan=3Footer/td
   /tr
 /table
 
 
 2006/7/17, Murray Collingwood [EMAIL PROTECTED]:
 
  For a select control use SelectionModel to pass the options to your
  component.  Then you
  don't need any @For loop in your html.
 
  In your table component you could code your Tapestry on the tr
  statement.  eg
  table...
  tr jwcid=xx
 
  Cheers
  mc
 
 
  On 17 Jul 2006 at 11:13, Blackwings wrote:
 
   Hi,
  
   I noticed something interresting about DOCTYPE. In fact, if a designer
  give
   me a XHTML1.0 transitional compliant html template, when I mark the tag
  and
   add some tags span the html is not anymore compliant :
  
   select jwcid=[EMAIL PROTECTED] id=searchCriteria.requester name=
   searchCriteria.requester size=1 tabindex=6 class=comboBox9pt
  span jwcid=@Foreach source=ognl:requesters value=ognl:
   searchCriteria.requester
 option value=1 jwcid=@Option label=ognl:
  requesters.requesterCode
   elem1/option
 option value=2 jwcid=$remove$elem2/option
 option value=3 jwcid=$remove$elem3/option
 option value=4 jwcid=$remove$elem4/option
   /span
 /select
  
   The span cannot be place after a select and this is warned.
  
   I have the same problem when I want to mark a bloc of tr, not all, in
  a
   table. I have to put a span tag between to a /tr and a tr that
  is
   not permit by the DOCTYPE definition, normally.
  
   Is there another DOCTYPE that manage Tapestry template or do we have
  to
   let the warn like that?
  
 
 
 
  FOCUS Computing - web design
  Mob: 0415 24 26 24
  [EMAIL PROTECTED]
  http://www.focus-computing.com.au
 
 
 
 
  --
  No virus found in this outgoing message.
  Checked by AVG Free Edition.
  Version: 7.1.394 / Virus Database: 268.10.1/389 - Release Date: 14/07/2006
 
 
  -
  To unsubscribe, e-mail: [EMAIL PROTECTED]
  For additional commands, e-mail: [EMAIL PROTECTED]
 
 
 



FOCUS Computing - web design
Mob: 0415 24 26 24
[EMAIL PROTECTED]
http://www.focus-computing.com.au




-- 
No virus found in this outgoing message.
Checked by AVG Free Edition.
Version: 7.1.394 / Virus Database: 268.10.1/389 - Release Date: 14/07/2006


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



Re: Generic application wide formats

2006-07-17 Thread Murray Collingwood
As you say... not pretty.

mc

On 17 Jul 2006 at 14:59, Shing Hing Man wrote:

 It is not very pretty. You could try the following.
 
 component id=dateField type=Insert
   binding name=value value=myclass.mydate/
 
   binding name=format
 ognl:new
 java.text.SimpleDateFormat(getMessages().getMessage('format_date'))
  /binding
 
  /component
 
 Shing
 --- Murray Collingwood [EMAIL PROTECTED]
 wrote:
 
  Hi all
  
  I'm a little new to Tapestry so I may be missing
  something, happy for anybody to point me in 
  the right direction.  I'm currently running Tapestry
  4.0.2
  
  I want to standardise my date format for the entire
  application to dd/MM/.  I decided that 
  the best place to do this while allowing for
  internationalisation is to add it to my
  app.properties 
  file.  I added a few other formats while I was
  there, so I had something like the following:
  
  # Generic formats
  format_date=dd/MM/
  format_time=HH:mm
  format_pct0=##0%
  format_pct2=##0.##%
  format_currency=$#,###,##0.00
  
  Then I found that in order to display a date in this
  format I was writing 7 lines of java code for 
  each page where a date was displayed (most of
  them)...along with 1 more line in the .page 
  file for each date to be displayed.
  
  When I wanted to edit a date again using this format
  I had 4 lines per page and 1 line per 
  field.
  
  This only provides the most basic of editing (I
  haven't allowed for any error processing yet) 
  and while the number of lines is not large it did
  seem to me that there were different methods 
  being employed to format the date for display and
  others for edit and validation.
  
  As I began, I may have missed something but it does
  seem a little messy at the moment.  
  Does anybody have a better method of achieving this
  generic formating?
  
  Wouldn't it be nice ifI could specify formats in
  my message catalogue and then simply 
  apply them to my components with a single line of
  code?  eg
  
  a) displaying a date value:
  
  component id=dateField type=Insert
  binding name=value value=myclass.mydate/
  binding name=format
  value=message:format_date/
  /component
  
  b) editing a date value:
  
  component id=dateField type=DatePicker
  binding name=displayName
  value=message:mydate_label/
  binding name=value  
  value=myclass.mydate/
  binding name=format
  value=message:format_date/
  binding name=validators 
  value=validators:required/
  /component
  
  
  Is this possible?
  
  
  FOCUS Computing - web design
  Mob: 0415 24 26 24
  [EMAIL PROTECTED]
  http://www.focus-computing.com.au
  
  
  
  
  -- 
  No virus found in this outgoing message.
  Checked by AVG Free Edition.
  Version: 7.1.394 / Virus Database: 268.10.1/389 -
  Release Date: 14/07/2006
  
  
 
 -
  To unsubscribe, e-mail:
  [EMAIL PROTECTED]
  For additional commands, e-mail:
  [EMAIL PROTECTED]
  
  
 
 
 Home page :
   http://uk.geocities.com/matmsh/index.html
 
 
   
   
   
 ___ 
 All new Yahoo! Mail The new Interface is stunning in its simplicity and ease 
 of use. - PC Magazine 
 http://uk.docs.yahoo.com/nowyoucan.html
 
 -
 To unsubscribe, e-mail: [EMAIL PROTECTED]
 For additional commands, e-mail: [EMAIL PROTECTED]
 



FOCUS Computing - web design
Mob: 0415 24 26 24
[EMAIL PROTECTED]
http://www.focus-computing.com.au




-- 
No virus found in this outgoing message.
Checked by AVG Free Edition.
Version: 7.1.394 / Virus Database: 268.10.1/389 - Release Date: 14/07/2006


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



RE: Re: Generic application wide formats

2006-07-17 Thread Murray Collingwood
What you have suggested is in fact what I am already doing for the date entry / 
update.  I'm 
also having to use a special method in my .java file to retrieve the format 
whenever I want to 
display a date in this format.

My problem is that this is a significant amount of coding required on each page 
for something 
that should be generic across my app.  Do you agree?

Cheers
mc


On 17 Jul 2006 at 16:21, Kristian Marinkovic wrote:

 this could help:
 http://www.nabble.com/Dynamic-translators-tf1229928.html#a3255867
 
 define your formatter as a bean and define the pattern using
 message:date_pattern
 
 greetings,
 kris
 
 

  Shing Hing Man
  [EMAIL PROTECTED] 
An 
 Tapestry users 
  17.07.2006 15:59   users@tapestry.apache.org
  Kopie 

   Bitte antwortenThema 
 an  Re: Generic application wide   
  Tapestry users   formats
  [EMAIL PROTECTED] 
 pache.org 




 
 
 
 
 It is not very pretty. You could try the following.
 
 component id=dateField type=Insert
  binding name=value value=myclass.mydate/
 
   binding name=format
ognl:new
 java.text.SimpleDateFormat(getMessages().getMessage('format_date'))
 /binding
 
  /component
 
 Shing
 --- Murray Collingwood [EMAIL PROTECTED]
 wrote:
 
  Hi all
 
  I'm a little new to Tapestry so I may be missing
  something, happy for anybody to point me in
  the right direction.  I'm currently running Tapestry
  4.0.2
 
  I want to standardise my date format for the entire
  application to dd/MM/.  I decided that
  the best place to do this while allowing for
  internationalisation is to add it to my
  app.properties
  file.  I added a few other formats while I was
  there, so I had something like the following:
 
  # Generic formats
  format_date=dd/MM/
  format_time=HH:mm
  format_pct0=##0%
  format_pct2=##0.##%
  format_currency=$#,###,##0.00
 
  Then I found that in order to display a date in this
  format I was writing 7 lines of java code for
  each page where a date was displayed (most of
  them)...along with 1 more line in the .page
  file for each date to be displayed.
 
  When I wanted to edit a date again using this format
  I had 4 lines per page and 1 line per
  field.
 
  This only provides the most basic of editing (I
  haven't allowed for any error processing yet)
  and while the number of lines is not large it did
  seem to me that there were different methods
  being employed to format the date for display and
  others for edit and validation.
 
  As I began, I may have missed something but it does
  seem a little messy at the moment.
  Does anybody have a better method of achieving this
  generic formating?
 
  Wouldn't it be nice ifI could specify formats in
  my message catalogue and then simply
  apply them to my components with a single line of
  code?  eg
 
  a) displaying a date value:
 
 component id=dateField type=Insert
 binding name=value value=myclass.mydate/
  binding name=format
  value=message:format_date/
 /component
 
  b) editing a date value:
 
  component id=dateField type=DatePicker
  binding name=displayName
  value=message:mydate_label/
  binding name=value
  value=myclass.mydate/
  binding name=format
  value=message:format_date/
  binding name=validators
  value=validators:required/
  /component
 
 
  Is this possible?
 
 
  FOCUS Computing - web design
  Mob: 0415 24 26 24
  [EMAIL PROTECTED]
  http://www.focus-computing.com.au
 
 
 
 
  --
  No virus found in this outgoing message.
  Checked by AVG Free Edition.
  Version: 7.1.394 / Virus Database: 268.10.1/389 -
  Release Date: 14/07/2006
 
 
 
 -
  To unsubscribe, e-mail:
  [EMAIL PROTECTED]
  For additional commands, e-mail:
  [EMAIL PROTECTED]
 
 
 
 
 Home page :
   http://uk.geocities.com

Re: DirectLink in TableValue

2006-07-17 Thread Murray Collingwood
I found this example somewhere, can't remember now... (I must keep bookmarking, 
I must 
keep bookmarking...)

[from A.html]

span jwcid=[EMAIL PROTECTED] 
span jwcid=editLinkspan key=link_editEdit/span/span 
span jwcid=deleteLinkspan 
key=link_deleteDel/span/span 
/span

[from A.page]

component id=editLink type=DirectLink
binding name=listener value=listener:edit/
binding name=parameters value=comp.id/
/component
component id=deleteLink type=DirectLink
binding name=listener value=listener:delete/
binding name=parameters value=comp.id/
/component

That wasn't hard.

The question you were probably wanting to know though was how to include a 
table value in 
the link text.

[from B.html]

span jwcid=[EMAIL PROTECTED] 
span jwcid=descLink 
span jwcid=descText / 
/span 
/span

[from B.page]

component id=descLink type=DirectLink
binding name=listener value=listener:select/
binding name=parameters value=comp.id/
/component
component id=descText type=InsertText
binding name=value value=comp.desc/
/component


You have to nest the spans here, one for the link and the second for the link 
text.

Now you have everything.

Cheers
mc


On 13 Jul 2006 at 13:46, Kosarev A.V. wrote:

 Update:
 I wish to place in a column two DirectLink components.
 
 
 -
 To unsubscribe, e-mail: [EMAIL PROTECTED]
 For additional commands, e-mail: [EMAIL PROTECTED]
 



FOCUS Computing - web design
Mob: 0415 24 26 24
[EMAIL PROTECTED]
http://www.focus-computing.com.au




-- 
No virus found in this outgoing message.
Checked by AVG Free Edition.
Version: 7.1.394 / Virus Database: 268.10.1/390 - Release Date: 17/07/2006


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



Re: Table foreach component - Flashing row

2006-07-17 Thread Murray Collingwood
What's the problem?

You can test your condition at the beginning of the row, when writing the tr 
component, so 
that you generate something like tr style=background-color: red; or tr 
class=rowinerror

I'm sure you've got past this.  

You mention when certain text is received, does this mean from user input in 
the midst of 
the table row or from the database?  Are you able to test the condition at the 
beginning of the 
row.  If you can't test at the beginning you could get JS to modify the 
background colour of 
the row, all you need is to assign an 'id' to the row and then retrieve the row 
in your JS and 
start changing properties.  Maybe you've tries this too...

One last thing, are you setting background colours in each cell?  If you do 
these will overwrite 
the background colour of the row in which case you may need to use JS to obtain 
control 
over each cell and set the background colour property manually in each.

Cheers
mc


On 18 Jul 2006 at 10:02, Peter Dawn wrote:

 guys,
 
 i have a table with a foreach condition within it. now the code
 generates a bunch of table rows based on my condition.
 
 now within my last column, i have a condition where if a certain text
 is received the background colour of that cell changes. now what i
 want to do is, if that text is received i want to hightlight the
 entire row or perhaps flash it, so that it shows attention to the user
 indicating that there is an error there.
 
 now how can i effect the entire row and not just the individual cell.
 has somebody done like this within a table.
 
 thanks.
 
 -
 To unsubscribe, e-mail: [EMAIL PROTECTED]
 For additional commands, e-mail: [EMAIL PROTECTED]
 



FOCUS Computing - web design
Mob: 0415 24 26 24
[EMAIL PROTECTED]
http://www.focus-computing.com.au




-- 
No virus found in this outgoing message.
Checked by AVG Free Edition.
Version: 7.1.394 / Virus Database: 268.10.1/390 - Release Date: 17/07/2006


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



Re: alternate row colours in foreach

2006-06-29 Thread Murray Collingwood
Hi Peter

I've been struggling with this alternating row thing for the last couple of 
days and finally 
cracked it this morning. Here is what I have:

[[Test.html]]
table width=100% cellspacing=0 cellpadding=3
  tr valign=top
td class=labelsspan key=actionAction/span/td
td class=labelsspan key=nameName/span/td
td class=labelsspan key=phonePhone/span/td
td class=labelsspan key=mobileMobile/span/td
td class=labelsspan key=addressAddress/span/td
td class=labelsspan key=notesNotes/span/td
  /tr
  span jwcid=@Foreach source=ognl:clients value=ognl:client 
index=ognl:rowIndex element=tr class=ognl:rowStyle
tdspan jwcid=@Insert value=ognl:rowIndex + 11/span/td
tdspan jwcid=@Insert value=ognl:client.nameGeorge 
Smith/span/td
tdspan jwcid=@Insert value=ognl:client.phone 
1234/span/td
tdspan jwcid=@Insert 
value=ognl:client.mobile0400100200/span/td
tdspan jwcid=@Insert value=ognl:client.address3 Claire 
Way/span/td
tdspan jwcid=@Insert value=ognl:client.notesNo notes/span/td
  /span
  tr valign=top
   td class=trailer colspan=10End of list/td
  /tr
/table

[[Test.java]]
private int rowIndex = 1;

public void setRowIndex(int rowIndex) {
this.rowIndex = rowIndex;
}
public int getRowIndex() {
return rowIndex;
}
public String getRowStyle() {
if (rowIndex%2 == 0)
return even;
return odd;
}

[[Application.css]]
.even {
background-color: #f0f0f0;
}
.odd {
background-color: #a0a0a0;
}


And I'm not going to say HTH as I know it will.

Cheers
mc

PS I'm sure there is another way to do this using a bean but the above does 
make sense in 
Tapestry and you not only get the even/odd thing, you also get a row counter.

PPS The other bit I did was to move the content of the getRowStyle() method to 
an 
application class, I'm going to use this on lots of pages and if I change the 
names of the 
even/odd styles I want to do this in one place and not 50.  So it became:
public String getRowStyle() {
return SomeApplicationClass.getRowStyle(rowIndex);
}




On 30 Jun 2006 at 8:38, Peter Dawn wrote:

 cant get it to work. am getting an error component For not found in
 application namespace.
 am also getting errors for value=entries Attribute value not defined
 in the DTD for element binding
 am also getting errors for value=beans.evenOdd.next Attribute value
 not defined in the DTD for element binding
 
 and why is type=For shouldnt it be Foreach, as I am using foreach.
 any thoughts.
 
 -
 To unsubscribe, e-mail: [EMAIL PROTECTED]
 For additional commands, e-mail: [EMAIL PROTECTED]
 



FOCUS Computing - web design
Mob: 0415 24 26 24
[EMAIL PROTECTED]
http://www.focus-computing.com.au




-- 
No virus found in this outgoing message.
Checked by AVG Free Edition.
Version: 7.1.394 / Virus Database: 268.9.7/379 - Release Date: 29/06/2006


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



Re: alternate row colours in foreach

2006-06-29 Thread Murray Collingwood
HI Peter

The HTML needs to be almost identical to mineyou will notice in my span 
there is a 
parameter called: element=tr  this is the trick that adds the style stuff to 
the 'tr' tag during 
rendering.  Sounds like you need to remove your 'tr' tag and live with my 
'span' tag.

Also, if it's still not working, post your html file.

Cheers
mc


On 30 Jun 2006 at 9:52, Peter Dawn wrote:

 mate,
 i dont know what to say. but i am still not able to get it to work. i
 have tried to put this code before my pagerender method and after but
 it still does not work. the only other diff i can see is that my
 foreach comp is within a tr tag and not a span as yours. i am not sure
 if this is a problem for me or not.
 any ideas.
 
 -
 To unsubscribe, e-mail: [EMAIL PROTECTED]
 For additional commands, e-mail: [EMAIL PROTECTED]
 



FOCUS Computing - web design
Mob: 0415 24 26 24
[EMAIL PROTECTED]
http://www.focus-computing.com.au




-- 
No virus found in this outgoing message.
Checked by AVG Free Edition.
Version: 7.1.394 / Virus Database: 268.9.7/379 - Release Date: 29/06/2006


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



Re: Running the Tapestry Tutorial

2006-06-04 Thread Murray Collingwood
Hi folks

I have updated the INFO.txt file that is downloaded with the tapestry-tutorial - would somebody like to review and update this back into the zip file, it may help somebody else following me...

Cheers
mc-- Murray CollingwoodFocus Computingp +61 415 24 26 24http://www.focus-computing.com.au 
tapestry-libraries.tar.gz

Ccontains just the Tapestry libraries, including all the current 
dependencies.

tapestry-tutorials.tar.gz

Contains the libraries as well as all of the Tapestry QuickStart 
tutorials.

The QuickStart Tutorials are distributed as a set of Eclipse workspaces 
(though Ant build files are supplied as well).  They depend on an 
Eclipse User
Library to locate the libraries.  You can create a User Library as 
follows:

- Select Window - Preferences... from the menu
- Navigate to Java / Build Path / User Libraries
- Click New
- Name the library Tapestry Libraries
- Click Add Jars ...
- Add all the JAR files in the tapestry-libraries/lib/web folder

To build the tutorials you needs ensure you are running JDK v5.0 (comes
after v1.4).  

Extract the downloaded files to a new directory, eg 
C:\TapestryTutorials. 
Don't extract it into your existing workspace.  From Eclipse select 
File |
Import... 'Existing projects into workspace', click the 'Browse' button 
to 
select a root directory, select the directory you extracted your 
download
to.  In my case above I selected C:\TapestryTutorials.  The import 
projects
dialog should display all of the projects that can be imported, these 
include 'directlink', 'forms', and 'helloworld' (depending on the 
version
of the tutorials you have downloaded). 

To build the projects you have imported you should find a 'build.xml' 
file 
inside each project.  Right mouse on the 'build.xml' and select 'Run 
As' |
'Ant Build'.

Problems: The most likely problem is an issue compiling the project due 
to 
errors with the annotations, eg @Persist.  If this is the problem 
then 
you need to find why your system is not using the JDK v5.0 libraries.  
It 
may still be referencing an older version somewhere.  Check through the 
Windows | Preferences, the project properties (right mouse on the 
project),
and the Ant build properties (right mouse on the 'build.xml' and select
Run As | Ant Build...).


tapestry-examples-xxx.tar.gz

A prebuilt JBoss distribution, containing the Tapestry Workbench and 
Virtual Library
applications.

Unpack the distribution, change the bin directory, and use the run.bat 
or
run.sh script to start up JBoss and the examples.

See http://jakarta.apache.org/tapestry/examples/index.html for details.-
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]

Where are the Australian supporters?

2006-06-04 Thread Murray Collingwood

Hi all

I looked through Tapestry Support Network page but couldn't find anybody in
Australia (preferably Brisbane).

I'm just starting out on my first Tapestry project and need to ensure I'm
making some educated choices about how it is structured and also getting my
environment setup correctly.

Is there anybody on this list from Brisbane that would like to give me some
one-on-one training?

Cheers
mc

--
Murray Collingwood
Focus Computing
p +61 415 24 26 24
http://www.focus-computing.com.au


HTML DTD for Tapestry

2006-06-04 Thread Murray Collingwood

Hi again

I loaded an Eclipse plugin, HTMLEditor from Amateras, and now when I try
editing an HTML file it issues warnings about the 'jwcid' parameters.  I can
try switching the warnings off, although I can't find anywhere I can do
this, or I can supply a new DTD that defines Tapestry's HTML syntax
correctly.

My preference was for help finding errors in my HTML and hence I'm looking
for the HTML DTD for Tapestry.  I'm assuming there is one, perhaps it should
be an extension of the W3C HTML DTD, whatever, if you've got one I think
I can load it and it may solve the problem.

I checked in http://jakarta.apache.org/tapestry/dtd/ however there were only
DTDs for Tapestry and Script.  The Tapestry one I have loaded although I
think this only reflects the app.application XML file content.

Cheers
mc


--
Murray Collingwood
Focus Computing
p +61 415 24 26 24
http://www.focus-computing.com.au


Re: Running the Tapestry Tutorial

2006-06-02 Thread Murray Collingwood

Thanks Jesse - I have now been able to load the tutorials.  I found the best
method was to extract the downloads to some location (not my workspace) and
then within Eclipse do the Windows | Preference setting to identify the
Tapestry Libraries, followed by File | Import an existing project, browse to
the place I extract the downloads and they should all appear in the
selection dialog.

I'm having one more problem...
Syntax error, annotations are only available if source level is 5.0

The line being referenced is in Home.java and reads...
@Persist

I have loaded J2SE 1.5.0_07 yet still this problem remains.  Is there
something I've forgotten or missed

Cheers
mc


--
Murray Collingwood
Focus Computing
p +61 415 24 26 24
http://www.focus-computing.com.au


Re: Running the Tapestry Tutorial

2006-06-02 Thread Murray Collingwood

Hi, managed to fix this on my own.

In Eclipse there is a setting in Windows | Preferences... under Java |
Compiler indicating the compiler compliance level, mine was set to 1.4 and
is now changed to 5.0 - this seems to have resolved the problem with the
@Persist.

I then right mouse on the project's build.xml and run this.

The output from my build creates further errors:


Buildfile: *C:\TapestryTutorial\directlink\build.xml

compile*:

[*mkdir*] Created dir: C:\TapestryTutorial\directlink\target\classes

[*javac*] Compiling 1 source file to
C:\TapestryTutorial\directlink\target\classes

[*javac*] *
C:\TapestryTutorial\directlink\src\java\tutorials\directlink\pages\Home.java
*:8: illegal character: \64

[*javac*] @Persist

[*javac*] ^

[*javac*] *
C:\TapestryTutorial\directlink\src\java\tutorials\directlink\pages\Home.java
*:9: identifier expected

[*javac*] public abstract int getCounter();

[*javac*] ^

[*javac*] 2 errors

BUILD FAILED
It looks as though my ant build isn't picking up the annotations. (I haven't
used annotations before so I'm not sure what to do apart from check the
compiler compliance for the buildhow do I do that?)

Anybodyhhhllp...

Cheers
mc

--
Murray Collingwood
Focus Computing
p +61 415 24 26 24
http://www.focus-computing.com.au


Re: Running the Tapestry Tutorial

2006-06-02 Thread Murray Collingwood

Brilliant!

I looked through the 'Ant Build...' dialog and found there was a 'tools.jar'
file being referenced from a v1.4 installation on my computer.  There was no
'tools.jar' in my 5.0 library...hmmm?  I went hunting on my machine (good on
Google Desktop) and found a tools.jar v5.0 in my Program Files directory,
copied all of the libs from this area into my v5.0 j2se library and it now
compiles perfectly.

Now I can start the tutorial properly...

Cheers
mc



--
Murray Collingwood
Focus Computing
p +61 415 24 26 24
http://www.focus-computing.com.au


Running the Tapestry Tutorial

2006-06-01 Thread Murray Collingwood

Hi folks

Sorry, this is a real newby question - how do you run the Tapestry Tutorial
in Eclipse?

I have installed Eclipse 3.1 (C:\Eclipse) and downloaded the Tapestry
Tutorial zip.  I extracted the Tutorial files into a folder -
C:\TapestryTutorial

I found a file called INFO.txt and tried to follow the instructions here
but they didn't help me find anything to work with.

The contents of the Tapestry Tutorial zip look nothing like the directory
layouts described on the Tapestry Quickstart page.
http://jakarta.apache.org/tapestry/QuickStart/index.html#Pre-requisistes

I must be missing something basic - somebody please help.

Cheers
mc



--
Murray Collingwood
Focus Computing
p +61 415 24 26 24
http://www.focus-computing.com.au