Package com.knowgate.acl

Examples of com.knowgate.acl.ACLDomain


    if (DebugFile.trace) {
      DebugFile.writeln("Begin ACLDomain.getSharedFilesCategory([Connection])");
      DebugFile.incIdent();
    }

  ACLDomain oDomain = new ACLDomain();
 
  if (oDomain.load(oConn, new Object[]{new Integer(iDomain)})) {
 
      Category oDomainRoot = forDomain(oConn, iDomain);
   
      if (null!=oDomainRoot) {
   
      String sSQL = "SELECT c." +  DB.gu_category + " FROM " + DB.k_categories + " c," + DB.k_cat_tree + " t WHERE c." + DB.gu_category + "=t." + DB.gu_child_cat + " AND t." + DB.gu_parent_cat + "=? AND c." + DB.nm_category + "=?";
        if (DebugFile.trace) DebugFile.writeln("Connection.prepareStatement(" + sSQL + ")");

      PreparedStatement oStmt = oConn.prepareStatement (sSQL, ResultSet.TYPE_FORWARD_ONLY, ResultSet.CONCUR_READ_ONLY);

      oStmt.setString (1, oDomainRoot.getString(DB.gu_category));
      oStmt.setString (2, oDomain.getString(DB.nm_domain) + "_SHARED");

      ResultSet oRSet = oStmt.executeQuery();

      if (oRSet.next())
        oDomainShared = new Category(oConn,oRSet.getString(1));
View Full Code Here


   */
    public boolean store(JDCConnection oConn, String sParentCategoryId) throws SQLException {
      boolean bRetVal;
      Category oRootCat;
      Category oBundlesCat;
      ACLDomain oDomain;

      if (DebugFile.trace) {
        DebugFile.writeln("Begin Shop.store([Connection], " + sParentCategoryId + ")");
        DebugFile.incIdent();
      }

      if (sParentCategoryId==null)
        throw new java.lang.IllegalArgumentException("Parent category Identifier cannot be null");

      if (sParentCategoryId.length()==0)
        throw new java.lang.IllegalArgumentException("Parent category Identifier cannot be empty");

      if (!AllVals.containsKey(DB.gu_shop))
        put(DB.gu_shop, Gadgets.generateUUID());

      if (!AllVals.containsKey(DB.bo_active))
        put(DB.bo_active, (short)1);

      oDomain = new ACLDomain(oConn, getInt(DB.id_domain));

      if (!AllVals.containsKey(DB.gu_root_cat)) {
        if (DebugFile.trace) DebugFile.writeln("creating shops category for domain " + String.valueOf(getInt(DB.id_domain)));

        oRootCat = new Category(Category.store(oConn, null, sParentCategoryId, Category.makeName(oConn, getString(DB.nm_shop)), getShort(DB.bo_active), (short)0, oDomain.getString(DB.gu_owner), null, null));
        oRootCat.setUserPermissions(oConn, oDomain.getString(DB.gu_owner), ACL.PERMISSION_FULL_CONTROL, (short)0, (short)0);
        oRootCat.setGroupPermissions(oConn, oDomain.getString(DB.gu_admins), ACL.PERMISSION_FULL_CONTROL, (short)0, (short)0);

        if (sAuditUsr.length()>0 && !sAuditUsr.equals(oDomain.getString(DB.gu_owner))) {
          oRootCat.setUserPermissions(oConn, sAuditUsr, ACL.PERMISSION_MODIFY, (short)0, (short)0);
        }
        put(DB.gu_root_cat, oRootCat.getString(DB.gu_category));
      }
      else {
        oRootCat = new Category(getString(DB.gu_root_cat));
        if (!oRootCat.isChildOf(oConn, sParentCategoryId));
          throw new IllegalArgumentException("Root Category is not a child of specified Parent Category");
      }

      if (!AllVals.containsKey(DB.gu_bundles_cat)) {
        if (DebugFile.trace) DebugFile.writeln("creating bundles category for domain " + String.valueOf(getInt(DB.id_domain)));

        oBundlesCat = new Category(Category.store(oConn, null, sParentCategoryId, Category.makeName(oConn, getString(DB.nm_shop)+"_BUNDLES"), getShort(DB.bo_active), (short)0, oDomain.getString(DB.gu_owner), null, null));
        oBundlesCat.setUserPermissions(oConn, oDomain.getString(DB.gu_owner), ACL.PERMISSION_FULL_CONTROL, (short)0, (short)0);
        oBundlesCat.setGroupPermissions(oConn, oDomain.getString(DB.gu_admins), ACL.PERMISSION_FULL_CONTROL, (short)0, (short)0);

        if (sAuditUsr.length()>0 && !sAuditUsr.equals(oDomain.getString(DB.gu_owner))) {
          oBundlesCat.setUserPermissions(oConn, sAuditUsr, ACL.PERMISSION_MODIFY, (short)0, (short)0);
        }
        put(DB.gu_bundles_cat, oBundlesCat.getString(DB.gu_category));
      }
      else {
View Full Code Here

TOP

Related Classes of com.knowgate.acl.ACLDomain

Copyright © 2018 www.massapicom. 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.