Archetypes don't have editable DC metadata

4 messages Options
Embed this post
Permalink
Derek Broughton-2 () Archetypes don't have editable DC metadata
Reply Threaded More More options
Print post
Permalink
I have a really straightforward content type that I created for a
training session.  I created it with ArchGenXML, but that hardly seems
important.  It inherits from BaseContent, and afaict it should have the
Dublin Core metadata - but I don't see a "Description" on the view or
edit pages (though the Description() accessor appears to be present when
I use Clouseau).

Am I doing something wrong?  Am I expecting something wrong?


from AccessControl import ClassSecurityInfo
from Products.Archetypes.atapi import *
from zope.interface import implements
import interfaces

from Products.CMFDynamicViewFTI.browserdefault import BrowserDefaultMixin

from Products.myProduct.config import *

##code-section module-header #fill in your manual code here
##/code-section module-header

schema = Schema((

    StringField(
        name='stringField',
        widget=StringField._properties['widget'](
            label='Stringfield',
            label_msgid='myProduct_label_stringField',
            i18n_domain='myProduct',
        ),
    ),
),
)

##code-section after-local-schema #fill in your manual code here
##/code-section after-local-schema

MyContent_schema = BaseSchema.copy() + \
    schema.copy()

##code-section after-schema #fill in your manual code here
##/code-section after-schema

class MyContent(BaseContent, BrowserDefaultMixin):
    """
    """
    security = ClassSecurityInfo()

    implements(interfaces.IMyContent)

    meta_type = 'MyContent'
    _at_rename_after_creation = True

    schema = MyContent_schema

    ##code-section class-header #fill in your manual code here
    ##/code-section class-header

    # Methods


registerType(MyContent, PROJECTNAME)
# end of class MyContent

--
derek


-------------------------------------------------------------------------
This SF.Net email is sponsored by the Moblin Your Move Developer's challenge
Build the coolest Linux based applications with Moblin SDK & win great prizes
Grand prize is a trip for two to an Open Source event anywhere in the world
http://moblin-contest.org/redirect.php?banner_id=100&url=/
_______________________________________________
Archetypes-users mailing list
[hidden email]
https://lists.sourceforge.net/lists/listinfo/archetypes-users
Khairil Yusof-4 () Re: Archetypes don't have editable DC metadata
Reply Threaded More More options
Print post
Permalink
On Wed, 2008-11-19 at 11:08 -0400, Derek Broughton wrote:
> I have a really straightforward content type that I created for a
> training session.  I created it with ArchGenXML, but that hardly seems
> important.  It inherits from BaseContent, and afaict it should have the
> Dublin Core metadata - but I don't see a "Description" on the view or
> edit pages (though the Description() accessor appears to be present when
> I use Clouseau).

Did you add the tagged value schemata = default in your model?

It's documented here: "field recycling - copy from parents schema or
another source schema and modify"

http://plone.org/documentation/manual/archgenxml2/basics/attributes-fields

For view, I just add this in my custom template.

 <div tal:define="desc here/Description"
tal:content="python:pss.newline_to_br(pss.html_quote(desc))">
              Description
         </div>

Hope this helps.


-------------------------------------------------------------------------
This SF.Net email is sponsored by the Moblin Your Move Developer's challenge
Build the coolest Linux based applications with Moblin SDK & win great prizes
Grand prize is a trip for two to an Open Source event anywhere in the world
http://moblin-contest.org/redirect.php?banner_id=100&url=/
_______________________________________________
Archetypes-users mailing list
[hidden email]
https://lists.sourceforge.net/lists/listinfo/archetypes-users
Derek Broughton-2 () Re: Archetypes don't have editable DC metadata
Reply Threaded More More options
Print post
Permalink
Khairil Yusof wrote:

> On Wed, 2008-11-19 at 11:08 -0400, Derek Broughton wrote:
>> I have a really straightforward content type that I created for a
>> training session.  I created it with ArchGenXML, but that hardly
>> seems
>> important.  It inherits from BaseContent, and afaict it should have
>> the Dublin Core metadata - but I don't see a "Description" on the
>> view or edit pages (though the Description() accessor appears to be
>> present when I use Clouseau).
>
> Did you add the tagged value schemata = default in your model?
>
> It's documented here: "field recycling - copy from parents schema or
> another source schema and modify"
>
> http://plone.org/documentation/manual/archgenxml2/basics/attributes-fields

Thanks.  That's not quite what I really wanted, but it put me on the
right track.  Description is in the BaseContent schema.  If I subclass
ATFolder or ATDocument, I get the Description where I want it - and
ATContentTypes just uses:

  ATContentTypeSchema['description'].schemata = 'default'

--
derek


-------------------------------------------------------------------------
This SF.Net email is sponsored by the Moblin Your Move Developer's challenge
Build the coolest Linux based applications with Moblin SDK & win great prizes
Grand prize is a trip for two to an Open Source event anywhere in the world
http://moblin-contest.org/redirect.php?banner_id=100&url=/
_______________________________________________
Archetypes-users mailing list
[hidden email]
https://lists.sourceforge.net/lists/listinfo/archetypes-users
Jens W. klein-2 () Re: Archetypes don't have editable DC metadata
Reply Threaded More More options
Print post
Permalink
In reply to this post by Derek Broughton-2
To make the description or any metadata field visible in the default
schemata (first form) do the following:

1) add an attribute description with type copy (description:copy)
2) select it and set a tagged value "schemata" with value "default"

thats it.

have fun

Jens Klein

Am Wed, 19 Nov 2008 11:08:24 -0400 schrieb Derek Broughton:

> I have a really straightforward content type that I created for a
> training session.  I created it with ArchGenXML, but that hardly seems
> important.  It inherits from BaseContent, and afaict it should have the
> Dublin Core metadata - but I don't see a "Description" on the view or
> edit pages (though the Description() accessor appears to be present when
> I use Clouseau).
>
[...]


------------------------------------------------------------------------------
This SF.net email is sponsored by:
SourcForge Community
SourceForge wants to tell your story.
http://p.sf.net/sfu/sf-spreadtheword
_______________________________________________
Archetypes-users mailing list
[hidden email]
https://lists.sourceforge.net/lists/listinfo/archetypes-users