Ignore:
Timestamp:
2012-01-26T11:50:17+13:00 (12 years ago)
Author:
sjm84
Message:

Adding UserContext to replace the use of lang and uid

File:
1 edited

Legend:

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

    r24393 r24993  
    2828import org.greenstone.gsdl3.util.GSXML;
    2929import org.greenstone.gsdl3.util.SimpleCollectionDatabase;
     30import org.greenstone.gsdl3.util.UserContext;
    3031
    3132import org.w3c.dom.Element;
     
    108109        result.setAttribute(GSXML.TYPE_ATT, GSXML.REQUEST_TYPE_PROCESS);
    109110
    110         String lang = request.getAttribute(GSXML.LANG_ATT);
    111         String uid = request.getAttribute(GSXML.USER_ID_ATT);
     111        UserContext userContext = new UserContext(request);
    112112
    113113        // Get the parameters of the request
     
    123123        String collection = (String) params.get(GSXML.COLLECTION_ATT);
    124124
    125         String filePath = _GSDM.archiveGetDocumentFilePath(oid, collection, lang, uid);
     125        String filePath = _GSDM.archiveGetDocumentFilePath(oid, collection, userContext);
    126126       
    127127        Element metadataList = this.doc.createElement(GSXML.METADATA_ELEM + GSXML.LIST_MODIFIER);
     
    139139        result.setAttribute(GSXML.TYPE_ATT, GSXML.REQUEST_TYPE_PROCESS);
    140140
    141         String lang = request.getAttribute(GSXML.LANG_ATT);
    142         String uid = request.getAttribute(GSXML.USER_ID_ATT);
     141        UserContext userContext = new UserContext(request);
    143142
    144143        // Get the parameters of the request
     
    154153        String collection = (String) params.get(GSXML.COLLECTION_ATT);
    155154
    156         String oid = _GSDM.archiveGetSourceFileOID(srcFile, collection, lang, uid);
     155        String oid = _GSDM.archiveGetSourceFileOID(srcFile, collection, userContext);
    157156        if(_GSDM.checkError(result, ARCHIVE_GET_SOURCE_FILE_OID))
    158157        {
     
    174173        result.setAttribute(GSXML.TYPE_ATT, GSXML.REQUEST_TYPE_PROCESS);
    175174
    176         String lang = request.getAttribute(GSXML.LANG_ATT);
    177         String uid = request.getAttribute(GSXML.USER_ID_ATT);
     175        UserContext userContext = new UserContext(request);
    178176
    179177        // Get the parameters of the request
     
    189187        String collection = (String) params.get(GSXML.COLLECTION_ATT);
    190188       
    191         boolean exists = _GSDM.archiveCheckDocumentOrSectionExists(oid, collection, lang, uid);
     189        boolean exists = _GSDM.archiveCheckDocumentOrSectionExists(oid, collection, userContext);
    192190        if(_GSDM.checkError(result, ARCHIVE_CHECK_DOCUMENT_OR_SECTION_EXISTS))
    193191        {
     
    207205        result.setAttribute(GSXML.TYPE_ATT, GSXML.REQUEST_TYPE_PROCESS);
    208206
    209         String lang = request.getAttribute(GSXML.LANG_ATT);
    210         String uid = request.getAttribute(GSXML.USER_ID_ATT);
     207        UserContext userContext = new UserContext(request);
    211208
    212209        // Get the parameters of the request
     
    255252        }
    256253       
    257         _GSDM.archiveWriteEntryToDatabase(oid, collection, info, lang, uid);
     254        _GSDM.archiveWriteEntryToDatabase(oid, collection, info, userContext);
    258255        _GSDM.checkError(result, ARCHIVE_WRITE_ENTRY_TO_DATABASE);
    259256
     
    268265        result.setAttribute(GSXML.TYPE_ATT, GSXML.REQUEST_TYPE_PROCESS);
    269266
    270         String lang = request.getAttribute(GSXML.LANG_ATT);
    271         String uid = request.getAttribute(GSXML.USER_ID_ATT);
     267        UserContext userContext = new UserContext(request);
    272268
    273269        // Get the parameters of the request
     
    299295        }
    300296       
    301         _GSDM.archiveRemoveEntryFromDatabase(oid, collection, lang, uid);
     297        _GSDM.archiveRemoveEntryFromDatabase(oid, collection, userContext);
    302298        _GSDM.checkError(result, ARCHIVE_REMOVE_ENTRY_FROM_DATABASE);
    303299
     
    312308        result.setAttribute(GSXML.TYPE_ATT, GSXML.REQUEST_TYPE_PROCESS);
    313309
    314         String lang = request.getAttribute(GSXML.LANG_ATT);
    315         String uid = request.getAttribute(GSXML.USER_ID_ATT);
     310        UserContext userContext = new UserContext(request);
    316311
    317312        // Get the parameters of the request
     
    327322        String collection = (String) params.get(GSXML.COLLECTION_ATT);
    328323
    329         ArrayList<String> assocFiles = _GSDM.archiveGetAssociatedImportFiles(oid, collection, lang, uid);
     324        ArrayList<String> assocFiles = _GSDM.archiveGetAssociatedImportFiles(oid, collection, userContext);
    330325        if(_GSDM.checkError(result, ARCHIVE_GET_ASSOCIATED_IMPORT_FILES))
    331326        {
Note: See TracChangeset for help on using the changeset viewer.