Changeset 8459


Ignore:
Timestamp:
2004-11-05T10:04:47+13:00 (19 years ago)
Author:
kjdon
Message:

formatting change and added in a case for METS documents

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/gsdl3/src/java/org/greenstone/gsdl3/gs3build/doctypes/DocumentFactory.java

    r7466 r8459  
    66import org.greenstone.gsdl3.gs3build.util.GS3SQLConnection;
    77
    8 public class DocumentFactory
    9 {
    10   public static AbstractDocument createDocument(String type, DocumentID id)
    11   {
    12       System.out.println(type + " " + id.toString());
    13     if (type.equals(HTMLDocument.HTML_DOCUMENT_TYPE))
    14     { return new HTMLDocument(id);
     8public class DocumentFactory {
     9    public static AbstractDocument createDocument(String type, DocumentID id) {
     10   
     11    System.out.println(type + " " + id.toString());
     12    if (type.equals(HTMLDocument.HTML_DOCUMENT_TYPE)) {
     13        return new HTMLDocument(id);
     14    } else if (type.equals(TextDocument.TEXT_DOCUMENT_TYPE)) {
     15        return new TextDocument(id);
     16    } else if (type.equals(JPEGDocument.JPEG_DOCUMENT_TYPE)) {
     17        return new JPEGDocument(id);
     18    } else if (type.equals(IndexDocument.INDEX_DOCUMENT_TYPE)) {
     19        return new IndexDocument(id);
     20    } else if (type.equals(MetadataDocument.METADATA_DOCUMENT_TYPE)) {
     21        return new MetadataDocument(id);
     22    } else if (type.equals(METSDocument.METS_DOCUMENT_TYPE)) {
     23        return new METSDocument(id);
     24    }
     25   
     26    /*
     27      else if (type.equals(ExtXMLDocument.EXTXML_DOCUMENT_TYPE))
     28      { return new ExtXMLDocument(id);
     29      }*/
     30    return null;
    1531    }
    16     else if (type.equals(TextDocument.TEXT_DOCUMENT_TYPE))
    17     { return new TextDocument(id);
    18     }
    19     else if (type.equals(JPEGDocument.JPEG_DOCUMENT_TYPE))
    20     { return new JPEGDocument(id);
    21     }
    22     else if (type.equals(IndexDocument.INDEX_DOCUMENT_TYPE))
    23     { return new IndexDocument(id);
    24     }
    25     else if (type.equals(MetadataDocument.METADATA_DOCUMENT_TYPE))
    26     { return new MetadataDocument(id);
    27     }/*
    28     else if (type.equals(ExtXMLDocument.EXTXML_DOCUMENT_TYPE))
    29     { return new ExtXMLDocument(id);
    30     }*/
    31     return null;
    32   }
    33 
     32   
    3433  public static DocumentInterface readSQLDocument(GS3SQLConnection connection, DocumentID id)
    3534  {
Note: See TracChangeset for help on using the changeset viewer.