Difference between revisions of "SUNScholar/Media Filters/4.X"

From Libopedia
Jump to navigation Jump to search
Line 52: Line 52:
 
==Step 4 - Configuration==
 
==Step 4 - Configuration==
 
===Step 4A===
 
===Step 4A===
First, be sure there is a value for thumbnail.maxwidth and that it corresponds to the size you want for preview images for the UI.
+
First, be sure there is a value for ''thumbnail.maxwidth'' and that it corresponds to the size you want for preview images for the UI.
  
Edit the "dspace.cfg" file.
+
Edit the ''"dspace.cfg"'' file.
 
  nano /home/dspace/source/config/dspace.cfg
 
  nano /home/dspace/source/config/dspace.cfg
 
Search for the following and modify.
 
Search for the following and modify.

Revision as of 13:41, 22 December 2014

Back to Media Filters

Requirements

Check the following and then return.

http://wiki.lib.sun.ac.za/index.php/SUNScholar/Install_DSpace/S03#Step_3.2

Step 1 - Login to the server

http://wiki.lib.sun.ac.za/index.php/SUNScholar/Prepare_Ubuntu/S01

Step 2 - Install the Ubuntu software packages

Type the following:

sudo apt-get install xpdf poppler-utils

Step 3 - Install the java packages

Step 3A - Install "jai_imageio.jar"

mkdir $HOME/temp 
cd $HOME/temp
curl -O http://download.java.net/media/jai-imageio/builds/release/1.1/jai_imageio-1_1-lib-linux-i586.tar.gz
tar -xzvf jai_imageio-1_1-lib-linux-i586.tar.gz
 mvn install:install-file \
                    -Dfile=jai_imageio-1_1/lib/jai_imageio.jar  \
                    -DgroupId=com.sun.media                     \
                    -DartifactId=jai_imageio                    \
                    -Dversion=1.0_01                            \
                    -Dpackaging=jar                             \
                    -DgeneratePom=true

Step 3B - Install "jai_core.jar"

mkdir $HOME/temp 
cd $HOME/temp 
wget --no-check-certificate https://m2.duraspace.org/content/repositories/thirdparty/org/fcrepo/jai_core/1.1.2_01/jai_core-1.1.2_01.jar
mvn install:install-file \
                    -Dfile=jai_core-1.1.2_01.jar  \
                    -DgroupId=javax.media                      \
                    -DartifactId=jai_core                      \
                    -Dversion=1.1.2_01                         \
                    -Dpackaging=jar                            \
                    -DgeneratePom=true

Step 4 - Configuration

Step 4A

First, be sure there is a value for thumbnail.maxwidth and that it corresponds to the size you want for preview images for the UI.

Edit the "dspace.cfg" file.

nano /home/dspace/source/config/dspace.cfg

Search for the following and modify.

# maximum width and height of generated thumbnails
thumbnail.maxwidth  = 160
thumbnail.maxheight = 160

Step 4B

Search for "filter.plugins" and replace with the following.

filter.plugins = \
        PDF Text Extractor, \
        PDF Thumbnail, \
        HTML Text Extractor, \
        Word Text Extractor, \
        JPEG Thumbnail, \
        Branded Preview JPEG

Step 4C

Change the MediaFilter plugin configuration to remove the old "org.dspace.app.mediafilter.PDFFilter" and add the new filters "org.dspace.app.mediafilter.XPDF2Text = PDF Text Extractor" and "org.dspace.app.mediafilter.XPDF2Thumbnail = PDF Thumbnail". Replace with the following.

plugin.named.org.dspace.app.mediafilter.FormatFilter = \
  org.dspace.app.mediafilter.XPDF2Text = PDF Text Extractor, \
  org.dspace.app.mediafilter.XPDF2Thumbnail = PDF Thumbnail, \
  org.dspace.app.mediafilter.HTMLFilter = HTML Text Extractor, \
  org.dspace.app.mediafilter.WordFilter = Word Text Extractor, \
  org.dspace.app.mediafilter.JPEGFilter = JPEG Thumbnail, \
  org.dspace.app.mediafilter.BrandedPreviewJPEGFilter = Branded Preview JPEG

Step 4D

Then replace "filter.org.dspace.app.mediafilter.PDFFilter.inputFormats = Adobe PDF" with the following:

filter.org.dspace.app.mediafilter.XPDF2Thumbnail.inputFormats = Adobe PDF
filter.org.dspace.app.mediafilter.XPDF2Text.inputFormats = Adobe PDF

Step 4E

Before the comment"#Custom settings for PDFFilter" add the following:

#The paths to the XPDF utilities
xpdf.path.pdftotext = /usr/bin/pdftotext
xpdf.path.pdftoppm  = /usr/bin/pdftoppm
xpdf.path.pdfinfo   = /usr/bin/pdfinfo

Step 4 - Build and Install

Perform the following as the "dspace" user.

To build, type the following:

cd /home/dspace/source
mvn -U clean package -Pxpdf-mediafilter-support

To install, type the following: (Replace XXX with your DSpace version number)

cd /home/dspace/source/dspace/target/dspace-XXX-build
ant update
ant clean_backups

Step 5 - Update dspace rebuild script

If the test build works then add the switch"-Pxpdf-mediafilter-support" to the dspace rebuild script, so that:

mvn -U clean package

becomes

mvn -U clean package -Pxpdf-mediafilter-support

See: http://wiki.lib.sun.ac.za/index.php/SUNScholar/Rebuild_DSpace

Step 6 - Test the media filers

Type the following to test. Select an item that has pdf files attached and use it as replacement for "123456789/29097".

/home/dspace/bin/dspace filter-media -n -v -i 123456789/29097

Step 7 - Create new thumbnails

Now that the tests have worked, type the following to create new thumbnails for the entire system.

/home/dspace/bin/dspace filter-media -n -v -f

References