public class ItemAPI extends BaseAPI
| Constructor and Description |
|---|
ItemAPI(ResourceFactory resourceFactory) |
| Modifier and Type | Method and Description |
|---|---|
int |
addItem(int appId,
ItemCreate create,
boolean silent)
Adds a new item to the given app.
|
void |
deleteItem(int itemId,
boolean silent)
Deletes an item and removes it from all views.
|
Item |
getItem(int itemId)
Gets the item with the given id
|
List<Map<String,Object>> |
getItemFieldValues(int itemId,
int fieldId)
Returns the values for a specified field on an item
|
List<ItemReference> |
getItemReference(int itemId)
Returns the items that have a reference to the given item.
|
ItemRevision |
getItemRevision(int itemId,
int revisionId)
Returns the data about the specific revision on an item
|
List<ItemFieldDifference> |
getItemRevisionDifference(int itemId,
int revisionFrom,
int revisionTo)
Returns the difference in fields values between the two revisions.
|
List<ItemRevision> |
getItemRevisions(int itemId)
Returns all the revisions that have been made to an item
|
ItemsResponse |
getItems(int appId,
Integer limit,
Integer offset,
SortBy sortBy,
Boolean sortDesc,
FilterByValue<?>... filters)
Returns the items on app matching the given filters.
|
ItemsResponse |
getItemsByExternalId(int appId,
String externalId)
Utility method to get items matching an external id
|
List<ItemMini> |
getItemsByFieldAndTitle(int fieldId,
String text)
Used to find possible items for a given application field.
|
List<FieldValuesView> |
getItemValues(int itemId)
Returns all the values for an item, with the additional data provided by
the get item operation.
|
void |
updateItem(int itemId,
ItemUpdate update,
boolean silent,
boolean hook)
Updates the entire item.
|
void |
updateItemFieldValues(int itemId,
int fieldId,
List<Map<String,Object>> values,
boolean silent,
boolean hook)
Update the item values for a specific field.
|
void |
updateItemValues(int itemId,
List<FieldValuesUpdate> values,
boolean silent,
boolean hook)
Updates all the values for an item
|
getResourceFactorypublic ItemAPI(ResourceFactory resourceFactory)
public int addItem(int appId,
ItemCreate create,
boolean silent)
appId - The id of the app the item should be added tocreate - The data for the new itemsilent - True if the create should be silten, false otherwisepublic Item getItem(int itemId)
itemId - The id of the itempublic void updateItem(int itemId,
ItemUpdate update,
boolean silent,
boolean hook)
itemId - The id of the item to updateupdate - The data for the updatesilent - True if the update should be silent, false otherwisehook - True if hooks should be executed for the change, false otherwisepublic void updateItemValues(int itemId,
List<FieldValuesUpdate> values,
boolean silent,
boolean hook)
itemId - The id of the itemvalues - The values for the fieldssilent - True if the update should be silent, false otherwisehook - True if hooks should be executed for the change, false otherwisepublic void updateItemFieldValues(int itemId,
int fieldId,
List<Map<String,Object>> values,
boolean silent,
boolean hook)
itemId - The id of the itemfieldId - The id of the fieldvalues - The new values for the fieldsilent - True if the update should be silent, false otherwisehook - True if hooks should be executed for the change, false otherwisepublic void deleteItem(int itemId,
boolean silent)
itemId - The id of the itemsilent - True if the deletion should be silent, false otherwisepublic List<Map<String,Object>> getItemFieldValues(int itemId, int fieldId)
itemId - The id of the itemfieldId - The id of the fieldpublic List<FieldValuesView> getItemValues(int itemId)
itemId - The id of the itempublic List<ItemMini> getItemsByFieldAndTitle(int fieldId, String text)
fieldId - The id of app reference field to search fortext - The text to search for in the items titlepublic List<ItemReference> getItemReference(int itemId)
itemId - The id of the itempublic ItemRevision getItemRevision(int itemId, int revisionId)
itemId - The id of the itemrevisionId - The running revision number, starts at 0 for the initial
revisionpublic List<ItemFieldDifference> getItemRevisionDifference(int itemId, int revisionFrom, int revisionTo)
itemId - The id of the itemrevisionFrom - The from revisionrevisionTo - The to revisionpublic List<ItemRevision> getItemRevisions(int itemId)
itemId - The id of the itempublic ItemsResponse getItems(int appId, Integer limit, Integer offset, SortBy sortBy, Boolean sortDesc, FilterByValue<?>... filters)
appId - The id of the applimit - The maximum number of items to receive, defaults to 20offset - The offset from the start of the items returned, defaults to 0sortBy - How the items should be sorted. For the possible options, see
the filter area.sortDesc - true or leave out to sort descending, use
false to sort ascendingfilters - The filters to applypublic ItemsResponse getItemsByExternalId(int appId, String externalId)
appId - The id of the appexternalId - The external idCopyright © 2014. All Rights Reserved.