Interface IResourceService
This interface has operations for light resource management.
Syntax
public interface IResourceService
Methods
CloneAndPublish(ResourceType, LightResourceInfo)
Creates a clone of an existing resource. The newly created resource will have the same data as the original one, but the properties (name, description, etc.) will be as defined by the resourceInfo parameter.
Declaration
Guid CloneAndPublish(ResourceType resourceType, LightResourceInfo resourceInfo)
Parameters
Type | Name | Description |
---|---|---|
ResourceType | resourceType | The type of the resource to be cloned. |
LightResourceInfo | resourceInfo | The parameters of the resource to be created.
|
Returns
Type | Description |
---|---|
Guid | The Guid of the newly created resource. |
Exceptions
Type | Condition |
---|---|
UnexpectedFault | An unexpected error occurred; equivalent of an 501 'Internal server error' http result. |
GenericFault | The details within the fault identify the specific error. Thrown for expected business errors that have no specific faults. |
CreateAndPublish(ResourceType, LightResourceInfo)
Creates a new resource with the parameters specified by the resourceInfo parameter. FilterConfig resources can not be created this way, use ImportNewAndPublish instead to create them.
Declaration
Guid CreateAndPublish(ResourceType resourceType, LightResourceInfo resourceInfo)
Parameters
Type | Name | Description |
---|---|---|
ResourceType | resourceType | The type of the resource to be created. |
LightResourceInfo | resourceInfo | The parameters of the resource to be created. The Guid and IsDefault members of the resourceInfo parameter are ignored. To find out exactly which LightResourceInfo derived class is to be used here for a resource type, see the "Described by class" section of the documentation of the appropriate "ResourceType" enum member (e.g.ResourceInfoWithLang for SegRules). |
Returns
Type | Description |
---|---|
Guid | The Guid of the newly created resource. |
Exceptions
Type | Condition |
---|---|
UnexpectedFault | An unexpected error occurred; equivalent of an 501 'Internal server error' http result. |
GenericFault | The details within the fault identify the specific error. Thrown for expected business errors that have no specific faults. |
DeleteResource(ResourceType, Guid)
Deletes a resource. If the resource is readonly, an exception is thrown.
Declaration
void DeleteResource(ResourceType resourceType, Guid resourceGuid)
Parameters
Type | Name | Description |
---|---|---|
ResourceType | resourceType | The type of the resource. |
Guid | resourceGuid | The guid of the resource to be deleted. |
Exceptions
Type | Condition |
---|---|
UnexpectedFault | An unexpected error occurred; equivalent of an 501 'Internal server error' http result. |
GenericFault | The details within the fault identify the specific error. Thrown for expected business errors that have no specific faults. |
ExportResource(ResourceType, Guid)
Exports the resource to a file. The format of the file is the same as used by memoQ import/export for the specific resource type.
Declaration
Guid ExportResource(ResourceType resourceType, Guid resourceGuid)
Parameters
Type | Name | Description |
---|---|---|
ResourceType | resourceType | The type of the resource. |
Guid | resourceGuid | The guid of the resource. |
Returns
Type | Description |
---|---|
Guid | The guid of the resulting file of the operation. Can be dowloaded using FileManagerService. |
Exceptions
Type | Condition |
---|---|
UnexpectedFault | An unexpected error occurred; equivalent of an 501 'Internal server error' http result. |
GenericFault | The details within the fault identify the specific error. Thrown for expected business errors that have no specific faults. |
GetResourceInfo(ResourceType, Guid)
Gets information about the specified resource.
Declaration
LightResourceInfo GetResourceInfo(ResourceType resourceType, Guid resourceGuid)
Parameters
Type | Name | Description |
---|---|---|
ResourceType | resourceType | The type of the resource. |
Guid | resourceGuid | The guid of the resource. |
Returns
Type | Description |
---|---|
LightResourceInfo | The LightResourceInfo (or derived object, depending the type of the resource) object describing the resource. To find out exactly which derived class is returned here for a resource type, see the "Described by class" section of the documentation of the appropriate "ResourceType" enum member (e.g.ResourceInfoWithLang for SegRules). |
Exceptions
Type | Condition |
---|---|
UnexpectedFault | An unexpected error occurred; equivalent of an 501 'Internal server error' http result. |
GenericFault | The details within the fault identify the specific error. Thrown for expected business errors that have no specific faults. |
ImportNewAndPublish(ResourceType, Guid, LightResourceInfo)
Creates a new resource and imports data from the specified file into it. Certain properties of the new resource are taken from the resourceInfo parameter, while others are taken from the header of the import file and can not be changed. The Name, Description and IsReadonly is taken from the resourceInfo parameter. For other rules see documentation for the resourceInfo parameter below.
Declaration
Guid ImportNewAndPublish(ResourceType resourceType, Guid fileGuid, LightResourceInfo resourceInfo)
Parameters
Type | Name | Description |
---|---|---|
ResourceType | resourceType | The type of the resource to be newly imported. |
Guid | fileGuid | |
LightResourceInfo | resourceInfo | The properties of the resource to be created.
|
Returns
Type | Description |
---|---|
Guid | The Guid of the newly imported resource. Although the header of the import file contains a guid, it is ignored, and a new guid is assigned. |
Exceptions
Type | Condition |
---|---|
UnexpectedFault | An unexpected error occurred; equivalent of an 501 'Internal server error' http result. |
GenericFault | The details within the fault identify the specific error. Thrown for expected business errors that have no specific faults. |
ListResources(ResourceType, LightResourceListFilter)
Returns the list of the light resources available on the server.
Declaration
LightResourceInfo[] ListResources(ResourceType resourceType, LightResourceListFilter filter = null)
Parameters
Type | Name | Description |
---|---|---|
ResourceType | resourceType | The type of the resource to be listed. |
LightResourceListFilter | filter | Optional filtering to apply. Default null value means no filtering other they resource type. |
Returns
Type | Description |
---|---|
LightResourceInfo[] | An array of LightResourceInfo (or derived, depending the type of the resource) objects is returned. To find out exactly which derived class is returned here for a resource type, see the "Described by class" section of the documentation of the appropriate "ResourceType" enum member (e.g.ResourceInfoWithLang for SegRules). |
Exceptions
Type | Condition |
---|---|
UnexpectedFault | An unexpected error occurred; equivalent of an 501 'Internal server error' http result. |
GenericFault | The details within the fault identify the specific error. Thrown for expected business errors that have no specific faults. |
UpdateResourceProperties(ResourceType, LightResourceInfo)
Updates the properties of a resource.
Declaration
void UpdateResourceProperties(ResourceType resourceType, LightResourceInfo resourceInfo)
Parameters
Type | Name | Description |
---|---|---|
ResourceType | resourceType | The type of the resource to update. |
LightResourceInfo | resourceInfo | The new properties of the resource.
|
Exceptions
Type | Condition |
---|---|
UnexpectedFault | An unexpected error occurred; equivalent of an 501 'Internal server error' http result. |
GenericFault | The details within the fault identify the specific error. Thrown for expected business errors that have no specific faults. |