History | Log In     View a printable version of the current page.  
Issue Details (XML | Word | Printable)

Key: TRAILS-59
Type: New Feature New Feature
Status: Closed Closed
Resolution: Fixed
Priority: Major Major
Assignee: Ken in nashua
Reporter: Ken in nashua
Votes: 0
Watchers: 0
Operations

If you were logged in you would be able to see more operations.
Trails

ObjectTable needs to be instrumented to be able to automatically render images

Created: 05/Jun/07 01:11 PM   Updated: 13/Jun/07 01:22 PM
Component/s: None
Affects Version/s: 1.1.0
Fix Version/s: 1.1.0

Time Tracking:
Not Specified

File Attachments: 1. HTML File DefaultList.html (2 kb)
2. Text File extending_the_ObjectTable_component.patch (2 kb)
3. Java Source File ObjectTable.java (8 kb)

Environment: XP Pro, MySQL, HSql


 Description  « Hide
ObjectTable needs to be instrumented to be able to automatically render images

Given the current support for blob this should be an easy task and may entail instrumentation of EditLink to parse a boolean that checks for ITrailsBlob and based on the annotation setting of the ITrailsBlob (beit link or image or frame) the object table would render it as is.



 All   Comments   Work Log   Change History      Sort Order: Ascending order - Click to sort in descending order
Ken in nashua - 07/Jun/07 04:36 PM
Ok, instrumenting ObjectTable was not my original idea but I wanted to get your feedback about it. Where this logic should preferably go.

Ken in nashua - 07/Jun/07 04:37 PM
Overrided a column, it is a guess... if it exists in the object it gets overridden otherwise ignored.

Ken in nashua - 07/Jun/07 04:54 PM
Alejandro, can you offer any advise about this...

Currently this solution is hardcoded to "photo" and descriptor="ognl:components.thisTable.photoColumnPropertyDescriptor"

Not pretty especially when the table knows nothing about whether the objects it is iterating even has UploadableMedia as any of it's properties.

Can you expand on a nice solution?

Ideally, it would be nice if the table was smart enough to render image or link for all UploadableMedia.

The solution I attached works fine... and operates the table column just as TrailsDownload.html works.

So it looks nice... I am curious about your view of the world at this juncture.

Thanks


Kalle Korhonen - 07/Jun/07 05:49 PM
Alejandro already gave you his advice. Use the block to render it. I'd suggesting closing the bug.

Ken in nashua - 07/Jun/07 07:25 PM
Sure, I am going to make one pass at abstract integration and close it for good.

Alejandro Scandroli - 08/Jun/07 02:27 AM
Ken that is waaaayyy too much code.
I wrote a snippet for you copying the usage of the EditLink block. Take a look at the patch.
That's all the code you need to change in ObjectTable.java. In ObjectTable.html you have 5 lines to do whatever you need to do to render the blob, if 5 lines of code are not enough you are going to need to create another component to hold your logic. I'm not following the blob components evolution too closely but I think you should be able to reuse the blob download component here. If you are not able to use it that means the download component could use a refactoring.

BTW, I'm not a fan of rendering blobs in the object table, but as long as the user can avoid it I'm ok with adding it.


Ken in nashua - 08/Jun/07 09:15 AM
Thanks Alejandro, thats what I was looking for...

Let me run with this and see what comes out of it.

great.. thanks !


Ken in nashua - 13/Jun/07 01:22 PM
Works like a dream...