Loading...
 
Skip to main content

Custom Share Module 0.1dev

History: TikiIntegrator

Preview of version: 19

Overview

Tiki Integrator is a feature to allow easy integration of third party pages into the Tiki (with look and theme of Tiki page). Integrator may have several repositories. 'Repository' is just a path on the local filesystem where a set of files is stored. These files will be processed later by integrator's rules. Such rules usually do two actions:

  1. remove all before HTML <BODY> and after </BODY> tags
  2. fix hyperlinks and reference to images so they will point to the Tiki Integrator wrapper to be correctly displayed from inside Tiki

Integrator does not do it by itself — all rules and repositories must be configured by admin. To process the file (note that it works with local HTML files by opening and processing them) just apply configuration rules for a given repository and insert the result inside tiki-center div to integrate a page into tiki.

origins of this idea

Originally this feature was developed to access and view doxygened pages from inside Tiki. After some time, the following idea came into my head... ๐Ÿ˜Š As many other programmers I have a lot of repositories (directories) with third party documentation (usually static *.html files) which I need to have fast access to from one point — my intranet Tiki site which is used as a team groupware tool. So Tiki Integrator should help me to do this ๐Ÿ˜Š

Internals Design

What I plan to implement
  • Integrator may have a set of repositories and an admin interface that should allow to manipulate the repositories
    • usual operations are: add/remove/edit repository and list repositories
  • Integrator may setup several rules for one repository
  • Rules can be two types
    • simple — use underlaying str_replace
    • advanced — use regexes
  • To be integrated, pages get processed (filtered through) by the wrapper which is applying rules defined for the given repository
  • It is possible to load an addon CSS file (which can be redefined by current theme)
    1. at first the wrapper will search for files redefined for current theme (let it be prefixed with current theme name)
    2. then a general file (configured for this specific repository) will be searched

DB Schema
  • 2 tables are required to implement this feature
    • tiki_integrator_repositories — Integrator repositories
    • tiki_integrator_rules — integration rules for repositories
  • The following fields are needed in tiki_int_repositories
    • repID — repository identifier
    • name — human readable repository name
    • path — path relative to root of local webserver
    • start_page — page to be displayed if file argument for wrapper script is missing
    • styles_file — CSS file to be loaded
    • visibility — is repository visible in users list (this allows to create &quot;rules only&quot; repositories — i.e. repositories with the only goal: be rule sources for others... like a &quot;skeleton&quot; file)
    • cacheable — is pages in repository should be cached
    • description — short human readable text about this repository
  • The following fields are needed in tiki_int_rules
    • ruleID — rule identifier
    • repID — repository identifier
    • ord — rules will be applied according to this order
    • srch — text to search
    • repl — text to replace
    • type — simple ('n' value) or advanced ('y' value)
    • casesense — case sensitivity (y/n) if simple rule
    • rxmod — regex modifiers (see PHP docs) if advanced rule
    • description — rule comment (what is this ๐Ÿ˜Š

What has been implemented
  • <Need smbd to decribe this>
  • Easy rules for copying between repositories
  • Rule preview — allows to play with rules and see results
    • HTML code view panel
    • Results view panel
  • Can intergate remote pages (http(s)://...). This will allow also to integrate locally located scripts (i.e. they should get interpreted by web server before processed by wrapper)
  • Special meta-variables (don't know how to name this ๐Ÿ˜Š may be used in replace field
    • {repID} — ID of current repository (very helpful for links fixing ๐Ÿ˜Š
    • {path} — path of configured repository (very helpful for images/scripts fixing ๐Ÿ˜Š
  • Intergated pages can be cached. This helps to avoid processing repository pages each time they accessed, after 1st touch page will be cached and used all next times.
    • Be aware of call refresh_cache() for integrator pages! URLs associated with cached data actualy can't be accessed for that data!

Requirements

In php.ini track_errors should be On to be able to show integration error messages in a convenient way (-+$php_errormsg+- PHP variable used).

Copy to clipboard
;Store the last error/warning message in $php_errormsg (boolean). track_errors = On

Micro HOWTO

As a little tutorial I'll teach you how to integrate doxygened documentation.

  1. at first you need to produce it ๐Ÿ˜Š and to put it into your document root... let it be /var/www/html/mydoxydoc. Also consider to fix background of generated pictures — to make it transparent (not all themes in Tiki have white background). ๐Ÿ˜Š You may do this by one simple command:
    Copy to clipboard
    cd /var/www/html/mydoxydoc; find . -name '*.png' -exec convert -transparent '#FFFFFF' '{}' '{}' ';'
    As you may notice Image Magick needs to be installed on your system.
  2. Next you need to define the repository using Admin tool. Specify the following
    [+]
  3. OK your first repository has been created. Now it's time to define some integration rules. Click on your repository in the table below ...
  4. ... and on the new page (Edit Rules for Repository) press copy rules link...
    [+]
  5. Choose Doxygened (1.3.4) Documentation and press the Copy button
    • here is a small cheat: by default (just after install) Tiki Integrator already has rules for doxygened repositories (as most usual type of programmer documentation)... in other cases you will need to make such rules for your repository by yourself... but fortunately it is easier than you may think ๐Ÿ˜Š
  6. Press/click view repository and enjoy ๐Ÿ˜Š
    • it's recommended to use one of the Notheme themes ๐Ÿ˜Š
    • ... also you may ask the author of your preferred theme to provide doxygen.css file too ๐Ÿ˜Š

Todo and Future Plans

  • Wiki plugin to integrate other page content
  • Easy import/export of integration rules. Need to choose in what way:
    1. XML file
    2. SQL file
    3. PHP serialize/unserialize
  • Need a way to see files in repository (smth like `ls` or dir ๐Ÿ˜Š
  • Repository can be a set of remote files — imagine what repository have only remote files and that files have no any links. In current concept such files can be integrated only as separate repositories (what is lack). Need a way to add remote files to repository and later ability to list all files in repository...
  • Handle HTTP POST/GET methods
    • in what way?
    • what to do with posted data?
    • where to get required data?
    • how to describe it?
    • what integrated page should look like after filtering?
    • ... so much questions w/o (currently ๐Ÿ˜Š answers... — any suggestions?
  • To reduce CPU load at processing pages it will be cool to add cache for integrated pages... mose hopes that it will help him ๐Ÿ˜Š
    • Look like tiki already have basics for caching service — maybe I should use it? Possible it will be needed to add smth to its functionality — maybe even make separate class (service)...

FAQ

โ“ Will there be a way to use the file system in tiki to allow users to upload their html files to the tiki file gallery and then have the integrator work its magic?
โžก๏ธ Yes. Files from gallery should be configured as remote.

โ“ Can the integrated pages be edited like a wiki page?
โžก๏ธ No! tiki-inegrator.php just wraps for other (real but located in other place) files.

History

Advanced
Information Version
Xavier de Pedro 30
View
zaufi 29
View
zaufi 28
View
zaufi 27
View
DennisDaniels 26
View
zaufi 25
View
zaufi 24
View
zaufi 23
View
zaufi 22
View
zaufi 21
View
zaufi 20
View
zaufi 19
View

Upcoming Events

1)  15 Aug 2024 14:00 GMT-0000
Tiki Roundtable Meeting
2)  19 Sep 2024 14:00 GMT-0000
Tiki Roundtable Meeting
3) 
Tiki birthday
4)  17 Oct 2024 14:00 GMT-0000
Tiki Roundtable Meeting
5)  21 Nov 2024 14:00 GMT-0000
Tiki Roundtable Meeting
6)  19 Dec 2024 14:00 GMT-0000
Tiki Roundtable Meeting