*/
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 {