Ignore:
Timestamp:
2012-05-08T09:55:48+12:00 (12 years ago)
Author:
sjm84
Message:

Removed some redundant code, as well as fixing up the createDocument transaction

File:
1 edited

Legend:

Unmodified
Added
Removed
  • main/trunk/greenstone3/src/java/org/greenstone/gsdl3/service/DocumentMaker.java

    r25066 r25541  
    383383            transactions = gson.fromJson(transactionString, type);
    384384        }
    385         catch(Exception ex)
     385        catch (Exception ex)
    386386        {
    387387            ex.printStackTrace();
     
    404404
    405405                    _GSDM.documentMoveOrDuplicate(origOID, origCollection, newOID, newCollection, _GSDM.operationStringToInt(subOperation), operation.equals("move"), userContext);
    406 
    407                     if (_GSDM.getErrorStatus() == GSDocumentModel.NO_ERROR && origCollection != null && !collectionsToBuild.contains(origCollection))
    408                     {
    409                         collectionsToBuild.add(origCollection);
    410                     }
    411 
    412                     if (_GSDM.getErrorStatus() == GSDocumentModel.NO_ERROR && newCollection != null && !collectionsToBuild.contains(newCollection))
    413                     {
    414                         collectionsToBuild.add(newCollection);
    415                     }
     406                }
     407                else if (operation.equals("createDocument"))
     408                {
     409                    String oid = (String) keyValueMap.get("oid");
     410                    String collection = (String) keyValueMap.get("collection");
     411
     412                    _GSDM.documentCreate(oid, collection, userContext);
    416413                }
    417414                else if (operation.equals("create"))
     
    423420                    //_GSDM.documentCreate(oid, collection, userContext); <--- Maybe go back to this
    424421                    _GSDM.documentXMLSetSection(oid, collection, this.doc.createElement(GSXML.DOCXML_SECTION_ELEM), _GSDM.operationStringToInt(subOperation), userContext);
    425 
    426                     if (_GSDM.getErrorStatus() == GSDocumentModel.NO_ERROR && collection != null && !collectionsToBuild.contains(collection))
    427                     {
    428                         collectionsToBuild.add(collection);
    429                     }
    430422                }
    431423                else if (operation.equals("delete"))
     
    435427
    436428                    _GSDM.documentDelete(oid, collection, userContext);
    437 
    438                     if (_GSDM.getErrorStatus() == GSDocumentModel.NO_ERROR && collection != null && !collectionsToBuild.contains(collection))
    439                     {
    440                         collectionsToBuild.add(collection);
    441                     }
    442429                }
    443430                else if (operation.equals("setText"))
     
    446433                    String collection = (String) keyValueMap.get("collection");
    447434                    String newContent = (String) keyValueMap.get("text");
    448                    
     435
    449436                    _GSDM.documentXMLSetText(oid, collection, newContent, userContext);
    450437                }
Note: See TracChangeset for help on using the changeset viewer.