In this section, we will see how to import binaries and documents
from the given package ZIP file
back to the Demo Application.
After running the Demo Application, let's import binaries and documents like the following.
$ cat import-params.json
{
publishOnImport: "none"
}
$ curl -i \
-F "params=@import-params.json" \
-F "package=@exim.zip" \
-u admin:admin \
http://localhost:8080/cms/ws/exim/import
HTTP/1.1 200
Date: Tue, 20 Feb 2018 22:04:37 GMT
Content-Type: multipart/mixed; boundary="uuid:de10ee65-f3e7-4817-ba3c-a7cfdeb0dcc4"
Transfer-Encoding: chunked
--uuid:de10ee65-f3e7-4817-ba3c-a7cfdeb0dcc4
Content-Type: text/plain
Content-Transfer-Encoding: binary
Content-ID: <logs>
INFO 2018-02-20 17:04:30,877 ContentEximService#importContentFromZip begins with /usr/local/tomcat/_exim_5892554060758255713.zip
INFO 2018-02-20 17:04:37,634 ContentEximService#importContentFromZip ends.
--uuid:de10ee65-f3e7-4817-ba3c-a7cfdeb0dcc4
Content-Type: application/json
Content-Transfer-Encoding: binary
Content-ID: <summary>
{
"totalBinaryCount" : 8,
"totalDocumentCount" : 24,
"succeededBinaryCount" : 8,
"failedBinaryCount" : 0,
"succeededDocumentCount" : 24,
"failedDocumentCount" : 0,
"items" : [ {
"path" : "/content/gallery/contenteximdemo/banners/banner-2.jpg",
"primaryType" : "hippogallery:imageset",
"succeeded" : true,
"errorMessage" : null
}, {
"path" : "/content/gallery/contenteximdemo/banners/banner-1.jpg",
"primaryType" : "hippogallery:imageset",
"succeeded" : true,
"errorMessage" : null
},
// ...
{
"path" : "/content/documents/contenteximdemo/events/2017/07/breakfast",
"primaryType" : "contenteximdemo:eventsdocument",
"succeeded" : true,
"errorMessage" : null
} ],
"errors" : [ ],
"progress" : 1.0
}
--uuid:de10ee65-f3e7-4817-ba3c-a7cfdeb0dcc4--
You can also override properties in ExecutionParams by adding optional form parameters like the following:
$ curl -i \
-F "publishOnImport=live" \
-F "params=@import-params.json" \
-F "package=@exim.zip" \
-u admin:admin \
http://localhost:8080/cms/ws/exim/import
Actually, as you can omit ExecutionParams in content import proccess
to keep the default parameters, you can simply execute
the importing process without the params attachment, like the following example:
$ curl -i \
-F "publishOnImport=live" \
-F "documentTags=contenteximdemo:tags=exim,v1.1" \
-F "package=@exim.zip" \
-u admin:admin \
http://localhost:8080/cms/ws/exim/import
You've just imported the binaries and documents in the content package ZIP file the system! Now, you can check if those are good through CMS system as well!