Class CreateContentItemParameters
- Namespace
- CMS.ContentEngine
- Assembly
- CMS.ContentEngine.dll
Parameters used for initial content item setup.
public sealed class CreateContentItemParameters
- Inheritance
-
objectCreateContentItemParameters
- Extension Methods
Constructors
CreateContentItemParameters(string, string, string)
Initializes a new instance of CreateContentItemParameters.
[Obsolete("Constructor is deprecated and will be removed in next version. Use CreateContentItemParameters(string, string, string, string, string) instead and set previously missing parameter to null.")]
[ObsoleteSince(30, 0)]
public CreateContentItemParameters(string contentTypeName, string displayName, string languageName)
Parameters
contentTypeName
stringContent type name.
displayName
stringName of the content item for use in UI.
languageName
stringLanguage codename of the content item.
Remarks
Name will be generated automatically.
Exceptions
- ArgumentException
Thrown when
contentTypeName
ordisplayName
orlanguageName
is null or empty or when VersionStatus is set to draft.
- See Also
CreateContentItemParameters(string, string, string, string)
Initializes a new instance of CreateContentItemParameters.
[Obsolete("Constructor is deprecated and will be removed in next version. Use CreateContentItemParameters(string, string, string, string, string) instead.")]
[ObsoleteSince(30, 0)]
public CreateContentItemParameters(string contentTypeName, string name, string displayName, string languageName)
Parameters
contentTypeName
stringContent type name.
name
stringCode name of the content item.
displayName
stringName of the content item for use in UI.
languageName
stringLanguage codename of the content item.
Exceptions
- ArgumentException
Thrown when
contentTypeName
orname
ordisplayName
orlanguageName
is null or empty or when VersionStatus is set to draft.
CreateContentItemParameters(string, string, string, string, string)
Initializes a new instance of CreateContentItemParameters.
public CreateContentItemParameters(string contentTypeName, string name, string displayName, string languageName, string workspaceName)
Parameters
contentTypeName
stringContent type name.
name
stringCode name of the content item. If null, it will be automatically generated.
displayName
stringName of the content item for use in UI.
languageName
stringLanguage codename of the content item.
workspaceName
stringWorkspace name of the content item.
Exceptions
- ArgumentException
Thrown when
contentTypeName
ordisplayName
orlanguageName
orworkspaceName
is null or empty or when VersionStatus is set to draft.
Properties
ContentTypeName
Content item type name.
public string ContentTypeName { get; }
Property Value
- string
DisplayName
Content item display name, used to identify the item in user interface.
public string DisplayName { get; }
Property Value
- string
GenerateName
Indicates if content item's Name should be automatically generated.
public bool GenerateName { get; }
Property Value
- bool
IsSecured
Indicates if content item is secured. By default, item will be created as not secured.
public bool IsSecured { get; set; }
Property Value
- bool
LanguageName
Language codename of the content item.
public string LanguageName { get; }
Property Value
- string
Name
Code name of the content item.
public string Name { get; }
Property Value
- string
Remarks
Code name has to consist of upper and lower case letters, numbers, dash or underscore. This value can be null if GenerateName is set to true leading to automatic generation of code name.
- See Also
ScheduledPublishWhen
Date and time when the content item should be published.
public DateTime? ScheduledPublishWhen { get; set; }
Property Value
- DateTime?
Remarks
Setting System.DateTime.MinValue is treated as null.
ScheduledUnpublishWhen
Date and time when the content item should be unpublished.
public DateTime? ScheduledUnpublishWhen { get; set; }
Property Value
- DateTime?
Remarks
Setting System.DateTime.MinValue is treated as null.
VersionStatus
Version status in which the new language variant will be created. Default status is InitialDraft.
public VersionStatus VersionStatus { get; set; }
Property Value
Remarks
You cannot create content item in Draft version. First create a Published version, then create a Draft using TryCreateDraft(int, string, CancellationToken).
Exceptions
- ArgumentException
Thrown when you attempt to set the VersionStatus to Draft.
WorkspaceName
Name of the workspace of the content item.
public string WorkspaceName { get; init; }
Property Value
- string