Invenzzia »

IMPORTANT ANNOUNCEMENT

Due to the uncertain status of the Flyspray project, lack of new releases and moving the code repository to Github, we decided to shutdown this issue tracker by the end of January 2011. From that date, the bugs should be reported directly in Github project repositories.

List of repositories:

Open Power Template 2.x family

PLEASE PROVIDE THE TEMPLATES AND/OR PHP CODE IN THE TASK DESCRIPTION (Not URL-s to them). THAT ALLOWS US TO REPRODUCE THE PROBLEM! OTHERWISE WE ARE NOT ABLE TO HELP YOU!

Remember to hide all the security-related pieces of code from the task description, like passwords, server paths etc. for your own safety. Once we close the task, we cannot edit it anymore!
Tasklist

FS#95 - For OPT V3 - Combination of Snippets (performance) and includes (nice handling)

Attached to Project: Open Power Template
Opened by Skruppy (Skrupellos) - Monday, 13 July 2009, 13:21 GMT-8
Last edited by Zyx (Zyx) - Thursday, 15 April 2010, 02:48 GMT-8
Task Type Feature Request
Category Instructions
Status Closed
Assigned To Zyx (Zyx)
Operating System OS-independent
Severity Low
Priority Normal
Reported Version 2.0-RC2
Due in Version 2.1.0
Due Date Undecided
Percent Complete 100%
Votes 0
Private No

Details

Up to now it is possible to dynamically include a whole file (with "opt:include"). This enables me to add some parameters in the opt:include tag or/and to import all parameters. opt:insert enables me to statically include a snippet. Here, I can't directly add some parameters and furthermore, the snipplet can see and change all variables of the including template.

With opt:include, there is also a performance problem. If you include more than 50 templates with some static strings as parameters, you have to create 50 Objects, copy literals to variables and do some template management. To save this overhead, I could copy and paste the template and replace all variables (this would be the manual way xD).

My idea is to combine opt:include and opt:insert. The resulting instruction could determine whether or not to "copy and paste" (like opt:insert) or dynamically include (like opt:include) the template/snippet by the file/snippet parameter (is it dynamic (parse:) or not(str:)). Snippets and files are both XML-Trees, the only difference is the declaration position (external file or inside a file). This means that you have to extract snippets to external files (for dynamic inclusion) and "copy and paste" template files for static inclusion. if you statically include a template, you have to substitute variable names with the expression in the parameters. unknown variable names have to be replaced (or something like that) to prevent collisions with "outside"-variable names. To import all "outside"-variables at once you could use a parameter like "import=yes" (of course, this is not exactly the same behavior like the opt:include import).
This task depends upon

Closed by  Zyx (Zyx)
Thursday, 15 April 2010, 02:48 GMT-8
Reason for closing:  Implemented
Additional comments about closing:  Implemented (procedures) in OPT 2.1

Loading...