logger.info("contents:" + contents);
Iterator<Content> contentsIterator = contents.getContents().iterator();
while(contentsIterator.hasNext())
{
Content content = contentsIterator.next();
logger.info("content:" + content + ":" + content.getValueObject().getId() + ":" + content.getValueObject().getRepositoryId() + ":" + content.getRepositoryId());
contentMap.put(content.getContentId(), content);
if(content.getValueObject().getParentContentId() == null)
{
logger.info("content was root:" + content + ":" + content.getValueObject().getId() + ":" + content.getValueObject().getRepositoryId() + ":" + content.getRepositoryId());
if(!repositoryContentMap.containsKey("" + content.getRepositoryId()))
repositoryContentMap.put("" + content.getRepositoryId(), content);
else
logger.info("content was root but skipping as registration allready there:" + content + ":" + content.getValueObject().getId() + ":" + content.getValueObject().getRepositoryId() + ":" + content.getRepositoryId());
}
//logger.info("readContentCandidate debug...:" + readContentCandidate.getName() + ":" + readContentCandidate.getId() + ":" + readContentCandidate.getRepositoryId());
}
contentsIterator = contents.getContents().iterator();
while(contentsIterator.hasNext())
{
Content content = contentsIterator.next();
logger.info("content:" + content.getName() + ":" + content.getValueObject().getParentContentId());
if(content.getValueObject().getParentContentId() != null)
{
Content parentContent = contentMap.get(content.getValueObject().getParentContentId());
if(parentContent != null)
{
logger.info("parentContent:" + parentContent.getName() + ":" + parentContent);
parentContent.getChildren().add(content);
content.setParentContent((ContentImpl)parentContent);
logger.info("Children after: " + parentContent.getChildren());
}
else
{
logger.error("Something is strange with parent content id:"+content.getValueObject().getParentContentId() +" it doesn't have a parent content id:"+content.getContentId());
}
}
logger.info("repositoryIdMap:" + repositoryIdMap);
//logger.info("Looking for repo:" + content.getRepositoryId());
Repository newRepository = (Repository)repositoryIdMap.get("" + content.getRepositoryId() + "_repository");
//logger.info("newRepository:" + newRepository);
content.setRepository((RepositoryImpl)newRepository);
//logger.info("readContentCandidate debug...:" + readContentCandidate.getName() + ":" + readContentCandidate.getId() + ":" + readContentCandidate.getRepositoryId());
}
InfoGlueExportImpl contentVersions = getInfoGlueExportImpl(contentVersionsFile, encoding);
logger.info("contentVersions:" + contentVersions);
float memoryLeft = ((float)Runtime.getRuntime().maxMemory() - (float)Runtime.getRuntime().totalMemory()) / 1024f / 1024f;
logger.info("Memory after contentVersions-file:" + memoryLeft);
for(ExportContentVersionImpl contentVersion : contentVersions.getContentVersions())
{
List<ExportContentVersionImpl> versions = allContentVersionMap.get(contentVersion.getValueObject().getContentId());
if(versions == null)
{
versions = new ArrayList<ExportContentVersionImpl>();
logger.info("Creating versions for " + contentVersion.getValueObject().getContentId());
allContentVersionMap.put(contentVersion.getValueObject().getContentId(), versions);
}
//logger.info("Adding version:" + contentVersion.getValueObject().getContentVersionId() + ":" + contentVersion.getValueObject().getContentId());
versions.add(contentVersion);
//logger.info("readContentCandidate debug...:" + readContentCandidate.getName() + ":" + readContentCandidate.getId() + ":" + readContentCandidate.getRepositoryId());
}
}
for(Repository repositoryRead : repositories)
{
logger.info("Getting root content for: " + repositoryRead.getId());
Content rootContent = (Content)repositoryContentMap.get("" + repositoryRead.getId());
logger.info("rootContent: " + rootContent);
if(rootContent == null)
{
Integer oldRepoId = (Integer)repositoryIdMap.get("" + repositoryRead.getId() + "_old");
logger.info("Getting root content for: " + oldRepoId);