if(logger.isInfoEnabled())
{
logger.info("principalName:" + principalName);
}
InfoGluePrincipal principal = UserControllerProxy.getController().getUser(principalName);
List missingRemoteComponents = (List)arguments.get("missingComponents");
logger.info("missingRemoteComponents:" + missingRemoteComponents);
Iterator missingRemoteComponentsIterator = missingRemoteComponents.iterator();
while(missingRemoteComponentsIterator.hasNext())
{
ContentVO missingRemoteContentVO = (ContentVO)missingRemoteComponentsIterator.next();
if(missingRemoteContentVO != null)
missingRemoteContentVO.setIsBranch(Boolean.FALSE);
logger.info("missingRemoteContentVO:" + missingRemoteContentVO + ":" + missingRemoteContentVO.getFullPath());
String fullPath = missingRemoteContentVO.getFullPath();
logger.info("fullPath:" + fullPath);
int siteNodeEnd = fullPath.indexOf(" - /");
String repositoryString = fullPath.substring(0, siteNodeEnd);
String restString = fullPath.substring(siteNodeEnd + 4);
restString = restString.substring(0, restString.lastIndexOf("/"));
if(restString.indexOf("/") > -1)
restString = restString.substring(restString.indexOf("/") + 1);
else
restString = "";
logger.info("repositoryString:" + repositoryString);
logger.info("restString:" + restString);
try
{
RepositoryVO repositoryVO = RepositoryController.getController().getRepositoryVOWithName(repositoryString);
logger.info("repositoryVO:" + repositoryVO);
if(repositoryVO == null && components != null && components.size() > 0)
{
ContentVO contentVO = (ContentVO)components.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, principal);
logger.info("parentContent:" + parentContent);
ContentVO newContentVO = ContentController.getContentController().create(parentContent.getId(), contentTypeDefinitionVO.getContentTypeDefinitionId(), parentContent.getRepositoryId(), missingRemoteContentVO);
logger.info("Now we want to create the version also on:" + newContentVO.getName());
ContentVersionVO contentVersionVO = new ContentVersionVO();
contentVersionVO.setVersionComment("deployment");
contentVersionVO.setVersionModifier(principal.getName());
logger.info("missingRemoteContentVO.getVersions():" + missingRemoteContentVO.getVersions());
if(missingRemoteContentVO.getVersions() != null && missingRemoteContentVO.getVersions().length > 0)
{
contentVersionVO.setVersionValue(missingRemoteContentVO.getVersions()[0]);
logger.info("Creating version on content: " + newContentVO.getId() + " in language: " + languageVO.getId());