Interface IBLOBAgent
Interface for the BLOB Agent Collection of all services that works with binary objects (BLOBS), e.g. Images and documents.
Namespace: SuperOffice.CRM.Services
Assembly: SuperOffice.Services.dll
Syntax
[Agent("BLOB Agent", "Interface for the BLOB Agent. Collection of all services that works with binary objects (BLOBS), e.g. Images and documents.")]
public interface IBLOBAgent : IAgent
Examples
using SuperOffice;
using SuperOffice.CRM.Services;
using (SoSession mySession = SoSession.Authenticate("user", "pass"))
{
using (BLOBAgent agent = new BLOBAgent())
{
// call methods on agent here...
}
}
Methods
ChangeContactImage(Int32, Int32)
Changes the contact image link. If the Binary object id is 0, any image link is removed from the contact.
Declaration
void ChangeContactImage(int contactId, int blobId)
Parameters
Type | Name | Description |
---|---|---|
Int32 | contactId | The Contact the image is linked to |
Int32 | blobId | The Binary object id. If the Binary object id is 0, any image link is removed from the Contact. |
Examples
using SuperOffice;
using SuperOffice.CRM.Services;
using (SoSession mySession = SoSession.Authenticate("user", "pass"))
{
using (BLOBAgent agent = new BLOBAgent())
{
// call methods on agent here...
}
}
ChangePersonImage(Int32, Int32)
Interface for the BLOB Agent Collection of all services that works with binary objects (BLOBS), e.g. Images and documents.
Declaration
void ChangePersonImage(int personId, int blobId)
Parameters
Type | Name | Description |
---|---|---|
Int32 | personId | The person the image is linked to |
Int32 | blobId | The Binary object id. If the Binary object id is 0, any image link is removed from the person. |
Examples
using SuperOffice;
using SuperOffice.CRM.Services;
using (SoSession mySession = SoSession.Authenticate("user", "pass"))
{
using (BLOBAgent agent = new BLOBAgent())
{
// call methods on agent here...
}
}
ChangeProductImage(Int32, Int32)
Interface for the BLOB Agent Collection of all services that works with binary objects (BLOBS), e.g. Images and documents.
Declaration
void ChangeProductImage(int productId, int blobId)
Parameters
Type | Name | Description |
---|---|---|
Int32 | productId | The product the image is linked to |
Int32 | blobId | The Binary object id. If the Binary object id is 0, any image link is removed from the product. |
Examples
using SuperOffice;
using SuperOffice.CRM.Services;
using (SoSession mySession = SoSession.Authenticate("user", "pass"))
{
using (BLOBAgent agent = new BLOBAgent())
{
// call methods on agent here...
}
}
ChangeProjectImage(Int32, Int32)
Changes the project image link. If the Binary object id is 0, any image link is removed from the project.
Declaration
void ChangeProjectImage(int projectId, int blobId)
Parameters
Type | Name | Description |
---|---|---|
Int32 | projectId | The project the image is linked to |
Int32 | blobId | The Binary object id. If the Binary object id is 0, any image link is removed from the project. |
Examples
using SuperOffice;
using SuperOffice.CRM.Services;
using (SoSession mySession = SoSession.Authenticate("user", "pass"))
{
using (BLOBAgent agent = new BLOBAgent())
{
// call methods on agent here...
}
}
CleanupBatchTask(Int32)
Removes the binary objects linked to the batch task, the links themselves and the batch task.
Declaration
void CleanupBatchTask(int batchTaskId)
Parameters
Type | Name | Description |
---|---|---|
Int32 | batchTaskId | The ID of the batchtask that created the output data |
Examples
using SuperOffice;
using SuperOffice.CRM.Services;
using (SoSession mySession = SoSession.Authenticate("user", "pass"))
{
using (BLOBAgent agent = new BLOBAgent())
{
// call methods on agent here...
}
}
CreateDefaultBlobEntity()
Loading default values into a new BlobEntity. NetServer calculates default values (e.g. Country) on the entity, which is required when creating/storing a new instance
Declaration
BlobEntity CreateDefaultBlobEntity()
Returns
Type | Description |
---|---|
BlobEntity | New BlobEntity with default values |
Examples
using SuperOffice;
using SuperOffice.CRM.Services;
using (SoSession mySession = SoSession.Authenticate("user", "pass"))
{
using (BLOBAgent agent = new BLOBAgent())
{
// call methods on agent here...
}
}
DeleteBlobEntity(Int32)
Deletes the BlobEntity
Declaration
void DeleteBlobEntity(int blobEntityId)
Parameters
Type | Name | Description |
---|---|---|
Int32 | blobEntityId | The identity of the BlobEntity |
Examples
using SuperOffice;
using SuperOffice.CRM.Services;
using (SoSession mySession = SoSession.Authenticate("user", "pass"))
{
using (BLOBAgent agent = new BLOBAgent())
{
// call methods on agent here...
}
}
GetAppData(String)
Get a CLOB (limited to a reasonable size by the mechanics of Web Services) according to a string key; ALSO limits to the current ApplicationToken if any
Declaration
string GetAppData(string key)
Parameters
Type | Name | Description |
---|---|---|
String | key | The key string, less than 200 characters. Must be unique within each application. |
Returns
Type | Description |
---|---|
String | The applications value, suggested to be a JSON, XML or other readable structure |
Examples
using SuperOffice;
using SuperOffice.CRM.Services;
using (SoSession mySession = SoSession.Authenticate("user", "pass"))
{
using (BLOBAgent agent = new BLOBAgent())
{
// call methods on agent here...
}
}
GetBlobEntity(Int32)
Gets a BlobEntity object.
Declaration
BlobEntity GetBlobEntity(int blobEntityId)
Parameters
Type | Name | Description |
---|---|---|
Int32 | blobEntityId | The identifier of the BlobEntity object |
Returns
Type | Description |
---|---|
BlobEntity | BlobEntity |
Examples
using SuperOffice;
using SuperOffice.CRM.Services;
using (SoSession mySession = SoSession.Authenticate("user", "pass"))
{
using (BLOBAgent agent = new BLOBAgent())
{
// call methods on agent here...
}
}
GetBlobEntityOnContact(Int32)
Gets the blob entity that represents the contact image binary object.
Declaration
BlobEntity GetBlobEntityOnContact(int contactId)
Parameters
Type | Name | Description |
---|---|---|
Int32 | contactId | The Contact id |
Returns
Type | Description |
---|---|
BlobEntity | BlobEntity object |
Examples
using SuperOffice;
using SuperOffice.CRM.Services;
using (SoSession mySession = SoSession.Authenticate("user", "pass"))
{
using (BLOBAgent agent = new BLOBAgent())
{
// call methods on agent here...
}
}
GetBlobEntityOnCountry(Int32)
Gets the blob entity that represents the country flag binary object.
Declaration
BlobEntity GetBlobEntityOnCountry(int countryId)
Parameters
Type | Name | Description |
---|---|---|
Int32 | countryId | The country id |
Returns
Type | Description |
---|---|
BlobEntity | BlobEntity object |
Examples
using SuperOffice;
using SuperOffice.CRM.Services;
using (SoSession mySession = SoSession.Authenticate("user", "pass"))
{
using (BLOBAgent agent = new BLOBAgent())
{
// call methods on agent here...
}
}
GetBlobEntityOnPerson(Int32)
Gets the blob entity that represents the person image binary object.
Declaration
BlobEntity GetBlobEntityOnPerson(int personId)
Parameters
Type | Name | Description |
---|---|---|
Int32 | personId | The person id |
Returns
Type | Description |
---|---|
BlobEntity | BlobEntity object |
Examples
using SuperOffice;
using SuperOffice.CRM.Services;
using (SoSession mySession = SoSession.Authenticate("user", "pass"))
{
using (BLOBAgent agent = new BLOBAgent())
{
// call methods on agent here...
}
}
GetBlobEntityOnProduct(Int32)
Gets the blob entity that represents the product image binary object.
Declaration
BlobEntity GetBlobEntityOnProduct(int productId)
Parameters
Type | Name | Description |
---|---|---|
Int32 | productId | The product id |
Returns
Type | Description |
---|---|
BlobEntity | BlobEntity object |
Examples
using SuperOffice;
using SuperOffice.CRM.Services;
using (SoSession mySession = SoSession.Authenticate("user", "pass"))
{
using (BLOBAgent agent = new BLOBAgent())
{
// call methods on agent here...
}
}
GetBlobEntityOnProject(Int32)
Gets the blob entity that represents the project image binary object.
Declaration
BlobEntity GetBlobEntityOnProject(int projectId)
Parameters
Type | Name | Description |
---|---|---|
Int32 | projectId | The project id |
Returns
Type | Description |
---|---|
BlobEntity | BlobEntity object |
Examples
using SuperOffice;
using SuperOffice.CRM.Services;
using (SoSession mySession = SoSession.Authenticate("user", "pass"))
{
using (BLOBAgent agent = new BLOBAgent())
{
// call methods on agent here...
}
}
GetBlobStream(Int32)
Get the binary object as a stream
Declaration
Stream GetBlobStream(int blobEntityId)
Parameters
Type | Name | Description |
---|---|---|
Int32 | blobEntityId | The ID of the BLOB entity object that refers to the binary data |
Returns
Type | Description |
---|---|
Stream | The binary object as a Stream |
Examples
using SuperOffice;
using SuperOffice.CRM.Services;
using (SoSession mySession = SoSession.Authenticate("user", "pass"))
{
using (BLOBAgent agent = new BLOBAgent())
{
// call methods on agent here...
}
}
GetChatImageWithSize(Int32, Int32, Int32)
Returns the chat image that is displayed in chat with a specified maximum size.
Declaration
Image GetChatImageWithSize(int chatTopicId, int width, int height)
Parameters
Type | Name | Description |
---|---|---|
Int32 | chatTopicId | The project id of the project the image belongs to. |
Int32 | width | The maximum with of the returned image. Specify <= 0 to preserve aspect ratio of existing image |
Int32 | height | The maximum height of the returned image. Specify <= 0 to preserve aspect ratio of existing image |
Returns
Type | Description |
---|---|
Image | The image as a System.Drawing.Image. (If the the image is returned over webservices, the stream is returned as a jpeg/base64 encoded string.) |
Examples
using SuperOffice;
using SuperOffice.CRM.Services;
using (SoSession mySession = SoSession.Authenticate("user", "pass"))
{
using (BLOBAgent agent = new BLOBAgent())
{
// call methods on agent here...
}
}
GetContactImage(Int32)
Returns the contact image that is displayed in the CRM application.
Declaration
Image GetContactImage(int contactId)
Parameters
Type | Name | Description |
---|---|---|
Int32 | contactId | The contact id of the contact the image belongs to. |
Returns
Type | Description |
---|---|
Image | The image as a System.Drawing.Image. (If the the image is returned over webservices, the stream is returned as a Base64 encoded string.) |
Examples
using SuperOffice;
using SuperOffice.CRM.Services;
using (SoSession mySession = SoSession.Authenticate("user", "pass"))
{
using (BLOBAgent agent = new BLOBAgent())
{
// call methods on agent here...
}
}
GetContactImageWithSize(Int32, Int32, Int32)
Returns the contact image that is displayed in the CRM application with a specified maximum size.
Declaration
Image GetContactImageWithSize(int contactId, int width, int height)
Parameters
Type | Name | Description |
---|---|---|
Int32 | contactId | The contact id of the Contact the image belongs to. |
Int32 | width | The maximum with of the returned image. Specify <= 0 to preserve aspect ratio of existing image |
Int32 | height | The maximum height of the returned image. Specify <= 0 to preserve aspect ratio of existing image |
Returns
Type | Description |
---|---|
Image | The image as a System.Drawing.Image. (If the the image is returned over webservices, the stream is returned as a jpeg/base64 encoded string.) |
Examples
using SuperOffice;
using SuperOffice.CRM.Services;
using (SoSession mySession = SoSession.Authenticate("user", "pass"))
{
using (BLOBAgent agent = new BLOBAgent())
{
// call methods on agent here...
}
}
GetOutputFromBatch(Int32)
Get the output of a batchtask as a stream
Declaration
Stream GetOutputFromBatch(int batchTaskId)
Parameters
Type | Name | Description |
---|---|---|
Int32 | batchTaskId | The ID of the batchtask that created the output data |
Returns
Type | Description |
---|---|
Stream | The binary object as a Stream |
Examples
using SuperOffice;
using SuperOffice.CRM.Services;
using (SoSession mySession = SoSession.Authenticate("user", "pass"))
{
using (BLOBAgent agent = new BLOBAgent())
{
// call methods on agent here...
}
}
GetPersonImage(Int32)
Returns the person image that is displayed in the CRM application.
Declaration
Image GetPersonImage(int personId)
Parameters
Type | Name | Description |
---|---|---|
Int32 | personId | The person id of the person the image belongs to. |
Returns
Type | Description |
---|---|
Image | The image as a System.Drawing.Image. (If the the image is returned over webservices, the stream is returned as a Base64 encoded string.) |
Examples
using SuperOffice;
using SuperOffice.CRM.Services;
using (SoSession mySession = SoSession.Authenticate("user", "pass"))
{
using (BLOBAgent agent = new BLOBAgent())
{
// call methods on agent here...
}
}
GetPersonImageWithSize(Int32, Int32, Int32)
Returns the person image that is displayed in the CRM application with a specified maximum size.
Declaration
Image GetPersonImageWithSize(int personId, int width, int height)
Parameters
Type | Name | Description |
---|---|---|
Int32 | personId | The person id of the person the image belongs to. |
Int32 | width | The maximum with of the returned image. Specify <= 0 to preserve aspect ratio of existing image |
Int32 | height | The maximum height of the returned image. Specify <= 0 to preserve aspect ratio of existing image |
Returns
Type | Description |
---|---|
Image | The image as a System.Drawing.Image. (If the the image is returned over webservices, the stream is returned as a jpeg/base64 encoded string.) |
Examples
using SuperOffice;
using SuperOffice.CRM.Services;
using (SoSession mySession = SoSession.Authenticate("user", "pass"))
{
using (BLOBAgent agent = new BLOBAgent())
{
// call methods on agent here...
}
}
GetProductImage(Int32)
Returns the product image (rank=1) that is displayed in the CRM application.
Declaration
Image GetProductImage(int productId)
Parameters
Type | Name | Description |
---|---|---|
Int32 | productId | The product id of the product the image belongs to. |
Returns
Type | Description |
---|---|
Image | The image as a System.Drawing.Image. (If the the image is returned over webservices, the stream is returned as a Base64 encoded string.) |
Examples
using SuperOffice;
using SuperOffice.CRM.Services;
using (SoSession mySession = SoSession.Authenticate("user", "pass"))
{
using (BLOBAgent agent = new BLOBAgent())
{
// call methods on agent here...
}
}
GetProductThumbnail(Int32)
Returns the product thumbnail that is displayed in the CRM application.
Declaration
Image GetProductThumbnail(int productId)
Parameters
Type | Name | Description |
---|---|---|
Int32 | productId | The product id of the product the thumbnail belongs to. |
Returns
Type | Description |
---|---|
Image | The thumbnail as a System.Drawing.Image. (If the the image is returned over webservices, the stream is returned as a Base64 encoded string.) |
Examples
using SuperOffice;
using SuperOffice.CRM.Services;
using (SoSession mySession = SoSession.Authenticate("user", "pass"))
{
using (BLOBAgent agent = new BLOBAgent())
{
// call methods on agent here...
}
}
GetProjectImage(Int32)
Returns the project image that is displayed in the CRM application.
Declaration
Image GetProjectImage(int projectId)
Parameters
Type | Name | Description |
---|---|---|
Int32 | projectId | The project id of the project the image belongs to. |
Returns
Type | Description |
---|---|
Image | The image as a System.Drawing.Image. (If the the image is returned over webservices, the stream is returned as a Base64 encoded string.) |
Examples
using SuperOffice;
using SuperOffice.CRM.Services;
using (SoSession mySession = SoSession.Authenticate("user", "pass"))
{
using (BLOBAgent agent = new BLOBAgent())
{
// call methods on agent here...
}
}
GetProjectImageWithSize(Int32, Int32, Int32)
Returns the project image that is displayed in the CRM application with a specified maximum size.
Declaration
Image GetProjectImageWithSize(int projectId, int width, int height)
Parameters
Type | Name | Description |
---|---|---|
Int32 | projectId | The project id of the project the image belongs to. |
Int32 | width | The maximum with of the returned image. Specify <= 0 to preserve aspect ratio of existing image |
Int32 | height | The maximum height of the returned image. Specify <= 0 to preserve aspect ratio of existing image |
Returns
Type | Description |
---|---|
Image | The image as a System.Drawing.Image. (If the the image is returned over webservices, the stream is returned as a jpeg/base64 encoded string.) |
Examples
using SuperOffice;
using SuperOffice.CRM.Services;
using (SoSession mySession = SoSession.Authenticate("user", "pass"))
{
using (BLOBAgent agent = new BLOBAgent())
{
// call methods on agent here...
}
}
GetQuoteLineImage(Int32)
Returns the quoteline image (rank=1) that is displayed in the CRM application.
Declaration
Image GetQuoteLineImage(int quoteLineId)
Parameters
Type | Name | Description |
---|---|---|
Int32 | quoteLineId | The product id of the quoteline the image belongs to. |
Returns
Type | Description |
---|---|
Image | The image as a System.Drawing.Image. (If the the image is returned over webservices, the stream is returned as a Base64 encoded string.) |
Examples
using SuperOffice;
using SuperOffice.CRM.Services;
using (SoSession mySession = SoSession.Authenticate("user", "pass"))
{
using (BLOBAgent agent = new BLOBAgent())
{
// call methods on agent here...
}
}
SaveBlobEntity(BlobEntity)
Updates the existing BlobEntity or creates a new BlobEntity if the id parameter is empty
Declaration
BlobEntity SaveBlobEntity(BlobEntity blobEntity)
Parameters
Type | Name | Description |
---|---|---|
BlobEntity | blobEntity | The BlobEntity that is saved. |
Returns
Type | Description |
---|---|
BlobEntity | New or updated BlobEntity |
Examples
using SuperOffice;
using SuperOffice.CRM.Services;
using (SoSession mySession = SoSession.Authenticate("user", "pass"))
{
using (BLOBAgent agent = new BLOBAgent())
{
// call methods on agent here...
}
}
SaveImageStream(BlobLinkType, Image, String)
Stores an image in the database without linking it to a project or a person. It is possible to ChangePersonImage or ChangeProjectImage to attach image later.
Declaration
int SaveImageStream(BlobLinkType type, Image image, string description)
Parameters
Type | Name | Description |
---|---|---|
BlobLinkType | type | The type of the image. |
Image | image | Image to store |
String | description | Image description |
Returns
Type | Description |
---|---|
Int32 | The blob id |
Examples
using SuperOffice;
using SuperOffice.CRM.Services;
using (SoSession mySession = SoSession.Authenticate("user", "pass"))
{
using (BLOBAgent agent = new BLOBAgent())
{
// call methods on agent here...
}
}
SaveProjectImage(String, Image)
Saves a project image that is displayed in the CRM application's project image selection dialog to the database.
Declaration
void SaveProjectImage(string description, Image image)
Parameters
Type | Name | Description |
---|---|---|
String | description | Image description. Should be image name (e.g. winter.jpg) for project images |
Image | image | The project image (System.Drawing.Image) |
Examples
using SuperOffice;
using SuperOffice.CRM.Services;
using (SoSession mySession = SoSession.Authenticate("user", "pass"))
{
using (BLOBAgent agent = new BLOBAgent())
{
// call methods on agent here...
}
}
SetAppData(String, String)
Get a CLOB (limited to a reasonable size by the mechanics of Web Services) according to a string key; ALSO limits to the current ApplicationToken if any. Existing data, if any, will be overwritten. Overwrite with a blank value to delete.
Declaration
void SetAppData(string key, string data)
Parameters
Type | Name | Description |
---|---|---|
String | key | The key string, less than 200 characters. Must be unique within each application. |
String | data | The applications value, suggested to be a JSON, XML or other readable structure |
Examples
using SuperOffice;
using SuperOffice.CRM.Services;
using (SoSession mySession = SoSession.Authenticate("user", "pass"))
{
using (BLOBAgent agent = new BLOBAgent())
{
// call methods on agent here...
}
}
SetBlobStream(Int32, Stream)
Store a binary object from it's stream
Declaration
void SetBlobStream(int blobEntityId, Stream stream)
Parameters
Type | Name | Description |
---|---|---|
Int32 | blobEntityId | Id of the BLOB entity object that the binary data should be stored to. |
Stream | stream | The binary object as a Stream |
Examples
using SuperOffice;
using SuperOffice.CRM.Services;
using (SoSession mySession = SoSession.Authenticate("user", "pass"))
{
using (BLOBAgent agent = new BLOBAgent())
{
// call methods on agent here...
}
}
SetContactImage(Int32, Image)
Stores the contact image that is displayed in the CRM application.
Declaration
void SetContactImage(int contactId, Image image)
Parameters
Type | Name | Description |
---|---|---|
Int32 | contactId | The contact id of the contact the image belongs to. |
Image | image | The image that is stored on the contact (System.Drawing.Image) |
Examples
using SuperOffice;
using SuperOffice.CRM.Services;
using (SoSession mySession = SoSession.Authenticate("user", "pass"))
{
using (BLOBAgent agent = new BLOBAgent())
{
// call methods on agent here...
}
}
SetPersonImage(Int32, Image)
Stores the person image that is displayed in the CRM application.
Declaration
void SetPersonImage(int personId, Image image)
Parameters
Type | Name | Description |
---|---|---|
Int32 | personId | The person id of the person the image belongs to. |
Image | image | The image that is stored on the person (System.Drawing.Image) |
Examples
using SuperOffice;
using SuperOffice.CRM.Services;
using (SoSession mySession = SoSession.Authenticate("user", "pass"))
{
using (BLOBAgent agent = new BLOBAgent())
{
// call methods on agent here...
}
}
SetProductImage(Int32, Image)
Stores the product image that is displayed in the CRM application. The image is scaled down to max 1000x1000. This method operates only the main (rank=1) image; future extensions may support multiple images. A thumbnail of size 75x75 is also automatically set.
Declaration
void SetProductImage(int productId, Image image)
Parameters
Type | Name | Description |
---|---|---|
Int32 | productId | The product id of the product the image belongs to. |
Image | image | The image that is stored on the product (System.Drawing.Image), scaled down to no more than 1000x1000 |
Examples
using SuperOffice;
using SuperOffice.CRM.Services;
using (SoSession mySession = SoSession.Authenticate("user", "pass"))
{
using (BLOBAgent agent = new BLOBAgent())
{
// call methods on agent here...
}
}
SetProductThumbnail(Int32, Image)
Stores the product thumbnail that is displayed in the CRM application. The image is scaled down to max 200x200 pixels.
Declaration
void SetProductThumbnail(int productId, Image image)
Parameters
Type | Name | Description |
---|---|---|
Int32 | productId | The product id of the product the image belongs to. |
Image | image | The image that is stored on the product (System.Drawing.Image); scaled down to no more than 200x200 |
Examples
using SuperOffice;
using SuperOffice.CRM.Services;
using (SoSession mySession = SoSession.Authenticate("user", "pass"))
{
using (BLOBAgent agent = new BLOBAgent())
{
// call methods on agent here...
}
}
SetProjectImage(Int32, Image)
Stores the project image that is displayed in the CRM application.
Declaration
void SetProjectImage(int projectId, Image image)
Parameters
Type | Name | Description |
---|---|---|
Int32 | projectId | The project id of the project the image belongs to. |
Image | image | The image that is stored on the project (System.Drawing.Image) |
Examples
using SuperOffice;
using SuperOffice.CRM.Services;
using (SoSession mySession = SoSession.Authenticate("user", "pass"))
{
using (BLOBAgent agent = new BLOBAgent())
{
// call methods on agent here...
}
}