public class MetadataTemplate extends BoxJSONObject
Modifier and Type | Class and Description |
---|---|
static class |
MetadataTemplate.Field
Class contains information about the metadata template field.
|
static class |
MetadataTemplate.FieldOperation
Posssible operations that can be performed in a Metadata template.
|
static class |
MetadataTemplate.Operation
Possible template operations.
|
static class |
MetadataTemplate.Option
Class contains information about the metadata template option.
|
static class |
MetadataTemplate.StaticConfig
Class contains information about the static configuration for the classification.
|
Modifier and Type | Field and Description |
---|---|
static URLTemplate |
ENTERPRISE_METADATA_URL_TEMPLATE |
static URLTemplate |
METADATA_TEMPLATE_BY_ID_URL_TEMPLATE |
static URLTemplate |
METADATA_TEMPLATE_SCHEMA_URL_TEMPLATE |
static URLTemplate |
METADATA_TEMPLATE_URL_TEMPLATE |
Constructor and Description |
---|
MetadataTemplate()
Constructs an empty metadata template.
|
MetadataTemplate(String json)
Constructs a metadata template from a JSON string.
|
Modifier and Type | Method and Description |
---|---|
static MetadataTemplate |
createMetadataTemplate(BoxAPIConnection api,
String scope,
String templateKey,
String displayName,
boolean hidden,
List<MetadataTemplate.Field> fields)
Creates new metadata template.
|
static MetadataTemplate |
createMetadataTemplate(BoxAPIConnection api,
String scope,
String templateKey,
String displayName,
Boolean hidden,
List<MetadataTemplate.Field> fields,
Boolean copyInstanceOnItemCopy)
Creates new metadata template.
|
static void |
deleteMetadataTemplate(BoxAPIConnection api,
String scope,
String template)
Deletes the schema of an existing metadata template.
|
static BoxResourceIterable<BoxItem.Info> |
executeMetadataQuery(BoxAPIConnection api,
MetadataQuery queryBody)
Executes a metadata query.
|
Boolean |
getCopyInstanceOnItemCopy()
Gets whether the copy operation should copy the metadata along with the item.
|
String |
getDisplayName()
Gets the displayed metadata template name.
|
static Iterable<MetadataTemplate> |
getEnterpriseMetadataTemplates(BoxAPIConnection api,
String... fields)
Returns all metadata templates within a user's enterprise.
|
static Iterable<MetadataTemplate> |
getEnterpriseMetadataTemplates(String scope,
BoxAPIConnection api,
String... fields)
Returns all metadata templates within a user's scope.
|
static Iterable<MetadataTemplate> |
getEnterpriseMetadataTemplates(String scope,
int limit,
BoxAPIConnection api,
String... fields)
Returns all metadata templates within a user's scope.
|
List<MetadataTemplate.Field> |
getFields()
Gets the iterable with all fields the metadata template contains.
|
String |
getID()
Gets the ID of the template.
|
Boolean |
getIsHidden()
Gets is the metadata template hidden.
|
static MetadataTemplate |
getMetadataTemplate(BoxAPIConnection api)
Gets the metadata template of properties.
|
static MetadataTemplate |
getMetadataTemplate(BoxAPIConnection api,
String templateName)
Gets the metadata template of specified template type.
|
static MetadataTemplate |
getMetadataTemplate(BoxAPIConnection api,
String templateName,
String scope,
String... fields)
Gets the metadata template of specified template type.
|
static MetadataTemplate |
getMetadataTemplateByID(BoxAPIConnection api,
String templateID)
Geta the specified metadata template by its ID.
|
String |
getScope()
Gets the metadata template scope.
|
String |
getTemplateKey()
Gets the unique template key to identify the metadata template.
|
static MetadataTemplate |
updateMetadataTemplate(BoxAPIConnection api,
String scope,
String template,
List<MetadataTemplate.FieldOperation> fieldOperations)
Updates the schema of an existing metadata template.
|
clearPendingChanges, getJson, getPendingChanges, getPendingChangesAsJsonObject, getPendingJSONObject
public static final URLTemplate METADATA_TEMPLATE_URL_TEMPLATE
getMetadataTemplate(BoxAPIConnection)
public static final URLTemplate METADATA_TEMPLATE_BY_ID_URL_TEMPLATE
public static final URLTemplate METADATA_TEMPLATE_SCHEMA_URL_TEMPLATE
public static final URLTemplate ENTERPRISE_METADATA_URL_TEMPLATE
public MetadataTemplate()
public MetadataTemplate(String json)
json
- the json encoded metadate template.public static MetadataTemplate createMetadataTemplate(BoxAPIConnection api, String scope, String templateKey, String displayName, boolean hidden, List<MetadataTemplate.Field> fields)
api
- the API connection to be used.scope
- the scope of the object.templateKey
- a unique identifier for the template.displayName
- the display name of the field.hidden
- whether this template is hidden in the UI.fields
- the ordered set of fields for the templatepublic static MetadataTemplate createMetadataTemplate(BoxAPIConnection api, String scope, String templateKey, String displayName, Boolean hidden, List<MetadataTemplate.Field> fields, Boolean copyInstanceOnItemCopy)
api
- the API connection to be used.scope
- the scope of the object.templateKey
- a unique identifier for the template.displayName
- the display name of the field.hidden
- whether this template is hidden in the UI.fields
- the ordered set of fields for the templatecopyInstanceOnItemCopy
- determines whether the copy operation should copy the metadata along with the item.public static MetadataTemplate updateMetadataTemplate(BoxAPIConnection api, String scope, String template, List<MetadataTemplate.FieldOperation> fieldOperations)
api
- the API connection to be usedscope
- the scope of the objecttemplate
- Unique identifier of the templatefieldOperations
- the fields that needs to be updated / added in the templatepublic static void deleteMetadataTemplate(BoxAPIConnection api, String scope, String template)
api
- the API connection to be usedscope
- the scope of the objecttemplate
- Unique identifier of the templatepublic static BoxResourceIterable<BoxItem.Info> executeMetadataQuery(BoxAPIConnection api, MetadataQuery queryBody)
api
- The API connection to be usedqueryBody
- The querypublic static MetadataTemplate getMetadataTemplate(BoxAPIConnection api)
api
- the API connection to be used.public static MetadataTemplate getMetadataTemplate(BoxAPIConnection api, String templateName)
api
- the API connection to be used.templateName
- the metadata template type name.public static MetadataTemplate getMetadataTemplate(BoxAPIConnection api, String templateName, String scope, String... fields)
api
- the API connection to be used.templateName
- the metadata template type name.scope
- the metadata template scope (global or enterprise).fields
- the fields to retrieve.public static MetadataTemplate getMetadataTemplateByID(BoxAPIConnection api, String templateID)
api
- the API connection to be used.templateID
- the ID of the template to get.public static Iterable<MetadataTemplate> getEnterpriseMetadataTemplates(BoxAPIConnection api, String... fields)
api
- the API connection to be used.fields
- the fields to retrieve.public static Iterable<MetadataTemplate> getEnterpriseMetadataTemplates(String scope, BoxAPIConnection api, String... fields)
scope
- the scope of the metadata templates.api
- the API connection to be used.fields
- the fields to retrieve.public static Iterable<MetadataTemplate> getEnterpriseMetadataTemplates(String scope, int limit, BoxAPIConnection api, String... fields)
scope
- the scope of the metadata templates.limit
- maximum number of entries per response.api
- the API connection to be used.fields
- the fields to retrieve.public String getTemplateKey()
public String getScope()
public String getDisplayName()
public Boolean getIsHidden()
public List<MetadataTemplate.Field> getFields()
public Boolean getCopyInstanceOnItemCopy()