Constructor and Description |
---|
Services(IMetaModel metaModel,
IAPIConnector connector) |
Services(V1Connector v1Connector) |
Modifier and Type | Method and Description |
---|---|
Asset |
createNew(IAssetType assetType,
Oid context)
Create new Asset
|
Oid |
executeOperation(IOperation op,
Oid oid)
Execute an operation on the server
|
String |
executePassThroughQuery(String query)
Executes a Query API query using in JSON or YAML format.
|
IAPIConnector |
get_connector() |
Oid |
get_loggedin() |
IAssetType |
getAssetType(String token)
Get the asset type from an token
|
Reader |
getAttachment(Oid attachmentOid)
Returns the attachment data for the specified attachment Oid.
|
IAttributeDefinition |
getAttributeDefinition(String token)
Get the attribute definition
|
Reader |
getEmbeddedImage(Oid embeddedImageOid)
Returns the embedded image data for the specified attachment Oid.
|
Map<String,String> |
getLocalization(ArrayList<IAttributeDefinition> attributes)
Returns a Map of localized values.
|
String |
getLocalization(IAttributeDefinition attribute)
Returns a localization value based on an attribute definition.
|
String |
getLocalization(String key)
Returns a localization value based on key.
|
Oid |
getLoggedIn()
Get the Oid of the current logged in user
|
IMetaModel |
getMeta()
Returns the MetaModel.
|
Oid |
getOid(String token)
Get the Object Identifier from a token
|
IOperation |
getOperation(String token)
Get an operation from a token
|
V1Connector |
getV1Connector()
Returns the V1Connector.
|
QueryResult |
retrieve(Query query)
Query VersionOne
|
void |
save(Asset asset)
Save an asset with no comment
|
void |
save(Asset[] assets)
Save an array of assets without comment
|
void |
save(Asset asset,
String comment)
Save an asset with comment
|
Oid |
saveAttachment(String filePath,
Asset asset,
String attachmentName)
Saves an attachment to the specified asset.
|
Oid |
saveEmbeddedImage(String filePath,
Asset asset)
Saves an embedded image to the specified asset.
|
public Services(IMetaModel metaModel, IAPIConnector connector)
metaModel
- - VersionOne MetaModelconnector
- - Connection to the serverpublic Services(V1Connector v1Connector)
public IMetaModel getMeta()
IServices
public IAPIConnector get_connector()
public Oid get_loggedin()
public V1Connector getV1Connector()
IServices
getV1Connector
in interface IServices
public QueryResult retrieve(Query query) throws ConnectionException, APIException, OidException
retrieve
in interface IServices
query
- The query to execute.ConnectionException
- - if connection to VersionOne downAPIException
- if there is a problem executing the queryOidException
- - if there is problem related to Object IdentifiersIServices.retrieve(Query)
public Asset createNew(IAssetType assetType, Oid context) throws V1Exception
createNew
in interface IServices
assetType
- The type of asset to createcontext
- - context under which to create the assetV1Exception
- - when the create failsIServices.createNew(IAssetType, Oid)
public Oid executeOperation(IOperation op, Oid oid) throws APIException
executeOperation
in interface IServices
op
- The operation to executeoid
- - OID of object on which method is executedAPIException
- - when the operation failsIServices.executeOperation(IOperation, Oid)
public IAssetType getAssetType(String token) throws MetaException
getAssetType
in interface IServices
token
- The token to processMetaException
- if the token is invalidIServices.getAssetType(String)
public IAttributeDefinition getAttributeDefinition(String token) throws MetaException
getAttributeDefinition
in interface IServices
token
- The token to processMetaException
- if the token is invalidIServices.getAttributeDefinition(String)
public Oid getOid(String token) throws OidException
getOid
in interface IServices
token
- The token to processOidException
- if the token is invalidIServices.getOid(String)
public IOperation getOperation(String token) throws MetaException
getOperation
in interface IServices
token
- The token to processMetaException
- if the token is invalidIServices.getOperation(String)
public Oid getLoggedIn() throws APIException, ConnectionException, OidException
getLoggedIn
in interface IServices
APIException
- - if there is any other errorConnectionException
- - if connection to VersionOne downOidException
- - if there is problem related to Object IdentifiersIServices.getLoggedIn()
public void save(Asset asset) throws APIException, ConnectionException
save
in interface IServices
asset
- The asset that changedAPIException
- - if the save failsConnectionException
- - if connection to VersionOne downIServices.save(Asset)
public void save(Asset asset, String comment) throws APIException, ConnectionException
save
in interface IServices
asset
- The asset that changedcomment
- - commentAPIException
- - if the save failsConnectionException
- - if connection to VersionOne downIServices.save(Asset, String)
public void save(Asset[] assets) throws V1Exception
save
in interface IServices
assets
- An array of assets to saveV1Exception
- - if the save failsIServices.save(Asset[])
public String executePassThroughQuery(String query)
IServices
executePassThroughQuery
in interface IServices
query
- The query JSON or YAML query stringpublic String getLocalization(IAttributeDefinition attribute) throws V1Exception
IServices
getLocalization
in interface IServices
attribute
- An attribute definitionV1Exception
- V1Exceptionpublic String getLocalization(String key) throws V1Exception
IServices
getLocalization
in interface IServices
key
- String A string value of the keyV1Exception
- V1Exceptionpublic Map<String,String> getLocalization(ArrayList<IAttributeDefinition> attributes) throws ConnectionException
IServices
getLocalization
in interface IServices
attributes
- attributesConnectionException
- ConnectionExceptionpublic Oid saveAttachment(String filePath, Asset asset, String attachmentName) throws V1Exception, IOException
IServices
saveAttachment
in interface IServices
filePath
- Path and name of the attachment file.asset
- Asset to save the attachment to.attachmentName
- The name of the attachment.V1Exception
- V1ExceptionIOException
- IOExceptionpublic Reader getAttachment(Oid attachmentOid) throws V1Exception
IServices
getAttachment
in interface IServices
attachmentOid
- The Oid of the attachment to return.V1Exception
- V1Exceptionpublic Oid saveEmbeddedImage(String filePath, Asset asset) throws V1Exception, IOException
IServices
saveEmbeddedImage
in interface IServices
filePath
- Path and name of the embedded image file.asset
- Asset to save the embedded image to.V1Exception
- V1ExceptionIOException
- IOExceptionpublic Reader getEmbeddedImage(Oid embeddedImageOid) throws V1Exception
IServices
getEmbeddedImage
in interface IServices
embeddedImageOid
- The Oid of the embedded image to return.V1Exception
- V1ExceptionCopyright © 2015 VersionOne, Inc.. All rights reserved.