Versions Compared

Key

  • This line was added.
  • This line was removed.
  • Formatting was changed.

Table of Contents
typeflat

Source code:

Please download the latest source code from Github:

https://github.com/gabag30/publicContent

Image AddedImage Added

Description:

Simple Java project that provides some code samples for how to perform the process for the registration of some Priority documents in java.

The project structure is as follow :

Image Added


In the config folder:


there you'll find the sample config.properties file for the project:

Code Block
languageyml
themeRDark
linenumberstrue
collapsetrue
pemFile=./src/main/resources/ibpct1_acc_es256_private.pem
log4jConfigPath=./src/main/resources/log4j.xml
issuer=https://www5.wipo.int/am/oauth2
audience=https://www5.wipo.int/am/oauth2/access_token
clientId=das-ib-pct1-api-id
scope=das-api/office-exchange
url=https://das-api.das.ipobs.acc.web1.wipo.int/das-api/v1/requests
columnFileId=9
columnRegistered=10
columnAckId=11

In the sample project, there will be also the test.csv file (see bellow) and a sample pdf file for testing the uploads .

The test.csv file, contains the information of the list of files that we will use for the test of the registration (please update the information of the as indicated by the columns of the csv file:

Code Block
languageyml
themeRDark
linenumberstrue
collapsetrue
"file_reference","file_location","application_number","application_date","priority_number","priority_date","document_category","application_category","das_code","file_id","registered"
"test_14","config/PCT_IB2022_052028.pdf","PCT/IB2022/052028","2022-03-08","PCT/IB2021/057865","2021-08-27","patent","priority document","AB21","","",""
"test_15","config/PCT_IB2022_052028.pdf","PCT/IB2022/052029","2022-03-08","PCT/IB2021/057866","2021-08-27","patent","priority document","AB21","","",""
"test_16","config/PCT_IB2022_052028.pdf","PCT/IB2022/052030","2022-03-08","PCT/IB2021/057867","2021-08-27","patent","priority document","AB21","","",""
"test_17","config/PCT_IB2022_052028.pdf","PCT/IB2022/052031","2022-03-08","PCT/IB2021/057868","2021-08-27","patent","priority document","AB21","","",""


Note

The empty fields at the end, will be updated with the information coming from DAS, by the end of the process. Please see at the end the final file.

The logs folder:

There you will find the logs (format configured in the log4j.xml file, see bellow).

Code Block
languagebash
themeRDark
collapsetrue
2023-04-13 12:11:03 INFO  ConfigManager:39 - Going to retrieve the access token from the oauth server
2023-04-13 12:11:03 INFO  ConfigManager:137 - ---------------------------------
2023-04-13 12:11:03 INFO  ConfigManager:138 - JWT Assertion eyJhbGciOiJFUzI1NiJ9.eyJpc3MiOiJkYXMtaWItcGN0MS1hcGktaWQiLCJzdWIiOiJkYXMtaWItcGN0MS1hcGktaWQiLCJhdWQiOiJodHRwczpcL1wvd3d3NS53aXBvLmludFwvYW1cL29hdXRoMlwvYWNjZXNzX3Rva2VuIiwiZXhwIjoxNjgxMzg4ODYzfQ.WffwONT75lIEi3vH8yuzsHbhT7Kzr-13m4mbV698GEwPgsF4Meie4dpd_OYLdAlVRnt6wFr20a6qu_VrELuKgA
2023-04-13 12:11:03 INFO  ConfigManager:139 - ---------------------------------
2023-04-13 12:11:04 INFO  ConfigManager:145 - Access token: eyJ0eXAiOiJKV1QiLCJraWQiOiI3bEhXSFovZ1h6ajJ4WFdBcXFQMVRIUDdHZzA9IiwiYWxnIjoiUlMyNTYifQ.eyJzdWIiOiJkYXMtaWItcGN0MS1hcGktaWQiLCJjdHMiOiJPQVVUSDJfU1RBVEVMRVNTX0dSQU5UIiwiYXVkaXRUcmFja2luZ0lkIjoiODhjOTIwMjItZTc0Zi00YmIwLWIxZWItZWVmNDVlMzhmM2VkLTE5MjUyMDAiLCJpc3MiOiJodHRwczovL3d3dzUud2lwby5pbnQvYW0vb2F1dGgyIiwidG9rZW5OYW1lIjoiYWNjZXNzX3Rva2VuIiwidG9rZW5fdHlwZSI6IkJlYXJlciIsImF1dGhHcmFudElkIjoiRzZKX2RRTVpJZ3RTMjR6eGI0d2RpakZlSTMwIiwiYXVkIjoiZGFzLWliLXBjdDEtYXBpLWlkIiwibmJmIjoxNjgxMzg3ODY0LCJncmFudF90eXBlIjoiY2xpZW50X2NyZWRlbnRpYWxzIiwic2NvcGUiOlsiZGFzLWFwaS9vZmZpY2UtZXhjaGFuZ2UiXSwiYXV0aF90aW1lIjoxNjgxMzg3ODY0LCJyZWFsbSI6Ii8iLCJleHAiOjE2ODEzOTE0NjQsImlhdCI6MTY4MTM4Nzg2NCwiZXhwaXJlc19pbiI6MzYwMCwianRpIjoiSUU2dFNfWVZ3NjVMQU5SSENLbVdoWS10S004In0.TOVTvuuYP5cJUZ7qWj_9GReS4qiRjjFAKm5C5rkYhT4I1W_4JriADVNVGes0kcY5bIprtyO1IxhOKdCeT15nw45ga_mdmyLiOrqW64xIbZE0Of-pEya4dpFoFGv0nSFQ9bjUpqqve0L4ZKdyaX28TAlCbFg0Y4kPIiUcMayYgVTYezALk2rdQB5TIz8dTtBQ6oal4xLpCiv10DwA6j08XQCfctmjuV6UTrsf4xOK3AWokxJ3bCOtsowV-PcqSIuT07HqrLyU3pDUIiBmjAMSFeHRC0YuvoldTTtvnHZw8881ESHkuz-U56WvEEZA7zT5jNK88WtetYU7fcK0sFeAsA
2023-04-13 12:11:04 INFO  ConfigManager:146 - ---------------------------------
2023-04-13 12:11:04 INFO  ConfigManager:147 - Expires in: 3599 secondes.
2023-04-13 12:11:04 INFO  ConfigManager:148 - ---------------------------------
2023-04-13 12:11:04 INFO  ConfigManager:46 - Authorization token retrieved successfully.
2023-04-13 12:11:04 INFO  ConfigManager:69 - File 'test_14' already registered.
2023-04-13 12:11:04 INFO  ConfigManager:69 - File 'test_15' already registered.
2023-04-13 12:11:04 INFO  ConfigManager:69 - File 'test_16' already registered.
2023-04-13 12:11:04 INFO  ConfigManager:69 - File 'test_17' already registered.
2023-04-13 12:11:38 INFO  ConfigManager:39 - Going to retrieve the access token from the oauth server
2023-04-13 12:11:39 INFO  ConfigManager:137 - ---------------------------------
2023-04-13 12:11:39 INFO  ConfigManager:138 - JWT Assertion eyJhbGciOiJFUzI1NiJ9.eyJpc3MiOiJkYXMtaWItcGN0MS1hcGktaWQiLCJzdWIiOiJkYXMtaWItcGN0MS1hcGktaWQiLCJhdWQiOiJodHRwczpcL1wvd3d3NS53aXBvLmludFwvYW1cL29hdXRoMlwvYWNjZXNzX3Rva2VuIiwiZXhwIjoxNjgxMzg4ODk5fQ.lhydJpREhGg7d8w0cgQCzui3b6Ii9ppiUmRj3eVrl6FeYeQZ1pZl2ooGD_EGkCWF6DdbVY5s6Fz0-HYlB1aRJQ
2023-04-13 12:11:39 INFO  ConfigManager:139 - ---------------------------------
2023-04-13 12:11:39 INFO  ConfigManager:145 - Access token: eyJ0eXAiOiJKV1QiLCJraWQiOiI3bEhXSFovZ1h6ajJ4WFdBcXFQMVRIUDdHZzA9IiwiYWxnIjoiUlMyNTYifQ.eyJzdWIiOiJkYXMtaWItcGN0MS1hcGktaWQiLCJjdHMiOiJPQVVUSDJfU1RBVEVMRVNTX0dSQU5UIiwiYXVkaXRUcmFja2luZ0lkIjoiODhjOTIwMjItZTc0Zi00YmIwLWIxZWItZWVmNDVlMzhmM2VkLTE5MjUzNTAiLCJpc3MiOiJodHRwczovL3d3dzUud2lwby5pbnQvYW0vb2F1dGgyIiwidG9rZW5OYW1lIjoiYWNjZXNzX3Rva2VuIiwidG9rZW5fdHlwZSI6IkJlYXJlciIsImF1dGhHcmFudElkIjoiYVVNdkZEUDE1dndScEtwS1k0ZXBmSFZmdXpNIiwiYXVkIjoiZGFzLWliLXBjdDEtYXBpLWlkIiwibmJmIjoxNjgxMzg3ODk5LCJncmFudF90eXBlIjoiY2xpZW50X2NyZWRlbnRpYWxzIiwic2NvcGUiOlsiZGFzLWFwaS9vZmZpY2UtZXhjaGFuZ2UiXSwiYXV0aF90aW1lIjoxNjgxMzg3ODk5LCJyZWFsbSI6Ii8iLCJleHAiOjE2ODEzOTE0OTksImlhdCI6MTY4MTM4Nzg5OSwiZXhwaXJlc19pbiI6MzYwMCwianRpIjoiTW5IQTIyQ1dwZnFjU2pVOU9hWGNSa2xLSWFVIn0.tKYs-igYFqVSl5VVW1n2jLcGy5ebxgqY0t-cH84ot1GZqnJTE6kkgaGtjAJ_0DdgrsQAhgEh3Ws7j4klpDtGx9oLoX76xT4GWfEo1SZqbRDZ8b0VLgzMiUp5_pnV64Q1d9g6d3rWGNJ6Q73Kbks9SXv18dev8AIAQ4oI1aJ87NrZnEwarepRoBmwUuNjbf6oWWcBg6wOgUrKQnHFauOGZ4i1FFaTcJy3oiFmTUgMvYbO1kiu4m5m0qrk4jvQ-sKUABn3YkR6ph2-BDM8rt_4lA9eNIEgiaqVoFPkoi7wQCWcWsE34yntPUVreAf3KW90NaZ4VEdvRy6IclGtQtUwKg
2023-04-13 12:11:39 INFO  ConfigManager:146 - ---------------------------------
2023-04-13 12:11:39 INFO  ConfigManager:147 - Expires in: 3599 secondes.
2023-04-13 12:11:39 INFO  ConfigManager:148 - ---------------------------------
2023-04-13 12:11:39 INFO  ConfigManager:46 - Authorization token retrieved successfully.
2023-04-13 12:11:39 INFO  ConfigManager:74 - Processing fileReference: test_14
2023-04-13 12:11:39 INFO  ConfigManager:76 - SHA-256 checksum: cda2970d8686b60c45166776669ddfa95da2ea77f1457ee4227b5a93e1f320ec
2023-04-13 12:11:39 INFO  ConfigManager:36 - Obtaining file ID and upload URL...
2023-04-13 12:12:00 WARN  ConfigManager:89 - Got fileId: 0a12e7fc-3064-4e72-b887-fc9ad989fb04
2023-04-13 12:12:00 WARN  ConfigManager:90 - Got uploadUrl: https://das-upload-eu-central-1-329803703153.s3.eu-central-1.amazonaws.com/das-ib-pct1/0a12e7fc-3064-4e72-b887-fc9ad989fb04.pdf?Content-Type=application%2Fpdf&X-Amz-Algorithm=AWS4-HMAC-SHA256&X-Amz-Credential=ASIAUZSOVENY5X5ARI3U%2F20230413%2Feu-central-1%2Fs3%2Faws4_request&X-Amz-Date=20230413T121200Z&X-Amz-Expires=900&X-Amz-Security-Token=FwoGZXIvYXdzEP7%2F%2F%2F%2F%2F%2F%2F%2F%2F%2FwEaDOlejtCnKYFI25s6MiLAAYZkY4IiHRUWPZ4JujKBoS4TcX1XRlWml3VNB3Xe2yQ%2BOvcglDXcuAkyqnKEoE4W0dweYeh%2FmOpyxNlOQfV2SlT0MTbdQHtdcOU11xYIg4aVxX3D4IaGf6y8jZc3nFQYHmh4G4nmPhFlFvFoKMx85zhhp3hMj3MJZPCqYAB7x1P%2FUwHcJLFeYjVJHsblQG52RkWr1UuL7JRHDjdFyjT3KKBiL2Y%2FlrshsFO51zj842yYN3C%2FHUisRGymjfTl6mSrEyiP49%2BhBjItGQKwKbeCC8eP7e4Ac8j4Oqn%2FUwrK3dngDo6SDsSevP7SKBgbva97vuzjwDY4&X-Amz-Signature=0764d2ee6ccca40f864e955b89ae42b059cb06863c00e245edeb03431366a850&X-Amz-SignedHeaders=host
2023-04-13 12:12:00 INFO  ConfigManager:93 - going to upload the file 
2023-04-13 12:12:00 INFO  ConfigManager:32 - uploading file...
2023-04-13 12:12:01 WARN  ConfigManager:168 - File uploaded successfully!
2023-04-13 12:12:01 INFO  ConfigManager:95 - File uploaded successfully!, continue for registration
2023-04-13 12:12:01 INFO  ConfigManager:26 - Checking file status...
2023-04-13 12:12:20 INFO  ConfigManager:46 - {"fileReference":"test_14","fileFormatCategory":"pdf","fileChecksum":"cda2970d8686b60c45166776669ddfa95da2ea77f1457ee4227b5a93e1f320ec","fileDateTime":"2023-04-13T12:12:00.208Z","fileStatusCategory":null,"error":null}
2023-04-13 12:12:20 WARN  ConfigManager:55 - File is still being processed.
2023-04-13 12:12:25 INFO  ConfigManager:46 - {"fileReference":"test_14","fileFormatCategory":"pdf","fileChecksum":"cda2970d8686b60c45166776669ddfa95da2ea77f1457ee4227b5a93e1f320ec","fileDateTime":"2023-04-13T12:12:00.208Z","fileStatusCategory":null,"error":null}
2023-04-13 12:12:25 WARN  ConfigManager:55 - File is still being processed.
2023-04-13 12:12:30 INFO  ConfigManager:46 - {"fileReference":"test_14","fileFormatCategory":"pdf","fileChecksum":"cda2970d8686b60c45166776669ddfa95da2ea77f1457ee4227b5a93e1f320ec","fileDateTime":"2023-04-13T12:12:00.208Z","fileStatusCategory":null,"error":null}
2023-04-13 12:12:30 WARN  ConfigManager:55 - File is still being processed.
2023-04-13 12:12:36 INFO  ConfigManager:46 - {"fileReference":"test_14","fileFormatCategory":"pdf","fileChecksum":"cda2970d8686b60c45166776669ddfa95da2ea77f1457ee4227b5a93e1f320ec","fileDateTime":"2023-04-13T12:12:00.208Z","fileSizeQuantity":3594416,"fileStatusCategory":null,"error":null}
2023-04-13 12:12:36 WARN  ConfigManager:57 - File was accepted! with SizeQuantity=3594416
2023-04-13 12:12:41 INFO  ConfigManager:102 - File upload status: ACCEPTED
2023-04-13 12:12:46 INFO  ConfigManager:107 - File was accepted!
2023-04-13 12:12:46 INFO  ConfigManager:43 - Registering file...
2023-04-13 12:13:06 INFO  ConfigManager:64 - {"operationCategory":"registration","documentKindCategory":"patent","documentNumber":"PCT/IB2021/057865","documentDate":"2021-08-27","dasAccessCode":"AB21","applicationCategory":"priority document","applicationNumber":"PCT/IB2022/052028","applicationFilingDate":"2022-03-08","email":null,"fileId":"0a12e7fc-3064-4e72-b887-fc9ad989fb04","documentCodeCategory":"priority document","requestAckId":"IBIB20230413000043","operationDateTime":"2023-04-13T12:13:06.133Z","requestStatusCategory":"registration - recorded"}
2023-04-13 12:13:06 WARN  ConfigManager:116 - File registered with AckId: IBIB20230413000043
2023-04-13 12:13:06 INFO  ConfigManager:208 - CSV file updated successfully
2023-04-13 12:13:06 INFO  ConfigManager:74 - Processing fileReference: test_15
2023-04-13 12:13:06 INFO  ConfigManager:76 - SHA-256 checksum: cda2970d8686b60c45166776669ddfa95da2ea77f1457ee4227b5a93e1f320ec
2023-04-13 12:13:06 INFO  ConfigManager:36 - Obtaining file ID and upload URL...
2023-04-13 12:13:07 WARN  ConfigManager:89 - Got fileId: a44afa77-11ab-477a-bbe3-d06bac18a7f3
2023-04-13 12:13:07 WARN  ConfigManager:90 - Got uploadUrl: https://das-upload-eu-central-1-329803703153.s3.eu-central-1.amazonaws.com/das-ib-pct1/a44afa77-11ab-477a-bbe3-d06bac18a7f3.pdf?Content-Type=application%2Fpdf&X-Amz-Algorithm=AWS4-HMAC-SHA256&X-Amz-Credential=ASIAUZSOVENYZJ5UMB75%2F20230413%2Feu-central-1%2Fs3%2Faws4_request&X-Amz-Date=20230413T121307Z&X-Amz-Expires=900&X-Amz-Security-Token=FwoGZXIvYXdzEP7%2F%2F%2F%2F%2F%2F%2F%2F%2F%2FwEaDNMiQvKfU7M5tDUaJiLAAcGwd9MQMD9fZN%2B%2BF2Fcgqivc3M2gK3r0qiCnXf2J50HZoEyhcvCNl376oPTLIb6wcP4QcRhU6HRxbXROJzoxW%2F21R51ctq6WUr%2Fw8YYNcoFuJU2ihDwl4G6Nj3dNxQLFx9D9RnTRzJ7XZOJU%2B%2Bly5tKWcYHb5K%2BJvlsNMR6WaMHHudxwi2dntXIq5Am4XpHHsfropg%2FJhvc2mgEgtiV2JUyb3XAkpofzrfiB0tXJ1ma4odGy2fMTdxkwPJADGoPryjT49%2BhBjIt%2BC6yUDBbOy5pnnNY%2BOIxJoat6GbhHm60QAg0XNjXJaDUHZ%2Fm7SlQaRClafnQ&X-Amz-Signature=8d6717971fd8c68ad502c35fb70a7fe6195e0706d6c3272b59e29830ac7ce82d&X-Amz-SignedHeaders=host
2023-04-13 12:13:07 INFO  ConfigManager:93 - going to upload the file 
2023-04-13 12:13:07 INFO  ConfigManager:32 - uploading file...
2023-04-13 12:13:08 WARN  ConfigManager:168 - File uploaded successfully!
2023-04-13 12:13:08 INFO  ConfigManager:95 - File uploaded successfully!, continue for registration
2023-04-13 12:13:08 INFO  ConfigManager:26 - Checking file status...
2023-04-13 12:13:08 INFO  ConfigManager:46 - {"fileReference":"test_15","fileFormatCategory":"pdf","fileChecksum":"cda2970d8686b60c45166776669ddfa95da2ea77f1457ee4227b5a93e1f320ec","fileDateTime":"2023-04-13T12:13:07.470Z","fileStatusCategory":null,"error":null}
2023-04-13 12:13:08 WARN  ConfigManager:55 - File is still being processed.
2023-04-13 12:13:13 INFO  ConfigManager:46 - {"fileReference":"test_15","fileFormatCategory":"pdf","fileChecksum":"cda2970d8686b60c45166776669ddfa95da2ea77f1457ee4227b5a93e1f320ec","fileDateTime":"2023-04-13T12:13:07.470Z","fileStatusCategory":null,"error":null}
2023-04-13 12:13:13 WARN  ConfigManager:55 - File is still being processed.
2023-04-13 12:13:19 INFO  ConfigManager:46 - {"fileReference":"test_15","fileFormatCategory":"pdf","fileChecksum":"cda2970d8686b60c45166776669ddfa95da2ea77f1457ee4227b5a93e1f320ec","fileDateTime":"2023-04-13T12:13:07.470Z","fileStatusCategory":null,"error":null}
2023-04-13 12:13:19 WARN  ConfigManager:55 - File is still being processed.
2023-04-13 12:13:24 INFO  ConfigManager:46 - {"fileReference":"test_15","fileFormatCategory":"pdf","fileChecksum":"cda2970d8686b60c45166776669ddfa95da2ea77f1457ee4227b5a93e1f320ec","fileDateTime":"2023-04-13T12:13:07.470Z","fileStatusCategory":null,"error":null}
2023-04-13 12:13:24 WARN  ConfigManager:55 - File is still being processed.
2023-04-13 12:13:29 INFO  ConfigManager:46 - {"fileReference":"test_15","fileFormatCategory":"pdf","fileChecksum":"cda2970d8686b60c45166776669ddfa95da2ea77f1457ee4227b5a93e1f320ec","fileDateTime":"2023-04-13T12:13:07.470Z","fileStatusCategory":null,"error":null}
2023-04-13 12:13:29 WARN  ConfigManager:55 - File is still being processed.
2023-04-13 12:13:34 INFO  ConfigManager:46 - {"fileReference":"test_15","fileFormatCategory":"pdf","fileChecksum":"cda2970d8686b60c45166776669ddfa95da2ea77f1457ee4227b5a93e1f320ec","fileDateTime":"2023-04-13T12:13:07.470Z","fileStatusCategory":null,"error":null}
2023-04-13 12:13:34 WARN  ConfigManager:55 - File is still being processed.
2023-04-13 12:13:40 INFO  ConfigManager:46 - {"fileReference":"test_15","fileFormatCategory":"pdf","fileChecksum":"cda2970d8686b60c45166776669ddfa95da2ea77f1457ee4227b5a93e1f320ec","fileDateTime":"2023-04-13T12:13:07.470Z","fileSizeQuantity":3594416,"fileStatusCategory":null,"error":null}
2023-04-13 12:13:40 WARN  ConfigManager:57 - File was accepted! with SizeQuantity=3594416
2023-04-13 12:13:45 INFO  ConfigManager:102 - File upload status: ACCEPTED
2023-04-13 12:13:50 INFO  ConfigManager:107 - File was accepted!
2023-04-13 12:13:50 INFO  ConfigManager:43 - Registering file...
2023-04-13 12:13:51 INFO  ConfigManager:64 - {"operationCategory":"registration","documentKindCategory":"patent","documentNumber":"PCT/IB2021/057866","documentDate":"2021-08-27","dasAccessCode":"AB21","applicationCategory":"priority document","applicationNumber":"PCT/IB2022/052029","applicationFilingDate":"2022-03-08","email":null,"fileId":"a44afa77-11ab-477a-bbe3-d06bac18a7f3","documentCodeCategory":"priority document","requestAckId":"IBIB20230413000044","operationDateTime":"2023-04-13T12:13:51.081Z","requestStatusCategory":"registration - recorded"}
2023-04-13 12:13:51 WARN  ConfigManager:116 - File registered with AckId: IBIB20230413000044
2023-04-13 12:13:51 INFO  ConfigManager:208 - CSV file updated successfully
2023-04-13 12:13:51 INFO  ConfigManager:74 - Processing fileReference: test_16
2023-04-13 12:13:51 INFO  ConfigManager:76 - SHA-256 checksum: cda2970d8686b60c45166776669ddfa95da2ea77f1457ee4227b5a93e1f320ec
2023-04-13 12:13:51 INFO  ConfigManager:36 - Obtaining file ID and upload URL...
2023-04-13 12:13:53 WARN  ConfigManager:89 - Got fileId: cc1feca6-bd7d-467c-8374-97a08066cb19
2023-04-13 12:13:53 WARN  ConfigManager:90 - Got uploadUrl: https://das-upload-eu-central-1-329803703153.s3.eu-central-1.amazonaws.com/das-ib-pct1/cc1feca6-bd7d-467c-8374-97a08066cb19.pdf?Content-Type=application%2Fpdf&X-Amz-Algorithm=AWS4-HMAC-SHA256&X-Amz-Credential=ASIAUZSOVENY43F5RU7Q%2F20230413%2Feu-central-1%2Fs3%2Faws4_request&X-Amz-Date=20230413T121353Z&X-Amz-Expires=900&X-Amz-Security-Token=FwoGZXIvYXdzEP7%2F%2F%2F%2F%2F%2F%2F%2F%2F%2FwEaDI8ycJmkby56iFywayLAAZKzyvoC2rBy6lunIrXQfjHbqJJV6ZvUBBW86F3Gsi22YAKWzh75xjy4LBOC2XEObMtmbQfdJ9UUGlrEysyMZUpidcgzEafLxEEysVeXbZknNB8kXW3IkT2pmyY54ZJt2a3f3VdnPTF7V6Mt6SWPvBlju3LV2YkTUR7VPhJdKwk0ZLIFBNJbR%2FftSCoYg%2F93wfvFqYI5ybOEwtadJWDgCLoGrUBTAm4l%2FxrnMAs9KAz01SZx4%2B3kSX%2FdkQ%2FBGhFZhCiA5N%2BhBjItjAoHEu2Gnp1n2HK3oxxqeNdi5v4Vgx0xtVatRl9RzxFE6aMdEj7Rwm6uoDAB&X-Amz-Signature=727c5551339f0ca65d8c8dcda9a7b4abae1af4ab2b12b602bda8ae45d15d4a49&X-Amz-SignedHeaders=host
2023-04-13 12:13:53 INFO  ConfigManager:93 - going to upload the file 
2023-04-13 12:13:53 INFO  ConfigManager:32 - uploading file...
2023-04-13 12:13:53 WARN  ConfigManager:168 - File uploaded successfully!
2023-04-13 12:13:53 INFO  ConfigManager:95 - File uploaded successfully!, continue for registration
2023-04-13 12:13:53 INFO  ConfigManager:26 - Checking file status...
2023-04-13 12:13:54 INFO  ConfigManager:46 - {"fileReference":"test_16","fileFormatCategory":"pdf","fileChecksum":"cda2970d8686b60c45166776669ddfa95da2ea77f1457ee4227b5a93e1f320ec","fileDateTime":"2023-04-13T12:13:53.029Z","fileStatusCategory":null,"error":null}
2023-04-13 12:13:54 WARN  ConfigManager:55 - File is still being processed.
2023-04-13 12:13:59 INFO  ConfigManager:46 - {"fileReference":"test_16","fileFormatCategory":"pdf","fileChecksum":"cda2970d8686b60c45166776669ddfa95da2ea77f1457ee4227b5a93e1f320ec","fileDateTime":"2023-04-13T12:13:53.029Z","fileStatusCategory":null,"error":null}
2023-04-13 12:13:59 WARN  ConfigManager:55 - File is still being processed.
2023-04-13 12:14:05 INFO  ConfigManager:46 - {"fileReference":"test_16","fileFormatCategory":"pdf","fileChecksum":"cda2970d8686b60c45166776669ddfa95da2ea77f1457ee4227b5a93e1f320ec","fileDateTime":"2023-04-13T12:13:53.029Z","fileStatusCategory":null,"error":null}
2023-04-13 12:14:05 WARN  ConfigManager:55 - File is still being processed.
2023-04-13 12:14:10 INFO  ConfigManager:46 - {"fileReference":"test_16","fileFormatCategory":"pdf","fileChecksum":"cda2970d8686b60c45166776669ddfa95da2ea77f1457ee4227b5a93e1f320ec","fileDateTime":"2023-04-13T12:13:53.029Z","fileStatusCategory":null,"error":null}
2023-04-13 12:14:10 WARN  ConfigManager:55 - File is still being processed.
2023-04-13 12:14:15 INFO  ConfigManager:46 - {"fileReference":"test_16","fileFormatCategory":"pdf","fileChecksum":"cda2970d8686b60c45166776669ddfa95da2ea77f1457ee4227b5a93e1f320ec","fileDateTime":"2023-04-13T12:13:53.029Z","fileStatusCategory":null,"error":null}
2023-04-13 12:14:15 WARN  ConfigManager:55 - File is still being processed.
2023-04-13 12:14:21 INFO  ConfigManager:46 - {"fileReference":"test_16","fileFormatCategory":"pdf","fileChecksum":"cda2970d8686b60c45166776669ddfa95da2ea77f1457ee4227b5a93e1f320ec","fileDateTime":"2023-04-13T12:13:53.029Z","fileSizeQuantity":3594416,"fileStatusCategory":null,"error":null}
2023-04-13 12:14:21 WARN  ConfigManager:57 - File was accepted! with SizeQuantity=3594416
2023-04-13 12:14:26 INFO  ConfigManager:102 - File upload status: ACCEPTED
2023-04-13 12:14:31 INFO  ConfigManager:107 - File was accepted!
2023-04-13 12:14:31 INFO  ConfigManager:43 - Registering file...
2023-04-13 12:14:33 INFO  ConfigManager:64 - {"operationCategory":"registration","documentKindCategory":"patent","documentNumber":"PCT/IB2021/057867","documentDate":"2021-08-27","dasAccessCode":"AB21","applicationCategory":"priority document","applicationNumber":"PCT/IB2022/052030","applicationFilingDate":"2022-03-08","email":null,"fileId":"cc1feca6-bd7d-467c-8374-97a08066cb19","documentCodeCategory":"priority document","requestAckId":"IBIB20230413000045","operationDateTime":"2023-04-13T12:14:32.841Z","requestStatusCategory":"registration - recorded"}
2023-04-13 12:14:33 WARN  ConfigManager:116 - File registered with AckId: IBIB20230413000045
2023-04-13 12:14:33 INFO  ConfigManager:208 - CSV file updated successfully
2023-04-13 12:14:33 INFO  ConfigManager:74 - Processing fileReference: test_17
2023-04-13 12:14:33 INFO  ConfigManager:76 - SHA-256 checksum: cda2970d8686b60c45166776669ddfa95da2ea77f1457ee4227b5a93e1f320ec
2023-04-13 12:14:33 INFO  ConfigManager:36 - Obtaining file ID and upload URL...
2023-04-13 12:14:34 WARN  ConfigManager:89 - Got fileId: 9da2b7d1-2306-4769-a94f-6a78317cd32e
2023-04-13 12:14:34 WARN  ConfigManager:90 - Got uploadUrl: https://das-upload-eu-central-1-329803703153.s3.eu-central-1.amazonaws.com/das-ib-pct1/9da2b7d1-2306-4769-a94f-6a78317cd32e.pdf?Content-Type=application%2Fpdf&X-Amz-Algorithm=AWS4-HMAC-SHA256&X-Amz-Credential=ASIAUZSOVENY47UNK4H4%2F20230413%2Feu-central-1%2Fs3%2Faws4_request&X-Amz-Date=20230413T121434Z&X-Amz-Expires=900&X-Amz-Security-Token=FwoGZXIvYXdzEP7%2F%2F%2F%2F%2F%2F%2F%2F%2F%2FwEaDBAKnbYyDp6Og9VWcyLAAfXBm6Kfql4bO8ro7a2zHxMPiehtwn%2FBnXgr%2FvPUhB5u1poe614hENMmlSb2S5sHlRSgeUHtcAixLpU7cnm9PvhtMvHaRuKjMeNMa8gsuLOoMzD10OM08JixCTSD06W0rAdak8WGsbpnZ4uhsA4dJvQkz%2BFcA1uthsLqx%2FNt02RvBkSIyYM45GF1UnWWDH93OTLpzRtV1zTbVWx4vScFgq06EysT46BS8PJoZZTZL6kBpr7b0Jwvg3AnAqVbSWpwpyiq5N%2BhBjIt8qemGK5pVnl3VY3HkeATA1mrZ6fwajbzoPkmJlAFkm5eHz20VGhtVNvJzCXd&X-Amz-Signature=dd3f0ec104dc971688ae8accbf49aac97604982d98c64aac9cb350682edae255&X-Amz-SignedHeaders=host
2023-04-13 12:14:34 INFO  ConfigManager:93 - going to upload the file 
2023-04-13 12:14:34 INFO  ConfigManager:32 - uploading file...
2023-04-13 12:14:34 WARN  ConfigManager:168 - File uploaded successfully!
2023-04-13 12:14:34 INFO  ConfigManager:95 - File uploaded successfully!, continue for registration
2023-04-13 12:14:34 INFO  ConfigManager:26 - Checking file status...
2023-04-13 12:14:35 INFO  ConfigManager:46 - {"fileReference":"test_17","fileFormatCategory":"pdf","fileChecksum":"cda2970d8686b60c45166776669ddfa95da2ea77f1457ee4227b5a93e1f320ec","fileDateTime":"2023-04-13T12:14:34.131Z","fileStatusCategory":null,"error":null}
2023-04-13 12:14:35 WARN  ConfigManager:55 - File is still being processed.
2023-04-13 12:14:40 INFO  ConfigManager:46 - {"fileReference":"test_17","fileFormatCategory":"pdf","fileChecksum":"cda2970d8686b60c45166776669ddfa95da2ea77f1457ee4227b5a93e1f320ec","fileDateTime":"2023-04-13T12:14:34.131Z","fileStatusCategory":null,"error":null}
2023-04-13 12:14:40 WARN  ConfigManager:55 - File is still being processed.
2023-04-13 12:14:45 INFO  ConfigManager:46 - {"fileReference":"test_17","fileFormatCategory":"pdf","fileChecksum":"cda2970d8686b60c45166776669ddfa95da2ea77f1457ee4227b5a93e1f320ec","fileDateTime":"2023-04-13T12:14:34.131Z","fileStatusCategory":null,"error":null}
2023-04-13 12:14:45 WARN  ConfigManager:55 - File is still being processed.
2023-04-13 12:14:51 INFO  ConfigManager:46 - {"fileReference":"test_17","fileFormatCategory":"pdf","fileChecksum":"cda2970d8686b60c45166776669ddfa95da2ea77f1457ee4227b5a93e1f320ec","fileDateTime":"2023-04-13T12:14:34.131Z","fileStatusCategory":null,"error":null}
2023-04-13 12:14:51 WARN  ConfigManager:55 - File is still being processed.
2023-04-13 12:14:56 INFO  ConfigManager:46 - {"fileReference":"test_17","fileFormatCategory":"pdf","fileChecksum":"cda2970d8686b60c45166776669ddfa95da2ea77f1457ee4227b5a93e1f320ec","fileDateTime":"2023-04-13T12:14:34.131Z","fileStatusCategory":null,"error":null}
2023-04-13 12:14:56 WARN  ConfigManager:55 - File is still being processed.
2023-04-13 12:15:01 INFO  ConfigManager:46 - {"fileReference":"test_17","fileFormatCategory":"pdf","fileChecksum":"cda2970d8686b60c45166776669ddfa95da2ea77f1457ee4227b5a93e1f320ec","fileDateTime":"2023-04-13T12:14:34.131Z","fileSizeQuantity":3594416,"fileStatusCategory":null,"error":null}
2023-04-13 12:15:01 WARN  ConfigManager:57 - File was accepted! with SizeQuantity=3594416
2023-04-13 12:15:06 INFO  ConfigManager:102 - File upload status: ACCEPTED
2023-04-13 12:15:11 INFO  ConfigManager:107 - File was accepted!
2023-04-13 12:15:11 INFO  ConfigManager:43 - Registering file...
2023-04-13 12:15:12 INFO  ConfigManager:64 - {"operationCategory":"registration","documentKindCategory":"patent","documentNumber":"PCT/IB2021/057868","documentDate":"2021-08-27","dasAccessCode":"AB21","applicationCategory":"priority document","applicationNumber":"PCT/IB2022/052031","applicationFilingDate":"2022-03-08","email":null,"fileId":"9da2b7d1-2306-4769-a94f-6a78317cd32e","documentCodeCategory":"priority document","requestAckId":"IBIB20230413000046","operationDateTime":"2023-04-13T12:15:12.444Z","requestStatusCategory":"registration - recorded"}
2023-04-13 12:15:12 WARN  ConfigManager:116 - File registered with AckId: IBIB20230413000046
2023-04-13 12:15:12 INFO  ConfigManager:208 - CSV file updated successfully

The src folder:

Here you will have all the code samples for each of the requests required for going through the process of registration of a priority document.

The individual files are as follow:

Children Display

The resources folder:

Here you will find the private key file (if you have set up this in the config.properties files above.

Info

The key needs to have been registered with WIPO before it can be used. Please refer to these pages : a.- Private key generation and use

The target folder:

after compiling the code, you will find here all the artifacts, libraries and other files needed by the java app.

The root folder:

Here you will find the pom.xml file (with the information for building the project with Maven).

Code Block
languageyml
themeRDark
titlepom.xml
linenumberstrue
collapsetrue
<project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
         xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/maven-v4_0_0.xsd">

    <modelVersion>4.0.0</modelVersion>
    <groupId>org.wipo.das.restapitest</groupId>
    <artifactId>restapitest</artifactId>
    <version>1.0-SNAPSHOT</version>
    <packaging>jar</packaging>

    <properties>
        <maven.compiler.source>11</maven.compiler.source>
        <maven.compiler.target>11</maven.compiler.target>
    </properties>

      <dependencies>
        <!-- Existing dependencies -->
        <dependency>
            <groupId>io.jsonwebtoken</groupId>
            <artifactId>jjwt-api</artifactId>
            <version>0.11.2</version>
        </dependency>
        <dependency>
            <groupId>io.jsonwebtoken</groupId>
            <artifactId>jjwt-impl</artifactId>
            <version>0.11.2</version>
            <scope>runtime</scope>
        </dependency>
        <dependency>
            <groupId>io.jsonwebtoken</groupId>
            <artifactId>jjwt-jackson</artifactId>
            <version>0.11.2</version>
            <scope>runtime</scope>
        </dependency>
        <dependency>
            <groupId>org.bouncycastle</groupId>
            <artifactId>bcprov-jdk15on</artifactId>
            <version>1.70</version>
        </dependency>
        <dependency>
            <groupId>org.bouncycastle</groupId>
            <artifactId>bcpkix-jdk15on</artifactId>
            <version>1.70</version>
        </dependency>
        <dependency>
            <groupId>org.bouncycastle</groupId>
            <artifactId>bcprov-ext-jdk15on</artifactId>
            <version>1.70</version>
        </dependency>

        <dependency>
            <groupId>com.google.code.gson</groupId>
            <artifactId>gson</artifactId>
            <version>2.8.9</version>
        </dependency>
        <!-- Nimbus JOSE+JWT library -->
        <dependency>
            <groupId>com.nimbusds</groupId>
            <artifactId>nimbus-jose-jwt</artifactId>
            <version>9.16.1</version>
        </dependency>
        <!-- OkHttp client -->
  <dependency>
    <groupId>com.squareup.okhttp3</groupId>
    <artifactId>okhttp</artifactId>
    <version>4.10.0</version>
  </dependency>
  <!-- Okio -->
  <dependency>
    <groupId>com.squareup.okio</groupId>
    <artifactId>okio</artifactId>
    <version>2.10.0</version>
  </dependency>
  <!-- Jackson JSON parser -->
  <dependency>
    <groupId>com.fasterxml.jackson.core</groupId>
    <artifactId>jackson-core</artifactId>
    <version>2.13.0</version>
  </dependency>
  <dependency>
    <groupId>com.fasterxml.jackson.core</groupId>
    <artifactId>jackson-databind</artifactId>
    <version>2.13.0</version>
  </dependency>
  <dependency>
    <groupId>com.fasterxml.jackson.core</groupId>
    <artifactId>jackson-annotations</artifactId>
    <version>2.13.0</version>
  </dependency>
  <!-- Log4j -->
  <dependency>
    <groupId>org.apache.logging.log4j</groupId>
    <artifactId>log4j-api</artifactId>
    <version>2.17.1</version>
  </dependency>
  <dependency>
    <groupId>org.apache.logging.log4j</groupId>
    <artifactId>log4j-core</artifactId>
    <version>2.17.1</version>
  </dependency>

    <dependency>
        <groupId>com.opencsv</groupId>
        <artifactId>opencsv</artifactId>
        <version>5.7.1</version>
    </dependency>
    <dependency>
        <groupId>commons-cli</groupId>
        <artifactId>commons-cli</artifactId>
        <version>1.5.0</version>
    </dependency>


    
    <!-- JSON Dependency -->
    <dependency>
        <groupId>org.json</groupId>
        <artifactId>json</artifactId>
        <version>20210307</version>
    </dependency>


        <dependency>
            <groupId>org.bitbucket.b_c</groupId>
            <artifactId>jose4j</artifactId>
            <version>0.7.9</version>
        </dependency>
    </dependencies>

    <build>
        <plugins>
            <plugin>
                <groupId>org.apache.maven.plugins</groupId>
                <artifactId>maven-jar-plugin</artifactId>
                <version>3.2.0</version>
                <configuration>
                    <archive>
                        <manifest>
                            <addClasspath>true</addClasspath>
                            <mainClass>org.wipo.das.restapitest.Main</mainClass>
                        </manifest>
                    </archive>
                </configuration>
            </plugin>
                        <plugin>
                <groupId>org.apache.maven.plugins</groupId>
                <artifactId>maven-dependency-plugin</artifactId>
                <version>3.2.0</version>
                <executions>
                    <execution>
                        <id>copy-dependencies</id>
                        <phase>package</phase>
                        <goals>
                            <goal>copy-dependencies</goal>
                        </goals>
                        <configuration>
                            <outputDirectory>${project.build.directory}/lib</outputDirectory>
                            <includeScope>runtime</includeScope>
                        </configuration>
                    </execution>
                </executions>
            </plugin>
            <plugin>
                <groupId>org.apache.maven.plugins</groupId>
                <artifactId>maven-compiler-plugin</artifactId>
                <version>3.8.1</version>
                <configuration>
                    <source>${maven.compiler.source}</source>
                    <target>${maven.compiler.target}</target>
                </configuration>
            </plugin>

        </plugins>
    </build>

</project>

Also, you will find an sh script to build the project: 

Code Block
languagebash
mvn -Dmaven.wagon.http.ssl.insecure=true clean package


Info

The "-Dmaven.wagon.http.ssl.insecure=true" flag is there due to some constraints that might happen if you are under a corporate network and the certificates are not properly installed in the PC or development environment

And finally the sh script used to execute the program:

Code Block
languagebash
java -cp ./target/restapitest-1.0-SNAPSHOT.jar:./target/lib/* org.wipo.das.restapitest.Main config/config.properties config/test.csv

...

Once launched, the process will read the contents of the csv file, looking for the new priority records that have not been registered yet.

It will go line by line, and execute all the requests needed for the registration. At the end of the process it will update the csv file with the information that has been provided by DAS and will set the record as registered:

If everything went well the csv file will look like this at the end:

Code Block
languageyml
"file_reference","file_location","application_number","application_date","priority_number","priority_date","document_category","application_category","das_code","file_id","registered"
"test_14","config/PCT_IB2022_052028.pdf","PCT/IB2022/052028","2022-03-08","PCT/IB2021/057865","2021-08-27","patent","priority document","AB21","0a12e7fc-3064-4e72-b887-fc9ad989fb04","true","IBIB20230413000043"
"test_15","config/PCT_IB2022_052028.pdf","PCT/IB2022/052029","2022-03-08","PCT/IB2021/057866","2021-08-27","patent","priority document","AB21","a44afa77-11ab-477a-bbe3-d06bac18a7f3","true","IBIB20230413000044"
"test_16","config/PCT_IB2022_052028.pdf","PCT/IB2022/052030","2022-03-08","PCT/IB2021/057867","2021-08-27","patent","priority document","AB21","cc1feca6-bd7d-467c-8374-97a08066cb19","true","IBIB20230413000045"
"test_17","config/PCT_IB2022_052028.pdf","PCT/IB2022/052031","2022-03-08","PCT/IB2021/057868","2021-08-27","patent","priority document","AB21","9da2b7d1-2306-4769-a94f-6a78317cd32e","true","IBIB20230413000046"

At the end of each execution, it will add the fileId ("0a12e7fc-3064-4e72-b887-fc9ad989fb04"),it will set "true" for the "registered" column and will save the ackId that has been given by the system ("IBIB20230413000043").

Warning

Be aware that this is a very basic Java project, just to demo the classes that are needed to execute the registration process in DAS. 

It is a work in progress and currently might not contain all the required mechanisms to cope with the eventualities of the process.

So, be ready that you might run into some exceptions if the information in the csv file is not properly set or the required assets are not present in the locations that are mentioned there or in the config.properties file. 

Attachments
patterns*.zip

...