Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Custom ddcSubject vocabulary #2

Merged
merged 1 commit into from
Apr 25, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
8 changes: 8 additions & 0 deletions recensio/altertum/browser/configure.zcml
Original file line number Diff line number Diff line change
Expand Up @@ -46,4 +46,12 @@
layer="recensio.altertum.interfaces.IAltertumLayer"
/>

<browser:page
name="vocabulary-helper"
for="*"
class=".views.AltertumVocabularyHelper"
permission="zope2.View"
layer="recensio.altertum.interfaces.IAltertumLayer"
/>

</configure>
6 changes: 6 additions & 0 deletions recensio/altertum/browser/views.py
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
from recensio.plone.browser.helper import VocabularyHelper
from recensio.plone.browser.homepage import HomepageView
from recensio.plone.browser.pdfgen import GeneratePdfRecension

Expand All @@ -12,3 +13,8 @@ class AltertumHomepageView(HomepageView):

resource_directory = "++resource++recensio.altertum.images"
review_languages = [""]

class AltertumVocabularyHelper(VocabularyHelper):
@property
def ddcSubject(self):
return self.get_named_vocabulary("recensio.altertum.vocabularies.topic_values")
7 changes: 7 additions & 0 deletions recensio/altertum/configure.zcml
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,14 @@
i18n_domain="recensio.altertum"
>

<include
package="collective.vdexvocabulary"
file="meta.zcml"
/>
<include package="collective.vdexvocabulary" />

<include package=".browser" />
<include package=".vocabularies" />
<include file="profiles.zcml" />

<include package="recensio.plone" />"
Expand Down
8 changes: 8 additions & 0 deletions recensio/altertum/vocabularies/configure.zcml
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
<configure
xmlns="http://namespaces.zope.org/zope"
xmlns:vdex="http://namespaces.zope.org/vdex"
>

<vdex:treevocabulary directory="vdex/" />

</configure>
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@
<vocabName>
<langstring language="en">International Standard Classification of Occupations, ISCO-88</langstring>
</vocabName>
<vocabIdentifier>ISCO88</vocabIdentifier>
<vocabIdentifier>recensio.altertum.vocabularies.topic_values</vocabIdentifier>
<term>
<termIdentifier>1001</termIdentifier>
<caption>
Expand Down