Ignore:
Timestamp:
2006-07-13T10:29:55+12:00 (18 years ago)
Author:
kjdon
Message:

committed some changes that I had made ages ago. Not sure if it still compiles - I need to write an ant build file for this, and check compilation. Will do it once I need to - its unclear whether anyone will ever use this again

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/greenstone3-extensions/gs3build/src/org/greenstone/gsdl3/gs3build/doctypes/METSDocument.java

    r12188 r12191  
    2626    public static final String METS_DOCUMENT_TYPE = "METS";
    2727    Document domDocument;
     28    String original_location;
     29   
    2830    public METSDocument(DocumentID id) {
    2931        super(id);
     
    5052        domDocument = builder.parse(file);
    5153
    52         int filePosition = file.getPath().indexOf("import/")+7;
    53         parseFilePath = file.getPath().substring(0, filePosition);
     54        //int filePosition = file.getPath().indexOf("import/")+7;
     55        //parseFilePath = file.getPath().substring(0, filePosition);
     56        parseFilePath = file.getParent(); // all refs should be relative to the current doc, or absolute
     57        parseFilePath += File.separator;
     58        this.original_location = parseFilePath;
    5459        // TODO: get all the types in the tree
    5560     
     
    139144    URL url = (URL) this.fileSet.getFile(0).getLocation();
    140145
    141     this.getSectionText("1");
     146    //this.getSectionText("1");
    142147   
    143148    if (url.getProtocol().equals("file")) {
    144         metsDoc = new HTMLDoc(url,url.getPath());
     149        String path = url.getPath();
     150        File f = new File(path);
     151        if (!f.isAbsolute() && this.original_location != null) {
     152        path = this.original_location + path;
     153        System.err.println("new path ="+path);
     154        }
     155        metsDoc = new HTMLDoc(url,path);
    145156    } else {
    146157        metsDoc = new HTMLDoc(url);
Note: See TracChangeset for help on using the changeset viewer.