Software: Apache/2.2.3 (CentOS). PHP/5.1.6 uname -a: Linux mx-ll-110-164-51-230.static.3bb.co.th 2.6.18-194.el5PAE #1 SMP Fri Apr 2 15:37:44 uid=48(apache) gid=48(apache) groups=48(apache) Safe-mode: OFF (not secure) /usr/lib/openoffice.org/basis3.1/share/Scripts/javascript/ExportSheetsToHTML/ drwxr-xr-x |
Viewing file: exportsheetstohtml.js (2.9 KB) -rw-r--r-- Select action/file-type: (+) | (+) | (+) | Code (+) | Session (+) | (+) | SDB (+) | (+) | (+) | (+) | (+) | (+) | // When this script is run on an existing, saved, spreadsheet, // eg. /home/testuser/myspreadsheet.sxc, the script will export // each sheet to a separate html file, // eg. /home/testuser/myspreadsheet_sheet1.html, // /home/testuser/myspreadsheet_sheet2.html etc importClass(Packages.com.sun.star.uno.UnoRuntime); importClass(Packages.com.sun.star.sheet.XSpreadsheetDocument); importClass(Packages.com.sun.star.container.XIndexAccess); importClass(Packages.com.sun.star.beans.XPropertySet); importClass(Packages.com.sun.star.beans.PropertyValue); importClass(Packages.com.sun.star.util.XModifiable); importClass(Packages.com.sun.star.frame.XStorable); importClass(Packages.com.sun.star.frame.XModel); importClass(Packages.com.sun.star.uno.AnyConverter); importClass(Packages.com.sun.star.uno.Type); importClass(java.lang.System); //get the document object from the scripting context oDoc = XSCRIPTCONTEXT.getDocument(); //get the XSpreadsheetDocument interface from the document xSDoc = UnoRuntime.queryInterface(XSpreadsheetDocument, oDoc); //get the XModel interface from the document xModel = UnoRuntime.queryInterface(XModel,oDoc); //get the XIndexAccess interface used to access each sheet xSheetsIndexAccess = UnoRuntime.queryInterface(XIndexAccess, xSDoc.getSheets()); //get the XStorable interface used to save the document xStorable = UnoRuntime.queryInterface(XStorable,xSDoc); //get the XModifiable interface used to indicate if the document has been //changed xModifiable = UnoRuntime.queryInterface(XModifiable,xSDoc); //set up an array of PropertyValue objects used to save each sheet in the //document storeProps = new Array;//PropertyValue[1]; storeProps[0] = new PropertyValue(); storeProps[0].Name = "FilterName"; storeProps[0].Value = "HTML (StarCalc)"; storeUrl = xModel.getURL(); storeUrl = storeUrl.substring(0,storeUrl.lastIndexOf('.')); //set only one sheet visible, and store to HTML doc for(var i=0;i<xSheetsIndexAccess.getCount();i++) { setAllButOneHidden(xSheetsIndexAccess,i); xModifiable.setModified(false); xStorable.storeToURL(storeUrl+"_sheet"+(i+1)+".html", storeProps); } // now set all visible again for(var i=0;i<xSheetsIndexAccess.getCount();i++) { xPropSet = AnyConverter.toObject( new Type(XPropertySet), xSheetsIndexAccess.getByIndex(i)); xPropSet.setPropertyValue("IsVisible", true); } function setAllButOneHidden(xSheetsIndexAccess,vis) { //System.err.println("count="+xSheetsIndexAccess.getCount()); //get an XPropertySet interface for the vis-th sheet xPropSet = AnyConverter.toObject( new Type(XPropertySet), xSheetsIndexAccess.getByIndex(vis)); //set the vis-th sheet to be visible xPropSet.setPropertyValue("IsVisible", true); // set all other sheets to be invisible for(var i=0;i<xSheetsIndexAccess.getCount();i++) { xPropSet = AnyConverter.toObject( new Type(XPropertySet), xSheetsIndexAccess.getByIndex(i)); if(i!=vis) { xPropSet.setPropertyValue("IsVisible", false); } } } |
:: Command execute :: | |
:: Shadow's tricks :D :: | |
Useful Commands
|
:: Preddy's tricks :D :: | |
Php Safe-Mode Bypass (Read Files)
|
--[ c999shell v. 1.0 pre-release build #16 Modded by Shadow & Preddy | RootShell Security Group | r57 c99 shell | Generation time: 0.0176 ]-- |