Beispiel #1
0
        /// <summary>
        /// Gets the distinguished name from the member name.
        /// </summary>
        /// <param name="user">The user name.</param>
        /// <param name="distinguishedName">Receives the ldap distinguished name.</param>
        /// <param name="id">Receives the member's user ID.</param>
        /// <returns>True if the distinguished name was found.</returns>
        private bool GetUserDN(string user, out string distinguishedName, out string id)
        {
            bool   status = false;
            Member member = null;

            // Initialize the outputs.
            distinguishedName = String.Empty;
            id = String.Empty;

            if (domain != null)
            {
                member = domain.GetMemberByName(user);
                if (member != null)
                {
                    Property dn = member.Properties.GetSingleProperty("DN");
                    if (dn != null)
                    {
                        distinguishedName = dn.ToString();
                        id     = member.UserID;
                        status = true;
                    }
                }
                else
                {
                    // The specified user did not exist in the roster under
                    // the short or common name.
                    // Let's see if the user came in fully distinguished.
                    // ex. cn=user.o=context

                    string dn = user.ToLower();
                    if (dn.StartsWith("cn=") == true)
                    {
                        // NDAP name to LDAP name
                        dn = dn.Replace('.', ',');
                        ICSList dnList = domain.Search("DN", dn, SearchOp.Equal);
                        if (dnList != null && dnList.Count == 1)
                        {
                            IEnumerator dnEnum = dnList.GetEnumerator();
                            if (dnEnum.MoveNext() == true)
                            {
                                member = new Member(domain, dnEnum.Current as ShallowNode);
                                if (member != null)
                                {
                                    distinguishedName = dn;
                                    id     = member.UserID;
                                    status = true;
                                }
                            }
                        }
                    }
                }
            }

            return(status);
        }
Beispiel #2
0
    public static void GetCollisionNodes( )
    {
        Store.Initialize(SimiasDataPath, true, -1);
        Store store = Store.GetStore();

        if (store == null)
        {
            Console.WriteLine("store could not be initialized.....");
        }
        Domain domain = store.GetDomain(store.DefaultDomain);

        SearchOp searchOperation = SearchOp.Begins;
        string   pattern         = "*";
        int      max             = 0;
        int      index           = 0;

        Console.WriteLine();
        Console.WriteLine("**************************Collision Nodes Report********************* ");
        Console.WriteLine();

        Simias.Storage.SearchPropertyList SearchPrpList = new Simias.Storage.SearchPropertyList();
        int i = 0;

        SearchPrpList.Add(CollisionProperty, "*", SearchOp.Exists);
        SearchPrpList.Add(BaseSchema.ObjectName, pattern, searchOperation);
        try{
            ICSList searchList = Catalog.Search(SearchPrpList);

            SearchState searchState = new SearchState(domain.ID, searchList.GetEnumerator() as ICSEnumerator, searchList.Count);
            if (index != 0)
            {
                searchState.Enumerator.SetCursor(Simias.Storage.Provider.IndexOrigin.SET, index);
            }
            foreach (ShallowNode sn in searchList)
            {
                if (max != 0 && i++ >= max)
                {
                    break;
                }
                CatalogEntry catEntry = Catalog.ConvertToCataloEntry(sn);
                Console.WriteLine("iFolder Name :{0}, iFolder ID:{1}", catEntry.Name, catEntry.CollectionID);
            }
        }
        catch (Exception ee)
        {
            Console.WriteLine("Got exception: " + ee.Message);
        }
        finally{
            Store.DeleteInstance();
        }
    }
Beispiel #3
0
        /// <summary>
        /// Starts a search for a specific set of domain members.
        /// </summary>
        /// <param name="domainID">The identifier of the domain to search for members in.</param>
        /// <param name="attributeName">Name of attribute to search.</param>
        /// <param name="searchString">String that contains a pattern to search for.</param>
        /// <param name="operation">Type of search operation to perform.</param>
        /// <param name="count">Maximum number of member objects to return.</param>
        /// <param name="searchContext">Receives a provider specific search context object. This object must be serializable.</param>
        /// <param name="memberList">Receives an array object that contains the domain Member objects.</param>
        /// <param name="total">Receives the total number of objects found in the search.</param>
        /// <returns>True if there are more domain members. Otherwise false is returned.</returns>
        public bool FindFirstDomainMembers(string domainID, string attributeName, string searchString, SearchOp operation, int count, out string searchContext, out Member[] memberList, out int total)
        {
            bool moreEntries = false;

            // Initialize the outputs.
            searchContext = null;
            memberList    = null;
            total         = 0;

            // Start the search for the specific members of the domain.
            Domain domain = store.GetDomain(domainID);

            if (domain != null)
            {
                ICSList     list        = domain.Search(attributeName, searchString, operation);
                SearchState searchState = new SearchState(domainID, list.GetEnumerator() as ICSEnumerator, list.Count);
                searchContext = searchState.ContextHandle;
                total         = list.Count;
                moreEntries   = FindNextDomainMembers(ref searchContext, count, out memberList);
            }

            return(moreEntries);
        }
Beispiel #4
0
        /// <summary>
        /// write the response back
        /// </summary>
        public void Send()
        {
            ctx.Response.Write("<channel>");

            ctx.Response.Write("<title>");
            ctx.Response.Write(collection.Name);
            ctx.Response.Write("</title>");

            /*
             * if (slog.Link != "")
             * {
             *      ctx.Response.Write("<link>");
             *      ctx.Response.Write( slog.Link );
             *      ctx.Response.Write("</link>");
             * }
             */

            ctx.Response.Write("<language>");
            ctx.Response.Write("en-us");
            ctx.Response.Write("</language>");

            ctx.Response.Write("<copyright>");
            ctx.Response.Write("(c) Novell, Inc.");
            ctx.Response.Write("</copyright>");

            ctx.Response.Write("<managingEditor>");
            Domain domain = store.GetDomain(store.DefaultDomain);

            if (collection.Owner.FN != null && collection.Owner.FN != "")
            {
                ctx.Response.Write(collection.Owner.FN);
            }
            else
            {
                ctx.Response.Write(collection.Owner.Name);
            }
            ctx.Response.Write("</managingEditor>");

            ctx.Response.Write("<webmaster>");
            //member = domain.GetMemberByID( domain.Owner );
            if (domain.Owner.FN != null && domain.Owner.FN != "")
            {
                ctx.Response.Write(domain.Owner.FN);
            }
            else
            {
                ctx.Response.Write(domain.Owner.Name);
            }
            ctx.Response.Write("</webmaster>");

            try
            {
                Simias.Storage.Property descProp =
                    collection.Properties.GetSingleProperty("Description");
                if (descProp != null)
                {
                    ctx.Response.Write("<description>" + descProp.Value.ToString() + "</description>");
                }
                else
                {
                    ctx.Response.Write("<description>" + collection.Type.ToString() + "</description>");
                }
            }
            catch {}

            ctx.Response.Write(
                String.Format(
                    "<link>{0}{1}:{2}{3}{4}?feed={5}</link>",
                    ctx.Request.IsSecureConnection ? "https://" : "http://",
                    ctx.Request.Url.Host,
                    ctx.Request.Url.Port.ToString(),
                    ctx.Request.ApplicationPath,
                    (publicAccess == true) ? "/pubrss.ashx" : "/rss.ashx",
                    HttpUtility.UrlEncode(collection.Name)));

            Simias.Storage.Property colProp =
                collection.Properties.GetSingleProperty(Simias.RssFeed.Util.LastModified);
            DateTime latest = (colProp != null) ? (DateTime)colProp.Value : collection.CreationTime;


            /*
             * ICSList nodes = collection.Search( Simias.RssFeed.Util.LastModified, dt, SearchOp.Greater );
             * ICSEnumerator nodesEnum = null;
             * if ( nodes.Count > 0 )
             * {
             *      nodesEnum = nodes.GetEnumerator() as ICSEnumerator;
             *      if ( nodesEnum != null &&
             *                      nodesEnum.SetCursor( IndexOrigin.SET, nodesEnum.Count - 1 ) == true )
             *      {
             *              nodesEnum.MoveNext();
             *
             *              try
             *              {
             *                      ShallowNode sn = nodesEnum.Current as ShallowNode;
             *                      log.Debug( "sn: " + sn.Name );
             *
             *                      Item item = new Item( collection, sn );
             *                      if ( item.Published > latest )
             *                      {
             *                              latest = item.Published;
             *                      }
             *              }
             *              catch( Exception e )
             *              {
             *                      log.Debug( e.Message );
             *              }
             *      }
             * }
             */

            Simias.RssFeed.Util.SendPublishDate(ctx, latest);

            ctx.Response.Write("<lastBuildDate>");
            ctx.Response.Write(Util.GetRfc822Date(latest));
            ctx.Response.Write("</lastBuildDate>");

            ctx.Response.Write("<generator>");
            ctx.Response.Write("Simias");
            ctx.Response.Write("</generator>");

            /*
             *      ctx.Response.Write("<cloud>");
             *      ctx.Response.Write( node.Cloud );
             *      ctx.Response.Write("</cloud>");
             */

            ctx.Response.Write("<ttl>");
            ctx.Response.Write(Simias.RssFeed.Util.DefaultTtl.ToString());
            ctx.Response.Write("</ttl>");

            ctx.Response.Write("<rating>");
            ctx.Response.Write(Simias.RssFeed.Util.DefaultRating);
            ctx.Response.Write("</rating>");

            if (strict == false)
            {
                ctx.Response.Write("<authorID>" + collection.Owner.UserID + "</authorID>");
                ctx.Response.Write("<type>" + collection.Type.ToString() + "</type>");
                ctx.Response.Write("<id>" + collection.ID + "</id>");
            }

            if (items == true)
            {
                ICSList nodes =
                    collection.Search(
                        Simias.RssFeed.Util.LastModified,
                        new DateTime(1992, 1, 1, 0, 0, 0),
                        SearchOp.Greater);
                if (nodes != null && nodes.Count > 0)
                {
                    ICSEnumerator nodesEnum = nodes.GetEnumerator() as ICSEnumerator;
                    int           count     = nodesEnum.Count;
                    while (count-- > 0)
                    {
                        if (nodesEnum.SetCursor(IndexOrigin.SET, count) == true)
                        {
                            nodesEnum.MoveNext();
                            ShallowNode sn   = nodesEnum.Current as ShallowNode;
                            Item        item = null;
                            if (this.types.Count == 0)
                            {
                                if (sn.Type == "FileNode")
                                {
                                    item = new Item(collection, sn, publicAccess);
                                }
                            }
                            else
                            {
                                foreach (string ctype in this.types)
                                {
                                    if (ctype == sn.Type)
                                    {
                                        item = new Item(collection, sn, publicAccess);
                                        break;
                                    }
                                }
                            }

                            if (item != null)
                            {
                                item.Strict     = this.strict;
                                item.Enclosures = this.enclosures;
                                item.Send(ctx);
                            }
                        }
                    }
                }
            }

            ctx.Response.Write("</channel>");
        }
    public static void GetCollisionNodes( )
    {
        Store.Initialize(SimiasDataPath, true, -1);
        Store store = Store.GetStore();

        if (store == null)
        {
            Console.WriteLine("store could not be initialized.....");
        }
        Domain domain = store.GetDomain(store.DefaultDomain);

        SearchOp searchOperation = SearchOp.Begins;
        string   pattern         = "*";
        int      max             = 0;
        int      index           = 0;

        //create catalog instances
        catalog = store.GetCollectionByID(catalogID);
        if (catalog == null)
        {
            Console.WriteLine("Could not get the catalog collection node from store... Exiting");
            return;
        }

        Console.WriteLine();
        Console.WriteLine("**************************Collision Nodes Deletion********************* ");
        Console.WriteLine();

        Simias.Storage.SearchPropertyList SearchPrpList = new Simias.Storage.SearchPropertyList();
        int i = 0;

        SearchPrpList.Add(CollisionProperty, "*", SearchOp.Exists);
        SearchPrpList.Add(BaseSchema.ObjectName, pattern, searchOperation);
        ICSList searchList = Catalog.Search(SearchPrpList);

        try{
            SearchState searchState = new SearchState(domain.ID, searchList.GetEnumerator() as ICSEnumerator, searchList.Count);
            if (index != 0)
            {
                searchState.Enumerator.SetCursor(Simias.Storage.Provider.IndexOrigin.SET, index);
            }
            if (searchList != null && searchList.Count > 0)
            {
                Console.WriteLine("Catalog entry for all collision nodes will be deleted from Catalog Collection Node, Type yes to continue.");
                Console.WriteLine();
                string entered = Console.ReadLine();
                if (String.Equals(entered.ToLower(), "yes"))
                {
                    foreach (ShallowNode sn in searchList)
                    {
                        if (max != 0 && i++ >= max)
                        {
                            break;
                        }
                        CatalogEntry catEntry = Catalog.ConvertToCataloEntry(sn);
                        Console.WriteLine("Deleting catalog with iFolder Name :{0}, iFolder ID:{1}", catEntry.Name, catEntry.CollectionID);
                        catalog.Commit(catalog.Delete(catEntry));
                        Thread.Sleep(100);
                    }
                    Console.WriteLine();
                    Console.WriteLine("Total number of deleted nodes: " + i);
                }
            }
            else
            {
                Console.WriteLine("No catalog node was found with collision!");
            }
        }catch (Exception ee)
        {
            Console.WriteLine("Got this exception: " + ee.Message);
        }
        finally{
            Store.DeleteInstance();
        }
    }
Beispiel #6
0
    public static void GetOrphanediFolders( )
    {
        Store.Initialize(SimiasDataPath, true, -1);
        Store store = Store.GetStore();

        if (store == null)
        {
            Console.WriteLine("store could not be initialized.....");
        }
        Domain domain = store.GetDomain(store.DefaultDomain);

        SearchOp searchOperation = SearchOp.Begins;
        string   pattern         = "*";

        CatalogEntry[] catalogEntries;
        string         OrphanedOwnerProperty = "OrphOwnerDN";
        string         MemberProperty        = "mid";
        int            max      = 0;
        int            index    = 0;
        string         accessID = null;

        Console.WriteLine();
        Console.WriteLine("**************************ORPHAN IfOLDER REPORT********************* ");
        Console.WriteLine();
        try
        {
            Simias.Storage.SearchPropertyList SearchPrpList = new Simias.Storage.SearchPropertyList();
            ArrayList list  = new ArrayList();
            int       i     = 0;
            int       total = 0;
            SearchPrpList.Add(OrphanedOwnerProperty, "*", SearchOp.Exists);
            SearchPrpList.Add(BaseSchema.ObjectName, pattern, searchOperation);
            if (accessID != null)
            {
                SearchPrpList.Add(MemberProperty, accessID, SearchOp.Begins);
            }
            ICSList searchList = Catalog.Search(SearchPrpList);

            total = searchList.Count;
            SearchState searchState = new SearchState(domain.ID, searchList.GetEnumerator() as ICSEnumerator, searchList.Count);
            if (index != 0)
            {
                searchState.Enumerator.SetCursor(Simias.Storage.Provider.IndexOrigin.SET, index);
            }
            foreach (ShallowNode sn in searchList)
            {
                if (max != 0 && i++ >= max)
                {
                    break;
                }
                CatalogEntry catEntry      = Catalog.ConvertToCataloEntry(sn);
                DateTime     lastModified  = (DateTime)catEntry.Properties.GetSingleProperty("LastModified").Value;
                string       PreviousOwner = catEntry.Properties.GetSingleProperty(OrphanedOwnerProperty).Value as string;
                Console.WriteLine("iFolder Name :{0}, iFolder ID:{1}, PreviousOwner:{2}, Orphaned on:{3}", catEntry.Name, catEntry.CollectionID, PreviousOwner, lastModified);
                //list.Add(new iFolder(Catalog.ConvertToCataloEntry(sn), accessID));
            }
        }
        catch (Exception ee)
        {
        }
        finally
        {
            Store.DeleteInstance();
        }
    }
Beispiel #7
0
        /// <summary>
        /// Process the http request
        /// </summary>
        /// <param name="context">Httpcontext object</param>
        public void ProcessRequest(HttpContext context)
        {
            HttpRequest  request  = context.Request;
            HttpResponse response = context.Response;

            response.StatusCode = (int)HttpStatusCode.BadRequest;

            try
            {
                // Make sure that there is a session.
                if (context.Session != null)
                {
                    //HttpService service = Session[ serviceTag ];
                    response.Cache.SetCacheability(HttpCacheability.NoCache);

                    string method = request.HttpMethod.ToLower();

                    log.Debug("Simias.Rss.Handler.ProcessRequest called");
                    log.Debug("  method: " + method);

                    //SyncMethod method = (SyncMethod)Enum.Parse(typeof(SyncMethod), Request.Headers.Get(SyncHeaders.Method), true);
                    if (method == "get")
                    {
                        Store  store  = Store.GetStore();
                        Domain domain = store.GetDomain(store.DefaultDomain);
                        Member member = null;

                        ParseUrlQueryOptions(request);

                        // If the caller is not looking for published collections
                        // impersonate him
                        if (published == false)
                        {
                            // Impersonate
                            member = domain.GetMemberByID(Thread.CurrentPrincipal.Identity.Name);
                            domain.Impersonate(member);
                            log.Debug("Impersonating user: "******"No query string - parsing iFolders");

                            ICSList ifolders = store.GetCollectionsByUser(member.UserID);
                            //ICSList ifolders = store.GetCollectionsByType( "iFolder" );
                            if (ifolders.Count > 0)
                            {
                                log.Debug("Number collections: " + ifolders.Count);
                                bool foundOne = false;
                                foreach (ShallowNode sn in ifolders)
                                {
                                    log.Debug("Base Type: " + sn.Type);
                                    if (sn.IsBaseType("Collection"))
                                    {
                                        if (foundOne == false)
                                        {
                                            response.StatusCode  = (int)HttpStatusCode.OK;
                                            response.ContentType = "text/xml";
                                            response.Write("<?xml version=\"1.0\" encoding=\"iso-8859-1\"?>");
                                            response.Write("<rss version=\"2.0\">");
                                            foundOne = true;
                                        }

                                        log.Debug("RSSizing collection: " + sn.Name);
                                        Simias.RssFeed.Channel channel =
                                            new Simias.RssFeed.Channel(context, store, sn);
                                        channel.Items      = false;
                                        channel.Enclosures = false;
                                        channel.Send();
                                    }
                                }

                                if (foundOne == true)
                                {
                                    response.Write("</rss>");
                                }
                            }
                        }
                        else
                        if (published == true)
                        {
                            log.Debug("Processing published collections");

                            if (searchTerm == null)
                            {
                                bool foundOne = false;
                                log.Debug("query==null - returning all published collections");
                                Property searchProp = new Property("Published", true);
                                //Property searchProp = new Property( "Published", Syntax.Boolean, "1" );
                                log.Debug("searchprop: " + searchProp.Value.ToString() + " syntax: " + searchProp.Type.ToString());
                                //ICSList list = domain.Search( searchProp, SearchOp.Equal );
                                ICSList list = store.GetNodesByProperty(searchProp, SearchOp.Equal);
                                foreach (ShallowNode sn in list)
                                {
                                    if (sn.IsBaseType("Collection"))
                                    {
                                        Collection col = new Collection(store, sn);
                                        if (col.Domain == domain.ID)
                                        {
                                            log.Debug("processing channel: " + sn.Name);
                                            Simias.RssFeed.Channel channel =
                                                new Simias.RssFeed.Channel(context, store, col);
                                            channel.Enclosures = this.enclosures;
                                            channel.Items      = this.items;
                                            channel.Strict     = this.strict;

                                            if (foundOne == false)
                                            {
                                                response.StatusCode  = (int)HttpStatusCode.OK;
                                                response.ContentType = "text/xml";
                                                response.Write("<?xml version=\"1.0\" encoding=\"iso-8859-1\"?>");
                                                response.Write("<rss version=\"2.0\">");
                                                foundOne = true;
                                            }

                                            channel.Send();
                                        }
                                    }
                                }

                                if (foundOne == true)
                                {
                                    response.Write("</rss>");
                                }
                            }
                            else
                            {
                                log.Debug("looking for collections that contain: " + searchTerm);

                                Hashtable ht   = new Hashtable();
                                ICSList   list = domain.Search("Description", this.searchTerm, SearchOp.Contains);
                                if (list != null && list.Count > 0)
                                {
                                    foreach (ShallowNode sn in list)
                                    {
                                        log.Debug("found in description: " + sn.Name);
                                        if (sn.Type == "Collection")
                                        {
                                            ht.Add(sn.ID, sn);
                                        }
                                    }
                                }

                                list = store.GetCollectionsByName(this.searchTerm, SearchOp.Contains);
                                if (list != null && list.Count > 0)
                                {
                                    foreach (ShallowNode sn in list)
                                    {
                                        log.Debug("found in name: " + sn.Name);
                                        if (ht.Contains(sn.ID) == false)
                                        {
                                            ht.Add(sn.ID, sn);
                                        }
                                    }
                                }

                                if (ht.Count > 0)
                                {
                                    response.StatusCode  = (int)HttpStatusCode.OK;
                                    response.ContentType = "text/xml";
                                    response.Write("<?xml version=\"1.0\" encoding=\"iso-8859-1\"?>");
                                    response.Write("<rss version=\"2.0\">");

                                    foreach (ShallowNode sn in ht.Values)
                                    {
                                        if (sn.Type == "Collection")
                                        {
                                            Simias.RssFeed.Channel channel =
                                                new Simias.RssFeed.Channel(context, store, sn);
                                            channel.Enclosures = this.enclosures;
                                            channel.Items      = this.items;
                                            channel.Strict     = this.strict;
                                            channel.Send();
                                        }
                                    }

                                    response.Write("</rss>");
                                }
                            }
                        }
                        else
                        if (specifiedFeed != null)
                        {
                            log.Debug("Processing channel: " + specifiedFeed);
                            Collection collection = store.GetSingleCollectionByName(specifiedFeed);
                            if (collection != null)
                            {
                                Member cMember = collection.GetMemberByID(member.UserID);
                                if (cMember != null)
                                {
                                    response.StatusCode  = (int)HttpStatusCode.OK;
                                    response.ContentType = "text/xml";
                                    response.Write("<?xml version=\"1.0\" encoding=\"iso-8859-1\"?>");
                                    response.Write("<rss version=\"2.0\">");

                                    Simias.RssFeed.Channel channel =
                                        new Simias.RssFeed.Channel(context, store, collection);
                                    channel.Enclosures = this.enclosures;
                                    channel.Items      = this.items;
                                    channel.Strict     = this.strict;
                                    channel.Send();

                                    response.Write("</rss>");
                                }
                            }
                        }
                        else
                        if (channelType != null)
                        {
                            bool foundOne = false;
                            log.Debug("Processing channel type: " + channelType);
                            ICSList list = store.GetCollectionsByType(channelType);
                            if (list != null && list.Count > 0)
                            {
                                IEnumerator colEnum = list.GetEnumerator();
                                if (colEnum.MoveNext() == true)
                                {
                                    Collection col = new Collection(store, colEnum.Current as ShallowNode);
                                    if (col.IsAccessAllowed(member, Access.Rights.ReadOnly))
                                    {
                                        Simias.RssFeed.Channel channel =
                                            new Simias.RssFeed.Channel(context, store, col);
                                        channel.Enclosures = this.enclosures;
                                        channel.Items      = this.items;
                                        channel.Strict     = this.strict;

                                        if (foundOne == false)
                                        {
                                            response.StatusCode  = (int)HttpStatusCode.OK;
                                            response.ContentType = "text/xml";
                                            response.Write("<?xml version=\"1.0\" encoding=\"iso-8859-1\"?>");
                                            response.Write("<rss version=\"2.0\">");
                                            foundOne = true;
                                        }

                                        channel.Send();

                                        if (foundOne == true)
                                        {
                                            response.Write("</rss>");
                                        }
                                    }
                                }
                            }
                        }
                        else
                        {
                            bool    foundOne = false;
                            ICSList ifolders = store.GetCollectionsByType("iFolder");
                            if (ifolders.Count > 0)
                            {
                                log.Debug("Number collections: " + ifolders.Count);
                                foreach (ShallowNode sn in ifolders)
                                {
                                    log.Debug("Type: " + sn.Type);
                                    Collection col     = new Collection(store, sn);
                                    Member     cMember = col.GetMemberByID(member.UserID);
                                    if (cMember != null && col.Domain == domain.ID)
                                    {
                                        log.Debug("RSSizing collection: " + sn.Name);
                                        Simias.RssFeed.Channel channel =
                                            new Simias.RssFeed.Channel(context, store, sn);
                                        channel.Items      = false;
                                        channel.Strict     = this.strict;
                                        channel.Enclosures = this.enclosures;

                                        if (foundOne == false)
                                        {
                                            response.StatusCode  = (int)HttpStatusCode.OK;
                                            response.ContentType = "text/xml";
                                            response.Write("<?xml version=\"1.0\" encoding=\"iso-8859-1\"?>");
                                            response.Write("<rss version=\"2.0\">");
                                            foundOne = true;
                                        }

                                        channel.Send();
                                    }
                                }

                                if (foundOne == true)
                                {
                                    response.Write("</rss>");
                                }
                            }
                        }
                    }
                }
            }
            catch (Exception ex)
            {
                log.Error(ex.Message);
                log.Error(ex.StackTrace);
                throw ex;
            }
            finally
            {
                response.End();
            }
        }