UserPropertiesExistsProperty Method (ConnectionId, SessionId, String, TrusteeUserIdentifiers, String, String) Content Studio 5.7 SDK
Content Studio Web Content Management System

[This is preliminary documentation and is subject to change.]

Test if a named property exists in an application

Namespace: ContentStudio.Security
Assembly: CSServer5 (in CSServer5.dll) Version: 5.7.5016.0 (5.7.5016.0)
Syntax

public bool ExistsProperty(
	ConnectionId connectionId,
	SessionId sessionId,
	string identifier,
	TrusteeUserIdentifiers idType,
	string application,
	string property
)

Parameters

connectionId
Type: ContentStudioConnectionId
A value that identifies the web site
sessionId
Type: ContentStudio.SecuritySessionId
A value that identifies the user's session. This value usually originates from a call to OpenSession(ConnectionId).
identifier
Type: SystemString
An identifier to a user. This parameter can be empty but not null
idType
Type: ContentStudio.SecurityTrusteeUserIdentifiers
The type of identifier entered in the Identifier parameter.
application
Type: SystemString
The name of the application where the property are to be found. For the system application a dot (.) can be used.
All application names are case-sensitive

This parameter cannot be null (Nothing in Visual Basic) or Empty.
property
Type: SystemString
The name of a property to test All property names are case-sensitive

This parameter cannot be null (Nothing in Visual Basic) or Empty.

Return Value

Type: Boolean
true if the property exists, false otherwise
Exceptions

ExceptionCondition
ArgumentNullExceptionThe Application argument was null
ArgumentExceptionThe Application argument was Empty.
CSExceptionA business rule was violated in the underlying Content Studio database. The following numbered exceptions are common:
  • 1001 - The session is invalid
  • 1002 - Permission denied
SqlExceptionAn error occurred when executing the command against the Content Studio database
Content Studio permissions

A user can always work with her own data. For other accounts the caller must have the GlobalGroupAdmin user right.
Remarks

When using the system application you can expect to find the following properties.
  • title
  • office
  • address
  • zip
  • city
  • country
  • phone
  • cellphone
  • fax
  • company
  • homephone
  • startdoc (the user's start page in Content Studio)
  • infodoc (the user's personal page in Content Studio)
  • webviewbool (indicates whether to display the tree view in Content Studio or not)
  • pflang (indicates the user's preferred language setting)
Examples

The following code shows how to examine whether the property Data1 in the application MyApp exists for the calling user and if so, it deletes that property.

try
{
   UserProperty upo = new UserProperties();
   if(upo.ExistsProperty(CS_ConnectionId, CS_UserSessionId, String.Empty, Trustee.UserIdentifiers.None, "MyApp", "Data1"))
   {
      upo.DeleteProperty(CS_ConnectionId, CS_UserSessionId, String.Empty, Trustee.UserIdentifiers.None, "MyApp.Data1");
   }
}
catch (Exception ex)
{
   Response.Write(Server.HtmlEncode(ex.Message));
}
See Also

Reference