| Package | com.j2flex.core |
| Class | public dynamic class J2FlexService |
| Inheritance | J2FlexService mx.rpc.remoting.RemoteObject |
ActionScript Example
Using the J2FlexService class in ActionScript:
private var service:J2FlexService;
private function init():void
{
service = new J2FlexService();
service.destination = "Destination";
service.showBusyCursor = true;
}
MXML Example
You can also using the J2FlexService class as a MXML tag, with the following
namespace: xmlns:j2flex="http://www.j2flex.com/j2flex". The <j2flex:J2FlexSerivce/>
tag inherits all the attributes of its superclass mx.rpc.remoting.RemoteObject
and adds the following tag attributes:
<j2flex:J2FlexService
Properties
id="No default."
showBusyCursor="false|true"
Events
fault="No default."
result="No default."
/>
See also
| Property | Defined by | ||
|---|---|---|---|
| consumerClientId : String [read-only]
Client generated id for point-to-point messaging between J2Flex and Flex clients.
| J2FlexService | ||
| domain : String [read-only]
Domain from the current Flex session.
| J2FlexService | ||
| domainInfo : DomainInfo
[read-only]
Domain info for the current domain.
| J2FlexService | ||
| langId : int [read-only]
The language id for the current Flex session.
| J2FlexService | ||
| roles : Array [read-only]
Array with all groups for the current user.
| J2FlexService | ||
| session : String [read-only]
The id of the current Flex session.
| J2FlexService | ||
| showBusyCursor : Boolean
If true, a busy cursor is displayed while the J2FlexService is executing.
| J2FlexService | ||
| userId : int [read-only]
The id of the user for the current Flex session.
| J2FlexService | ||
| Method | Defined by | ||
|---|---|---|---|
|
Creates a new J2FlexService.
| J2FlexService | ||
|
addUserToRole(userId:int, groupId:int, roleManager:Boolean = false):AsyncToken
Adds a user to a specified group.
| J2FlexService | ||
|
createObject(object:Object):AsyncToken
Creates new object of the given type.
| J2FlexService | ||
|
deleteObject(object:Object, deleteLinked:Boolean = false):AsyncToken
Deletes a object with given obj_type and obj_id.
| J2FlexService | ||
|
getAllRights(object:Object):AsyncToken
Returns all rights that users and groups have to this object.
| J2FlexService | ||
|
getArticle(artUUID:String, withRights:Boolean = true, showLong:Boolean = true):AsyncToken
Returns details of the article with the given UUID.
| J2FlexService | ||
|
getArticles(menuUUID:String, withRights:Boolean = true):AsyncToken
Returns all articles connected with the given menu.
| J2FlexService | ||
|
getContainers(menuUUID:String, withRights:Boolean = true):AsyncToken
Return containers that are located on the given menu.
| J2FlexService | ||
|
getDomain():AsyncToken
Gets the domain for the Flex session.
| J2FlexService | ||
|
getDomainInfo():AsyncToken
Returns the domain info for the current domain.
| J2FlexService | ||
|
getLangId():AsyncToken
Returns the actual language for the Flex session, or the default language if it was not set.
| J2FlexService | ||
|
getMenuPath(menuId:int, showRoot:Boolean = true, withRights:Boolean = true):AsyncToken
Returns a RecordSet with all the ancestors of the given menu, the root ancestor at the top.
| J2FlexService | ||
|
getMenus(showRoot:Boolean = true, withRights:Boolean = true, openedIds:String = null):AsyncToken
Returns menus, sorted in the same order as they are located in the tree.
| J2FlexService | ||
|
getObjectRights(object:Object):AsyncToken
Returns the right that the current user has to this object.
| J2FlexService | ||
|
getObjects(sql:String, collection:ListCollectionView = null, withRights:Boolean = true, params:Array = null, treeOptions:TreeOptions = null):AsyncToken
Executes the query and returns the data as a RecordSet value object.
| J2FlexService | ||
|
getRoles():AsyncToken
Returns an array with all groups for the current user.
| J2FlexService | ||
|
getRootMenuPath(menuId:int, rootId:int, showRoot:Boolean = true, withRights:Boolean = true):AsyncToken
Returns a Recordset with all the ancestors of the given menu, the root ancestor at the top.
| J2FlexService | ||
|
getRootMenus(rootId:int, showRoot:Boolean = true, withRights:Boolean = true, openedIds:String = null):AsyncToken
Returns menus, sorted in the same order as the are located in the tree.
| J2FlexService | ||
|
getSession():AsyncToken
Returns the id of the current Flex session.
| J2FlexService | ||
|
getUserId():AsyncToken
Returns the current user id for the Flex session.
| J2FlexService | ||
|
isUserInRole(groupIdOrName:Object):AsyncToken
Checks if the current user belongs to the group with the given id or the given name.
| J2FlexService | ||
|
loginUser(username:String, password:String, clientId:String = null):AsyncToken
Logs the user in.
| J2FlexService | ||
|
logoutUser():AsyncToken
Logs the user out.
| J2FlexService | ||
|
removeUserFromRole(userId:int, groupId:int):AsyncToken
Remove a user from a group.
| J2FlexService | ||
|
setConsumerClientId(clientId:String = null):AsyncToken
Stores the client generated id used for point-to-point messaging between J2Flex and Flex clients.
| J2FlexService | ||
|
setDomain(domain:String):AsyncToken
Saves domain for the Flex session.
| J2FlexService | ||
|
setLang(langId:int):AsyncToken
Sets the current language id for the Flex session.
| J2FlexService | ||
|
setRoleRight(objType:int, objId:int, groupId:int, right:int):AsyncToken
Sets group right on the object.
| J2FlexService | ||
|
setUserRight(objType:int, objId:int, userId:int, right:int):AsyncToken
Sets user right on the object.
| J2FlexService | ||
|
updateObject(object:Object):AsyncToken
Updates the object.
| J2FlexService | ||
| Event | Summary | Defined by | ||
|---|---|---|---|---|
| Dispatched when an J2FlexService call fails. | J2FlexService | |||
| Dispatched when an J2FlexService call returns successfully. | J2FlexService | |||
| consumerClientId | property |
consumerClientId:String [read-only]Client generated id for point-to-point messaging between J2Flex and Flex clients.
Implementation public function get consumerClientId():String
| domain | property |
domain:String [read-only]Domain from the current Flex session.
Implementation public function get domain():String
| domainInfo | property |
domainInfo:DomainInfo [read-only]Domain info for the current domain.
Implementation public function get domainInfo():DomainInfo
| langId | property |
langId:int [read-only]The language id for the current Flex session.
Implementation public function get langId():int
| roles | property |
roles:Array [read-only]Array with all groups for the current user.
Implementation public function get roles():Array
| session | property |
session:String [read-only]The id of the current Flex session.
Implementation public function get session():String
| showBusyCursor | property |
showBusyCursor:Boolean [read-write]If true, a busy cursor is displayed while the J2FlexService is executing.
The default value is false.
public function get showBusyCursor():Boolean
public function set showBusyCursor(value:Boolean):void
| userId | property |
userId:int [read-only]The id of the user for the current Flex session.
Implementation public function get userId():int
| J2FlexService | () | constructor |
public function J2FlexService()Creates a new J2FlexService.
| addUserToRole | () | method |
public function addUserToRole(userId:int, groupId:int, roleManager:Boolean = false):AsyncTokenAdds a user to a specified group.
ParametersuserId:int — The id of the user.
|
|
groupId:int — The id of the group.
|
|
roleManager:Boolean (default = false) — Indicates if the user is a group manager.
|
AsyncToken — AsyncToken which can be used to respond to the success or failure of the operation.
|
| createObject | () | method |
public function createObject(object:Object):AsyncTokenCreates new object of the given type.
Parametersobject:Object — The object to create. The object must contain the obj_type and obj_id properties.
The obj_type property must be set to a valid object type.
|
AsyncToken — AsyncToken which can be used to respond to the success or failure of the operation.
|
— If the object argument has no obj_type or obj_id property.
|
| deleteObject | () | method |
public function deleteObject(object:Object, deleteLinked:Boolean = false):AsyncTokenDeletes a object with given obj_type and obj_id.
Parametersobject:Object — The object to delete. The object must contain the obj_type and obj_id properties.
|
|
deleteLinked:Boolean (default = false) — If true, linked objectes will be deleted too.
|
AsyncToken — AsyncToken which can be used to respond to the success or failure of the operation.
|
— If the object argument has no obj_type or obj_id property.
|
| getAllRights | () | method |
public function getAllRights(object:Object):AsyncTokenReturns all rights that users and groups have to this object.
Parametersobject:Object — The object to get rights for. The object must contain the obj_type and obj_id properties.
|
AsyncToken — AsyncToken which can be used to respond to the success or failure of the operation.
|
— If the object argument has no obj_type or obj_id property.
|
| getArticle | () | method |
public function getArticle(artUUID:String, withRights:Boolean = true, showLong:Boolean = true):AsyncTokenReturns details of the article with the given UUID.
ParametersartUUID:String — The UUID of the article.
|
|
withRights:Boolean (default = true) — Indicates if the rights are checked or not.
|
|
showLong:Boolean (default = true) — Show the long text of the article or not.
|
AsyncToken — AsyncToken which can be used to respond to the success or failure of the operation.
|
— If the artUUID argument is null or a empty string.
|
| getArticles | () | method |
public function getArticles(menuUUID:String, withRights:Boolean = true):AsyncTokenReturns all articles connected with the given menu.
ParametersmenuUUID:String — The UUID of the menu.
|
|
withRights:Boolean (default = true) — Indicates if the rights are checked or not.
Return only readable articles for the current user.
|
AsyncToken — AsyncToken which can be used to respond to the success or failure of the operation.
|
— If the menuUUID argument is null or a empty string.
|
| getContainers | () | method |
public function getContainers(menuUUID:String, withRights:Boolean = true):AsyncTokenReturn containers that are located on the given menu.
ParametersmenuUUID:String — The UUID of the menu.
|
|
withRights:Boolean (default = true) — Indicates if the rights are checked or not.
Return only readable containers for the current user.
|
AsyncToken — AsyncToken which can be used to respond to the success or failure of the operation.
|
— If the menuUUID argument is null or a empty string.
|
| getDomain | () | method |
public function getDomain():AsyncTokenGets the domain for the Flex session. If the operation call returns successfully the domain property will be set.
ReturnsAsyncToken — AsyncToken which can be used to respond to the success or failure of the operation.
|
| getDomainInfo | () | method |
public function getDomainInfo():AsyncTokenReturns the domain info for the current domain. If the operation call returns successfully the domainInfo property will be set.
ReturnsAsyncToken — AsyncToken which can be used to respond to the success or failure of the operation.
|
See also
| getLangId | () | method |
public function getLangId():AsyncTokenReturns the actual language for the Flex session, or the default language if it was not set. If the operation call returns successfully the langId property will be set.
ReturnsAsyncToken — AsyncToken which can be used to respond to the success or failure of the operation.
|
| getMenuPath | () | method |
public function getMenuPath(menuId:int, showRoot:Boolean = true, withRights:Boolean = true):AsyncTokenReturns a RecordSet with all the ancestors of the given menu, the root ancestor at the top. The method uses the root menu of the current domain as the root of hierarchy. If the domain is unknown, it takes the menu with id=0.
ParametersmenuId:int — The id of the menu.
|
|
showRoot:Boolean (default = true) — Indicates if the root menu is returned or not.
|
|
withRights:Boolean (default = true) — Indicates if the rights are checked or not.
|
AsyncToken — AsyncToken which can be used to respond to the success or failure of the operation.
|
| getMenus | () | method |
public function getMenus(showRoot:Boolean = true, withRights:Boolean = true, openedIds:String = null):AsyncTokenReturns menus, sorted in the same order as they are located in the tree. The method uses the root menu of the current domain as the root of hierarchy. If the domain is unknown, it takes the menu with id=0.
ParametersshowRoot:Boolean (default = true) — Indicates if the root menu is returned or not.
|
|
withRights:Boolean (default = true) — Indicates if the rights are checked or not.
|
|
openedIds:String (default = null) — Comma-separeted string with the IDs of open nodes in the tree.
|
AsyncToken — AsyncToken which can be used to respond to the success or failure of the operation.
|
| getObjectRights | () | method |
public function getObjectRights(object:Object):AsyncTokenReturns the right that the current user has to this object.
Parametersobject:Object — The object to get rights for. The object must contain the obj_type and obj_id properties.
|
AsyncToken — AsyncToken which can be used to respond to the success or failure of the operation.
|
— If the object argument has no obj_type or obj_id property.
|
| getObjects | () | method |
public function getObjects(sql:String, collection:ListCollectionView = null, withRights:Boolean = true, params:Array = null, treeOptions:TreeOptions = null):AsyncTokenExecutes the query and returns the data as a RecordSet value object. The query uses the current user (when withRights is true) and the current languageId. When a collection is passed to the function, it will be automatically filled with data, when the operation call returns successfully.
Parameterssql:String — The query. Can contain parameter, with parameter use '?' as placeholders.
|
|
collection:ListCollectionView (default = null) — Collection to fill with result data.
|
|
withRights:Boolean (default = true) — Indicates if the rights are checked or not. Return only readable objects
for the current user.
|
|
params:Array (default = null) — An array with parameter values. The size of the array must be equal to the
number of the placeholders in the query.
|
|
treeOptions:TreeOptions (default = null) — Various options of getting information from the tree structure.
|
AsyncToken — AsyncToken which can be used to respond to the success or failure of the operation.
|
— If the sql argument is null or a empty string.
|
See also
| getRoles | () | method |
public function getRoles():AsyncTokenReturns an array with all groups for the current user. If the operation call returns successfully the roles property will be set.
ReturnsAsyncToken — AsyncToken which can be used to respond to the success or failure of the operation.
|
| getRootMenuPath | () | method |
public function getRootMenuPath(menuId:int, rootId:int, showRoot:Boolean = true, withRights:Boolean = true):AsyncTokenReturns a Recordset with all the ancestors of the given menu, the root ancestor at the top.
ParametersmenuId:int — The id of the menu.
|
|
rootId:int — The id of the root ancestor.
|
|
showRoot:Boolean (default = true) — Indicates if the root menu is returned or not.
|
|
withRights:Boolean (default = true) — Indicates if the rights are checked or not.
|
AsyncToken — AsyncToken which can be used to respond to the success or failure of the operation.
|
| getRootMenus | () | method |
public function getRootMenus(rootId:int, showRoot:Boolean = true, withRights:Boolean = true, openedIds:String = null):AsyncTokenReturns menus, sorted in the same order as the are located in the tree.
ParametersrootId:int — The root of the tree structure.
|
|
showRoot:Boolean (default = true) — Indicates if the root menu is returned or not.
|
|
withRights:Boolean (default = true) — Indicates if the rights are checked or not.
|
|
openedIds:String (default = null) — Comma-separeted string with the IDs of open nodes in the tree.
|
AsyncToken — AsyncToken which can be used to respond to the success or failure of the operation.
|
| getSession | () | method |
public function getSession():AsyncTokenReturns the id of the current Flex session. If the operation call returns successfully the session property will be set.
ReturnsAsyncToken — AsyncToken which can be used to respond to the success or failure of the operation.
|
| getUserId | () | method |
public function getUserId():AsyncTokenReturns the current user id for the Flex session. If the operation call returns successfully the userId property will be set.
ReturnsAsyncToken — AsyncToken which can be used to respond to the success or failure of the operation.
|
| isUserInRole | () | method |
public function isUserInRole(groupIdOrName:Object):AsyncTokenChecks if the current user belongs to the group with the given id or the given name.
ParametersgroupIdOrName:Object — The id or a name of a group.
|
AsyncToken — AsyncToken which can be used to respond to the success or failure of the operation.
|
— If the groupIdOrName argument is not a integer or a string. If the
groupIdOrName argument is a empty string.
|
| loginUser | () | method |
public function loginUser(username:String, password:String, clientId:String = null):AsyncTokenLogs the user in. Sets the username and password as credentials for the J2FlexService. Set the parameters user_id (int), logged_in (Boolean) and u_tech_name (String) for the Flex session. Returns true if the authentication was successful, false otherwise.
Parametersusername:String — The username.
|
|
password:String — The password.
|
|
clientId:String (default = null) — The client generated id.
|
AsyncToken — AsyncToken which can be used to respond to the success or failure of the operation.
|
— If the username and/or password is null or a ampty string.
|
| logoutUser | () | method |
public function logoutUser():AsyncTokenLogs the user out. Removes the parameters user_id, logged_id and u_tech_name from the Flex session. Prefers also a logout on the J2FlexSerivce.
ReturnsAsyncToken — AsyncToken which can be used to respond to the success or failure of the operation.
|
| removeUserFromRole | () | method |
public function removeUserFromRole(userId:int, groupId:int):AsyncTokenRemove a user from a group.
ParametersuserId:int — The id of a user.
|
|
groupId:int — The id of the group to remove a user from.
|
AsyncToken — AsyncToken which can be used to respond to the success or failure of the operation.
|
| setConsumerClientId | () | method |
public function setConsumerClientId(clientId:String = null):AsyncTokenStores the client generated id used for point-to-point messaging between J2Flex and Flex clients. If no clientId or an empty string is passed to the function, a new clientId will be created by using the UIDUtil class.
ParametersclientId:String (default = null) — A client generated id.
|
AsyncToken — AsyncToken which can be used to respond to the success or failure of the operation.
|
See also
| setDomain | () | method |
public function setDomain(domain:String):AsyncTokenSaves domain for the Flex session. The domain property will be set to the new value.
Parametersdomain:String — The domain to set.
|
AsyncToken — AsyncToken which can be used to respond to the success or failure of the operation.
|
— If the domain argument is null or a empty string.
|
| setLang | () | method |
public function setLang(langId:int):AsyncTokenSets the current language id for the Flex session. The langId property will be set to the new value.
ParameterslangId:int — The id of language to set.
|
AsyncToken — AsyncToken which can be used to respond to the success or failure of the operation.
|
| setRoleRight | () | method |
public function setRoleRight(objType:int, objId:int, groupId:int, right:int):AsyncTokenSets group right on the object.
ParametersobjType:int — The type of the object.
|
|
objId:int — The id of the object.
|
|
groupId:int — The id of the group.
|
|
right:int — The rights to set to the group.
|
AsyncToken — AsyncToken which can be used to respond to the success or failure of the operation.
|
See also
| setUserRight | () | method |
public function setUserRight(objType:int, objId:int, userId:int, right:int):AsyncTokenSets user right on the object.
ParametersobjType:int — The type of the object.
|
|
objId:int — The id of the object.
|
|
userId:int — The id of the user.
|
|
right:int — The rights to set to the group.
|
AsyncToken — AsyncToken which can be used to respond to the success or failure of the operation.
|
See also
| updateObject | () | method |
public function updateObject(object:Object):AsyncTokenUpdates the object.
Parametersobject:Object — A object to update. The object must contain the obj_type and obj_id properties.
|
AsyncToken — AsyncToken which can be used to respond to the success or failure of the operation.
|
— If the object argument has no obj_tyoe or obj_id property.
|
| fault | event |
| result | event |
com.j2flex.events.J2FlexResultEvent
Dispatched when an J2FlexService call returns successfully.