Ignore:
Timestamp:
2014-08-21T12:19:21+12:00 (10 years ago)
Author:
kjdon
Message:

commenting out the doc xml cache. When doing doc editing through a collection, metadata changes are currently handled by metadata-server.pl. This edits files directly, not through DocumentMaker using this class. Therefore the doc xml cache gets out of date, and you lose metadata changes if you then edit the text

File:
1 edited

Legend:

Unmodified
Added
Removed
  • main/trunk/greenstone3/src/java/org/greenstone/gsdl3/util/GSDocumentModel.java

    r28965 r29224  
    103103    protected String _siteHome;
    104104    protected MessageRouter _router;
    105     protected HashMap<String, Document> _docCache = new HashMap<String, Document>();
     105
     106  // When we are doing document editing through browser, metadata changes are currently handled by metadata_server.pl. This edits files directly. If I then come to edit text via this class, the doc xml gets read from the cache and my external changes are lost. I am disabling it for now...
     107  //protected HashMap<String, Document> _docCache = new HashMap<String, Document>();
    106108
    107109    public GSDocumentModel(String siteHome, MessageRouter router)
     
    695697            docXML = db.parse(docFile);
    696698
    697             _docCache.put(oid + "__" + collection, docXML);
     699            //_docCache.put(oid + "__" + collection, docXML);
    698700        }
    699701        catch (Exception ex)
     
    19101912
    19111913        Document docXML = null;
    1912         if ((docXML = _docCache.get(oid + "__" + collection)) == null)
    1913         {
     1914        //if ((docXML = _docCache.get(oid + "__" + collection)) == null)
     1915        //  {
    19141916            String filePath = archiveGetDocumentFilePath(oid, collection, userContext);
    19151917            File docFile = new File(filePath);
     
    19261928                docXML = db.parse(docFile);
    19271929
    1928                 _docCache.put(oid + "__" + collection, docXML);
     1930                //_docCache.put(oid + "__" + collection, docXML);
    19291931            }
    19301932            catch (Exception ex)
     
    19321934                return null;
    19331935            }
    1934         }
     1936            //  }
    19351937        return docXML;
    19361938    }
Note: See TracChangeset for help on using the changeset viewer.