Summary of the invention
The present invention is intended to provide a kind of file edition management method and system, with solve cross-platform file edition management with
And the problem of restoring files.
For this purpose, the invention provides the following technical scheme:
A kind of file edition management method, comprising:
In client, com component is set;
File object is created, and by com component the corresponding physical file of the file object is uploaded onto the server,
And the version information of the file object is recorded in version information table, the physical file is recorded in the information table of file address
Store information;
Operation is updated to the file object using the method in WebService, and will be updated by com component
During the corresponding physical file of file object afterwards is uploaded onto the server, and the new of the file object is recorded in version information table
Version information;
Operation is downloaded to the file object using the method in WebService.
Preferably, the file object includes: the address of file or folder, title, version information.
Preferably, the method using in WebService is updated operation to the file object and includes:
The file object is carried out to check out operation by the CheckOut method provided in WebService;
Check-in operation is carried out to the file object checked out by the CheckIn method provided in WebService.
Preferably, the method also includes:
File object is carried out after checking out operation, file check out recorded in table the file object be check out state, institute
File is stated to check out in table comprising for recording corresponding informance of the obj ect file checked out in version information table.
Preferably, the CheckIn method by providing in WebService signs the file object checked out
Entering operation includes:
Determine the address information of file object to be checked in;
It is checked out according to the address information from the file and checks whether the file object is in the state of checking out in table, and
Check whether the file object has correct version information;
If detecting that the file object is in the state that checks out and has correct version information, to the file pair
As carrying out check-in operation.
Preferably, the method also includes:
The operation that labels is carried out to directory object by the MarkLabel method provided in WebService.
A kind of file edition management system, comprising:
Setup module, for com component to be arranged in client;
File object creation module, for creating file object;
Uploading module, used in the corresponding physical file of the file object to be uploaded onto the server by com component;
Logging modle, for recording the version information of the file object in version information table, in file address information
The physical file storage information is recorded in table;
File object update module, for being updated behaviour to the file object using the method in WebService
Make;
The uploading module is also used to upload to the corresponding physical file of updated file object by com component
In server;
The logging modle is also used to record the new version information of the file object in version information table;
Download module, for being downloaded operation to the file object using the method in WebService.
Preferably, the file object update module includes:
Operating unit is checked out, the file object is carried out for the CheckOut method by being provided in WebService
Check out operation;
Operating unit is checked in, for the CheckIn method by providing in WebService to the file object checked out
Carry out check-in operation.
Preferably, the logging modle is also used to check out after operating unit carries out checking out operation to file object described,
It is checked out in file and records the file object in table to check out state, it includes to be checked out in table for recording that the file, which checks out,
Corresponding informance of the obj ect file in version information table.
Preferably, the check-in operating unit includes:
Subelement is determined, for determining the address information of file object to be checked in;
Subelement is checked, for checking out whether check the file object in table from the file according to the address information
In the state that checks out, and check whether the file object has correct version information;
Subelement is operated, for detecting that the file object is in the state that checks out and with just in the inspection subelement
True version information then carries out check-in operation to the file object.
Preferably, the system also includes:
Label module, carries out mark to directory object for the MarkLabel method by providing in WebService
Label operation.
The file edition management method and system of the above embodiment of the present invention use WebService technology, overcome
Obstacle is accessed between platform, has achieved the effect that cross-platform operation.
Specific embodiment
The scheme of embodiment in order to enable those skilled in the art to better understand the present invention with reference to the accompanying drawing and is implemented
Mode is described in further detail the embodiment of the present invention.
The present invention provides a kind of file edition management method and device thereof, for realizing in software system development to text
The version management of part and the function of restoring files.In embodiments of the present invention, file or folder is uniformly put into service
It is managed.It is embedded in com component in client, which is responsible for being communicated with server, and component is by all FileVersions
It manages relevant operation and is all encapsulated in component internal, outside does not have to the details of concerned with internal file edition management, calls directly COM
The interface that component provides, Lai Shixian file download upload, and submit the correlation function of version.
In embodiments of the present invention, each file or file are indicated by file object, the format of file object
Such as: FFS: 1/ file of // file, 2/ file: the character string of version number, between each client or server-side and client
When end carries out the transmitting of file, character string as shown above is only transmitted, then give the character string to insertion by client
Com component, com component are communicated by the character string with server end, and specific file or folder content are got visitor
The specified position in family end, realizes the downloading of file.
Further, in embodiments of the present invention, file download or upload when also there is verifying function.Specifically, literary
When part is downloaded, com component gets the MD5 check code of this document from server end first, to file after the completion of file download
The verification code value for recalculating MD5, is compared with the check code got before.If check code is identical, then it represents that file
It transmits errorless;If check code is different, supporting paper downloading is wrong, needs to re-download.When file uploads, in order to reduce not
Necessary upload number, the MD5 of the first calculation document of meeting verifies code value before uploading, and the verification code value is first sent to server
End, if the code value has existed in server end, then it represents that this document has existed in server end, i.e., without uploading, directly
It connects and can return to upload successfully mark.
In embodiments of the present invention, server end and the communication mode of client use Web Service, Web
Services is by the application on site service of its specific business needs of the completion of enterprise's publication, other companies or application software can
It is accessed by internet and uses this online service.Data and service are provided to its logicality for other applications, respectively
Application program accesses Web Service by network protocol and defined some standard data formats (Http, XML, Soap),
Obtain required as a result, Web Service can be executed from simple request to complicated commercial affairs by being executed inside Web Service
Any function of processing.
Client file calibration technology can use MD5 algorithm, and MD5 is message digest algorithm, it can be to any file
Generate a unique MD5 identifying code, once this file in transmission process, if content is damaged or is modified,
The MD5 code of so this file will change, and by the verifying to file MD5, can learn whether the file of acquisition is complete
It is whole.
Com component is the behavior exploitation that Microsoft is more in line with the mankind for the software production of computer industry
A kind of new software development technique.Under COM framework, people can develop various function-specific components, then
They are combined as required, constitutes complicated application system.Some advantages that arise therefrom is various: can be by system
In component replaced with new, to carry out the upgrading and customization of system at any time;Benefit can be repeated in multiple application systems
With the same component;What be can be convenient expands to application system under network environment;COM and language, platform-independent characteristic make
The ability and intelligence and speciality that all programmers can give full play to oneself write assembly module.
For the convenience of description, by the Data Sheet Design in the embodiment of the present invention, in which:
Database structure used in the embodiment of the present invention is done a simple declaration first by FileObj_Info, such as Fig. 2 institute
Show.Including:
FileObj_Info, this table are used to record file object and directory object (FileObj), are treelike structural table.
FileObj_ID(major key ID), FileObj_ParentID(father ID), file and directory object are referred to as
FileObj, and (FileObj_Type=0 is directory object, and 1 is file object) is distinguished with FileObj_Type field.
FileObj_Version, this table are used to record All Files object version information, and check-in operation every time can be to increase
The file of one new version.
FileObj_CheckOut, what this table was used to record file object checks out state, when file object is checked out, no
Allow to operate file.
FileObj_Label, this table are used to record the label of directory object.
File_Info, this table are used to record the storage information of physical file corresponding to file object.
User, this table are used to record operation user.
Based on above-mentioned database structure, file edition management method of the embodiment of the present invention is done further specifically below
It is bright.
As shown in Fig. 2, being the flow chart of file edition management method of the embodiment of the present invention, comprising the following steps:
Step 201, com component is set in client.
Step 202, file object is created, and is uploaded to the corresponding physical file of the file object by com component
In server, and the version information of the file object is recorded in version information table, institute is recorded in the information table of file address
State physical file storage information.
It is specifically as follows: provides a customized directory address for create directory object and file object, such as
Location ffs: in // directory A/directory A B/ file ABC:0, directory A and directory A B are directory object, for indicating directory object name
Claiming, file ABC:0 is file object, and file ABC is file object title: 0 is fileversion number.Create the directory object and
File object embodies mesh with tree structure (FileObj_ID, FileObj_ParentID) in FileObj_Info table
Object and file object structure are recorded, being distinguished with FileObj_Type field is directory object or file object.
The creation of file object can follow following rule:
1, in the table default there are root object/, all FileObj in root object/lower creation, there is no with
The FileObj of root object peer.
2, it is not allow for that FileObj identical (file object allows to possess different editions, uses file under peer FileObj
Object name: version number is distinguished).
After the completion of creating FileObj, by the method for uploading provided in com component, physical file is uploaded to and is set in advance
In the ftp server set, and file object version information is added in FileObj_Version table, add in File_Info table
Physical file is added to store information.
Step 203, the file object is updated using the method in WebService, and will by com component
During the corresponding physical file of updated file object is uploaded onto the server, and the file object is recorded in version information table
New version information.
It is above-mentioned that the operation including being checked out, being checked in file object is updated to file object.
It is described check out (CheckOut) operation refer to visitor will to this document object execute modification operation, this document object
Occupied by current visitor, before the visitor is not carried out check-in (CheckIn) operation, other visitors do not allow to sign again
This file object out.
The concrete operations checked out are as follows: provide one for accessing the address of file object, such as step by visitor first
Address ffs in 202: // directory A/directory A B/ file ABC:0, it can be with by the CheckOut method that is provided in WebService
File ABC:0 is carried out to check out operation, the file record in the state that checks out is in FileObj_CheckOut table.FileObj_
FileVer_ID field is used to record the corresponding letter in FileObj_Version table of the file checked out in CheckOut table
Breath.
Check-in (CheckIn) operation proposes the file object execution write operation that refers to and will once check out.
The concrete operations of check-in are as follows: based on the above-mentioned file object checked out, check-in operation can be carried out to it, passed through
The CheckIn method provided in WebService carries out check-in operation to file ABC:0, when executing check-in operation, needs to mention
For a FileObj address information to be checked in, address described in step 202 is continued to use, detects whether the FileObj is signed first
(information is checked out in detection FileObj_CheckOut table) out, then detect the version information of the FileObj with the presence or absence of (detection
This document object version in FileObj_Version).When detect the FileObj be in check out state and detect correctly
FileObj version information (if detecting version information from FileObject_Version table, as correct FileObj
Version information) when, check-in operation is carried out to it.If the version information detected is incorrect, assert that this time check-in operation is lost
It loses.
Check-in operation will be deleted the information that checks out of the FileObj first, then the upload side by providing in com component
Method carries out upload operation to it, and the check-in new version information of the FileObj can be finally recorded in FileObj_Version table,
Version number is that the current latest edition number got adds 1.
Step 204, operation is downloaded to the file object using the method in WebService.
The concrete operations of downloading are as follows: provide one for downloading the address of file object, such as above-mentioned check-in by visitor
The newly-increased file object address ffs: // directory A/directory A B/ file ABC:1 of operation, passes through what is provided in WebService
DownloadFfsFile method can be downloaded operation to file ABC:1, and (method for down loading in the WebService is pair
The calling that method for down loading in com component carries out).This method inquires version information (different editions corresponding to FileObj first
The corresponding physical address of FileObj it is different, determine that the corresponding different physical files of different editions are shown in tables of data Fig. 1.
File_ID is recorded in FileObj_Version table, which is the major key of File_Info table, is recorded in File_Info table
The physical address of file.), next searches actual physical address information corresponding to the FileObj, by under com component
Support method is downloaded operation to it.
In embodiments of the present invention, the concrete operations that file object version information obtains are as follows: provide one and be used to obtain text
The address information of part object, such as address ffs: // directory A/directory A B/ file ABC, FileObj file ABC is in above-mentioned check-in
It has increased a version in operation newly, has there is version 0 and version 1 at present.Providing method GetFileVersion can in WebService
To return to a FileObj_Version array about this document object, wherein including version 0 and version 1.
It should be noted that in embodiments of the present invention, it can also be using the method provided in WebService to catalogue
Object carries out the operation that labels.
The operation (MarkLabel) that labels is that single or multiple file objects are marked, and is used for sort file
Object records the version information of certain current file object.
The concrete operations that directory object labels are as follows: the operation that labels can be carried out to a certain catalogue, directory object labels
Operation the All Files object under the catalogue that needs label can be all created a new version and saved, can be in access
It is accessed with directory object name tag name, such as ffs: // directory A label A/directory A B/ file ABC:1.In WebService
Providing method MarkLabel can carry out the operation that labels to above-mentioned catalogue, first look for the All Files object under the catalogue,
Then file object is increased a new version and records the label of this document object by circulate operation.Mark can be passed through in access
It signs to find file corresponding under the catalogue.
File or folder is uniformly put into service and is managed by the file edition management method of the embodiment of the present invention.
It is embedded in com component in client, which is responsible for being communicated with server, and component is relevant by all file edition managements
Operation is all encapsulated in component internal, and outside does not have to the details of concerned with internal file edition management, calls directly com component offer
Interface, Lai Shixian file download upload, and submit the correlation function of version.Access obstacle between platform to overcome, reached across
The effect of platform operation.
Correspondingly, the embodiment of the present invention also provides a kind of file edition management system, as shown in figure 3, being the one of the system
Kind structural schematic diagram.
The system includes:
Setup module 301, for com component to be arranged in client;
File object creation module 302, for creating file object;
Uploading module 303, for the corresponding physical file of the file object to be uploaded onto the server by com component
In;
Logging modle 304 is believed for recording the version information of the file object in version information table in file address
The physical file storage information is recorded in breath table;
File object update module 305, for being updated using the method in WebService to the file object
Operation;
The uploading module 303 is also used to upload the corresponding physical file of updated file object by com component
Into server;
The logging modle 304 is also used to record the new version information of the file object in version information table;
Download module 306, for being downloaded operation to the file object using the method in WebService.
Wherein, a kind of specific implementation structure of file object update module 305 includes:
Operating unit is checked out, the file object is carried out for the CheckOut method by being provided in WebService
Check out operation;
Operating unit is checked in, for the CheckIn method by providing in WebService to the file object checked out
Carry out check-in operation.
Correspondingly, logging modle 304 is also used to check out after operating unit carries out checking out operation to file object described,
It is the state that checks out that file, which checks out and records the file object in table, and the file checks out in table comprising for recording pair checked out
As corresponding informance of the file in version information table.
The check-in operating unit may include:
Subelement is determined, for determining the address information of file object to be checked in;
Subelement is checked, for checking out whether check the file object in table from the file according to the address information
In the state that checks out, and check whether the file object has correct version information;
Subelement is operated, for detecting that the file object is in the state that checks out and with just in the inspection subelement
True version information then carries out check-in operation to the file object.
In practical applications, the system can also further comprise:
The module that labels (not shown), for the MarkLabel method by being provided in WebService to directory object
Carry out the operation that labels.
The specific operation process of above-mentioned each module can refer to the description in the embodiment of the present invention method of front, no longer superfluous herein
It states.
File or folder is uniformly put into service and is managed by the file edition management system of the embodiment of the present invention.
All relevant operations of file edition management are all encapsulated in component internal, outside does not have to concerned with internal file edition management
Details calls directly the interface of com component offer, and Lai Shixian file download uploads, and submits the correlation function of version.To overcome
Obstacle is accessed between platform, has achieved the effect that cross-platform operation.
All the embodiments in this specification are described in a progressive manner, same and similar portion between each embodiment
Dividing may refer to each other, and each embodiment focuses on the differences from other embodiments.Especially for system reality
For applying example, since it is substantially similar to the method embodiment, so describing fairly simple, related place is referring to embodiment of the method
Part explanation.
Obviously, those skilled in the art should be understood that above-mentioned modules of the invention or each step can be used
General computer installation is realized.JAVA object+template side can be passed through as workbench operates the content that application is shown
Formula realizes that the mode that XML data source+XSLT conversion module equally also can be used is realized.Attribute field storage configuration, attribute word
Section application configuration, workbench application, which such as show at the modules, can be concentrated on a single computing device, or be distributed in multiple meters
It calculates on network composed by device, optionally, they can be realized with the program code that computing device can perform, so as to
It is stored in storage device and is performed by computing device, or they are fabricated to each integrated circuit modules,
Or single integrated circuit module is maked multiple modules or steps in them to realize.In this way, the present invention is not limited to
Any specific hardware and software combines.
The foregoing is only a preferred embodiment of the present invention, is not intended to restrict the invention, for the skill of this field
For art personnel, the invention may be variously modified and varied.All within the spirits and principles of the present invention, made any to repair
Change, equivalent replacement, improvement etc., should all be included in the protection scope of the present invention.