Skip to content

Commit

Permalink
Merge pull request #2 from syslabcom/scrum-2194-ddc-vocabularies
Browse files Browse the repository at this point in the history
Custom ddcSubject vocabulary
  • Loading branch information
reinhardt authored Apr 25, 2024
2 parents a1a90c7 + e367a6d commit 82719c8
Show file tree
Hide file tree
Showing 5 changed files with 30 additions and 1 deletion.
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

0 comments on commit 82719c8

Please sign in to comment.