|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectcom.acesoft.aceoffix.AceoffixCtrl
public class AceoffixCtrl
AceoffixCtrl class is the heart among all Aceoffix classes, which is in charge of online opening, displaying and editing the Office document.
Constructor Summary | |
---|---|
AceoffixCtrl(HttpServletRequest request)
Initializes a new instance of the AceoffixCtrl class. |
Method Summary | |
---|---|
void |
addCustomMenuItem(java.lang.String caption,
java.lang.String jsFunction,
boolean enabled)
Adds a menu item to custom menu. |
void |
addCustomToolButton(java.lang.String caption,
java.lang.String jsFunction,
int iconIndex)
Adds a button to custom tool bar. |
void |
bind(java.lang.Object writerObj)
Binds the data source object to the AceoffixCtrl. |
void |
createNewDocument(java.lang.String userName,
DocumentVersion docVersion)
Creates a new document and open it for editing online. |
RibbonToolbar |
getRibbonBar()
Gets the Ribbon bar object to customize the Ribbon toolbar of Office2007/2010/2013/2016. |
void |
openDocument(java.lang.String documentURL,
OpenModeType openMode,
java.lang.String userName)
Opens an Office document online. |
void |
setAllowCopy(boolean value)
Sets a value that indicates whether Copy, Paste and Download are allowed in the current document. |
void |
setBorderColor(java.awt.Color value)
Sets the border color of AceoffixCtrl. |
void |
setBorderStyle(BorderStyleType value)
Sets the border style of AceoffixCtrl. |
void |
setCaption(java.lang.String value)
Sets the caption text for AceoffixCtrl. |
void |
setCompressDocument(boolean value)
Sets a value that indicates whether the document will be compressed when AceoffixCtrl saving document. |
void |
setCustomMenuCaption(java.lang.String value)
Sets the caption of custom menu. |
void |
setCustomToolbar(boolean value)
Sets a value that indicates whether the custom tool bar of AceoffixCtrl shows. |
void |
setEnableUserProtection(boolean value)
Indicates whether the document protection set by user will be enabled. |
void |
setFileTitle(java.lang.String value)
The default file name of the Save As dialog box prompted by AceoffixCtrl at the client side. |
void |
setHTTPBasic_Password(java.lang.String value)
The password used in HTTP Basic Authentication. |
void |
setHTTPBasic_UserName(java.lang.String value)
The user name used in HTTP Basic Authentication. |
void |
setInstallationHint(java.lang.String value)
Customize installation hint of Acoeffix at client side. |
void |
setJsFunction_AfterDocumentClosed(java.lang.String value)
Sets a JavaScript function for AfterDocumentClosed event. |
void |
setJsFunction_AfterDocumentOpened(java.lang.String value)
Sets a JavaScript function for AfterDocumentOpened event. |
void |
setJsFunction_AfterDocumentSaved(java.lang.String value)
Sets a JavaScript function for AfterDocumentSaved event. |
void |
setJsFunction_BeforeDocumentClosed(java.lang.String value)
Sets a JavaScript function for BeforeDocumentClosed event. |
void |
setJsFunction_BeforeDocumentSaved(java.lang.String value)
Sets a JavaScript function for BeforeDocumentSaved event. |
void |
setJsFunction_OnExcelCellClick(java.lang.String value)
Sets a JavaScript function for OnExcelCellClick event. |
void |
setJsFunction_OnWordDataRegionClick(java.lang.String value)
Sets a JavaScript function for OnWordDataRegionClick event. |
void |
setMenubar(boolean value)
Sets a value that indicates whether the menu bar of AceoffixCtrl shows. |
void |
setMenubarColor(java.awt.Color value)
Sets the back color of the menu bar of the AceoffixCtrl. |
void |
setMenubarTextColor(java.awt.Color value)
Sets the text color of the menu bar of AceoffixCtrl. |
void |
setOfficeToolbars(boolean value)
Sets a value that indicates whether the tool bars of Microsoft Office shows. |
void |
setProtectPassword(java.lang.String value)
Sets protection password for the current Word or Excel document when the document has a protection password. |
void |
setSaveDataPage(java.lang.String saveDataPage)
Sets a value that indicates with which page developers would like to receive and save the data sent by AceoffixCtrl. |
void |
setSaveFileMaxSize(int value)
Sets the max size of saving document by AceoffixCtrl, in bytes. |
void |
setSaveFilePage(java.lang.String saveFilePage)
Sets a value that indicates with which page developer would like to receive and save the document sent by AceoffixCtrl. |
void |
setServerPage(java.lang.String serverPage)
Sets a value that indicates the URL of Aceoffix server page. |
void |
setTagId(java.lang.String id)
This method is very important. |
void |
setTheme(ThemeType value)
Sets the theme of the AceoffixCtrl. |
void |
setTimeSpan(int value)
Sets the time span of concurrency control, in minutes. |
void |
setTitlebar(boolean value)
Sets a value that indicates whether the title bar of the AceoffixCtrl shows. |
void |
setTitlebarColor(java.awt.Color value)
Sets the back color of the title bar of the AceoffixCtrl. |
void |
setTitlebarTextColor(java.awt.Color value)
Sets the text color of the title bar of the AceoffixCtrl. |
void |
setVisible(boolean value)
Sets a value that indicates whether AceoffixCtrl is visible when it is running. |
void |
wordCompare(java.lang.String documentURL,
java.lang.String documentURL2,
OpenModeType openMode,
java.lang.String userName)
Compares two different Word documents online. |
Methods inherited from class java.lang.Object |
---|
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Constructor Detail |
---|
public AceoffixCtrl(HttpServletRequest request)
Method Detail |
---|
public void setTagId(java.lang.String id) throws java.lang.Exception, java.io.IOException
The following example shows how to open a Word document online.
AceoffixCtrl aceCtrl1 = new AceoffixCtrl(request); //Set the server page of AceoffixCtrl. aceCtrl1.setServerPage("server.ace"); // Required //Set UI theme. aceCtrl1.setCaption("test.doc"); aceCtrl1.setTheme(ThemeType.Office2010); aceCtrl1.setBorderStyle(BorderStyleType.BorderFlat); //Hide menu bar. aceCtrl1.setMenubar(false); //Hide Office tool bars. aceCtrl1.setOfficeToolbars(false); //Set the page for saving the current document. aceCtrl1.setSaveFilePage("savefile.jsp"); //Open a Word document with OpenModeType.docNormalEdit mode. aceCtrl1.openDocument("doc/test.doc", OpenModeType.docNormalEdit, "John Scott"); aceCtrl1.setTagId("AceoffixCtrl1");
id
- The id is in the HTML code where the tag of AceoffixCtrl is. And it can be defined by developer.
java.lang.Exception
java.io.IOException
FileRequest.saveToFile() to learn how to get the file submitted by AceoffixCtrl by writing code of savefile.jsp page.
public void setBorderStyle(BorderStyleType value)
value
- The default value is BorderStyleType.BorderFlat.public void setBorderColor(java.awt.Color value)
value
- The default value is system button shadow color.public void setTheme(ThemeType value)
value
- The default value is ThemeType.Office2010.public void setTitlebar(boolean value)
value
- The default value is true.public void setTitlebarColor(java.awt.Color value)
value
- The default value is active caption color.public void setTitlebarTextColor(java.awt.Color value)
value
- The default value is active caption text color.public void setMenubar(boolean value)
value
- The default value is true.public void setMenubarColor(java.awt.Color value)
value
- The default value is system menu back color.public void setMenubarTextColor(java.awt.Color value)
value
- The default value is system window text color.public void setCustomToolbar(boolean value)
value
- The default value is true.public void setOfficeToolbars(boolean value)
value
- The default value is true.public void setCaption(java.lang.String value)
value
- The default value is "Aceoffix".public void setAllowCopy(boolean value)
value
- The default value is true.public void setFileTitle(java.lang.String value)
value
- The default value is the default file name.public void setServerPage(java.lang.String serverPage)
This is an important property of AceoffixCtrl. The Aceoffix server page provides running services for AceoffixCtrl. Before calling openDocument, wordCompare or createNewDocument method, you must set the ServerPage property.
The following example shows how to use ServerPage property.
aceCtrl1.setServerPage("server.ace"); // Required aceCtrl1.openDocument("doc/test.doc", OpenModeType.docNormalEdit, "John Scott"); aceCtrl1.setTagId("AceoffixCtrl1"); // Required
serverPage
- The serverPage has no default value. ServerPage is the URL of Aceoffix server page.
The URL can be a relative URL or a complete URL which starts with "http". The relative URL can be relative to the URL of current page and it also can be a root relative URL. The root relative URL starting with "/" is relative to the root path of the web application.
Note: If the URL is a complete URL, make sure that this URL must link to the current website instead of other websites.
AceoffixCtrl.setTagId() to learn how to open document online.
public void setSaveFilePage(java.lang.String saveFilePage)
This is an important property of AceoffixCtrl. If you need to save the document modified by user, you must set a value to SaveFilePage property before you call the OpenDocument or CreateNewDocument method. SaveFilePage is the URL of Web page used to receive and save document.
When AceoffixCtrl is saving document, AceoffixCtrl will first submit data extracted from the document to page specified by SaveDataPage and then submit the document file to page specified by SaveFilePage.
If the SaveDataPage property is not assigned, submitting data action will not execute. If the SaveFilePage property is not assigned, submitting file action will not execute. If both SaveDataPage property and SaveFilePage property are not assigned, AceoffixCtrl will report an error when saving document.
The following example shows how to use SaveFilePage property.
aceCtrl1.setServerPage("server.ace"); // Required aceCtrl1.setSaveFilePage("savefile.jsp"); // Set savefile.jsp to save file. aceCtrl1.openDocument("doc/test.doc", OpenModeType.docNormalEdit, "John Scott"); aceCtrl1.setTagId("AceoffixCtrl1"); // Required
saveFilePage
- The saveFilePage has no default value. SaveFilePage is the URL of Web page used to receive and save document.
The URL can be a relative URL or a complete URL which starts with "http". The relative URL can be relative to the URL of current page and it also can be a root relative URL. The root relative URL starting with "/" is relative to the root path of the web application.
Note: If the URL is a complete URL, make sure that this URL must link to the current website instead of other websites.
AceoffixCtrl.setTagId() to learn how to open document online.
public void setSaveDataPage(java.lang.String saveDataPage)
This is an important property of AceoffixCtrl. If you need to save data inputted by user in the document, you must set a value to SaveDataPage property before you call the OpenDocument method. SaveDataPage is the URL of Web page used to receive and save data from the document.
If the document is Word document, the OpenMode in OpenDocument must be Aceoffix.OpenModeType.docSubmitForm. If the document is Excel document, the OpenMode in OpenDocument must be Aceoffix.OpenModeType.xlsSubmitForm.
After setting SaveDataPage property, you should create the SaveData page to receive and save the data sent by AceoffixCtrl. In SaveData page, you must create com.acesoft.aceoffix.wordreader.WordDocument or com.acesoft.aceoffix.excelreader.Workbook object to get data from the document.
When AceoffixCtrl is saving document, AceoffixCtrl will first submit data extracted from the document to page specified by SaveDataPage and then submit the document file to page specified by SaveFilePage.
If the SaveDataPage property is not assigned, submitting data action will not execute. If the SaveFilePage property is not assigned, submitting file action will not execute. If both SaveDataPage property and SaveFilePage property are not assigned, AceoffixCtrl will report an error when saving document.
The following example shows how to use SaveDataPage property.
Word code example:
aceCtrl1.setServerPage("server.ace"); // Required WordDocument wd = new WordDocument(); DataRegion dataRegion = wd.openDataRegion("name"); dataRegion.setEditing(true); aceCtrl1.setSaveDataPage("savedata.jsp"); aceCtrl1.bind(wd);// The data source is a WordDocument object. aceCtrl1.openDocument("doc/test.doc", OpenModeType.docSubmitForm, "Tom"); aceCtrl1.setTagId("AceoffixCtrl1"); // Required
Excel code example:
aceCtrl1.setServerPage("server.ace"); // Required Workbook wb = new Workbook(); Cell cell1 = wb.openSheet("Order").OpenCell("B5"); cell1.setReadOnly(false);// Enable edit aceCtrl1.setSaveDataPage("savedata.jsp"); aceCtrl1.bind(wb);// The data source is a Workbook object. aceCtrl1.openDocument("doc/test.xls", OpenModeType.xlsSubmitForm, "Tom"); aceCtrl1.setTagId("AceoffixCtrl1"); // Required
saveDataPage
- The property has no default value. SaveDataPage is the URL of Web page used to receive and save data from the document.
The URL can be a relative URL or a complete URL which starts with "http". The relative URL can be relative to the URL of current page and it also can be a root relative URL. The root relative URL starting with "/" is relative to the root path of the web application.
Note: If the URL is a complete URL, make sure that this URL must link to the current website instead of other websites.
public void setSaveFileMaxSize(int value)
value
- The default value is 0 which means that there is no limit to the size of saving document.public void setCompressDocument(boolean value)
If the value is true, AceoffixCtrl will compress the document and then save the compressed document to the Web server. When opening the compressed document next time, AceoffixCtrl can automatically identify it and open it. The advantages of using CompressDocument property are saving the space of server disk, reducing network traffic and speeding up opening or saving document. The disadvantage of using CompressDocument property is that the compressed format cannot be easily identified by other softwares and the users logged on the Web server cannot open the compressed documents by double-clicking. Typically, there is no need to use this property.
value
- The default value is false.public void setHTTPBasic_UserName(java.lang.String value)
public void setHTTPBasic_Password(java.lang.String value)
public void setTimeSpan(int value)
When many people attempt to modify a document online at the same time, a document lock must be implemented so that modifications made by one person do not adversely affect those of another persons. This is called document concurrency in Aceoffix.
If the value of TimeSpan is greater than 0, the concurrency control will be started to control the current document.
The value of TimeSpan means how many minutes a owner can lock the document.
When TimeSpan is timeout, Aceoffix will automatically release the lock and the owner cannot save the document. If the owner closes the document before the TimeSpan is timeout, Aceoffix also will automatically release the lock. After the lock is released, other user can open the document for editing immediately.
During the lock is valid, other users can open the document as read-only.
The
- default value is 0 which means that the current document do not use concurrency control.public void setJsFunction_AfterDocumentOpened(java.lang.String value)
This event is triggered at the client-side after the document is opened. If you want to capture this event, You should define a JavaScript function in the current page.
The following code example shows how to use the JsFunction_AfterDocumentOpened property.
aceCtrl1.setJsFunction_AfterDocumentOpened("AfterDocumentOpened()");
And then, you should define the AfterDocumentOpened() JavaScript function in the current page.
<script language="javascript" type="text/javascript"> function AfterDocumentOpened() { // Add your code here. } </script>
public void setJsFunction_AfterDocumentClosed(java.lang.String value)
This event is triggered at the client-side after the document is closed. If you want to capture this event, You should define a JavaScript function in the current page.
The following code example shows how to use the JsFunction_AfterDocumentClosed property.
aceCtrl1.setJsFunction_AfterDocumentClosed("AfterDocumentClosed()");
And then, you should define the AfterDocumentClosed() JavaScript function in the current page.
<script language="javascript" type="text/javascript"> function AfterDocumentClosed() { // Add your code here. } </script>
public void setJsFunction_AfterDocumentSaved(java.lang.String value)
This event is triggered at the client-side after the document is saved. If you want to capture this event, You should define a JavaScript function in the current page.
The following code example shows how to use the JsFunction_AfterDocumentSaved property.
aceCtrl1.setJsFunction_AfterDocumentSaved("AfterDocumentSaved()");
And then, you should define the AfterDocumentSaved() JavaScript function in the current page.
<script language="javascript" type="text/javascript"> function AfterDocumentSaved() { // Add your code here. } </script>
public void setJsFunction_BeforeDocumentClosed(java.lang.String value)
This event is triggered at the client-side before the document is closed. If you want to capture this event, You should define a JavaScript function in the current page.
In the JavaScript function, you can return false to prevent from closing the document.
But returning false cannot prevent web browser from being closed. If you want to check whether current document is modified and notice user to save document before close page, we recommend you write code into onunload event of the page.
The following code example shows how to use the JsFunction_BeforeDocumentClosed property.
aceCtrl1.setJsFunction_BeforeDocumentClosed("BeforeDocumentClosed()");
And then, you should define the BeforeDocumentClosed() JavaScript function in the current page.
<script language="javascript" type="text/javascript"> function BeforeDocumentClosed() { // Add your code here. return true; } </script>
public void setJsFunction_BeforeDocumentSaved(java.lang.String value)
This event is triggered at the client-side before the document is saved. If you want to capture this event, You should define a JavaScript function in the current page.
In the JavaScript function, you can return false to prevent from saving the document.
The following code example shows how to use the JsFunction_BeforeDocumentSaved property.
aceCtrl1.setJsFunction_BeforeDocumentSaved("BeforeDocumentSaved()");
And then, you should define the BeforeDocumentSaved() JavaScript function in the current page.<
<script language="javascript" type="text/javascript"> function BeforeDocumentSaved() { // Add your code here. return true; } </script>
public void setJsFunction_OnWordDataRegionClick(java.lang.String value)
This event is triggered when user clicks the DataRegion predefined in Word document. If you want to capture this event, you should define a JavaScript function in the current page.
In the JavaScript function, you can return a value to set the value of DataRegion.
The following code example shows how to use the JsFunction_OnWordDataRegionClick property.
aceCtrl1.setJsFunction_OnWordDataRegionClick("OnWordDataRegionClick()");
And then, you should define OnWordDataRegionClick() function in the current page.
<script language="javascript" type="text/javascript"> function OnWordDataRegionClick(Name, Value, Left, Bottom) { if (Name == "ACE_N004") { return "Developer can raise a dialog box at here and get the value inputted by user."; } } </script>
public void setJsFunction_OnExcelCellClick(java.lang.String value)
This event is triggered when user clicks the cell in Excel document. If you want to capture this event, you should define a JavaScript function in the current page.
In the JavaScript function, you can return a value to set the value of the current Cell.
The following code example shows how to use the JsFunction_OnExcelCellClick property.
aceCtrl1.setJsFunction_OnExcelCellClick("OnExcelCellClick()");
And then, you should define the OnExcelCellClick() JavaScript function in the current page.
<script language="javascript" type="text/javascript"> function OnExcelCellClick(CellAddress, Value, Left, Bottom) { if (CellAddress == "Sheet!$B$5") { return "Developer can raise a dialog box at here and get the value inputted by user."; } } </script>
public void setCustomMenuCaption(java.lang.String value)
value
- The default value is "Custom Me&nu".public void setProtectPassword(java.lang.String value)
public void setVisible(boolean value)
public void setEnableUserProtection(boolean value)
value
- The default value is false.public RibbonToolbar getRibbonBar() throws java.lang.Exception
java.lang.Exception
public void setInstallationHint(java.lang.String value)
public void addCustomMenuItem(java.lang.String caption, java.lang.String jsFunction, boolean enabled) throws java.lang.Exception
The following code example shows how to use the addCustomMenuItem method.
aceCtrl1.setCustomMenuCaption("My &Tools"); aceCtrl1.addCustomMenuItem("&Show revisions", "OnCustomMenuClick()", true); aceCtrl1.addCustomMenuItem("&Hide revisions", "OnCustomMenuClick()", true); aceCtrl1.addCustomMenuItem("-", "", true); aceCtrl1.addCustomMenuItem("&Accept all revisions", "DoAcceptAll()", false);
And then, you should define the JavaScript functions in the current page.
<script language="javascript" type="text/javascript"> function OnCustomMenuClick(iIndex, sCaption) { var AceoffixCtrl1 = document.getElementById("AceoffixCtrl1"); if (iIndex == 0) AceoffixCtrl1.ShowRevisions = true; if (iIndex == 1) AceoffixCtrl1.ShowRevisions = false; } function DoAcceptAll() { document.getElementById("AceoffixCtrl1").AcceptAllRevisions(); } </script>
caption
- The caption of new menu item. If the caption is "-", means that this menu item is separator.jsFunction
- The name of JavaScript function. The JavaScript function will be called when user clicks this menu item.enabled
- true: Enable menu item. false: Disable menu item and menu item appears in grey.
java.lang.Exception
public void addCustomToolButton(java.lang.String caption, java.lang.String jsFunction, int iconIndex) throws java.lang.Exception
The following code example shows how to use the AddCustomToolButton method.
aceCtrl1.addCustomToolButton("Save", "SaveDocument()", 1); aceCtrl1.addCustomToolButton("Print", "ShowPrintDlg()", 6); aceCtrl1.addCustomToolButton("-", "", 0); aceCtrl1.addCustomToolButton("Switch Full-screen", "SwitchFullScreen()", 4);
And then, you should define the JavaScript functions in the current page.
<script language="javascript" type="text/javascript"> function SaveDocument() { document.getElementById("AceoffixCtrl1").SaveDocument(); } function ShowPrintDlg() { document.getElementById("AceoffixCtrl1").ShowDialog(4); //Print dialog box } function SwitchFullScreen() { document.getElementById("AceoffixCtrl1").FullScreen = !document.getElementById("AceoffixCtrl1").FullScreen; } </script>
caption
- The caption of new button item. If the caption is "-", means that this button item is separator.jsFunction
- JavaScript The name of JavaScript function. The JavaScript function will be called when user clicks this button.iconIndex
- The index of button icon. Aceoffix predefines some button icons and you can use one of them. The default value is 0. Possible values as following:
java.lang.Exception
public void bind(java.lang.Object writerObj) throws java.lang.Exception, java.io.IOException
When output data to Word document or Excel workbook, you must create a com.acesoft.aceoffix.wordwriter.WordDocument object or a com.acesoft.aceoffix.excelwriter.Workbook object, and call Bind method to set data source object to AceoffixCtrl. If you need to call Bind method, you must call it before calling openDocument or createNewDocument method.
The type of writerObj parameter should be the same as the type of document opened through OpenDocument method. For example, if writerObj is a WordDocument object, the parameter of writerObj must be com.acesoft.aceoffix.wordwriter.WordDocument object.
The following code example shows how to use the Bind method.
Word code example:
WordDocument wd = new WordDocument(); DataRegion dataRegion = wd.openDataRegion("name"); dataRegion.setValue("John"); aceCtrl1.bind(wd); //The data source is the com.acesoft.aceoffix.wordwriter.WordDocument object.
Excel code example:
Workbook wb = new Workbook(); Sheet sheetOrder = wb.openSheet("Order"); sheetOrder.OpenCell("B5").setValue("John"); aceCtrl1.bind(wb); //The data source is the com.acesoft.aceoffix.excelwriter.Workbook object.
writerObj
- Data source object. Available object types are com.acesoft.aceoffix.wordwriter.WordDocument and com.acesoft.aceoffix.excelwriter.Workbook.
java.lang.Exception
java.io.IOException
public void openDocument(java.lang.String documentURL, OpenModeType openMode, java.lang.String userName) throws java.lang.Exception, java.io.IOException
This is the important method of AceoffixCtrl. It is used to open an Office document online.
The openDocument method should be called at the end of code called by AceoffixCtrl.
Code example: Open the test.doc document and set the document in editable state.
aceCtrl1.setServerPage("server.ace"); //Required //Open the document with URL. aceCtrl1.openDocument("doc/test.doc", OpenModeType.docNormalEdit, "John"); //Open the document from disk path on server. aceCtrl1.openDocument("D:\\documents\\test.doc", OpenModeType.docNormalEdit, "John");
documentURL
- The URL of the document which is going to be opened.
The document can be a file from Web folder and also can be a binary stream outputted by server page. However, the document must be Office document format.
Aceoffix supports many document formats, such as *.doc,*.docx,*.xls,*.xlsx,*.ppt,*.pptx,*.vsd and *.mpp.
The URL can be a relative URL or a complete URL which starts with "http". The relative URL can be relative to the URL of current page and it also can be a root relative URL. The root relative URL starting with "/" is relative to the root path of the application. New feature: The URL can be the physical disk path of the document file on the server. For example: D:\\docfiles\\test.doc.
Note: If the URL is a complete URL, make sure that this URL must link to the current website instead of other websites.
openMode
- The open mode AceoffixCtrl should use after the document is opened. Make sure that the openMode is consistent with the file type of the document.userName
- The operator of the current document. Typically, userName should be the name of current user who has logged in your web application.
java.lang.Exception
java.io.IOException
public void createNewDocument(java.lang.String userName, DocumentVersion docVersion) throws java.lang.Exception, java.io.IOException
If you want to create a new document and open it for editing online, you need to use createNewDocument method. The createNewDocument method should be called at the end of code called by AceoffixCtrl.
Creating new document on Web server is very different from creating new document on local computer. Creating new document on Web server must consider the compatibility with all the Microsoft Office softwares installed on client computers. In order to keep the compatibility of Office software version, you should choose the lower DocumentVersion when you create a new document by createNewDocument method.
The following code example shows how to use the createNewDocument method to create a blank document in Word2003 format.
Word code example:
aceCtrl1.setServerPage("server.ace"); //Required aceCtrl1.setSaveFilePage("savefile.jsp?id=1&op=new"); aceCtrl1.webCreateNew("John", DocumentVersion.Word2003);
userName
- The operator of the current document. Typically, userName should be the name of current user who has logged in your web application.docVersion
- The document type and version.
java.lang.Exception
java.io.IOException
public void wordCompare(java.lang.String documentURL, java.lang.String documentURL2, OpenModeType openMode, java.lang.String userName) throws java.lang.Exception, java.io.IOException
documentURL
- The first Word document. Please refer to the openDocument method topic to learn how to use URL.documentURL2
- The second Word document. Please refer to the openDocument method topic to learn how to use URL.openMode
- The open mode of the document. Only docFinalizeDraft and docReadOnly are valid here. When comparative result is displayed in docFinalizeDraft mode, users can edit the comparative result. When comparative result is displayed in docReadOnly mode, user can only view the comparative results.userName
- The operator of the current document. Typically, userName should be the name of the current user who has logged in your web application.
java.lang.Exception
java.io.IOException
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |