[fusion-commits] r1840 - in trunk/widgets/Theme: . classes templates
svn_fusion at osgeo.org
svn_fusion at osgeo.org
Wed Apr 29 14:05:43 EDT 2009
Author: pagameba
Date: 2009-04-29 14:05:43 -0400 (Wed, 29 Apr 2009)
New Revision: 1840
Added:
trunk/widgets/Theme/templates/arearuletemplate-1.0.0.xml
trunk/widgets/Theme/templates/arearuletemplate-1.1.0.xml
trunk/widgets/Theme/templates/arearuletemplate-1.2.0.xml
trunk/widgets/Theme/templates/arearuletemplate-1.3.0.xml
Removed:
trunk/widgets/Theme/templates/arearuletemplate.xml
Modified:
trunk/widgets/Theme/classes/layerinfo.php
trunk/widgets/Theme/classes/property.php
trunk/widgets/Theme/classes/theme.php
trunk/widgets/Theme/themecontroller.php
trunk/widgets/Theme/thememain.php
Log:
Re #250, add version-specfic templates for theming as the schema has changed for AreaRule in some versions of the layer schema. Also clean up some of the PHP so it doesn't output blank text.
Modified: trunk/widgets/Theme/classes/layerinfo.php
===================================================================
--- trunk/widgets/Theme/classes/layerinfo.php 2009-04-29 15:58:44 UTC (rev 1839)
+++ trunk/widgets/Theme/classes/layerinfo.php 2009-04-29 18:05:43 UTC (rev 1840)
@@ -1,36 +1,33 @@
-<?php
-
-//
-// Copyright (C) 2004-2006 Autodesk, Inc.
-//
-// This library is free software; you can redistribute it and/or
-// modify it under the terms of version 2.1 of the GNU Lesser
-// General Public License as published by the Free Software Foundation.
-//
-// This library 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
-// Lesser General Public License for more details.
-//
-// You should have received a copy of the GNU Lesser General Public
-// License along with this library; if not, write to the Free Software
-// Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
-//
-
-?>
-
-<?php
-
-class LayerInfo
-{
- public $properties = null;
- public $scaleRanges = null;
-
- function __construct($properties, $scaleRanges)
- {
- $this->properties = $properties;
- $this->scaleRanges = $scaleRanges;
- }
-}
-
+<?php
+
+//
+// Copyright (C) 2004-2006 Autodesk, Inc.
+//
+// This library is free software; you can redistribute it and/or
+// modify it under the terms of version 2.1 of the GNU Lesser
+// General Public License as published by the Free Software Foundation.
+//
+// This library 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
+// Lesser General Public License for more details.
+//
+// You should have received a copy of the GNU Lesser General Public
+// License along with this library; if not, write to the Free Software
+// Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
+//
+
+
+class LayerInfo
+{
+ public $properties = null;
+ public $scaleRanges = null;
+
+ function __construct($properties, $scaleRanges)
+ {
+ $this->properties = $properties;
+ $this->scaleRanges = $scaleRanges;
+ }
+}
+
?>
\ No newline at end of file
Modified: trunk/widgets/Theme/classes/property.php
===================================================================
--- trunk/widgets/Theme/classes/property.php 2009-04-29 15:58:44 UTC (rev 1839)
+++ trunk/widgets/Theme/classes/property.php 2009-04-29 18:05:43 UTC (rev 1840)
@@ -1,38 +1,34 @@
-<?php
-
-//
-// Copyright (C) 2004-2006 Autodesk, Inc.
-//
-// This library is free software; you can redistribute it and/or
-// modify it under the terms of version 2.1 of the GNU Lesser
-// General Public License as published by the Free Software Foundation.
-//
-// This library 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
-// Lesser General Public License for more details.
-//
-// You should have received a copy of the GNU Lesser General Public
-// License along with this library; if not, write to the Free Software
-// Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
-//
-
-?>
-
-<?php
-
-class Property
-{
- public $name = '';
- public $dataType = 0;
- public $distroTypes = null;
-
- function __construct($name, $dataType, $distroTypes)
- {
- $this->name = $name;
- $this->dataType = $dataType;
- $this->distroTypes = $distroTypes;
- }
-}
-
+<?php
+
+//
+// Copyright (C) 2004-2006 Autodesk, Inc.
+//
+// This library is free software; you can redistribute it and/or
+// modify it under the terms of version 2.1 of the GNU Lesser
+// General Public License as published by the Free Software Foundation.
+//
+// This library 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
+// Lesser General Public License for more details.
+//
+// You should have received a copy of the GNU Lesser General Public
+// License along with this library; if not, write to the Free Software
+// Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
+//
+
+class Property
+{
+ public $name = '';
+ public $dataType = 0;
+ public $distroTypes = null;
+
+ function __construct($name, $dataType, $distroTypes)
+ {
+ $this->name = $name;
+ $this->dataType = $dataType;
+ $this->distroTypes = $distroTypes;
+ }
+}
+
?>
\ No newline at end of file
Modified: trunk/widgets/Theme/classes/theme.php
===================================================================
--- trunk/widgets/Theme/classes/theme.php 2009-04-29 15:58:44 UTC (rev 1839)
+++ trunk/widgets/Theme/classes/theme.php 2009-04-29 18:05:43 UTC (rev 1840)
@@ -16,11 +16,6 @@
// License along with this library; if not, write to the Free Software
// Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
//
-
-?>
-
-<?php
-
require_once('layerinfo.php');
require_once('property.php');
// require_once('../Common/constants.php');
@@ -87,6 +82,7 @@
$map = new MgMap();
$map->Open($resourceService, $this->args['MAPNAME']);
$layer = $map->GetLayers()->GetItem($this->args['LAYERNAME']);
+
// First get a list of all of the Feature Class properties that can be used for theming.
@@ -229,6 +225,8 @@
// Load the Layer Definition and Navigate to the specified <VectorScaleRange>
$doc = DOMDocument::loadXML($byteReader->ToString());
+ $version = $doc->documentElement->getAttribute('version');
+ $template = 'templates/arearuletemplate-'.$version.'.xml';
$nodeList = $doc->getElementsByTagName('VectorScaleRange');
$vectorScaleRangecElement = $nodeList->item($this->args['SCALERANGEINDEX']);
@@ -246,7 +244,7 @@
// Now create the new <AreaRule> elements.
- $areaRuleTemplate = file_get_contents("templates/arearuletemplate.xml");
+ $areaRuleTemplate = file_get_contents($template);
$aggregateOptions = new MgFeatureAggregateOptions();
$portion = 0.0;
Copied: trunk/widgets/Theme/templates/arearuletemplate-1.0.0.xml (from rev 1836, trunk/widgets/Theme/templates/arearuletemplate.xml)
===================================================================
--- trunk/widgets/Theme/templates/arearuletemplate-1.0.0.xml (rev 0)
+++ trunk/widgets/Theme/templates/arearuletemplate-1.0.0.xml 2009-04-29 18:05:43 UTC (rev 1840)
@@ -0,0 +1,17 @@
+<AreaRule>
+ <LegendLabel>%s</LegendLabel>
+ <Filter>%s</Filter>
+ <AreaSymbolization2D>
+ <Fill>
+ <FillPattern>Solid</FillPattern>
+ <ForegroundColor>%s</ForegroundColor>
+ <BackgroundColor>FF000000</BackgroundColor>
+ </Fill>
+ <Stroke>
+ <LineStyle>Solid</LineStyle>
+ <Thickness>0</Thickness>
+ <Color>%s</Color>
+ <Unit>Inches</Unit>
+ </Stroke>
+ </AreaSymbolization2D>
+</AreaRule>
\ No newline at end of file
Added: trunk/widgets/Theme/templates/arearuletemplate-1.1.0.xml
===================================================================
--- trunk/widgets/Theme/templates/arearuletemplate-1.1.0.xml (rev 0)
+++ trunk/widgets/Theme/templates/arearuletemplate-1.1.0.xml 2009-04-29 18:05:43 UTC (rev 1840)
@@ -0,0 +1,18 @@
+<AreaRule>
+ <LegendLabel>%s</LegendLabel>
+ <Filter>%s</Filter>
+ <AreaSymbolization2D>
+ <Fill>
+ <FillPattern>Solid</FillPattern>
+ <ForegroundColor>%s</ForegroundColor>
+ <BackgroundColor>FF000000</BackgroundColor>
+ </Fill>
+ <Stroke>
+ <LineStyle>Solid</LineStyle>
+ <Thickness>0</Thickness>
+ <Color>%s</Color>
+ <Unit>Inches</Unit>
+ <SizeContext>DeviceUnits</SizeContext>
+ </Stroke>
+ </AreaSymbolization2D>
+</AreaRule>
\ No newline at end of file
Property changes on: trunk/widgets/Theme/templates/arearuletemplate-1.1.0.xml
___________________________________________________________________
Name: svn:executable
+ *
Added: trunk/widgets/Theme/templates/arearuletemplate-1.2.0.xml
===================================================================
--- trunk/widgets/Theme/templates/arearuletemplate-1.2.0.xml (rev 0)
+++ trunk/widgets/Theme/templates/arearuletemplate-1.2.0.xml 2009-04-29 18:05:43 UTC (rev 1840)
@@ -0,0 +1,18 @@
+<AreaRule>
+ <LegendLabel>%s</LegendLabel>
+ <Filter>%s</Filter>
+ <AreaSymbolization2D>
+ <Fill>
+ <FillPattern>Solid</FillPattern>
+ <ForegroundColor>%s</ForegroundColor>
+ <BackgroundColor>FF000000</BackgroundColor>
+ </Fill>
+ <Stroke>
+ <LineStyle>Solid</LineStyle>
+ <Thickness>0</Thickness>
+ <Color>%s</Color>
+ <Unit>Inches</Unit>
+ <SizeContext>DeviceUnits</SizeContext>
+ </Stroke>
+ </AreaSymbolization2D>
+</AreaRule>
\ No newline at end of file
Property changes on: trunk/widgets/Theme/templates/arearuletemplate-1.2.0.xml
___________________________________________________________________
Name: svn:executable
+ *
Added: trunk/widgets/Theme/templates/arearuletemplate-1.3.0.xml
===================================================================
--- trunk/widgets/Theme/templates/arearuletemplate-1.3.0.xml (rev 0)
+++ trunk/widgets/Theme/templates/arearuletemplate-1.3.0.xml 2009-04-29 18:05:43 UTC (rev 1840)
@@ -0,0 +1,18 @@
+<AreaRule>
+ <LegendLabel>%s</LegendLabel>
+ <Filter>%s</Filter>
+ <AreaSymbolization2D>
+ <Fill>
+ <FillPattern>Solid</FillPattern>
+ <ForegroundColor>%s</ForegroundColor>
+ <BackgroundColor>FF000000</BackgroundColor>
+ </Fill>
+ <Stroke>
+ <LineStyle>Solid</LineStyle>
+ <Thickness>0</Thickness>
+ <Color>%s</Color>
+ <Unit>Inches</Unit>
+ <SizeContext>DeviceUnits</SizeContext>
+ </Stroke>
+ </AreaSymbolization2D>
+</AreaRule>
\ No newline at end of file
Property changes on: trunk/widgets/Theme/templates/arearuletemplate-1.3.0.xml
___________________________________________________________________
Name: svn:executable
+ *
Deleted: trunk/widgets/Theme/templates/arearuletemplate.xml
===================================================================
--- trunk/widgets/Theme/templates/arearuletemplate.xml 2009-04-29 15:58:44 UTC (rev 1839)
+++ trunk/widgets/Theme/templates/arearuletemplate.xml 2009-04-29 18:05:43 UTC (rev 1840)
@@ -1,18 +0,0 @@
-<AreaRule>
- <LegendLabel>%s</LegendLabel>
- <Filter>%s</Filter>
- <AreaSymbolization2D>
- <Fill>
- <FillPattern>Solid</FillPattern>
- <ForegroundColor>%s</ForegroundColor>
- <BackgroundColor>FF000000</BackgroundColor>
- </Fill>
- <Stroke>
- <LineStyle>Solid</LineStyle>
- <Thickness>0</Thickness>
- <Color>%s</Color>
- <Unit>Inches</Unit>
- <SizeContext>DeviceUnits</SizeContext>
- </Stroke>
- </AreaSymbolization2D>
-</AreaRule>
\ No newline at end of file
Modified: trunk/widgets/Theme/themecontroller.php
===================================================================
--- trunk/widgets/Theme/themecontroller.php 2009-04-29 15:58:44 UTC (rev 1839)
+++ trunk/widgets/Theme/themecontroller.php 2009-04-29 18:05:43 UTC (rev 1840)
@@ -16,10 +16,6 @@
// License along with this library; if not, write to the Free Software
// Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
//
-
-?>
-
-<?php
$fusionMGpath = '../../layers/MapGuide/php/';
require_once $fusionMGpath . 'Common.php';
require_once $fusionMGpath . 'Utilities.php';
@@ -74,4 +70,4 @@
<tr><td class="Title">Error<hr></td></tr>
<tr><td><?= $errorMsg ?></td></tr>
<tr><td><?= $errorDetail ?></td></tr>
-</table>
+</table>
\ No newline at end of file
Modified: trunk/widgets/Theme/thememain.php
===================================================================
--- trunk/widgets/Theme/thememain.php 2009-04-29 15:58:44 UTC (rev 1839)
+++ trunk/widgets/Theme/thememain.php 2009-04-29 18:05:43 UTC (rev 1840)
@@ -16,10 +16,6 @@
// License along with this library; if not, write to the Free Software
// Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
//
-
-?>
-
-<?php
$fusionMGpath = '../../layers/MapGuide/php/';
require_once $fusionMGpath . 'Common.php';
require_once $fusionMGpath . 'Utilities.php';
@@ -459,4 +455,4 @@
</body>
-</html>
+</html>
\ No newline at end of file
More information about the fusion-commits
mailing list