2013-01-22 13:52:48 +01:00
|
|
|
#import datetime
|
2013-03-06 00:41:45 +01:00
|
|
|
from Acquisition import aq_parent
|
2013-01-28 14:22:11 +01:00
|
|
|
from zope.interface import implements
|
2013-01-22 13:14:22 +01:00
|
|
|
|
2013-01-24 10:21:09 +01:00
|
|
|
from zope import schema
|
|
|
|
|
2013-01-22 13:14:22 +01:00
|
|
|
from plone.dexterity.schema import DexteritySchemaPolicy
|
2013-01-22 13:52:48 +01:00
|
|
|
from plone.dexterity.content import Item
|
2013-01-22 13:14:22 +01:00
|
|
|
|
2013-08-22 14:08:39 +02:00
|
|
|
from plone.app.textfield import RichText
|
|
|
|
|
2013-01-22 13:52:48 +01:00
|
|
|
from plone.supermodel import model
|
2013-01-22 13:14:22 +01:00
|
|
|
|
|
|
|
from . import _
|
2013-03-05 09:53:53 +01:00
|
|
|
from .keywordsfield import ThesaurusKeywords
|
|
|
|
from .equivalencesfield import ThesaurusKeywordEquivalences
|
2013-04-14 15:56:14 +02:00
|
|
|
from .vocabulary import NoThesaurusFound
|
2013-01-22 13:14:22 +01:00
|
|
|
|
|
|
|
class IDmsKeyword(model.Schema):
|
|
|
|
""" """
|
|
|
|
|
2013-04-13 14:53:14 +02:00
|
|
|
title = schema.TextLine(
|
|
|
|
title=_(u"Title")
|
|
|
|
)
|
|
|
|
|
2013-01-28 13:41:19 +01:00
|
|
|
# EQ: equivalences
|
2013-01-24 15:41:32 +01:00
|
|
|
equivs = ThesaurusKeywordEquivalences(
|
2013-03-05 09:53:53 +01:00
|
|
|
title=_(u'EQ (Equivalences)'),
|
2013-01-24 10:21:09 +01:00
|
|
|
required=False,
|
|
|
|
)
|
|
|
|
|
|
|
|
# BT: broader term
|
2013-03-05 09:53:53 +01:00
|
|
|
broader = ThesaurusKeywords(
|
2013-01-24 10:21:09 +01:00
|
|
|
title=_(u"BT (Broader Terms)"),
|
|
|
|
required=False,
|
2013-03-06 00:41:45 +01:00
|
|
|
vocabulary=u'dms.thesaurus.internalrefs'
|
2013-01-24 10:21:09 +01:00
|
|
|
)
|
|
|
|
|
|
|
|
# RT: related term
|
2013-03-05 09:53:53 +01:00
|
|
|
related = ThesaurusKeywords(
|
2013-01-24 10:21:09 +01:00
|
|
|
title=_(u"RT (Related Terms)"),
|
|
|
|
required=False,
|
2013-03-05 09:53:53 +01:00
|
|
|
display_backrefs=True,
|
2013-03-06 00:41:45 +01:00
|
|
|
vocabulary=u'dms.thesaurus.internalrefs'
|
2013-01-28 13:41:19 +01:00
|
|
|
)
|
|
|
|
|
|
|
|
# HN: historical note
|
2013-08-22 14:08:39 +02:00
|
|
|
historical_note = RichText(
|
2013-04-11 12:11:23 +02:00
|
|
|
title=_(u"HN (Historical Note)"),
|
2013-01-28 13:41:19 +01:00
|
|
|
required=False,
|
|
|
|
)
|
|
|
|
|
|
|
|
# SN: scope note
|
2013-08-22 14:08:39 +02:00
|
|
|
scope_note = RichText(
|
2013-04-11 12:11:23 +02:00
|
|
|
title=_(u"SN (Scope Note)"),
|
2013-01-28 13:41:19 +01:00
|
|
|
required=False,
|
2013-01-24 10:21:09 +01:00
|
|
|
)
|
|
|
|
|
|
|
|
|
2013-01-22 13:52:48 +01:00
|
|
|
class DmsKeyword(Item):
|
2013-01-22 13:14:22 +01:00
|
|
|
""" """
|
|
|
|
implements(IDmsKeyword)
|
|
|
|
|
|
|
|
|
|
|
|
class DmsKeywordSchemaPolicy(DexteritySchemaPolicy):
|
|
|
|
""" """
|
|
|
|
|
|
|
|
def bases(self, schemaName, tree):
|
|
|
|
return (IDmsKeyword, )
|
|
|
|
|