<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN">
<HTML><HEAD><TITLE>Studio: reset to defaults?</TITLE>
<META http-equiv=Content-Type content="text/html; charset=us-ascii">
<META content="MSHTML 6.00.2900.2802" name=GENERATOR></HEAD>
<BODY>
<DIV dir=ltr align=left><SPAN class=540182515-04042006><FONT face=Arial
color=#0000ff size=2>Hi Andy,</FONT></SPAN></DIV>
<DIV dir=ltr align=left><SPAN class=540182515-04042006><FONT face=Arial
color=#0000ff size=2></FONT></SPAN> </DIV>
<DIV dir=ltr align=left><SPAN class=540182515-04042006><FONT face=Arial
color=#0000ff size=2>During development we had thought about the following:
When changing the feature class for the layer, first scan the
LayerDefinition and find all properties used in expressions. Then check that
these properties match properties in the new feature class. If they do
match, then we consider them to be compatible and then allow the layer author to
continue. Then to go a bit further, when changing feature sources, we
would try to find a compatible feature class in that new feature source to
use. Doing this, was just a matter of time
really.</FONT></SPAN></DIV>
<DIV dir=ltr align=left><SPAN class=540182515-04042006><FONT face=Arial
color=#0000ff size=2></FONT></SPAN> </DIV>
<DIV dir=ltr align=left><SPAN class=540182515-04042006><FONT face=Arial
color=#0000ff size=2>And of course, there is also the approach of having a "I
know what I'm doing, leave things as is" button on the "Incompatible data
sources" dialog. However, this requires thorough testing to make
sure that anything that gets through does not cause subsequent failures in
Studio. Again, just a matter of time.</FONT></SPAN></DIV>
<DIV dir=ltr align=left><SPAN class=540182515-04042006><FONT face=Arial
color=#0000ff size=2></FONT></SPAN> </DIV>
<DIV dir=ltr align=left><SPAN class=540182515-04042006></SPAN><SPAN
class=540182515-04042006></SPAN><SPAN class=540182515-04042006><FONT face=Arial
color=#0000ff size=2></FONT></SPAN> </DIV>
<DIV dir=ltr align=left><SPAN class=540182515-04042006><FONT face=Arial
color=#0000ff size=2>Editing the layer definition externally from Studio is
possible and here is one recipe for it.</FONT></SPAN></DIV>
<DIV dir=ltr align=left><SPAN class=540182515-04042006><FONT face=Arial
color=#0000ff size=2></FONT></SPAN> </DIV>
<DIV dir=ltr align=left><SPAN class=540182515-04042006><FONT face=Arial
color=#0000ff size=2>In Studio</FONT></SPAN></DIV>
<DIV dir=ltr align=left><SPAN class=540182515-04042006></SPAN><SPAN
class=540182515-04042006><FONT face=Arial color=#0000ff size=2>1) Make a
copy of the layer definition</FONT></SPAN></DIV>
<DIV dir=ltr align=left><SPAN class=540182515-04042006><FONT face=Arial
color=#0000ff size=2>2) Open the layer definition and do a File > Save As
XML...</FONT></SPAN></DIV>
<DIV dir=ltr align=left><SPAN class=540182515-04042006><FONT face=Arial
color=#0000ff size=2>3) Close the layer definition editor.</FONT></SPAN></DIV>
<DIV dir=ltr align=left><SPAN class=540182515-04042006><FONT face=Arial
color=#0000ff size=2></FONT></SPAN> </DIV>
<DIV dir=ltr align=left><SPAN class=540182515-04042006><FONT face=Arial
color=#0000ff size=2>In your favorite XML editor</FONT></SPAN></DIV>
<DIV dir=ltr align=left><SPAN class=540182515-04042006><FONT face=Arial
color=#0000ff size=2>4) Open the saved file</FONT></SPAN></DIV>
<DIV dir=ltr align=left><SPAN class=540182515-04042006><FONT face=Arial
color=#0000ff size=2>5) In the XML, find the FeatureSource used by the layer. It
will be enclosed in ResourceId tags. Change the resource to point to
the correct feature source.</FONT></SPAN></DIV>
<DIV dir=ltr align=left><SPAN class=540182515-04042006><FONT face=Arial
color=#0000ff size=2>6) Save the file.</FONT></SPAN></DIV>
<DIV dir=ltr align=left><SPAN class=540182515-04042006><FONT face=Arial
color=#0000ff size=2></FONT></SPAN> </DIV>
<DIV dir=ltr align=left><SPAN class=540182515-04042006><FONT face=Arial
color=#0000ff size=2>Using Internet Explorer</FONT></SPAN></DIV>
<DIV dir=ltr align=left><SPAN class=540182515-04042006><FONT face=Arial
color=#0000ff size=2>7) Open the server web pages: <A
href="http://servername/mapguide/mapagent/index.html">http://servername/mapguide/mapagent/index.html</A></FONT></SPAN></DIV>
<DIV dir=ltr align=left><SPAN class=540182515-04042006><FONT face=Arial
color=#0000ff size=2>8) Click on the SetResource link in the bottom left
pane.</FONT></SPAN></DIV>
<DIV dir=ltr align=left><SPAN class=540182515-04042006><FONT face=Arial
color=#0000ff size=2>9) In the Resource ID field, type the name of the layer
definition. This will have the form
Library://path/layer.LayerDefinition.</FONT></SPAN></DIV>
<DIV dir=ltr align=left><SPAN class=540182515-04042006></SPAN><SPAN
class=540182515-04042006><FONT face=Arial color=#0000ff size=2>10) In the
Content field, click the Browse button and find the XML file that you edited in
step 5.</FONT></SPAN></DIV>
<DIV dir=ltr align=left><SPAN class=540182515-04042006><FONT face=Arial
color=#0000ff size=2>11) Leave the Header blank. </FONT></SPAN></DIV>
<DIV dir=ltr align=left><SPAN class=540182515-04042006><FONT face=Arial
color=#0000ff size=2>12) Press Submit.</FONT></SPAN></DIV>
<DIV dir=ltr align=left><SPAN class=540182515-04042006><FONT face=Arial
color=#0000ff size=2></FONT></SPAN> </DIV>
<DIV dir=ltr align=left><SPAN class=540182515-04042006><FONT face=Arial
color=#0000ff size=2>You should now be able to open and edit the changed layer
definition in Studio.</FONT></SPAN></DIV>
<DIV dir=ltr align=left><SPAN class=540182515-04042006><FONT face=Arial
color=#0000ff size=2></FONT></SPAN><SPAN class=540182515-04042006><FONT
face=Arial color=#0000ff size=2></FONT></SPAN><SPAN
class=540182515-04042006><FONT face=Arial color=#0000ff
size=2></FONT></SPAN> </DIV>
<DIV dir=ltr align=left><SPAN class=540182515-04042006><FONT face=Arial
color=#0000ff size=2>Cheers</FONT></SPAN></DIV>
<DIV dir=ltr align=left><SPAN class=540182515-04042006><FONT face=Arial
color=#0000ff size=2>Tom</FONT></SPAN></DIV>
<DIV dir=ltr align=left><SPAN class=540182515-04042006></SPAN><SPAN
class=540182515-04042006><FONT face=Arial color=#0000ff
size=2></FONT></SPAN> </DIV><BR>
<DIV class=OutlookMessageHeader lang=en-us dir=ltr align=left>
<HR tabIndex=-1>
<FONT face=Tahoma size=2><B>From:</B> Andy Morsell
[mailto:amorsell@spatialgis.com] <BR><B>Sent:</B> Friday, March 31, 2006 5:41
PM<BR><B>To:</B> users@mapguide.osgeo.org<BR><B>Subject:</B> [mapguide-users]
Studio: reset to defaults?<BR></FONT><BR></DIV>
<DIV></DIV><!-- Converted from text/rtf format -->
<P><FONT face=Arial size=2>This is a Studio issue, not a MGOS issue. I am
authoring several different road layers from Shape files (converted to SDF
during load). These are all standardized in terms of the defined feature
types (major, minor, local roads, etc). I have defined a layer based on
one that has multiple scale ranges, each with the thematic definition. I
then copy this layer definition to another location to use as a template for a
different data source. This seems to work OK (despite several .NET and JIT
warnings) for the most part. </FONT></P>
<P><FONT face=Arial size=2>However, it appears that if the feature source being
chosen has any difference in field definitions from the feature source that the
layer was originally created from, then Studio pops up a dialog that says:
"Reset to defaults? - You're about to change to an incompatible data
resource. Proceed and reset the layer to defaults?". If I say OK,
all of the styles already in place are reset to scratch. I don't
understand why it would do this since the field that is being themed is the same
name and type in both feature sources.</FONT></P>
<P><FONT face=Arial size=2>I don't see any way around this. I don't
believe the layer definition can be edited externally from Studio, or can
it? Can this behavior be changed in a future release of Studio so that we
can have more control over style "templates"?</FONT></P>
<P><FONT face=Arial size=2>Thanks.</FONT> </P>
<P><FONT face=Tahoma size=1>Andy Morsell, P.E.</FONT> <BR><FONT face=Tahoma
size=1>Spatial Integrators, Inc.</FONT> <BR><A
href="http://www.SpatialGIS.com"><U><FONT face=Tahoma color=#0000ff
size=1>http://www.SpatialGIS.com</FONT></U></A> </P></BODY></HTML>