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 records 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 the understanding to the embodiment of the invention, be described in detail below in conjunction with the method flow of accompanying drawing to the embodiment of the invention.
Fig. 1 is the method flow synoptic diagram of the embodiment of the invention, can find out, method flow can comprise:
11: search and obtain the application file under the Widget system; The user can be in the internet or local system search and download the Widget application file, 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 recorded 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 representation conversion, user interface) the UI label mapping table of label mapping relation, or the Function Mapping table of the JavaScript of the relation of the JavaScript Function Mapping before and after the representation conversion, or the configuration file mapping table of the configuration file mapping relations before and after the representation conversion, or the CSS File Mapping table of the relation of the CSS File Mapping before and after the representation 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, JavaScript file, XML compressing file become 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 process of transplanting in real time Widget that the Widget file is changed.
Need to prove, above-mentioned mapping table can be user or system configuration, namely can be according to the mapping relations of Widget application file between the different Widget system, set up and storage is used for changing 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 the understanding to the embodiment of the invention, be described in detail below in conjunction with the specific implementation of accompanying drawing 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 automatically transplants flow process; In the internet or local system search the Widget application file of need 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: according to the Widget File Mapping table of having set up described application file is changed; Concrete, this step can comprise:
231: the Widget application file of downloading is carried out decompress(ion); Certainly, compressed if the Widget application file of downloading does not have, 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, can find out, 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 arrives final needs (namely after the conversion) 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, the 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 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 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 to 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 converted to JS function 2 ' at first stage, be that intermediateness is JS function 2 ', but when carrying out the conversion of 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: optional, 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 to 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 to 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 compressing file, 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 sequentially be carried out in no particular order.
Can find out from foregoing description, the above-mentioned flow process of the embodiment of the invention has realized carrying out in real time online Widget and has transplanted, and namely user terminal whenever finds a Widget file (comprising various Widget application files) and just changes in real time and finish automatic graft procedure.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 off-gauge Widget application file is converted to the Widget application file of standard 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, namely finished the automatic conversion of Widget application file from an off-gauge Widget system to another non-standard Widget system.
Can find out by foregoing description, 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 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 for being 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 for searching Widget application file under the Widget system; Specifically can be in the internet or local system search and need the Widget application file transplanted;
Acquisition module 62 is used for obtaining 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, JavaScript file, XML compressing file become 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 is resolved for the application file code of the Widget application file that described acquisition module 62 is obtained;
Mapping table submodule 632 is used for setting up and storage is changed the mapping table that need to use to the Widget application file; Described mapping table comprises following at least one: the UI label mapping table of the UI label mapping relation before and after the representation conversion, or the Function Mapping table of the JavaScript of the relation of the JavaScript Function Mapping before and after the representation conversion, or the configuration file mapping table of the configuration file mapping relations before and after the representation conversion, or the CSS File Mapping table of the relation of the CSS File Mapping before and after the representation 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 arrives final needs (namely after the conversion) Widget application file code status; Concrete operations can comprise: the Widget application file code after resolving is carried out be used to making the adaptive UI label adapting operation of screen size; And the JavaScript code that carries out giving up for the code that will not be suitable for the 2nd Widget system is accepted or rejected operation; When the application file institutional framework of a Widget system and the 2nd Widget system not simultaneously, go again the resource file reorientation; 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 the various functions of this device can also be realized by software, therefore, what can realize this device various functions 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, 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 by hardware, but the former is better embodiment in a lot of situation.Based on such understanding, technical scheme of the present invention is to can embodying with the form of software product in whole or in part that background technology contributes, this computer software product can be stored in the storage medium, such as ROM/RAM, magnetic disc, CD etc., comprise that some instructions are with so that a computer equipment (can be 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, because online real-time searching 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 better embodiment of the present invention, but protection scope of the present invention is not limited to this, 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.