Changeset 24288

Show
Ignore:
Timestamp:
18.07.2011 21:05:06 (8 years ago)
Author:
ak19
Message:

If the PDFBox extension is not installed, GLI will now display a dialog on start-up informing the user where they can get PDFBox from if they want to process PDF files of v1.5 and greater. This is by way of introducing users to this facility.

Location:
main/trunk/gli
Files:
3 modified

Legend:

Unmodified
Added
Removed
  • main/trunk/gli/classes/dictionary.properties

    r23662 r24288  
    883883MissingImageMagick.Message:Warning! The Librarian Interface failed to locate an appropriate version of ImageMagick. Images can be included in collections but no image processing functionality will be available, such as converting images to a different type, or generating thumbnails.  
    884884MissingImageMagick.Title:Missing ImageMagick 
     885#******* MissingPDFBox ******** 
     886MissingPDFBox.Message:If you wish Greenstone to process PDF documents of version 1.5 and above, then download the PDFBox extension from http://trac.greenstone.org/export/24287/gs2-extensions/pdf-box/trunk/pdf-box-java.{0} and install it by unzipping it into your {1} folder. 
     887MissingPDFBox.Title:PDFBox extension 
    885888#******** Multiple filename encodings not supported ******* 
    886889NoEncodingSupport.Message:Your locale seems to be in UTF-8. Non-UTF-8 filenames are not supported by your setup. 
  • main/trunk/gli/classes/xml/config.xml

    r23647 r24288  
    107107    <Argument name="warning.MissingGSDL">true</Argument> 
    108108    <Argument name="warning.MissingImageMagick">true</Argument> 
     109    <Argument name="warning.MissingPDFBox">true</Argument>     
    109110    <Argument name="warning.MissingPERL">true</Argument> 
    110     <Argument name="warning.NoEncodingSupport">true</Argument> 
     111    <Argument name="warning.NoEncodingSupport">true</Argument> 
    111112    <Argument name="warning.NoPluginExpectedToProcessFile">true</Argument> 
    112113    <Argument name="warning.LegacyCollection">true</Argument> 
  • main/trunk/gli/src/org/greenstone/gatherer/Gatherer.java

    r24238 r24288  
    446446                missingImageMagick(); 
    447447            } 
     448             
     449            // Check for PDFBox 
     450            if (Gatherer.isGsdlRemote) { 
     451                DebugStream.println("Not checking for PDFBox."); 
     452            } 
     453            else { 
     454                String gs_dir = GS3 ? gsdl3_src_path : gsdl_path; 
     455                File pdfboxExtensionFolder = new File(gs_dir+File.separator+"ext"+File.separator+"pdf-box"); 
     456                if (!(pdfboxExtensionFolder.exists() && pdfboxExtensionFolder.isDirectory())) { 
     457                // The user doesn't have PDFBox, inform them of it 
     458                String zipExtension = Utility.isWindows() ? "zip" : "tar.gz"; 
     459                missingPDFBox(zipExtension, pdfboxExtensionFolder.getParent()); 
     460                } 
     461            } 
     462 
    448463 
    449464            if (Gatherer.isGsdlRemote) { 
     
    12721287    } 
    12731288 
     1289        /** Prints a message informing the user where they can get PDFBox from to process PDF files of v1.5 and greater */ 
     1290    static private void missingPDFBox(String zipExtension, String extFolder) { 
     1291    WarningDialog dialog = new WarningDialog("warning.MissingPDFBox", Dictionary.get("MissingPDFBox.Title"), Dictionary.get("MissingPDFBox.Message", new String[]{zipExtension, extFolder}), null, false); 
     1292        dialog.display(); 
     1293        dialog.dispose(); 
     1294        dialog = null; 
     1295    } 
     1296 
    12741297    /** Prints a warning message about missing a valid PERL path, which although not fatal pretty much ensures no collection creation/building will work properly in the GLI. */ 
    12751298    static private void missingPERL() {