arnbae
I'm new here

Update of Store Elements from export-ZIP?

Hi,

can anyone give me any information about the StoreElement.update() method? It is (not) documented like this in the API documentation

update

void update(ZipFile exportFile,
            ImportHandler importHandler)
            throws IOException
ImportHandler may be null

Throws:
IOException
Since:
3.1.158

More specifically I hope that this method updates an existing StoreElement from an equivalent Export ZIP file, but my blind testing only threw exceptions. The idea behind it to use it along the "Template Update" and "Package Pool" functionalities to update Elements that are not supported yet (Global Content in Packages, and everything except Templates in "Template Updates").

I draw my hope that "update" has very much the same syntax as

importStoreElement

StoreElement importStoreElement(ZipFile exportFile,
                                ImportHandler importHandler)
                                throws IOException,
                                       ElementDeletedException,
                                       WorkflowLockException
Imports the first StoreElement from given zip exportfile. The created node is not locked, but it's necessary to lock, save and unlock the imported element.

Parameters:
exportFile - zip export-file.
importHandler - may be null.
Returns:
first element from exportfile.
Throws:
IOException - occured in handling given zip file.
ElementDeletedException - if this element is already deleted.
WorkflowLockException
Since:
3.0.7
0 Kudos
1 Reply
boesebeck
Crownpeak employee

Hi,

first - sorry for the late response. StoreElement.update() is designed only for the export format that firstspirit export, and it works only correct, in the way that you expect, in the same project. So i think it is not the solution you search for, you must probably update the StoreElement over the Editor Methods. A further Method are discuss in the feature request javascript:;

In my test i found a unnecessary thrown IOException, i post it into our internal bug tracking system.

0 Kudos