use of de.catma.serialization.TagLibrarySerializationHandler in project catma by forTEXT.
the class GraphWorktreeProject method loadTagLibrary.
@Override
public List<TagsetDefinitionImportStatus> loadTagLibrary(InputStream inputStream) throws IOException {
TeiSerializationHandlerFactory factory = new TeiSerializationHandlerFactory();
factory.setTagManager(new TagManager(new TagLibrary()));
TagLibrarySerializationHandler tagLibrarySerializationHandler = factory.getTagLibrarySerializationHandler();
TagLibrary importedLibrary = tagLibrarySerializationHandler.deserialize(null, inputStream);
List<String> resourceIds = gitProjectHandler.getResourceIds();
List<TagsetDefinitionImportStatus> tagsetDefinitionImportStatusList = new ArrayList<>();
for (TagsetDefinition tagset : importedLibrary) {
boolean inProjectHistory = resourceIds.contains(tagset.getUuid());
boolean current = inProjectHistory && (getTagManager().getTagLibrary().getTagsetDefinition(tagset.getUuid()) != null);
tagsetDefinitionImportStatusList.add(new TagsetDefinitionImportStatus(tagset, inProjectHistory, current));
}
return tagsetDefinitionImportStatusList;
}
Aggregations