com.mizar.faces.javax.session
Class SessionConstants

java.lang.Object
  extended by com.mizar.faces.javax.session.SessionConstants

public class SessionConstants
extends java.lang.Object


Field Summary
static int APPLICATION
           
static int REQUEST
           
static int SESSION
           
 
Constructor Summary
SessionConstants()
           
 
Method Summary
 void closeEm()
          If em is not null and is open then it is closed.
 void closePersistenceUnit()
           
 java.lang.String getApplicationDS()
          Used for JDBC connections
 java.lang.String getApplicationName()
           
 java.lang.String getBackgroundColor()
           
 java.lang.String getBaseMap()
           
 java.lang.String getBaseMapYear()
          THIS PROPERTY WILL DISAPPEAR ONCE WE FIGURE OUT HOW BEST TO MANAGE MULTIPLE YEARS OF BASE MAPS
 java.util.HashMap<java.lang.String,java.lang.String> getBeanTableMap()
           
static SessionConstants getCurrentInstance()
           
 java.lang.Boolean getDeveloperMode()
           
 javax.persistence.EntityManager getEm()
           
 javax.persistence.EntityManagerFactory getEmf()
          The method searches the beanTableMap and if the
 java.util.HashMap<java.lang.String,java.lang.String> getEmProperties()
           
 int getEmScope()
          Do not change default of EmScope.SESSION
 java.util.HashMap<java.lang.String,java.lang.String> getFoiImages()
           
 int getGeocodeNumberedStreetMode()
           
 GeometryBean getLastFoundGeometry()
           
 oracle.spatial.geometry.JGeometry getMapClick()
           
 java.lang.Integer getMapZoom()
           
 int getMaxResultSetSize()
          This should be used as a parameter to java.persistence.Query.setMaxResults()
 double getMaxSpatialQueryArea()
           
 java.lang.Boolean getMetricUnits()
           
 java.util.HashMap<java.lang.String,java.lang.String> getMvXMLStyles()
           
 java.lang.String getPassword()
           
 java.lang.String getPersistenceUnitName()
           
 javax.faces.model.SelectItem[] getPersistenceUnits()
           
 java.util.ArrayList<java.util.HashMap<java.lang.String,java.lang.String>> getQuickPicks()
          QuickPicks are a simple method to display attributes of a registered JPA Bean that is nearest to a selected point.
 oracle.spatial.geometry.JGeometry getSearchArea()
           
 java.lang.String getSearchPanelType()
           
 java.lang.Boolean getSessionLogKiller()
           
 java.lang.Boolean getSessionLogLocker()
           
 java.lang.Boolean getSessionLogReader()
           
 java.lang.Boolean getShowBigHeader()
           
 java.lang.String getSkinFamily()
          The skin family is used in WEB-INF/trinidad-config.xml as follows:
 User getUser()
           
 UserIdentity getUserIdentity()
          Deprecated.  
 java.lang.String getUserName()
          See the MizarSecurity library for more information
 void heartBeat(javax.faces.event.FacesEvent evt)
           
 boolean isBatchOperation()
          This indicator is used by various methods to suppress interactive actions during batch operations.
 boolean isSearchAreaDefined()
           
 java.lang.Boolean isShowBigHeader()
           
 boolean isShowGuides()
           
 void setApplicationDS(java.lang.String applicationDS)
           
 void setApplicationName(java.lang.String applicationName)
          Set by the Login class in MizarSecurity
 void setBackgroundColor(java.lang.String backgroundColor)
           
 void setBaseMap(java.lang.String baseMap)
           
 void setBaseMapYear(java.lang.String baseMapYear)
          THIS PROPERTY WILL DISAPPEAR ONCE WE FIGURE OUT HOW BEST TO MANAGE MULTIPLE YEARS OF BASE MAPS
 void setBatchOperation(boolean batchOperation)
          This indicator is used by various methods to suppress interactive actions during batch operations.
 void setEmProperties(java.util.HashMap<java.lang.String,java.lang.String> emProperties)
           
 void setEmScope(int emScope)
          Only the default value of EmScope.SESSION is currently supported.
 void setFoiImages(java.util.HashMap<java.lang.String,java.lang.String> foiImages)
           
 void setGeocodeNumberedStreetMode(int geocodeNumberedStreetMode)
           
 void setLastFoundGeometry(GeometryBean lastFoundGeometry)
           
 void setMapClick(oracle.spatial.geometry.JGeometry mapClick)
           
 void setMapZoom(java.lang.Integer mapZoom)
           
 void setMaxResultSetSize(int maxResultSetSize)
           
 void setMaxSpatialQueryArea(double maxSpatialQueryArea)
           
 void setMetricUnits(java.lang.Boolean metricUnits)
           
 void setMvXMLStyles(java.util.HashMap<java.lang.String,java.lang.String> mvXMLStyles)
           
 void setPassword(java.lang.String password)
           
 void setPersistenceUnitName(java.lang.String persistenceUnitName)
          The method resets the persistenceUnitName and if it is different from the current persistenceUnitName the EntityManager em and EntityManagerFactory emf are flushed, cleared, and closed.
 void setQuickPicks(java.util.ArrayList<java.util.HashMap<java.lang.String,java.lang.String>> quickPicks)
           
 void setSearchArea(oracle.spatial.geometry.JGeometry searchArea)
          May be used as a spatial filter
 void setSearchPanelType(java.lang.String searchPanelType)
           
 void setShowBigHeader()
          toggles the showBigHeader value
 void setShowBigHeader(java.lang.Boolean showBigHeader)
          The showBigHeader property is used to permit sessions to switch between a larger "Big Header" and a more narrow compact header.
 void setShowGuides(boolean showGuides)
           
 void setSkinFamily(java.lang.String skinFamily)
           
 void setUser(User user)
           
 void setUserIdentity(UserIdentity userIdentity)
          Deprecated.  
 void setUserName(java.lang.String userName)
          See the MizarSecurity library for more information
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

APPLICATION

public static final int APPLICATION
See Also:
Constant Field Values

SESSION

public static final int SESSION
See Also:
Constant Field Values

REQUEST

public static final int REQUEST
See Also:
Constant Field Values
Constructor Detail

SessionConstants

public SessionConstants()
Method Detail

getCurrentInstance

public static SessionConstants getCurrentInstance()
Returns:
the SessionConstant

setEmScope

public void setEmScope(int emScope)
Only the default value of EmScope.SESSION is currently supported.

Parameters:
emScope -

getEmScope

public int getEmScope()

Do not change default of EmScope.SESSION

The Scope of the entity manager might be EmScope.SESSION or EmScope.APPLICATION

The concept of an EmScope.APPLICATION is conceived of, but not implemented, because of the fear that the application scope would either

  1. result in a very large cache requirement, or
  2. cause the cache to be blown out by many uses attempting to cache entity beans.
Of course, this might all be foolishness and an APPLICATION scoped entity manager might be a fine idea, but we're not ready to test it yet.

Returns:
the default scope of the entity manager

setEmProperties

public void setEmProperties(java.util.HashMap<java.lang.String,java.lang.String> emProperties)

heartBeat

public void heartBeat(javax.faces.event.FacesEvent evt)

getEmProperties

public java.util.HashMap<java.lang.String,java.lang.String> getEmProperties()

getEmf

public javax.persistence.EntityManagerFactory getEmf()
The method searches the beanTableMap and if the

Returns:
a Session scoped EntityManagerFactory
See Also:
RowFactory#

getEm

public javax.persistence.EntityManager getEm()
Returns:

closeEm

public void closeEm()
If em is not null and is open then it is closed. em is set to null.


closePersistenceUnit

public void closePersistenceUnit()

setApplicationDS

public void setApplicationDS(java.lang.String applicationDS)
Parameters:
applicationDS - the pooled connector for the application schema; set in faces-config.xml

getApplicationDS

public java.lang.String getApplicationDS()
Used for JDBC connections

Returns:
the pooled connector for the application schema

getBeanTableMap

public java.util.HashMap<java.lang.String,java.lang.String> getBeanTableMap()
Returns:
a HashMap of GenericBean and AbstractTable class names used by getEmf() to associate with RowInterfaces

setPersistenceUnitName

public void setPersistenceUnitName(java.lang.String persistenceUnitName)
The method resets the persistenceUnitName and if it is different from the current persistenceUnitName the EntityManager em and EntityManagerFactory emf are flushed, cleared, and closed.

Parameters:
persistenceUnitName - a persistenceUnitName

getPersistenceUnitName

public java.lang.String getPersistenceUnitName()
Returns:
the current persistenceUnitName

setBatchOperation

public void setBatchOperation(boolean batchOperation)
This indicator is used by various methods to suppress interactive actions during batch operations.

Parameters:
batchOperation - set to true when a batch operation is underway

isBatchOperation

public boolean isBatchOperation()
This indicator is used by various methods to suppress interactive actions during batch operations.

Returns:
if true then a batch operation is underway
See Also:
ADFUtils.launchApprovalDialog(java.lang.String, java.lang.String, javax.faces.component.UIComponent, java.util.HashMap), com.mizar.adfrichfaces.ADFUtils#launchArbitraryDialog

setShowGuides

public void setShowGuides(boolean showGuides)
Parameters:
showGuides - if true then display help icons, if false suppress them

isShowGuides

public boolean isShowGuides()
Returns:
if true then display help icons, if false suppress them

setMaxResultSetSize

public void setMaxResultSetSize(int maxResultSetSize)
Parameters:
maxResultSetSize -

getMaxResultSetSize

public int getMaxResultSetSize()
This should be used as a parameter to java.persistence.Query.setMaxResults()

Returns:
the maximum number of rows to return in a search
See Also:
com.mizar.adfrichfaces.AbstractCollection#getListJPQL, com.mizar.adfrichfaces.AbstractCollection#getListSQL

setSearchPanelType

public void setSearchPanelType(java.lang.String searchPanelType)

getSearchPanelType

public java.lang.String getSearchPanelType()

setSkinFamily

public void setSkinFamily(java.lang.String skinFamily)
Parameters:
skinFamily - a current Skin Family
See Also:
com.mizar.javax.faces.application.ApplicationConstants#getSkinFamilies()

getSkinFamily

public java.lang.String getSkinFamily()
The skin family is used in WEB-INF/trinidad-config.xml as follows:
 <skin-family>#{SessionConstants.skinFamily}</skin-family>
 

Returns:
the current Skin Family

setMapZoom

public void setMapZoom(java.lang.Integer mapZoom)
Parameters:
mapZoom -

getMapZoom

public java.lang.Integer getMapZoom()
Returns:
the current map zoom level

setBaseMap

public void setBaseMap(java.lang.String baseMap)
Parameters:
baseMap -

getBaseMap

public java.lang.String getBaseMap()
Returns:
the current base map

setShowBigHeader

public void setShowBigHeader(java.lang.Boolean showBigHeader)
The showBigHeader property is used to permit sessions to switch between a larger "Big Header" and a more narrow compact header.

Parameters:
showBigHeader -

setShowBigHeader

public void setShowBigHeader()
toggles the showBigHeader value


isShowBigHeader

public java.lang.Boolean isShowBigHeader()
Returns:
the current state of the showBigHeader property

getShowBigHeader

public java.lang.Boolean getShowBigHeader()
Returns:
the current state of the showBigHeader property

setUserName

public void setUserName(java.lang.String userName)
See the MizarSecurity library for more information

Parameters:
userName - the active username

getUserName

public java.lang.String getUserName()
See the MizarSecurity library for more information

Returns:
the active username

setPassword

public void setPassword(java.lang.String password)
Parameters:
password -

getPassword

public java.lang.String getPassword()
Returns:

setUser

public void setUser(User user)
Parameters:
user -

getUser

public User getUser()
Returns:
the current logged in User

setApplicationName

public void setApplicationName(java.lang.String applicationName)
Set by the Login class in MizarSecurity

Parameters:
applicationName -

getApplicationName

public java.lang.String getApplicationName()
Returns:

setQuickPicks

public void setQuickPicks(java.util.ArrayList<java.util.HashMap<java.lang.String,java.lang.String>> quickPicks)

getQuickPicks

public java.util.ArrayList<java.util.HashMap<java.lang.String,java.lang.String>> getQuickPicks()

QuickPicks are a simple method to display attributes of a registered JPA Bean that is nearest to a selected point.

The values for this List of HashMaps should be set in the projects faces-config.xml file in a manner similar to:

   <managed-bean>
     <managed-bean-name>SessionConstants</managed-bean-name>
     <managed-bean-class>com.mizar.faces.javax.session.SessionConstants</managed-bean-class>
     <managed-bean-scope>session</managed-bean-scope>
     <managed-property>
      <property-name>quickPicks</property-name>
       <list-entries>
         <value-class>java.util.HashMap</value-class>
         <value>#{quickPick1}</value>
         <value>#{quickPick2}</value>
       </list-entries>
     </managed-property>
   </managed-bean>
   <managed-bean>
     <managed-bean-name>quickPick1</managed-bean-name>
     <managed-bean-class>java.util.HashMap</managed-bean-class>
     <managed-bean-scope>none</managed-bean-scope>
     <map-entries>
       <map-entry><key>label</key><value>Parcel(8 mi.)</value></map-entry>
       <map-entry><key>tip</key><value>Click map to get quick parcel info</value></map-entry>
       <map-entry><key>className</key><value>us.cuyahogacounty.cegisportal.db.beans.ParcelBean</value></map-entry>
       <map-entry><key>minZoomLevel</key><value>3</value></map-entry>
       <map-entry><key>callNext</key><value>addToParcelTable</value></map-entry>
     </map-entries>
   </managed-bean>
   <managed-bean>
     <managed-bean-name>quickPick2</managed-bean-name>
     <managed-bean-class>java.util.HashMap</managed-bean-class>
     <managed-bean-scope>none</managed-bean-scope>
     <map-entries>
       <map-entry><key>label</key><value>Census Block Group</value></map-entry>
       <map-entry><key>tip</key><value>Click map to get quick census block info</value></map-entry>
       <map-entry><key>className</key><value>us.cuyahogacounty.census.CensusBlockBean</value></map-entry>
       <map-entry><key>minZoomLevel</key><value>0</value></map-entry>
     </map-entries>
   </managed-bean>
 
Required values for HashMap keys include: Optional values include:

Returns:
quickPick parameters used by mizarAjax.js quickPick(event) function
See Also:
QuickPickHandler.processRequest(HttpServletRequest, HttpServletResponse), FacesUtils.getInfoBox(Object)

setSearchArea

public void setSearchArea(oracle.spatial.geometry.JGeometry searchArea)
May be used as a spatial filter

Parameters:
searchArea -
See Also:
SearchAreaHandler

getSearchArea

public oracle.spatial.geometry.JGeometry getSearchArea()
Returns:
the current spatial filter

isSearchAreaDefined

public boolean isSearchAreaDefined()

setBaseMapYear

public void setBaseMapYear(java.lang.String baseMapYear)
THIS PROPERTY WILL DISAPPEAR ONCE WE FIGURE OUT HOW BEST TO MANAGE MULTIPLE YEARS OF BASE MAPS

Parameters:
baseMapYear - the year of the current base map

getBaseMapYear

public java.lang.String getBaseMapYear()
THIS PROPERTY WILL DISAPPEAR ONCE WE FIGURE OUT HOW BEST TO MANAGE MULTIPLE YEARS OF BASE MAPS

Returns:

getPersistenceUnits

public javax.faces.model.SelectItem[] getPersistenceUnits()

setMaxSpatialQueryArea

public void setMaxSpatialQueryArea(double maxSpatialQueryArea)

getMaxSpatialQueryArea

public double getMaxSpatialQueryArea()

setMetricUnits

public void setMetricUnits(java.lang.Boolean metricUnits)

getMetricUnits

public java.lang.Boolean getMetricUnits()

setUserIdentity

@Deprecated
public void setUserIdentity(UserIdentity userIdentity)
Deprecated. 

Parameters:
userIdentity -
See Also:
setUser(com.mizar.credentials.User)

getUserIdentity

@Deprecated
public UserIdentity getUserIdentity()
Deprecated. 

Returns:
See Also:
getUser()

setMvXMLStyles

public void setMvXMLStyles(java.util.HashMap<java.lang.String,java.lang.String> mvXMLStyles)

getMvXMLStyles

public java.util.HashMap<java.lang.String,java.lang.String> getMvXMLStyles()

setFoiImages

public void setFoiImages(java.util.HashMap<java.lang.String,java.lang.String> foiImages)

getFoiImages

public java.util.HashMap<java.lang.String,java.lang.String> getFoiImages()

setGeocodeNumberedStreetMode

public void setGeocodeNumberedStreetMode(int geocodeNumberedStreetMode)

getGeocodeNumberedStreetMode

public int getGeocodeNumberedStreetMode()

setMapClick

public void setMapClick(oracle.spatial.geometry.JGeometry mapClick)

getMapClick

public oracle.spatial.geometry.JGeometry getMapClick()

setBackgroundColor

public void setBackgroundColor(java.lang.String backgroundColor)

getBackgroundColor

public java.lang.String getBackgroundColor()

getSessionLogReader

public java.lang.Boolean getSessionLogReader()

getSessionLogKiller

public java.lang.Boolean getSessionLogKiller()

getSessionLogLocker

public java.lang.Boolean getSessionLogLocker()

getDeveloperMode

public java.lang.Boolean getDeveloperMode()

setLastFoundGeometry

public void setLastFoundGeometry(GeometryBean lastFoundGeometry)

getLastFoundGeometry

public GeometryBean getLastFoundGeometry()