* This handles the actual exporting.
*/
protected String doExecute() throws Exception
{
RegistryController registryController = RegistryController.getController();
Database db = CastorDatabaseService.getDatabase();
try
{
db.begin();
//Checks the relations from sitenodes
List siteNodes = SiteNodeController.getController().getRepositorySiteNodes(this.repositoryId, db);
Iterator siteNodesIterator = siteNodes.iterator();
while(siteNodesIterator.hasNext())
{
SiteNode siteNode = (SiteNode)siteNodesIterator.next();
logger.info("Going to index all versions of " + siteNode.getName());
Iterator siteNodeVersionsIterator = siteNode.getSiteNodeVersions().iterator();
while(siteNodeVersionsIterator.hasNext())
{
SiteNodeVersion siteNodeVersion = (SiteNodeVersion)siteNodeVersionsIterator.next();
registryController.updateSiteNodeVersion(siteNodeVersion.getValueObject(), db);
}
}
//Checks the relations from contents
List contents = ContentController.getContentController().getRepositoryContents(this.repositoryId, db);
Iterator iterator = contents.iterator();
while(iterator.hasNext())
{
Content content = (Content)iterator.next();
logger.info("Going to index all version of " + content.getName());
Iterator versionsIterator = content.getContentVersions().iterator();
while(versionsIterator.hasNext())
{
ContentVersion contentVersion = (ContentVersion)versionsIterator.next();
registryController.updateContentVersion(contentVersion.getValueObject(), db);
}
}
db.commit();
}