Embodiment
Below in conjunction with the accompanying drawing in the embodiment of the invention, the technical scheme in the embodiment of the invention is clearly and completely described, obviously, described embodiment only is the present invention's part embodiment, rather than whole embodiment.Based on the embodiment among the present invention, those of ordinary skills belong to the scope of protection of the invention not making the every other embodiment that is obtained under the creative work prerequisite.
In embodiments of the present invention, for conveniently the e-file resource being managed and showing that the mode that is based on plain text manages.Its implication is, some descriptors of e-file and the routing information of image data storage etc. are utilized XML (Extensible Markup Language, extend markup language) language defines, then, by loading demonstration and the management of corresponding XML file realization to e-file.Wherein, described e-file includes but not limited to newspaper picture, e-magazine, video.
Below, describing in detail in conjunction with specific embodiments is what how to realize the demonstration of e-file and management.
As shown in Figure 1, the display packing of the embodiment of the invention one e-file comprises the steps:
Step 11, system obtain the sign of the e-file of desired display.
In this step, described sign can be abbreviation of e-file etc.With the newspaper picture is example, and this sign can be called for short for newspaper, newspaper title etc.When the user clicked certain e-file in the electronic file list, system can obtain the sign of the e-file that the user clicks according to this click event of user.In addition, system can also offer dialog box of user, is imported the sign of the e-file of its desired demonstration in this dialog box by the user.Certainly, in the specific implementation process, the process of obtaining described sign is not limited at this cited.
Step 12, according to described sign, in Resource TOC, obtain the description document and the picture file of e-file respectively with described sign, wherein said description document is used for the store electrons description information of files, and described picture file is used for the image data of store electrons file.
At this, system's predefined Resource TOC, its institutional framework is as follows:
Root directory
---bjrb//(abbreviation)
---paperindex.html//(indexing the front page of up-to-date phase)
——html
——2009-09
---period.xml//(phase time descriptor)
——21
---pages_existed.xml//(space of a whole page descriptor)
---nbs.D440100bjrb_32.xml//(concrete space of a whole page descriptor)
…
——images
——2009-09
——21
——32
---2009092132_icon, jpg//(picture resource)
——2009092132_brief.jpg
——2009092132_big_pdf.jpg
As seen from the above, the related data of all e-files all leaves under the root directory, and with the abbreviation of each e-file title as each sub-directory.Certainly, can also be with other the sign of e-file as the title of each sub-directory.
For each e-file, in system, set up two files: html file and images file for it.
Wherein, store the description document of e-file in the html file, this document is mainly used in the descriptor of each e-file of storage.Wherein, the period.xml file under the html file is used to write down all phase time descriptors of current month of certain e-file.In the file structure shown in above, the date of electronic document data is arranged in September, 2009 is example to write down.The pages_existed.xml file is used for inferior space of a whole page descriptor of each phase of recorded electronic file, and can link to the space of a whole page description document nbs.D440100bjrb_32.xml of each space of a whole page by this information, in the file structure shown in above, be all layout informations of e-file on September 21st, 2009.The nbs.D440100bjrb_32.xml file is a space of a whole page description document, information such as the path of the space of a whole page title of each space of a whole page of record and each domain sheet and size in this document.
Store the picture file of e-file in the images file, this picture file is mainly used in the image data of depositing e-file.What deposit in the described images file is concrete picture file, as implied above, represents the 32nd edition pairing picture of newspaper on September 21st, 2009, and wherein picture can have several different specifications, is used for different displaying occasions.
And, also including the paperindex.html file in the file structure shown in above, the information of preserving in this document is used to be indexed to the pairing xml file of the up-to-date phase front page of e-file, to show the up-to-date phase front page space of a whole page of each e-file.
According to above-mentioned file structure as can be seen, management for each e-file is to be stored in respectively under the different files with pictorial information by the descriptor with each e-file in embodiments of the present invention, when new e-file deposits in, only be required to be the e-file that newly deposits in and set up corresponding file and get final product.Therefore, made things convenient for management in this manner, also made things convenient for reading and storing each e-file to e-file.
After the sign of obtaining the desired demonstration of user, can be according to being identified in the above-mentioned file of obtaining with the described index search that is designated, search with this and identify picture file in description document in the html file of corresponding e-file and the images file.
Below, enumerate the XML language description file of above-mentioned several files respectively.
(1) Resource TOC stub.xml: the essential information that is used for the recorded electronic file.With the newspaper picture is essential informations such as example, the id of this essential information such as newspaper, title and abbreviation, and corresponding resource in the bibliographic structure can be searched according to these essential informations by system.
<papers><paper><paperUid>Nbs.D110000bjrb</paperUid><paperName>Beijing Daily</paperName><paperShortName>Bjrb</paperShortName>.</paper></papers> |
(2) Period.xml: be used for record phase time information, as follows, there are the newspaper data of 2009-09-01 in the expression Resource TOC.
<periodlist> <period?id=″13786″> <period_name>2009-09-01</period_name> <paper_id>1200</paper_id> <period_date>2009-09-01</period_date> <front_page>nbs.D110000bjrb_01.xml</front_page> </period> … </periodlist> |
(3) Pages_existed.xml: the layout information that is used for the recorded electronic file.
<pages> <page?id=″nb.D110000bjrb_20090922_01″> <pageinfo>nbs.D110000bjrb_01.xml</pageinfo> </page> … </pages> |
As implied above, having write down in the layout information file should the included space of a whole page of phase e-file, and has provided the filename of the pairing space of a whole page description document of this space of a whole page.
(4) Paperindex.html: be used for preservation and be indexed to the pairing picture file of the up-to-date phase front page of e-file.
<html> <head> <META?HTTP-EQUIV=″cache-control″CONTENT=″no-cache,must-revalidate″> <META?HTTP-EQUIV=″Expires″CONTENT=″-1″><META?HTTP-EQUIV=″pragma″ CONTENT=″no-nache″><META?HTTP-EQUIV=″REFRESH″CONTENT=″0; URL=html/2009-09/22/nbs.D110000bjcb_01.xml″></head> <body></body> </html> |
When new data arrived, old paperindex.html file can be covered by the file of the same name in the new data, therefore, refreshes the newspaper list page at every turn, all can show the front page picture of up-to-date first phase e-file.
(5) space of a whole page description document: the release, version name and corresponding picture path and the specification information that have write down this space of a whole page.
<ban Mian><da Yang><registration>Beijing Daily</registration><ri Qi>2009-09-22</Ri Qi><ban Ci>01</Ban Ci><version name>Important news</version name><space of a whole page Tu><wen Jianming>../../../images/2009-09/22/01/2009092201_big_pdf.jpg</Wen Jianming><gao>3000</Gao><kuan>1853</Kuan></space of a whole page Tu><jian Tu><wen Jianming>../../../images/2009-09/22/01/2009092201_brief.jpg</Wen Jianming></Jian Tu><figure marks on a map;<wen Jianming>../../../images/2009-09/22/01/icon_2009092201_brief.jpg</Wen Jianming></figure marks on a map;</Da Yang></Ban Mian> |
Step 13, the described description document of parsing and picture file show described e-file.
Based on the storage mode of above e-file related resource, can and resolve behind the description document of the e-file that obtains desired display and picture file, show then.
By above description as can be seen, the display packing of the described e-file of the embodiment of the invention when having the user that watching of e-file asked, obtains the sign of the e-file of the desired demonstration of user.Then, utilize description document in the Resource TOC and picture file again and, show satisfactory e-file according to described sign.Because the embodiment of the invention is the descriptor of storing each e-file by the description document in the Resource TOC, store the image data of each e-file by picture file, therefore, when needs show certain e-file, only need read relevant information and demonstration that these two files can obtain this e-file; And, when new e-file, only need in Resource TOC, to add corresponding description document and picture file get final product, and need no longer that need be stored in e-file in the database as prior art.Therefore, utilize the described method of the embodiment of the invention, made things convenient for storage, read, manage and show e-file.
Below two to describe with the newspaper picture be how to show e-file in conjunction with the embodiments again.As shown in Figure 2, the display packing of the e-file of the embodiment of the invention two comprises the steps:
Step 20, in Resource TOC, be respectively each newspaper picture and create description document and picture file.
By creating corresponding description document and picture file, made things convenient for the storage of newspaper picture resource and read, and be follow-up management and show that the newspaper picture resource provides convenience for each newspaper picture.
Step 21, startup server, system loads the Resource TOC stub.xml that leaves under the classpath automatically.When user capture newspaper list page, obtain the tabulation of newspaper picture.
In this step, after system reads this stub.xml file, the information of all newspaper pictures is left in the container, as the list among the java.And, in the tabulation of this newspaper picture, include the sign of newspaper picture.
Step 22, according to the sign of each newspaper picture in the tabulation of described newspaper picture, be called for short as newspaper, determine whether to exist in the described Resource TOC and corresponding description document of described sign and picture file.Have then to enter step 23, then do not finish.
Step 23, when having in the described newspaper catalogue with corresponding description document of described sign and picture file, show the up-to-date phase front page space of a whole page of newspaper picture with described sign according to up-to-date phase front page layout file of described each newspaper picture.
At this, system can travel through newspaper picture tabulation, obtains the space of a whole page description document and the pairing picture file of this front page of front page of the up-to-date phase of each newspaper picture by the paperindex.html under the described Resource TOC.
So, what presented to the user this moment is exactly the front page of the up-to-date phase of each newspaper picture, is convenient to the user and obtains up-to-date information, has strengthened user's impression.
Step 24, when the user clicks the newspaper picture that expectation watches by the front page of the up-to-date phase of each the newspaper picture that shows, obtain the sign of the newspaper picture of desired display.
Step 25, according to described sign, in Resource TOC, obtain the description document html and the picture file images of newspaper picture respectively with described sign.
Step 26, obtain the phase time information of the newspaper picture with described sign of desired display.
Step 27, read time descriptor period.xml of described phase, obtain this phase time pairing space of a whole page descriptor pages_existed.xml according to time information of described phase.
Step 28, obtain corresponding space of a whole page description document, for example nbs.D440100bjrb_32.xml among the embodiment one by described space of a whole page descriptor pages_existed.xml.
Step 29, according to described space of a whole page description document and the pairing picture file of each space of a whole page, show each space of a whole page of corresponding phase time.
Step 210, when space of a whole page handoff request, according to the space of a whole page sign of the space of a whole page after switching, the space of a whole page description document that space of a whole page descriptor is obtained the space of a whole page after the switching, and then according to described space of a whole page description document and the picture file of the space of a whole page after switching, show the space of a whole page after switching.
By the method for embodiment two as can be seen, utilize this embodiment to make things convenient for management and demonstration to the newspaper picture.
In concrete the application, system can be web application, and the platform of any Web of being used for exploitation all can be used for the exploitation of system, as J2EE platform .Net platform etc.Server can be selected Web server relatively more commonly used for use, all can be used as the server of system as Tomcat, JBoss, Weblogic etc.The Java technology is adopted in the exploitation on system backstage.System is by reading path and other essential informations that the XML file obtains the newspaper picture resource, so reading of XML file is the key issue that system realizes.In concrete the application, can adopt Dom4j technology or SAXReader technology, both are the API that Java reads the XML file.Read the XML file by these two kinds of API, all can reach with the form of Java object or container (as List) and return the result who reads.Can be placed among the JavaBeans by reading the information that the XML file obtains, the form with container (as List) places internal memory then.The foreground is used to show the data of obtaining, and can adopt Flex technology or Jsp technology.
One of ordinary skill in the art will appreciate that all or part of flow process that realizes in the foregoing description method, be to instruct relevant hardware to finish by computer program, described program can be stored in the computer read/write memory medium, this program can comprise the flow process as the embodiment of above-mentioned each side method when carrying out.Wherein, described storage medium can be magnetic disc, CD, read-only storage memory body (Read-Only Memory, ROM) or at random store memory body (Random Access Memory, RAM) etc.
As shown in Figure 3, the embodiment of the invention three provides a kind of display device of e-file, comprising:
Sign acquiring unit 31 is used to obtain the sign of the e-file of desired display; File acquiring unit 32, be used for according to described sign, in Resource TOC, obtain the description document and the picture file of e-file respectively with described sign, wherein said description document is used for the store electrons description information of files, and described picture file is used for the image data of store electrons file; Picture display unit 33 is used to resolve described description document and picture file, shows described e-file.
In this embodiment, described e-file includes but not limited to newspaper picture, e-magazine.That describes among the form of described Resource TOC and particular content and the method embodiment is identical, does not repeat them here.
In addition, in order to strengthen user experience, as shown in Figure 4, described device also can comprise: first display unit 34 is used for showing according to described up-to-date phase front page layout file the up-to-date phase front page space of a whole page of each e-file.Specifically can comprise: the tabulation read module, be used to read Resource TOC, obtain electronic file list; Whether judge module is used for the sign according to described each e-file of electronic file list, determine to exist in the described Resource TOC and corresponding description document of described sign and picture file; First display module, be used for when described newspaper catalogue has with corresponding description document of described sign and picture file, show the up-to-date phase front page space of a whole page of e-file according to the up-to-date phase front page layout file of described each e-file with described sign.
When the user need watch certain first phase of certain e-file, described device also can comprise: information acquisition unit 35 is used to obtain the phase time information of the e-file with described sign of desired display.At this moment, described picture display unit 33 specifically comprises: first acquisition module, be used for reading time descriptor of described phase according to time information of described phase, and obtain this phase time pairing space of a whole page descriptor; Second acquisition module is used for obtaining corresponding space of a whole page description document by described space of a whole page descriptor; Second display module is used for according to described space of a whole page description document and the pairing picture file of each space of a whole page, shows corresponding each inferior space of a whole page of phase.
In order to satisfy the watch requirement of user to the e-file of the different spaces of a whole page, the described device of the embodiment of the invention also can comprise: switch unit 36, be used for when space of a whole page handoff request, according to the space of a whole page sign of the space of a whole page after switching, the space of a whole page description document that space of a whole page descriptor is obtained the space of a whole page after the switching.At this moment, described picture display unit 33 also is used for according to described space of a whole page description document and the picture file of the space of a whole page after switching, and shows the space of a whole page after switching.
In addition, as shown in Figure 4, also can comprise document creation unit 37, be used for being respectively each e-file and create description document and picture file at described Resource TOC.
As seen from the above, the display packing of the described e-file of the embodiment of the invention and device when having the user that watching of e-file asked, obtain the sign of the e-file of the desired demonstration of user.Then, utilize description document in the Resource TOC and picture file again and, show satisfactory e-file according to described sign.Because the embodiment of the invention is the descriptor of storing each e-file by the description document in the Resource TOC, store the image data of each e-file by picture file, therefore, when needs show certain e-file, only need read relevant information and demonstration that these two files can obtain this e-file; And, when new e-file, only need in Resource TOC, to add corresponding description document and picture file get final product, and need no longer that need be stored in e-file in the database as prior art.Therefore, utilize described method of the embodiment of the invention and device, made things convenient for storage, read, manage and show e-file.
The above; only be the specific embodiment of the present invention, but protection scope of the present invention is not limited thereto, anyly is familiar with those skilled in the art in the technical scope that the present invention discloses; can expect easily changing or replacing, 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 described claim.