<!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><SPAN class=846271823-12122006><FONT face=Arial
color=#0000ff size=2>Or you could hit the MapAgent :)</FONT></SPAN></DIV>
<DIV dir=ltr align=left><SPAN class=846271823-12122006><FONT face=Arial
color=#0000ff size=2></FONT></SPAN> </DIV>
<DIV dir=ltr align=left><SPAN class=846271823-12122006><FONT face=Arial
color=#0000ff size=2><A
href="http://localhost:8008/mapguide/mapagent/mapagent.fcgi?OPERATION=ENUMERATERESOURCES&VERSION=1.0.0&LOCALE=en&RESOURCEID=Library://&TYPE=MapDefinition&DEPTH=-1">http://localhost:8008/mapguide/mapagent/mapagent.fcgi?OPERATION=ENUMERATERESOURCES&VERSION=1.0.0&LOCALE=en&RESOURCEID=Library://&TYPE=MapDefinition&DEPTH=-1</A></FONT></SPAN></DIV>
<DIV dir=ltr align=left><SPAN class=846271823-12122006><FONT face=Arial
color=#0000ff size=2></FONT></SPAN> </DIV>
<DIV dir=ltr align=left><SPAN class=846271823-12122006><FONT face=Arial
color=#0000ff size=2></FONT></SPAN> </DIV>
<DIV dir=ltr align=left><SPAN class=846271823-12122006><FONT face=Arial
color=#0000ff size=2>Parsing the DOM isn't that hard in PHP (stealing from Bob's
excellent AU session on resources):</FONT></SPAN></DIV>
<DIV dir=ltr align=left><SPAN class=846271823-12122006></SPAN><SPAN
class=846271823-12122006><FONT face=Arial color=#0000ff
size=2></FONT></SPAN> </DIV>
<DIV dir=ltr align=left><SPAN class=846271823-12122006><FONT face=Arial
color=#0000ff size=2>$resourceDOC = DOMDocument::loadXML(<SPAN
class=846271823-12122006><FONT face=Arial color=#0000ff
size=2>$byteReader->ToString()</FONT></SPAN>);</FONT></SPAN></DIV>
<DIV dir=ltr align=left><SPAN class=846271823-12122006><FONT face=Arial
color=#0000ff size=2>$mapList = $resourceDOC->getElementsByTagName('<SPAN
class=846271823-12122006><FONT face=Arial color=#0000ff
size=2>ResourceId</FONT></SPAN>');</FONT></SPAN></DIV>
<DIV dir=ltr align=left><SPAN class=846271823-12122006><FONT face=Arial
color=#0000ff size=2></FONT></SPAN> </DIV>
<DIV dir=ltr align=left><SPAN class=846271823-12122006><FONT face=Arial
color=#0000ff size=2>foreach ($mapList as $map)<BR>{<BR> print
$map->nodeValue;</FONT></SPAN></DIV>
<DIV dir=ltr align=left><SPAN class=846271823-12122006><FONT face=Arial
color=#0000ff size=2>}</FONT></SPAN></DIV>
<DIV dir=ltr align=left><SPAN class=846271823-12122006><FONT face=Arial
color=#0000ff size=2></FONT></SPAN> </DIV>
<DIV dir=ltr align=left><SPAN class=846271823-12122006><FONT face=Arial
color=#0000ff size=2>Jason</FONT></SPAN></DIV>
<DIV dir=ltr align=left><SPAN class=846271823-12122006><FONT face=Arial
color=#0000ff size=2></FONT></SPAN> </DIV><FONT face=Arial color=#0000ff
size=2></FONT><BR>
<DIV class=OutlookMessageHeader lang=en-us dir=ltr align=left>
<HR tabIndex=-1>
<FONT face=Tahoma size=2><B>From:</B> Scott Reisdorf<BR><B>Sent:</B> Tuesday,
December 12, 2006 15:18<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 name="PersonName"
namespaceuri="urn:schemas-microsoft-com:office:smarttags"><!--[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<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"><FONT face=Arial color=#0000ff
size=2></FONT><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"><FONT face=Arial color=#0000ff
size=2></FONT><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"><FONT face=Arial color=#0000ff
size=2></FONT><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>