## $Id: interfaces.py 11997 2014-11-19 17:02:48Z henrik $ ## ## Copyright (C) 2014 Uli Fouquet & Henrik Bettermann ## This program is free software; you can redistribute it and/or modify ## it under the terms of the GNU General Public License as published by ## the Free Software Foundation; either version 2 of the License, or ## (at your option) any later version. ## ## This program is distributed in the hope that it will be useful, ## but WITHOUT ANY WARRANTY; without even the implied warranty of ## MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the ## GNU General Public License for more details. ## ## You should have received a copy of the GNU General Public License ## along with this program; if not, write to the Free Software ## Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA ## from zope.interface import Attribute from zope import schema from waeup.ikoba.interfaces import ( IIkobaObject, SimpleIkobaVocabulary, ContextualDictSourceFactoryBase) from waeup.ikoba.interfaces import MessageFactory as _ class DocumentCategorySource(ContextualDictSourceFactoryBase): """A document type source delivers all types of documents. """ #: name of dict to deliver from ikoba utils. DICT_NAME = 'DOCUMENT_TYPES' class IDocumentsContainer(IIkobaObject): """A container for all kind of document objects. """ class IDocument(IIkobaObject): """A base representation of documents. """ id = Attribute('Document Identifier') history = Attribute('Object history, a list of messages') category = schema.Choice( title = _(u'Document Category'), source = DocumentCategorySource(), required = True, ) title = schema.TextLine( title = _(u'Document Title'), required = True, )