Skip to content

Commit

Permalink
-Fixed locking issue when trying to edit a Dashboard through the
Browse files Browse the repository at this point in the history
Dashboard Builder
  • Loading branch information
jsmethie committed Jul 18, 2016
1 parent bf8841b commit 41d5234
Show file tree
Hide file tree
Showing 2 changed files with 27 additions and 19 deletions.
8 changes: 4 additions & 4 deletions geoprism-web/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -115,8 +115,8 @@
**/*catalina*.jar,
**/*servlet-api*.jar,
**/*annotations-api*.jar,
<!-- Exclude runtime build jars -->
**/*aspectjtools*.jar
<!-- Exclude aspectjtools because it conflicts with our BIRT jar -->
**/aspectjtools*.jar
</packagingExcludes>
<webResources>
<resource>
Expand Down Expand Up @@ -346,8 +346,8 @@
**/*catalina*.jar,
**/*servlet-api*.jar,
**/*annotations-api*.jar,
<!-- Exclude runtime build jars -->
**/*aspectjtools*.jar
<!-- Exclude aspectjtools because it conflicts with our BIRT jar -->
**/aspectjtools*.jar
</packagingExcludes>
<overlays>
<overlay>
Expand Down
38 changes: 23 additions & 15 deletions geoprism-web/src/main/webapp/net/geoprism/service/BuilderService.js
Original file line number Diff line number Diff line change
Expand Up @@ -49,47 +49,55 @@

service.loadDashboard = function(dashboardId, onSuccess, onFailure) {

var request = runwayService.createRequest(function(json, dto) {
/*
* Second: Get all options
*/
var request = runwayService.createRequest(function(json, dto) {
service.dto = dto;

var object = JSON.parse(json);

var result = {};
// Populate the list of country options
// ORDER MATTERS for this array of field names. Fields will be added to the form in order.
var attributeNames = ['displayLabel', 'description', 'name'];

if(dto.isNewInstance()) {
attributeNames = ['displayLabel', 'description'];
}

result.fields = runwayService.getFields(service.dto, attributeNames);

// Overwrite name field options
if(!dto.isNewInstance()) {
result.fields[2].writable = dto.isNewInstance();
}

result.object = object;

onSuccess(result);

}, onFailure);

if(dashboardId != null) {
var dto = new net.geoprism.dashboard.Dashboard();
dto.id = dashboardId;
dto.newInstance = false;
dto.attributeMap.id.value = dashboardId;

dto.getDashboardDefinition(request);
if(dashboardId != null) {

/*
* First: Lock the dashboard object
*/
var lockRequest = runwayService.createRequest(function(dto){
dto.getDashboardDefinition(request);
});

net.geoprism.dashboard.Dashboard.lock(lockRequest, dashboardId);
}
else {
var dto = new net.geoprism.dashboard.Dashboard();
dto.getDashboardDefinition(request);
}
}


return service;
}

Expand Down

0 comments on commit 41d5234

Please sign in to comment.