use of de.catma.document.source.ContentInfoSet in project catma by forTEXT.
the class TPGraphProjectHandler method addCollection.
@Override
public void addCollection(String rootRevisionHash, String collectionId, String name, String umcRevisionHash, SourceDocument document, TagLibrary tagLibrary, String oldRootRevisionHash) throws Exception {
logRootRevisionHash(rootRevisionHash, oldRootRevisionHash, "addCollection enter");
logger.info("Adding Collection " + name);
graphWriter.addCollection(oldRootRevisionHash, rootRevisionHash, new AnnotationCollection(collectionId, new ContentInfoSet(name), tagLibrary, document.getUuid(), document.getRevisionHash()));
logRootRevisionHash("addCollection exit");
}
use of de.catma.document.source.ContentInfoSet in project catma by forTEXT.
the class GitTagsetHandler method getContentInfoSet.
public ContentInfoSet getContentInfoSet(String projectId, String tagsetId) throws IOException {
try (ILocalGitRepositoryManager localGitRepoManager = this.localGitRepositoryManager) {
String projectRootRepositoryName = GitProjectManager.getProjectRootRepositoryName(projectId);
localGitRepoManager.open(projectId, projectRootRepositoryName);
String tagsetSubmoduleName = String.format("%s/%s", GitProjectHandler.TAGSET_SUBMODULES_DIRECTORY_NAME, tagsetId);
File tagsetHeaderFile = new File(localGitRepoManager.getRepositoryWorkTree(), tagsetSubmoduleName + "/" + HEADER_FILE_NAME);
String serialized = FileUtils.readFileToString(tagsetHeaderFile, StandardCharsets.UTF_8);
GitTagsetHeader gitTagsetHeader = new SerializationHelper<GitTagsetHeader>().deserialize(serialized, GitTagsetHeader.class);
ContentInfoSet contentInfoSet = new ContentInfoSet();
contentInfoSet.setTitle(gitTagsetHeader.getName());
return contentInfoSet;
}
}
Aggregations