-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
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 #9 fixed #12
- Loading branch information
Showing
28 changed files
with
983 additions
and
61 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -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 | ||
<AlephRecord at /plone/Members/test_user_1_/test-title> | ||
|
||
>>> folder['test-title'].Title() | ||
'Test Title' | ||
|
||
Now, let's demonstrate a failing test:: | ||
|
||
>>> 2 == 3 # Deliberately failing test; fix me! | ||
True |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -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 | ||
<OriginalFileContributingRequest at /plone/Members/test_user_1_/test-title> | ||
|
||
>>> folder['test-title'].Title() | ||
'Test Title' | ||
|
||
Now, let's demonstrate a failing test:: | ||
|
||
>>> 2 == 3 # Deliberately failing test; fix me! | ||
True |
39 changes: 39 additions & 0 deletions
39
edeposit/content/OriginalFileContributingRequestsFolder.txt
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -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 | ||
<OriginalFileContributingRequestsFolder at /plone/Members/test_user_1_/test-title> | ||
|
||
>>> folder['test-title'].Title() | ||
'Test Title' | ||
|
||
Now, let's demonstrate a failing test:: | ||
|
||
>>> 2 == 3 # Deliberately failing test; fix me! | ||
True |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -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 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,31 @@ | ||
<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en" | ||
xmlns:tal="http://xml.zope.org/namespaces/tal" | ||
xmlns:metal="http://xml.zope.org/namespaces/metal" | ||
xmlns:i18n="http://xml.zope.org/namespaces/i18n" | ||
lang="en" | ||
metal:use-macro="context/main_template/macros/master" | ||
i18n:domain="edeposit.content"> | ||
<body> | ||
|
||
<tal:comment tal:condition="nothing"> | ||
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. | ||
</tal:comment> | ||
|
||
<metal:main fill-slot="content-core"> | ||
<metal:content-core define-macro="content-core"> | ||
|
||
<h2> | ||
Rendered from | ||
aleph_record_templates/<span tal:replace="template/id" /> | ||
</h2> | ||
|
||
|
||
<div tal:content="context/Title">Title inserted here</div> | ||
|
||
</metal:content-core> | ||
</metal:main> | ||
|
||
</body> | ||
</html> | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.