Project

General

Profile

« Previous | Next » 

Revision 566

Added by Matt Jones over 23 years ago

Modified stylesheets and server code to use a single "read" action instead
of the earlier "getdocument" and "getrelateddocument" actions. In the
process, developed and started to utilize a new suite of URL "protocol
handlers" that are in the package "edu.ucsb.nceas.protocols" and handle
the parsing of various forms of URLS (mainly metacat:// protocol URLS). New
protocols can be added by following the model for the metacat protocol handler.
Using this mechanism, the standard URL handling methods like "getProtocol()"
can be used, and I added the "parseQuery()" method to MetaCatUtil for
parsing query parameters into name/value pairs and returning a hashtable.
I've eliminated the use of the MetacatURL class from the main Metacat servlet
classes, but not yet from the replication server classes (because I don't
understand the implications of doing so yet).

View differences:

RelationHandler.java
68 68
        String subject = rs.getString(1);
69 69
        MetacatURL subjectMurl = new MetacatURL(subject);
70 70
        String subjectDoctype = null;
71
        if(subjectMurl.getURLType().equals("metacat"))
71
        if(subjectMurl.getProtocol().equals("metacat"))
72 72
        {
73 73
          DocumentImpl subDoc = new DocumentImpl(conn, 
74 74
                                                 subjectMurl.getParam(0)[1]);
......
129 129
        MetacatURL objMurl = new MetacatURL(object);
130 130
        String subDoctype = null;
131 131
        String objDoctype = null;
132
        if(subMurl.getURLType().equals("metacat"))
132
        if(subMurl.getProtocol().equals("metacat"))
133 133
        {
134 134
          DocumentImpl subDoc = new DocumentImpl(conn, subMurl.getParam(0)[1]);
135 135
          subDoctype = subDoc.getDoctype();
136 136
        }
137
        if(objMurl.getURLType().equals("metacat"))
137
        if(objMurl.getProtocol().equals("metacat"))
138 138
        {
139 139
          DocumentImpl objDoc = new DocumentImpl(conn, objMurl.getParam(0)[1]);
140 140
          objDoc.getDoctype();

Also available in: Unified diff