Instantly share code, notes, and snippets. Created Jun 10, Code Revisions 1 Stars 4 Forks 3. Embed What would you like to do?
Embed Embed this gist in your website. Share Copy sharable link for this gist. Learn more about clone URLs. Download ZIP. Nokogiri Template Builder. I also spent quite a lot of time cleaning up the old code which I was a bit ashamed of. Class variables are now removed and overall, the code should be a bit more sane.
The source code can be found in my GitHub accout and the documentation there. The Rails team and the Merb team announced working together on a joined version of the 2 frameworks. This is so exciting, nobody believed it could ever happen I personally, had my serious doubt. Yehuda had a great post laying down the plan and explaining things in details.
David is known to be a very opinionated person. But if you come up with the right arguments, he can be convinced and when that happens, he is willing to move forward and shake things up. This merge is a concrete example that David and the rest of the Rails team cares about Rails and the Ruby community more than we usually give them credit for. As a unified team, we are going to change the way web development in Ruby is done!
We just started getting together and discuss the technical details. We are shooting for a release at RailsConf The good news is that the next version of merb rails 3. Again, Rails 3. Come talk with me, or any members from the new team. Imagine a version of Rails with true modularity and agnosticism sequel, DM and AR will still be supported and the same type of performance as what you get with Merb.
In other words, the rails world is about to discover the power of merb! I had a hard time believing that we could work together but I was proved wrong. An initial RAID server breakdown proved to be a real test of our team strength, but with the help of a good reference , and an affordable data recovery service , we were able to come out looking amazing. If the first argument to a tag call is a symbol, it will be joined to the tag to produce a namespace:tag combination.
It is easier to show this than describe it. SOAP :Envelope do If no target is given, then XmlMarkup defaults to a string target.
Indentation is enabled by providing the number of spaces to indent for each level as a second argument to XmlBuilder. Initial indentation may be specified using a third parameter. We now use normal block calls to execute the markup block.
This means that all markup methods must now be explicitly send to the xml builder. Click Show All to see all the form fields in the document. Click Close to close the field property browser. The only button does not automatically update any changes in the edit field, therefore ensure that you select Update if you want to save edits. The Template Builder provides an accessibility checker to check the template for features to enhance the accessibility of the report for report consumers who may need assistive technologies to view the report.
The tool generates a report that indicates areas of a template that do not include the following accessibility features:. In some cases the accessibility checker cannot determine if the accessibility feature is present and generates a warning.
The report designer can then verify that the accessibility features are present. For information on how to add these features to the template, see Appendix C, "Designing Accessible Reports. If you used the Open Template dialog to connect to BI Publisher, and load the data to the Template Builder, or if you downloaded an existing template from the BI Publisher catalog, then you can upload the new or updated layout back to the report definition on the server.
If you downloaded an existing template and want to upload the modifications to the template, then select Upload Template from the Oracle BI Publisher menu. If this is a new template for the report definition, then use the Upload Template As option to upload the layout to the report definition on the server. Also use this option to upload modifications to an existing template under a different name. Use the first option if the translated template requires a different layout from the original template.
To use the Template Builder translation tools to create templates for translations, see the following topics in this section:. This menu item allows you to create a standard XLIFF translation file that contains the boilerplate text from the template. XLIFF is a standard file format that is understood by many translation software packages. A "translatable string" is any text in the template that is intended for display in the published report, such as table headers and field labels.
Text supplied at runtime from the data is not translatable, nor is any text that you supply in the Microsoft Word form fields. You are prompted to save the extract file as an XML file type. Enter a name for the extract file and save to the desired location. If you want to translate the template manually, open the. For a detailed description of working with the BI Publisher generated.
When done, you can preview the translation. Then upload the file to the BI Publisher report definition. Locate the file, and click Open. Because BI Publisher enables you to extract the boilerplate text strings from a template into an XLIFF file that can be translated and then applied at runtime, if the reports for additional languages only require the translation of these text strings, then you only need to supply translated XLIFF files to accompany the base template.
However, you would localize a template when the requirements for the report in the specific language go beyond the simple translation of the text in the layout.
This invokes a warning message that localizing the template overwrites the template. Locate the appropriate file and click Open. Upload the template file to the appropriate report definition in the BI Publisher catalog. Select the appropriate locale in the upload dialog.
Access the Options dialog as follows: In the Options group, click Options. Use the Options dialog: UI tab to set options that influence the look and feel of the Template Builder. The tree view that shows the data source can show either the correct XML tag names of the data source or they can show a slightly modified version that is easier to read. The Options dialog: Preview tab allows you to specify options that influence the Preview functionality of the Template Builder.
Table Preview Options. A style template is an RTF template that contains style information that can be applied to RTF layouts, similar to a style sheet. The style information in the style template is applied to RTF layouts at runtime to achieve a consistent look and feel across your enterprise reports.
You can choose the language and territory used for previewing the template. While this change does not automatically translate any files, it is important to set the correct locale for the preview to use the correct direction of the text left-to-right or right-to-left , and to correctly set locale-specific date, number, and currency formats.
The Preview and export functionality requires Java code. If this option is not specified, the Template Builder assumes that the Java virtual machine java.
Specify the memory to reserve for the Template Builder to process the template. The default value is -XmxM. Use the Options dialog: Build tab to specify options that influence how the Template Builder generates tables and forms.
Table Build Tab Options. The Descriptive option for example: for-each Invoice renders a descriptive form field for the processing instructions. This option makes the layout template easier to understand. However, the longer fields may distract from the visual layout of the template.
Note that the descriptive option does not apply to fields within table cells. The Abbreviated option for example: F provides a one letter abbreviation for each instruction. Select the Hidden box to generate the processing instruction form fields using Microsoft Word's hidden font effect. Hidden text is hidden in the Print Preview and you may display or hide the hidden text by changing the Hidden Text setting in the Display group of the Microsoft Word Options. Large - inserts the BI Publisher code to a document variable.
The document variable field can accommodate approximately 48 kilobytes of code line. It is important to note that this setting affects only fields that are created or edited while this option is set. If the template is intended for use with the 10g version of BI Publisher, use the Backward Compatibility setting. This limited the length of code that could be inserted for a single form field. By default, the Large option is used because it can accommodate much larger code strings. Customize the default color for the templates.
This configuration is performed at the template level. The template-level setting overrides the server setting. The configuration file must be named xdoconfig. Alternatively, you can use the file name xdo. The configuration file allows you to:. If you are using Microsoft Word , then you might have to modify the Add-In settings. The Online group of commands enable you to initiate interaction with the BI Publisher application. For more information about working with the online commands, see Section 5.
Figure The Online Group of Commands. Table Online Group Commands. Enables you to log in to BI Publisher. Enter your user name and password. When you log on, the Open Template dialog is displayed. Note: You must log in directly to the BI Publisher server. After you log on, this command becomes available to enable you to open a report in the BI Publisher catalog. If you used the Open Template dialog to download a template from the BI Publisher catalog, use this option to upload the updated layout back to the report definition in the catalog.
If you used the Open Template dialog to download a template or to open a report from the catalog, use this option to upload the layout to the report definition in the catalog. If you are working in connected mode, then use this command to save the data to a local directory if you also need access to the data in disconnected mode.
The Load Data group of commands enables you to load a saved sample data file or sample schema to the Template Builder. You must load data to use most of the Template Builder functionality. Table Load Data Group Commands. This command enables you to load a previously saved sample XML file from the report data source. If you are not connected to the BI Publisher server, use this method to load the data.
This command enables you to load an XML Schema file. The XML schema has the advantage of being complete a sample xml file may not contain all the fields from the data source.
Use the Insert group of commands to insert the layout components to the template. For more information, see Section 5. Figure The Insert Group of Commands. Table Insert Group Commands. This function provides a wizard that guides you through the creation of tables used in typical reports. The Pivot Table function enables you to drag and drop the data elements to a pivot table structure. BI Publisher does not recognize native Microsoft Word charts.
This function allows you to select fields from the data source and insert them into the template. Note: As a beginner, you should use Insert Fields only for data fields that are unique - none repeating - in the document. Use this function to insert data fields to be organized as a simple or nested table or as a form that is repeated with different data.
You may even organize all the data fields for the whole document before inserting them. Enables you to select or define a group of elements that you want repeated for each occurrence of an element in the data.
This function inserts all fields found in the XML data into the document. It also inserts processing instructions into the document that repeats a section - such as a table row - when the associated XML element is repeated. Note: XML documents often contain a large number of fields in a deeply nested hierarchy. For example, an Oracle Purchasing purchase order contains purchase order lines, which contain shipments, which contain distributions. The purchase order line alone contains more than data fields.
When you select any of these output formats, the Template Builder merges the data into the template and creates the output document. Figure The Preview Group of Commands. For more information about using the commands in the Tools group refer to Section 5.
Figure The Tools Group of Commands. Table Tools Group Commands. The field browser is a tool for advanced users who must change the BI Publisher commands that are hidden in the form fields. It shows the commands behind each form field and allows you to change them. Use this tool to correct flawed RTF templates or to update multiple fields efficiently.
The validation function checks the template for incorrect use of BI Publisher commands and unsupported elements in the Word file. This functionality enables you to test translation files. This means that in the current RTF template all boilerplate text is translated. The main function of this feature is to create a language-specific version of a template. This function is mainly for debugging. The Options group of commands allows you to define preferences and options for using BI Publisher and access online help.
Figure The Options Group of Commands. This chapter includes the following sections: Section 5. The Template Builder is tightly integrated with Microsoft Word and enables you to perform the following functions: Insert data fields Insert tables Insert forms Insert charts Preview the template with sample XML data Browse and update the content of form fields Extract boilerplate text into an XLIFF translation file and test translations The Template Builder automates insertion of the most frequently used components of an RTF template.
The following demos are provided: TemplateBuilderDemo. Supported versions of Microsoft Word and Microsoft Windows are installed on the client. Note: See System Requirements and Certification for the most up-to-date information on supported hardware and software.
It contains the following topics: Section 5. If you selected a data model : Click Create Report to create a report for this data model in the BI Publisher catalog. Enter a Report Name and select the folder in which to save it. Click Save. The sample data from the data model is loaded to the Template Builder. Any existing templates are listed in the Layout Templates pane. To work in disconnected mode: Save a sample data file to your local computer.
To save data from the report viewer: In the BI Publisher catalog, navigate to the report. Click Open to run the report in the report viewer. Save the file to a local directory. When you select a data model, you are prompted to create a report in the catalog. Figure shows an example. In this step, select the data group that contains the data that is required for the table. This is optional. It allows you to perform the following tasks: Create a simple or nested table with a variable number of rows.
Select and define a layout for all the data fields in the template. Group or re-group the data. Note: If you use the left mouse button for drag and drop, then the node and all children are copied. You have the following options to describe how the Template Builder should show the field: Calculation You can select one of the aggregation functions for the data fields. Force LTR Left-to-Right Direction This option is only needed if you are using the template in a language that displays characters from right to left, such as Arabic or Hebrew.
You have the following options to describe how the Template Builder should render the group: Style To display the data as a horizontal table with a header, select Table. Grouping Grouping is an advanced operation that allows you to group the data by a specific element in the data.
Sort By Select an element by which the data groups are sorted. Sort Order If you have selected an element for Sort By you can select if the data should be sorted either ascending or descending.
0コメント