AgileApps Support Wiki Pre Release

Server-Side Actions

From AgileApps Support Wiki
Revision as of 18:14, 6 May 2011 by imported>Aeric (→‎Common Parameters)
(diff) ← Older revision | Latest revision (diff) | Newer revision → (diff)

The AgileApps Cloud platform includes a number of built-in server-side actions. These actions are typically useful for an authenticated site. Common actions for a typical Web Application which supports authentication are listed here, and are used with the Common Parameters.

Considerations
  • Each action is available as a service through a URL and expects certain parameters for a successful execution.
  • Both HTTP GET and HTTP POST are supported for these actions.
Action Description URL
Login to the site Used to Login a User to the AgileApps Cloud platform Base URL + "/login"
Register a New User Used to Register as a User in the AgileApps Cloud platform Base URL + "/register"
Change Password Used to Change a User Password Base URL + "/change_password"
Update Profile Used to update a User Profile Base URL + "/update_profile"
Validate the Security Question Used to validate the security question, as part of the Forgot my Password process Base URL + "/validate_security_question"
Reset Password Used to Reset a User Password Base URL + "/reset_password"
Manage Objects Used to add/update/delete a record in an Object Base URL + "/service"
Download File Used to download a Document Base URL + "/download_file"
Logout from the Site Used to Logout a User from the AgileApps Cloud platform Base URL + "/logout"

Common Parameters

The following common parameters are required for all Server-Side Actions:

Parameter Required Description
__oe Yes On Error, a relative URL which is executed when an error occurs
__os Yes On Success, a relative URL which is executed when a successful action is executed. Example URL for __os and __oe will be “pages/home.jsp” or “controller/com/platform/{namespace}/{package}/GetRecords”
__pc No This is the class that is executed before the action is executed. This can be used for validations before a controller or a server side action is executed. This can be used to execute some code before server side action is executed, when the controller is Platform.
__pcm No Method of class identified by __pc, that is executed before the action is executed. This can be used for validations before a controller or a server side action is executed. This can be used to execute some code before server side action is executed, when the controller is Platform.

Login to the site

Performs same behavior as Login. Requires following HTML parameters to be submitted:

URL
Syntax: Base URL + "/login"
Example: http://{domain}/networking/sites/123456/[MySiteName]/login
Parameters
login
Username of the user logging in to the site
password
Password associated with the username

Register a New User

Used for registering a new site user. Requires following HTML parameters to be submitted.

URL
Syntax: Base URL + "/register"
Example: http://{domain}/networking/sites/123456/[siteName]/register
Parameters
first_name
First Name of the user
last_name
Last Name of the user
email
Email of the user
username
Username of the user
password
Password of the user
password2
Password of the user for confirmation
custom_security_question
Security question of the user, in case the user forgets the password
security_answer
Security answer in case the user forgets the password

Change Password

Used for changing user’s password. The user is required to be logged in for this action to take place.

URL
Syntax: Base URL + "/change_password"
Example: http://{domain}/networking/sites/123456/[siteName]/change_password
Parameters
old_password
Old password of the user
password
New password of the user
password2
New password of the user, for confirmation

Update Profile

Used for updating user’s profile. The user is required to be logged in for this action to take place.

URL
Syntax: Base URL + "/update_profile"
Example: http://{domain}/networking/sites/123456/[siteName]/update_profile
Parameters
first_name
First Name of the user
last_name
Last Name of the user
email
Email of the user
street
Street part of the user’s address
city
City part of the user’s address
state
State part of the user’s address
zip
Zip part of the user’s address
country
Country part of the user’s address
company
Company of the user
title
title of the user
division
Division of the user. Generally used for different departments within a company
phone
Phone number of the user
fax
Fax number of the user
mobile
Mobile number of the user
custom_security_question
Security Question in case user forgets the password
security_answer
Security Answer in case user forgets the password

Validate the Security Question

Used for validating the Security Question entered by the user. This action is particularly used for the Forgot My Password use case.

URL
Syntax: Base URL + "/validate_security_question"
Example: http://{domain}/networking/sites/123456/[siteName]/validate_security_question
Parameters
username
Username of the user
custom_security_question
Security Question, in case user forgot the password
security_answer
Security Answer, in case user forgot the password

Reset Password

Used for resetting user’s password. This action is particularly used for forgot password use case.

URL
Syntax: Base URL + "/reset_password"
Example: http://{domain}/networking/sites/123456/[siteName]/reset_password
Parameters
password
new password of the user
password2:new password of the user for confirmation

Manage Objects

Used to add/update/delete a record in a Custom Object.

URL
Syntax: Base URL + "/service"
Example: http://{domain}/networking/sites/123456/[siteName]/service
Parameters
action
action is one of add/update/delete for a custom object.
object
Name/Id of the object user wants to take action upon.
[fieldName]
Any field that is part of the object. Field list is same as that is being used for Java APIs. Please refer to the Java API documentation on how to retrieve the field names. For update and delete operation, id is the required attribute.

Download File

Used for downloading a file for an id. It can download any document that is uploaded in the Documents tag.

URL
Syntax: Base URL + "/download_file"
Example: http://{domain}/networking/sites/123456/[siteName]/download_file
Parameters
id
id of the file that is to be downloaded
Learn more: Tags

Logout from the Site

Used for logging out from the Site.

URL
Syntax: Base URL + "/logout"
Example: http://{domain}/networking/sites/123456/[siteName]/logout
Parameters
None
Learn more: Tags