Re: [mapguide-users] How to Load Runtime map in mapviewerajax

2008-12-01 Thread padmini godavarthi

Hi thanks for u r reply.

But i dont want to give path for the map definition like 


  layout.Map.ResourceId = Library://mymap.MapDefinition;

i want to create it dynamically in the code .After creating weblayout how to
call it in the ajaxviewer sample application.


If u know this plz help me



Kenneth Skovhede, GEOGRAF A/S wrote:
 
 If you want to create a WebLayout using the MaestroAPI, simpy do:
 MaestroAPI.ServerConnectionI con; //You need this from the 
 code in the example
 MaestroAPI.WebLayout layout = new MaestroAPI.WebLayout();
 layout.Map = new MaestroAPI.MapType();
 layout.Map.ResourceId = Library://mymap.MapDefinition;
 con.SaveResourceAs(layout, Library://mylayout.WebLayout);
 
 You might also want to add some buttons and set other options.
 
 Regards, Kenneth Skovhede, GEOGRAF A/S
 
 
 
 padmini godavarthi skrev:
 Hi,
 Thanks for u r reply.
 Actually i have created one mgp in mapguide maestro.
 so  i placed it in  the ajaxviewer sample application as
 weblayout=Library://Layout/maplayout.weblayout.
 It works fine

 Now i want to create it by coding using (Maestroapi.dll) dynamically  so
 i
 saw a link

 http://trac.osgeo.org/mapguide/wiki/maestro/MaestroAPI/samples/AddInitialLayer

 but i didnt get the code


 So plz tell me the procedure sothat i will proceed further development


 Regards,
 Padmini



 Maksim Sestic wrote:
   
 Then check the last few lines of this example:

 http://trac.osgeo.org/mapguide/wiki/maestro/MaestroAPI/samples/AddInitialLay
 er

 ...but I suggest you reading a bit about MeastroAPI in general:

 http://trac.osgeo.org/mapguide/wiki/maestro/MaestroAPI

 Regards,
 Maksim Sestic

 -Original Message-
 From: [EMAIL PROTECTED]
 [mailto:[EMAIL PROTECTED] On Behalf Of padmini
 godavarthi
 Sent: Thursday, November 27, 2008 02:22
 To: mapguide-users@lists.osgeo.org
 Subject: RE: [mapguide-users] How to Load Runtime map in mapviewerajax


 Hi,
 Thanks for u r reply.
 I followed the given url



 http://trac.osgeo.org/mapguide/wiki/maestro/MaestroAPI/samples/RuntimeMap



 i got an session id for that. After getting it iam unable to get what to
 do
 with that?


 can u plz tell me the procedure.



 Regards,
 padmini

 Maksim Sestic wrote:
 
 You might check this out first:

 http://trac.osgeo.org/mapguide/wiki/maestro/MaestroAPI/samples/Runtime
 Map

 I guess it does exactly what you need.

 Regards,
 Maksim Sestic

 -Original Message-
 From: [EMAIL PROTECTED]
 [mailto:[EMAIL PROTECTED] On Behalf Of padmini 
 godavarthi
 Sent: Wednesday, November 26, 2008 17:15
 To: mapguide-users@lists.osgeo.org
 Subject: [mapguide-users] How to Load Runtime map in mapviewerajax



Hi,
 iam using Mapguide opensource 2.0 (with .net 2.0+IIS 5.1).
 Now i want to load a runtime map  (using MaestroAPI.dll) in to 
 mapviewer ajax application (in .net)

 Plz tell me the procedure  for

 1) How to load the runtime map?
 2) What are the steps i have to follow?

 If anybody knows plz help me


 Regards,
 Padmini


 --
 View this message in context:
 http://www.nabble.com/How-to-Load-Runtime-map-in-mapviewerajax-tp20704
 038p20
 704038.html
 Sent from the MapGuide Users mailing list archive at Nabble.com.

 ___
 mapguide-users mailing list
 mapguide-users@lists.osgeo.org
 http://lists.osgeo.org/mailman/listinfo/mapguide-users

 __ Information from ESET NOD32 Antivirus, version of virus 
 signature database 3643 (20081126) __

 The message was checked by ESET NOD32 Antivirus.

 http://www.eset.com

  

 __ Information from ESET NOD32 Antivirus, version of virus 
 signature database 3643 (20081126) __

 The message was checked by ESET NOD32 Antivirus.

 http://www.eset.com
  

 ___
 mapguide-users mailing list
 mapguide-users@lists.osgeo.org
 http://lists.osgeo.org/mailman/listinfo/mapguide-users


   
 --
 View this message in context:
 http://www.nabble.com/How-to-Load-Runtime-map-in-mapviewerajax-tp20704038p20
 712155.html
 Sent from the MapGuide Users mailing list archive at Nabble.com.

 ___
 mapguide-users mailing list
 mapguide-users@lists.osgeo.org
 http://lists.osgeo.org/mailman/listinfo/mapguide-users

 __ Information from ESET NOD32 Antivirus, version of virus
 signature
 database 3644 (20081126) __

 The message was checked by ESET NOD32 Antivirus.

 http://www.eset.com


  

 __ Information from ESET NOD32 Antivirus, version of virus
 signature
 database 3644 (20081126) __

 The message was checked by ESET NOD32 Antivirus.

 http://www.eset.com
  

 ___
 mapguide-users mailing list
 mapguide-users@lists.osgeo.org
 http://lists.osgeo.org/mailman/listinfo/mapguide-users


 

   
 
 ___
 mapguide-users mailing list
 

Re: [mapguide-users] How to Load Runtime map in mapviewerajax

2008-12-01 Thread Kenneth Skovhede, GEOGRAF A/S

You can't.
You can only reference items in the repository.
You can create a new MapDefinition with:
MaestroAPI.MapDefinition mdef = new MaestroAPI.MapDefinition();

You can then save that under an ID (either Library (permanent) or 
Session (temporary)), and reference it from a WebLayout.

A MapDefinition is not the same as a Runtime Map.

You can open the browser with any WebLayout using an URL like this:
http://servername/mapguide/ajaxviewer/?WEBLAYOUT=...resourceId for your 
WebLayout...USERNAME=AnonymousPASSWORD=


If you want to, you can redirect your ASP.Net page to the url like:
Response.Redirect(/mapguide/ajaxviewer/?WEBLAYOUT=...resourceId for 
your WebLayout...USERNAME=AnonymousPASSWORD=);


Regards, Kenneth Skovhede, GEOGRAF A/S



padmini godavarthi skrev:
Hi thanks for u r reply. But i dont want to give path for the map 
definition like layout.Map.ResourceId = 
Library://mymap.MapDefinition; i want to create it dynamically in 
the code .After creating weblayout how to call it in the ajaxviewer 
sample application. If u know this plz help me


View this message in context: Re: How to Load Runtime map in 
mapviewerajax 
http://www.nabble.com/How-to-Load-Runtime-map-in-mapviewerajax-tp20704038p20768314.html
Sent from the MapGuide Users mailing list archive 
http://www.nabble.com/MapGuide-Users-f14845.html at Nabble.com.



___
mapguide-users mailing list
mapguide-users@lists.osgeo.org
http://lists.osgeo.org/mailman/listinfo/mapguide-users
  
___
mapguide-users mailing list
mapguide-users@lists.osgeo.org
http://lists.osgeo.org/mailman/listinfo/mapguide-users


[mapguide-users] How to create filled polygon from data file?

2008-12-01 Thread jamesdudden

Hi,

Is it possible to create a filled polygon from data? - The data has a centre
point (longitute/latitude) and a string of points (longitute/latitude) that
make up the shape outline. 

Would this be done in MGStudio or would it need to be done in code.

Any help or advie would be appreciated.

Regards

James

-
Straightforward solutions to take care of your business
http://www.software-matters.co.uk Software Matters 
-- 
View this message in context: 
http://www.nabble.com/How-to-create-filled-polygon-from-data-file--tp20769949p20769949.html
Sent from the MapGuide Users mailing list archive at Nabble.com.

___
mapguide-users mailing list
mapguide-users@lists.osgeo.org
http://lists.osgeo.org/mailman/listinfo/mapguide-users


[mapguide-users] XML Parser error for Feature Sources

2008-12-01 Thread cagray

Hi,

I have a web application in .NET c# which allows a user to define their own
feature sources and set the connection parameters. It is very similar to
doing the same through map guide's own interface. However no matter I do to
the xml in the code behind I get the error:

An exception occurred in the XML parser.

this gives me no detail why so is very hard to debug. I have validated the
xml against the xsd and it validates fine. Example of xml below:

?xml version=1.0 encoding=utf-8?
FeatureSource xmlns:xsi=http://www.w3.org/2001/XMLSchema-instance;
xmlns:xsd=http://www.w3.org/2001/XMLSchema;
xsi:noNamespaceSchemaLocation=FeatureSource-1.0.0.xsd
  ProviderOSGeo.SHP/Provider
  Parameter
NameDefaultFileLocation/Name
Valued:\Data\OLPSample_EDC\Local Plan\Lines_ polygon\economic
development opportunities.shp/Value
  /Parameter
/FeatureSource

My method is to grab the xml from mapguide as:

XmlDocument xmlDoc = new XmlDocument();
xmlDoc.PreserveWhitespace = true;

string strXml =
resourceService.GetResourceContent(resourceID).ToString();
xmlDoc.LoadXml(strXml);

Then I traverse the xml structure and edit node's InnerText or add nodes as
appropriate. Once done I do:

MgByteSource byteSource = getResourceByteSource(xmlDoc);
MgResourceIdentifier resourceID = new 
MgResourceIdentifier(whereToString +
// + resourceName + . + resourceType);
resourceService.SetResource(resourceID, byteSource.GetReader(), null);

where the getResourceByteSource function looks like:

public MgByteSource getResourceByteSource(XmlDocument xmlDoc)
{
MemoryStream memStream = new MemoryStream();
xmlDoc.Save(memStream);
Byte[] arrBytes = memStream.ToArray();

UTF8Encoding utf8 = new UTF8Encoding();
byte[] encodedDefinition =
utf8.GetBytes(xmlDoc.InnerXml.ToString());
MgByteSource contentByteSource = new
MgByteSource(encodedDefinition, encodedDefinition.Length);

return contentByteSource;
}

This works completely find for editing layer definitions but no matter what
I do with feature source xml it returns this error. I have tried hand coded
xml strings, adding spaces, removing formatting etc. I even have tried just
taking a feature resource straight out and trying to put it back without any
changes and this error still occurs. 

Anyone ever seen this before (and hopefully got round it)?

Thanks
Colin




-- 
View this message in context: 
http://www.nabble.com/XML-Parser-error-for-Feature-Sources-tp20770245p20770245.html
Sent from the MapGuide Users mailing list archive at Nabble.com.

___
mapguide-users mailing list
mapguide-users@lists.osgeo.org
http://lists.osgeo.org/mailman/listinfo/mapguide-users


Re: [mapguide-users] Search Query and shorter url's

2008-12-01 Thread jamesdudden



Sumedho wrote:
 
 I tried the custom search tool but it didnt return any results. There was
 an error in the search query. I am using .shp files so wondering if
 something is up with that.
 
 I am interested in the ad hoc query command shown in the live application
 gallery. It says that the source is downloadable but I can't find it
 anywhere. Thanks for the help.
 
 
Which example apllication do you mean?
Have you tried the sample application -
http://mapguide.osgeo.org/download/releases/2.0.x-samples
I downloaded the dotnetviewrsample and ammended the query example from it.

Regards

James

-
Straightforward solutions to take care of your business
http://www.software-matters.co.uk Software Matters 
-- 
View this message in context: 
http://www.nabble.com/Search-Query-and-shorter-url%27s-tp20765010p20770278.html
Sent from the MapGuide Users mailing list archive at Nabble.com.

___
mapguide-users mailing list
mapguide-users@lists.osgeo.org
http://lists.osgeo.org/mailman/listinfo/mapguide-users


Re: [mapguide-users] How to create filled polygon from data file?

2008-12-01 Thread Zac Spitzer
you could just create a polygon from the points using WKT ie POLYGON
(( 10 10, 10 20, 20 20, 20 15, 10 10))
and insert that via some (simple ish) code into a featuresource,
either via FDO or much more simply in your
favourite database with an insert statement

MG Studio is more a XML editor

z


On Mon, Dec 1, 2008 at 10:11 PM, jamesdudden
[EMAIL PROTECTED] wrote:

 Hi,

 Is it possible to create a filled polygon from data? - The data has a centre
 point (longitute/latitude) and a string of points (longitute/latitude) that
 make up the shape outline.

 Would this be done in MGStudio or would it need to be done in code.

 Any help or advie would be appreciated.

 Regards

 James

 -
 Straightforward solutions to take care of your business
 http://www.software-matters.co.uk Software Matters
 --
 View this message in context: 
 http://www.nabble.com/How-to-create-filled-polygon-from-data-file--tp20769949p20769949.html
 Sent from the MapGuide Users mailing list archive at Nabble.com.

 ___
 mapguide-users mailing list
 mapguide-users@lists.osgeo.org
 http://lists.osgeo.org/mailman/listinfo/mapguide-users




-- 
Zac Spitzer -
http://zacster.blogspot.com
+61 405 847 168
___
mapguide-users mailing list
mapguide-users@lists.osgeo.org
http://lists.osgeo.org/mailman/listinfo/mapguide-users


Re: [mapguide-users] How to create filled polygon from data file?

2008-12-01 Thread Kenneth Skovhede, GEOGRAF A/S

I'm pretty sure you can't do this through Studio (hapilly corrected).
It would be straightforward through code.
Simply create the WKT for the polygons like POLYGON(( + points string 
+ )),
and insert this with the Fdo Insert/Update command (avalible from the 
MapGuide API).


Regards, Kenneth Skovhede, GEOGRAF A/S



jamesdudden skrev:

Hi,

Is it possible to create a filled polygon from data? - The data has a centre
point (longitute/latitude) and a string of points (longitute/latitude) that
make up the shape outline. 


Would this be done in MGStudio or would it need to be done in code.

Any help or advie would be appreciated.

Regards

James

-
Straightforward solutions to take care of your business
http://www.software-matters.co.uk Software Matters 
  

___
mapguide-users mailing list
mapguide-users@lists.osgeo.org
http://lists.osgeo.org/mailman/listinfo/mapguide-users


Re: [mapguide-users] XML Parser error for Feature Sources

2008-12-01 Thread cagray

Thanks for the reply. Unfortunately that did not solve my problem and I got
the same error. Is there anything else I could try?

I was not aware you could do this without generating/manipulating the xml.
My web tool has to fully control setting up data sources. So the user
selects a provider and then fills in the connection details. I then need to
create a new data source from this to be stored in mapguide. Can you do this
using the Meastro API alone? 


Kenneth Skovhede, GEOGRAF A/S wrote:
 
 I believe the problem is the .Net UTF-8 Encoder prefixes an UTF-8 BOM,
 which causes problems in the Xml parser:
 http://trac.osgeo.org/mapguide/ticket/233
 
 You can try to create the UTF-8 encoder with:
 
 UTF8Encoding utf8 = new UTF8Encoding(false);
 
 
 And see if the problem goes away.
 Alternatively you can use the MaestroAPI instead of messing with the raw 
 Xml:
 http://trac.osgeo.org/mapguide/wiki/maestro/MaestroAPI
 
 Regards, Kenneth Skovhede, GEOGRAF A/S
 
 
-- 
View this message in context: 
http://www.nabble.com/XML-Parser-error-for-Feature-Sources-tp20770245p20771868.html
Sent from the MapGuide Users mailing list archive at Nabble.com.

___
mapguide-users mailing list
mapguide-users@lists.osgeo.org
http://lists.osgeo.org/mailman/listinfo/mapguide-users


Re: [mapguide-users] XML Parser error for Feature Sources

2008-12-01 Thread cagray

The error in the log is:

 Error: An exception occurred in the XML parser.
 StackTrace:
  - MgResourceServiceHandler.ProcessOperation line 80 file
d:\build\mapguide_open_source_v2.0\build_30.11\mgdev\server\src\services\resource\ResourceServiceHandler.cpp
  - MgOpSetResource.Execute line 103 file
d:\build\mapguide_open_source_v2.0\build_30.11\mgdev\server\src\services\resource\OpSetResource.cpp
  - MgServerResourceService.SetResource line 713 file
d:\build\mapguide_open_source_v2.0\build_30.11\mgdev\server\src\services\resource\ServerResourceService.cpp
  - MgRepositoryManager.SetResource line 867 file
d:\build\mapguide_open_source_v2.0\build_30.11\mgdev\server\src\services\resource\RepositoryManager.cpp
  - MgRepositoryManager.AddResource line 840 file
d:\build\mapguide_open_source_v2.0\build_30.11\mgdev\server\src\services\resource\RepositoryManager.cpp
  - MgResourceContentManager.AddResource line 183 file
d:\build\mapguide_open_source_v2.0\build_30.11\mgdev\server\src\services\resource\ResourceContentManager.cpp
  - MgResourceContentManager.PutDocument line 624 file
d:\build\mapguide_open_source_v2.0\build_30.11\mgdev\server\src\services\resource\ResourceContentManager.cpp
  - MgResourceDefinitionManager.PutDocument line 554 file
d:\build\mapguide_open_source_v2.0\build_30.11\mgdev\server\src\services\resource\ResourceDefinitionManager.cpp
  - MgResourceDefinitionManager.ValidateDocument line 429 file
d:\build\mapguide_open_source_v2.0\build_30.11\mgdev\server\src\services\resource\ResourceDefinitionManager.cpp
  - MgResourceContentManager.ValidateDocument line 556 file
d:\build\mapguide_open_source_v2.0\build_30.11\mgdev\server\src\services\resource\ResourceContentManager.cpp
An exception occurred in the XML parser.

However the MaestroAPI looks really good (think i was confusing MaestroAPI
with MapGuideAPI!). I'll have a go at that also.

Many thanks again
Colin


Kenneth Skovhede, GEOGRAF A/S wrote:
 
 Yes, you can do just that.
 Look in the Maestro source code to see how it's done.
 The files ResourceEditors/ResourceEditorBase.cs  and 
 ResourceEditors/ResourceEditorGeneric.cs shows it.
 Some more customized versions are avalible in eg
 FeatureSourceEditorSDF.cs
 
 Basically you can do:
 MaestroAPI.ServerConnectionI con; //You must initialize this, see 
 the developer docs
 MaestroAPI.FeatureSource fs = new MaestroAPI.FeatureSource();
 fs.Provider = OSGeo.SHP.3.1;
 fs.Parameter[DefaultFilePath] = C:\my.shp;
 con.SaveResourceAs(fs, new MaestroAPI.ResourceIdentifier(my fs, 
 OSGeo.MapGuide.MaestroAPI.ResourceTypes.FeatureSource));
 
 
 As for your actual problem, does the server error log show anything?
 C:\program files\Mapguideopensource2.0\server\logs\error.log
 
 Regards, Kenneth Skovhede, GEOGRAF A/S
 
 
 
 

-- 
View this message in context: 
http://www.nabble.com/XML-Parser-error-for-Feature-Sources-tp20770245p20772530.html
Sent from the MapGuide Users mailing list archive at Nabble.com.

___
mapguide-users mailing list
mapguide-users@lists.osgeo.org
http://lists.osgeo.org/mailman/listinfo/mapguide-users


[mapguide-users] Reading data resulting from a SQL query

2008-12-01 Thread [EMAIL PROTECTED]
Hi everybody,
is it possible to run a SQL query on a DB table for reading its resulting data?


Thank you for your help
Cheers
Carmelo

___
mapguide-users mailing list
mapguide-users@lists.osgeo.org
http://lists.osgeo.org/mailman/listinfo/mapguide-users


Re: [mapguide-users] XML Parser error for Feature Sources

2008-12-01 Thread cagray

I tried your example and I always get an error of:

Object reference not set to an instance of an object.

when I do:

 fs.Parameter[DefaultFilePath] = C:\my.shp;

or other similar attempts for other providers. If I take this line out it
creates the resource no problem. Do you know why this would happen?

Also I tried to download the help (MaestroAPI.chm) off the website but none
of the help links work. Have I done something daft? 

Any help is appreciated.
Colin


Kenneth Skovhede, GEOGRAF A/S wrote:
 
 Yes, you can do just that.
 Look in the Maestro source code to see how it's done.
 The files ResourceEditors/ResourceEditorBase.cs  and 
 ResourceEditors/ResourceEditorGeneric.cs shows it.
 Some more customized versions are avalible in eg
 FeatureSourceEditorSDF.cs
 
 Basically you can do:
 MaestroAPI.ServerConnectionI con; //You must initialize this, see 
 the developer docs
 MaestroAPI.FeatureSource fs = new MaestroAPI.FeatureSource();
 fs.Provider = OSGeo.SHP.3.1;
 fs.Parameter[DefaultFilePath] = C:\my.shp;
 con.SaveResourceAs(fs, new MaestroAPI.ResourceIdentifier(my fs, 
 OSGeo.MapGuide.MaestroAPI.ResourceTypes.FeatureSource));
 
 
 As for your actual problem, does the server error log show anything?
 C:\program files\Mapguideopensource2.0\server\logs\error.log
 
 Regards, Kenneth Skovhede, GEOGRAF A/S
 
 
 
 cagray skrev:
 Thanks for the reply. Unfortunately that did not solve my problem and I
 got
 the same error. Is there anything else I could try?

 I was not aware you could do this without generating/manipulating the
 xml.
 My web tool has to fully control setting up data sources. So the user
 selects a provider and then fills in the connection details. I then need
 to
 create a new data source from this to be stored in mapguide. Can you do
 this
 using the Meastro API alone? 


 Kenneth Skovhede, GEOGRAF A/S wrote:
   
 I believe the problem is the .Net UTF-8 Encoder prefixes an UTF-8 BOM,
 which causes problems in the Xml parser:
 http://trac.osgeo.org/mapguide/ticket/233

 You can try to create the UTF-8 encoder with:

 UTF8Encoding utf8 = new UTF8Encoding(false);


 And see if the problem goes away.
 Alternatively you can use the MaestroAPI instead of messing with the raw 
 Xml:
 http://trac.osgeo.org/mapguide/wiki/maestro/MaestroAPI

 Regards, Kenneth Skovhede, GEOGRAF A/S


 
 ___
 mapguide-users mailing list
 mapguide-users@lists.osgeo.org
 http://lists.osgeo.org/mailman/listinfo/mapguide-users
 
 

-- 
View this message in context: 
http://www.nabble.com/XML-Parser-error-for-Feature-Sources-tp20770245p20774513.html
Sent from the MapGuide Users mailing list archive at Nabble.com.

___
mapguide-users mailing list
mapguide-users@lists.osgeo.org
http://lists.osgeo.org/mailman/listinfo/mapguide-users


[mapguide-users] Problem with plot DWF (to Brian Berdel)

2008-12-01 Thread Sergio Nistal Calvo

Hi, and I'm sorry for many mails:
 
Only I have one problem. I have installed the program Autodesk design review, 
version 9.0.0.96. With this program works for me the plot of DWF of Sheboygan, 
but not with my data type shp, sbx, sbn, dbf, idx and shx (or with the 
transformation to sdf with fdo2fdo). (The message is: Your current version of 
Design Review does not support files of this type) Do I need to install 
another program? What is the problem? I saw in this link 
http://www.mail-archive.com/mapguide-users@lists.osgeo.org/msg03539.html the 
same problem, but I didn´t see the solution. Brian, can you help me?
 
Thanks.
_
¿Aún no tienes Internet Explorer 7? Bájatelo y consigue un regalo  gratis
http://www.vivelive.com/ieak7___
mapguide-users mailing list
mapguide-users@lists.osgeo.org
http://lists.osgeo.org/mailman/listinfo/mapguide-users


Re: [mapguide-users] XML Parser error for Feature Sources

2008-12-01 Thread Kenneth Skovhede, GEOGRAF A/S

You have to initialize the parameter collection manually:
fs.Parameter = new MaestroAPI.NameValuePairTypeCollection();
(I forgot to mention that).

I just tried to download MaestroAPI.chm, and the link works for me:
http://trac.osgeo.org/mapguide/browser/trunk/Tools/Maestro/MaestroAPI/Documentation/Msdn-Chm/MaestroAPI.chm?format=raw

Regards, Kenneth Skovhede, GEOGRAF A/S



cagray skrev:

I tried your example and I always get an error of:

Object reference not set to an instance of an object.

when I do:

 fs.Parameter[DefaultFilePath] = C:\my.shp;

or other similar attempts for other providers. If I take this line out it
creates the resource no problem. Do you know why this would happen?

Also I tried to download the help (MaestroAPI.chm) off the website but none
of the help links work. Have I done something daft? 


Any help is appreciated.
Colin


Kenneth Skovhede, GEOGRAF A/S wrote:
  

Yes, you can do just that.
Look in the Maestro source code to see how it's done.
The files ResourceEditors/ResourceEditorBase.cs  and 
ResourceEditors/ResourceEditorGeneric.cs shows it.

Some more customized versions are avalible in eg
FeatureSourceEditorSDF.cs

Basically you can do:
MaestroAPI.ServerConnectionI con; //You must initialize this, see 
the developer docs

MaestroAPI.FeatureSource fs = new MaestroAPI.FeatureSource();
fs.Provider = OSGeo.SHP.3.1;
fs.Parameter[DefaultFilePath] = C:\my.shp;
con.SaveResourceAs(fs, new MaestroAPI.ResourceIdentifier(my fs, 
OSGeo.MapGuide.MaestroAPI.ResourceTypes.FeatureSource));



As for your actual problem, does the server error log show anything?
C:\program files\Mapguideopensource2.0\server\logs\error.log

Regards, Kenneth Skovhede, GEOGRAF A/S



cagray skrev:


Thanks for the reply. Unfortunately that did not solve my problem and I
got
the same error. Is there anything else I could try?

I was not aware you could do this without generating/manipulating the
xml.
My web tool has to fully control setting up data sources. So the user
selects a provider and then fills in the connection details. I then need
to
create a new data source from this to be stored in mapguide. Can you do
this
using the Meastro API alone? 



Kenneth Skovhede, GEOGRAF A/S wrote:
  
  

I believe the problem is the .Net UTF-8 Encoder prefixes an UTF-8 BOM,
which causes problems in the Xml parser:
http://trac.osgeo.org/mapguide/ticket/233

You can try to create the UTF-8 encoder with:

UTF8Encoding utf8 = new UTF8Encoding(false);


And see if the problem goes away.
Alternatively you can use the MaestroAPI instead of messing with the raw 
Xml:

http://trac.osgeo.org/mapguide/wiki/maestro/MaestroAPI

Regards, Kenneth Skovhede, GEOGRAF A/S





___
mapguide-users mailing list
mapguide-users@lists.osgeo.org
http://lists.osgeo.org/mailman/listinfo/mapguide-users





  
___
mapguide-users mailing list
mapguide-users@lists.osgeo.org
http://lists.osgeo.org/mailman/listinfo/mapguide-users


Re: [mapguide-users] Reading data resulting from a SQL query

2008-12-01 Thread Kenneth Skovhede, GEOGRAF A/S

I think I read something about doing a pass-through query.
You might be able to find info on it on the FDO website.

For most queries, it is sufficient to pass an FDO filter.
From that you can read values as you please:
http://mapguide.osgeo.net/files/mapguide/docs/webapi/d6/ddc/class_mg_feature_reader.html

Regards, Kenneth Skovhede, GEOGRAF A/S



[EMAIL PROTECTED] skrev:

Hi everybody,
is it possible to run a SQL query on a DB table for reading its resulting data?


Thank you for your help
Cheers
Carmelo

___
mapguide-users mailing list
mapguide-users@lists.osgeo.org
http://lists.osgeo.org/mailman/listinfo/mapguide-users
  

___
mapguide-users mailing list
mapguide-users@lists.osgeo.org
http://lists.osgeo.org/mailman/listinfo/mapguide-users


Re: [mapguide-users] Permanent changes in data

2008-12-01 Thread Kenneth Skovhede, GEOGRAF A/S

You could be affected by this bug:
http://trac.osgeo.org/mapguide/ticket/649

Otherwise, try to post a section of the code,
maybe someone will spot something obvious.

Regards, Kenneth Skovhede, GEOGRAF A/S



Stefan Dalakov skrev:

Hi all,
I am trying to add a feature (permanently) to a data source.
I am using MGOS 1.2 and tried Sheboygan samples, where this part is 
not working, I have not explored the reason yet.
My idea is to digitize a feature ( a line ) and add it permanently to 
an existing layer on the map.
I wrote some code, and everything seems OK, no errors,  but at the end 
I have no feature added.

Can someone help with a piece of code ?

Thanks in advance
Stefan Dalakov
___
mapguide-users mailing list
mapguide-users@lists.osgeo.org
http://lists.osgeo.org/mailman/listinfo/mapguide-users

___
mapguide-users mailing list
mapguide-users@lists.osgeo.org
http://lists.osgeo.org/mailman/listinfo/mapguide-users