/// <summary>
        /// Handles the Load event of the Page control.
        /// </summary>
        /// <param name="sender">The source of the event.</param>
        /// <param name="e">The <see cref="T:System.EventArgs"/> instance containing the event data.</param>
        private void Page_Load(object sender, EventArgs e)
        {
            requestInfo             = new ServiceRequestInfo();
            requestInfo.Type        = ServiceType.CommunityWebService;
            requestInfo.Url         = Settings["URL"].ToString();
            requestInfo.PortalAlias = Settings["PortalAlias"].ToString();
            requestInfo.LocalMode   = bool.Parse(Settings["LocalMode"].ToString().ToLower());

            /* Jakob says: later...
             *          requestInfo.UserName = Settings["UserName"].ToString();
             *          requestInfo.UserPassword = Settings["UserPassword"].ToString();
             */

            requestInfo.ListType      = ServiceListType.Item;
            requestInfo.ModuleType    = Settings["ModuleType"].ToString();
            requestInfo.MaxHits       = Int32.Parse(Settings["MaxHits"].ToString());
            requestInfo.ShowID        = bool.Parse(Settings["ShowID"].ToString().ToLower());
            requestInfo.SearchString  = Settings["SearchString"].ToString();
            requestInfo.SearchField   = Settings["SearchField"].ToString();
            requestInfo.SortField     = Settings["SortField"].ToString();
            requestInfo.SortDirection = Settings["SortDirection"].ToString();
            requestInfo.MobileOnly    = bool.Parse(Settings["MobileOnly"].ToString().ToLower());
            requestInfo.IDList        = Settings["IDList"].ToString();

            //requestInfo.IDListType = Settings["IDListType"].ToString();
            string par = Settings["IDListType"].ToString();

            if (par == ServiceListType.Item.ToString())
            {
                requestInfo.IDListType = ServiceListType.Item;
            }
            if (par == ServiceListType.Module.ToString())
            {
                requestInfo.IDListType = ServiceListType.Module;
            }
            if (par == ServiceListType.Tab.ToString())
            {
                requestInfo.IDListType = ServiceListType.Tab;
            }

            requestInfo.Tag = Int32.Parse(Settings["Tag"].ToString());

            //showImage = bool.Parse(Settings["ShowImage"].ToString().ToLower());
            showModuleFriendlyName = bool.Parse(Settings["ShowModuleFriendlyName"].ToString().ToLower());
            showTitle         = bool.Parse(Settings["ShowSearchTitle"].ToString().ToLower());
            showDescription   = bool.Parse(Settings["ShowDescription"].ToString().ToLower());
            showCreatedByUser = bool.Parse(Settings["ShowCreatedByUser"].ToString().ToLower());
            showCreatedDate   = bool.Parse(Settings["ShowCreatedDate"].ToString().ToLower());
            showLink          = bool.Parse(Settings["ShowLink"].ToString().ToLower());
            showTabName       = bool.Parse(Settings["ShowTabName"].ToString().ToLower());
            showModuleTitle   = bool.Parse(Settings["ShowModuleTitle"].ToString().ToLower());
            Target            = "_" + Settings["Target"].ToString();

            GetItems();
        }
예제 #2
0
        public ServiceResponseInfo GetCommunityContent(ServiceRequestInfo requestInfo)
        {
            requestInfo.LocalMode = true;
            requestInfo.ListType  = ServiceListType.Item;

            ServiceResponseInfo responseInfo;

            responseInfo = ServiceHelper.CallService(-1, -1, string.Empty, ref requestInfo, null);

            return(responseInfo);
        }
 /// <summary>
 /// Begins the content of the get community.
 /// </summary>
 /// <param name="requestInfo">The request info.</param>
 /// <param name="callback">The callback.</param>
 /// <param name="asyncState">State of the async.</param>
 /// <returns></returns>
 /// <remarks/>
 public IAsyncResult BeginGetCommunityContent(ServiceRequestInfo requestInfo, AsyncCallback callback, object asyncState)
 {
     return(this.BeginInvoke("GetCommunityContent", new object[] { requestInfo }, callback, asyncState));
 }
 public ServiceResponseInfo GetCommunityContent(ServiceRequestInfo requestInfo)
 {
     object[] results = this.Invoke("GetCommunityContent", new object[] { requestInfo });
     return((ServiceResponseInfo)(results[0]));
 }
예제 #5
0
        private void Page_Load(object sender, System.EventArgs e)
        {
            string parameterError = string.Empty;

            requestInfo = new ServiceRequestInfo();

            bool RequestInfoOK = ServiceHelper.FillRSSServiceRequestInfo(Request.Params, ref parameterError, ref requestInfo);

            // Create the response info
            try
            {
                ServiceResponseInfo responseInfo = new ServiceResponseInfo();
                responseInfo = ServiceHelper.CallService(this.portalSettings.PortalID, -1, Rainbow.Settings.Path.ApplicationFullPath, ref requestInfo, this);

                if (!RequestInfoOK || requestInfo.Tag != 0)
                {
                    responseInfo.ServiceStatus = string.Empty;
                    if (requestInfo.Tag != 0)
                    {
                        responseInfo.ServiceStatus = "ERROR! Unknown value of parameter Tag! ";
                    }
                    if (!RequestInfoOK)
                    {
                        responseInfo.ServiceStatus += "WARNING! Bad request. Problem with value of " + parameterError;
                    }
                    responseInfo.ServiceDescription += " (" + responseInfo.ServiceStatus + ")";
                }

                StringBuilder sb;
                sb = new StringBuilder(string.Empty, 4000);

                // Header
                sb.Append("<?xml version=\"1.0\" encoding=\"utf-8\"?>");
                sb.Append("<!DOCTYPE rss PUBLIC \"-//Netscape Communications//DTD RSS 0.91//EN\" \"http://my.netscape.com/publish/formats/rss-0.91.dtd\">");
                sb.Append("<rss version=\"0.91\">");
                sb.Append("<channel>");
                sb.Append("<title>" + Server.HtmlEncode(responseInfo.ServiceTitle) + "</title>");
                sb.Append("<link>" + Server.HtmlEncode(responseInfo.ServiceLink) + "</link>");
                sb.Append("<description>" + Server.HtmlEncode(responseInfo.ServiceDescription) + "</description>");
                sb.Append("<image>");
                sb.Append("<title>" + Server.HtmlEncode(responseInfo.ServiceImageTitle) + "</title>");
                sb.Append("<url>" + Server.HtmlEncode(responseInfo.ServiceImageUrl) + "</url>");
                sb.Append("<link>" + Server.HtmlEncode(responseInfo.ServiceImageLink) + "</link>");
                sb.Append("<width>100</width>");
                sb.Append("<height>40</height>");
                sb.Append("</image>");

                // Loop on each Item of the responseInfo collection
                foreach (ServiceResponseInfoItem srii in responseInfo.Items)
                {
                    sb.Append("<item>");
                    sb.Append("<title>" + Server.HtmlEncode(srii.Title) + "</title>");
                    sb.Append("<link>" + Server.HtmlEncode(srii.Link) + "</link>");
                    sb.Append("<description>" + Server.HtmlEncode(srii.Description) + "</description>");
                    sb.Append("</item>");
                }

                // Footer
                sb.Append("</channel>");
                sb.Append("</rss>");

                RSSLiteral.Text = sb.ToString();
                //xml1.DocumentContent = sb.ToString();
            }
            catch (Exception ex)
            {
                Rainbow.Configuration.ErrorHandler.HandleException("FATAL ERROR IN CSS SERVICE", ex);

                RSSLiteral.Text = ServiceHelper.CreateErrorRSSFeed(
                    "FATAL ERROR IN CSS SERVICE! (Click here to go to Forum)",
                    "http://rainbow.duemetri.net/ASPNetForums/",
                    Server.HtmlEncode("Please check the parameters. Error: " + ex.ToString()));
            }
        }
예제 #6
0
 public ServiceResponseInfo GetCommunityContent(ServiceRequestInfo requestInfo)
 {
     var results = this.Invoke("GetCommunityContent", new object[] { requestInfo });
     return (ServiceResponseInfo)(results[0]);
 }
예제 #7
0
 /// <summary>
 /// Begins the content of the get community.
 /// </summary>
 /// <param name="requestInfo">
 /// The request info.
 /// </param>
 /// <param name="callback">
 /// The callback.
 /// </param>
 /// <param name="asyncState">
 /// State of the async.
 /// </param>
 /// <returns>
 /// </returns>
 /// <remarks>
 /// </remarks>
 public IAsyncResult BeginGetCommunityContent(
     ServiceRequestInfo requestInfo, AsyncCallback callback, object asyncState)
 {
     return this.BeginInvoke("GetCommunityContent", new object[] { requestInfo }, callback, asyncState);
 }