Skip to main content
summaryrefslogtreecommitdiffstats
blob: 6e759054db68a5ad9865f181684c7e74196cae11 (plain) (blame)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
/*******************************************************************************
 * Copyright (c) 2010 Boeing.
 * All rights reserved. This program and the accompanying materials
 * are made available under the terms of the Eclipse Public License v1.0
 * which accompanies this distribution, and is available at
 * http://www.eclipse.org/legal/epl-v10.html
 *
 * Contributors:
 *     Boeing - initial API and implementation
 *******************************************************************************/
package org.eclipse.osee.framework.ui.skynet.dbHealth;

import org.eclipse.core.runtime.IProgressMonitor;
import org.eclipse.nebula.widgets.xviewer.XViewerColumn;
import org.eclipse.nebula.widgets.xviewer.XViewerColumn.SortDataType;
import org.eclipse.osee.framework.database.operation.InvalidTxCurrentsAndModTypes;
import org.eclipse.osee.framework.ui.skynet.results.ResultsReporter;
import org.eclipse.osee.framework.ui.skynet.results.table.ResultsEditorTableTab;
import org.eclipse.swt.SWT;

/**
 * @author Ryan D. Brooks
 */
public class TxCurrentChecks extends DatabaseHealthOperation {

   public TxCurrentChecks() {
      super("All tx currents and mod types");
   }

   @Override
   protected void doHealthCheck(IProgressMonitor monitor) throws Exception {
      getResultsProvider().clearTabs();

      checkAndFix("osee_artifact", "art_id", monitor);
      checkAndFix("osee_attribute", "attr_id", monitor);
      checkAndFix("osee_relation_link", "rel_link_id", monitor);
   }

   private void checkAndFix(String tableName, String columnName, IProgressMonitor monitor) throws Exception {
      ResultsEditorTableTab resultsTab = new ResultsEditorTableTab(tableName + " currents");
      getResultsProvider().addResultsTab(resultsTab);
      resultsTab.addColumn(new XViewerColumn("1", "Issue", 220, SWT.LEFT, true, SortDataType.String, false, ""));
      resultsTab.addColumn(new XViewerColumn("2", "Branch Id", 80, SWT.LEFT, true, SortDataType.Integer, false, ""));
      resultsTab.addColumn(new XViewerColumn("3", columnName, 80, SWT.LEFT, true, SortDataType.Integer, false, ""));
      resultsTab.addColumn(new XViewerColumn("4", "Transaction Id", 80, SWT.LEFT, true, SortDataType.Integer, false, ""));
      resultsTab.addColumn(new XViewerColumn("5", "Gamma Id", 80, SWT.LEFT, true, SortDataType.Integer, false, ""));
      resultsTab.addColumn(new XViewerColumn("6", "Mod Type", 80, SWT.LEFT, true, SortDataType.String, false, ""));
      resultsTab.addColumn(new XViewerColumn("7", "TX Current", 80, SWT.LEFT, true, SortDataType.String, false, ""));

      doSubWork(new InvalidTxCurrentsAndModTypes("TxCurrentChecks ", tableName, columnName, new ResultsReporter(
         resultsTab), isFixOperationEnabled(), true), monitor, 0.3);
   }

   @Override
   public String getCheckDescription() {
      return "Find versions of artifact, attributes, and relations that currents that ";
   }

   @Override
   public String getFixDescription() {
      return null;
   }
}

Back to the top