Skip to main content

mbga.TextData

Method​

mbga.TextData.getId​

String getId()

mbga.TextData.getData​

String getData()

mbga.TextData.getStatus​

String getStatus()

mbga.TextData.getWriterId​

String getWriterId()

mbga.TextData.getOwnerId​

String getOwnerId()

mbga.TextData.getField​

Object getField(name)

mbga.TextData.setField​

void setField(name, value)

mbga.TextData.Field​

mbga.TextData.Field.ID​

The id of the TextData.

mbga.TextData.Field.GROUP_NAME​

The name of the TextDataGroups.

mbga.TextData.Field.PARENT_ID​

The id of the parent TextData.

mbga.TextData.Field.WRITER_ID​

The user ID of the person who wrote the TextData.

mbga.TextData.Field.OWNER_ID​

The user ID of the owner of the TextData.

mbga.TextData.Field.DATA​

Main text of the TextData.

mbga.TextData.Field.STATUS​

Logical status value of the TextData. Below is a comparison chart of integer values and status contents.

ValueDescription
0Normal
11Modified by user
21Modified by operator
31Modified by partner

mbga.TextData.Field.PUBLISHED​

Date and time the TextData was generated.

mbga.TextData.Field.UPDATED​

Date and time the TextData was updated.

mbga.TextDataRequestFields​

A list of fields that can be used with mbga.newFetchTextDataRequest or mbga.requestFetchTextData opt_params.

mbga.TextDataRequestFields.TEXTDATA_ID​

Specifies the TextData ID to be updated/deleted.

mbga.TextDataRequestFields.TEXTDATA_GROUP_NAME​

Specifies the TextData group name.

mbga.TextDataRequestFields.TEXTDATA​

Specifies the TextData data to be newly created/updated.

mbga.TextDataRequestFields.SORT_BY​

This can be assigned from mbga.TextDataRequest.SortBy. In the following sample, TextData that has been sorted in descending order based on its updated date and time (from most recent to oldest) is acquired.

Sample​
var params = {};
params[mbga.TextDataRequestFields.TEXTDATA_GROUP_NAME] = "message_board"; // required
params[mbga.TextDataRequestFields.SORT_BY] = mbga.TextDataRequest.SortBy.UPDATED;
params[mbga.TextDataRequestFields.SORT_ORDER] = mbga.TextDataRequest.SortOrder.DESCENDING.;

mbga.requestFetchTextData(params, function(response) {
if (response.hadError()) {
// error handling
} else {
var textdatas = response.getData();

textdatas.each(function(textdata) {
var writerId = textdata.getWriterId();
// ...
});
}
});

mbga.TextDataRequestFields.SORT_ORDER​

This can be assigned from mbga.TextData.SortOrder.

mbga.TextDataRequestFields.FILTER_BY​

mbga.TextDataRequest.FilterBy can be specified.

mbga.TextDataRequestFields.FILTER_VALUE​

The field used for filtering.
OwnerId or writerId values can be specified.In the sample below, only TextData for which the ownerID is "10000" is acquired.

Sample​
var params = {};
params[mbga.TextDataRequestFields.TEXTDATA_GROUP_NAME] = "message_board"; // required
params[mbga.TextDataRequestFields.FILTER_BY] = mbga.TextDataRequest.FilterBy.OWNER_ID.;
params[mbga.TextDataRequestFields.FILTER_OP] = mbga.TextDataRequest.FilterOp.EQUALS.;
params[mbga.TextDataRequestFields.FILTER_VALUE] = "10000";

mbga.requestFetchTextData(params, function(response) {
if (response.hadError()) {
// error handling
} else {
var textdatas = response.getData();

textdatas.each(function(textdata) {
var writerId = textdata.getWriterId();
// ...
});
}
});

mbga.TextDataRequestFields.FILTER_OP​

mbga.TextDataRequest.FilterOp can be specified.

mbga.TextDataRequestFields.FIRST​

The starting position of TextData acquisition is assigned using natural numbers. Normally, it is used for paging data that is acquired at the same time as mbga.TextDataRequestFields.MAX. The default value is 1.

In the following sample, the blacklist data to be acquired is first split into 5 per page, and then the 5 pieces of data on the third page from the top are acquired. If the assigned number of data units does not exist on the pertinent page, just enough data is acquired so that it can be returned.

Sample​
var params = {};
params[mbga.TextDataRequestFields.TEXTDATA_GROUP_NAME] = "message_board"; // required
params[mbga.TextDataRequestFields.MAX] = 5;
params[mbga.TextDataRequestFields.FIRST] = 3;

mbga.requestFetchTextData(params, function(response) {
if (response.hadError()) {
// error handling
} else {
var textdatas = response.getData();

textdatas.each(function(textdata) {
var writerId = textdata.getWriterId();
// ...
});
}
});

mbga.TextDataRequestFields.MAX​

The maximum number of TextData acquisitions is assigned using natural numbers. Normally, it is used for paging data that is acquired at the same time as mbga.TextDataRequestFields.FIRST. The default value is 50.

mbga.TextDataRequestFields.FORMAT​

mbga.TextDataRequest.Format can be specified.

mbga.TextDataRequestFields.FIELDS​

Specifies arrays with fields to be acquired from those in mbga.TextData.Fields arranged.

mbga.TextDataRequest.SortBy​

mbga.TextDataRequest.SortBy.ID​

Sorting is performed using the mbga.TextData.Field.ID value as a key.

mbga.TextDataRequest.SortBy.UPDATED​

Sorting is performed using the mbga.TextData.Field.UPDATED value as a key.

mbga.TextDataRequest.SortOrder​

mbga.TextDataRequest.SortOrder.ASCENDING​

Sorting is performed in ascending order of the key values.

mbga.TextDataRequest.SortOrder.DESCENDING​

Sorting is performed in descending order of the key values.

mbga.TextDataRequest.FilterBy​

mbga.TextDataRequest.FilterBy.OWNER_ID​

Filtering is performed using the mbga.TextData.Field.OWNER_ID value.

mbga.TextDataRequest.FilterBy.WRITER_ID​

Filtering is performed using the mbga.TextData.Field.WRITER_ID value.

mbga.TextDataRequest.FilterOp​

mbga.TextDataRequest.FilterOp.EQUALS​

A value equivalent to that assigned in mbga.TextDataRequestFields.FILTER_VALUE is set as the filtering condition.

mbga.TextDataRequest.Format​

mbga.TextDataRequest.Format.JSON​

Revision History​

  • 12/2010
    • Initial Release.