AnalysisView.js revision fae509d4126434ef768309e9cccb9d0ac752d593
/**
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS HEADER.
*
* Copyright (c) 2014 ForgeRock AS. All rights reserved.
*
* The contents of this file are subject to the terms
* of the Common Development and Distribution License
* (the License). You may not use this file except in
* compliance with the License.
*
* You can obtain a copy of the License at
* See the License for the specific language governing
* permission and limitations under the License.
*
* When distributing Covered Code, include this CDDL
* Header Notice in each file and include the License file
* If applicable, add the following below the CDDL Header,
* with the fields enclosed by brackets [] replaced by
* your own identifying information:
* "Portions Copyrighted [year] [name of copyright owner]"
*/
/*global define, $, _, Handlebars */
], function(AdminAbstractView, MappingBaseView, conf, eventManager, constants, reconDelegate, dateUtil, syncDelegate, configDelegate, mappingUtils, changeAssociationDialog, TestSyncDialog) {
element: "#analysisView",
noBaseTemplate: true,
events: {
"change #situationSelection": "changeSituationView",
"click #doSyncButton": "syncNow",
"click #changeAssociation": "changeAssociation",
"click #singleRecordSync": "singleRecordSync"
},
data: {},
syncNow: function(e){
e.preventDefault();
},
singleRecordSync: function(e){
e.preventDefault();
TestSyncDialog.render({sync: this.sync, mapping: this.mapping, mappingName: this.data.mappingName, recon: MappingBaseView.data.recon});
},
changeAssociation: function(e){
var args,
selectedRow = this.getSelectedRow(),
if(isSource){
}
}, this),
e.preventDefault();
}
});
args = {
reloadAnalysisGrid: _.bind(function(){
}, this),
};
},
getSelectedRow: function () {
},
checkNewLinks: function(rows){
if(row.sourceObject){
} else {
}
}, this));
if(count){
if(count === 1){
warningText = $.t("templates.mapping.analysis.oneNewLinkWarning");
} else {
}
} else {
$('#newLinksWarning').hide();
}
return rows;
},
var _this = this,
jsonReader : {
repeatitems: false,
},
autowidth: true,
height: "100%",
datatype: "json",
rowNum: 10,
multiselect: true,
multiboxonly: true,
hoverrows: true,
altRows:true,
altclass: "analysisGridRowAlt",
"context" : "endpoint/reconResults",
"type" : "text/javascript",
"file" : "ui/reconResults.js"
}).then(function(){
});
}
},
loadComplete: function(data){
_this.$el.find("td.ui-search-input input").attr("placeholder",$.t("templates.mapping.analysis.enterSearchTerms"));
//new tooltip
if(callback) {
callback();
}
},
beforeRequest: function(){
} else {
}
},
onSelectRow: function(id){
},
colModel: [
{"name":"sourceObject", "hidden": true},
{"name":"_id", "hidden": true},
{"name":"hasLink", "hidden": true},
{"name": "sourceObjectDisplay", "jsonmap": "sourceObject", "label": $.t("templates.mapping.source"), "sortable": false,
var translatedObject,
txt;
if (sourceObject) {
txt = "<span class='newLinkWarning errorMessage fa fa-exclamation-triangle' title='" + $.t("templates.mapping.analysis.newLinkCreated") + "'></span> " + txt;
}
if(reconRecord.hasLink){
if(!reconRecord.linkQualifier) {
}
txt = "<span class='float-right fa fa-chain fa-lg linkIcon' title='" + reconRecord.linkQualifier + "'></span>" + txt;
}
return txt;
} else {
return "Not Found";
}
}
},
{"name": "targetObjectDisplay", "jsonmap": "targetObject","label": $.t("templates.mapping.target"), "sortable": false,
} else if (targetObject) {
return "Multiple Matches Found";
} else {
return "Not Found";
}
}
}
],
});
searchOnEnter: false
});
}
}, this);
if(selectedSituation){
}
this.data.reconAvailable = true;
this.data.situationList = _.map(_.pairs(this.data.recon.situationSummary), function(item) { return { key: item[0], value: item[1] }; });
}
reconDelegate.getNewLinksFromRecon(this.data.recon._id, this.data.recon.ended).then(_.bind(function(newLinks){
.pluck("sourceObjectId")
}, this))
.value();
this.parentRender(_.bind(function () {
if(selectedSituation){
}
}, this));
}, this));
},
this.data.sourceProps = _.pluck(this.mapping.properties,"source").slice(0,this.data.numRepresentativeProps);
this.data.targetProps = _.pluck(this.mapping.properties,"target").slice(0,this.data.numRepresentativeProps);
this.data.hideSingleRecordReconButton = mappingUtils.readOnlySituationalPolicy(this.mapping.policies);
this.data.reconAvailable = false;
this.parentRender(_.bind(function() {
this.renderReconResults(null, callback);
} else {
if(callback) {
callback();
}
}
}, this));
},
changeSituationView: function(e){
e.preventDefault();
}
});
return new AnalysisView();
});