WorkflowWidget.js revision e26e5073e1266868172d72453c97f413fe2fb603
/**
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS HEADER.
*
* Copyright (c) 2015 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",
var workflowInstance = {},
noBaseTemplate: true,
events: {
"change #workflowList": "changeSchema"
},
model: {
changeCallback: _.noop(),
key: "",
params: {}
},
/**
* @param args
* {
* params: {
* name1: "value1",
* name2: "script2"
* },
* sync: boolean,
* key: string,
* changeCallback: function(){},
* element: $.el,
* context: {}
* }
*
* @param callback
*/
var selected = false;
function myParentRender() {
this.parentRender(_.bind(function() {
if (selected !== false) {
}, this);
}
if (callback) {
}
}, this));
}
this.data = {
workflows: [],
sync: false,
selectedWorkflow: {},
context: ""
};
if (args.changeCallback) {
}
}
} else {
}
}
}
_.bind(myParentRender, this)();
}, this));
} else {
_.bind(myParentRender, this)();
}, this));
} else {
this.data.properties = [];
_.bind(myParentRender, this)();
}
}, this));
}
},
/**
* Gets a list of all workflows and all necessary properties
*
* @param selectedKey
* @param params
* @returns {array}
* "workflowList": A list of workflow objects
* "selectedWorkflow": The selected workflow object
*
*/
var workflowList = [],
selectedWorkflow = null;
});
}
}, this);
"workflowList": workflowList,
"selectedWorkflow": selectedWorkflow
});
}, this));
return promise;
},
/**
* Gets a detailed list of properties for a given workflow.
*
* @param workflow
* @returns workflowProperties {array}
*/
getWorkflowSchema: function(workflow) {
workflowProperties = [];
});
}
}, this);
}
}, this));
return promise;
},
isValid: function() {
return $(".workflow-body textarea[data-validator]").length === 0 || ValidatorsManager.formValidated(this.$el);
},
changeSchema: function() {
this.render({
"params": {},
"element": this.element,
if (this.model.changeCallback) {
this.model.changeCallback();
}
},
getConfiguration: function () {
properties = {},
}
});
return {
"type": "text/javascript",
"file": file,
"globals": {
"params": properties
}
};
},
getValid: function () {
}
});
var widget = {};
return widget;
};
return workflowInstance;
});