]> git.llucax.com Git - mecon/ai.git/commitdiff
Se agregan 2 tipos de orden predefinidos para los servicios:
authorLeandro Lucarella <llucax@gmail.com>
Wed, 8 Oct 2003 21:31:42 +0000 (21:31 +0000)
committerLeandro Lucarella <llucax@gmail.com>
Wed, 8 Oct 2003 21:31:42 +0000 (21:31 +0000)
AI_SERVICIO_ORDEN_LONG_HIJOS y AI_SERVICIO_ORDEN_LONG_NOMBRE. El primero
está pensado para ordenar las tablas de servicios realizando un balance de
carga, ya que ordena haciendo un calculo que predice la cantidad de
renglones que ocupará cada hijo.
El segundo está pensado para ordenar los contenidos de una tabla, para que
aparezcan los nombres mas largos abajo.

doc/uml.xmi
lib/AI/DBTreeObject.php
lib/AI/Error.php
lib/AI/Servicio.php

index 45fd219fd5c21738c8c84ee13823b925b163d4e2..77312b533d1447e5ae179e50fabfca8ab692166a 100644 (file)
@@ -10,7 +10,7 @@
   <XMI.metamodel xmi.name="UML" href="UML.xml" xmi.version="1.3" />
  </XMI.header>
  <XMI.content>
-  <docsettings viewid="412" documentation="" uniqueid="538" />
+  <docsettings viewid="412" documentation="" uniqueid="539" />
   <umlobjects>
    <UML:Class stereotype="" package="AI" xmi.id="413" abstract="0" documentation="Servicio." name="AI_Servicio" static="0" scope="200" >
     <UML:Operation stereotype="" package="" xmi.id="465" type="void" abstract="0" documentation="" name="AI_Servicio" static="0" scope="200" >
      <UML:Parameter stereotype="" package="" xmi.id="1" value="" type="DB" abstract="0" documentation="DB donde guardar." name="db" static="0" scope="200" />
      <UML:Parameter stereotype="" package="" xmi.id="2" value="false" type="bool" abstract="0" documentation="Si es true, se fuerza a guardar el Servicio como nuevo." name="nuevo" static="0" scope="200" />
     </UML:Operation>
+    <UML:Operation stereotype="" package="" xmi.id="539" type="mixed" abstract="0" documentation="Carga hijos de un servicio. Si hubo error devuelve un PEAR_Error, si no hubo error, devuleve un array de objetos (los hijos)." name="cargarHijos" static="0" scope="200" >
+     <UML:Parameter stereotype="" package="" xmi.id="1" value="" type="mixed" abstract="0" documentation="Base de datos o resultado a usar." name="db" static="0" scope="201" />
+     <UML:Parameter stereotype="" package="" xmi.id="2" value="true" type="bool" abstract="0" documentation="Si es true, sólo trae los servicios habilitados." name="soloHabilitados" static="0" scope="201" />
+     <UML:Parameter stereotype="" package="" xmi.id="3" value="false" type="mixed" abstract="0" documentation="Indica el orden en que se deben traer los hijos. Puede ser AI_SERVICIO_ORDEN_CANT_HIJOS, AI_SERVICIO_ORDEN_LONG_NOMBRE o un campo arbitrario." name="orden" static="0" scope="201" />
+    </UML:Operation>
     <UML:Attribute stereotype="" package="" xmi.id="428" value="0" type="int" abstract="0" documentation="ID del servicio." name="servicio" static="0" scope="200" />
     <UML:Attribute stereotype="" package="" xmi.id="452" value="0" type="int" abstract="0" documentation="" name="servicio_padre" static="0" scope="200" />
     <UML:Attribute stereotype="" package="" xmi.id="429" value="''" type="string" abstract="0" documentation="Nombre del servicio." name="nombre" static="0" scope="200" />
@@ -136,69 +141,84 @@ Sólo se obtienen las secciones que todavía no pertenecen a ningún grupo. Si s
     <UML:Attribute stereotype="" package="" xmi.id="525" value="array()" type="array" abstract="0" documentation="Grupos de secciones que tiene este grupo.
 x2c:get" name="hijos" static="0" scope="202" />
    </UML:Class>
-   <UML:Association nameb="" stereotype="" visibilitya="200" visibilityb="200" assoctype="500" rolea="469" roleb="471" multia="" doca="" multib="" docb="" package="" xmi.id="-1" abstract="0" documentation="" name="" static="0" scope="200" changeabilitya="900" changeabilityb="900" namea="" />
-   <UML:Association nameb="" stereotype="" visibilitya="200" visibilityb="200" assoctype="500" rolea="416" roleb="516" multia="" doca="" multib="" docb="" package="" xmi.id="-1" abstract="0" documentation="" name="" static="0" scope="200" changeabilitya="900" changeabilityb="900" namea="" />
-   <UML:Association nameb="" stereotype="" visibilitya="200" visibilityb="200" assoctype="500" rolea="524" roleb="516" multia="" doca="" multib="" docb="" package="" xmi.id="-1" abstract="0" documentation="" name="" static="0" scope="200" changeabilitya="900" changeabilityb="900" namea="" />
-   <UML:Association nameb="" stereotype="" visibilitya="200" visibilityb="200" assoctype="500" rolea="486" roleb="524" multia="" doca="" multib="" docb="" package="" xmi.id="-1" abstract="0" documentation="" name="" static="0" scope="200" changeabilitya="900" changeabilityb="900" namea="" />
-   <UML:Association nameb="" stereotype="" visibilitya="200" visibilityb="200" assoctype="500" rolea="413" roleb="524" multia="" doca="" multib="" docb="" package="" xmi.id="-1" abstract="0" documentation="" name="" static="0" scope="200" changeabilitya="900" changeabilityb="900" namea="" />
   </umlobjects>
   <diagrams>
-   <diagram snapgrid="0" showattsig="1" fillcolor="#ffffc0" zoom="100" showgrid="1" showopsig="1" usefillcolor="1" snapx="10" canvaswidth="819" snapy="10" showatts="1" xmi.id="412" documentation="" type="402" showops="1" showpackage="0" name="Clases" localid="30000" showstereotype="0" showscope="1" snapcsgrid="0" font="Helvetica,12,-1,5,50,0,0,0,0,0" linecolor="#ff0000" canvasheight="632" >
+   <diagram snapgrid="0" showattsig="1" fillcolor="#ffffc0" zoom="100" showgrid="1" showopsig="1" usefillcolor="1" snapx="10" canvaswidth="834" snapy="10" showatts="1" xmi.id="412" documentation="" type="402" showops="1" showpackage="0" name="Clases" localid="30000" showstereotype="0" showscope="1" snapcsgrid="0" font="Helvetica,12,-1,5,50,0,0,0,0,0" linecolor="#ff0000" canvasheight="648" >
     <widgets>
-     <UML:ClassWidget usesdiagramfillcolour="0" width="152" showattsigs="601" usesdiagramusefillcolour="0" x="386" linecolour="#ff0000" y="353" showopsigs="600" instancename="" usesdiagramlinecolour="0" fillcolour="#ffffc0" height="156" usefillcolor="1" showattributes="1" isinstance="0" xmi.id="413" showoperations="1" showpackage="0" showscope="1" showstereotype="0" font="Helvetica,8,-1,5,50,0,0,0,0,0" />
-     <UML:ClassWidget usesdiagramfillcolour="0" width="369" showattsigs="601" usesdiagramusefillcolour="0" x="9" linecolour="#ff0000" y="180" showopsigs="601" instancename="" usesdiagramlinecolour="0" fillcolour="#ffffc0" height="182" usefillcolor="1" showattributes="1" isinstance="0" xmi.id="416" showoperations="1" showpackage="0" showscope="1" showstereotype="0" font="Helvetica,8,-1,5,50,0,0,0,0,0" />
-     <UML:ClassWidget usesdiagramfillcolour="0" width="241" showattsigs="601" usesdiagramusefillcolour="0" x="89" linecolour="#ff0000" y="430" showopsigs="601" instancename="" usesdiagramlinecolour="0" fillcolour="#ffffc0" height="45" usefillcolor="1" showattributes="1" isinstance="0" xmi.id="469" showoperations="1" showpackage="0" showscope="1" showstereotype="0" font="Helvetica,8,-1,5,50,0,0,0,0,0" />
-     <UML:ClassWidget usesdiagramfillcolour="0" width="68" showattsigs="601" usesdiagramusefillcolour="0" x="175" linecolour="#ff0000" y="374" showopsigs="601" instancename="" usesdiagramlinecolour="0" fillcolour="#dcdcdc" height="23" usefillcolor="1" showattributes="0" isinstance="0" xmi.id="471" showoperations="0" showpackage="0" showscope="1" showstereotype="0" font="Helvetica,8,-1,5,50,0,0,0,0,0" />
-     <UML:ClassWidget usesdiagramfillcolour="0" width="142" showattsigs="601" usesdiagramusefillcolour="0" x="572" linecolour="#ff0000" y="354" showopsigs="600" instancename="" usesdiagramlinecolour="0" fillcolour="#ffffc0" height="182" usefillcolor="1" showattributes="1" isinstance="0" xmi.id="486" showoperations="1" showpackage="0" showscope="1" showstereotype="0" font="Helvetica,8,-1,5,50,0,0,0,0,0" />
-     <UML:ClassWidget usesdiagramfillcolour="0" width="324" showattsigs="601" usesdiagramusefillcolour="0" x="244" linecolour="#ff0000" y="10" showopsigs="601" instancename="" usesdiagramlinecolour="0" fillcolour="#ffffc0" height="91" usefillcolor="1" showattributes="1" isinstance="0" xmi.id="516" showoperations="1" showpackage="0" showscope="1" showstereotype="0" font="Helvetica,8,-1,5,50,0,0,0,0,0" />
-     <UML:ClassWidget usesdiagramfillcolour="0" width="415" showattsigs="601" usesdiagramusefillcolour="0" x="415" linecolour="#ff0000" y="180" showopsigs="601" instancename="" usesdiagramlinecolour="0" fillcolour="#ffffc0" height="65" usefillcolor="1" showattributes="1" isinstance="0" xmi.id="524" showoperations="1" showpackage="0" showscope="1" showstereotype="0" font="Helvetica,8,-1,5,50,0,0,0,0,0" />
+     <UML:ClassWidget usesdiagramfillcolour="0" width="152" showattsigs="601" usesdiagramusefillcolour="0" x="386" linecolour="#ff0000" y="353" showopsigs="600" instancename="" usesdiagramlinecolour="0" fillcolour="#ffffc0" height="169" usefillcolor="1" showattributes="1" isinstance="0" xmi.id="413" showoperations="1" showpackage="0" showscope="1" showstereotype="0" font="Helvetica,8,-1,5,50,0,1,0,0,0" />
+     <UML:ClassWidget usesdiagramfillcolour="0" width="369" showattsigs="601" usesdiagramusefillcolour="0" x="9" linecolour="#ff0000" y="180" showopsigs="601" instancename="" usesdiagramlinecolour="0" fillcolour="#ffffc0" height="182" usefillcolor="1" showattributes="1" isinstance="0" xmi.id="416" showoperations="1" showpackage="0" showscope="1" showstereotype="0" font="Helvetica,8,-1,5,50,0,1,0,0,0" />
+     <UML:ClassWidget usesdiagramfillcolour="0" width="241" showattsigs="601" usesdiagramusefillcolour="0" x="89" linecolour="#ff0000" y="430" showopsigs="601" instancename="" usesdiagramlinecolour="0" fillcolour="#ffffc0" height="45" usefillcolor="1" showattributes="1" isinstance="0" xmi.id="469" showoperations="1" showpackage="0" showscope="1" showstereotype="0" font="Helvetica,8,-1,5,50,0,1,0,0,0" />
+     <UML:ClassWidget usesdiagramfillcolour="0" width="68" showattsigs="601" usesdiagramusefillcolour="0" x="175" linecolour="#ff0000" y="374" showopsigs="601" instancename="" usesdiagramlinecolour="0" fillcolour="#dcdcdc" height="23" usefillcolor="1" showattributes="0" isinstance="0" xmi.id="471" showoperations="0" showpackage="0" showscope="1" showstereotype="0" font="Helvetica,8,-1,5,75,0,0,0,0,0" />
+     <UML:ClassWidget usesdiagramfillcolour="0" width="142" showattsigs="601" usesdiagramusefillcolour="0" x="572" linecolour="#ff0000" y="354" showopsigs="600" instancename="" usesdiagramlinecolour="0" fillcolour="#ffffc0" height="182" usefillcolor="1" showattributes="1" isinstance="0" xmi.id="486" showoperations="1" showpackage="0" showscope="1" showstereotype="0" font="Helvetica,8,-1,5,50,0,1,0,0,0" />
+     <UML:ClassWidget usesdiagramfillcolour="0" width="324" showattsigs="601" usesdiagramusefillcolour="0" x="244" linecolour="#ff0000" y="10" showopsigs="601" instancename="" usesdiagramlinecolour="0" fillcolour="#ffffc0" height="91" usefillcolor="1" showattributes="1" isinstance="0" xmi.id="516" showoperations="1" showpackage="0" showscope="1" showstereotype="0" font="Helvetica,8,-1,5,50,0,1,0,0,0" />
+     <UML:ClassWidget usesdiagramfillcolour="0" width="415" showattsigs="601" usesdiagramusefillcolour="0" x="415" linecolour="#ff0000" y="180" showopsigs="601" instancename="" usesdiagramlinecolour="0" fillcolour="#ffffc0" height="65" usefillcolor="1" showattributes="1" isinstance="0" xmi.id="524" showoperations="1" showpackage="0" showscope="1" showstereotype="0" font="Helvetica,8,-1,5,50,0,1,0,0,0" />
     </widgets>
     <messages/>
     <associations>
-     <UML:AssocWidget totalcounta="2" indexa="1" visibilityB="200" totalcountb="2" indexb="1" widgetbid="471" roleBdoc="" widgetaid="469" roleAdoc="" documentation="" type="500" changeabilityA="900" changeabilityB="900" visibilityA="200" >
-      <UML:FloatingTextWidget usesdiagramfillcolour="1" width="0" usesdiagramusefillcolour="1" x="-4" linecolour="none" y="0" operation="" instancename="" posttext="" usesdiagramlinecolour="1" role="703" fillcolour="none" height="0" usefillcolor="1" seqnum="" pretext="" isinstance="0" xmi.id="-1" text="" font="helvetica,12,-1,5,50,0,0,0,0,0" />
-      <UML:FloatingTextWidget usesdiagramfillcolour="1" width="0" usesdiagramusefillcolour="1" x="-12" linecolour="none" y="0" operation="" instancename="" posttext="" usesdiagramlinecolour="1" role="711" fillcolour="none" height="0" usefillcolor="1" seqnum="" pretext="" isinstance="0" xmi.id="-1" text="" font="helvetica,12,-1,5,50,0,0,0,0,0" />
-      <UML:FloatingTextWidget usesdiagramfillcolour="1" width="0" usesdiagramusefillcolour="1" x="-9" linecolour="none" y="0" operation="" instancename="" posttext="" usesdiagramlinecolour="1" role="712" fillcolour="none" height="0" usefillcolor="1" seqnum="" pretext="" isinstance="0" xmi.id="-1" text="" font="helvetica,12,-1,5,50,0,0,0,0,0" />
+     <UML:AssocWidget totalcounta="2" indexa="1" visibilityB="200" totalcountb="2" indexb="1" widgetbid="471" widgetaid="469" roleBdoc="" roleAdoc="" type="500" changeabilityA="900" changeabilityB="900" visibilityA="200" >
       <linepath>
        <startpoint startx="209" starty="430" />
        <endpoint endx="209" endy="397" />
       </linepath>
+      <UML:FloatingTextWidget usesdiagramfillcolour="1" width="8" usesdiagramusefillcolour="1" x="-4" linecolour="none" y="0" instancename="" posttext="" usesdiagramlinecolour="1" role="703" fillcolour="none" height="23" usefillcolor="1" pretext="" isinstance="0" xmi.id="-1" text="" font="helvetica,12,-1,5,50,0,0,0,0,0" />
+      <UML:FloatingTextWidget usesdiagramfillcolour="1" width="8" usesdiagramusefillcolour="1" x="1" linecolour="none" y="1" instancename="" posttext="" usesdiagramlinecolour="1" role="701" fillcolour="none" height="23" usefillcolor="1" pretext="" isinstance="0" xmi.id="-1" text="" font="helvetica,12,-1,5,50,0,0,0,0,0" />
+      <UML:FloatingTextWidget usesdiagramfillcolour="1" width="8" usesdiagramusefillcolour="1" x="1" linecolour="none" y="1" instancename="" posttext="" usesdiagramlinecolour="1" role="702" fillcolour="none" height="23" usefillcolor="1" pretext="" isinstance="0" xmi.id="-1" text="" font="helvetica,12,-1,5,50,0,0,0,0,0" />
+      <UML:FloatingTextWidget usesdiagramfillcolour="1" width="18" usesdiagramusefillcolour="1" x="-21" linecolour="none" y="1" instancename="" posttext="" usesdiagramlinecolour="1" role="709" fillcolour="none" height="23" usefillcolor="1" pretext="+" isinstance="0" xmi.id="-1" text="" font="helvetica,12,-1,5,50,0,0,0,0,0" />
+      <UML:FloatingTextWidget usesdiagramfillcolour="1" width="18" usesdiagramusefillcolour="1" x="-21" linecolour="none" y="1" instancename="" posttext="" usesdiagramlinecolour="1" role="710" fillcolour="none" height="23" usefillcolor="1" pretext="+" isinstance="0" xmi.id="-1" text="" font="helvetica,12,-1,5,50,0,0,0,0,0" />
+      <UML:FloatingTextWidget usesdiagramfillcolour="1" width="8" usesdiagramusefillcolour="1" x="-12" linecolour="none" y="0" instancename="" posttext="" usesdiagramlinecolour="1" role="711" fillcolour="none" height="23" usefillcolor="1" pretext="" isinstance="0" xmi.id="-1" text="" font="helvetica,12,-1,5,50,0,0,0,0,0" />
+      <UML:FloatingTextWidget usesdiagramfillcolour="1" width="8" usesdiagramusefillcolour="1" x="-9" linecolour="none" y="0" instancename="" posttext="" usesdiagramlinecolour="1" role="712" fillcolour="none" height="23" usefillcolor="1" pretext="" isinstance="0" xmi.id="-1" text="" font="helvetica,12,-1,5,50,0,0,0,0,0" />
      </UML:AssocWidget>
-     <UML:AssocWidget totalcounta="2" indexa="1" visibilityB="200" totalcountb="3" indexb="1" widgetbid="516" roleBdoc="" widgetaid="416" roleAdoc="" documentation="" type="500" changeabilityA="900" changeabilityB="900" visibilityA="200" >
-      <UML:FloatingTextWidget usesdiagramfillcolour="1" width="0" usesdiagramusefillcolour="1" x="0" linecolour="none" y="0" operation="" instancename="" posttext="" usesdiagramlinecolour="1" role="703" fillcolour="none" height="0" usefillcolor="1" seqnum="" pretext="" isinstance="0" xmi.id="-1" text="" font="helvetica,12,-1,5,50,0,0,0,0,0" />
-      <UML:FloatingTextWidget usesdiagramfillcolour="1" width="0" usesdiagramusefillcolour="1" x="0" linecolour="none" y="0" operation="" instancename="" posttext="" usesdiagramlinecolour="1" role="711" fillcolour="none" height="0" usefillcolor="1" seqnum="" pretext="" isinstance="0" xmi.id="-1" text="" font="helvetica,12,-1,5,50,0,0,0,0,0" />
-      <UML:FloatingTextWidget usesdiagramfillcolour="1" width="0" usesdiagramusefillcolour="1" x="0" linecolour="none" y="0" operation="" instancename="" posttext="" usesdiagramlinecolour="1" role="712" fillcolour="none" height="0" usefillcolor="1" seqnum="" pretext="" isinstance="0" xmi.id="-1" text="" font="helvetica,12,-1,5,50,0,0,0,0,0" />
+     <UML:AssocWidget totalcounta="2" indexa="1" visibilityB="200" totalcountb="3" indexb="1" widgetbid="516" widgetaid="416" roleBdoc="" roleAdoc="" type="500" changeabilityA="900" changeabilityB="900" visibilityA="200" >
       <linepath>
        <startpoint startx="193" starty="180" />
        <endpoint endx="352" endy="101" />
       </linepath>
+      <UML:FloatingTextWidget usesdiagramfillcolour="1" width="8" usesdiagramusefillcolour="1" x="27" linecolour="none" y="0" instancename="" posttext="" usesdiagramlinecolour="1" role="703" fillcolour="none" height="23" usefillcolor="1" pretext="" isinstance="0" xmi.id="-1" text="" font="helvetica,12,-1,5,50,0,0,0,0,0" />
+      <UML:FloatingTextWidget usesdiagramfillcolour="1" width="8" usesdiagramusefillcolour="1" x="1" linecolour="none" y="1" instancename="" posttext="" usesdiagramlinecolour="1" role="701" fillcolour="none" height="23" usefillcolor="1" pretext="" isinstance="0" xmi.id="-1" text="" font="helvetica,12,-1,5,50,0,0,0,0,0" />
+      <UML:FloatingTextWidget usesdiagramfillcolour="1" width="8" usesdiagramusefillcolour="1" x="55" linecolour="none" y="1" instancename="" posttext="" usesdiagramlinecolour="1" role="702" fillcolour="none" height="23" usefillcolor="1" pretext="" isinstance="0" xmi.id="-1" text="" font="helvetica,12,-1,5,50,0,0,0,0,0" />
+      <UML:FloatingTextWidget usesdiagramfillcolour="1" width="18" usesdiagramusefillcolour="1" x="-21" linecolour="none" y="1" instancename="" posttext="" usesdiagramlinecolour="1" role="709" fillcolour="none" height="23" usefillcolor="1" pretext="+" isinstance="0" xmi.id="-1" text="" font="helvetica,12,-1,5,50,0,0,0,0,0" />
+      <UML:FloatingTextWidget usesdiagramfillcolour="1" width="18" usesdiagramusefillcolour="1" x="33" linecolour="none" y="1" instancename="" posttext="" usesdiagramlinecolour="1" role="710" fillcolour="none" height="23" usefillcolor="1" pretext="+" isinstance="0" xmi.id="-1" text="" font="helvetica,12,-1,5,50,0,0,0,0,0" />
+      <UML:FloatingTextWidget usesdiagramfillcolour="1" width="8" usesdiagramusefillcolour="1" x="0" linecolour="none" y="0" instancename="" posttext="" usesdiagramlinecolour="1" role="711" fillcolour="none" height="23" usefillcolor="1" pretext="" isinstance="0" xmi.id="-1" text="" font="helvetica,12,-1,5,50,0,0,0,0,0" />
+      <UML:FloatingTextWidget usesdiagramfillcolour="1" width="8" usesdiagramusefillcolour="1" x="54" linecolour="none" y="0" instancename="" posttext="" usesdiagramlinecolour="1" role="712" fillcolour="none" height="23" usefillcolor="1" pretext="" isinstance="0" xmi.id="-1" text="" font="helvetica,12,-1,5,50,0,0,0,0,0" />
      </UML:AssocWidget>
-     <UML:AssocWidget totalcounta="2" indexa="1" visibilityB="200" totalcountb="3" indexb="2" widgetbid="516" roleBdoc="" widgetaid="524" roleAdoc="" documentation="" type="500" changeabilityA="900" changeabilityB="900" visibilityA="200" >
-      <UML:FloatingTextWidget usesdiagramfillcolour="1" width="0" usesdiagramusefillcolour="1" x="0" linecolour="none" y="0" operation="" instancename="" posttext="" usesdiagramlinecolour="1" role="703" fillcolour="none" height="0" usefillcolor="1" seqnum="" pretext="" isinstance="0" xmi.id="-1" text="" font="helvetica,12,-1,5,50,0,0,0,0,0" />
-      <UML:FloatingTextWidget usesdiagramfillcolour="1" width="0" usesdiagramusefillcolour="1" x="26" linecolour="none" y="0" operation="" instancename="" posttext="" usesdiagramlinecolour="1" role="711" fillcolour="none" height="0" usefillcolor="1" seqnum="" pretext="" isinstance="0" xmi.id="-1" text="" font="helvetica,12,-1,5,50,0,0,0,0,0" />
-      <UML:FloatingTextWidget usesdiagramfillcolour="1" width="0" usesdiagramusefillcolour="1" x="0" linecolour="none" y="0" operation="" instancename="" posttext="" usesdiagramlinecolour="1" role="712" fillcolour="none" height="0" usefillcolor="1" seqnum="" pretext="" isinstance="0" xmi.id="-1" text="" font="helvetica,12,-1,5,50,0,0,0,0,0" />
+     <UML:AssocWidget totalcounta="2" indexa="1" visibilityB="200" totalcountb="3" indexb="2" widgetbid="516" widgetaid="524" roleBdoc="" roleAdoc="" type="500" changeabilityA="900" changeabilityB="900" visibilityA="200" >
       <linepath>
        <startpoint startx="622" starty="180" />
        <endpoint endx="460" endy="101" />
       </linepath>
+      <UML:FloatingTextWidget usesdiagramfillcolour="1" width="8" usesdiagramusefillcolour="1" x="0" linecolour="none" y="0" instancename="" posttext="" usesdiagramlinecolour="1" role="703" fillcolour="none" height="23" usefillcolor="1" pretext="" isinstance="0" xmi.id="-1" text="" font="helvetica,12,-1,5,50,0,0,0,0,0" />
+      <UML:FloatingTextWidget usesdiagramfillcolour="1" width="8" usesdiagramusefillcolour="1" x="1" linecolour="none" y="1" instancename="" posttext="" usesdiagramlinecolour="1" role="701" fillcolour="none" height="23" usefillcolor="1" pretext="" isinstance="0" xmi.id="-1" text="" font="helvetica,12,-1,5,50,0,0,0,0,0" />
+      <UML:FloatingTextWidget usesdiagramfillcolour="1" width="8" usesdiagramusefillcolour="1" x="1" linecolour="none" y="1" instancename="" posttext="" usesdiagramlinecolour="1" role="702" fillcolour="none" height="23" usefillcolor="1" pretext="" isinstance="0" xmi.id="-1" text="" font="helvetica,12,-1,5,50,0,0,0,0,0" />
+      <UML:FloatingTextWidget usesdiagramfillcolour="1" width="18" usesdiagramusefillcolour="1" x="-21" linecolour="none" y="1" instancename="" posttext="" usesdiagramlinecolour="1" role="709" fillcolour="none" height="23" usefillcolor="1" pretext="+" isinstance="0" xmi.id="-1" text="" font="helvetica,12,-1,5,50,0,0,0,0,0" />
+      <UML:FloatingTextWidget usesdiagramfillcolour="1" width="18" usesdiagramusefillcolour="1" x="-21" linecolour="none" y="1" instancename="" posttext="" usesdiagramlinecolour="1" role="710" fillcolour="none" height="23" usefillcolor="1" pretext="+" isinstance="0" xmi.id="-1" text="" font="helvetica,12,-1,5,50,0,0,0,0,0" />
+      <UML:FloatingTextWidget usesdiagramfillcolour="1" width="8" usesdiagramusefillcolour="1" x="26" linecolour="none" y="0" instancename="" posttext="" usesdiagramlinecolour="1" role="711" fillcolour="none" height="23" usefillcolor="1" pretext="" isinstance="0" xmi.id="-1" text="" font="helvetica,12,-1,5,50,0,0,0,0,0" />
+      <UML:FloatingTextWidget usesdiagramfillcolour="1" width="8" usesdiagramusefillcolour="1" x="0" linecolour="none" y="0" instancename="" posttext="" usesdiagramlinecolour="1" role="712" fillcolour="none" height="23" usefillcolor="1" pretext="" isinstance="0" xmi.id="-1" text="" font="helvetica,12,-1,5,50,0,0,0,0,0" />
      </UML:AssocWidget>
-     <UML:AssocWidget totalcounta="2" indexa="1" visibilityB="200" totalcountb="3" indexb="2" widgetbid="524" roleBdoc="" widgetaid="486" roleAdoc="" documentation="" type="500" changeabilityA="900" changeabilityB="900" visibilityA="200" >
-      <UML:FloatingTextWidget usesdiagramfillcolour="1" width="0" usesdiagramusefillcolour="1" x="39" linecolour="none" y="0" operation="" instancename="" posttext="" usesdiagramlinecolour="1" role="703" fillcolour="none" height="0" usefillcolor="1" seqnum="" pretext="" isinstance="0" xmi.id="-1" text="" font="helvetica,12,-1,5,50,0,0,0,0,0" />
-      <UML:FloatingTextWidget usesdiagramfillcolour="1" width="0" usesdiagramusefillcolour="1" x="0" linecolour="none" y="7" operation="" instancename="" posttext="" usesdiagramlinecolour="1" role="711" fillcolour="none" height="0" usefillcolor="1" seqnum="" pretext="" isinstance="0" xmi.id="-1" text="" font="helvetica,12,-1,5,50,0,0,0,0,0" />
-      <UML:FloatingTextWidget usesdiagramfillcolour="1" width="0" usesdiagramusefillcolour="1" x="79" linecolour="none" y="0" operation="" instancename="" posttext="" usesdiagramlinecolour="1" role="712" fillcolour="none" height="0" usefillcolor="1" seqnum="" pretext="" isinstance="0" xmi.id="-1" text="" font="helvetica,12,-1,5,50,0,0,0,0,0" />
+     <UML:AssocWidget totalcounta="2" indexa="1" visibilityB="200" totalcountb="3" indexb="2" widgetbid="524" widgetaid="486" roleBdoc="" roleAdoc="" type="500" changeabilityA="900" changeabilityB="900" visibilityA="200" >
       <linepath>
        <startpoint startx="572" starty="445" />
        <endpoint endx="691" endy="245" />
       </linepath>
+      <UML:FloatingTextWidget usesdiagramfillcolour="1" width="8" usesdiagramusefillcolour="1" x="39" linecolour="none" y="0" instancename="" posttext="" usesdiagramlinecolour="1" role="703" fillcolour="none" height="23" usefillcolor="1" pretext="" isinstance="0" xmi.id="-1" text="" font="helvetica,12,-1,5,50,0,0,0,0,0" />
+      <UML:FloatingTextWidget usesdiagramfillcolour="1" width="8" usesdiagramusefillcolour="1" x="1" linecolour="none" y="1" instancename="" posttext="" usesdiagramlinecolour="1" role="701" fillcolour="none" height="23" usefillcolor="1" pretext="" isinstance="0" xmi.id="-1" text="" font="helvetica,12,-1,5,50,0,0,0,0,0" />
+      <UML:FloatingTextWidget usesdiagramfillcolour="1" width="8" usesdiagramusefillcolour="1" x="1" linecolour="none" y="1" instancename="" posttext="" usesdiagramlinecolour="1" role="702" fillcolour="none" height="23" usefillcolor="1" pretext="" isinstance="0" xmi.id="-1" text="" font="helvetica,12,-1,5,50,0,0,0,0,0" />
+      <UML:FloatingTextWidget usesdiagramfillcolour="1" width="18" usesdiagramusefillcolour="1" x="-21" linecolour="none" y="1" instancename="" posttext="" usesdiagramlinecolour="1" role="709" fillcolour="none" height="23" usefillcolor="1" pretext="+" isinstance="0" xmi.id="-1" text="" font="helvetica,12,-1,5,50,0,0,0,0,0" />
+      <UML:FloatingTextWidget usesdiagramfillcolour="1" width="18" usesdiagramusefillcolour="1" x="-21" linecolour="none" y="1" instancename="" posttext="" usesdiagramlinecolour="1" role="710" fillcolour="none" height="23" usefillcolor="1" pretext="+" isinstance="0" xmi.id="-1" text="" font="helvetica,12,-1,5,50,0,0,0,0,0" />
+      <UML:FloatingTextWidget usesdiagramfillcolour="1" width="8" usesdiagramusefillcolour="1" x="0" linecolour="none" y="7" instancename="" posttext="" usesdiagramlinecolour="1" role="711" fillcolour="none" height="23" usefillcolor="1" pretext="" isinstance="0" xmi.id="-1" text="" font="helvetica,12,-1,5,50,0,0,0,0,0" />
+      <UML:FloatingTextWidget usesdiagramfillcolour="1" width="8" usesdiagramusefillcolour="1" x="79" linecolour="none" y="0" instancename="" posttext="" usesdiagramlinecolour="1" role="712" fillcolour="none" height="23" usefillcolor="1" pretext="" isinstance="0" xmi.id="-1" text="" font="helvetica,12,-1,5,50,0,0,0,0,0" />
      </UML:AssocWidget>
-     <UML:AssocWidget totalcounta="2" indexa="1" visibilityB="200" totalcountb="3" indexb="1" widgetbid="524" roleBdoc="" widgetaid="413" roleAdoc="" documentation="" type="500" changeabilityA="900" changeabilityB="900" visibilityA="200" >
-      <UML:FloatingTextWidget usesdiagramfillcolour="1" width="0" usesdiagramusefillcolour="1" x="20" linecolour="none" y="0" operation="" instancename="" posttext="" usesdiagramlinecolour="1" role="703" fillcolour="none" height="0" usefillcolor="1" seqnum="" pretext="" isinstance="0" xmi.id="-1" text="" font="helvetica,12,-1,5,50,0,0,0,0,0" />
-      <UML:FloatingTextWidget usesdiagramfillcolour="1" width="0" usesdiagramusefillcolour="1" x="0" linecolour="none" y="0" operation="" instancename="" posttext="" usesdiagramlinecolour="1" role="711" fillcolour="none" height="0" usefillcolor="1" seqnum="" pretext="" isinstance="0" xmi.id="-1" text="" font="helvetica,12,-1,5,50,0,0,0,0,0" />
-      <UML:FloatingTextWidget usesdiagramfillcolour="1" width="0" usesdiagramusefillcolour="1" x="40" linecolour="none" y="0" operation="" instancename="" posttext="" usesdiagramlinecolour="1" role="712" fillcolour="none" height="0" usefillcolor="1" seqnum="" pretext="" isinstance="0" xmi.id="-1" text="" font="helvetica,12,-1,5,50,0,0,0,0,0" />
+     <UML:AssocWidget totalcounta="2" indexa="1" visibilityB="200" totalcountb="3" indexb="1" widgetbid="524" widgetaid="413" roleBdoc="" roleAdoc="" type="500" changeabilityA="900" changeabilityB="900" visibilityA="200" >
       <linepath>
        <startpoint startx="462" starty="353" />
        <endpoint endx="553" endy="245" />
       </linepath>
+      <UML:FloatingTextWidget usesdiagramfillcolour="1" width="8" usesdiagramusefillcolour="1" x="55" linecolour="none" y="0" instancename="" posttext="" usesdiagramlinecolour="1" role="703" fillcolour="none" height="23" usefillcolor="1" pretext="" isinstance="0" xmi.id="-1" text="" font="helvetica,12,-1,5,50,0,0,0,0,0" />
+      <UML:FloatingTextWidget usesdiagramfillcolour="1" width="8" usesdiagramusefillcolour="1" x="13" linecolour="none" y="28" instancename="" posttext="" usesdiagramlinecolour="1" role="701" fillcolour="none" height="23" usefillcolor="1" pretext="" isinstance="0" xmi.id="-1" text="" font="helvetica,12,-1,5,50,0,0,0,0,0" />
+      <UML:FloatingTextWidget usesdiagramfillcolour="1" width="8" usesdiagramusefillcolour="1" x="62" linecolour="none" y="-26" instancename="" posttext="" usesdiagramlinecolour="1" role="702" fillcolour="none" height="23" usefillcolor="1" pretext="" isinstance="0" xmi.id="-1" text="" font="helvetica,12,-1,5,50,0,0,0,0,0" />
+      <UML:FloatingTextWidget usesdiagramfillcolour="1" width="18" usesdiagramusefillcolour="1" x="-21" linecolour="none" y="1" instancename="" posttext="" usesdiagramlinecolour="1" role="709" fillcolour="none" height="23" usefillcolor="1" pretext="+" isinstance="0" xmi.id="-1" text="" font="helvetica,12,-1,5,50,0,0,0,0,0" />
+      <UML:FloatingTextWidget usesdiagramfillcolour="1" width="18" usesdiagramusefillcolour="1" x="48" linecolour="none" y="1" instancename="" posttext="" usesdiagramlinecolour="1" role="710" fillcolour="none" height="23" usefillcolor="1" pretext="+" isinstance="0" xmi.id="-1" text="" font="helvetica,12,-1,5,50,0,0,0,0,0" />
+      <UML:FloatingTextWidget usesdiagramfillcolour="1" width="8" usesdiagramusefillcolour="1" x="0" linecolour="none" y="0" instancename="" posttext="" usesdiagramlinecolour="1" role="711" fillcolour="none" height="23" usefillcolor="1" pretext="" isinstance="0" xmi.id="-1" text="" font="helvetica,12,-1,5,50,0,0,0,0,0" />
+      <UML:FloatingTextWidget usesdiagramfillcolour="1" width="8" usesdiagramusefillcolour="1" x="109" linecolour="none" y="0" instancename="" posttext="" usesdiagramlinecolour="1" role="712" fillcolour="none" height="23" usefillcolor="1" pretext="" isinstance="0" xmi.id="-1" text="" font="helvetica,12,-1,5,50,0,0,0,0,0" />
      </UML:AssocWidget>
     </associations>
    </diagram>
@@ -215,7 +235,7 @@ x2c:get" name="hijos" static="0" scope="202" />
        <listitem open="0" type="815" id="520" label="cargar" />
        <listitem open="0" type="815" id="521" label="guardar" />
       </listitem>
-      <listitem open="0" type="813" id="524" label="AI_DBTreeObject" >
+      <listitem open="1" type="813" id="524" label="AI_DBTreeObject" >
        <listitem open="0" type="814" id="525" label="hijos" />
        <listitem open="0" type="815" id="526" label="AI_DBTreeObject" />
        <listitem open="0" type="815" id="529" label="borrar" />
@@ -225,7 +245,7 @@ x2c:get" name="hijos" static="0" scope="202" />
        <listitem open="0" type="815" id="470" label="AI_Error" />
        <listitem open="0" type="815" id="530" label="isError" />
       </listitem>
-      <listitem open="1" type="813" id="486" label="AI_GrupoSecciones" >
+      <listitem open="0" type="813" id="486" label="AI_GrupoSecciones" >
        <listitem open="0" type="814" id="492" label="antiguedad" />
        <listitem open="0" type="814" id="487" label="grupo" />
        <listitem open="0" type="814" id="489" label="grupo_padre" />
@@ -240,7 +260,7 @@ x2c:get" name="hijos" static="0" scope="202" />
        <listitem open="0" type="815" id="512" label="getSeccionesArray" />
        <listitem open="0" type="815" id="497" label="guardar" />
       </listitem>
-      <listitem open="0" type="813" id="413" label="AI_Servicio" >
+      <listitem open="1" type="813" id="413" label="AI_Servicio" >
        <listitem open="0" type="814" id="433" label="descripcion" />
        <listitem open="0" type="814" id="534" label="habilitado" />
        <listitem open="0" type="814" id="430" label="icono" />
@@ -251,9 +271,10 @@ x2c:get" name="hijos" static="0" scope="202" />
        <listitem open="0" type="814" id="428" label="servicio" />
        <listitem open="0" type="814" id="452" label="servicio_padre" />
        <listitem open="0" type="815" id="465" label="AI_Servicio" />
+       <listitem open="0" type="815" id="539" label="cargarHijos" />
        <listitem open="0" type="815" id="458" label="guardar" />
       </listitem>
-      <listitem open="1" type="813" id="416" label="AI_Sistema" >
+      <listitem open="0" type="813" id="416" label="AI_Sistema" >
        <listitem open="0" type="814" id="514" label="descripcion" />
        <listitem open="0" type="814" id="533" label="habilitado" />
        <listitem open="0" type="814" id="438" label="icono" />
@@ -276,9 +297,9 @@ x2c:get" name="hijos" static="0" scope="202" />
     </listitem>
     <listitem open="1" type="802" id="-1" label="Vista de caso de uso" />
     <listitem open="1" type="821" id="-1" label="Component View" />
-    <listitem open="0" type="823" id="-1" label="Diagrams" />
     <listitem open="1" type="827" id="-1" label="Deployment View" />
    </listitem>
   </listview>
+  <codegeneration/>
  </XMI.content>
 </XMI>
index 7877b995d015306bd78d57155664d8e92e427e48..994f8f5bd93913bf7e5b0b01478c626ea56b9479 100644 (file)
@@ -85,7 +85,7 @@ class AI_DBTreeObject extends AI_DBObject {
      * @access public
      */
     function cargarHijos($db, $soloHabilitados = true, $orden = 'nombre') // ~X2C
-     {
+    {
         $id_field = $this->conf['id'];
         $id_padre = $this->conf['padre'];
         $tabla    = $this->conf['base'].'.'.$this->conf['tabla'];
index 1dc3915a9500020b5a22cd9ac67f36accd1217b5..3af3bef6b5bcaff53f0c0f87e9ef853c7eec7981 100644 (file)
@@ -48,6 +48,12 @@ define('AI_ERROR_NO_RESULTADOS', 1);
  */
 define('AI_ERROR_TIENE_HIJOS', 2);
 
+/**
+ * Error que indica que el tipo de orden usado no es válido.
+ * Es un error no esperado.
+ */
+define('AI_ERROR_ORDEN_INVALIDO', 3);
+
 // +X2C Class 469 :AI_Error
 /**
  * @package AI
index 85ac3a2c9449b19545cc45dde0a0437193c01ea0..9fb5e8ce668c2b5756a63c67785b2baf206112f9 100644 (file)
@@ -38,6 +38,18 @@ require_once 'AI/Error.php';
  */
 define('AI_SERVICIO_CONFFILE', dirname(__FILE__).'/Servicio.ini');
 
+/**
+ * Trae los servicios en un orden según la <em>longitud</em> de los hijos.
+ * La <em>longitud<em> de los hijos se calcula prediciendo la cantidad de
+ * renglones que va a ocupar cada hijo y sumándolos para un mismo padre.
+ */
+define('AI_SERVICIO_ORDEN_LONG_HIJOS', 1);
+
+/**
+ * Trae los servicios en un orden según la longitud del nombre.
+ */
+define('AI_SERVICIO_ORDEN_LONG_NOMBRE', 2);
+
 // +X2C Class 413 :AI_Servicio
 /**
  * Servicio.
@@ -158,7 +170,58 @@ class AI_Servicio extends AI_DBTreeObject {
     }
     // -X2C
 
-
+    // +X2C Operation 539
+    /**
+     * Carga hijos de un servicio. Si hubo error devuelve un PEAR_Error, si no hubo error, devuleve un array de objetos (los hijos).
+     *
+     * @param  mixed $db Base de datos o resultado a usar.
+     * @param  bool $soloHabilitados Si es true, sólo trae los servicios habilitados.
+     * @param  mixed $orden Indica el orden en que se deben traer los hijos. Puede ser AI_SERVICIO_ORDEN_CANT_HIJOS, AI_SERVICIO_ORDEN_LONG_NOMBRE o un campo arbitrario.
+     *
+     * @return mixed
+     * @access public
+     */
+    function cargarHijos($db, $soloHabilitados = true, $orden = false) // ~X2C
+    {
+        if (!is_a($db, 'db_result')) {
+            if (is_int($orden)) {
+                $id_field = $this->conf['id'];
+                $id_padre = $this->conf['padre'];
+                $id = intval($this->$id_field);
+                if ($orden === AI_SERVICIO_ORDEN_LONG_HIJOS) {
+                    $query = "
+                        SELECT A.*, SUM(CEIL(LENGTH(B.nombre) / 22)) as RENGLONES
+                        FROM {$this->conf['base']}.{$this->conf['tabla']} AS A,
+                             {$this->conf['base']}.{$this->conf['tabla']} AS B
+                        WHERE A.$id_field = B.$id_padre
+                            AND A.$id_padre = $id";
+                    if ($soloHabilitados) {
+                        $query .= " AND A.{$this->conf['habilitado']} = 1";
+                    }
+                    $query .= " GROUP BY A.$id_field ORDER BY RENGLONES DESC";
+                } elseif ($orden === AI_SERVICIO_ORDEN_LONG_NOMBRE) {
+                    $query = "
+                        SELECT *
+                        FROM {$this->conf['base']}.{$this->conf['tabla']}
+                        WHERE $id_padre = $id";
+                    if ($soloHabilitados) {
+                        $query .= ' AND ' . $this->conf['habilitado'] . ' = 1';
+                    }
+                    $query .= ' ORDER BY LENGTH(nombre)';
+                } else {
+                    return new AI_Error(AI_ERROR_ORDEN_INVALIDO,
+                        "Tipo de órden incorrecto [orden=$orden]");
+                }
+                $result = $db->query($query);
+                if (DB::isError($result)) {
+                    return $result;
+                }
+                return parent::cargarHijos($result, $soloHabilitados, $orden);
+            }
+        }
+        return parent::cargarHijos($db, $soloHabilitados, $orden);
+    }
+    // -X2C
 
 } // -X2C Class :AI_Servicio