Ejemplo n.º 1
0
            /// <summary>
            /// set all metadata for the document
            /// </summary>
            /// <returns>True if succeded</returns>
            public override bool LoadCompleteMetadatas()
            {
                //author id
                Authors = message.GetValue("user");
                //transform into a label (real_name)
                if (!Str.IsEmpty(Authors) && cntr.users.ContainsKey(Authors))
                {
                    Authors = cntr.users[Authors].ValueStr("real_name");
                }

                //folder for treepath column
                Folder = channel.ValueStr("name");

                //title
                Title = cntr.transformText(message.ValueStr("text"), true);

                //time in unixtime
                string ts = message.ValueStr("ts");

                Modified = Dat.FromUnixTimestamp(Sys.ToLng(Str.ParseToSep(ts, '.')));

                //url
                Url1 = Url.Add(cntr.url, "archives", channel.ValueStr("id"), "p" + message.ValueStr("ts"));

                //docformat
                DocFormat = FileExt;

                //default properties
                return(base.LoadCompleteMetadatas());
            }
        public UrlBuilder WithTag(string tag, int numberOfOccurences)
        {
            for (var i = 0; i < numberOfOccurences; i++)
            {
                _url.Add(tag);
            }

            return(this);
        }
Ejemplo n.º 3
0
        private static string UrlWithOptionalParameter(Url baseUrl, string urlParameter)
        {
            if (!string.IsNullOrEmpty(urlParameter))
            {
                baseUrl.Add(urlParameter);
            }

            return(baseUrl.BuildUrl());
        }
Ejemplo n.º 4
0
 /// <summary>
 /// Do HTTP call with Sinequa HTTP requester
 /// </summary>
 /// <param name="api">API endpoint to use</param>
 /// <returns>a Json Object of the HTTP response</returns>
 protected Json slackGet(string api)
 {
     return(Connector.UrlAccess.GetJson(Url.Add("https://slack.com/api/", api)));
 }