com.partnersoft.modules.inspection.app
Class InspectionKit

java.lang.Object
  extended by com.partnersoft.modules.inspection.app.InspectionKit

public class InspectionKit
extends java.lang.Object

A single go-to class containing all the necessary pieces for an inspection app.

This includes the inspection storage, data schema, GUI, pointers to the mapset, module, and app, etc.

Copyright 2008 Partner Software, Inc.

Version:
$Id$
Author:
Paul Reavis

Constructor Summary
InspectionKit(com.partnersoft.maps.app.MapApp app, com.partnersoft.maps.model.MapSet mapset, com.partnersoft.system.Module module, java.lang.String typeName)
           
InspectionKit(com.partnersoft.system.Module module)
           
InspectionKit(com.partnersoft.system.Module module, java.lang.String typeName)
           
 
Method Summary
 void addModifiedInspecton(java.lang.String guid)
          Marks an Inspection as modified.
 void clearAllQueueInspections()
          Removes all inspection guids from the modified queue.
 com.partnersoft.maps.model.MapEditActor getActor()
           
 com.partnersoft.maps.app.MapApp getApp()
           
 InspectionFormDialog getDialog()
           
 InspectionStore getHubStore()
          Returns InspectionStore for the hub database.
 com.partnersoft.system.Module getInspectionModule()
          Returns the Inspection module (not the individual one, the main one).
 java.lang.String getInspectionUserName()
          Returns the user name stored from set Preferences, or the window's login if Preference is /null.
 InspectionLogic getLogic()
           
 com.partnersoft.maps.model.MapEditActor getMapEditActor()
           
 com.partnersoft.maps.model.MapSet getMapset()
           
 InspectionMaster getMaster()
          Returns the InspectionMaster for the Inspection Overview mapset.
 java.lang.String getModifiedInspectionGuidAndRemove()
          Returns the first guid on the modified Inspection queue, or null if empty.
 java.util.Iterator<java.lang.String> getModifiedInspections()
          Returns an iterator to the queue of modified Inspections.
 com.partnersoft.system.Module getModule()
           
 java.lang.String getRoverDataType()
           
 java.lang.String getRoverGraphicType()
           
 com.partnersoft.cog.CogSchema getSchema()
           
 com.partnersoft.data.NameSet getSourceDataTypes()
          Returns the configured set of valid source data types (for copying data from/adding inspections to).
 InspectionStore getStore()
          Returns InspectionStore for the local database.
 com.partnersoft.cog.CogStructureType getType()
           
 java.lang.String getUserName()
           
 void hubInstall()
           
 void install()
           
 boolean isReloadAllInspections()
          Checks if inspections in the queue should be updated, or everything from the database.
 boolean isSource(com.partnersoft.maps.model.MapEditContext context)
           
 boolean isSource(java.lang.String dataType)
           
 java.util.List<java.lang.String> listAddableSubtypes()
          Returns list of all subtype names that can be added from the edit panel.
 java.util.List<InspectionGridCell> listAllCells(com.partnersoft.geometry.xy.XyGrid grid)
          Returns a list of InspectionGridCells for this Inspection based on passed XyGrid
 java.util.List<java.lang.String> listAllSubtypes()
          Returns list of all subtype names List returned is a copy, modifying will not affect the original.
 java.util.List<java.lang.String> listContainedByModuleNames()
           
 java.util.List<com.partnersoft.system.Module> listContainedByModules()
           
 java.util.List<java.lang.String> listContainsModuleNames()
           
 java.util.List<com.partnersoft.system.Module> listContainsModules()
           
 java.util.List<java.lang.String> listFieldsForSubtype(java.lang.String subtype)
           
 java.util.List<java.lang.String> listUserNames()
           
 void setInspectionUserName(java.lang.String userName)
          Sets the user name stored in Preferences.
 void setReloadAllInspections(boolean shouldI)
          Sets the flag to read from the queue of modified inspections, or read everything from the database.
 void setUserName(java.lang.String userName)
           
 void shutdown()
           
 void startup()
           
 void syncAll()
           
 void syncCheckOut()
           
 java.lang.String toString()
           
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Constructor Detail

InspectionKit

public InspectionKit(com.partnersoft.system.Module module)
              throws java.io.IOException
Throws:
java.io.IOException

InspectionKit

public InspectionKit(com.partnersoft.system.Module module,
                     java.lang.String typeName)
              throws java.io.IOException
Throws:
java.io.IOException

InspectionKit

public InspectionKit(com.partnersoft.maps.app.MapApp app,
                     com.partnersoft.maps.model.MapSet mapset,
                     com.partnersoft.system.Module module,
                     java.lang.String typeName)
              throws java.io.IOException
Throws:
java.io.IOException
Method Detail

install

public void install()
             throws java.sql.SQLException
Throws:
java.sql.SQLException

hubInstall

public void hubInstall()
                throws java.sql.SQLException
Throws:
java.sql.SQLException

startup

public void startup()
             throws java.sql.SQLException
Throws:
java.sql.SQLException

shutdown

public void shutdown()
              throws java.sql.SQLException
Throws:
java.sql.SQLException

syncAll

public void syncAll()
             throws java.io.IOException,
                    java.sql.SQLException
Throws:
java.io.IOException
java.sql.SQLException

syncCheckOut

public void syncCheckOut()
                  throws java.io.IOException,
                         java.sql.SQLException
Throws:
java.io.IOException
java.sql.SQLException

toString

public java.lang.String toString()
Overrides:
toString in class java.lang.Object

getApp

public com.partnersoft.maps.app.MapApp getApp()

getLogic

public InspectionLogic getLogic()

getModule

public com.partnersoft.system.Module getModule()

getMapset

public com.partnersoft.maps.model.MapSet getMapset()

getMaster

public InspectionMaster getMaster()
Returns the InspectionMaster for the Inspection Overview mapset. Returns null if the mapset has not been initialized or the Inspection module doesn't exist.

Returns:

getActor

public com.partnersoft.maps.model.MapEditActor getActor()

listContainedByModules

public java.util.List<com.partnersoft.system.Module> listContainedByModules()

listContainsModuleNames

public java.util.List<java.lang.String> listContainsModuleNames()

listContainsModules

public java.util.List<com.partnersoft.system.Module> listContainsModules()

listContainedByModuleNames

public java.util.List<java.lang.String> listContainedByModuleNames()

getInspectionModule

public com.partnersoft.system.Module getInspectionModule()
Returns the Inspection module (not the individual one, the main one).

Returns:

getStore

public InspectionStore getStore()
Returns InspectionStore for the local database.

Returns:

getHubStore

public InspectionStore getHubStore()
Returns InspectionStore for the hub database.

Returns:

getSchema

public com.partnersoft.cog.CogSchema getSchema()

getType

public com.partnersoft.cog.CogStructureType getType()

getDialog

public InspectionFormDialog getDialog()

getMapEditActor

public com.partnersoft.maps.model.MapEditActor getMapEditActor()

getRoverDataType

public java.lang.String getRoverDataType()

getRoverGraphicType

public java.lang.String getRoverGraphicType()

getInspectionUserName

public java.lang.String getInspectionUserName()
Returns the user name stored from set Preferences, or the window's login if Preference is /null.

Returns:

setInspectionUserName

public void setInspectionUserName(java.lang.String userName)
Sets the user name stored in Preferences.


getSourceDataTypes

public com.partnersoft.data.NameSet getSourceDataTypes()
Returns the configured set of valid source data types (for copying data from/adding inspections to). Returns null if all types are valid.

Returns:

isSource

public boolean isSource(java.lang.String dataType)

isSource

public boolean isSource(com.partnersoft.maps.model.MapEditContext context)

getUserName

public java.lang.String getUserName()

setUserName

public void setUserName(java.lang.String userName)

listFieldsForSubtype

public java.util.List<java.lang.String> listFieldsForSubtype(java.lang.String subtype)

listUserNames

public java.util.List<java.lang.String> listUserNames()

listAddableSubtypes

public java.util.List<java.lang.String> listAddableSubtypes()
Returns list of all subtype names that can be added from the edit panel. List returned is a copy, modifying will not affect the original.

Returns:

listAllSubtypes

public java.util.List<java.lang.String> listAllSubtypes()
Returns list of all subtype names List returned is a copy, modifying will not affect the original.

Returns:

listAllCells

public java.util.List<InspectionGridCell> listAllCells(com.partnersoft.geometry.xy.XyGrid grid)
Returns a list of InspectionGridCells for this Inspection based on passed XyGrid

Parameters:
grid -
Returns:

getModifiedInspections

public java.util.Iterator<java.lang.String> getModifiedInspections()
Returns an iterator to the queue of modified Inspections. Does not remove any inspection guids.

Returns:

getModifiedInspectionGuidAndRemove

public java.lang.String getModifiedInspectionGuidAndRemove()
Returns the first guid on the modified Inspection queue, or null if empty.

Returns:
String guid, or null if queue is empty.

addModifiedInspecton

public void addModifiedInspecton(java.lang.String guid)
Marks an Inspection as modified. Lets frontend know to update this object's graphics/data next refresh.

Parameters:
guid - - Inspection's guid.

isReloadAllInspections

public boolean isReloadAllInspections()
Checks if inspections in the queue should be updated, or everything from the database.

Returns:
- True if all records should be re-read.

setReloadAllInspections

public void setReloadAllInspections(boolean shouldI)
Sets the flag to read from the queue of modified inspections, or read everything from the database.

Parameters:
shouldI - - Read from databse if true, read from queue otherwise.

clearAllQueueInspections

public void clearAllQueueInspections()
Removes all inspection guids from the modified queue.