@@ -34,36 +34,9 @@ def __init__(self, notice_metadata: ExtractedMetadata):
3434 def template_metadata (self , action : str = METS_TYPE_CREATE ) -> PackagerMetadata :
3535 metadata = self .from_notice_metadata (self .notice_metadata )
3636
37- # here are set custom and composed metadata properties
37+ # here the custom and composed metadata properties are set
3838 metadata .mets .type = action
3939 metadata .mets .document_id = f"{ metadata .work .identifier } _{ action } "
40- metadata .mets .dmd_href = METS_DMD_HREF .format (
41- work_identifier = metadata .work .identifier ,
42- revision = metadata .mets .revision
43- )
44- metadata .mets .dmd_id = METS_DMD_ID .format (
45- work_identifier = metadata .work .identifier ,
46- revision = metadata .mets .revision ,
47- dmd_idx = "001"
48- )
49- metadata .mets .tmd_id = METS_TMD_ID .format (
50- work_identifier = metadata .work .identifier ,
51- revision = metadata .mets .revision ,
52- tmd_idx = "001"
53- )
54- metadata .mets .tmd_href = METS_TMD_HREF .format (
55- work_identifier = metadata .work .identifier ,
56- revision = metadata .mets .revision
57- )
58- metadata .mets .file_id = METS_FILE_ID .format (
59- work_identifier = metadata .work .identifier ,
60- revision = metadata .mets .revision ,
61- file_idx = "001"
62- )
63- metadata .mets .notice_file_href = METS_NOTICE_FILE_HREF .format (
64- work_identifier = metadata .work .identifier ,
65- revision = metadata .mets .revision
66- )
6740 return metadata
6841
6942 @classmethod
@@ -85,7 +58,9 @@ def from_notice_metadata(cls, notice_metadata: ExtractedMetadata) -> PackagerMet
8558
8659 # NOTICE
8760 metadata .notice .id = cls .normalize_value (notice_metadata .notice_publication_number )
88- metadata .notice .number = publication_notice_number (metadata .notice .id )
61+ metadata .notice .public_number_document = publication_notice_number (metadata .notice .id )
62+ metadata .notice .public_number_edition = publication_notice_year (
63+ notice_metadata ) + notice_metadata .ojs_issue_number .zfill (3 )
8964
9065 # WORK
9166 publication_date = datetime .datetime .strptime (notice_metadata .publication_date , '%Y%m%d' ).strftime ('%Y-%m-%d' )
@@ -108,6 +83,36 @@ def from_notice_metadata(cls, notice_metadata: ExtractedMetadata) -> PackagerMet
10883 # MANIFESTATION
10984 metadata .manifestation .identifier = f"{ metadata .expression .identifier } .rdf"
11085 metadata .manifestation .date_publication = publication_date
86+
87+ # METS
88+ metadata .mets .dmd_href = METS_DMD_HREF .format (
89+ work_identifier = metadata .work .identifier ,
90+ revision = metadata .mets .revision
91+ )
92+ metadata .mets .dmd_id = METS_DMD_ID .format (
93+ work_identifier = metadata .work .identifier ,
94+ revision = metadata .mets .revision ,
95+ dmd_idx = "001"
96+ )
97+ metadata .mets .tmd_id = METS_TMD_ID .format (
98+ work_identifier = metadata .work .identifier ,
99+ revision = metadata .mets .revision ,
100+ tmd_idx = "001"
101+ )
102+ metadata .mets .tmd_href = METS_TMD_HREF .format (
103+ work_identifier = metadata .work .identifier ,
104+ revision = metadata .mets .revision
105+ )
106+ metadata .mets .file_id = METS_FILE_ID .format (
107+ work_identifier = metadata .work .identifier ,
108+ revision = metadata .mets .revision ,
109+ file_idx = "001"
110+ )
111+ metadata .mets .notice_file_href = METS_NOTICE_FILE_HREF .format (
112+ work_identifier = metadata .work .identifier ,
113+ revision = metadata .mets .revision
114+ )
115+
111116 return metadata
112117
113118
@@ -126,4 +131,4 @@ def publication_notice_uri(notice_id, notice_metadata):
126131def publication_work_identifier (notice_id , notice_metadata ):
127132 year = publication_notice_year (notice_metadata )
128133 number = publication_notice_number (notice_id )
129- return f"{ year } _{ notice_metadata .ojs_type } _{ notice_metadata .ojs_issue_number } _{ number } "
134+ return f"{ year } _{ notice_metadata .ojs_type } _{ notice_metadata .ojs_issue_number . zfill ( 3 ) } _{ number } "
0 commit comments