]> git.llucax.com Git - software/bife/bife-all.git/commitdiff
Draft 3:
authorLeandro Lucarella <llucax@gmail.com>
Sat, 17 May 2003 04:59:29 +0000 (04:59 +0000)
committerLeandro Lucarella <llucax@gmail.com>
Sat, 17 May 2003 04:59:29 +0000 (04:59 +0000)
* Moved templates to a directory.
* Added an initial Umbrello class diagram.
* Added an initial xmi2code configuration file.
* Added an initial template file for xmi2code.
* Moved some functionality from BIFE_Base to a new class: BIFE_Container.
* Renamed BIFE_Common to BIFE_Generic and made it extends BIFE_Container.

bife.xmi [new file with mode: 0644]
index.php
template.php [new file with mode: 0644]
templates/bife_album.html [moved from bife_album.html with 100% similarity]
templates/bife_album_emptyitem.html [moved from bife_album_emptyitem.html with 100% similarity]
templates/bife_album_item.html [moved from bife_album_item.html with 100% similarity]
templates/bife_page.html [moved from bife_page.html with 100% similarity]
templates/bife_title.html [moved from bife_title.html with 100% similarity]
xmi2code.config [new file with mode: 0644]

diff --git a/bife.xmi b/bife.xmi
new file mode 100644 (file)
index 0000000..ca1e6c1
--- /dev/null
+++ b/bife.xmi
@@ -0,0 +1,142 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<XMI xmlns:UML="org.omg/standards/UML" verified="false" timestamp="" xmi.version="1.2" >
+ <XMI.header>
+  <XMI.documentation>
+   <XMI.exporter>umbrello uml modeller http://uml.sf.net</XMI.exporter>
+   <XMI.exporterVersion>1.1</XMI.exporterVersion>
+  </XMI.documentation>
+  <XMI.model xmi.name="bife" href="/home/llucar/public_html/bife/bife.xmi" />
+  <XMI.metamodel xmi.name="UML" href="UML.xml" xmi.version="1.3" />
+ </XMI.header>
+ <XMI.content>
+  <docsettings viewid="2" documentation="" uniqueid="24" />
+  <umlobjects>
+   <UML:Class stereotype="" package="BIFE" xmi.id="3" abstract="1" documentation="Base widget class." name="Widget" static="0" scope="200" >
+    <UML:Operation stereotype="" package="" xmi.id="4" type="void" abstract="1" documentation="Renders the widget returning a string.
+
+Renders the widget using a template returning a string with the
+results." name="render" static="0" scope="200" >
+     <UML:Parameter stereotype="" package="" xmi.id="1" value="" type="&amp;HTML_Template_Sigma" abstract="0" documentation="Template object to render the widget." name="template" static="0" scope="200" />
+    </UML:Operation>
+   </UML:Class>
+   <UML:Class stereotype="" package="BIFE" xmi.id="5" abstract="1" documentation="Base container widget class.
+
+This is a widget that can contain data (and other widgets too)." name="Container" static="0" scope="200" >
+    <UML:Operation stereotype="" package="" xmi.id="6" type="void" abstract="1" documentation="Adds contents to the container." name="addContents" static="0" scope="200" >
+     <UML:Parameter stereotype="" package="" xmi.id="1" value="" type="string" abstract="0" documentation="Contents to add to the container." name="contents" static="0" scope="200" />
+    </UML:Operation>
+   </UML:Class>
+   <UML:Class stereotype="" package="BIFE" xmi.id="7" abstract="1" documentation="This is a generic and simple BIFE_Container implementation." name="Generic" static="0" scope="200" >
+    <UML:Operation stereotype="" package="" xmi.id="10" type="void" abstract="0" documentation="Constructor." name="BIFE_Generic" static="0" scope="200" >
+     <UML:Parameter stereotype="" package="" xmi.id="1" value="" type="array" abstract="0" documentation="Attributes." name="attrs" static="0" scope="200" />
+    </UML:Operation>
+    <UML:Operation stereotype="" package="" xmi.id="11" type="void" abstract="0" documentation="Add contents to the widget." name="addContents" static="0" scope="200" >
+     <UML:Parameter stereotype="" package="" xmi.id="1" value="" type="string" abstract="0" documentation="Contents to add." name="contents" static="0" scope="200" />
+    </UML:Operation>
+    <UML:Operation stereotype="" package="" xmi.id="12" type="void" abstract="0" documentation="Renders the widget." name="render" static="0" scope="200" >
+     <UML:Parameter stereotype="" package="" xmi.id="1" value="" type="&amp;HTML_Template_Sigma" abstract="0" documentation="Template to use to render the widget." name="template" static="0" scope="200" />
+    </UML:Operation>
+    <UML:Attribute stereotype="" package="" xmi.id="8" value="" type="array" abstract="0" documentation="Attribute list." name="attrs" static="0" scope="201" />
+    <UML:Attribute stereotype="" package="" xmi.id="9" value="" type="string" abstract="0" documentation="" name="contents" static="0" scope="201" />
+   </UML:Class>
+   <UML:Class stereotype="" package="BIFE" xmi.id="14" abstract="0" documentation="Page widget." name="Page" static="0" scope="200" >
+    <UML:Operation stereotype="" package="" xmi.id="15" type="void" abstract="0" documentation="Constructor." name="BIFE_Page" static="0" scope="200" >
+     <UML:Parameter stereotype="" package="" xmi.id="1" value="" type="array" abstract="0" documentation="Attributes." name="attrs" static="0" scope="200" />
+    </UML:Operation>
+   </UML:Class>
+   <UML:Class stereotype="" package="BIFE" xmi.id="17" abstract="0" documentation="Title widget." name="Title" static="0" scope="200" >
+    <UML:Operation stereotype="" package="" xmi.id="18" type="void" abstract="0" documentation="Constructor." name="BIFE_Title" static="0" scope="200" >
+     <UML:Parameter stereotype="" package="" xmi.id="1" value="" type="array" abstract="0" documentation="Attributes." name="attrs" static="0" scope="200" />
+    </UML:Operation>
+   </UML:Class>
+   <UML:Class stereotype="" package="BIFE" xmi.id="20" abstract="0" documentation="Photo album widget.
+
+[TODO: Make a better explanation]" name="Album" static="0" scope="200" >
+    <UML:Operation stereotype="" package="" xmi.id="22" type="void" abstract="0" documentation="Constructor." name="BIFE_Album" static="0" scope="200" >
+     <UML:Parameter stereotype="" package="" xmi.id="1" value="" type="array" abstract="0" documentation="Attributes." name="attrs" static="0" scope="200" />
+    </UML:Operation>
+    <UML:Operation stereotype="" package="" xmi.id="23" type="void" abstract="0" documentation="Renders the widget." name="render" static="0" scope="200" >
+     <UML:Parameter stereotype="" package="" xmi.id="1" value="" type="&amp;HTML_Template_Sigma" abstract="0" documentation="Template to use to render the widget." name="template" static="0" scope="200" />
+    </UML:Operation>
+    <UML:Attribute stereotype="" package="" xmi.id="21" value="" type="array" abstract="0" documentation="Attributes." name="attrs" static="0" scope="201" />
+   </UML:Class>
+  </umlobjects>
+  <diagrams>
+   <diagram snapgrid="0" showattsig="1" fillcolor="#ffffc0" showgrid="1" showopsig="1" usefillcolor="1" snapx="10" snapy="10" showatts="1" xmi.id="2" documentation="" type="402" showops="1" showpackage="1" name="class diagram" localid="30000" showstereotype="0" showscope="1" font="Helvetica,10,-1,5,48,0,0,0,0,0" linecolor="#ff0000" >
+    <widgets>
+     <UML:ConceptWidget usesdiagramfillcolour="0" width="104" showattsigs="601" usesdiagramusefillcolour="0" x="170" linecolour="#ff0000" y="70" showopsigs="601" usesdiagramlinecolour="0" fillcolour="#ffffc0" height="28" usefillcolor="1" showattributes="0" xmi.id="3" showoperations="0" showpackage="1" showscope="1" showstereotype="0" font="Helvetica,10,-1,5,48,0,0,0,0,0" />
+     <UML:ConceptWidget usesdiagramfillcolour="0" width="123" showattsigs="601" usesdiagramusefillcolour="0" x="83" linecolour="#ff0000" y="160" showopsigs="601" usesdiagramlinecolour="0" fillcolour="#ffffc0" height="28" usefillcolor="1" showattributes="0" xmi.id="5" showoperations="0" showpackage="1" showscope="1" showstereotype="0" font="Helvetica,10,-1,5,48,0,0,0,0,0" />
+     <UML:ConceptWidget usesdiagramfillcolour="0" width="109" showattsigs="601" usesdiagramusefillcolour="0" x="90" linecolour="#ff0000" y="260" showopsigs="601" usesdiagramlinecolour="0" fillcolour="#ffffc0" height="28" usefillcolor="1" showattributes="0" xmi.id="7" showoperations="0" showpackage="1" showscope="1" showstereotype="0" font="Helvetica,10,-1,5,48,0,0,0,0,0" />
+     <UML:ConceptWidget usesdiagramfillcolour="0" width="90" showattsigs="601" usesdiagramusefillcolour="0" x="30" linecolour="#ff0000" y="360" showopsigs="601" usesdiagramlinecolour="0" fillcolour="#ffffc0" height="28" usefillcolor="1" showattributes="0" xmi.id="14" showoperations="0" showpackage="1" showscope="1" showstereotype="0" font="Helvetica,10,-1,5,48,0,0,0,0,0" />
+     <UML:ConceptWidget usesdiagramfillcolour="0" width="84" showattsigs="601" usesdiagramusefillcolour="0" x="170" linecolour="#ff0000" y="360" showopsigs="601" usesdiagramlinecolour="0" fillcolour="#ffffc0" height="28" usefillcolor="1" showattributes="0" xmi.id="17" showoperations="0" showpackage="1" showscope="1" showstereotype="0" font="Helvetica,10,-1,5,48,0,0,0,0,0" />
+     <UML:ConceptWidget usesdiagramfillcolour="0" width="98" showattsigs="601" usesdiagramusefillcolour="0" x="250" linecolour="#ff0000" y="160" showopsigs="601" usesdiagramlinecolour="0" fillcolour="#ffffc0" height="28" usefillcolor="1" showattributes="0" xmi.id="20" showoperations="0" showpackage="1" showscope="1" showstereotype="0" font="Helvetica,10,-1,5,48,0,0,0,0,0" />
+    </widgets>
+    <messages/>
+    <associations>
+     <UML:AssocWidget totalcounta="2" indexa="1" totalcountb="3" indexb="1" widgetbid="3" widgetaid="5" documentation="" type="500" >
+      <linepath>
+       <startpoint startx="144" starty="160" />
+       <endpoint endx="204" endy="98" />
+      </linepath>
+     </UML:AssocWidget>
+     <UML:AssocWidget totalcounta="2" indexa="1" totalcountb="2" indexb="1" widgetbid="5" widgetaid="7" documentation="" type="500" >
+      <linepath>
+       <startpoint startx="144" starty="260" />
+       <endpoint endx="144" endy="188" />
+      </linepath>
+     </UML:AssocWidget>
+     <UML:AssocWidget totalcounta="2" indexa="1" totalcountb="3" indexb="1" widgetbid="7" widgetaid="14" documentation="" type="500" >
+      <linepath>
+       <startpoint startx="75" starty="360" />
+       <endpoint endx="126" endy="288" />
+      </linepath>
+     </UML:AssocWidget>
+     <UML:AssocWidget totalcounta="2" indexa="1" totalcountb="3" indexb="2" widgetbid="7" widgetaid="17" documentation="" type="500" >
+      <linepath>
+       <startpoint startx="212" starty="360" />
+       <endpoint endx="162" endy="288" />
+      </linepath>
+     </UML:AssocWidget>
+     <UML:AssocWidget totalcounta="2" indexa="1" totalcountb="3" indexb="2" widgetbid="3" widgetaid="20" documentation="" type="500" >
+      <linepath>
+       <startpoint startx="299" starty="160" />
+       <endpoint endx="239" endy="98" />
+      </linepath>
+     </UML:AssocWidget>
+    </associations>
+   </diagram>
+  </diagrams>
+  <listview>
+   <listitem open="1" type="800" id="-1" label="Views" >
+    <listitem open="1" type="801" id="-1" label="Logical View" >
+     <listitem open="0" type="813" id="20" label="Album" >
+      <listitem open="0" type="815" id="22" label="BIFE_Album" />
+      <listitem open="0" type="814" id="21" label="attrs" />
+      <listitem open="0" type="815" id="23" label="render" />
+     </listitem>
+     <listitem open="0" type="813" id="5" label="Container" >
+      <listitem open="0" type="815" id="6" label="addContents" />
+     </listitem>
+     <listitem open="0" type="813" id="7" label="Generic" >
+      <listitem open="0" type="815" id="10" label="BIFE_Generic" />
+      <listitem open="0" type="815" id="11" label="addContents" />
+      <listitem open="0" type="814" id="8" label="attrs" />
+      <listitem open="0" type="814" id="9" label="contents" />
+      <listitem open="0" type="815" id="12" label="render" />
+     </listitem>
+     <listitem open="0" type="813" id="14" label="Page" >
+      <listitem open="0" type="815" id="15" label="BIFE_Page" />
+     </listitem>
+     <listitem open="0" type="813" id="17" label="Title" >
+      <listitem open="0" type="815" id="18" label="BIFE_Title" />
+     </listitem>
+     <listitem open="0" type="813" id="3" label="Widget" >
+      <listitem open="0" type="815" id="4" label="render" />
+     </listitem>
+     <listitem open="0" type="807" id="2" label="class diagram" />
+    </listitem>
+    <listitem open="1" type="802" id="-1" label="Use Case View" />
+   </listitem>
+  </listview>
+ </XMI.content>
+</XMI>
index 439ab5fa0e52f1decfa046330f9244faaa604811..aabb4e9111541916494a00e3ec526acf9bc552de 100644 (file)
--- a/index.php
+++ b/index.php
@@ -1,12 +1,12 @@
 <?
-// BIFE: Build It FastEr - draft 2
+// BIFE: Build It FastEr - draft 4
 
 require_once 'HTML/Template/Sigma.php';
 require_once 'Album.php';
 
 $file = "simple.xml";
 
-$template =& new HTML_Template_Sigma('.');
+$template =& new HTML_Template_Sigma('templates');
 $template->setErrorHandling(PEAR_ERROR_PRINT);
 
 $output = '';
@@ -70,24 +70,33 @@ class BIFE_Base {
             E_USER_ERROR);
     }
 
-    function addContents($contents) {
+    function process(&$template) {
         trigger_error('Method not implemented '.get_class($this).
             '::addContents().', E_USER_ERROR);
     }
 
-    function process(&$template) {
+}
+
+class BIFE_Container extends BIFE_Base {
+
+    function BIFE_Container() {
+        trigger_error('Can\'t instanciate abstract class BIFE_Container.',
+            E_USER_ERROR);
+    }
+
+    function addContents($contents) {
         trigger_error('Method not implemented '.get_class($this).
             '::addContents().', E_USER_ERROR);
     }
 
 }
 
-class BIFE_Common extends BIFE_Base {
+class BIFE_Generic extends BIFE_Container {
 
     var $attrs;
     var $contents;
 
-    function BIFE_Common($attrs) {
+    function BIFE_Generic($attrs) {
         $this->attrs    = $attrs;
         $this->contents = '';
     }
@@ -105,15 +114,15 @@ class BIFE_Common extends BIFE_Base {
 
 }
 
-class BIFE_Page extends BIFE_Common {
+class BIFE_Page extends BIFE_Generic {
     function BIFE_Page($attrs) {
-        $this->BIFE_Common($attrs);
+        $this->BIFE_Generic($attrs);
     }
 }
 
-class BIFE_Title extends BIFE_Common {
+class BIFE_Title extends BIFE_Generic {
     function BIFE_Title($attrs) {
-        $this->BIFE_Common($attrs);
+        $this->BIFE_Generic($attrs);
     }
 }
 
diff --git a/template.php b/template.php
new file mode 100644 (file)
index 0000000..3de96f6
--- /dev/null
@@ -0,0 +1,27 @@
+<?php
+// vim: set expandtab tabstop=4 softtabstop=4 shiftwidth=4:
+// +--------------------------------------------------------------------+
+// |                      BIFE - Buil It Fast & Easy                    |
+// +--------------------------------------------------------------------+
+// | This file is part of BIFE.                                         |
+// |                                                                    |
+// | BIFE is free software; you can redistribute it and/or modify it    |
+// | under the terms of the GNU General Public License as published by  |
+// | the Free Software Foundation; either version 2 of the License, or  |
+// | (at your option) any later version.                                |
+// |                                                                    |
+// | BIFE is distributed in the hope that it will be useful, but        |
+// | WITHOUT ANY WARRANTY; without even the implied warranty of         |
+// | MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU   |
+// | General Public License for more details.                           |
+// |                                                                    |
+// | You should have received a copy of the GNU General Public License  |
+// | along with Hooks; if not, write to the Free Software Foundation,   |
+// | Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307  USA      |
+// +--------------------------------------------------------------------+
+// | Created: @date
+// | Authors: @author
+// +--------------------------------------------------------------------+
+//
+// $Id$
+//
\ No newline at end of file
similarity index 100%
rename from bife_album.html
rename to templates/bife_album.html
similarity index 100%
rename from bife_page.html
rename to templates/bife_page.html
similarity index 100%
rename from bife_title.html
rename to templates/bife_title.html
diff --git a/xmi2code.config b/xmi2code.config
new file mode 100644 (file)
index 0000000..010d975
--- /dev/null
@@ -0,0 +1,22 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<xmi2code>
+  <!-- general options -->
+  <option key="target" value=""/>
+  <option key="xmi-input" value="bife.xmi"/>
+  <option key="config-file" value="xmi2code.config"/>
+  <option key="config-file-set" value="false"/>
+  <option key="handler" value="umbrello"/>
+  <option key="generator-path" value="."/>
+  <option key="use-package-as-dir" value="true"/>
+  <option key="indent" value="    "/>
+  <option key="files-case" value="preserve"/>
+  <option key="generator" value="php.pear"/>
+  <option key="template-path" value="."/>
+  <option key="php.template" value="template.php"/>
+  <option key="php.default-code" value="trigger_error('Not implemented!', E_USER_WARNING);"/>
+  <option key="php.pear.use-package-in-classnames" value="true"/>
+  <!-- user defined variables (for templates)  -->
+  <option key="project" value="BIFE"/>
+  <option key="author" value="Leandro Lucarella"/>
+  <option key="email" value="luca@lugmen.org.ar"/>
+</xmi2code>