| Constructor and Description |
|---|
Services(IMetaModel metaModel,
IAPIConnector connector) |
Services(V1Connector v1Connector) |
Services(V1Connector connector,
boolean preLoadMeta) |
Services(V1Connector connector,
IMetaModel metaModel) |
| 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
|
InputStream |
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) throws org.apache.commons.lang.NullArgumentException
org.apache.commons.lang.NullArgumentExceptionpublic Services(V1Connector connector, IMetaModel metaModel) throws org.apache.commons.lang.NullArgumentException
org.apache.commons.lang.NullArgumentExceptionpublic Services(V1Connector connector, boolean preLoadMeta) throws org.apache.commons.lang.NullArgumentException
org.apache.commons.lang.NullArgumentExceptionpublic IMetaModel getMeta()
IServicespublic IAPIConnector get_connector()
public Oid get_loggedin()
public V1Connector getV1Connector()
IServicesgetV1Connector in interface IServicespublic QueryResult retrieve(Query query) throws ConnectionException, APIException, OidException
retrieve in interface IServicesquery - 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 IServicesassetType - 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 IServicesop - 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 IServicestoken - The token to processMetaException - if the token is invalidIServices.getAssetType(String)public IAttributeDefinition getAttributeDefinition(String token) throws MetaException
getAttributeDefinition in interface IServicestoken - The token to processMetaException - if the token is invalidIServices.getAttributeDefinition(String)public Oid getOid(String token) throws OidException
getOid in interface IServicestoken - The token to processOidException - if the token is invalidIServices.getOid(String)public IOperation getOperation(String token) throws MetaException
getOperation in interface IServicestoken - The token to processMetaException - if the token is invalidIServices.getOperation(String)public Oid getLoggedIn() throws APIException, ConnectionException, OidException
getLoggedIn in interface IServicesAPIException - - 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 IServicesasset - 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 IServicesasset - 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 IServicesassets - An array of assets to saveV1Exception - - if the save failsIServices.save(Asset[])public String executePassThroughQuery(String query)
IServicesexecutePassThroughQuery in interface IServicesquery - The query JSON or YAML query stringpublic String getLocalization(IAttributeDefinition attribute) throws V1Exception
IServicesgetLocalization in interface IServicesattribute - An attribute definitionV1Exception - V1Exceptionpublic String getLocalization(String key) throws V1Exception
IServicesgetLocalization in interface IServiceskey - String A string value of the keyV1Exception - V1Exceptionpublic Map<String,String> getLocalization(ArrayList<IAttributeDefinition> attributes) throws ConnectionException
IServicesgetLocalization in interface IServicesattributes - attributesConnectionException - ConnectionExceptionpublic Oid saveAttachment(String filePath, Asset asset, String attachmentName) throws V1Exception, IOException
IServicessaveAttachment in interface IServicesfilePath - Path and name of the attachment file.asset - Asset to save the attachment to.attachmentName - The name of the attachment.V1Exception - V1ExceptionIOException - IOExceptionpublic InputStream getAttachment(Oid attachmentOid) throws V1Exception
IServicesgetAttachment in interface IServicesattachmentOid - The Oid of the attachment to return.V1Exception - V1Exceptionpublic Oid saveEmbeddedImage(String filePath, Asset asset) throws V1Exception, IOException
IServicessaveEmbeddedImage in interface IServicesfilePath - 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
IServicesgetEmbeddedImage in interface IServicesembeddedImageOid - The Oid of the embedded image to return.V1Exception - V1ExceptionCopyright © 2016 VersionOne, Inc.. All rights reserved.