You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@lenya.apache.org by "J. Wolfgang Kaltz" <jw...@apache.org> on 2005/05/03 11:04:17 UTC

[trunk] metadata handling

Hi list,
a few weeks ago we discussed changing the metadata handling, to
1. make metadata for a document mandatory;
2. store the metadata separately from the contents
3. add some Lenya-specific, non dublincore metadata, specifically the 
Lenya resource type within the metadata

1. & 2. basically just mean handling document metadata identically to 
the way meta-data is currently handled for assets; this does not seem to 
require many changes. However I'd like your input whether I've 
overlooked something before checking anything in:
Changes are
- DefaultDocument.java: work similar to Resource.java, that is: get 
metadata from a different URI than the contents. Add this source in 
getRepositoryNodes for locking
- remove meta stuff from the samples
- remove meta stuff from the schemas

Do you see any other things to consider ? I've tested editing in 
oneform, and the meta usecase for editing metadata. Testing in BXE and 
Kupu is incomplete, since the editor integration is not finished in 
trunk, but I suppose those editors don't care about Lenya metadata.


--
Wolfgang

Re: [trunk] metadata handling

Posted by qMax <qm...@mediasoft.ru>.
Tuesday, May 3, 2005, 4:04:17 PM, jwkaltz@apache.org wrote:

JWK> Hi list,
JWK> a few weeks ago we discussed changing the metadata handling, to
JWK> 1. make metadata for a document mandatory;
JWK> 2. store the metadata separately from the contents
JWK> 3. add some Lenya-specific, non dublincore metadata, specifically the
JWK> Lenya resource type within the metadata
It might make a sence to also add some publication-specific (not lenya) metadata.

I used some parameters to form additional navigation elements.
Other use may be to store list of subscribers for specific page.
Etc.

JWK> Do you see any other things to consider ?
? cocoon input module.

-- 
 qMax


---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@lenya.apache.org
For additional commands, e-mail: dev-help@lenya.apache.org


Re: [trunk] metadata handling

Posted by "Gregor J. Rothfuss" <gr...@apache.org>.
J. Wolfgang Kaltz wrote:

> I checked in the changes thus far as they are working; some open issues 
> remain:
> - should the index page of the default publication be of the resource 
> type "homepage" ? I actually did not understand how the homepage 
> resource type was handled thus far (how is "homepage" distinguished from 
> "xhtml"?)

from parameter-doctype.xmap:

     <map:pipeline>
       <!-- {area}/index.html -->
       <map:match pattern="*/index*.html">
         <map:generate type="serverpages" 
src="../../config/parameters/default.xsp">
           <map:parameter name="value" value="homepage"/>
         </map:generate>
         <map:serialize type="xml"/>
       </map:match>
     </map:pipeline>

the reason it was introduced was to allow a different stylesheet for the 
homepage, a common usecase

> - should blog entries have meta-data as well ? I suppose yes
> - should we attempt to unify all meta-data creation within DefaultCreator ?

+1

> - the resource type matching does not yet use the new meta-data

---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@lenya.apache.org
For additional commands, e-mail: dev-help@lenya.apache.org


Re: [RT] documents, resources, resource types

Posted by "Gregor J. Rothfuss" <gr...@apache.org>.
J. Wolfgang Kaltz wrote:

> What we have now IIUC is
> - documents (class Document), which can contain one piece of XML content 
> of a certain type (the "resource type")
> - resource types (class DocumentType), which gives information about a 
> resource type (name, schema location, ...) and a factory for creating 
> documents of this type
> - assets (class Resource), which belong to a Document

now that we store metadata seperately, we can store the resource type in 
the private lenya metadata, and treat them the same. the idea was also 
to have assets independant of documents (global assets)

> I was thinking a while back about how the Lenya object model might be 
> changed to better support key features such as content aggregation and 
> global assets. Initial thoughts are summarized in 
> http://wiki.apache.org/lenya/ContentModelProposal and although it is far 
> from complete it may provide a basis for discussion.
> 
> Any input is appreciated, either here in the mailing list or as comments 
> in the Wiki-page.

will take a look

> Bottom-line for short-term name changes would be
> - change Resource to ContentItem
> - change DocumentType to ResourceType
> Any actual structural changes obviously require more analysis and 
> discussion.

not sure we should do this at this point

---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@lenya.apache.org
For additional commands, e-mail: dev-help@lenya.apache.org


[RT] documents, resources, resource types (was: Re: [trunk] metadata handling)

Posted by "J. Wolfgang Kaltz" <jw...@apache.org>.
Andreas Hartmann schrieb:
> (...)
> 
> The DocumentTypeResolver could be removed, but I'd change
> 
>   String Document.getResourceType() throws DocumentException;
> 
> to
> 
>   DocumentType getResourceType() throws DocumentException;
> 
> or better
> 
>   ResourceType getResourceType() throws DocumentException;
> 
> which would use the DocumentTypeBuilder (ResourceTypeBuilder) for
> lazy loading the ResourceType object.

I was about to rename DocumentType to ResourceType, but then I noticed 
that we have Resource, which is something completely different :(
By that I mean, a ResourceType would not be the type of a Resource and I 
think that's quite confusing.

I think this is a good time to start a discussion about the Lenya object 
model regarding content.

What we have now IIUC is
- documents (class Document), which can contain one piece of XML content 
of a certain type (the "resource type")
- resource types (class DocumentType), which gives information about a 
resource type (name, schema location, ...) and a factory for creating 
documents of this type
- assets (class Resource), which belong to a Document

I was thinking a while back about how the Lenya object model might be 
changed to better support key features such as content aggregation and 
global assets. Initial thoughts are summarized in 
http://wiki.apache.org/lenya/ContentModelProposal and although it is far 
from complete it may provide a basis for discussion.

Any input is appreciated, either here in the mailing list or as comments 
in the Wiki-page.

Bottom-line for short-term name changes would be
- change Resource to ContentItem
- change DocumentType to ResourceType
Any actual structural changes obviously require more analysis and 
discussion.

WDYT ?

---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@lenya.apache.org
For additional commands, e-mail: dev-help@lenya.apache.org


Re: [trunk] metadata handling

Posted by Andreas Hartmann <an...@apache.org>.
J. Wolfgang Kaltz wrote:
> Andreas Hartmann schrieb:
> 
>> (...)
>>
>>> - the resource type matching does not yet use the new meta-data
>>
>>
>>
>> I don't quite understand, what do you mean here?
> 
> 
> At the start of the meta-data discussion (a while back, true enough :) ) 
> we talked about removing the need for calculating the resource type upon 
> each request for a document, and instead keeping the resource type in 
> the metadata and using that value.

OK, I'm on the track again :)

> I guess that would mean removing the DocumentTypeResolver, and replacing 
>  it with calls to Document.getResourceType().
> For example, PageEnvelopeModule.getDocumentType() would now just be a 
> one-liner, envelope.getDocument().getResourceType()

Big +1

That would mean that we could get rid of the URIParameterizer which
would simplify and speed up the processing.

The document type could be added to the PageEnvelope, which would
remove the inconsistency between PE and PEModule.

> I don't know if there are also more complicated cases, as the 
> DocumentTypeResolver is used in several places and also involves an 
> instance of the DocumentType class.

The DocumentTypeResolver could be removed, but I'd change

   String Document.getResourceType() throws DocumentException;

to

   DocumentType getResourceType() throws DocumentException;

or better

   ResourceType getResourceType() throws DocumentException;

which would use the DocumentTypeBuilder (ResourceTypeBuilder) for
lazy loading the ResourceType object.

-- Andreas


---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@lenya.apache.org
For additional commands, e-mail: dev-help@lenya.apache.org


Re: [trunk] metadata handling

Posted by "J. Wolfgang Kaltz" <jw...@apache.org>.
Andreas Hartmann schrieb:
> (...)
>> - the resource type matching does not yet use the new meta-data
> 
> 
> I don't quite understand, what do you mean here?

At the start of the meta-data discussion (a while back, true enough :) ) 
we talked about removing the need for calculating the resource type upon 
each request for a document, and instead keeping the resource type in 
the metadata and using that value.

I guess that would mean removing the DocumentTypeResolver, and replacing 
  it with calls to Document.getResourceType().
For example, PageEnvelopeModule.getDocumentType() would now just be a 
one-liner, envelope.getDocument().getResourceType()

I don't know if there are also more complicated cases, as the 
DocumentTypeResolver is used in several places and also involves an 
instance of the DocumentType class.


--
Wolfgang

---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@lenya.apache.org
For additional commands, e-mail: dev-help@lenya.apache.org


Re: [trunk] metadata handling

Posted by Andreas Hartmann <an...@apache.org>.
J. Wolfgang Kaltz wrote:
> Andreas Hartmann schrieb:
> 
>> (...) Maybe it makes sense to generalize DefaultDocument
>> and Resource re. the external meta data handling, or delegate this code
>> to another class.
> 
> 
> That's a good idea, we currently have the problem that the creation is 
> not generalized. The access is OK (going through the MetaDataManager), 
> but creation is
> - in Create.java usecase for documents
> - in DefaultResourcesManager.java for assets
> 
> whereas it probably should be in DefaultCreator instead ?

Yes, I agree. Maybe the whole document creation should be handled by

   DocumentManager.add(
       DocumentType doctype,
       String area,
       String id,
       String language)

which would call the creator that is assigned to the doctype ...


> That way any new type of creation might be able to share the metadata 
> creation (e.g. NewBlogEntryCreator - does not write metadata as of yet)
> 
> I checked in the changes thus far as they are working; some open issues 
> remain:
> - should the index page of the default publication be of the resource 
> type "homepage" ? I actually did not understand how the homepage 
> resource type was handled thus far (how is "homepage" distinguished from 
> "xhtml"?)

It looks like the homepage doctype is not used at all. No idea ...

> - should blog entries have meta-data as well ? I suppose yes
> - should we attempt to unify all meta-data creation within DefaultCreator ?

That would mean to use the DefaultCreator to create resources (assets)
as well, wouldn't it? That would be a bit strange since the concepts
of resource (asset) and document are separated at the moment.
I'd rather introduce a new class or add the functionality
to the MetaDataManager.

> - the resource type matching does not yet use the new meta-data

I don't quite understand, what do you mean here?

-- Andreas


---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@lenya.apache.org
For additional commands, e-mail: dev-help@lenya.apache.org


Re: [trunk] metadata handling

Posted by "J. Wolfgang Kaltz" <jw...@apache.org>.
Andreas Hartmann schrieb:
> (...) Maybe it makes sense to generalize DefaultDocument
> and Resource re. the external meta data handling, or delegate this code
> to another class.

That's a good idea, we currently have the problem that the creation is 
not generalized. The access is OK (going through the MetaDataManager), 
but creation is
- in Create.java usecase for documents
- in DefaultResourcesManager.java for assets

whereas it probably should be in DefaultCreator instead ?
That way any new type of creation might be able to share the metadata 
creation (e.g. NewBlogEntryCreator - does not write metadata as of yet)

I checked in the changes thus far as they are working; some open issues 
remain:
- should the index page of the default publication be of the resource 
type "homepage" ? I actually did not understand how the homepage 
resource type was handled thus far (how is "homepage" distinguished from 
"xhtml"?)
- should blog entries have meta-data as well ? I suppose yes
- should we attempt to unify all meta-data creation within DefaultCreator ?
- the resource type matching does not yet use the new meta-data


--
Wolfgang

---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@lenya.apache.org
For additional commands, e-mail: dev-help@lenya.apache.org


Re: [trunk] metadata handling

Posted by Andreas Hartmann <an...@apache.org>.
J. Wolfgang Kaltz wrote:
> Hi list,
> a few weeks ago we discussed changing the metadata handling, to
> 1. make metadata for a document mandatory;
> 2. store the metadata separately from the contents
> 3. add some Lenya-specific, non dublincore metadata, specifically the 
> Lenya resource type within the metadata
> 
> 1. & 2. basically just mean handling document metadata identically to 
> the way meta-data is currently handled for assets; this does not seem to 
> require many changes. However I'd like your input whether I've 
> overlooked something before checking anything in:
> Changes are
> - DefaultDocument.java: work similar to Resource.java, that is: get 
> metadata from a different URI than the contents. Add this source in 
> getRepositoryNodes for locking

That sounds very good. Maybe it makes sense to generalize DefaultDocument
and Resource re. the external meta data handling, or delegate this code
to another class.

-- Andreas

> - remove meta stuff from the samples
> - remove meta stuff from the schemas
>
> Do you see any other things to consider ? I've tested editing in 
> oneform, and the meta usecase for editing metadata. Testing in BXE and 
> Kupu is incomplete, since the editor integration is not finished in 
> trunk, but I suppose those editors don't care about Lenya metadata.
> 
> 
> -- 
> Wolfgang
> 
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: dev-unsubscribe@lenya.apache.org
> For additional commands, e-mail: dev-help@lenya.apache.org


---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@lenya.apache.org
For additional commands, e-mail: dev-help@lenya.apache.org


Re: [trunk] metadata handling

Posted by "Gregor J. Rothfuss" <gr...@apache.org>.
J. Wolfgang Kaltz wrote:

>> that means we can switch back to a generic xhtml relax ng, yay.
> 
> 
> Yes, except that we need to keep the lenya namespace IIUC, because the 
> document may contain a lenya:asset

hmm... we might be able to use object for that as well


> Suggestion: the MetaData of a Document/Resource consists of 3 sets of 
> metadata
> - dublin core, this is the existing stuff. It is specified at document 
> creation time; the "meta" usecase is used to edit this information in a 
> GUI.
> - lenya metadata: this is Lenya internal metadata, such as "resource 
> type". It is automatically created and managed by Lenya, the user does 
> not see this data.
> - custom metadata (see also qMax's mail): this is the mechanism through 
> which a Lenya implementer / customizer can assign arbitrary metadata to 
> resources / documents.

+1

plus we should take a look at how this maps to jcr nodetypes

---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@lenya.apache.org
For additional commands, e-mail: dev-help@lenya.apache.org


Re: [trunk] metadata handling

Posted by "J. Wolfgang Kaltz" <jw...@apache.org>.
Gregor J. Rothfuss schrieb:
> J. Wolfgang Kaltz wrote:
> 
>> Hi list,
>> a few weeks ago we discussed changing the metadata handling, to
>> 1. make metadata for a document mandatory;
>> 2. store the metadata separately from the contents
>> 3. add some Lenya-specific, non dublincore metadata, specifically the 
>> Lenya resource type within the metadata
>>
>>  (...)
> 
> that means we can switch back to a generic xhtml relax ng, yay.

Yes, except that we need to keep the lenya namespace IIUC, because the 
document may contain a lenya:asset

> 
> what about 3? will you handle 1 & 2 first, and then tackle 3? sounds 
> good to me.

Yes, 1 & 2 are in fact a simple change (unless I've overlooked 
something), I can check that in later.

For the next step, I'm wondering to what degree different types of 
metadata should be separated. We could of course handle everything in 
the same Map, but maybe it's better to have a clear separation ?

Suggestion: the MetaData of a Document/Resource consists of 3 sets of 
metadata
- dublin core, this is the existing stuff. It is specified at document 
creation time; the "meta" usecase is used to edit this information in a GUI.
- lenya metadata: this is Lenya internal metadata, such as "resource 
type". It is automatically created and managed by Lenya, the user does 
not see this data.
- custom metadata (see also qMax's mail): this is the mechanism through 
which a Lenya implementer / customizer can assign arbitrary metadata to 
resources / documents.

All metadata would be stored in the .meta file (later: meta node), 
though perhaps in 3 different branches; whereas the API would explicitly 
distinguish the 3 types.

WDYT ?

---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@lenya.apache.org
For additional commands, e-mail: dev-help@lenya.apache.org


Re: [trunk] metadata handling

Posted by "Gregor J. Rothfuss" <gr...@apache.org>.
J. Wolfgang Kaltz wrote:
> Hi list,
> a few weeks ago we discussed changing the metadata handling, to
> 1. make metadata for a document mandatory;
> 2. store the metadata separately from the contents
> 3. add some Lenya-specific, non dublincore metadata, specifically the 
> Lenya resource type within the metadata
> 
> 1. & 2. basically just mean handling document metadata identically to 
> the way meta-data is currently handled for assets; this does not seem to 
> require many changes. However I'd like your input whether I've 
> overlooked something before checking anything in:
> Changes are
> - DefaultDocument.java: work similar to Resource.java, that is: get 
> metadata from a different URI than the contents. Add this source in 
> getRepositoryNodes for locking
> - remove meta stuff from the samples
> - remove meta stuff from the schemas

that means we can switch back to a generic xhtml relax ng, yay.

what about 3? will you handle 1 & 2 first, and then tackle 3? sounds 
good to me.

---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@lenya.apache.org
For additional commands, e-mail: dev-help@lenya.apache.org