<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
<html>
<head>
  <meta content="text/html;charset=ISO-8859-1" http-equiv="Content-Type">
</head>
<body bgcolor="#ffffff" text="#000000">
You are using the wrong toString().&nbsp; Use the UpperCase ToString()&nbsp; not
the toString()<br>
<br>
-scott<br>
<br>
<br>
Chris Gountanis wrote:
<blockquote cite="mid000f01c71ef4$b92a0220$17d167d1@domain.local"
 type="cite">
  <title></title>
  <meta http-equiv="Content-Type" content="text/html; ">
  <meta content="MSHTML 6.00.5730.11" name="GENERATOR">
  <div dir="ltr" align="left"><font face="Arial"><span
 class="663572220-13122006">When I do:</span></font></div>
  <div dir="ltr" align="left"><font face="Arial"><span
 class="663572220-13122006"></span></font>&nbsp;</div>
  <div dir="ltr" align="left"><font face="Arial"><span
 class="663572220-13122006">MgByteReader byteReader =
resourceService.EnumerateResources(resId,-1,MgResourceType.MapDefinition);<br>
String xml = byteReader.ToString();</span></font></div>
  <div dir="ltr" align="left"><font face="Arial"><span
 class="663572220-13122006"></span></font>&nbsp;</div>
  <div dir="ltr" align="left"><font face="Arial"><span
 class="663572220-13122006"></span></font>&nbsp;</div>
  <div dir="ltr" align="left"><font><span class="663572220-13122006"><font
 face="Arial">All I get in the string is a value of
"org.osgeo.mapguide.MgByteReader@b0fa61". Any ideas on why?</font></span></font></div>
  <div>&nbsp;</div>
  <font face="Arial">--<br>
Chris</font><br>
  <div>&nbsp;</div>
  <br>
  <div class="OutlookMessageHeader" dir="ltr" align="left" lang="en-us">
  <hr tabindex="-1"><font face="Tahoma" size="2"><b>From:</b> Dave
Wilson [<a class="moz-txt-link-freetext" href="mailto:dave.wilson@autodesk.com">mailto:dave.wilson@autodesk.com</a>] <br>
  <b>Sent:</b> Tuesday, December 12, 2006 5:21 PM<br>
  <b>To:</b> <a class="moz-txt-link-abbreviated" href="mailto:users@mapguide.osgeo.org">users@mapguide.osgeo.org</a><br>
  <b>Subject:</b> RE: [mapguide-users] Finding list of Mapdefinitions<br>
  </font><br>
  </div>
  <div dir="ltr" align="left"><span class="510531823-12122006"><font
 color="#0000ff" face="Arial" size="2">Thanks Scott. Beat me to it.</font></span></div>
  <div dir="ltr" align="left"><span class="510531823-12122006"></span>&nbsp;</div>
  <div dir="ltr" align="left"><span class="510531823-12122006"><font
 color="#0000ff" face="Arial" size="2">With the DOM parser you can
search on the &lt;ResourceId&gt; tag and parse the name of the map,
here's an example value:</font></span></div>
  <div dir="ltr" align="left"><span class="510531823-12122006"></span>&nbsp;</div>
  <div dir="ltr" align="left"><span class="510531823-12122006"><font
 color="#0000ff" face="Arial" size="2">&lt;ResourceId&gt;Library://QE_Data/Maps/SDF2.0_Dublin_CA83IIIF.MapDefinition&lt;/ResourceId&gt;</font></span></div>
  <div dir="ltr" align="left"><span class="510531823-12122006"></span>&nbsp;</div>
  <div dir="ltr" align="left"><span class="510531823-12122006"><font
 color="#0000ff" face="Arial" size="2">By the way it's Library://</font></span></div>
  <div dir="ltr" align="left"><span class="510531823-12122006"></span>&nbsp;</div>
  <div dir="ltr" align="left"><span class="510531823-12122006"><font
 color="#0000ff" face="Arial" size="2">// and not \\&nbsp;just in case you
missed that too.</font></span></div>
  <div dir="ltr" align="left"><span class="510531823-12122006"></span>&nbsp;</div>
  <div dir="ltr" align="left"><span class="510531823-12122006"><font
 color="#0000ff" face="Arial" size="2">Dave</font></span></div>
  <br>
  <div class="OutlookMessageHeader" dir="ltr" align="left" lang="en-us">
  <hr tabindex="-1"><font face="Tahoma" size="2"><b>From:</b> Scott
Reisdorf [<a class="moz-txt-link-freetext" href="mailto:reisdorf1@llnl.gov">mailto:reisdorf1@llnl.gov</a>] <br>
  <b>Sent:</b> Tuesday, December 12, 2006 4:18 PM<br>
  <b>To:</b> <a class="moz-txt-link-abbreviated" href="mailto:users@mapguide.osgeo.org">users@mapguide.osgeo.org</a><br>
  <b>Subject:</b> Re: [mapguide-users] Finding list of Mapdefinitions<br>
  </font><br>
  </div>
In Java you can do something like this, creating a
ByteArrayOutputStream and then displaying that stream back as a String.<br>
  <br>
  <br>
&nbsp;ByteArrayOutputStream bos = new ByteArrayOutputStream();&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; <br>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; byte[] byteBuffer = new byte[1024];<br>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; int numBytes = byteReader.Read(byteBuffer, 1024);<br>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; while(numBytes &gt; 0)<br>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; {<br>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; bos.write(byteBuffer, 0, numBytes);<br>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; numBytes = byteReader.Read(byteBuffer, 1024);<br>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; }<br>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; System.out.println(bos.toByteArray());<br>
  <br>
  <br>
or you can get straight XML back from the MgByteReader, and then parse
that:<br>
  <br>
&nbsp; MgByteReader byteReader =
resourceService.EnumerateResources(resId,-1,MgResourceType.MapDefinition);<br>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; String xml = byteReader.ToString();<br>
&nbsp;&nbsp; //&nbsp; ...parse the xml via the DOM<br>
  <br>
hope this helps<br>
-scott<br>
  <br>
Scott Hameister wrote:
  <blockquote cite="mid00c101c71e41$e7968f60$18d167d1@domain.local"
 type="cite">
    <meta content="Microsoft Word 11 (filtered medium)" name="Generator">
<!--[if !mso]>
  <STYLE>v\:* {
        BEHAVIOR: url(#default#VML)
}
o\:* {
        BEHAVIOR: url(#default#VML)
}
w\:* {
        BEHAVIOR: url(#default#VML)
}
.shape {
        BEHAVIOR: url(#default#VML)
}
</STYLE>
<![endif]--><O:SMARTTAGTYPE
 namespaceuri="urn:schemas-microsoft-com:office:smarttags"
 name="PersonName"><!--[if !mso]>
  <STYLE>st1\:* {
        BEHAVIOR: url(#default#ieooui)
}
</STYLE>
<![endif]-->
    <style>@font-face {
        font-family: Tahoma;
}
@page Section1 {size: 8.5in 11.0in; margin: 1.0in 1.25in 1.0in 1.25in; }
P.MsoNormal {
        FONT-SIZE: 12pt; MARGIN: 0in 0in 0pt; FONT-FAMILY: "Times New Roman"
}
LI.MsoNormal {
        FONT-SIZE: 12pt; MARGIN: 0in 0in 0pt; FONT-FAMILY: "Times New Roman"
}
DIV.MsoNormal {
        FONT-SIZE: 12pt; MARGIN: 0in 0in 0pt; FONT-FAMILY: "Times New Roman"
}
A:link {
        COLOR: blue; TEXT-DECORATION: underline
}
SPAN.MsoHyperlink {
        COLOR: blue; TEXT-DECORATION: underline
}
A:visited {
        COLOR: purple; TEXT-DECORATION: underline
}
SPAN.MsoHyperlinkFollowed {
        COLOR: purple; TEXT-DECORATION: underline
}
SPAN.EmailStyle17 {
        COLOR: windowtext; FONT-FAMILY: Arial; mso-style-type: personal
}
SPAN.EmailStyle18 {
        COLOR: navy; FONT-FAMILY: Arial; mso-style-type: personal
}
SPAN.EmailStyle19 {
        COLOR: navy; FONT-FAMILY: Arial; mso-style-type: personal-reply
}
DIV.Section1 {
        page: Section1
}
    </style> </O:SMARTTAGTYPE>
    <div class="Section1">
    <p class="MsoNormal"><font color="navy" face="Arial" size="2"><span
 style="font-size: 10pt; color: navy; font-family: Arial;">Did that,
but I get an MgByteReader object with no clue how to iterate&#8230;isn&#8217;t
there a count/getitem method I could use or do I have to convert to a
string and Parse or something?<O:P></O:P></span></font></p>
    <p class="MsoNormal"><font color="navy" face="Arial" size="2"><span
 style="font-size: 10pt; color: navy; font-family: Arial;"><O:P></O:P></span></font></p>
    <p class="MsoNormal"><font color="navy" face="Arial" size="2"><span
 style="font-size: 10pt; color: navy; font-family: Arial;"><O:P></O:P></span></font></p>
    <div>
    <div class="MsoNormal" style="text-align: center;" align="center"><font
 face="Times New Roman" size="3"><span style="font-size: 12pt;">
    <hr tabindex="-1" align="center" size="2" width="100%"> </span></font></div>
    <p class="MsoNormal"><b><font face="Tahoma" size="2"><span
 style="font-weight: bold; font-size: 10pt; font-family: Tahoma;">From:</span></font></b><font
 face="Tahoma" size="2"><span
 style="font-size: 10pt; font-family: Tahoma;"> Dave Wilson [<a
 class="moz-txt-link-freetext" href="mailto:dave.wilson@autodesk.com">mailto:dave.wilson@autodesk.com</a>]
    <br>
    <b><span style="font-weight: bold;">Sent:</span></b> Tuesday,
December 12, 2006 4:54 PM<br>
    <b><span style="font-weight: bold;">To:</span></b> <ST1:PERSONNAME
 w:st="on"><a class="moz-txt-link-abbreviated"
 href="mailto:users@mapguide.osgeo.org">users@mapguide.osgeo.org</a></ST1:PERSONNAME><br>
    <b><span style="font-weight: bold;">Subject:</span></b> RE:
[mapguide-users] Finding list of Mapdefinitions</span></font><O:P></O:P></p>
    </div>
    <p class="MsoNormal"><font face="Times New Roman" size="3"><span
 style="font-size: 12pt;"><O:P></O:P></span></font></p>
    <p class="MsoNormal"><font color="blue" face="Arial" size="2"><span
 style="font-size: 10pt; color: blue; font-family: Arial;">Try
MapDefinition</span></font><O:P></O:P></p>
    <p class="MsoNormal"><font face="Times New Roman" size="3"><span
 style="font-size: 12pt;"><O:P></O:P></span></font></p>
    <p class="MsoNormal"><font color="blue" face="Arial" size="2"><span
 style="font-size: 10pt; color: blue; font-family: Arial;">Case
sensitive.</span></font><O:P></O:P></p>
    <p class="MsoNormal"><font face="Times New Roman" size="3"><span
 style="font-size: 12pt;"><O:P></O:P></span></font></p>
    <p class="MsoNormal"><font color="blue" face="Arial" size="2"><span
 style="font-size: 10pt; color: blue; font-family: Arial;">:)</span></font><O:P></O:P></p>
    <div class="MsoNormal" style="text-align: center;" align="center"><font
 face="Times New Roman" size="3"><span style="font-size: 12pt;">
    <hr tabindex="-1" align="center" size="2" width="100%"> </span></font></div>
    <p class="MsoNormal" style="margin-bottom: 12pt;"><b><font
 face="Tahoma" size="2"><span
 style="font-weight: bold; font-size: 10pt; font-family: Tahoma;">From:</span></font></b><font
 face="Tahoma" size="2"><span
 style="font-size: 10pt; font-family: Tahoma;"> Scott Hameister [<a
 class="moz-txt-link-freetext" href="mailto:ScottH@mPower-tech.com">mailto:ScottH@mPower-tech.com</a>]
    <br>
    <b><span style="font-weight: bold;">Sent:</span></b> Tuesday,
December 12, 2006 3:53 PM<br>
    <b><span style="font-weight: bold;">To:</span></b> <ST1:PERSONNAME
 w:st="on"><a class="moz-txt-link-abbreviated"
 href="mailto:users@mapguide.osgeo.org">users@mapguide.osgeo.org</a></ST1:PERSONNAME><br>
    <b><span style="font-weight: bold;">Subject:</span></b>
[mapguide-users] Finding list of Mapdefinitions</span></font><O:P></O:P></p>
    <p class="MsoNormal"><font color="navy" face="Arial" size="2"><span
 style="font-size: 10pt; color: navy; font-family: Arial;">Pulling my
Hair out I&#8217;m just trying to get a list of Mapdefinitions in the
Library:\\<O:P></O:P></span></font></p>
    <p class="MsoNormal"><font color="navy" face="Arial" size="2"><span
 style="font-size: 10pt; color: navy; font-family: Arial;"><O:P></O:P></span></font></p>
    <p class="MsoNormal"><font color="navy" face="Arial" size="2"><span
 style="font-size: 10pt; color: navy; font-family: Arial;">I tried
doing EnumerateResources on Library\\: with -1 and Mapdefinition, but
can&#8217;t find an API way to get the names&#8230;.Am I way off target here?<O:P></O:P></span></font></p>
    </div>
  </blockquote>
</blockquote>
</body>
</html>