AddMappingView.js revision e26e5073e1266868172d72453c97f413fe2fb603
/**
* 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 */
"jquery",
"underscore",
], function($, _,
events: {
"click .add-resource-button" : "addResourceMapping"
},
addMappingView: false,
var connectorPromise,
$.when(connectorPromise, managedPromise, iconPromise).then(_.bind(function(connectors, managedObjects, iconList){
connector.displayName = $.t("templates.connector." +connectorUtils.cleanConnectorName(connector.connectorRef.connectorName));
if(connector.objectTypes) {
.filter(function(objectTypes){
return objectTypes !== "__ALL__";
})
.sortBy(function(objectType) {
return objectType;
})
.value();
connector.displayObjectType = connector.objectTypes[0] +", " +connector.objectTypes[1]+ ", (" +(connector.objectTypes.length - 2) +" " +$.t("templates.mapping.more") +")";
} else {
}
}
}, this));
}, this);
}, this));
this.parentRender(_.bind(function(){
$("#submenu").hide();
this.scrollInit = false;
"removeCallback": _.bind(function(){
}, this),
}
}, this)},
_.bind(function(){
this.preselectMappingCard(args);
}
if (callback) {
callback();
}
}, this));
}, this));
}, this));
},
preselectMappingCard: function(selected) {
var resourceData = null;
});
if(resourceData !== null) {
}
} else {
});
if(resourceData !== null) {
}
}
if(resourceData !== null) {
}
},
addResourceMapping: function(event) {
resourceData = null,
resourceLocation = null;
if(resourceType === "connector") {
resourceLocation = this.$el.find("#resourceConnectorContainer .resource-body").index(resourceSelected);
} else {
resourceLocation = this.$el.find("#resourceManagedContainer .resource-body").index(resourceSelected);
}
},
/*
No longer in use but code could be useful if this feature is desired later in different context
*/
mappingDetail: function(event){
}
eventManager.sendEvent(constants.ROUTE_REQUEST, {routeName: "editManagedView", args: [details.name]});
} else {
eventManager.sendEvent(constants.ROUTE_REQUEST, {routeName: "editConnectorView", args: [details.cleanUrlName]});
}
}
}
});
return new MappingAddView();
});