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

            this._owner = owner;
        }
        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;
            }
        }
 public abstract void UpdateModuleDataForPortlet(string name, string value, PortletInfo portlet);
 public abstract void UpdateContainerPortletLink(ContainerInfo container, PortletInfo portlet, int order);
 public abstract void RemoveModuleDataForPortlet(string name, PortletInfo portlet);
 public abstract void RemoveContainerPortletLink(ContainerInfo container, PortletInfo portlet);
 public abstract RolesPermissionsDictionary GetRolesForPortlet(PortletInfo portlet);
 public abstract PortletPropertyCollection GetGeneralPropertiesForPortlet(PortletInfo portlet);
        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) { }
        }
        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) { }
        }
        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) { }
        }
        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) { }
        }
        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;
        }
        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);
        }
        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;
        }
 public abstract bool ContainerPortletLinked(ContainerInfo container, PortletInfo portlet);
 public abstract int GetContainerPortletLinkOrder(ContainerInfo container, PortletInfo portlet);
        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) { }
        }
 public abstract PortletModuleDataCollection GetModuleDataForPortlet(PortletInfo portlet);
        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) { }
        }
 public abstract void RemoveAllRolesForPortlet(PortletInfo portlet);
Exemple #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;
        }
 public abstract void RemoveGeneralPropertyForPortlet(string name, PortletInfo portlet);
Exemple #24
0
        public void RemovePortlet(PortletInfo portlet)
        {
            // remove portlet from this container
            Common.DatabaseProvider.RemoveContainerPortletLink(this, portlet);

            // reset portlets collection
            this._Portlets = null;
        }
 public abstract void RemoveRoleForPortlet(string role, PortletInfo portlet);
Exemple #26
0
 public void UpdatePortlet(PortletInfo portlet, int order)
 {
     // update portlet to this container
     Common.DatabaseProvider.UpdateContainerPortletLink(this, portlet, order);
 }
 public abstract void UpdateGeneralPropertyForPortlet(string name, string value, PortletInfo portlet);
 public abstract void CommitPortletChanges(PortletInfo portlet);
 public abstract void UpdateRoleForPortlet(string role, string[] permissions, PortletInfo portlet);
 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;
     }
 }