|
POST
|
We're obliged to support IE 9, at least until the end of the year.
... View more
08-28-2015
11:55 AM
|
0
|
0
|
4036
|
|
POST
|
Thanks, we'll give it a try. I haven't needed a proxy page set up for very many things, and I'm surprised how few resources I've found for examples. I guess most people must be using the files from gitHub as-is, except for their serverUrls.
... View more
08-28-2015
11:45 AM
|
0
|
3
|
4036
|
|
POST
|
I'm thinking in a circle here. If I have my application and proxy configuration deployed on appserver.com and my gis services on gisserver.com, when I edit my proxy.config file to tighten the security. then allowReferers would be to "gisserver.com" , wouldn't it? Or am I telling the GIS server to only allows requests from the application server?
... View more
08-28-2015
11:32 AM
|
0
|
9
|
6634
|
|
POST
|
I am also curious to know of other people's experiences with this type of code scan. My problem is the explanation of it isn't really enough to satisfy that its existence isn't a security risk.
... View more
08-28-2015
11:15 AM
|
0
|
0
|
1086
|
|
POST
|
We have a product called Veracode that is used to review our code for security leaks. It isn't typically run against an HTML/JS, but for this project, it's written largely in .NET with just a section of HTML/JS for a map. Because the project is hosted on an application server, we set up a standard proxy configuration file. The software scan is generating several 'medium' level security risks, mostly related to cross site scripting, I think solely because we have this proxy configuration to reference the map services. I think this is all fine, because the whole point of the proxy is to allow the application and AGS server to communicate properly, but that's not official enough to satisfy our customers. "Because ESRI provides this as a sample" apparently doesn't cut it. I don't know exactly what I"m looking for here, but I need something maybe more technical that explains that what the proxy configuration is doing is limited in scope in what traffic is allowed and not a gaping hole into our network?
... View more
08-28-2015
07:31 AM
|
0
|
2
|
3459
|
|
POST
|
It was set to none in the original sitePen as well, and commenting that out didn't help me. I also realized that the field I was using for ID wasn't numeric. I know that's not going to work. I switched it to use the index as the ID instead, but still no luck.
... View more
08-27-2015
02:02 PM
|
0
|
1
|
2101
|
|
POST
|
Yeah, it's pretty common to see OnDemandGrid be used as Grid, so I did something similar when I required OnDemandList. I've had issues with several of the options for select/combobox/filteringselect not working across all platforms, so I'm always looking for alternatives. I've had good luck with OnDemandGrid, so I figured I'd take OnDemandList for a spin too.
... View more
08-27-2015
01:44 PM
|
0
|
1
|
2101
|
|
POST
|
I am using this example from SitePen that create an onDemandList to like a select. <!DOCTYPE html>
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8">
<meta http-equiv="X-UA-Compatible" content="IE=7, IE=9, IE=10">
<meta name="viewport" content="initial-scale=1, maximum-scale=1,user-scalable=no"/>
<title>Sitepen Sample</title>
<link rel="stylesheet" href="https://community.esri.com//js.arcgis.com/3.13/dijit/themes/claro/claro.css"/>
<link rel="stylesheet" type="text/css" href="https://community.esri.com//js.arcgis.com/3.13/esri/css/esri.css"/>
<!-- Based on http://dgrid.io/tutorials/0.4/drop_down/ -->
<style type="text/css">
.mySelect {
border: 1px solid #b5bcc7;
background-color: #fff;
width: 200px;
height: 17px;
position: relative;
padding: 0;
}
.mySelect .label {
line-height: 17px;
vertical-align: middle;
}
.mySelect .arrow {
position: absolute;
top: 0;
right: 0;
background-image: url("//ajax.googleapis.com/ajax/libs/dojo/1.10.3/dijit/themes/claro/form/images/commonFormArrows.png");
background-position: -35px 70%;
background-repeat: no-repeat;
width: 16px;
height: 16px;
border: 1px solid #fff;
border-top: none;
background-color: #efefef;
}
.mySelect .dgrid {
cursor: default;
display: none;
position: absolute;
top: 17px;
left: -1px;
height: auto;
max-height: 20em;
width: 100%;
}
.mySelect .dgrid-scroller {
position: relative;
}
.mySelect .opened {
display: block;
}
</style>
<script type="text/javascript">
window.dojoConfig = {
async: true,
parseOnLoad:false
};
</script>
<script type="text/javascript" src="//js.arcgis.com/3.13compact"></script>
<script type="text/javascript">
require([
'dojo/_base/declare',
'dojo/on',
'dgrid/OnDemandList',
'dgrid/Selection',
"dojo/store/Memory",
'dojo/dom',
'dojo/dom-construct',
'dojo/dom-class',
'dojo/query',
'dojo/domReady!'
], function(declare, on, List, Selection, Memory, dom, domConstruct, domClass, query) {
var DropDown = declare([ List, Selection ]);
var store = new Memory({
idProperty: 'id',
data: [
{ id: 0, name: 'One', value: 1 },
{ id: 1, name: 'Two', value: 2 },
{ id: 2, name: 'Three', value: 3 },
{ id: 3, name: 'Four', value: 4 }
]
});
function renderItem(item) {
var divNode = domConstruct.create('div');
domConstruct.place(document.createTextNode(item.name), divNode);
return divNode;
}
var dropDown = new DropDown({
selectionMode: 'single',
store: store,
renderRow: renderItem
});
domConstruct.place(dropDown.domNode, 'select');
dropDown.startup();
var open = false;
function toggle(state) {
open = typeof state !== 'undefined' ? state : !open;
domClass.toggle(dropDown.domNode, 'opened', open);
}
on(dom.byId('select'), '.button:click', function () {
toggle();
});
var label = query('.label', dom.byId('select'))[0];
dropDown.on('dgrid-select', function (event) {
var node = renderItem(event.rows[0].data);
domConstruct.place(node, label, 'only');
toggle(false);
});
});
</script>
</head>
<body class="claro">
<div id="select" class="mySelect">
<div class="label button">Label</div>
<div class="arrow button"></div>
</div>
</body>
</html> Instead I need to use the results of my queryTask as th source for the data. This doesn't display anything. I think my problem is getting the data/Memory formatted correctly so the List knows how to interpret it. Perhaps in my renderItem function. <!DOCTYPE html>
<html lang="en">
<head>
<meta http-equiv="Content-Type" content= "text/html; charset=utf-8">
<meta http-equiv="X-UA-Compatible" content="IE=edge">
<meta name="viewport" content= "width=device-width, initial-scale=1.0">
<title>dGrid OnDemandList from QueryTask</title>
<link rel="stylesheet" href="https://js.arcgis.com/3.13/dijit/themes/claro/claro.css"/>
<link rel="stylesheet" type="text/css" href= "//js.arcgis.com/3.13/esri/css/esri.css">
<style type="text/css">
#sidebar {
margin: 10px;
}
.mySelect {
border: 1px solid #b5bcc7;
background-color: #fff;
width: 200px;
height: 20px;
position: relative;
padding: 0;
}
.mySelect .label {
line-height: 17px;
vertical-align: middle;
font-size: 1em;
font-weight: normal;
color: #000000;
}
.mySelect .arrow {
position: absolute;
top: 0;
right: 0;
background-image: url("//ajax.googleapis.com/ajax/libs/dojo/1.10.3/dijit/themes/claro/form/images/commonFormArrows.png");
background-position: -35px 70%;
background-repeat: no-repeat;
width: 16px;
height: 16px;
border: 1px solid #fff;
border-top: none;
background-color: #efefef;
}
.mySelect .dgrid {
cursor: default;
display: none;
position: absolute;
top: 17px;
left: -1px;
height: 20em;
width: 100%;
}
.mySelect .dgrid-scroller {
position: relative;
}
.opened {
display: block;
height: 10em;
}
</style>
</head>
<body class="claro">
<script type="text/javascript">
var djConfig = {
parseOnLoad: false,
async: true
};
</script>
<script type="text/javascript" src="//js.arcgis.com/3.13compact">
</script>
<script type="text/javascript">
var pathName = "https://ogitest.oa.mo.gov";
require(['dojo/parser', 'dojo/query', 'dojo/on', 'dojo/dom', 'dojo/dom-class', 'dojo/dom-construct',
'dojo/_base/array', 'esri/tasks/QueryTask', 'esri/tasks/query', "dojo/_base/declare",
'dojo/store/Memory', 'dgrid/OnDemandList', 'dgrid/Selection',
'dojo/domReady!'],
function(parser, query, on, dom, domClass, domConstruct, arrayUtils, QueryTask, Query, declare,
Memory, List, Selection){
parser.parse();
// create list from provider table
function populateProviderList(){
var queryTask = new QueryTask(pathName + '/arcgis/rest/services/DSS/medProvider/MapServer/2');
var queryParams = new Query();
queryParams.outFields = ["*"];
queryParams.where = "1=1";
queryParams.returnGeometry = false;
queryTask.on('complete', providerResultsHandlerGrid);
queryTask.on('error', errorHandler);
queryTask.execute(queryParams);
}
function errorHandler(err){
console.log("error on populate Dropdown, queryTask, error: " + err.details);
}
function providerResultsHandlerGrid(results){
var DropDown = new declare([List, Selection]);
var data = arrayUtils.map(results.featureSet.features, function(feature){
return {
"id": feature.attributes['ID_PROV_TYPE_PK'],
"name": feature.attributes['TX_PROV_DESC'],
"value": feature.attributes['ID_PROV_TYPE_PK']
};
});
var currentMemory = new Memory({
data: data,
idProperty: 'id'
});
var dropDown = new DropDown({
selectionMode: 'single',
store: currentMemory,
renderRow: renderItem
});
domConstruct.place(dropDown.domNode, 'select');
dropDown.startup();
var open = false;
var label = query('.label', dropDown.domNode[0]);
on(dom.byId('select'), '.button:click', function(){
toggle();
});
on(dropDown, 'dgrid-select', function(event){
var node = renderItem(event.rows[0].data);
domConstruct.place(node, label, 'only');
toggle(false);
});
}
function toggle(state){
open = typeof state !== 'undefined' ? state : !open;
console.log("domClass contains opened:" + domClass.contains("select", "opened"));
if (domClass.contains("select", "opened")) {
domClass.toggle(dom.byId('select'), 'opened', open);
}
else {
domClass.add(dom.byId('select'), 'opened');
}
}
function renderItem(item){
var divNode = domConstruct.create('div');
domConstruct.place(document.createTextNode(item.name), divNode);
return divNode;
}
populateProviderList();
});
</script>
<div id="sidebar">
<div id="select" class="mySelect">
<div class="label button">
Pick a category
</div>
<div class="arrow button">
</div>
</div>
</div>
</body>
</html>
... View more
08-27-2015
01:32 PM
|
0
|
6
|
5662
|
|
POST
|
I'd just been going by what I could see from the REST service, which said Supports Advanced Queries: true I tried var test = app.buildingLayer.advancedQueryCapabilities; and looked at that object. It is
... View more
08-27-2015
09:50 AM
|
0
|
0
|
806
|
|
POST
|
I had a version that didn't have it, and that didn't help. There must be something in particular about this service. I tried another service that I've had for a while, making a secure version of it. I was able to generate a list of distinct values without any problem from it. It is based on a SQL server geodatabase, where my initial service is a file geodatabase. I haven't read any limitations about that, except from an older thread that may or may not have any bearing. My problem service doesn't return distinct values through the REST endpoint either. Of course what you can do with REST and what's in the API aren't always identical. In the end, I just went back to my function that removed duplicates, so at least I can move forward.
... View more
08-27-2015
09:36 AM
|
0
|
1
|
806
|
|
POST
|
I believe this is a bug. When I change my code to use a non-secured service, both orderByFields and returnDistictValues works just fine. With secure services, running through a proxy etc, neither one of these work. Kelly Hutchinsate this?
... View more
08-27-2015
06:58 AM
|
0
|
1
|
806
|
|
POST
|
I don't believe it is working correctly with secure services. I will make a more simple test and see if my theory is correct. It might be a bug.
... View more
08-27-2015
06:09 AM
|
0
|
0
|
2605
|
|
POST
|
I changed it to var urlPos = ioArgs.url.search(app.buildingLayer.url+"/query"); if (urlPos > 0) { // if(ioArgs.url === "../../proxy/proxy.ashx?"+app.buildingLayer.url+"/query"){ ioArgs.content.returnDistinctValues = true; } return ioArgs; }); At least now it's finding where I'm querying that url, but now there's no results to my query.
... View more
08-26-2015
12:55 PM
|
0
|
0
|
2605
|
|
POST
|
No, because Kelly said it was on the list for the next release (3.11 at that writing). I'm sure it's now fixed. I should have mentioned, if I didn't already, this is a secure service. I'm not sure if this will work, because ioArgs.url is always going to have a token on the end and it's not going to match the original url of my featureLayer. populateBuildingList: function(){ esriRequest.setRequestPreCallback(function(ioArgs){ console.log("ioArgs.url: " + ioArgs.url); if(ioArgs.url === "../../proxy/proxy.ashx?"+app.buildingLayer.url+"/query"){ //never resolves to true ioArgs.content.returnDistinctValues = true; } return ioArgs; }); app.buildingAgencyList.length = 0; var queryTask2 = new QueryTask(app.buildingLayer.url); .....
... View more
08-26-2015
12:38 PM
|
0
|
0
|
2605
|
| Title | Kudos | Posted |
|---|---|---|
| 1 | 06-02-2017 02:38 PM | |
| 2 | 03-18-2022 10:14 AM | |
| 2 | 02-18-2016 06:28 AM | |
| 1 | 03-18-2024 07:29 AM | |
| 4 | 08-02-2023 06:08 AM |
| Online Status |
Offline
|
| Date Last Visited |
02-25-2025
01:56 PM
|