new Lane()
Create a new instance of Lanes
- Source:
- Lane/Lane.js, line 57
- See:
Properties:
Name | Type | Description |
---|---|---|
author |
User | Contains the author's information. |
title |
String | the title of the lane |
summary |
Object | the summary of the lane |
isEverybody |
String | term that signifies if the lane is set to alow everybody |
isDynamic |
String | term that signifies if the lane is set to dynamic |
type |
String | Type of the lane |
parent |
Object | the parent pool of the lane |
users |
Array | All the users associated to the lane |
usersUrl |
String | The URL of the users list |
parentUrl |
String | The URL of the parent |
script |
String | script of the lane |
acceptanceUsers |
Array | All the acceptance users associated to the lane |
isRemove |
Boolean | flag to set a lane as lane to be removed. |
isLoadedUserLane |
Boolean | Flag that represents if the la was loaded as a userLane |
Examples
Load a lane
function loadUserLanes(user){//User object
user.loadLanes({
onSuccess:function(){
var lane = user.lanes[0];
}
});
};
Load all users
function loadAllLaneUsers(lane){//Lane object
var optL = {};
optL.onSuccess = function(){
alert("Users Loaded! There are "+lane.allUsers.users.length+" users in the list");
};
lane.loadAllUsers(optL);
};
Methods
-
addUser(options)
-
Add a User to a lane.
Parameters:
Name Type Description options
object options to be used during the call
Properties
Name Type Argument Description onSuccess
Resource~onSuccess a callback function called in case of a success onFailure
Resource~onFailure <optional>
a callback function called in case of a failure user
User the user to add filters
Array <optional>
an array of filters - Source:
- Lane/Lane.js, line 264
-
create()
-
Create a new Lane.
Parameters:
Name Type Argument Description options.onSuccess
Resource~onSuccess a callback function called in case of a success options.onFailure
Resource~onFailure <optional>
a callback function called in case of a failure options.baseUrl
String <optional>
base URL. If not set the current base URL will be used - Source:
- Lane/Lane.js, line 384
- See:
Example
Create a lane function CreateLane(opt){// object var lane = new Lane(); lane.title = "Lane name"; lane.poolUrl = opt.poolUrl; //Url of the pool lane.script = opt.script; //Script of the lane lane.create({ onSuccess:function(){ alert("Lane " + lane.id + " created."); } }); };
-
generate_xml()
-
generate xml to create/update
Parameters:
Name Type Argument Description options.baseUrl
String <optional>
base URL. If not set the current base URL will be used - Source:
- Lane/Lane.js, line 470
- See:
-
generateAddUser_xml()
-
generate xml to add a user
Parameters:
Name Type Argument Description options.baseUrl
String <optional>
base URL. If not set the current base URL will be used options.user
String the user to be added - Source:
- Lane/Lane.js, line 308
- See:
-
generateUrl()
-
Overrides Resource's generateUrl method to return the request url
- Source:
- Lane/Lane.js, line 92
- See:
-
loadAcceptanceUsers(options)
-
Load all Acceptance users.
Parameters:
Name Type Description options
object options to be used during the call
Properties
Name Type Argument Description filters
Array array of filters onSuccess
Resource~onSuccess a callback function called in case of a success onFailure
Resource~onFailure <optional>
a callback function called in case of a failure baseUrl
String <optional>
base URL. If not set the current base URL will be used pagination
Object <optional>
an Object with pagination variables (nb and first) filters
Array <optional>
an array of filters - Source:
- Lane/Lane.js, line 220
Example
Load Acceptance Users function loadAcceptanceUsers(user){//User object user.loadLanes({ onSuccess:function(){ var lane = user.lanes[0]; lane.load({ onSuccess:function(){ lane.loadAcceptanceUsers({ onSuccess:function(){ alert(lane.acceptanceUsers.length); } }); } }); } }); };
-
loadPreset()
-
Overrides Resource's loadPreset method.
- Source:
- Lane/Lane.js, line 86
- See:
-
loadSet(rObject)
-
Overrides Resource's loadSet method to set local variables after request.
Parameters:
Name Type Description rObject
json JSON representation of the loaded data. - Source:
- Lane/Lane.js, line 102
- See:
-
loadUsers(options)
-
Load all users.
Parameters:
Name Type Description options
object options to be used during the call
Properties
Name Type Argument Description filters
Array array of filters onSuccess
Resource~onSuccess a callback function called in case of a success onFailure
Resource~onFailure <optional>
a callback function called in case of a failure baseUrl
String <optional>
base URL. If not set the current base URL will be used pagination
Object <optional>
an Object with pagination variables (nb and first) filters
Array <optional>
an array of filters - Source:
- Lane/Lane.js, line 157
Example
Load Users function loadUsers(user){//User object user.loadLanes({ onSuccess:function(){ var lane = user.lanes[0]; lane.load({ onSuccess:function(){ lane.loadUsers({ onSuccess:function(){ alert(lane.users.length); } }); } }); } }); };
-
removeUser(options)
-
delete User From lane
Parameters:
Name Type Description options
object options to be used during the call
Properties
Name Type Argument Description onSuccess
Resource~onSuccess a callback function called in case of a success onFailure
Resource~onFailure <optional>
a callback function called in case of a failure user
User the user to delete filters
Array <optional>
an array of filters - Source:
- Lane/Lane.js, line 339
-
update()
-
Update a Lane.
Parameters:
Name Type Argument Description options.onSuccess
Resource~onSuccess a callback function called in case of a success options.onFailure
Resource~onFailure <optional>
a callback function called in case of a failure options.baseUrl
String <optional>
base URL. If not set the current base URL will be used - Source:
- Lane/Lane.js, line 434
- See: