Exemplo n.º 1
0
        /// <summary>
        /// Creates the lava template from the list of fields.
        /// </summary>
        /// <returns></returns>
        private string CreateLavaTemplate()
        {
            var fields = GetAttributeValue(AttributeKeys.AdditionalFields).FromJsonOrNull <List <FieldSetting> >() ?? new List <FieldSetting>();

            var properties = new Dictionary <string, string>
            {
                { "Id", "Id" },
                { "Guid", "Guid" },
                { "PersonId", "PersonId" },
                { "FullName", "Person.FullName" },
                { "FirstName", "Person.FirstName" },
                { "NickName", "Person.NickName" },
                { "LastName", "Person.LastName" },
                { "GroupRole", "GroupRole.Name" },
                { "PhotoId", "Person.PhotoId" }
            };

            //
            // Add a custom field for the PhotoUrl since it needs to be custom formatted.
            //
            fields.Add(new FieldSetting
            {
                Key         = "PhotoUrl",
                FieldFormat = FieldFormat.String,
                Value       = "{{ 'Global' | Attribute:'PublicApplicationRoot' | Append:item.Person.PhotoUrl }}"
            });

            return(MobileHelper.CreateItemLavaTemplate(properties, fields));
        }
Exemplo n.º 2
0
        /// <summary>
        /// Creates the lava template from the list of fields.
        /// </summary>
        /// <returns></returns>
        private string CreateLavaTemplate()
        {
            var properties = new Dictionary <string, string>
            {
                { "Id", "Id" },
                { "Guid", "Guid" },
                { "Name", "Name" },
                { "StartDateTime", "DateTime" },
                { "EndDateTime", "EndDateTime" },
                { "Campus", "Campus" },
                { "Audiences", "Audiences" }
            };

            return(MobileHelper.CreateItemLavaTemplate(properties, null));
        }