Embodiment
In embodiments of the present invention, for the Widget that realizes striding between the Widget system transplants, a kind of Widget implantation method is provided, specifically can comprise: search and obtain the application file under the Widget system, according to Widget File mapping table described application file is changed application file under the 2nd Widget system that obtains, wherein, described mapping table writes down the mapping relations of Widget application file between a Widget system and the 2nd Widget system; Application file under the 2nd Widget system that obtains is preserved or installed.
For ease of understanding, be described in detail below in conjunction with the method flow of accompanying drawing to the embodiment of the invention to the embodiment of the invention.
Fig. 1 is the method flow synoptic diagram of the embodiment of the invention, and as can be seen, method flow can comprise:
11: search and obtain the application file under the Widget system; The user can search and download the Widget application file on internet or local system, the Widget application file of download comprises: html file, CSS file, JavaScript file, XML file etc.;
12: according to Widget File mapping table the application file under the described Widget system is changed, obtained the application file under the 2nd Widget system, wherein, mapping table has write down the mapping relations of the Widget application file between the different Widget system; Mapping table comprises following at least one: UI (the User Interface before and after the expression conversion, user interface) the UI label mapping table of label mapping relations, or the Function Mapping table of the JavaScript of the JavaScript Function Mapping relation before and after the expression conversion, or the configuration file mapping table of the configuration file mapping relations before and after the expression conversion, or the CSS File mapping table of the CSS File mapping relation before and after the expression conversion;
13: the application file under the 2nd Widget system that will obtain is preserved or is installed; Can be with the html file after the conversion, the CSS file, the JavaScript file, the XML File Compress becomes a Widget application file, and according to the configuration modification file type of local system.So far can finish and search the Widget file, and the online in real time that the Widget file is changed is transplanted the process of Widget.
Need to prove, above-mentioned mapping table can be user or system configuration, promptly can be according to the mapping relations of Widget application file between the different Widget system, set up and storage is used to change the mapping table of the application file between the different Widget system, when needs are changed, can change according to this mapping table.
According to foregoing description, the Widget application file that the embodiment of the invention can be implemented between different Widget system is transplanted automatically, can satisfy the user and stride the demand that the Widget system uses Widget.
For ease of understanding, be described in detail below in conjunction with the specific implementation of accompanying drawing to the embodiment of the invention to the embodiment of the invention.
Fig. 2 is that the Widget that the embodiment of the invention provides transplants schematic flow sheet; As shown in Figure 2, idiographic flow can comprise:
21: the user starts Widget and transplants flow process automatically; On internet or local system, search the Widget application file that needs transplanting,
22: be loaded in the Widget application file that finds on internet or the local system down, the Widget application file of download can comprise: html file, CSS file, JavaScript file, XML file etc.;
23: described application file is changed according to the Widget File mapping table of having set up; Concrete, this step can comprise:
231: the Widget application file of downloading is carried out decompress(ion); Certainly, if the Widget application file of downloading is not compressed, this step also can omit;
232: the application file code to the Widget application file behind the decompress(ion) is resolved;
233: the Widget application file code after resolving is changed, and concrete, conversion is carried out according to Widget File mapping table; Fig. 3 is the mapping table of the embodiment of the invention, as shown in Figure 3, as can be seen, the code conversion of Widget application file divides two stages, first stage is that the Widget application file code status before the conversion arrives intermediateness, and second stage is that intermediateness is to ultimate demand (i.e. conversion back) Widget application file code status; For the different Widget system of transplanting before and after the Widget application file, the Widget document code of intermediateness can be identical, also can be different; Contrast mapping table shown in Figure 3, UI label that Widget code before the conversion comprises and JS function can find corresponding item at the secondary series of mapping table, then carry out the centre processing procedure, convert the UI label and the JS function of secondary series to UI label and JS function that the 3rd of mapping table is listed as correspondence, then carry out a hardware and software platform processing procedure, convert tertial UI label and JS function to UI label and JS function that the 4th of mapping table is listed as correspondence, that is to say, this transfer process is as shown in Figure 4: the application file of a Widget system is through a centreization process, obtain the Widget application file of intermediateness, then the Widget application file of this intermediateness carries out the hardware and software platform process, obtains the application file of the 2nd Widget system; Like this, just realized of the automatic conversion of Widget application file from a Widget system to another Widget system;
Above-mentioned conversion specifically can comprise:
2331: carry out UI label adapting operation; Owing to need to consider the display screen size of terminal device in the Widget migration process, for example the Widget on the computer is transplanted on the mobile phone, it is adaptive just need to carry out screen size to file; Concrete, this UI label adapting operation can convert automatically by the UI label, and the Widget engine of local Widget system can carry out adaptive demonstration automatically according to the size of screen when resolving UI label after the conversion; Can certainly carry out UI label adapting operation by some picture crossover tools
2332: carry out the JS code and accept or reject; Because in the Widget application file code before the conversion, some code also is not suitable for local system, therefore, need give up by the code that these are redundant, with the code that obtains to utilize, so use may the lost part function for the Widget after the conversion; The JS code is accepted or rejected shown in Fig. 3 " JS Function Mapping table ", JS function 2 is a JS function 2 ' in first phase transition, be that intermediateness is a JS function 2 ', but when carrying out the conversion in second stage, do not have corresponding JS function in the local Widget system, so the logic function of JS function 2 representatives will be rejected after conversion;
2333: optionally, can also carry out the resource file reorientation; Because the Widget system before and after transplanting requires possibility different to the son file institutional framework of Widget application file, therefore, need carry out the resource file reorientation to the son file of Widget application file, so that the file organization structure goes for local Widget system;
2334: the Widget system that considers does not have configuration file, and the Widget system after transplanting just need be configured file build when needing configuration file; If the configuration file structure of the Widget system requirements before and after transplanting is inconsistent, then need to be configured re-constructing of file;
234: the html file after will changing, the CSS file, the JavaScript file, is packaged into a Widget application file at the XML File Compress, and needs the revised file type according to local system;
24: the Widget application file after will changing is preserved or is installed.
Need to prove that above-mentioned step 2331 and 2332 can be carried out in no particular order in proper order.
From foregoing description as can be seen, the above-mentioned flow process of the embodiment of the invention has realized that online in real time carries out Widget and transplant, and promptly user terminal whenever finds a Widget file (comprising various Widget application files) and just changes and finish automatic graft procedure in real time.Certainly, the flow path switch of Widget application file also can be the non real-time automatic transfer process of off-line.
Further, above-mentioned steps 233 is applicable to the Widget application file of standard that off-gauge Widget application file is converted to too, process as shown in Figure 5, among Fig. 5, an off-gauge Widget application file is through a course of standardization process, the Widget application file of outputting standard, again through a hardware and software platform processing procedure, output meets the Widget application file of local Widget system requirements, promptly finished the automatic conversion of Widget application file from an off-gauge Widget system to another non-standard Widget system.
By foregoing description as can be seen, the embodiment of the invention has realized that the Widget application file between different Widget system transplants automatically, can satisfy the user and stride the demand that the Widget system uses Widget, and reduce the Widget migration process complicacy that causes because of each Widget system specifications is inconsistent.
The embodiment of the invention also provides corresponding Widget transplantation device, and the Widget application file that is used to be implemented between different Widget system is transplanted automatically, its structure as shown in Figure 6, the specific implementation structure can comprise:
Search module 61, be used to search Widget application file under the Widget system; Specifically can on internet or local system, search the Widget application file that needs transplanting;
Acquisition module 62 is used to obtain the described Widget application file that module 61 finds of searching; For example, download the Widget application file, can comprise: html file, CSS file, JavaScript file, XML file etc.;
Modular converter 63, the application file under the Widget system that is used for according to Widget File mapping table described acquisition module 62 being obtained is changed, and obtains the application file under the 2nd Widget system;
Processing module 64, the application file under the 2nd Widget system that is used for modular converter 63 is obtained is preserved or is installed; Specifically can be with the html file after the conversion, the CSS file, the JavaScript file, the XML File Compress becomes a Widget application file, and according to the configuration modification file type of local system.
Wherein, described modular converter 63, its structure specifically can comprise as shown in Figure 7:
Analyzing sub-module 631, the application file code that is used for Widget application file that described acquisition module 62 is obtained is resolved;
Mapping table submodule 632 is used to set up and store the Widget application file is changed the mapping table that need use; Described mapping table comprises following at least one: the UI label mapping table of the UI label mapping relations before and after the expression conversion, or the Function Mapping table of the JavaScript of the JavaScript Function Mapping relation before and after the expression conversion, or the configuration file mapping table of the configuration file mapping relations before and after the expression conversion, or the CSS File mapping table of the CSS File mapping relation before and after the expression conversion; Above-mentioned mapping table can be user or system, sets up in advance and stores according to the mapping relations of Widget application file between the different Widget system;
Conversion submodule 633 is used for the mapping table according to the storage of mapping table submodule, and the Widget application file code after described analyzing sub-module is resolved is changed; The code conversion of Widget application file divides two stages, and first stage is that the Widget application file code status before the conversion arrives intermediateness, and second stage is that intermediateness is to ultimate demand (i.e. conversion back) Widget application file code status; Concrete operations can comprise: the Widget application file code after resolving is used to the UI label adapting operation that makes screen size adaptive; And the JavaScript code that is used for the code that is not suitable for the 2nd Widget system is given up is accepted or rejected operation; When the application file institutional framework of a Widget system and the 2nd Widget system not simultaneously, go the resource file reorientation again; When the configuration file structure of a Widget system and the 2nd Widget system requirements not simultaneously, be configured file build;
Packing submodule 634 is used for the Widget application file after the conversion is packed, compressed, and according to the configuration modification file type of local system.
Said apparatus in the embodiment of the invention can be arranged in the third party device of any Widget of an independence system; Perhaps be arranged in the Widget system; And because every function of this device can also realize by software, therefore, what can realize that this installs every function can be a program of the Widget Integrated Development Environment of Widget platform, also can be a program on the Widget engine, can also be mounted in a concrete Widget application program in the subscriber equipment Widget system.For example, this Widget application program in the Widget system on the subscriber equipment can convert the Widget application file in other Widget systems to the Widget application file that meets native system, further, Widget application file after this conversion can be kept on the control panel of Widget engine, uses for Widget engine load operating.
Through the above description of the embodiments, those skilled in the art can be well understood to the present invention and can realize by the mode that software adds essential hardware platform, can certainly all implement, but the former is better embodiment under a lot of situation by hardware.Based on such understanding, all or part of can the embodying that technical scheme of the present invention contributes to background technology with the form of software product, this computer software product can be stored in the storage medium, as ROM/RAM, magnetic disc, CD etc., comprise that some instructions are with so that a computer equipment (can be a personal computer, server, the perhaps network equipment etc.) carry out the described method of some part of each embodiment of the present invention or embodiment.
In sum, compare in various embodiments of the present invention and the prior art, owing to can online in real time search and download the Widget application file, and according to Widget File mapping table described application file is changed; Widget application file after the conversion is preserved or installed, and the Widget application file that therefore can be implemented between different Widget system is transplanted automatically, has satisfied the user and has striden the demand that the Widget system uses Widget.
The above; only for the preferable embodiment of the present invention, but protection scope of the present invention is not limited thereto, and anyly is familiar with those skilled in the art in the technical scope that the present invention discloses; the variation that can expect easily or replacement all should be encompassed within protection scope of the present invention.Therefore, protection scope of the present invention should be as the criterion with the protection domain of claim.