Search in sources :

Example 16 with ContentInfoSet

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");
}
Also used : AnnotationCollection(de.catma.document.annotation.AnnotationCollection) ContentInfoSet(de.catma.document.source.ContentInfoSet)

Example 17 with ContentInfoSet

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;
    }
}
Also used : ContentInfoSet(de.catma.document.source.ContentInfoSet) ILocalGitRepositoryManager(de.catma.repository.git.interfaces.ILocalGitRepositoryManager) GitTagsetHeader(de.catma.repository.git.serialization.models.GitTagsetHeader) File(java.io.File)

Aggregations

ContentInfoSet (de.catma.document.source.ContentInfoSet)17 File (java.io.File)12 ILocalGitRepositoryManager (de.catma.repository.git.interfaces.ILocalGitRepositoryManager)9 IndexInfoSet (de.catma.document.source.IndexInfoSet)6 SourceDocumentInfo (de.catma.document.source.SourceDocumentInfo)6 TechInfoSet (de.catma.document.source.TechInfoSet)6 IDGenerator (de.catma.util.IDGenerator)6 FileInputStream (java.io.FileInputStream)6 AnnotationCollection (de.catma.document.annotation.AnnotationCollection)4 JGitRepoManager (de.catma.repository.git.managers.JGitRepoManager)4 GitMarkupCollectionHeader (de.catma.repository.git.serialization.models.GitMarkupCollectionHeader)4 TagsetDefinition (de.catma.tag.TagsetDefinition)4 EventBus (com.google.common.eventbus.EventBus)3 BackgroundService (de.catma.backgroundservice.BackgroundService)3 SourceDocument (de.catma.document.source.SourceDocument)3 TermExtractor (de.catma.indexer.TermExtractor)3 GitLabServerManagerTest (de.catma.repository.git.managers.GitLabServerManagerTest)3 Property (de.catma.tag.Property)3 TagInstance (de.catma.tag.TagInstance)3 UsernamePasswordCredentialsProvider (org.eclipse.jgit.transport.UsernamePasswordCredentialsProvider)3