Summary of the invention
Embodiments provide and a kind of call the device of transmitting assembly, method and system, it is possible to effective raising should
Efficiency with exploitation.
A kind of device calling transmitting assembly, is connected with at least one transmitting assembly of peripheral hardware, including: encapsulation builds single
Unit, interactive unit and interface, wherein,
Described encapsulation construction unit, for determining the default parameters and default value that each of peripheral hardware transmitting assembly is corresponding,
Described default parameters and default value are packaged;
Described interactive unit, is used for determining modulation parameter, receives the parameter value that the described modulation parameter of input is corresponding, concurrently
Send the parameter value that described modulation parameter is corresponding;
Described interface, for loading the default parameters of described encapsulation construction unit encapsulation and corresponding default value, receives also
Resolve the parameter value that the described modulation parameter of described interactive unit transmission is corresponding, according to described default value and the parameter parsed
Value, calls the target transmitting assembly of peripheral hardware.
Preferably, said apparatus farther includes: display unit, wherein,
Described encapsulation construction unit, is further used for encapsulating the mode of at least one files passe and pattern, for described envelope
It is first that the mode of at least one files passe of dress builds corresponding html with the mode of each files passe in pattern with pattern
Element attribute;
Described interactive unit, is further used for receiving at least one target html element property values of input, and sends institute
State at least one target html element property values;
Described interface, is further used for receiving at least one target html element property values that described interactive unit sends,
Resolve at least one target html element property values described, according at least one target html element property values described, described
In the mode of at least one files passe of encapsulation construction unit encapsulation and pattern, select files the targeted manner and sample uploaded
Formula, and the targeted manner of described files passe and pattern are sent to the target transmitting assembly of described peripheral hardware;
Described display unit, for the files passe arrived according to target transmitting assembly and the described interface of described peripheral hardware
Targeted manner and pattern, the display dialog box of files passe and the button of files passe.
Preferably, described encapsulation construction unit, it is used for default parameters corresponding for each of peripheral hardware transmitting assembly and writes from memory
Recognize in the webuploader.js file that value is encapsulated into correspondence, and store described webuploader.js file;
Described interactive unit, the request parameter list of server end address and files passe for determining files passe is tune
Variable element, receives the parameter value that the server end address of described files passe is corresponding with the request parameter list of files passe;
Described interface, is further used for arranging the introducing path that each webuploader.js file is corresponding, according to institute
State introducing path, load webuploader.js file.
Preferably, described encapsulation construction unit, be used for encapsulating monofile upload mode and pattern, multiple document uploading mode and
Pattern, free hand drawing sheet upload mode and pattern and many pictures upload mode and pattern, and wherein, monofile uploads mode and pattern/mono-
Picture uploads mode and pattern, including: add " selection " button on the right side of element, when adding " uploading " after filesselected, " deleting
Remove " button hide " selection " button, and show upload progress;Multiple document uploading mode and pattern/many pictures upload mode and
Pattern, including: add the Add Files button, " starting to upload " button and " cancellation " button for element, by " interpolation file "
Button adds at least one file, and shows upload progress.
A kind of method calling transmitting assembly, connects at least one transmitting assembly, determines that each transmitting assembly is corresponding
Default parameters and default value, be packaged described default parameters and default value;Also include:
Determine modulation parameter, receive the parameter value that the described modulation parameter of input is corresponding;
Load the default parameters of described encapsulation and corresponding default value, and resolve the parameter value that described modulation parameter is corresponding;
According to described default value and the parameter value parsed, call the target transmitting assembly of peripheral hardware.
Preferably, said method farther includes: encapsulate mode and the pattern of at least one files passe, for described encapsulation
Mode and the mode of each files passe in pattern of at least one files passe build corresponding html element with pattern
Attribute;
After the parameter value that the described modulation parameter of described reception input is corresponding, in the acquiescence of the described encapsulation of described loading
Before parameter and corresponding default value, farther include: receive at least one target html element property values of input;
After the parameter value that described parsing described modulation parameter is corresponding, the described target transmitting assembly calling peripheral hardware it
Before, farther include: resolve at least one target html element property values described, according at least one target html element described
Property value, in the mode and pattern of at least one files passe described, select files the targeted manner and pattern uploaded;
After the described target transmitting assembly calling peripheral hardware, farther include: by the targeted manner of described files passe
With the target transmitting assembly that pattern is sent to described peripheral hardware, according to targeted manner and the pattern of described files passe, show file
The dialog box uploaded and the button of files passe.
Preferably, described described default parameters and default value are packaged, including: default parameters and default value are encapsulated
In corresponding webuploader.js file, and store described webuploader.js file;
Described determine modulation parameter, receive the parameter value that the described modulation parameter of input is corresponding, comprise determining that files passe
Server end address and the request parameter list of files passe be modulation parameter, receive the server end address of described files passe
The parameter value corresponding with the request parameter list of files passe;
The default parameters of the described encapsulation of described loading, including: each corresponding drawing of webuploader.js file is set
Enter path, according to described introducing path, load webuploader.js file.
Preferably, the mode of at least one files passe described and pattern, including:
Encapsulation monofile uploads mode and pattern, multiple document uploading mode and pattern, free hand drawing sheet upload mode and pattern and
Any one or more in mode and pattern uploaded by many pictures.
A kind of system calling transmitting assembly, including: above-mentioned any one call the device of transmitting assembly and at least one
Transmitting assembly, wherein,
In at least one transmitting assembly described, each transmitting assembly, it is used for calling described in receiving the device of transmitting assembly
Call, and encapsulate mode and the pattern of at least one files passe, output file according to the described device calling transmitting assembly
Upload/picture uploads dialog box.
Preferably, at least one transmitting assembly described, including: any one or two kinds in Web Uploader and JS.
Embodiments providing and a kind of call the device of transmitting assembly, method and system, this device is by encapsulation structure
Build default parameters and default value that unit determines that each of peripheral hardware transmitting assembly is corresponding, default parameters and default value are sealed
Dress, it is achieved that to default parameters and the encapsulation of default value, can by directly invoking packaged default parameters and default value, and
Input without user, it addition, the parameter value needing the parameter of modulation corresponding can be received by interactive unit, thus pass through interface
Call the target transmitting assembly of peripheral hardware, by directly invoking packaged default parameters, and write parameter successively without user, from
And can effectively improve the efficiency of application and development.
Detailed description of the invention
For making the purpose of the embodiment of the present invention, technical scheme and advantage clearer, below in conjunction with the embodiment of the present invention
In accompanying drawing, the technical scheme in the embodiment of the present invention is clearly and completely described, it is clear that described embodiment is
The a part of embodiment of the present invention rather than whole embodiments, based on the embodiment in the present invention, those of ordinary skill in the art
The every other embodiment obtained on the premise of not making creative work, broadly falls into the scope of protection of the invention.
As it is shown in figure 1, the embodiment of the present invention provides a kind of device calling transmitting assembly, upload with at least one of peripheral hardware
Assembly is connected, including: encapsulation construction unit 101, interactive unit 102 and interface 103, wherein,
Encapsulation construction unit 101, for determining the default parameters and default value that each of peripheral hardware transmitting assembly is corresponding, right
Default parameters and default value are packaged;
Interactive unit 102, is used for determining modulation parameter, receives the parameter value that the modulation parameter of input is corresponding, and sends tune
The parameter value that variable element is corresponding;
Interface 103, for loading the default parameters of encapsulation construction unit 101 encapsulation and corresponding default value, receives and solves
Analyse the parameter value that the modulation parameter of interactive unit 102 transmission is corresponding, according to default value and the parameter value parsed, call peripheral hardware
Target transmitting assembly.
In the embodiment shown in fig. 1, corresponding the writing from memory of each of peripheral hardware transmitting assembly is determined by encapsulation construction unit
Recognize parameter and default value, default parameters and default value are packaged, it is achieved that be to default parameters and the encapsulation of default value, permissible
By directly invoking packaged default parameters and default value, and input without user, it addition, can be received by interactive unit
Need the parameter value that the parameter of modulation is corresponding, thus by the target transmitting assembly of interface interchange peripheral hardware, by directly invoking envelope
The default parameters installed, and parameter is write successively without user, it is possible to the effective efficiency improving application and development.
As in figure 2 it is shown, in an alternative embodiment of the invention, said apparatus farther includes: display unit 201, wherein,
Encapsulation construction unit 101, is further used for encapsulating the mode of at least one files passe and pattern, for encapsulation extremely
The mode of few a kind of files passe builds corresponding html element property with the mode of each files passe in pattern with pattern;
Interactive unit 102, is further used for receiving at least one target html element property values of input, and sends to few
One target html element property values;
Interface 103, is further used for receiving at least one target html element property values that interactive unit 102 sends, solves
Analyse at least one target html element property values, according at least one target html element property values, at encapsulation construction unit 101
In the mode of at least one files passe of encapsulation and pattern, select files the targeted manner and pattern uploaded, and by file
The targeted manner passed and pattern are sent to the target transmitting assembly of peripheral hardware;
Display unit 201, the target of the files passe for receiving according to target transmitting assembly and the interface 103 of peripheral hardware
Mode and pattern, the dialog box of display files passe and the button of files passe.
In still another embodiment of the process, encapsulate construction unit, for being write from memory by corresponding for each of peripheral hardware transmitting assembly
Recognize parameter and default value is encapsulated in the webuploader.js file of correspondence, and store webuploader.js file;
Interactive unit, for determining that the server end address of files passe and the request parameter list of files passe are modulation ginseng
Number, receives the parameter value that the server end address of files passe is corresponding with the request parameter list of files passe;
Interface, is further used for arranging the introducing path that each webuploader.js file is corresponding, according to introducing road
Footpath, loads webuploader.js file.
In an alternative embodiment of the invention, encapsulate construction unit, be used for encapsulating monofile and upload mode and pattern, multifile
Uploading mode and pattern, free hand drawing sheet upload mode and pattern and many pictures upload mode and pattern, wherein, monofile uploads mode
Mode and pattern is uploaded with pattern/free hand drawing sheet, including: add " selection " button on the right side of element, when adding after filesselected
" upload ", " deletion " button hide " selection " button, and show upload progress;Multiple document uploading mode and pattern/many pictures
Upload mode and pattern, including: add the Add Files button, " starting to upload " button and " cancellation " button for element, pass through
The Add Files button adds at least one file, and shows upload progress.
As it is shown on figure 3, the embodiment of the present invention provides a kind of method calling transmitting assembly, the method can include following step
Rapid:
Step 301: connect at least one transmitting assembly, determines default parameters and acquiescence that each transmitting assembly is corresponding
Value, is packaged default parameters and default value;
Step 302: determine modulation parameter, receives the parameter value that the modulation parameter of input is corresponding;
Step 303: load the default parameters of encapsulation and corresponding default value, and resolve the parameter value that modulation parameter is corresponding;
Step 304: according to default value and the parameter value parsed, call the target transmitting assembly of peripheral hardware.
In an embodiment of the invention, by the way of encapsulating at least one files passe and pattern, to carry further
The efficiency of high application and development, said method farther includes: encapsulate mode and the pattern of at least one files passe, for encapsulation
The mode of at least one files passe builds corresponding html element with the mode of each files passe in pattern with pattern and belongs to
Property;After step 302, before step 303, farther include: receive at least one target html element property values of input;
After step 303, before step 304, farther include: resolve at least one target html element property values, according at least
One target html element property values, in the mode and pattern of at least one files passe, select files the target side uploaded
Formula and pattern;Farther include after the step 304: targeted manner and the pattern of files passe are sent in the target of peripheral hardware
Pass assembly, according to targeted manner and the pattern of files passe, the dialog box of display files passe and the button of files passe.Example
As: user has only to input<input type=" mutilate-files ">, can select multiple document uploading mode and pattern,
Then export this multiple document uploading mode and pattern, in order to receive upper transmitting file, carry out files passe.
In an embodiment of the invention, in order to convenient default parameters and the default value of obtaining easily, the most flexibly
Be configured according to user's request, the detailed description of the invention of step 301, including: it is right default parameters and default value to be encapsulated into
In the webuploader.js file answered, and store described webuploader.js file;The detailed description of the invention of step 302,
Comprise determining that the server end address of files passe and the request parameter list of files passe are modulation parameter, receive files passe
The server end address parameter value corresponding with the request parameter list of files passe;The detailed description of the invention of step 303, including:
The introducing path that each webuploader.js file is corresponding is set, according to introducing path, loads webuploader.js literary composition
Part.By this process, when webuploader.js file path changes, it is only necessary to amendment introducing path, can realize
Loading webuploader.js file, the address additionally, due to the server of different files passe is different, by by files passe
Server address be set to modulation parameter, user can input according to oneself demand so that calls transmitting assembly cleverer
Live.
In an embodiment of the invention, in order to ensure the multiformity of mode of uploading and pattern, for according to user's request
Select, the mode of at least one files passe above-mentioned and pattern, upload mode and pattern, how literary composition including: encapsulation monofile
Part uploads mode and pattern, free hand drawing sheet upload mode and pattern and many pictures upload in mode and pattern any one or many
Kind.Such as: monofile uploads mode and pattern/free hand drawing sheet uploads mode and pattern could be arranged to add on the right side of element
" select " button, when adding " uploading ", " deletion " button after filesselected and hiding " selection " button, and show upload progress;
Mode uploaded by multiple document uploading mode and pattern/many pictures and pattern could be arranged to element and adds the Add Files button, " opens
Begin to upload " button and " cancellation " button, add at least one file by the Add Files button, and show upload progress.
As shown in Figure 4, another embodiment of the present invention provides a kind of method calling transmitting assembly, and the method can include
Following steps:
Step 401: connect at least one transmitting assembly, determines default parameters and acquiescence that each transmitting assembly is corresponding
Value;
Step 402: default parameters and default value are encapsulated into webuploader.js file;
By connecting at least one transmitting assembly such as Web Uploader or JS in step 401 and step 402, then root
Can realize multiple transmitting assembly is called according to the demand in application development process, due to each transmitting assembly parameter not
With, need for different assemblies determine respectively correspondence default parameters and default value, such as: for Web Uploader,
DisableGlobalDnd default value is that false (forbid pulling, in case picture being pulled into browser and being taken as file and beat by acquiescence
Open), it is also possible to the parameter that some are of little use or application are set to default parameters to uploading the fixing parameter of demand, and give silent
Recognize value, it is also possible to according to the actual demand allocating default parameter item of application.Form is as follows:
It addition, in this step, it is encapsulated into webuploader.js file, user by just default parameters and default value
Have only to determine or revise the store path of webuploader.js file, loading default parameters and acquiescence can be automatically obtained
Value, and input this partial parameters value without user again.
Step 403: the introducing path that each webuploader.js file is corresponding is set;
This step obtains the store path of introducing path i.e. webuploader.js file, can be rear by this introducing path
Successfully the default parameters in webuploader.js file and default value are loaded during Xu.
Step 404: encapsulate mode and the pattern of at least one files passe;
The mode of the files passe encapsulated in this step and pattern, including: monofile uploads mode and pattern, multifile
Upload mode and pattern, free hand drawing sheet upload mode and pattern and any one or more in mode and pattern uploaded by many pictures,
Wherein, monofile uploads mode and pattern/free hand drawing sheet uploads mode and pattern is to add " selection " button on the right side of element, when
Add " uploading ", " deletion " button after filesselected and hide " selection " button, and showing upload progress;Multiple document uploading mode
Upload mode with pattern/many pictures and pattern is that element adds the Add Files button, " starting to upload " button is pressed with " cancellation "
Button, adds at least one file by the Add Files button, and shows upload progress.The display box of the element files mentioned.
Step 405: in the mode of at least one files passe of encapsulation and pattern each files passe mode and
Pattern builds corresponding html element property;
In this step, upload mode corresponding to monofile and pattern, multiple document uploading mode and pattern, free hand drawing sheet are uploaded
Mode and pattern and many pictures upload the element property of mode and pattern be respectively file, mutilate-files, image,
Mutilate-images tetra-kinds, its input form is as follows:
<input type=" file " ...>,<input type=" mutilate-files " ...>etc..
Step 406: determine modulation parameter, receives the parameter value that the modulation parameter of input is corresponding;
The modulation parameter determined in this step is mainly some simply, and user holds catchy parameter, such as: on file
The server end address (server) passed, the request parameter list (formData) etc. of files passe, this modulation parameter disclosure satisfy that
The demand of user, it is ensured that call the motility of transmitting assembly.Such as: the server end address of files passe is set
(server):
Step 407: receive at least one target html element property values of input;
Such as: user wants monofile to upload mode and pattern, then input<input type=" file " ...>.
Step 408: according to introducing path, loads webuploader.js file, and resolves the parameter that modulation parameter is corresponding
Value;
Step 409: according to default value and the parameter value parsed, call the target transmitting assembly of peripheral hardware;
The process of step 408 and step 409 achieves calls transmitting assembly by parameter value, but, showing of transmitting assembly
Sample formula then needs following step 410 to step 413 to realize.
Step 410: resolve at least one target html element property values;
Step 411: according at least one target html element property values, at mode and the pattern of at least one files passe
In, select files the targeted manner and pattern uploaded;
Step 412: the targeted manner of files passe and pattern are sent to the target transmitting assembly of peripheral hardware;
Step 413: according to targeted manner and the pattern of files passe, the dialog box of display files passe and files passe
Button.
Step 410 realizes process to step 413: such as: parse two target html element property values, be
Input type=" file " ... > i.e. monofile uploads mode and pattern, then according to application demand and the setting of above parameter, will
The two monofile uploads mode and pattern is respectively displayed on the diverse location of application, and this monofile uploads the aobvious of mode and pattern
Show form as it is shown in figure 5, before non-load document, show " selection " button (Fig. 5-1) added on the right side of display box, when
After filesselected f123.zip, add " uploading ", " deletion " button and hide " selection " button (Fig. 5-2).
As shown in Figure 6, the embodiment of the present invention provide a kind of system calling transmitting assembly, this system includes: above-mentioned arbitrarily
A kind of device 601 calling transmitting assembly and at least one transmitting assembly 602, wherein,
In at least one transmitting assembly 602, each transmitting assembly, calls the device 601 of transmitting assembly for reception
Call, and encapsulate mode and the pattern of at least one files passe according to the device 601 calling transmitting assembly, on output file
Dialog box uploaded by biography/picture.
In an alternative embodiment of the invention, at least one transmitting assembly above-mentioned, including: appointing in Web Uploader and JS
Anticipate one or both.
According to such scheme, various embodiments of the present invention, at least have the advantages that
1. determine, by encapsulation construction unit, the default parameters and default value that each of peripheral hardware transmitting assembly is corresponding, to silent
Recognize parameter and default value is packaged, it is achieved that to default parameters and the encapsulation of default value, can be packaged by directly invoking
Default parameters and default value, and input without user, need the parameter of modulation corresponding it addition, can be received by interactive unit
Parameter value, thus by the target transmitting assembly of interface interchange peripheral hardware, by directly invoking packaged default parameters, and nothing
User must write parameter successively, it is possible to the effective efficiency improving application and development.
2. by the way of encapsulating at least one files passe and pattern, for the mode of at least one files passe of encapsulation
Corresponding html element property, at least inputted by reception is built with pattern with the mode of each files passe in pattern
Individual target html element property values, resolves at least one target html element property values, can be at least one file described
In the mode passed and pattern, select files the targeted manner and pattern uploaded;It is to say, user has only to input element attribute
Value can orient mode and the pattern of the files passe of correspondence, further increases the efficiency of application and development, it addition, the present invention
Embodiment encapsulate monofile upload mode and pattern, multiple document uploading mode and pattern, free hand drawing sheet upload mode and pattern and
Any one or more in mode and pattern uploaded by many pictures, has unified the Show Styles of transmitting assembly.
3. the request parameter list of the server end address and files passe that are determined by files passe is modulation parameter, receives
The parameter value that the server end address of files passe of user's input is corresponding with the request parameter list of files passe, allows users to
According to the required parameter arranging server end address and files passe according to the demand of oneself so that the embodiment of the present invention provides
The device calling transmitting assembly has certain motility, it addition, pass through webuploader.js Document encapsulation default parameters, when
Webuploader.js file store path changes, and user has only to change the introducing path in interface, and need not be to adding
The path of each parameter being downloaded in transmitting assembly is modified, and further reduces workload, thus further increases
Development efficiency.
It should be noted that in this article, the relational terms of such as first and second etc is used merely to an entity
Or operation separates with another entity or operating space, and not necessarily require or imply existence between these entities or operation
The relation of any this reality or order.And, term " includes ", " comprising " or its any other variant are intended to non-
Comprising of exclusiveness, so that include that the process of a series of key element, method, article or equipment not only include those key elements,
But also include other key elements being not expressly set out, or also include being consolidated by this process, method, article or equipment
Some key elements.In the case of there is no more restriction, statement the key element " including " and limiting, do not arrange
Except there is also other same factor in including the process of described key element, method, article or equipment.
One of ordinary skill in the art will appreciate that: all or part of step realizing said method embodiment can be passed through
The hardware that programmed instruction is relevant completes, and aforesaid program can be stored in the storage medium of embodied on computer readable, this program
Upon execution, perform to include the step of said method embodiment;And aforesaid storage medium includes: ROM, RAM, magnetic disc or light
In the various medium that can store program code such as dish.
Last it should be understood that the foregoing is only presently preferred embodiments of the present invention, it is merely to illustrate the skill of the present invention
Art scheme, is not intended to limit protection scope of the present invention.All made within the spirit and principles in the present invention any amendment,
Equivalent, improvement etc., be all contained in protection scope of the present invention.