Package com.podio.app
Class AppAPI
- java.lang.Object
-
- com.podio.BaseAPI
-
- com.podio.app.AppAPI
-
public class AppAPI extends BaseAPI
This area is used to manage application definitions. An application definition, commonly called just an app, is the setup of an application. It consists primarily of a list of fields and secondly of various settings.
-
-
Constructor Summary
Constructors Constructor Description AppAPI(ResourceFactory resourceFactory)
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description voidactivateApp(int appId)Activates a deactivated app.intaddApp(ApplicationCreate app)Creates a new app on a space.intaddField(int appId, ApplicationFieldCreate field)Adds a new field to an appvoiddeactivateApp(int appId)Deactivates the app with the given id.voiddeleteApp(int appId)Deletes the app with the given id.voiddeleteField(int appId, int fieldId)Deletes a field on an app.ApplicationgetApp(int appId)Gets the definition of an app and can include configuration and fields.List<Application>getApps()Returns the apps available to the user.List<Application>getAppsOnSpace(int spaceId)Returns all the apps on the space that are visible.DependenciesgetDependencies(int appId)Returns the apps that the given app depends on.ApplicationFieldgetField(int appId, int fieldId)Returns a single field from an app.ApplicationFieldgetField(int appId, String externalId)Returns a single field from an app.List<Application>getTopApps(Integer limit)Returns the top apps for the active user.intinstall(int appId, int spaceId)Installs the app with the given id on the space.voidupdateApp(int appId, ApplicationUpdate app)Updates an app.voidupdateField(int appId, int fieldId, ApplicationFieldConfiguration configuration)Updates the configuration of an app field.voidupdateOrder(int spaceId, List<Integer> appIds)Updates the order of the apps on the space.-
Methods inherited from class com.podio.BaseAPI
getResourceFactory
-
-
-
-
Constructor Detail
-
AppAPI
public AppAPI(ResourceFactory resourceFactory)
-
-
Method Detail
-
getApp
public Application getApp(int appId)
Gets the definition of an app and can include configuration and fields. This method will always return the latest revision of the app definition.- Parameters:
appId- The id of the app to be returned- Returns:
- The full definition of the app
-
getAppsOnSpace
public List<Application> getAppsOnSpace(int spaceId)
Returns all the apps on the space that are visible. The apps are sorted by any custom ordering and else by name.- Parameters:
spaceId- The id of the space- Returns:
- The list of apps on the given space
-
getTopApps
public List<Application> getTopApps(Integer limit)
Returns the top apps for the active user. This is the apps that the user have interacted with the most.- Parameters:
limit- The maximum number of apps to return, defaults to 4.- Returns:
- The top apps for the active user
-
addApp
public int addApp(ApplicationCreate app)
Creates a new app on a space.- Parameters:
app- The definition for the new app- Returns:
- The id of the newly created app
-
updateApp
public void updateApp(int appId, ApplicationUpdate app)Updates an app. The update can contain an new configuration for the app, addition of new fields as well as updates to the configuration of existing fields. Fields not included will not be deleted. To delete a field use the "delete field" operation.When adding/updating/deleting apps and fields, it can be simpler to only update the app config here and add/update/remove fields using the field/{field_id} sub resource.
- Parameters:
appId- The id of the app to be updatedapp- The updated app definition
-
addField
public int addField(int appId, ApplicationFieldCreate field)Adds a new field to an app- Parameters:
appId- The id of the the field should be added tofield- The definition of the new field- Returns:
- The id of the newly created field
-
updateField
public void updateField(int appId, int fieldId, ApplicationFieldConfiguration configuration)Updates the configuration of an app field. The type of the field cannot be updated, only the configuration.- Parameters:
appId- The id of the app the field is onefieldId- The id of the field to be updatedconfiguration- The new configuration of the field
-
getField
public ApplicationField getField(int appId, int fieldId)
Returns a single field from an app.- Parameters:
appId- The id of the app the field is onfieldId- The id of the field to be returned- Returns:
- The definition and current configuration of the requested field
-
getField
public ApplicationField getField(int appId, String externalId)
Returns a single field from an app.- Parameters:
appId- The id of the app the field is onexternalId- The id of the field to be returned- Returns:
- The definition and current configuration of the requested field
-
deleteField
public void deleteField(int appId, int fieldId)Deletes a field on an app. When deleting a field any new items and updates to existing items will not have this field present. For existing items, the field will still be presented when viewing the item.- Parameters:
appId- The id of the app the field is onfieldId- The id of the field that should be deleted
-
install
public int install(int appId, int spaceId)Installs the app with the given id on the space.- Parameters:
appId- The id of the app to be installedspaceId- The id of the space the app should be installed o n- Returns:
- The id of the newly installed app
-
updateOrder
public void updateOrder(int spaceId, List<Integer> appIds)Updates the order of the apps on the space. It should post all the apps from the space in the order required.- Parameters:
spaceId- The id of the space the apps are onappIds- The ids of the apps in the new order
-
getApps
public List<Application> getApps()
Returns the apps available to the user.- Returns:
- The list of apps the user has access to
-
getDependencies
public Dependencies getDependencies(int appId)
Returns the apps that the given app depends on.- Parameters:
appId- The id of the app the dependecies should be returned for- Returns:
- The applications that the given app depends on
-
deactivateApp
public void deactivateApp(int appId)
Deactivates the app with the given id. This removes the app from the app navigator, and disables insertion of new items.- Parameters:
appId- The id of the app to deactivate
-
activateApp
public void activateApp(int appId)
Activates a deactivated app. This puts the app back in the app navigator and allows insertion of new items.- Parameters:
appId- The id of the app to activate
-
deleteApp
public void deleteApp(int appId)
Deletes the app with the given id. This will delete all items, widgets, filters and shares on the app. This operating is not reversible.- Parameters:
appId- The id of the app to delete
-
-