Readme.md 6.78 KB

How to install the Add-on

The detailed instructions can be found in the docs folder.

Adding the new entries in the Messages.properties and in Messages_pt_PT.properties

Edit $DSPACE_SRC/dspace/dspace-api/src/main/resources/Messages.properties and add:

browse.type.metadata.type = Document Type
browse.menu.type = Document Type

Edit $DSPACE_SRC/dspace/dspace-api/src/main/resources/Messages.properties and add:

browse.type.metadata.type = Tipo de Documento
browse.menu.type = Tipo de Documento

Change dspace.cfg

nano $DSPACE_SRC/dspace/config/dspace.cfg

Add the following line after #webui.browse.index.5 = dateaccessioned:item:dateaccessioned

webui.browse.index.5 = type:metadata:dc.type:text

Note: If there is already defined index.5, add the next value number (in this case inedx.6)

Change file discovery.xml

Edit $DSPACE_SRC/dspace/config/spring/api/discovery.xml

In the <property name="sidebarFacets"> add:

<ref bean="searchFilterType" />

In the <property name="searchFilters"> add:

<ref bean="searchFilterType" />

After <value>dc.subject</value> add:

<value>dc.type</value>

Before <!--Sort Properties--> add:

<bean id="searchFilterType" class="org.dspace.discovery.configuration.DiscoverySearchFilterFacet">
    <property name="indexFieldName" value="type"/>
    <property name="metadataFields">
        <list>
            <value>dc.type</value>
        </list>
    </property>
    <property name="facetLimit" value="10"/>
    <property name="sortOrder" value="VALUE"/>
</bean>

Before </beans> add:

<bean id="sortType" class="org.dspace.discovery.configuration.DiscoverySortFieldConfiguration">
    <property name="metadataField" value="dc.type"/>
</bean>

If you want to translate the document type values, change the following files:

NOTE Never use the translated values as metadata

Edit $DSPACE_SRC/dspace/dspace-api/src/main/resources/Messages.properties and add:

document.type.annotation = Annotation
document.type.article = Article
document.type.bachelorThesis = Bachelor Thesis 
document.type.book = Book
document.type.bookPart = Book Part 
document.type.conferenceObject = Conference Object
document.type.doctoralThesis  = Doctoral Thesis
document.type.lecture = Lecture
document.type.masterThesis = Master Thesis
document.type.other = Other
document.type.report = Report
document.type.workingPaper = Working Paper
document.type.review = Review
document.type.preprint = Preprint
document.type.contributionToPeriodical = Contributionto Periodic
document.type.patent = Patent

Edit $DSPACE_SRC/dspace/dspace-api/src/main/resources/Messages_pt_PT.properties and add:

document.type.annotation = Anota&ccedil&atilde;o
document.type.article = Artigo
document.type.bachelorThesis = Disserta&ccedil&atilde;o de Licenciatura 
document.type.book = Livro 
document.type.bookPart = Parte ou cap&iacute;tulo de livro 
document.type.conferenceObject = Documento de Confer&ecirc;ncia 
document.type.doctoralThesis  = Disserta&ccedil&atilde;o de Doutoramento
document.type.lecture = Palestra
document.type.masterThesis = Disserta&ccedil&atilde;o de Mestrado
document.type.other = Outro
document.type.report = Relat&oacute;rio
document.type.workingPaper = Working Paper
document.type.review = Recens&atilde;o
document.type.preprint = Preprint
document.type.contributionToPeriodical = Texto de Peri&oacute;dico
document.type.patent = Patente

Change the single.jsp and full.jsp

Edit $DSPACE_SRC/dspace/dspace-jspui/src/main/webapp/browse/single.jsp Add to the imports

<%@ taglib prefix="c" uri="http://java.sun.com/jsp/jstl/core" %>

After type = bix.getName(); add:

%>
<c:set var="typea" scope="page" value="<%= type %>"/>
<%

After <li class="list-group-item"> and before <%= StringUtils.isNotBlank(results[i][2])?"... replace by:

            <c:choose>
            <c:when test="${typea == 'type'}" >
            <a href="<%= sharedLink %>
            <% if (results[i][1] != null) { %>&amp;authority=<%= URLEncoder.encode(results[i][1], "UTF-8") %>" class="authority <%= bix.getName() %>"><%= Utils.addEntities(results[i][0]) %></a> <% } 
            else { %>&amp;value=<%= URLEncoder.encode(results[i][0], "UTF-8") %>"><% String typemessage = "document.type." + results[i][0]; %> <fmt:message key='<%= Utils.addEntities(typemessage) %>' /> </a> <% } %>
            </c:when>
            <c:otherwise> 
            <a href="<%= sharedLink %><% if (results[i][1] != null) { %>&amp;authority=<%= URLEncoder.encode(results[i][1], "UTF-8") %>" class="authority <%= bix.getName() %>"><%= Utils.addEntities(results[i][0]) %></a> <% } else { %>&amp;value=<%= URLEncoder.encode(results[i][0], "UTF-8") %>"><%= Utils.addEntities(results[i][0]) %></a> <% } %>
         </c:otherwise>
    </c:choose>
    <!--<a href="<%= sharedLink %><% if (results[i][1] != null) { %>&amp;authority=<%= URLEncoder.encode(results[i][1], "UTF-8") %>" class="authority <%= bix.getName() %>"><%= Utils.addEntities(results[i][0]) %></a> <% } else { %>&amp;value=<%= URLEncoder.encode(results[i][0], "UTF-8") %>"><%= Utils.addEntities(results[i][0]) %></a> <% } %>
    -->         

Edit $DSPACE_SRC/dspace/dspace-jspui/src/main/webapp/browse/full.jsp

<%@ page import="org.dspace.core.Utils" %>
<%@ taglib prefix="c" uri="http://java.sun.com/jsp/jstl/core" %>

After type = bix.getName(); add:

%>
<c:set var="typea" scope="page" value="<%= type %>"/>
<%

Repalce the entries between <%-- Build the header (careful use of spacing) --%> <h2> AND </h2>

<%-- Build the header (careful use of spacing) --%> 
    <c:choose>
    <c:when test="${typea == 'type'}" ><%
        String typemessage = "document.type." + value; %>
        <fmt:message key="browse.full.header"><fmt:param value="<%= scope %>"/></fmt:message> <fmt:message key="<%= typeKey %>"/>: <fmt:message key="<%= Utils.addEntities(typemessage) %>"/>
     </c:when>
     <c:otherwise>
        <fmt:message key="browse.full.header"><fmt:param value="<%= scope %>"/></fmt:message> <fmt:message key="<%= typeKey %>"/> <%= value %>
     </c:otherwise>
    </c:choose>

Build DSpace

Proceed according to DSpace Documentation to build and update your DSpace installation.

Run Scripts

Stop tomcat and run the following scripts:

/dspace/bin/dspace index-discovery -f

Restart tomcat

Developers

The Sharing Bar Add-on was developed in the context of RCAAP ProjectRCAAP by KEEP SOLUTIONS, a spin-off of the University of Minho, specialized in digital preservation and advanced solutions for digital archives and libraries, in partnership with the Documentation Services of the University of Minho.

Need help, or give any type of contribution?

Please contact us at FCT|FCCN or any commiter.

License

Please contact us at FCT|FCCN.