migrate saflute to dbflute and lastaflute structure
This commit is contained in:
parent
37dd4781c8
commit
bfdd952741
56 changed files with 44434 additions and 3275 deletions
1
.gitignore
vendored
1
.gitignore
vendored
|
@ -6,6 +6,7 @@
|
|||
/src/main/webapp/WEB-INF/classes/
|
||||
/src/main/webapp/WEB-INF/lib/
|
||||
/src/main/webapp/jar/
|
||||
/dbflute_fess/log/*.log
|
||||
/dbflute_h2/log/*.log
|
||||
/dbflute_mysql/log/*.log
|
||||
/dbflute_oracle/log/*.log
|
||||
|
|
|
@ -3,33 +3,34 @@ Directory for DBFlute properties
|
|||
Required (Basic) Properties:
|
||||
o basicInfoMap.dfprop
|
||||
o databaseInfoMap.dfprop
|
||||
At first, you should set these properties
|
||||
before executions of DBFlute tasks.
|
||||
|
||||
Properties for additional informations:
|
||||
o additionalForeignKeyMap.dfprop
|
||||
o additionalPrimaryKeyMap.dfprop
|
||||
o additionalUniqueKeyMap.dfprop
|
||||
o additionalTableMap.dfprop
|
||||
o additionalUniqueKeyMap.dfprop (manual making)
|
||||
o additionalTableMap.dfprop (manual making)
|
||||
|
||||
Properties for implementation environments:
|
||||
o commonColumnMap.dfprop
|
||||
o classificationDefinitionMap.dfprop
|
||||
o classificationDeploymentMap.dfprop
|
||||
o optimisticLockDefinitionMap.dfprop
|
||||
o outsideSqlDefinitionMap.dfprop
|
||||
o sequenceDefinitionMap.dfprop
|
||||
o commonColumnMap.dfprop
|
||||
o conditionBeanMap.dfprop
|
||||
o dependencyInjectionMap.dfprop
|
||||
o littleAdjustmentMap.dfprop
|
||||
o includeQueryMap.dfprop
|
||||
o typeMappingMap.dfprop
|
||||
o outsideSqlMap.dfprop
|
||||
o sequenceMap.dfprop
|
||||
|
||||
Properties for ReplaceSchema:
|
||||
o replaceSchemaDefinitionMap.dfprop
|
||||
o replaceSchemaMap.dfprop
|
||||
|
||||
Properties for documents:
|
||||
o documentDefinitionMap.dfprop
|
||||
o documentMap.dfprop
|
||||
|
||||
Properties for non-functional adjustments:
|
||||
o allClassCopyright.dfprop
|
||||
o refreshDefinitionMap.dfprop
|
||||
o sourceCopyright.dfprop
|
||||
o infraMap.dfprop (manual making)
|
||||
|
||||
Properties for plug-ins:
|
||||
o freeGenMap.dfprop (manual making)
|
||||
o lastafluteMap.dfprop (manual making)
|
||||
o simpleDtoMap.dfprop (manual making)
|
||||
|
|
|
@ -1,42 +0,0 @@
|
|||
# /---------------------------------------------------------------------------
|
||||
# additionalTableMap: (NotRequired - Default map:{})
|
||||
#
|
||||
# This property is valid at only JDBC task.
|
||||
# You should use this when JDBC can not provide table information
|
||||
# and when you have no table but call stored procedures only.
|
||||
#
|
||||
# The element 'columnMap' is only required in table elements.
|
||||
# The element 'type' is only required in column elements.
|
||||
#
|
||||
# Specification:
|
||||
# map: {
|
||||
# [table-name] = map:{
|
||||
# columnMap = map:{
|
||||
# [column-name] = map:{
|
||||
# type = [column JDBC type] ; dbType = [column DB type]
|
||||
# ; required = [true or false] ; size = [column size]
|
||||
# ; primaryKey = [true or false] ; pkName = [PK constraint name]
|
||||
# ; autoIncrement = [true or false]
|
||||
# ; default = [default value] ; comment = [column comment]
|
||||
# }
|
||||
# }
|
||||
# ; comment = [table comment]
|
||||
# }
|
||||
# }
|
||||
#
|
||||
# *The line that starts with '#' means comment-out.
|
||||
#
|
||||
map:{
|
||||
#; FOO_TABLE = map:{
|
||||
# ; columnMap = map:{
|
||||
# FOO_ID = map:{ type = INTEGER ; dbType = INTEGER
|
||||
# ; required = true ; primaryKey = true ; autoIncrement = true
|
||||
# }
|
||||
# FOO_NAME = map:{ type = VARCHAR ; required = true ; size = 123 }
|
||||
# FOO_DATE = map:{ type = DATE }
|
||||
# }
|
||||
#}
|
||||
}
|
||||
# ----------------/
|
||||
#
|
||||
# *Refer to typeMappingMap.dfprop for JDBC type reference.
|
|
@ -1,26 +0,0 @@
|
|||
# /---------------------------------------------------------------------------
|
||||
# additionalUniqueKeyMap: (NotRequired - Default map:{})
|
||||
#
|
||||
# If unique key does not exist in your database,
|
||||
# you can set up here as virtual unique key for DBFlute.
|
||||
# And you can use it to view objects too.
|
||||
# The names are treated as case insensitive.
|
||||
#
|
||||
# Example:
|
||||
# map:{
|
||||
# ; UQ_MEMBER = map:{
|
||||
# ; tableName = MEMBER ; columnName = MEMBER_ACCOUNT
|
||||
# }
|
||||
# ; UQ_PRODUCT = map:{
|
||||
# ; tableName = PRODUCT ; columnName = PRODUCT_HANDLE_CODE
|
||||
# }
|
||||
# }
|
||||
#
|
||||
# *The line that starts with '#' means comment-out.
|
||||
#
|
||||
map:{
|
||||
#; UQ_MEMBER = map:{
|
||||
# ; tableName = MEMBER ; columnName = MEMBER_ACCOUNT
|
||||
#}
|
||||
}
|
||||
# ----------------/
|
|
@ -42,24 +42,20 @@ map:{
|
|||
# [Include]
|
||||
# String columns may not be needed
|
||||
# to be set these condition-keys basically.
|
||||
#; GreaterThan = map:{}
|
||||
#; LessThan = map:{}
|
||||
#; GreaterEqual = map:{}
|
||||
#; LessEqual = map:{}
|
||||
; GreaterThan = map:{}
|
||||
; LessThan = map:{}
|
||||
; GreaterEqual = map:{}
|
||||
; LessEqual = map:{}
|
||||
|
||||
# [Exclude]
|
||||
# Common columns of String type may not be needed
|
||||
# to be set these condition-keys basically.
|
||||
#; !NotEqual = map:{ $$ALL$$ = list:{ $$CommonColumn$$ } }
|
||||
#; !GreaterThan = map:{ $$ALL$$ = list:{ $$CommonColumn$$ } }
|
||||
#; !LessThan = map:{ $$ALL$$ = list:{ $$CommonColumn$$ } }
|
||||
#; !GreaterEqual = map:{ $$ALL$$ = list:{ $$CommonColumn$$ } }
|
||||
#; !LessEqual = map:{ $$ALL$$ = list:{ $$CommonColumn$$ } }
|
||||
#; !InScope = map:{ $$ALL$$ = list:{ $$CommonColumn$$ } }
|
||||
#; !NotInScope = map:{ $$ALL$$ = list:{ $$CommonColumn$$ } }
|
||||
#; !PrefixSearch = map:{ $$ALL$$ = list:{ $$CommonColumn$$ } }
|
||||
#; !LikeSearch = map:{ $$ALL$$ = list:{ $$CommonColumn$$ } }
|
||||
#; !NotLikeSearch = map:{ $$ALL$$ = list:{ $$CommonColumn$$ } }
|
||||
; !NotEqual = map:{ $$ALL$$ = list:{ $$CommonColumn$$ ; type:LONGVARCHAR ; suffix:_NAME } }
|
||||
; !InScope = map:{ $$ALL$$ = list:{ $$CommonColumn$$ ; type:LONGVARCHAR ; suffix:_NAME } }
|
||||
; !NotInScope = map:{ $$ALL$$ = list:{ $$CommonColumn$$ ; type:LONGVARCHAR ; suffix:_NAME } }
|
||||
; !PrefixSearch = map:{ $$ALL$$ = list:{ $$CommonColumn$$ } }
|
||||
; !LikeSearch = map:{ $$ALL$$ = list:{ $$CommonColumn$$ } }
|
||||
; !NotLikeSearch = map:{ $$ALL$$ = list:{ $$CommonColumn$$ } }
|
||||
}
|
||||
; Number = map:{
|
||||
# [Include]
|
||||
|
@ -68,14 +64,15 @@ map:{
|
|||
# [Exclude]
|
||||
# VersionNo column may not be needed
|
||||
# to be set these condition-keys basically.
|
||||
#; !NotEqual = map:{ $$ALL$$ = list:{ $$VersionNo$$ } }
|
||||
#; !GreaterThan = map:{ $$ALL$$ = list:{ $$VersionNo$$ } }
|
||||
#; !LessThan = map:{ $$ALL$$ = list:{ $$VersionNo$$ } }
|
||||
#; !GreaterEqual = map:{ $$ALL$$ = list:{ $$VersionNo$$ } }
|
||||
#; !LessEqual = map:{ $$ALL$$ = list:{ $$VersionNo$$ } }
|
||||
; !NotEqual = map:{ $$ALL$$ = list:{ $$VersionNo$$ ; DISPLAY_ORDER } }
|
||||
; !GreaterThan = map:{ $$ALL$$ = list:{ $$VersionNo$$ ; DISPLAY_ORDER } }
|
||||
; !LessThan = map:{ $$ALL$$ = list:{ $$VersionNo$$ ; DISPLAY_ORDER } }
|
||||
; !GreaterEqual = map:{ $$ALL$$ = list:{ $$VersionNo$$ ; DISPLAY_ORDER } }
|
||||
; !LessEqual = map:{ $$ALL$$ = list:{ $$VersionNo$$ ; DISPLAY_ORDER } }
|
||||
# RangeOf only valid just in case
|
||||
#; !RangeOf = map:{ $$ALL$$ = list:{ $$VersionNo$$ } }
|
||||
#; !InScope = map:{ $$ALL$$ = list:{ $$VersionNo$$ } }
|
||||
#; !NotInScope = map:{ $$ALL$$ = list:{ $$VersionNo$$ } }
|
||||
; !InScope = map:{ $$ALL$$ = list:{ $$VersionNo$$ ; DISPLAY_ORDER } }
|
||||
; !NotInScope = map:{ $$ALL$$ = list:{ $$VersionNo$$ ; DISPLAY_ORDER } }
|
||||
}
|
||||
; Date = map:{
|
||||
# [Include]
|
||||
|
@ -88,12 +85,17 @@ map:{
|
|||
# [Exclude]
|
||||
# Common columns of Date type may not be needed
|
||||
# to be set these condition-keys basically.
|
||||
#; !GreaterThan = map:{ $$ALL$$ = list:{ $$CommonColumn$$ } }
|
||||
#; !LessThan = map:{ $$ALL$$ = list:{ $$CommonColumn$$ } }
|
||||
#; !GreaterEqual = map:{ $$ALL$$ = list:{ $$CommonColumn$$ } }
|
||||
#; !LessEqual = map:{ $$ALL$$ = list:{ $$CommonColumn$$ } }
|
||||
#; !FromTo = map:{ $$ALL$$ = list:{ $$CommonColumn$$ } }
|
||||
#; !DateFromTo = map:{ $$ALL$$ = list:{ $$CommonColumn$$ } }
|
||||
; !GreaterThan = map:{ $$ALL$$ = list:{ $$CommonColumn$$ } }
|
||||
; !LessThan = map:{ $$ALL$$ = list:{ $$CommonColumn$$ } }
|
||||
; !GreaterEqual = map:{ $$ALL$$ = list:{ $$CommonColumn$$ } }
|
||||
; !LessEqual = map:{ $$ALL$$ = list:{ $$CommonColumn$$ } }
|
||||
# RangeOf only valid just in case
|
||||
#; !FromTo = map:{ $$ALL$$ = list:{ $$CommonColumn$$ } }
|
||||
; !DateFromTo = map:{ $$ALL$$ = list:{ $$CommonColumn$$ } }
|
||||
}
|
||||
; OrderBy = map:{
|
||||
; !Asc = map:{ $$ALL$$ = list:{ type:LONGVARCHAR } }
|
||||
; !Desc = map:{ $$ALL$$ = list:{ type:LONGVARCHAR } }
|
||||
}
|
||||
}
|
||||
# ----------------/
|
|
@ -16,7 +16,7 @@
|
|||
#
|
||||
map:{
|
||||
; driver = org.h2.Driver
|
||||
; url = jdbc:h2:file:../src/main/resources/fess
|
||||
; url = jdbc:h2:file:../src/test/resources/dummydb/dummydb
|
||||
; schema =
|
||||
; user = sa
|
||||
; password =
|
||||
|
|
|
@ -31,7 +31,7 @@ map:{
|
|||
; domainPackage = org.codelibs.fess
|
||||
|
||||
# keywords for environment properties, same as directory name
|
||||
; environmentList = list:{ integration ; production }
|
||||
; environmentList = list:{}
|
||||
|
||||
# environment dispatch by lasta.env of system property?
|
||||
; isUseLastaEnv = false
|
||||
|
|
|
@ -7,24 +7,20 @@
|
|||
# o isAvailableAddingCatalogToTableSqlName: (NotRequired - Default false)
|
||||
# o isAvailableDatabaseDependency: (NotRequired - Default false)
|
||||
# o isAvailableDatabaseNativeJDBC: (NotRequired - Default false)
|
||||
# o isAvailableNonPrimaryKeyWritable: (NotRequired - Default false)
|
||||
# o classificationUndefinedHandlingType: (NotRequired - Default LOGGING)
|
||||
# o isEntityConvertEmptyStringToNull: (NotRequired - Default false)
|
||||
# o isMakeConditionQueryEqualEmptyString: (NotRequired - Default false)
|
||||
# o isTableDispNameUpperCase: (NotRequired - Default false)
|
||||
# o isTableSqlNameUpperCase: (NotRequired - Default false)
|
||||
# o isColumnSqlNameUpperCase: (NotRequired - Default false)
|
||||
# o isMakeDeprecated: (NotRequired - Default false)
|
||||
# o isMakeRecentlyDeprecated: (NotRequired - Default true)
|
||||
# o extendedDBFluteInitializerClass: (NotRequired - Default null)
|
||||
# o extendedImplementedInvokerAssistantClass: (NotRequired - Default null)
|
||||
# o extendedImplementedCommonColumnAutoSetupperClass: (NotRequired - Default null)
|
||||
# o shortCharHandlingMode: (NotRequired - Default NONE)
|
||||
# o quoteTableNameList: (NotRequired - Default list:{})
|
||||
# o quoteColumnNameList: (NotRequired - Default list:{})
|
||||
# o columnNullObjectMap: (NotRequired - Default map:{})
|
||||
# o relationalNullObjectMap: (NotRequired - Default map:{})
|
||||
# o cursorSelectFetchSize: (NotRequired - Default null)
|
||||
# o refreshMap: (NotRequired - Default map:{})
|
||||
# o optimisticLockMap: (NotRequired - Default map:{})
|
||||
#
|
||||
# *The line that starts with '#' means comment-out.
|
||||
#
|
||||
|
@ -34,9 +30,6 @@ map:{
|
|||
# [true]
|
||||
# Add schema to table SQL name. (The table name on query is SCHEMA.TABLE)
|
||||
#
|
||||
# [false]
|
||||
# Non.
|
||||
#
|
||||
#; isAvailableAddingSchemaToTableSqlName = false
|
||||
# - - - - - - - - - -/
|
||||
|
||||
|
@ -44,10 +37,6 @@ map:{
|
|||
# o isAvailableAddingCatalogToTableSqlName: (NotRequired - Default false)
|
||||
# [true]
|
||||
# Add catalog to table SQL name. (The table name on query is CATALOG.SCHEMA.TABLE)
|
||||
# This property works only when isAvailableAddingSchemaToTableSqlName is true.
|
||||
#
|
||||
# [false]
|
||||
# Non.
|
||||
#
|
||||
#; isAvailableAddingCatalogToTableSqlName = false
|
||||
# - - - - - - - - - -/
|
||||
|
@ -55,11 +44,7 @@ map:{
|
|||
# /- - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
|
||||
# o isAvailableDatabaseDependency: (NotRequired - Default false)
|
||||
# [true]
|
||||
# Generate the method that depends on the database.
|
||||
# For example: cb.lockWithRR() at DB2.
|
||||
#
|
||||
# [false]
|
||||
# Non.
|
||||
# Generate the method that depends on the database. e.g. cb.lockWithRR() at DB2.
|
||||
#
|
||||
#; isAvailableDatabaseDependency = false
|
||||
# - - - - - - - - - -/
|
||||
|
@ -67,27 +52,12 @@ map:{
|
|||
# /- - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
|
||||
# o isAvailableDatabaseNativeJDBC: (NotRequired - Default false)
|
||||
# [true]
|
||||
# Use classes of database native JDBC on generated classes
|
||||
# to get best performances of DB access.
|
||||
# Use classes of database native JDBC on generated classes to get best performances of DB access.
|
||||
# Your project needs to refer to database native JDBC.
|
||||
#
|
||||
# [false]
|
||||
# Non.
|
||||
#
|
||||
#; isAvailableDatabaseNativeJDBC = false
|
||||
# - - - - - - - - - -/
|
||||
|
||||
# /- - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
|
||||
# o isAvailableNonPrimaryKeyWritable: (NotRequired - Default false)
|
||||
# [true]
|
||||
# Generate writable methods at non-primary-key table.
|
||||
#
|
||||
# [false]
|
||||
# Non.
|
||||
#
|
||||
#; isAvailableNonPrimaryKeyWritable = false
|
||||
# - - - - - - - - - -/
|
||||
|
||||
# /- - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
|
||||
# o classificationUndefinedHandlingType: (NotRequired - Default LOGGING)
|
||||
# The handling type when undefined classification is found.
|
||||
|
@ -104,32 +74,13 @@ map:{
|
|||
# [true]
|
||||
# Convert empty-string data to null in entity.
|
||||
#
|
||||
# [false]
|
||||
# Non.
|
||||
#
|
||||
#; isEntityConvertEmptyStringToNull = false
|
||||
# - - - - - - - - - -/
|
||||
|
||||
# /- - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
|
||||
# o isMakeConditionQueryEqualEmptyString: (NotRequired - Default false)
|
||||
# [true]
|
||||
# Make equal-empty-string methods of condition-query.
|
||||
# For example: cb.query().setMemberName_Equal_EmptyString()
|
||||
#
|
||||
# [false]
|
||||
# Non.
|
||||
#
|
||||
#; isMakeConditionQueryEqualEmptyString = false
|
||||
# - - - - - - - - - -/
|
||||
|
||||
# /- - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
|
||||
# o isTableDispNameUpperCase: (NotRequired - Default false)
|
||||
# [true]
|
||||
# Table names for display, e.g. on documents,
|
||||
# are forcedly treated as upper case.
|
||||
#
|
||||
# [false]
|
||||
# Non.
|
||||
# Table names for display, e.g. on documents, are forcedly treated as upper case.
|
||||
#
|
||||
#; isTableDispNameUpperCase = false
|
||||
# - - - - - - - - - -/
|
||||
|
@ -140,9 +91,6 @@ map:{
|
|||
# Table names on SQL executed by condition-bean or behavior
|
||||
# are forcedly treated as upper case. (except outside-SQL)
|
||||
#
|
||||
# [false]
|
||||
# Non.
|
||||
#
|
||||
#; isTableSqlNameUpperCase = false
|
||||
# - - - - - - - - - -/
|
||||
|
||||
|
@ -152,36 +100,9 @@ map:{
|
|||
# Column names on SQL executed by condition-bean or behavior
|
||||
# are forcedly treated as upper case. (except outside-SQL)
|
||||
#
|
||||
# [false]
|
||||
# Non.
|
||||
#
|
||||
#; isColumnSqlNameUpperCase = false
|
||||
# - - - - - - - - - -/
|
||||
|
||||
# /- - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
|
||||
# o isMakeDeprecated: (NotRequired - Default false)
|
||||
# [true]
|
||||
# Make deprecated method and class and so on...
|
||||
# *You should specify this property 'false'!
|
||||
#
|
||||
# [false]
|
||||
# Non.
|
||||
#
|
||||
#; isMakeDeprecated = false
|
||||
# - - - - - - - - - -/
|
||||
|
||||
# /- - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
|
||||
# o isMakeRecentlyDeprecated: (NotRequired - Default true)
|
||||
# [true]
|
||||
# Make RECENTLY deprecated method and class and so on...
|
||||
# *You should specify this property 'false'!
|
||||
#
|
||||
# [false]
|
||||
# Non.
|
||||
#
|
||||
#; isMakeRecentlyDeprecated = true
|
||||
# - - - - - - - - - -/
|
||||
|
||||
# /- - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
|
||||
# o extendedDBFluteInitializerClass: (NotRequired - Default null)
|
||||
# If you want to extend the embedded DBFlute initializer,
|
||||
|
@ -192,26 +113,6 @@ map:{
|
|||
#; extendedDBFluteInitializerClass = com.example.ExtendedDBFluteInitializer
|
||||
# - - - - - - - - - -/
|
||||
|
||||
# /- - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
|
||||
# o extendedImplementedInvokerAssistantClass: (NotRequired - Default null)
|
||||
# If you want to extend the embedded invoker assistant,
|
||||
# specify the class name of your original invoker assistant
|
||||
# that extends the embedded one.
|
||||
# *Basically you SHOULD NOT specify this property!
|
||||
#
|
||||
#; extendedImplementedInvokerAssistantClass = com.example.ExtendedImplementedInvokerAssistant
|
||||
# - - - - - - - - - -/
|
||||
|
||||
# /- - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
|
||||
# o extendedImplementedCommonColumnAutoSetupperClass: (NotRequired - Default null)
|
||||
# If you want to extend the embedded common column auto setupper,
|
||||
# specify the class name of your original common column auto setupper
|
||||
# that extends the embedded one.
|
||||
# *Basically you SHOULD NOT specify this property!
|
||||
#
|
||||
#; extendedImplementedCommonColumnAutoSetupperClass = com.example.ExtendedImplementedCommonColumnAutoSetupper
|
||||
# - - - - - - - - - -/
|
||||
|
||||
# /- - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
|
||||
# o shortCharHandlingMode: (NotRequired - Default NONE)
|
||||
# If the parameter of condition-bean or parameter-bean has short size,
|
||||
|
@ -225,16 +126,14 @@ map:{
|
|||
|
||||
# /- - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
|
||||
# o quoteTableNameList: (NotRequired - Default list:{})
|
||||
# The list of table DB names that need to be quoted.
|
||||
# Specified tables is quoted on auto-generated SQL.
|
||||
# The list of table DB names that need to be quoted. Specified tables is quoted on auto-generated SQL.
|
||||
#
|
||||
#; quoteTableNameList = list:{}
|
||||
# - - - - - - - - - -/
|
||||
|
||||
# /- - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
|
||||
# o quoteColumnNameList: (NotRequired - Default list:{})
|
||||
# The list of column DB names that need to be quoted.
|
||||
# Specified columns is quoted on auto-generated SQL.
|
||||
# The list of column DB names that need to be quoted. Specified columns is quoted on auto-generated SQL.
|
||||
#
|
||||
#; quoteColumnNameList = list:{}
|
||||
# - - - - - - - - - -/
|
||||
|
@ -278,5 +177,32 @@ map:{
|
|||
#
|
||||
#; cursorSelectFetchSize = Integer.MIN_VALUE
|
||||
# - - - - - - - - - -/
|
||||
|
||||
# /- - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
|
||||
# o refreshMap: (NotRequired - Default map:{projectName=$$AutoDetect$$ ; requestUrl=http://localhost:8386/})
|
||||
# If you use synchronizer and specify this property, no need to refresh(F5) your eclipse project.
|
||||
# The projectName can be set plural names by slash '/'. e.g. sea/land
|
||||
#
|
||||
#; refreshMap = map:{
|
||||
# ; projectName = $$AutoDetect$$
|
||||
# ; requestUrl = http://localhost:8386/
|
||||
#}
|
||||
# - - - - - - - - - -/
|
||||
|
||||
# /- - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
|
||||
# o optimisticLockMap: (NotRequired - Default map:{})
|
||||
# The definition for optimistic lock of DBFlute.
|
||||
#
|
||||
#; optimisticLockMap = map:{
|
||||
# # o updateDateFieldName: (NotRequired - Default '')
|
||||
# ; updateDateFieldName = UPDATE_DATE
|
||||
#
|
||||
# # o versionNoFieldName: (NotRequired - Default 'VERSION_NO')
|
||||
# # The column name of version no for optimistic lock.
|
||||
# # Basically you don't need this if your tables have the column 'VERSION_NO'.
|
||||
# # because the default value is 'VERSION_NO'.
|
||||
# ; versionNoFieldName = VERSION_NO
|
||||
#}
|
||||
# - - - - - - - - - -/
|
||||
}
|
||||
# ----------------/
|
|
@ -1,28 +0,0 @@
|
|||
# /---------------------------------------------------------------------------
|
||||
# optimisticLockDefinitionMap: (NotRequired - Default map:{})
|
||||
#
|
||||
# The definition for optimistic lock of DBFlute.
|
||||
#
|
||||
# o updateDateFieldName: (NotRequired - Default '')
|
||||
# o versionNoFieldName: (NotRequired - Default 'VERSION_NO')
|
||||
#
|
||||
# *The line that starts with '#' means comment-out.
|
||||
#
|
||||
map:{
|
||||
# /- - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
|
||||
# o updateDateFieldName: (NotRequired - Default '')
|
||||
# The column name of update date for optimistic lock.
|
||||
#
|
||||
#; updateDateFieldName = UPDATE_DATE
|
||||
# - - - - - - - - - -/
|
||||
|
||||
# /- - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
|
||||
# o versionNoFieldName: (NotRequired - Default 'VERSION_NO')
|
||||
# The column name of version no for optimistic lock.
|
||||
# Basically you don't need this if your tables have the column 'VERSION_NO'.
|
||||
# because the default value is 'VERSION_NO'.
|
||||
#
|
||||
#; versionNoFieldName = VERSION_NO
|
||||
# - - - - - - - - - -/
|
||||
}
|
||||
# ----------------/
|
|
@ -1,5 +1,5 @@
|
|||
# /---------------------------------------------------------------------------
|
||||
# outsideSqlDefinitionMap: (NotRequired - Default map:{})
|
||||
# outsideSqlMap: (NotRequired - Default map:{})
|
||||
#
|
||||
# The various settings about outsideSql.
|
||||
#
|
||||
|
@ -27,9 +27,6 @@ map:{
|
|||
# The parameter beans for procedure are auto-generated.
|
||||
# If you call the procedure from DBFlute, you should specify 'true'!
|
||||
#
|
||||
# [false]
|
||||
# Non.
|
||||
#
|
||||
; isGenerateProcedureParameterBean = false
|
||||
# - - - - - - - - - -/
|
||||
|
||||
|
@ -43,9 +40,6 @@ map:{
|
|||
# (because of getting from execution meta data (result set meta data))
|
||||
# This property is valid only when isGenerateProcedureParameterBean is true.
|
||||
#
|
||||
# [false]
|
||||
# Non.
|
||||
#
|
||||
; isGenerateProcedureCustomizeEntity = false
|
||||
# - - - - - - - - - -/
|
||||
|
||||
|
@ -104,9 +98,6 @@ map:{
|
|||
# You should always write the title of outsideSql.
|
||||
# If it doesn't exist, the OutsideSqlTest task fails.
|
||||
#
|
||||
# [false]
|
||||
# Non.
|
||||
#
|
||||
#; isRequiredSqlTitle = true
|
||||
# - - - - - - - - - -/
|
||||
|
||||
|
@ -116,9 +107,6 @@ map:{
|
|||
# You should always write the description of outsideSql.
|
||||
# If it doesn't exist, the OutsideSqlTest task fails.
|
||||
#
|
||||
# [false]
|
||||
# Non.
|
||||
#
|
||||
#; isRequiredSqlDescription = true
|
||||
# - - - - - - - - - -/
|
||||
|
|
@ -1,19 +0,0 @@
|
|||
# /---------------------------------------------------------------------------
|
||||
# refreshDefinitionMap: (NotRequired - Default map:{})
|
||||
#
|
||||
# If you use synchronizer and specify this property,
|
||||
# You don't need to refresh(F5) your eclipse project.
|
||||
#
|
||||
# Specification:
|
||||
# map:{
|
||||
# ; projectName = [Eclipse Project1] / [Eclipse Project2] / ...
|
||||
# ; requestUrl = [synchronizer's URL]
|
||||
# }
|
||||
#
|
||||
# *The line that starts with '#' means comment-out.
|
||||
#
|
||||
map:{
|
||||
; projectName = $$AutoDetect$$
|
||||
; requestUrl = http://localhost:8386/
|
||||
}
|
||||
# ----------------/
|
|
@ -1,5 +1,5 @@
|
|||
# /---------------------------------------------------------------------------
|
||||
# replaceSchemaDefinitionMap: (NotRequired - Default map:{})
|
||||
# replaceSchemaMap: (NotRequired - Default map:{})
|
||||
#
|
||||
# The various settings about replace-schema.
|
||||
#
|
||||
|
|
|
@ -1,11 +1,10 @@
|
|||
# /---------------------------------------------------------------------------
|
||||
# sequenceDefinitionMap: (NotRequired - Default map:{})
|
||||
#
|
||||
# sequenceMap: (NotRequired - Default map:{})
|
||||
#
|
||||
# The relation mappings between sequence and table.
|
||||
# If you don't specify the mappings, you cannot insert
|
||||
# a record of the table by sequence.
|
||||
# If you don't specify the mappings, you cannot insert a record of the table by sequence.
|
||||
# The table names are treated as case insensitive.
|
||||
#
|
||||
#
|
||||
# Example:
|
||||
# map:{
|
||||
# ; PURCHASE = SEQ_PURCHASE
|
||||
|
|
40814
dbflute_fess/output/doc/properties-fess.html
Normal file
40814
dbflute_fess/output/doc/properties-fess.html
Normal file
File diff suppressed because it is too large
Load diff
864
dbflute_fess/output/doc/schema-fess.html
Normal file
864
dbflute_fess/output/doc/schema-fess.html
Normal file
|
@ -0,0 +1,864 @@
|
|||
<!DOCTYPE html>
|
||||
<html>
|
||||
<head>
|
||||
<meta charset="UTF-8" />
|
||||
<title>fess schema</title>
|
||||
<style type="text/css">
|
||||
* {
|
||||
margin: 0;
|
||||
padding: 0;
|
||||
}
|
||||
body {
|
||||
font-family: Verdana, "Hiragino Kaku Gothic Pro", "ヒラギノ角ゴ Pro W3", Meiryo, "メイリオ", "MS P Gothic", "MS Pゴシック", sans-serif;
|
||||
font-size: 80%;
|
||||
margin: 10px 5px 5px 15px;
|
||||
background-color: #ffffe0;
|
||||
}
|
||||
|
||||
/* heading */
|
||||
h1 {
|
||||
font-size: 1.5em;
|
||||
border-bottom: 2px solid #af0000;
|
||||
border-top: 2px solid #af0000;
|
||||
}
|
||||
h2 {
|
||||
margin: 30px 0 5px 0;
|
||||
font-size: 1.8em;
|
||||
border-bottom: 2px solid #af0000;
|
||||
border-left: 10px solid #af0000;
|
||||
text-indent: 10px;
|
||||
}
|
||||
h3 {
|
||||
padding: 0 0 0 10px;
|
||||
margin: 1em 10% 0 0;
|
||||
border-top: double 3px #af0000;
|
||||
border-bottom: solid 1px #333333;
|
||||
font-size: 1.5em;
|
||||
color: #333333;
|
||||
}
|
||||
h4 {
|
||||
padding: 0 0 0 10px;
|
||||
margin: 1em 10% 0 1em;
|
||||
border-top: solid 1px #af0000;
|
||||
border-bottom: solid 1px #af0000;
|
||||
font-size: 1.4em;
|
||||
color: #333333;
|
||||
}
|
||||
|
||||
/* total info */
|
||||
.updatedate {
|
||||
text-align: right;
|
||||
}
|
||||
.mainschema {
|
||||
text-align: right;
|
||||
}
|
||||
.navilinkarea {
|
||||
text-align: right;
|
||||
}
|
||||
.sublink {
|
||||
margin-top: 0.1em;
|
||||
}
|
||||
.sisterlink {
|
||||
margin-top: 0.6em;
|
||||
font-size: 120%;
|
||||
}
|
||||
.sistersublink {
|
||||
margin-top: 0.6em;
|
||||
font-size: 85%;
|
||||
}
|
||||
.sisterneighborlink {
|
||||
margin-top: 0.6em;
|
||||
font-size: 100%;
|
||||
}
|
||||
|
||||
/* keyword search */
|
||||
.keywordsearch {
|
||||
padding: 0.7em 0 0.7em 0;
|
||||
}
|
||||
.searchmemo {
|
||||
font-size: 0.9em;
|
||||
color: #114488;
|
||||
}
|
||||
.suggestionarea {
|
||||
padding: 0 0.2em 0.2em 0.2em;
|
||||
margin: 0;
|
||||
position: absolute;
|
||||
zindex: 100;
|
||||
background-color: #DDFFDD;
|
||||
border-width: 1px;
|
||||
border-style: solid;
|
||||
border-color: #CCCCCC;
|
||||
list-style-type: none;
|
||||
}
|
||||
|
||||
/* table */
|
||||
table {
|
||||
border-collapse:collapse;
|
||||
}
|
||||
table, th {
|
||||
border: 1px solid #555;
|
||||
}
|
||||
th {
|
||||
background-color: #cc9;
|
||||
font-size: 0.8em;
|
||||
}
|
||||
td {
|
||||
border-bottom: 1px dotted #aaa;
|
||||
border-left: 1px solid #555;
|
||||
padding:2px;
|
||||
}
|
||||
.tablecomment {
|
||||
font-size: 0.8em;
|
||||
color: #3F7E5E;
|
||||
padding:0 0 0.2em 1em;
|
||||
}
|
||||
.rownumhead {
|
||||
text-align: center;
|
||||
font-size: 0.4em;
|
||||
}
|
||||
.rownumcell {
|
||||
text-align: center;
|
||||
font-size: 0.4em;
|
||||
color: #444;
|
||||
}
|
||||
.schemacell {
|
||||
font-size: 0.8em;
|
||||
white-space: nowrap;
|
||||
}
|
||||
.aliascell {
|
||||
white-space: nowrap;
|
||||
}
|
||||
.flgcell {
|
||||
text-align: center;
|
||||
}
|
||||
.flgplus {
|
||||
font-size: 0.7em;
|
||||
}
|
||||
.typecell {
|
||||
font-size: 0.6em;
|
||||
}
|
||||
.sizecell {
|
||||
text-align: center;
|
||||
font-size: 0.8em;
|
||||
}
|
||||
.defvalcell {
|
||||
text-align: center;
|
||||
font-size: 0.6em;
|
||||
}
|
||||
.relcell {
|
||||
font-size: 0.7em;
|
||||
}
|
||||
.commentcell {
|
||||
font-size: 0.7em;
|
||||
color: #3F7E5E;
|
||||
}
|
||||
.subcell {
|
||||
font-size: 0.6em;
|
||||
}
|
||||
.comcolcell {
|
||||
color: #666;
|
||||
}
|
||||
.optcell {
|
||||
font-style: italic;
|
||||
}
|
||||
.additionalpk {
|
||||
font-style: italic;
|
||||
}
|
||||
.additionalfk {
|
||||
font-style: italic;
|
||||
}
|
||||
.clstypecell {
|
||||
text-align: center;
|
||||
font-size: 0.8em;
|
||||
}
|
||||
.commentdesc {
|
||||
color: #3F7E5E;
|
||||
}
|
||||
|
||||
/* inner table */
|
||||
table.child {
|
||||
margin: 3px;
|
||||
}
|
||||
table.child th {
|
||||
font-size: 0.7em;
|
||||
}
|
||||
table.child, table.child td, table.child th {
|
||||
border-top: none;
|
||||
border-left: none;
|
||||
border-bottom: 1px solid #aaa;
|
||||
border-right: 1px solid #aaa;
|
||||
}
|
||||
.clsgroup {
|
||||
font-size: 1.2em;
|
||||
padding-left: 4px;
|
||||
padding-right: 4px;
|
||||
}
|
||||
|
||||
/* table supplementary info */
|
||||
span.tableschema {
|
||||
font-size: 0.6em;
|
||||
}
|
||||
span.bqpcount {
|
||||
font-size: 0.5em;
|
||||
}
|
||||
dl.bqplist {
|
||||
padding-left: 2em;
|
||||
}
|
||||
dl.bqplist dt {
|
||||
display: list-item;
|
||||
font-size: 1.3em;
|
||||
margin-top: 0.3em;
|
||||
}
|
||||
dl.bqplist dd {
|
||||
padding-left: 1em;
|
||||
}
|
||||
dl.bqplist dd pre {
|
||||
font-size: 1.1em;
|
||||
}
|
||||
dl.bqplist dd.subinfo {
|
||||
padding-left: 2em;
|
||||
}
|
||||
dl.bqplist dd.subinfo span.sqlap {
|
||||
font-style: italic;
|
||||
color: #002266;
|
||||
}
|
||||
dl.bqplist dd.subinfo span.file {
|
||||
font-style: italic;
|
||||
color: #002266;
|
||||
}
|
||||
dl.bqplist dd.subinfo span.ctet {
|
||||
color: green;
|
||||
}
|
||||
dl.bqplist dd.subinfo span.pmb {
|
||||
color: green;
|
||||
}
|
||||
dl.procedurelist {
|
||||
padding-left: 2em;
|
||||
}
|
||||
dl.procedurelist dt {
|
||||
display: list-item;
|
||||
font-size: 1.3em;
|
||||
margin-top: 0.3em;
|
||||
}
|
||||
dl.procedurelist dt span.type {
|
||||
font-size: 0.7em;
|
||||
color: green;
|
||||
}
|
||||
dl.procedurelist dd {
|
||||
padding-left: 1em;
|
||||
}
|
||||
dl.procedurelist dd pre {
|
||||
font-size: 1.1em;
|
||||
}
|
||||
dl.procedurelist dd.column {
|
||||
font-style: italic;
|
||||
padding-left: 2em;
|
||||
}
|
||||
dl.procedurelist dd.column span.attrs {
|
||||
font-size: 0.7em;
|
||||
color: #125699;
|
||||
}
|
||||
dl.procedurelist dd.column span.type {
|
||||
font-size: 0.9em;
|
||||
color: green;
|
||||
}
|
||||
dl.procedurelist dd.column pre {
|
||||
padding-left: 1em;
|
||||
}
|
||||
</style>
|
||||
</head>
|
||||
|
||||
<body>
|
||||
<h1>Schema for fess (h2)</h1>
|
||||
<p class="mainschema">generated from <strong>DUMMYDB.PUBLIC</strong></p>
|
||||
<div class="navilinkarea">
|
||||
<p class="sistersublink"><a href="./properties-fess.html">to PropertiesHTML</a></p>
|
||||
</div>
|
||||
|
||||
<h2>Table List</h2>
|
||||
<div class="keywordsearch">
|
||||
<input type="text" id="incremental-search-field" tabindex=1 value="" placeholder="Table Search" />
|
||||
<ul id="suggestion-list" class="suggestionarea"></ul>
|
||||
<span class="searchmemo">*Push 'tab' (primary tab order)</span>
|
||||
</div>
|
||||
<table>
|
||||
<thead>
|
||||
<tr>
|
||||
<th class="rownumhead">No.</th>
|
||||
<th>Name</th>
|
||||
<th>Type</th>
|
||||
<th>ForeignTable</th>
|
||||
<th>ReferrerTable</th>
|
||||
<th>EntityName</th>
|
||||
</tr>
|
||||
</thead>
|
||||
<tbody id="table-list-body">
|
||||
<tr>
|
||||
<td class="rownumcell">1</td>
|
||||
<td><a href="#dummy_member" title="type=TABLE, primaryKey={MEMBER_ID}, nameLength=12, columnCount=11">DUMMY_MEMBER</a></td>
|
||||
<td class="typecell">TABLE</td>
|
||||
<td class="relcell"> </td>
|
||||
<td class="relcell"> </td>
|
||||
<td class="subcell">DummyMember</td>
|
||||
</tr>
|
||||
</tbody>
|
||||
</table>
|
||||
|
||||
<h2 id="dummy_member" title="type=TABLE, primaryKey={MEMBER_ID}, nameLength=12, columnCount=11">
|
||||
DUMMY_MEMBER
|
||||
</h2>
|
||||
<table>
|
||||
<thead>
|
||||
<tr>
|
||||
<th class="rownumhead">No.</th>
|
||||
<th>PK</th>
|
||||
<th>ID</th>
|
||||
<th>UQ</th>
|
||||
<th>IX</th>
|
||||
<th>Not<br />Null</th>
|
||||
<th>Name</th>
|
||||
<th>Type</th>
|
||||
<th>Size</th>
|
||||
<th>ForeignTable</th>
|
||||
<th>ReferrerTable</th>
|
||||
<th>Classification</th>
|
||||
<th>PropertyName</th>
|
||||
<th>JavaType</th>
|
||||
</tr>
|
||||
</thead>
|
||||
<tr>
|
||||
<td class="rownumcell">1</td>
|
||||
<td class="flgcell" title="CONSTRAINT_D">o</td>
|
||||
<td class="flgcell">o</td>
|
||||
<td class="flgcell"> </td>
|
||||
<td class="flgcell"> </td>
|
||||
<td class="flgcell">*</td>
|
||||
<td id="dummy_member_member_id">MEMBER_ID</td>
|
||||
<td class="typecell">INTEGER</td>
|
||||
<td class="sizecell"> 10 </td>
|
||||
<td class="relcell"> </td>
|
||||
<td class="relcell"> </td>
|
||||
<td class="relcell"> </td>
|
||||
<td class="subcell">memberId</td>
|
||||
<td class="subcell">Integer</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td class="rownumcell">2</td>
|
||||
<td class="flgcell"> </td>
|
||||
<td class="flgcell"> </td>
|
||||
<td class="flgcell"> </td>
|
||||
<td class="flgcell"> </td>
|
||||
<td class="flgcell">*</td>
|
||||
<td id="dummy_member_member_name">MEMBER_NAME</td>
|
||||
<td class="typecell">VARCHAR</td>
|
||||
<td class="sizecell"> 200 </td>
|
||||
<td class="relcell"> </td>
|
||||
<td class="relcell"> </td>
|
||||
<td class="relcell"> </td>
|
||||
<td class="subcell">memberName</td>
|
||||
<td class="subcell">String</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td class="rownumcell">3</td>
|
||||
<td class="flgcell"> </td>
|
||||
<td class="flgcell"> </td>
|
||||
<td class="flgcell"> </td>
|
||||
<td class="flgcell"> </td>
|
||||
<td class="flgcell">*</td>
|
||||
<td id="dummy_member_member_account">MEMBER_ACCOUNT</td>
|
||||
<td class="typecell">VARCHAR</td>
|
||||
<td class="sizecell"> 50 </td>
|
||||
<td class="relcell"> </td>
|
||||
<td class="relcell"> </td>
|
||||
<td class="relcell"> </td>
|
||||
<td class="subcell">memberAccount</td>
|
||||
<td class="subcell">String</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td class="rownumcell">4</td>
|
||||
<td class="flgcell"> </td>
|
||||
<td class="flgcell"> </td>
|
||||
<td class="flgcell"> </td>
|
||||
<td class="flgcell"> </td>
|
||||
<td class="flgcell">*</td>
|
||||
<td id="dummy_member_member_status_code">MEMBER_STATUS_CODE</td>
|
||||
<td class="typecell">CHAR</td>
|
||||
<td class="sizecell"> 3 </td>
|
||||
<td class="relcell"> </td>
|
||||
<td class="relcell"> </td>
|
||||
<td class="relcell"> </td>
|
||||
<td class="subcell">memberStatusCode</td>
|
||||
<td class="subcell">String</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td class="rownumcell">5</td>
|
||||
<td class="flgcell"> </td>
|
||||
<td class="flgcell"> </td>
|
||||
<td class="flgcell"> </td>
|
||||
<td class="flgcell"> </td>
|
||||
<td class="flgcell"> </td>
|
||||
<td id="dummy_member_formalized_datetime">FORMALIZED_DATETIME</td>
|
||||
<td class="typecell">TIMESTAMP</td>
|
||||
<td class="sizecell"> 23, 10 </td>
|
||||
<td class="relcell"> </td>
|
||||
<td class="relcell"> </td>
|
||||
<td class="relcell"> </td>
|
||||
<td class="subcell">formalizedDatetime</td>
|
||||
<td class="subcell">LocalDateTime</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td class="rownumcell">6</td>
|
||||
<td class="flgcell"> </td>
|
||||
<td class="flgcell"> </td>
|
||||
<td class="flgcell"> </td>
|
||||
<td class="flgcell"> </td>
|
||||
<td class="flgcell"> </td>
|
||||
<td id="dummy_member_birthdate">BIRTHDATE</td>
|
||||
<td class="typecell">DATE</td>
|
||||
<td class="sizecell"> 8 </td>
|
||||
<td class="relcell"> </td>
|
||||
<td class="relcell"> </td>
|
||||
<td class="relcell"> </td>
|
||||
<td class="subcell">birthdate</td>
|
||||
<td class="subcell">LocalDate</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td class="rownumcell">7</td>
|
||||
<td class="flgcell"> </td>
|
||||
<td class="flgcell"> </td>
|
||||
<td class="flgcell"> </td>
|
||||
<td class="flgcell"> </td>
|
||||
<td class="flgcell">*</td>
|
||||
<td id="dummy_member_register_datetime">REGISTER_DATETIME</td>
|
||||
<td class="typecell">TIMESTAMP</td>
|
||||
<td class="sizecell"> 23, 10 </td>
|
||||
<td class="relcell"> </td>
|
||||
<td class="relcell"> </td>
|
||||
<td class="relcell"> </td>
|
||||
<td class="subcell">registerDatetime</td>
|
||||
<td class="subcell">LocalDateTime</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td class="rownumcell">8</td>
|
||||
<td class="flgcell"> </td>
|
||||
<td class="flgcell"> </td>
|
||||
<td class="flgcell"> </td>
|
||||
<td class="flgcell"> </td>
|
||||
<td class="flgcell">*</td>
|
||||
<td id="dummy_member_register_user">REGISTER_USER</td>
|
||||
<td class="typecell">VARCHAR</td>
|
||||
<td class="sizecell"> 200 </td>
|
||||
<td class="relcell"> </td>
|
||||
<td class="relcell"> </td>
|
||||
<td class="relcell"> </td>
|
||||
<td class="subcell">registerUser</td>
|
||||
<td class="subcell">String</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td class="rownumcell">9</td>
|
||||
<td class="flgcell"> </td>
|
||||
<td class="flgcell"> </td>
|
||||
<td class="flgcell"> </td>
|
||||
<td class="flgcell"> </td>
|
||||
<td class="flgcell">*</td>
|
||||
<td id="dummy_member_update_datetime">UPDATE_DATETIME</td>
|
||||
<td class="typecell">TIMESTAMP</td>
|
||||
<td class="sizecell"> 23, 10 </td>
|
||||
<td class="relcell"> </td>
|
||||
<td class="relcell"> </td>
|
||||
<td class="relcell"> </td>
|
||||
<td class="subcell">updateDatetime</td>
|
||||
<td class="subcell">LocalDateTime</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td class="rownumcell">10</td>
|
||||
<td class="flgcell"> </td>
|
||||
<td class="flgcell"> </td>
|
||||
<td class="flgcell"> </td>
|
||||
<td class="flgcell"> </td>
|
||||
<td class="flgcell">*</td>
|
||||
<td id="dummy_member_update_user">UPDATE_USER</td>
|
||||
<td class="typecell">VARCHAR</td>
|
||||
<td class="sizecell"> 200 </td>
|
||||
<td class="relcell"> </td>
|
||||
<td class="relcell"> </td>
|
||||
<td class="relcell"> </td>
|
||||
<td class="subcell">updateUser</td>
|
||||
<td class="subcell">String</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td class="rownumcell">11</td>
|
||||
<td class="flgcell"> </td>
|
||||
<td class="flgcell"> </td>
|
||||
<td class="flgcell"> </td>
|
||||
<td class="flgcell"> </td>
|
||||
<td class="flgcell">*</td>
|
||||
<td class="optcell" id="dummy_member_version_no">VERSION_NO</td>
|
||||
<td class="typecell">BIGINT</td>
|
||||
<td class="sizecell"> 19 </td>
|
||||
<td class="relcell"> </td>
|
||||
<td class="relcell"> </td>
|
||||
<td class="relcell"> </td>
|
||||
<td class="subcell">versionNo</td>
|
||||
<td class="subcell">Long</td>
|
||||
</tr>
|
||||
</table>
|
||||
|
||||
|
||||
|
||||
<h2 id="thanks">Thanks</h2>
|
||||
<p>
|
||||
Created by <a href="http://dbflute.org/">DBFlute(AutoGenerator)</a>
|
||||
</p>
|
||||
<script>
|
||||
/**
|
||||
* Incremental Search contributed by makotot (Thanks!)
|
||||
*
|
||||
* and extended by jflute:
|
||||
* o style adjustment
|
||||
* o varying name index
|
||||
* o prefix search priority
|
||||
*/
|
||||
|
||||
// this index value depends on DBFlute settings
|
||||
// so defines it here as global for easy-to-understand
|
||||
var NAME_INDEX = 1; // number, name
|
||||
|
||||
function Incremental (targetInput, dist) {
|
||||
this.targetInput = targetInput;
|
||||
this.dist = dist;
|
||||
this.query = '';
|
||||
this.suggestionIdx = 0;
|
||||
this.currentSuggestion = '';
|
||||
}
|
||||
|
||||
Incremental.prototype = {
|
||||
|
||||
/**
|
||||
* @method init
|
||||
*/
|
||||
init: function () {
|
||||
var dataList = this.getDataList();
|
||||
|
||||
this.distDataList = dataList.distList;
|
||||
this.sectionList = dataList.sectionList;
|
||||
this.buildSuggestList();
|
||||
this.attachEvent();
|
||||
},
|
||||
|
||||
/**
|
||||
* @method buildSuggetList
|
||||
*/
|
||||
buildSuggestList: function () {
|
||||
var fragment = document.createDocumentFragment(),
|
||||
ul = document.getElementById('suggestion-list');
|
||||
|
||||
this.ul = ul;
|
||||
this.setupLinkElement(fragment); // for prefix area
|
||||
this.setupLinkElement(fragment); // for contain area
|
||||
ul.appendChild(fragment);
|
||||
|
||||
this.attachSuggestionEvent();
|
||||
},
|
||||
|
||||
/**
|
||||
* @method setupLinkElement
|
||||
*/
|
||||
setupLinkElement: function (fragment) {
|
||||
var li, anchor;
|
||||
for (var i = 0, max = this.distDataList.length; i < max; i++) {
|
||||
li = document.createElement('li');
|
||||
li.style.display = 'none';
|
||||
anchor = document.createElement('a');
|
||||
anchor.href = this.sectionList[i];
|
||||
|
||||
var distData = this.distDataList[i];
|
||||
if (document.body.dataset) {
|
||||
anchor.dataset.name = distData;
|
||||
} else {
|
||||
anchor.setAttribute('data-name', distData); // for searching
|
||||
}
|
||||
|
||||
this.util.setElemTxt(anchor, distData); // for display
|
||||
|
||||
li.appendChild(anchor);
|
||||
fragment.appendChild(li);
|
||||
}
|
||||
},
|
||||
|
||||
/**
|
||||
* @method attachEvent
|
||||
*/
|
||||
attachEvent: function () {
|
||||
var self = this,
|
||||
eventHandler = function () {
|
||||
self.displaySuggestion();
|
||||
},
|
||||
eventName = ('oninput' in window) ? 'input' : 'propertychange';
|
||||
|
||||
this.util.addEvent(this.targetInput, eventName, eventHandler);
|
||||
},
|
||||
|
||||
/**
|
||||
* @method displaySuggestion
|
||||
*/
|
||||
displaySuggestion: function () {
|
||||
this.query = (this.util.trim(this.targetInput.value)).toLowerCase();
|
||||
|
||||
var i, j, max;
|
||||
|
||||
this.resetSuggestion();
|
||||
|
||||
var visibleList;
|
||||
|
||||
if (this.query.length) {
|
||||
var alreadyCheckedData = {}; // to suppress duplicate check (key only used)
|
||||
var distDataCount = this.distDataList.length; // to determine prefix or contain area
|
||||
var hitCount = 0; // to suppress large result (primitive counter just in case)
|
||||
for (i = 0, max = this.ul.childNodes.length; i < max && hitCount <= 100; i++) {
|
||||
var childNode = this.ul.childNodes[i];
|
||||
var anchor = childNode.getElementsByTagName('a')[0]; // always only one
|
||||
var dataName = anchor.getAttribute('data-name'); // e.g. table name
|
||||
if (alreadyCheckedData[dataName] != null) { // to suppress duplicate check
|
||||
continue;
|
||||
}
|
||||
if (i < distDataCount && dataName.lastIndexOf(this.query, 0) > -1) { // prefix hit
|
||||
childNode.searchDirection = 'prefix';
|
||||
alreadyCheckedData[dataName] = 'dummy';
|
||||
++hitCount;
|
||||
} else if (i >= distDataCount && dataName.indexOf(this.query) > -1) { // contain hit
|
||||
childNode.searchDirection = 'contain';
|
||||
alreadyCheckedData[dataName] = 'dummy';
|
||||
++hitCount;
|
||||
} else {
|
||||
childNode.searchDirection = 'none';
|
||||
}
|
||||
}
|
||||
|
||||
visibleList = this.filterVisibleChild();
|
||||
|
||||
if (visibleList.length) {
|
||||
visibleList[0].style.backgroundColor = '#CCCCCC';
|
||||
}
|
||||
} else {
|
||||
for (i = 0, max = this.ul.childNodes.length; i < max; i++) {
|
||||
var childNode = this.ul.childNodes[i];
|
||||
childNode.searchDirection = null; // clear
|
||||
childNode.style.display = 'none'; // all none
|
||||
}
|
||||
}
|
||||
},
|
||||
|
||||
/**
|
||||
* @method getDataList
|
||||
*/
|
||||
getDataList: function () {
|
||||
var tr = this.dist.getElementsByTagName('tr'),
|
||||
distDataList = [],
|
||||
sectionIdList = [];
|
||||
|
||||
for (var i = 0, max = tr.length; i < max; i++) {
|
||||
distDataList.push(this.util.getElemTxt(tr[i].getElementsByTagName('td')[NAME_INDEX]).toLowerCase());
|
||||
sectionIdList.push(tr[i].getElementsByTagName('td')[NAME_INDEX].getElementsByTagName('a')[0].getAttribute('href'));
|
||||
}
|
||||
|
||||
return {
|
||||
distList: distDataList,
|
||||
sectionList: sectionIdList
|
||||
};
|
||||
},
|
||||
|
||||
/**
|
||||
* @method attachSuggestionEvent
|
||||
*/
|
||||
attachSuggestionEvent: function () {
|
||||
var self = this;
|
||||
|
||||
this.util.addEvent(this.targetInput, 'keyup', function (e) {
|
||||
self.selectSuggestion(e);
|
||||
self.setInputValue(e);
|
||||
});
|
||||
this.util.addEvent(this.targetInput, 'blur', function () {
|
||||
setTimeout(function () {
|
||||
self.resetSuggestion();
|
||||
}, 100);
|
||||
});
|
||||
},
|
||||
|
||||
/**
|
||||
* @method selectSuggestion
|
||||
*/
|
||||
selectSuggestion: function (ev) {
|
||||
var keyCode = ev.keyCode,
|
||||
visibleChildNodes = this.filterVisibleChild(),
|
||||
prevIdx;
|
||||
|
||||
if (keyCode === 38 || keyCode === 40) {
|
||||
|
||||
if (visibleChildNodes.length) {
|
||||
prevIdx = this.suggestionIdx;
|
||||
|
||||
if (keyCode === 40 && this.suggestionIdx < visibleChildNodes.length - 1) {
|
||||
this.suggestionIdx++;
|
||||
}
|
||||
|
||||
if (keyCode === 38 && this.suggestionIdx > 0) {
|
||||
this.suggestionIdx--;
|
||||
}
|
||||
|
||||
if (prevIdx > -1) {
|
||||
visibleChildNodes[prevIdx].style.backgroundColor = '';
|
||||
}
|
||||
|
||||
visibleChildNodes[this.suggestionIdx].style.backgroundColor = '#CCCCCC';
|
||||
this.currentSuggestion = this.util.getElemTxt(visibleChildNodes[this.suggestionIdx]);
|
||||
|
||||
} else if (this.query.length) {
|
||||
|
||||
this.displaySuggestion();
|
||||
}
|
||||
}
|
||||
|
||||
if (!this.query.length) {
|
||||
this.resetSuggestion();
|
||||
}
|
||||
},
|
||||
|
||||
/**
|
||||
* @method setInputValue
|
||||
* @param ev {Object}
|
||||
*/
|
||||
setInputValue: function (ev) {
|
||||
var keyCode = ev.keyCode,
|
||||
visibleChildNodes = this.filterVisibleChild(),
|
||||
currentSuggestionTxt,
|
||||
selectedSection;
|
||||
|
||||
if (visibleChildNodes.length) {
|
||||
currentSuggestionTxt = this.util.getElemTxt(visibleChildNodes[this.suggestionIdx]);
|
||||
|
||||
if (keyCode === 13) {
|
||||
this.targetInput.value = currentSuggestionTxt;
|
||||
selectedSection = this.getSelectedSection(visibleChildNodes[this.suggestionIdx]);
|
||||
this.clearSuggestion();
|
||||
this.scrollToSelectedSection(selectedSection);
|
||||
this.setHash(selectedSection);
|
||||
}
|
||||
}
|
||||
},
|
||||
|
||||
/**
|
||||
* @method filterVisibleChild
|
||||
*/
|
||||
filterVisibleChild: function () {
|
||||
var visibleChildNodes = [];
|
||||
|
||||
// ordered by prefix, contain
|
||||
for (var i = 0, max = this.ul.childNodes.length; i < max; i++) {
|
||||
var childNode = this.ul.childNodes[i];
|
||||
if (childNode.searchDirection === 'prefix') {
|
||||
visibleChildNodes.push(childNode);
|
||||
childNode.style.display = 'block';
|
||||
} else if (childNode.searchDirection === 'contain') {
|
||||
visibleChildNodes.push(childNode);
|
||||
childNode.style.display = 'block';
|
||||
} else {
|
||||
childNode.style.display = 'none';
|
||||
}
|
||||
}
|
||||
|
||||
return visibleChildNodes;
|
||||
},
|
||||
|
||||
/**
|
||||
* @method clearSuggestion
|
||||
*/
|
||||
clearSuggestion: function () {
|
||||
for (var i = 0, max = this.ul.childNodes.length; i < max; i++) {
|
||||
var childNode = this.ul.childNodes[i];
|
||||
childNode.searchDirection = null;
|
||||
childNode.style.display = 'none';
|
||||
childNode.style.backgroundColor = '';
|
||||
}
|
||||
},
|
||||
|
||||
/**
|
||||
* @method resetSuggestion
|
||||
*/
|
||||
resetSuggestion: function () {
|
||||
this.clearSuggestion();
|
||||
|
||||
this.suggestionIdx = 0;
|
||||
},
|
||||
|
||||
/**
|
||||
* @method getSelectedSection
|
||||
* @param suggestionNode {Object}
|
||||
* @return selectedIdx {Number}
|
||||
*/
|
||||
getSelectedSection: function (suggestionNode) {
|
||||
var selectedIdx;
|
||||
|
||||
for (var i = 0, max = this.ul.childNodes.length; i < max; i++) {
|
||||
if (this.ul.childNodes[i] === suggestionNode) {
|
||||
selectedIdx = i;
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
||||
return selectedIdx;
|
||||
},
|
||||
|
||||
/**
|
||||
* @method scrollToSelectedSection
|
||||
* @param idx {Number}
|
||||
*/
|
||||
scrollToSelectedSection: function (idx) {
|
||||
var selectedId = this.ul.childNodes[idx].getElementsByTagName('a')[0].href.split('#')[1],
|
||||
targetSection = document.getElementById(selectedId);
|
||||
|
||||
window.scrollTo(0, targetSection.offsetTop);
|
||||
this.targetInput.blur();
|
||||
},
|
||||
|
||||
/**
|
||||
* @method setHash
|
||||
*/
|
||||
setHash: function (idx) {
|
||||
var selectedId = this.ul.childNodes[idx].getElementsByTagName('a')[0].href.split('#')[1];
|
||||
|
||||
window.location.hash = selectedId;
|
||||
}
|
||||
};
|
||||
|
||||
|
||||
Incremental.prototype.util = {
|
||||
|
||||
addEvent: function (elem, ev, fn) {
|
||||
if (elem.addEventListener) {
|
||||
elem.addEventListener(ev, fn, false);
|
||||
} else if (elem.attachEvent) {
|
||||
elem.attachEvent('on' + ev, fn);
|
||||
} else {
|
||||
elem['on' + ev] = fn;
|
||||
}
|
||||
},
|
||||
|
||||
trim: function (txt) {
|
||||
return (String.prototype.trim) ? txt.trim() : txt.replace(/^\s+|\s+$/g, '');
|
||||
},
|
||||
|
||||
getElemTxt: function (elem) {
|
||||
return (elem.innerText !== undefined) ? elem.innerText : elem.textContent;
|
||||
},
|
||||
|
||||
setElemTxt: function (elem, data) {
|
||||
return (elem.innerText !== undefined) ? (elem.innerText = data) : (elem.textContent = data);
|
||||
}
|
||||
};
|
||||
|
||||
var searcher = new Incremental(document.getElementById('incremental-search-field'), document.getElementById('table-list-body'));
|
||||
searcher.init();
|
||||
</script>
|
||||
</body>
|
||||
</html>
|
21
dbflute_fess/output/lasta/fess-lastadoc.html
Normal file
21
dbflute_fess/output/lasta/fess-lastadoc.html
Normal file
|
@ -0,0 +1,21 @@
|
|||
<!DOCTYPE html>
|
||||
<html>
|
||||
<head>
|
||||
<meta charset="UTF-8" />
|
||||
<title>fess lasta_doc</title>
|
||||
<style type="text/css">
|
||||
* {
|
||||
margin: 0;
|
||||
padding: 0;
|
||||
}
|
||||
body {
|
||||
font-family: Verdana, "Hiragino Kaku Gothic Pro", "ヒラギノ角ゴ Pro W3", Meiryo, "メイリオ", "MS P Gothic", "MS Pゴシック", sans-serif;
|
||||
font-size: 80%;
|
||||
margin: 10px 5px 5px 15px;
|
||||
background-color: #ffffe0;
|
||||
}
|
||||
</style>
|
||||
</head>
|
||||
<body>
|
||||
</body>
|
||||
</html>
|
|
@ -1 +1,14 @@
|
|||
|
||||
|
||||
create table DUMMY_MEMBER(
|
||||
MEMBER_ID INTEGER IDENTITY NOT NULL PRIMARY KEY,
|
||||
MEMBER_NAME VARCHAR(200) NOT NULL,
|
||||
MEMBER_ACCOUNT VARCHAR(50) NOT NULL,
|
||||
MEMBER_STATUS_CODE CHAR(3) NOT NULL,
|
||||
FORMALIZED_DATETIME DATETIME,
|
||||
BIRTHDATE DATE,
|
||||
REGISTER_DATETIME DATETIME NOT NULL,
|
||||
REGISTER_USER VARCHAR(200) NOT NULL,
|
||||
UPDATE_DATETIME DATETIME NOT NULL,
|
||||
UPDATE_USER VARCHAR(200) NOT NULL,
|
||||
VERSION_NO BIGINT NOT NULL
|
||||
);
|
38
dbflute_fess/schema/project-schema-fess.xml
Normal file
38
dbflute_fess/schema/project-schema-fess.xml
Normal file
|
@ -0,0 +1,38 @@
|
|||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<!DOCTYPE database SYSTEM "http://dbflute.org/meta/database.dtd">
|
||||
<!-- Auto-generated by JDBC task! -->
|
||||
<database name="PUBLIC">
|
||||
<table name="DUMMY_MEMBER" schema="DUMMYDB.PUBLIC" type="TABLE">
|
||||
<column autoIncrement="true" comment="" dbType="INTEGER"
|
||||
default="NEXT VALUE FOR PUBLIC.SYSTEM_SEQUENCE_05D1DE4D_7162_4229_BA69_C016D6C8EA5C"
|
||||
javaType="Integer" name="MEMBER_ID" pkName="CONSTRAINT_D"
|
||||
pkPosition="1" primaryKey="true" required="true" size="10" type="INTEGER"/>
|
||||
<column comment="" dbType="VARCHAR" javaType="String"
|
||||
name="MEMBER_NAME" required="true" size="200" type="VARCHAR"/>
|
||||
<column comment="" dbType="VARCHAR" javaType="String"
|
||||
name="MEMBER_ACCOUNT" required="true" size="50" type="VARCHAR"/>
|
||||
<column comment="" dbType="CHAR" javaType="String"
|
||||
name="MEMBER_STATUS_CODE" required="true" size="3" type="CHAR"/>
|
||||
<column comment="" dbType="TIMESTAMP"
|
||||
javaType="java.time.LocalDateTime"
|
||||
name="FORMALIZED_DATETIME" size="23, 10" type="TIMESTAMP"/>
|
||||
<column comment="" dbType="DATE" javaType="java.time.LocalDate"
|
||||
name="BIRTHDATE" size="8" type="DATE"/>
|
||||
<column comment="" dbType="TIMESTAMP"
|
||||
javaType="java.time.LocalDateTime" name="REGISTER_DATETIME"
|
||||
required="true" size="23, 10" type="TIMESTAMP"/>
|
||||
<column comment="" dbType="VARCHAR" javaType="String"
|
||||
name="REGISTER_USER" required="true" size="200" type="VARCHAR"/>
|
||||
<column comment="" dbType="TIMESTAMP"
|
||||
javaType="java.time.LocalDateTime" name="UPDATE_DATETIME"
|
||||
required="true" size="23, 10" type="TIMESTAMP"/>
|
||||
<column comment="" dbType="VARCHAR" javaType="String"
|
||||
name="UPDATE_USER" required="true" size="200" type="VARCHAR"/>
|
||||
<column comment="" dbType="BIGINT" javaType="Long"
|
||||
name="VERSION_NO" required="true" size="19" type="BIGINT"/>
|
||||
</table>
|
||||
<sequenceGroup>
|
||||
<sequence incrementSize="1"
|
||||
name="SYSTEM_SEQUENCE_05D1DE4D_7162_4229_BA69_C016D6C8EA5C" schema="DUMMYDB.PUBLIC"/>
|
||||
</sequenceGroup>
|
||||
</database>
|
8
pom.xml
8
pom.xml
|
@ -39,7 +39,7 @@
|
|||
|
||||
<!-- Main Framework -->
|
||||
<dbflute.version>1.1.0-sp7</dbflute.version>
|
||||
<lastaflute.version>0.6.0-RCV</lastaflute.version>
|
||||
<lastaflute.version>0.6.0-RCW</lastaflute.version>
|
||||
<lasta.taglib.version>0.6.0-RCA</lasta.taglib.version>
|
||||
<servlet.version>3.1.0</servlet.version>
|
||||
<jsp.version>2.3.1</jsp.version>
|
||||
|
@ -520,6 +520,12 @@
|
|||
<version>3.1</version>
|
||||
<scope>test</scope>
|
||||
</dependency>
|
||||
<dependency>
|
||||
<groupId>org.dbflute.jetty</groupId>
|
||||
<artifactId>jetty-boot</artifactId>
|
||||
<version>${jetty.boot.version}</version>
|
||||
<scope>provided</scope>
|
||||
</dependency>
|
||||
<dependency>
|
||||
<groupId>org.eclipse.jetty</groupId> <!-- jetty-all does not contain JSP -->
|
||||
<artifactId>jetty-jsp</artifactId>
|
||||
|
|
1186
src/main/java/org/codelibs/fess/app/web/RootAction.java
Normal file
1186
src/main/java/org/codelibs/fess/app/web/RootAction.java
Normal file
File diff suppressed because it is too large
Load diff
|
@ -1,146 +0,0 @@
|
|||
/*
|
||||
* Copyright 2009-2015 the CodeLibs Project and the Others.
|
||||
*
|
||||
* Licensed under the Apache License, Version 2.0 (the "License");
|
||||
* you may not use this file except in compliance with the License.
|
||||
* You may obtain a copy of the License at
|
||||
*
|
||||
* http://www.apache.org/licenses/LICENSE-2.0
|
||||
*
|
||||
* Unless required by applicable law or agreed to in writing, software
|
||||
* distributed under the License is distributed on an "AS IS" BASIS,
|
||||
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND,
|
||||
* either express or implied. See the License for the specific language
|
||||
* governing permissions and limitations under the License.
|
||||
*/
|
||||
package org.codelibs.fess.lasta.core.direction;
|
||||
|
||||
/**
|
||||
* @author FreeGen
|
||||
*/
|
||||
public interface FessConfig extends FessEnv {
|
||||
|
||||
/** The key of the configuration. e.g. Fess */
|
||||
String DOMAIN_TITLE = "domain.title";
|
||||
|
||||
/** The key of the configuration. e.g. / */
|
||||
String COOKIE_DEFAULT_PATH = "cookie.default.path";
|
||||
|
||||
/** The key of the configuration. e.g. 31556926 */
|
||||
String COOKIE_DEFAULT_EXPIRE = "cookie.default.expire";
|
||||
|
||||
/** The key of the configuration. e.g. 315360000 */
|
||||
String COOKIE_ETERNAL_EXPIRE = "cookie.eternal.expire";
|
||||
|
||||
/**
|
||||
* Get the value of property as {@link String}.
|
||||
* @param propertyKey The key of the property. (NotNull)
|
||||
* @return The value of found property. (NullAllowed: if null, not found)
|
||||
*/
|
||||
@Override
|
||||
String get(String propertyKey);
|
||||
|
||||
/**
|
||||
* Is the property true?
|
||||
* @param propertyKey The key of the property which is boolean type. (NotNull)
|
||||
* @return The determination, true or false. (if the property can be true, returns true)
|
||||
*/
|
||||
@Override
|
||||
boolean is(String propertyKey);
|
||||
|
||||
/**
|
||||
* Get the value for the key 'domain.title'. <br />
|
||||
* The value is, e.g. Fess <br />
|
||||
* comment: The title of domain the application for logging
|
||||
* @return The value of found property. (NullAllowed: if null, not found)
|
||||
*/
|
||||
String getDomainTitle();
|
||||
|
||||
/**
|
||||
* Get the value for the key 'cookie.default.path'. <br />
|
||||
* The value is, e.g. / <br />
|
||||
* comment: The default path of cookie (basically '/' if no context path)
|
||||
* @return The value of found property. (NullAllowed: if null, not found)
|
||||
*/
|
||||
String getCookieDefaultPath();
|
||||
|
||||
/**
|
||||
* Get the value for the key 'cookie.default.expire'. <br />
|
||||
* The value is, e.g. 31556926 <br />
|
||||
* comment: The default expire of cookie in seconds e.g. 31556926: one year, 86400: one day
|
||||
* @return The value of found property. (NullAllowed: if null, not found)
|
||||
*/
|
||||
String getCookieDefaultExpire();
|
||||
|
||||
/**
|
||||
* Get the value for the key 'cookie.default.expire' as {@link Integer}. <br />
|
||||
* The value is, e.g. 31556926 <br />
|
||||
* comment: The default expire of cookie in seconds e.g. 31556926: one year, 86400: one day
|
||||
* @return The value of found property. (NullAllowed: if null, not found)
|
||||
* @throws NumberFormatException When the property is not integer.
|
||||
*/
|
||||
Integer getCookieDefaultExpireAsInteger();
|
||||
|
||||
/**
|
||||
* Get the value for the key 'cookie.eternal.expire'. <br />
|
||||
* The value is, e.g. 315360000 <br />
|
||||
* comment: The eternal expire of cookie in seconds e.g. 315360000: ten year, 86400: one day
|
||||
* @return The value of found property. (NullAllowed: if null, not found)
|
||||
*/
|
||||
String getCookieEternalExpire();
|
||||
|
||||
/**
|
||||
* Get the value for the key 'cookie.eternal.expire' as {@link Integer}. <br />
|
||||
* The value is, e.g. 315360000 <br />
|
||||
* comment: The eternal expire of cookie in seconds e.g. 315360000: ten year, 86400: one day
|
||||
* @return The value of found property. (NullAllowed: if null, not found)
|
||||
* @throws NumberFormatException When the property is not integer.
|
||||
*/
|
||||
Integer getCookieEternalExpireAsInteger();
|
||||
|
||||
/**
|
||||
* The simple implementation for configuration.
|
||||
* @author FreeGen
|
||||
*/
|
||||
public static class SimpleImpl extends FessEnv.SimpleImpl implements FessConfig {
|
||||
|
||||
/** The serial version UID for object serialization. (Default) */
|
||||
private static final long serialVersionUID = 1L;
|
||||
|
||||
/** {@inheritDoc} */
|
||||
@Override
|
||||
public String getDomainTitle() {
|
||||
return get(FessConfig.DOMAIN_TITLE);
|
||||
}
|
||||
|
||||
/** {@inheritDoc} */
|
||||
@Override
|
||||
public String getCookieDefaultPath() {
|
||||
return get(FessConfig.COOKIE_DEFAULT_PATH);
|
||||
}
|
||||
|
||||
/** {@inheritDoc} */
|
||||
@Override
|
||||
public String getCookieDefaultExpire() {
|
||||
return get(FessConfig.COOKIE_DEFAULT_EXPIRE);
|
||||
}
|
||||
|
||||
/** {@inheritDoc} */
|
||||
@Override
|
||||
public Integer getCookieDefaultExpireAsInteger() {
|
||||
return getAsInteger(FessConfig.COOKIE_DEFAULT_EXPIRE);
|
||||
}
|
||||
|
||||
/** {@inheritDoc} */
|
||||
@Override
|
||||
public String getCookieEternalExpire() {
|
||||
return get(FessConfig.COOKIE_ETERNAL_EXPIRE);
|
||||
}
|
||||
|
||||
/** {@inheritDoc} */
|
||||
@Override
|
||||
public Integer getCookieEternalExpireAsInteger() {
|
||||
return getAsInteger(FessConfig.COOKIE_ETERNAL_EXPIRE);
|
||||
}
|
||||
}
|
||||
}
|
|
@ -1,290 +0,0 @@
|
|||
/*
|
||||
* Copyright 2009-2015 the CodeLibs Project and the Others.
|
||||
*
|
||||
* Licensed under the Apache License, Version 2.0 (the "License");
|
||||
* you may not use this file except in compliance with the License.
|
||||
* You may obtain a copy of the License at
|
||||
*
|
||||
* http://www.apache.org/licenses/LICENSE-2.0
|
||||
*
|
||||
* Unless required by applicable law or agreed to in writing, software
|
||||
* distributed under the License is distributed on an "AS IS" BASIS,
|
||||
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND,
|
||||
* either express or implied. See the License for the specific language
|
||||
* governing permissions and limitations under the License.
|
||||
*/
|
||||
package org.codelibs.fess.lasta.core.direction;
|
||||
|
||||
import org.lastaflute.core.direction.ObjectiveConfig;
|
||||
|
||||
/**
|
||||
* @author FreeGen
|
||||
*/
|
||||
public interface FessEnv {
|
||||
|
||||
/** The key of the configuration. e.g. true */
|
||||
String DEVELOPMENT_HERE = "development.here";
|
||||
|
||||
/** The key of the configuration. e.g. Local Development */
|
||||
String ENVIRONMENT_TITLE = "environment.title";
|
||||
|
||||
/** The key of the configuration. e.g. false */
|
||||
String FRAMEWORK_DEBUG = "framework.debug";
|
||||
|
||||
/** The key of the configuration. e.g. 0 */
|
||||
String TIME_ADJUST_TIME_MILLIS = "time.adjust.time.millis";
|
||||
|
||||
/** The key of the configuration. e.g. true */
|
||||
String MAIL_SEND_MOCK = "mail.send.mock";
|
||||
|
||||
/** The key of the configuration. e.g. localhost:25 */
|
||||
String MAIL_SMTP_SERVER_DEFAULT_HOST_AND_PORT = "mail.smtp.server.default.host.and.port";
|
||||
|
||||
/** The key of the configuration. e.g. jdbc:mysql://localhost:3306/maihamadb */
|
||||
String JDBC_URL = "jdbc.url";
|
||||
|
||||
/** The key of the configuration. e.g. maihamauser */
|
||||
String JDBC_USER = "jdbc.user";
|
||||
|
||||
/** The key of the configuration. e.g. maihamaword */
|
||||
String JDBC_PASSWORD = "jdbc.password";
|
||||
|
||||
/** The key of the configuration. e.g. 10 */
|
||||
String JDBC_CONNECTION_POOLING_SIZE = "jdbc.connection.pooling.size";
|
||||
|
||||
/**
|
||||
* Get the value of property as {@link String}.
|
||||
* @param propertyKey The key of the property. (NotNull)
|
||||
* @return The value of found property. (NullAllowed: if null, not found)
|
||||
*/
|
||||
String get(String propertyKey);
|
||||
|
||||
/**
|
||||
* Is the property true?
|
||||
* @param propertyKey The key of the property which is boolean type. (NotNull)
|
||||
* @return The determination, true or false. (if the property can be true, returns true)
|
||||
*/
|
||||
boolean is(String propertyKey);
|
||||
|
||||
/**
|
||||
* Get the value for the key 'development.here'. <br />
|
||||
* The value is, e.g. true <br />
|
||||
* comment: Is development environment here? (used for various purpose, you should set false if unknown)
|
||||
* @return The value of found property. (NullAllowed: if null, not found)
|
||||
*/
|
||||
String getDevelopmentHere();
|
||||
|
||||
/**
|
||||
* Is the property for the key 'development.here' true? <br />
|
||||
* The value is, e.g. true <br />
|
||||
* comment: Is development environment here? (used for various purpose, you should set false if unknown)
|
||||
* @return The determination, true or false. (if the property can be true, returns true)
|
||||
*/
|
||||
boolean isDevelopmentHere();
|
||||
|
||||
/**
|
||||
* Get the value for the key 'environment.title'. <br />
|
||||
* The value is, e.g. Local Development <br />
|
||||
* comment: The title of environment (e.g. local or integartion or production)
|
||||
* @return The value of found property. (NullAllowed: if null, not found)
|
||||
*/
|
||||
String getEnvironmentTitle();
|
||||
|
||||
/**
|
||||
* Get the value for the key 'framework.debug'. <br />
|
||||
* The value is, e.g. false <br />
|
||||
* comment: Does it enable the Framework internal debug? (true only when emergency)
|
||||
* @return The value of found property. (NullAllowed: if null, not found)
|
||||
*/
|
||||
String getFrameworkDebug();
|
||||
|
||||
/**
|
||||
* Is the property for the key 'framework.debug' true? <br />
|
||||
* The value is, e.g. false <br />
|
||||
* comment: Does it enable the Framework internal debug? (true only when emergency)
|
||||
* @return The determination, true or false. (if the property can be true, returns true)
|
||||
*/
|
||||
boolean isFrameworkDebug();
|
||||
|
||||
/**
|
||||
* Get the value for the key 'time.adjust.time.millis'. <br />
|
||||
* The value is, e.g. 0 <br />
|
||||
* comment: The milliseconds for (relative or absolute) adjust time (set only when test) @LongType *dynamic in development
|
||||
* @return The value of found property. (NullAllowed: if null, not found)
|
||||
*/
|
||||
String getTimeAdjustTimeMillis();
|
||||
|
||||
/**
|
||||
* Get the value for the key 'time.adjust.time.millis' as {@link Long}. <br />
|
||||
* The value is, e.g. 0 <br />
|
||||
* comment: The milliseconds for (relative or absolute) adjust time (set only when test) @LongType *dynamic in development
|
||||
* @return The value of found property. (NullAllowed: if null, not found)
|
||||
* @throws NumberFormatException When the property is not long.
|
||||
*/
|
||||
Long getTimeAdjustTimeMillisAsLong();
|
||||
|
||||
/**
|
||||
* Get the value for the key 'mail.send.mock'. <br />
|
||||
* The value is, e.g. true <br />
|
||||
* comment: Does it send mock mail? (true: no send actually, logging only)
|
||||
* @return The value of found property. (NullAllowed: if null, not found)
|
||||
*/
|
||||
String getMailSendMock();
|
||||
|
||||
/**
|
||||
* Is the property for the key 'mail.send.mock' true? <br />
|
||||
* The value is, e.g. true <br />
|
||||
* comment: Does it send mock mail? (true: no send actually, logging only)
|
||||
* @return The determination, true or false. (if the property can be true, returns true)
|
||||
*/
|
||||
boolean isMailSendMock();
|
||||
|
||||
/**
|
||||
* Get the value for the key 'mail.smtp.server.default.host.and.port'. <br />
|
||||
* The value is, e.g. localhost:25 <br />
|
||||
* comment: SMTP server settings for default: host:port
|
||||
* @return The value of found property. (NullAllowed: if null, not found)
|
||||
*/
|
||||
String getMailSmtpServerDefaultHostAndPort();
|
||||
|
||||
/**
|
||||
* Get the value for the key 'jdbc.url'. <br />
|
||||
* The value is, e.g. jdbc:mysql://localhost:3306/maihamadb <br />
|
||||
* comment: The URL of database connection for JDBC
|
||||
* @return The value of found property. (NullAllowed: if null, not found)
|
||||
*/
|
||||
String getJdbcUrl();
|
||||
|
||||
/**
|
||||
* Get the value for the key 'jdbc.user'. <br />
|
||||
* The value is, e.g. maihamauser <br />
|
||||
* comment: The user of database connection for JDBC
|
||||
* @return The value of found property. (NullAllowed: if null, not found)
|
||||
*/
|
||||
String getJdbcUser();
|
||||
|
||||
/**
|
||||
* Get the value for the key 'jdbc.password'. <br />
|
||||
* The value is, e.g. maihamaword <br />
|
||||
* comment: @Secure The password of database connection for JDBC
|
||||
* @return The value of found property. (NullAllowed: if null, not found)
|
||||
*/
|
||||
String getJdbcPassword();
|
||||
|
||||
/**
|
||||
* Get the value for the key 'jdbc.connection.pooling.size'. <br />
|
||||
* The value is, e.g. 10 <br />
|
||||
* comment: The (max) pooling size of Seasar's connection pool
|
||||
* @return The value of found property. (NullAllowed: if null, not found)
|
||||
*/
|
||||
String getJdbcConnectionPoolingSize();
|
||||
|
||||
/**
|
||||
* Get the value for the key 'jdbc.connection.pooling.size' as {@link Integer}. <br />
|
||||
* The value is, e.g. 10 <br />
|
||||
* comment: The (max) pooling size of Seasar's connection pool
|
||||
* @return The value of found property. (NullAllowed: if null, not found)
|
||||
* @throws NumberFormatException When the property is not integer.
|
||||
*/
|
||||
Integer getJdbcConnectionPoolingSizeAsInteger();
|
||||
|
||||
/**
|
||||
* The simple implementation for configuration.
|
||||
* @author FreeGen
|
||||
*/
|
||||
public static class SimpleImpl extends ObjectiveConfig implements FessEnv {
|
||||
|
||||
/** The serial version UID for object serialization. (Default) */
|
||||
private static final long serialVersionUID = 1L;
|
||||
|
||||
/** {@inheritDoc} */
|
||||
@Override
|
||||
public String getDevelopmentHere() {
|
||||
return get(FessEnv.DEVELOPMENT_HERE);
|
||||
}
|
||||
|
||||
/** {@inheritDoc} */
|
||||
@Override
|
||||
public boolean isDevelopmentHere() {
|
||||
return is(FessEnv.DEVELOPMENT_HERE);
|
||||
}
|
||||
|
||||
/** {@inheritDoc} */
|
||||
@Override
|
||||
public String getEnvironmentTitle() {
|
||||
return get(FessEnv.ENVIRONMENT_TITLE);
|
||||
}
|
||||
|
||||
/** {@inheritDoc} */
|
||||
@Override
|
||||
public String getFrameworkDebug() {
|
||||
return get(FessEnv.FRAMEWORK_DEBUG);
|
||||
}
|
||||
|
||||
/** {@inheritDoc} */
|
||||
@Override
|
||||
public boolean isFrameworkDebug() {
|
||||
return is(FessEnv.FRAMEWORK_DEBUG);
|
||||
}
|
||||
|
||||
/** {@inheritDoc} */
|
||||
@Override
|
||||
public String getTimeAdjustTimeMillis() {
|
||||
return get(FessEnv.TIME_ADJUST_TIME_MILLIS);
|
||||
}
|
||||
|
||||
/** {@inheritDoc} */
|
||||
@Override
|
||||
public Long getTimeAdjustTimeMillisAsLong() {
|
||||
return getAsLong(FessEnv.TIME_ADJUST_TIME_MILLIS);
|
||||
}
|
||||
|
||||
/** {@inheritDoc} */
|
||||
@Override
|
||||
public String getMailSendMock() {
|
||||
return get(FessEnv.MAIL_SEND_MOCK);
|
||||
}
|
||||
|
||||
/** {@inheritDoc} */
|
||||
@Override
|
||||
public boolean isMailSendMock() {
|
||||
return is(FessEnv.MAIL_SEND_MOCK);
|
||||
}
|
||||
|
||||
/** {@inheritDoc} */
|
||||
@Override
|
||||
public String getMailSmtpServerDefaultHostAndPort() {
|
||||
return get(FessEnv.MAIL_SMTP_SERVER_DEFAULT_HOST_AND_PORT);
|
||||
}
|
||||
|
||||
/** {@inheritDoc} */
|
||||
@Override
|
||||
public String getJdbcUrl() {
|
||||
return get(FessEnv.JDBC_URL);
|
||||
}
|
||||
|
||||
/** {@inheritDoc} */
|
||||
@Override
|
||||
public String getJdbcUser() {
|
||||
return get(FessEnv.JDBC_USER);
|
||||
}
|
||||
|
||||
/** {@inheritDoc} */
|
||||
@Override
|
||||
public String getJdbcPassword() {
|
||||
return get(FessEnv.JDBC_PASSWORD);
|
||||
}
|
||||
|
||||
/** {@inheritDoc} */
|
||||
@Override
|
||||
public String getJdbcConnectionPoolingSize() {
|
||||
return get(FessEnv.JDBC_CONNECTION_POOLING_SIZE);
|
||||
}
|
||||
|
||||
/** {@inheritDoc} */
|
||||
@Override
|
||||
public Integer getJdbcConnectionPoolingSizeAsInteger() {
|
||||
return getAsInteger(FessEnv.JDBC_CONNECTION_POOLING_SIZE);
|
||||
}
|
||||
}
|
||||
}
|
|
@ -1,252 +0,0 @@
|
|||
/*
|
||||
* Copyright 2009-2015 the CodeLibs Project and the Others.
|
||||
*
|
||||
* Licensed under the Apache License, Version 2.0 (the "License");
|
||||
* you may not use this file except in compliance with the License.
|
||||
* You may obtain a copy of the License at
|
||||
*
|
||||
* http://www.apache.org/licenses/LICENSE-2.0
|
||||
*
|
||||
* Unless required by applicable law or agreed to in writing, software
|
||||
* distributed under the License is distributed on an "AS IS" BASIS,
|
||||
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND,
|
||||
* either express or implied. See the License for the specific language
|
||||
* governing permissions and limitations under the License.
|
||||
*/
|
||||
package org.codelibs.fess.lasta.core.direction;
|
||||
|
||||
import java.util.TimeZone;
|
||||
|
||||
import javax.annotation.Resource;
|
||||
|
||||
import org.codelibs.fess.lasta.core.direction.sponsor.FessActionAdjustmentProvider;
|
||||
import org.codelibs.fess.lasta.core.direction.sponsor.FessTimeResourceProvider;
|
||||
import org.codelibs.fess.lasta.core.direction.sponsor.FessUserLocaleProcessProvider;
|
||||
import org.codelibs.fess.lasta.core.direction.sponsor.FessUserTimeZoneProcessProvider;
|
||||
import org.dbflute.system.DBFluteSystem;
|
||||
import org.dbflute.system.provider.DfFinalTimeZoneProvider;
|
||||
import org.dbflute.util.DfTypeUtil;
|
||||
import org.lastaflute.core.direction.CachedFwAssistantDirector;
|
||||
import org.lastaflute.web.servlet.cookie.CookieResourceProvider;
|
||||
|
||||
/**
|
||||
* @author jflute
|
||||
*/
|
||||
public class FessFwAssistantDirector extends CachedFwAssistantDirector {
|
||||
|
||||
// ===================================================================================
|
||||
// Definition
|
||||
// ==========
|
||||
public static final String FESS_CONFIG_FILE = "fess_config.properties";
|
||||
|
||||
public static final String FESS_ENV_FILE = "fess_env.properties";
|
||||
|
||||
// ===================================================================================
|
||||
// Attribute
|
||||
// =========
|
||||
@Resource
|
||||
protected FessConfig fessConfig;
|
||||
|
||||
// ===================================================================================
|
||||
// Assist
|
||||
// ======
|
||||
@Override
|
||||
protected OptionalAssistDirection prepareOptionalAssistDirection() {
|
||||
final OptionalAssistDirection direction = new OptionalAssistDirection();
|
||||
prepareConfiguration(direction);
|
||||
return direction;
|
||||
}
|
||||
|
||||
protected void prepareConfiguration(OptionalAssistDirection direction) {
|
||||
direction.directConfiguration(getDomainConfigFile(), getExtendsConfigFiles());
|
||||
}
|
||||
|
||||
protected String getDomainConfigFile() {
|
||||
return FESS_CONFIG_FILE;
|
||||
}
|
||||
|
||||
protected String[] getExtendsConfigFiles() {
|
||||
return new String[] { FESS_ENV_FILE };
|
||||
}
|
||||
|
||||
// ===================================================================================
|
||||
// Core
|
||||
// ====
|
||||
@Override
|
||||
protected OptionalCoreDirection prepareOptionalCoreDirection() {
|
||||
final OptionalCoreDirection direction = new OptionalCoreDirection();
|
||||
prepareFramework(direction);
|
||||
prepareSecurity(direction);
|
||||
prepareTime(direction);
|
||||
return direction;
|
||||
}
|
||||
|
||||
// -----------------------------------------------------
|
||||
// Framework
|
||||
// ---------
|
||||
protected void prepareFramework(OptionalCoreDirection direction) {
|
||||
// this configuration is on fess_env.properties
|
||||
// because this is true only when development
|
||||
direction.directDevelopmentHere(fessConfig.isDevelopmentHere());
|
||||
|
||||
// titles are from configurations
|
||||
direction.directLoggingTitle(fessConfig.getDomainTitle(), fessConfig.getEnvironmentTitle());
|
||||
|
||||
// this configuration is on sea_env.properties
|
||||
// because it has no influence to production
|
||||
// even if you set true manually and forget to set false back
|
||||
direction.directFrameworkDebug(fessConfig.isFrameworkDebug()); // basically false
|
||||
|
||||
// you can add your own process when your application is booting
|
||||
direction.directBootProcessCallback(assistantDirector -> processDBFluteSystem());
|
||||
}
|
||||
|
||||
protected void processDBFluteSystem() {
|
||||
DBFluteSystem.unlock();
|
||||
DBFluteSystem.setFinalTimeZoneProvider(new DfFinalTimeZoneProvider() {
|
||||
protected final TimeZone provided = FessUserTimeZoneProcessProvider.centralTimeZone;
|
||||
|
||||
@Override
|
||||
public TimeZone provide() {
|
||||
return provided;
|
||||
}
|
||||
|
||||
@Override
|
||||
public String toString() {
|
||||
return DfTypeUtil.toClassTitle(this) + ":{" + provided.getID() + "}";
|
||||
}
|
||||
});
|
||||
DBFluteSystem.lock();
|
||||
}
|
||||
|
||||
// -----------------------------------------------------
|
||||
// Security
|
||||
// --------
|
||||
protected void prepareSecurity(OptionalCoreDirection direction) {
|
||||
final String key = getPrimarySecurityWord();
|
||||
final InvertibleCipher primaryInvertibleCipher = InvertibleCipher.createAesCipher(key); // AES for now
|
||||
direction.directSecurity(() -> primaryInvertibleCipher);
|
||||
}
|
||||
|
||||
protected String getPrimarySecurityWord() {
|
||||
return "fess:fess"; // hard coding for now
|
||||
}
|
||||
|
||||
// -----------------------------------------------------
|
||||
// Time
|
||||
// ----
|
||||
protected void prepareTime(OptionalCoreDirection direction) {
|
||||
direction.directTime(createTimeResourceProvider());
|
||||
}
|
||||
|
||||
protected FessTimeResourceProvider createTimeResourceProvider() {
|
||||
return new FessTimeResourceProvider(fessConfig);
|
||||
}
|
||||
|
||||
// ===================================================================================
|
||||
// DB
|
||||
// ==
|
||||
@Override
|
||||
protected OptionalDBFluteDirection prepareOptionalDBFluteDirection() {
|
||||
final OptionalDBFluteDirection direction = new OptionalDBFluteDirection();
|
||||
return direction;
|
||||
}
|
||||
|
||||
// ===================================================================================
|
||||
// Web
|
||||
// ===
|
||||
// -----------------------------------------------------
|
||||
// Action
|
||||
// ------
|
||||
@Override
|
||||
protected OptionalActionDirection prepareOptionalActionDirection() {
|
||||
final OptionalActionDirection direction = new OptionalActionDirection();
|
||||
prepareAdjustment(direction);
|
||||
prepareMessage(direction);
|
||||
return direction;
|
||||
}
|
||||
|
||||
protected void prepareAdjustment(OptionalActionDirection direction) {
|
||||
direction.directAdjustment(createActionAdjustmentProvider());
|
||||
}
|
||||
|
||||
protected FessActionAdjustmentProvider createActionAdjustmentProvider() {
|
||||
return new FessActionAdjustmentProvider();
|
||||
}
|
||||
|
||||
protected void prepareMessage(OptionalActionDirection direction) {
|
||||
direction.directMessage(getDomainMessageName(), getExtendsMessageNames());
|
||||
}
|
||||
|
||||
protected String getDomainMessageName() {
|
||||
return "fess_message";
|
||||
}
|
||||
|
||||
protected String[] getExtendsMessageNames() {
|
||||
return new String[] {};
|
||||
}
|
||||
|
||||
// -----------------------------------------------------
|
||||
// Servlet
|
||||
// -------
|
||||
@Override
|
||||
protected OptionalServletDirection prepareOptionalServletDirection() {
|
||||
final OptionalServletDirection direction = new OptionalServletDirection();
|
||||
prepareRequest(direction);
|
||||
prepareCookie(direction);
|
||||
return direction;
|
||||
}
|
||||
|
||||
protected OptionalServletDirection prepareRequest(OptionalServletDirection direction) {
|
||||
direction.directRequest(createUserLocaleProcessProvider(), createUserTimeZoneProcessProvider());
|
||||
return direction;
|
||||
}
|
||||
|
||||
protected FessUserLocaleProcessProvider createUserLocaleProcessProvider() {
|
||||
return new FessUserLocaleProcessProvider();
|
||||
}
|
||||
|
||||
protected FessUserTimeZoneProcessProvider createUserTimeZoneProcessProvider() {
|
||||
return new FessUserTimeZoneProcessProvider();
|
||||
}
|
||||
|
||||
protected void prepareCookie(OptionalServletDirection direction) {
|
||||
final String key = getCookieSecurityWord();
|
||||
final String cookieDefaultPath = fessConfig.getCookieDefaultPath();
|
||||
final Integer cookieDefaultExpire = fessConfig.getCookieDefaultExpireAsInteger();
|
||||
final InvertibleCipher cookieCipher = InvertibleCipher.createAesCipher(key); // AES for now
|
||||
direction.directCookie(new CookieResourceProvider() {
|
||||
@Override
|
||||
public String provideDefaultPath() {
|
||||
return cookieDefaultPath;
|
||||
}
|
||||
|
||||
@Override
|
||||
public Integer provideDefaultExpire() {
|
||||
return cookieDefaultExpire;
|
||||
}
|
||||
|
||||
@Override
|
||||
public InvertibleCipher provideCipher() {
|
||||
return cookieCipher;
|
||||
}
|
||||
|
||||
@Override
|
||||
public String toString() {
|
||||
return "{" + cookieDefaultPath + ", " + cookieDefaultExpire + "}";
|
||||
}
|
||||
});
|
||||
}
|
||||
|
||||
protected String getCookieSecurityWord() {
|
||||
return "fess:fess"; // hard coding for now
|
||||
}
|
||||
|
||||
// -----------------------------------------------------
|
||||
// Task
|
||||
// ----
|
||||
@Override
|
||||
protected OptionalTaskDirection prepareOptionalTaskDirection() {
|
||||
return new OptionalTaskDirection();
|
||||
}
|
||||
}
|
|
@ -1,71 +0,0 @@
|
|||
/*
|
||||
* Copyright 2009-2015 the CodeLibs Project and the Others.
|
||||
*
|
||||
* Licensed under the Apache License, Version 2.0 (the "License");
|
||||
* you may not use this file except in compliance with the License.
|
||||
* You may obtain a copy of the License at
|
||||
*
|
||||
* http://www.apache.org/licenses/LICENSE-2.0
|
||||
*
|
||||
* Unless required by applicable law or agreed to in writing, software
|
||||
* distributed under the License is distributed on an "AS IS" BASIS,
|
||||
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND,
|
||||
* either express or implied. See the License for the specific language
|
||||
* governing permissions and limitations under the License.
|
||||
*/
|
||||
package org.codelibs.fess.lasta.core.direction.sponsor;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
import javax.servlet.http.HttpServletRequest;
|
||||
|
||||
import org.dbflute.util.DfTypeUtil;
|
||||
import org.lastaflute.web.path.ActionAdjustmentProvider;
|
||||
|
||||
/**
|
||||
* @author jflute
|
||||
*/
|
||||
public class FessActionAdjustmentProvider implements ActionAdjustmentProvider {
|
||||
|
||||
private static final int INDEXED_PROPERTY_SIZE_LIMIT = 200; // hard coding for now
|
||||
|
||||
@Override
|
||||
public int provideIndexedPropertySizeLimit() {
|
||||
return INDEXED_PROPERTY_SIZE_LIMIT;
|
||||
}
|
||||
|
||||
@Override
|
||||
public String decodeUrlParameterPropertyValue(Object bean, String name, String value) {
|
||||
return null;
|
||||
}
|
||||
|
||||
@Override
|
||||
public String filterJspPath(String path, ActionMappingWrapper actionMappingWrapper) {
|
||||
return null;
|
||||
}
|
||||
|
||||
@Override
|
||||
public List<String> prepareJspRetryWordList(String requestPath, List<String> wordList) {
|
||||
return null;
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean isForcedRoutingTarget(HttpServletRequest request, String requestPath) {
|
||||
return false;
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean isForcedSuppressRedirectWithSlash(HttpServletRequest request, String requestPath, S2ExecuteConfig executeConfig) {
|
||||
return false;
|
||||
}
|
||||
|
||||
@Override
|
||||
public String customizeActionMappingRequestPath(String requestPath) {
|
||||
return null;
|
||||
}
|
||||
|
||||
@Override
|
||||
public String toString() {
|
||||
return DfTypeUtil.toClassTitle(this) + ":{indexedLimit=" + INDEXED_PROPERTY_SIZE_LIMIT + "}";
|
||||
}
|
||||
}
|
|
@ -1,96 +0,0 @@
|
|||
/*
|
||||
* Copyright 2009-2015 the CodeLibs Project and the Others.
|
||||
*
|
||||
* Licensed under the Apache License, Version 2.0 (the "License");
|
||||
* you may not use this file except in compliance with the License.
|
||||
* You may obtain a copy of the License at
|
||||
*
|
||||
* http://www.apache.org/licenses/LICENSE-2.0
|
||||
*
|
||||
* Unless required by applicable law or agreed to in writing, software
|
||||
* distributed under the License is distributed on an "AS IS" BASIS,
|
||||
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND,
|
||||
* either express or implied. See the License for the specific language
|
||||
* governing permissions and limitations under the License.
|
||||
*/
|
||||
package org.codelibs.fess.lasta.core.direction.sponsor;
|
||||
|
||||
import java.util.Date;
|
||||
|
||||
import org.codelibs.fess.lasta.core.direction.FessConfig;
|
||||
import org.lastaflute.core.time.BusinessTimeHandler;
|
||||
import org.lastaflute.core.time.RelativeDateScript;
|
||||
import org.lastaflute.core.time.TimeManager;
|
||||
import org.lastaflute.core.time.TimeResourceProvider;
|
||||
import org.lastaflute.core.time.TypicalBusinessTimeHandler;
|
||||
|
||||
/**
|
||||
* @author jflute
|
||||
*/
|
||||
public class FessTimeResourceProvider implements TimeResourceProvider {
|
||||
|
||||
// ===================================================================================
|
||||
// Attribute
|
||||
// =========
|
||||
protected final FessConfig maihamaConfig;
|
||||
|
||||
protected final RelativeDateScript script = new RelativeDateScript();
|
||||
|
||||
// ===================================================================================
|
||||
// Constructor
|
||||
// ===========
|
||||
public FessTimeResourceProvider(FessConfig maihamaConfig) {
|
||||
this.maihamaConfig = maihamaConfig;
|
||||
}
|
||||
|
||||
// ===================================================================================
|
||||
// Basic Handling
|
||||
// ==============
|
||||
@Override
|
||||
public BusinessTimeHandler provideBusinessTimeHandler(TimeManager timeManager) {
|
||||
return new TypicalBusinessTimeHandler(() -> {
|
||||
return timeManager.getCurrentMillis();
|
||||
}, () -> {
|
||||
return FessUserTimeZoneProcessProvider.centralTimeZone;
|
||||
});
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean isCurrentIgnoreTransaction() {
|
||||
// this project uses transaction time for current date
|
||||
return false; // fixedly
|
||||
}
|
||||
|
||||
// ===================================================================================
|
||||
// Time Adjustment
|
||||
// ===============
|
||||
@Override
|
||||
public boolean isAdjustAbsoluteMode() { // *1
|
||||
final String exp = maihamaConfig.getTimeAdjustTimeMillis();
|
||||
return exp.startsWith("$"); // means absolute e.g. $(2014/07/10)
|
||||
}
|
||||
|
||||
@Override
|
||||
public long provideAdjustTimeMillis() { // *1
|
||||
final String exp = maihamaConfig.getTimeAdjustTimeMillis();
|
||||
try {
|
||||
return doProvideAdjustTimeMillis(exp);
|
||||
} catch (final RuntimeException e) {
|
||||
final String msg = "Illegal property for time.adjust.time.millis: " + exp;
|
||||
throw new IllegalStateException(msg);
|
||||
}
|
||||
}
|
||||
|
||||
protected long doProvideAdjustTimeMillis(final String exp) {
|
||||
if (exp.startsWith("$")) { // absolute e.g. $(2014/07/10)
|
||||
return script.resolveHardCodingDate(exp).getTime();
|
||||
} else if (exp.contains("(")) { // relative e.g. addDay(3)
|
||||
final long current = System.currentTimeMillis();
|
||||
final Date resolved = script.resolveRelativeDate(exp, new Date(current));
|
||||
return resolved.getTime() - current;
|
||||
} else { // should be millisecond as relative
|
||||
return maihamaConfig.getTimeAdjustTimeMillisAsLong();
|
||||
}
|
||||
}
|
||||
// *1: called per called for dynamic change in development
|
||||
}
|
|
@ -1,66 +0,0 @@
|
|||
/*
|
||||
* Copyright 2009-2015 the CodeLibs Project and the Others.
|
||||
*
|
||||
* Licensed under the Apache License, Version 2.0 (the "License");
|
||||
* you may not use this file except in compliance with the License.
|
||||
* You may obtain a copy of the License at
|
||||
*
|
||||
* http://www.apache.org/licenses/LICENSE-2.0
|
||||
*
|
||||
* Unless required by applicable law or agreed to in writing, software
|
||||
* distributed under the License is distributed on an "AS IS" BASIS,
|
||||
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND,
|
||||
* either express or implied. See the License for the specific language
|
||||
* governing permissions and limitations under the License.
|
||||
*/
|
||||
package org.codelibs.fess.lasta.core.direction.sponsor;
|
||||
|
||||
import java.util.Locale;
|
||||
|
||||
import org.lastaflute.web.servlet.request.RequestManager;
|
||||
import org.lastaflute.web.servlet.request.UserLocaleProcessProvider;
|
||||
|
||||
/**
|
||||
* @author jflute
|
||||
*/
|
||||
public class FessUserLocaleProcessProvider implements UserLocaleProcessProvider {
|
||||
|
||||
public static final Locale centralLocale = Locale.getDefault(); // you can change it if you like
|
||||
|
||||
/**
|
||||
* {@inheritDoc}
|
||||
*/
|
||||
@Override
|
||||
public boolean isAcceptCookieLocale() {
|
||||
return false;
|
||||
}
|
||||
|
||||
/**
|
||||
* {@inheritDoc}
|
||||
*/
|
||||
@Override
|
||||
public Locale findBusinessLocale(ActionExecuteMeta executeMeta, RequestManager requestManager) {
|
||||
return null;
|
||||
}
|
||||
|
||||
/**
|
||||
* {@inheritDoc}
|
||||
*/
|
||||
@Override
|
||||
public Locale getRequestedLocale(RequestManager requestManager) {
|
||||
return null; // null means browser default
|
||||
}
|
||||
|
||||
/**
|
||||
* {@inheritDoc}
|
||||
*/
|
||||
@Override
|
||||
public Locale getFallbackLocale() {
|
||||
return centralLocale;
|
||||
}
|
||||
|
||||
@Override
|
||||
public String toString() {
|
||||
return "{acceptCookieLocale=" + isAcceptCookieLocale() + ", fallbackLocale=" + getFallbackLocale() + "}";
|
||||
}
|
||||
}
|
|
@ -1,416 +0,0 @@
|
|||
/*
|
||||
* Copyright 2009-2015 the CodeLibs Project and the Others.
|
||||
*
|
||||
* Licensed under the Apache License, Version 2.0 (the "License");
|
||||
* you may not use this file except in compliance with the License.
|
||||
* You may obtain a copy of the License at
|
||||
*
|
||||
* http://www.apache.org/licenses/LICENSE-2.0
|
||||
*
|
||||
* Unless required by applicable law or agreed to in writing, software
|
||||
* distributed under the License is distributed on an "AS IS" BASIS,
|
||||
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND,
|
||||
* either express or implied. See the License for the specific language
|
||||
* governing permissions and limitations under the License.
|
||||
*/
|
||||
package org.codelibs.fess.lasta.web.action;
|
||||
|
||||
/**
|
||||
* The path definition of JSP.
|
||||
* @author FreeGen
|
||||
*/
|
||||
public interface FessJspPath {
|
||||
|
||||
/** The path of the JSP: /admin/boostDocumentRule/confirm.jsp */
|
||||
String path_AdminBoostDocumentRule_ConfirmJsp = "/admin/boostDocumentRule/confirm.jsp";
|
||||
|
||||
/** The path of the JSP: /admin/boostDocumentRule/edit.jsp */
|
||||
String path_AdminBoostDocumentRule_EditJsp = "/admin/boostDocumentRule/edit.jsp";
|
||||
|
||||
/** The path of the JSP: /admin/boostDocumentRule/error.jsp */
|
||||
String path_AdminBoostDocumentRule_ErrorJsp = "/admin/boostDocumentRule/error.jsp";
|
||||
|
||||
/** The path of the JSP: /admin/boostDocumentRule/index.jsp */
|
||||
String path_AdminBoostDocumentRule_IndexJsp = "/admin/boostDocumentRule/index.jsp";
|
||||
|
||||
/** The path of the JSP: /admin/crawl/index.jsp */
|
||||
String path_AdminCrawl_IndexJsp = "/admin/crawl/index.jsp";
|
||||
|
||||
/** The path of the JSP: /admin/crawlingSession/confirm.jsp */
|
||||
String path_AdminCrawlingSession_ConfirmJsp = "/admin/crawlingSession/confirm.jsp";
|
||||
|
||||
/** The path of the JSP: /admin/crawlingSession/error.jsp */
|
||||
String path_AdminCrawlingSession_ErrorJsp = "/admin/crawlingSession/error.jsp";
|
||||
|
||||
/** The path of the JSP: /admin/crawlingSession/index.jsp */
|
||||
String path_AdminCrawlingSession_IndexJsp = "/admin/crawlingSession/index.jsp";
|
||||
|
||||
/** The path of the JSP: /admin/data/index.jsp */
|
||||
String path_AdminData_IndexJsp = "/admin/data/index.jsp";
|
||||
|
||||
/** The path of the JSP: /admin/dataConfig/confirm.jsp */
|
||||
String path_AdminDataConfig_ConfirmJsp = "/admin/dataConfig/confirm.jsp";
|
||||
|
||||
/** The path of the JSP: /admin/dataConfig/edit.jsp */
|
||||
String path_AdminDataConfig_EditJsp = "/admin/dataConfig/edit.jsp";
|
||||
|
||||
/** The path of the JSP: /admin/dataConfig/error.jsp */
|
||||
String path_AdminDataConfig_ErrorJsp = "/admin/dataConfig/error.jsp";
|
||||
|
||||
/** The path of the JSP: /admin/dataConfig/index.jsp */
|
||||
String path_AdminDataConfig_IndexJsp = "/admin/dataConfig/index.jsp";
|
||||
|
||||
/** The path of the JSP: /admin/design/edit.jsp */
|
||||
String path_AdminDesign_EditJsp = "/admin/design/edit.jsp";
|
||||
|
||||
/** The path of the JSP: /admin/design/index.jsp */
|
||||
String path_AdminDesign_IndexJsp = "/admin/design/index.jsp";
|
||||
|
||||
/** The path of the JSP: /admin/dict/error.jsp */
|
||||
String path_AdminDict_ErrorJsp = "/admin/dict/error.jsp";
|
||||
|
||||
/** The path of the JSP: /admin/dict/index.jsp */
|
||||
String path_AdminDict_IndexJsp = "/admin/dict/index.jsp";
|
||||
|
||||
/** The path of the JSP: /admin/dict/synonym/confirm.jsp */
|
||||
String path_AdminDictSynonym_ConfirmJsp = "/admin/dict/synonym/confirm.jsp";
|
||||
|
||||
/** The path of the JSP: /admin/dict/synonym/download.jsp */
|
||||
String path_AdminDictSynonym_DownloadJsp = "/admin/dict/synonym/download.jsp";
|
||||
|
||||
/** The path of the JSP: /admin/dict/synonym/edit.jsp */
|
||||
String path_AdminDictSynonym_EditJsp = "/admin/dict/synonym/edit.jsp";
|
||||
|
||||
/** The path of the JSP: /admin/dict/synonym/error.jsp */
|
||||
String path_AdminDictSynonym_ErrorJsp = "/admin/dict/synonym/error.jsp";
|
||||
|
||||
/** The path of the JSP: /admin/dict/synonym/index.jsp */
|
||||
String path_AdminDictSynonym_IndexJsp = "/admin/dict/synonym/index.jsp";
|
||||
|
||||
/** The path of the JSP: /admin/dict/synonym/upload.jsp */
|
||||
String path_AdminDictSynonym_UploadJsp = "/admin/dict/synonym/upload.jsp";
|
||||
|
||||
/** The path of the JSP: /admin/dict/userDict/confirm.jsp */
|
||||
String path_AdminDictUserDict_ConfirmJsp = "/admin/dict/userDict/confirm.jsp";
|
||||
|
||||
/** The path of the JSP: /admin/dict/userDict/download.jsp */
|
||||
String path_AdminDictUserDict_DownloadJsp = "/admin/dict/userDict/download.jsp";
|
||||
|
||||
/** The path of the JSP: /admin/dict/userDict/edit.jsp */
|
||||
String path_AdminDictUserDict_EditJsp = "/admin/dict/userDict/edit.jsp";
|
||||
|
||||
/** The path of the JSP: /admin/dict/userDict/error.jsp */
|
||||
String path_AdminDictUserDict_ErrorJsp = "/admin/dict/userDict/error.jsp";
|
||||
|
||||
/** The path of the JSP: /admin/dict/userDict/index.jsp */
|
||||
String path_AdminDictUserDict_IndexJsp = "/admin/dict/userDict/index.jsp";
|
||||
|
||||
/** The path of the JSP: /admin/dict/userDict/upload.jsp */
|
||||
String path_AdminDictUserDict_UploadJsp = "/admin/dict/userDict/upload.jsp";
|
||||
|
||||
/** The path of the JSP: /admin/document/index.jsp */
|
||||
String path_AdminDocument_IndexJsp = "/admin/document/index.jsp";
|
||||
|
||||
/** The path of the JSP: /admin/failureUrl/confirm.jsp */
|
||||
String path_AdminFailureUrl_ConfirmJsp = "/admin/failureUrl/confirm.jsp";
|
||||
|
||||
/** The path of the JSP: /admin/failureUrl/error.jsp */
|
||||
String path_AdminFailureUrl_ErrorJsp = "/admin/failureUrl/error.jsp";
|
||||
|
||||
/** The path of the JSP: /admin/failureUrl/index.jsp */
|
||||
String path_AdminFailureUrl_IndexJsp = "/admin/failureUrl/index.jsp";
|
||||
|
||||
/** The path of the JSP: /admin/favoriteLog/confirm.jsp */
|
||||
String path_AdminFavoriteLog_ConfirmJsp = "/admin/favoriteLog/confirm.jsp";
|
||||
|
||||
/** The path of the JSP: /admin/favoriteLog/error.jsp */
|
||||
String path_AdminFavoriteLog_ErrorJsp = "/admin/favoriteLog/error.jsp";
|
||||
|
||||
/** The path of the JSP: /admin/favoriteLog/index.jsp */
|
||||
String path_AdminFavoriteLog_IndexJsp = "/admin/favoriteLog/index.jsp";
|
||||
|
||||
/** The path of the JSP: /admin/fileAuthentication/confirm.jsp */
|
||||
String path_AdminFileAuthentication_ConfirmJsp = "/admin/fileAuthentication/confirm.jsp";
|
||||
|
||||
/** The path of the JSP: /admin/fileAuthentication/edit.jsp */
|
||||
String path_AdminFileAuthentication_EditJsp = "/admin/fileAuthentication/edit.jsp";
|
||||
|
||||
/** The path of the JSP: /admin/fileAuthentication/error.jsp */
|
||||
String path_AdminFileAuthentication_ErrorJsp = "/admin/fileAuthentication/error.jsp";
|
||||
|
||||
/** The path of the JSP: /admin/fileAuthentication/index.jsp */
|
||||
String path_AdminFileAuthentication_IndexJsp = "/admin/fileAuthentication/index.jsp";
|
||||
|
||||
/** The path of the JSP: /admin/fileConfig/confirm.jsp */
|
||||
String path_AdminFileConfig_ConfirmJsp = "/admin/fileConfig/confirm.jsp";
|
||||
|
||||
/** The path of the JSP: /admin/fileConfig/edit.jsp */
|
||||
String path_AdminFileConfig_EditJsp = "/admin/fileConfig/edit.jsp";
|
||||
|
||||
/** The path of the JSP: /admin/fileConfig/error.jsp */
|
||||
String path_AdminFileConfig_ErrorJsp = "/admin/fileConfig/error.jsp";
|
||||
|
||||
/** The path of the JSP: /admin/fileConfig/index.jsp */
|
||||
String path_AdminFileConfig_IndexJsp = "/admin/fileConfig/index.jsp";
|
||||
|
||||
/** The path of the JSP: /admin/jobLog/confirm.jsp */
|
||||
String path_AdminJobLog_ConfirmJsp = "/admin/jobLog/confirm.jsp";
|
||||
|
||||
/** The path of the JSP: /admin/jobLog/error.jsp */
|
||||
String path_AdminJobLog_ErrorJsp = "/admin/jobLog/error.jsp";
|
||||
|
||||
/** The path of the JSP: /admin/jobLog/index.jsp */
|
||||
String path_AdminJobLog_IndexJsp = "/admin/jobLog/index.jsp";
|
||||
|
||||
/** The path of the JSP: /admin/keyMatch/confirm.jsp */
|
||||
String path_AdminKeyMatch_ConfirmJsp = "/admin/keyMatch/confirm.jsp";
|
||||
|
||||
/** The path of the JSP: /admin/keyMatch/edit.jsp */
|
||||
String path_AdminKeyMatch_EditJsp = "/admin/keyMatch/edit.jsp";
|
||||
|
||||
/** The path of the JSP: /admin/keyMatch/error.jsp */
|
||||
String path_AdminKeyMatch_ErrorJsp = "/admin/keyMatch/error.jsp";
|
||||
|
||||
/** The path of the JSP: /admin/keyMatch/index.jsp */
|
||||
String path_AdminKeyMatch_IndexJsp = "/admin/keyMatch/index.jsp";
|
||||
|
||||
/** The path of the JSP: /admin/labelType/confirm.jsp */
|
||||
String path_AdminLabelType_ConfirmJsp = "/admin/labelType/confirm.jsp";
|
||||
|
||||
/** The path of the JSP: /admin/labelType/edit.jsp */
|
||||
String path_AdminLabelType_EditJsp = "/admin/labelType/edit.jsp";
|
||||
|
||||
/** The path of the JSP: /admin/labelType/error.jsp */
|
||||
String path_AdminLabelType_ErrorJsp = "/admin/labelType/error.jsp";
|
||||
|
||||
/** The path of the JSP: /admin/labelType/index.jsp */
|
||||
String path_AdminLabelType_IndexJsp = "/admin/labelType/index.jsp";
|
||||
|
||||
/** The path of the JSP: /admin/log/index.jsp */
|
||||
String path_AdminLog_IndexJsp = "/admin/log/index.jsp";
|
||||
|
||||
/** The path of the JSP: /admin/overlappingHost/confirm.jsp */
|
||||
String path_AdminOverlappingHost_ConfirmJsp = "/admin/overlappingHost/confirm.jsp";
|
||||
|
||||
/** The path of the JSP: /admin/overlappingHost/edit.jsp */
|
||||
String path_AdminOverlappingHost_EditJsp = "/admin/overlappingHost/edit.jsp";
|
||||
|
||||
/** The path of the JSP: /admin/overlappingHost/error.jsp */
|
||||
String path_AdminOverlappingHost_ErrorJsp = "/admin/overlappingHost/error.jsp";
|
||||
|
||||
/** The path of the JSP: /admin/overlappingHost/index.jsp */
|
||||
String path_AdminOverlappingHost_IndexJsp = "/admin/overlappingHost/index.jsp";
|
||||
|
||||
/** The path of the JSP: /admin/pathMapping/confirm.jsp */
|
||||
String path_AdminPathMapping_ConfirmJsp = "/admin/pathMapping/confirm.jsp";
|
||||
|
||||
/** The path of the JSP: /admin/pathMapping/edit.jsp */
|
||||
String path_AdminPathMapping_EditJsp = "/admin/pathMapping/edit.jsp";
|
||||
|
||||
/** The path of the JSP: /admin/pathMapping/error.jsp */
|
||||
String path_AdminPathMapping_ErrorJsp = "/admin/pathMapping/error.jsp";
|
||||
|
||||
/** The path of the JSP: /admin/pathMapping/index.jsp */
|
||||
String path_AdminPathMapping_IndexJsp = "/admin/pathMapping/index.jsp";
|
||||
|
||||
/** The path of the JSP: /admin/requestHeader/confirm.jsp */
|
||||
String path_AdminRequestHeader_ConfirmJsp = "/admin/requestHeader/confirm.jsp";
|
||||
|
||||
/** The path of the JSP: /admin/requestHeader/edit.jsp */
|
||||
String path_AdminRequestHeader_EditJsp = "/admin/requestHeader/edit.jsp";
|
||||
|
||||
/** The path of the JSP: /admin/requestHeader/error.jsp */
|
||||
String path_AdminRequestHeader_ErrorJsp = "/admin/requestHeader/error.jsp";
|
||||
|
||||
/** The path of the JSP: /admin/requestHeader/index.jsp */
|
||||
String path_AdminRequestHeader_IndexJsp = "/admin/requestHeader/index.jsp";
|
||||
|
||||
/** The path of the JSP: /admin/roleType/confirm.jsp */
|
||||
String path_AdminRoleType_ConfirmJsp = "/admin/roleType/confirm.jsp";
|
||||
|
||||
/** The path of the JSP: /admin/roleType/edit.jsp */
|
||||
String path_AdminRoleType_EditJsp = "/admin/roleType/edit.jsp";
|
||||
|
||||
/** The path of the JSP: /admin/roleType/error.jsp */
|
||||
String path_AdminRoleType_ErrorJsp = "/admin/roleType/error.jsp";
|
||||
|
||||
/** The path of the JSP: /admin/roleType/index.jsp */
|
||||
String path_AdminRoleType_IndexJsp = "/admin/roleType/index.jsp";
|
||||
|
||||
/** The path of the JSP: /admin/scheduledJob/confirm.jsp */
|
||||
String path_AdminScheduledJob_ConfirmJsp = "/admin/scheduledJob/confirm.jsp";
|
||||
|
||||
/** The path of the JSP: /admin/scheduledJob/edit.jsp */
|
||||
String path_AdminScheduledJob_EditJsp = "/admin/scheduledJob/edit.jsp";
|
||||
|
||||
/** The path of the JSP: /admin/scheduledJob/error.jsp */
|
||||
String path_AdminScheduledJob_ErrorJsp = "/admin/scheduledJob/error.jsp";
|
||||
|
||||
/** The path of the JSP: /admin/scheduledJob/index.jsp */
|
||||
String path_AdminScheduledJob_IndexJsp = "/admin/scheduledJob/index.jsp";
|
||||
|
||||
/** The path of the JSP: /admin/searchList/confirmDelete.jsp */
|
||||
String path_AdminSearchList_ConfirmDeleteJsp = "/admin/searchList/confirmDelete.jsp";
|
||||
|
||||
/** The path of the JSP: /admin/searchList/index.jsp */
|
||||
String path_AdminSearchList_IndexJsp = "/admin/searchList/index.jsp";
|
||||
|
||||
/** The path of the JSP: /admin/searchLog/confirm.jsp */
|
||||
String path_AdminSearchLog_ConfirmJsp = "/admin/searchLog/confirm.jsp";
|
||||
|
||||
/** The path of the JSP: /admin/searchLog/error.jsp */
|
||||
String path_AdminSearchLog_ErrorJsp = "/admin/searchLog/error.jsp";
|
||||
|
||||
/** The path of the JSP: /admin/searchLog/index.jsp */
|
||||
String path_AdminSearchLog_IndexJsp = "/admin/searchLog/index.jsp";
|
||||
|
||||
/** The path of the JSP: /admin/stats/index.jsp */
|
||||
String path_AdminStats_IndexJsp = "/admin/stats/index.jsp";
|
||||
|
||||
/** The path of the JSP: /admin/suggestBadWord/confirm.jsp */
|
||||
String path_AdminSuggestBadWord_ConfirmJsp = "/admin/suggestBadWord/confirm.jsp";
|
||||
|
||||
/** The path of the JSP: /admin/suggestBadWord/download.jsp */
|
||||
String path_AdminSuggestBadWord_DownloadJsp = "/admin/suggestBadWord/download.jsp";
|
||||
|
||||
/** The path of the JSP: /admin/suggestBadWord/edit.jsp */
|
||||
String path_AdminSuggestBadWord_EditJsp = "/admin/suggestBadWord/edit.jsp";
|
||||
|
||||
/** The path of the JSP: /admin/suggestBadWord/error.jsp */
|
||||
String path_AdminSuggestBadWord_ErrorJsp = "/admin/suggestBadWord/error.jsp";
|
||||
|
||||
/** The path of the JSP: /admin/suggestBadWord/index.jsp */
|
||||
String path_AdminSuggestBadWord_IndexJsp = "/admin/suggestBadWord/index.jsp";
|
||||
|
||||
/** The path of the JSP: /admin/suggestBadWord/upload.jsp */
|
||||
String path_AdminSuggestBadWord_UploadJsp = "/admin/suggestBadWord/upload.jsp";
|
||||
|
||||
/** The path of the JSP: /admin/suggestElevateWord/confirm.jsp */
|
||||
String path_AdminSuggestElevateWord_ConfirmJsp = "/admin/suggestElevateWord/confirm.jsp";
|
||||
|
||||
/** The path of the JSP: /admin/suggestElevateWord/download.jsp */
|
||||
String path_AdminSuggestElevateWord_DownloadJsp = "/admin/suggestElevateWord/download.jsp";
|
||||
|
||||
/** The path of the JSP: /admin/suggestElevateWord/edit.jsp */
|
||||
String path_AdminSuggestElevateWord_EditJsp = "/admin/suggestElevateWord/edit.jsp";
|
||||
|
||||
/** The path of the JSP: /admin/suggestElevateWord/error.jsp */
|
||||
String path_AdminSuggestElevateWord_ErrorJsp = "/admin/suggestElevateWord/error.jsp";
|
||||
|
||||
/** The path of the JSP: /admin/suggestElevateWord/index.jsp */
|
||||
String path_AdminSuggestElevateWord_IndexJsp = "/admin/suggestElevateWord/index.jsp";
|
||||
|
||||
/** The path of the JSP: /admin/suggestElevateWord/upload.jsp */
|
||||
String path_AdminSuggestElevateWord_UploadJsp = "/admin/suggestElevateWord/upload.jsp";
|
||||
|
||||
/** The path of the JSP: /admin/system/index.jsp */
|
||||
String path_AdminSystem_IndexJsp = "/admin/system/index.jsp";
|
||||
|
||||
/** The path of the JSP: /admin/systemInfo/index.jsp */
|
||||
String path_AdminSystemInfo_IndexJsp = "/admin/systemInfo/index.jsp";
|
||||
|
||||
/** The path of the JSP: /admin/userInfo/confirm.jsp */
|
||||
String path_AdminUserInfo_ConfirmJsp = "/admin/userInfo/confirm.jsp";
|
||||
|
||||
/** The path of the JSP: /admin/userInfo/error.jsp */
|
||||
String path_AdminUserInfo_ErrorJsp = "/admin/userInfo/error.jsp";
|
||||
|
||||
/** The path of the JSP: /admin/userInfo/index.jsp */
|
||||
String path_AdminUserInfo_IndexJsp = "/admin/userInfo/index.jsp";
|
||||
|
||||
/** The path of the JSP: /admin/webAuthentication/confirm.jsp */
|
||||
String path_AdminWebAuthentication_ConfirmJsp = "/admin/webAuthentication/confirm.jsp";
|
||||
|
||||
/** The path of the JSP: /admin/webAuthentication/edit.jsp */
|
||||
String path_AdminWebAuthentication_EditJsp = "/admin/webAuthentication/edit.jsp";
|
||||
|
||||
/** The path of the JSP: /admin/webAuthentication/error.jsp */
|
||||
String path_AdminWebAuthentication_ErrorJsp = "/admin/webAuthentication/error.jsp";
|
||||
|
||||
/** The path of the JSP: /admin/webAuthentication/index.jsp */
|
||||
String path_AdminWebAuthentication_IndexJsp = "/admin/webAuthentication/index.jsp";
|
||||
|
||||
/** The path of the JSP: /admin/webConfig/confirm.jsp */
|
||||
String path_AdminWebConfig_ConfirmJsp = "/admin/webConfig/confirm.jsp";
|
||||
|
||||
/** The path of the JSP: /admin/webConfig/edit.jsp */
|
||||
String path_AdminWebConfig_EditJsp = "/admin/webConfig/edit.jsp";
|
||||
|
||||
/** The path of the JSP: /admin/webConfig/error.jsp */
|
||||
String path_AdminWebConfig_ErrorJsp = "/admin/webConfig/error.jsp";
|
||||
|
||||
/** The path of the JSP: /admin/webConfig/index.jsp */
|
||||
String path_AdminWebConfig_IndexJsp = "/admin/webConfig/index.jsp";
|
||||
|
||||
/** The path of the JSP: /admin/wizard/crawlingConfig.jsp */
|
||||
String path_AdminWizard_CrawlingConfigJsp = "/admin/wizard/crawlingConfig.jsp";
|
||||
|
||||
/** The path of the JSP: /admin/wizard/error.jsp */
|
||||
String path_AdminWizard_ErrorJsp = "/admin/wizard/error.jsp";
|
||||
|
||||
/** The path of the JSP: /admin/wizard/index.jsp */
|
||||
String path_AdminWizard_IndexJsp = "/admin/wizard/index.jsp";
|
||||
|
||||
/** The path of the JSP: /admin/wizard/startCrawling.jsp */
|
||||
String path_AdminWizard_StartCrawlingJsp = "/admin/wizard/startCrawling.jsp";
|
||||
|
||||
/** The path of the JSP: /error/badRequest.jsp */
|
||||
String path_Error_BadRequestJsp = "/error/badRequest.jsp";
|
||||
|
||||
/** The path of the JSP: /error/error_message.jsp */
|
||||
String path_Error_ErrorMessageJsp = "/error/error_message.jsp";
|
||||
|
||||
/** The path of the JSP: /error/footer.jsp */
|
||||
String path_Error_FooterJsp = "/error/footer.jsp";
|
||||
|
||||
/** The path of the JSP: /error/header.jsp */
|
||||
String path_Error_HeaderJsp = "/error/header.jsp";
|
||||
|
||||
/** The path of the JSP: /error/notFound.jsp */
|
||||
String path_Error_NotFoundJsp = "/error/notFound.jsp";
|
||||
|
||||
/** The path of the JSP: /error/redirect.jsp */
|
||||
String path_Error_RedirectJsp = "/error/redirect.jsp";
|
||||
|
||||
/** The path of the JSP: /error/system.jsp */
|
||||
String path_Error_SystemJsp = "/error/system.jsp";
|
||||
|
||||
/** The path of the JSP: /error.jsp */
|
||||
String path_ErrorJsp = "/error.jsp";
|
||||
|
||||
/** The path of the JSP: /footer.jsp */
|
||||
String path_FooterJsp = "/footer.jsp";
|
||||
|
||||
/** The path of the JSP: /header.jsp */
|
||||
String path_HeaderJsp = "/header.jsp";
|
||||
|
||||
/** The path of the JSP: /help.jsp */
|
||||
String path_HelpJsp = "/help.jsp";
|
||||
|
||||
/** The path of the JSP: /index.jsp */
|
||||
String path_IndexJsp = "/index.jsp";
|
||||
|
||||
/** The path of the JSP: /login/error.jsp */
|
||||
String path_Login_ErrorJsp = "/login/error.jsp";
|
||||
|
||||
/** The path of the JSP: /login/footer.jsp */
|
||||
String path_Login_FooterJsp = "/login/footer.jsp";
|
||||
|
||||
/** The path of the JSP: /login/header.jsp */
|
||||
String path_Login_HeaderJsp = "/login/header.jsp";
|
||||
|
||||
/** The path of the JSP: /login/index.jsp */
|
||||
String path_Login_IndexJsp = "/login/index.jsp";
|
||||
|
||||
/** The path of the JSP: /login/logout.jsp */
|
||||
String path_Login_LogoutJsp = "/login/logout.jsp";
|
||||
|
||||
/** The path of the JSP: /search.jsp */
|
||||
String path_SearchJsp = "/search.jsp";
|
||||
|
||||
/** The path of the JSP: /searchNoResult.jsp */
|
||||
String path_SearchNoResultJsp = "/searchNoResult.jsp";
|
||||
|
||||
/** The path of the JSP: /searchResults.jsp */
|
||||
String path_SearchResultsJsp = "/searchResults.jsp";
|
||||
}
|
|
@ -1,736 +0,0 @@
|
|||
/*
|
||||
* Copyright 2009-2015 the CodeLibs Project and the Others.
|
||||
*
|
||||
* Licensed under the Apache License, Version 2.0 (the "License");
|
||||
* you may not use this file except in compliance with the License.
|
||||
* You may obtain a copy of the License at
|
||||
*
|
||||
* http://www.apache.org/licenses/LICENSE-2.0
|
||||
*
|
||||
* Unless required by applicable law or agreed to in writing, software
|
||||
* distributed under the License is distributed on an "AS IS" BASIS,
|
||||
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND,
|
||||
* either express or implied. See the License for the specific language
|
||||
* governing permissions and limitations under the License.
|
||||
*/
|
||||
package org.codelibs.fess.lasta.web.action;
|
||||
|
||||
import org.lastaflute.web.ruts.message.ActionMessage;
|
||||
import org.lastaflute.web.ruts.message.ActionMessages;
|
||||
|
||||
/**
|
||||
* The keys for message.
|
||||
* @author FreeGen
|
||||
*/
|
||||
public class FessMessages extends ActionMessages {
|
||||
|
||||
/** The serial version UID for object serialization. (Default) */
|
||||
private static final long serialVersionUID = 1L;
|
||||
|
||||
/** The key of the message: <font color="red"><ul> */
|
||||
public static final String ERRORS_HEADER = "errors.header";
|
||||
|
||||
/** The key of the message: </ul></font> */
|
||||
public static final String ERRORS_FOOTER = "errors.footer";
|
||||
|
||||
/** The key of the message: <li> */
|
||||
public static final String ERRORS_PREFIX = "errors.prefix";
|
||||
|
||||
/** The key of the message: </li> */
|
||||
public static final String ERRORS_SUFFIX = "errors.suffix";
|
||||
|
||||
/** The key of the message: {0}は必須です。 */
|
||||
public static final String ERRORS_REQUIRED = "errors.required";
|
||||
|
||||
/** The key of the message: {0}の長さが最小値({1})未満です。 */
|
||||
public static final String ERRORS_MINLENGTH = "errors.minlength";
|
||||
|
||||
/** The key of the message: {0}の長さが最大値({1})を超えています。 */
|
||||
public static final String ERRORS_MAXLENGTH = "errors.maxlength";
|
||||
|
||||
/** The key of the message: {0}のバイト長が最小値({1})未満です。 */
|
||||
public static final String ERRORS_MINBYTELENGTH = "errors.minbytelength";
|
||||
|
||||
/** The key of the message: {0}のバイト長が最大値({1})を超えています。 */
|
||||
public static final String ERRORS_MAXBYTELENGTH = "errors.maxbytelength";
|
||||
|
||||
/** The key of the message: {0}が不正です。 */
|
||||
public static final String ERRORS_INVALID = "errors.invalid";
|
||||
|
||||
/** The key of the message: {0}は{1}と{2}の間でなければいけません。 */
|
||||
public static final String ERRORS_RANGE = "errors.range";
|
||||
|
||||
/** The key of the message: {0}はバイトでなければいけません。 */
|
||||
public static final String ERRORS_BYTE = "errors.byte";
|
||||
|
||||
/** The key of the message: {0}は短整数でなければいけません。 */
|
||||
public static final String ERRORS_SHORT = "errors.short";
|
||||
|
||||
/** The key of the message: {0}は整数でなければいけません。 */
|
||||
public static final String ERRORS_INTEGER = "errors.integer";
|
||||
|
||||
/** The key of the message: {0}は長整数でなければいけません。 */
|
||||
public static final String ERRORS_LONG = "errors.long";
|
||||
|
||||
/** The key of the message: {0}は単精度実数でなければいけません。 */
|
||||
public static final String ERRORS_FLOAT = "errors.float";
|
||||
|
||||
/** The key of the message: {0}は倍精度実数でなければいけません。 */
|
||||
public static final String ERRORS_DOUBLE = "errors.double";
|
||||
|
||||
/** The key of the message: {0}は日付でなければいけません */
|
||||
public static final String ERRORS_DATE = "errors.date";
|
||||
|
||||
/** The key of the message: {0}はクレジットカード番号として不正です。 */
|
||||
public static final String ERRORS_CREDITCARD = "errors.creditcard";
|
||||
|
||||
/** The key of the message: {0}はメールアドレスとして不正です。 */
|
||||
public static final String ERRORS_EMAIL = "errors.email";
|
||||
|
||||
/** The key of the message: {0}はURLとして不正です。 */
|
||||
public static final String ERRORS_URL = "errors.url";
|
||||
|
||||
/** The key of the message: {0}は数値を入力してください */
|
||||
public static final String ERRORS_NUMBER = "errors.number";
|
||||
|
||||
/** The key of the message: {0}に同一の項目が選ばれています */
|
||||
public static final String ERRORS_SAME_VALUE = "errors.same.value";
|
||||
|
||||
/** The key of the message: {0}は{1}より大きい数値を入力してください */
|
||||
public static final String ERRORS_GREATER_THAN = "errors.greater.than";
|
||||
|
||||
/** The key of the message: {0}のいずれかを入力してください */
|
||||
public static final String ERRORS_REQUIRED_AT_LEAST_ONE = "errors.required.at.least.one";
|
||||
|
||||
/** The key of the message: {0}と{1}のどちらかを入力してください */
|
||||
public static final String ERRORS_REQUIRED_OR = "errors.required.or";
|
||||
|
||||
/** The key of the message: 上限が{1}バイトなのに実際は{0}バイトだったのでアップロードできませんでした。 */
|
||||
public static final String ERRORS_UPLOAD_SIZE = "errors.upload.size";
|
||||
|
||||
/** The key of the message: メールアドレスまたはパスワードが未入力です */
|
||||
public static final String ERRORS_EMPTY_LOGIN = "errors.empty.login";
|
||||
|
||||
/** The key of the message: メールアドレス又はパスワードが間違っています */
|
||||
public static final String ERRORS_NOT_LOGIN = "errors.not.login";
|
||||
|
||||
/** The key of the message: 既に登録済みのメールアドレスです */
|
||||
public static final String ERRORS_EMAIL_EXISTS = "errors.email.exists";
|
||||
|
||||
/** The key of the message: {0}はすでに登録されている{1}です */
|
||||
public static final String ERRORS_ALREADY_REGISTERED = "errors.already.registered";
|
||||
|
||||
/** The key of the message: 他の人が更新した可能性があります。再度やり直してください */
|
||||
public static final String ERRORS_APP_ALREADY_DELETED = "errors.app.already.deleted";
|
||||
|
||||
/** The key of the message: 他の人が更新した可能性があります。再度やり直してください */
|
||||
public static final String ERRORS_APP_ALREADY_UPDATED = "errors.app.already.updated";
|
||||
|
||||
/** The key of the message: 既に登録されているデータです。再度やり直してください */
|
||||
public static final String ERRORS_APP_ALREADY_EXISTS = "errors.app.already.exists";
|
||||
|
||||
/** The key of the message: 不正なアクセスがされました。再度やり直してください */
|
||||
public static final String ERRORS_APP_ILLEGAL_TRANSITION = "errors.app.illegal.transition";
|
||||
|
||||
/** The key of the message: 検索キーワードを入力 */
|
||||
public static final String MESSAGES_INPUT_NOTE_KEYWORD = "messages.input.note.keyword";
|
||||
|
||||
/** The key of the message: メールアドレスを入力 */
|
||||
public static final String MESSAGES_INPUT_NOTE_EMAIL = "messages.input.note.email";
|
||||
|
||||
/** The key of the message: Pixy って入れてー */
|
||||
public static final String MESSAGES_INPUT_NOTE_EMAIL_OR_ACCOUNT = "messages.input.note.emailOrAccount";
|
||||
|
||||
/** The key of the message: sea って入れてー */
|
||||
public static final String MESSAGES_INPUT_NOTE_PASSWORD = "messages.input.note.password";
|
||||
|
||||
/** The key of the message: 例: 153-0051 */
|
||||
public static final String MESSAGES_INPUT_NOTE_ZIP_CODE = "messages.input.note.zipCode";
|
||||
|
||||
/**
|
||||
* Add the created action message for the key 'errors.header' with parameters.
|
||||
* <pre>
|
||||
* message: <font color="red"><ul>
|
||||
* </pre>
|
||||
* @param property The property name for the message. (NotNull)
|
||||
*/
|
||||
public void addErrorsHeader(String property) {
|
||||
assertPropertyNotNull(property);
|
||||
add(property, new ActionMessage(ERRORS_HEADER, (Object[]) null));
|
||||
}
|
||||
|
||||
/**
|
||||
* Add the created action message for the key 'errors.footer' with parameters.
|
||||
* <pre>
|
||||
* message: </ul></font>
|
||||
* </pre>
|
||||
* @param property The property name for the message. (NotNull)
|
||||
*/
|
||||
public void addErrorsFooter(String property) {
|
||||
assertPropertyNotNull(property);
|
||||
add(property, new ActionMessage(ERRORS_FOOTER, (Object[]) null));
|
||||
}
|
||||
|
||||
/**
|
||||
* Add the created action message for the key 'errors.prefix' with parameters.
|
||||
* <pre>
|
||||
* message: <li>
|
||||
* </pre>
|
||||
* @param property The property name for the message. (NotNull)
|
||||
*/
|
||||
public void addErrorsPrefix(String property) {
|
||||
assertPropertyNotNull(property);
|
||||
add(property, new ActionMessage(ERRORS_PREFIX, (Object[]) null));
|
||||
}
|
||||
|
||||
/**
|
||||
* Add the created action message for the key 'errors.suffix' with parameters.
|
||||
* <pre>
|
||||
* message: </li>
|
||||
* </pre>
|
||||
* @param property The property name for the message. (NotNull)
|
||||
*/
|
||||
public void addErrorsSuffix(String property) {
|
||||
assertPropertyNotNull(property);
|
||||
add(property, new ActionMessage(ERRORS_SUFFIX, (Object[]) null));
|
||||
}
|
||||
|
||||
/**
|
||||
* Add the created action message for the key 'errors.required' with parameters.
|
||||
* <pre>
|
||||
* message: {0}は必須です。
|
||||
* </pre>
|
||||
* @param property The property name for the message. (NotNull)
|
||||
* @param arg0 The parameter 0 for message. (NotNull)
|
||||
*/
|
||||
public void addErrorsRequired(String property, String arg0) {
|
||||
assertPropertyNotNull(property);
|
||||
add(property, new ActionMessage(ERRORS_REQUIRED, arg0));
|
||||
}
|
||||
|
||||
/**
|
||||
* Add the created action message for the key 'errors.minlength' with parameters.
|
||||
* <pre>
|
||||
* message: {0}の長さが最小値({1})未満です。
|
||||
* </pre>
|
||||
* @param property The property name for the message. (NotNull)
|
||||
* @param arg0 The parameter 0 for message. (NotNull)
|
||||
* @param arg1 The parameter 1 for message. (NotNull)
|
||||
*/
|
||||
public void addErrorsMinlength(String property, String arg0, String arg1) {
|
||||
assertPropertyNotNull(property);
|
||||
add(property, new ActionMessage(ERRORS_MINLENGTH, arg0, arg1));
|
||||
}
|
||||
|
||||
/**
|
||||
* Add the created action message for the key 'errors.maxlength' with parameters.
|
||||
* <pre>
|
||||
* message: {0}の長さが最大値({1})を超えています。
|
||||
* </pre>
|
||||
* @param property The property name for the message. (NotNull)
|
||||
* @param arg0 The parameter 0 for message. (NotNull)
|
||||
* @param arg1 The parameter 1 for message. (NotNull)
|
||||
*/
|
||||
public void addErrorsMaxlength(String property, String arg0, String arg1) {
|
||||
assertPropertyNotNull(property);
|
||||
add(property, new ActionMessage(ERRORS_MAXLENGTH, arg0, arg1));
|
||||
}
|
||||
|
||||
/**
|
||||
* Add the created action message for the key 'errors.minbytelength' with parameters.
|
||||
* <pre>
|
||||
* message: {0}のバイト長が最小値({1})未満です。
|
||||
* </pre>
|
||||
* @param property The property name for the message. (NotNull)
|
||||
* @param arg0 The parameter 0 for message. (NotNull)
|
||||
* @param arg1 The parameter 1 for message. (NotNull)
|
||||
*/
|
||||
public void addErrorsMinbytelength(String property, String arg0, String arg1) {
|
||||
assertPropertyNotNull(property);
|
||||
add(property, new ActionMessage(ERRORS_MINBYTELENGTH, arg0, arg1));
|
||||
}
|
||||
|
||||
/**
|
||||
* Add the created action message for the key 'errors.maxbytelength' with parameters.
|
||||
* <pre>
|
||||
* message: {0}のバイト長が最大値({1})を超えています。
|
||||
* </pre>
|
||||
* @param property The property name for the message. (NotNull)
|
||||
* @param arg0 The parameter 0 for message. (NotNull)
|
||||
* @param arg1 The parameter 1 for message. (NotNull)
|
||||
*/
|
||||
public void addErrorsMaxbytelength(String property, String arg0, String arg1) {
|
||||
assertPropertyNotNull(property);
|
||||
add(property, new ActionMessage(ERRORS_MAXBYTELENGTH, arg0, arg1));
|
||||
}
|
||||
|
||||
/**
|
||||
* Add the created action message for the key 'errors.invalid' with parameters.
|
||||
* <pre>
|
||||
* message: {0}が不正です。
|
||||
* </pre>
|
||||
* @param property The property name for the message. (NotNull)
|
||||
* @param arg0 The parameter 0 for message. (NotNull)
|
||||
*/
|
||||
public void addErrorsInvalid(String property, String arg0) {
|
||||
assertPropertyNotNull(property);
|
||||
add(property, new ActionMessage(ERRORS_INVALID, arg0));
|
||||
}
|
||||
|
||||
/**
|
||||
* Add the created action message for the key 'errors.range' with parameters.
|
||||
* <pre>
|
||||
* message: {0}は{1}と{2}の間でなければいけません。
|
||||
* </pre>
|
||||
* @param property The property name for the message. (NotNull)
|
||||
* @param arg0 The parameter 0 for message. (NotNull)
|
||||
* @param arg1 The parameter 1 for message. (NotNull)
|
||||
* @param arg2 The parameter 2 for message. (NotNull)
|
||||
*/
|
||||
public void addErrorsRange(String property, String arg0, String arg1, String arg2) {
|
||||
assertPropertyNotNull(property);
|
||||
add(property, new ActionMessage(ERRORS_RANGE, arg0, arg1, arg2));
|
||||
}
|
||||
|
||||
/**
|
||||
* Add the created action message for the key 'errors.byte' with parameters.
|
||||
* <pre>
|
||||
* message: {0}はバイトでなければいけません。
|
||||
* </pre>
|
||||
* @param property The property name for the message. (NotNull)
|
||||
* @param arg0 The parameter 0 for message. (NotNull)
|
||||
*/
|
||||
public void addErrorsByte(String property, String arg0) {
|
||||
assertPropertyNotNull(property);
|
||||
add(property, new ActionMessage(ERRORS_BYTE, arg0));
|
||||
}
|
||||
|
||||
/**
|
||||
* Add the created action message for the key 'errors.short' with parameters.
|
||||
* <pre>
|
||||
* message: {0}は短整数でなければいけません。
|
||||
* </pre>
|
||||
* @param property The property name for the message. (NotNull)
|
||||
* @param arg0 The parameter 0 for message. (NotNull)
|
||||
*/
|
||||
public void addErrorsShort(String property, String arg0) {
|
||||
assertPropertyNotNull(property);
|
||||
add(property, new ActionMessage(ERRORS_SHORT, arg0));
|
||||
}
|
||||
|
||||
/**
|
||||
* Add the created action message for the key 'errors.integer' with parameters.
|
||||
* <pre>
|
||||
* message: {0}は整数でなければいけません。
|
||||
* </pre>
|
||||
* @param property The property name for the message. (NotNull)
|
||||
* @param arg0 The parameter 0 for message. (NotNull)
|
||||
*/
|
||||
public void addErrorsInteger(String property, String arg0) {
|
||||
assertPropertyNotNull(property);
|
||||
add(property, new ActionMessage(ERRORS_INTEGER, arg0));
|
||||
}
|
||||
|
||||
/**
|
||||
* Add the created action message for the key 'errors.long' with parameters.
|
||||
* <pre>
|
||||
* message: {0}は長整数でなければいけません。
|
||||
* </pre>
|
||||
* @param property The property name for the message. (NotNull)
|
||||
* @param arg0 The parameter 0 for message. (NotNull)
|
||||
*/
|
||||
public void addErrorsLong(String property, String arg0) {
|
||||
assertPropertyNotNull(property);
|
||||
add(property, new ActionMessage(ERRORS_LONG, arg0));
|
||||
}
|
||||
|
||||
/**
|
||||
* Add the created action message for the key 'errors.float' with parameters.
|
||||
* <pre>
|
||||
* message: {0}は単精度実数でなければいけません。
|
||||
* </pre>
|
||||
* @param property The property name for the message. (NotNull)
|
||||
* @param arg0 The parameter 0 for message. (NotNull)
|
||||
*/
|
||||
public void addErrorsFloat(String property, String arg0) {
|
||||
assertPropertyNotNull(property);
|
||||
add(property, new ActionMessage(ERRORS_FLOAT, arg0));
|
||||
}
|
||||
|
||||
/**
|
||||
* Add the created action message for the key 'errors.double' with parameters.
|
||||
* <pre>
|
||||
* message: {0}は倍精度実数でなければいけません。
|
||||
* </pre>
|
||||
* @param property The property name for the message. (NotNull)
|
||||
* @param arg0 The parameter 0 for message. (NotNull)
|
||||
*/
|
||||
public void addErrorsDouble(String property, String arg0) {
|
||||
assertPropertyNotNull(property);
|
||||
add(property, new ActionMessage(ERRORS_DOUBLE, arg0));
|
||||
}
|
||||
|
||||
/**
|
||||
* Add the created action message for the key 'errors.date' with parameters.
|
||||
* <pre>
|
||||
* message: {0}は日付でなければいけません
|
||||
* </pre>
|
||||
* @param property The property name for the message. (NotNull)
|
||||
* @param arg0 The parameter 0 for message. (NotNull)
|
||||
*/
|
||||
public void addErrorsDate(String property, String arg0) {
|
||||
assertPropertyNotNull(property);
|
||||
add(property, new ActionMessage(ERRORS_DATE, arg0));
|
||||
}
|
||||
|
||||
/**
|
||||
* Add the created action message for the key 'errors.creditcard' with parameters.
|
||||
* <pre>
|
||||
* message: {0}はクレジットカード番号として不正です。
|
||||
* </pre>
|
||||
* @param property The property name for the message. (NotNull)
|
||||
* @param arg0 The parameter 0 for message. (NotNull)
|
||||
*/
|
||||
public void addErrorsCreditcard(String property, String arg0) {
|
||||
assertPropertyNotNull(property);
|
||||
add(property, new ActionMessage(ERRORS_CREDITCARD, arg0));
|
||||
}
|
||||
|
||||
/**
|
||||
* Add the created action message for the key 'errors.email' with parameters.
|
||||
* <pre>
|
||||
* message: {0}はメールアドレスとして不正です。
|
||||
* </pre>
|
||||
* @param property The property name for the message. (NotNull)
|
||||
* @param arg0 The parameter 0 for message. (NotNull)
|
||||
*/
|
||||
public void addErrorsEmail(String property, String arg0) {
|
||||
assertPropertyNotNull(property);
|
||||
add(property, new ActionMessage(ERRORS_EMAIL, arg0));
|
||||
}
|
||||
|
||||
/**
|
||||
* Add the created action message for the key 'errors.url' with parameters.
|
||||
* <pre>
|
||||
* message: {0}はURLとして不正です。
|
||||
* </pre>
|
||||
* @param property The property name for the message. (NotNull)
|
||||
* @param arg0 The parameter 0 for message. (NotNull)
|
||||
*/
|
||||
public void addErrorsUrl(String property, String arg0) {
|
||||
assertPropertyNotNull(property);
|
||||
add(property, new ActionMessage(ERRORS_URL, arg0));
|
||||
}
|
||||
|
||||
/**
|
||||
* Add the created action message for the key 'errors.number' with parameters.
|
||||
* <pre>
|
||||
* message: {0}は数値を入力してください
|
||||
* comment: -------------
|
||||
* </pre>
|
||||
* @param property The property name for the message. (NotNull)
|
||||
* @param arg0 The parameter 0 for message. (NotNull)
|
||||
*/
|
||||
public void addErrorsNumber(String property, String arg0) {
|
||||
assertPropertyNotNull(property);
|
||||
add(property, new ActionMessage(ERRORS_NUMBER, arg0));
|
||||
}
|
||||
|
||||
/**
|
||||
* Add the created action message for the key 'errors.same.value' with parameters.
|
||||
* <pre>
|
||||
* message: {0}に同一の項目が選ばれています
|
||||
* </pre>
|
||||
* @param property The property name for the message. (NotNull)
|
||||
* @param arg0 The parameter 0 for message. (NotNull)
|
||||
*/
|
||||
public void addErrorsSameValue(String property, String arg0) {
|
||||
assertPropertyNotNull(property);
|
||||
add(property, new ActionMessage(ERRORS_SAME_VALUE, arg0));
|
||||
}
|
||||
|
||||
/**
|
||||
* Add the created action message for the key 'errors.greater.than' with parameters.
|
||||
* <pre>
|
||||
* message: {0}は{1}より大きい数値を入力してください
|
||||
* </pre>
|
||||
* @param property The property name for the message. (NotNull)
|
||||
* @param arg0 The parameter 0 for message. (NotNull)
|
||||
* @param arg1 The parameter 1 for message. (NotNull)
|
||||
*/
|
||||
public void addErrorsGreaterThan(String property, String arg0, String arg1) {
|
||||
assertPropertyNotNull(property);
|
||||
add(property, new ActionMessage(ERRORS_GREATER_THAN, arg0, arg1));
|
||||
}
|
||||
|
||||
/**
|
||||
* Add the created action message for the key 'errors.required.at.least.one' with parameters.
|
||||
* <pre>
|
||||
* message: {0}のいずれかを入力してください
|
||||
* </pre>
|
||||
* @param property The property name for the message. (NotNull)
|
||||
* @param arg0 The parameter 0 for message. (NotNull)
|
||||
*/
|
||||
public void addErrorsRequiredAtLeastOne(String property, String arg0) {
|
||||
assertPropertyNotNull(property);
|
||||
add(property, new ActionMessage(ERRORS_REQUIRED_AT_LEAST_ONE, arg0));
|
||||
}
|
||||
|
||||
/**
|
||||
* Add the created action message for the key 'errors.required.or' with parameters.
|
||||
* <pre>
|
||||
* message: {0}と{1}のどちらかを入力してください
|
||||
* </pre>
|
||||
* @param property The property name for the message. (NotNull)
|
||||
* @param arg0 The parameter 0 for message. (NotNull)
|
||||
* @param arg1 The parameter 1 for message. (NotNull)
|
||||
*/
|
||||
public void addErrorsRequiredOr(String property, String arg0, String arg1) {
|
||||
assertPropertyNotNull(property);
|
||||
add(property, new ActionMessage(ERRORS_REQUIRED_OR, arg0, arg1));
|
||||
}
|
||||
|
||||
/**
|
||||
* Add the created action message for the key 'errors.upload.size' with parameters.
|
||||
* <pre>
|
||||
* message: 上限が{1}バイトなのに実際は{0}バイトだったのでアップロードできませんでした。
|
||||
* </pre>
|
||||
* @param property The property name for the message. (NotNull)
|
||||
* @param arg1 The parameter 1 for message. (NotNull)
|
||||
* @param arg0 The parameter 0 for message. (NotNull)
|
||||
*/
|
||||
public void addErrorsUploadSize(String property, String arg1, String arg0) {
|
||||
assertPropertyNotNull(property);
|
||||
add(property, new ActionMessage(ERRORS_UPLOAD_SIZE, arg1, arg0));
|
||||
}
|
||||
|
||||
/**
|
||||
* Add the created action message for the key 'errors.empty.login' with parameters.
|
||||
* <pre>
|
||||
* message: メールアドレスまたはパスワードが未入力です
|
||||
* comment: ----------------
|
||||
* </pre>
|
||||
* @param property The property name for the message. (NotNull)
|
||||
*/
|
||||
public void addErrorsEmptyLogin(String property) {
|
||||
assertPropertyNotNull(property);
|
||||
add(property, new ActionMessage(ERRORS_EMPTY_LOGIN, (Object[]) null));
|
||||
}
|
||||
|
||||
/**
|
||||
* Add the created action message for the key 'errors.not.login' with parameters.
|
||||
* <pre>
|
||||
* message: メールアドレス又はパスワードが間違っています
|
||||
* </pre>
|
||||
* @param property The property name for the message. (NotNull)
|
||||
*/
|
||||
public void addErrorsNotLogin(String property) {
|
||||
assertPropertyNotNull(property);
|
||||
add(property, new ActionMessage(ERRORS_NOT_LOGIN, (Object[]) null));
|
||||
}
|
||||
|
||||
/**
|
||||
* Add the created action message for the key 'errors.email.exists' with parameters.
|
||||
* <pre>
|
||||
* message: 既に登録済みのメールアドレスです
|
||||
* </pre>
|
||||
* @param property The property name for the message. (NotNull)
|
||||
*/
|
||||
public void addErrorsEmailExists(String property) {
|
||||
assertPropertyNotNull(property);
|
||||
add(property, new ActionMessage(ERRORS_EMAIL_EXISTS, (Object[]) null));
|
||||
}
|
||||
|
||||
/**
|
||||
* Add the created action message for the key 'errors.already.registered' with parameters.
|
||||
* <pre>
|
||||
* message: {0}はすでに登録されている{1}です
|
||||
* </pre>
|
||||
* @param property The property name for the message. (NotNull)
|
||||
* @param arg0 The parameter 0 for message. (NotNull)
|
||||
* @param arg1 The parameter 1 for message. (NotNull)
|
||||
*/
|
||||
public void addErrorsAlreadyRegistered(String property, String arg0, String arg1) {
|
||||
assertPropertyNotNull(property);
|
||||
add(property, new ActionMessage(ERRORS_ALREADY_REGISTERED, arg0, arg1));
|
||||
}
|
||||
|
||||
/**
|
||||
* Add the created action message for the key 'errors.app.already.deleted' with parameters.
|
||||
* <pre>
|
||||
* message: 他の人が更新した可能性があります。再度やり直してください
|
||||
* comment: ---------------------
|
||||
* </pre>
|
||||
* @param property The property name for the message. (NotNull)
|
||||
*/
|
||||
public void addErrorsAppAlreadyDeleted(String property) {
|
||||
assertPropertyNotNull(property);
|
||||
add(property, new ActionMessage(ERRORS_APP_ALREADY_DELETED, (Object[]) null));
|
||||
}
|
||||
|
||||
/**
|
||||
* Add the created action message for the key 'errors.app.already.updated' with parameters.
|
||||
* <pre>
|
||||
* message: 他の人が更新した可能性があります。再度やり直してください
|
||||
* </pre>
|
||||
* @param property The property name for the message. (NotNull)
|
||||
*/
|
||||
public void addErrorsAppAlreadyUpdated(String property) {
|
||||
assertPropertyNotNull(property);
|
||||
add(property, new ActionMessage(ERRORS_APP_ALREADY_UPDATED, (Object[]) null));
|
||||
}
|
||||
|
||||
/**
|
||||
* Add the created action message for the key 'errors.app.already.exists' with parameters.
|
||||
* <pre>
|
||||
* message: 既に登録されているデータです。再度やり直してください
|
||||
* </pre>
|
||||
* @param property The property name for the message. (NotNull)
|
||||
*/
|
||||
public void addErrorsAppAlreadyExists(String property) {
|
||||
assertPropertyNotNull(property);
|
||||
add(property, new ActionMessage(ERRORS_APP_ALREADY_EXISTS, (Object[]) null));
|
||||
}
|
||||
|
||||
/**
|
||||
* Add the created action message for the key 'errors.app.illegal.transition' with parameters.
|
||||
* <pre>
|
||||
* message: 不正なアクセスがされました。再度やり直してください
|
||||
* </pre>
|
||||
* @param property The property name for the message. (NotNull)
|
||||
*/
|
||||
public void addErrorsAppIllegalTransition(String property) {
|
||||
assertPropertyNotNull(property);
|
||||
add(property, new ActionMessage(ERRORS_APP_ILLEGAL_TRANSITION, (Object[]) null));
|
||||
}
|
||||
|
||||
/**
|
||||
* Add the created action message for the key 'messages.input.note.keyword' with parameters.
|
||||
* <pre>
|
||||
* message: 検索キーワードを入力
|
||||
* comment: ----------
|
||||
* </pre>
|
||||
* @param property The property name for the message. (NotNull)
|
||||
*/
|
||||
public void addMessagesInputNoteKeyword(String property) {
|
||||
assertPropertyNotNull(property);
|
||||
add(property, new ActionMessage(MESSAGES_INPUT_NOTE_KEYWORD, (Object[]) null));
|
||||
}
|
||||
|
||||
/**
|
||||
* Add the created action message for the key 'messages.input.note.email' with parameters.
|
||||
* <pre>
|
||||
* message: メールアドレスを入力
|
||||
* </pre>
|
||||
* @param property The property name for the message. (NotNull)
|
||||
*/
|
||||
public void addMessagesInputNoteEmail(String property) {
|
||||
assertPropertyNotNull(property);
|
||||
add(property, new ActionMessage(MESSAGES_INPUT_NOTE_EMAIL, (Object[]) null));
|
||||
}
|
||||
|
||||
/**
|
||||
* Add the created action message for the key 'messages.input.note.emailOrAccount' with parameters.
|
||||
* <pre>
|
||||
* message: Pixy って入れてー
|
||||
* </pre>
|
||||
* @param property The property name for the message. (NotNull)
|
||||
*/
|
||||
public void addMessagesInputNoteEmailOrAccount(String property) {
|
||||
assertPropertyNotNull(property);
|
||||
add(property, new ActionMessage(MESSAGES_INPUT_NOTE_EMAIL_OR_ACCOUNT, (Object[]) null));
|
||||
}
|
||||
|
||||
/**
|
||||
* Add the created action message for the key 'messages.input.note.password' with parameters.
|
||||
* <pre>
|
||||
* message: sea って入れてー
|
||||
* </pre>
|
||||
* @param property The property name for the message. (NotNull)
|
||||
*/
|
||||
public void addMessagesInputNotePassword(String property) {
|
||||
assertPropertyNotNull(property);
|
||||
add(property, new ActionMessage(MESSAGES_INPUT_NOTE_PASSWORD, (Object[]) null));
|
||||
}
|
||||
|
||||
/**
|
||||
* Add the created action message for the key 'messages.input.note.zipCode' with parameters.
|
||||
* <pre>
|
||||
* message: 例: 153-0051
|
||||
* </pre>
|
||||
* @param property The property name for the message. (NotNull)
|
||||
*/
|
||||
public void addMessagesInputNoteZipCode(String property) {
|
||||
assertPropertyNotNull(property);
|
||||
add(property, new ActionMessage(MESSAGES_INPUT_NOTE_ZIP_CODE, (Object[]) null));
|
||||
}
|
||||
|
||||
/**
|
||||
* Assert the property is not null.
|
||||
* @param property The value of the property. (NotNull)
|
||||
*/
|
||||
protected void assertPropertyNotNull(String property) {
|
||||
if (property == null) {
|
||||
final String msg = "The argument 'property' for message should not be null.";
|
||||
throw new IllegalArgumentException(msg);
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* The definition of keys for labels.
|
||||
* @author FreeGen
|
||||
*/
|
||||
public static interface LabelKey {
|
||||
|
||||
/** The key of the label: 会員 */
|
||||
String LABELS_MEMBER = "labels.member";
|
||||
|
||||
/** The key of the label: 会員ID */
|
||||
String LABELS_MEMBER_ID = "labels.memberId";
|
||||
|
||||
/** The key of the label: 会員名称 */
|
||||
String LABELS_MEMBER_NAME = "labels.memberName";
|
||||
|
||||
/** The key of the label: メールアドレス */
|
||||
String LABELS_EMAIL = "labels.email";
|
||||
|
||||
/** The key of the label: メアドもしくはアカウント */
|
||||
String LABELS_EMAIL_OR_ACCOUNT = "labels.emailOrAccount";
|
||||
|
||||
/** The key of the label: パスワード */
|
||||
String LABELS_PASSWORD = "labels.password";
|
||||
|
||||
/** The key of the label: バージョンNo */
|
||||
String LABELS_VERSION_NO = "labels.versionNo";
|
||||
|
||||
/** The key of the label: 一覧 */
|
||||
String LABELS_LIST = "labels.list";
|
||||
|
||||
/** The key of the label: 追加 */
|
||||
String LABELS_ADD = "labels.add";
|
||||
|
||||
/** The key of the label: 編集 */
|
||||
String LABELS_EDIT = "labels.edit";
|
||||
|
||||
/** The key of the label: 検索 */
|
||||
String LABELS_SEARCH = "labels.search";
|
||||
|
||||
/** The key of the label: 登録 */
|
||||
String LABELS_REGISTER = "labels.register";
|
||||
|
||||
/** The key of the label: 更新 */
|
||||
String LABELS_UPDATE = "labels.update";
|
||||
|
||||
/** The key of the label: @[labels.member]@[labels.list] */
|
||||
String LABELS_MEMBER_LIST = "labels.member.list";
|
||||
|
||||
/** The key of the label: @[labels.member]@[labels.add] */
|
||||
String LABELS_MEMBER_ADD = "labels.member.add";
|
||||
|
||||
/** The key of the label: @[labels.member]@[labels.edit] */
|
||||
String LABELS_MEMBER_EDIT = "labels.member.edit";
|
||||
|
||||
/** The key of the label: お知らせ */
|
||||
String LABELS_HEADER_TITLE_ERROR_MESSAGE = "labels.header.title.error.message";
|
||||
}
|
||||
}
|
|
@ -2490,8 +2490,7 @@ public class FessLabels extends ActionMessages {
|
|||
public static final String LABELS_system_info_bug_report_title = "{labels.system_info_bug_report_title}";
|
||||
|
||||
/** The key of the message: crawler.properties does not exist. Default values are applied. */
|
||||
public static final String LABELS_system_info_crawler_properties_does_not_exist =
|
||||
"{labels.system_info_crawler_properties_does_not_exist}";
|
||||
public static final String LABELS_system_info_crawler_properties_does_not_exist = "{labels.system_info_crawler_properties_does_not_exist}";
|
||||
|
||||
/** The key of the message: File Authentication */
|
||||
public static final String LABELS_file_authentication_configuration = "{labels.file_authentication_configuration}";
|
||||
|
@ -2530,8 +2529,7 @@ public class FessLabels extends ActionMessages {
|
|||
public static final String LABELS_file_authentication_list_hostname = "{labels.file_authentication_list_hostname}";
|
||||
|
||||
/** The key of the message: Config Name */
|
||||
public static final String LABELS_file_authentication_list_file_crawling_config =
|
||||
"{labels.file_authentication_list_file_crawling_config}";
|
||||
public static final String LABELS_file_authentication_list_file_crawling_config = "{labels.file_authentication_list_file_crawling_config}";
|
||||
|
||||
/** The key of the message: Any */
|
||||
public static final String LABELS_file_authentication_any = "{labels.file_authentication_any}";
|
||||
|
|
|
@ -124,8 +124,7 @@ public class FessMessages extends FessLabels {
|
|||
public static final String ERRORS_failed_to_delete_solr_index = "{errors.failed_to_delete_solr_index}";
|
||||
|
||||
/** The key of the message: Failed to start a process because of running solr process. */
|
||||
public static final String ERRORS_failed_to_start_solr_process_because_of_running =
|
||||
"{errors.failed_to_start_solr_process_because_of_running}";
|
||||
public static final String ERRORS_failed_to_start_solr_process_because_of_running = "{errors.failed_to_start_solr_process_because_of_running}";
|
||||
|
||||
/** The key of the message: Failed to restore data. */
|
||||
public static final String ERRORS_failed_to_import_data = "{errors.failed_to_import_data}";
|
||||
|
|
|
@ -20,8 +20,8 @@ public interface FessConfig extends FessEnv {
|
|||
/** The key of the configuration. e.g. 315360000 */
|
||||
String COOKIE_ETERNAL_EXPIRE = "cookie.eternal.expire";
|
||||
|
||||
/** The key of the configuration. e.g. HRB */
|
||||
String COOKIE_AUTO_LOGIN_HARBOR_KEY = "cookie.auto.login.harbor.key";
|
||||
/** The key of the configuration. e.g. FES */
|
||||
String COOKIE_REMEMBER_ME_HARBOR_KEY = "cookie.remember.me.harbor.key";
|
||||
|
||||
/** The key of the configuration. e.g. 4 */
|
||||
String PAGING_PAGE_SIZE = "paging.page.size";
|
||||
|
@ -99,12 +99,12 @@ public interface FessConfig extends FessEnv {
|
|||
Integer getCookieEternalExpireAsInteger();
|
||||
|
||||
/**
|
||||
* Get the value for the key 'cookie.auto.login.harbor.key'. <br>
|
||||
* The value is, e.g. HRB <br>
|
||||
* comment: The cookie key of auto-login for Fess
|
||||
* Get the value for the key 'cookie.remember.me.harbor.key'. <br>
|
||||
* The value is, e.g. FES <br>
|
||||
* comment: The cookie key of remember-me for Fess
|
||||
* @return The value of found property. (NotNull: if not found, exception but basically no way)
|
||||
*/
|
||||
String getCookieAutoLoginHarborKey();
|
||||
String getCookieRememberMeHarborKey();
|
||||
|
||||
/**
|
||||
* Get the value for the key 'paging.page.size'. <br>
|
||||
|
@ -189,8 +189,8 @@ public interface FessConfig extends FessEnv {
|
|||
return getAsInteger(FessConfig.COOKIE_ETERNAL_EXPIRE);
|
||||
}
|
||||
|
||||
public String getCookieAutoLoginHarborKey() {
|
||||
return get(FessConfig.COOKIE_AUTO_LOGIN_HARBOR_KEY);
|
||||
public String getCookieRememberMeHarborKey() {
|
||||
return get(FessConfig.COOKIE_REMEMBER_ME_HARBOR_KEY);
|
||||
}
|
||||
|
||||
public String getPagingPageSize() {
|
||||
|
|
|
@ -23,6 +23,18 @@ public interface FessEnv {
|
|||
/** The key of the configuration. e.g. 0 */
|
||||
String TIME_ADJUST_TIME_MILLIS = "time.adjust.time.millis";
|
||||
|
||||
/** The key of the configuration. e.g. true */
|
||||
String MAIL_SEND_MOCK = "mail.send.mock";
|
||||
|
||||
/** The key of the configuration. e.g. localhost:25 */
|
||||
String MAIL_SMTP_SERVER_MAIN_HOST_AND_PORT = "mail.smtp.server.main.host.and.port";
|
||||
|
||||
/** The key of the configuration. e.g. [Test] */
|
||||
String MAIL_SUBJECT_TEST_PREFIX = "mail.subject.test.prefix";
|
||||
|
||||
/** The key of the configuration. e.g. returnpath@docksidestage.org */
|
||||
String MAIL_RETURN_PATH = "mail.return.path";
|
||||
|
||||
/**
|
||||
* Get the value of property as {@link String}.
|
||||
* @param propertyKey The key of the property. (NotNull)
|
||||
|
@ -104,6 +116,46 @@ public interface FessEnv {
|
|||
*/
|
||||
Long getTimeAdjustTimeMillisAsLong();
|
||||
|
||||
/**
|
||||
* Get the value for the key 'mail.send.mock'. <br>
|
||||
* The value is, e.g. true <br>
|
||||
* comment: Does it send mock mail? (true: no send actually, logging only)
|
||||
* @return The value of found property. (NotNull: if not found, exception but basically no way)
|
||||
*/
|
||||
String getMailSendMock();
|
||||
|
||||
/**
|
||||
* Is the property for the key 'mail.send.mock' true? <br>
|
||||
* The value is, e.g. true <br>
|
||||
* comment: Does it send mock mail? (true: no send actually, logging only)
|
||||
* @return The determination, true or false. (if not found, exception but basically no way)
|
||||
*/
|
||||
boolean isMailSendMock();
|
||||
|
||||
/**
|
||||
* Get the value for the key 'mail.smtp.server.main.host.and.port'. <br>
|
||||
* The value is, e.g. localhost:25 <br>
|
||||
* comment: SMTP server settings for main: host:port
|
||||
* @return The value of found property. (NotNull: if not found, exception but basically no way)
|
||||
*/
|
||||
String getMailSmtpServerMainHostAndPort();
|
||||
|
||||
/**
|
||||
* Get the value for the key 'mail.subject.test.prefix'. <br>
|
||||
* The value is, e.g. [Test] <br>
|
||||
* comment: The prefix of subject to show test environment or not
|
||||
* @return The value of found property. (NotNull: if not found, exception but basically no way)
|
||||
*/
|
||||
String getMailSubjectTestPrefix();
|
||||
|
||||
/**
|
||||
* Get the value for the key 'mail.return.path'. <br>
|
||||
* The value is, e.g. returnpath@docksidestage.org <br>
|
||||
* comment: The common return path of all mail
|
||||
* @return The value of found property. (NotNull: if not found, exception but basically no way)
|
||||
*/
|
||||
String getMailReturnPath();
|
||||
|
||||
/**
|
||||
* The simple implementation for configuration.
|
||||
* @author FreeGen
|
||||
|
@ -144,5 +196,25 @@ public interface FessEnv {
|
|||
public Long getTimeAdjustTimeMillisAsLong() {
|
||||
return getAsLong(FessEnv.TIME_ADJUST_TIME_MILLIS);
|
||||
}
|
||||
|
||||
public String getMailSendMock() {
|
||||
return get(FessEnv.MAIL_SEND_MOCK);
|
||||
}
|
||||
|
||||
public boolean isMailSendMock() {
|
||||
return is(FessEnv.MAIL_SEND_MOCK);
|
||||
}
|
||||
|
||||
public String getMailSmtpServerMainHostAndPort() {
|
||||
return get(FessEnv.MAIL_SMTP_SERVER_MAIN_HOST_AND_PORT);
|
||||
}
|
||||
|
||||
public String getMailSubjectTestPrefix() {
|
||||
return get(FessEnv.MAIL_SUBJECT_TEST_PREFIX);
|
||||
}
|
||||
|
||||
public String getMailReturnPath() {
|
||||
return get(FessEnv.MAIL_RETURN_PATH);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
|
@ -0,0 +1,143 @@
|
|||
/*
|
||||
* Copyright 2009-2015 the CodeLibs Project and the Others.
|
||||
*
|
||||
* Licensed under the Apache License, Version 2.0 (the "License");
|
||||
* you may not use this file except in compliance with the License.
|
||||
* You may obtain a copy of the License at
|
||||
*
|
||||
* http://www.apache.org/licenses/LICENSE-2.0
|
||||
*
|
||||
* Unless required by applicable law or agreed to in writing, software
|
||||
* distributed under the License is distributed on an "AS IS" BASIS,
|
||||
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND,
|
||||
* either express or implied. See the License for the specific language
|
||||
* governing permissions and limitations under the License.
|
||||
*/
|
||||
package org.codelibs.fess.mylasta.direction;
|
||||
|
||||
import javax.annotation.Resource;
|
||||
|
||||
import org.codelibs.fess.mylasta.direction.sponsor.FessActionAdjustmentProvider;
|
||||
import org.codelibs.fess.mylasta.direction.sponsor.FessApiFailureHook;
|
||||
import org.codelibs.fess.mylasta.direction.sponsor.FessCookieResourceProvider;
|
||||
import org.codelibs.fess.mylasta.direction.sponsor.FessCurtainBeforeListener;
|
||||
import org.codelibs.fess.mylasta.direction.sponsor.FessListedClassificationProvider;
|
||||
import org.codelibs.fess.mylasta.direction.sponsor.FessMailDeliveryDepartmentCreator;
|
||||
import org.codelibs.fess.mylasta.direction.sponsor.FessSecurityResourceProvider;
|
||||
import org.codelibs.fess.mylasta.direction.sponsor.FessTimeResourceProvider;
|
||||
import org.codelibs.fess.mylasta.direction.sponsor.FessUserLocaleProcessProvider;
|
||||
import org.codelibs.fess.mylasta.direction.sponsor.FessUserTimeZoneProcessProvider;
|
||||
import org.lastaflute.core.direction.CachedFwAssistantDirector;
|
||||
import org.lastaflute.core.direction.FwAssistDirection;
|
||||
import org.lastaflute.core.direction.FwCoreDirection;
|
||||
import org.lastaflute.core.security.InvertibleCryptographer;
|
||||
import org.lastaflute.core.security.OneWayCryptographer;
|
||||
import org.lastaflute.db.dbflute.classification.ListedClassificationProvider;
|
||||
import org.lastaflute.db.direction.FwDbDirection;
|
||||
import org.lastaflute.web.direction.FwWebDirection;
|
||||
|
||||
/**
|
||||
* @author jflute
|
||||
*/
|
||||
public class FessFwAssistantDirector extends CachedFwAssistantDirector {
|
||||
|
||||
// ===================================================================================
|
||||
// Attribute
|
||||
// =========
|
||||
@Resource
|
||||
protected FessConfig fessConfig;
|
||||
|
||||
// ===================================================================================
|
||||
// Assist
|
||||
// ======
|
||||
@Override
|
||||
protected void prepareAssistDirection(FwAssistDirection direction) {
|
||||
direction.directConfig(nameList -> nameList.add("fess_config.properties"), "fess_env.properties");
|
||||
}
|
||||
|
||||
// ===================================================================================
|
||||
// Core
|
||||
// ======
|
||||
@Override
|
||||
protected void prepareCoreDirection(FwCoreDirection direction) {
|
||||
// this configuration is on fess_env.properties because this is true only when development
|
||||
direction.directDevelopmentHere(fessConfig.isDevelopmentHere());
|
||||
|
||||
// titles of the application for logging are from configurations
|
||||
direction.directLoggingTitle(fessConfig.getDomainTitle(), fessConfig.getEnvironmentTitle());
|
||||
|
||||
// this configuration is on sea_env.properties because it has no influence to production
|
||||
// even if you set true manually and forget to set false back
|
||||
direction.directFrameworkDebug(fessConfig.isFrameworkDebug()); // basically false
|
||||
|
||||
// you can add your own process when your application is booting
|
||||
direction.directCurtainBefore(createBootListener());
|
||||
|
||||
direction.directSecurity(createSecurityResourceProvider());
|
||||
direction.directTime(createTimeResourceProvider());
|
||||
direction.directMail(createFessMailDeliveryDepartmentCreator().create());
|
||||
}
|
||||
|
||||
protected FessCurtainBeforeListener createBootListener() {
|
||||
return new FessCurtainBeforeListener();
|
||||
}
|
||||
|
||||
protected FessSecurityResourceProvider createSecurityResourceProvider() { // #change_it_first
|
||||
final InvertibleCryptographer inver = InvertibleCryptographer.createAesCipher("*unused@");
|
||||
final OneWayCryptographer oneWay = OneWayCryptographer.createSha256Cryptographer();
|
||||
return new FessSecurityResourceProvider(inver, oneWay);
|
||||
}
|
||||
|
||||
protected FessTimeResourceProvider createTimeResourceProvider() {
|
||||
return new FessTimeResourceProvider(fessConfig);
|
||||
}
|
||||
|
||||
protected FessMailDeliveryDepartmentCreator createFessMailDeliveryDepartmentCreator() {
|
||||
return new FessMailDeliveryDepartmentCreator(fessConfig);
|
||||
}
|
||||
|
||||
// ===================================================================================
|
||||
// DB
|
||||
// ====
|
||||
@Override
|
||||
protected void prepareDbDirection(FwDbDirection direction) {
|
||||
direction.directClassification(createListedClassificationProvider());
|
||||
}
|
||||
|
||||
protected ListedClassificationProvider createListedClassificationProvider() {
|
||||
return new FessListedClassificationProvider();
|
||||
}
|
||||
|
||||
// ===================================================================================
|
||||
// Web
|
||||
// =====
|
||||
@Override
|
||||
protected void prepareWebDirection(FwWebDirection direction) {
|
||||
direction.directRequest(createUserLocaleProcessProvider(), createUserTimeZoneProcessProvider());
|
||||
direction.directCookie(createCookieResourceProvider());
|
||||
direction.directAdjustment(createActionAdjustmentProvider());
|
||||
direction.directMessage(nameList -> nameList.add("fess_message"), "fess_label");
|
||||
direction.directApiCall(createApiFailureHook());
|
||||
}
|
||||
|
||||
protected FessUserLocaleProcessProvider createUserLocaleProcessProvider() {
|
||||
return new FessUserLocaleProcessProvider();
|
||||
}
|
||||
|
||||
protected FessUserTimeZoneProcessProvider createUserTimeZoneProcessProvider() {
|
||||
return new FessUserTimeZoneProcessProvider();
|
||||
}
|
||||
|
||||
protected FessCookieResourceProvider createCookieResourceProvider() { // #change_it_first
|
||||
final InvertibleCryptographer cr = InvertibleCryptographer.createAesCipher("*unused@");
|
||||
return new FessCookieResourceProvider(fessConfig, cr);
|
||||
}
|
||||
|
||||
protected FessActionAdjustmentProvider createActionAdjustmentProvider() {
|
||||
return new FessActionAdjustmentProvider();
|
||||
}
|
||||
|
||||
protected FessApiFailureHook createApiFailureHook() {
|
||||
return new FessApiFailureHook();
|
||||
}
|
||||
}
|
|
@ -1,5 +1,5 @@
|
|||
/*
|
||||
* Copyright 2009-2015 the CodeLibs Project and the Others.
|
||||
* Copyright 2014-2015 the original author or authors.
|
||||
*
|
||||
* Licensed under the Apache License, Version 2.0 (the "License");
|
||||
* you may not use this file except in compliance with the License.
|
||||
|
@ -13,20 +13,23 @@
|
|||
* either express or implied. See the License for the specific language
|
||||
* governing permissions and limitations under the License.
|
||||
*/
|
||||
package org.codelibs.fess.lasta.web.action;
|
||||
package org.codelibs.fess.mylasta.direction.sponsor;
|
||||
|
||||
import java.lang.annotation.ElementType;
|
||||
import java.lang.annotation.Inherited;
|
||||
import java.lang.annotation.Retention;
|
||||
import java.lang.annotation.RetentionPolicy;
|
||||
import java.lang.annotation.Target;
|
||||
import org.dbflute.util.DfTypeUtil;
|
||||
import org.lastaflute.web.path.ActionAdjustmentProvider;
|
||||
|
||||
/**
|
||||
* @author jflute
|
||||
*/
|
||||
// needs inheritance when type because action is enhanced
|
||||
@Inherited
|
||||
@Retention(RetentionPolicy.RUNTIME)
|
||||
@Target({ ElementType.TYPE, ElementType.METHOD })
|
||||
public @interface FessLoginRequired {
|
||||
public class FessActionAdjustmentProvider implements ActionAdjustmentProvider {
|
||||
|
||||
// _/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/
|
||||
// you can adjust your actions by overriding
|
||||
// default methods defined at the interface
|
||||
// _/_/_/_/_/_/_/_/_/_/
|
||||
|
||||
@Override
|
||||
public String toString() {
|
||||
return DfTypeUtil.toClassTitle(this) + ":{}";
|
||||
}
|
||||
}
|
|
@ -0,0 +1,91 @@
|
|||
/*
|
||||
* Copyright 2014-2015 the original author or authors.
|
||||
*
|
||||
* Licensed under the Apache License, Version 2.0 (the "License");
|
||||
* you may not use this file except in compliance with the License.
|
||||
* You may obtain a copy of the License at
|
||||
*
|
||||
* http://www.apache.org/licenses/LICENSE-2.0
|
||||
*
|
||||
* Unless required by applicable law or agreed to in writing, software
|
||||
* distributed under the License is distributed on an "AS IS" BASIS,
|
||||
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND,
|
||||
* either express or implied. See the License for the specific language
|
||||
* governing permissions and limitations under the License.
|
||||
*/
|
||||
package org.codelibs.fess.mylasta.direction.sponsor;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
import org.dbflute.optional.OptionalThing;
|
||||
import org.lastaflute.web.api.ApiFailureHook;
|
||||
import org.lastaflute.web.api.ApiFailureResource;
|
||||
import org.lastaflute.web.login.exception.LoginUnauthorizedException;
|
||||
import org.lastaflute.web.response.ApiResponse;
|
||||
import org.lastaflute.web.response.JsonResponse;
|
||||
|
||||
/**
|
||||
* @author jflute
|
||||
*/
|
||||
public class FessApiFailureHook implements ApiFailureHook { // #change_it for handling API failure
|
||||
|
||||
// ===================================================================================
|
||||
// Definition
|
||||
// ==========
|
||||
protected static final int HTTP_BAD_REQUEST = 400;
|
||||
protected static final int HTTP_UNAUTHORIZED = 401;
|
||||
|
||||
// ===================================================================================
|
||||
// Business Failure
|
||||
// ================
|
||||
@Override
|
||||
public ApiResponse handleValidationError(ApiFailureResource resource) {
|
||||
return asJson(createFailureBean(resource)).httpStatus(HTTP_BAD_REQUEST);
|
||||
}
|
||||
|
||||
@Override
|
||||
public ApiResponse handleApplicationException(ApiFailureResource resource, RuntimeException cause) {
|
||||
final int status;
|
||||
if (cause instanceof LoginUnauthorizedException) {
|
||||
status = HTTP_UNAUTHORIZED; // unauthorized
|
||||
} else {
|
||||
status = HTTP_BAD_REQUEST; // bad request
|
||||
}
|
||||
return asJson(createFailureBean(resource)).httpStatus(status);
|
||||
}
|
||||
|
||||
// ===================================================================================
|
||||
// System Failure
|
||||
// ==============
|
||||
@Override
|
||||
public OptionalThing<ApiResponse> handleClientException(ApiFailureResource resource, RuntimeException cause) {
|
||||
return OptionalThing.empty(); // means empty body (HTTP status will be automatically sent)
|
||||
}
|
||||
|
||||
@Override
|
||||
public OptionalThing<ApiResponse> handleServerException(ApiFailureResource resource, Throwable cause) {
|
||||
return OptionalThing.empty(); // means empty body (HTTP status will be automatically sent)
|
||||
}
|
||||
|
||||
// ===================================================================================
|
||||
// Assist Logic
|
||||
// ============
|
||||
protected JsonResponse<TooSimpleFailureBean> asJson(TooSimpleFailureBean bean) {
|
||||
return new JsonResponse<TooSimpleFailureBean>(bean);
|
||||
}
|
||||
|
||||
protected TooSimpleFailureBean createFailureBean(ApiFailureResource resource) {
|
||||
return new TooSimpleFailureBean(resource.getMessageList());
|
||||
}
|
||||
|
||||
public static class TooSimpleFailureBean {
|
||||
|
||||
public final String notice = "[Attension] tentative JSON so you should change it: " + FessApiFailureHook.class;
|
||||
|
||||
public final List<String> messageList;
|
||||
|
||||
public TooSimpleFailureBean(List<String> messageList) {
|
||||
this.messageList = messageList;
|
||||
}
|
||||
}
|
||||
}
|
|
@ -0,0 +1,46 @@
|
|||
/*
|
||||
* Copyright 2014-2015 the original author or authors.
|
||||
*
|
||||
* Licensed under the Apache License, Version 2.0 (the "License");
|
||||
* you may not use this file except in compliance with the License.
|
||||
* You may obtain a copy of the License at
|
||||
*
|
||||
* http://www.apache.org/licenses/LICENSE-2.0
|
||||
*
|
||||
* Unless required by applicable law or agreed to in writing, software
|
||||
* distributed under the License is distributed on an "AS IS" BASIS,
|
||||
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND,
|
||||
* either express or implied. See the License for the specific language
|
||||
* governing permissions and limitations under the License.
|
||||
*/
|
||||
package org.codelibs.fess.mylasta.direction.sponsor;
|
||||
|
||||
import org.codelibs.fess.mylasta.direction.FessConfig;
|
||||
import org.lastaflute.core.security.InvertibleCryptographer;
|
||||
import org.lastaflute.web.servlet.cookie.CookieResourceProvider;
|
||||
|
||||
/**
|
||||
* @author jflute
|
||||
*/
|
||||
public class FessCookieResourceProvider implements CookieResourceProvider {
|
||||
|
||||
protected final FessConfig harborConfig;
|
||||
protected final InvertibleCryptographer cookieCipher;
|
||||
|
||||
public FessCookieResourceProvider(FessConfig harborConfig, InvertibleCryptographer cookieCipher) {
|
||||
this.harborConfig = harborConfig;
|
||||
this.cookieCipher = cookieCipher;
|
||||
}
|
||||
|
||||
public String provideDefaultPath() {
|
||||
return harborConfig.getCookieDefaultPath();
|
||||
}
|
||||
|
||||
public Integer provideDefaultExpire() {
|
||||
return harborConfig.getCookieDefaultExpireAsInteger();
|
||||
}
|
||||
|
||||
public InvertibleCryptographer provideCipher() {
|
||||
return cookieCipher;
|
||||
}
|
||||
}
|
|
@ -0,0 +1,55 @@
|
|||
/*
|
||||
* Copyright 2014-2015 the original author or authors.
|
||||
*
|
||||
* Licensed under the Apache License, Version 2.0 (the "License");
|
||||
* you may not use this file except in compliance with the License.
|
||||
* You may obtain a copy of the License at
|
||||
*
|
||||
* http://www.apache.org/licenses/LICENSE-2.0
|
||||
*
|
||||
* Unless required by applicable law or agreed to in writing, software
|
||||
* distributed under the License is distributed on an "AS IS" BASIS,
|
||||
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND,
|
||||
* either express or implied. See the License for the specific language
|
||||
* governing permissions and limitations under the License.
|
||||
*/
|
||||
package org.codelibs.fess.mylasta.direction.sponsor;
|
||||
|
||||
import java.util.TimeZone;
|
||||
|
||||
import org.dbflute.system.DBFluteSystem;
|
||||
import org.dbflute.system.provider.DfFinalTimeZoneProvider;
|
||||
import org.dbflute.util.DfTypeUtil;
|
||||
import org.lastaflute.core.direction.CurtainBeforeListener;
|
||||
import org.lastaflute.core.direction.FwAssistantDirector;
|
||||
|
||||
/**
|
||||
* @author jflute
|
||||
*/
|
||||
public class FessCurtainBeforeListener implements CurtainBeforeListener {
|
||||
|
||||
public void listen(FwAssistantDirector assistantDirector) {
|
||||
processDBFluteSystem();
|
||||
}
|
||||
|
||||
protected void processDBFluteSystem() {
|
||||
DBFluteSystem.unlock();
|
||||
DBFluteSystem.setFinalTimeZoneProvider(createFinalTimeZoneProvider());
|
||||
DBFluteSystem.lock();
|
||||
}
|
||||
|
||||
protected DfFinalTimeZoneProvider createFinalTimeZoneProvider() {
|
||||
return new DfFinalTimeZoneProvider() {
|
||||
protected final TimeZone provided = FessUserTimeZoneProcessProvider.centralTimeZone;
|
||||
|
||||
public TimeZone provide() {
|
||||
return provided;
|
||||
}
|
||||
|
||||
@Override
|
||||
public String toString() {
|
||||
return DfTypeUtil.toClassTitle(this) + ":{" + provided.getID() + "}";
|
||||
}
|
||||
};
|
||||
}
|
||||
}
|
|
@ -0,0 +1,63 @@
|
|||
/*
|
||||
* Copyright 2014-2015 the original author or authors.
|
||||
*
|
||||
* Licensed under the Apache License, Version 2.0 (the "License");
|
||||
* you may not use this file except in compliance with the License.
|
||||
* You may obtain a copy of the License at
|
||||
*
|
||||
* http://www.apache.org/licenses/LICENSE-2.0
|
||||
*
|
||||
* Unless required by applicable law or agreed to in writing, software
|
||||
* distributed under the License is distributed on an "AS IS" BASIS,
|
||||
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND,
|
||||
* either express or implied. See the License for the specific language
|
||||
* governing permissions and limitations under the License.
|
||||
*/
|
||||
package org.codelibs.fess.mylasta.direction.sponsor;
|
||||
|
||||
import java.util.Locale;
|
||||
|
||||
import org.dbflute.jdbc.ClassificationMeta;
|
||||
import org.dbflute.optional.OptionalObject;
|
||||
import org.dbflute.optional.OptionalThing;
|
||||
import org.lastaflute.db.dbflute.classification.ListedClassificationProvider;
|
||||
import org.lastaflute.db.dbflute.exception.ProvidedClassificationNotFoundException;
|
||||
|
||||
/**
|
||||
* @author jflute
|
||||
*/
|
||||
public class FessListedClassificationProvider implements ListedClassificationProvider {
|
||||
|
||||
public ClassificationMeta provide(String classificationName) throws ProvidedClassificationNotFoundException {
|
||||
final ClassificationMeta onMainSchema = findOnMainSchema(classificationName);
|
||||
if (onMainSchema == null) {
|
||||
String msg = "Not found the classification: " + classificationName;
|
||||
throw new ProvidedClassificationNotFoundException(msg);
|
||||
}
|
||||
return onMainSchema;
|
||||
}
|
||||
|
||||
protected ClassificationMeta findOnMainSchema(String classificationName) throws ProvidedClassificationNotFoundException {
|
||||
// *no use DBFlute classification
|
||||
return null;
|
||||
//String searchName = classificationName;
|
||||
//if (classificationName.contains(".")) {
|
||||
// final String dbName = Srl.substringFirstFront(classificationName, ".");
|
||||
// if (dbName.equals(DBCurrent.getInstance().projectName())) {
|
||||
// searchName = Srl.substringFirstRear(classificationName, ".");
|
||||
// } else {
|
||||
// return null;
|
||||
// }
|
||||
//}
|
||||
//try {
|
||||
// return CDef.DefMeta.valueOf(searchName);
|
||||
//} catch (IllegalArgumentException ignored) { // not found
|
||||
// return null; // handled later
|
||||
//}
|
||||
}
|
||||
|
||||
@Override
|
||||
public OptionalThing<String> determineAlias(Locale locale) {
|
||||
return OptionalObject.empty();
|
||||
}
|
||||
}
|
|
@ -0,0 +1,150 @@
|
|||
/*
|
||||
* Copyright 2014-2015 the original author or authors.
|
||||
*
|
||||
* Licensed under the Apache License, Version 2.0 (the "License");
|
||||
* you may not use this file except in compliance with the License.
|
||||
* You may obtain a copy of the License at
|
||||
*
|
||||
* http://www.apache.org/licenses/LICENSE-2.0
|
||||
*
|
||||
* Unless required by applicable law or agreed to in writing, software
|
||||
* distributed under the License is distributed on an "AS IS" BASIS,
|
||||
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND,
|
||||
* either express or implied. See the License for the specific language
|
||||
* governing permissions and limitations under the License.
|
||||
*/
|
||||
package org.codelibs.fess.mylasta.direction.sponsor;
|
||||
|
||||
import java.util.List;
|
||||
import java.util.Locale;
|
||||
|
||||
import org.codelibs.fess.mylasta.direction.FessConfig;
|
||||
import org.dbflute.mail.send.SMailDeliveryDepartment;
|
||||
import org.dbflute.mail.send.SMailPostalMotorbike;
|
||||
import org.dbflute.mail.send.SMailPostalParkingLot;
|
||||
import org.dbflute.mail.send.SMailPostalPersonnel;
|
||||
import org.dbflute.mail.send.embedded.personnel.SMailDogmaticPostalPersonnel;
|
||||
import org.dbflute.mail.send.embedded.receptionist.SMailConventionReceptionist;
|
||||
import org.dbflute.mail.send.supplement.async.SMailAsyncStrategy;
|
||||
import org.dbflute.mail.send.supplement.filter.SMailSubjectFilter;
|
||||
import org.dbflute.mail.send.supplement.label.SMailLabelStrategy;
|
||||
import org.dbflute.optional.OptionalThing;
|
||||
import org.dbflute.util.DfStringUtil;
|
||||
import org.lastaflute.core.magic.async.AsyncManager;
|
||||
import org.lastaflute.core.magic.async.ConcurrentAsyncCall;
|
||||
import org.lastaflute.core.message.MessageManager;
|
||||
import org.lastaflute.core.util.ContainerUtil;
|
||||
|
||||
/**
|
||||
* @author jflute
|
||||
*/
|
||||
public class FessMailDeliveryDepartmentCreator {
|
||||
|
||||
// ===================================================================================
|
||||
// Attribute
|
||||
// =========
|
||||
protected final FessConfig fessConfig;
|
||||
|
||||
// ===================================================================================
|
||||
// Constructor
|
||||
// ===========
|
||||
public FessMailDeliveryDepartmentCreator(FessConfig fessConfig) {
|
||||
this.fessConfig = fessConfig;
|
||||
}
|
||||
|
||||
// ===================================================================================
|
||||
// Create
|
||||
// ======
|
||||
public SMailDeliveryDepartment create() {
|
||||
return new SMailDeliveryDepartment(createPostalParkingLot(), createPostalPersonnel());
|
||||
}
|
||||
|
||||
// -----------------------------------------------------
|
||||
// Postal Parking Lot
|
||||
// ------------------
|
||||
protected SMailPostalParkingLot createPostalParkingLot() {
|
||||
final SMailPostalParkingLot parkingLot = new SMailPostalParkingLot();
|
||||
final SMailPostalMotorbike motorbike = new SMailPostalMotorbike();
|
||||
final String hostAndPort = fessConfig.getMailSmtpServerMainHostAndPort();
|
||||
final List<String> hostPortList = DfStringUtil.splitListTrimmed(hostAndPort, ":");
|
||||
motorbike.registerConnectionInfo(hostPortList.get(0), Integer.parseInt(hostPortList.get(1)));
|
||||
motorbike.registerReturnPath(fessConfig.getMailReturnPath());
|
||||
parkingLot.registerMotorbikeAsMain(motorbike);
|
||||
return parkingLot;
|
||||
}
|
||||
|
||||
// -----------------------------------------------------
|
||||
// Postal Personnel
|
||||
// ----------------
|
||||
protected SMailPostalPersonnel createPostalPersonnel() {
|
||||
final SMailDogmaticPostalPersonnel personnel = createDogmaticPostalPersonnel();
|
||||
return fessConfig.isMailSendMock() ? personnel.asTraining() : personnel;
|
||||
}
|
||||
|
||||
protected SMailDogmaticPostalPersonnel createDogmaticPostalPersonnel() { // #ext_point e.g. locale, database
|
||||
final String testPrefix = fessConfig.getMailSubjectTestPrefix();
|
||||
final AsyncManager asyncManager = getAsyncManager();
|
||||
final MessageManager messageManager = getMessageManager();
|
||||
return new SMailDogmaticPostalPersonnel() {
|
||||
|
||||
// *if you need user locale switching or templates from database,
|
||||
// override createConventionReceptionist() (see the method for the details)
|
||||
@Override
|
||||
protected SMailConventionReceptionist createConventionReceptionist() {
|
||||
return super.createConventionReceptionist().asReceiverLocale(postcard -> {
|
||||
return OptionalThing.empty();
|
||||
});
|
||||
}
|
||||
|
||||
@Override
|
||||
protected OptionalThing<SMailSubjectFilter> createSubjectFilter() {
|
||||
return OptionalThing.of((view, subject) -> testPrefix + subject);
|
||||
}
|
||||
|
||||
@Override
|
||||
protected OptionalThing<SMailAsyncStrategy> createAsyncStrategy() {
|
||||
return OptionalThing.of((view, runnable) -> async(asyncManager, runnable));
|
||||
}
|
||||
|
||||
@Override
|
||||
protected OptionalThing<SMailLabelStrategy> createLabelStrategy() {
|
||||
return OptionalThing.of((view, locale, label) -> resolveLabelIfNeeds(messageManager, locale, label));
|
||||
}
|
||||
};
|
||||
}
|
||||
|
||||
// ===================================================================================
|
||||
// Asynchronous
|
||||
// ============
|
||||
protected void async(AsyncManager asyncManager, Runnable runnable) {
|
||||
asyncManager.async(new ConcurrentAsyncCall() {
|
||||
@Override
|
||||
public void callback() {
|
||||
runnable.run();
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean asPrimary() {
|
||||
return true; // mail is primary business
|
||||
}
|
||||
});
|
||||
}
|
||||
|
||||
// ===================================================================================
|
||||
// Resolve Label
|
||||
// =============
|
||||
protected String resolveLabelIfNeeds(MessageManager messageManager, Locale locale, String label) {
|
||||
return label.startsWith("labels.") ? messageManager.getMessage(locale, label) : label;
|
||||
}
|
||||
|
||||
// ===================================================================================
|
||||
// Component
|
||||
// =========
|
||||
protected MessageManager getMessageManager() {
|
||||
return ContainerUtil.getComponent(MessageManager.class);
|
||||
}
|
||||
|
||||
protected AsyncManager getAsyncManager() {
|
||||
return ContainerUtil.getComponent(AsyncManager.class);
|
||||
}
|
||||
}
|
|
@ -0,0 +1,398 @@
|
|||
/*
|
||||
* Copyright 2014-2015 the original author or authors.
|
||||
*
|
||||
* Licensed under the Apache License, Version 2.0 (the "License");
|
||||
* you may not use this file except in compliance with the License.
|
||||
* You may obtain a copy of the License at
|
||||
*
|
||||
* http://www.apache.org/licenses/LICENSE-2.0
|
||||
*
|
||||
* Unless required by applicable law or agreed to in writing, software
|
||||
* distributed under the License is distributed on an "AS IS" BASIS,
|
||||
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND,
|
||||
* either express or implied. See the License for the specific language
|
||||
* governing permissions and limitations under the License.
|
||||
*/
|
||||
package org.codelibs.fess.mylasta.direction.sponsor;
|
||||
|
||||
import java.io.File;
|
||||
import java.io.IOException;
|
||||
import java.io.InputStream;
|
||||
import java.io.Serializable;
|
||||
import java.util.Hashtable;
|
||||
import java.util.Iterator;
|
||||
import java.util.List;
|
||||
import java.util.Map;
|
||||
|
||||
import javax.servlet.ServletException;
|
||||
import javax.servlet.http.HttpServletRequest;
|
||||
|
||||
import org.apache.commons.fileupload.FileItem;
|
||||
import org.apache.commons.fileupload.FileUploadBase.SizeLimitExceededException;
|
||||
import org.apache.commons.fileupload.FileUploadException;
|
||||
import org.apache.commons.fileupload.disk.DiskFileItemFactory;
|
||||
import org.apache.commons.fileupload.servlet.ServletFileUpload;
|
||||
import org.dbflute.helper.message.ExceptionMessageBuilder;
|
||||
import org.lastaflute.web.LastaWebKey;
|
||||
import org.lastaflute.web.exception.ForcedRequest404NotFoundException;
|
||||
import org.lastaflute.web.ruts.config.ModuleConfig;
|
||||
import org.lastaflute.web.ruts.multipart.MultipartFormFile;
|
||||
import org.lastaflute.web.ruts.multipart.MultipartRequestHandler;
|
||||
import org.lastaflute.web.ruts.multipart.MultipartRequestWrapper;
|
||||
import org.lastaflute.web.ruts.multipart.exception.MultipartExceededException;
|
||||
import org.lastaflute.web.util.LaServletContextUtil;
|
||||
import org.slf4j.Logger;
|
||||
import org.slf4j.LoggerFactory;
|
||||
|
||||
/**
|
||||
* @author modified by jflute (originated in Seasar)
|
||||
*/
|
||||
public class FessMultipartRequestHandler implements MultipartRequestHandler {
|
||||
|
||||
// ===================================================================================
|
||||
// Definition
|
||||
// ==========
|
||||
private static final Logger logger = LoggerFactory.getLogger(FessMultipartRequestHandler.class);
|
||||
public static final long DEFAULT_SIZE_MAX = 250 * 1024 * 1024; // 250MB
|
||||
public static final int DEFAULT_SIZE_THRESHOLD = 256 * 1024; // 250KB
|
||||
protected static final String CONTEXT_TEMPDIR_KEY = "javax.servlet.context.tempdir";
|
||||
protected static final String JAVA_IO_TMPDIR_KEY = "java.io.tmpdir";
|
||||
|
||||
// ===================================================================================
|
||||
// Attribute
|
||||
// =========
|
||||
protected Map<String, Object> elementsAll;
|
||||
protected Map<String, MultipartFormFile> elementsFile;
|
||||
protected Map<String, String[]> elementsText;
|
||||
|
||||
// ===================================================================================
|
||||
// Handle Request
|
||||
// ==============
|
||||
@Override
|
||||
public void handleRequest(HttpServletRequest request) throws ServletException {
|
||||
// /- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
|
||||
// copied from super's method and extends it
|
||||
// basically for JVN#14876762
|
||||
// thought not all problems are resolved however the main case is safety
|
||||
// - - - - - - - - - -/
|
||||
final ServletFileUpload upload = createServletFileUpload(request);
|
||||
prepareElementsHash();
|
||||
try {
|
||||
final List<FileItem> items = parseRequest(request, upload);
|
||||
mappingParameter(request, items);
|
||||
} catch (SizeLimitExceededException e) {
|
||||
handleSizeLimitExceededException(request, e);
|
||||
} catch (FileUploadException e) {
|
||||
handleFileUploadException(e);
|
||||
}
|
||||
}
|
||||
|
||||
protected ModuleConfig getModuleConfig(HttpServletRequest request) {
|
||||
return (ModuleConfig) request.getAttribute(LastaWebKey.MODULE_CONFIG_KEY);
|
||||
}
|
||||
|
||||
// ===================================================================================
|
||||
// Create ServletFileUpload
|
||||
// ========================
|
||||
protected ServletFileUpload createServletFileUpload(HttpServletRequest request) {
|
||||
final DiskFileItemFactory fileItemFactory = createDiskFileItemFactory();
|
||||
final ServletFileUpload upload = newServletFileUpload(fileItemFactory);
|
||||
upload.setHeaderEncoding(request.getCharacterEncoding());
|
||||
upload.setSizeMax(getSizeMax());
|
||||
return upload;
|
||||
}
|
||||
|
||||
protected ServletFileUpload newServletFileUpload(DiskFileItemFactory fileItemFactory) {
|
||||
return new ServletFileUpload(fileItemFactory) {
|
||||
@Override
|
||||
protected byte[] getBoundary(String contentType) { // for security
|
||||
final byte[] boundary = super.getBoundary(contentType);
|
||||
checkBoundarySize(contentType, boundary);
|
||||
return boundary;
|
||||
}
|
||||
};
|
||||
}
|
||||
|
||||
protected void checkBoundarySize(String contentType, byte[] boundary) {
|
||||
final int boundarySize = boundary.length;
|
||||
final int limitSize = getBoundaryLimitSize();
|
||||
if (boundarySize > getBoundaryLimitSize()) {
|
||||
throwTooLongBoundarySizeException(contentType, boundarySize, limitSize);
|
||||
}
|
||||
}
|
||||
|
||||
protected int getBoundaryLimitSize() {
|
||||
// one HTTP proxy tool already limits the size (e.g. 3450 bytes)
|
||||
// so specify this size for test
|
||||
return 2000; // you can override as you like it
|
||||
}
|
||||
|
||||
protected void throwTooLongBoundarySizeException(String contentType, int boundarySize, int limitSize) {
|
||||
final ExceptionMessageBuilder br = new ExceptionMessageBuilder();
|
||||
br.addNotice("Too long boundary size so treats it as 404.");
|
||||
br.addItem("Advice");
|
||||
br.addElement("Against for JVN14876762.");
|
||||
br.addElement("Boundary size is limited by Framework.");
|
||||
br.addElement("Too long boundary is treated as 404 because it's thought of as attack.");
|
||||
br.addElement("");
|
||||
br.addElement("While, you can override the boundary limit size");
|
||||
br.addElement(" in " + FessMultipartRequestHandler.class.getSimpleName() + ".");
|
||||
br.addItem("Content Type");
|
||||
br.addElement(contentType);
|
||||
br.addItem("Boundary Size");
|
||||
br.addElement(boundarySize);
|
||||
br.addItem("Limit Size");
|
||||
br.addElement(limitSize);
|
||||
final String msg = br.buildExceptionMessage();
|
||||
throw new ForcedRequest404NotFoundException(msg); // heavy attack!? so give no page to tell wasted action
|
||||
}
|
||||
|
||||
protected DiskFileItemFactory createDiskFileItemFactory() {
|
||||
final File repository = createRepositoryFile();
|
||||
return new DiskFileItemFactory((int) getSizeThreshold(), repository);
|
||||
}
|
||||
|
||||
protected File createRepositoryFile() {
|
||||
return new File(getRepositoryPath());
|
||||
}
|
||||
|
||||
// ===================================================================================
|
||||
// Handling Parts
|
||||
// ==============
|
||||
protected void prepareElementsHash() {
|
||||
elementsText = new Hashtable<String, String[]>();
|
||||
elementsFile = new Hashtable<String, MultipartFormFile>();
|
||||
elementsAll = new Hashtable<String, Object>();
|
||||
}
|
||||
|
||||
protected List<FileItem> parseRequest(HttpServletRequest request, ServletFileUpload upload) throws FileUploadException {
|
||||
return upload.parseRequest(request);
|
||||
}
|
||||
|
||||
protected void mappingParameter(HttpServletRequest request, List<FileItem> items) {
|
||||
showFieldLoggingTitle();
|
||||
final Iterator<FileItem> iter = items.iterator();
|
||||
while (iter.hasNext()) {
|
||||
final FileItem item = iter.next();
|
||||
if (item.isFormField()) {
|
||||
showFormFieldParameter(item);
|
||||
addTextParameter(request, item);
|
||||
} else {
|
||||
showFileFieldParameter(item);
|
||||
addFileParameter(item);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
protected void showFieldLoggingTitle() {
|
||||
// logging filter cannot show the parameters when multi-part so logging here
|
||||
if (logger.isDebugEnabled()) {
|
||||
logger.debug("[Multipart Request Parameter]");
|
||||
}
|
||||
}
|
||||
|
||||
protected void showFormFieldParameter(FileItem item) {
|
||||
if (logger.isDebugEnabled()) {
|
||||
logger.debug("[param] {}={}", item.getFieldName(), item.getString());
|
||||
}
|
||||
}
|
||||
|
||||
protected void showFileFieldParameter(FileItem item) {
|
||||
if (logger.isDebugEnabled()) {
|
||||
logger.debug("[param] {}:{name={}, size={}}", item.getFieldName(), item.getName(), item.getSize());
|
||||
}
|
||||
}
|
||||
|
||||
protected void handleSizeLimitExceededException(HttpServletRequest request, SizeLimitExceededException e) {
|
||||
final long actual = e.getActualSize();
|
||||
final long permitted = e.getPermittedSize();
|
||||
String msg = "Exceeded size of the multipart request: actual=" + actual + " permitted=" + permitted;
|
||||
request.setAttribute(MAX_LENGTH_EXCEEDED_KEY, new MultipartExceededException(msg, actual, permitted, e));
|
||||
try {
|
||||
final InputStream is = request.getInputStream();
|
||||
try {
|
||||
final byte[] buf = new byte[1024];
|
||||
@SuppressWarnings("unused")
|
||||
int len = 0;
|
||||
while ((len = is.read(buf)) != -1) {}
|
||||
} catch (Exception ignored) {} finally {
|
||||
try {
|
||||
is.close();
|
||||
} catch (Exception ignored) {}
|
||||
}
|
||||
} catch (Exception ignored) {}
|
||||
}
|
||||
|
||||
protected void handleFileUploadException(FileUploadException e) throws ServletException {
|
||||
// suppress logging because it can be caught by logging filter
|
||||
//log.error("Failed to parse multipart request", e);
|
||||
throw new ServletException("Failed to upload the file.", e);
|
||||
}
|
||||
|
||||
// ===================================================================================
|
||||
// Roll-back
|
||||
// =========
|
||||
@Override
|
||||
public void rollback() {
|
||||
final Iterator<MultipartFormFile> iter = elementsFile.values().iterator();
|
||||
while (iter.hasNext()) {
|
||||
final MultipartFormFile formFile = iter.next();
|
||||
formFile.destroy();
|
||||
}
|
||||
}
|
||||
|
||||
// ===================================================================================
|
||||
// Add Text
|
||||
// ========
|
||||
protected void addTextParameter(HttpServletRequest request, FileItem item) {
|
||||
final String name = item.getFieldName();
|
||||
final String encoding = request.getCharacterEncoding();
|
||||
String value = null;
|
||||
boolean haveValue = false;
|
||||
if (encoding != null) {
|
||||
try {
|
||||
value = item.getString(encoding);
|
||||
haveValue = true;
|
||||
} catch (Exception e) {}
|
||||
}
|
||||
if (!haveValue) {
|
||||
try {
|
||||
value = item.getString("ISO-8859-1");
|
||||
} catch (java.io.UnsupportedEncodingException uee) {
|
||||
value = item.getString();
|
||||
}
|
||||
haveValue = true;
|
||||
}
|
||||
if (request instanceof MultipartRequestWrapper) {
|
||||
final MultipartRequestWrapper wrapper = (MultipartRequestWrapper) request;
|
||||
wrapper.setParameter(name, value);
|
||||
}
|
||||
final String[] oldArray = elementsText.get(name);
|
||||
final String[] newArray;
|
||||
if (oldArray != null) {
|
||||
newArray = new String[oldArray.length + 1];
|
||||
System.arraycopy(oldArray, 0, newArray, 0, oldArray.length);
|
||||
newArray[oldArray.length] = value;
|
||||
} else {
|
||||
newArray = new String[] { value };
|
||||
}
|
||||
elementsText.put(name, newArray);
|
||||
elementsAll.put(name, newArray);
|
||||
}
|
||||
|
||||
protected void addFileParameter(FileItem item) {
|
||||
final MultipartFormFile formFile = newActionMultipartFormFile(item);
|
||||
elementsFile.put(item.getFieldName(), formFile);
|
||||
elementsAll.put(item.getFieldName(), formFile);
|
||||
}
|
||||
|
||||
protected ActionMultipartFormFile newActionMultipartFormFile(FileItem item) {
|
||||
return new ActionMultipartFormFile(item);
|
||||
}
|
||||
|
||||
// ===================================================================================
|
||||
// Finish
|
||||
// ======
|
||||
@Override
|
||||
public void finish() {
|
||||
rollback();
|
||||
}
|
||||
|
||||
// ===================================================================================
|
||||
// Small Helper
|
||||
// ============
|
||||
protected long getSizeMax() {
|
||||
return DEFAULT_SIZE_MAX;
|
||||
}
|
||||
|
||||
protected long getSizeThreshold() {
|
||||
return DEFAULT_SIZE_THRESHOLD;
|
||||
}
|
||||
|
||||
protected String getRepositoryPath() {
|
||||
String tempDir = null;
|
||||
if (tempDir == null || tempDir.length() == 0) {
|
||||
final File tempDirFile = (File) LaServletContextUtil.getServletContext().getAttribute(CONTEXT_TEMPDIR_KEY);
|
||||
tempDir = tempDirFile.getAbsolutePath();
|
||||
if (tempDir == null || tempDir.length() == 0) {
|
||||
tempDir = System.getProperty(JAVA_IO_TMPDIR_KEY);
|
||||
}
|
||||
}
|
||||
return tempDir;
|
||||
}
|
||||
|
||||
// ===================================================================================
|
||||
// Form File
|
||||
// =========
|
||||
protected static class ActionMultipartFormFile implements MultipartFormFile, Serializable {
|
||||
|
||||
private static final long serialVersionUID = 1L;
|
||||
|
||||
protected final FileItem fileItem;
|
||||
|
||||
public ActionMultipartFormFile(FileItem fileItem) {
|
||||
this.fileItem = fileItem;
|
||||
}
|
||||
|
||||
public byte[] getFileData() throws IOException {
|
||||
return fileItem.get();
|
||||
}
|
||||
|
||||
public InputStream getInputStream() throws IOException {
|
||||
return fileItem.getInputStream();
|
||||
}
|
||||
|
||||
public String getContentType() {
|
||||
return fileItem.getContentType();
|
||||
}
|
||||
|
||||
public int getFileSize() {
|
||||
return (int) fileItem.getSize();
|
||||
}
|
||||
|
||||
public String getFileName() {
|
||||
return getBaseFileName(fileItem.getName());
|
||||
}
|
||||
|
||||
protected String getBaseFileName(String filePath) {
|
||||
final String fileName = new File(filePath).getName();
|
||||
int colonIndex = fileName.indexOf(":");
|
||||
if (colonIndex == -1) {
|
||||
colonIndex = fileName.indexOf("\\\\"); // Windows SMB
|
||||
}
|
||||
final int backslashIndex = fileName.lastIndexOf("\\");
|
||||
if (colonIndex > -1 && backslashIndex > -1) {
|
||||
return fileName.substring(backslashIndex + 1);
|
||||
} else {
|
||||
return fileName;
|
||||
}
|
||||
}
|
||||
|
||||
public void destroy() {
|
||||
fileItem.delete();
|
||||
}
|
||||
|
||||
@Override
|
||||
public String toString() {
|
||||
return "formFile:{" + getFileName() + "}";
|
||||
}
|
||||
}
|
||||
|
||||
// ===================================================================================
|
||||
// Accessor
|
||||
// ========
|
||||
@Override
|
||||
public Map<String, Object> getAllElements() {
|
||||
return elementsAll;
|
||||
}
|
||||
|
||||
@Override
|
||||
public Map<String, String[]> getTextElements() {
|
||||
return elementsText;
|
||||
}
|
||||
|
||||
@Override
|
||||
public Map<String, MultipartFormFile> getFileElements() {
|
||||
return elementsFile;
|
||||
}
|
||||
}
|
|
@ -0,0 +1,43 @@
|
|||
/*
|
||||
* Copyright 2014-2015 the original author or authors.
|
||||
*
|
||||
* Licensed under the Apache License, Version 2.0 (the "License");
|
||||
* you may not use this file except in compliance with the License.
|
||||
* You may obtain a copy of the License at
|
||||
*
|
||||
* http://www.apache.org/licenses/LICENSE-2.0
|
||||
*
|
||||
* Unless required by applicable law or agreed to in writing, software
|
||||
* distributed under the License is distributed on an "AS IS" BASIS,
|
||||
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND,
|
||||
* either express or implied. See the License for the specific language
|
||||
* governing permissions and limitations under the License.
|
||||
*/
|
||||
package org.codelibs.fess.mylasta.direction.sponsor;
|
||||
|
||||
import org.lastaflute.core.security.InvertibleCryptographer;
|
||||
import org.lastaflute.core.security.OneWayCryptographer;
|
||||
import org.lastaflute.core.security.SecurityResourceProvider;
|
||||
|
||||
/**
|
||||
* @author jflute
|
||||
*/
|
||||
public class FessSecurityResourceProvider implements SecurityResourceProvider {
|
||||
|
||||
protected final InvertibleCryptographer primaryInvertibleCryptographer;
|
||||
protected final OneWayCryptographer primaryOneWayCryptographer;
|
||||
|
||||
public FessSecurityResourceProvider(InvertibleCryptographer primaryInvertibleCryptographer,
|
||||
OneWayCryptographer primaryOneWayCryptographer) {
|
||||
this.primaryInvertibleCryptographer = primaryInvertibleCryptographer;
|
||||
this.primaryOneWayCryptographer = primaryOneWayCryptographer;
|
||||
}
|
||||
|
||||
public InvertibleCryptographer providePrimaryInvertibleCryptographer() {
|
||||
return primaryInvertibleCryptographer;
|
||||
}
|
||||
|
||||
public OneWayCryptographer providePrimaryOneWayCryptographer() {
|
||||
return primaryOneWayCryptographer;
|
||||
}
|
||||
}
|
|
@ -1,5 +1,5 @@
|
|||
/*
|
||||
* Copyright 2009-2015 the CodeLibs Project and the Others.
|
||||
* Copyright 2014-2015 the original author or authors.
|
||||
*
|
||||
* Licensed under the Apache License, Version 2.0 (the "License");
|
||||
* you may not use this file except in compliance with the License.
|
||||
|
@ -13,65 +13,48 @@
|
|||
* either express or implied. See the License for the specific language
|
||||
* governing permissions and limitations under the License.
|
||||
*/
|
||||
package org.codelibs.fess.lasta.web.action;
|
||||
package org.codelibs.fess.mylasta.direction.sponsor;
|
||||
|
||||
import java.util.TimeZone;
|
||||
|
||||
import org.codelibs.fess.mylasta.direction.FessConfig;
|
||||
import org.lastaflute.core.time.TypicalTimeResourceProvider;
|
||||
|
||||
/**
|
||||
* @author jflute
|
||||
*/
|
||||
public class FessUserBean extends TypicalUserBaseBean {
|
||||
|
||||
// ===================================================================================
|
||||
// Definition
|
||||
// ==========
|
||||
/** The serial version UID for object serialization. (Default) */
|
||||
private static final long serialVersionUID = 1L;
|
||||
|
||||
/** The user type for Member, e.g. used by access context. */
|
||||
public static final String USER_TYPE = "M";
|
||||
|
||||
/** The application type for Dockside, e.g. used by access context. */
|
||||
public static final String DOMAIN_TYPE = "DCK";
|
||||
public class FessTimeResourceProvider extends TypicalTimeResourceProvider {
|
||||
|
||||
// ===================================================================================
|
||||
// Attribute
|
||||
// =========
|
||||
protected final Long memberId;
|
||||
protected final String memberName;
|
||||
protected final FessConfig fessConfig;
|
||||
|
||||
// ===================================================================================
|
||||
// Constructor
|
||||
// ===========
|
||||
public FessUserBean() {
|
||||
memberId = null;
|
||||
memberName = null;
|
||||
public FessTimeResourceProvider(FessConfig fessConfig) {
|
||||
this.fessConfig = fessConfig;
|
||||
}
|
||||
|
||||
// ===================================================================================
|
||||
// Implementation
|
||||
// Basic Handling
|
||||
// ==============
|
||||
@Override
|
||||
public Long getUserId() {
|
||||
return memberId;
|
||||
}
|
||||
|
||||
@Override
|
||||
public String getUserType() {
|
||||
return USER_TYPE;
|
||||
}
|
||||
|
||||
@Override
|
||||
public String getDomainType() {
|
||||
return DOMAIN_TYPE;
|
||||
protected TimeZone getCentralTimeZone() {
|
||||
return FessUserTimeZoneProcessProvider.centralTimeZone;
|
||||
}
|
||||
|
||||
// ===================================================================================
|
||||
// Accessor
|
||||
// ========
|
||||
public Long getMemberId() {
|
||||
return memberId;
|
||||
// Time Adjustment
|
||||
// ===============
|
||||
@Override
|
||||
protected String getTimeAdjustTimeMillis() {
|
||||
return fessConfig.getTimeAdjustTimeMillis();
|
||||
}
|
||||
|
||||
public String getMemberName() {
|
||||
return memberName;
|
||||
@Override
|
||||
protected Long getTimeAdjustTimeMillisAsLong() {
|
||||
return fessConfig.getTimeAdjustTimeMillisAsLong();
|
||||
}
|
||||
}
|
|
@ -0,0 +1,55 @@
|
|||
/*
|
||||
* Copyright 2014-2015 the original author or authors.
|
||||
*
|
||||
* Licensed under the Apache License, Version 2.0 (the "License");
|
||||
* you may not use this file except in compliance with the License.
|
||||
* You may obtain a copy of the License at
|
||||
*
|
||||
* http://www.apache.org/licenses/LICENSE-2.0
|
||||
*
|
||||
* Unless required by applicable law or agreed to in writing, software
|
||||
* distributed under the License is distributed on an "AS IS" BASIS,
|
||||
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND,
|
||||
* either express or implied. See the License for the specific language
|
||||
* governing permissions and limitations under the License.
|
||||
*/
|
||||
package org.codelibs.fess.mylasta.direction.sponsor;
|
||||
|
||||
import java.util.Locale;
|
||||
|
||||
import org.dbflute.optional.OptionalObject;
|
||||
import org.dbflute.optional.OptionalThing;
|
||||
import org.dbflute.util.DfTypeUtil;
|
||||
import org.lastaflute.web.callback.ActionRuntime;
|
||||
import org.lastaflute.web.servlet.request.RequestManager;
|
||||
import org.lastaflute.web.servlet.request.UserLocaleProcessProvider;
|
||||
|
||||
/**
|
||||
* @author jflute
|
||||
*/
|
||||
public class FessUserLocaleProcessProvider implements UserLocaleProcessProvider {
|
||||
|
||||
@Override
|
||||
public boolean isAcceptCookieLocale() {
|
||||
return false;
|
||||
}
|
||||
|
||||
@Override
|
||||
public OptionalThing<Locale> findBusinessLocale(ActionRuntime runtimeMeta, RequestManager requestManager) {
|
||||
return OptionalObject.empty(); // to next determination
|
||||
}
|
||||
|
||||
@Override
|
||||
public OptionalThing<Locale> getRequestedLocale(RequestManager requestManager) {
|
||||
return OptionalObject.empty(); // means browser default
|
||||
}
|
||||
|
||||
// ===================================================================================
|
||||
// Basic Override
|
||||
// ==============
|
||||
@Override
|
||||
public String toString() {
|
||||
final String hash = Integer.toHexString(hashCode());
|
||||
return DfTypeUtil.toClassTitle(this) + ":{acceptCookieLocale=" + isAcceptCookieLocale() + "}@" + hash;
|
||||
}
|
||||
}
|
|
@ -1,5 +1,5 @@
|
|||
/*
|
||||
* Copyright 2009-2015 the CodeLibs Project and the Others.
|
||||
* Copyright 2014-2015 the original author or authors.
|
||||
*
|
||||
* Licensed under the Apache License, Version 2.0 (the "License");
|
||||
* you may not use this file except in compliance with the License.
|
||||
|
@ -13,10 +13,14 @@
|
|||
* either express or implied. See the License for the specific language
|
||||
* governing permissions and limitations under the License.
|
||||
*/
|
||||
package org.codelibs.fess.lasta.core.direction.sponsor;
|
||||
package org.codelibs.fess.mylasta.direction.sponsor;
|
||||
|
||||
import java.util.TimeZone;
|
||||
|
||||
import org.dbflute.optional.OptionalObject;
|
||||
import org.dbflute.optional.OptionalThing;
|
||||
import org.dbflute.util.DfTypeUtil;
|
||||
import org.lastaflute.web.callback.ActionRuntime;
|
||||
import org.lastaflute.web.servlet.request.RequestManager;
|
||||
import org.lastaflute.web.servlet.request.UserTimeZoneProcessProvider;
|
||||
|
||||
|
@ -25,55 +29,35 @@ import org.lastaflute.web.servlet.request.UserTimeZoneProcessProvider;
|
|||
*/
|
||||
public class FessUserTimeZoneProcessProvider implements UserTimeZoneProcessProvider {
|
||||
|
||||
public static final TimeZone centralTimeZone = TimeZone.getDefault(); // you can change it if you like
|
||||
public static final TimeZone centralTimeZone = TimeZone.getDefault();
|
||||
|
||||
/**
|
||||
* {@inheritDoc}
|
||||
*/
|
||||
@Override
|
||||
public boolean isUseTimeZoneHandling() {
|
||||
return false;
|
||||
}
|
||||
|
||||
/**
|
||||
* {@inheritDoc}
|
||||
*/
|
||||
@Override
|
||||
public boolean isAcceptCookieTimeZone() {
|
||||
return false;
|
||||
}
|
||||
|
||||
/**
|
||||
* {@inheritDoc}
|
||||
*/
|
||||
@Override
|
||||
public TimeZone findBusinessTimeZone(ActionExecuteMeta executeMeta, RequestManager requestManager) {
|
||||
return null;
|
||||
public OptionalThing<TimeZone> findBusinessTimeZone(ActionRuntime runtimeMeta, RequestManager requestManager) {
|
||||
return OptionalObject.empty();
|
||||
}
|
||||
|
||||
/**
|
||||
* {@inheritDoc}
|
||||
*/
|
||||
@Override
|
||||
public TimeZone getRequestedTimeZone(RequestManager requestManager) {
|
||||
return centralTimeZone; // same as fall-back
|
||||
}
|
||||
|
||||
/**
|
||||
* {@inheritDoc}
|
||||
*/
|
||||
@Override
|
||||
public TimeZone getFallbackTimeZone() {
|
||||
return centralTimeZone;
|
||||
public TimeZone getRequestedTimeZone(RequestManager requestManager) { // not null
|
||||
return centralTimeZone; // you can change it if you like
|
||||
}
|
||||
|
||||
@Override
|
||||
public String toString() {
|
||||
final StringBuilder sb = new StringBuilder();
|
||||
sb.append("{useTimeZoneHandling=").append(isUseTimeZoneHandling());
|
||||
sb.append(DfTypeUtil.toClassTitle(this));
|
||||
sb.append(":{useTimeZoneHandling=").append(isUseTimeZoneHandling());
|
||||
sb.append(", acceptCookieTimeZone=").append(isAcceptCookieTimeZone());
|
||||
sb.append(", fallbackTimeZone=").append(getFallbackTimeZone());
|
||||
sb.append("}");
|
||||
sb.append("}@").append(Integer.toHexString(hashCode()));
|
||||
return sb.toString();
|
||||
}
|
||||
}
|
|
@ -31,800 +31,233 @@
|
|||
*/
|
||||
package org.codelibs.fess.web.base;
|
||||
|
||||
import java.lang.reflect.Method;
|
||||
import java.time.LocalDate;
|
||||
import java.time.LocalDateTime;
|
||||
import java.util.List;
|
||||
import java.util.Map;
|
||||
import java.util.TimeZone;
|
||||
import java.util.function.Function;
|
||||
import java.util.stream.Collector;
|
||||
import java.util.stream.Collectors;
|
||||
|
||||
import javax.annotation.Resource;
|
||||
|
||||
import org.apache.commons.logging.Log;
|
||||
import org.apache.commons.logging.LogFactory;
|
||||
import org.codelibs.fess.entity.LoginInfo;
|
||||
import org.codelibs.fess.lasta.core.direction.FessConfig;
|
||||
import org.codelibs.fess.lasta.web.action.FessJspPath;
|
||||
import org.codelibs.fess.lasta.web.action.FessMessages;
|
||||
import org.codelibs.sastruts.core.SSCConstants;
|
||||
import org.dbflute.bhv.proposal.callback.ExecutedSqlCounter;
|
||||
import org.dbflute.bhv.proposal.callback.TraceableSqlAdditionalInfoProvider;
|
||||
import org.dbflute.exception.EntityAlreadyDeletedException;
|
||||
import org.dbflute.exception.EntityAlreadyExistsException;
|
||||
import org.dbflute.exception.EntityAlreadyUpdatedException;
|
||||
import org.codelibs.fess.mylasta.action.FessHtmlPath;
|
||||
import org.codelibs.fess.mylasta.action.FessMessages;
|
||||
import org.codelibs.fess.mylasta.direction.FessConfig;
|
||||
import org.dbflute.helper.HandyDate;
|
||||
import org.dbflute.hook.AccessContext;
|
||||
import org.dbflute.hook.CallbackContext;
|
||||
import org.dbflute.hook.SqlFireHook;
|
||||
import org.dbflute.hook.SqlStringFilter;
|
||||
import org.dbflute.optional.OptionalObject;
|
||||
import org.dbflute.util.DfTypeUtil;
|
||||
import org.lastaflute.core.exception.ExceptionTranslator;
|
||||
import org.lastaflute.core.magic.ThreadCacheContext;
|
||||
import org.lastaflute.core.time.TimeManager;
|
||||
import org.dbflute.optional.OptionalThing;
|
||||
import org.lastaflute.db.dbflute.accesscontext.AccessContextArranger;
|
||||
import org.lastaflute.db.dbflute.accesscontext.AccessContextResource;
|
||||
import org.lastaflute.db.dbflute.accesscontext.PreparedAccessContext;
|
||||
import org.lastaflute.db.dbflute.callbackcontext.RomanticTraceableSqlFireHook;
|
||||
import org.lastaflute.db.dbflute.callbackcontext.RomanticTraceableSqlStringFilter;
|
||||
import org.lastaflute.web.api.ApiManager;
|
||||
import org.lastaflute.web.exception.ForcedIllegalTransitionApplicationException;
|
||||
import org.lastaflute.web.exception.ForcedRequest404NotFoundException;
|
||||
import org.lastaflute.web.exception.MessageKeyApplicationException;
|
||||
import org.lastaflute.web.ruts.message.ActionMessages;
|
||||
import org.lastaflute.web.TypicalAction;
|
||||
import org.lastaflute.web.callback.ActionRuntime;
|
||||
import org.lastaflute.web.login.LoginManager;
|
||||
import org.lastaflute.web.login.UserBean;
|
||||
import org.lastaflute.web.response.ActionResponse;
|
||||
import org.lastaflute.web.servlet.request.RequestManager;
|
||||
import org.lastaflute.web.servlet.session.SessionManager;
|
||||
import org.lastaflute.web.validation.ActionValidator;
|
||||
import org.lastaflute.web.validation.LaValidatable;
|
||||
|
||||
/**
|
||||
* @author jflute
|
||||
*/
|
||||
public abstract class FessBaseAction extends RootAction implements ActionCallback, FessJspPath {
|
||||
public abstract class FessBaseAction extends TypicalAction // has several interfaces for direct use
|
||||
implements LaValidatable<FessMessages>, FessMessages.LabelKey, FessHtmlPath {
|
||||
|
||||
// ===================================================================================
|
||||
// Definition
|
||||
// ==========
|
||||
private static final Log LOG = LogFactory.getLog(FessBaseAction.class);
|
||||
/** The application type for FESs, e.g. used by access context. */
|
||||
protected static final String APP_TYPE = "FES"; // #change_it_first
|
||||
|
||||
// ===================================================================================
|
||||
// Attribute
|
||||
// =========
|
||||
@Resource
|
||||
protected FessConfig fessConfig;
|
||||
|
||||
/** The manager of time. (NotNull) */
|
||||
private RequestManager requestManager;
|
||||
@Resource
|
||||
protected TimeManager timeManager;
|
||||
|
||||
/** The manager of session. (NotNull) */
|
||||
@Resource
|
||||
protected SessionManager sessionManager;
|
||||
|
||||
/** The translator of exception. (NotNull) */
|
||||
@Resource
|
||||
protected ExceptionTranslator exceptionTranslator;
|
||||
|
||||
/** The manager of API. (NotNull) */
|
||||
@Resource
|
||||
protected ApiManager apiManager;
|
||||
private FessConfig fessConfig;
|
||||
|
||||
// ===================================================================================
|
||||
// Login
|
||||
// =======
|
||||
protected OptionalObject<LoginInfo> getLoginInfo() {
|
||||
return OptionalObject.of(sessionManager.getAttribute(SSCConstants.USER_INFO));
|
||||
}
|
||||
|
||||
// ===================================================================================
|
||||
// Message
|
||||
// =======
|
||||
/**
|
||||
* Create the action messages basically for session global errors or messages.
|
||||
* @return The new-created action messages provided from Struts. (NotNull)
|
||||
*/
|
||||
protected ActionMessages createActionMessages() { // should be overridden as type-safe properties
|
||||
return new ActionMessages();
|
||||
}
|
||||
|
||||
// -----------------------------------------------------
|
||||
// Errors
|
||||
// ------
|
||||
/**
|
||||
* Save message as (global) action errors. (after deleting existing messages) <br>
|
||||
* This message will be deleted immediately after display if you use {@link MyErrorsTag}.
|
||||
* @param messageKey The message key to be saved. (NotNull)
|
||||
* @param args The varying array of arguments for the message. (NullAllowed, EmptyAllowed)
|
||||
*/
|
||||
protected void saveErrors(String messageKey, Object... args) {
|
||||
sessionManager.saveErrors(messageKey, args);
|
||||
}
|
||||
|
||||
/**
|
||||
* Save message as (global) action errors. (after deleting existing messages) <br>
|
||||
* This message will be deleted immediately after display if you use {@link MyErrorsTag}.
|
||||
* @param errors The action message for errors. (NotNull, EmptyAllowed: removes existing errors)
|
||||
*/
|
||||
protected void saveErrors(ActionMessages errors) {
|
||||
sessionManager.saveErrors(errors);
|
||||
}
|
||||
|
||||
/**
|
||||
* Add message as (global) action errors to rear of existing messages. <br>
|
||||
* This message will be deleted immediately after display if you use {@link MyErrorsTag}.
|
||||
* @param messageKey The message key to be added. (NotNull)
|
||||
* @param args The varying array of arguments for the message. (NullAllowed, EmptyAllowed)
|
||||
*/
|
||||
protected void addErrors(String messageKey, Object... args) {
|
||||
sessionManager.addErrors(messageKey, args);
|
||||
}
|
||||
|
||||
/**
|
||||
* Does it have messages as (global or specified property) action errors at least one?
|
||||
* @return The determination, true or false.
|
||||
*/
|
||||
protected boolean hasErrors() {
|
||||
return sessionManager.hasErrors();
|
||||
}
|
||||
|
||||
/**
|
||||
* Get action message from (global) action errors.
|
||||
* @return The object for action message. (NullAllowed: if no errors in session)
|
||||
*/
|
||||
protected ActionMessages getErrors() {
|
||||
return sessionManager.getErrors();
|
||||
}
|
||||
|
||||
/**
|
||||
* Clear (global) action errors from session.
|
||||
*/
|
||||
protected void clearErrors() {
|
||||
sessionManager.clearErrors();
|
||||
}
|
||||
|
||||
// -----------------------------------------------------
|
||||
// Messages
|
||||
// --------
|
||||
/**
|
||||
* Save message as (global) action messages. (after deleting existing messages) <br>
|
||||
* This message will be deleted immediately after display if you use {@link MyHtmlMessagesTag}.
|
||||
* @param messageKey The message key to be saved. (NotNull)
|
||||
* @param args The varying array of arguments for the message. (NullAllowed, EmptyAllowed)
|
||||
*/
|
||||
protected void saveMessages(String messageKey, Object... args) {
|
||||
sessionManager.saveMessages(messageKey, args);
|
||||
}
|
||||
|
||||
/**
|
||||
* Save message as (global) action messages. (after deleting existing messages) <br>
|
||||
* This message will be deleted immediately after display if you use {@link MyHtmlMessagesTag}.
|
||||
* @param messages The action message for messages. (NotNull, EmptyAllowed: removes existing messages)
|
||||
*/
|
||||
protected void saveMessages(ActionMessages messages) {
|
||||
sessionManager.saveMessages(messages);
|
||||
}
|
||||
|
||||
/**
|
||||
* Add message as (global) action messages to rear of existing messages. <br>
|
||||
* This message will be deleted immediately after display if you use {@link MyHtmlMessagesTag}.
|
||||
* @param messageKey The message key to be added. (NotNull)
|
||||
* @param args The varying array of arguments for the message. (NullAllowed, EmptyAllowed)
|
||||
*/
|
||||
protected void addMessages(String messageKey, Object... args) {
|
||||
sessionManager.addMessages(messageKey, args);
|
||||
}
|
||||
|
||||
/**
|
||||
* Does it have messages as (global or specified property) action messages at least one?
|
||||
* @return The determination, true or false.
|
||||
*/
|
||||
protected boolean hasMessages() {
|
||||
return sessionManager.hasMessages();
|
||||
}
|
||||
|
||||
/**
|
||||
* Get action message from (global) action errors.
|
||||
* @return The object for action message. (NullAllowed: if no messages in session)
|
||||
*/
|
||||
protected ActionMessages getMessages() {
|
||||
return sessionManager.getMessages();
|
||||
}
|
||||
|
||||
/**
|
||||
* Clear (global) action messages from session.
|
||||
*/
|
||||
protected void clearMessages() {
|
||||
sessionManager.clearMessages();
|
||||
}
|
||||
|
||||
// ===================================================================================
|
||||
// Callback
|
||||
// ========
|
||||
// [typical callback process]
|
||||
// read the source code for the details
|
||||
// (because of no comment here)
|
||||
// -----------------------------------------------------
|
||||
// Before
|
||||
// ------
|
||||
// Hook
|
||||
// ======
|
||||
// to suppress unexpected override by sub-class
|
||||
// you should remove the 'final' if you need to override this
|
||||
@Override
|
||||
public final String godHandActionPrologue(final ActionExecuteMeta executeMeta) { // fixed process
|
||||
arrangeThreadCacheContextBasicItem(executeMeta);
|
||||
arrangePreparedAccessContext(executeMeta);
|
||||
arrangeCallbackContext(executeMeta); // should be after access-context (using access context's info)
|
||||
arrangeThreadCacheContextLoginItem(executeMeta);
|
||||
return null;
|
||||
}
|
||||
|
||||
protected void arrangeThreadCacheContextBasicItem(ActionExecuteMeta executeMeta) {
|
||||
if (ThreadCacheContext.exists()) { // basically true, just in case
|
||||
ThreadCacheContext.registerRequestPath(requestManager.getRoutingOriginRequestPathAndQuery());
|
||||
ThreadCacheContext.registerEntryMethod(executeMeta.getActionMethod());
|
||||
}
|
||||
}
|
||||
|
||||
protected void arrangeThreadCacheContextLoginItem(ActionExecuteMeta executeMeta) {
|
||||
if (ThreadCacheContext.exists()) { // basically true, just in case
|
||||
ThreadCacheContext.registerUserBean(getLoginInfo().orElse(null)); // basically for asynchronous
|
||||
}
|
||||
public final ActionResponse godHandPrologue(ActionRuntime runtime) {
|
||||
return super.godHandPrologue(runtime);
|
||||
}
|
||||
|
||||
@Override
|
||||
public String godHandBefore(ActionExecuteMeta executeMeta) { // you can override
|
||||
return null;
|
||||
public final ActionResponse godHandMonologue(ActionRuntime runtime) {
|
||||
return super.godHandMonologue(runtime);
|
||||
}
|
||||
|
||||
@Override
|
||||
public String callbackBefore(ActionExecuteMeta executeMeta) { // you can override
|
||||
return null;
|
||||
public final void godHandEpilogue(ActionRuntime runtime) {
|
||||
super.godHandEpilogue(runtime);
|
||||
}
|
||||
|
||||
// -----------------------------------------------------
|
||||
// on Success
|
||||
// ----------
|
||||
// #app_customize you can customize the action hook
|
||||
@Override
|
||||
public String godHandSuccessMonologue(ActionExecuteMeta executeMeta) {
|
||||
return null;
|
||||
}
|
||||
|
||||
// -----------------------------------------------------
|
||||
// on Failure
|
||||
// ----------
|
||||
@Override
|
||||
public String godHandExceptionMonologue(ActionExecuteMeta executeMeta) { // fixed process
|
||||
return handleActionException(executeMeta);
|
||||
}
|
||||
|
||||
protected String handleActionException(ActionExecuteMeta executeMeta) {
|
||||
final RuntimeException cause = executeMeta.getFailureCause();
|
||||
RuntimeException translated = null;
|
||||
try {
|
||||
translateException(cause);
|
||||
} catch (final RuntimeException e) {
|
||||
translated = e;
|
||||
}
|
||||
final RuntimeException handlingEx = translated != null ? translated : cause;
|
||||
final String nextPath = handleApplicationException(executeMeta, handlingEx);
|
||||
if (nextPath != null) {
|
||||
return nextPath;
|
||||
}
|
||||
if (translated != null) {
|
||||
throw translated;
|
||||
}
|
||||
return null;
|
||||
}
|
||||
|
||||
protected void translateException(RuntimeException cause) {
|
||||
exceptionTranslator.translateException(cause);
|
||||
}
|
||||
|
||||
// -----------------------------------------------------
|
||||
// Finally
|
||||
// -------
|
||||
@Override
|
||||
public void callbackFinally(ActionExecuteMeta executeMeta) { // you can override
|
||||
public ActionResponse hookBefore(ActionRuntime runtime) { // application may override
|
||||
return super.hookBefore(runtime);
|
||||
}
|
||||
|
||||
@Override
|
||||
public void godHandFinally(ActionExecuteMeta executeMeta) { // you can override
|
||||
}
|
||||
|
||||
@Override
|
||||
public final void godHandActionEpilogue(ActionExecuteMeta executeMeta) { // fixed process
|
||||
if (executeMeta.isForwardToJsp()) {
|
||||
arrangeNoCacheResponseWhenJsp(executeMeta);
|
||||
}
|
||||
handleSqlCount(executeMeta);
|
||||
clearCallbackContext();
|
||||
clearPreparedAccessContext();
|
||||
}
|
||||
|
||||
protected void arrangeNoCacheResponseWhenJsp(ActionExecuteMeta executeMeta) {
|
||||
responseManager.addNoCache();
|
||||
}
|
||||
|
||||
// -----------------------------------------------------
|
||||
// Adjustment
|
||||
// ----------
|
||||
@Override
|
||||
protected String movedPermanently(String redirectUrl) {
|
||||
// e.g. godHandBefore() needs dummy to stop execution
|
||||
super.movedPermanently(redirectUrl);
|
||||
return responseResolved();
|
||||
}
|
||||
|
||||
/**
|
||||
* Return as response resolved. <br>
|
||||
* Basically used in action callback or action execute. <br>
|
||||
* You should use this to stop execution in callback.
|
||||
* <pre>
|
||||
* ... // resolve response by other way
|
||||
* return responseResolved(); // stop execution after here
|
||||
* </pre>
|
||||
* @return The dummy value that means resolved. (NotNull)
|
||||
*/
|
||||
protected String responseResolved() {
|
||||
return ActionCallback.RESPONSE_RESOLVED_DUMMY_FORWARD;
|
||||
public void hookFinally(ActionRuntime runtime) {
|
||||
super.hookFinally(runtime);
|
||||
}
|
||||
|
||||
// ===================================================================================
|
||||
// Access Context
|
||||
// ==============
|
||||
/**
|
||||
* Arrange prepared access context for DBFlute, which is used for common columns setup. <br>
|
||||
* This is called by callback process so you should NOT call this directly in your action.
|
||||
* @param executeMeta The meta of action execute. (NotNull)
|
||||
*/
|
||||
protected void arrangePreparedAccessContext(ActionExecuteMeta executeMeta) { // called by callback
|
||||
final AccessContextArranger arranger = createAccessContextArranger();
|
||||
final AccessContextResource resource = createAccessContextResource(executeMeta);
|
||||
final AccessContext accessContext = arranger.arrangePreparedAccessContext(resource);
|
||||
PreparedAccessContext.setAccessContextOnThread(accessContext);
|
||||
}
|
||||
|
||||
/**
|
||||
* Create the arranger of access context.
|
||||
* @return The instance of arranger. (NotNull)
|
||||
*/
|
||||
protected AccessContextArranger createAccessContextArranger() {
|
||||
return new AccessContextArranger() {
|
||||
@Override
|
||||
public AccessContext arrangePreparedAccessContext(final AccessContextResource resource) {
|
||||
final AccessContext context = new AccessContext();
|
||||
// uses provider to synchronize it with transaction time
|
||||
context.setAccessLocalDateTimeProvider(() -> {
|
||||
return timeManager.getCurrentLocalDateTime();
|
||||
});
|
||||
// uses provider to synchronize it with login status in session
|
||||
context.setAccessUserProvider(() -> {
|
||||
return buildAccessUserTrace(resource);
|
||||
});
|
||||
return context;
|
||||
}
|
||||
|
||||
private String buildAccessUserTrace(AccessContextResource resource) {
|
||||
return getLoginInfo().map(info -> info.getUsername()).orElse("system");
|
||||
}
|
||||
@Override
|
||||
protected AccessContextArranger newAccessContextArranger() { // for framework
|
||||
return resource -> {
|
||||
final AccessContext context = new AccessContext();
|
||||
context.setAccessLocalDateTimeProvider(() -> currentDateTime());
|
||||
context.setAccessUserProvider(() -> buildAccessUserTrace(resource));
|
||||
return context;
|
||||
};
|
||||
}
|
||||
|
||||
/**
|
||||
* Create the resource of access context.
|
||||
* @param executeMeta The meta of action execute. (NotNull)
|
||||
* @return The new-created resource of access context. (NotNull)
|
||||
*/
|
||||
protected AccessContextResource createAccessContextResource(ActionExecuteMeta executeMeta) {
|
||||
final Method method = executeMeta.getActionMethod();
|
||||
final String classTitle = DfTypeUtil.toClassTitle(method.getDeclaringClass());
|
||||
return new AccessContextResource(classTitle, method);
|
||||
}
|
||||
|
||||
/**
|
||||
* Clear prepared access context. <br>
|
||||
* This is called by callback process so you should NOT call this directly in your action.
|
||||
*/
|
||||
protected void clearPreparedAccessContext() { // called by callback
|
||||
PreparedAccessContext.clearAccessContextOnThread();
|
||||
private String buildAccessUserTrace(AccessContextResource resource) {
|
||||
// #app_customize you can customize the user trace for common column
|
||||
final StringBuilder sb = new StringBuilder();
|
||||
sb.append(myUserType().map(userType -> userType + ":").orElse(""));
|
||||
sb.append(getUserBean().map(bean -> bean.getUserId()).orElseGet(() -> -1L));
|
||||
sb.append(",").append(myAppType()).append(",").append(resource.getModuleName());
|
||||
final String trace = sb.toString();
|
||||
final int columnSize = 200;
|
||||
return trace.length() > columnSize ? trace.substring(0, columnSize) : trace;
|
||||
}
|
||||
|
||||
// ===================================================================================
|
||||
// Callback Context
|
||||
// ================
|
||||
/**
|
||||
* Arrange callback context for DBFlute, which is used for several purpose. <br>
|
||||
* This is called by callback process so you should NOT call this directly in your action.
|
||||
* @param executeMeta The meta of action execute. (NotNull)
|
||||
*/
|
||||
protected void arrangeCallbackContext(final ActionExecuteMeta executeMeta) {
|
||||
final SqlFireHook sqlFireHook = createSqlFireHook(executeMeta);
|
||||
CallbackContext.setSqlFireHookOnThread(sqlFireHook);
|
||||
final SqlStringFilter filter = createSqlStringFilter(executeMeta);
|
||||
CallbackContext.setSqlStringFilterOnThread(filter);
|
||||
// User Info
|
||||
// =========
|
||||
@Override
|
||||
protected OptionalThing<UserBean> getUserBean() { // to return as concrete class
|
||||
return OptionalThing.empty();// uses application server authentication so empty here
|
||||
}
|
||||
|
||||
/**
|
||||
* Create the filter of SQL string for DBFlute.
|
||||
* @param executeMeta The meta of action execute. (NotNull)
|
||||
* @return The hook of SQL fire. (NullAllowed: if null, no hook)
|
||||
*/
|
||||
protected SqlFireHook createSqlFireHook(ActionExecuteMeta executeMeta) {
|
||||
return newRomanticTraceableSqlFireHook();
|
||||
@Override
|
||||
protected String myAppType() { // for framework
|
||||
return APP_TYPE;
|
||||
}
|
||||
|
||||
protected RomanticTraceableSqlFireHook newRomanticTraceableSqlFireHook() {
|
||||
return new RomanticTraceableSqlFireHook();
|
||||
@Override
|
||||
protected OptionalThing<String> myUserType() { // for framework
|
||||
return OptionalObject.empty(); // same reason as getUserBean()
|
||||
}
|
||||
|
||||
/**
|
||||
* Create the filter of SQL string for DBFlute.
|
||||
* @param executeMeta The meta of action execute. (NotNull)
|
||||
* @return The filter of SQL string. (NullAllowed: if null, no filter)
|
||||
*/
|
||||
protected SqlStringFilter createSqlStringFilter(final ActionExecuteMeta executeMeta) {
|
||||
final Method actionMethod = executeMeta.getActionMethod();
|
||||
return newRomanticTraceableSqlStringFilter(actionMethod, () -> buildSqlMarkingAdditionalInfo());
|
||||
}
|
||||
|
||||
protected RomanticTraceableSqlStringFilter newRomanticTraceableSqlStringFilter(Method actionMethod,
|
||||
TraceableSqlAdditionalInfoProvider additionalInfoProvider) {
|
||||
return new RomanticTraceableSqlStringFilter(actionMethod, additionalInfoProvider);
|
||||
}
|
||||
|
||||
/**
|
||||
* Build string for additional info of SQL marking.
|
||||
* @return The string expression of additional info. (NullAllowed: if null, no additional info)
|
||||
*/
|
||||
protected String buildSqlMarkingAdditionalInfo() {
|
||||
return "{" + getLoginInfo().map(info -> String.valueOf(info.isAdministrator())).orElse("*No login") + "}";
|
||||
// it doesn't contain user ID for SQL cache in DBMS
|
||||
}
|
||||
|
||||
/**
|
||||
* Handle count of SQL execution in the request.
|
||||
* @param executeMeta The meta of action execute. (NotNull)
|
||||
*/
|
||||
protected void handleSqlCount(final ActionExecuteMeta executeMeta) {
|
||||
final CallbackContext context = CallbackContext.getCallbackContextOnThread();
|
||||
if (context == null) {
|
||||
return;
|
||||
}
|
||||
final SqlStringFilter filter = context.getSqlStringFilter();
|
||||
if (filter == null || !(filter instanceof ExecutedSqlCounter)) {
|
||||
return;
|
||||
}
|
||||
final ExecutedSqlCounter counter = ((ExecutedSqlCounter) filter);
|
||||
final int limitCountOfSql = getLimitCountOfSql(executeMeta);
|
||||
if (limitCountOfSql >= 0 && counter.getTotalCountOfSql() > limitCountOfSql) {
|
||||
handleTooManySqlExecution(executeMeta, counter);
|
||||
}
|
||||
final String exp = counter.toLineDisp();
|
||||
requestManager.setAttribute(RequestManager.KEY_DBFLUTE_SQL_COUNT, exp); // logged by logging filter
|
||||
}
|
||||
|
||||
/**
|
||||
* Handle too many SQL executions.
|
||||
* @param executeMeta The meta of action execute. (NotNull)
|
||||
* @param sqlCounter The counter object for SQL executions. (NotNull)
|
||||
*/
|
||||
protected void handleTooManySqlExecution(final ActionExecuteMeta executeMeta, final ExecutedSqlCounter sqlCounter) {
|
||||
final String actionDisp = buildActionDisp(executeMeta);
|
||||
LOG.warn("*Too many SQL executions: " + sqlCounter.getTotalCountOfSql() + " in " + actionDisp);
|
||||
}
|
||||
|
||||
protected String buildActionDisp(ActionExecuteMeta executeMeta) {
|
||||
final Method method = executeMeta.getActionMethod();
|
||||
final Class<?> declaringClass = method.getDeclaringClass();
|
||||
return declaringClass.getSimpleName() + "." + method.getName() + "()";
|
||||
}
|
||||
|
||||
/**
|
||||
* Get the limit count of SQL execution. <br>
|
||||
* You can override if you need.
|
||||
* @param executeMeta The meta of action execute. (NotNull)
|
||||
* @return The max count allowed for SQL executions. (MinusAllowed: if minus, no check)
|
||||
*/
|
||||
protected int getLimitCountOfSql(ActionExecuteMeta executeMeta) {
|
||||
return 30; // as default
|
||||
}
|
||||
|
||||
/**
|
||||
* Clear callback context. <br>
|
||||
* This is called by callback process so you should NOT call this directly in your action.
|
||||
*/
|
||||
protected void clearCallbackContext() {
|
||||
CallbackContext.clearSqlStringFilterOnThread();
|
||||
CallbackContext.clearSqlFireHookOnThread();
|
||||
@Override
|
||||
protected OptionalThing<LoginManager> myLoginManager() {
|
||||
return OptionalThing.empty(); // same reason as getUserBean()
|
||||
}
|
||||
|
||||
// ===================================================================================
|
||||
// Application Exception
|
||||
// =====================
|
||||
/**
|
||||
* Handle the application exception thrown by (basically) action execute. <br>
|
||||
* Though this is same as global-exceptions settings of Struts,
|
||||
* There is more flexibility than the function so you can set it here. <br>
|
||||
* This is called by callback process so you should NOT call this directly in your action.
|
||||
* @param executeMeta The meta of action execute. (NotNull)
|
||||
* @param cause The exception thrown by (basically) action execute, might be translated. (NotNull)
|
||||
* @return The forward path. (NullAllowed: if not null, it goes to the path)
|
||||
*/
|
||||
protected String handleApplicationException(ActionExecuteMeta executeMeta, RuntimeException cause) { // called by callback
|
||||
final String forwardTo = doHandleApplicationException(executeMeta, cause);
|
||||
if (forwardTo != null && executeMeta.isApiAction()) {
|
||||
return dispatchApiApplicationException(executeMeta, cause);
|
||||
}
|
||||
return forwardTo;
|
||||
// Validation
|
||||
// ==========
|
||||
@SuppressWarnings("unchecked")
|
||||
@Override
|
||||
public ActionValidator<FessMessages> createValidator() {
|
||||
return super.createValidator();
|
||||
}
|
||||
|
||||
protected String doHandleApplicationException(ActionExecuteMeta executeMeta, RuntimeException cause) {
|
||||
String forwardTo = null;
|
||||
if (cause instanceof ApplicationBaseException) {
|
||||
final ApplicationBaseException appEx = (ApplicationBaseException) cause;
|
||||
if (appEx instanceof GetParameterNotFoundException) {
|
||||
forwardTo = handleGetParameterNotFoundException((GetParameterNotFoundException) appEx);
|
||||
} else if (appEx instanceof MessageKeyApplicationException) {
|
||||
forwardTo = handleErrorsApplicationException((MessageKeyApplicationException) appEx);
|
||||
} else {
|
||||
forwardTo = handleSpecialApplicationException(appEx);
|
||||
}
|
||||
if (forwardTo == null) {
|
||||
forwardTo = handleUnknownApplicationException(appEx);
|
||||
}
|
||||
reflectEmbeddedApplicationMessagesIfExists(appEx); // override existing messages if exists
|
||||
} else {
|
||||
if (cause instanceof EntityAlreadyDeletedException) {
|
||||
forwardTo = handleEntityAlreadyDeletedException((EntityAlreadyDeletedException) cause);
|
||||
} else if (cause instanceof EntityAlreadyUpdatedException) {
|
||||
forwardTo = handleEntityAlreadyUpdatedException((EntityAlreadyUpdatedException) cause);
|
||||
} else if (cause instanceof EntityAlreadyExistsException) {
|
||||
forwardTo = handleEntityAlreadyExistsException((EntityAlreadyExistsException) cause);
|
||||
}
|
||||
}
|
||||
if (forwardTo != null) {
|
||||
showApplicationExceptionHandling(cause, forwardTo);
|
||||
}
|
||||
return forwardTo;
|
||||
}
|
||||
|
||||
protected void showApplicationExceptionHandling(RuntimeException cause, String forwardTo) {
|
||||
if (LOG.isDebugEnabled()) {
|
||||
// not show forwardTo because of forwarding log later
|
||||
final StringBuilder sb = new StringBuilder();
|
||||
sb.append("...Handling application exception:");
|
||||
sb.append("\n_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/");
|
||||
sb.append("\n[Application Exception]");
|
||||
sb.append("\n").append(cause.getMessage());
|
||||
final ActionMessages errors = getErrors();
|
||||
if (errors != null) {
|
||||
sb.append("\n").append(errors.toString());
|
||||
}
|
||||
buildApplicationExceptionStackTrace(cause, sb);
|
||||
sb.append("\n_/_/_/_/_/_/_/_/_/_/");
|
||||
LOG.debug(sb.toString());
|
||||
}
|
||||
}
|
||||
|
||||
protected void buildApplicationExceptionStackTrace(RuntimeException cause, StringBuilder sb) {
|
||||
final StackTraceElement[] stackTrace = cause.getStackTrace();
|
||||
if (stackTrace == null) { // just in case
|
||||
return;
|
||||
}
|
||||
int index = 0;
|
||||
for (final StackTraceElement element : stackTrace) {
|
||||
if (index > 10) { // not all because it's not error
|
||||
break;
|
||||
}
|
||||
final String className = element.getClassName();
|
||||
final String fileName = element.getFileName(); // might be null
|
||||
final int lineNumber = element.getLineNumber();
|
||||
final String methodName = element.getMethodName();
|
||||
sb.append("\n at ").append(className).append(".").append(methodName);
|
||||
sb.append("(").append(fileName);
|
||||
if (lineNumber >= 0) {
|
||||
sb.append(":").append(lineNumber);
|
||||
}
|
||||
sb.append(")");
|
||||
++index;
|
||||
}
|
||||
}
|
||||
|
||||
protected void reflectEmbeddedApplicationMessagesIfExists(ApplicationBaseException appEx) {
|
||||
final String errorsKey = appEx.getErrorKey();
|
||||
if (errorsKey != null) {
|
||||
if (LOG.isDebugEnabled()) {
|
||||
LOG.debug("...Saving embedded application message as action error: " + errorsKey);
|
||||
}
|
||||
saveErrors(errorsKey, appEx.getErrorArgs());
|
||||
}
|
||||
}
|
||||
|
||||
protected String dispatchApiApplicationException(ActionExecuteMeta executeMeta, RuntimeException cause) {
|
||||
final ActionMessages errors = getErrors(); // might be null in minor case
|
||||
final ApiResult result = apiManager.prepareApplicationExceptionResult(errors, executeMeta, cause);
|
||||
apiManager.writeJsonResponse(result);
|
||||
return apiManager.forwardToApiResolvedDummy();
|
||||
}
|
||||
|
||||
// -----------------------------------------------------
|
||||
// DBFlute Entity
|
||||
// --------------
|
||||
protected String handleEntityAlreadyDeletedException(EntityAlreadyDeletedException cause) {
|
||||
saveErrors(getErrorsAppAlreadyDeletedKey());
|
||||
return getErrorMessageAlreadyDeletedJsp();
|
||||
}
|
||||
|
||||
protected String getErrorsAppAlreadyDeletedKey() {
|
||||
return FessMessages.ERRORS_APP_ALREADY_DELETED;
|
||||
}
|
||||
|
||||
protected String getErrorMessageAlreadyDeletedJsp() {
|
||||
return getErrorMessageJsp(); // as default
|
||||
}
|
||||
|
||||
protected String handleEntityAlreadyUpdatedException(EntityAlreadyUpdatedException cause) {
|
||||
saveErrors(getErrorsAppAlreadyUpdatedKey());
|
||||
return getErrorMessageAlreadyUpdatedJsp();
|
||||
}
|
||||
|
||||
protected String getErrorsAppAlreadyUpdatedKey() {
|
||||
return FessMessages.ERRORS_APP_ALREADY_UPDATED;
|
||||
}
|
||||
|
||||
protected String getErrorMessageAlreadyUpdatedJsp() {
|
||||
return getErrorMessageJsp(); // as default
|
||||
}
|
||||
|
||||
protected String handleEntityAlreadyExistsException(EntityAlreadyExistsException cause) {
|
||||
saveErrors(getErrorsAppAlreadyExistsKey());
|
||||
return getErrorMessageAlreadyExistsJsp();
|
||||
}
|
||||
|
||||
protected String getErrorsAppAlreadyExistsKey() {
|
||||
return FessMessages.ERRORS_APP_ALREADY_EXISTS;
|
||||
}
|
||||
|
||||
protected String getErrorMessageAlreadyExistsJsp() {
|
||||
return getErrorMessageJsp(); // as default
|
||||
}
|
||||
|
||||
// -----------------------------------------------------
|
||||
// Get Parameter
|
||||
// -------------
|
||||
protected String handleGetParameterNotFoundException(GetParameterNotFoundException appEx) {
|
||||
saveErrors(getErrorsAppIllegalTransitionKey());
|
||||
return getErrorMessageJsp();
|
||||
}
|
||||
|
||||
protected String getErrorsAppIllegalTransitionKey() {
|
||||
return FessMessages.ERRORS_APP_ILLEGAL_TRANSITION;
|
||||
}
|
||||
|
||||
protected String getErrorMessageJsp() {
|
||||
return path_Error_ErrorMessageJsp;
|
||||
}
|
||||
|
||||
// -----------------------------------------------------
|
||||
// Message Key
|
||||
// -----------
|
||||
protected String handleErrorsApplicationException(MessageKeyApplicationException appEx) {
|
||||
// no save here because of saved later
|
||||
//saveErrors(appEx.getErrors());
|
||||
return getErrorMessageJsp();
|
||||
}
|
||||
|
||||
// -----------------------------------------------------
|
||||
// Special
|
||||
// -------
|
||||
protected String handleSpecialApplicationException(ApplicationBaseException appEx) { // you can override
|
||||
return null;
|
||||
}
|
||||
|
||||
// -----------------------------------------------------
|
||||
// Unknown
|
||||
// -------
|
||||
protected String handleUnknownApplicationException(ApplicationBaseException appEx) {
|
||||
return null; // basically no way
|
||||
}
|
||||
|
||||
// ===================================================================================
|
||||
// Assert Helper
|
||||
// =============
|
||||
/**
|
||||
* Assert the condition is true or it throws illegal transition forcedly. <br>
|
||||
* You can use this in your action process against strange request parameters.
|
||||
* @param condition Your determination, true or false. (false: illegal transition)
|
||||
*/
|
||||
protected void assertTrueOrForcedIllegalTransition(boolean condition) {
|
||||
if (!condition) {
|
||||
throw new ForcedIllegalTransitionApplicationException(getErrorsAppIllegalTransitionKey());
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* Assert the condition is true or it throws 404 not found forcedly. <br>
|
||||
* You can use this in your action process against invalid URL parameters.
|
||||
* @param condition Your determination, true or false. (false: 404 not found)
|
||||
*/
|
||||
protected void assertTrueOrForcedRequest404NotFound(boolean condition) {
|
||||
if (!condition) {
|
||||
final String msg = "from Forced 404 NotFound assertion"; // debug message
|
||||
throw new ForcedRequest404NotFoundException(msg);
|
||||
}
|
||||
@Override
|
||||
public FessMessages createMessages() { // application may call
|
||||
return new FessMessages(); // overriding to change return type to concrete-class
|
||||
}
|
||||
|
||||
// ===================================================================================
|
||||
// Conversion Helper
|
||||
// =================
|
||||
// #app_customize you can customize the conversion logic
|
||||
// -----------------------------------------------------
|
||||
// Collectors
|
||||
// ----------
|
||||
protected <T> Collector<T, ?, List<T>> toList() {
|
||||
return Collectors.toList();
|
||||
}
|
||||
|
||||
protected <T, K, U> Collector<T, ?, Map<K, U>> toMap(Function<? super T, ? extends K> keyMapper,
|
||||
Function<? super T, ? extends U> valueMapper) {
|
||||
return Collectors.toMap(keyMapper, valueMapper);
|
||||
}
|
||||
|
||||
// -----------------------------------------------------
|
||||
// String Date
|
||||
// -----------
|
||||
protected String toStringDate(LocalDate localDate) {
|
||||
return localDate != null ? doConvertToDisp(localDate) : null;
|
||||
}
|
||||
|
||||
protected String toStringDate(LocalDateTime localDateTime) {
|
||||
return localDateTime != null ? doConvertToStringDate(localDateTime) : null;
|
||||
}
|
||||
|
||||
private String doConvertToDisp(LocalDate localDate) {
|
||||
return new HandyDate(localDate, getConversionTimeZone()).toDisp(getStringDatePattern());
|
||||
}
|
||||
|
||||
private String doConvertToStringDate(LocalDateTime localDateTime) {
|
||||
return new HandyDate(localDateTime, getConversionTimeZone()).toDisp(getStringDatePattern());
|
||||
}
|
||||
|
||||
protected String toStringDateTime(LocalDateTime localDateTime) {
|
||||
return localDateTime != null ? doConvertToStringDateTime(localDateTime) : null;
|
||||
}
|
||||
|
||||
private String doConvertToStringDateTime(LocalDateTime localDateTime) {
|
||||
return new HandyDate(localDateTime, getConversionTimeZone()).toDisp(getStringDateTimePattern());
|
||||
}
|
||||
|
||||
// -----------------------------------------------------
|
||||
// Local Date
|
||||
// ----------
|
||||
protected LocalDate toLocalDate(String dateExp) {
|
||||
if (dateExp == null || dateExp.isEmpty()) {
|
||||
return null;
|
||||
// to Local Date
|
||||
// -------------
|
||||
protected OptionalThing<LocalDate> toDate(String exp) { // application may call
|
||||
if (isNotEmpty(exp)) {
|
||||
return OptionalThing.of(new HandyDate(exp, myConvZone()).getLocalDate());
|
||||
} else {
|
||||
return OptionalThing.ofNullable(null, () -> {
|
||||
throw new IllegalStateException("The specified expression for local date was null or empty: " + exp);
|
||||
});
|
||||
}
|
||||
final TimeZone userTimeZone = getConversionTimeZone();
|
||||
return new HandyDate(dateExp, userTimeZone).getLocalDate();
|
||||
}
|
||||
|
||||
protected LocalDateTime toLocalDateTime(String dateTimeExp) {
|
||||
if (dateTimeExp == null || dateTimeExp.isEmpty()) {
|
||||
return null;
|
||||
protected OptionalThing<LocalDateTime> toDateTime(String exp) { // application may call
|
||||
if (isNotEmpty(exp)) {
|
||||
return OptionalThing.of(new HandyDate(exp, myConvZone()).getLocalDateTime());
|
||||
} else {
|
||||
return OptionalThing.ofNullable(null, () -> {
|
||||
throw new IllegalStateException("The specified expression for local date was null or empty: " + exp);
|
||||
});
|
||||
}
|
||||
}
|
||||
|
||||
// -----------------------------------------------------
|
||||
// to Display Date
|
||||
// ---------------
|
||||
protected OptionalThing<String> toDispDate(LocalDate date) { // application may call
|
||||
if (date != null) {
|
||||
return OptionalThing.of(new HandyDate(date, myConvZone()).toDisp(myDatePattern()));
|
||||
} else {
|
||||
return OptionalThing.ofNullable(null, () -> {
|
||||
throw new IllegalStateException("The specified local date was null.");
|
||||
});
|
||||
}
|
||||
}
|
||||
|
||||
protected OptionalThing<String> toDispDate(LocalDateTime dateTime) { // application may call
|
||||
if (dateTime != null) {
|
||||
return OptionalThing.of(new HandyDate(dateTime, myConvZone()).toDisp(myDatePattern()));
|
||||
} else {
|
||||
return OptionalThing.ofNullable(null, () -> {
|
||||
throw new IllegalStateException("The specified local date-time was null.");
|
||||
});
|
||||
}
|
||||
}
|
||||
|
||||
protected OptionalThing<String> toDispDateTime(LocalDateTime dateTime) { // application may call
|
||||
if (dateTime != null) {
|
||||
return OptionalThing.of(new HandyDate(dateTime, myConvZone()).toDisp(myDateTimePattern()));
|
||||
} else {
|
||||
return OptionalThing.ofNullable(null, () -> {
|
||||
throw new IllegalStateException("The specified local date-time was null.");
|
||||
});
|
||||
}
|
||||
final TimeZone userTimeZone = getConversionTimeZone();
|
||||
return new HandyDate(dateTimeExp, userTimeZone).getLocalDateTime();
|
||||
}
|
||||
|
||||
// -----------------------------------------------------
|
||||
// Conversion Resource
|
||||
// -------------------
|
||||
protected String getStringDatePattern() {
|
||||
protected String myDatePattern() {
|
||||
return "yyyy/MM/dd";
|
||||
}
|
||||
|
||||
protected String getStringDateTimePattern() {
|
||||
protected String myDateTimePattern() {
|
||||
return "yyyy/MM/dd HH:mm:ss";
|
||||
}
|
||||
|
||||
protected TimeZone getConversionTimeZone() {
|
||||
protected TimeZone myConvZone() {
|
||||
return requestManager.getUserTimeZone();
|
||||
}
|
||||
|
||||
// ===================================================================================
|
||||
// Document
|
||||
// ========
|
||||
/**
|
||||
* {@inheritDoc} <br>
|
||||
* Application Origin Methods:
|
||||
* <pre>
|
||||
* <span style="font-size: 130%; color: #553000">[Conversion Helper]</span>
|
||||
* o toDate(exp) <span style="color: #3F7E5E">// convert expression to local date</span>
|
||||
* o toDateTime(exp) <span style="color: #3F7E5E">// convert expression to local date-time</span>
|
||||
* o toDispDate(date) <span style="color: #3F7E5E">// convert local date to display expression</span>
|
||||
* o toDispDateTime(date) <span style="color: #3F7E5E">// convert local date-time to display expression</span>
|
||||
* </pre>
|
||||
*/
|
||||
@Override
|
||||
public void document1_CallableSuperMethod() {
|
||||
super.document1_CallableSuperMethod();
|
||||
}
|
||||
}
|
||||
|
|
|
@ -29,8 +29,8 @@ cookie.default.expire = 31556926
|
|||
# The eternal expire of cookie in seconds e.g. 315360000: ten year, 86400: one day
|
||||
cookie.eternal.expire = 315360000
|
||||
|
||||
# The cookie key of auto-login for Fess
|
||||
cookie.auto.login.harbor.key = HRB
|
||||
# The cookie key of remember-me for Fess
|
||||
cookie.remember.me.harbor.key = FES
|
||||
|
||||
# ----------------------------------------------------------
|
||||
# Paging
|
||||
|
|
|
@ -21,3 +21,27 @@ framework.debug = false
|
|||
# The milliseconds for (relative or absolute) adjust time (set only when test) @LongType *dynamic in development
|
||||
time.adjust.time.millis = 0
|
||||
|
||||
# ----------------------------------------------------------
|
||||
# Mail
|
||||
# ------
|
||||
# Does it send mock mail? (true: no send actually, logging only)
|
||||
mail.send.mock = true
|
||||
|
||||
# SMTP server settings for main: host:port
|
||||
mail.smtp.server.main.host.and.port = localhost:25
|
||||
|
||||
# The prefix of subject to show test environment or not
|
||||
mail.subject.test.prefix = [Test]
|
||||
|
||||
# The common return path of all mail
|
||||
mail.return.path = returnpath@docksidestage.org
|
||||
|
||||
|
||||
# ========================================================================================
|
||||
# DB
|
||||
# ====
|
||||
|
||||
|
||||
# ========================================================================================
|
||||
# Web
|
||||
# =====
|
||||
|
|
|
@ -3,7 +3,7 @@
|
|||
# _/_/_/_/_/_/_/_/_/_/
|
||||
|
||||
# location of smart-deploy mode e.g. maihama_env.properties: lasta_di.smart.deploy.mode
|
||||
smart.deploy.mode.location = harbor_env.properties: lasta_di.smart.deploy.mode
|
||||
smart.deploy.mode.location = fess_env.properties: lasta_di.smart.deploy.mode
|
||||
|
||||
# package for smart deploy target e.g. org.docksidestage.app
|
||||
smart.package1 = org.codelibs.fess.app
|
||||
|
|
|
@ -2,5 +2,5 @@
|
|||
<!DOCTYPE components PUBLIC "-//DBFLUTE//DTD LastaDi 1.0//EN"
|
||||
"http://dbflute.org/meta/lastadi10.dtd">
|
||||
<components>
|
||||
<component class="org.codelibs.fess.crud.creator.PagerCreator"/>
|
||||
<component name="pagerCreator" class="org.codelibs.fess.crud.creator.PagerCreator"/>
|
||||
</components>
|
||||
|
|
|
@ -1,5 +1,5 @@
|
|||
/*
|
||||
* Copyright 2009-2015 the CodeLibs Project and the Others.
|
||||
* Copyright 2014-2015 the original author or authors.
|
||||
*
|
||||
* Licensed under the Apache License, Version 2.0 (the "License");
|
||||
* you may not use this file except in compliance with the License.
|
||||
|
@ -9,21 +9,20 @@
|
|||
*
|
||||
* Unless required by applicable law or agreed to in writing, software
|
||||
* distributed under the License is distributed on an "AS IS" BASIS,
|
||||
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND,
|
||||
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND,
|
||||
* either express or implied. See the License for the specific language
|
||||
* governing permissions and limitations under the License.
|
||||
*/
|
||||
package org.codelibs.fess.lasta.web.action;
|
||||
package org.codelibs.fess.boot;
|
||||
|
||||
import java.lang.annotation.ElementType;
|
||||
import java.lang.annotation.Retention;
|
||||
import java.lang.annotation.RetentionPolicy;
|
||||
import java.lang.annotation.Target;
|
||||
import org.dbflute.jetty.JettyBoot;
|
||||
|
||||
/**
|
||||
* @author jflute
|
||||
*/
|
||||
@Retention(RetentionPolicy.RUNTIME)
|
||||
@Target(value = ElementType.METHOD)
|
||||
public @interface FessPerformLogin {
|
||||
public class FessBoot {
|
||||
|
||||
public static void main(String[] args) {
|
||||
new JettyBoot(8090, "/fess").asDevelopment().bootAwait();
|
||||
}
|
||||
}
|
|
@ -18,13 +18,13 @@ package org.codelibs.fess.lasta;
|
|||
|
||||
import javax.annotation.Resource;
|
||||
|
||||
import org.codelibs.fess.lasta.core.direction.FessConfig;
|
||||
import org.codelibs.fess.unit.UnitFessContainerTestCase;
|
||||
import org.codelibs.fess.mylasta.direction.FessConfig;
|
||||
import org.codelibs.fess.unit.UnitFessTestCase;
|
||||
|
||||
/**
|
||||
* @author jflute
|
||||
*/
|
||||
public class LastaEnvTest extends UnitFessContainerTestCase {
|
||||
public class LastaEnvTest extends UnitFessTestCase {
|
||||
|
||||
@Resource
|
||||
protected FessConfig fessConfig;
|
||||
|
|
|
@ -1,93 +0,0 @@
|
|||
/*
|
||||
* Copyright 2009-2015 the CodeLibs Project and the Others.
|
||||
*
|
||||
* Licensed under the Apache License, Version 2.0 (the "License");
|
||||
* you may not use this file except in compliance with the License.
|
||||
* You may obtain a copy of the License at
|
||||
*
|
||||
* http://www.apache.org/licenses/LICENSE-2.0
|
||||
*
|
||||
* Unless required by applicable law or agreed to in writing, software
|
||||
* distributed under the License is distributed on an "AS IS" BASIS,
|
||||
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND,
|
||||
* either express or implied. See the License for the specific language
|
||||
* governing permissions and limitations under the License.
|
||||
*/
|
||||
|
||||
package org.codelibs.fess.unit;
|
||||
|
||||
import java.util.Date;
|
||||
|
||||
import javax.annotation.Resource;
|
||||
|
||||
import org.dbflute.saflute.core.direction.FwAssistantDirector;
|
||||
import org.dbflute.saflute.core.direction.OptionalCoreDirection;
|
||||
import org.dbflute.saflute.core.magic.ThreadCacheContext;
|
||||
import org.dbflute.saflute.core.magic.TransactionTimeContext;
|
||||
import org.dbflute.saflute.core.time.TimeManager;
|
||||
import org.dbflute.utflute.seasar.ContainerTestCase;
|
||||
|
||||
/**
|
||||
* Use like this:
|
||||
* <pre>
|
||||
* YourTest extends {@link UnitFessContainerTestCase} {
|
||||
*
|
||||
* public void test_yourMethod() {
|
||||
* <span style="color: #3F7E5E">// ## Arrange ##</span>
|
||||
* YourAction action = new YourAction();
|
||||
* <span style="color: #FD4747">inject</span>(action);
|
||||
*
|
||||
* <span style="color: #3F7E5E">// ## Act ##</span>
|
||||
* action.submit();
|
||||
*
|
||||
* <span style="color: #3F7E5E">// ## Assert ##</span>
|
||||
* assertTrue(action...);
|
||||
* }
|
||||
* }
|
||||
* </pre>
|
||||
* @author jflute
|
||||
*/
|
||||
public abstract class UnitFessContainerTestCase extends ContainerTestCase {
|
||||
|
||||
// ===================================================================================
|
||||
// Attribute
|
||||
// =========
|
||||
@Resource
|
||||
protected FwAssistantDirector assistantDirector;
|
||||
|
||||
@Resource
|
||||
protected TimeManager timeManager;
|
||||
|
||||
// ===================================================================================
|
||||
// Settings
|
||||
// ========
|
||||
@Override
|
||||
public void setUp() throws Exception {
|
||||
super.setUp();
|
||||
initializeThreadCacheContext();
|
||||
initializeTransactionTime();
|
||||
initializeAssistantDirector();
|
||||
}
|
||||
|
||||
protected void initializeThreadCacheContext() {
|
||||
ThreadCacheContext.initialize();
|
||||
}
|
||||
|
||||
protected void initializeTransactionTime() {
|
||||
// because of non-UserTransaction transaction in UTFlute
|
||||
final Date transactionTime = timeManager.getFlashDate();
|
||||
TransactionTimeContext.setTransactionTime(transactionTime);
|
||||
}
|
||||
|
||||
protected void initializeAssistantDirector() {
|
||||
OptionalCoreDirection direction = assistantDirector.assistOptionalCoreDirection();
|
||||
direction.assistBootProcessCallback().callback(assistantDirector);
|
||||
}
|
||||
|
||||
@Override
|
||||
public void tearDown() throws Exception {
|
||||
TransactionTimeContext.clear();
|
||||
ThreadCacheContext.clear();
|
||||
super.tearDown();
|
||||
}
|
||||
}
|
42
src/test/java/org/codelibs/fess/unit/UnitFessTestCase.java
Normal file
42
src/test/java/org/codelibs/fess/unit/UnitFessTestCase.java
Normal file
|
@ -0,0 +1,42 @@
|
|||
/*
|
||||
* Copyright 2009-2015 the CodeLibs Project and the Others.
|
||||
*
|
||||
* Licensed under the Apache License, Version 2.0 (the "License");
|
||||
* you may not use this file except in compliance with the License.
|
||||
* You may obtain a copy of the License at
|
||||
*
|
||||
* http://www.apache.org/licenses/LICENSE-2.0
|
||||
*
|
||||
* Unless required by applicable law or agreed to in writing, software
|
||||
* distributed under the License is distributed on an "AS IS" BASIS,
|
||||
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND,
|
||||
* either express or implied. See the License for the specific language
|
||||
* governing permissions and limitations under the License.
|
||||
*/
|
||||
|
||||
package org.codelibs.fess.unit;
|
||||
|
||||
import org.dbflute.utflute.lastadi.ContainerTestCase;
|
||||
|
||||
/**
|
||||
* Use like this:
|
||||
* <pre>
|
||||
* YourTest extends {@link UnitFessTestCase} {
|
||||
*
|
||||
* public void test_yourMethod() {
|
||||
* <span style="color: #3F7E5E">// ## Arrange ##</span>
|
||||
* YourAction action = new YourAction();
|
||||
* <span style="color: #FD4747">inject</span>(action);
|
||||
*
|
||||
* <span style="color: #3F7E5E">// ## Act ##</span>
|
||||
* action.submit();
|
||||
*
|
||||
* <span style="color: #3F7E5E">// ## Assert ##</span>
|
||||
* assertTrue(action...);
|
||||
* }
|
||||
* }
|
||||
* </pre>
|
||||
* @author jflute
|
||||
*/
|
||||
public abstract class UnitFessTestCase extends ContainerTestCase {
|
||||
}
|
BIN
src/test/resources/dummydb/dummydb.mv.db
Normal file
BIN
src/test/resources/dummydb/dummydb.mv.db
Normal file
Binary file not shown.
Loading…
Add table
Reference in a new issue