[mapguide][MG224][Modified] Support additional expression functions for hyperlinks

Walt Welton-Lair walt.welton-lair at autodesk.com
Mon Apr 17 19:29:45 EDT 2006


You can view the artifact detail at the following URL:

    https://mapguide.osgeo.org/servlets/Scarab/id/MG224

Type:
Enhancement

Artifact ID:
MG224 (Support additional expression functions for hyperlinks)

Modified by:
Walt Welton-Lair
waltweltonlair (walt.welton-lair at autodesk.com)

The following modifications were made to this artifact:
---------------------------------------------------------------------

-- Developer Notes set to new value:
Old value:
RS_FilterExecutor has been updated to support the five named functions.  The bulk of the work, however, is supplying the values returned by these functions.

The Renderer abstract class now has accessors for the map/layer/feature class info, and all derived classes implement these.  The map info is set/cleared in StartMap/EndMap, while the layer/feature info is set/cleared in StartLayer/EndLayer.

The RS_MapUIInfo object (which stores the map info) was updated to store the session string.  A side affect of this is that we can remove the session string member variable from the EMapRenderer class.

The final piece is the DefaultStylizer class.  It already had a reference to a Renderer class, and it's the one which creates the RS_FilterExecutor.  It now uses the new Renderer accessors to get the map/layer/feature info and sets this information on the RS_FilterExecutor.

While at it I also removed the legacy QueryRenderer class (an internal class).

New value:
RS_FilterExecutor has been updated to support the six named functions.  The bulk of the work, however, is supplying the values returned by these functions.

The Renderer abstract class now has accessors for the map/layer/feature class info, and all derived classes implement these.  The map info is set/cleared in StartMap/EndMap, while the layer/feature info is set/cleared in StartLayer/EndLayer.

The RS_MapUIInfo object (which stores the map info) was updated to store the session string.  A side affect of this is that we can remove the session string member variable from the EMapRenderer class.

The final piece is the DefaultStylizer class.  It already had a reference to a Renderer class, and it's the one which creates the RS_FilterExecutor.  It now uses the new Renderer accessors to get the map/layer/feature info and sets this information on the RS_FilterExecutor.

While at it I also removed the legacy QueryRenderer class (an internal class).

-- Description set to new value:
Old value:
In order for hyperlinks to truly be useful, we need a way to tie the hyperlink to an actual feature.  That requires there be a way to include the feature ID, feature class, and layer ID with a feature's hyperlink.

A user could manually enter this information in the layer's tooltip string.  For example, if the name of the feature key property is KEY, the feature class name is "MyClass" and the layer name is "MyLayer", then they could enter a hyperlink expression like:

Concat(Concat('Hyperlink.php?FeatureID=', KEY), '&FeatureClass=MyClass&LayerID=MyLayer')

Every generated link will therefore have the required identifying information.  It's a bit tedious but it could work, unless you have multiple feature classes in the same layer, or you change the layer name.

An easier solution would be to define some additional functions:

MAPNAME
SESSION
LAYERID
FEATURECLASS
FEATUREID

that can be used in the hyperlink expression.

Now the hyperlink could be something like the following:

concat(concat(concat(concat(concat('Hyperlink.php?FeatureID=', FEATUREID()), '&FeatureClass='), FEATURECLASS()), 'LayerID='), LAYERID())

When generating the hyperlinks the server would automatically fill in the feature ID, feature class, and layer ID for each feature.  All-in-all this is much easier for the end-user.

No client-side code needs to be modified to support this.

New value:
In order for hyperlinks to truly be useful, we need a way to tie the hyperlink to an actual feature.  That requires there be a way to include the feature ID, feature class, and layer ID with a feature's hyperlink.

A user could manually enter this information in the layer's tooltip string.  For example, if the name of the feature key property is KEY, the feature class name is "MyClass" and the layer name is "MyLayer", then they could enter a hyperlink expression like:

Concat(Concat('Hyperlink.php?FeatureID=', KEY), '&FeatureClass=MyClass&LayerID=MyLayer')

Every generated link will therefore have the required identifying information.  It's a bit tedious but it could work, unless you have multiple feature classes in the same layer, or you change the layer name.

An easier solution would be to define some additional functions:

MAPNAME()
SESSION()
LAYERID()
FEATURECLASS()
FEATUREID()

that can be used in the hyperlink expression.

Now the hyperlink could be something like the following:

concat(concat(
  concat('Hyperlink.php?FeatureID=', FEATUREID()),
  concat('&FeatureClass=', FEATURECLASS())),
  concat('&LayerID=', LAYERID()))

When generating the hyperlinks the server would automatically fill in the feature ID, feature class, and layer ID for each feature.  All-in-all this is much easier for the end-user.

No client-side code needs to be modified to support this.

NOTE: One thing users need to be careful about when creating hyperlink expressions that have request parameters is to ensure that all parameters are properly URL encoded.  The five new functions above have the potential to return strings which require URL encoding.  For example, FEATUREID() may evaluate to 'fyAAAA==' for a given feature, which is not a valid URL parameter value.  This is why the ECO also includes the URLENCODE() function.  It takes a single string argument as input and URL encodes that string.

So the example above needs to actually be fixed.  It should be changed to:

concat(concat(
  concat('Hyperlink.php?FeatureID=', URLENCODE(FEATUREID())),
  concat('&FeatureClass=', URLENCODE(FEATURECLASS()))),
  concat('&LayerID=', URLENCODE(LAYERID())))




---------------------------------------------------------------------
This message was automatically generated by Project Tracker.








More information about the Mapguide_issues mailing list