Examples of IUserLayoutRestriction


Examples of org.jasig.portal.layout.restrictions.IUserLayoutRestriction

      ALNode node = getLayoutNode(nodeId);

      // Checking restrictions on the node
      Collection restrictions = node.getRestrictionsByPath(IUserLayoutRestriction.LOCAL_RESTRICTION_PATH);
      for ( Iterator i = restrictions.iterator(); i.hasNext(); ) {
         IUserLayoutRestriction restriction = (IUserLayoutRestriction) i.next();
         // check other restrictions except priority and depth
         if ( !restriction.getName().equals(RestrictionTypes.DEPTH_RESTRICTION) &&
             !restriction.getName().equals(RestrictionTypes.PRIORITY_RESTRICTION) &&
              !restriction.checkRestriction(node) ) {
            moveNodeToLostFolder(nodeId);
            break;
         }
      }

      // Checking the depth restriction
      if ( !restrictionManager.checkRestriction(nodeId,RestrictionTypes.DEPTH_RESTRICTION,depth+"") ) {
          moveNodeToLostFolder(nodeId);
      }

      // Checking children related restrictions on the children if they exist
      restrictions = node.getRestrictionsByPath(IUserLayoutRestriction.CHILDREN_RESTRICTION_PATH);
      boolean isFolder = (node.getNodeType() == IUserLayoutNodeDescription.FOLDER );
      if ( isFolder ) {
        for ( Iterator i = restrictions.iterator(); i.hasNext(); ) {
         IUserLayoutRestriction restriction = (IUserLayoutRestriction) i.next();
          for ( String nextId = ((ALFolder)node).getFirstChildNodeId(); nextId != null; ) {
           ALNode nextNode = getLayoutNode(nextId);
           String tmpNodeId = nextNode.getNextNodeId();
           if ( !restriction.getName().equals(RestrictionTypes.DEPTH_RESTRICTION) &&
                !restriction.checkRestriction(nextNode) ) {
              moveNodeToLostFolder(nextId);
           }
            nextId = tmpNodeId;
          }
       }
      }

      // Checking parent related restrictions on the parent if it exists
      String parentNodeId = node.getParentNodeId();
      if ( parentNodeId != null ) {
       restrictions = node.getRestrictionsByPath(IUserLayoutRestriction.PARENT_RESTRICTION_PATH);
       ALNode parentNode = getLayoutNode(parentNodeId);
       for ( Iterator i = restrictions.iterator(); i.hasNext(); ) {
          IUserLayoutRestriction restriction = (IUserLayoutRestriction) i.next();
          if !restriction.getName().equals(RestrictionTypes.DEPTH_RESTRICTION) &&
                !restriction.checkRestriction(parentNode) ) {
              moveNodeToLostFolder(nodeId);
              break;
          }
       }
      }
View Full Code Here

Examples of org.jasig.portal.layout.restrictions.IUserLayoutRestriction

             String restrPath = childNode.getAttribute("path");
             String restrValue = childNode.getAttribute("value");
             String restrType = childNode.getAttribute("type");

             if ( restrValue != null ) {
              IUserLayoutRestriction restriction = UserLayoutRestrictionFactory.createRestriction(restrType,restrValue,restrPath);
              nodeDesc.addRestriction(restriction);
             }
            }
        }
View Full Code Here

Examples of org.jasig.portal.layout.restrictions.IUserLayoutRestriction

     * @param propertyValue a <code>String</code> property value to be checked
     * @return a boolean value
     * @exception PortalException if an error occurs
     */
  public boolean checkRestriction(ALNode node, String restrictionName, String restrictionPath, String propertyValue) throws PortalException {
    IUserLayoutRestriction restriction = node.getRestriction(UserLayoutRestriction.getUniqueKey(restrictionName,restrictionPath));
    if ( restriction != null )
     return restriction.checkRestriction(propertyValue);
     return true;
  }
View Full Code Here

Examples of org.jasig.portal.layout.restrictions.IUserLayoutRestriction

    if ( !parentNode.getNodeDescription().isImmutable() ) {

     // Checking children related restrictions
     Collection restrictions = parentNode.getRestrictionsByPath(IUserLayoutRestriction.CHILDREN_RESTRICTION_PATH);
     for ( Iterator i = restrictions.iterator(); i.hasNext(); ) {
         IUserLayoutRestriction restriction = (IUserLayoutRestriction) i.next();
         if (   !restriction.getName().equals(RestrictionTypes.DEPTH_RESTRICTION) &&
                !restriction.checkRestriction(newNode) )
            return false;
     }

     // Checking parent related restrictions
     restrictions = newNode.getRestrictionsByPath(IUserLayoutRestriction.PARENT_RESTRICTION_PATH);
     for ( Iterator i = restrictions.iterator(); i.hasNext(); ) {
          IUserLayoutRestriction restriction = (IUserLayoutRestriction) i.next();
          if !restriction.getName().equals(RestrictionTypes.DEPTH_RESTRICTION) &&
                !restriction.checkRestriction(parentNode) )
            return false;
     }

     // Considering two cases if the node is new or it is already in the user layout
     if ( newNodeId != null ) {
View Full Code Here

Examples of org.jasig.portal.layout.restrictions.IUserLayoutRestriction

     if ( !oldParentNode.equals(newParentNode) ) {
      // Checking children related restrictions
      Collection restrictions = newParentNode.getRestrictionsByPath(IUserLayoutRestriction.CHILDREN_RESTRICTION_PATH);
      for ( Iterator i = restrictions.iterator(); i.hasNext(); ) {
         IUserLayoutRestriction restriction = (IUserLayoutRestriction) i.next();
         if (   !restriction.getName().equals(RestrictionTypes.DEPTH_RESTRICTION) &&
                !restriction.checkRestriction(node) )
            return false;
      }

      // Checking parent related restrictions
      restrictions = node.getRestrictionsByPath(IUserLayoutRestriction.PARENT_RESTRICTION_PATH);
      for ( Iterator i = restrictions.iterator(); i.hasNext(); ) {
          IUserLayoutRestriction restriction = (IUserLayoutRestriction) i.next();
          if !restriction.getName().equals(RestrictionTypes.DEPTH_RESTRICTION) &&
                !restriction.checkRestriction(newParentNode) )
            return false;
      }

      // Checking depth restrictions for the node and all its descendants
      if ( !checkDepthRestrictions(nodeId,newParentId) )
View Full Code Here

Examples of org.jasig.portal.layout.restrictions.IUserLayoutRestriction


        // Checking parent related restrictions for the children
        Collection restrictions = layout.getLayoutNode(node.getParentNodeId()).getRestrictionsByPath(IUserLayoutRestriction.CHILDREN_RESTRICTION_PATH);
        for ( Iterator i = restrictions.iterator(); i.hasNext(); ) {
         IUserLayoutRestriction restriction = (IUserLayoutRestriction) i.next();
         if ( !restriction.checkRestriction(node) ) {
            node.setNodeDescription(currentNodeDesc);
            return false;
         }
        }


        // Checking child related restrictions for the parent
        if ( node.getNodeType() == IUserLayoutNodeDescription.FOLDER ) {
         for ( String nextId = ((ALFolder)node).getFirstChildNodeId(); nextId != null; ) {
          ALNode child = layout.getLayoutNode(nextId);
          restrictions = child.getRestrictionsByPath(IUserLayoutRestriction.PARENT_RESTRICTION_PATH);
          for ( Iterator i = restrictions.iterator(); i.hasNext(); ) {
           IUserLayoutRestriction restriction = (IUserLayoutRestriction) i.next();
           if ( !restriction.checkRestriction(node) ) {
            node.setNodeDescription(currentNodeDesc);
            return false;
           }
          }
            nextId = child.getNextNodeId();
View Full Code Here

Examples of org.jasig.portal.layout.restrictions.IUserLayoutRestriction

     */
     public Vector getRestrictionsByPath( String restrictionPath ) {
       Vector list = new Vector();
       if ( restrictions != null ) {
        for ( Enumeration enum1 = restrictions.elements(); enum1.hasMoreElements(); ) {
          IUserLayoutRestriction restriction = (IUserLayoutRestriction) enum1.nextElement();
          if ( CommonUtils.nvl(restrictionPath).equals(CommonUtils.nvl(restriction.getRestrictionPath())) )
               list.add(restriction);
        }
       }
         return list;
     }
View Full Code Here

Examples of org.jasig.portal.layout.restrictions.IUserLayoutRestriction

    protected void addRestrictionChildren(Element node, Document root) {
       if ( restrictions != null )
        for ( Enumeration enum1 = restrictions.elements(); enum1.hasMoreElements(); ) {
            Element pElement=root.createElement("restriction");
            IUserLayoutRestriction restriction = (IUserLayoutRestriction) enum1.nextElement();
            pElement.setAttribute("path",restriction.getRestrictionPath());
            pElement.setAttribute("value",restriction.getRestrictionExpression());
            pElement.setAttribute("type",restriction.getName());
            node.appendChild(pElement);
        }
    }
View Full Code Here

Examples of org.jasig.portal.layout.restrictions.IUserLayoutRestriction

         if ( fragmentId > 0 && layoutId < 0 ) {   

           Enumeration restrictions = restrHash.elements();
          
           for ( ;restrictions.hasMoreElements(); ) {
             IUserLayoutRestriction restriction = (IUserLayoutRestriction) restrictions.nextElement();

             psAddRestriction.setString(1,restriction.getName());
             psAddRestriction.setInt(2,nodeId);
             psAddRestriction.setInt(3,fragmentId);
             psAddRestriction.setString(4,restriction.getRestrictionExpression());

              String path = restriction.getRestrictionPath();
              psAddRestriction.setString(5,path);

             //execute update restrictions
             psAddRestriction.executeUpdate();

           }

         } else if ( fragmentId <= 0 ) {

            Enumeration restrictions = restrHash.elements();
 
            for ( ;restrictions.hasMoreElements(); ) {
             IUserLayoutRestriction restriction = (IUserLayoutRestriction) restrictions.nextElement();

             psAddRestriction.setString(1,restriction.getName());
             psAddRestriction.setInt(2,layoutId);
             psAddRestriction.setInt(3,userId);
             psAddRestriction.setInt(4,nodeId);
             psAddRestriction.setString(5,restriction.getRestrictionExpression());

             String path = restriction.getRestrictionPath();
             psAddRestriction.setString(6,path);

             //execute update restrictions
             psAddRestriction.executeUpdate();
View Full Code Here

Examples of org.jasig.portal.layout.restrictions.IUserLayoutRestriction

          if ( fragmentId > 0 && layoutId < ) {

           Enumeration restrictions = restrHash.elements();
           for ( ;restrictions.hasMoreElements(); ) {
            IUserLayoutRestriction restriction = (IUserLayoutRestriction) restrictions.nextElement();

            psUpdateRestriction.setString(1,restriction.getRestrictionExpression());
            psUpdateRestriction.setInt(2,fragmentId);
            psUpdateRestriction.setInt(3,nodeId);
            psUpdateRestriction.setString(4,restriction.getName());

            String path = restriction.getRestrictionPath();
            psUpdateRestriction.setString(5,path);

            //execute update restrictions
            count += psUpdateRestriction.executeUpdate();
           } // end for */

          } else if ( fragmentId <= 0 ) {

           Enumeration restrictions = restrHash.elements();
           for ( ;restrictions.hasMoreElements(); ) {
            IUserLayoutRestriction restriction = (IUserLayoutRestriction) restrictions.nextElement();

            psUpdateRestriction.setString(1,restriction.getRestrictionExpression());
            psUpdateRestriction.setInt(2,layoutId);
            psUpdateRestriction.setInt(3,userId);
            psUpdateRestriction.setInt(4,nodeId);
            psUpdateRestriction.setString(5,restriction.getName());

            String path = restriction.getRestrictionPath();
            psUpdateRestriction.setString(6,path);

            //execute update restrictions
            count += psUpdateRestriction.executeUpdate();

View Full Code Here
TOP
Copyright © 2018 www.massapi.com. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.