Skip to content

Commit

Permalink
issue #11
Browse files Browse the repository at this point in the history
  • Loading branch information
rsoika committed Jul 16, 2016
1 parent dba0f15 commit 85529c7
Show file tree
Hide file tree
Showing 3 changed files with 50 additions and 9 deletions.
4 changes: 2 additions & 2 deletions src/main/webapp/index.html
Original file line number Diff line number Diff line change
Expand Up @@ -75,10 +75,10 @@
<!-- END container -->

<div id="footer">
<div id="footer1">Version 4.1.2</div>
<div id="footer1">Version 4.1.3</div>
<div id="footer2">

&#169; 2006-2014 <a href="http://www.imixs.com" target="_blank">Imixs
&#169; 2006-2016 <a href="http://www.imixs.com" target="_blank">Imixs
Software Solutions GmbH</a> | <a href="mailto:[email protected]">Contact</a>
| Webdesign: <a href="http://www.creatix.org">www.creatix.org</a>
</div>
Expand Down
41 changes: 38 additions & 3 deletions src/main/webapp/js/imixs-admin.js
Original file line number Diff line number Diff line change
Expand Up @@ -24,6 +24,7 @@ IMIXS.org.imixs.workflow.adminclient = (function() {

RestService = function() {
this.baseURL = "http://localhost:8080/office-rest";
this.priorVersion=false;
this.connected=false;
this.indexMap = null;
this.indexName = null;
Expand Down Expand Up @@ -172,6 +173,9 @@ IMIXS.org.imixs.workflow.adminclient = (function() {
afterRoute : function(router) {
$("#imixs-nav ul li").removeClass('active');
$("#imixs-nav ul li:nth-child(1)").addClass('active');

// update the priorVersionCheckbox
$('#priorVersionCheckBox').prop('checked', restServiceController.model.priorVersion);
}

}),
Expand Down Expand Up @@ -455,7 +459,26 @@ IMIXS.org.imixs.workflow.adminclient = (function() {
* Read the index list and open the query view
*/
restServiceController.connect = function() {

worklistController.model.view=null;


this.pull();

// get priorVersion flag manually (not yet supported by benJS)
restServiceController.model.priorVersion=$('#priorVersionCheckBox').is(':checked');

// remove last / if provided
restServiceController.model.baseURL=restServiceController.model.baseURL.trim();
if (restServiceController.model.baseURL.endsWith("/")) {
restServiceController.model.baseURL=restServiceController.model.baseURL.substring(0,restServiceController.model.baseURL.length-1);
}

console.log("baseURL=" + restServiceController.model.baseURL);
console.log("priorVersion=" + restServiceController.model.priorVersion);



// read indexlist...
$.ajax({
type : "GET",
Expand Down Expand Up @@ -557,8 +580,11 @@ IMIXS.org.imixs.workflow.adminclient = (function() {
// replace new lines..
query = query.replace(/(\r\n|\n|\r)/gm, " ");

if (restServiceController.model.priorVersion)
url = url + "/entity/entitiesbyquery/" + query;
else
url = url + "/entity/query/" + query;

url = url + "/entity/query/" + query;
url = url + "?start=" + worklistController.model.start + "&count="
+ worklistController.model.count;

Expand Down Expand Up @@ -605,7 +631,11 @@ IMIXS.org.imixs.workflow.adminclient = (function() {
printLog("Load worklist: '" + worklistController.model.query + "'...");

var url = restServiceController.model.baseURL;
url = url + "/entity/query/" + worklistController.model.query;
if (restServiceController.model.priorVersion)
url = url + "/entity/entitiesbyquery/" + worklistController.model.query;
else
url = url + "/entity/query/" + worklistController.model.query;

url = url + "?start=" + worklistController.model.start + "&count="
+ worklistController.model.count;

Expand Down Expand Up @@ -677,7 +707,12 @@ IMIXS.org.imixs.workflow.adminclient = (function() {
printLog("Load worklist: '" + worklistController.model.query + "'...");

var url = restServiceController.model.baseURL;
url = url + "/entity/query/" + worklistController.model.query;

if (restServiceController.model.priorVersion)
url = url + "/entity/entitiesbyquery/" + worklistController.model.query;
else
url = url + "/entity/query/" + worklistController.model.query;

url = url + "?start=" + worklistController.model.start + "&count="
+ worklistController.model.count;

Expand Down
14 changes: 10 additions & 4 deletions src/main/webapp/view_restservice.html
Original file line number Diff line number Diff line change
@@ -1,20 +1,26 @@
<div class="row">
<h1>Rest Service</h1>
<div data-ben-controller="restServiceController" class="imixs-form-section">
<div data-ben-controller="restServiceController"
class="imixs-form-section">
<dl>
<dt>URL:</dt>
<dd>
<input type="text" placeholder="Enter Rest Service Base Address"
data-ben-model="baseURL" autocomplete="on"/>
data-ben-model="baseURL" autocomplete="on" />
<br />
<input id="priorVersionCheckBox"
type="checkBox" value="true" /><span
title="Use deprecated Rest API URL pattern">Connect to prior versions 3.8.x</span>

</dd>



</dl>


<input type="button" value="Connect" onclick="adminclient.restServiceController.connect()"
class="btn" />
<input type="button" value="Connect"
onclick="adminclient.restServiceController.connect()" class="btn" />


</div>
Expand Down

0 comments on commit 85529c7

Please sign in to comment.