Skip to main content
summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorjmisinco2011-08-29 15:31:42 +0000
committerRyan D. Brooks2011-08-29 15:31:42 +0000
commitf8e462a2726067b16167a45c440fde911e6f65a7 (patch)
tree5f6e44196f05c0ded37a92bf4d15b9c58654f1d0
parente402ef8574d8dc38fd76a67d1acdb896b6c7cd98 (diff)
downloadorg.eclipse.osee-f8e462a2726067b16167a45c440fde911e6f65a7.tar.gz
org.eclipse.osee-f8e462a2726067b16167a45c440fde911e6f65a7.tar.xz
org.eclipse.osee-f8e462a2726067b16167a45c440fde911e6f65a7.zip
feature[ats_M1Y56]: Remove references to osee_artifact_type table
-rw-r--r--plugins/org.eclipse.osee.framework.server.admin/src/org/eclipse/osee/framework/server/admin/PurgeAttributeType.java80
-rw-r--r--plugins/org.eclipse.osee.framework.server.admin/src/org/eclipse/osee/framework/server/admin/ServerAdminCommandProvider.java18
-rw-r--r--plugins/org.eclipse.osee.framework.skynet.core/src/org/eclipse/osee/framework/skynet/core/artifact/ArtifactTypeManager.java14
-rw-r--r--plugins/org.eclipse.osee.framework.ui.data.model.editor/META-INF/MANIFEST.MF1
-rw-r--r--plugins/org.eclipse.osee.framework.ui.data.model.editor/src/org/eclipse/osee/framework/ui/data/model/editor/input/OseeDataTypeDatastore.java28
-rw-r--r--plugins/org.eclipse.osee.framework.ui.skynet.test/src/org/eclipse/osee/framework/ui/skynet/test/cases/ImageManagerTest.java36
-rw-r--r--plugins/org.eclipse.osee.framework.ui.skynet/images/implementationDetails.gifbin0 -> 1033 bytes
-rw-r--r--plugins/org.eclipse.osee.framework.ui.skynet/images/implementationDetails.xcfbin0 -> 2433 bytes
-rw-r--r--plugins/org.eclipse.osee.framework.ui.skynet/plugin.xml6
-rw-r--r--plugins/org.eclipse.osee.framework.ui.skynet/src/org/eclipse/osee/framework/ui/skynet/ArtifactImageManager.java49
-rw-r--r--plugins/org.eclipse.osee.framework.ui.skynet/src/org/eclipse/osee/framework/ui/skynet/FrameworkArtifactImageProvider.java2
-rw-r--r--plugins/org.eclipse.osee.framework.ui.skynet/src/org/eclipse/osee/framework/ui/skynet/FrameworkImage.java1
-rw-r--r--plugins/org.eclipse.osee.framework.ui.skynet/src/org/eclipse/osee/framework/ui/skynet/blam/operation/UpdateArtifactTypeImage.java88
-rw-r--r--plugins/org.eclipse.osee.framework.ui.skynet/src/org/eclipse/osee/framework/ui/skynet/dbHealth/DuplicateHRID.java8
-rw-r--r--plugins/org.eclipse.osee.framework.ui.skynet/src/org/eclipse/osee/framework/ui/skynet/search/ArtifactSearchPage.java2
15 files changed, 21 insertions, 312 deletions
diff --git a/plugins/org.eclipse.osee.framework.server.admin/src/org/eclipse/osee/framework/server/admin/PurgeAttributeType.java b/plugins/org.eclipse.osee.framework.server.admin/src/org/eclipse/osee/framework/server/admin/PurgeAttributeType.java
deleted file mode 100644
index 4db74153271..00000000000
--- a/plugins/org.eclipse.osee.framework.server.admin/src/org/eclipse/osee/framework/server/admin/PurgeAttributeType.java
+++ /dev/null
@@ -1,80 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2004, 2011 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.server.admin;
-
-import java.util.LinkedList;
-import org.eclipse.core.runtime.IProgressMonitor;
-import org.eclipse.osee.framework.core.exception.OseeArgumentException;
-import org.eclipse.osee.framework.core.exception.OseeCoreException;
-import org.eclipse.osee.framework.core.operation.OperationLogger;
-import org.eclipse.osee.framework.database.IOseeDatabaseService;
-import org.eclipse.osee.framework.database.core.AbstractDbTxOperation;
-import org.eclipse.osee.framework.database.core.ConnectionHandler;
-import org.eclipse.osee.framework.database.core.OseeConnection;
-import org.eclipse.osee.framework.server.admin.internal.Activator;
-
-/**
- * Purges given attribute types.<br/>
- * <p>
- * Tables involved:
- * <li>osee_artifact_type_attributes</li>
- * <li>osee_attribute</li>
- * <li>osee_attribute_type</li>
- * </p>
- * <br/>
- *
- * @author Ryan D. Brooks
- * @author Shawn F. Cook
- */
-public class PurgeAttributeType extends AbstractDbTxOperation {
- private static final String DELETE_ARTIFACT_ATTRIBUTE =
- "delete from osee_artifact_type_attributes where attr_type_id = ?";
- private static final String COUNT_ATTRIBUTE_OCCURRENCE =
- "select count(1) FROM osee_attribute where attr_type_id = ?";
- private static final String DELETE_ATTRIBUTE_TYPE = "delete from osee_attribute_type where attr_type_id = ?";
-
- private final LinkedList<String> attributeTypeIds;
-
- public PurgeAttributeType(IOseeDatabaseService databaseService, OperationLogger logger, String... typesToPurge) {
- super(databaseService, "Purge Attribute Type", Activator.PLUGIN_ID, logger);
-
- this.attributeTypeIds = new LinkedList<String>();
- for (String att : typesToPurge) {
- this.attributeTypeIds.add(att);
- }
- }
-
- @Override
- protected void doTxWork(IProgressMonitor monitor, OseeConnection connection) throws OseeCoreException {
-
- log();
- log("Purging Attribute Types...");
-
- for (String attributeTypeId : attributeTypeIds) {
- log(" Purging " + attributeTypeId);
- purgeAttributeType(attributeTypeId, connection);
- }
-
- log("...done.");
- }
-
- private static void purgeAttributeType(final String attributeTypeId, OseeConnection connection) throws OseeCoreException {
- int attributeCount = ConnectionHandler.runPreparedQueryFetchInt(0, COUNT_ATTRIBUTE_OCCURRENCE, attributeTypeId);
- if (attributeCount != 0) {
- throw new OseeArgumentException(
- "Can not delete attribute type [%s] because there are %d existing attributes of this type.",
- attributeTypeId, attributeCount);
- }
-
- ConnectionHandler.runPreparedUpdate(connection, DELETE_ARTIFACT_ATTRIBUTE, attributeTypeId);
- ConnectionHandler.runPreparedUpdate(connection, DELETE_ATTRIBUTE_TYPE, attributeTypeId);
- }
-}
diff --git a/plugins/org.eclipse.osee.framework.server.admin/src/org/eclipse/osee/framework/server/admin/ServerAdminCommandProvider.java b/plugins/org.eclipse.osee.framework.server.admin/src/org/eclipse/osee/framework/server/admin/ServerAdminCommandProvider.java
index b4aa353ff08..6bcbaf8c578 100644
--- a/plugins/org.eclipse.osee.framework.server.admin/src/org/eclipse/osee/framework/server/admin/ServerAdminCommandProvider.java
+++ b/plugins/org.eclipse.osee.framework.server.admin/src/org/eclipse/osee/framework/server/admin/ServerAdminCommandProvider.java
@@ -216,23 +216,6 @@ public class ServerAdminCommandProvider implements CommandProvider {
return Operations.executeAsJob(operation, false);
}
- public Job _purge_attribute_type(CommandInterpreter ci) {
- OperationLogger logger = new CommandInterpreterLogger(ci);
-
- //to be purged
- final Collection<String> attributeTypes = new ArrayList<String>();
-
- for (String arg = ci.nextArgument(); Strings.isValid(arg); arg = ci.nextArgument()) {
- attributeTypes.add(arg);
- }
-
- IOperation operation =
- new PurgeAttributeType(Activator.getOseeDatabaseService(), logger,
- attributeTypes.toArray(new String[attributeTypes.size()]));
-
- return Operations.executeAsJob(operation, false);
- }
-
public Job _purge_transactions(CommandInterpreter ci) {
OperationLogger logger = new CommandInterpreterLogger(ci);
final List<Integer> transactions = new ArrayList<Integer>();
@@ -264,7 +247,6 @@ public class ServerAdminCommandProvider implements CommandProvider {
sb.append(" purge_relation_type -force excute the operation, relationType1 ...\n");
sb.append(" parse_dir - converts the given file into a formatted CSV file\n");
sb.append(" purge_transactions <transaction ids> - ");
- sb.append(" purge_attribute_type <attr ids> - deletes specified rows from osee_artifact_type_attributes and osee_attribute_type\n");
sb.append(" prune_workspace [preserve_file_pattern] workspace_path purge_file_pattern - delete files that are found in workspace_path and whose filenames match purge_file_pattern. Any filename that matches the optional preserve_file_pattern are not deleted\n");
sb.append(" find_invalid_utf8 - finds invalid UTF8 chars in table osee_attribute\n");
sb.append(" consolidate_relations - consolidate rows of relations\n");
diff --git a/plugins/org.eclipse.osee.framework.skynet.core/src/org/eclipse/osee/framework/skynet/core/artifact/ArtifactTypeManager.java b/plugins/org.eclipse.osee.framework.skynet.core/src/org/eclipse/osee/framework/skynet/core/artifact/ArtifactTypeManager.java
index 406e5f35b19..f49408039a6 100644
--- a/plugins/org.eclipse.osee.framework.skynet.core/src/org/eclipse/osee/framework/skynet/core/artifact/ArtifactTypeManager.java
+++ b/plugins/org.eclipse.osee.framework.skynet.core/src/org/eclipse/osee/framework/skynet/core/artifact/ArtifactTypeManager.java
@@ -33,8 +33,6 @@ import org.eclipse.osee.framework.core.model.event.DefaultBasicGuidArtifact;
import org.eclipse.osee.framework.core.model.type.ArtifactType;
import org.eclipse.osee.framework.core.services.IOseeCachingService;
import org.eclipse.osee.framework.database.core.ConnectionHandler;
-import org.eclipse.osee.framework.database.core.DbTransaction;
-import org.eclipse.osee.framework.database.core.OseeConnection;
import org.eclipse.osee.framework.skynet.core.artifact.factory.ArtifactFactoryManager;
import org.eclipse.osee.framework.skynet.core.artifact.search.ArtifactQuery;
import org.eclipse.osee.framework.skynet.core.internal.Activator;
@@ -181,11 +179,8 @@ public class ArtifactTypeManager {
artifactToken.getName(), artifactToken.getGuid(), null);
}
- private static final String DELETE_VALID_ATTRIBUTE =
- "delete from osee_artifact_type_attributes where art_type_id = ?";
private static final String COUNT_ARTIFACT_OCCURRENCE =
"select count(1) from (select DISTINCT(art_id) FROM osee_artifact where art_type_id = ?) t1";
- private static final String DELETE_ARIFACT_TYPE = "delete from osee_artifact_type where art_type_id = ?";
public static void purgeArtifactType(IArtifactType artifactType) throws OseeCoreException {
final int artifactTypeId = getTypeId(artifactType);
@@ -196,15 +191,6 @@ public class ArtifactTypeManager {
"Can not delete artifact type [%s] because there are %d existing artifacts of this type.", artifactType,
artifactCount);
}
- new DbTransaction() {
-
- @Override
- protected void handleTxWork(OseeConnection connection) throws OseeCoreException {
- ConnectionHandler.runPreparedUpdate(connection, DELETE_VALID_ATTRIBUTE, artifactTypeId);
- ConnectionHandler.runPreparedUpdate(connection, DELETE_ARIFACT_TYPE, artifactTypeId);
- }
-
- }.execute();
}
/**
diff --git a/plugins/org.eclipse.osee.framework.ui.data.model.editor/META-INF/MANIFEST.MF b/plugins/org.eclipse.osee.framework.ui.data.model.editor/META-INF/MANIFEST.MF
index c8912939b35..0f1dd7e52a7 100644
--- a/plugins/org.eclipse.osee.framework.ui.data.model.editor/META-INF/MANIFEST.MF
+++ b/plugins/org.eclipse.osee.framework.ui.data.model.editor/META-INF/MANIFEST.MF
@@ -19,6 +19,7 @@ Bundle-RequiredExecutionEnvironment: JavaSE-1.6
Bundle-ActivationPolicy: lazy
Import-Package: org.eclipse.osee.framework.core.client,
org.eclipse.osee.framework.core.data,
+ org.eclipse.osee.framework.core.enums,
org.eclipse.osee.framework.core.exception,
org.eclipse.osee.framework.core.model,
org.eclipse.osee.framework.core.model.type,
diff --git a/plugins/org.eclipse.osee.framework.ui.data.model.editor/src/org/eclipse/osee/framework/ui/data/model/editor/input/OseeDataTypeDatastore.java b/plugins/org.eclipse.osee.framework.ui.data.model.editor/src/org/eclipse/osee/framework/ui/data/model/editor/input/OseeDataTypeDatastore.java
index c9c424950d7..1daf4e16fd2 100644
--- a/plugins/org.eclipse.osee.framework.ui.data.model.editor/src/org/eclipse/osee/framework/ui/data/model/editor/input/OseeDataTypeDatastore.java
+++ b/plugins/org.eclipse.osee.framework.ui.data.model.editor/src/org/eclipse/osee/framework/ui/data/model/editor/input/OseeDataTypeDatastore.java
@@ -11,20 +11,19 @@
package org.eclipse.osee.framework.ui.data.model.editor.input;
import java.util.ArrayList;
+import java.util.Collection;
import java.util.List;
-import java.util.logging.Level;
+import org.eclipse.osee.framework.core.data.IAttributeType;
+import org.eclipse.osee.framework.core.enums.CoreBranches;
import org.eclipse.osee.framework.core.exception.OseeCoreException;
import org.eclipse.osee.framework.core.model.type.ArtifactType;
import org.eclipse.osee.framework.core.model.type.AttributeType;
import org.eclipse.osee.framework.core.model.type.RelationType;
-import org.eclipse.osee.framework.database.core.ConnectionHandler;
-import org.eclipse.osee.framework.database.core.IOseeStatement;
import org.eclipse.osee.framework.jdk.core.type.HashCollection;
-import org.eclipse.osee.framework.logging.OseeLog;
import org.eclipse.osee.framework.skynet.core.artifact.ArtifactTypeManager;
+import org.eclipse.osee.framework.skynet.core.artifact.BranchManager;
import org.eclipse.osee.framework.skynet.core.attribute.AttributeTypeManager;
import org.eclipse.osee.framework.skynet.core.relation.RelationTypeManager;
-import org.eclipse.osee.framework.ui.data.model.editor.internal.Activator;
import org.eclipse.osee.framework.ui.data.model.editor.model.ArtifactDataType;
import org.eclipse.osee.framework.ui.data.model.editor.model.AttributeDataType;
import org.eclipse.osee.framework.ui.data.model.editor.model.RelationDataType;
@@ -34,7 +33,6 @@ import org.eclipse.osee.framework.ui.skynet.ArtifactImageManager;
* @author Roberto E. Escobar
*/
public class OseeDataTypeDatastore {
- private static final String SELECT_ATTRIBUTE_VALIDITY = "SELECT * FROM osee_artifact_type_attributes";
public static List<AttributeDataType> getAttributeTypes() throws OseeCoreException {
List<AttributeDataType> attributeDataTypes = new ArrayList<AttributeDataType>();
@@ -75,18 +73,14 @@ public class OseeDataTypeDatastore {
public static HashCollection<String, String> getArtifactToAttributeEntries() throws OseeCoreException {
HashCollection<String, String> toReturn = new HashCollection<String, String>();
- IOseeStatement chStmt = ConnectionHandler.getStatement();
- try {
- chStmt.runPreparedQuery(2000, SELECT_ATTRIBUTE_VALIDITY);
- while (chStmt.next()) {
- try {
- toReturn.put(chStmt.getString("art_type_id"), chStmt.getString("attr_type_id"));
- } catch (OseeCoreException ex) {
- OseeLog.log(Activator.class, Level.SEVERE, ex);
- }
+ for (ArtifactType artifactType : ArtifactTypeManager.getAllTypes()) {
+ Collection<IAttributeType> attributeTypes =
+ artifactType.getAttributeTypes(BranchManager.getBranch(CoreBranches.SYSTEM_ROOT));
+
+ for (IAttributeType attrType : attributeTypes) {
+ int typeId = AttributeTypeManager.getTypeId(attrType);
+ toReturn.put(String.valueOf(artifactType.getId()), String.valueOf(typeId));
}
- } finally {
- chStmt.close();
}
return toReturn;
}
diff --git a/plugins/org.eclipse.osee.framework.ui.skynet.test/src/org/eclipse/osee/framework/ui/skynet/test/cases/ImageManagerTest.java b/plugins/org.eclipse.osee.framework.ui.skynet.test/src/org/eclipse/osee/framework/ui/skynet/test/cases/ImageManagerTest.java
index 8db9940299a..c0e22412279 100644
--- a/plugins/org.eclipse.osee.framework.ui.skynet.test/src/org/eclipse/osee/framework/ui/skynet/test/cases/ImageManagerTest.java
+++ b/plugins/org.eclipse.osee.framework.ui.skynet.test/src/org/eclipse/osee/framework/ui/skynet/test/cases/ImageManagerTest.java
@@ -11,7 +11,6 @@
package org.eclipse.osee.framework.ui.skynet.test.cases;
import static org.junit.Assert.assertEquals;
-import static org.junit.Assert.assertFalse;
import static org.junit.Assert.assertNotNull;
import static org.junit.Assert.assertTrue;
import static org.junit.Assert.fail;
@@ -56,8 +55,6 @@ public abstract class ImageManagerTest {
@org.junit.BeforeClass
public static void testSetup() throws Exception {
monitorLog = new SevereLoggingMonitor();
- // Clear db image
- ArtifactImageManager.setArtifactTypeImageInDb(CoreArtifactTypes.Folder, null);
OseeLog.registerLoggerListener(monitorLog);
}
@@ -128,39 +125,6 @@ public abstract class ImageManagerTest {
ArtifactImageManager.getImage(folder).equals(ImageManager.getImage(PluginUiImage.FOLDER)));
}
- @org.junit.Test
- public void testSetArtifactTypeImageInDb() throws Exception {
-
- Artifact folder =
- ArtifactCacheQuery.getOrCreateSingletonArtifactByText(CoreArtifactTypes.Folder, CoreAttributeTypes.StaticId,
- "user.groups", BranchManager.getCommonBranch());
-
- // Check folder image
- assertTrue("Image returned not a \"Folder\" image.",
- ArtifactImageManager.getImage(folder).equals(ImageManager.getImage(PluginUiImage.FOLDER)));
-
- // Set different image for folder
- ArtifactImageManager.setArtifactTypeImageInDb(CoreArtifactTypes.Folder, getByteArrayInputStream("heading.gif"));
-
- // Test that different image overrides folder image
- assertFalse("Image returned should be \"Heading\" image.",
- ArtifactImageManager.getImage(folder).equals(ImageManager.getImage(PluginUiImage.FOLDER)));
-
- // Clear db image
- ArtifactImageManager.setArtifactTypeImageInDb(CoreArtifactTypes.Folder, null);
-
- // Reload cache
- ArtifactImageManager.loadCache();
- TestUtil.sleep(2000);
-
- // Test that folder image is back
- assertTrue("Image returned not a \"Folder\" image.",
- ArtifactImageManager.getImage(folder).equals(ImageManager.getImage(PluginUiImage.FOLDER)));
-
- // Cleanup folder artifact
- folder.purgeFromBranch();
- }
-
public static ByteArrayInputStream getByteArrayInputStream(String imageFilename) throws Exception {
File imageFile = Activator.getInstance().getPluginFile("images/" + imageFilename);
if (!imageFile.exists()) {
diff --git a/plugins/org.eclipse.osee.framework.ui.skynet/images/implementationDetails.gif b/plugins/org.eclipse.osee.framework.ui.skynet/images/implementationDetails.gif
new file mode 100644
index 00000000000..89b02913fd8
--- /dev/null
+++ b/plugins/org.eclipse.osee.framework.ui.skynet/images/implementationDetails.gif
Binary files differ
diff --git a/plugins/org.eclipse.osee.framework.ui.skynet/images/implementationDetails.xcf b/plugins/org.eclipse.osee.framework.ui.skynet/images/implementationDetails.xcf
new file mode 100644
index 00000000000..6122772d1f7
--- /dev/null
+++ b/plugins/org.eclipse.osee.framework.ui.skynet/images/implementationDetails.xcf
Binary files differ
diff --git a/plugins/org.eclipse.osee.framework.ui.skynet/plugin.xml b/plugins/org.eclipse.osee.framework.ui.skynet/plugin.xml
index dc17bcffed0..ae7f89a00ef 100644
--- a/plugins/org.eclipse.osee.framework.ui.skynet/plugin.xml
+++ b/plugins/org.eclipse.osee.framework.ui.skynet/plugin.xml
@@ -1076,12 +1076,6 @@
</image>
</extension>
<extension
- point="org.eclipse.osee.framework.ui.skynet.BlamOperation">
- <Operation
- className="org.eclipse.osee.framework.ui.skynet.blam.operation.UpdateArtifactTypeImage">
- </Operation>
- </extension>
- <extension
id="ValidateArtifactsToDelete"
name="ValidateArtifactsToDelete"
point="org.eclipse.osee.framework.ui.skynet.BlamOperation">
diff --git a/plugins/org.eclipse.osee.framework.ui.skynet/src/org/eclipse/osee/framework/ui/skynet/ArtifactImageManager.java b/plugins/org.eclipse.osee.framework.ui.skynet/src/org/eclipse/osee/framework/ui/skynet/ArtifactImageManager.java
index df29c1314e6..19fec8f83e1 100644
--- a/plugins/org.eclipse.osee.framework.ui.skynet/src/org/eclipse/osee/framework/ui/skynet/ArtifactImageManager.java
+++ b/plugins/org.eclipse.osee.framework.ui.skynet/src/org/eclipse/osee/framework/ui/skynet/ArtifactImageManager.java
@@ -10,7 +10,6 @@
*******************************************************************************/
package org.eclipse.osee.framework.ui.skynet;
-import java.io.ByteArrayInputStream;
import java.util.HashSet;
import java.util.List;
import java.util.Map;
@@ -23,14 +22,9 @@ import org.eclipse.osee.framework.core.data.IArtifactType;
import org.eclipse.osee.framework.core.enums.ModificationType;
import org.eclipse.osee.framework.core.exception.OseeArgumentException;
import org.eclipse.osee.framework.core.exception.OseeCoreException;
-import org.eclipse.osee.framework.database.core.ConnectionHandler;
-import org.eclipse.osee.framework.database.core.IOseeStatement;
-import org.eclipse.osee.framework.database.core.SQL3DataType;
-import org.eclipse.osee.framework.jdk.core.util.Lib;
import org.eclipse.osee.framework.logging.OseeLog;
import org.eclipse.osee.framework.plugin.core.util.ExtensionDefinedObjects;
import org.eclipse.osee.framework.skynet.core.artifact.Artifact;
-import org.eclipse.osee.framework.skynet.core.artifact.ArtifactTypeManager;
import org.eclipse.osee.framework.skynet.core.change.Change;
import org.eclipse.osee.framework.skynet.core.conflict.ArtifactConflict;
import org.eclipse.osee.framework.skynet.core.conflict.AttributeConflict;
@@ -51,11 +45,6 @@ public final class ArtifactImageManager {
private static final String EXTENSION_ELEMENT = "ArtifactImageProvider";
private static final String EXTENSION_ID = Activator.PLUGIN_ID + "." + EXTENSION_ELEMENT;
- private static final String SELECT_ARTIFACT_TYPES_IMAGE_QUERY =
- "SELECT art_type_id, image FROM osee_artifact_type where image is not null";
- private static final String UPDATE_ARTIFACT_TYPE_IMAGE =
- "UPDATE osee_artifact_type SET image = ? where art_type_id = ?";
-
private static final Map<IArtifactType, ArtifactImageProvider> providersOverrideImageMap =
new ConcurrentHashMap<IArtifactType, ArtifactImageProvider>();
private static final Map<IArtifactType, KeyedImage> artifactTypeImageMap =
@@ -65,7 +54,6 @@ public final class ArtifactImageManager {
private static final String OSEE_DATABASE_PROVIDER = "OSEE Database Provider";
- private static boolean artifactTypeImagesLoaded;
private static KeyedImage overrideImageEnum;
static {
@@ -73,7 +61,6 @@ public final class ArtifactImageManager {
}
public synchronized static void loadCache() {
- artifactTypeImagesLoaded = false;
Set<IArtifactType> imageKeys = new HashSet<IArtifactType>();
imageKeys.addAll(providersOverrideImageMap.keySet());
@@ -101,31 +88,6 @@ public final class ArtifactImageManager {
}
}
- private synchronized static void ensureArtifactTypeImagesLoaded() throws OseeCoreException {
- if (!artifactTypeImagesLoaded) {
- artifactTypeImagesLoaded = true;
- // Load base images from database (which can override the ImageManager.registerImage() calls provided
- // through the ArtifactImageProviders
- IOseeStatement chStmt = ConnectionHandler.getStatement();
- try {
- chStmt.runPreparedQuery(SELECT_ARTIFACT_TYPES_IMAGE_QUERY);
-
- while (chStmt.next()) {
- try {
- IArtifactType artifactType = ArtifactTypeManager.getType(chStmt.getInt("art_type_id"));
- artifactTypeImageMap.put(artifactType,
- BaseImage.getBaseImageEnum(artifactType, Lib.inputStreamToBytes(chStmt.getBinaryStream("image"))));
- artifactTypeImageProviderMap.put(artifactType, OSEE_DATABASE_PROVIDER);
- } catch (Exception ex) {
- OseeLog.log(Activator.class, Level.SEVERE, ex);
- }
- }
- } finally {
- chStmt.close();
- }
- }
- }
-
public static Image getConflictImage(Conflict conflict) throws OseeCoreException {
if (conflict instanceof AttributeConflict) {
return ImageManager.getImage(FrameworkImage.ATTRIBUTE_MOLECULE);
@@ -222,8 +184,6 @@ public final class ArtifactImageManager {
}
public synchronized static void registerBaseImage(IArtifactType artifactType, KeyedImage oseeImage, ArtifactImageProvider provider) throws OseeCoreException {
- ensureArtifactTypeImagesLoaded();
-
boolean alreadyProvided = artifactTypeImageMap.containsKey(artifactType);
String providerId = artifactTypeImageProviderMap.get(artifactType);
@@ -299,15 +259,6 @@ public final class ArtifactImageManager {
return ImageManager.setupImage(baseImageEnum);
}
- public static void setArtifactTypeImageInDb(IArtifactType artifactType, ByteArrayInputStream byteInput) throws OseeCoreException {
- Object imageData = byteInput != null ? byteInput : SQL3DataType.BLOB;
- ConnectionHandler.runPreparedUpdate(UPDATE_ARTIFACT_TYPE_IMAGE, imageData,
- ArtifactTypeManager.getTypeId(artifactType));
- loadCache();
-
- // TODO Need remote event kick to tell other clients of artifact type image changes
- }
-
public static KeyedImage getArtifactTypeImage(IArtifactType artifactType) {
return artifactTypeImageMap.get(artifactType);
}
diff --git a/plugins/org.eclipse.osee.framework.ui.skynet/src/org/eclipse/osee/framework/ui/skynet/FrameworkArtifactImageProvider.java b/plugins/org.eclipse.osee.framework.ui.skynet/src/org/eclipse/osee/framework/ui/skynet/FrameworkArtifactImageProvider.java
index fe7b1a985fc..51013b5c6ca 100644
--- a/plugins/org.eclipse.osee.framework.ui.skynet/src/org/eclipse/osee/framework/ui/skynet/FrameworkArtifactImageProvider.java
+++ b/plugins/org.eclipse.osee.framework.ui.skynet/src/org/eclipse/osee/framework/ui/skynet/FrameworkArtifactImageProvider.java
@@ -34,6 +34,8 @@ public class FrameworkArtifactImageProvider extends ArtifactImageProvider {
ArtifactImageManager.registerBaseImage(CoreArtifactTypes.GlobalPreferences, FrameworkImage.GEAR, this);
ArtifactImageManager.registerBaseImage(CoreArtifactTypes.UserGroup, FrameworkImage.USERS, this);
ArtifactImageManager.registerBaseImage(CoreArtifactTypes.UniversalGroup, FrameworkImage.GROUP, this);
+ ArtifactImageManager.registerBaseImage(CoreArtifactTypes.ImplementationDetails,
+ FrameworkImage.IMPLEMENTATION_DETAILS, this);
ArtifactImageManager.registerOverrideImageProvider(this, CoreArtifactTypes.User);
}
diff --git a/plugins/org.eclipse.osee.framework.ui.skynet/src/org/eclipse/osee/framework/ui/skynet/FrameworkImage.java b/plugins/org.eclipse.osee.framework.ui.skynet/src/org/eclipse/osee/framework/ui/skynet/FrameworkImage.java
index ae555ca4512..4544e1a52e1 100644
--- a/plugins/org.eclipse.osee.framework.ui.skynet/src/org/eclipse/osee/framework/ui/skynet/FrameworkImage.java
+++ b/plugins/org.eclipse.osee.framework.ui.skynet/src/org/eclipse/osee/framework/ui/skynet/FrameworkImage.java
@@ -97,6 +97,7 @@ public enum FrameworkImage implements KeyedImage {
GROUP("group.gif"),
HEADING("heading.gif"),
HELP("help.gif"),
+ IMPLEMENTATION_DETAILS("implementationDetails.gif"),
IMPORT("import.gif"),
INCOMING_ARTIFACT_DELETED("INCOMING_Deleted.gif"),
INCOMING_DELETED("INCOMING_Deleted.gif"),
diff --git a/plugins/org.eclipse.osee.framework.ui.skynet/src/org/eclipse/osee/framework/ui/skynet/blam/operation/UpdateArtifactTypeImage.java b/plugins/org.eclipse.osee.framework.ui.skynet/src/org/eclipse/osee/framework/ui/skynet/blam/operation/UpdateArtifactTypeImage.java
deleted file mode 100644
index 513f1bbcbad..00000000000
--- a/plugins/org.eclipse.osee.framework.ui.skynet/src/org/eclipse/osee/framework/ui/skynet/blam/operation/UpdateArtifactTypeImage.java
+++ /dev/null
@@ -1,88 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2004, 2007 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.blam.operation;
-
-import java.io.ByteArrayInputStream;
-import java.io.File;
-import java.io.FileInputStream;
-import java.util.Arrays;
-import java.util.Collection;
-import org.eclipse.core.runtime.IProgressMonitor;
-import org.eclipse.jface.dialogs.MessageDialog;
-import org.eclipse.osee.framework.core.data.IArtifactType;
-import org.eclipse.osee.framework.core.exception.OseeArgumentException;
-import org.eclipse.osee.framework.jdk.core.util.Lib;
-import org.eclipse.osee.framework.jdk.core.util.Strings;
-import org.eclipse.osee.framework.ui.skynet.ArtifactImageManager;
-import org.eclipse.osee.framework.ui.skynet.blam.AbstractBlam;
-import org.eclipse.osee.framework.ui.skynet.blam.VariableMap;
-import org.eclipse.osee.framework.ui.swt.Displays;
-
-/**
- * @author Ryan D. Brooks
- */
-public final class UpdateArtifactTypeImage extends AbstractBlam {
-
- private static final String ARTIFACT_TYPE_NAME = "Select Artifact Type";
- private static final String SELECT_IMAGE = "Select Image GIF";
-
- @Override
- public String getName() {
- return "Update ArtifactType Image";
- }
-
- @Override
- public void runOperation(final VariableMap variableMap, IProgressMonitor monitor) throws Exception {
- String filename = variableMap.getString(SELECT_IMAGE);
- final IArtifactType artifactSubtypeDescriptor = variableMap.getArtifactType("Select Artifact Type");
- if (Strings.isValid(filename)) {
- File imageFile = new File(filename);
- if (!imageFile.exists()) {
- throw new OseeArgumentException("Invalid image filename.");
- }
- ArtifactImageManager.setArtifactTypeImageInDb(artifactSubtypeDescriptor,
- new ByteArrayInputStream(Lib.inputStreamToBytes(new FileInputStream(imageFile))));
- } else {
- Displays.ensureInDisplayThread(new Runnable() {
- @Override
- public void run() {
- try {
- if (MessageDialog.openConfirm(Displays.getActiveShell(), "Clear Database Image?",
- "No Image File Selected.\n\nSelect \"Ok\" to clear image from database (default image will be used).")) {
- ArtifactImageManager.setArtifactTypeImageInDb(artifactSubtypeDescriptor, null);
- }
- } catch (Exception ex) {
- log(ex);
- }
- }
- });
- }
- }
-
- @Override
- public String getDescriptionUsage() {
- return "This BLAM will import the selected 16x16 pixel gif image as the image for the selected artifact type. Existing image will be overwritten.\nLeaving image filename blank will clear the image from the database. Programatic default will be used instead.";
- }
-
- @Override
- public String getXWidgetsXml() {
- StringBuffer buffer = new StringBuffer("<xWidgets>");
- buffer.append("<XWidget xwidgetType=\"XFileSelectionDialog\" displayName=\"" + SELECT_IMAGE + "\" />");
- buffer.append("<XWidget xwidgetType=\"XArtifactTypeComboViewer\" displayName=\"" + ARTIFACT_TYPE_NAME + "\" />");
- buffer.append("</xWidgets>");
- return buffer.toString();
- }
-
- @Override
- public Collection<String> getCategories() {
- return Arrays.asList("Admin");
- }
-} \ No newline at end of file
diff --git a/plugins/org.eclipse.osee.framework.ui.skynet/src/org/eclipse/osee/framework/ui/skynet/dbHealth/DuplicateHRID.java b/plugins/org.eclipse.osee.framework.ui.skynet/src/org/eclipse/osee/framework/ui/skynet/dbHealth/DuplicateHRID.java
index 40a616ba41f..c4d2d2de45c 100644
--- a/plugins/org.eclipse.osee.framework.ui.skynet/src/org/eclipse/osee/framework/ui/skynet/dbHealth/DuplicateHRID.java
+++ b/plugins/org.eclipse.osee.framework.ui.skynet/src/org/eclipse/osee/framework/ui/skynet/dbHealth/DuplicateHRID.java
@@ -23,6 +23,7 @@ import org.eclipse.osee.framework.database.core.ConnectionHandler;
import org.eclipse.osee.framework.database.core.IOseeStatement;
import org.eclipse.osee.framework.jdk.core.util.AHTML;
import org.eclipse.osee.framework.jdk.core.util.Strings;
+import org.eclipse.osee.framework.skynet.core.artifact.ArtifactTypeManager;
import org.eclipse.osee.framework.ui.skynet.results.XResultDataUI;
/**
@@ -56,7 +57,7 @@ public class DuplicateHRID extends DatabaseHealthOperation {
}
private static final String GET_DUPLICATE_HRIDS =
- "SELECT DISTINCT(t1.art_id), t1.guid, t1.human_readable_id, t3.name FROM osee_artifact t1, osee_artifact_type t3 WHERE t1.human_readable_id IN (SELECT t2.human_readable_id FROM osee_artifact t2 GROUP BY t2.human_readable_id HAVING COUNT(t2.human_readable_id) > 1) AND t3.art_type_id = t1.art_type_id ORDER BY t1.human_readable_id";
+ "SELECT DISTINCT(t1.art_id), t1.guid, t1.human_readable_id, t1.art_type_id FROM osee_artifact t1 WHERE t1.human_readable_id IN (SELECT t2.human_readable_id FROM osee_artifact t2 GROUP BY t2.human_readable_id HAVING COUNT(t2.human_readable_id) > 1) ORDER BY t1.human_readable_id";
private static final String COUNT_ATTRIBUTE_VALUES_CONTAINING =
"SELECT count(1) from osee_attribute where value like ?"; // TODO value not necessarily in database
@@ -135,7 +136,7 @@ public class DuplicateHRID extends DatabaseHealthOperation {
rd.addRaw(AHTML.endMultiColumnTable());
} finally {
- XResultDataUI.report(rd,getName());
+ XResultDataUI.report(rd, getName());
}
}
@@ -149,7 +150,8 @@ public class DuplicateHRID extends DatabaseHealthOperation {
ArtifactData duplicateHrid = new ArtifactData();
duplicateHrid.guid = chStmt1.getString("guid");
duplicateHrid.hrid = chStmt1.getString("human_readable_id");
- duplicateHrid.artTypeName = chStmt1.getString("name");
+ int typeId = chStmt1.getInt("art_type_id");
+ duplicateHrid.artTypeName = ArtifactTypeManager.getType(typeId).getName();
duplicateItems.add(duplicateHrid);
}
Collections.sort(duplicateItems, new DuplicateHridSorter());
diff --git a/plugins/org.eclipse.osee.framework.ui.skynet/src/org/eclipse/osee/framework/ui/skynet/search/ArtifactSearchPage.java b/plugins/org.eclipse.osee.framework.ui.skynet/src/org/eclipse/osee/framework/ui/skynet/search/ArtifactSearchPage.java
index ae834ee9e1e..4e64d33c619 100644
--- a/plugins/org.eclipse.osee.framework.ui.skynet/src/org/eclipse/osee/framework/ui/skynet/search/ArtifactSearchPage.java
+++ b/plugins/org.eclipse.osee.framework.ui.skynet/src/org/eclipse/osee/framework/ui/skynet/search/ArtifactSearchPage.java
@@ -218,7 +218,7 @@ public class ArtifactSearchPage extends DialogPage implements ISearchPage, IRepl
relationTypeList.setSorter(new SearchSorter());
final ComboViewer relationSideList = new ComboViewer(relationControls, SWT.DROP_DOWN | SWT.READ_ONLY);
relationSideList.setContentProvider(new SearchContentProvider());
- relationSideList.setLabelProvider(new SearchLabelProvider());
+ relationSideList.setLabelProvider(new StringSearchLabelProvider());
relationSideList.setSorter(new SearchSorter());
try {

Back to the top