<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN">
<HTML><HEAD><TITLE></TITLE>
<META http-equiv=Content-Type content="text/html; charset=us-ascii">
<META content="MSHTML 6.00.5730.11" name=GENERATOR></HEAD>
<BODY text=#000000 bgColor=#ffffff>
<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> </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> </DIV>
<DIV dir=ltr align=left><FONT face=Arial><SPAN
class=663572220-13122006></SPAN></FONT> </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><FONT face=Arial></FONT> </DIV><FONT face=Arial>--<BR>Chris</FONT><BR>
<DIV> </DIV><BR>
<DIV class=OutlookMessageHeader lang=en-us dir=ltr align=left>
<HR tabIndex=-1>
<FONT face=Tahoma size=2><B>From:</B> Dave Wilson
[mailto:dave.wilson@autodesk.com] <BR><B>Sent:</B> Tuesday, December 12, 2006
5:21 PM<BR><B>To:</B> users@mapguide.osgeo.org<BR><B>Subject:</B> RE:
[mapguide-users] Finding list of Mapdefinitions<BR></FONT><BR></DIV>
<DIV></DIV>
<DIV dir=ltr align=left><SPAN class=510531823-12122006><FONT face=Arial
color=#0000ff size=2>Thanks Scott. Beat me to it.</FONT></SPAN></DIV>
<DIV dir=ltr align=left><SPAN class=510531823-12122006><FONT face=Arial
color=#0000ff size=2></FONT></SPAN> </DIV>
<DIV dir=ltr align=left><SPAN class=510531823-12122006><FONT face=Arial
color=#0000ff size=2>With the DOM parser you can search on the
<ResourceId> 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><FONT face=Arial
color=#0000ff size=2></FONT></SPAN> </DIV>
<DIV dir=ltr align=left><SPAN class=510531823-12122006><FONT face=Arial
color=#0000ff
size=2><ResourceId>Library://QE_Data/Maps/SDF2.0_Dublin_CA83IIIF.MapDefinition</ResourceId></FONT></SPAN></DIV>
<DIV dir=ltr align=left><SPAN class=510531823-12122006><FONT face=Arial
color=#0000ff size=2></FONT></SPAN> </DIV>
<DIV dir=ltr align=left><SPAN class=510531823-12122006><FONT face=Arial
color=#0000ff size=2>By the way it's Library://</FONT></SPAN></DIV>
<DIV dir=ltr align=left><SPAN class=510531823-12122006><FONT face=Arial
color=#0000ff size=2></FONT></SPAN> </DIV>
<DIV dir=ltr align=left><SPAN class=510531823-12122006><FONT face=Arial
color=#0000ff size=2>// and not \\ just in case you missed that
too.</FONT></SPAN></DIV>
<DIV dir=ltr align=left><SPAN class=510531823-12122006><FONT face=Arial
color=#0000ff size=2></FONT></SPAN> </DIV>
<DIV dir=ltr align=left><SPAN class=510531823-12122006><FONT face=Arial
color=#0000ff size=2>Dave</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> Scott Reisdorf [mailto:reisdorf1@llnl.gov]
<BR><B>Sent:</B> Tuesday, December 12, 2006 4:18 PM<BR><B>To:</B>
users@mapguide.osgeo.org<BR><B>Subject:</B> Re: [mapguide-users] Finding list of
Mapdefinitions<BR></FONT><BR></DIV>
<DIV></DIV>In Java you can do something like this, creating a
ByteArrayOutputStream and then displaying that stream back as a
String.<BR><BR><BR> ByteArrayOutputStream bos = new
ByteArrayOutputStream();
<BR> byte[] byteBuffer = new
byte[1024];<BR> int numBytes =
byteReader.Read(byteBuffer, 1024);<BR>
while(numBytes > 0)<BR>
{<BR>
bos.write(byteBuffer, 0,
numBytes);<BR>
numBytes = byteReader.Read(byteBuffer,
1024);<BR>
}<BR>
System.out.println(bos.toByteArray());<BR><BR><BR>or you can get straight XML
back from the MgByteReader, and then parse that:<BR><BR> MgByteReader
byteReader =
resourceService.EnumerateResources(resId,-1,MgResourceType.MapDefinition);<BR>
String xml = byteReader.ToString();<BR> // ...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 face=Arial color=navy 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…isn’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 face=Arial color=navy size=2><SPAN
style="FONT-SIZE: 10pt; COLOR: navy; FONT-FAMILY: Arial"><O:P></O:P></SPAN></FONT></P>
<P class=MsoNormal><FONT face=Arial color=navy 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 width="100%" SIZE=2>
</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 face=Arial color=blue 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 face=Arial color=blue 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 face=Arial color=blue 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 width="100%" SIZE=2>
</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 face=Arial color=navy size=2><SPAN
style="FONT-SIZE: 10pt; COLOR: navy; FONT-FAMILY: Arial">Pulling my Hair out
I’m just trying to get a list of Mapdefinitions in the
Library:\\<O:P></O:P></SPAN></FONT></P>
<P class=MsoNormal><FONT face=Arial color=navy size=2><SPAN
style="FONT-SIZE: 10pt; COLOR: navy; FONT-FAMILY: Arial"><O:P></O:P></SPAN></FONT></P>
<P class=MsoNormal><FONT face=Arial color=navy size=2><SPAN
style="FONT-SIZE: 10pt; COLOR: navy; FONT-FAMILY: Arial">I tried doing
EnumerateResources on Library\\: with -1 and Mapdefinition, but can’t find an
API way to get the names….Am I way off target
here?<O:P></O:P></SPAN></FONT></P></DIV></BLOCKQUOTE></BODY></HTML>