Online word editing

Source: Internet
Author: User

In ourOAA common requirement in a project is the online document editing function. In normalOAProducts are generally integrated with some third-partyOfficeComponents, suchNtkoWait, the third-party component functions are very powerful, and I am not very clear about the implementation details of these functions, but for Online Editing alone, there is now a relatively simple solution, that is, the useHTTP 1.1ExtendedWebDAV(Web Distributed Authoring and Versioning).

WebDAVYou can directly use your browser and network neighbors to manage remote data.WebOn the serverWebDAVFiles in the folderWindowsIn the system, coordination between the server and the client is required to complete this function.

Server Settings Start WebDAVExtension ( Use Sharepoint. opendocuments Not Required )

InIISSelect"WebService extension ", findWebDAVAnd then allow.

Because online editing requires you to directly modify the server files on the client, you must enable the "write" permission in the site or virtual directory:

 

In Directory Security, my current setting here is to enable Anonymous access so that Internet users can access the site without enabling "integration ".WindowsTo avoid entering the user name and password when accessing the site. However, because the "write" permission is enabled, this poses a security risk to the server. Therefore, you must take appropriate security policies based on your own situation when setting the permission. My currentProgramIs running on the IntranetOASo the security level is very low, so I made this setting.

You have enabled the "write" permission for the site or virtual directory, enabled the default anonymous account, and disabled "integration ".WindowsAfter Authentication, you need to set permissions for the directory where the files that are allowed to be modified are stored.

The Directory of my stored files isAttachmentWhich stores the files that I want to open to the target audience or collaborate to edit.Vs2008After the default release, its permissions inherit the parent directory by default. Therefore, you must first cancel the inheritance and then set your own permissions:

Remove "allow the inheritance permission of the parent item to be propagated to this object and all sub-objects, including those clearly defined projects", and click application. The above dialog box is displayed, click "copy" to copy the parent permission to the current directory.AttachmentThere is a parent directory permission, saving the effort to define some basic permissions. If you click DeleteAttachmentThe directory will become empty, and then you have to add some basic permissions step by step, suchAdministrator.

After obtaining the permissions of the parent objectInternetThe Guest account is rejected. Edit the account and click"InternetGuest account, and then click "edit". The following dialog box is displayed:

Here, the read, change, and write permissions must be set. Otherwise, the read permission may not be readable, or the read permission cannot be modified. Of course, this should be based on your needs. If you just want users to open the browser without changing it, you can remove the "change" and "write" permissions as appropriate. My current requirement is to be able to read and write, but not to delete, So I removed two options related to "delete. After confirming the permissions to be set, click "OK.

To enableAttachmentThe permission set in the directory allows sub-directories and files to be inherited accordingly. You also need to select the "use the project displayed here to apply to sub-objects to replace all sub-objects" check box, in this way, the permissions set in the parent directory can overwrite the permissions of all subdirectories and files, so that we can manage them in a unified manner.

After the preceding settings, the server configuration is complete.

Client

If you need to use a browser to open and edit documents on the server, you need to openWebClientThis service. However, my current requirement is to enable the server on the client side.WordDocumentation. You can use other methods.

InOffice XPLater,OfficeAfter installation,OCXControl. This control allows us to call it to edit files on the server. We can useJavascriptScript to call it:

FunctionGetspopenappsentobject (){

If(Window. shortpoingopentdocuments ){

ReturnWindow. Sort poingopentdocuments;

}

Else{

VaRProgids = ["Sharepoint. opendocuments.3","Sharepoint. opendocuments.2","Sharepoint. opendocuments.1"];

For(VaRI = 0; I <progids. length; ++ I ){

Try{

Return(Window. Export poingopentdocuments =NewActivexobject (progids [I]);

}

Catch(E)

{}

}

 

Return Null;

}

}

After obtaining this object, we can useGetspopenappsentobject (). editdocument ('HTTP: // xxx.com/xx.doc ') To edit the document.

 

Note: This requirement does not actually involve the WebDAV function, but it is regarded as a record. To implement online editing, you only need to set the server permission and then call the OCX control on the client.
Because I edited it in word, and I didn't keep the captured image file, but I couldn't bring a piece into the essay, So I uploaded the Word file, if you want to view images, you can directly view the Word documents:
Word File Download

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.