Inputting and Displaying Free Text
The Mobage open platform has an API for acquiring and saving free text that users have input. The saved text is monitored.
The mbga feature specifications must be declared with Required Elements in Gadget XML in order to use this API.
Creating a TextDataGroup
A TextDataGroup object for grouping TextData objects must be created beforehand with API access through a Trusted Model (OAuth Consumer Request).
See here for more information on generating TextDataGroup objects.
Inputting free text
The following is sample code for creating free text on the server.
- Specify the free text you want to input as a parameter in TEXTDATA, and specify the name of the TextDataGroup you want to save in TEXT_DATA_GROUP_NAME.
- Use the requestCreateTextData() method to generate a TextData object on the server.
- The generated TextData object is returned in the callback function.
Displaying free text
The following is sample code for acquiring created free text.
- Specify the name of the saved TextDataGroup in TEXTDATA_GROUP_NAME and specify the ID of the TextData object in TEXTDATA_ID.
- Generate a DataRequest object with newDataRequest().
- Specify the parameters in newFetchTextDataRequest() and add them to the DataRequest.
- Send a request to the server with the send() method.
- The callback function is called, including the acquired TextData.
Changing and deleting free text
The following is sample code for changing created free text.
- Specify the free text you want to change as a parameter in the TEXTDATA, the name of the saved TextDataGroup in the TEXT_DATA_GROUP_NAME, and the TextData object ID you want to change in the TEXTDATA_ID.
- Use the requestUpdateTextData() method to make a TextData object change request to the server.
- A NULL object is returned to the callback function.
The following is sample code for deleting created free text.
- Specify the name of the TextDataGroup that was saved as parameters in TEXT_DATA_GROUP_NAME and the ID of the TextData object you want to delete in TEXTDATA_ID.
- Use the requestRemoveTextData() method to make a TextData object delete request to the server.
- The ID of the deleted TextData is returned to the callback function.
The following are the current restrictions on TextData.
- Five TextDataGroups can be created per application.
- The maximum number of entries that can be stored in each TextDataGroup is 100,000 for up to 10,000 users who installed the application.
- If more than 10,000 users have installed the application up to the previous day, the maximum number of entries is 10 times the number of users who installed the application according to the count up to the previous day.
- If the maximum number of entries is exceeded, the oldest entry in the entries for that group will be logically deleted as needed (status value = 20).
- Data that was logically deleted three months prior then becomes physically deleted. In this case, the entry resource of the deleted TextData no longer exists, and even if an entry resource is acquired with GET, 404 Not Found is returned.
- Initial Release.