Project

General

Profile

« Previous | Next » 

Revision 679

Added by berkley over 23 years ago

fixed bug that was accidentally introduced when the change from metacatURL to URL was done.

View differences:

src/edu/ucsb/nceas/metacat/RelationHandler.java
149 149
            insertTransRelation.append("subdoctype, relationship, object, ");
150 150
            insertTransRelation.append("objdoctype) values ('");
151 151
            insertTransRelation.append(docid).append("', '");
152
            insertTransRelation.append(subject).append("', '");
152
            insertTransRelation.append(subject).append("', '"); 
153 153
            insertTransRelation.append(subjectDoctype).append("', ");
154 154
            insertTransRelation.append("'hasTransitiveRelationTo', '");
155 155
            insertTransRelation.append(currentSub).append("', '");
......
171 171
        try
172 172
        {
173 173
          URL subMurl = new URL(subject);
174
          Hashtable subMurlParams = util.parseQuery(subMurl.getQuery());
175
          subDocid = (String)subMurlParams.get("docid");
174
          if(subMurl.getQuery() != null)
175
          {
176
            Hashtable subMurlParams = util.parseQuery(subMurl.getQuery());
177
            subDocid = (String)subMurlParams.get("docid");
178
            if(subMurl.getProtocol().equals("metacat"))
179
            {
180
              subDoc = new DocumentImpl(conn, subDocid);
181
              subDoctype = subDoc.getDoctype();
182
            }
183
          }
184
          else
185
          {
186
            subDocid = subject;
187
          }
176 188
        }
177 189
        catch(MalformedURLException murle)
178 190
        { //assume this is just a docid not a url
......
182 194
        try
183 195
        {
184 196
          URL objMurl = new URL(object); 
185
          Hashtable objMurlParams = util.parseQuery(objMurl.getQuery());
186
          objDocid = (String)objMurlParams.get("docid");
197
          if(objMurl.getQuery() != null)
198
          {
199
            Hashtable objMurlParams = util.parseQuery(objMurl.getQuery());
200
            objDocid = (String)objMurlParams.get("docid");
201
            if(objMurl.getProtocol().equals("metacat"))
202
            {
203
              DocumentImpl objDoc = new DocumentImpl(conn, objDocid);
204
              objDoctype = objDoc.getDoctype();
205
            }
206
          }
207
          else
208
          {
209
            objDocid = object;
210
          }
187 211
        }
188 212
        catch(MalformedURLException murle)
189 213
        { //assume this is just a docid
190 214
          objDocid = object;
191 215
        }
192 216
        
193
        subDoc = new DocumentImpl(conn, subDocid);
194
        subDoctype = subDoc.getDoctype();
195
        DocumentImpl objDoc = new DocumentImpl(conn, objDocid);
196
        objDoctype = objDoc.getDoctype();
197 217
        
198 218
        //now that the comparisons are done, the new relation can be put
199 219
        //into xml_relation

Also available in: Unified diff