Re: [mapguide-users] [ZS2] Re: Filter on joined database values

2009-01-14 Thread irwan

Kenneth,
howdy...everything is fine but,  i can't encode 'ID IN ('.$res.')'. What
should i do now

irwan wrote:
> 
> wow many thanks!! you help me a lot.
> 
> 
> Kenneth Skovhede, GEOGRAF A/S wrote:
>> 
>> This is the filter:
>> 
>> $QueryFilter='Drawing+%3D+%26apos%3B74%26apos%3B+AND+Dept+%3D+%26apos%3B136%26apos%3B'
>>  
>> 
>> For some reason the PHP xml system does not seem to autoencode the 
>> stuff, you must xml encode your input.
>> I don't know why the above is url encoded though.
>> 
>> The un-encoded filter should look like:
>> $QueryFilter = 'Drawing = "3B74" AND Dept = "3B136"'
>> 
>> The Xml encoded version should look like this:
>> $QueryFilter = 'Drawing = "3B74" AND Dept = "3B136"'
>> No expert on PHP functions, but I found this to help you out:
>> http://vantol.org/node/31
>> 
>> The $QueryFilter is the string you should change to match your list of 
>> values.
>> Build the list like this:
>> 
>> $res = '';
>> 
>> while(odbc_fetch_row($rs))
>> {
>>  $bl_id=odbc_result($rs,"bl_id");
>>  $res .= $bl_id;
>>  $res .= ',';
>> }
>> 
>> $res = substr($res, 0, -1); //Remove the last ,
>> $QueryFilter = xmlencode('ID IN ('.$res.')');
>> 
>> 
>> (Note: If the values are not integers, they have to be surrounded with 
>> quotes).
>> (Note: You filter column in the SDF may not be called ID).
>> (Note: xmlencode is the function from the link given)
>> 
>> Regards, Kenneth Skovhede, GEOGRAF A/S
>> 
>> irwan skrev:
>>>
>>> Kenneth Skovhede, GEOGRAF A/S wrote:
>>>   
 IIRC, something is broken, so you can't filter on a joined database.
 Instead, you can select keys from the database with an sql like this:
 select distinct key from table where somecolumn = 'somecriteria';

 The sql should then give you a list of keys.
 You can then set the layer filter like this:
 "ID" IN (...comma seperated key list...)
 ea: "ID" IN ('1','A')

 Regards, Kenneth Skovhede, GEOGRAF A/S


 
>>>  i really stucked! really dont have an idea to change Filter element in
>>> xml.what i want to know here is how to pass a value that i get from sql
>>> query(php) to xml?i have create a php script, a very simple one to query
>>> data from database.
>>>
>>> $wr_selected="SELECT * FROM wr WHERE bl_id = 'Rev";
>>>
>>> $rs=odbc_exec($conn,$wr_selected);
>>>
>>>
>>> while(odbc_fetch_row($rs))
>>> {
>>> $bl_id=odbc_result($rs,"bl_id");
>>> }
>>>
>>> currently $bl_id hold a value that satisfy a query. So i want this value
>>> put
>>> into the  element in xml file such as BL_ID IN
>>> $bl_id but i know this is something we cannot do.
>>> I look at this code from
>>>
>>>   
>>> $QueryFilter='Drawing+%3D+%26apos%3B74%26apos%3B+AND+Dept+%3D+%26apos%3B136%26apos%3B'
>>>  
>>>// Load the Query Match Layer Definition template into a PHP DOM
>>> object
>>> and 
>>>// modify its Filter node so we're displaying the right building and
>>> floor. 
>>>$doc = DOMDocument::load('QueryMatch.LayerDefinition.xml'); 
>>>$FilterNode = $doc->getElementsByTagName('Filter')->item(0); 
>>>$FilterNode->nodeValue = $QueryFilter; 
>>>$LayerDefinition = $doc->saveXML(); 
>>>$byteSource = new MgByteSource($LayerDefinition,   
>>> strlen($LayerDefinition)); 
>>>$byteSource->SetMimeType(MgMimeType::Xml); 
>>>$tempResourceID = new
>>> MgResourceIdentifier("Library://HumboldtFM/Layers/QueryMatch.LayerDefinition");
>>>  
>>>$resourceService->SetResource($tempResourceID,
>>> $byteSource->GetReader(),
>>> null); 
>>>
>>> but i really dont know that to do with this code. Can someone here
>>> assist
>>> me?
>>>   
>> 
>> ___
>> mapguide-users mailing list
>> mapguide-users@lists.osgeo.org
>> http://lists.osgeo.org/mailman/listinfo/mapguide-users
>> 
>> 
> 
> 

-- 
View this message in context: 
http://n2.nabble.com/invalid-XML-document-tp2149327p2161106.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] [ZS2] Re: Get Lat Long

2009-01-14 Thread ajid

Here my solution.. Thanx All  :) i forgot to targer my frame


-
::: PublicVisitor :::
www.myguidepages.com
-- 
View this message in context: 
http://n2.nabble.com/Get-Lat-Long-tp2155091p2161097.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] Name to Display

2009-01-14 Thread Jackie Ng

Hi Fabio,

Use the MgResoureService to get the xml content (GetResourceContent) for the
layer definition (of the layer in question).

Look at the  elements within. Each element will have a
 element and a  element. The  element contains the
display name for the property indicated by the  element.

- Jackie


sekko970 wrote:
> 
> Dear all,
> where can I find the "Name to Display" of a property by using server side
> API?
> 
> Thanks in advance for your help.
> Fabio
> 

-- 
View this message in context: 
http://n2.nabble.com/Name-to-Display-tp2156847p2160976.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] Query on *.mdb

2009-01-14 Thread ajid

MGOS
i have *.mdb data, then im try using queymain.aspx on sample data.. but :(
failed.. (not display d result)
any method?souce code? or edited script from sample??
Thanx

-
::: PublicVisitor :::
www.myguidepages.com
-- 
View this message in context: 
http://n2.nabble.com/Query-on-*.mdb-tp2160887p2160887.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] [ZS2] Re: Filter on joined database values

2009-01-14 Thread irwan

wow many thanks!! you help me a lot.


Kenneth Skovhede, GEOGRAF A/S wrote:
> 
> This is the filter:
> 
> $QueryFilter='Drawing+%3D+%26apos%3B74%26apos%3B+AND+Dept+%3D+%26apos%3B136%26apos%3B'
>  
> 
> For some reason the PHP xml system does not seem to autoencode the 
> stuff, you must xml encode your input.
> I don't know why the above is url encoded though.
> 
> The un-encoded filter should look like:
> $QueryFilter = 'Drawing = "3B74" AND Dept = "3B136"'
> 
> The Xml encoded version should look like this:
> $QueryFilter = 'Drawing = "3B74" AND Dept = "3B136"'
> No expert on PHP functions, but I found this to help you out:
> http://vantol.org/node/31
> 
> The $QueryFilter is the string you should change to match your list of 
> values.
> Build the list like this:
> 
> $res = '';
> 
> while(odbc_fetch_row($rs))
> {
>   $bl_id=odbc_result($rs,"bl_id");
>   $res .= $bl_id;
>   $res .= ',';
> }
> 
> $res = substr($res, 0, -1); //Remove the last ,
> $QueryFilter = xmlencode('ID IN ('.$res.')');
> 
> 
> (Note: If the values are not integers, they have to be surrounded with 
> quotes).
> (Note: You filter column in the SDF may not be called ID).
> (Note: xmlencode is the function from the link given)
> 
> Regards, Kenneth Skovhede, GEOGRAF A/S
> 
> irwan skrev:
>>
>> Kenneth Skovhede, GEOGRAF A/S wrote:
>>   
>>> IIRC, something is broken, so you can't filter on a joined database.
>>> Instead, you can select keys from the database with an sql like this:
>>> select distinct key from table where somecolumn = 'somecriteria';
>>>
>>> The sql should then give you a list of keys.
>>> You can then set the layer filter like this:
>>> "ID" IN (...comma seperated key list...)
>>> ea: "ID" IN ('1','A')
>>>
>>> Regards, Kenneth Skovhede, GEOGRAF A/S
>>>
>>>
>>> 
>>  i really stucked! really dont have an idea to change Filter element in
>> xml.what i want to know here is how to pass a value that i get from sql
>> query(php) to xml?i have create a php script, a very simple one to query
>> data from database.
>>
>> $wr_selected="SELECT * FROM wr WHERE bl_id = 'Rev";
>>
>> $rs=odbc_exec($conn,$wr_selected);
>>
>>
>> while(odbc_fetch_row($rs))
>> {
>> $bl_id=odbc_result($rs,"bl_id");
>> }
>>
>> currently $bl_id hold a value that satisfy a query. So i want this value
>> put
>> into the  element in xml file such as BL_ID IN
>> $bl_id but i know this is something we cannot do.
>> I look at this code from
>>
>>   
>> $QueryFilter='Drawing+%3D+%26apos%3B74%26apos%3B+AND+Dept+%3D+%26apos%3B136%26apos%3B'
>>  
>>// Load the Query Match Layer Definition template into a PHP DOM
>> object
>> and 
>>// modify its Filter node so we're displaying the right building and
>> floor. 
>>$doc = DOMDocument::load('QueryMatch.LayerDefinition.xml'); 
>>$FilterNode = $doc->getElementsByTagName('Filter')->item(0); 
>>$FilterNode->nodeValue = $QueryFilter; 
>>$LayerDefinition = $doc->saveXML(); 
>>$byteSource = new MgByteSource($LayerDefinition,   
>> strlen($LayerDefinition)); 
>>$byteSource->SetMimeType(MgMimeType::Xml); 
>>$tempResourceID = new
>> MgResourceIdentifier("Library://HumboldtFM/Layers/QueryMatch.LayerDefinition");
>>  
>>$resourceService->SetResource($tempResourceID,
>> $byteSource->GetReader(),
>> null); 
>>
>> but i really dont know that to do with this code. Can someone here assist
>> me?
>>   
> 
> ___
> mapguide-users mailing list
> mapguide-users@lists.osgeo.org
> http://lists.osgeo.org/mailman/listinfo/mapguide-users
> 
> 

-- 
View this message in context: 
http://n2.nabble.com/invalid-XML-document-tp2149327p2157416.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] Automatic custom javascript loading in AjaxViewer

2009-01-14 Thread Bruno Scott


Kenneth Skovhede, GEOGRAF A/S wrote:
> 
> This would load all js files for every weblayout application?
> Could this be tweaked to somehow take the WebLayout into consideration,
> so layout1 loads some files, and layout2 loads others?
> 
This is a good idea
It would be easy to mofify that code to include specific weblayout js files
Lets take for an example
library://Samples/Sheboygan/Layouts/SheboyganAsp.WebLayout
we could end up with something like this
www/
Customjs/
jsFileCommonForAllLayout.js
Samples/
Sheboygan/
Layouts/
jsFileCommonForAllSheboyganLayout.js
SheboyganAsp/
jsFileOnlyForSheboyganAsp.js
or
www/
Customjs/
jsfileCommonForAllLayout.js
Samples.Sheboygan.Layouts.jsFileCommonForAllSheboyganLayout.js
Samples.Sheboygan.Layouts.SheboyganAsp.jsFileOnlyForSheboyganAsp.js


Kenneth Skovhede, GEOGRAF A/S wrote:
> 
> The problem with including such functionality, is that there are three 
> different languages (php, jsp and aspx),
> and you will need all three versions of the code before it can be 
> included in an official release.
> 
I understand this and there is no problem writing the patch for all 3
languages


Bruno Scott
-- 
View this message in context: 
http://n2.nabble.com/Automatic-custom-javascript-loading-in-AjaxViewer-tp2156302p2156859.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] Is MGOS Version 2.2 based on FDO 3.4.0?

2009-01-14 Thread carls

I found the Beta of FDO 3.4.0 had been released.

Is MapGuide OS 2.2 compatible to FDO 3.4.0?

Thanks!

-
Regards, Carl SHE
-- 
View this message in context: 
http://n2.nabble.com/Is-MGOS-Version-2.2-based-on-FDO-3.4.0--tp2156671p2156671.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: [ZS2] Re: [mapguide-users] Get Lat Long

2009-01-14 Thread Kenneth Skovhede, GEOGRAF A/S
If you want to read the current x,y and scale, you must do it with 
javascript.

There is a reference here:
http://mapguide.osgeo.org/files/mapguide/docs/viewerapi/viewerapi.html#mapframe_getcenter

You already have three textboxes in your code, allowing the user to 
enter x,y and scale.
If you mean something else, please try to write your question with other 
words.


Regards, Kenneth Skovhede, GEOGRAF A/S



ajid skrev:

That Method X Y and scale was ready input on script

gotopoint.aspx?id = X=101.657487&Y=3.161049&Scale=26432.77 this link


So how i wanna X,Y,scale user input on 3 textfield . any idea...

-
::: PublicVisitor :::
www.myguidepages.com
  

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


Re: [mapguide-users] Automatic custom javascript loading in AjaxViewer

2009-01-14 Thread Kenneth Skovhede, GEOGRAF A/S

This would load all js files for every weblayout application?
Could this be tweaked to somehow take the WebLayout into consideration,
so layout1 loads some files, and layout2 loads others?

The problem with including such functionality, is that there are three 
different languages (php, jsp and aspx),
and you will need all three versions of the code before it can be 
included in an official release.


If you are considering advanced customization/expansion, the Fusion 
framework is much more flexible,

and can handle something like this already, through the use of widgets.
I would like to encourage you to try switching to this framework instead.

Regards, Kenneth Skovhede, GEOGRAF A/S



Bruno Scott skrev:

I propose a new enhencement to the AjaxViewer, the ability to the ajaxviewer
to automatically include javascript files at load time

In mainframe.aspx
...
//Scans the customjs directory for custom client javascript files
String clientJSInclude = "";
String strExt = "*.js";
String strPath = Request.PhysicalApplicationPath + "..\\customjs";
try
{
  String[] files = Directory.GetFiles(strPath, strExt,
SearchOption.TopDirectoryOnly);
  foreach(String file in files)
  {
clientJSInclude += "\n";
  }
}
catch(Exception e){}

//load the HTML template and format it

//
String template = MgLocalizer.Localize(LoadTemplate(Request,
"../viewerfiles/mainframe.templ"), locale, GetClientOS(Request));
String[] args = {
webLayout.GetTitle(),
clientJSInclude,
...

In mainframe.templ
Just add un new %s after the existing 

Re: [mapguide-users] Mapguide Localization

2009-01-14 Thread Kenneth Skovhede, GEOGRAF A/S
I think you should ask Autodesk directly, as they hold the potential 
copyright for the files, and are the only ones who has the answer.
I can see many reasons that would cause an Autodesk employee to refrain 
from answering such a question publicly.


Regards, Kenneth Skovhede, GEOGRAF A/S



Bruno Scott skrev:

I think this is a very important question and i didn't get any response yet.

Bruno
  

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


Re: [ZS2] Re: [mapguide-users] Filter on joined database values

2009-01-14 Thread Kenneth Skovhede, GEOGRAF A/S

This is the filter:

$QueryFilter='Drawing+%3D+%26apos%3B74%26apos%3B+AND+Dept+%3D+%26apos%3B136%26apos%3B' 

For some reason the PHP xml system does not seem to autoencode the 
stuff, you must xml encode your input.

I don't know why the above is url encoded though.

The un-encoded filter should look like:
$QueryFilter = 'Drawing = "3B74" AND Dept = "3B136"'

The Xml encoded version should look like this:
$QueryFilter = 'Drawing = "3B74" AND Dept = "3B136"'
No expert on PHP functions, but I found this to help you out:
http://vantol.org/node/31

The $QueryFilter is the string you should change to match your list of 
values.

Build the list like this:

$res = '';

while(odbc_fetch_row($rs))
{
$bl_id=odbc_result($rs,"bl_id");
$res .= $bl_id;
$res .= ',';
}

$res = substr($res, 0, -1); //Remove the last ,
$QueryFilter = xmlencode('ID IN ('.$res.')');


(Note: If the values are not integers, they have to be surrounded with 
quotes).

(Note: You filter column in the SDF may not be called ID).
(Note: xmlencode is the function from the link given)

Regards, Kenneth Skovhede, GEOGRAF A/S

irwan skrev:


Kenneth Skovhede, GEOGRAF A/S wrote:
  

IIRC, something is broken, so you can't filter on a joined database.
Instead, you can select keys from the database with an sql like this:
select distinct key from table where somecolumn = 'somecriteria';

The sql should then give you a list of keys.
You can then set the layer filter like this:
"ID" IN (...comma seperated key list...)
ea: "ID" IN ('1','A')

Regards, Kenneth Skovhede, GEOGRAF A/S




 i really stucked! really dont have an idea to change Filter element in
xml.what i want to know here is how to pass a value that i get from sql
query(php) to xml?i have create a php script, a very simple one to query
data from database.

$wr_selected="SELECT * FROM wr WHERE bl_id = 'Rev";

$rs=odbc_exec($conn,$wr_selected);


while(odbc_fetch_row($rs))
{
$bl_id=odbc_result($rs,"bl_id");
}

currently $bl_id hold a value that satisfy a query. So i want this value put
into the  element in xml file such as BL_ID IN
$bl_id but i know this is something we cannot do.
I look at this code from

  
$QueryFilter='Drawing+%3D+%26apos%3B74%26apos%3B+AND+Dept+%3D+%26apos%3B136%26apos%3B' 
   // Load the Query Match Layer Definition template into a PHP DOM object
and 
   // modify its Filter node so we're displaying the right building and
floor. 
   $doc = DOMDocument::load('QueryMatch.LayerDefinition.xml'); 
   $FilterNode = $doc->getElementsByTagName('Filter')->item(0); 
   $FilterNode->nodeValue = $QueryFilter; 
   $LayerDefinition = $doc->saveXML(); 
   $byteSource = new MgByteSource($LayerDefinition,   
strlen($LayerDefinition)); 
   $byteSource->SetMimeType(MgMimeType::Xml); 
   $tempResourceID = new
MgResourceIdentifier("Library://HumboldtFM/Layers/QueryMatch.LayerDefinition"); 
   $resourceService->SetResource($tempResourceID, $byteSource->GetReader(),
null); 


but i really dont know that to do with this code. Can someone here assist
me?
  
___
mapguide-users mailing list
mapguide-users@lists.osgeo.org
http://lists.osgeo.org/mailman/listinfo/mapguide-users


Re: [mapguide-users] Mapguide Localization

2009-01-14 Thread Bruno Scott

I think this is a very important question and i didn't get any response yet.

Bruno
-- 
View this message in context: 
http://n2.nabble.com/Mapguide-Localization-tp1819323p2156316.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] Automatic custom javascript loading in AjaxViewer

2009-01-14 Thread Bruno Scott

I propose a new enhencement to the AjaxViewer, the ability to the ajaxviewer
to automatically include javascript files at load time

In mainframe.aspx
...
//Scans the customjs directory for custom client javascript files
String clientJSInclude = "";
String strExt = "*.js";
String strPath = Request.PhysicalApplicationPath + "..\\customjs";
try
{
  String[] files = Directory.GetFiles(strPath, strExt,
SearchOption.TopDirectoryOnly);
  foreach(String file in files)
  {
clientJSInclude += "\n";
  }
}
catch(Exception e){}

//load the HTML template and format it
//
String template = MgLocalizer.Localize(LoadTemplate(Request,
"../viewerfiles/mainframe.templ"), locale, GetClientOS(Request));
String[] args = {
webLayout.GetTitle(),
clientJSInclude,
...

In mainframe.templ
Just add un new %s after the existing 

Re: [mapguide-users] Get Lat Long

2009-01-14 Thread irwan

you can easily create a script with 3 textfield, then pass the x,y and scale
value to gotopoint.aspx.. declare them as a variable rather than hold a
static value.


ajid wrote:
> 
> That Method X Y and scale was ready input on script
> 
> this
> link 
> 
> So how i wanna X,Y,scale user input on 3 textfield . any idea...
> 

-- 
View this message in context: 
http://n2.nabble.com/Get-Lat-Long-tp2155091p2155696.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] Get Lat Long

2009-01-14 Thread ajid

That Method X Y and scale was ready input on script

gotopoint.aspx?id = X=101.657487&Y=3.161049&Scale=26432.77 this link


So how i wanna X,Y,scale user input on 3 textfield . any idea...

-
::: PublicVisitor :::
www.myguidepages.com
-- 
View this message in context: 
http://n2.nabble.com/Get-Lat-Long-tp2155091p2155606.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