You can store the zip in a filedocument and create a java action to unzip it into filedocuments.
ImportFile is a specialization of filedocument
parameter
zipfile: filedocument
imports
import java.util.zip.ZipEntry;
import java.util.zip.ZipInputStream;
import org.apache.commons.io.IOUtils;
User code
ZipInputStream zis = new ZipInputStream(Core.getFileDocumentContent(getContext(), zipfile.getMendixObject()));
ZipEntry ze = zis.getNextEntry();
while(ze!=null){
String filename = substringAfterLast(ze.getName(), "/");
ImportFile zipEntryDocument = new ImportFile(getContext());
zipEntryDocument.setName(filename);
// use intermediate memory stream because storeFileDocumentContent will close the zis stream.
ByteArrayOutputStream baos = new ByteArrayOutputStream();
IOUtils.copy(zis, baos);
Core.getLogger("Unzipper").debug("store import file " + zipEntryDocument.getName());
Core.storeFileDocumentContent(this.getContext(), zipEntryDocument.getMendixObject(), new ByteArrayInputStream(baos.toByteArray()));
zipEntryDocument.commit();
ze = zis.getNextEntry();
}
zis.closeEntry();
zis.close();
return true;
EDIT 2: you can download a 10.6.3 module from this link
You can also have a look at the Community Commons module from the appstore. This contains the 'storeURLtoFileDocument' action.
Hi Chris,
If you already have an import mapping, it is not a big step further to create an export mapping to map the xml to a filedocument. For this you can use the 'Export With Mapping' action in a microflow and store the output as a FileDocument.