Skip to content

Commit ffd5992

Browse files
zubeydecivelekzzacharo
authored andcommitted
docs: updated README and LICENSE
1 parent 3f95458 commit ffd5992

File tree

3 files changed

+64
-50
lines changed

3 files changed

+64
-50
lines changed

Bruno Collection - CDS Videos Publish Video.json

Lines changed: 25 additions & 25 deletions
Original file line numberDiff line numberDiff line change
@@ -4,22 +4,22 @@
44
"items": [
55
{
66
"type": "http",
7-
"name": "Optional Change access of the video",
8-
"seq": 8,
7+
"name": "Step 6: Get Project to Check the Flow Status",
8+
"seq": 7,
99
"request": {
10-
"url": "{{baseURL}}/api/deposits/video/{{video_id}}",
11-
"method": "PUT",
10+
"url": "{{baseURL}}/api/deposits/project/{{project_id}}",
11+
"method": "GET",
1212
"headers": [
1313
{
1414
"name": "content-type",
15-
"value": "application/vnd.video.partial+json",
15+
"value": "application/vnd.project.partial+json",
1616
"enabled": true
1717
}
1818
],
1919
"params": [],
2020
"body": {
2121
"mode": "json",
22-
"json": "{\n \"_access\": {\n \"update\": [\n \"[email protected]\",\n \"[email protected]\" //Update the access according to category\n ],\n // If you want to restrict the video, update access read\n \"read\": [\n \"[email protected]\"\n ]\n\n }\n}\n\n",
22+
"json": "",
2323
"formUrlEncoded": [],
2424
"multipartForm": []
2525
},
@@ -34,22 +34,22 @@
3434
},
3535
{
3636
"type": "http",
37-
"name": "Get project to check the flow is finished",
38-
"seq": 5,
37+
"name": "Optional: Update the Access of the Video",
38+
"seq": 6,
3939
"request": {
40-
"url": "{{baseURL}}/api/deposits/project/{{project_id}}",
41-
"method": "GET",
40+
"url": "{{baseURL}}/api/deposits/video/{{video_id}}",
41+
"method": "PUT",
4242
"headers": [
4343
{
4444
"name": "content-type",
45-
"value": "application/vnd.project.partial+json",
45+
"value": "application/vnd.video.partial+json",
4646
"enabled": true
4747
}
4848
],
4949
"params": [],
5050
"body": {
5151
"mode": "json",
52-
"json": "",
52+
"json": "{\n \"_access\": {\n \"update\": [\n \"[email protected]\",\n \"[email protected]\" \n ],\n // If you want to restrict the video, update access read\n \"read\": [\n \"[email protected]\"\n ]\n\n }\n}\n\n",
5353
"formUrlEncoded": [],
5454
"multipartForm": []
5555
},
@@ -64,7 +64,7 @@
6464
},
6565
{
6666
"type": "http",
67-
"name": "Step 1- Create a project",
67+
"name": "Step 1: Create a project",
6868
"seq": 1,
6969
"request": {
7070
"url": "{{baseURL}}/api/deposits/project/",
@@ -96,7 +96,7 @@
9696
},
9797
{
9898
"type": "http",
99-
"name": "Step 2- Create a video",
99+
"name": "Step 2: Create a video",
100100
"seq": 2,
101101
"request": {
102102
"url": "{{baseURL}}/api/deposits/video/",
@@ -111,7 +111,7 @@
111111
"params": [],
112112
"body": {
113113
"mode": "json",
114-
"json": "{\n \"$schema\":\"https://localhost:5000/schemas/deposits/records/videos/video/video-v1.0.0.json\",\n \"_project_id\":\"{{project_id}}\",\n \"title\":\n {\n \"title\":\"217490_medium\"\n },\n\n \"vr\": false,\n \"featured\": false,\n \"language\": \"en\",\n \"contributors\": [\n {\n \"name\": \"Surname, Name\",\n \"ids\": [\n {\n \"value\": \"868056\",\n \"source\": \"cern\"\n }\n ],\n \"email\": \"[email protected]\",\n \"role\": \"Co-Producer\"\n }\n ],\n \"description\": \"Description\",\n \"date\": \"2024-11-12\"\n}",
114+
"json": "{\n \"$schema\":\"https://localhost:5000/schemas/deposits/records/videos/video/video-v1.0.0.json\",\n \"_project_id\":\"{{project_id}}\",\n \"title\":\n {\n \"title\":\"your_title\"\n },\n \"_access\": {\n \"read\": [\n \"[email protected]\"\n ]\n },\n \"vr\": false,\n \"featured\": false,\n \"language\": \"en\",\n \"contributors\": [\n {\n \"name\": \"Surname, Name\",\n \"ids\": [\n {\n \"value\": \"cern id\",\n \"source\": \"cern\"\n }\n ],\n \"email\": \"[email protected]\",\n \"role\": \"Co-Producer\"\n }\n ],\n \"description\": \"Description\",\n \"date\": \"2024-11-12\",\n \"keywords\":[\n {\n \"name\": \"keyword\",\n \"value\": {\n \"name\": \"keyword\"\n }\n },\n {\n \"name\": \"keyword2\",\n \"value\": {\n \"name\": \"keyword2\"\n }\n }\n ],\n \"related_links\":[\n {\n \"name\": \"related link\",\n \"url\": \"https://relatedlink\"\n }\n ]\n}",
115115
"formUrlEncoded": [],
116116
"multipartForm": []
117117
},
@@ -128,7 +128,7 @@
128128
},
129129
{
130130
"type": "http",
131-
"name": "Step 3- Upload the video",
131+
"name": "Step 3: Upload the video",
132132
"seq": 3,
133133
"request": {
134134
"url": "{{baseURL}}/api/files/{{bucket_id}}/{{video_name}}",
@@ -152,7 +152,7 @@
152152
],
153153
"params": [],
154154
"script": {
155-
"req": "const fs = require('fs');\nconst path = require('path');\n\n// File details\nconst filename = \"CHANGE HERE\";\nconst filePath = \"CHANGE HERE\";\nbru.setEnvVar(\"video_name\",filename);\n\n// Read the file as raw binary data\nconst fileContent = fs.readFileSync(filePath);\n\n// Set request headers\nreq.setHeader(\"Content-Type\", \"video/mp4\"); // File content type\nreq.setHeader(\"Accept\", \"application/json, text/plain, */*\"); \nreq.setHeader(\"Accept-Encoding\", \"gzip, deflate, br, zstd\"); \nreq.setHeader(\"Content-Length\", fileContent.length);\n\n// Attach the file content as the request body\nreq.setBody(fileContent);\n",
155+
"req": "const fs = require('fs');\nconst path = require('path');\n\n// File details\nconst filename = \"video_name.mp4\"; // CHANGE HERE\nconst filePath = \"video_file_path\"; // CHANGE HERE\nbru.setEnvVar(\"video_name\",filename);\n\n// Read the file as raw binary data\nconst fileContent = fs.readFileSync(filePath);\n\n// Set request headers\nreq.setHeader(\"Content-Type\", \"video/mp4\"); // File content type\nreq.setHeader(\"Accept\", \"application/json, text/plain, */*\"); \nreq.setHeader(\"Accept-Encoding\", \"gzip, deflate, br, zstd\"); \nreq.setHeader(\"Content-Length\", fileContent.length);\n\n// Attach the file content as the request body\nreq.setBody(fileContent);\n",
156156
"res": "let data = res.body ;\nbru.setEnvVar(\"main_file_version_id\", data.version_id);\nbru.setEnvVar(\"video_key\", data.key);"
157157
},
158158
"vars": {},
@@ -165,7 +165,7 @@
165165
},
166166
{
167167
"type": "http",
168-
"name": "Step 4- Create a flow",
168+
"name": "Step 4: Create a flow",
169169
"seq": 4,
170170
"request": {
171171
"url": "{{baseURL}}/api/flows/",
@@ -180,7 +180,7 @@
180180
"params": [],
181181
"body": {
182182
"mode": "json",
183-
"json": "{\n \"version_id\":\"{{main_file_version_id}}\", //response of the put the video 'version_id' \n \"key\": \"{{video_key}}\",//response of the put the video 'key' \n \"bucket_id\":\"{{bucket_id}}\", // create video response \n \"deposit_id\":\"{{video_id}}\" // create video response\n}",
183+
"json": "{\n \"version_id\":\"{{main_file_version_id}}\", //response of the `upload the video` 'version_id' \n \"key\": \"{{video_key}}\", //response of the `upload the video` 'key' \n \"bucket_id\":\"{{bucket_id}}\", // create video response \n \"deposit_id\":\"{{video_id}}\" // create video response\n}",
184184
"formUrlEncoded": [],
185185
"multipartForm": []
186186
},
@@ -195,8 +195,8 @@
195195
},
196196
{
197197
"type": "http",
198-
"name": "Step 5- Upload additional file",
199-
"seq": 6,
198+
"name": "Step 5: Upload additional file",
199+
"seq": 5,
200200
"request": {
201201
"url": "{{baseURL}}/api/files/{{bucket_id}}/{{additional_file}}",
202202
"method": "PUT",
@@ -209,7 +209,7 @@
209209
"multipartForm": []
210210
},
211211
"script": {
212-
"req": "const fs = require('fs');\nconst path = require('path');\n\n// File details\nconst filename = \"CHANGE HERE\";\nconst filePath = \"CHANGE HERE\";\nbru.setEnvVar(\"additional_file\", filename);\n\n// Read the file as raw binary data\nconst fileContent = fs.readFileSync(filePath);\n\n// Set request headers\nreq.setHeader(\"Accept\", \"application/json, text/plain, */*\"); \nreq.setHeader(\"Accept-Encoding\", \"gzip, deflate, br, zstd\"); \nreq.setHeader(\"Content-Length\", fileContent.length);\n\n// Attach the file content as the request body\nreq.setBody(fileContent);\n"
212+
"req": "const fs = require('fs');\nconst path = require('path');\n\n// File details\nconst filename = \"video_name.mp4\"; // CHANGE HERE\nconst filePath = \"video_file_path\"; // CHANGE HERE\nbru.setEnvVar(\"additional_file\", filename);\n\n// Read the file as raw binary data\nconst fileContent = fs.readFileSync(filePath);\n\n// Set request headers\nreq.setHeader(\"Accept\", \"application/json, text/plain, */*\"); \nreq.setHeader(\"Accept-Encoding\", \"gzip, deflate, br, zstd\"); \nreq.setHeader(\"Content-Length\", fileContent.length);\n\n// Attach the file content as the request body\nreq.setBody(fileContent);\n"
213213
},
214214
"vars": {},
215215
"assertions": [],
@@ -221,8 +221,8 @@
221221
},
222222
{
223223
"type": "http",
224-
"name": "Step 6- Publish",
225-
"seq": 7,
224+
"name": "Step 7: Publish",
225+
"seq": 8,
226226
"request": {
227227
"url": "{{baseURL}}/api/deposits/video/{{video_id}}/actions/publish",
228228
"method": "POST",
@@ -250,7 +250,7 @@
250250
}
251251
}
252252
],
253-
"activeEnvironmentUid": "zqLEVCQ0eIhimP48VysTg",
253+
"activeEnvironmentUid": "O01m8KLYsgrkGRjOSv443",
254254
"environments": [
255255
{
256256
"variables": [

COPYING renamed to LICENSE

File renamed without changes.

README.rst

Lines changed: 39 additions & 25 deletions
Original file line numberDiff line numberDiff line change
@@ -1,12 +1,20 @@
1-
===
2-
CDS
3-
===
1+
..
2+
Copyright (C) 2013-2024 CERN.
3+
CDS Videos is free software; you can redistribute it and/or modify it
4+
under the terms of the GNU General Public License; see LICENSE file for more details.
45
5-
This is the CERN Document Server source code overlay.
6+
==========
7+
CDS Videos
8+
==========
9+
10+
.. image:: https://img.shields.io/github/license/CERNDocumentServer/cds-videos.svg
11+
:target: ./LICENSE
12+
13+
This is the CDS Videos source code overlay.
614

715
Powered by Invenio
816
===================
9-
CDS is a small layer on top of `Invenio <http://invenio-software.org>`_, a ​free software suite enabling you to run your own ​digital library or document repository on the web.
17+
CDS Videos is a small layer on top of `Invenio <http://invenio-software.org>`_, a ​free software suite enabling you to run your own ​digital library or document repository on the web.
1018

1119
Table of Contents
1220
=================
@@ -29,7 +37,6 @@ Table of Contents
2937
- `Optional: Update the Access of the Video <#optional-update-the-access-of-the-video>`_
3038
- `Step 6: Get Project to Check the Flow Status <#step-6-get-project-to-check-the-flow-status>`_
3139
- `Step 7: Publish Video <#step-7-publish-video>`_
32-
- `License <#license>`_
3340

3441

3542
Prerequisites
@@ -170,13 +177,31 @@ To facilitate local development, open multiple terminal sessions and run the fol
170177
171178
Testing
172179
=======
173-
Running the tests are as simple as: ::
174180

175-
python setup.py test
181+
To run the tests, follow these steps:
182+
183+
1. **Activate your Python environment:**
184+
185+
2. **Set up the test environment:**
186+
187+
.. code-block:: bash
188+
189+
./scripts/setup-tests
190+
191+
3. **Run the tests:**
192+
193+
.. code-block:: bash
194+
195+
./run-tests.sh
176196
177-
or (to also show test coverage) ::
178197
179-
source run-tests.sh
198+
**Running Specific Tests**
199+
200+
To run a specific test file or function, use the following command:
201+
202+
.. code-block:: bash
203+
204+
./run-tests.sh tests/unit/test_example.py -k "test_specific_function"
180205
181206
182207
Publish Video through REST API
@@ -204,7 +229,7 @@ If you'd like to use the pre-configured REST API collection in Bruno, ensure you
204229
- Download this `Bruno collection <./Bruno%20Collection%20-%20CDS%20Videos%20Publish%20Video.json>`_.
205230
- Open Bruno and import downloaded collection.
206231
- Create an environment for the collection.
207-
- Configure the environment by adding a variable named ``baseURl``. Set its value to your API base URL (e.g., ``http://localhost:5000``).
232+
- Configure the environment by adding a variable named ``baseURL``. Set its value to your API base URL (e.g., ``http://localhost:5000``).
208233

209234
3. **Configure Authentication in Bruno:**
210235

@@ -513,6 +538,7 @@ Step 3: Upload the Video
513538
- body
514539
- Video file.
515540

541+
- To include the file in the body, modify the `pre-request script` in Bruno.
516542

517543
**Response:**
518544

@@ -601,6 +627,8 @@ Step 5: (Optional) Upload Additional File
601627
- body
602628
- The file to be uploaded.
603629

630+
- To include the file in the body, modify the `pre-request script` in Bruno.
631+
604632
**Response:**
605633

606634
Uploaded additional file JSON.
@@ -729,17 +757,3 @@ Before publishing the video, ensure that the workflow is complete.
729757

730758
Published video deposit JSON.
731759

732-
733-
License
734-
=======
735-
736-
Copyright (C) 2013-2024 CERN.
737-
738-
CDS is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation; either version 2 of the License, or (at your option) any later version.
739-
740-
CDS is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details.
741-
742-
You should have received a copy of the GNU General Public License along with CDS; if not, write to the Free Software Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307, USA.
743-
744-
In applying this licence, CERN does not waive the privileges and immunities granted to it by virtue of its status as an Intergovernmental Organization or submit itself to any jurisdiction.
745-

0 commit comments

Comments
 (0)