/** * Override this to open the main file. * <p />You should pass this record owner to the new main file (ie., new MyNewTable(thisRecordOwner)). * @return The new record. */ public Record openMainRecord() { return new UserPermission(this); }
/** * Constructor. */ public UserPermission(RecordOwner screen) { this(); this.init(screen); } /**
/** * UpdateResourcePermissions Method. */ public void updateResourcePermissions() { UserPermission recUserPermission = new UserPermission(Utility.getRecordOwner(this.getOwner())); recUserPermission.addListener(new SubFileFilter(this.getOwner())); try { while (recUserPermission.hasNext()) { recUserPermission.next(); recUserPermission.edit(); recUserPermission.getField(UserPermission.kUserResourceID).setModified(true); // Fake a mod, so the group permissions will be updated recUserPermission.set(); } } catch (DBException ex) { ex.printStackTrace(); } recUserPermission.free(); }
/** * Add all standard file & field behaviors. * Override this to add record listeners and filters. */ public void addListeners() { super.addListeners(); this.addListener(new UpdateGroupPermissionHandler(null)); }
/** * Add this key area description to the Record. */ public KeyArea setupKey(int iKeyArea) { KeyArea keyArea = null; if (iKeyArea == 0) { keyArea = this.makeIndex(DBConstants.UNIQUE, ID_KEY); keyArea.addKeyField(ID, DBConstants.ASCENDING); } if (iKeyArea == 1) { keyArea = this.makeIndex(DBConstants.UNIQUE, USER_GROUP_ID_KEY); keyArea.addKeyField(USER_GROUP_ID, DBConstants.ASCENDING); keyArea.addKeyField(USER_RESOURCE_ID, DBConstants.ASCENDING); keyArea.addKeyField(LOGIN_LEVEL, DBConstants.ASCENDING); } if (iKeyArea == 2) { keyArea = this.makeIndex(DBConstants.UNIQUE, USER_RESOURCE_ID_KEY); keyArea.addKeyField(USER_RESOURCE_ID, DBConstants.ASCENDING); keyArea.addKeyField(USER_GROUP_ID, DBConstants.ASCENDING); keyArea.addKeyField(LOGIN_LEVEL, DBConstants.ASCENDING); } if (keyArea == null) keyArea = super.setupKey(iKeyArea); return keyArea; } /**
/** * UpdateResourcePermissions Method. */ public void updateResourcePermissions() { UserPermission recUserPermission = new UserPermission(this.getOwner().findRecordOwner()); recUserPermission.addListener(new SubFileFilter(this.getOwner())); try { while (recUserPermission.hasNext()) { recUserPermission.next(); recUserPermission.edit(); recUserPermission.getField(UserPermission.USER_RESOURCE_ID).setModified(true); // Fake a mod, so the group permissions will be updated recUserPermission.set(); } } catch (DBException ex) { ex.printStackTrace(); } recUserPermission.free(); }
/** * Add all standard file & field behaviors. * Override this to add record listeners and filters. */ public void addListeners() { super.addListeners(); this.addListener(new UpdateGroupPermissionHandler(null)); }
if (iKeyArea == kIDKey) keyArea = this.makeIndex(DBConstants.UNIQUE, "PrimaryKey"); keyArea.addKeyField(kID, DBConstants.ASCENDING); keyArea = this.makeIndex(DBConstants.UNIQUE, "UserGroupID"); keyArea.addKeyField(kUserGroupID, DBConstants.ASCENDING); keyArea.addKeyField(kUserResourceID, DBConstants.ASCENDING); keyArea = this.makeIndex(DBConstants.UNIQUE, "UserResourceID"); keyArea.addKeyField(kUserResourceID, DBConstants.ASCENDING); keyArea.addKeyField(kUserGroupID, DBConstants.ASCENDING);
/** * Override this to open the main file. * <p />You should pass this record owner to the new main file (ie., new MyNewTable(thisRecordOwner)). * @return The new record. */ public Record openMainRecord() { return new UserPermission(this); } /**
/** * Constructor. */ public UserPermission(RecordOwner screen) { this(); this.init(screen); } /**
m_recUserPermission = new UserPermission(this.getOwner().findRecordOwner()); Record m_recUserGroup = ((ReferenceField)m_recUserPermission.getField(UserPermission.USER_GROUP_ID)).getReferenceRecord();
m_recUserPermission = new UserPermission(Utility.getRecordOwner(this.getOwner())); Record m_recUserGroup = ((ReferenceField)m_recUserPermission.getField(UserPermission.kUserGroupID)).getReferenceRecord();