Documentation > CMS Template API Library > SearchG2Context

CrownPeak.CMSAPI.SearchG2Context : CrownPeak.CMSAPI.Context

The context available when running a search_g2_*.aspx template file.

NameDescriptionType
GetJson()

Method used to retrieve JSON formatted string that will be sent to Search G2. Helpful for debugging purposes.

Method
CollectionName

The name of the Search G2 Collection to update. Null if no collection was configured for the current Publishing Package.

Property
IsPublishing

Are we publishing

Property
JsonOverride

A JSON string in Solr UpdateJSON format. This field will be used instead of any code generated from JsonParams.

Property
JsonParams

Parameters used to generate UpdateJSON to send to the configured Search G2 Collection. See SearchG2JsonParams for more details.

Property
LayoutName

Name of the layout file such as output.aspx or xml_output.aspx.

Property
PublishDirection

A code that tells if we have an asset moving to a new state, an updated asset, or a change requiring removals

Property
PublishingLoopNumber

The current publishing loop number. Usually the same as page number, but it always starts at 1. Goes hand-in-hand with "PublishAgain". Use this to see which iteration you are on if you are using PublishAgain to continue publishing.

Property
PublishingPackage

The destination package.

Property
PublishingStatus

The status that corresponds to the current publishing destination.

Property
ClientName

The name of this client.

Property
CultureInfo

If this is set, then when asset objects are looking for fields via the [] operator, they will first look for the the culture string (fr for example) plus name before returning, otherwise the field without the string will be returned. This will remain set for the lifetime of the currently running template unless specifically set to another culture or to null which will restore the default. The default culture has a string of "en-US"

Property
CurrentTemplateId

The asset id of the template file that we are currently running.

Property
Error

Contains errors. May also be used to trigger or set an error under some circumstances such as during upload.aspx During post_input don't use this for validation errors, use ValidationError instead.

Property
ExecutedById

The asset id of the asset that is executing this template. Only populated if the current template is called by another such as when using an Asset.Show() or Asset.GetLink() command. Calling template must also be a C# template.

Property
FilterStatus

Contains the names of statuses like "Live" and "Stage" which are considered valid in the current context. There is usually always a blank "" which signifies that assets without workflow are valid. Affects all calls which use filter status including Asset.Load(), Asset.GetFilterList(), Asset.GetFileList(), and Asset.GetFolderList() unless specifically set by those functions. This is a ReadOnlyCollection. You may read it, but not modify it. Reading this type of collection is almost identical to reading a List.

Property
JobId

The job id if the current template is running via a Job. Currently only used by post_save_job template.

Property
UIType

The type of user interface from which the current user is running the template. UIType.Unspecified is used when publishing.

Property
UserInfo

Gets the user info. See the User class note on this one.

Property

Connect with CrownPeak