Ejemplo n.º 1
0
        public EditPropertyContainer(XmlDocument pagedata, List <ModuleParams> moduleparams, XmlNamespaceManager pagenamespaces)
            : base(pagedata, moduleparams, pagenamespaces)
        {
            mp = new ModulesProcessing();


            footer.MasterPage = base.MasterPage;
        }
Ejemplo n.º 2
0
        public PropertyList(XmlDocument pagedata, List <ModuleParams> moduleparams, XmlNamespaceManager pagenamespaces)
            : base(pagedata, moduleparams, pagenamespaces)
        {
            XmlDocument       presentationxml = base.PresentationXML;
            SessionManagement sm = new SessionManagement();

            Profiles.Profile.Utilities.DataIO data = new Profiles.Profile.Utilities.DataIO();


            this.PropertyListXML = data.GetPropertyList(pagedata, presentationxml, "", false, false, true);

            mp = new ModulesProcessing();
        }
        /// <summary>
        /// Each repeater on the master page will fire this event when its bound with presentation xml data.
        /// </summary>
        /// <param name="sender"></param>
        /// <param name="e"></param>
        protected void DrawModule(object sender, RepeaterItemEventArgs e)
        {
            PlaceHolder placeholder = null;

            mp = new ModulesProcessing();
            Literal literal = null;

            if (e.Item.ItemType == ListItemType.Header)
            {
                literal = (Literal)e.Item.FindControl("litHeader");
                return;
            }
            if (e.Item.ItemType == ListItemType.Footer)
            {
                literal = (Literal)e.Item.FindControl("litFooter");
                return;
            }

            Utilities.Module module  = (Utilities.Module)e.Item.DataItem;
            bool             display = true;

            if (module == null)
            {
                return;
            }

            placeholder = (PlaceHolder)e.Item.FindControl("phHeader");

            if (placeholder == null)
            {
                placeholder = (PlaceHolder)e.Item.FindControl("phActive");
            }

            if (placeholder == null)
            {
                placeholder = (PlaceHolder)e.Item.FindControl("phLeft");
            }

            if (placeholder == null)
            {
                placeholder = (PlaceHolder)e.Item.FindControl("phMain");
            }

            if (placeholder == null)
            {
                placeholder = (PlaceHolder)e.Item.FindControl("phPage");
            }

            if (placeholder == null)
            {
                placeholder = (PlaceHolder)e.Item.FindControl("phPassive");
            }


            if (module.Path != "")
            {
                if (module.DisplayRule != string.Empty)
                {
                    if (this.RDFData.SelectSingleNode(module.DisplayRule, this.RDFNamespaces).InnerText != "")
                    {
                        display = false;
                    }
                }
                if (display == true)
                {
                    placeholder.Controls.Add(mp.LoadControl(module.Path, this, this.RDFData, module.ParamList, this.RDFNamespaces));
                }
            }


            display = true;
        }
Ejemplo n.º 4
0
        private void DrawProfilesModule()
        {
            string label = string.Empty;

            System.Text.StringBuilder html       = new System.Text.StringBuilder();
            System.Text.StringBuilder itembuffer = new System.Text.StringBuilder();

            bool hasitems = false;

            // UCSF OpenSocial items
            string uri = null;

            // code to convert from numeric node ID to URI
            if (base.Namespaces.HasNamespace("rdf"))
            {
                XmlNode node = this.BaseData.SelectSingleNode("rdf:RDF/rdf:Description/@rdf:about", base.Namespaces);
                uri = node != null ? node.Value : null;
            }
            foreach (XmlNode propertygroup in this.PropertyListXML.SelectNodes("PropertyList/PropertyGroup"))
            {
                if (base.GetModuleParamXml("PropertyGroupURI") == null || base.GetModuleParamString("PropertyGroupURI") != string.Empty)
                {
                    if ((propertygroup.SelectNodes("Property/Network/Connection").Count > 0 && propertygroup.SelectNodes("Property[@CustomDisplay='false']").Count > 0) || propertygroup.SelectNodes("Property/CustomModule").Count > 0)
                    {
                        //html.Append("<div class='PropertyGroup' tabindex=\"0\" style='cursor:pointer;' onkeypress=\"if (event.keyCode == 13) javascript:toggleBlock('propertygroup','" + propertygroup.SelectSingleNode("@URI").Value + "');\" onclick=\"javascript:toggleBlock('propertygroup','" + propertygroup.SelectSingleNode("@URI").Value + "');\"  role=\"region\"><br>");
                        //html.Append("<img id=\"propertygroup" + propertygroup.SelectSingleNode("@URI").Value + "\" src='" + Root.Domain + "/Profile/Modules/PropertyList/images/minusSign.gif' alt='Collapse' style='border: none; text-decoration: none !important' border='0' width='9' height='9'/>&nbsp;"); //add image and onclick here.
                        //html.Append("<input  type='hidden' id=\"imgon" + propertygroup.SelectSingleNode("@URI").Value + "\" value='" + Root.Domain + "/Profile/Modules/PropertyList/images/minusSign.gif' alt='Collapse' width='9'/>");
                        //html.Append("<input type='hidden' id=\"imgoff" + propertygroup.SelectSingleNode("@URI").Value + "\" value='" + Root.Domain + "/Profile/Modules/PropertyList/images/plusSign.gif' alt='Expand' />");

                        //html.Append(propertygroup.SelectSingleNode("@Label").Value);
                        //html.Append("&nbsp;<br></div>");
                        html.Append("<div class='PropertyGroupItem'  id='" + propertygroup.SelectSingleNode("@URI").Value + "'>");

                        foreach (XmlNode propertyitem in propertygroup.SelectNodes("Property"))
                        {
                            if (base.GetModuleParamXml("PropertyURI") == null || base.GetModuleParamString("PropertyURI") != string.Empty)
                            {
                                itembuffer = new System.Text.StringBuilder();
                                if (propertyitem.SelectSingleNode("@CustomDisplay").Value == "false")
                                {
                                    hasitems = false;

                                    // itembuffer.Append("<input type='hidden' id=\"imgon" + propertyitem.SelectSingleNode("@URI").Value + "\" value='" + Root.Domain + "/Profile/Modules/PropertyList/images/minusSign.gif' alt='Collapse'  width='9' height='9'/>");
                                    // itembuffer.Append("<input type='hidden' id=\"imgoff" + propertyitem.SelectSingleNode("@URI").Value + "\" value='" + Root.Domain + "/Profile/Modules/PropertyList/images/plusSign.gif' alt='Expand' />");
                                    itembuffer.Append("<div class='PropertyItemHeader-wrapper'>");
                                    itembuffer.Append("<div class='PropertyItemHeader' style='cursor:pointer;' tabindex=\"0\" role=\"region\">");
                                    //itembuffer.Append("<img id=\"propertyitem" + propertyitem.SelectSingleNode("@URI").Value + "\" src='" + Root.Domain + "/Profile/Modules/PropertyList/images/minusSign.gif' alt='Collapse'  border='0' width='9' height='9' />&nbsp;"); //add image and onclick here.
                                    itembuffer.Append(propertyitem.SelectSingleNode("@Label").Value);
                                    itembuffer.Append("</div>");
                                    itembuffer.Append("<div class='PropertyGroupData'>");
                                    itembuffer.Append("<div style='padding-top:6px;padding-right:6px;padding-left:6px' id='" + propertyitem.SelectSingleNode("@URI").Value + "'>");

                                    foreach (XmlNode connection in propertyitem.SelectNodes("Network/Connection"))
                                    {
                                        if (hasitems)
                                        {
                                            itembuffer.Append("<br>");
                                        }
                                        if (connection.SelectSingleNode("@ResourceURI") != null)
                                        {
                                            itembuffer.Append("<a href='");
                                            itembuffer.Append(connection.SelectSingleNode("@ResourceURI").Value);
                                            itembuffer.Append("'>");
                                            itembuffer.Append(connection.InnerText.Replace("\n", "<br/>"));
                                            itembuffer.Append("</a><br>");
                                            hasitems = true;
                                        }
                                        else
                                        {
                                            itembuffer.Append(connection.InnerText.Replace("\n", "<br/>") + "<br>");
                                            hasitems = true;
                                        }
                                    }

                                    itembuffer.Append("</div></div></div>");
                                }
                                else if (propertyitem.SelectSingleNode("@CustomDisplay").Value == "true" && propertyitem.SelectNodes("CustomModule").Count > 0)
                                {
                                    foreach (XmlNode node in propertyitem.SelectNodes("CustomModule"))
                                    {
                                        Framework.Utilities.ModulesProcessing mp = new ModulesProcessing();
                                        XmlDocument modules = new XmlDocument();
                                        modules.LoadXml(node.OuterXml);

                                        foreach (XmlNode module in modules.GetElementsByTagName("Module"))
                                        {
                                            this.Modules = mp.FetchModules(module);

                                            foreach (Module m in this.Modules)
                                            {
                                                if (m.css != null)
                                                {
                                                    System.Web.UI.HtmlControls.HtmlLink css = new System.Web.UI.HtmlControls.HtmlLink();
                                                    css.Href = m.css;
                                                    css.Attributes["rel"]   = "stylesheet";
                                                    css.Attributes["type"]  = "text/css";
                                                    css.Attributes["media"] = "all";
                                                    Page.Header.Controls.Add(css);
                                                }
                                            }
                                            this.Modules = null;

                                            String propertyItemLabel = propertyitem.SelectSingleNode("@Label").Value;
                                            if (module.Attributes["Label"] != null)
                                            {
                                                propertyItemLabel = module.Attributes["Label"].Value;
                                            }


                                            itembuffer.Append("<div class='PropertyItemHeader-wrapper'>");
                                            itembuffer.Append("<div class='PropertyItemHeader' role=\"region\">");

                                            itembuffer.Append(propertyItemLabel);
                                            itembuffer.Append("</div>");
                                            itembuffer.Append("<div class='PropertyGroupData'>");
                                            itembuffer.Append("<div id='" + propertyitem.SelectSingleNode("@URI").Value + "'>");

                                            itembuffer.Append(base.RenderCustomControl(module.OuterXml, base.BaseData));

                                            itembuffer.Append("</div></div></div>");
                                        }
                                        hasitems = true;
                                    }
                                }



                                if (hasitems)
                                {
                                    html.Append(itembuffer.ToString());
                                }
                            }
                        } //End of property item loop

                        html.Append("</div>");
                    }
                }
            }//End of property group loop

            litPropertyList.Text = html.ToString();
        }