<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
<html>
<head>
<meta content="text/html;charset=ISO-8859-1" http-equiv="Content-Type">
<title></title>
</head>
<body bgcolor="#ffffff" text="#000000">
Haris,<br>
<br>
MapGuide simply returns the reader to the application developer. If you
look at MgFeatureService::UpdateFeatures it returns a property
collection with one entry per command. For MgInsertFeature commands the
API reference says:<br>
<ul>
<li>If the command is of type <a class="el"
href="cid:part1.02030107.00060804@robertbray.net">MgInsertFeatures</a>,
the property type is an <a class="el"
href="cid:part2.01010506.00010908@robertbray.net">MgPropertyType::Feature</a>,
and its value is a <a class="el"
href="cid:part3.09010502.07050401@robertbray.net">MgFeatureReader</a>
object. The feature reader object contains the set of properties
inserted into the datastore by the insert command. </li>
</ul>
Bob<br>
<br>
Orest Halustchak wrote:
<blockquote
cite="mid1C457E48E15E5F4C957A23F0847C6123036429C5@msgusaebk01.autodesk.com"
type="cite">
<title>Message</title>
<meta http-equiv="Content-Type" content="text/html; ">
<meta content="MSHTML 6.00.2900.2963" name="GENERATOR">
<div dir="ltr" align="left"><span class="885491214-18102006"><font
color="#0000ff" face="Arial" size="2">Hi Haris,</font></span></div>
<div dir="ltr" align="left"><span class="885491214-18102006"></span> </div>
<div dir="ltr" align="left"><span class="885491214-18102006"><font
color="#0000ff" face="Arial" size="2">If the provider has no way to
get the generated id values, it could return an empty reader (rather
than null reader), but then I'm not sure what Map would do in the case
where the records are displayed in the data grid. Map expects to get
the id values back so that it can populate the corresponding columns in
the data grid and also to know the ids of the objects so that if they
are edited subsequently, the correct objects get updated in the server.
I suppose if a lot of new features are being added at one time, the
user simply could refresh the whole layer in Map to get updated data
complete with id values, but for cases of adding one or a small number
of objects, it's not very efficient to do it that way.</font></span></div>
<div dir="ltr" align="left"><span class="885491214-18102006"></span> </div>
<div dir="ltr" align="left"><span class="885491214-18102006"><font
color="#0000ff" face="Arial" size="2">I don't think that MapGuide by
default uses the insert command unless someone writes their own scripts
that create new features.</font></span></div>
<div dir="ltr" align="left"><span class="885491214-18102006"></span> </div>
<div dir="ltr" align="left"><span class="885491214-18102006"><font
color="#0000ff" face="Arial" size="2">Orest.</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> Haris
Kurtagic [<a class="moz-txt-link-freetext" href="mailto:haris@sl-king.com">mailto:haris@sl-king.com</a>] <br>
<b>Sent:</b> Wednesday, October 18, 2006 3:54 AM<br>
<b>To:</b> <a class="moz-txt-link-abbreviated" href="mailto:dev@fdo.osgeo.org">dev@fdo.osgeo.org</a><br>
<b>Subject:</b> RE: [fdo-dev] fdo insert command<br>
</font><br>
</div>
<div dir="ltr" align="left"><span class="843333607-18102006"><font
color="#0000ff" face="Arial" size="2">Hi Orest,</font></span></div>
<div dir="ltr" align="left"><span class="843333607-18102006"></span> </div>
<div dir="ltr" align="left"><span class="843333607-18102006"><font
color="#0000ff" face="Arial" size="2">Yes, I understand it is up to
provider and RDBMS and app model, but there could be some other case's
of generetaing id's like triggers or procedure in db or more complex
id's (not just number,string)</font></span></div>
<div dir="ltr" align="left"><span class="843333607-18102006"><font
color="#0000ff" face="Arial" size="2">So I think there could be cases
when it is not so straight forward to get those id's back. </font></span></div>
<div dir="ltr" align="left"><span class="843333607-18102006"></span> </div>
<div dir="ltr" align="left"><span class="843333607-18102006"><font
color="#0000ff" face="Arial" size="2">How is this reader (return from
insert) used in MapGuide? Is it used at all?</font></span></div>
<div dir="ltr" align="left"><span class="843333607-18102006"><font
color="#0000ff" face="Arial" size="2">Would be appropriate
(considering FDO architecture) for provider to return NULL reader ? </font></span></div>
<div dir="ltr" align="left"><span class="843333607-18102006"></span><span
class="843333607-18102006"></span> </div>
<div dir="ltr" align="left"><span class="843333607-18102006"><font
color="#0000ff" face="Arial" size="2">Thank you for Map tip. It works
exactly as you wrote </font></span><span class="843333607-18102006"><font
color="#0000ff" face="Arial" size="2">( I suppose Map anyhow should
not try to immediately insert features if some properties are not
nullable).</font></span></div>
<div dir="ltr" align="left"><span class="843333607-18102006"></span> </div>
<div dir="ltr" align="left"><span class="843333607-18102006"><font
color="#0000ff" face="Arial" size="2">Haris</font></span></div>
<div dir="ltr" align="left"><span class="843333607-18102006"></span> </div>
<div dir="ltr" align="left"><span class="843333607-18102006"></span> </div>
<br>
<div class="OutlookMessageHeader" dir="ltr" align="left" lang="en-us">
<hr tabindex="-1"><font face="Tahoma" size="2"><b>From:</b> Orest
Halustchak [<a class="moz-txt-link-freetext" href="mailto:orest.halustchak@autodesk.com">mailto:orest.halustchak@autodesk.com</a>] <br>
<b>Sent:</b> Wednesday, October 18, 2006 1:46 AM<br>
<b>To:</b> <a class="moz-txt-link-abbreviated" href="mailto:dev@fdo.osgeo.org">dev@fdo.osgeo.org</a><br>
<b>Subject:</b> RE: [fdo-dev] fdo insert command<br>
</font><br>
</div>
<div><span class="250104223-17102006"><font color="#0000ff"
face="Arial" size="2">Hi Haris,</font></span></div>
<div><span class="250104223-17102006"></span> </div>
<div><span class="250104223-17102006"><font color="#0000ff"
face="Arial" size="2">Yes, the reader returned from the insert command
should return the id's of the inserted records. This is particularly
needed if the id's are auto-generated. The actual mechanism of
auto-generating new id's is up to the provider. Oracle would use
sequences, other rdbms would use autonumber or related concepts.</font></span></div>
<div><span class="250104223-17102006"></span> </div>
<div><span class="250104223-17102006"><font color="#0000ff"
face="Arial" size="2">Map expects to get this reader from every
insert. It uses this information for example to update the data table
and cached information for newly created features.</font></span></div>
<div><span class="250104223-17102006"></span> </div>
<div><span class="250104223-17102006"><font color="#0000ff"
face="Arial" size="2">To avoid having Map try to insert records
immediately with null values, change the Edit menu option for update
edits automatically to off (I don't remember the exact menu item name -
I don't have the Map ui in front of me right now, but I think it's the
first item under Edit). Then, once you finish adding the geometry and
setting the properties that you want, you can check-in the feature or
features.</font></span></div>
<div><span class="250104223-17102006"></span> </div>
<div><span class="250104223-17102006"><font color="#0000ff"
face="Arial" size="2">Thanks,</font></span></div>
<div><span class="250104223-17102006"><font color="#0000ff"
face="Arial" size="2">Orest.</font></span></div>
<blockquote dir="ltr" style="margin-right: 0px;">
<div class="OutlookMessageHeader" dir="ltr" align="left"
lang="en-us"><font face="Tahoma" size="2">-----Original Message-----<br>
<b>From:</b> Haris Kurtagic [<a class="moz-txt-link-freetext" href="mailto:haris@sl-king.com">mailto:haris@sl-king.com</a>] <br>
<b>Sent:</b> October 17, 2006 6:52 PM<br>
<b>To:</b> <a class="moz-txt-link-abbreviated" href="mailto:dev@fdo.osgeo.org">dev@fdo.osgeo.org</a><br>
<b>Subject:</b> [fdo-dev] fdo insert command<br>
<br>
</font></div>
<div><span class="593054122-17102006"><font face="Arial" size="2">Hi,</font></span></div>
<div><span class="593054122-17102006"></span> </div>
<div><span class="593054122-17102006"><font face="Arial" size="2">I
am little confused how FDO Insert Command should work, and what it
should return.</font></span></div>
<div><span class="593054122-17102006"></span> </div>
<div><span class="593054122-17102006"><font face="Arial" size="2">From
documentation I understand it should return reader with feature id's of
new records filled, for single and also for batch insert. Is this true
and necessary? Could be problem for some rdbms ?</font></span></div>
<div><span class="593054122-17102006"></span> </div>
<div><span class="593054122-17102006"><font face="Arial" size="2">Also
I don't quite understand how Map is using insert command and null
values. It seems to me that it is calling Insert command immediately
after creating new geometry without user filling Null values ?</font></span></div>
<div><span class="593054122-17102006"></span> </div>
<div><span class="593054122-17102006"><font face="Arial" size="2">All
this I am testing on foreign schema's (without fdo metadata)</font></span></div>
<div><span class="593054122-17102006"></span> </div>
<div><span class="593054122-17102006"><font face="Arial" size="2">I
hope that I put together understandable questions.</font></span></div>
<div><span class="593054122-17102006"></span> </div>
<div><span class="593054122-17102006"><font face="Arial" size="2">Haris</font></span></div>
</blockquote>
</blockquote>
<br>
</body>
</html>