SwordCollection scol = new SwordCollection(); scol.setLocation(location); scol.setTitle(title); scol.setCollectionPolicy(collectionPolicy); String firstValue = dcAbstracts.get(0).getValue(); if (StringUtils.isNotBlank(firstValue)) { scol.setAbstract(firstValue); scol.setMediation(mediation); scol.addAccepts(accept); scol.addMultipartAccepts(accept); scol.addAcceptPackaging(ap); if (itemService) { String subService = urlManager.constructSubServiceUrl(col); scol.addSubService(new IRI(subService));
private List<SwordCollection> buildSwordCollectionList(String workspaceName, AuthCredentials auth) { String baseURL = MCRFrontendUtil.getBaseURL(); List<SwordCollection> swordCollections = new ArrayList<>(); MCRSword.getCollectionsOfWorkspace(workspaceName).stream() .map(collection -> new AbstractMap.SimpleEntry<>(collection, MCRSword.getCollection(collection))) .filter(collectionEntry -> collectionEntry.getValue().isVisible()) .forEach(collection -> { SwordCollection swordCollection = new SwordCollection(); final String collectionTitle = collection.getKey(); swordCollection.setTitle(collectionTitle); // add the supported packaging to the collection Provider final MCRSwordCollectionProvider collectionProvider = collection.getValue(); collectionProvider.getSupportedPagacking().forEach(swordCollection::addAcceptPackaging); swordCollection.setHref(baseURL + MCRSwordConstants.SWORD2_COL_IRI + collectionTitle + "/"); swordCollections.add(swordCollection); }); return swordCollections; } }
SwordCollection scol = new SwordCollection(); location = handleService.getCanonicalForm(com.getHandle()); scol.setLocation(location); scol.setTitle(title); String firstValue = abstracts.get(0).getValue(); if (StringUtils.isNotBlank(firstValue)) { scol.setAbstract(firstValue); scol.setMediation(swordConfig.isMediated()); scol.addSubService(new IRI(subService));
String dvAlias = dataverse.getAlias(); if (dvAlias != null && !dvAlias.isEmpty()) { SwordCollection swordCollection = new SwordCollection(); swordCollection.setTitle(dataverse.getName()); swordCollection.setHref(hostnamePlusBaseUrl + "/collection/dataverse/" + dvAlias); swordCollection.addAcceptPackaging(UriRegistry.PACKAGE_SIMPLE_ZIP); swordCollection.setCollectionPolicy(systemConfig.getApiTermsOfUse()); swordWorkspace.addCollection(swordCollection);