com.extentech.ExtenXLS.web
Class WebWorkBook

java.lang.Object
  extended by com.extentech.ExtenXLS.DocumentHandle
      extended by com.extentech.ExtenDOC.DocHandle
          extended by com.extentech.ExtenXLS.web.MemeDocument
              extended by com.extentech.ExtenXLS.web.MemeWorkBook
                  extended by com.extentech.ExtenXLS.web.WebWorkBook
All Implemented Interfaces:
Document, Handle, WorkBook, com.extentech.toolkit.LogOutputter
Direct Known Subclasses:
FileWebWorkBook

public class WebWorkBook
extends MemeWorkBook
implements WorkBook

The WebWorkBook class provides additional functionality to the WorkBookHandle class to allow it to participate in a Service-Oriented-Architecture. The additional functionality of the WebWorkBook relates to version and access control using a hosted architecture to provide for the security and versioning repository.

Author:
John McMahon -- Copyright ©2010 Extentech Inc.
See Also:
WorkBook, WorkBookHandle, http://www.sheetster.com

Field Summary
 
Fields inherited from class com.extentech.ExtenXLS.web.MemeDocument
ACCESS_STATUS_PRIVATE, ACCESS_STATUS_PUBLIC, ACCESS_STATUS_SHARED
 
Fields inherited from interface com.extentech.ExtenXLS.WorkBook
ALLOWDUPES, CALCULATE_ALWAYS, CALCULATE_AUTO, CALCULATE_EXPLICIT, DEBUG_HIGH, DEBUG_LOW, DEBUG_MEDIUM, SHAREDUPES, STRING_ENCODING_AUTO, STRING_ENCODING_COMPRESSED, STRING_ENCODING_UNICODE
 
Constructor Summary
WebWorkBook()
           
WebWorkBook(Connection dbc, byte[] in, com.extentech.security.User user, String description)
          Create a new WebWorkbook from a workbook passed in.
WebWorkBook(Connection dbcon, File fx)
           
WebWorkBook(Connection cx, int mix, boolean storeAsFile, boolean xmlStorage)
          constructor with a meme_id
WebWorkBook(Connection dbcon, URL u)
           
WebWorkBook(InputStream urlx, com.extentech.security.User user)
          constructor that loads workbook from an InputStream
WebWorkBook(int midi, com.extentech.security.User user)
          constructor retrieves workbook referenced by midi
WebWorkBook(String path)
           
WebWorkBook(String finpath, com.extentech.swingtools.ProgressDialog progdialog)
           
WebWorkBook(String fCurrent, String fLatest, String outputDir, boolean bDEBUG)
          constructor for file comparisons - testing purposes
WebWorkBook(URL urlx, com.extentech.security.User user)
          Deprecated. - use FileStream constructor Move user handling to more logical spot...
WebWorkBook(com.extentech.security.User user)
          Create a new WebWorkBook with the passed in user.
 
Method Summary
 WorkBook applyDiff(StringBuffer diff)
          apply a single diff to a Document
 boolean commit()
          commit changes from the existing workbook as compared to the stored version retrieve changes as diff and store
static InputStream convertDocumentToInputStream(org.jdom.Document doc)
           
 StringBuffer getDiff(org.jdom.Document oldDoc, org.jdom.Document newDoc)
           
 List getDiffs()
          return an Iterator of diff history -- list[0] is the most current changes, applying list[0] to the current document brings it back 1 version.
 org.jdom.Document getLatestXML()
          retrieve the lastest XML stream from the conurl URL and format into a Document object
static String incrementVersionNumber(String origFName)
          test utilty to increase the version number (-n.XML) for file comparisons
 void init()
           
static void printDocument(org.jdom.Document doc, String fName)
          Handle differences in number of nodes + attributes for the root element only (must handle by hand since DetailedDiff appears to have problems in root-level comparisons)
 DocumentHandle revertDiff()
          revert current workbook to the most recent previous version
 
Methods inherited from class com.extentech.ExtenXLS.web.MemeWorkBook
addProperty, addSheetFromWorkBook, addSheetFromWorkBookWithFormatting, addWorkSheet, addWorkSheet, calculateFormulas, close, copyChartToSheet, copyChartToSheet, copyWorkSheet, createChart, createNamedRange, createWorkSheet, createWorkSheet, deleteChart, equals, finalize, getBytes, getCell, getCellRanges, getCells, getChart, getChartById, getCharts, getConditionalFormats, getFactory, getFormats, getFormulaCalculationMode, getFormulaHandle, getImage, getImages, getIsExcel2007, getName, getNamedRange, getNamedRangeInScope, getNamedRanges, getNamedRangesInScope, getNoSheetWorkBook, getNumCells, getNumWorkSheets, getPivotTable, getPivotTables, getProperties, getProperty, getStats, getStats, getWorkBook, getWorkingDirectory, getWorkSheet, getWorkSheet, getWorkSheets, getXLSVersionString, hashCode, is1904, removeAllWorkSheets, reset, searchAndReplace, setDebugLevel, setDefaultColWidth, setDefaultRowHeight, setDupeStringMode, setFormulaCalculationMode, setName, setProperties, setProtected, setStringEncodingMode, toString, write, write, write, write, writeBytes, writeXLSXBytes
 
Methods inherited from class com.extentech.ExtenXLS.web.MemeDocument
addUser, appendOutputDir, bindData, createPage, deleteBook, deleteDoc, getAllDiffs, getBook, getConcurrentUsers, getConnection, getCryptPass, getDataFactory, getDatamapping, getDefaultFileString, getDescription, getFileName, getLatestDiff, getMemeId, getMemeType, getMessageManager, getNumPages, getOutputDir, getOwnerId, getPages, getRESTEmit, getRESTlog, getServerURL, getSession, getSharingAccess, getTempfile, getXMLStream, isPublic, isSaved, loadDataDefinition, loadDataDefinition, log, log, log, main, revert, save, setConnection, setCryptPass, setDataFactory, setDatamapping, setDescription, setMemeId, setMemeType, setMessageManager, setOutputDir, setOwnerId, setRESTlog, setSaved, setServerURL, setSession, setSharingAccess, setStoreAsXML, setStoreBookAsFile, setTempfile, storeAsXML, storeBookAsFile, storeDiff, storeNewDocument
 
Methods inherited from class com.extentech.ExtenDOC.DocHandle
getAllText, getFormatHandles, getPage, getParagraphs, getTextRangeHandles, getVersion, getXHTML, setFileName, setXHTML
 
Methods inherited from class java.lang.Object
getClass, notify, notifyAll, wait, wait, wait
 
Methods inherited from interface com.extentech.ExtenXLS.WorkBook
addProperty, addSheetFromWorkBook, addWorkSheet, calculateFormulas, copyChartToSheet, copyChartToSheet, copyWorkSheet, createWorkSheet, getBytes, getCell, getCells, getChart, getCharts, getFormats, getFormulaCalculationMode, getName, getNamedRange, getNamedRanges, getNoSheetWorkBook, getNumCells, getPivotTable, getPivotTables, getProperty, getWorkBook, getWorkingDirectory, getWorkSheet, getWorkSheet, getWorkSheets, removeAllWorkSheets, reset, setDebugLevel, setDefaultColWidth, setDefaultRowHeight, setDupeStringMode, setFormulaCalculationMode, setName, setProtected, setStringEncodingMode, toString, writeBytes
 
Methods inherited from interface com.extentech.toolkit.LogOutputter
log, log, log
 

Constructor Detail

WebWorkBook

public WebWorkBook(String fCurrent,
                   String fLatest,
                   String outputDir,
                   boolean bDEBUG)
constructor for file comparisons - testing purposes

Parameters:
fCurrent - original XML filename
fLatest - updated XML filename

WebWorkBook

public WebWorkBook(String path)

WebWorkBook

public WebWorkBook(Connection cx,
                   int mix,
                   boolean storeAsFile,
                   boolean xmlStorage)
constructor with a meme_id


WebWorkBook

public WebWorkBook(URL urlx,
                   com.extentech.security.User user)
Deprecated. - use FileStream constructor Move user handling to more logical spot...

constructor that loads workbook from a URL


WebWorkBook

public WebWorkBook(InputStream urlx,
                   com.extentech.security.User user)
constructor that loads workbook from an InputStream


WebWorkBook

public WebWorkBook(com.extentech.security.User user)
Create a new WebWorkBook with the passed in user. The user param will be the owner of the new workbook


WebWorkBook

public WebWorkBook(int midi,
                   com.extentech.security.User user)
constructor retrieves workbook referenced by midi


WebWorkBook

public WebWorkBook(Connection dbc,
                   byte[] in,
                   com.extentech.security.User user,
                   String description)
            throws SQLException
Create a new WebWorkbook from a workbook passed in.

Parameters:
bk -
user -
Throws:
SQLException

WebWorkBook

public WebWorkBook(String finpath,
                   com.extentech.swingtools.ProgressDialog progdialog)

WebWorkBook

public WebWorkBook()

WebWorkBook

public WebWorkBook(Connection dbcon,
                   File fx)

WebWorkBook

public WebWorkBook(Connection dbcon,
                   URL u)
Method Detail

init

public void init()

commit

public boolean commit()
commit changes from the existing workbook as compared to the stored version retrieve changes as diff and store

Returns:
boolean truth of "commit was successful"

getDiffs

public List getDiffs()
return an Iterator of diff history -- list[0] is the most current changes, applying list[0] to the current document brings it back 1 version. applying list[1] after applying list[0] brings the current document back 2 versions. and so on.


applyDiff

public WorkBook applyDiff(StringBuffer diff)
apply a single diff to a Document

Parameters:
diff - StringBuffer of diffs in specific diff format
Returns:
WorkBook representing changes

getDiff

public StringBuffer getDiff(org.jdom.Document oldDoc,
                            org.jdom.Document newDoc)

getLatestXML

public org.jdom.Document getLatestXML()
retrieve the lastest XML stream from the conurl URL and format into a Document object

Returns:
Document object representing the XML stream from the URL

incrementVersionNumber

public static String incrementVersionNumber(String origFName)
test utilty to increase the version number (-n.XML) for file comparisons

Returns:

printDocument

public static void printDocument(org.jdom.Document doc,
                                 String fName)
Handle differences in number of nodes + attributes for the root element only (must handle by hand since DetailedDiff appears to have problems in root-level comparisons)

Parameters:
oldDocRoot -
newDocRoot -
xpathRoot -
removals -
additions -

convertDocumentToInputStream

public static InputStream convertDocumentToInputStream(org.jdom.Document doc)
                                                throws IOException
Throws:
IOException

revertDiff

public DocumentHandle revertDiff()
revert current workbook to the most recent previous version

Returns:
reverted Workbook or null


Copyright © 2010 Extentech Inc. All Rights Reserved.