[mapguide-users] Finding list of Mapdefinitions

Scott Reisdorf reisdorf1 at llnl.gov
Tue Dec 12 18:17:33 EST 2006


In Java you can do something like this, creating a ByteArrayOutputStream 
and then displaying that stream back as a String.


 ByteArrayOutputStream bos = new ByteArrayOutputStream();       
        byte[] byteBuffer = new byte[1024];
        int numBytes = byteReader.Read(byteBuffer, 1024);
        while(numBytes > 0)
        {
            bos.write(byteBuffer, 0, numBytes);
            numBytes = byteReader.Read(byteBuffer, 1024);
        }
        System.out.println(bos.toByteArray());


or you can get straight XML back from the MgByteReader, and then parse that:

  MgByteReader byteReader = 
resourceService.EnumerateResources(resId,-1,MgResourceType.MapDefinition);
        String xml = byteReader.ToString();
   //  ...parse the xml via the DOM

hope this helps
-scott

Scott Hameister wrote:
>
> 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?
>
>  
>
>  
>
> ------------------------------------------------------------------------
>
> *From:* Dave Wilson [mailto:dave.wilson at autodesk.com]
> *Sent:* Tuesday, December 12, 2006 4:54 PM
> *To:* users at mapguide.osgeo.org
> *Subject:* RE: [mapguide-users] Finding list of Mapdefinitions
>
>  
>
> Try MapDefinition
>
>  
>
> Case sensitive.
>
>  
>
> :)
>
> ------------------------------------------------------------------------
>
> *From:* Scott Hameister [mailto:ScottH at mPower-tech.com]
> *Sent:* Tuesday, December 12, 2006 3:53 PM
> *To:* users at mapguide.osgeo.org
> *Subject:* [mapguide-users] Finding list of Mapdefinitions
>
> Pulling my Hair out I'm just trying to get a list of Mapdefinitions in 
> the Library:\\
>
>  
>
> 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?
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://lists.osgeo.org/pipermail/mapguide-users/attachments/20061212/8c8b4d8f/attachment.html


More information about the Mapguide-users mailing list