Skip to content

Commit

Permalink
adding second col
Browse files Browse the repository at this point in the history
  • Loading branch information
linxOD committed Sep 23, 2024
1 parent a53205c commit 3d3a713
Show file tree
Hide file tree
Showing 3 changed files with 28 additions and 1 deletion.
7 changes: 6 additions & 1 deletion .github/workflows/download_collection.yml
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,10 @@ on:
description: 'Collection ID'
required: true
default: '162553'
colId2:
description: 'Collection ID 2'
required: true
default: '162554'


jobs:
Expand All @@ -18,6 +22,7 @@ jobs:
TR_USER: ${{ secrets.TR_USER }}
TR_PW: ${{ secrets.TR_PW}}
COL_ID: ${{ github.event.inputs.colId }}
COL_ID2: ${{ github.event.inputs.colId2 }}
steps:
- name: Perform Checkout
uses: actions/checkout@v2
Expand All @@ -34,7 +39,7 @@ jobs:
python ./scripts/fetch_mets.py
- name: Transform to TEI
run: |
ant -DCOL_ID=${COL_ID} -f ./build_tei.xml
ant -DCOL_ID=${COL_ID} -DCOL_ID2=${COL_ID2} -f ./build_tei.xml
- uses: stefanzweifel/git-auto-commit-action@v4
with:
commit_message: Exported and Transformed ColId ${{ github.event.inputs.colId }}
12 changes: 12 additions & 0 deletions build_tei.xml
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,9 @@
<property name="collection.id" value="${COL_ID}"/>
<property name="tei.dir" value="./tei/${collection.id}"/>
<property name="source.dir" value="./mets/${collection.id}"/>
<property name="collection.id2" value="${COL_ID2}"/>
<property name="tei.dir2" value="./tei/${collection.id2}"/>
<property name="source.dir2" value="./mets/${collection.id2}"/>
<property name="stylesheet" value="./page2tei/page2tei-0.xsl"/>
<property name="lib.dir" value="lib"/>
<target name="make-tei">
Expand All @@ -16,6 +19,15 @@
</fileset>
<mapper type="glob" from="*_mets.xml" to="*_tei.xml"/>
</xslt>
<xslt style="${stylesheet}" destdir="${tei.dir2}" basedir="${source.dir2}">
<factory name="net.sf.saxon.TransformerFactoryImpl"/>
<classpath location="./saxon/saxon9he.jar"/>
<param name="col-id" expression="${collection.id2}"/>
<fileset dir="${source.dir2}">
<include name="*.xml"/>
</fileset>
<mapper type="glob" from="*_mets.xml" to="*_tei.xml"/>
</xslt>
</target>
<extension-point name="generate-tei" depends="make-tei"></extension-point>
</project>
10 changes: 10 additions & 0 deletions scripts/fetch_mets.py
Original file line number Diff line number Diff line change
Expand Up @@ -12,3 +12,13 @@
)

mpr_docs = transkribus_client.collection_to_mets(col_id, file_path='./mets')

col_id = os.environ.get('COL_ID2')

transkribus_client = ACDHTranskribusUtils(
user=user,
password=pw,
transkribus_base_url="https://transkribus.eu/TrpServer/rest"
)

mpr_docs = transkribus_client.collection_to_mets(col_id, file_path='./mets')

0 comments on commit 3d3a713

Please sign in to comment.