Show / Hide Table of Contents

Class BaseHandler

Base API handler.

Inheritance
System.Object
BaseHandler
AccountHandler
AnalyticsHandler
ArTargetHandler
AssessmentHandler
ChannelHandler
BaseFloARHandler
ContentLibraryHandler
FileHandler
FormHandler
ImageRecognitionHandler
LearnHandler
LocationHandler
PackageHandler
QAndAHandler
TenantHandler
UserHandler
Inherited Members
System.Object.Equals(System.Object)
System.Object.Equals(System.Object, System.Object)
System.Object.GetHashCode()
System.Object.GetType()
System.Object.MemberwiseClone()
System.Object.ReferenceEquals(System.Object, System.Object)
System.Object.ToString()
Namespace: Appearition.Common
Assembly: Appearition.SDK.dll
Syntax
public abstract class BaseHandler

Fields

View Source

JSON_FOLDER_NAME

Name of the folder where JSON data will be stored when appropriate.

Declaration
public const string JSON_FOLDER_NAME = "JSON"
Field Value
Type Description
System.String

Properties

View Source

TokenUsedForDownloads

Defines what authentication type will be used for the downloads. By default, the highest authentication should be the one in charge.

Declaration
protected static AuthenticationOverrideType TokenUsedForDownloads { get; }
Property Value
Type Description
AuthenticationOverrideType

Methods

View Source

ClearHandlerCache<T>(Action<Boolean>)

Fully deletes the stored content for this container from this device.

Declaration
public static IEnumerator ClearHandlerCache<T>(Action<bool> onComplete = null)
    where T : BaseHandler
Parameters
Type Name Description
System.Action<System.Boolean> onComplete

Called once the process has completed. Contains whether or not the operation was successful.

Returns
Type Description
System.Collections.IEnumerator
Type Parameters
Name Description
T
View Source

CopyFileToDestinationProcess(String, String, Action<Boolean>)

Copies the file from a source location to a given destination full path.

Declaration
protected static IEnumerator CopyFileToDestinationProcess(string pathToSourceFile, string pathToDestinationFile, Action<bool> onComplete = null)
Parameters
Type Name Description
System.String pathToSourceFile

Full path to the source file.

System.String pathToDestinationFile

Full path to the destination file.

System.Action<System.Boolean> onComplete

Called once the process has completed. Contains whether or not the operation was successful.

Returns
Type Description
System.Collections.IEnumerator
View Source

DeleteFileProcess(String, Action<Boolean>)

Deletes the file at a given path.

Declaration
protected static IEnumerator DeleteFileProcess(string pathToFile, Action<bool> onComplete = null)
Parameters
Type Name Description
System.String pathToFile

Full path to the file.

System.Action<System.Boolean> onComplete

Called once the process has completed. Contains whether or not the operation was successful.

Returns
Type Description
System.Collections.IEnumerator
View Source

DownloadGenericFile(String, String, String, Boolean, Action<Byte[]>, DataTransferStatus)

Downloads a file from the EMS to a given full path (including file name and extension). If the file already exists with a matching checksum, will load the local file instead.

Declaration
public static IEnumerator DownloadGenericFile(string url, string fileFullPath, string checksum, bool saveFile, Action<byte[]> onComplete, DataTransferStatus downloadTransferStatus = null)
Parameters
Type Name Description
System.String url

Full URL where the file is located.

System.String fileFullPath

The full path to the file that is about to get downloaded.

System.String checksum

The checksum of the file's current version as it came down from the EMS.

System.Boolean saveFile

Whether or not the downloaded file should be saved locally.

System.Action<System.Byte[]> onComplete

Called once the process has completed. Contains the data that was downloaded and saved.

DataTransferStatus downloadTransferStatus
Returns
Type Description
System.Collections.IEnumerator
View Source

GetApiDownloadedBytesFullPath<T, K>(T, UserProfile, Int32, String)

Declaration
public static string GetApiDownloadedBytesFullPath<T, K>(T api, UserProfile user, int channelId, string extra = "")
    where T : BaseApi, new()
    where K : BaseHandler
Parameters
Type Name Description
T api
UserProfile user
System.Int32 channelId
System.String extra
Returns
Type Description
System.String
Type Parameters
Name Description
T
K
View Source

GetApiJsonFullPath<T, K>()

Generates a filename for a json file based on an API type and user profile.

Declaration
public static string GetApiJsonFullPath<T, K>()
    where T : BaseApi, new()
    where K : BaseHandler
Returns
Type Description
System.String
Type Parameters
Name Description
T
K
View Source

GetApiJsonFullPath<T, K>(T, UserProfile)

Generates a filename for a json file based on an API type and user profile.

Declaration
public static string GetApiJsonFullPath<T, K>(T api, UserProfile user)
    where T : BaseApi, new()
    where K : BaseHandler
Parameters
Type Name Description
T api
UserProfile user
Returns
Type Description
System.String
Type Parameters
Name Description
T
K
View Source

GetApiJsonFullPath<T, K>(T, UserProfile, Int32, String)

Generates a filename for a json file based on an API type and user profile.

Declaration
public static string GetApiJsonFullPath<T, K>(T api, UserProfile user, int channelId, string extra = "")
    where T : BaseApi, new()
    where K : BaseHandler
Parameters
Type Name Description
T api
UserProfile user
System.Int32 channelId
System.String extra
Returns
Type Description
System.String
Type Parameters
Name Description
T
K
View Source

GetApiJsonFullPath<T, K>(UserProfile)

Generates a filename for a json file based on an API type and user profile.

Declaration
public static string GetApiJsonFullPath<T, K>(UserProfile user)
    where T : BaseApi, new()
    where K : BaseHandler
Parameters
Type Name Description
UserProfile user

Related user

Returns
Type Description
System.String

The json file name.

Type Parameters
Name Description
T
K
View Source

GetApiJsonFullPath<T, K>(UserProfile, Int32, String)

Generates a filename for a json file based on an API type and user profile.

Declaration
public static string GetApiJsonFullPath<T, K>(UserProfile user, int channelId, string extra = "")
    where T : BaseApi, new()
    where K : BaseHandler
Parameters
Type Name Description
UserProfile user
System.Int32 channelId
System.String extra
Returns
Type Description
System.String
Type Parameters
Name Description
T
K
View Source

GetChecksumFromExistingFile(String)

Obtains the checksum of a local file.

Declaration
public static string GetChecksumFromExistingFile(string path)
Parameters
Type Name Description
System.String path
Returns
Type Description
System.String
View Source

GetContentFromFileProcess(String, Action<Byte[]>, DataTransferStatus)

Fetches the content of a local file at a given path.

Declaration
protected static IEnumerator GetContentFromFileProcess(string pathToFile, Action<byte[]> onComplete = null, DataTransferStatus loadTransferStatus = null)
Parameters
Type Name Description
System.String pathToFile

The full path to the file.

System.Action<System.Byte[]> onComplete

Called once the process has completed. Contains the content of the data of the Media.

DataTransferStatus loadTransferStatus
Returns
Type Description
System.Collections.IEnumerator
View Source

GetEmsContentFileSize(String, Action<Nullable<Int64>>)

Attempts to get the file size for a file on the EMS.

Declaration
protected static IEnumerator GetEmsContentFileSize(string url, Action<long?> outcome)
Parameters
Type Name Description
System.String url
System.Action<System.Nullable<System.Int64>> outcome
Returns
Type Description
System.Collections.IEnumerator
View Source

GetHandlerJsonFolderPath<K>()

Fetches the folder name where the JSON files generated by the given type should be located.

Declaration
protected static string GetHandlerJsonFolderPath<K>()
    where K : BaseHandler
Returns
Type Description
System.String

The json folder path.

Type Parameters
Name Description
K
View Source

GetHandlerStoragePath<T>()

The name of the directory inside the root where all the content from this handler is to be saved.

Declaration
public static string GetHandlerStoragePath<T>()
    where T : BaseHandler
Returns
Type Description
System.String
Type Parameters
Name Description
T
View Source

GetReusableApiRequest<T>()

Fetches (or creates) an API request sample of the given type. Stores them locally for reusable purpose.

Declaration
public static T GetReusableApiRequest<T>()
    where T : BaseApi, new()
Returns
Type Description
T
Type Parameters
Name Description
T

The 1st type parameter.

View Source

IsThereExistingMediaWithMatchingChecksum(String, String)

Whether or not the existing file's checksum matches a given checksum.

Declaration
public static bool IsThereExistingMediaWithMatchingChecksum(string fullPath, string checksum)
Parameters
Type Name Description
System.String fullPath

The full path to the file.

System.String checksum

The checksum of the file's current version as it came down from the EMS.

Returns
Type Description
System.Boolean

Whether or not the existing file's checksum matches a given checksum.

View Source

SaveContentToFileProcess(Byte[], String, Action<Boolean>)

Saves the Media File data to the given path.

Declaration
protected static IEnumerator SaveContentToFileProcess(byte[] data, string pathToFile, Action<bool> onComplete = null)
Parameters
Type Name Description
System.Byte[] data

The content of this File.

System.String pathToFile

The full path to the file.

System.Action<System.Boolean> onComplete

Called once the process has completed. Contains whether or not the operation was successful.

Returns
Type Description
System.Collections.IEnumerator

Extension Methods

ObjectExtension.ToStream(Object)
  • View Source
Back to top Generated by DocFX