cancel
Showing results for 
Search instead for 
Did you mean: 

Generator and/or Converter to show content properties

lapo
Champ in-the-making
Champ in-the-making
Hi.
I have created a few aspects, a few new textual & date properties, and all works perfectly, get indexed by Lucene, are shown and edited correctly in the webclient, all is peachy (not without a learning curve, that is, but I've got far enough on that curve to have them working).
The problem is that now I have a binary data property, and being binary data I figured out it must be of data type "content", I write it using ContentServices, I can read it back, and as far as my action goes, it applies the aspect and set the property value correctly.
The problem is showing it in webclient… AFAIK (I know very little of JSFaces) I should create a Generator to properly show the property with the full complexity that I need (an HTML table with a few fields)… but taking a quick look at existing Generators I was a bit scared off, so I decided to "start easy" and use a Converter to get a String containing a rough version of that property, easily visible from the webclient (just to be sure that the data is there, and is correct).

getAsString(FacesContext context, UIComponent component, Object value)
Problem is: my converter gets called with a null "value" parameter.
All the pre-existing Converters expect to receive "property value" in that parameter, but I guess it isn't so for content types, only for data that's stored directly in the DB?
Or is the problem completely different?

In short: what's the way to get the byte[] value of a content property from a Converter?
5 REPLIES 5

gavinc
Champ in-the-making
Champ in-the-making
Content properties are not supported in the property sheet (in fact those properties are set to read-only) so there is a good chance the context is not being setup properly for the converter to work.

If all you want to do is get the byte size of some content it will probably be easier to expose the byte size as an additional property of the client side Node object the web client uses.

If you look at BrowseBean.queryBrowseNodes() you'll notice some additional properties being added via 'propertyResolvers', I would try this approach. In fact, there is already a "size" property added for the default content property so you can use this as an example.

lapo
Champ in-the-making
Champ in-the-making
First of all, thanks for the fast reply, it's much appreciated!
That content is not really something that can be easily "summarized" in a normal property: the custom property contains (probably large) binary data that must be parsed in its components (example given, one of the components is a digital signature that must be verified).
Using a full-fledged Generator there would be the same problems to access a content property as there are with a Converter?
Or are there other ways to customize the webclient with custom pieces? (maybe a wizard, or custom JSPs… I'm just brainstorming here, but I'll take a better look at the documentation; any pointer to the correct section is appreciated)

dhalupa
Champ on-the-rise
Champ on-the-rise
I will try to list steps which are needed to achieve custom visual representation of binary data

1. As Gavin allready said, first thing you have to do is change BrowseBean.queryBrowseNodes and add your own NodePropertyResolver implementation which will return your binary content.
2. You will have to write and register custom JSF component. The responsibility of this component is to  analyze bound binary data and render visual representation.
3. Write and register component generator which will instantiate and initialize your custom component and will also perform value binding.
4. Register new component generator with property sheet

Kind regards,

Denis

lapo
Champ in-the-making
Champ in-the-making
Ah OK, I misunderstood Gavin regarding the resolvers, I tought he meant an actual property had to be created. I'll take a deep look at those classes you both mentioned, thanks for the pointers!

gavinc
Champ in-the-making
Champ in-the-making
Thanks for clarifying Denis
Getting started

Tags


Find what you came for

We want to make your experience in Hyland Connect as valuable as possible, so we put together some helpful links.