Embodiment
To combine the accompanying drawing in the embodiment of the invention below, the technical scheme in the embodiment of the invention is carried out clear, intactly description, 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 are not making the every other embodiment that is obtained under the creative work prerequisite, all belong to the scope of the present invention's protection.
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 is managed.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, realize demonstration and management through loading corresponding XML file to e-file.Wherein, described e-file includes but not limited to newspaper picture, e-magazine, video.
Below, describing in detail in conjunction with concrete embodiment 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, in this dialog box, is imported the sign of the e-file of its desired demonstration by the user.Certainly, in concrete implementation procedure, the process of obtaining said sign is not limited at this cited.
Step 12, according to said sign; In Resource TOC, obtain the description document and the picture file of e-file respectively with said sign; Wherein said description document is used for the store electrons description information of files, and said picture file is used for the image data of store electrons file.
At this, system's predefined Resource TOC, its institutional framework is following:
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
By on can find out that 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, the sign of e-file that can also use other is 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 through 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 said images file is concrete picture file, as implied above, representes the 32nd edition pairing picture of newspaper on September 21st, 2009, and wherein picture can have several kinds of 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.
Can find out according to above-mentioned file structure; Management for each e-file is to be stored in the different files folder respectively down through descriptor and pictorial information 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 identified in the above-mentioned file with the said index search that is designated according to what obtain, search with this and identify the 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 kinds of 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 said description document of parsing and picture file show said 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.
Can find out that through above description 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 again in the Resource TOC description document and picture file and according to said sign, show satisfactory e-file.Because the embodiment of the invention is the descriptor through each e-file of the storage of the description document in the Resource TOC; Image data through each e-file of picture file storage; 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 no longer need as prior art, e-file be stored in the database need.Therefore, utilize the described method of the embodiment of the invention, made things convenient for storage, read, manage and show e-file.
Below combining embodiment two to describe with the newspaper picture is how to show e-file.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.
Through 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 automatically and leaves the Resource TOC stub.xml under the classpath in.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, like 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 said newspaper picture, be called for short like newspaper, confirm whether to exist in the said Resource TOC and corresponding description document of said sign and picture file.Have then to get into step 23, then do not finish.
Step 23, when having in the said newspaper catalogue with corresponding description document of said sign and picture file, show the up-to-date phase front page space of a whole page of newspaper picture with said sign according to up-to-date phase front page layout file of said 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 through the paperindex.html under the said 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 said sign, in Resource TOC, obtain the description document html and the picture file images of newspaper picture respectively with said sign.
Step 26, obtain the phase time information of the newspaper picture with said sign of desired display.
Step 27, read time descriptor period.xml of said phase, obtain this phase time pairing space of a whole page descriptor pages_existed.xml according to time information of said phase.
Step 28, obtain corresponding space of a whole page description document, the for example nbs.D440100bjrb_32.xml among the embodiment one through said space of a whole page descriptor pages_existed.xml.
Step 29, according to said 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 said 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.
Method by embodiment two can be found out, utilizes 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, like 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 like Tomcat, JBoss, Weblogic etc.The Java technology is adopted in the exploitation on system backstage.System is through 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 through these two kinds of API, all can reach with the form of Java object or container (like List) and return the result who reads.Can be placed among the JavaBeans through reading the information that the XML file obtains, the form with container (like 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 accomplish through computer program; Described program can be stored in the computer read/write memory medium; This program can comprise the flow process like 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 said sign; In Resource TOC, obtain the description document and the picture file of e-file respectively with said sign; Wherein said description document is used for the store electrons description information of files, and said picture file is used for the image data of store electrons file; Picture display unit 33 is used to resolve said description document and picture file, shows said e-file.
In this embodiment, said e-file includes but not limited to newspaper picture, e-magazine.That describes among the form of said Resource TOC and particular content and the method embodiment is identical, repeats no more at this.
In addition, as shown in Figure 4 in order to strengthen user experience, said device also can comprise: first display unit 34 is used for the up-to-date phase front page space of a whole page according to said up-to-date each e-file of phase front page layout file demonstration.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 said each e-file of electronic file list, confirm to exist in the said Resource TOC and corresponding description document of said sign and picture file; First display module; Be used for when said newspaper catalogue has with corresponding description document of said 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 said each e-file with said sign.
When the user need watch certain first phase of certain e-file, said device also can comprise: information acquisition unit 35 is used to obtain the phase time information of the e-file with said sign of desired display.At this moment, said picture display unit 33 specifically comprises: first acquisition module, be used for reading time descriptor of said phase according to time information of said 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 through said space of a whole page descriptor; Second display module is used for according to said 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, said picture display unit 33 also is used for according to said 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 said Resource TOC.
By on can find out that the display packing of the described e-file of the embodiment of the invention and device in when request watched that has the user to e-file, obtain the sign of the e-file of the desired demonstration of user.Then, utilize again in the Resource TOC description document and picture file and according to said sign, show satisfactory e-file.Because the embodiment of the invention is the descriptor through each e-file of the storage of the description document in the Resource TOC; Image data through each e-file of picture file storage; 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 no longer need as prior art, e-file be stored in the database need.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; Be merely embodiment of the present invention, but protection scope of the present invention is not limited thereto, any technician who is familiar with the present technique field is in the technical scope that the present invention discloses; Can expect easily changing 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 said claim.