public PortletPropertyCollection(PortletInfo owner, NameValueCollection properties)
        {
            for(int i = 0; i < properties.Count; i++)
                base.Add(
                    properties.GetKey(i),
                    properties[i]
                    );

            this._owner = owner;
        }
Пример #2
0
        public override bool ContainerPortletLinked(ContainerInfo container, PortletInfo portlet)
        {
            ContainerPortletLink link = ContainerPortletLink.GetByContainerIDAndPortletID(
                container.Identity,
                portlet.Identity
                );

            try
            {
                // return if combination is found
                return link.ContainerID != 0 && link.PortletID != 0;
            }
            catch (Exception)
            {
                return false;
            }
        }
Пример #3
0
 public abstract void UpdateModuleDataForPortlet(string name, string value, PortletInfo portlet);
Пример #4
0
 public abstract void UpdateContainerPortletLink(ContainerInfo container, PortletInfo portlet, int order);
Пример #5
0
 public abstract void RemoveModuleDataForPortlet(string name, PortletInfo portlet);
Пример #6
0
 public abstract void RemoveContainerPortletLink(ContainerInfo container, PortletInfo portlet);
Пример #7
0
 public abstract RolesPermissionsDictionary GetRolesForPortlet(PortletInfo portlet);
Пример #8
0
 public abstract PortletPropertyCollection GetGeneralPropertiesForPortlet(PortletInfo portlet);
Пример #9
0
        public override void RemoveRoleForPortlet(string role, PortletInfo portlet)
        {
            PortletRole dbrole = PortletRole.GetByPortletIDAndRole(
                portlet.Identity,
                role
                );

            try
            {
                // remove certain role
                dbrole.Delete();
                dbrole.CommitChanges();
            }
            catch (Exception) { }
        }
Пример #10
0
        public override void RemoveModuleDataForPortlet(string name, PortletInfo portlet)
        {
            PortletProperty property = PortletProperty.GetByPortletIDAndPropertyGroupAndName(
                portlet.Identity,
                PortletModuleDataGroup,
                name
                );

            try
            {
                // delete property
                property.Delete();
                property.CommitChanges();
            }
            catch (Exception) { }
        }
Пример #11
0
        public override void RemoveContainerPortletLink(ContainerInfo container, PortletInfo portlet)
        {
            ContainerPortletLink link = ContainerPortletLink.GetByContainerIDAndPortletID(
                container.Identity,
                portlet.Identity
                );

            try
            {
                // delete combination
                link.Delete();
                link.CommitChanges();
            }
            catch (Exception) { }
        }
Пример #12
0
        public override void RemoveAllRolesForPortlet(PortletInfo portlet)
        {
            List<PortletRole> dbrole = PortletRole.GetByPortletID(portlet.Identity);

            try
            {
                // remove all roles for one section
                foreach (PortletRole role in dbrole)
                {
                    role.Delete();
                    role.CommitChanges();
                }
            }
            catch (Exception) { }
        }
Пример #13
0
        public override RolesPermissionsDictionary GetRolesForPortlet(PortletInfo portlet)
        {
            List<PortletRole> dbroles = PortletRole.GetByPortletID(portlet.Identity);

            // return list of roles
            RolesPermissionsDictionary roles = new RolesPermissionsDictionary();

            foreach (PortletRole role in dbroles)
                roles.Add(
                    role.Role,
                    role.Permissions.Split(Common.Delimiter)
                    );

            return roles;
        }
Пример #14
0
        public override PortletModuleDataCollection GetModuleDataForPortlet(PortletInfo portlet)
        {
            List<PortletProperty> properties = PortletProperty.GetList("PortletID = " + portlet.Identity + " and PropertyGroup = '" + PortletModuleDataGroup + "'");
            NameValueCollection collection = new NameValueCollection(properties.Count);

            // add all rows to NameValueCollection
            foreach (PortletProperty property in properties)
                collection.Add(
                    property.Name,
                    property.Value
                    );

            // returns a property collection
            return new ManagedFusion.PortletModuleDataCollection(portlet, collection);
        }
Пример #15
0
        public override int GetContainerPortletLinkOrder(ContainerInfo container, PortletInfo portlet)
        {
            ContainerPortletLink link = ContainerPortletLink.GetByContainerIDAndPortletID(
                container.Identity,
                portlet.Identity
                );

            return (link.ContainerID != 0 && link.PortletID != 0) ? link.SortOrder : -1;
        }
Пример #16
0
 public abstract bool ContainerPortletLinked(ContainerInfo container, PortletInfo portlet);
Пример #17
0
 public abstract int GetContainerPortletLinkOrder(ContainerInfo container, PortletInfo portlet);
Пример #18
0
        public override void UpdateContainerPortletLink(ContainerInfo container, PortletInfo portlet, int order)
        {
            ContainerPortletLink link = ContainerPortletLink.GetByContainerIDAndPortletID(
                container.Identity,
                portlet.Identity
                );
            link.SortOrder = order;

            try
            {
                // update combination
                link.CommitChanges();
            }
            catch (Exception) { }
        }
Пример #19
0
 public abstract PortletModuleDataCollection GetModuleDataForPortlet(PortletInfo portlet);
Пример #20
0
        public override void UpdateGeneralPropertyForPortlet(string name, string value, PortletInfo portlet)
        {
            PortletProperty property = PortletProperty.GetByPortletIDAndPropertyGroupAndName(
                portlet.Identity,
                PortletGeneralPropertiesGroup,
                name
                );
            property.Value = value;

            try
            {
                // update property
                property.CommitChanges();
            }
            catch (Exception) { }
        }
Пример #21
0
 public abstract void RemoveAllRolesForPortlet(PortletInfo portlet);
Пример #22
0
        public void AddPortlet(PortletInfo portlet, int order)
        {
            // add portlet to this container
            Common.DatabaseProvider.AddContainerPortletLink(this, portlet, order);

            // reset portlets collection
            this._Portlets = null;
        }
Пример #23
0
 public abstract void RemoveGeneralPropertyForPortlet(string name, PortletInfo portlet);
Пример #24
0
        public void RemovePortlet(PortletInfo portlet)
        {
            // remove portlet from this container
            Common.DatabaseProvider.RemoveContainerPortletLink(this, portlet);

            // reset portlets collection
            this._Portlets = null;
        }
Пример #25
0
 public abstract void RemoveRoleForPortlet(string role, PortletInfo portlet);
Пример #26
0
 public void UpdatePortlet(PortletInfo portlet, int order)
 {
     // update portlet to this container
     Common.DatabaseProvider.UpdateContainerPortletLink(this, portlet, order);
 }
Пример #27
0
 public abstract void UpdateGeneralPropertyForPortlet(string name, string value, PortletInfo portlet);
Пример #28
0
 public abstract void CommitPortletChanges(PortletInfo portlet);
Пример #29
0
 public abstract void UpdateRoleForPortlet(string role, string[] permissions, PortletInfo portlet);
Пример #30
0
 public override void CommitPortletChanges(PortletInfo portlet)
 {
     switch (portlet.State)
     {
         case State.Added :		// insert
             Portlet.Insert((Portlet)portlet);
             break;
         case State.Changed :	// commit changes
             Portlet.Update((Portlet)portlet);
             break;
         case State.Deleted :	// remove
             Portlet.Delete((Portlet)portlet);
             break;
     }
 }