Examples of IUserLayoutRestriction


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

           PreparedStatement  psFragmentRestr =
             con.prepareStatement("DELETE FROM UP_FRAGMENT_RESTRICTIONS"+
                                  " WHERE FRAGMENT_ID=? AND NODE_ID=? AND RESTRICTION_NAME=? AND RESTRICTION_TREE_PATH=?");
           Enumeration restrictions = restrHash.elements();
           for ( ;restrictions.hasMoreElements(); ) {
            IUserLayoutRestriction restriction = (IUserLayoutRestriction) restrictions.nextElement();

            psFragmentRestr.setInt(1,fragmentId);
            psFragmentRestr.setInt(2,nodeId);
            psFragmentRestr.setString(3,restriction.getName());

            String path = restriction.getRestrictionPath();
            psFragmentRestr.setString(4,path);

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

           } // end for
            psFragmentRestr.close();

          // fragment ID is null
          } else  if ( fragmentId <= 0 ){

           PreparedStatement  psRestr =
             con.prepareStatement("DELETE FROM UP_LAYOUT_RESTRICTIONS"+
                                  " WHERE LAYOUT_ID=? AND USER_ID=? AND NODE_ID=? AND RESTRICTION_NAME=? AND RESTRICTION_TREE_PATH=?");

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

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

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

            //execute update restrictions
            count += psRestr.executeUpdate();
View Full Code Here

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

                  String restrName = rsRestr.getString(1);
                  String restrExp = rsRestr.getString(2);
                  String restrPath = rsRestr.getString(3);
                  if ( restrPath == null || restrPath.trim().length() == 0 )
                    restrPath = IUserLayoutRestriction.LOCAL_RESTRICTION_PATH;
                  IUserLayoutRestriction restriction = UserLayoutRestrictionFactory.createRestriction(restrName,restrExp,restrPath);
                  nodeDesc.addRestriction(restriction);
              }
               rsRestr.close();
               if ( psRestr != null ) psRestr.close();
View Full Code Here

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

                  String restrName = rsRestr.getString(1);
                  String restrExp = rsRestr.getString(2);
                  String restrPath = rsRestr.getString(3);
                  if ( restrPath == null || restrPath.trim().length() == 0 )
                    restrPath = IUserLayoutRestriction.LOCAL_RESTRICTION_PATH;
                  IUserLayoutRestriction restriction = UserLayoutRestrictionFactory.createRestriction(restrName,restrExp,restrPath);
                  nodeDesc.addRestriction(restriction);
              }
               rsRestr.close();
               if ( psRestr != null ) psRestr.close();
View Full Code Here

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

  private void bindRestrictions( IALNodeDescription nodeDesc, ContentHandler contentHandler ) throws SAXException {
      Hashtable restrictions = nodeDesc.getRestrictions();
      if ( restrictions != null ) {
       for ( Enumeration e = restrictions.elements(); e.hasMoreElements(); ) {
        IUserLayoutRestriction restriction = (IUserLayoutRestriction ) e.nextElement();
         AttributesImpl paramAttrs = new AttributesImpl();
         paramAttrs.addAttribute("","path","path","CDATA",restriction.getRestrictionPath());
         // we have to re-scale the priority restriction for the UI
         if ( restriction.getName().equals(RestrictionTypes.PRIORITY_RESTRICTION) ) {
          PriorityRestriction priorRestriction = (PriorityRestriction) restriction;
          paramAttrs.addAttribute("","value","value","CDATA",((int)priorRestriction.getMinValue()/IAggregatedUserLayoutManager.PRIORITY_COEFF)+"-"+
                                                             ((int)priorRestriction.getMaxValue()/IAggregatedUserLayoutManager.PRIORITY_COEFF));
         } else
          paramAttrs.addAttribute("","value","value","CDATA",restriction.getRestrictionExpression());

         paramAttrs.addAttribute("","type","type","CDATA",restriction.getName());
         contentHandler.startElement("",RESTRICTION,RESTRICTION,paramAttrs);
         contentHandler.endElement("",RESTRICTION,RESTRICTION);
       }
      }
  }
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.