com.extentech.ExtenXLS.web
Class WorkBookUpdateBean

java.lang.Object
  extended by com.extentech.ExtenXLS.web.WorkBookUpdateBean

public class WorkBookUpdateBean
extends Object

WorkbookUpdateBean is a bean that manipulates a WorkBook using a command pattern. This class is meant to be called through the executeCommand in a static manner. A map of parameters should be passed in to the executeCommand method. These parameters can include a number of different values, but at a minimum, two key/value pairs need to exist within that map, command, a string which represents the action to be performed upon the workbook, and book, which should be valid WorkBook. All commands map directly to the method names in this class. TODO: package sample code files for this class

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

Constructor Summary
WorkBookUpdateBean()
           
 
Method Summary
static String addcell(Map parameters)
          Inserts a row into the worksheet
static String deletecol(Map parameters)
          delete a column from the workbook, shifting all subsequent columns back one.
static String deleterow(Map parameters)
          Delete a row from the worksheet
static String deletesheet(Map parameters)
          Delete a sheet from the workbook
static Object executeCommand(Map parameters)
          A basic reflection call to the method passed in as command.
static String formatcells(Map parameters)
          Formats the cells passed in with the formatting patterns passed in.
static CellHandle[] getcellhandles(Map parameters)
          Primarily set up for testing purposes, but I figure there's got to be some sort of useful thing to do with this.
static String getformulafromcell(Map parameters)
          Get an XMLResponse string representing a formula for a cell
static Map getParamHashFromString(String requestURI)
           
static String insertcol(Map parameters)
          Insert a column into the workbook, shifting all subsequent columns over one.
static String insertrow(Map parameters)
          Inserts a row into the worksheet
static String insertsheet(Map parameters)
          Insert a new worksheet into the workbook
static String linkupdate(Map parameters)
          Set a link on the cells passed in.
static String resizecol(Map parameters)
          Resize the column of the workbook to the parameters passed in.
static String resizerow(Map parameters)
          Resize the row of the workbook to the parameters passed in.
static String returnXMLResponse(String value)
          Return an xml response string with the value passed in.
 
Methods inherited from class java.lang.Object
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

WorkBookUpdateBean

public WorkBookUpdateBean()
Method Detail

getParamHashFromString

public static Map getParamHashFromString(String requestURI)

executeCommand

public static Object executeCommand(Map parameters)
                             throws Exception
A basic reflection call to the method passed in as command. Parameters will need to match what is expected within the method. These are currently set within gridajax.js, so anything added here will also need to be added there.

Parameters:
parameters - = correct arguments for the method, including the command and workbook
Returns:
XML response string
Throws:
Exception

addcell

public static String addcell(Map parameters)
Inserts a row into the worksheet

Parameters:
parameters - ROW_NUMBER and SHEET_NAME
Returns:
status

resizerow

public static String resizerow(Map parameters)
Resize the row of the workbook to the parameters passed in.

Parameters:
parameters: - a map containing the keys rownum, newsize, and sheename, and a key book
Returns:
responseXML

insertrow

public static String insertrow(Map parameters)
Inserts a row into the worksheet

Parameters:
parameters - ROW_NUMBER and SHEET_NAME
Returns:
status

deleterow

public static String deleterow(Map parameters)
Delete a row from the worksheet

Parameters:
parameters - ROW_NUMBER, SHEET_NAME
Returns:
responseXML

resizecol

public static String resizecol(Map parameters)
Resize the column of the workbook to the parameters passed in.

Parameters:
parameters: - a map containing the keys colnum, newsize, and sheetname, and a key book
Returns:
responseXML

insertsheet

public static String insertsheet(Map parameters)
Insert a new worksheet into the workbook

Parameters:
parameters - a map containing the keys sheetpos and sheetname, and a key book
Returns:
responseXML

insertcol

public static String insertcol(Map parameters)
Insert a column into the workbook, shifting all subsequent columns over one.

Parameters:
parameters - a map containing the keys COL_NUMBER and SHEET_NAME
Returns:
xmlResponse

deletecol

public static String deletecol(Map parameters)
delete a column from the workbook, shifting all subsequent columns back one.

Parameters:
parameters - a map containing the keys COL_NUMBER and SHEET_NAME
Returns:
xmlResponse

formatcells

public static String formatcells(Map parameters)
Formats the cells passed in with the formatting patterns passed in. This is an "update" of the formatting of this cell rather than a full creation of a format. This means if a cell has a red background, and you change the font size, the background will still be red.

Parameters:
parameters - CELL_RANGE, and any formatting strings/keys
Returns:
responseXML;

deletesheet

public static String deletesheet(Map parameters)
Delete a sheet from the workbook

Parameters:
parameters - a map containing the key deletesheet, and a key book
Returns:
responseXML

getformulafromcell

public static String getformulafromcell(Map parameters)
Get an XMLResponse string representing a formula for a cell

Parameters:
parameters - containing the keys CELL_ADDR
Returns:

linkupdate

public static String linkupdate(Map parameters)
Set a link on the cells passed in. If the LINK parameter is null, the link will be removed from the cell

Parameters:
parameters - LINK, CELL_ADDRESS
Returns:

getcellhandles

public static CellHandle[] getcellhandles(Map parameters)
Primarily set up for testing purposes, but I figure there's got to be some sort of useful thing to do with this.


returnXMLResponse

public static String returnXMLResponse(String value)
Return an xml response string with the value passed in.

Parameters:
value -
Returns:


Copyright © 2011 Extentech Inc. All Rights Reserved.