Saturday, 19 December 2015

Dspace Installation in Ubuntu Linux

Dspace Installation in Ubuntu 12.04.4 64 bit amd

Pre-request source

1.JAVA: jdk-6u35-linux-x64 download
2.ANT: apache-ant download
3.MAVEN: apache-maven download
4.TOMCAT: apache-tomcat download
5.DSPACE: dspace-x.x-src-release download

I prefer /opt(exist in root if opt directory not exist then please create it) for install all require software
like java,ant,maven and tomcat.

Install JAVA
1.Copy Java source to /opt
terminal>sudo cp jdk-6u35-linux-x64.bin /opt/
2.goto /opt
terminal> cd /opt
3.change the permission of jdk-6u35-linux-x64.bin into /opt for execute it.
opt > sudo chmod 755 jdk-6u35-linux-x64.bin
4.execute it
opt > sudo ./jdk-6u35-linux-x64.bin
        this is create folder into /opt/jdk1.6.0_35

5.Set JAVA_HOME and JRE_HOME path into /etc/profile carefully.
terminal> sudo vi /etc/profile
-add path end of profile file
export JAVA_HOME="/opt/jdk1.6.0_35"
export JRE_HOME="/opt/jdk1.6.0_35/jre"
export PATH="$PATH:$JAVA_HOME/bin:$JRE_HOME/bin"
terminal>source /etc/profile


Intsall Apache Ant
1.Copy Apache-Ant to /opt
terminal>sudo cp -rf apache-ant-1.9.3 /opt/

2.Set ANT_HOME path into /etc/profile carefully.
terminal> sudo vi /etc/profile
-add path end of profile file
export JAVA_HOME="/opt/jdk1.6.0_35"
export JRE_HOME="/opt/jdk1.6.0_35/jre"
export ANT_HOME="/opt/apache-ant-1.9.3"
export PATH="$PATH:$JAVA_HOME/bin:$JRE_HOME/bin:$ANT_HOME/bin"
terminal>source /etc/profile

Install Apache Maven
1.Copy Apache-Maven to /opt
terminal>sudo cp -rf apache-maven-2.2.1  /opt/

2.Set MAVEN_HOME path into /etc/profile carefully.
terminal> sudo vi /etc/profile
-add path end of profile file
export JAVA_HOME="/opt/jdk1.6.0_35"
export JRE_HOME="/opt/jdk1.6.0_35/jre"
export ANT_HOME="/opt/apache-ant-1.9.3"
export M2_HOME="/opt/apache-maven-2.2.1"
export                  PATH="$PATH:$JAVA_HOME/bin:$JRE_HOME/bin:$ANT_HOME/bin:$M2_HOME/bin"

terminal>source /etc/profile

Complete JAVA, ANT and MAVEN intallation...
After set PATH need to restart computer for set path on OS level.

Intsall Posrgresql database(helpfull link : https://help.ubuntu.com/community/PostgreSQL)
1.install package
terminal> sudo apt-get install postgresql
after installation complete
run following commands
terminal> sudo -u postgres psql postgres
terminal> \password postgres
terminal> Enter new password for postgres user
terminal>Ctrl+Z for out postgres prompt
Install PgAdmin-client for postgres database
terminal> sudo apt-get install pgadmin3

now you are access postgres database from pgAdmin client of postgres

Install Dspace
1.Go into Dspace source directory
terminal>cd WorkData/Dspace/DspaceSource/dspace-4.1-src-release/
terminal>mvn clean install
after getting Build succesfull message
you need to create dspace directory into /
terminal>sudo mkdir /dspace
terminal>sudo chmod 777 /dspace
create database for dspace using pgAdmin
you need to create database name with dspace
and also create user with dspace name and also password dspace
allow rights to dspace user to dspace database
       
          OR Using terminal create database and user in postgres.
          terminal>createuser -U postgres -d -A -P dspace
          terminal>createdb -U dspace -E UNICODE dspace
          terminal>createuser -U postgres -d -A -P dspace ; createdb -U dspace -E UNICODE dspace
          
        after create dspace database you need to deploy project using ant
terminal>cd dspace/target/dspace-4.1-build/
terminal> ant fresh_install 

We need ApplicationServer Apache-Tomcat
Install tomcat
1.copy the extracted source of tomcat into /opt
terminal>sudo cp -rf apache-tomcat-6.0.37 /opt/
we need to set JAVA_HOME and JRE_HOME into tomcat
terminal>sudo vi /opt/apache-tomcat-6.0.37/bin/catalina.sh 
add this to line into file
JAVA_HOME="/opt/jdk1.6.0_35"
JRE_HOME="/opt/jdk1.6.0_35/jre"

For deploy dspace into tomcat just you need to copy module to tomcat/webapps directory
terminal>sudo cp -rf /dspace/webapps/* /opt/apache-tomcat-6.0.37/webapps/


Start Tomcat

terminal> sudo sh /opt/apache-tomcat-6.0.37/bin/startup.sh

for more detail read dspace manual here

Tuesday, 15 December 2015

Dspace Metadata Customization


Dspace Metadata Customization

Dspace 5.1

  

  •    Available metadata.




  •    For add own metadata login with admin account.
  •    Go to Administer > General Setting > Metadata Registry for add new metadata
  •    Here i add new metadata for "No of pages".
  •    Here you can see list of other metadata schema provide by dspace.



  • Add new metadata schema.

  • Now newly added metadata schema see in list. click on it.


  • Here i add new metadata for "No of pages" into newly added schema.


  • Please see note list of metadata after add  "Note: Adding a new field to the registry does not add a corresponding input field to the the submit forms!".


  • Still "No of pages" metadata field not display on submit form.

  • Open file "dspace/config/input-forms.xml" files.
  • This file is responsible for display filed into input forms dspace. 


  • Here i have write code for add filed for "No of pages".
     <field>
         <dc-schema>uni</dc-schema> <!-- Write schema name added by me above-->
         <dc-element>number</dc-element> <!-- Write element name added by me above--> 
         <dc-qualifier>totalPage</dc-qualifier> <!-- Write qualifier name added by me above-->
         <repeatable>false</repeatable> <!-- Allow metadata have multiple one& more filed-->
         <label>No of pages</label>  <!-- Display label of input filed.-->
         <input-type>onebox</input-type> <!-- Input control for filed-->
         <hint>No of pages in document.</hint> <!-- Hint display on input page.-->
         <required>You must enter total no of pages in document.</required><!-- Require validation message. -->
     </field>





  • Now you need to restart you server.
  • After restart server you are able to view "No of pages" filed into input form.



  • Add new book with "No of pages" filed value is 200.


  • Add new metadata field in "No of pages" into browse item by.



  • Please open file dspace/config/dspace.cfg file
  • This file is most important file this file have all basic configuration.
  • get backup before changes.



  • Search content in file like "webui.browse.index.1" or go to line no 1139.

  • Add new line for "No of pages" filed.
     webui.browse.index.5 = totalPage:metadata:dc.number.*:text




  • Now newly added filed display in Browse menu.


  • For add display label for "browse.menu.totalPage"  you need source of Messages.properties file. source
    • Open file "dspace-5.1-src-release/dspace-api/src/main/resources/Messages.properties".
    • Add properties for "browse.menu.totalPage" E.g browse.menu.totalPage=No of Pages
    • Now copy updated Messages.properties files into "tomcat/webapps/jspui/WEB_INF/classes"
    • Restart tomcat server.




  • Now newly added label display in Browse menu.



  • Now we need do changes related to add metadata into browse and search index.
  • Open file "dspace/config/dspace.cfg". Remove comment from mark line below image.
  • Now  add filed into search index. search content "search.index."
        search.index.13 = totalPage:uni.number.* < add this line for search index.

  • Now we need to run few command for update into database.
  • open terminal or cmd (window).
  • run following command.
  • cd /dspace/bin
  • ./dspace index-lucene-init
  • ./dspace index-lucene-update
  • ./dspace index-db-browse -fi
  • then restart tomcat server.


  • For this type of value we need to perform same step to add properties into "Messages.properties" file.

Fore more information read this document.