Content Studio Web Content Management System
SystemObject
SystemMarshalByRefObject
ContentStudioCSBase
ContentStudio.SecuritySecurityBase
ContentStudio.SecurityUserProperties
Assembly: CSServer5 (in CSServer5.dll) Version: 5.7.5016.0 (5.7.5016.0)
Top
Top
Top
Top
User properties are system defined or custom properties that are stored on the user's profile in Content Studio.
Custom properties are stored in Applications that acts as namespaces for different set of user properties.
For example, to store equal settings but for two different categories you could create two applications MyApp_168 for category
no 168 and MyApp_169 for category no 169. Both applications could contain the properties DialogWidth and DialogHeight
making it possible for the web developer to obtain a polymorphic behavior.
The first sample shows how to read the start document of the calling user.
In order to avoid exceptions when the property is missing the code calls the ExistsProperty(ConnectionId, SessionId, String, String)
method first to check whether or not the property actual exists.
The second example shows how to save two custom properties for the calling user, read these values back and write them out on a Content Studio web site.
It is also possible to read the properties using the GetApplicationProperties(ConnectionId, SessionId, String, TrusteeUserIdentifiers, String) method
but this approach is more complicated for the caller and needs more careful exception handling.
[This is preliminary documentation and is subject to change.]
This class handles static or dynamic properties for a certain user in Content Studio.
Inheritance Hierarchy
SystemMarshalByRefObject
ContentStudioCSBase
ContentStudio.SecuritySecurityBase
ContentStudio.SecurityUserProperties
Namespace: ContentStudio.Security
Assembly: CSServer5 (in CSServer5.dll) Version: 5.7.5016.0 (5.7.5016.0)
Syntax
The UserProperties type exposes the following members.
Constructors
Name | Description | |
---|---|---|
UserProperties | Initializes a new instance of the UserProperties class |
Properties
Name | Description | |
---|---|---|
ForceLDAPLevel |
Retrieves the ForceLDAPLevel debug setting
(Inherited from SecurityBase.) | |
UseNetBiosDomainBinding |
Gets a value that indicates whether the NetBiosDomain name should be included when binding the user SID to Active Directory.
(Inherited from SecurityBase.) |
Methods
Name | Description | |
---|---|---|
CreateObjRef | (Inherited from MarshalByRefObject.) | |
DeleteApplication(ConnectionId, SessionId, String, TrusteeUserIdentifiers, String) |
Deletes a custom Content Studio User property application and all the properties connected to that application. | |
DeleteApplication(ConnectionId, SessionId, String, Int32, String) |
Deletes a custom Content Studio User property application and all the properties connected to that application. | |
DeleteProperty(ConnectionId, SessionId, String, TrusteeUserIdentifiers, String) |
Deletes a custom Content Studio User property.
| |
DeleteProperty(ConnectionId, SessionId, String, Int32, String) |
Deletes a custom Content Studio User property.
| |
Equals | (Inherited from Object.) | |
ExistsProperty(ConnectionId, SessionId, String, String) |
Test if a named property exists in an application for the calling user.
| |
ExistsProperty(ConnectionId, SessionId, String, TrusteeUserIdentifiers, String, String) |
Test if a named property exists in an application
| |
Finalize | (Inherited from Object.) | |
GetApplicationProperties(ConnectionId, SessionId, String) |
Gets a list of all the property names and their values that exists in an application
| |
GetApplicationProperties(ConnectionId, SessionId, String, TrusteeUserIdentifiers, String) |
Gets a list of all the property names and their values that exists in an application
| |
GetBuiltInPropertyNames |
Returns the names of all built in user properties in Content Studio.
These properties exists in the predefined system application which can be reached by its name or a dot.
| |
GetHashCode | (Inherited from Object.) | |
GetLifetimeService | (Inherited from MarshalByRefObject.) | |
GetProperty(ConnectionId, SessionId, String, TrusteeUserIdentifiers, String) | Obsolete.
Gets a custom Content Studio User property.
| |
GetProperty(ConnectionId, SessionId, String, Int32, String) |
Gets a custom Content Studio User property.
| |
GetType | (Inherited from Object.) | |
InitializeLifetimeService | (Inherited from MarshalByRefObject.) | |
MemberwiseClone | (Inherited from Object.) | |
MemberwiseClone(Boolean) | (Inherited from MarshalByRefObject.) | |
SetProperty(ConnectionId, SessionId, DictionaryString, String) |
Saves one or more custom Content Studio User properties for the calling user.
| |
SetProperty(ConnectionId, SessionId, String, TrusteeUserIdentifiers, DictionaryString, String) |
Saves one or more custom Content Studio User properties.
| |
SetProperty(ConnectionId, SessionId, String, Int32, String) |
Saves one or more custom Content Studio User properties.
| |
ToString | (Inherited from Object.) |
Fields
Name | Description | |
---|---|---|
CS_APPLICATION |
Defines the name of the built in CS application.
|
Remarks
Examples
VB
Try Dim upo As New UserProperties() 'The user's start document is stored in the built-in system application If upo.ExistsProperty(CS_ConnectionId, CS_UserSessionId, UserProperties.CS_APPLICATION, "startdoc") Then Response.Write("Your start document is: " & upo.GetApplicationProperties(CS_ConnectionId, _ CS_UserSessionId, _ UserProperties.CS_APPLICATION)("startdoc")) Else Response.Write("Your start document is not defined") End If Catch ex As Exception Response.Write(Server.HtmlEncode(ex.Message)) End Try
try { UserProperties upo = new UserProperties(); //The user's start document is stored in the built-in system application if(upo.ExistsProperty(CS_ConnectionId, CS_UserSessionId, UserProperties.CS_APPLICATION, "startdoc")) { Response.Write("Your start document is: " + upo.GetApplicationProperties(CS_ConnectionId, CS_UserSessionId, UserProperties.CS_APPLICATION)["startdoc"]); } else Response.Write("Your start document is not defined."); } catch(Exception ex) { Response.Write(Server.HtmlEncode(ex.Message)); }
try { //Add some properties in the a custom application called MyApp Dictionary<string, string> dic = new Dictionary<string, string>(); dic.Add("MyApp.Data1", "Value 1"); dic.Add("MyApp.Data2", "Value 2"); UserProperties upo = new UserProperties(); upo.SetProperty(CS_ConnectionId, CS_UserSessionId, dic); dic = upo.GetApplicationProperties(CS_ConnectionId, CS_UserSessionId, "MyApp"); Response.Write("MyApp.Data1 value " + Server.HtmlEncode(dic["Data1"]) + "<br /> + Environment.NewLine); Response.Write("MyApp.Data2 value " + Server.HtmlEncode(dic["Data2"]) + "<br /> + Environment.NewLine); } catch (Exception ex) { Response.Write(Server.HtmlEncode(ex.Message)); }
try { //Add the properties in the a custom application called MyApp Dictionary<string, string> dic = new Dictionary<string, string>(); dic.Add("MyApp.Data1", "Value 1"); dic.Add("MyApp.Data2", "Value 2"); UserProperties upo = new UserProperties(); upo.SetProperty(CS_ConnectionId, CS_UserSessionId, "", Trustee.UserIdentifiers.None, dic); string data1 = ""; using (StringReader sr = new StringReader(upo.GetProperty(CS_ConnectionId, CS_UserSessionId, "", Trustee.UserIdentifiers.None, "MyApp.Data1"))) { XmlReader XReader = XmlReader.Create(sr); if (XReader.ReadToFollowing("value")) { data1 = XReader.ReadElementContentAsString(); } } string data2 = ""; using (StringReader sr = new StringReader(upo.GetProperty(CS_ConnectionId, CS_UserSessionId, "", Trustee.UserIdentifiers.None, "MyApp.Data2"))) { XmlReader XReader = XmlReader.Create(sr); if (XReader.ReadToFollowing("value")) { data2 = XReader.ReadElementContentAsString(); } } Response.Write("MyApp.Data1 value " + Server.HtmlEncode(data1) + "<br /> + Environment.NewLine); Response.Write("MyApp.Data2 value " + Server.HtmlEncode(data2) + "<br /> + Environment.NewLine); } catch (Exception ex) { Response.Write(Server.HtmlEncode(ex.Message)); }
See Also