| From | Sent On | Attachments |
|---|---|---|
| Chris Nelson | Apr 28, 2005 8:36 pm |
| Subject: | Re: [trails-dev] Hi All! | |
|---|---|---|
| From: | Chris Nelson (cnel...@yahoo.com) | |
| Date: | Apr 28, 2005 8:36:46 pm | |
| List: | net.java.dev.trails.dev | |
Alejandro,
Thanks very much for your contributions! I'll be adding them to the codebase. I'll probably refactor the ObjectTable contribution a little bit so that the code isn't duplicated in PropertyTable, but this is definitely a good idea. Something that occurred to me at one point and then I lost track of.
It's great to hear Trails is working out for you. With open source projects you never really know who is doing what with your stuff until you get emails like this, so it's very encouraging to hear positive feedback from users.
I'd definitely be interested to see the other things you mentioned also.
--Chris
--- Alejandro Scandroli <alej...@gmail.com> wrote:
Hi my name is Alejandro Scandroli.
I have been working in three-tier developments for a while. The last year I start using Tapestry-Spring-Hibernate combination for all my projects. I also use xdoclet, junit, etc. Two months ago I found Trails. Now I'm in heaven. I'm faster than ever. I do more work in less time, and I get paid for project ;-)
My last project is a EnhydraShark WebClient. Shark already has a persistence layer (also implemented with Hibernate) so I start working with Trails source to make it work with Shark.
I would like to share my work results.
1) In
TrailsPropertyDescriptor.java :: public boolean
isNumeric() I add
getPropertyType().getName().endsWith("Long")
to add compatibility with Long type.
2) I add a new parameter "propertyNames" to ObjectTable component as in
<parameter name="propertyNames" type="java.lang.String[]" required="no" direction="auto" default-value="null"/>
Then add this lines in ObjectTable.java (from PropertyTable.java)
ObjectTable { public abstract String[] getPropertyNames();
public abstract void setPropertyNames(String[] PropertyNames);
public List getPropertyDescriptors() { if (getPropertyNames() == null || getPropertyNames().length == 0) { return getClassDescriptor().getPropertyDescriptors(); } ArrayList descriptors = new ArrayList(); for (int i = 0; i < getPropertyNames().length; i++) { try {
descriptors.add(Ognl.getValue("classDescriptor.propertyDescriptors.{?
name ==\"" + getPropertyNames()[i] + "\"}[0]", this)); } catch (OgnlException e) { e.printStackTrace(); //To change body of catch statement use File | Settings | File Templates. } } return descriptors; }
public String getColumnString() { ArrayList columnStrings = new ArrayList();
for (Iterator iter = getPropertyDescriptors().iterator(); iter.hasNext();) { TrailsPropertyDescriptor descriptor = (TrailsPropertyDescriptor) iter.next(); // name id column id so we can make a block for it String columnId = descriptor.isIdentifier() ? "id" : descriptor.getName(); if (displaying(descriptor)) { columnStrings.add(columnId + ":" + descriptor.getDisplayName() + ":" + descriptor.getName());
} }
return StringUtils.join(columnStrings.iterator(), ","); }
private boolean displaying(TrailsPropertyDescriptor descriptor) { if ((descriptor.isCollection() && isShowCollections() && !descriptor.isHidden()) || (!descriptor.isCollection() && !descriptor.isHidden())) { return true; } else { return false; } } }
This way I can set the properties I want to show.
I'm, also, adding User Management & login capabilities, extending the PersistenceService, and creating a special descriptor for java.util.Map
I hope you found this useful. I would really like to share my work.
Bye. Alejandro Scandroli.
PD:- please! excuse my lame English.
---------------------------------------------------------------------
To unsubscribe, e-mail: dev-...@trails.dev.java.net For additional commands, e-mail: dev-...@trails.dev.java.net
__________________________________________________ Do You Yahoo!? Tired of spam? Yahoo! Mail has the best spam protection around http://mail.yahoo.com





