public string AddDefaultWikiContent(SPListInstance list)
        {
            if (list == null)
            {
                throw new JavaScriptException(this.Engine, "Error", "A list must be specified as the first parameter.");
            }

            return(SPUtility.AddDefaultWikiContent(list.List));
        }
        public void RestrictToList(SPListInstance list)
        {
            if (list == null)
            {
                throw new JavaScriptException(this.Engine, "Error", "List must be specified.");
            }

            m_auditQuery.RestrictToList(list.List);
        }
        public SPFileInstance CreateNewWikiPage(SPListInstance list, string url)
        {
            if (list == null)
            {
                throw new JavaScriptException(this.Engine, "Error", "A list must be specified as the first parameter.");
            }

            var result = SPUtility.CreateNewWikiPage(list.List, url);

            return(result == null
                ? null
                : new SPFileInstance(this.Engine.Object.InstancePrototype, result));
        }
        public SPListItemInstance CreateNewDiscussion(SPListInstance list, string title)
        {
            if (list == null)
            {
                throw new JavaScriptException(this.Engine, "Error", "A list must be specified as the first parameter.");
            }

            var result = SPUtility.CreateNewDiscussion(list.List, title);

            return(result == null
                ? null
                : new SPListItemInstance(this.Engine, result));
        }
Ejemplo n.º 5
0
        public string CreateCamlQueryFromODataQueryString(SPListInstance list, object includeQueryTag)
        {
            var bIncludeQueryTag = true;

            if (includeQueryTag != null && includeQueryTag != Undefined.Value && includeQueryTag != Null.Value &&
                includeQueryTag is bool)
            {
                bIncludeQueryTag = (bool)includeQueryTag;
            }

            var queryParameters = SPBaristaContext.Current.Request.QueryString;

            return(CreateCamlQueryFromOData(queryParameters, bIncludeQueryTag));
        }
Ejemplo n.º 6
0
        public SPListInstance Construct(string listUrl)
        {
            SPSite site;
            SPWeb  web;
            SPList list;

            if (SPHelper.TryGetSPList(listUrl, out site, out web, out list))
            {
                var result = new SPListInstance(Engine, site, web, list);

                return(result);
            }

            throw new JavaScriptException(Engine, "Error", "A list at the specified url was not found.");
        }
Ejemplo n.º 7
0
        public string CreateCamlQueryFromOData(SPListInstance list, ObjectInstance oData, object includeQueryTag)
        {
            var bIncludeQueryTag = true;

            if (includeQueryTag != null && includeQueryTag != Undefined.Value && includeQueryTag != Null.Value &&
                includeQueryTag is bool)
            {
                bIncludeQueryTag = (bool)includeQueryTag;
            }

            var queryParameters = oData.Properties
                                  .ToDictionary(property => property.Name, property => oData.GetPropertyValue(property.Name).ToString());

            return(CreateCamlQueryFromOData(queryParameters, bIncludeQueryTag));
        }
Ejemplo n.º 8
0
 public void SetList(SPListInstance list)
 {
     m_alert.List = list == null
         ? null
         : list.List;
 }