⭐ 欢迎来到虫虫下载站! | 📦 资源下载 📁 资源专辑 ℹ️ 关于我们
⭐ 虫虫下载站

📄 readme

📁 hibernate-distribution-3.3.1.GA-dist.zip源码
💻
字号:
THE HIBERNATE DOCUMENTATIONchristian@hibernate.orgCOPYRIGHT NOTICE: This documentation system and all its source files arelicensed under the GNU Lesser Public License (LGPL). Authors and translatorsretain the copyright of their work. All font and other build files (the DocBooksystem) are property of their respective copyright holders. Some of the files(especially font files) might require a license from the respective vendor; youare responsible to check and obtain these licenses as necessary before you useand/or distribute these files.PrefaceThe Hibernate documentation is a modular documentation, it usesvarious XML files (written with the DocBook DTD) and a Java-basedbuild process to generate HTML and PDF output. Use a simple texteditor with XML support, such as JEdit, to edit the source files. Youwill need Java and Ant installed for the output generation. The toolsetis Java only and should work on any operating system.Note: Always use 4 spaces to indent, no tabstops (code examples willbe broken otherwise).1. How to get itCheck out a copy of Hibernate from the repository. A regularHibernate download will not contain the build process for thedocumentation, only the PDF/HTML output, use the repository!See http://www.hibernate.org/Download/DownloadOverview2. Working on the original languageThe original and master language is English, hence the "en" subdirectoryin /doc/reference/ is authorative. We use "id" and "revision" attributes onXML elements to track changes. Here are the rules, they are mandatory:2a. Changing existing content involves an update of the "revision" of the XMLelement you are working on (e.g. a <sect1>, <sect2> or even a <para>).If a <sect1> has a revision="1", you update it to "2" after updating thecontent in that section.You can also add a revision attribute to an element if there is none,start with revision="1". You should not add a revision attribute to eachparagraph, try to only add/use revision attributes to sections. You can't add a revision attribute to elements without an "id" attribute!2b. Adding new content involves adding new elements (even new files), suchas <sect1>, <para> and so on. Any new element (or its new parent element)needs an "id" attribute if the new content is to be included in the changetracking. If you add a section, give it a unique short textidentifer, look at the parent element's identifier for the common prefix.2c. Deleting content involves removing old elements. Just remove them andmake sure that the parent elements revision is updated, if the removedelement did not itself have an identifer and a revision. If you remove anelement with its own identifier, everything is fine and no other changes arenecessary.3. Starting a new languageIf you start a translation for a new language, you have to copythe default language (English) and start an initial translation.3a. First, duplicate the default language "en" by duplicating the directory/doc/reference/en. For example, a new German translationwill be a copy of that directory in /doc/reference/de. We use the ISOcodes to name the language subdirectories.3b. You also have to add your new language to the language build file,/doc/reference/build.xml. Look for the lines that have a "TRANSLATOR"comment and duplicate them. Change the default "en" to your languagecode, every language listed here will be included in both the PDF/HTMLgeneration and the revision diff change tracking reports (discussed later).4. The initial translationIf you just copied the default language, start translating the DocBookXML modules and illustrations in the new language subdirectory. Forexample, all modules for German would be in /doc/reference/de/modulesand all illustrations in /doc/reference/de/images, note that you also haveto translate the master.xml in your language subdirectory.The initial translation is straightforward: Translate all modules andall illustrations, but don't add any files, don't add any new XML elements(like a section or a chapter, not even a paragraph). Simply translatesentence by sentence. This is very important.Note that every DocBook XML file needs an encoding, specific to alanguage. Add a line like this at the top of every file, if it doesn't exist:<?xml version='1.0' encoding="iso-8859-1"?>You can use UTF-8 or any other character set, please experiment withthe builds to see what works for you.If you need a new section or paragraph, because your translation requiresmore explanation, you can add it if you also add an "id" and a "revision"to that new section or paragraph.For example, if you add a new <para> element to the existing document,give it an identifier, a short unique string that extends the identifierstring of the parent element: <para id="queryhql-projection-specialnote">would be a special paragraph in the <sect1 id="queryhql-projection">section in the chapter <chapter id="queryhql">.Never add a new element in a translated version without also adding a newunique identifier value! Also, you have to mark this new element as "onlyrelevant in the translated version". Simply set the "revision" attribute ofyour new element to "-1". For example, set the previously createdparagraph to "only relevant in the translation" by declaring<para id="queryhql-projection-specialnote" revision="-1">.Changes to that paragraph will not be tracked, it is your responsibility towatch out for neccessary updates. Any element with revision="-1" will not betracked.5. Updating translated documentationTranslators get updates by updating their working directory from therepository. As a translator you will get an e-mail from us when translationis required, you can then update your copy. Or, subscribe to the commitmailing list to get all updates automatically.The documentation tools can generate a report after you updatedfrom the repository and show you what needs to be translated and/or removedin your local translation copy. To generate that report, run "ant all.revdiff"in the doc/reference/ subdirectory. Click on the generated HTML reportfile for your language and you will see what has to be updated and/orremoved.If the report indicates that content in the original has been removed,simply remove the identified XML element from your language modules.If the report detects a new revision, open the file that has been updatedin your translation, find the identified XML element and update/translateits contents. Important: Make sure you also update the "revision"attribute of that XML element by setting it to the same version as inthe original file, hence both the original XML file and your translatedfile should have the same revision number for all elements. If anXML element in your translation doesn't have a revision, but the originalfile has, add a new "revision" attribute to your XML element.The HTML report shows the identifiers and revisions for both the originaland the translated files, use it to compare.Rerun the "ant all.revdiff" report generation as often as you like untilno more differences are detected. You should always try to get yourcopy clean, with all updated revisions and all identified elementssynchronzied.6. Committing a translationAll translators will be asked to submit their translated versions fromtime to time. This will be a manual process, you will get an e-mail fromthe Hibernate team and simply send your language subdirectory asa ZIP file to us. It will then be integrated in the main Hibernatedistribution and on the website. Or, you can contact us for commit accessto the repository, where you can maintain a translation directly.7. Generating PDF and HTML outputThe documentation is generated with the target 'ant all.doc'.To build the reference docs for a particular language only, use"ant -Dlang=en", for example, and call either lang.all, lang.docpdf,lang.dochtml, or lang.dochtmlsingle for the target of your choice.You can also call lang.section-check to track down missing identifiers ina particular language, or you can call lang.revdiff to get a differencereport for a particular language, compared with the English reference.

⌨️ 快捷键说明

复制代码 Ctrl + C
搜索代码 Ctrl + F
全屏模式 F11
切换主题 Ctrl + Shift + D
显示快捷键 ?
增大字号 Ctrl + =
减小字号 Ctrl + -