/// ----------------------------------------------------------------------------- /// <summary> /// Adds the default property definitions for a portal /// </summary> /// <param name="portalId">Id of the Portal</param> /// ----------------------------------------------------------------------------- public static void AddDefaultDefinitions(int portalId) { portalId = GetEffectivePortalId(portalId); _orderCounter = 1; var listController = new ListController(); Dictionary <string, ListEntryInfo> dataTypes = listController.GetListEntryInfoDictionary("DataType"); AddDefaultDefinition(portalId, "Name", "Prefix", "Text", 50, UserVisibilityMode.AllUsers, dataTypes); AddDefaultDefinition(portalId, "Name", "FirstName", "Text", 50, UserVisibilityMode.AllUsers, dataTypes); AddDefaultDefinition(portalId, "Name", "MiddleName", "Text", 50, UserVisibilityMode.AllUsers, dataTypes); AddDefaultDefinition(portalId, "Name", "LastName", "Text", 50, UserVisibilityMode.AllUsers, dataTypes); AddDefaultDefinition(portalId, "Name", "Suffix", "Text", 50, UserVisibilityMode.AllUsers, dataTypes); AddDefaultDefinition(portalId, "Address", "Unit", "Text", 50, UserVisibilityMode.AdminOnly, dataTypes); AddDefaultDefinition(portalId, "Address", "Street", "Text", 50, UserVisibilityMode.AdminOnly, dataTypes); AddDefaultDefinition(portalId, "Address", "City", "Text", 50, UserVisibilityMode.AdminOnly, dataTypes); AddDefaultDefinition(portalId, "Address", "Region", "Region", 0, UserVisibilityMode.AdminOnly, dataTypes); AddDefaultDefinition(portalId, "Address", "Country", "Country", 0, UserVisibilityMode.AdminOnly, dataTypes); AddDefaultDefinition(portalId, "Address", "PostalCode", "Text", 50, UserVisibilityMode.AdminOnly, dataTypes); AddDefaultDefinition(portalId, "Contact Info", "Telephone", "Text", 50, UserVisibilityMode.AdminOnly, dataTypes); AddDefaultDefinition(portalId, "Contact Info", "Cell", "Text", 50, UserVisibilityMode.AdminOnly, dataTypes); AddDefaultDefinition(portalId, "Contact Info", "Fax", "Text", 50, UserVisibilityMode.AdminOnly, dataTypes); AddDefaultDefinition(portalId, "Contact Info", "Website", "Text", 50, UserVisibilityMode.AdminOnly, dataTypes); AddDefaultDefinition(portalId, "Contact Info", "IM", "Text", 50, UserVisibilityMode.AdminOnly, dataTypes); AddDefaultDefinition(portalId, "Preferences", "Biography", "Multi-line Text", 0, UserVisibilityMode.AdminOnly, dataTypes); AddDefaultDefinition(portalId, "Preferences", "TimeZone", "TimeZone", 0, UserVisibilityMode.AdminOnly, dataTypes); AddDefaultDefinition(portalId, "Preferences", "PreferredTimeZone", "TimeZoneInfo", 0, UserVisibilityMode.AdminOnly, dataTypes); AddDefaultDefinition(portalId, "Preferences", "PreferredLocale", "Locale", 0, UserVisibilityMode.AdminOnly, dataTypes); AddDefaultDefinition(portalId, "Preferences", "Photo", "Image", 0, UserVisibilityMode.AllUsers, dataTypes); //6.0 requires the old TimeZone property to be marked as Deleted ProfilePropertyDefinition pdf = GetPropertyDefinitionByName(portalId, "TimeZone"); if (pdf != null) { DeletePropertyDefinition(pdf); } }
public ProfileDefinitionDto(ProfilePropertyDefinition definition) { PropertyCategory = definition.PropertyCategory; PropertyName = definition.PropertyName; Required = definition.Required; ValidationExpression = definition.ValidationExpression; PropertyValue = definition.PropertyValue; Visible = definition.Visible; Length = definition.Length; var dataTypeId = definition.DataType; var listController = new ListController(); var dataTypes = listController.GetListEntryInfoDictionary("DataType"); if (dataTypes.Any(i => i.Value.EntryID == dataTypeId)) { DataType = dataTypes.First(i => i.Value.EntryID == dataTypeId).Key.ToLowerInvariant().Substring(9); } else { DataType = "unknown"; } }