Secure Map Rendering - Javascript API

Hello All
I need to apply secure mapping functionality using Mapviewer’s JavaScript based API.Is it possible using cookie ?.Can you please give an example for this?
Thank you

Thanks for your prompt reply
I do following things for secure rendering a map
1) First created a SQL package
CREATE OR REPLACE PACKAGE BODY web_user_info
AS
w_name VARCHAR2 (32767);
PROCEDURE set_user (p_name IN VARCHAR2)
AS
BEGIN
insert into test(testcol) values(1);
commit;
w_name := LOWER (p_name);
END;
PROCEDURE clear_user
AS
BEGIN
insert into test(testcol) values(2);
commit;
w_name := null;
END;
FUNCTION get_user
RETURN VARCHAR2
AS
BEGIN
--insert into test(testcol) values(3);
--commit;
RETURN w_name;
END;
END;
2) Then I created a view for my spatial table .
CREATE OR REPLACE FORCE VIEW nb_view (node_name,
src_file,
mi_style,
geom,
mv_style,
status,
account_mgr
AS
SELECT "NODE_NAME", "SRC_FILE", "MI_STYLE", "GEOM", "MV_STYLE", "STATUS",
"ACCOUNT_MGR"
FROM node_boundary
WHERE account_mgr = web_user_info.get_user;
After that I created theme *(THEME_NB)* using this view
3) And My Mapviewer configuration settings as like below
<map_data_source name="mvtest"
jdbc_host="192.168.5.120"
jdbc_sid="sbcsptl"
jdbc_port="1521"
jdbc_user="mvtest"
jdbc_password="HUBA8JhmUr15xuA9gRFnvT6iXhCyYcrQ"
jdbc_mode="thin"
number_of_mappers="3"
allow_jdbc_theme_based_foi="true"
plsql_package="web_user_info"
web_user_type="MON_USER"
/>
4) Finally my Cookie is settings as like below
<script language="Javascript">
var mapview;
var basemap1 = new MVMapTileLayer("MVTEST.TILE_NB");
var basemap2 = new MVThemeBasedFOI('basemap2', 'MVTEST.THEME_NB');
function showMap() {
set_cookie ( "MON_USER", "kk" );
var baseURL = "http://192.168.5.116:7101/mapviewer";
var mpoint = MVSdoGeometry.createPoint(1968376.0, 770568.7, 41129);
mapview = new MVMapView(document.getElementById("map"), baseURL);
mapview.addMapTileLayer(basemap1);
mapview.addThemeBasedFOI(basemap2);
mapview.setCenter(mpoint);
mapview.setZoomLevel(2);
mapview.display();
mapview.addNavigationPanel();
function set_cookie ( name, value, secure )
var cookie_string = name + "=" + escape ( value );
secure="secure";
if ( secure )
cookie_string += "; secure";
document.cookie = cookie_string;
</script>
The issue in my case, set_user and clear_user is not executed properly.
Thank You

Similar Messages

  • Secure Map Rendering on Javabean based API

    Hi,
    I need to apply secure mapping functionality using Mapviewer’s JavaBean based API. I’ve created a secure data source by adding the plsql_package="web_user_info" statement on the data source definition. For testing purposes I’ve used mvdemo data set and followed the steps of Secure Map Rendering Demo. I created "web_user_info" package on mvdemo schema as well as a view on CUSTOMERS table (create or replace view customers_view as select * from customers where account_mgr = web_user_info.get_user) and a geometry theme: mycystomers on that view.
    I also added the appropriate authenticated web users to the OC4J container(e.g. alex) and assigned them the "users" role.
    Finally I included the relative path of JSP Demo (with mapclient lib) that resides at http://server:port/mapviewer/demo/mapinit.jsp to the <security-constraint> element of web.xml file so that the data source can get the web user name from J2EE user:
    <!-- For Secure Map Rendering demos only -->
    <security-constraint>
    <web-resource-collection>
    <web-resource-name>Secure mapping demo page</web-resource-name>
    <description>MapViewer secure map rendering demo</description>     
         <url-pattern>/demo/secure-mapping.html</url-pattern>
         <url-pattern>/demo/mapinit.jsp</url-pattern>
         <url-pattern>/demo/map.jsp</url-pattern>
    </web-resource-collection>
    <auth-constraint>
    <role-name>secure_maps_role</role-name>
    </auth-constraint>
    </security-constraint>
    After authenticating to the http://server:port/mapviewer/demo/mapinit.jsp JSP demo through mapviewer's login page that was automatically generated because of the security-constraint, I filled in the required fields asking for base map: demo_map. I also modified "demo_map" by adding "mycustomers" theme to it. Unlike Oracle Maps Map Rendering Demo (http://server:port/mapviewer/demo/secure-mapping.html) that displays only those customers that belong to the authenticated user, the generated map does not display any customer data at all.
    Does Secure Map Rendering Demo apply just for the Oracle Maps Javascript API and the XML API or is there any other parameter that I’m missing and needs to be configured in order for it to run for the JavaBean based API as well?
    Any help on the above matter would be really appreciated.
    Thanks in advance.

    Hi,
    The reason the JSP files did not show the secured customers, is because while you authenticated to the J2EE server when accessing these JSP files, the JSP file themselves did not authenticate to the J2EE server. In other words, there are two sessions involved. One session is between your browser and the J2EE server, which contains the authenticated user ID. This session is initiated when you try to open the mapinit.jsp page.
    The other session is established when the JSP page (map.jsp) opens a new HTTP Connection to the server to send the XML map request generated from various JavaBean API calls. To be more specific, when the JSP page invokes MapViewer.run(), this method internally gathers all the themes/basemaps you have added to the client handle, then constructs a single XML map request out of these pieces of information. It then opens a HTTP connection back to the same server to send the XML doc to mapviewer for processing. The problem is that to the J2EE server this is a new session (initiated by map.jsp), and it does not contain any authentication info.
    Because currently the JavaBean API does not support setting a cookie or user credential directly on its internal Http connections, there seems to be no easy work around for this issue for now. Please contact us offline if you would like to open an enhancement request.
    Thanks
    LJ

  • Secure map rendering and the tile server

    Hi all,
    The demos for secure map rendering that I've seen e.g. mapviewer.ear/web.war/demo/secure-mapping.html involve sending an XML map request directly to mapviewer, and they work OK.
    However when I use a MVMapView JavaScript object and just pull back map tiles (no FOI), I see clear_user() being called but not set_user(). In other words my tiles are not being built securely. I don't see anything in the debug listing the values of cookies. Before I dig any deeper is secure map rendering expected to work with the tile server? Does the tile server know in such a case not to cache the tiles since one user's tile may contain different information than another user's view of the same tile?
    When pulling back FOIs with a MVMapView I do see debug info about the values of cookies, and the username is stated correctly in the debug. But still set_user() is not called! I'm sure that at least FOIs should be queried securely???
    BTW this is MapViewer 11gR1.
    Thanks
    Al

    Currently users and roles are not used when rendering tiles.

  • Map Builder JavaScript API

    Hello everybody,
    I'm a student who is currently working with Oracle for the first time. I developed an Web mapping application by using Oracle XE Database (10g), Oracle Map Viewer and corresponding Map Builder (the latest version). I choose the JavaScript API for the implementation of this application.
    The reason for this post is one particular problem that I encountered. I want to extract the X and Y coordinates (which are naturally stored as SDO_GEOMETRY in my database) for certain features that are visible in my map window (this features belong to themebasedFOIs). I know that the x and y coordinates (and other attribs) are easily accessible for the JavaScript Client if the coordinates are stored in own columns (additionally to the information stored in the SDO_GEOMETRY) ... but that is not the case!
    I searched the JavaScript API, the Internet, this forum and it took me a long time ... but I didn't come across any possiblity to manage this. So does anybody who reads this post see a possibility to get my X and Y coordinates from my HTML application that is build with JavaScript API???
    I will be very thankful for any advices and/or hints... :-)
    With regards

    hi, we don't return the geometry back to the client unless the foi is a point.

  • Get Direction Map using Mapviewer Javascript API

    Hello Gurus,
    I have coordinate information for a route which I got using routing engine. Now, my requirement is to get map (Similar to eLocation GetDirection map) which can show routing curve in map. Using Javascript API, how can I achieve this?
    If I am not not wrong, I will have to create new FOI with MVSdoGeometry, but I am not sure about how to create MVSdoGeometry for the lat-lang I have which will display a curve?
    Thanks in advance.
    -Hardik

    Currently you can not add zooming event listener. We'll support it in the next release.

  • Displaying a theme-based FOI layer as a whole image with javascript API v2

    Hi,
    I have looked the Oracle maps V2 tutorial developed in mvdemo.war application provided with Oracle Mapviewer v11.1.1.7. I have looked how to use theme-based FOI layers and I have not found how to set the "whole image" property for these layers. This feature is present in javascript API V1 and it greatly improves application performance. Our applications use this property very often.
    Is this property present in javascript API V2 but not documented?
    If it's not present, do you know if it will be?
    How can we show a layer with many geometry features and obtain the same performance we have now with the whole image property?
    Thanks,
    Arturo

    Hi,
    since this is a very crucial feature for us I'm very interested in that functionality as well. Is there a comparable functionality in the V2 API or will it be available in feature releases?
    Thanks
    Dominik

  • Flash security settings in javascript

    hello all -   (newbie here)
    is there a way i can read the flash player camera/microphone security settings from javascript?
    i need to be able to determine from jscript if somebody selected "allow" or "deny" for the camera/microphone.
    also, is there a way in jscript i can determine when somebody hits the "close" button in the security question popup?
    i am playing around with the html object-map-coords tags but that does not seem to be working.
    or even better:  can i determine via javascript when somebody hits the "close" button after answering the security questions?
    NOTE:  i dont have any access to the action-script.
    thank you!

    I don't kknow of any easy/automatic way to do it, but It can
    be faked...
    You can put the javascript on the html page calling on the
    flash file. Inside the flash file use a preloader to determine when
    the page is fully loaded. Then instead of just playing the movie
    put in a
    getURL("javascript:name();");
    function to call the javascript once the page is fully
    loaded.
    This will do what you want. However thanks to new flash
    security it probably will not work until you publish the file to a
    server. There may be an easier way but I don't know it.

  • How to add a polygon to mapviewer using Javascript API

    Hi,
    I am using JavaScript API for the MapViewer.
    Using redlining tool, my application allows user to draw polygon onto the map.
    I would like to have union, difference and intersect tools. I know the back end logic can be done using using JTS or SDO_Union, SDO_difference, and SDO_intersection. but how do i display the result polygon on the map? Note that I am not going to store the polygon in the database.
    Thanks for any ideas.

    Hi,
    If I understand well you are using Oracle Maps. User do some redlining, then you somehow makes FOI polygons. Then you get the coordinates of the polygons and send them to the back-end where you can use spatial functions and get the coordinates of the new polygon.
    You can store those coordinates in i.e. hidden input field on page (if you use JSF it is very simple) and then use JavaScript to parse them and Oracle Maps API to create new FOI polygon and add it to mapviewer object. One disadvantage of this concept is that reloading of page (submit) is necessary.
    Branislav

  • How to trigger the automated row fetch process and open modal window by javascript api?

    Hi,
    I would like to click the one row of column of IR report, to open the modal window of current page.  <----------------it is ok. I can use "javascript:openModal('windowID')"  to do it.
    There is one form in this modal window, Meanwhile, I would like to pass column data to this form.    <--------------------- it is ok also. I can use " $s('P7_ID','column_value');" to do it.
    But I don't know how to trigger the "automated row fetch" process of this form to retrieve other field's value in this form.   
    I tried to use following 2 ways. But failed.
    First method:
    add one ajax process of "automated row fetch" in "page processing" block, named "get_fetch_data"
    when click IR column , call "openModal", and call  "apex.server.process ( "get_fetch_data", {}, { success: function( pData ) { }  } );"  , I tried to call above ajax process to refresh form. It is failed.
    Second method:
    add one process of  "automated row fetch" in "page rendering" block, named "get_fetch_data"
    when click IR column, call javascript api "apex.submit" to submit current page , then call "openModal".
    such as :  javascript:apex.submit({request:'MODIFY',set:{'P7_ID': #ID#}}); openModal('trade');
    But it is failed also. the modal page is showed firstly. then page refresh. but modal window will not open again.
    I am not sure if my thinking is right. Could you please provide any suggestion?
    Thanks in advance,
    Ping

    Hi Ping,
    You can try to set the session state of your modal page's primary key before opening the modal page. Use one dynamic action (on click of IR row) with two true actions. First one to set session state of modal page pk, second on to open modal page.
    Or you can add the modal page url as link in your report by extending your query:
    select ...
    ,         apex_util.prepare_url( 'f?p='||:APP_ID||':7:'||:APP_SESSION||'::'||:DEBUG||':7:P7_ID'||COLUMN_VALUE ) as link
    from ...
    This will give you the url of the modal page, with set primary key.
    Regards,
    Vincent Deelen
    http://vincentdeelen.blogspot.com

  • Office 365 addin. JavaScript API. Working with files.

    Please help me.
    Is there any posibility to get url for created document from my addin with JavaScript API?
    May be I need to use OneDrive.

    You are creating a Word 2013 app? If so, you might want to post your question here:
    https://social.msdn.microsoft.com/Forums/en-US/home?forum=officegeneral
    Are you trying to get the URL that the document was opened from?
    Mike Smith TechTrainingNotes.blogspot.com
    Books:
    SharePoint 2007 2010 Customization for the Site Owner,
    SharePoint 2010 Security for the Site Owner

  • Javascript API and server-generated URLs

    I'm creating a Shopify site for a client and part of the site is a complex Adobe Edge Animate animation. Shopify uses server-generated paths to files. My animation uses images and audio.
    It looks like the animation sets a base path set in the Publish settings then it sets everything itself in the Javascript runtime and associated files. With Shopify, I end up with image URLs that are like this one: "cdn//path//image.gif?234324". I don't have a absolute path with an absolute file name.
    Does anyone know of a way I can put these specific unique server-generated paths to the files needed for my animation in the files for my animation? Basically, can I customize and control the entire URL to all the files needed for my animation?
    I see how I can put any URL for assets in the edge.js file. My bigger problem, I think, is being able to customize the URLs for the edge.js and edgeActions.js files.
    If anyone has any ideas, I'd really, really appreciate it!

    I am getting close on this!  I'm hoping someone can help me figure out the last step.
    I am using an iframe and sandbox method to load the swf video player like this:
    <iframe id="playerFrame" src="player.html" sandboxRoot="http://localhost/air/" documentRoot="app:/"></iframe>
    So now the JavaScript API for the player actually works in player.html.   The BIG problem is that the videos are downloaded to the app-storage directory.  Well, based on AIR security, the iframe (non-application sandbox) content cannot access the application storage directory.  So now only videos that are in the app:/ location will load.  Unfortunately, this application downloads video from a central server and places them in the application storage directory.  Security also will not allow me to download to the app directory.  So I am in an endless circle!
    I can't use the API if I am in the application sandbox because there is no domain (sandboxRoot) available.
    The API works in the non-application sandbox, but I can't access the downloadable content.
    What am I missing here?  Surely, people have needed to interact with a SWF file using JavaScript and load dynamic content at the same time.

  • Local Javascript API and AIR

    I'm having a hard time describing this problem, but I'll try...
    Is there anything I can do to allow Adobe AIR to load a JavaScript API to interact with JW Player (longtailvideo.com)?  The API already exists, and I can port my AIR code over to an HTML page on my server and it works fine.   Longtail support boards say that the API will not load locally (either locally on a folder OR "locally" in an AIR app).  They said it is a restriction of Flash.  Is this correct?  I did put my HTML files on my desktop and the API did NOT load.  It only seems to load when I put it on my server and run it on a domain.
    I assume this is somehow related to security. JavaScipt cannot interact with Flash unless it is on a domain?  Is that correct?
    I can get the player to load and play video just fine in AIR.  However, the API never loads, so I cannot interact with it.
    This is the last piece of a very LONG project I have been working on, so any help would be greatly appreciated!    Is it possible to get AIR to "pretend" it is on a URL?  I tried referencing files with app:/, and that had no impact.

    I am getting close on this!  I'm hoping someone can help me figure out the last step.
    I am using an iframe and sandbox method to load the swf video player like this:
    <iframe id="playerFrame" src="player.html" sandboxRoot="http://localhost/air/" documentRoot="app:/"></iframe>
    So now the JavaScript API for the player actually works in player.html.   The BIG problem is that the videos are downloaded to the app-storage directory.  Well, based on AIR security, the iframe (non-application sandbox) content cannot access the application storage directory.  So now only videos that are in the app:/ location will load.  Unfortunately, this application downloads video from a central server and places them in the application storage directory.  Security also will not allow me to download to the app directory.  So I am in an endless circle!
    I can't use the API if I am in the application sandbox because there is no domain (sandboxRoot) available.
    The API works in the non-application sandbox, but I can't access the downloadable content.
    What am I missing here?  Surely, people have needed to interact with a SWF file using JavaScript and load dynamic content at the same time.

  • PDF embedding & Acrobat's JavaScript API

    Hello,
    I have two questions.
    I currently using Safari 1.3.2 and Acrobat Reader 7.0.9 to test an PDF document embedded in a Web page. In Safari 1.3.2 I get a "This operation is not allowed" warning when the HTML object element and the embed element are encountered.
    I have also tested it in Safari 3.0 on Windows, with plug-ins enabled in the Preferences and Acrobat Reader 8 installed. The PDF file is not shown and no warning is given either.
    So, does Safari 2.0 support embedding PDF files at all?
    My other question is, assuming Safari does support PDF embedding, whether it is possible to interface from an HTML page to the Acrobat plug-in via Acrobat's JavaScript API. In IE this is a simple as getting the object element by id and for example, invoking its Print() method. Is this possible in Safari?
    Thank you in advance,
    Adal Fraile

    Hello,
    I have two questions.
    I currently using Safari 1.3.2 and Acrobat Reader 7.0.9 to test an PDF document embedded in a Web page. In Safari 1.3.2 I get a "This operation is not allowed" warning when the HTML object element and the embed element are encountered.
    I have also tested it in Safari 3.0 on Windows, with plug-ins enabled in the Preferences and Acrobat Reader 8 installed. The PDF file is not shown and no warning is given either.
    So, does Safari 2.0 support embedding PDF files at all?
    My other question is, assuming Safari does support PDF embedding, whether it is possible to interface from an HTML page to the Acrobat plug-in via Acrobat's JavaScript API. In IE this is a simple as getting the object element by id and for example, invoking its Print() method. Is this possible in Safari?
    Thank you in advance,
    Adal Fraile

  • How can i use  a adf javascript api

    hi
    can i use the adf javascript api for creating the AdfRichInputText .is there any producer
    to create the AdfRichTextInputText in javascript .plz guide me
    Thanks and Regard
    Message was edited by:
    Prapan Sol

    Hi,
    the ADF JavaScript API is not meant for you to create JSF components on the fly. For this you please use teh ADF Facesserver side components.
    The RichInputText component is defined by a pair of components, the AdfRichInputText and its Peer component. I don't know what your usecase is, but my impression is you are looking at it from the wrong end
    Frank

  • Getting error when updating the JavaScript API for Office and manifest schema files in your Visual Studio project from version 1.0 to 1.1

    Hi,
    I`m getting error message like "None of the apps in your project can be activated in the target. The manifest file of one or more apps contain API sets or Office applications that are not supported by
    the target Office client. To debug those apps, update manifest files to exclude any unsupported API sets or Office applications, and then start the project again. Alternatively, you can debug your apps by using Office 365 as a target." when when
    updating the JavaScript API for Office and manifest schema files in your Visual Studio project from version 1.0 to 1.1 in manifest file though i have added host elements.
    any help in this regard is highly appreciated
    Thanks,
    Santosh Sutar  

    Hi Satosh Sutar,
    Based on the description, you got the error message when you update the apps from version 1.0 to 1.1.
    From the error message, it seems the menifest include some settings no allowed in the new version. Would you mind sharing more detail about how you update the project?
    And here is an article about updating apps for Office and menifest schema files in the project for your reference:
    How to: Update the JavaScript API for Office and manifest schema files in your Visual Studio project from version 1.0 to 1.1
    Regards & Fei
    We are trying to better understand customer views on social support experience, so your participation in this interview project would be greatly appreciated if you have time. Thanks for helping make community forums a great place.
    Click
    HERE to participate the survey.

Maybe you are looking for