diff --git a/dspace-api/src/main/java/cz/cuni/mff/ufal/curation/RequiredMetadata.java b/dspace-api/src/main/java/cz/cuni/mff/ufal/curation/RequiredMetadata.java index 5b5749a67eb..9ebdcc17611 100644 --- a/dspace-api/src/main/java/cz/cuni/mff/ufal/curation/RequiredMetadata.java +++ b/dspace-api/src/main/java/cz/cuni/mff/ufal/curation/RequiredMetadata.java @@ -147,11 +147,7 @@ public int perform(DSpaceObject dso) throws IOException colhandle = item.getOwningCollection().getHandle(); checkExtra = checkExtraIds.contains(Integer.toString(item.getOwningCollection().getID())); } - Metadatum[] itemTypeDCV = item.getMetadata("dc", "type", null, Item.ANY); - String itemType = null; - if(itemTypeDCV != null && itemTypeDCV.length >0){ - itemType = itemTypeDCV[0].value; - } + Metadatum[] itemTypes = item.getMetadata(Item.ANY, "type", Item.ANY, Item.ANY); for (DCInput input : getReqList(colhandle,checkExtra)) { StringBuilder reqsb = new StringBuilder(); @@ -177,7 +173,7 @@ public int perform(DSpaceObject dso) throws IOException if (!mdPatFound) { Metadatum[] vals = item.getMetadataByMetadataString(req); - if ((itemType == null || input.isAllowedFor(itemType)) && vals.length == 0) + if ((itemTypes == null || itemTypes.length == 0 || input.isAllowedFor(itemTypes)) && vals.length == 0) { boolean issue_warning = true; if (mdEquivalenceMap.containsKey(req)) { diff --git a/dspace-api/src/main/java/cz/cuni/mff/ufal/dspace/app/itemimport/ItemImportReplacingMetadata.java b/dspace-api/src/main/java/cz/cuni/mff/ufal/dspace/app/itemimport/ItemImportReplacingMetadata.java new file mode 100644 index 00000000000..4307017bc6b --- /dev/null +++ b/dspace-api/src/main/java/cz/cuni/mff/ufal/dspace/app/itemimport/ItemImportReplacingMetadata.java @@ -0,0 +1,99 @@ +package cz.cuni.mff.ufal.dspace.app.itemimport; + +import cz.cuni.mff.ufal.DSpaceApi; +import cz.cuni.mff.ufal.lindat.utilities.hibernate.LicenseDefinition; +import cz.cuni.mff.ufal.lindat.utilities.interfaces.IFunctionalities; +import org.dspace.app.itemimport.ItemImport; +import org.dspace.content.*; +import org.dspace.core.Context; +import org.dspace.handle.HandleManager; + +import java.io.File; +import java.util.ArrayList; +import java.util.List; +import java.util.Map; + +public class ItemImportReplacingMetadata extends ItemImport { + + private java.nio.file.FileSystem fs = java.nio.file.FileSystems.getDefault(); + IFunctionalities functionalities = DSpaceApi.getFunctionalityManager(); + + @Override + protected void replaceItems(Context c, Collection[] mycollections, String sourceDir, String mapFile, + boolean template) throws Exception { + // verify the source directory + File d = new java.io.File(sourceDir); + List processedItems = new ArrayList<>(); + + if (d == null || !d.isDirectory()) + { + throw new Exception("Error, cannot open source directory " + + sourceDir); + } + + // read in HashMap first, to get list of handles & source dirs + Map myHash = readMapFile(mapFile); + + for (Map.Entry mapEntry : myHash.entrySet()) + { + String itemName = mapEntry.getKey(); + String handle = mapEntry.getValue(); + Item item; + + if (handle.indexOf('/') != -1) + { + System.out.println("\tReplacing: " + handle); + + // add new item, locate old one + item = (Item) HandleManager.resolveToObject(c, handle); + } + else + { + item = Item.find(c, Integer.parseInt(handle)); + } + + final Metadatum[] provenance = item.getMetadataByMetadataString("dc.description.provenance"); + final Metadatum[] accessioned = item.getMetadataByMetadataString("dc.date.accessioned"); + final Metadatum[] available = item.getMetadataByMetadataString("dc.date.available"); + final Metadatum[] branding = item.getMetadataByMetadataString("local.branding"); + + item.clearMetadata(Item.ANY, Item.ANY, Item.ANY, Item.ANY); + loadMetadata(c, item, java.nio.file.Paths.get(sourceDir, itemName).toString() + fs.getSeparator()); + for (Metadatum[] mds : new Metadatum[][]{provenance, accessioned, available, branding}){ + for(Metadatum md : mds){ + item.addMetadatum(md); + } + } + processedItems.add(item); + } + + //attempt at saving all changes or none; + for(Item i : processedItems){ + i.update(); + } + c.commit(); + c.clearCache(); + + // attach license, license label requires an update + functionalities.openSession(); + for(Item i : processedItems){ + final String licenseURI = i.getMetadata("dc.rights.uri"); + if(licenseURI != null) { + final LicenseDefinition license = functionalities.getLicenseByDefinition(licenseURI); + final int licenseId = license.getLicenseId(); + for(Bundle bundle : i.getBundles("ORIGINAL")){ + for(Bitstream b : bundle.getBitstreams()){ + functionalities.detachLicenses(b.getID()); + functionalities.attachLicense(licenseId, b.getID()); + } + } + i.clearMetadata("dc", "rights", "label", Item.ANY); + i.addMetadata("dc", "rights", "label", Item.ANY, license.getLicenseLabel().getLabel()); + i.update(); + } + } + c.commit(); + c.clearCache(); + functionalities.closeSession(); + } +} diff --git a/dspace-api/src/main/java/cz/cuni/mff/ufal/dspace/submit/step/UFALExtraMetadataStep.java b/dspace-api/src/main/java/cz/cuni/mff/ufal/dspace/submit/step/UFALExtraMetadataStep.java index 9d7c39ff6fa..c19b449baa3 100644 --- a/dspace-api/src/main/java/cz/cuni/mff/ufal/dspace/submit/step/UFALExtraMetadataStep.java +++ b/dspace-api/src/main/java/cz/cuni/mff/ufal/dspace/submit/step/UFALExtraMetadataStep.java @@ -76,13 +76,9 @@ public int doProcessing(Context context, HttpServletRequest request, } // Fetch the document type (dc.type) - String documentType = ""; - if( (item.getMetadataByMetadataString("dc.type") != null) && (item.getMetadataByMetadataString("dc.type").length >0) ) - { - documentType = item.getMetadataByMetadataString("dc.type")[0].value; - } - - + Metadatum[] documentTypes = item.getMetadata(Item.ANY, "type", Item.ANY, Item.ANY); + + // Step 1: // clear out all item metadata defined on this page @@ -115,7 +111,7 @@ public int doProcessing(Context context, HttpServletRequest request, for (int j = 0; j < inputs.length; j++) { // Omit fields not allowed for this document type - if(!inputs[j].isAllowedFor(documentType)) + if(!inputs[j].isAllowedFor(documentTypes)) { continue; } @@ -249,7 +245,7 @@ else if (buttonPressed.equals("submit_" + fieldName + "_delete")) { // Do not check the required attribute if it is not visible or not allowed for the document type String scope = subInfo.isInWorkflow() ? DCInput.WORKFLOW_SCOPE : DCInput.SUBMISSION_SCOPE; - if ( !( inputs[i].isVisible(scope) && inputs[i].isAllowedFor(documentType) ) ) + if ( !( inputs[i].isVisible(scope) && inputs[i].isAllowedFor(documentTypes) ) ) { continue; } diff --git a/dspace-api/src/main/java/org/dspace/app/itemimport/ItemImport.java b/dspace-api/src/main/java/org/dspace/app/itemimport/ItemImport.java index bde057eec71..8aef62cda41 100644 --- a/dspace-api/src/main/java/org/dspace/app/itemimport/ItemImport.java +++ b/dspace-api/src/main/java/org/dspace/app/itemimport/ItemImport.java @@ -789,7 +789,7 @@ public void addItems(Context c, Collection[] mycollections, } } - private void replaceItems(Context c, Collection[] mycollections, + protected void replaceItems(Context c, Collection[] mycollections, String sourceDir, String mapFile, boolean template) throws Exception { // verify the source directory @@ -1048,7 +1048,7 @@ private void deleteItem(Context c, String myhandle) throws Exception // utility methods //////////////////////////////////// // read in the map file and generate a hashmap of (file,handle) pairs - private Map readMapFile(String filename) throws Exception + protected Map readMapFile(String filename) throws Exception { Map myHash = new HashMap(); @@ -1100,7 +1100,7 @@ private Map readMapFile(String filename) throws Exception } // Load all metadata schemas into the item. - private void loadMetadata(Context c, Item myitem, String path) + protected void loadMetadata(Context c, Item myitem, String path) throws SQLException, IOException, ParserConfigurationException, SAXException, TransformerException, AuthorizeException { diff --git a/dspace-api/src/main/java/org/dspace/app/util/DCInput.java b/dspace-api/src/main/java/org/dspace/app/util/DCInput.java index e04ae404aee..73984451734 100644 --- a/dspace-api/src/main/java/org/dspace/app/util/DCInput.java +++ b/dspace-api/src/main/java/org/dspace/app/util/DCInput.java @@ -11,6 +11,7 @@ import org.apache.commons.lang.StringUtils; import org.dspace.content.MetadataSchema; +import org.dspace.content.Metadatum; import org.dspace.core.Context; import org.xml.sax.SAXException; @@ -110,7 +111,7 @@ public class DCInput private boolean closedVocabulary = false; /** allowed document types */ - private List typeBind = null; + private Map> typeBind = new HashMap<>(); private ComplexDefinition complexDefinition = null; @@ -199,13 +200,21 @@ public DCInput(Map fieldMap, || "yes".equalsIgnoreCase(closedVocabularyStr); // parsing of the element (using the colon as split separator) - typeBind = new ArrayList(); String typeBindDef = fieldMap.get("type-bind"); if(typeBindDef != null && typeBindDef.trim().length() > 0) { String[] types = typeBindDef.split(","); + List boundTypes = new ArrayList<>(); for(String type : types) { - typeBind.add( type.trim() ); + boundTypes.add( type.trim() ); } + String typeBindField = fieldMap.get(DCInputsReader.TYPE_BIND_FIELD_ATTRIBUTE); + List existingTypes = typeBind.get(typeBindField); + if(existingTypes == null){ + typeBind.put(typeBindField, boundTypes); + }else{ + existingTypes.addAll(boundTypes); + } + } } @@ -520,14 +529,24 @@ public boolean isClosedVocabulary() { /** * Decides if this field is valid for the document type - * @param typeName Document type name + * @param types Document type Metadata * @return true when there is no type restriction or typeName is allowed */ - public boolean isAllowedFor(String typeName) { + public boolean isAllowedFor(Metadatum[] types) { if(typeBind.size() == 0) return true; - - return typeBind.contains(typeName); + + if(types != null) { + for (Metadatum md : types) { + String fieldName = md.getField(); + List allowedTypes = typeBind.get(fieldName); + if(allowedTypes != null && allowedTypes.contains(md.value)){ + return true; + } + } + } + + return false; } /** diff --git a/dspace-api/src/main/java/org/dspace/app/util/DCInputsReader.java b/dspace-api/src/main/java/org/dspace/app/util/DCInputsReader.java index d7d6339e794..89971c28de4 100644 --- a/dspace-api/src/main/java/org/dspace/app/util/DCInputsReader.java +++ b/dspace-api/src/main/java/org/dspace/app/util/DCInputsReader.java @@ -55,6 +55,7 @@ public class DCInputsReader static final String PAIR_TYPE_NAME = "value-pairs-name"; static final String COMPLEX_DEFINITION_REF = "complex-definition-ref"; + public static final String TYPE_BIND_FIELD_ATTRIBUTE = "field"; /** The fully qualified pathname of the form definition XML file */ private String defsFile = ConfigurationManager.getProperty("dspace.dir") @@ -495,7 +496,13 @@ private void processPageParts(String formName, String page, Node n, Map0) ) + Metadatum[] documentTypes = null; + if( (item.getMetadata(Item.ANY, "type", Item.ANY, Item.ANY) != null) && (item.getMetadata(Item.ANY, "type", + Item.ANY, Item.ANY).length > 0) ) { - documentType = item.getMetadataByMetadataString("dc.type")[0].value; + documentTypes = item.getMetadata(Item.ANY, "type", Item.ANY, Item.ANY); } // Step 1: @@ -208,7 +209,7 @@ public int doProcessing(Context context, HttpServletRequest request, for (int j = 0; j < inputs.length; j++) { // Omit fields not allowed for this document type - if(!inputs[j].isAllowedFor(documentType)) + if(!inputs[j].isAllowedFor(documentTypes)) { continue; } @@ -339,7 +340,7 @@ else if (buttonPressed.equals("submit_" + fieldName + "_delete")) { // Do not check the required attribute if it is not visible or not allowed for the document type String scope = subInfo.isInWorkflow() ? DCInput.WORKFLOW_SCOPE : DCInput.SUBMISSION_SCOPE; - if ( !( inputs[i].isVisible(scope) && inputs[i].isAllowedFor(documentType) ) ) + if ( !( inputs[i].isVisible(scope) && inputs[i].isAllowedFor(documentTypes) ) ) { continue; } diff --git a/dspace-oai/src/main/java/cz/cuni/mff/ufal/dspace/xoai/filter/ColComFilter.java b/dspace-oai/src/main/java/cz/cuni/mff/ufal/dspace/xoai/filter/ColComFilter.java new file mode 100644 index 00000000000..658b976fb60 --- /dev/null +++ b/dspace-oai/src/main/java/cz/cuni/mff/ufal/dspace/xoai/filter/ColComFilter.java @@ -0,0 +1,96 @@ +package cz.cuni.mff.ufal.dspace.xoai.filter; + +import com.lyncode.xoai.dataprovider.core.ReferenceSet; +import org.apache.log4j.LogManager; +import org.apache.log4j.Logger; +import org.apache.solr.client.solrj.util.ClientUtils; +import org.dspace.content.Collection; +import org.dspace.content.Community; +import org.dspace.content.DSpaceObject; +import org.dspace.core.Constants; +import org.dspace.core.Context; +import org.dspace.handle.HandleManager; +import org.dspace.xoai.data.DSpaceItem; +import org.dspace.xoai.filter.DSpaceFilter; +import org.dspace.xoai.filter.results.DatabaseFilterResult; +import org.dspace.xoai.filter.results.SolrFilterResult; + +import java.sql.SQLException; + +public class ColComFilter extends DSpaceFilter { + private static Logger log = LogManager.getLogger(ColComFilter.class); + + private DSpaceObject dso = null; + + @Override + public DatabaseFilterResult buildDatabaseQuery(Context context) { + throw new UnsupportedOperationException("Database query not implemented."); + } + + @Override + public SolrFilterResult buildSolrQuery() { + if (getDSpaceObject() != null) { + String setSpec = getSetSpec(); + if (dso.getType() == Constants.COLLECTION) { + return new SolrFilterResult("-item.collections:" + + ClientUtils.escapeQueryChars(setSpec)); + } else if (dso.getType() == Constants.COMMUNITY) { + return new SolrFilterResult("-item.communities:" + + ClientUtils.escapeQueryChars(setSpec)); + } + }; + return new SolrFilterResult("*:*"); + } + + @Override + public boolean isShown(DSpaceItem item) { + if(getDSpaceObject() != null) { + String setSpec = getSetSpec(); + for (ReferenceSet s : item.getSets()) { + if (s.getSetSpec().equals(setSpec)) { + return false; + } + } + } + return true; + } + + private String getSetSpec(){ + return "hdl_" + dso.getHandle().replace("/", "_"); + } + + private DSpaceObject getDSpaceObject(){ + if (dso == null) { + if(getConfiguration().get("handle") != null) { + String handle = getConfiguration().get("handle").asSimpleType().asString(); + try { + dso = HandleManager.resolveToObject(context, handle); + } catch (SQLException e) { + log.error(e); + } + }else if(getConfiguration().get("name") != null){ + String name = getConfiguration().get("name").asSimpleType().asString(); + try { + for(Community c : Community.findAll(context)){ + if(name.equals(c.getName())){ + dso = c; + break; + } + } + if(dso == null){ + for(Collection c : Collection.findAll(context)){ + if(name.equals(c.getName())){ + dso = c; + break; + } + } + } + } catch (SQLException e) { + log.error(e); + } + + } + } + return dso; + } +} diff --git a/dspace-xmlui/src/main/java/cz/cuni/mff/ufal/dspace/app/xmlui/aspect/submission/submit/SelectCollectionStep.java b/dspace-xmlui/src/main/java/cz/cuni/mff/ufal/dspace/app/xmlui/aspect/submission/submit/SelectCollectionStep.java index 8a857de9fe2..33fe04a1a56 100644 --- a/dspace-xmlui/src/main/java/cz/cuni/mff/ufal/dspace/app/xmlui/aspect/submission/submit/SelectCollectionStep.java +++ b/dspace-xmlui/src/main/java/cz/cuni/mff/ufal/dspace/app/xmlui/aspect/submission/submit/SelectCollectionStep.java @@ -32,6 +32,8 @@ import org.dspace.content.DSpaceObject; import org.dspace.core.Constants; import org.dspace.handle.HandleManager; +import org.dspace.services.ConfigurationService; +import org.dspace.utils.DSpace; import org.json.simple.JSONArray; import org.json.simple.JSONObject; import org.xml.sax.SAXException; @@ -74,6 +76,8 @@ public class SelectCollectionStep extends AbstractSubmissionStep protected static final Message T_submit_next = message("xmlui.Submission.general.submission.next"); + private final ConfigurationService configurationService = new DSpace().getConfigurationService(); + private class CommunityComparator implements Comparator { @Override @@ -296,6 +300,8 @@ private JSONObject createJSONModel( modelJo.put("communities", communitiesJa); + modelJo.put("GUI2", configurationService.getPropertyAsType("lr.SelectCollectionStep.TopLevelOnly", false)); + return modelJo; } @@ -312,12 +318,17 @@ private Map> createCommunitiesMap( Collection[] collections) throws SQLException { Map> model = new HashMap>(); + boolean onlyTopLevel = configurationService.getPropertyAsType("lr.SelectCollectionStep.TopLevelOnly", false); for (Collection collection : collections) { Community[] communities = collection.getCommunities(); for (Community community : communities) { + if(onlyTopLevel && community.getParentCommunity() != null){ + continue; + } + if (model.containsKey(community)) { java.util.List communityCollections = (java.util.List) model diff --git a/dspace-xmlui/src/main/java/cz/cuni/mff/ufal/dspace/app/xmlui/aspect/submission/submit/UFALExtraMetadataStep.java b/dspace-xmlui/src/main/java/cz/cuni/mff/ufal/dspace/app/xmlui/aspect/submission/submit/UFALExtraMetadataStep.java index cc64cdb32d4..7abc3c77f8e 100644 --- a/dspace-xmlui/src/main/java/cz/cuni/mff/ufal/dspace/app/xmlui/aspect/submission/submit/UFALExtraMetadataStep.java +++ b/dspace-xmlui/src/main/java/cz/cuni/mff/ufal/dspace/app/xmlui/aspect/submission/submit/UFALExtraMetadataStep.java @@ -98,10 +98,7 @@ public void addBody(Body body) throws SAXException, WingException, String last_repeatable_component = null; // Fetch the document type (dc.type) - String documentType = ""; - if( (item.getMetadataByMetadataString("dc.type") != null) && (item.getMetadataByMetadataString("dc.type").length >0) ) { - documentType = item.getMetadataByMetadataString("dc.type")[0].value; - } + Metadatum[] documentTypes = item.getMetadata(Item.ANY, "type", Item.ANY, Item.ANY); String scope = submissionInfo.isInWorkflow() ? DCInput.WORKFLOW_SCOPE : DCInput.SUBMISSION_SCOPE; @@ -126,7 +123,7 @@ public void addBody(Body body) throws SAXException, WingException, } } - if ( !isInputDisplayable(context, dcInput, scope, documentType ) ) + if ( !isInputDisplayable(context, dcInput, scope, documentTypes ) ) { continue; } @@ -431,18 +428,14 @@ public List addReviewSection(List reviewList) throws SAXException, // Fetch the document type (dc.type) Item item = submission.getItem(); - String documentType = ""; - if( (item.getMetadataByMetadataString("dc.type") != null) && (item.getMetadataByMetadataString("dc.type").length >0) ) - { - documentType = item.getMetadataByMetadataString("dc.type")[0].value; - } - + Metadatum[] documentTypes = item.getMetadata(Item.ANY, "type", Item.ANY, Item.ANY); + for (DCInput input : inputs) { // If the input is invisible in this scope, then skip it. String scope = submissionInfo.isInWorkflow() ? DCInput.WORKFLOW_SCOPE : DCInput.SUBMISSION_SCOPE; - if(!isInputDisplayable(context, input, scope, documentType)) { + if(!isInputDisplayable(context, input, scope, documentTypes)) { continue; } diff --git a/dspace-xmlui/src/main/java/org/dspace/app/xmlui/aspect/submission/submit/DescribeStep.java b/dspace-xmlui/src/main/java/org/dspace/app/xmlui/aspect/submission/submit/DescribeStep.java index 024cc4950bb..c27ed321237 100644 --- a/dspace-xmlui/src/main/java/org/dspace/app/xmlui/aspect/submission/submit/DescribeStep.java +++ b/dspace-xmlui/src/main/java/org/dspace/app/xmlui/aspect/submission/submit/DescribeStep.java @@ -248,12 +248,8 @@ public void addBody(Body body) throws SAXException, WingException, form.addItem("english-only-info", "alert alert-info").addContent(T_english_only); // Fetch the document type (dc.type) - String documentType = ""; - if( (item.getMetadataByMetadataString("dc.type") != null) && (item.getMetadataByMetadataString("dc.type").length >0) ) - { - documentType = item.getMetadataByMetadataString("dc.type")[0].value; - } - + Metadatum[] documentTypes = item.getMetadata(Item.ANY, "type", Item.ANY, Item.ANY); + // Iterate over all inputs and add it to the form. for(DCInput dcInput : inputs) { @@ -261,7 +257,7 @@ public void addBody(Body body) throws SAXException, WingException, boolean readonly = dcInput.isReadOnly(scope); // Omit fields not allowed for this document type - if(!dcInput.isAllowedFor(documentType)) + if(!dcInput.isAllowedFor(documentTypes)) { continue; } @@ -429,12 +425,8 @@ public List addReviewSection(List reviewList) throws SAXException, // Fetch the document type (dc.type) Item item = submission.getItem(); - String documentType = ""; - if( (item.getMetadataByMetadataString("dc.type") != null) && (item.getMetadataByMetadataString("dc.type").length >0) ) - { - documentType = item.getMetadataByMetadataString("dc.type")[0].value; - } - + Metadatum[] documentTypes = item.getMetadata(Item.ANY, "type", Item.ANY, Item.ANY); + for (DCInput input : inputs) { @@ -444,7 +436,7 @@ public List addReviewSection(List reviewList) throws SAXException, { continue; } - if(!input.isAllowedFor(documentType)) + if(!input.isAllowedFor(documentTypes)) { continue; } @@ -1616,10 +1608,10 @@ protected void addJumpToInput(Division div) throws WingException /** * should we render the metadata field based on field description? */ - protected boolean isInputDisplayable(Context c, DCInput dcInput, String scope, String documentType) + protected boolean isInputDisplayable(Context c, DCInput dcInput, String scope, Metadatum[] documentTypes) { // Omit fields not allowed for this document type - if(!dcInput.isAllowedFor(documentType)) { + if(!dcInput.isAllowedFor(documentTypes)) { return false; } diff --git a/dspace-xmlui/src/main/webapp/i18n/messages.xml b/dspace-xmlui/src/main/webapp/i18n/messages.xml index bf33a490aaa..73540a08278 100644 --- a/dspace-xmlui/src/main/webapp/i18n/messages.xml +++ b/dspace-xmlui/src/main/webapp/i18n/messages.xml @@ -3235,6 +3235,42 @@ Link to original paper that references this dataset. The supplied url must start with http/https + Select the kind of resource you are submitting + Choose one of TEXT, VIDEO, SOUND, IMAGE, 3D. If choosing + TEXT consider adding the resource among other Language Resources. + Please select one of the options. + TEXT + VIDEO + SOUND + IMAGE + 3D + + The type of the resource + The type should be different from what you have + entered in the first step. Examples: photo or painting for IMAGE, book or letter for TEXT, etc. + Type is required + + Pick the languages of the TEXT + Select the language of the main content of the item. Multiple languages are possible. Start + typing the language and use autocomplete form that will appear if applicable. Better to list all the languages then to use the 'mul' iso code (if there are too many, contact support). + + The language is required for TEXT resources + + Language + Optionally, select the language of the main content + of the item. Multiple languages are possible. Start + typing the language and use autocomplete form that will appear if applicable. Better to list all the languages then to use the 'mul' iso code (if there are too many, contact support). + + + Spatial coverage + Optionally, describe places and locations the + resource is about. + + Temporal coverage + Optionally, describe dates or periods the resources is + about. + + Distribution License Agreement Distribution License Agreement diff --git a/dspace-xmlui/src/main/webapp/themes/UFAL/lib/js/ufal-select-collection.js b/dspace-xmlui/src/main/webapp/themes/UFAL/lib/js/ufal-select-collection.js index 6c0237b1bc0..6822a12fa6a 100644 --- a/dspace-xmlui/src/main/webapp/themes/UFAL/lib/js/ufal-select-collection.js +++ b/dspace-xmlui/src/main/webapp/themes/UFAL/lib/js/ufal-select-collection.js @@ -16,6 +16,24 @@ ufal.selectCollection = { getSelectCommunityCommunitiesListDiv : function() { return $('#cz_cuni_mff_ufal_dspace_app_xmlui_aspect_submission_submit_SelectCollectionStep_div_communities-list'); }, + + div_communities: function(html) { + return ufal.selectCollection.getSelectCommunityCommunitiesListDiv().html(html); + }, + + getCollectionsListDiv : function(){ + return $("#collection_list"); + }, + + div_collections: function(html){ + var where = ufal.selectCollection.getCollectionsListDiv(); + if(where.length){ + return where.html(html); + }else { + return ufal.selectCollection.getSelectCommunityCommunitiesListDiv().after('
' + html + ''); + } + }, getSelectCommunityCommunitiesListLinks : function() { return $('#cz_cuni_mff_ufal_dspace_app_xmlui_aspect_submission_submit_SelectCollectionStep_div_communities-list a'); @@ -37,27 +55,28 @@ ufal.selectCollection = { return $('#cz_cuni_mff_ufal_dspace_app_xmlui_aspect_submission_submit_SelectCollectionStep_field_communities-model'); }, - createCommunitiesGUI : function(model) { + createGUI : function(model, key) { var html = ''; html += '
'; - html += '
'; - for ( var i in model.communities) { + html += ''; - ufal.selectCollection.getSelectCommunityCommunitiesListDiv().html(html); + var appendTo = ufal.selectCollection['div_' + key](html); }, + createCommunitiesGUI : function(model) { + ufal.selectCollection.createGUI(model, 'communities'); + }, + getCommunitiesModel : function() { var model = {}; var modelJSON = ufal.selectCollection.getCommunitiesModelInput().val(); @@ -89,7 +112,7 @@ ufal.selectCollection = { select.append(''); } - break; + return community; } } }, @@ -111,10 +134,38 @@ ufal.selectCollection = { else { ufal.selectCollection.getSelectCollectionSubmitButton().removeAttr('disabled'); } + $('html, body').delay(100).animate({ + scrollTop: ufal.selectCollection.getSelectCollectionDiv().offset().top + }, 200); }, - - showNextButtonOnly : function() { - ufal.selectCollection.getSelectCollectionDiv().hide(); + + showCollectionsGUI2 : function(community, collectionSelect) { + ufal.selectCollection.createGUI(community, 'collections'); + ufal.selectCollection.getCollectionsListDiv().find("a").on('click', function(){ + ufal.selectCollection.getCollectionsListDiv().find(".alert-info").each(function(){ + $(this).removeClass('alert-info'); + }); + var $this = $(this); + $this.toggleClass('alert-info'); + var name = $this.attr('id'); + var collectionID = name.replace(/^.*_(\d+)/, '$1'); + var handle; + for (var i in community.collections){ + var collection = community.collections[i]; + if(collection.id == collectionID){ + handle = collection.handle; + break; + } + } + if(handle) { + collectionSelect.find('option[value="' + handle + '"]').prop('selected', true); + ufal.selectCollection.getSelectCollectionSubmitButton().removeAttr('disabled'); + } + }); + }, + + showNextButtonOnly : function() { + ufal.selectCollection.getSelectCollectionDiv().hide(); ufal.selectCollection.getSelectCollectionSubmitButton().removeAttr('disabled'); }, @@ -123,17 +174,18 @@ ufal.selectCollection = { $(this).toggleClass('alert-info'); var name = $(this).attr('id'); var communityID = name.replace(/^.*_(\d+)/, '$1'); - ufal.selectCollection.populateCollections(communityID, ufal.selectCollection.model); + var community = ufal.selectCollection.populateCollections(communityID, ufal.selectCollection.model); var collectionSelect = ufal.selectCollection.getSelectCollectionSelect(); if(collectionSelect.find('option').length == 2) { collectionSelect.find('option:eq(1)').prop('selected', true); ufal.selectCollection.showNextButtonOnly(); } else { - ufal.selectCollection.showCollectionsGUI(); - $('html, body').delay(100).animate({ - scrollTop: ufal.selectCollection.getSelectCollectionDiv().offset().top - }, 200); + if(ufal.selectCollection.model.GUI2){ + ufal.selectCollection.showCollectionsGUI2(community, collectionSelect) + }else{ + ufal.selectCollection.showCollectionsGUI(); + } } return false; }, diff --git a/dspace-xmlui/src/main/webapp/themes/UFAL/lib/xsl/aspect/artifactbrowser/item-view.xsl b/dspace-xmlui/src/main/webapp/themes/UFAL/lib/xsl/aspect/artifactbrowser/item-view.xsl index ffa6db1c68d..34611ecf2f6 100644 --- a/dspace-xmlui/src/main/webapp/themes/UFAL/lib/xsl/aspect/artifactbrowser/item-view.xsl +++ b/dspace-xmlui/src/main/webapp/themes/UFAL/lib/xsl/aspect/artifactbrowser/item-view.xsl @@ -381,17 +381,27 @@ + test="$clause = 9 and ((dim:field[@element='type' and not(@qualifier)]) or (dim:field[@qualifier='mediaType']))">
  xmlui.dri2xhtml.METS-1.0.item-type
- - /browse?value=&type=type - - + + + + + + + + + + , + +
diff --git a/dspace-xmlui/src/main/webapp/themes/UFAL/lib/xsl/core/forms.xsl b/dspace-xmlui/src/main/webapp/themes/UFAL/lib/xsl/core/forms.xsl index fbec93f6b4d..3559763a7f3 100644 --- a/dspace-xmlui/src/main/webapp/themes/UFAL/lib/xsl/core/forms.xsl +++ b/dspace-xmlui/src/main/webapp/themes/UFAL/lib/xsl/core/forms.xsl @@ -1215,7 +1215,9 @@ - +
diff --git a/dspace/config/crosswalks/oai/xoai.xml b/dspace/config/crosswalks/oai/xoai.xml index 37f99e5153e..6bc473f2e8e 100644 --- a/dspace/config/crosswalks/oai/xoai.xml +++ b/dspace/config/crosswalks/oai/xoai.xml @@ -138,6 +138,7 @@ metadataFormats/lindat_cmdi.xsl http://www.clarin.eu/cmd/ http://catalog.clarin.eu/ds/ComponentRegistry/rest/registry/profiles/clarin.eu:cr1:p_1349361150622/xsd + olac @@ -183,6 +184,11 @@ + + + + + + @@ -359,6 +361,270 @@ + +
+ + + + + + edm + type + + false + + dropdown + input_forms.field.edm.type.hint + input_forms.field.edm.type.required + + + + dc + title + + false + + onebox + input_forms.field.dc.title.hint + input_forms.field.dc.title.required + + + + local + demo + uri + false + + onebox + input_forms.field.local.demo.uri.hint + + http.* + input_forms.field.local.demo.uri.regexp-warning + + + + dc + relation + isreferencedby + true + + onebox + input_forms.field.dc.relation.isreferencedby.hint + + http.* + input_forms.field.dc.relation.isreferencedby.regexp-warning + + + + dc + date + issued + false + + FormattedDate + input_forms.field.dc.date.issued.hint + input_forms.field.dc.date.issued.required + with-datepicker + + + + local + hidden + + false + + list + input_forms.field.local.hidden.hint + + + policy=deny,action=read,grantee-type=user,grantee-id=* + + + + + local + hasMetadata + + false + + list + + input_forms.field.local.hasMetadata.hint + + + policy=deny,action=read,grantee-type=user,grantee-id=* + + + + + + + + + + + + + dc + contributor + author + true + + name + input_forms.field.dc.contributor.author.hint + solr-author_ac-specific + input_forms.field.dc.contributor.author.required + + + + dc + publisher + + true + + onebox + input_forms.field.dc.publisher.hint + solr-publisher_ac + input_forms.field.dc.publisher.required + + + + local + contact + person + true + + complex + input_forms.field.local.contact.person.hint + input_forms.field.local.contact.person.required + + + + + local + sponsor + true + + complex + input_forms.field.local.sponsor.hint + + + + + + + + dc + type + + false + + onebox + input_forms.field.dc.type.clariah.hint + solr-dctype_ac + input_forms.field.dc.type.clariah.required + no-thumbs + + + + dc + description + + false + + textarea + input_forms.field.dc.description.hint + input_forms.field.dc.description.required + + + + + dc + language + iso + true + + TEXT + onebox + input_forms.field.dc.language.iso.clariah.hint + json_static-iso_langs.json + input_forms.field.dc.language.iso.clariah.required + + + + dc + language + iso + true + + VIDEO,IMAGE,SOUND,3D + onebox + input_forms.field.dc.language.iso1.clariah.hint + json_static-iso_langs.json + + + + + dc + subject + + + true + true + + twobox + input_forms.field.dc.subject.hint + solr-subject_ac + input_forms.field.dc.subject.required + + + + dc + coverage + spatial + + true + true + + twobox + input_forms.field.dc.coverage.spatial.hint + + + + dc + coverage + temporal + + true + true + + twobox + input_forms.field.dc.coverage.temporal.hint + + + + local + size + info + true + + complex + input_forms.field.local.size.info.hint + + + + +
@@ -439,6 +705,72 @@ + +
+ + + local + submission + note + false + + textarea + input_forms.field.local.submission.note.hint + + + + + + dc + relation + replaces + true + + onebox + input_forms.field.dc.relation.replaces.hint + solr-handle_title_ac + + + Special fields + + + + + dc + relation + isreplacedby + true + + onebox + input_forms.field.dc.relation.isreplacedby.hint + solr-handle_title_ac + + + + policy=deny,action=read,grantee-type=user,grantee-id=* + + + + + + local + embargo + termslift + false + + onebox + input_forms.field.local.embargo.termslift.hint + + \d\d\d\d-\d\d-\d\d + input_forms.field.local.embargo.termslift.regexp-warning + + + policy=deny,action=read,grantee-type=user,grantee-id=* + + + + +
@@ -508,6 +840,28 @@ --> + + + input_forms.value_pairs.edm_types.text + TEXT + + + input_forms.value_pairs.edm_types.video + VIDEO + + + input_forms.value_pairs.edm_types.sound + SOUND + + + input_forms.value_pairs.edm_types.image + IMAGE + + + input_forms.value_pairs.edm_types.3d + 3D + + @@ -462,6 +463,7 @@ + @@ -516,6 +518,8 @@ dc.type + edm.type + metashare.ResourceInfo#ContentInfo.mediaType @@ -602,12 +606,25 @@ dc.type + edm.type + metashare.ResourceInfo#ContentInfo.mediaType - + + + + + + dc.type + + + + + + diff --git a/dspace/modules/xmlui/src/main/webapp/i18n/messages_cs.xml b/dspace/modules/xmlui/src/main/webapp/i18n/messages_cs.xml index 265bc169630..5a4dcc03042 100644 --- a/dspace/modules/xmlui/src/main/webapp/i18n/messages_cs.xml +++ b/dspace/modules/xmlui/src/main/webapp/i18n/messages_cs.xml @@ -3498,6 +3498,35 @@ Odkaz na původní článek, který zmiňuje tento záznam. URL musi začínat http/https + Zvolte druh záznamu + Vyberte z TEXT, VIDEO, ZVUK, OBRAZ, 3D. Pokud zvolíte TEXT, + zvažte, jestli se nejedná o Language Resource (Jazykový zdroj). + Zvolte prosím jednu z možností + TEXT + VIDEO + ZVUK + OBRAZ + 3D + + Typ záznamu + Typ by měl být odlišný od druhu, který jste zvolili v + prvním kroku. Například: fotografie nebo malba pro druh OBRAZ, kniha nebo dopis pro typ TEXT apod. + Vyplňte typ + + Vyberte jazyky TEXTu + Vyberte jazyky, jichž se data tohoto záznamu týkají. Je možné zvolit více jazyků. Začnete-li psát, objeví se nápověda. Je lepší vyjmenovat všechny dotčené jazyky (pokud jich je větší množství, kontaktujte podporu), než používat iso kód 'mul'. + Pro TEXTy je jazyk povinný + + Jazyk + Volitelné. Vyberte jazyky, jichž se data tohoto záznamu týkají. Je možné zvolit více jazyků. Začnete-li psát, objeví se nápověda. Je lepší vyjmenovat všechny dotčené jazyky (pokud jich je větší množství, kontaktujte podporu), než používat iso kód 'mul'. + + Místa + Volitelné. Uveďte místa, o kterých zdroj je. + + Období + Volitelné. Uveďte data, období, epochy apod., o + kterých zdroj je. + Smlouva o distribuci dat Smlouva o distribuci dat