Prepared package with new content types (still no field)

This commit is contained in:
David Convent 2013-01-22 13:52:48 +01:00
parent e6ec0c30cd
commit 28da1f21fd
9 changed files with 104 additions and 33 deletions

View File

@ -16,7 +16,6 @@
<include package="plone.supermodel" />
<include package="plone.app.relationfield" />
<include package="collective.dms.thesaurus" />
<include package="collective.contact.content" />
<genericsetup:registerProfile
name="default"
@ -32,19 +31,8 @@
/>
<utility
factory=".dmskeyword.DmsOutgoingMailSchemaPolicy"
name="schema_policy_dmsoutgoingmail"
factory=".dmsthesaurus.DmsThesaurusSchemaPolicy"
name="schema_policy_dmsthesaurus"
/>
<browser:resource
name="dmskeyword_icon.png"
image="dmskeyword_icon.png"
/>
<browser:resource
name="dmskeyword_orange_icon.png"
image="dmskeyword_orange_icon.png"
/>
</configure>

View File

@ -1,27 +1,23 @@
import datetime
from zope import schema
#import datetime
#from zope import schema
#from zope.component import adapts
from zope.interface import implements
#from plone.dexterity.content import Container
from plone.dexterity.schema import DexteritySchemaPolicy
from plone.dexterity.content import Item
from collective.dms.thesaurus.relateddocs import RelatedDocs
#from plone.supermodel import model
from collective.dms.thesaurus.dmsdocument import IDmsDocument, DmsDocument
from collective.contact.content.schema import ContactList, ContactChoice
from plone.supermodel import model
from . import _
from plone.autoform import directives as form
from plone.directives.form import default_value
#from plone.autoform import directives as form
#from plone.directives.form import default_value
class IDmsKeyword(model.Schema):
""" """
class DmsKeyword(DmsDocument):
class DmsKeyword(Item):
""" """
implements(IDmsKeyword)
@ -32,4 +28,3 @@ class DmsKeywordSchemaPolicy(DexteritySchemaPolicy):
def bases(self, schemaName, tree):
return (IDmsKeyword, )

View File

@ -0,0 +1,31 @@
#import datetime
#from zope import schema
#from zope.component import adapts
from zope.interface import implements
#from plone.dexterity.content import Container
from plone.dexterity.schema import DexteritySchemaPolicy
from plone.dexterity.content import Container
from plone.supermodel import model
from . import _
#from plone.autoform import directives as form
#from plone.directives.form import default_value
class IDmsThesaurus(model.Schema):
""" """
class DmsThesaurus(Container):
""" """
implements(IDmsThesaurus)
class DmsThesaurusSchemaPolicy(DexteritySchemaPolicy):
""" """
def bases(self, schemaName, tree):
return (IDmsThesaurus, )

View File

@ -19,3 +19,7 @@ msgstr ""
msgid "Thesaurus Keyword"
msgstr ""
#: ./profiles/default/types/dmsthesaurus.xml
msgid "Thesaurus"
msgstr ""

View File

@ -19,3 +19,7 @@ msgstr ""
msgid "Thesaurus Keyword"
msgstr "Mot clé du thesaurus"
#: ./profiles/default/types/dmsthesaurus.xml
msgid "Thesaurus"
msgstr "Thesaurus"

View File

@ -21,3 +21,7 @@ msgstr ""
msgid "Thesaurus Keyword"
msgstr ""
#: ./profiles/default/types/dmsthesaurus.xml
msgid "Thesaurus"
msgstr ""

View File

@ -1,5 +1,6 @@
<?xml version="1.0"?>
<object name="portal_types" meta_type="Plone Types Tool">
<property name="title">Controls the available content types in your portal</property>
<object name="dmsthesaurus" meta_type="Dexterity FTI"/>
<object name="dmskeyword" meta_type="Dexterity FTI"/>
</object>

View File

@ -1,19 +1,16 @@
<?xml version="1.0"?>
<object name="dmskeyword" meta_type="Dexterity FTI" i18n:domain="plone"
xmlns:i18n="http://xml.zope.org/namespaces/i18n">
<property name="title" i18n:translate="">Incoming Mail</property>
<property name="description" i18n:translate="">Incoming dms mail document</property>
<property name="icon_expr">string:${portal_url}/++resource++document_icon.png</property>
<property name="title" i18n:translate="">Keyword</property>
<property name="description" i18n:translate="">DMS Keyword</property>
<property name="icon_expr">string:${portal_url}/++resource++folder_icon.png</property>
<property name="factory">dmskeyword</property>
<property name="add_view_expr">string:${folder_url}/++add++dmskeyword</property>
<property name="link_target"></property>
<property name="immediate_view">view</property>
<property name="global_allow">True</property>
<property name="filter_content_types">True</property>
<property name="allowed_content_types">
<element value="dmsmainfile"/>
<element value="dmsappendixfile"/>
</property>
<property name="allowed_content_types"/>
<property name="allow_discussion">False</property>
<property name="default_view">view</property>
<property name="view_methods">

View File

@ -0,0 +1,47 @@
<?xml version="1.0"?>
<object name="dmsthesaurus" meta_type="Dexterity FTI" i18n:domain="plone"
xmlns:i18n="http://xml.zope.org/namespaces/i18n">
<property name="title" i18n:translate="">Thesaurus</property>
<property name="description" i18n:translate="">DMS Thesaurus</property>
<property name="icon_expr">string:${portal_url}/++resource++folder_icon.png</property>
<property name="factory">dmsthesaurus</property>
<property name="add_view_expr">string:${folder_url}/++add++dmsthesaurus</property>
<property name="link_target"></property>
<property name="immediate_view">view</property>
<property name="global_allow">True</property>
<property name="filter_content_types">True</property>
<property name="allowed_content_types">
<element value="dmskeyword"/>
</property>
<property name="allow_discussion">False</property>
<property name="default_view">view</property>
<property name="view_methods">
<element value="view"/>
</property>
<property name="default_view_fallback">False</property>
<property name="add_permission">cmf.AddPortalContent</property>
<property name="klass">collective.dms.thesaurus.dmsthesaurus.DmsThesaurus</property>
<property name="behaviors">
<element value="plone.app.content.interfaces.INameFromTitle"/>
<element value="plone.app.dexterity.behaviors.metadata.IDublinCore"/>
<element value="collective.dexteritytextindexer.behavior.IDexterityTextIndexer" />
</property>
<!-- DO NOT use a model_source or it removes manually added fields while reapplying the profile -->
<!--property name="model_source" /-->
<property name="schema">collective.dms.thesaurus.dmsthesaurus.IDmsThesaurus</property>
<property name="schema_policy">schema_policy_dmsthesaurus</property>
<alias from="(Default)" to="(dynamic view)"/>
<alias from="edit" to="@@edit"/>
<alias from="sharing" to="@@sharing"/>
<alias from="view" to="(selected layout)"/>
<action title="View" action_id="view" category="object" condition_expr=""
description="" icon_expr="" link_target="" url_expr="string:${object_url}"
visible="True">
<permission value="View"/>
</action>
<action title="Edit" action_id="edit" category="object" condition_expr=""
description="" icon_expr="" link_target=""
url_expr="string:${object_url}/edit" visible="True">
<permission value="Modify portal content"/>
</action>
</object>