Class ContentManager
IContentManager interface implementation.
Inheritance
Implements
Inherited Members
Namespace: Quark.CMSAdapters.QPP
Assembly: Quark.CMSAdapters.QPP.dll
Syntax
public class ContentManager : IContentManager
Constructors
ContentManager()
Initializes a new instance of the ContentManager class.
Declaration
public ContentManager()
Properties
CurrentTimeZone
Gets the current time zone as per tz database.
Declaration
public string CurrentTimeZone { get; }
Property Value
Type | Description |
---|---|
System.String | The current time zone. |
PublishingManager
Gets the publishing manager.
Declaration
public IPublishingManager PublishingManager { get; }
Property Value
Type | Description |
---|---|
IPublishingManager | The publishing manager. |
ReferenceManager
Gets the UI manager.
Declaration
public IReferenceManager ReferenceManager { get; }
Property Value
Type | Description |
---|---|
IReferenceManager | The UI manager. |
RelationTypes
Gets the relation types.
Declaration
public Dictionary<string, RelationType> RelationTypes { get; }
Property Value
Type | Description |
---|---|
System.Collections.Generic.Dictionary<System.String, RelationType> | The relation types. |
ServerAttributeMap
Gets the server attributes map.
Declaration
public Dictionary<long, AttributeDefinition> ServerAttributeMap { get; }
Property Value
Type | Description |
---|---|
System.Collections.Generic.Dictionary<System.Int64, AttributeDefinition> | The server attributes map. |
ServerAttributes
Gets the server attributes.
Declaration
public Dictionary<string, AttributeDefinition> ServerAttributes { get; }
Property Value
Type | Description |
---|---|
System.Collections.Generic.Dictionary<System.String, AttributeDefinition> | The server attributes. |
Methods
AddToWorkflow(Int64, Int64, String)
Shows options to change Workflow and other applicable attributes.
Declaration
public void AddToWorkflow(long assetId, long collectionId = 0L, string title = null)
Parameters
Type | Name | Description |
---|---|---|
System.Int64 | assetId | The asset identifier. |
System.Int64 | collectionId | The collection identifier. |
System.String | title | The window title. |
Browse(String, String, Boolean, Boolean, String)
Browse available assets in the server.
Declaration
public List<string> Browse(string type, string title, bool allowMultiSelect = false, bool allowViewRevision = false, string defaultBrowseLocation = null)
Parameters
Type | Name | Description |
---|---|---|
System.String | type | The type of documents |
System.String | title | The dialog title |
System.Boolean | allowMultiSelect | if set to |
System.Boolean | allowViewRevision | if set to |
System.String | defaultBrowseLocation | The default browse location. |
Returns
Type | Description |
---|---|
System.Collections.Generic.List<System.String> | Returns urn of the selected assets. |
Browse(String, String, Boolean, out Boolean, Boolean, String)
Browse available assets in the server.
Declaration
public string Browse(string type, string title, bool allowCheckOut, out bool checkOutReadOnly, bool allowViewRevision = false, string defaultBrowseLocation = null)
Parameters
Type | Name | Description |
---|---|---|
System.String | type | The type of documents |
System.String | title | The dialog title |
System.Boolean | allowCheckOut | if set to |
System.Boolean | checkOutReadOnly | is checkout read only |
System.Boolean | allowViewRevision | if set to |
System.String | defaultBrowseLocation | The default browse location. |
Returns
Type | Description |
---|---|
System.String | Returns urn of the selected asset. |
CancelCheckout(String)
Cancels the checkout.
Declaration
public void CancelCheckout(string urn)
Parameters
Type | Name | Description |
---|---|---|
System.String | urn | The urn. |
CheckOut(ref String, Boolean, Boolean)
Downloads and marks the asset, specified by given urn, as checked out. This API can also update the urn if required.
Declaration
public string CheckOut(ref string urn, bool checkOutReadOnly, bool isSilent = false)
Parameters
Type | Name | Description |
---|---|---|
System.String | urn | The urn. |
System.Boolean | checkOutReadOnly | if set to |
System.Boolean | isSilent | if set to |
Returns
Type | Description |
---|---|
System.String | The file name of the downloaded file. |
Exceptions
Type | Condition |
---|---|
CmsAdapterException |
CheckRelinkOptionBasedOnFileSize(String, Int64, Int64)
Validates the link option by comparing the file size of the asset based on the name and collection id of an asset.
Declaration
public string CheckRelinkOptionBasedOnFileSize(string assetName, long collectionId, long fileLength)
Parameters
Type | Name | Description |
---|---|---|
System.String | assetName | The asset name |
System.Int64 | collectionId | The collection id |
System.Int64 | fileLength | The file sze of the local component |
Returns
Type | Description |
---|---|
System.String | Returns the urn of the CMS asset if the file size is same. |
DownloadFile(String, Boolean)
Downloads the file.
Declaration
public string DownloadFile(string urn, bool isLowRes)
Parameters
Type | Name | Description |
---|---|---|
System.String | urn | The urn. |
System.Boolean | isLowRes | if set to |
Returns
Type | Description |
---|---|
System.String |
DownloadFile(String, Nullable<RenditionTypes>, String)
Downloads the file.
Declaration
public string DownloadFile(string urn, RenditionTypes? renditionType = default(RenditionTypes? ), string destinationFilePath = null)
Parameters
Type | Name | Description |
---|---|---|
System.String | urn | The urn. |
System.Nullable<RenditionTypes> | renditionType | Type of the rendition. |
System.String | destinationFilePath | Destination file path |
Returns
Type | Description |
---|---|
System.String |
Exceptions
Type | Condition |
---|---|
System.ArgumentException | Unsupported - renditionType |
GetAccessibleTopLevelCollection()
Get the top level accessible collection id.
Declaration
public long GetAccessibleTopLevelCollection()
Returns
Type | Description |
---|---|
System.Int64 | the accessible collection id |
GetAccessToken()
Returns the session cookie.
Declaration
public string GetAccessToken()
Returns
Type | Description |
---|---|
System.String | Session Cookie |
GetApplicableRules(List<RuleElement>, String, SaveOptions)
Gets the applicable rules as per the specified rule conditions.
Declaration
public HashSet<string> GetApplicableRules(List<RuleElement> ruleList, string urn, SaveOptions saveOptions)
Parameters
Type | Name | Description |
---|---|---|
System.Collections.Generic.List<RuleElement> | ruleList | The rule list. |
System.String | urn | The urn. |
SaveOptions | saveOptions | The save options. |
Returns
Type | Description |
---|---|
System.Collections.Generic.HashSet<System.String> |
GetAssetVersion(Int64)
Returns the asset version.
Declaration
public object GetAssetVersion(long assetId)
Parameters
Type | Name | Description |
---|---|---|
System.Int64 | assetId |
Returns
Type | Description |
---|---|
System.Object |
GetAttributeValues(String, List<AttributeInfo>)
Gets the attribute values.
Declaration
public Dictionary<string, string> GetAttributeValues(string urn, List<AttributeInfo> attributes)
Parameters
Type | Name | Description |
---|---|---|
System.String | urn | The urn. |
System.Collections.Generic.List<AttributeInfo> | attributes | The attributes. |
Returns
Type | Description |
---|---|
System.Collections.Generic.Dictionary<System.String, System.String> |
GetCollectionId(String, Boolean)
Gets the collection id.
Declaration
public long GetCollectionId(string collectionPath, bool isAbsolutePath = false)
Parameters
Type | Name | Description |
---|---|---|
System.String | collectionPath | The collection path. |
System.Boolean | isAbsolutePath | if set to |
Returns
Type | Description |
---|---|
System.Int64 |
GetCollectionIdForPath(String)
Gets the collection id from the given collection path.
Declaration
public long GetCollectionIdForPath(string collectionPath)
Parameters
Type | Name | Description |
---|---|---|
System.String | collectionPath | The collection path |
Returns
Type | Description |
---|---|
System.Int64 | Returns the collection id. |
GetContentType(Int64)
Gets content type of an asset
Declaration
public ContentTypes GetContentType(long assetId)
Parameters
Type | Name | Description |
---|---|---|
System.Int64 | assetId | ID of asset. |
Returns
Type | Description |
---|---|
ContentTypes | The content type |
GetContentTypeId(String)
Gets the content type id from the given file name
Declaration
public long GetContentTypeId(string fileName)
Parameters
Type | Name | Description |
---|---|---|
System.String | fileName | file name |
Returns
Type | Description |
---|---|
System.Int64 | The content type id. |
GetDomainValue(Int32, String)
Gets the domain value.
Declaration
public DomainValue GetDomainValue(int domainId, string domainValueName)
Parameters
Type | Name | Description |
---|---|---|
System.Int32 | domainId | The domain id. |
System.String | domainValueName | Name of the domain value. |
Returns
Type | Description |
---|---|
DomainValue |
GetDraft(String)
Gets the draft.
Declaration
public IDocumentDraft GetDraft(string urn)
Parameters
Type | Name | Description |
---|---|---|
System.String | urn | The urn. |
Returns
Type | Description |
---|---|
IDocumentDraft |
GetReviewOptions(String)
Gets the review options.
Declaration
public ReviewOptions GetReviewOptions(string urn)
Parameters
Type | Name | Description |
---|---|---|
System.String | urn | The urn. |
Returns
Type | Description |
---|---|
ReviewOptions |
GetSaveOptions(String, String, Dictionary<String, AttributeInfo>, Boolean, String, Boolean, Nullable<Boolean>, String, Nullable<NameConflictResolveOptions>, Nullable<Boolean>)
Gets the save options.
Declaration
public SaveOptions GetSaveOptions(string urn, string filePath, Dictionary<string, AttributeInfo> attributes, bool isSaveAndCloseMode, string title, bool isSilent = false, bool? createMinorVersion = default(bool? ), string defaultBrowseLocation = null, NameConflictResolveOptions? nameConflictResolveOptions = default(NameConflictResolveOptions? ), bool? workflowMandatory = default(bool? ))
Parameters
Type | Name | Description |
---|---|---|
System.String | urn | The urn. |
System.String | filePath | The file path. |
System.Collections.Generic.Dictionary<System.String, AttributeInfo> | attributes | The attributes. |
System.Boolean | isSaveAndCloseMode | if set to |
System.String | title | the title of the open save dialog |
System.Boolean | isSilent | if set to |
System.Nullable<System.Boolean> | createMinorVersion | if set to |
System.String | defaultBrowseLocation | The default browse location. |
System.Nullable<NameConflictResolveOptions> | nameConflictResolveOptions | The name conflict resolve options. |
System.Nullable<System.Boolean> | workflowMandatory | Show workflow options while creating new asset. |
Returns
Type | Description |
---|---|
SaveOptions | The save options. |
Exceptions
Type | Condition |
---|---|
System.Exception |
GetVersionInfo(String)
Gets the version info.
Declaration
public string GetVersionInfo(string urn)
Parameters
Type | Name | Description |
---|---|---|
System.String | urn | The urn. |
Returns
Type | Description |
---|---|
System.String | The version info |
InvalidateSession(Boolean)
Invalidates the current CMS session.
Declaration
public void InvalidateSession(bool isShuttingDown = false)
Parameters
Type | Name | Description |
---|---|---|
System.Boolean | isShuttingDown | if set to |
IsOfType(Int64, Int64)
Checks if given content type is of ancestor type.
Declaration
public bool IsOfType(long ancestorId, long contentTypeId)
Parameters
Type | Name | Description |
---|---|---|
System.Int64 | ancestorId | |
System.Int64 | contentTypeId |
Returns
Type | Description |
---|---|
System.Boolean |
MapAttributeValues(Dictionary<String, AttributeInfo>)
Maps the attribute values.
Declaration
public Dictionary<long, AttributeValue> MapAttributeValues(Dictionary<string, AttributeInfo> attributeMap)
Parameters
Type | Name | Description |
---|---|---|
System.Collections.Generic.Dictionary<System.String, AttributeInfo> | attributeMap | The attribute map. |
Returns
Type | Description |
---|---|
System.Collections.Generic.Dictionary<System.Int64, AttributeValue> | Dictionary{System.Int64AttributeValue}. |
MarkAsCheckedOut(ref String, String)
Marks the document as checked out. This API can also update the urn if required.
Declaration
public void MarkAsCheckedOut(ref string urn, string filePath)
Parameters
Type | Name | Description |
---|---|---|
System.String | urn | The urn. |
System.String | filePath | The file path. |
PromoteToAsset(Int64, String, QPPSaveOptions)
Promotes to asset.
Declaration
public string PromoteToAsset(long clipboardDataId, string fileName, QPPSaveOptions qppSaveOptions)
Parameters
Type | Name | Description |
---|---|---|
System.Int64 | clipboardDataId | The clipboard data identifier. |
System.String | fileName | Name of the file. |
QPPSaveOptions | qppSaveOptions | The QPP save options. |
Returns
Type | Description |
---|---|
System.String |
SaveDraft(String, String)
Saves the draft.
Declaration
public IDocumentDraft SaveDraft(string urn, string filePath)
Parameters
Type | Name | Description |
---|---|---|
System.String | urn | The urn. |
System.String | filePath | The file path. |
Returns
Type | Description |
---|---|
IDocumentDraft |
Exceptions
Type | Condition |
---|---|
CmsAdapterException |
ShowRevisionComments(String)
Show revision comment dialog based on preference for a checked-out asset.
Declaration
public void ShowRevisionComments(string urn)
Parameters
Type | Name | Description |
---|---|---|
System.String | urn |
Upload(UploadFileInfo)
Uploads the specified file to CMS.
Declaration
public string Upload(UploadFileInfo uploadFileInfo)
Parameters
Type | Name | Description |
---|---|---|
UploadFileInfo | uploadFileInfo | The upload file info. |
Returns
Type | Description |
---|---|
System.String | Returns urn of the CMS asset. |
Exceptions
Type | Condition |
---|---|
CmsAdapterException |
ValidateDocument(String)
Validates the document.
Declaration
public void ValidateDocument(string urn)
Parameters
Type | Name | Description |
---|---|---|
System.String | urn | The urn. |
ValidateSession(Boolean, Boolean)
Validates the current CMS session. If user is not logged on, initiates log on routine. API never throws any exception.
Declaration
public bool ValidateSession(bool isSilent = false, bool doLogon = true)
Parameters
Type | Name | Description |
---|---|---|
System.Boolean | isSilent | Shows error dialog if false else silently logs exceptions |
System.Boolean | doLogon | Shows logon dialog if not logged on |
Returns
Type | Description |
---|---|
System.Boolean | The session validation status. |
Events
AfterCancelCheckOut
Occurs after cancel checkout.
Declaration
public event Action<EventArgs> AfterCancelCheckOut
Event Type
Type | Description |
---|---|
System.Action<System.EventArgs> |
AfterCheckOut
Occurs after check out.
Declaration
public event Action<EventArgs> AfterCheckOut
Event Type
Type | Description |
---|---|
System.Action<System.EventArgs> |
AfterSave
Occurs after document save is complete.
Declaration
public event Action<EventArgs> AfterSave
Event Type
Type | Description |
---|---|
System.Action<System.EventArgs> |
BeforeCancelCheckOut
Occurs before cancel checkout.
Declaration
public event Action<EventArgs> BeforeCancelCheckOut
Event Type
Type | Description |
---|---|
System.Action<System.EventArgs> |
BeforeCheckOut
Occurs before checkout.
Declaration
public event Action<EventArgs> BeforeCheckOut
Event Type
Type | Description |
---|---|
System.Action<System.EventArgs> |
BeforeSave
Occurs before document save starts.
Declaration
public event Action<EventArgs> BeforeSave
Event Type
Type | Description |
---|---|
System.Action<System.EventArgs> |
FileUpload
Occurs before file upload.
Declaration
public event Action<EventArgs> FileUpload
Event Type
Type | Description |
---|---|
System.Action<System.EventArgs> |
SaveOptionsUpdate
Occurs when user submits save options.
Declaration
public event Action<EventArgs> SaveOptionsUpdate
Event Type
Type | Description |
---|---|
System.Action<System.EventArgs> |