logger.info("repositoryString:" + repositoryString);
logger.info("restString:" + restString);
try
{
RepositoryVO repositoryVO = RepositoryController.getController().getRepositoryVOWithName(repositoryString);
logger.info("repositoryVO:" + repositoryVO);
if(repositoryVO == null)
{
logger.warn("No repository found by name " + repositoryString + ". Looking for a default repository where other templates are located.");
List templates = ContentController.getContentController().getContentVOWithContentTypeDefinition("HTMLTemplate");
if(templates != null && templates.size() > 0)
{
ContentVO contentVO = (ContentVO)templates.get(0);
repositoryVO = RepositoryController.getController().getRepositoryVOWithId(contentVO.getRepositoryId());
logger.info("repositoryVO:" + repositoryVO);
}
}
if(repositoryVO != null)
{
LanguageVO languageVO = LanguageController.getController().getMasterLanguage(repositoryVO.getRepositoryId());
ContentVO parentContent = ContentController.getContentController().getContentVOWithPath(repositoryVO.getId(), restString, true, this.getInfoGluePrincipal());
logger.info("parentContent:" + parentContent);
ContentVO newContentVO = ContentController.getContentController().create(parentContent.getId(), contentTypeDefinitionVO.getContentTypeDefinitionId(), parentContent.getRepositoryId(), remoteContentVO);
logger.info("Now we want to create the version also on:" + newContentVO.getName());
ContentVersionVO contentVersionVO = new ContentVersionVO();
contentVersionVO.setVersionComment("deployment");