From b8b504b4a62e945a033fc7cb421e8786a89c6156 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Jan=20Stav=C4=9Bl?= Date: Tue, 1 Jul 2014 13:56:29 +0200 Subject: [PATCH] added original file contributing request structure. added aleph record structure updated handlers for new aleph responses changed ++add++edeposit.content.epublication view back to standard view added add-at-once view jstavel/edeposit.content#9 fixed jstavel/edeposit.content#12 --- edeposit.content.egg-info/SOURCES.txt | 3 + edeposit/content/AlephRecord.txt | 39 +++++ .../OriginalFileContributingRequest.txt | 39 +++++ ...OriginalFileContributingRequestsFolder.txt | 39 +++++ edeposit/content/aleph_record.py | 110 ++++++++++++++ .../aleph_record_templates/sampleview.pt | 31 ++++ .../content/aleph_search_sysnumber_request.py | 5 - edeposit/content/configure.zcml | 44 +++--- edeposit/content/epublication.py | 6 +- edeposit/content/handlers.py | 137 +++++++++++++++--- .../cs/LC_MESSAGES/edeposit.content.mo | Bin 8056 -> 8341 bytes .../cs/LC_MESSAGES/edeposit.content.po | 52 ++++++- .../content/locales/cs/LC_MESSAGES/plone.mo | Bin 596 -> 596 bytes .../content/locales/cs/LC_MESSAGES/plone.po | 2 +- edeposit/content/locales/edeposit.content.pot | 50 ++++++- edeposit/content/locales/plone.pot | 2 +- edeposit/content/models/aleph_record.xml | 11 ++ .../originalfile_contributing_request.xml | 11 ++ ...ginalfile_contributing_requests_folder.xml | 11 ++ .../originalfile_contributing_request.py | 74 ++++++++++ .../sampleview.pt | 31 ++++ ...iginalfile_contributing_requests_folder.py | 126 ++++++++++++++++ .../sampleview.pt | 31 ++++ edeposit/content/profiles/default/types.xml | 3 + .../types/edeposit.content.alephrecord.xml | 52 +++++++ ...ontent.originalfilecontributingrequest.xml | 57 ++++++++ ...originalfilecontributingrequestsfolder.xml | 54 +++++++ edeposit/content/tests.py | 24 +++ 28 files changed, 983 insertions(+), 61 deletions(-) create mode 100644 edeposit/content/AlephRecord.txt create mode 100644 edeposit/content/OriginalFileContributingRequest.txt create mode 100644 edeposit/content/OriginalFileContributingRequestsFolder.txt create mode 100644 edeposit/content/aleph_record.py create mode 100644 edeposit/content/aleph_record_templates/sampleview.pt create mode 100644 edeposit/content/models/aleph_record.xml create mode 100644 edeposit/content/models/originalfile_contributing_request.xml create mode 100644 edeposit/content/models/originalfile_contributing_requests_folder.xml create mode 100644 edeposit/content/originalfile_contributing_request.py create mode 100644 edeposit/content/originalfile_contributing_request_templates/sampleview.pt create mode 100644 edeposit/content/originalfile_contributing_requests_folder.py create mode 100644 edeposit/content/originalfile_contributing_requests_folder_templates/sampleview.pt create mode 100644 edeposit/content/profiles/default/types/edeposit.content.alephrecord.xml create mode 100644 edeposit/content/profiles/default/types/edeposit.content.originalfilecontributingrequest.xml create mode 100644 edeposit/content/profiles/default/types/edeposit.content.originalfilecontributingrequestsfolder.xml diff --git a/edeposit.content.egg-info/SOURCES.txt b/edeposit.content.egg-info/SOURCES.txt index a07c944..bb3807e 100644 --- a/edeposit.content.egg-info/SOURCES.txt +++ b/edeposit.content.egg-info/SOURCES.txt @@ -15,6 +15,7 @@ edeposit/content/__init__.py edeposit/content/aleph_exception.py edeposit/content/aleph_export_request.py edeposit/content/aleph_export_result.py +edeposit/content/aleph_record.py edeposit/content/aleph_search_sysnumber_request.py edeposit/content/author.py edeposit/content/book.py @@ -35,6 +36,8 @@ edeposit/content/library.py edeposit/content/libraryfolder.py edeposit/content/messages_folder.py edeposit/content/originalfile.py +edeposit/content/originalfile_contributing_request.py +edeposit/content/originalfile_contributing_requests_folder.py edeposit/content/previewfile.py edeposit/content/printingfile.py edeposit/content/testing.py diff --git a/edeposit/content/AlephRecord.txt b/edeposit/content/AlephRecord.txt new file mode 100644 index 0000000..3fb90cf --- /dev/null +++ b/edeposit/content/AlephRecord.txt @@ -0,0 +1,39 @@ +AlephRecord Tests +----------------- + +This is a DocTest file, using the Python doctest format. + + +Create a AlephRecord object and put it in a folder + + Create the object:: + + >>> from zope.component import createObject + >>> container = createObject('edeposit.content.alephrecord') + + Verify it's type:: + + >>> container.portal_type + 'edeposit.content.alephrecord' + + Give it a title:: + + >>> container.setTitle('Test Title') + >>> container.Title() + 'Test Title' + + Put it in our base folder:: + + >>> from plone.dexterity.utils import addContentToContainer + >>> cobj = addContentToContainer(folder, container) + + >>> cobj + + + >>> folder['test-title'].Title() + 'Test Title' + +Now, let's demonstrate a failing test:: + + >>> 2 == 3 # Deliberately failing test; fix me! + True \ No newline at end of file diff --git a/edeposit/content/OriginalFileContributingRequest.txt b/edeposit/content/OriginalFileContributingRequest.txt new file mode 100644 index 0000000..aa5dddc --- /dev/null +++ b/edeposit/content/OriginalFileContributingRequest.txt @@ -0,0 +1,39 @@ +OriginalFileContributingRequest Tests +----------------- + +This is a DocTest file, using the Python doctest format. + + +Create a OriginalFileContributingRequest object and put it in a folder + + Create the object:: + + >>> from zope.component import createObject + >>> container = createObject('edeposit.content.originalfilecontributingrequest') + + Verify it's type:: + + >>> container.portal_type + 'edeposit.content.originalfilecontributingrequest' + + Give it a title:: + + >>> container.setTitle('Test Title') + >>> container.Title() + 'Test Title' + + Put it in our base folder:: + + >>> from plone.dexterity.utils import addContentToContainer + >>> cobj = addContentToContainer(folder, container) + + >>> cobj + + + >>> folder['test-title'].Title() + 'Test Title' + +Now, let's demonstrate a failing test:: + + >>> 2 == 3 # Deliberately failing test; fix me! + True \ No newline at end of file diff --git a/edeposit/content/OriginalFileContributingRequestsFolder.txt b/edeposit/content/OriginalFileContributingRequestsFolder.txt new file mode 100644 index 0000000..75c62ef --- /dev/null +++ b/edeposit/content/OriginalFileContributingRequestsFolder.txt @@ -0,0 +1,39 @@ +OriginalFileContributingRequestsFolder Tests +----------------- + +This is a DocTest file, using the Python doctest format. + + +Create a OriginalFileContributingRequestsFolder object and put it in a folder + + Create the object:: + + >>> from zope.component import createObject + >>> container = createObject('edeposit.content.originalfilecontributingrequestsfolder') + + Verify it's type:: + + >>> container.portal_type + 'edeposit.content.originalfilecontributingrequestsfolder' + + Give it a title:: + + >>> container.setTitle('Test Title') + >>> container.Title() + 'Test Title' + + Put it in our base folder:: + + >>> from plone.dexterity.utils import addContentToContainer + >>> cobj = addContentToContainer(folder, container) + + >>> cobj + + + >>> folder['test-title'].Title() + 'Test Title' + +Now, let's demonstrate a failing test:: + + >>> 2 == 3 # Deliberately failing test; fix me! + True \ No newline at end of file diff --git a/edeposit/content/aleph_record.py b/edeposit/content/aleph_record.py new file mode 100644 index 0000000..048485b --- /dev/null +++ b/edeposit/content/aleph_record.py @@ -0,0 +1,110 @@ +# -*- coding: utf-8 -*- +from five import grok + +from z3c.form import group, field +from zope import schema +from zope.interface import invariant, Invalid +from zope.schema.interfaces import IContextSourceBinder +from zope.schema.vocabulary import SimpleVocabulary, SimpleTerm + +from plone.dexterity.content import Item + +from plone.directives import dexterity, form +from plone.app.textfield import RichText +from plone.namedfile.field import NamedImage, NamedFile +from plone.namedfile.field import NamedBlobImage, NamedBlobFile +from plone.namedfile.interfaces import IImageScaleTraversable + + +from edeposit.content import MessageFactory as _ + + +# Interface class; used to define content-type schema. + +class IAlephRecord(form.Schema, IImageScaleTraversable): + """ + E-Deposit Aleph Record + """ + + # If you want a schema-defined interface, delete the model.load + # line below and delete the matching file in the models sub-directory. + # If you want a model-based interface, edit + # models/aleph_record.xml to define the content type. + isbn = schema.ASCIILine( + title=_("ISBN"), + description=_(u"Value of ISBN"), + required = True, + ) + + + def getNazev(self): + return self.title + + nazev = schema.TextLine ( + title = u"Název", + required = False, + ) + + podnazev = schema.TextLine ( + title = u"Podnázev", + required = False, + ) + + cast = schema.TextLine ( + title = u"Část, díl", + required = False, + ) + + nazev_casti = schema.TextLine ( + title = u"Název části, dílu", + required = False, + ) + + rok_vydani = schema.ASCIILine ( + title = u"Rok vydání", + required = True, + ) + + aleph_sys_number = schema.ASCIILine ( + title = _(u'Aleph SysNumber'), + description = _(u'Internal SysNumber that Aleph refers to metadata of this ePublication'), + required = True, + ) + + aleph_library = schema.ASCIILine ( + title = _(u'Aleph Library'), + description = _(u'Library that Aleph refers to metadata of this ePublication'), + required = True, + ) + +# Custom content-type class; objects created for this content type will +# be instances of this class. Use this class to add content-type specific +# methods and properties. Put methods that are mainly useful for rendering +# in separate view classes. + +class AlephRecord(Item): + grok.implements(IAlephRecord) + + # Add your class methods and properties here + pass + + +# View class +# The view will automatically use a similarly named template in +# aleph_record_templates. +# Template filenames should be all lower case. +# The view will render when you request a content object with this +# interface with "/@@sampleview" appended. +# You may make this the default view for content objects +# of this type by uncommenting the grok.name line below or by +# changing the view class name and template filename to View / view.pt. + +class SampleView(grok.View): + """ sample view class """ + + grok.context(IAlephRecord) + grok.require('zope2.View') + + # grok.name('view') + + # Add view methods here diff --git a/edeposit/content/aleph_record_templates/sampleview.pt b/edeposit/content/aleph_record_templates/sampleview.pt new file mode 100644 index 0000000..f2f4404 --- /dev/null +++ b/edeposit/content/aleph_record_templates/sampleview.pt @@ -0,0 +1,31 @@ + + + + + This is a sample view template. It will not be used for rendering the + content unless activated by creation of a view class with a matching name. + + + + + +

+ Rendered from + aleph_record_templates/ +

+ + +
Title inserted here
+ +
+
+ + + + diff --git a/edeposit/content/aleph_search_sysnumber_request.py b/edeposit/content/aleph_search_sysnumber_request.py index 30262a1..af4f30c 100644 --- a/edeposit/content/aleph_search_sysnumber_request.py +++ b/edeposit/content/aleph_search_sysnumber_request.py @@ -26,11 +26,6 @@ class IAlephSearchSysNumberRequest(form.Schema, IImageScaleTraversable): Aleph Search SysNumber Request """ - # If you want a schema-defined interface, delete the model.load - # line below and delete the matching file in the models sub-directory. - # If you want a model-based interface, edit - # models/aleph_search_sysnumber_request.xml to define the content type. - isbn = schema.TextLine ( title = u"ISBN v souboru", required = True, diff --git a/edeposit/content/configure.zcml b/edeposit/content/configure.zcml index 775a111..abdc912 100644 --- a/edeposit/content/configure.zcml +++ b/edeposit/content/configure.zcml @@ -15,20 +15,6 @@ - - - @@ -102,13 +88,29 @@ - + + + + + + + + + + + + diff --git a/edeposit/content/epublication.py b/edeposit/content/epublication.py index c637995..f9e86f1 100644 --- a/edeposit/content/epublication.py +++ b/edeposit/content/epublication.py @@ -268,11 +268,14 @@ class IOriginalFiles(model.Schema): ) from originalfile import OriginalFile +from epublicationfolder import IePublicationFolder class EPublicationAddForm(DefaultAddForm): # label = _(u"Registration of a producent") # description = _(u"Please fill informations about user and producent.") default_fieldset_label = u"ePublikace" + portal_type="edeposit.content.epublication" + grok.context(IePublicationFolder) @property def additionalSchemata(self): @@ -283,7 +286,7 @@ def additionalSchemata(self): def update(self): print "update" - DefaultAddForm.update(self) + super(DefaultAddForm,self).update() self.widgets['IBasic.title'].label=u"Název ePublikace" def extractData(self): @@ -389,6 +392,7 @@ def getAndRemoveKey(data, key, defaultValue): class EPublicationAddView(DefaultAddView): form = EPublicationAddForm #index = ViewPageTemplateFile('epublication_templates/editatonce.pt') + pass class AuthorFactory(object): adapts(Interface, Interface, Interface, Interface) diff --git a/edeposit/content/handlers.py b/edeposit/content/handlers.py index 92b9fce..b891a50 100644 --- a/edeposit/content/handlers.py +++ b/edeposit/content/handlers.py @@ -5,7 +5,9 @@ IObjectRemovedEvent, IContainerModifiedEvent ) +import re from logging import getLogger +from decimal import Decimal logger = getLogger('edeposit.content.handlers') from plone.dexterity.utils import createContentInContainer @@ -29,9 +31,14 @@ Author ) +from edeposit.amqp.aleph.datastructures.alephrecord import ( + AlephRecord +) + from edeposit.amqp.aleph.datastructures.results import ( ISBNValidationResult, CountResult, + SearchResult, ExportResult, ) @@ -59,7 +66,6 @@ class ISBNValidateRequestProducent(Producer): exchange_durable = True auto_delete = False durable = True - #routing_key = "plone.aleph.isbn.validate.request" routing_key = "request" pass @@ -73,7 +79,6 @@ class ISBNCountRequestProducent(Producer): exchange_durable = True auto_delete = False durable = True - #routing_key = "plone.aleph.isbn.count.request" routing_key = "request" pass @@ -91,6 +96,7 @@ class AlephResponseConsumer(Consumer): @grok.subscribe(IAlephResponse, IMessageArrivedEvent) def handleAlephResponse(message, event): print "handle aleph response" + wft = api.portal.get_tool('portal_workflow') headers = message.header_frame.headers key=headers.get('UUID',None) if not key: @@ -99,15 +105,18 @@ def handleAlephResponse(message, event): message.ack() return - def getIfKeyExists(keyName,key): + def getContentIfKeyExists(keyName,key): if key.get(keyName,None): return api.content.get(UID=key[keyName]) return None keyContent = json.loads(key) - systemMessages = getIfKeyExists('systemMessages_UID',keyContent) - requestMessage = getIfKeyExists('request_UID',keyContent) - if not systemMessages or not requestMessage: + print "key contents of: " , keyContent + systemMessages = getContentIfKeyExists('systemMessages_UID',keyContent) + requestMessage = getContentIfKeyExists('request_UID',keyContent) + uuidType = keyContent.get('type',None) + uuidValue = keyContent.get('value', None) + if (not systemMessages or not requestMessage) and (not uuidType or not uuidValue): print "no system message or no request message exists in key" print message.body message.ack() @@ -116,8 +125,14 @@ def getIfKeyExists(keyName,key): # Messages from Aleph has its own deserialization logic. # So we will use it. data = deserialize(json.dumps(message.body),globals()) - print data - if isinstance(data, ISBNValidationResult): + if isinstance(data, SearchResult): + try: + handleSearchResult(key, data) + except HandlerError,e: + print str(e) + pass + message.ack() + elif isinstance(data, ISBNValidationResult): with api.env.adopt_user(username="system"): createContentInContainer(systemMessages,'edeposit.content.isbnvalidationresult', title="".join(["Výsledky kontroly ISBN: ", @@ -149,16 +164,20 @@ def getIfKeyExists(keyName,key): pass elif "exception" in headers: + #import sys,pdb; pdb.Pdb(stdout=sys.__stdout__).set_trace() with api.env.adopt_user(username="system"): - createContentInContainer(systemMessages,'edeposit.content.alephexception', - title="".join([u"Chyba při volání služby Aleph: ", - requestMessage.isbn, - ]), - message = "".join([ str(headers), - str(data) - ]), - isbn = requestMessage.isbn, - ) + if systemMessages: + createContentInContainer(systemMessages,'edeposit.content.alephexception', + title="".join([u"Chyba při volání služby Aleph: ", + getattr(requestMessage,'isbn',""), + ]), + message = "".join([ str(headers), + str(data) + ]), + isbn = getattr(requestMessage,'isbn',""), + ) + else: + print "exception without systemMessages folder, so I print it only", str(headers) pass print "There was an error in processing request ", headers["UUID"] @@ -198,6 +217,7 @@ def added(context,event): context.invokeFactory('edeposit.content.messagesfolder','system-messages', title=u"Systémové zprávy") + def addedEPublicationFolder(context, event): def queryForStates(*args): return [ {'i': 'portal_type', @@ -371,3 +391,86 @@ def addedAlephExportResult(context, event): # producer = getUtility(IProducer, name="amqp.aleph-export-result") wft.doActionFor(epublication, 'exportToAlephOK') return + +class HandlerError(Exception): + pass + +def handleSearchResult(uuid, data): + wft = api.portal.get_tool('portal_workflow') + keyContent = json.loads(uuid) + print "key contents of: " , keyContent + uuidType = keyContent.get('type',None) + uuidValue = keyContent.get('value', None) + if (not uuidType or not uuidValue): + raise HandlerError("no system message or no request message exists in key") + + def getContentIfKeyExists(keyName,key): + if key.get(keyName,None): + return api.content.get(UID=key[keyName]) + return None + + context = getContentIfKeyExists('context_UID',uuidValue) + if not context: + raise HandlerError("chyba: toto uuid neexistuje: " + str(uuid)) + if uuidType == 'edeposit.originalfile-load-epublication-request': + #import sys,pdb; pdb.Pdb(stdout=sys.__stdout__).set_trace() + with api.env.adopt_user(username="system"): + producent = aq_parent(aq_parent(context)) + ePublicationsFolder = producent['epublications'] + for record in data.records: + epublication = record.epublication + result = re.search('([0-9]+[\.,]{0,1}[0-9]*)',epublication.cena) + price = (result and result.group(0) or "").replace(",",".") + dataForFactory = { + 'title': str(epublication.nazev), + 'podnazev': epublication.podnazev, + 'cena': price and Decimal(price), + 'isbn_souboru_publikaci': epublication.ISBNSouboruPublikaci, + 'cast': epublication.castDil, + 'nazev_casti': epublication.nazevCasti, + 'nakladatel_vydavatel': epublication.nakladatelVydavatel, + 'rok_vydani': int(epublication.datumVydani), + 'poradi_vydani': epublication.poradiVydani, + 'misto_vydani': epublication.mistoVydani, + 'vydano_v_koedici_s': "", # TODO + 'zpracovatel_zaznamu': epublication.zpracovatelZaznamu, + } + newObject = createContentInContainer(ePublicationsFolder, + 'edeposit.content.epublication', + **dataForFactory + ) + # TODO: nacteni autoru + for author in epublication.autori: + pass + # set wfState + wft.doActionFor(newObject,'loadedFromAleph') + #wft.doActionFor(context, 'gotAnEPublication') + pass + pass + elif uuidType == 'edeposit.originalfile-search-alephrecords-request': + with api.env.adopt_user(username="system"): + for record in data.records: + epublication = record.epublication + dataForFactory = { + 'title': "".join([u"Záznam v Alephu: ", + str(epublication.nazev), + '(', + str(record.docNumber), + ')']), + 'nazev': str(epublication.nazev), + 'isbn': epublication.ISBN[0], + 'podnazev': epublication.podnazev, + 'cast': epublication.castDil, + 'nazev_casti': epublication.nazevCasti, + 'rok_vydani': epublication.datumVydani, + 'aleph_sys_number': record.docNumber, + 'aleph_library': record.library, + } + createContentInContainer(context,'edeposit.content.alephrecord', + **dataForFactory + ) + wft.doActionFor(context, 'gotAlephRecords') + pass + else: + raise HandlerError('wrong type of uuid: ' + uuidType) + diff --git a/edeposit/content/locales/cs/LC_MESSAGES/edeposit.content.mo b/edeposit/content/locales/cs/LC_MESSAGES/edeposit.content.mo index 98ea4e81344532ed3f29c206fbebd3eccd778a88..e8d9428f2cb492999a8bb7855e7c68e801868d92 100644 GIT binary patch delta 2474 zcmajhe@vBC9LMpm{0JnK9~C8#Jl9mzl=xu;Xb7k%h+$}!2^e@U?vBg73og!O>)LW= zo6(BV`oo#5t!8Dl-PT%8*1Ds$vOlUnD#vOK*H8N~YgDU0dVjcww*F|I@qJ$BdG2}6 zbDnd)=g~jvMjK*Zb_5L75!fhg9|O_!*(peDBg%Ca2dXZ8sJyhfQ7tXC3d1- z;7P2-k8lOfn{QTuRj4-(q6T;b7vdP^^L#r?B^N(N{_G+LP2pwd@3@@vzfm16U0`-Q z*5gKe2%9m1Jlp28KC7_+nPS_5H)9C(qR*fPb_!#JeZs-RDO3k(%(rGD7xgBUs0VlA zHFyv;#mAA!u$M6%-$ce}XA0qiW*=Ss$CfQvqKy-Bg0sMr%`JbMj20{c)?KZJVDFnahbDo0{( zQ&~mjCtQq$JjKI0=U!C9!>Dcc3ewa*L_O#tD#^Y_-M@gRslRg6uINJL&`H#;dJna0 ze!(j3|0T>@Js0+%*6f7y9i&hD7CqE_bC3B@9o3@Vs0TH*gQ&HB#CZ(4)gDJC$6i3q z)H%Edl~_UT|J_v7aRRlSCb1TM%(F(`fl9igsF6Q`dea25toAi}_!s)Hh>wP5q|Vuc z8sJgq)2Nwz9@BWfO}Gp1JHJD%T_&xx-3n0IUWyt>H7Z9MP}#p7)qbb57t1+6h?=1n zQQPgT`~6+ieV?K7&nBtJ%XkZB7AGHAjmr8))V66uJ$RS99ze~+0D3rzTKhMgQ>a|Y z;YX@gf_lzo)P0>E^RFp9%!N6qq7kp0sU?>~RW)8iFus|xj^h?rpJf}B+lWoXc6YJC zseIYt>O#xAhghNY*N9Y<6pchHq3Kgul4NGjldUr!qZ(Ac=##3lme8zeiBvp-RIob; z73G4KM>C=2t0!6r^3YZ-=P+BeM)wlh_wB^&Z={12j|4M{V`bC=gv#C|Gsn9*RudIO z9nnRk5VsQgdh8-pe1!HysZJ=(#QK?9@?Vs0>N|v71oYm&7(>s;g^}wYhroPmF~VXFPwTZ>T>Ij*dK9 m-( delta 2223 zcmXxke`u9e7{Kx4ezafOHg9&DYkJM8&9d&@ozBhXHn)|VF150nZe|V!5`;!Y5pgLr z8BsxFL}8^ASzuUPwaCgqtSF-pN-C&eEQqZ?B(eyKzTbP_9q#jf&Ux?qzURE>Jm($n z{CjQYr@2Mrfig^7O*9pTFp3*5<3QO{8bTTF#RNWvm3T1nD0=CKcqN{}BK!eoz$*L&<9IP@m+@5F^Kk(-qA#!oz5jl^ z3ZF%gsu1>HsCRA z#P88JojoT%uw__7yBi(I4y>mC@DLS#;Q$AxZanfOyq5N>=z~7THk`n2Ty%K|y*PsO z72d%W_z^O-VG6IqO4h3c*PsLILYMGi4w(d%r>OXVBWOp*F@|5GQ#paWbSPvUim?(I zLzsu&w;1PQ5}oocWR=1oGO1w%c|_QYq*r(Xy>EXN^IuKnc}~>g>uCEEbnVZh5Bd?k zaT583-y;9PCA2HJ$(c)`16zeATX)pnfOa^5NgP36=mqDWdU%b4BRqj#cou!5^XQCB zqEqKd*D#F}vqI=c2b8)ZpEK*w=j=phVh=iFqv&V!8kR2=aMbdAoS+4?1# z%@eo@!@LmI!DdY082aGj$k@UMXou&}jwUgIm(ZMulX2H$4_<>0U;;DaQRO7MjV>U+ zaEXH*%waSpQw+Va8GX<;H2V*rS^pWjdoH58qlVF}!hY<)edto1jhsR*W&N4Y1b;Lj z=RzO)pkee)o<^tiAiBm!Bi}`S;UouMGJJ#1(64wmHn48H@k#W#)99`#Ced244;$S7 z`>B|0$Iy|#kG|0xh_S=!?&?TBech$dWQdjel zDW(5VOT}cUN3%SQ-q0M`iz(XM(HVIL-Bzze|G$OacM6?}(~;lejkKrG4r>{u$-M;K z9gUc=##RNWruJwzNpQ5?(2QI{N4tBU4y{`kEv0M@c{W(J)6%)ucohj{6#n1BQnUmNO)%{vJAj?*wpXeo$gvI5vuxrCgqTc>j zQ!zo76Bd)>2Er+`@G`lN(}r9t|E4aFGhyCXZXw98+~?M|#U;9naC^IjO==6vpUW5P zv9ZG?@r;YK%O+(oPwsdJ$7aICZzHx71w<23LflSR5(HVF+vpH(Ce~V^+(hgk+!D7D zL&N}KF^jwS8suGEw%#aSk&3_MZCt=x{JLdP0*=BLEw-CdGiDKDE+)B6=EPiL* z`1fXCE*&h$F0Gg<$_`b1QBb~eMPn+FT-};Zj-_G?^37C|W_BQ!E*iTpUN&~Bt~~oy Md{c3DS6#aBe}neCM*si- diff --git a/edeposit/content/locales/cs/LC_MESSAGES/edeposit.content.po b/edeposit/content/locales/cs/LC_MESSAGES/edeposit.content.po index 311d175..4f3201a 100644 --- a/edeposit/content/locales/cs/LC_MESSAGES/edeposit.content.po +++ b/edeposit/content/locales/cs/LC_MESSAGES/edeposit.content.po @@ -14,8 +14,8 @@ msgid "" msgstr "" "Project-Id-Version: 1.0\n" -"POT-Creation-Date: 2014-05-21 08:30+0000\n" -"PO-Revision-Date: 2014-05-21 10:30+0200\n" +"POT-Creation-Date: 2014-06-12 06:36+0000\n" +"PO-Revision-Date: 2014-06-12 08:36+0200\n" "Last-Translator: Jan Stavěl \n" "Language-Team: Czech\n" "MIME-Version: 1.0\n" @@ -56,10 +56,15 @@ msgstr "" msgid "Aleph Export Result" msgstr "" +#: edeposit/content/profiles/default/types/edeposit.content.alephrecord.xml +msgid "Aleph Record" +msgstr "" + #: edeposit/content/profiles/default/types/edeposit.content.alephsearchsysnumberrequest.xml msgid "Aleph Search SysNumber Request" msgstr "" +#: edeposit/content/aleph_record.py:60 #: edeposit/content/originalfile.py:53 msgid "Aleph SysNumber" msgstr "" @@ -153,6 +158,10 @@ msgstr "E-Deposit - Složka s knihovnami" msgid "E-Deposit Original File" msgstr "E-Deposit - Soubor s originálem" +#: edeposit/content/profiles/default/types/edeposit.content.originalfilecontributingrequest.xml +msgid "E-Deposit Original File Contributing Request" +msgstr "E-Deposit - Žádost na odevzdání dokumentu" + #: edeposit/content/profiles/default/types/edeposit.content.previewfile.xml msgid "E-Deposit Preview File" msgstr "E-Deposit - Soubor s náhledem" @@ -227,6 +236,10 @@ msgstr "Doplňte v jaké je cena měně." msgid "Folder for AMQP messages." msgstr "Složka pro amqp zprávy" +#: edeposit/content/profiles/default/types/edeposit.content.originalfilecontributingrequestsfolder.xml +msgid "Folder for original file contributing requests" +msgstr "" + #: edeposit/content/profiles/default/types/edeposit.content.libraryfolder.xml msgid "Folder holds libraries" msgstr "Složka obsahuje záznamy o knihovnách" @@ -242,9 +255,9 @@ msgstr "Formát souboru." msgid "Generate ISBN" msgstr "Přiřadit ISBN" +#: edeposit/content/aleph_record.py:30 #: edeposit/content/isbn.py:31 #: edeposit/content/originalfile.py:35 -#: edeposit/content/profiles/default/types/edeposit.content.isbn.xml msgid "ISBN" msgstr "ISBN" @@ -288,6 +301,7 @@ msgstr "Interní číslo, podle kterého Aleph zařadí informace o tomto pokra msgid "Internal DocNumber that Aleph refers to metadata of this ePeriodical part" msgstr "Interní číslo podle kterého systém Aleph zařadí informace o tomto vydání pokračujícího zdroje" +#: edeposit/content/aleph_record.py:61 #: edeposit/content/originalfile.py:54 msgid "Internal SysNumber that Aleph refers to metadata of this ePublication" msgstr "" @@ -322,6 +336,10 @@ msgstr "Zpráva, co informuje o výsledku exportu do Alephu" msgid "Messages Folder" msgstr "Složka se systémovými zprávami" +#: edeposit/content/originalfile_contributing_requests_folder.py:70 +msgid "Odevzdání dokumentu" +msgstr "" + #: edeposit/content/originalfile.py:42 msgid "Original File of an ePublication" msgstr "Originál ePublikace" @@ -330,6 +348,15 @@ msgstr "Originál ePublikace" msgid "OriginalFile" msgstr "E-Deposit - Soubor s originálem" +#: edeposit/content/originalfile_contributing_requests_folder.py:123 +#: edeposit/content/profiles/default/types/edeposit.content.originalfilecontributingrequest.xml +msgid "OriginalFile Contributing Request" +msgstr "Žádost na odevzdání dokumentu" + +#: edeposit/content/profiles/default/types/edeposit.content.originalfilecontributingrequestsfolder.xml +msgid "OriginalFile Contributing Requests Folder" +msgstr "Složka k odevzdávání dokumentů" + #: edeposit/content/book.py:127 #: edeposit/content/eperiodical.py:103 #: edeposit/content/eperiodicalpart.py:122 @@ -403,6 +430,10 @@ msgstr "RIV" msgid "RIV category" msgstr "kategorie pro RIV" +#: edeposit/content/profiles/default/types/edeposit.content.alephrecord.xml +msgid "Record stored in Aleph" +msgstr "" + #: edeposit/content/eperiodical.py:133 #: edeposit/content/eperiodicalpart.py:152 #: edeposit/content/epublication.py:215 @@ -430,7 +461,7 @@ msgstr "" msgid "Result sent by Aleph amqp daemon" msgstr "" -#: edeposit/content/handlers.py:177 +#: edeposit/content/handlers.py:178 msgid "Review of authors" msgstr "Přehled autorů" @@ -467,6 +498,7 @@ msgstr "Web stránka, na které se pracuje s Krameriem." msgid "URLs" msgstr "Cesty URL" +#: edeposit/content/aleph_record.py:31 #: edeposit/content/isbn.py:32 #: edeposit/content/originalfile.py:36 msgid "Value of ISBN" @@ -495,6 +527,10 @@ msgstr "Titul svazku" msgid "Whether ISBN agency should generate ISBN number." msgstr "Má ISBN agentura přiřadit ISBN?" +#: edeposit/content/originalfile_contributing_requests_folder.py:71 +msgid "Známe ISBN záznamu v Alephu, chceme k němu odevzdat odpovídající dokument." +msgstr "" + #: edeposit/content/profiles/default/types/edeposit.content.eperiodical.xml msgid "ePeriodical" msgstr "E-Deposit - Pokračující zdroj" @@ -515,19 +551,19 @@ msgstr "E-Deposit - ePublikace" msgid "ePublicationFolder" msgstr "E-Deposit - Složka ePublikací" -#: edeposit/content/handlers.py:215 +#: edeposit/content/handlers.py:217 msgid "ePublications in declaring" msgstr "ePublikace v zadání" -#: edeposit/content/handlers.py:230 +#: edeposit/content/handlers.py:232 msgid "ePublications waiting for RIV to be reviewed" msgstr "" -#: edeposit/content/handlers.py:220 +#: edeposit/content/handlers.py:222 msgid "ePublications waiting for preparing of acquisition" msgstr "ePublikace čekající na akvizici" -#: edeposit/content/handlers.py:225 +#: edeposit/content/handlers.py:227 msgid "ePublications with errors" msgstr "ePublikace s chybami" diff --git a/edeposit/content/locales/cs/LC_MESSAGES/plone.mo b/edeposit/content/locales/cs/LC_MESSAGES/plone.mo index c4a94f54b3d3beb80923207d36cfdaebecbfec68..cca0664c7e4414dc34d8850728a2275117b05f13 100644 GIT binary patch delta 21 ccmcb@a)o8W2`)2TLn8$PGb>}WjhC7j0Z`Wm2mk;8 delta 21 ccmcb@a)o8W2`*DzBSQrP3oB!TjhC7j0Z_aL0{{R3 diff --git a/edeposit/content/locales/cs/LC_MESSAGES/plone.po b/edeposit/content/locales/cs/LC_MESSAGES/plone.po index 1779692..0d18c74 100644 --- a/edeposit/content/locales/cs/LC_MESSAGES/plone.po +++ b/edeposit/content/locales/cs/LC_MESSAGES/plone.po @@ -1,7 +1,7 @@ msgid "" msgstr "" "Project-Id-Version: PACKAGE VERSION\n" -"POT-Creation-Date: 2014-05-21 08:30+0000\n" +"POT-Creation-Date: 2014-06-12 06:36+0000\n" "PO-Revision-Date: YEAR-MO-DA HO:MI +ZONE\n" "Last-Translator: FULL NAME \n" "Language-Team: LANGUAGE \n" diff --git a/edeposit/content/locales/edeposit.content.pot b/edeposit/content/locales/edeposit.content.pot index c6ce607..77418a5 100644 --- a/edeposit/content/locales/edeposit.content.pot +++ b/edeposit/content/locales/edeposit.content.pot @@ -4,7 +4,7 @@ msgid "" msgstr "" "Project-Id-Version: PACKAGE VERSION\n" -"POT-Creation-Date: 2014-05-21 08:30+0000\n" +"POT-Creation-Date: 2014-06-12 06:36+0000\n" "PO-Revision-Date: YEAR-MO-DA HO:MI +ZONE\n" "Last-Translator: FULL NAME \n" "Language-Team: LANGUAGE \n" @@ -44,10 +44,15 @@ msgstr "" msgid "Aleph Export Result" msgstr "" +#: edeposit/content/profiles/default/types/edeposit.content.alephrecord.xml +msgid "Aleph Record" +msgstr "" + #: edeposit/content/profiles/default/types/edeposit.content.alephsearchsysnumberrequest.xml msgid "Aleph Search SysNumber Request" msgstr "" +#: edeposit/content/aleph_record.py:60 #: edeposit/content/originalfile.py:53 msgid "Aleph SysNumber" msgstr "" @@ -141,6 +146,10 @@ msgstr "" msgid "E-Deposit Original File" msgstr "" +#: edeposit/content/profiles/default/types/edeposit.content.originalfilecontributingrequest.xml +msgid "E-Deposit Original File Contributing Request" +msgstr "" + #: edeposit/content/profiles/default/types/edeposit.content.previewfile.xml msgid "E-Deposit Preview File" msgstr "" @@ -215,6 +224,10 @@ msgstr "" msgid "Folder for AMQP messages." msgstr "" +#: edeposit/content/profiles/default/types/edeposit.content.originalfilecontributingrequestsfolder.xml +msgid "Folder for original file contributing requests" +msgstr "" + #: edeposit/content/profiles/default/types/edeposit.content.libraryfolder.xml msgid "Folder holds libraries" msgstr "" @@ -230,9 +243,9 @@ msgstr "" msgid "Generate ISBN" msgstr "" +#: edeposit/content/aleph_record.py:30 #: edeposit/content/isbn.py:31 #: edeposit/content/originalfile.py:35 -#: edeposit/content/profiles/default/types/edeposit.content.isbn.xml msgid "ISBN" msgstr "" @@ -276,6 +289,7 @@ msgstr "" msgid "Internal DocNumber that Aleph refers to metadata of this ePeriodical part" msgstr "" +#: edeposit/content/aleph_record.py:61 #: edeposit/content/originalfile.py:54 msgid "Internal SysNumber that Aleph refers to metadata of this ePublication" msgstr "" @@ -310,6 +324,10 @@ msgstr "" msgid "Messages Folder" msgstr "" +#: edeposit/content/originalfile_contributing_requests_folder.py:70 +msgid "Odevzdání dokumentu" +msgstr "" + #: edeposit/content/originalfile.py:42 msgid "Original File of an ePublication" msgstr "" @@ -318,6 +336,15 @@ msgstr "" msgid "OriginalFile" msgstr "" +#: edeposit/content/originalfile_contributing_requests_folder.py:123 +#: edeposit/content/profiles/default/types/edeposit.content.originalfilecontributingrequest.xml +msgid "OriginalFile Contributing Request" +msgstr "" + +#: edeposit/content/profiles/default/types/edeposit.content.originalfilecontributingrequestsfolder.xml +msgid "OriginalFile Contributing Requests Folder" +msgstr "" + #: edeposit/content/book.py:127 #: edeposit/content/eperiodical.py:103 #: edeposit/content/eperiodicalpart.py:122 @@ -391,6 +418,10 @@ msgstr "" msgid "RIV category" msgstr "" +#: edeposit/content/profiles/default/types/edeposit.content.alephrecord.xml +msgid "Record stored in Aleph" +msgstr "" + #: edeposit/content/eperiodical.py:133 #: edeposit/content/eperiodicalpart.py:152 #: edeposit/content/epublication.py:215 @@ -418,7 +449,7 @@ msgstr "" msgid "Result sent by Aleph amqp daemon" msgstr "" -#: edeposit/content/handlers.py:177 +#: edeposit/content/handlers.py:178 msgid "Review of authors" msgstr "" @@ -455,6 +486,7 @@ msgstr "" msgid "URLs" msgstr "" +#: edeposit/content/aleph_record.py:31 #: edeposit/content/isbn.py:32 #: edeposit/content/originalfile.py:36 msgid "Value of ISBN" @@ -483,6 +515,10 @@ msgstr "" msgid "Whether ISBN agency should generate ISBN number." msgstr "" +#: edeposit/content/originalfile_contributing_requests_folder.py:71 +msgid "Známe ISBN záznamu v Alephu, chceme k němu odevzdat odpovídající dokument." +msgstr "" + #: edeposit/content/profiles/default/types/edeposit.content.eperiodical.xml msgid "ePeriodical" msgstr "" @@ -503,19 +539,19 @@ msgstr "" msgid "ePublicationFolder" msgstr "" -#: edeposit/content/handlers.py:215 +#: edeposit/content/handlers.py:217 msgid "ePublications in declaring" msgstr "" -#: edeposit/content/handlers.py:230 +#: edeposit/content/handlers.py:232 msgid "ePublications waiting for RIV to be reviewed" msgstr "" -#: edeposit/content/handlers.py:220 +#: edeposit/content/handlers.py:222 msgid "ePublications waiting for preparing of acquisition" msgstr "" -#: edeposit/content/handlers.py:225 +#: edeposit/content/handlers.py:227 msgid "ePublications with errors" msgstr "" diff --git a/edeposit/content/locales/plone.pot b/edeposit/content/locales/plone.pot index 4393406..404cf3b 100644 --- a/edeposit/content/locales/plone.pot +++ b/edeposit/content/locales/plone.pot @@ -4,7 +4,7 @@ msgid "" msgstr "" "Project-Id-Version: PACKAGE VERSION\n" -"POT-Creation-Date: 2014-05-21 08:30+0000\n" +"POT-Creation-Date: 2014-06-12 06:36+0000\n" "PO-Revision-Date: YEAR-MO-DA HO:MI +ZONE\n" "Last-Translator: FULL NAME \n" "Language-Team: LANGUAGE \n" diff --git a/edeposit/content/models/aleph_record.xml b/edeposit/content/models/aleph_record.xml new file mode 100644 index 0000000..faf4f90 --- /dev/null +++ b/edeposit/content/models/aleph_record.xml @@ -0,0 +1,11 @@ + + + + + + + + + + \ No newline at end of file diff --git a/edeposit/content/models/originalfile_contributing_request.xml b/edeposit/content/models/originalfile_contributing_request.xml new file mode 100644 index 0000000..faf4f90 --- /dev/null +++ b/edeposit/content/models/originalfile_contributing_request.xml @@ -0,0 +1,11 @@ + + + + + + + + + + \ No newline at end of file diff --git a/edeposit/content/models/originalfile_contributing_requests_folder.xml b/edeposit/content/models/originalfile_contributing_requests_folder.xml new file mode 100644 index 0000000..faf4f90 --- /dev/null +++ b/edeposit/content/models/originalfile_contributing_requests_folder.xml @@ -0,0 +1,11 @@ + + + + + + + + + + \ No newline at end of file diff --git a/edeposit/content/originalfile_contributing_request.py b/edeposit/content/originalfile_contributing_request.py new file mode 100644 index 0000000..2c18302 --- /dev/null +++ b/edeposit/content/originalfile_contributing_request.py @@ -0,0 +1,74 @@ +from five import grok + +from z3c.form import group, field +from zope import schema +from zope.interface import invariant, Invalid +from zope.schema.interfaces import IContextSourceBinder +from zope.schema.vocabulary import SimpleVocabulary, SimpleTerm + +from plone.dexterity.content import Container + +from plone.directives import dexterity, form +from plone.app.textfield import RichText +from plone.namedfile.field import NamedImage, NamedFile +from plone.namedfile.field import NamedBlobImage, NamedBlobFile +from plone.namedfile.interfaces import IImageScaleTraversable + + +from edeposit.content import MessageFactory as _ + + +# Interface class; used to define content-type schema. + +class IOriginalFileContributingRequest(form.Schema, IImageScaleTraversable): + """ + Description of the Example Type + """ + isbn = schema.ASCIILine( + title=_("ISBN"), + description=_(u"Value of ISBN"), + required = True, + ) + choosen_aleph_sys_number = schema.ASCIILine ( + title = _(u'Aleph SysNumber to load this document for'), + description = _(u'Internal SysNumber of a record in Aleph to load this document for.'), + required = False, + ) + choosen_aleph_library = schema.ASCIILine ( + title = _(u'Aleph Library to load this document for'), + description = _(u'Library of a record in Aleph to load this document for.'), + required = False, + ) + + + +# Custom content-type class; objects created for this content type will +# be instances of this class. Use this class to add content-type specific +# methods and properties. Put methods that are mainly useful for rendering +# in separate view classes. + +class OriginalFileContributingRequest(Container): + grok.implements(IOriginalFileContributingRequest) + # Add your class methods and properties here + pass + + +# View class +# The view will automatically use a similarly named template in +# originalfile_contributing_request_templates. +# Template filenames should be all lower case. +# The view will render when you request a content object with this +# interface with "/@@sampleview" appended. +# You may make this the default view for content objects +# of this type by uncommenting the grok.name line below or by +# changing the view class name and template filename to View / view.pt. + +class SampleView(grok.View): + """ sample view class """ + + grok.context(IOriginalFileContributingRequest) + grok.require('zope2.View') + + # grok.name('view') + + # Add view methods here diff --git a/edeposit/content/originalfile_contributing_request_templates/sampleview.pt b/edeposit/content/originalfile_contributing_request_templates/sampleview.pt new file mode 100644 index 0000000..2a14342 --- /dev/null +++ b/edeposit/content/originalfile_contributing_request_templates/sampleview.pt @@ -0,0 +1,31 @@ + + + + + This is a sample view template. It will not be used for rendering the + content unless activated by creation of a view class with a matching name. + + + + + +

+ Rendered from + originalfile_contributing_request_templates/ +

+ + +
Title inserted here
+ +
+
+ + + + diff --git a/edeposit/content/originalfile_contributing_requests_folder.py b/edeposit/content/originalfile_contributing_requests_folder.py new file mode 100644 index 0000000..72cc2f8 --- /dev/null +++ b/edeposit/content/originalfile_contributing_requests_folder.py @@ -0,0 +1,126 @@ +# -*- coding: utf-8 -*- +from five import grok +import zope + +from z3c.form import group, field, button +from zope import schema +from zope.interface import invariant, Invalid +from zope.schema.interfaces import IContextSourceBinder +from zope.schema.vocabulary import SimpleVocabulary, SimpleTerm + +from plone.dexterity.content import Container +from plone.dexterity.utils import createContentInContainer, addContentToContainer, createContent + +from plone.directives import dexterity, form +from plone.app.textfield import RichText +from plone.namedfile.field import NamedImage, NamedFile +from plone.namedfile.field import NamedBlobImage, NamedBlobFile +from plone.namedfile.interfaces import IImageScaleTraversable + +from .originalfile_contributing_request import IOriginalFileContributingRequest +from edeposit.content import MessageFactory as _ +import edeposit.amqp.aleph + +from z3c.form.interfaces import WidgetActionExecutionError, ActionExecutionError, IObjectFactory, IValidator, IErrorViewSnippet + +# Interface class; used to define content-type schema. + +class IOriginalFileContributingRequestsFolder(form.Schema, IImageScaleTraversable): + """ + Folder for original file contributing requests + """ + + # If you want a schema-defined interface, delete the model.load + # line below and delete the matching file in the models sub-directory. + # If you want a model-based interface, edit + # models/originalfile_contributing_requests_folder.xml to define the content type. + + form.model("models/originalfile_contributing_requests_folder.xml") + + +# Custom content-type class; objects created for this content type will +# be instances of this class. Use this class to add content-type specific +# methods and properties. Put methods that are mainly useful for rendering +# in separate view classes. + +class OriginalFileContributingRequestsFolder(Container): + grok.implements(IOriginalFileContributingRequestsFolder) + # Add your class methods and properties here + pass + + +# View class +# The view will automatically use a similarly named template in +# originalfile_contributing_requests_folder_templates. +# Template filenames should be all lower case. +# The view will render when you request a content object with this +# interface with "/@@sampleview" appended. +# You may make this the default view for content objects +# of this type by uncommenting the grok.name line below or by +# changing the view class name and template filename to View / view.pt. + + +class ContributeForm(form.Form): + grok.context(IOriginalFileContributingRequestsFolder) + grok.name('contribute') + grok.require('zope2.View') + + fields = field.Fields(IOriginalFileContributingRequest) + + label = _(u"Odevzdání dokumentu") + description = _(u"Známe ISBN záznamu v Alephu, chceme k němu odevzdat odpovídající dokument.") + ignoreContext = True + + def update(self): + self.request.set('disable_border', True) + return super(ContributeForm, self).update() + + def extractData(self): + def getErrorView(widget,error): + view = zope.component.getMultiAdapter( (error, + self.request, + widget, + widget.field, + widget.form, + self.context), + IErrorViewSnippet) + view.update() + widget.error = view + return view + + data, errors = super(ContributeForm,self).extractData() + isbn = data.get('isbn',None) + print 'isbn: ', isbn + if isbn: + print "isbn appeared: ", isbn + isbnWidget = self.widgets.get('isbn',None) + valid = edeposit.amqp.aleph.isbn.is_valid_isbn(isbn) + if not valid: + # validity error + print "isbn is not valid" + errors += (getErrorView(isbnWidget, zope.interface.Invalid(u'chyba v isbn')),) + pass + else: + try: + appearedAtAleph = edeposit.amqp.aleph.aleph.getISBNCount(isbn) + if not appearedAtAleph: + errors += (getErrorView(isbnWidget, zope.interface.Invalid(u'isbn nemá v Alephu záznam. Použijte jíné.')),) + except: + pass + + return (data,errors) + + + + + @button.buttonAndHandler(u"Načíst záznam z Alephu") + def contribute(self, action): + data, errors = self.extractData() + if errors: + self.status = self.formErrorsMessage + return + + data['title'] = u"Žádost na odevzdání dokumentu" + newObject = createContentInContainer(self.context,'edeposit.content.originalfilecontributingrequest',**data) + self.request.response.redirect(newObject.absolute_url()) + pass diff --git a/edeposit/content/originalfile_contributing_requests_folder_templates/sampleview.pt b/edeposit/content/originalfile_contributing_requests_folder_templates/sampleview.pt new file mode 100644 index 0000000..e75ae28 --- /dev/null +++ b/edeposit/content/originalfile_contributing_requests_folder_templates/sampleview.pt @@ -0,0 +1,31 @@ + + + + + This is a sample view template. It will not be used for rendering the + content unless activated by creation of a view class with a matching name. + + + + + +

+ Rendered from + originalfile_contributing_requests_folder_templates/ +

+ + +
Title inserted here
+ +
+
+ + + + diff --git a/edeposit/content/profiles/default/types.xml b/edeposit/content/profiles/default/types.xml index dde920c..115d341 100644 --- a/edeposit/content/profiles/default/types.xml +++ b/edeposit/content/profiles/default/types.xml @@ -11,6 +11,9 @@ + + + diff --git a/edeposit/content/profiles/default/types/edeposit.content.alephrecord.xml b/edeposit/content/profiles/default/types/edeposit.content.alephrecord.xml new file mode 100644 index 0000000..ba09d0d --- /dev/null +++ b/edeposit/content/profiles/default/types/edeposit.content.alephrecord.xml @@ -0,0 +1,52 @@ + + + + + Aleph Record + E-Deposit Aleph Record + string:${portal_url}/document_icon.png + edeposit.content.alephrecord + False + True + + False + + + edeposit.content.aleph_record.IAlephRecord + edeposit.content.aleph_record.AlephRecord + + + + + + + + + view + view + + + + False + cmf.AddPortalContent + + + + + + + + + + + + + + + + diff --git a/edeposit/content/profiles/default/types/edeposit.content.originalfilecontributingrequest.xml b/edeposit/content/profiles/default/types/edeposit.content.originalfilecontributingrequest.xml new file mode 100644 index 0000000..f201837 --- /dev/null +++ b/edeposit/content/profiles/default/types/edeposit.content.originalfilecontributingrequest.xml @@ -0,0 +1,57 @@ + + + + + OriginalFile Contributing Request + E-Deposit Original File Contributing Request + string:${portal_url}/folder_icon.png + edeposit.content.originalfilecontributingrequest + False + True + + + + False + + + edeposit.content.originalfile_contributing_request.IOriginalFileContributingRequest + edeposit.content.originalfile_contributing_request.OriginalFileContributingRequest + + + + + + + + + + + + view + view + + + + False + cmf.AddPortalContent + + + + + + + + + + + + + + + + diff --git a/edeposit/content/profiles/default/types/edeposit.content.originalfilecontributingrequestsfolder.xml b/edeposit/content/profiles/default/types/edeposit.content.originalfilecontributingrequestsfolder.xml new file mode 100644 index 0000000..be0a469 --- /dev/null +++ b/edeposit/content/profiles/default/types/edeposit.content.originalfilecontributingrequestsfolder.xml @@ -0,0 +1,54 @@ + + + + + OriginalFile Contributing Requests Folder + Folder for original file contributing requests + string:${portal_url}/folder_icon.png + edeposit.content.originalfilecontributingrequestsfolder + False + True + + + + False + + + edeposit.content.originalfile_contributing_requests_folder.IOriginalFileContributingRequestsFolder + edeposit.content.originalfile_contributing_requests_folder.OriginalFileContributingRequestsFolder + + + + + + + + + view + view + + + + False + cmf.AddPortalContent + + + + + + + + + + + + + + + + diff --git a/edeposit/content/tests.py b/edeposit/content/tests.py index 5e5127c..9c04622 100644 --- a/edeposit/content/tests.py +++ b/edeposit/content/tests.py @@ -22,6 +22,30 @@ # -*- extra stuff goes here -*- + # Integration tests for AlephRecord + ztc.ZopeDocFileSuite( + 'AlephRecord.txt', + package='edeposit.content', + optionflags = OPTION_FLAGS, + test_class=TestCase), + + + # Integration tests for OriginalFileContributingRequestsFolder + ztc.ZopeDocFileSuite( + 'OriginalFileContributingRequestsFolder.txt', + package='edeposit.content', + optionflags = OPTION_FLAGS, + test_class=TestCase), + + + # Integration tests for OriginalFileContributingRequest + ztc.ZopeDocFileSuite( + 'OriginalFileContributingRequest.txt', + package='edeposit.content', + optionflags = OPTION_FLAGS, + test_class=TestCase), + + # Integration tests for AlephException ztc.ZopeDocFileSuite( 'AlephException.txt',