public override void update() { CswNbtMetaDataObjectClass ReportOC = _CswNbtSchemaModTrnsctn.MetaData.getObjectClass( CswEnumNbtObjectClass.ReportClass ); foreach( CswNbtObjClassReport ReportNode in ReportOC.getNodes( false, true, false, true ) ) { if( "Location Codes" == ReportNode.ReportName.Text ) { ReportNode.SQL.Text = @"select lscode,location,name,Location || ' > ' || name pathname, type from ( select barcode lscode,name,location,'building' type from building union select barcode lscode,name,location,'room' type from room union select barcode lscode,name,location,'cabinet' type from cabinet union select barcode lscode, name, location, 'floor' type from floor union select barcode lscode, name, location, 'shelf' type from shelf union select barcode lscode, name, location, 'box' type from box ) x where name is not null and location is not null and lower(location || ' > ' || name) like lower(trim('{LocationBegins}') || '%') order by lower(location), lower(name)"; ReportNode.postChanges( false ); } } } // update()
public override void update() { // Add (demo) to Lab 1 Deficiencies Report CswNbtMetaDataObjectClass ReportOC = _CswNbtSchemaModTrnsctn.MetaData.getObjectClass( NbtObjectClass.ReportClass ); foreach( CswNbtObjClassReport ReportNode in ReportOC.getNodes( false, false ) ) { if( ReportNode.ReportName.Text == "Lab 1 Deficiencies" ) { ReportNode.ReportName.Text = "Lab 1 Deficiencies (demo)"; ReportNode.postChanges( false ); } } } //Update()
public override void update() { #region NodeTypes CswNbtMetaDataNodeType ReportGroupPermNT = _createPermissionNT( CswEnumNbtObjectClass.ReportGroupPermissionClass, "Report Group Permission" ); CswNbtMetaDataNodeType MailReportGroupPermNT = _createPermissionNT( CswEnumNbtObjectClass.MailReportGroupPermissionClass, "Mail Report Group Permission" ); CswNbtMetaDataNodeType ReportGroupNT = _createGroupNT( CswEnumNbtObjectClass.ReportGroupClass, "Report Group", CswNbtObjClassReportGroup.PropertyName.Reports ); CswNbtMetaDataNodeType MailReportGroupNT = _createGroupNT( CswEnumNbtObjectClass.MailReportGroupClass, "Mail Report Group", CswNbtObjClassMailReportGroup.PropertyName.MailReports ); CswNbtMetaDataObjectClass InvGrpPermOC = _CswNbtSchemaModTrnsctn.MetaData.getObjectClass( CswEnumNbtObjectClass.InventoryGroupPermissionClass ); _CswNbtSchemaModTrnsctn.MetaData.makeMissingNodeTypeProps();//For some reason this is needed here or else the following code will throw an ORNI on a full master reset foreach( CswNbtMetaDataNodeType InvGrpPermNT in InvGrpPermOC.getNodeTypes() ) { _setPermissionPropFilters( InvGrpPermNT ); } #endregion NodeTypes #region Permission Group Nodes CswNbtObjClassReportGroup DefaultReportGroup = _CswNbtSchemaModTrnsctn.Nodes.makeNodeFromNodeTypeId( ReportGroupNT.NodeTypeId, CswEnumNbtMakeNodeOperation.MakeTemp ); DefaultReportGroup.Name.Text = "Default Report Group"; DefaultReportGroup.IsTemp = false; DefaultReportGroup.postChanges( false ); CswNbtMetaDataObjectClass ReportOC = _CswNbtSchemaModTrnsctn.MetaData.getObjectClass( CswEnumNbtObjectClass.ReportClass ); foreach( CswNbtObjClassReport ReportNode in ReportOC.getNodes( false, false ) ) { ReportNode.ReportGroup.RelatedNodeId = DefaultReportGroup.NodeId; ReportNode.postChanges( false ); } CswNbtObjClassMailReportGroup DefaultMailReportGroup = _CswNbtSchemaModTrnsctn.Nodes.makeNodeFromNodeTypeId( MailReportGroupNT.NodeTypeId, CswEnumNbtMakeNodeOperation.MakeTemp ); DefaultMailReportGroup.Name.Text = "Default Mail Report Group"; DefaultMailReportGroup.IsTemp = false; DefaultMailReportGroup.postChanges( false ); CswNbtMetaDataObjectClass MailReportOC = _CswNbtSchemaModTrnsctn.MetaData.getObjectClass( CswEnumNbtObjectClass.MailReportClass ); foreach( CswNbtObjClassMailReport MailReportNode in MailReportOC.getNodes( false, false ) ) { MailReportNode.MailReportGroup.RelatedNodeId = DefaultMailReportGroup.NodeId; MailReportNode.postChanges( false ); } #endregion Permission Group Nodes #region Inventory Group Permission Nodes CswNbtMetaDataNodeType InventoryGroupNT = InvGrpPermOC.FirstNodeType; if( null != InventoryGroupNT ) { CswNbtMetaDataNodeTypeProp PermissionGroupNTP = InventoryGroupNT.getNodeTypePropByObjectClassProp( CswNbtPropertySetPermission.PropertyName.PermissionGroup ); if( null != PermissionGroupNTP ) { PermissionGroupNTP.PropName = CswNbtPropertySetPermission.PropertyName.PermissionGroup; } } foreach( CswNbtObjClassInventoryGroupPermission InvGrpPermNode in InvGrpPermOC.getNodes( false, false ) ) { InvGrpPermNode.ApplyToAllWorkUnits.Checked = CswEnumTristate.False; InvGrpPermNode.ApplyToAllRoles.Checked = CswEnumTristate.False; InvGrpPermNode.PermissionGroup.RefreshNodeName(); InvGrpPermNode.postChanges( false ); } CswNbtMetaDataObjectClass InvGrpOC = _CswNbtSchemaModTrnsctn.MetaData.getObjectClass( CswEnumNbtObjectClass.InventoryGroupClass ); foreach( CswNbtObjClassInventoryGroup InvGrpNode in InvGrpOC.getNodes( false, false ) ) { if( InvGrpNode.Name.Text == "Default Inventory Group" && null != InventoryGroupNT ) { CswNbtObjClassInventoryGroupPermission WildCardInventoryGroupPermission = _CswNbtSchemaModTrnsctn.Nodes.makeNodeFromNodeTypeId( InventoryGroupNT.NodeTypeId, CswEnumNbtMakeNodeOperation.DoNothing ); WildCardInventoryGroupPermission.ApplyToAllRoles.Checked = CswEnumTristate.True; WildCardInventoryGroupPermission.ApplyToAllWorkUnits.Checked = CswEnumTristate.True; WildCardInventoryGroupPermission.PermissionGroup.RelatedNodeId = InvGrpNode.NodeId; WildCardInventoryGroupPermission.View.Checked = CswEnumTristate.True; WildCardInventoryGroupPermission.Edit.Checked = CswEnumTristate.True; WildCardInventoryGroupPermission.Dispense.Checked = CswEnumTristate.False; WildCardInventoryGroupPermission.Dispose.Checked = CswEnumTristate.False; WildCardInventoryGroupPermission.Request.Checked = CswEnumTristate.False; WildCardInventoryGroupPermission.Undispose.Checked = CswEnumTristate.False; WildCardInventoryGroupPermission.WorkUnit.RelatedNodeId = null; WildCardInventoryGroupPermission.WorkUnit.RefreshNodeName(); WildCardInventoryGroupPermission.WorkUnit.SyncGestalt(); WildCardInventoryGroupPermission.postChanges( false ); } } //This is now being handled as part of creating the Default Group nodes /*CswNbtObjClassReportGroupPermission WildCardReportGroupPermission = _CswNbtSchemaModTrnsctn.Nodes.makeNodeFromNodeTypeId( ReportGroupPermNT.NodeTypeId, CswEnumNbtMakeNodeOperation.DoNothing ); WildCardReportGroupPermission.ApplyToAllRoles.Checked = CswEnumTristate.True; WildCardReportGroupPermission.ApplyToAllWorkUnits.Checked = CswEnumTristate.True; WildCardReportGroupPermission.PermissionGroup.RelatedNodeId = DefaultReportGroup.NodeId; WildCardReportGroupPermission.View.Checked = CswEnumTristate.True; WildCardReportGroupPermission.Edit.Checked = CswEnumTristate.True; WildCardReportGroupPermission.postChanges( false ); CswNbtObjClassMailReportGroupPermission WildCardMailReportGroupPermission = _CswNbtSchemaModTrnsctn.Nodes.makeNodeFromNodeTypeId( MailReportGroupPermNT.NodeTypeId, CswEnumNbtMakeNodeOperation.DoNothing ); WildCardMailReportGroupPermission.ApplyToAllRoles.Checked = CswEnumTristate.True; WildCardMailReportGroupPermission.ApplyToAllWorkUnits.Checked = CswEnumTristate.True; WildCardMailReportGroupPermission.PermissionGroup.RelatedNodeId = DefaultMailReportGroup.NodeId; WildCardMailReportGroupPermission.View.Checked = CswEnumTristate.True; WildCardMailReportGroupPermission.Edit.Checked = CswEnumTristate.True; WildCardMailReportGroupPermission.postChanges( false );*/ #endregion Inventory Group Permission Nodes } // update()