Hi Gary, The nt:resource node type contains a property called : jcr:mimeType, which is a mandatory property meant to hold exactly this kind of information.
If you want to add a property, create a new node type, with nt:resource as a supertype, then add a property ;) Frédéric Esnault - Ingénieur R&D Legisway 60 boulevard de la mission Marchand 92400 Courbevoie La Défense -----Message d'origine----- De : Gary Dong [mailto:[EMAIL PROTECTED] Envoyé : jeudi 24 mai 2007 23:27 À : [email protected] Objet : Re: Custom property type? Hi Stefan; Thank you for the information. I got some more questions related that. I noticed that nt:resource node type and I can see that I can set my content to the 'jcr:data' property. But where I can set my content type, (ie. pdf, doc..) to the node? I shouldn't set my content type to either jcr:encoding or jcr:mimeTypy, is that right? Also, can I add a new property definition to the predefined node types? Do I have to define a new node type extending from the predefined ones to include some new property definitions? Gary On 5/24/07, Stefan Guggisberg <[EMAIL PROTECTED]> wrote: > > On 5/24/07, Frédéric Esnault <[EMAIL PROTECTED]> wrote: > > HI Gary, > > > > I was wondering, instead of creating a custom PropertyType, why not > creating a child node instead of a property, and give this child node two > properties : > > - one STRING property holding the type of the content (ie. PDF, DOC, > PS....); > > - one BINARY property holding the content itself? > > there's already a built-in node type nt:resource that you can use: > > [nt:resource] > mix:referenceable > - jcr:encoding (string) > - jcr:mimeType (string) mandatory > - jcr:data (binary) primary mandatory > - jcr:lastModified (date) mandatory ignore > > cheers > stefan > > > > > Frederic > > > > -----Message d'origine----- > > De: Gary Dong [mailto:[EMAIL PROTECTED] > > Envoyé: jeudi 24 mai 2007 03:27 > > À: [email protected] > > Objet: Custom property type? > > > > Hi; > > > > Does any know how to define(create) a custom property type? I need to > define > > some my own property type, for example, .doc or .pdf, so that I can > search > > the properties by those custom property type. I noticed that the > > 'PropertyType' class is a final class. I couldn't extend it. Is there > any > > way I can define(create) a custom property type? > > > > > > Thank you ahead for the help. > > > > Gary > > >
