NOTE: I attach a custom implementation for the "org.jboss.portal.cms.impl.jcr.command.ContentCreateCommand" that solves the problem for me.
If you exports a directory content (for instance: "/default" folder), you make some changes to some files (for instance "index,html"), you zip all the files and try to upload the entire zip to the same directory (make changes over the existent files), the system throwns a VersionException because the system is trying to modify a property over an existent node without doing checkout.
What are happening?
The CMSAminPortlet is executing the following commands:
Command storearchiveCMD = CMSService.getCommandFactory().createStoreArchiveCommand(sPath, is, sLanguage);
List contentstoVersion = (List)CMSService.execute(storearchiveCMD);
Command createVersions = CMSService.getCommandFactory().createContentCreateNewVersionCommand(contentstoVersion, true);
The command that - i think - is not doing his work fine is the first one (org.jboss.portal.cms.impl.jcr.command.ContentCreateCommand), the implementation is assuming that the files (file+language) doesn't exists in the repository.
Exactly, the ContentCreateCommand is looking for the Node that points to the File in the repository (basePath), and adding a new Node for the given language. Instead of that, the code should check if the Node for that language already exists.
If the Node (for the given language) already exists, then we only need to change the "jcr:data" and "jcr:lastModified", invoking first the "checout()" method for the node, as i show here:
contentNode.setProperty("jcr:data", new BinaryValue(mFile.getContent().getBytes()));
contentNode.setProperty("jcr:lastModified", new DateValue(Calendar.getInstance()));
Then, the node is ready to be versioned by the next Command executed in the CMSAdminPortlet (createContentCreateNewVersionCommand).