Skip to content

Commit

Permalink
Merge pull request #207 from Chicago/dev
Browse files Browse the repository at this point in the history
Release 1.1.0 Changes
  • Loading branch information
tomschenkjr committed Jun 9, 2016
2 parents df7c549 + fe3f4a2 commit 44322e0
Show file tree
Hide file tree
Showing 285 changed files with 6,503 additions and 99 deletions.
49 changes: 45 additions & 4 deletions docs/OpenGrid API.md
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
<br>
<h1 align="center">OpenGrid REST Service <br> Application Programming Interface (API)</h1>
<h4 align="center">Version 1.0</h4>
<h4 align="center">Version 1.1.0</h4>

<!--
## Table of Contents
Expand Down Expand Up @@ -216,7 +216,8 @@ Create a new user. Returns object for newly created user, if successful.

## 1.1.4 /users/{user_id}
**Methods**
<p><b>GET</b>

<p><b>GET</b></p>
<br>
Return a single user object given the user’s internal id.
</p>
Expand Down Expand Up @@ -785,18 +786,25 @@ It is recommended that this value be URL encoded.
<td><p>The maximum number of records to return; If this parameter is not specified, no records are returned (i.e. default value of 0)</p>
</td>
</tr>
<tr>
<td>opts</td>
<td>JSON string</td>
<td><p>Optional parameters that can be passed depending on service capabilities. This value needs to be encoded for the call to work as expected. "geoFilter" is an attribute supported as of Release 1.1.0 and should be a valid geoJson geometry value.</p>
</td>
</tr>

</table>
</html>

<p><b>Sample Request</b><br>
<code>
&lt;Service URL&gt;/datasets/twitter/query?q={"$and":[{"text":{"$regex":"happy"}}]}&n=1
&lt;Service URL&gt;/datasets/twitter/query?q={"$and":[{"text":{"$regex":"happy"}}]}&n=1&opts={"geoFilter":{"type":"MultiPolygon","coordinates":[[[[-87.63304710388184,41.89278978584501],[-87.61206150054932,41.89278978584501],[-87.61206150054932,41.88140002416609],[-87.63304710388184,41.88140002416609],[-87.63304710388184,41.89278978584501]]]]}}
</code>
</p>

<p><b><small>Or when URL encoded:</small></b><br>
<code>
&lt;Service URL&gt;/datasets/twitter/query?q=%7B%22$and%22:%5B%7B%22text%22:%7B%22$regex%22:%22happy%22%7D%7D%5D%7D&n=1
&lt;Service URL&gt;/datasets/twitter/query?q=%7B%22$and%22:%5B%7B%22text%22:%7B%22$regex%22:%22happy%22%7D%7D%5D%7D&n=6000&opts=%7B%22geoFilter%22:%7B%22type%22:%22MultiPolygon%22,%22coordinates%22:%5B%5B%5B%5B-87.63304710388184,41.89278978584501%5D,%5B-87.61206150054932,41.89278978584501%5D,%5B-87.61206150054932,41.88140002416609%5D,%5B-87.63304710388184,41.88140002416609%5D,%5B-87.63304710388184,41.89278978584501%5D%5D%5D%5D%7D%7D
</code>
</p>

Expand Down Expand Up @@ -1101,6 +1109,26 @@ Delete a query given the query’s internal Id on the URL path.
No response is returned when a query is deleted.
</p>

## 1.1.12 /capabilities
New since Release 1.1.0<br>
**Methods**
<p><b>GET</b>
<br>
Return a json object with service's capabilities flags. As of Release 1.1.0, only 'geoSpatialFiltering' flag is available.
</p>
<p><b>Sample Request</b>
<br>
<code>
&lt;Service URL&gt;/capabilities
</code>
</p>
<p><b>Sample Response</b><br>
<code>
&nbsp; {
<br> &nbsp; &nbsp; &nbsp; "geoSpatialFiltering" : true
<br> &nbsp; }
</code>
</p>

## 1.2 HTTP Status Codes on Response

Expand All @@ -1114,6 +1142,18 @@ No response is returned when a query is deleted.
</li></ul>

<code>
<<<<<<< HEAD
&nbsp; {
<br> &nbsp; &nbsp; “error”: {
<br> &nbsp; &nbsp; &nbsp; &nbsp; “code”: “&lt;error code&gt;
<br> &nbsp; &nbsp; &nbsp; &nbsp; “message”: “&lt;error message&gt;
<br> &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; }
<br> &nbsp;&nbsp; }
</code>

{
<p> “error”: {
=======
<p>&nbsp; { </p>
<p>&nbsp; &nbsp; “error”: {
</p>
Expand All @@ -1122,6 +1162,7 @@ No response is returned when a query is deleted.
<p>&nbsp; &nbsp; &nbsp; &nbsp; “message”: “&lt;error message&gt;
</p>
<p>&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; }
>>>>>>> df7c549d50d1400ec04f15d3c747fc5f50c7951c
</p>
<p>&nbsp;&nbsp; }
</p>
Expand Down
18 changes: 9 additions & 9 deletions docs/User Documentation.md
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
<br>

![login](media/combine32.png)
![login](media/combine32.jpg)


## Getting Started
Expand Down Expand Up @@ -49,7 +49,7 @@ The quick search help feature assist users in performing a valid search. Each se
- between
<br>

![combine](media/combine21.png)
![combine](media/combine21.jpg)

### Search around a parameter (Point)
<p>To search with given point or boundaries the Geo spatial-filters will have to be applied.<br>
Expand Down Expand Up @@ -97,27 +97,27 @@ Tile Maps are small images, usually rectangular or isometric that acts like a pu
<p>Search criteria that’s been entered and saved within the database are called Saved Queries. The saved queries are store in the Manage Queries section. To save a query, the user enters in the preferred name for a query; then clicks the saved button. The user will also be given an option to overwrite other queries and save it using an existing name.</p>
<p>There are three icons for managing queries submit, share and delete. The submit function allows the user to run the query for the manage queries window. The share function gives the user the ability to share a query either to a group or to another user. The delete function gives the user the option to delete a query.</p>
<br>
![measure](media/combine31.png)
![measure](media/combine31.jpg)

## Measure Distance and Area
<p>Measuring distances and areas is a function within OpenGrid that allows the user to perform measurements between any given point to another. Once the measurement tool is selected the user will be prompt to start creating measurements by adding points on the map.</p>

## Measurement and Tools
<p>Click the measurement tool icon.</p>
<br>
![icoa](media/ombine1.png)
![icoa](media/ombine1.jpg)

<p>A measurement tool textbox will appear with an option to <b>create a new measurement</b>.</p>
<br>
![icob](media/ombine4.png)
![icob](media/ombine4.jpg)

<p>Once click <b>"create a new measurement"</b>... display points of origin and destination on the map by creating points.</p>
<br>
![icoc](media/ombine3.png)
![icoc](media/ombine3.jpg)

<br>
<p>After the measurement has been created the finish measurement textbox will appear. click <b>"Finish Measurement"</b>.</p>
![icod](media/combine10.png)
![icod](media/combine10.jpg)
<br>
<p>After clicking on finish measurement the <b>"Area Measurement"</b> textbox will appear providing information about the perimeter:</p>.
<ul>
Expand All @@ -127,11 +127,11 @@ Tile Maps are small images, usually rectangular or isometric that acts like a pu
</ul>
<p>It also gives the user an option to center on the Area or to Delete the perimeter.</p>
<br>
![icoe](media/ombine5.png)
![icoe](media/ombine5.jpg)

<p></p>

![icof](media/combine9.png)
![icof](media/combine9.jpg)

## FREQUENTLY ASKED QUESTIONS

Expand Down
Binary file added docs/media/2015-12-01_1211.jpg
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file removed docs/media/2015-12-01_1211.png
Binary file not shown.
File renamed without changes
Binary file added docs/media/Android OG 005.jpg
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file removed docs/media/Android OG 005.png
Binary file not shown.
Binary file added docs/media/Android OG 006.jpg
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file removed docs/media/Android OG 006.png
Binary file not shown.
Binary file added docs/media/Android OG 007.jpg
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file removed docs/media/Android OG 007.png
Binary file not shown.
Binary file added docs/media/Android OG 008.jpg
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file removed docs/media/Android OG 008.png
Binary file not shown.
Binary file added docs/media/Android OG 009.jpg
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file removed docs/media/Android OG 009.png
Binary file not shown.
Binary file added docs/media/Android OG 010.jpg
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file removed docs/media/Android OG 010.png
Binary file not shown.
Binary file added docs/media/Android OG 013.jpg
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file removed docs/media/Android OG 013.png
Binary file not shown.
Binary file added docs/media/Android OG 014.jpg
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file removed docs/media/Android OG 014.png
Binary file not shown.
Binary file added docs/media/Android OG 015.jpg
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file removed docs/media/Android OG 015.png
Binary file not shown.
Binary file added docs/media/Android OG 016.jpg
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file removed docs/media/Android OG 016.png
Binary file not shown.
Binary file added docs/media/Android OG 017.jpg
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file removed docs/media/Android OG 017.png
Binary file not shown.
Binary file added docs/media/Android OG 018.jpg
Binary file removed docs/media/Android OG 018.png
Diff not rendered.
Binary file added docs/media/Android OG 019.jpg
Binary file removed docs/media/Android OG 019.png
Diff not rendered.
Binary file added docs/media/Android OG 020.jpg
Binary file removed docs/media/Android OG 020.png
Diff not rendered.
Binary file added docs/media/Android OG 021.jpg
Binary file removed docs/media/Android OG 021.png
Diff not rendered.
Binary file added docs/media/Android OG 022.jpg
Binary file removed docs/media/Android OG 022.png
Diff not rendered.
Binary file added docs/media/Android OG 023.jpg
Binary file removed docs/media/Android OG 023.png
Diff not rendered.
Binary file added docs/media/Android OG 024.jpg
Binary file removed docs/media/Android OG 024.png
Diff not rendered.
Binary file added docs/media/Android OG 025.jpg
Binary file removed docs/media/Android OG 025.png
Diff not rendered.
Binary file added docs/media/Android OG 026.jpg
Binary file removed docs/media/Android OG 026.png
Diff not rendered.
Binary file added docs/media/Android OG 027.jpg
Binary file removed docs/media/Android OG 027.png
Diff not rendered.
Binary file added docs/media/Android OG 028.jpg
Binary file removed docs/media/Android OG 028.png
Diff not rendered.
Binary file added docs/media/Android OG 029.jpg
Binary file removed docs/media/Android OG 029.png
Diff not rendered.
Binary file added docs/media/Android OG 030.jpg
Binary file removed docs/media/Android OG 030.png
Diff not rendered.
Binary file added docs/media/Android OG 031.jpg
Binary file removed docs/media/Android OG 031.png
Diff not rendered.
Binary file added docs/media/Android OG 032.jpg
Binary file removed docs/media/Android OG 032.png
Diff not rendered.
Binary file removed docs/media/Iphone Mobile 013.PNG
Diff not rendered.
Binary file added docs/media/Iphone Mobile 013.jpg
Binary file removed docs/media/Iphone Mobile 014.PNG
Diff not rendered.
Binary file added docs/media/Iphone Mobile 014.jpg
Binary file removed docs/media/Iphone Mobile 015.PNG
Diff not rendered.
Binary file added docs/media/Iphone Mobile 015.jpg
Binary file removed docs/media/Iphone Mobile 016.PNG
Diff not rendered.
Binary file added docs/media/Iphone Mobile 016.jpg
Binary file removed docs/media/Iphone Mobile 017.PNG
Diff not rendered.
Binary file added docs/media/Iphone Mobile 017.jpg
Binary file removed docs/media/Iphone Mobile 018.PNG
Diff not rendered.
Binary file added docs/media/Iphone Mobile 018.jpg
Binary file removed docs/media/Iphone Mobile 019.PNG
Diff not rendered.
Binary file added docs/media/Iphone Mobile 019.jpg
Binary file removed docs/media/Iphone Mobile 020.PNG
Diff not rendered.
Binary file added docs/media/Iphone Mobile 020.jpg
Binary file removed docs/media/Iphone Mobile 021.PNG
Diff not rendered.
Binary file added docs/media/Iphone Mobile 021.jpg
Binary file removed docs/media/Iphone Mobile 022.PNG
Diff not rendered.
Binary file added docs/media/Iphone Mobile 022.jpg
Binary file removed docs/media/Iphone Mobile 023.PNG
Diff not rendered.
Binary file added docs/media/Iphone Mobile 023.jpg
Binary file removed docs/media/Iphone Mobile 024.PNG
Diff not rendered.
Binary file added docs/media/Iphone Mobile 024.jpg
Binary file removed docs/media/Iphone Mobile 025.PNG
Diff not rendered.
Binary file added docs/media/Iphone Mobile 025.jpg
Binary file removed docs/media/Iphone Mobile 026.PNG
Diff not rendered.
Binary file added docs/media/Iphone Mobile 026.jpg
Binary file removed docs/media/Iphone Mobile 027.PNG
Diff not rendered.
Binary file added docs/media/Iphone Mobile 027.jpg
Binary file removed docs/media/Iphone Mobile 028.PNG
Diff not rendered.
Binary file added docs/media/Iphone Mobile 028.jpg
Binary file removed docs/media/Iphone Mobile 029.PNG
Diff not rendered.
Binary file added docs/media/Iphone Mobile 029.jpg
Binary file removed docs/media/Iphone Mobile 030.PNG
Diff not rendered.
Binary file added docs/media/Iphone Mobile 030.jpg
Binary file removed docs/media/Iphone Mobile 031.PNG
Diff not rendered.
Binary file added docs/media/Iphone Mobile 031.jpg
Binary file removed docs/media/Iphone Mobile 032.PNG
Diff not rendered.
Binary file added docs/media/Iphone Mobile 032.jpg
Binary file removed docs/media/Iphone Mobile 033.PNG
Diff not rendered.
Binary file added docs/media/Iphone Mobile 033.jpg
Binary file removed docs/media/Iphone Mobile 034.PNG
Diff not rendered.
Binary file added docs/media/Iphone Mobile 034.jpg
Binary file removed docs/media/Iphone Mobile 035.PNG
Diff not rendered.
Binary file added docs/media/Iphone Mobile 035.jpg
Binary file removed docs/media/Iphone Mobile 036.PNG
Diff not rendered.
Binary file added docs/media/Iphone Mobile 036.jpg
Binary file removed docs/media/Iphone Mobile 037.PNG
Diff not rendered.
Binary file added docs/media/Iphone Mobile 037.jpg
Binary file removed docs/media/Iphone Mobile 038.PNG
Diff not rendered.
Binary file added docs/media/Iphone Mobile 038.jpg
Binary file removed docs/media/Iphone Mobile 039.PNG
Diff not rendered.
Binary file added docs/media/Iphone Mobile 039.jpg
Binary file removed docs/media/Iphone Mobile 040.PNG
Diff not rendered.
Binary file added docs/media/Iphone Mobile 040.jpg
Binary file removed docs/media/Iphone Mobile 041.PNG
Diff not rendered.
Binary file added docs/media/Iphone Mobile 041.jpg
Binary file removed docs/media/Iphone Mobile 042.PNG
Diff not rendered.
Binary file added docs/media/Iphone Mobile 042.jpg
Binary file removed docs/media/Iphone Mobile 043.PNG
Diff not rendered.
Binary file added docs/media/Iphone Mobile 043.jpg
Binary file removed docs/media/Iphone Mobile 045.PNG
Diff not rendered.
Binary file added docs/media/Iphone Mobile 045.jpg
Binary file removed docs/media/Iphone Mobile 046.PNG
Diff not rendered.
Binary file added docs/media/Iphone Mobile 046.jpg
Binary file removed docs/media/Iphone Mobile 047.PNG
Diff not rendered.
Binary file added docs/media/Iphone Mobile 047.jpg
Binary file removed docs/media/Iphone Mobile 048.PNG
Diff not rendered.
Binary file added docs/media/Iphone Mobile 048.jpg
Binary file removed docs/media/Iphone Mobile 049.PNG
Diff not rendered.
Binary file added docs/media/Iphone Mobile 049.jpg
Binary file removed docs/media/Iphone52.PNG
Diff not rendered.
Binary file added docs/media/Iphone52.jpg
Binary file modified docs/media/Thumbs.db
Binary file not shown.
Binary file added docs/media/coc.jpg
Binary file removed docs/media/coc.png
Diff not rendered.
Binary file removed docs/media/combine10.png
Diff not rendered.
Binary file added docs/media/combine20.jpg
Binary file removed docs/media/combine20.png
Diff not rendered.
Binary file added docs/media/combine21.jpg
Binary file removed docs/media/combine21.png
Diff not rendered.
File renamed without changes
Binary file added docs/media/combine25.jpg
Binary file removed docs/media/combine25.png
Diff not rendered.
Binary file added docs/media/combine30.jpg
Binary file removed docs/media/combine30.png
Diff not rendered.
Binary file added docs/media/combine31.jpg
Binary file removed docs/media/combine31.png
Diff not rendered.
Binary file added docs/media/combine32.jpg
Binary file removed docs/media/combine32.png
Diff not rendered.
File renamed without changes
File renamed without changes
File renamed without changes
File renamed without changes
File renamed without changes
File renamed without changes
Binary file removed docs/media/combine9.png
Diff not rendered.
Binary file added docs/media/ekdi.jpg
Binary file removed docs/media/ekdi.png
Diff not rendered.
File renamed without changes
Binary file added docs/media/image15.jpg
Binary file removed docs/media/image15.png
Diff not rendered.
Binary file added docs/media/image16.jpg
Binary file removed docs/media/image16.png
Diff not rendered.
Binary file added docs/media/image17.jpg
Binary file removed docs/media/image17.png
Diff not rendered.
Binary file added docs/media/image18.jpg
Binary file removed docs/media/image18.png
Diff not rendered.
Binary file added docs/media/image19.jpg
Binary file removed docs/media/image19.png
Diff not rendered.
Binary file added docs/media/image20.jpg
Binary file removed docs/media/image20.png
Diff not rendered.
Binary file added docs/media/image33.jpg
Binary file removed docs/media/image33.png
Diff not rendered.
Binary file added docs/media/image34.jpg
Binary file removed docs/media/image34.png
Diff not rendered.
Binary file added docs/media/image35.jpg
Binary file removed docs/media/image35.png
Diff not rendered.
Binary file added docs/media/image36.jpg
Binary file removed docs/media/image36.png
Diff not rendered.
Binary file added docs/media/image37.jpg
Binary file removed docs/media/image37.png
Diff not rendered.
Binary file added docs/media/image38.jpg
Binary file removed docs/media/image38.png
Diff not rendered.
Binary file added docs/media/image39.jpg
Binary file removed docs/media/image39.png
Diff not rendered.
Binary file added docs/media/image50.jpg
Binary file removed docs/media/image50.png
Diff not rendered.
Binary file added docs/media/image51.jpg
Binary file removed docs/media/image51.png
Diff not rendered.
Binary file added docs/media/image52.jpg
Binary file removed docs/media/image52.png
Diff not rendered.
Binary file added docs/media/image53.jpg
Binary file removed docs/media/image53.png
Diff not rendered.
Binary file added docs/media/image53a.jpg
Binary file removed docs/media/image53a.png
Diff not rendered.
Binary file added docs/media/image54.jpg
Binary file removed docs/media/image54.png
Diff not rendered.
Binary file added docs/media/image55.jpg
Binary file removed docs/media/image55.png
Diff not rendered.
Binary file added docs/media/image56.jpg
Binary file removed docs/media/image56.png
Diff not rendered.
Binary file added docs/media/image57.jpg
Binary file removed docs/media/image57.png
Diff not rendered.
Binary file added docs/media/image58.jpg
Binary file removed docs/media/image58.png
Diff not rendered.
Binary file added docs/media/image59.jpg
Binary file removed docs/media/image59.png
Diff not rendered.
Binary file added docs/media/image60.jpg
Binary file removed docs/media/image60.png
Diff not rendered.
Binary file added docs/media/image60_001.jpg
Binary file removed docs/media/image60_001.png
Diff not rendered.
Binary file added docs/media/image61.jpg
Binary file removed docs/media/image61.png
Diff not rendered.
Binary file added docs/media/image62.jpg
Binary file removed docs/media/image62.png
Diff not rendered.
Binary file added docs/media/image64.jpg
Binary file removed docs/media/image64.png
Diff not rendered.
Binary file added docs/media/image65.jpg
Binary file removed docs/media/image65.png
Diff not rendered.
Binary file added docs/media/image66.jpg
Binary file removed docs/media/image66.png
Diff not rendered.
Binary file added docs/media/image67.jpg
Binary file removed docs/media/image67.png
Diff not rendered.
Binary file added docs/media/image68.jpg
Binary file removed docs/media/image68.png
Diff not rendered.
Binary file added docs/media/image70.jpg
Binary file removed docs/media/image70.png
Diff not rendered.
Binary file added docs/media/image71.jpg
Binary file removed docs/media/image71.png
Diff not rendered.
Binary file added docs/media/image72.jpg
Binary file removed docs/media/image72.png
Diff not rendered.
Binary file removed docs/media/image73.png
Diff not rendered.
Binary file added docs/media/image75.jpg
Binary file removed docs/media/image75.png
Diff not rendered.
Binary file removed docs/media/image76.png
Diff not rendered.
Binary file added docs/media/image80.jpg
Binary file removed docs/media/image80.png
Diff not rendered.
Binary file added docs/media/image81.jpg
Binary file removed docs/media/image81.png
Diff not rendered.
Binary file added docs/media/image82.jpg
Binary file removed docs/media/image82.png
Diff not rendered.
Binary file added docs/media/image83.jpg
Binary file removed docs/media/image83.png
Diff not rendered.
Binary file added docs/media/image96.jpg
Binary file removed docs/media/image96.png
Diff not rendered.
Binary file added docs/media/image97.jpg
Binary file removed docs/media/image97.png
Diff not rendered.
Binary file added docs/media/image98.jpg
Binary file removed docs/media/image98.png
Diff not rendered.
Binary file added docs/media/image99.jpg
Binary file removed docs/media/image99.png
Diff not rendered.
Binary file added docs/media/images45.jpg
Binary file removed docs/media/images45.png
Diff not rendered.
Binary file added docs/media/images46.jpg
Binary file removed docs/media/images46.png
Diff not rendered.
Binary file added docs/media/manage.jpg
Binary file removed docs/media/manage.png
Diff not rendered.
Binary file added docs/media/manage1.jpg
Binary file removed docs/media/manage1.png
Diff not rendered.
Binary file added docs/media/ombine1.jpg
Binary file removed docs/media/ombine1.png
Diff not rendered.
Binary file added docs/media/ombine2.jpg
Binary file removed docs/media/ombine2.png
Diff not rendered.
Binary file added docs/media/ombine3.jpg
Binary file removed docs/media/ombine3.png
Diff not rendered.
Binary file added docs/media/ombine4.jpg
Binary file removed docs/media/ombine4.png
Diff not rendered.
Binary file added docs/media/ombine5.jpg
Binary file removed docs/media/ombine5.png
Diff not rendered.
Binary file added docs/media/rest.jpg
Binary file removed docs/media/rest.png
Diff not rendered.
Binary file added img/branding/Thumbs.db
Binary file not shown.
68 changes: 55 additions & 13 deletions lib/jquery-1.11.2/opengrid-query-builder.js
Original file line number Diff line number Diff line change
Expand Up @@ -1276,18 +1276,18 @@

//'$now' is a system value representing current date/time
//OpenGrid extension
if ( (value[i] == '$now' || '$today') ) {
//OpenGrid extension
if (this.isChronoValue(value[i])) {
//do something
//valid value
//console.log('found $now');
} else {
//original validation logic is below
// we need MomentJS
if (validation.format) {
if (!('moment' in window)) {
error('MomentJS is required for Date/Time validation. Get it here http://momentjs.com');
}
var datetime = moment(value[i], validation.format);
/*var datetime = moment(value[i], validation.format);
if (!datetime.isValid()) {
result = ['datetime_invalid'];
break;
Expand All @@ -1305,7 +1305,11 @@
break;
}
}
}
}*/
//we're now using chrono's validator as our main validator
//anything after this is a bad value
result = ['datetime_invalid'];
break;
}
}
break;
Expand All @@ -1327,6 +1331,31 @@
return result;
};

//OpenGrid customization
QueryBuilder.prototype.isChronoValue = function(value) {
var dt = chrono.parseDate(value);
return (dt !=null);
};


QueryBuilder.prototype.isNaturalLangChronoValue = function(value) {
var o = chrono.parse(value);
if (o.length > 0) {
var v = o[0];
if (v.tags) {
//if (v.tags.ENCasualDateParser) {
// console.log("Natural");
//} else
if (v.tags.ENSlashDateFormatParser) {
return false;
} else
return true;
}
}
return false;
};


/**
* Returns an incremented group ID
* @return {string}
Expand Down Expand Up @@ -2671,7 +2700,7 @@
valuesCopy = [].concat(rule.value);
if (rule.type === 'date') {
$.each(valuesCopy, function(i, v) {
valuesCopy[i] = that._getDateValue(v);
valuesCopy[i] = that._getArrayElementDateValue(i, v);
});
}
}
Expand Down Expand Up @@ -2699,28 +2728,41 @@
_getRuleValue: function(rule) {
//OpenGrid extension, translate system rule value
if (rule.type === 'date') {
return this._getDateValue(rule.value);
//OpenGrid extension, translate system rule value
if (this.isNaturalLangChronoValue(rule.value) ) {
//map to Mongo's current date time token
//this does not work for datetime values stored as numeric
//rule.value = '$currentDate';

//assume: datetime on target is stored in Mongo as a numeric value representing Unix epoch in ms
return moment(chrono.parseDate(rule.value)).startOf('day').valueOf();
} else
return moment(rule.value, "MM/DD/YYYY hh:mm:ss a").valueOf();
} else
return rule.value;
},

_getDateValue: function(value) {
if (value === '$now') {
//assume only 'between' operator can be applied
_getArrayElementDateValue: function(i, value) {
if (this.isNaturalLangChronoValue(value) ) {
//map to Mongo's current date time token
//this does not work for datetime values stored as numeric
//rule.value = '$currentDate';

//assume: datetime on target is stored in Mongo as a numeric value representing Unix epoch in ms
return moment().valueOf();
} else if (value === '$today') {
return moment().startOf('day').valueOf();
if (i==1)
value = moment(chrono.parseDate(value)).endOf('day').valueOf();
else
value = moment(chrono.parseDate(value)).startOf('day').valueOf();
return value;
} else {
//assume: datetime on target is stored in Mongo as a numeric value representing Unix epoch in ms
return moment(value, "MM/DD/YYYY hh:mm:ss a").valueOf();
}
},





/**
* Convert MongoDB object to rules
* @param data {object} query object
Expand Down

0 comments on commit 44322e0

Please sign in to comment.