Merge pull request #329 from codelibs/lastaflute

Replace with Lastaflute
This commit is contained in:
Shinsuke Sugaya 2015-10-05 22:22:24 +09:00
commit 390d274b5c
905 changed files with 88224 additions and 38218 deletions

1
.gitignore vendored
View file

@ -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

View file

@ -12,24 +12,29 @@ Fess is Solr based search server, but knowledge/experience about Solr is NOT nee
- [English](http://fess.codelibs.org/)
- [Japanese](http://fess.codelibs.org/ja/)
### Issues/Questions
## Issues/Questions
Please file an [issue](https://github.com/codelibs/fess/issues "issue").
(Japanese forum is [here](https://github.com/codelibs/codelibs-ja-forum "here").)
### Development
## Development
### Get Source Code
First of all, clone Fess's repositories:
$ cd ~/workspace
$ git clone https://github.com/codelibs/fess.git
$ git clone https://github.com/codelibs/fess-db.git
$ git clone https://github.com/codelibs/fess-suggest.git
$ git clone https://github.com/codelibs/fess-solr-plugin.git
and then imports them as Maven project.
If you want to re-create H2 database for Fess, runs:
and then imports it as Maven project on eclipse or ohter IDE.
### Download Elasticsearch Plugins
Run antrun:run to download plugins into plugins directory:
$ mvn antrun:run
### Run Fess
Run or debug org.codelibs.fess.FessBoot on IDE, and then access http://localhost:8080/fess/
$ cd fess-db/fess-db-h2
$ mvn dbflute:download
$ mvn dbflute:replace-schema

View file

@ -2,7 +2,7 @@
set ANT_OPTS=-Xmx512m
set DBFLUTE_HOME=..\mydbflute\dbflute-1.1.0-sp1
set DBFLUTE_HOME=..\mydbflute\dbflute-1.1.0-sp8
set MY_PROPERTIES_PATH=build.properties

View file

@ -2,6 +2,6 @@
export ANT_OPTS=-Xmx512m
export DBFLUTE_HOME=../mydbflute/dbflute-1.1.0-sp1
export DBFLUTE_HOME=../mydbflute/dbflute-1.1.0-sp8
export MY_PROPERTIES_PATH=build.properties

View file

@ -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)

View file

@ -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.

View file

@ -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
#}
}
# ----------------/

View file

@ -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 } }
}
}
# ----------------/

View file

@ -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 =

View file

@ -1,4 +1,30 @@
map:{
; ElasticsearchFessUserGen = map:{
; resourceMap = map:{
; resourceType = ELASTICSEARCH
; resourceFile = ../src/main/config/es/fess_user.json
}
; outputMap = map:{
; templateFile = unused
; outputDirectory = ../src/main/java
; package = org.codelibs.fess.es
; className = unused
}
; tableMap = map:{
; tablePath = .fess_user -> mappings -> map
; mappingMap = map:{
; type = map:{
; string = String
; integer = Integer
; long = Long
; float = Float
; double = Double
; boolean = Boolean
; date = LocalDateTime
}
}
}
}
; ElasticsearchFessConfigGen = map:{
; resourceMap = map:{
; resourceType = ELASTICSEARCH
@ -20,15 +46,15 @@ map:{
; float = Float
; double = Double
; boolean = Boolean
; date = java.time.LocalDateTime
; date = LocalDateTime
}
}
}
}
; ElasticsearchSearchLogGen = map:{
; ElasticsearchFessLogGen = map:{
; resourceMap = map:{
; resourceType = ELASTICSEARCH
; resourceFile = ../src/main/config/es/search_log.json
; resourceFile = ../src/main/config/es/fess_log.json
}
; outputMap = map:{
; templateFile = unused
@ -37,7 +63,7 @@ map:{
; className = unused
}
; tableMap = map:{
; tablePath = search_log -> mappings -> map
; tablePath = fess_log -> mappings -> map
; mappingMap = map:{
; type = map:{
; string = String
@ -46,7 +72,7 @@ map:{
; float = Float
; double = Double
; boolean = Boolean
; date = java.time.LocalDateTime
; date = LocalDateTime
}
}
}

View file

@ -0,0 +1,53 @@
# /---------------------------------------------------------------------------
# lastafluteMap: (NotRequired - Default map:{})
#
# Specification:
# map:{
# ; serviceName = [your service name]
# ; domainPackage = [package]
# ; environmentList = list:{ [environment name] }
# ; isMakeActionHtml = [true or false]
# ; commonMap = map:{
# ; path = [relative path to common project from DBFlute client]
# ; freeGenList = list:{ [env or config or label or message or html] }
# ; propertiesHtmlList = list:{ [env or config or label or message] }
# }
# ; appMap = map:{
# ; [application name, camel case, initial uncapitalised] = map:{
# ; path = [relative path to application project from DBFlute client]
# ; freeGenList = list:{ [env or config or label or message or html] }
# ; propertiesHtmlList = list:{ [env or config or label or message] }
# }
# }
# }
#
# *The line that starts with '#' means comment-out.
#
map:{
# your service name, camel case, initial uncapitalised
; serviceName = fess
# package for your domain name, e.g. com.example
; domainPackage = org.codelibs.fess
# keywords for environment properties, same as directory name
; environmentList = list:{}
# environment dispatch by lasta.env of system property?
; isUseLastaEnv = false
# settings for web applications
; appMap = map:{
; fess = map:{
; path = ..
; freeGenList = list:{ env ; config ; label ; message ; mail ; template ; jsp ; doc }
; propertiesHtmlList = list:{ env ; config ; label ; message }
}
}
# you can override (several) default settings like this:
#; overrideMap = map:{
# ; fess.freeGen.mail.targetDir = ./playsql/data/mail
#}
}
# ----------------/

View file

@ -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
#}
# - - - - - - - - - -/
}
# ----------------/

View file

@ -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
# - - - - - - - - - -/
}
# ----------------/

View file

@ -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
# - - - - - - - - - -/

View file

@ -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/
}
# ----------------/

View file

@ -1,5 +1,5 @@
# /---------------------------------------------------------------------------
# replaceSchemaDefinitionMap: (NotRequired - Default map:{})
# replaceSchemaMap: (NotRequired - Default map:{})
#
# The various settings about replace-schema.
#

View file

@ -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

View file

@ -25,6 +25,7 @@ import org.dbflute.cbean.ConditionBean;
import org.dbflute.cbean.coption.CursorSelectOption;
import org.dbflute.cbean.result.ListResultBean;
import org.dbflute.exception.IllegalBehaviorStateException;
import org.dbflute.util.DfTypeUtil;
import org.elasticsearch.action.bulk.BulkItemResponse;
import org.elasticsearch.action.bulk.BulkRequestBuilder;
import org.elasticsearch.action.bulk.BulkResponse;
@ -76,10 +77,17 @@ public abstract class AbstractBehavior<ENTITY extends Entity, CB extends Conditi
protected <RESULT extends ENTITY> List<RESULT> delegateSelectList(final ConditionBean cb, final Class<? extends RESULT> entityType) {
// TODO check response
final SearchRequestBuilder builder = client.prepareSearch(asEsIndex()).setTypes(asEsSearchType());
final int from;
final int size;
if (cb.isFetchScopeEffective()) {
builder.setFrom(cb.getFetchStartIndex());
builder.setSize(cb.getFetchSize());
from = cb.getFetchStartIndex();
size = cb.getFetchSize();
} else {
from = 0;
size = 10;
}
builder.setFrom(from);
builder.setSize(size);
((AbstractConditionBean) cb).request().build(builder);
final SearchResponse response = ((AbstractConditionBean) cb).build(builder).execute().actionGet();
@ -94,8 +102,8 @@ public abstract class AbstractBehavior<ENTITY extends Entity, CB extends Conditi
list.add(entity);
});
list.setPageSize(size);
list.setAllRecordCount((int) searchHits.totalHits());
list.setPageSize(cb.getFetchSize());
list.setCurrentPageNumber(cb.getFetchPageNumber());
list.setTook(response.getTookInMillis());
@ -346,72 +354,24 @@ public abstract class AbstractBehavior<ENTITY extends Entity, CB extends Conditi
return results;
}
protected static String toString(final Object value) {
if (value != null) {
return value.toString();
} else {
return null;
}
@Override
protected UpdateOption<CB> createPlainUpdateOption() {
UpdateOption<CB> updateOption = new UpdateOption<CB>();
updateOption.xtoBeCompatibleBatchUpdateDefaultEveryColumn();
return updateOption;
}
protected static Short toShort(final Object value) {
if (value instanceof Number) {
return ((Number) value).shortValue();
} else if (value instanceof String) {
return Short.parseShort(value.toString());
} else {
return null;
}
}
protected static Integer toInteger(final Object value) {
if (value instanceof Number) {
return ((Number) value).intValue();
} else if (value instanceof String) {
return Integer.parseInt(value.toString());
} else {
return null;
}
}
protected static Long toLong(final Object value) {
if (value instanceof Number) {
return ((Number) value).longValue();
} else if (value instanceof String) {
return Long.parseLong(value.toString());
} else {
return null;
}
}
protected static Float toFloat(final Object value) {
if (value instanceof Number) {
return ((Number) value).floatValue();
} else if (value instanceof String) {
return Float.parseFloat(value.toString());
} else {
return null;
}
}
protected static Double toDouble(final Object value) {
if (value instanceof Number) {
return ((Number) value).doubleValue();
} else if (value instanceof String) {
return Double.parseDouble(value.toString());
} else {
return null;
}
}
protected static Boolean toBoolean(final Object value) {
if (value instanceof Boolean) {
return ((Boolean) value).booleanValue();
} else if (value instanceof String) {
return Boolean.parseBoolean(value.toString());
} else {
public static String[] toStringArray(final Object value) {
if (value instanceof String[]) {
return (String[]) value;
} else if (value instanceof List) {
return ((List<?>) value).stream().map(v -> v.toString()).toArray(n -> new String[n]);
}
String str = DfTypeUtil.toString(value);
if (str == null) {
return null;
}
return new String[] { str };
}
public static class BulkList<E> implements List<E> {

View file

@ -572,6 +572,28 @@ public abstract class AbstractConditionBean implements ConditionBean {
// do nothing
}
@Override
public boolean hasSpecifiedLocalColumn() {
// TODO Auto-generated method stub
return false;
}
@Override
public void enableUndefinedClassificationSelect() {
// TODO Auto-generated method stub
}
@Override
public void disableUndefinedClassificationSelect() {
// TODO Auto-generated method stub
}
@Override
public boolean isUndefinedClassificationSelectAllowed() {
// TODO Auto-generated method stub
return false;
}
public SearchRequestParams request() {
return _searchRequestParams;
}

View file

@ -164,12 +164,14 @@ public abstract class AbstractConditionQuery implements ConditionQuery {
}
protected RangeQueryBuilder regRangeQ(String name, ConditionKey ck, Object value) {
for (QueryBuilder builder : queryBuilderList) {
if (builder instanceof RangeQueryBuilder) {
RangeQueryBuilder rangeQueryBuilder = (RangeQueryBuilder) builder;
if (rangeQueryBuilder.toString().replaceAll("\\s", "").startsWith("{\"range\":{\"" + name + "\"")) {
addRangeC(rangeQueryBuilder, ck, value);
return rangeQueryBuilder;
if (queryBuilderList != null) {
for (QueryBuilder builder : queryBuilderList) {
if (builder instanceof RangeQueryBuilder) {
RangeQueryBuilder rangeQueryBuilder = (RangeQueryBuilder) builder;
if (rangeQueryBuilder.toString().replaceAll("\\s", "").startsWith("{\"range\":{\"" + name + "\"")) {
addRangeC(rangeQueryBuilder, ck, value);
return rangeQueryBuilder;
}
}
}
}

View file

@ -163,9 +163,22 @@ public abstract class AbstractEntity implements Entity, Serializable, Cloneable
return null;
}
@Override
public void myunlockUndefinedClassificationAccess() {
// TODO Auto-generated method stub
}
@Override
public boolean myundefinedClassificationAccessAllowed() {
// TODO Auto-generated method stub
return false;
}
public abstract Map<String, Object> toSource();
public class DocMeta {
public class DocMeta implements Serializable {
private static final long serialVersionUID = 1L;
protected String id;

View file

@ -16,6 +16,7 @@ import org.dbflute.cbean.result.ListResultBean;
import org.dbflute.cbean.result.PagingResultBean;
import org.dbflute.exception.IllegalBehaviorStateException;
import org.dbflute.optional.OptionalEntity;
import org.dbflute.util.DfTypeUtil;
import org.elasticsearch.action.bulk.BulkRequestBuilder;
import org.elasticsearch.action.delete.DeleteRequestBuilder;
import org.elasticsearch.action.index.IndexRequestBuilder;
@ -54,10 +55,15 @@ public abstract class Bs${table.camelizedName}Bhv extends AbstractBehavior<${tab
protected <RESULT extends ${table.camelizedName}> RESULT createEntity(Map<String, Object> source, Class<? extends RESULT> entityType) {
try {
final RESULT result = entityType.newInstance();
#set ($tableMetaSettings = ${table.indexSettings.settings.index.dbflute.get($table.name)})
#foreach ($column in $table.columnList)
#if ($column.isNormalColumn)
#set ($javaNative = ${column.type})
result.set${column.capCamelName}(to$javaNative(source.get("${column.name}")));
#if ($tableMetaSettings.properties.get($column.name).array)
result.set${column.capCamelName}(to${javaNative}Array(source.get("${column.name}")));
#else
result.set${column.capCamelName}(DfTypeUtil.to$javaNative(source.get("${column.name}")));
#end
#end
#end
return result;
@ -224,5 +230,10 @@ public abstract class Bs${table.camelizedName}Bhv extends AbstractBehavior<${tab
}
// TODO create, modify, remove
@Override
protected boolean isCompatibleBatchInsertDefaultEveryColumn() {
return true;
}
}

View file

@ -1,5 +1,6 @@
package ${request.package}.cbean.cf.bs;
import java.time.LocalDateTime;
import java.util.Collection;
import ${request.package}.cbean.cf.${table.camelizedName}CF;
@ -90,11 +91,11 @@ public abstract class Bs${table.camelizedName}CF extends AbstractConditionFilter
}
}
public void query(org.codelibs.fess.es.cbean.cq.bs.AbstractConditionQuery.OperatorCall<${table.camelizedName}CQ> queryLambda) {
public void query(${request.package}.cbean.cq.bs.AbstractConditionQuery.OperatorCall<${table.camelizedName}CQ> queryLambda) {
query(queryLambda, null);
}
public void query(org.codelibs.fess.es.cbean.cq.bs.AbstractConditionQuery.OperatorCall<${table.camelizedName}CQ> queryLambda,
public void query(${request.package}.cbean.cq.bs.AbstractConditionQuery.OperatorCall<${table.camelizedName}CQ> queryLambda,
ConditionOptionCall<QueryFilterBuilder> opLambda) {
${table.camelizedName}CQ query = new ${table.camelizedName}CQ();
queryLambda.callback(query);

View file

@ -1,5 +1,6 @@
package ${request.package}.cbean.cq.bs;
import java.time.LocalDateTime;
import java.util.Collection;
import ${request.package}.cbean.cq.${table.camelizedName}CQ;

View file

@ -33,15 +33,17 @@ public class Bs${table.camelizedName} extends AbstractEntity {
// ===================================================================================
// Attribute
// =========
#set ($tableMetaSettings = ${table.indexSettings.settings.index.dbflute.get($table.name)})
#foreach ($column in $table.columnList)
#if ($column.isNormalColumn)
#set ($javaNative = ${column.type})
#elseif ($column.isRefColumn)
#set ($javaNative = ${column.camelizedName})
#end
#if ($tableMetaSettings.properties.get($column.name).array)#set($arrayType = "[]")#else#set($arrayType = "")#end
#if ($column.name != $idColumn)
/** ${column.name} */
protected ${javaNative} ${column.uncapCamelName};
protected ${javaNative}${arrayType} ${column.uncapCamelName};
#end
#end
@ -59,6 +61,7 @@ public class Bs${table.camelizedName} extends AbstractEntity {
#elseif ($column.isRefColumn)
#set ($javaNative = ${column.camelizedName})
#end
#if ($tableMetaSettings.properties.get($column.name).array)#set($arrayType = "[]")#else#set($arrayType = "")#end
#if ($column.name != $idColumn)
#if ($javaNative == "boolean")
public ${javaNative} is${column.capCamelName}() {
@ -66,13 +69,13 @@ public class Bs${table.camelizedName} extends AbstractEntity {
return ${column.uncapCamelName};
}
#else
public ${javaNative} get${column.capCamelName}() {
public ${javaNative}${arrayType} get${column.capCamelName}() {
checkSpecifiedProperty("${column.uncapCamelName}");
return ${column.uncapCamelName};
}
#end
public void set${column.capCamelName}(${javaNative} value) {
public void set${column.capCamelName}(${javaNative}${arrayType} value) {
registerModifiedProperty("${column.uncapCamelName}");
this.${column.uncapCamelName} = value;
}

View file

@ -2,13 +2,19 @@ package ${request.package}.bsentity.dbmeta;
import java.util.List;
import java.util.Map;
import java.time.LocalDateTime;
import ${request.package}.exentity.${table.camelizedName};
import org.dbflute.Entity;
import org.dbflute.dbmeta.AbstractDBMeta;
import org.dbflute.dbmeta.info.ColumnInfo;
import org.dbflute.dbmeta.info.UniqueInfo;
import org.dbflute.dbmeta.name.TableSqlName;
import org.dbflute.dbmeta.property.PropertyGateway;
import org.dbflute.dbway.DBDef;
import org.dbflute.util.DfTypeUtil;
public class ${table.camelizedName}Dbm extends AbstractDBMeta {
@ -24,6 +30,73 @@ public class ${table.camelizedName}Dbm extends AbstractDBMeta {
return _instance;
}
// ===================================================================================
// Property Gateway
// ================
// -----------------------------------------------------
// Column Property
// ---------------
protected final Map<String, PropertyGateway> _epgMap = newHashMap();
{
#set ($tableMetaSettings = ${table.indexSettings.settings.index.dbflute.get($table.name)})
#foreach ($col in $table.columnList)
#if ($col.isNormalColumn)
#set ($javaNative = ${col.type})
#elseif ($col.isRefColumn)
#set ($javaNative = ${col.camelizedName})
#end
#if ($tableMetaSettings.properties.get($col.name).array)
setupEpg(_epgMap, et-> ((${table.camelizedName})et).get${col.camelizedName}(),(et,vl)->((${table.camelizedName}) et).set${col.camelizedName}((${javaNative}[])vl), "${col.uncapCamelName}");
#else
setupEpg(_epgMap, et-> ((${table.camelizedName})et).get${col.camelizedName}(),(et,vl)->((${table.camelizedName}) et).set${col.camelizedName}(DfTypeUtil.to${javaNative}(vl)), "${col.uncapCamelName}");
#end
#end
}
@Override
public PropertyGateway findPropertyGateway(final String prop) {
return doFindEpg(_epgMap, prop);
}
// ===================================================================================
// Column Info
// ===========
#foreach ($col in $table.columnList)
#if ($col.isNormalColumn)
#set ($javaNative = ${col.type})
#elseif ($col.isRefColumn)
#set ($javaNative = ${col.camelizedName})
#end
#if ($tableMetaSettings.properties.get($col.name).array)#set($arrayType = "[]")#else#set($arrayType = "")#end
protected final ColumnInfo _column${col.camelizedName} = cci("${col.name}", "${col.name}", null, null, ${javaNative}${arrayType}.class, "${col.uncapCamelName}", null, false, false, false, "${col.type}", 0, 0, null, false, null, null, null, null, null, false);
#end
#foreach ($col in $table.columnList)
public ColumnInfo column${col.camelizedName}() { return _column${col.camelizedName}; }
#end
protected List<ColumnInfo> ccil() {
List<ColumnInfo> ls = newArrayList();
#foreach ($col in $table.columnList)
ls.add(column${col.camelizedName}());
#end
return ls;
}
// ===================================================================================
// Table Info
// ==========
protected final String _tableDbName = "${table.name}";
protected final String _tableDispName = "${table.name}";
protected final String _tablePropertyName = "${table.camelizedName}";
public String getTableDbName() { return _tableDbName; }
@Override
public String getTableDispName() { return _tableDispName; }
@Override
public String getTablePropertyName() { return _tablePropertyName; }
@Override
public TableSqlName getTableSqlName() { return null; }
@Override
public String getProjectName() {
// TODO Auto-generated method stub
@ -48,30 +121,6 @@ public class ${table.camelizedName}Dbm extends AbstractDBMeta {
return null;
}
@Override
public String getTableDbName() {
// TODO Auto-generated method stub
return null;
}
@Override
public String getTableDispName() {
// TODO Auto-generated method stub
return null;
}
@Override
public String getTablePropertyName() {
// TODO Auto-generated method stub
return null;
}
@Override
public TableSqlName getTableSqlName() {
// TODO Auto-generated method stub
return null;
}
@Override
public boolean hasPrimaryKey() {
// TODO Auto-generated method stub
@ -86,32 +135,27 @@ public class ${table.camelizedName}Dbm extends AbstractDBMeta {
@Override
public String getEntityTypeName() {
// TODO Auto-generated method stub
return null;
return "${request.package}.exentity.${table.camelizedName}";
}
@Override
public String getConditionBeanTypeName() {
// TODO Auto-generated method stub
return null;
return "${request.package}.cbean.${table.camelizedName}CB";
}
@Override
public String getBehaviorTypeName() {
// TODO Auto-generated method stub
return null;
return "${request.package}.exbhv.${table.camelizedName}Bhv";
}
@Override
public Class<? extends Entity> getEntityType() {
// TODO Auto-generated method stub
return null;
return ${table.camelizedName}.class;
}
@Override
public Entity newEntity() {
// TODO Auto-generated method stub
return null;
return new ${table.camelizedName}();
}
@Override
@ -138,12 +182,6 @@ public class ${table.camelizedName}Dbm extends AbstractDBMeta {
return null;
}
@Override
protected List<ColumnInfo> ccil() {
// TODO Auto-generated method stub
return null;
}
@Override
protected UniqueInfo cpui() {
// TODO Auto-generated method stub

File diff suppressed because it is too large Load diff

View 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">&nbsp;</td>
<td class="relcell">&nbsp;</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">&nbsp;</td>
<td class="flgcell">&nbsp;</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">&nbsp;&nbsp;</td>
<td class="relcell">&nbsp;</td>
<td class="relcell"> &nbsp;</td>
<td class="subcell">memberId</td>
<td class="subcell">Integer</td>
</tr>
<tr>
<td class="rownumcell">2</td>
<td class="flgcell">&nbsp;</td>
<td class="flgcell"> &nbsp;</td>
<td class="flgcell">&nbsp;</td>
<td class="flgcell">&nbsp;</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">&nbsp;&nbsp;</td>
<td class="relcell">&nbsp;</td>
<td class="relcell"> &nbsp;</td>
<td class="subcell">memberName</td>
<td class="subcell">String</td>
</tr>
<tr>
<td class="rownumcell">3</td>
<td class="flgcell">&nbsp;</td>
<td class="flgcell"> &nbsp;</td>
<td class="flgcell">&nbsp;</td>
<td class="flgcell">&nbsp;</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">&nbsp;&nbsp;</td>
<td class="relcell">&nbsp;</td>
<td class="relcell"> &nbsp;</td>
<td class="subcell">memberAccount</td>
<td class="subcell">String</td>
</tr>
<tr>
<td class="rownumcell">4</td>
<td class="flgcell">&nbsp;</td>
<td class="flgcell"> &nbsp;</td>
<td class="flgcell">&nbsp;</td>
<td class="flgcell">&nbsp;</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">&nbsp;&nbsp;</td>
<td class="relcell">&nbsp;</td>
<td class="relcell"> &nbsp;</td>
<td class="subcell">memberStatusCode</td>
<td class="subcell">String</td>
</tr>
<tr>
<td class="rownumcell">5</td>
<td class="flgcell">&nbsp;</td>
<td class="flgcell"> &nbsp;</td>
<td class="flgcell">&nbsp;</td>
<td class="flgcell">&nbsp;</td>
<td class="flgcell"> &nbsp;</td>
<td id="dummy_member_formalized_datetime">FORMALIZED_DATETIME</td>
<td class="typecell">TIMESTAMP</td>
<td class="sizecell"> 23, 10 </td>
<td class="relcell">&nbsp;&nbsp;</td>
<td class="relcell">&nbsp;</td>
<td class="relcell"> &nbsp;</td>
<td class="subcell">formalizedDatetime</td>
<td class="subcell">LocalDateTime</td>
</tr>
<tr>
<td class="rownumcell">6</td>
<td class="flgcell">&nbsp;</td>
<td class="flgcell"> &nbsp;</td>
<td class="flgcell">&nbsp;</td>
<td class="flgcell">&nbsp;</td>
<td class="flgcell"> &nbsp;</td>
<td id="dummy_member_birthdate">BIRTHDATE</td>
<td class="typecell">DATE</td>
<td class="sizecell"> 8 </td>
<td class="relcell">&nbsp;&nbsp;</td>
<td class="relcell">&nbsp;</td>
<td class="relcell"> &nbsp;</td>
<td class="subcell">birthdate</td>
<td class="subcell">LocalDate</td>
</tr>
<tr>
<td class="rownumcell">7</td>
<td class="flgcell">&nbsp;</td>
<td class="flgcell"> &nbsp;</td>
<td class="flgcell">&nbsp;</td>
<td class="flgcell">&nbsp;</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">&nbsp;&nbsp;</td>
<td class="relcell">&nbsp;</td>
<td class="relcell"> &nbsp;</td>
<td class="subcell">registerDatetime</td>
<td class="subcell">LocalDateTime</td>
</tr>
<tr>
<td class="rownumcell">8</td>
<td class="flgcell">&nbsp;</td>
<td class="flgcell"> &nbsp;</td>
<td class="flgcell">&nbsp;</td>
<td class="flgcell">&nbsp;</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">&nbsp;&nbsp;</td>
<td class="relcell">&nbsp;</td>
<td class="relcell"> &nbsp;</td>
<td class="subcell">registerUser</td>
<td class="subcell">String</td>
</tr>
<tr>
<td class="rownumcell">9</td>
<td class="flgcell">&nbsp;</td>
<td class="flgcell"> &nbsp;</td>
<td class="flgcell">&nbsp;</td>
<td class="flgcell">&nbsp;</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">&nbsp;&nbsp;</td>
<td class="relcell">&nbsp;</td>
<td class="relcell"> &nbsp;</td>
<td class="subcell">updateDatetime</td>
<td class="subcell">LocalDateTime</td>
</tr>
<tr>
<td class="rownumcell">10</td>
<td class="flgcell">&nbsp;</td>
<td class="flgcell"> &nbsp;</td>
<td class="flgcell">&nbsp;</td>
<td class="flgcell">&nbsp;</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">&nbsp;&nbsp;</td>
<td class="relcell">&nbsp;</td>
<td class="relcell"> &nbsp;</td>
<td class="subcell">updateUser</td>
<td class="subcell">String</td>
</tr>
<tr>
<td class="rownumcell">11</td>
<td class="flgcell">&nbsp;</td>
<td class="flgcell"> &nbsp;</td>
<td class="flgcell">&nbsp;</td>
<td class="flgcell">&nbsp;</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">&nbsp;&nbsp;</td>
<td class="relcell">&nbsp;</td>
<td class="relcell"> &nbsp;</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>

View file

@ -0,0 +1,66 @@
<!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>
/ :: RootAction <br>
/admin/ :: AdminAction <br>
/dict/ :: DictAction <br>
/admin/boostdocumentrule/ :: AdminBoostdocumentruleAction <br>
/admin/crawl/ :: AdminCrawlAction <br>
/admin/crawlingsession/ :: AdminCrawlingsessionAction <br>
/admin/dataconfig/ :: AdminDataconfigAction <br>
/admin/design/ :: AdminDesignAction <br>
/synonym/ :: SynonymAction <br>
/user/dict/ :: UserDictAction <br>
/admin/failureurl/ :: AdminFailureurlAction <br>
/admin/fileauthentication/ :: AdminFileauthenticationAction <br>
/admin/fileconfig/ :: AdminFileconfigAction <br>
/admin/group/ :: AdminGroupAction <br>
/admin/joblog/ :: AdminJoblogAction <br>
/admin/keymatch/ :: AdminKeymatchAction <br>
/admin/labeltype/ :: AdminLabeltypeAction <br>
/admin/log/ :: AdminLogAction <br>
/admin/overlappinghost/ :: AdminOverlappinghostAction <br>
/admin/pathmapping/ :: AdminPathmappingAction <br>
/admin/requestheader/ :: AdminRequestheaderAction <br>
/admin/role/ :: AdminRoleAction <br>
/admin/roletype/ :: AdminRoletypeAction <br>
/admin/scheduledjob/ :: AdminScheduledjobAction <br>
/admin/searchlist/ :: AdminSearchlistAction <br>
/admin/suggestbadword/ :: AdminSuggestbadwordAction <br>
/admin/suggestelevateword/ :: AdminSuggestelevatewordAction <br>
/admin/system/ :: AdminSystemAction <br>
/admin/systeminfo/ :: AdminSysteminfoAction <br>
/admin/user/ :: AdminUserAction <br>
/admin/webauthentication/ :: AdminWebauthenticationAction <br>
/admin/webconfig/ :: AdminWebconfigAction <br>
/admin/wizard/ :: AdminWizardAction <br>
/fess/admin/ :: FessAdminAction <br>
/fess/base/ :: FessBaseAction <br>
/fess/search/ :: FessSearchAction <br>
/cache/ :: CacheAction <br>
/error/ :: ErrorAction <br>
/go/ :: GoAction <br>
/help/ :: HelpAction <br>
/login/ :: LoginAction <br>
/logout/ :: LogoutAction <br>
/osdd/ :: OsddAction <br>
/screenshot/ :: ScreenshotAction <br>
/search/ :: SearchAction <br>
</body>
</html>

View file

@ -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
);

View 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>

1357
pom.xml

File diff suppressed because it is too large Load diff

View file

@ -0,0 +1,191 @@
#!/bin/sh
# OPTIONS:
# -d daemonize (run in background)
# -p pidfile write PID to <pidfile>
# -h
# --help print command line options
# -v print fess version, then exit
# -D prop set JAVA system property
# -X prop set non-standard JAVA system property
# --prop=val
# --prop val set fess property (i.e. -Des.<prop>=<val>)
CDPATH=""
SCRIPT="$0"
# SCRIPT may be an arbitrarily deep series of symlinks. Loop until we have the concrete path.
while [ -h "$SCRIPT" ] ; do
ls=`ls -ld "$SCRIPT"`
# Drop everything prior to ->
link=`expr "$ls" : '.*-> \(.*\)$'`
if expr "$link" : '/.*' > /dev/null; then
SCRIPT="$link"
else
SCRIPT=`dirname "$SCRIPT"`/"$link"
fi
done
# determine fess home
FESS_HOME=`dirname "$SCRIPT"`/..
# make ELASTICSEARCH_HOME absolute
FESS_HOME=`cd "$FESS_HOME"; pwd`
# If an include wasn't specified in the environment, then search for one...
if [ "x$FESS_INCLUDE" = "x" ]; then
# Locations (in order) to use when searching for an include file.
for include in /usr/share/fess/fess.in.sh \
/usr/local/share/fess/fess.in.sh \
/opt/fess/bin/fess.in.sh \
~/.fess.in.sh \
$FESS_HOME/bin/fess.in.sh \
"`dirname "$0"`"/fess.in.sh; do
if [ -r "$include" ]; then
. "$include"
break
fi
done
# ...otherwise, source the specified include.
elif [ -r "$FESS_INCLUDE" ]; then
. "$FESS_INCLUDE"
fi
if [ -x "$JAVA_HOME/bin/java" ]; then
JAVA="$JAVA_HOME/bin/java"
else
JAVA=`which java`
fi
if [ ! -x "$JAVA" ]; then
echo "Could not find any executable java binary. Please install java in your PATH or set JAVA_HOME"
exit 1
fi
if [ -z "$FESS_CLASSPATH" ]; then
echo "You must set the FESS_CLASSPATH var" >&2
exit 1
fi
# Special-case path variables.
case `uname` in
CYGWIN*)
FESS_CLASSPATH=`cygpath -p -w "$FESS_CLASSPATH"`
FESS_HOME=`cygpath -p -w "$FESS_HOME"`
;;
esac
launch_service()
{
pidpath=$1
daemonized=$2
props=$3
fess_parms="-Dfess"
if [ "x$pidpath" != "x" ]; then
fess_parms="$fess_parms -Dfess.pidfile=$pidpath"
fi
# Make sure we dont use any predefined locale, as we check some exception message strings and rely on english language
# As those strings are created by the OS, they are dependant on the configured locale
LANG=en_US.UTF-8
LC_ALL=en_US.UTF-8
export HOSTNAME=`hostname -s`
if [ "x$daemonized" = "x" ]; then
fess_parms="$fess_parms -Dfess.foreground=yes"
exec "$JAVA" $JAVA_OPTS $FESS_JAVA_OPTS $fess_parms -Dfess.es.dir="$ES_HOME" -cp "$FESS_CLASSPATH" $props \
org.codelibs.fess.FessBoot $FESS_OPTS
else
exec "$JAVA" $JAVA_OPTS $FESS_JAVA_OPTS $fess_parms -Dfess.es.dir="$ES_HOME" -cp "$FESS_CLASSPATH" $props \
org.codelibs.fess.FessBoot $FESS_OPTS <&- &
return $?
fi
}
# Print command line usage / help
usage() {
echo "Usage: $0 [-vdh] [-p pidfile] [-D prop] [-X prop]"
echo "Start fess."
echo " -d daemonize (run in background)"
echo " -p pidfile write PID to <pidfile>"
echo " -h"
echo " --help print command line options"
echo " -v print fess version, then exit"
echo " -D prop set JAVA system property"
echo " -X prop set non-standard JAVA system property"
echo " --prop=val"
echo " --prop val set fess property (i.e. -Des.<prop>=<val>)"
}
# Parse any long getopt options and put them into properties before calling getopt below
# Be dash compatible to make sure running under ubuntu works
ARGV=""
while [ $# -gt 0 ]
do
case $1 in
--help) ARGV="$ARGV -h"; shift;;
--*=*) properties="$properties -Dfess.${1#--}"
shift 1
;;
--*) [ $# -le 1 ] && {
echo "Option requires an argument: '$1'."
shift
continue
}
properties="$properties -Dfess.${1#--}=$2"
shift 2
;;
*) ARGV="$ARGV $1" ; shift
esac
done
# Parse any command line options.
args=`getopt vdhp:D:X: $ARGV`
eval set -- "$args"
while true; do
case $1 in
-v)
"$JAVA" $JAVA_OPTS $FESS_JAVA_OPTS $fess_parms -cp "$FESS_CLASSPATH" $props \
org.codelibs.fess.Version
exit 0
;;
-p)
pidfile="$2"
shift 2
;;
-d)
daemonized="yes"
shift
;;
-h)
usage
exit 0
;;
-D)
properties="$properties -D$2"
shift 2
;;
-X)
properties="$properties -X$2"
shift 2
;;
--)
shift
break
;;
*)
echo "Error parsing argument $1!" >&2
usage
exit 1
;;
esac
done
# Start up the service
launch_service "$pidfile" "$daemonized" "$properties"
exit $?

View file

@ -0,0 +1,83 @@
#!/bin/sh
FESS_CLASSPATH=$FESS_HOME/lib/classes
if [ "x$FESS_MIN_MEM" = "x" ]; then
FESS_MIN_MEM=256m
fi
if [ "x$FESS_MAX_MEM" = "x" ]; then
FESS_MAX_MEM=2g
fi
if [ "x$FESS_HEAP_SIZE" != "x" ]; then
FESS_MIN_MEM=$FESS_HEAP_SIZE
FESS_MAX_MEM=$FESS_HEAP_SIZE
fi
# min and max heap sizes should be set to the same value to avoid
# stop-the-world GC pauses during resize, and so that we can lock the
# heap in memory on startup to prevent any of it from being swapped
# out.
JAVA_OPTS="$JAVA_OPTS -Xms${FESS_MIN_MEM}"
JAVA_OPTS="$JAVA_OPTS -Xmx${FESS_MAX_MEM}"
# new generation
if [ "x$FESS_HEAP_NEWSIZE" != "x" ]; then
JAVA_OPTS="$JAVA_OPTS -Xmn${FESS_HEAP_NEWSIZE}"
fi
# max direct memory
if [ "x$FESS_DIRECT_SIZE" != "x" ]; then
JAVA_OPTS="$JAVA_OPTS -XX:MaxDirectMemorySize=${FESS_DIRECT_SIZE}"
fi
# set to headless, just in case
JAVA_OPTS="$JAVA_OPTS -Djava.awt.headless=true"
# Force the JVM to use IPv4 stack
if [ "x$FESS_USE_IPV4" != "x" ]; then
JAVA_OPTS="$JAVA_OPTS -Djava.net.preferIPv4Stack=true"
fi
JAVA_OPTS="$JAVA_OPTS -XX:+UseParNewGC"
JAVA_OPTS="$JAVA_OPTS -XX:+UseConcMarkSweepGC"
JAVA_OPTS="$JAVA_OPTS -XX:CMSInitiatingOccupancyFraction=75"
JAVA_OPTS="$JAVA_OPTS -XX:+UseCMSInitiatingOccupancyOnly"
# GC logging options
if [ "x$FESS_USE_GC_LOGGING" != "x" ]; then
JAVA_OPTS="$JAVA_OPTS -XX:+PrintGCDetails"
JAVA_OPTS="$JAVA_OPTS -XX:+PrintGCTimeStamps"
JAVA_OPTS="$JAVA_OPTS -XX:+PrintGCDateStamps"
JAVA_OPTS="$JAVA_OPTS -XX:+PrintClassHistogram"
JAVA_OPTS="$JAVA_OPTS -XX:+PrintTenuringDistribution"
JAVA_OPTS="$JAVA_OPTS -XX:+PrintGCApplicationStoppedTime"
JAVA_OPTS="$JAVA_OPTS -Xloggc:/var/log/elasticsearch/gc.log"
fi
# Causes the JVM to dump its heap on OutOfMemory.
JAVA_OPTS="$JAVA_OPTS -XX:+HeapDumpOnOutOfMemoryError"
# The path to the heap dump location, note directory must exists and have enough
# space for a full heap dump.
#JAVA_OPTS="$JAVA_OPTS -XX:HeapDumpPath=$FESS_HOME/logs/heapdump.hprof"
# Disables explicit GC
JAVA_OPTS="$JAVA_OPTS -XX:+DisableExplicitGC"
# Ensure UTF-8 encoding by default (e.g. filenames)
JAVA_OPTS="$JAVA_OPTS -Dfile.encoding=UTF-8"
# Application Configuration
APP_NAME=fess
ES_HOME=$FESS_HOME/es
FESS_JAVA_OPTS="$FESS_JAVA_OPTS -Dfess.home=$FESS_HOME"
FESS_JAVA_OPTS="$FESS_JAVA_OPTS -Dfess.context.path=/$APP_NAME"
FESS_JAVA_OPTS="$FESS_JAVA_OPTS -Dfess.port=8080"
FESS_JAVA_OPTS="$FESS_JAVA_OPTS -Dfess.webapp.path=$FESS_HOME/app"
FESS_JAVA_OPTS="$FESS_JAVA_OPTS -Dfess.webxml.path=$FESS_HOME/app/WEB-INF/web.xml"
FESS_JAVA_OPTS="$FESS_JAVA_OPTS -Dfess.temp.path=$FESS_HOME/temp"
FESS_JAVA_OPTS="$FESS_JAVA_OPTS -Dfess.log.name=$APP_NAME"
FESS_JAVA_OPTS="$FESS_JAVA_OPTS -Dfess.log.path=$FESS_HOME/logs"
FESS_JAVA_OPTS="$FESS_JAVA_OPTS -Dfess.log.level=info"
FESS_JAVA_OPTS="$FESS_JAVA_OPTS -Dlasta.env=production"

View file

@ -0,0 +1,10 @@
handlers=java.util.logging.FileHandler
.level=INFO
java.util.logging.ConsoleHandler.level=INFO
java.util.logging.ConsoleHandler.formatter=java.util.logging.SimpleFormatter
java.util.logging.FileHandler.level=INFO
java.util.logging.FileHandler.pattern=${fess.home}/logs/server_%g.log
java.util.logging.FileHandler.formatter=java.util.logging.SimpleFormatter
java.util.logging.FileHandler.count=10

View file

@ -0,0 +1,93 @@
<?xml version="1.0"?>
<assembly
xmlns="http://maven.apache.org/plugins/maven-assembly-plugin/assembly/1.1.3"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:schemaLocation="http://maven.apache.org/plugins/maven-assembly-plugin/assembly/1.1.3 http://maven.apache.org/xsd/assembly-1.1.3.xsd">
<id>package</id>
<formats>
<format>zip</format>
</formats>
<includeBaseDirectory>false</includeBaseDirectory>
<dependencySets>
<dependencySet>
<outputDirectory>fess-${project.version}/app</outputDirectory>
<useProjectArtifact>true</useProjectArtifact>
<unpack>true</unpack>
<includes>
<include>org.codelibs.fess:fess</include>
</includes>
</dependencySet>
<dependencySet>
<outputDirectory>fess-${project.version}/app/WEB-INF/cmd/lib</outputDirectory>
<useProjectArtifact>false</useProjectArtifact>
<includes>
<include>javax.servlet:javax.servlet-api</include>
</includes>
<scope>provided</scope>
</dependencySet>
</dependencySets>
<fileSets>
<!-- lib -->
<fileSet>
<directory>${project.build.directory}/tomcat-lib</directory>
<outputDirectory>fess-${project.version}/lib/classes</outputDirectory>
</fileSet>
<fileSet>
<directory>${project.build.directory}/fess/WEB-INF/classes/org/codelibs/fess/</directory>
<includes>
<include>FessBoot**</include>
</includes>
<outputDirectory>fess-${project.version}/lib/classes/org/codelibs/fess</outputDirectory>
</fileSet>
<fileSet>
<directory>${project.basedir}/src/main/assemblies/files</directory>
<includes>
<include>logging.properties</include>
</includes>
<outputDirectory>fess-${project.version}/lib/classes</outputDirectory>
</fileSet>
<!-- app -->
<fileSet>
<directory>${project.basedir}/src/main/assemblies/files</directory>
<fileMode>0755</fileMode>
<lineEnding>lf</lineEnding>
<includes>
<include>fess</include>
<include>fess.in.sh</include>
</includes>
<outputDirectory>fess-${project.version}/bin</outputDirectory>
</fileSet>
<!-- logs -->
<fileSet>
<directory>src/main/assemblies/files</directory>
<outputDirectory>fess-${project.version}/logs</outputDirectory>
<excludes>
<exclude>*</exclude>
</excludes>
<filtered>false</filtered>
</fileSet>
<!-- temp -->
<fileSet>
<directory>src/main/assemblies/files</directory>
<outputDirectory>fess-${project.version}/temp</outputDirectory>
<excludes>
<exclude>*</exclude>
</excludes>
<filtered>false</filtered>
</fileSet>
<!-- es/plugins -->
<fileSet>
<directory>${project.basedir}/plugins</directory>
<outputDirectory>fess-${project.version}/es/plugins</outputDirectory>
</fileSet>
<!-- es/data -->
<fileSet>
<directory>src/main/assemblies/files</directory>
<outputDirectory>fess-${project.version}/es/data</outputDirectory>
<excludes>
<exclude>*</exclude>
</excludes>
<filtered>false</filtered>
</fileSet>
</fileSets>
</assembly>

View file

@ -1,11 +1,7 @@
{
"search_log" : {
"aliases" : {
"search_log_search" : {},
"search_log_index" : {}
},
"fess_log" : {
"mappings" : {
"user_info" : {
"search_field_log" : {
"_all" : {
"enabled" : false
},
@ -13,10 +9,32 @@
"path" : "id"
},
"properties" : {
"code" : {
"id" : {
"type" : "string",
"index" : "not_analyzed"
},
"name" : {
"type" : "string",
"index" : "not_analyzed"
},
"searchLogId" : {
"type" : "string",
"index" : "not_analyzed"
},
"value" : {
"type" : "string",
"index" : "not_analyzed"
}
}
},
"favorite_log" : {
"_all" : {
"enabled" : false
},
"_id" : {
"path" : "id"
},
"properties" : {
"createdTime" : {
"type" : "long"
},
@ -24,8 +42,71 @@
"type" : "string",
"index" : "not_analyzed"
},
"updatedTime" : {
"url" : {
"type" : "string",
"index" : "not_analyzed"
},
"userInfoId" : {
"type" : "string",
"index" : "not_analyzed"
}
}
},
"event_log" : {
"_all" : {
"enabled" : false
},
"_id" : {
"path" : "id"
},
"properties" : {
"createdAt" : {
"type" : "date",
"format" : "dateOptionalTime"
},
"createdBy" : {
"type" : "string",
"index" : "not_analyzed"
},
"eventType" : {
"type" : "string",
"index" : "not_analyzed"
},
"id" : {
"type" : "string",
"index" : "not_analyzed"
},
"message" : {
"type" : "string"
},
"path" : {
"type" : "string",
"index" : "not_analyzed"
}
}
},
"click_log" : {
"_all" : {
"enabled" : false
},
"_id" : {
"path" : "id"
},
"properties" : {
"id" : {
"type" : "string",
"index" : "not_analyzed"
},
"requestedTime" : {
"type" : "long"
},
"searchLogId" : {
"type" : "string",
"index" : "not_analyzed"
},
"url" : {
"type" : "string",
"index" : "not_analyzed"
}
}
},
@ -86,7 +167,7 @@
}
}
},
"search_field_log" : {
"user_info" : {
"_all" : {
"enabled" : false
},
@ -94,32 +175,10 @@
"path" : "id"
},
"properties" : {
"id" : {
"code" : {
"type" : "string",
"index" : "not_analyzed"
},
"name" : {
"type" : "string",
"index" : "not_analyzed"
},
"searchLogId" : {
"type" : "string",
"index" : "not_analyzed"
},
"value" : {
"type" : "string",
"index" : "not_analyzed"
}
}
},
"favorite_log" : {
"_all" : {
"enabled" : false
},
"_id" : {
"path" : "id"
},
"properties" : {
"createdTime" : {
"type" : "long"
},
@ -127,45 +186,15 @@
"type" : "string",
"index" : "not_analyzed"
},
"url" : {
"type" : "string",
"index" : "not_analyzed"
},
"userInfoId" : {
"type" : "string",
"index" : "not_analyzed"
}
}
},
"click_log" : {
"_all" : {
"enabled" : false
},
"_id" : {
"path" : "id"
},
"properties" : {
"id" : {
"type" : "string",
"index" : "not_analyzed"
},
"requestedTime" : {
"updatedTime" : {
"type" : "long"
},
"searchLogId" : {
"type" : "string",
"index" : "not_analyzed"
},
"url" : {
"type" : "string",
"index" : "not_analyzed"
}
}
}
},
"settings" : {
"index" : {
"refresh_interval" : "1m",
"refresh_interval" : "60s",
"number_of_shards" : "10",
"number_of_replicas" : "0"
}

View file

@ -0,0 +1,90 @@
{
".fess_user" : {
"mappings" : {
"role" : {
"_all" : {
"enabled" : false
},
"_id" : {
"path" : "id"
},
"properties" : {
"id" : {
"type" : "string",
"index" : "not_analyzed"
},
"name" : {
"type" : "string",
"index" : "not_analyzed"
}
}
},
"user" : {
"_all" : {
"enabled" : false
},
"_id" : {
"path" : "id"
},
"properties" : {
"groups" : {
"type" : "string",
"index" : "not_analyzed"
},
"id" : {
"type" : "string",
"index" : "not_analyzed"
},
"name" : {
"type" : "string",
"index" : "not_analyzed"
},
"password" : {
"type" : "string",
"index" : "not_analyzed"
},
"roles" : {
"type" : "string",
"index" : "not_analyzed"
}
}
},
"group" : {
"_all" : {
"enabled" : false
},
"_id" : {
"path" : "id"
},
"properties" : {
"id" : {
"type" : "string",
"index" : "not_analyzed"
},
"name" : {
"type" : "string",
"index" : "not_analyzed"
}
}
}
},
"settings" : {
"index" : {
"refresh_interval" : "1s",
"dbflute" : {
"user" : {
"properties" : {
"groups" : {
"array" : "true"
},
"roles" : {
"array" : "true"
}
}
}
},
"number_of_replicas" : "0"
}
}
}
}

File diff suppressed because it is too large Load diff

View file

@ -88,12 +88,6 @@ public class Constants extends CoreLibConstants {
public static final long DEFAULT_CRAWLING_EXECUTION_INTERVAL = 5000L;
/** Solr Status: Active */
public static final String ACTIVE = "ACTIVE";
/** Solr Status: Inactive */
public static final String INACTIVE = "INACTIVE";
// fess properties
public static final String USER_INFO_PROPERTY = "user.info";
@ -232,9 +226,9 @@ public class Constants extends CoreLibConstants {
public static final String[] RESERVED = { "+", "-", "&&", "||", "!", "(", ")", "{", "}", "[", "]", "^", "~", "*", "?", "\\", ";", ":",
"/" };
public static final Pattern SOLR_FIELD_RESERVED_PATTERN = Pattern.compile("([+\\-!\\(\\){}\\[\\]^\"~\\\\:\\p{Zs}]|(&&)|(\\|\\|))"); // "*", "?",
public static final Pattern LUCENE_FIELD_RESERVED_PATTERN = Pattern.compile("([+\\-!\\(\\){}\\[\\]^\"~\\\\:\\p{Zs}]|(&&)|(\\|\\|))"); // "*", "?",
public static final Pattern SOLR_RANGE_FIELD_RESERVED_PATTERN = Pattern.compile("([!\\(\\){}\\[\\]\"~\\\\:\\p{Zs}]|(&&)|(\\|\\|))");
public static final Pattern LUCENE_RANGE_FIELD_RESERVED_PATTERN = Pattern.compile("([!\\(\\){}\\[\\]\"~\\\\:\\p{Zs}]|(&&)|(\\|\\|))");
public static final String SEARCH_LOG_ACCESS_TYPE = "searchLogAccessType";
@ -252,8 +246,6 @@ public class Constants extends CoreLibConstants {
public static final String SEARCH_FIELD_LOG_SEARCH_QUERY = "query";
public static final String SEARCH_FIELD_LOG_SOLR_QUERY = "solrQuery";
public static final String STATS_REPORT_TYPE = "reportType";
public static final String RESULT_DOC_ID_CACHE = "resultDocIds";
@ -305,14 +297,14 @@ public class Constants extends CoreLibConstants {
public static final String INVALID_NUMERIC_PARAMETER = "-1";
public static final String NOW = "NOW";
public static final String FACET_FIELD_PREFIX = "field:";
public static final String FACET_QUERY_PREFIX = "query:";
public static final String FESS_ES_TRANSPORT_ADDRESSES = "fess.es.transport_addresses";
public static final String FESS_ES_CLUSTER_NAME = "fess.es.cluster_name";
public static final int DEFAULT_PAGE_SIZE = 20;
public static final int DEFAULT_START_COUNT = 0;
@ -325,4 +317,14 @@ public class Constants extends CoreLibConstants {
public static final long ONE_DAY_IN_MILLIS = 24L * 60L * 60L * 1000L;
public static final String GUEST_USER = "guest";
public static final String[] PAGER_CONVERSION_RULE = { "allRecordCount", "pageSize", "currentPageNumber", "allPageCount",
"existPrePage", "existNextPage" };
// TODO remove searchParams
public static final String[] COMMON_CONVERSION_RULE = new String[] { "searchParams", "crudMode", "createdBy", "createdTime",
"updatedBy", "updatedTime" };
public static final String USER_INFO = "LoginInfo";
}

View file

@ -0,0 +1,128 @@
package org.codelibs.fess;
import java.io.ByteArrayInputStream;
import java.io.ByteArrayOutputStream;
import java.io.File;
import java.io.IOException;
import java.io.InputStream;
import java.nio.ByteBuffer;
import java.util.logging.Level;
import java.util.logging.LogManager;
import java.util.logging.Logger;
import java.util.regex.Pattern;
import org.dbflute.tomcat.TomcatBoot;
public class FessBoot extends TomcatBoot {
private static final Logger logger = Logger.getLogger(FessBoot.class.getPackage().getName());
private static final String LOGGING_PROPERTIES = "/logging.properties";
private static final String FESS_CONTEXT_PATH = "fess.context.path";
private static final String FESS_PORT = "fess.port";
private static final String FESS_TEMP_PATH = "fess.temp.path";
private static final String FESS_WEBXML_PATH = "fess.webxml.path";
private static final String FESS_WEBAPP_PATH = "fess.webapp.path";
private static final String JAVA_IO_TMPDIR = "java.io.tmpdir";
private static final int DEFAULT_BUF_SIZE = 4096;
private static final String UTF_8 = "UTF-8";
public FessBoot(final int port, final String contextPath) {
super(port, contextPath);
}
@Override
protected String prepareWebappPath() {
final String value = System.getProperty(FESS_WEBAPP_PATH);
if (value != null) {
return value;
}
return super.prepareWebappPath();
}
@Override
protected String prepareWebXmlPath() {
final String value = System.getProperty(FESS_WEBXML_PATH);
if (value != null) {
return value;
}
return super.prepareWebXmlPath();
}
@Override
protected String getMarkDir() {
return new File(System.getProperty(JAVA_IO_TMPDIR), "fessboot").getAbsolutePath();
}
@Override
protected void info(final String msg) {
logger.info(msg);
}
// ===================================================================================
// main
// ============
public static void main(final String[] args) {
// load logging.properties
try (InputStream is = FessBoot.class.getResourceAsStream(LOGGING_PROPERTIES)) {
if (is != null) {
try (ByteArrayOutputStream out = new ByteArrayOutputStream()) {
final ByteBuffer buffer = ByteBuffer.allocate(DEFAULT_BUF_SIZE);
final byte[] buf = buffer.array();
int len;
while ((len = is.read(buf)) != -1) {
out.write(buf, 0, len);
}
String configContent = out.toString(UTF_8);
final String fessHomeDir = System.getProperty("fess.home");
if (fessHomeDir != null) {
configContent = configContent.replaceAll(Pattern.quote("${fess.home}"), fessHomeDir);
}
LogManager.getLogManager().readConfiguration(new ByteArrayInputStream(configContent.getBytes(UTF_8)));
logger.info(LOGGING_PROPERTIES + " is loaded.");
}
}
} catch (final IOException e) {
logger.log(Level.WARNING, "Failed to load " + LOGGING_PROPERTIES, e);
}
// update java.io.tmpdir
final String value = System.getProperty(FESS_TEMP_PATH);
if (value != null) {
System.setProperty(JAVA_IO_TMPDIR, value);
}
new FessBoot(getPort(), getContextPath()).useTldDetect().asDevelopment(isNoneEnv()).bootAwait();
}
private static boolean isNoneEnv() {
return System.getProperty("lasta.env") == null;
}
protected static int getPort() {
final String value = System.getProperty(FESS_PORT);
if (value != null) {
return Integer.parseInt(value);
}
return 8080;
}
protected static String getContextPath() {
final String value = System.getProperty(FESS_CONTEXT_PATH);
if (value != null) {
return value;
}
return "/fess";
}
}

View file

@ -22,27 +22,24 @@ import java.lang.annotation.RetentionPolicy;
import java.lang.annotation.Target;
import org.codelibs.core.lang.StringUtil;
import org.seasar.struts.annotation.Arg;
import org.seasar.struts.annotation.Msg;
import org.seasar.struts.annotation.Validator;
@Retention(RetentionPolicy.RUNTIME)
@Target(ElementType.FIELD)
@Validator("cronExpression")
//@Validator("cronExpression")
public @interface CronExpression {
/**
* A validation message.
*
* @return
*/
Msg msg() default @Msg(key = "errors.cronexpression");
//Msg msg() default @Msg(key = "errors.cronexpression");
/**
* Argument for a message
*
* @return
*/
Arg arg0() default @Arg(key = StringUtil.EMPTY);
//Arg arg0() default @Arg(key = StringUtil.EMPTY);
/**
* a target name for this validation

View file

@ -13,7 +13,7 @@
* either express or implied. See the License for the specific language
* governing permissions and limitations under the License.
*/
package org.codelibs.sastruts.core.annotation;
package org.codelibs.fess.annotation;
import java.lang.annotation.ElementType;
import java.lang.annotation.Retention;
@ -22,7 +22,7 @@ import java.lang.annotation.Target;
/**
* @author shinsuke
*
*
*/
@Target(ElementType.METHOD)
@Retention(RetentionPolicy.RUNTIME)

View file

@ -22,13 +22,10 @@ import java.lang.annotation.RetentionPolicy;
import java.lang.annotation.Target;
import org.codelibs.core.lang.StringUtil;
import org.seasar.struts.annotation.Arg;
import org.seasar.struts.annotation.Msg;
import org.seasar.struts.annotation.Validator;
@Retention(RetentionPolicy.RUNTIME)
@Target(ElementType.FIELD)
@Validator("uriType")
//@Validator("uriType")
public @interface UriType {
String protocols();
@ -38,14 +35,14 @@ public @interface UriType {
*
* @return
*/
Msg msg() default @Msg(key = "errors.cronexpression");
//Msg msg() default @Msg(key = "errors.cronexpression");
/**
* Argument for a message
*
* @return
*/
Arg arg0() default @Arg(key = StringUtil.EMPTY);
//Arg arg0() default @Arg(key = StringUtil.EMPTY);
/**
* a target name for this validation

View file

@ -13,7 +13,7 @@
* either express or implied. See the License for the specific language
* governing permissions and limitations under the License.
*/
package org.codelibs.sastruts.core.annotation;
package org.codelibs.fess.annotation;
import java.lang.annotation.ElementType;
import java.lang.annotation.Retention;
@ -22,7 +22,7 @@ import java.lang.annotation.Target;
/**
* @author shinsuke
*
*
*/
@Target({ ElementType.FIELD, ElementType.METHOD })
@Retention(RetentionPolicy.RUNTIME)

View file

@ -16,6 +16,16 @@
package org.codelibs.fess.api;
import java.io.IOException;
import java.io.OutputStreamWriter;
import java.io.PrintWriter;
import javax.servlet.http.HttpServletResponse;
import org.codelibs.core.exception.IORuntimeException;
import org.lastaflute.web.util.LaRequestUtil;
import org.lastaflute.web.util.LaResponseUtil;
public class BaseApiManager {
protected static final String FAVORITES_API = "/favoritesApi";
@ -60,4 +70,31 @@ public class BaseApiManager {
}
}
public static void write(final String text, String contentType, String encoding) {
if (contentType == null) {
contentType = "text/plain";
}
if (encoding == null) {
encoding = LaRequestUtil.getRequest().getCharacterEncoding();
if (encoding == null) {
encoding = "UTF-8";
}
}
final HttpServletResponse response = LaResponseUtil.getResponse();
response.setContentType(contentType + "; charset=" + encoding);
try {
PrintWriter out = null;
try {
out = new PrintWriter(new OutputStreamWriter(response.getOutputStream(), encoding));
out.print(text);
} finally {
if (out != null) {
out.close();
}
}
} catch (final IOException e) {
throw new IORuntimeException(e);
}
}
}

View file

@ -28,24 +28,23 @@ import javax.servlet.ServletException;
import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpServletResponse;
import org.apache.commons.lang.StringEscapeUtils;
import org.apache.commons.lang3.StringEscapeUtils;
import org.codelibs.core.CoreLibConstants;
import org.codelibs.core.lang.StringUtil;
import org.codelibs.fess.Constants;
import org.codelibs.fess.WebApiException;
import org.codelibs.fess.api.BaseApiManager;
import org.codelibs.fess.api.WebApiManager;
import org.codelibs.fess.api.WebApiRequest;
import org.codelibs.fess.api.WebApiResponse;
import org.codelibs.fess.client.FessEsClient;
import org.codelibs.fess.entity.PingResponse;
import org.codelibs.fess.es.client.FessEsClient;
import org.codelibs.fess.exception.WebApiException;
import org.codelibs.fess.util.ComponentUtil;
import org.codelibs.fess.util.FacetResponse;
import org.codelibs.fess.util.FacetResponse.Field;
import org.codelibs.fess.util.MoreLikeThisResponse;
import org.codelibs.fess.util.WebApiUtil;
import org.seasar.struts.util.RequestUtil;
import org.seasar.struts.util.ResponseUtil;
import org.lastaflute.web.util.LaRequestUtil;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
@ -519,7 +518,7 @@ public class JsonApiManager extends BaseApiManager implements WebApiManager {
}
protected void writeJsonResponse(final int status, final String body, final String errMsg) {
final String callback = RequestUtil.getRequest().getParameter("callback");
final String callback = LaRequestUtil.getRequest().getParameter("callback");
final boolean isJsonp = StringUtil.isNotBlank(callback);
final StringBuilder buf = new StringBuilder(1000);
@ -548,7 +547,7 @@ public class JsonApiManager extends BaseApiManager implements WebApiManager {
if (isJsonp) {
buf.append(')');
}
ResponseUtil.write(buf.toString(), "text/javascript+json", Constants.UTF_8);
write(buf.toString(), "text/javascript+json", Constants.UTF_8);
}

View file

@ -27,7 +27,7 @@ import javax.servlet.ServletException;
import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpServletResponse;
import org.apache.commons.lang.StringEscapeUtils;
import org.apache.commons.lang3.StringEscapeUtils;
import org.codelibs.core.CoreLibConstants;
import org.codelibs.core.lang.StringUtil;
import org.codelibs.fess.Constants;
@ -35,14 +35,13 @@ import org.codelibs.fess.api.BaseApiManager;
import org.codelibs.fess.api.WebApiManager;
import org.codelibs.fess.api.WebApiRequest;
import org.codelibs.fess.api.WebApiResponse;
import org.codelibs.fess.client.FessEsClient;
import org.codelibs.fess.entity.PingResponse;
import org.codelibs.fess.es.client.FessEsClient;
import org.codelibs.fess.util.ComponentUtil;
import org.codelibs.fess.util.FacetResponse;
import org.codelibs.fess.util.FacetResponse.Field;
import org.codelibs.fess.util.MoreLikeThisResponse;
import org.codelibs.fess.util.WebApiUtil;
import org.seasar.struts.util.ResponseUtil;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
@ -375,7 +374,7 @@ public class XmlApiManager extends BaseApiManager implements WebApiManager {
buf.append("</message>");
}
buf.append("</response>");
ResponseUtil.write(buf.toString(), "text/xml", Constants.UTF_8);
write(buf.toString(), "text/xml", Constants.UTF_8);
}

View file

@ -14,7 +14,7 @@
* governing permissions and limitations under the License.
*/
package org.codelibs.fess.pager;
package org.codelibs.fess.app.pager;
import java.io.Serializable;
import java.util.List;

View file

@ -14,13 +14,16 @@
* governing permissions and limitations under the License.
*/
package org.codelibs.fess.pager;
package org.codelibs.fess.app.pager;
import java.io.Serializable;
import java.util.List;
import org.codelibs.fess.Constants;
public class CrawlingSessionPager {
public class CrawlingSessionPager implements Serializable {
private static final long serialVersionUID = 1L;
public static final int DEFAULT_PAGE_SIZE = 20;

View file

@ -14,13 +14,16 @@
* governing permissions and limitations under the License.
*/
package org.codelibs.fess.pager;
package org.codelibs.fess.app.pager;
import java.io.Serializable;
import java.util.List;
import org.codelibs.fess.Constants;
public class DataConfigPager {
public class DataConfigPager implements Serializable {
private static final long serialVersionUID = 1L;
public static final int DEFAULT_PAGE_SIZE = 20;

View file

@ -14,26 +14,27 @@
* governing permissions and limitations under the License.
*/
package org.codelibs.fess.pager;
package org.codelibs.fess.app.pager;
import java.io.Serializable;
import java.util.List;
import org.codelibs.fess.Constants;
import org.seasar.struts.annotation.IntRange;
import org.seasar.struts.annotation.Maxbytelength;
public class FailureUrlPager {
public class FailureUrlPager implements Serializable {
@Maxbytelength(maxbytelength = 1000)
private static final long serialVersionUID = 1L;
//@Maxbytelength(maxbytelength = 1000)
public String url;
@IntRange(min = 0, max = 2147483647)
//@IntRange(min = 0, max = 2147483647)
public String errorCountMin;
@IntRange(min = 0, max = 2147483647)
//@IntRange(min = 0, max = 2147483647)
public String errorCountMax;
@Maxbytelength(maxbytelength = 1000)
//@Maxbytelength(maxbytelength = 1000)
public String errorName;
public static final int DEFAULT_PAGE_SIZE = 20;

View file

@ -14,13 +14,16 @@
* governing permissions and limitations under the License.
*/
package org.codelibs.fess.pager;
package org.codelibs.fess.app.pager;
import java.io.Serializable;
import java.util.List;
import org.codelibs.fess.Constants;
public class FileAuthenticationPager {
public class FileAuthenticationPager implements Serializable {
private static final long serialVersionUID = 1L;
public static final int DEFAULT_PAGE_SIZE = 20;

View file

@ -14,13 +14,16 @@
* governing permissions and limitations under the License.
*/
package org.codelibs.fess.pager;
package org.codelibs.fess.app.pager;
import java.io.Serializable;
import java.util.List;
import org.codelibs.fess.Constants;
public class FileConfigPager {
public class FileConfigPager implements Serializable {
private static final long serialVersionUID = 1L;
public static final int DEFAULT_PAGE_SIZE = 20;

View file

@ -0,0 +1,132 @@
/*
* 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.app.pager;
import java.io.Serializable;
import java.util.List;
import org.codelibs.fess.Constants;
public class GroupPager implements Serializable {
private static final long serialVersionUID = 1L;
public static final int DEFAULT_PAGE_SIZE = 20;
public static final int DEFAULT_CURRENT_PAGE_NUMBER = 1;
private int allRecordCount;
private int allPageCount;
private boolean existPrePage;
private boolean existNextPage;
private List<Integer> pageNumberList;
private int pageSize;
private int currentPageNumber;
public String id;
public String name;
public String versionNo;
public void clear() {
pageSize = getDefaultPageSize();
currentPageNumber = getDefaultCurrentPageNumber();
id = null;
name = null;
versionNo = null;
}
protected int getDefaultCurrentPageNumber() {
return DEFAULT_CURRENT_PAGE_NUMBER;
}
public int getAllRecordCount() {
return allRecordCount;
}
public void setAllRecordCount(final int allRecordCount) {
this.allRecordCount = allRecordCount;
}
public int getAllPageCount() {
return allPageCount;
}
public void setAllPageCount(final int allPageCount) {
this.allPageCount = allPageCount;
}
public boolean isExistPrePage() {
return existPrePage;
}
public void setExistPrePage(final boolean existPrePage) {
this.existPrePage = existPrePage;
}
public boolean isExistNextPage() {
return existNextPage;
}
public void setExistNextPage(final boolean existNextPage) {
this.existNextPage = existNextPage;
}
public int getPageSize() {
if (pageSize <= 0) {
pageSize = getDefaultPageSize();
}
return pageSize;
}
public void setPageSize(final int pageSize) {
this.pageSize = pageSize;
}
public int getCurrentPageNumber() {
if (currentPageNumber <= 0) {
currentPageNumber = getDefaultCurrentPageNumber();
}
return currentPageNumber;
}
public void setCurrentPageNumber(final int currentPageNumber) {
this.currentPageNumber = currentPageNumber;
}
public List<Integer> getPageNumberList() {
return pageNumberList;
}
public void setPageNumberList(final List<Integer> pageNumberList) {
this.pageNumberList = pageNumberList;
}
protected int getDefaultPageSize() {
return Constants.DEFAULT_ADMIN_PAGE_SIZE;
}
}

View file

@ -14,13 +14,16 @@
* governing permissions and limitations under the License.
*/
package org.codelibs.fess.pager;
package org.codelibs.fess.app.pager;
import java.io.Serializable;
import java.util.List;
import org.codelibs.fess.Constants;
public class JobLogPager {
public class JobLogPager implements Serializable {
private static final long serialVersionUID = 1L;
public static final int DEFAULT_PAGE_SIZE = 20;

View file

@ -14,17 +14,16 @@
* governing permissions and limitations under the License.
*/
package org.codelibs.fess.pager;
package org.codelibs.fess.app.pager;
import java.io.Serializable;
import java.util.List;
import org.codelibs.fess.Constants;
public class KeyMatchPager {
public class KeyMatchPager implements Serializable {
public KeyMatchPager() {
super();
}
private static final long serialVersionUID = 1L;
public static final int DEFAULT_PAGE_SIZE = 20;

View file

@ -14,13 +14,16 @@
* governing permissions and limitations under the License.
*/
package org.codelibs.fess.pager;
package org.codelibs.fess.app.pager;
import java.io.Serializable;
import java.util.List;
import org.codelibs.fess.Constants;
public class LabelTypePager {
public class LabelTypePager implements Serializable {
private static final long serialVersionUID = 1L;
public static final int DEFAULT_PAGE_SIZE = 20;

View file

@ -14,13 +14,16 @@
* governing permissions and limitations under the License.
*/
package org.codelibs.fess.pager;
package org.codelibs.fess.app.pager;
import java.io.Serializable;
import java.util.List;
import org.codelibs.fess.Constants;
public class OverlappingHostPager {
public class OverlappingHostPager implements Serializable {
private static final long serialVersionUID = 1L;
public static final int DEFAULT_PAGE_SIZE = 20;

View file

@ -14,13 +14,16 @@
* governing permissions and limitations under the License.
*/
package org.codelibs.fess.pager;
package org.codelibs.fess.app.pager;
import java.io.Serializable;
import java.util.List;
import org.codelibs.fess.Constants;
public class PathMappingPager {
public class PathMappingPager implements Serializable {
private static final long serialVersionUID = 1L;
public static final int DEFAULT_PAGE_SIZE = 20;

View file

@ -14,13 +14,16 @@
* governing permissions and limitations under the License.
*/
package org.codelibs.fess.pager;
package org.codelibs.fess.app.pager;
import java.io.Serializable;
import java.util.List;
import org.codelibs.fess.Constants;
public class RequestHeaderPager {
public class RequestHeaderPager implements Serializable {
private static final long serialVersionUID = 1L;
public static final int DEFAULT_PAGE_SIZE = 20;

View file

@ -0,0 +1,132 @@
/*
* 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.app.pager;
import java.io.Serializable;
import java.util.List;
import org.codelibs.fess.Constants;
public class RolePager implements Serializable {
private static final long serialVersionUID = 1L;
public static final int DEFAULT_PAGE_SIZE = 20;
public static final int DEFAULT_CURRENT_PAGE_NUMBER = 1;
private int allRecordCount;
private int allPageCount;
private boolean existPrePage;
private boolean existNextPage;
private List<Integer> pageNumberList;
private int pageSize;
private int currentPageNumber;
public String id;
public String name;
public String versionNo;
public void clear() {
pageSize = getDefaultPageSize();
currentPageNumber = getDefaultCurrentPageNumber();
id = null;
name = null;
versionNo = null;
}
protected int getDefaultCurrentPageNumber() {
return DEFAULT_CURRENT_PAGE_NUMBER;
}
public int getAllRecordCount() {
return allRecordCount;
}
public void setAllRecordCount(final int allRecordCount) {
this.allRecordCount = allRecordCount;
}
public int getAllPageCount() {
return allPageCount;
}
public void setAllPageCount(final int allPageCount) {
this.allPageCount = allPageCount;
}
public boolean isExistPrePage() {
return existPrePage;
}
public void setExistPrePage(final boolean existPrePage) {
this.existPrePage = existPrePage;
}
public boolean isExistNextPage() {
return existNextPage;
}
public void setExistNextPage(final boolean existNextPage) {
this.existNextPage = existNextPage;
}
public int getPageSize() {
if (pageSize <= 0) {
pageSize = getDefaultPageSize();
}
return pageSize;
}
public void setPageSize(final int pageSize) {
this.pageSize = pageSize;
}
public int getCurrentPageNumber() {
if (currentPageNumber <= 0) {
currentPageNumber = getDefaultCurrentPageNumber();
}
return currentPageNumber;
}
public void setCurrentPageNumber(final int currentPageNumber) {
this.currentPageNumber = currentPageNumber;
}
public List<Integer> getPageNumberList() {
return pageNumberList;
}
public void setPageNumberList(final List<Integer> pageNumberList) {
this.pageNumberList = pageNumberList;
}
protected int getDefaultPageSize() {
return Constants.DEFAULT_ADMIN_PAGE_SIZE;
}
}

View file

@ -14,13 +14,16 @@
* governing permissions and limitations under the License.
*/
package org.codelibs.fess.pager;
package org.codelibs.fess.app.pager;
import java.io.Serializable;
import java.util.List;
import org.codelibs.fess.Constants;
public class RoleTypePager {
public class RoleTypePager implements Serializable {
private static final long serialVersionUID = 1L;
public static final int DEFAULT_PAGE_SIZE = 20;

View file

@ -14,13 +14,16 @@
* governing permissions and limitations under the License.
*/
package org.codelibs.fess.pager;
package org.codelibs.fess.app.pager;
import java.io.Serializable;
import java.util.List;
import org.codelibs.fess.Constants;
public class ScheduledJobPager {
public class ScheduledJobPager implements Serializable {
private static final long serialVersionUID = 1L;
public static final int DEFAULT_PAGE_SIZE = 20;

View file

@ -14,13 +14,16 @@
* governing permissions and limitations under the License.
*/
package org.codelibs.fess.pager;
package org.codelibs.fess.app.pager;
import java.io.Serializable;
import java.util.List;
import org.codelibs.fess.Constants;
public class SuggestBadWordPager {
public class SuggestBadWordPager implements Serializable {
private static final long serialVersionUID = 1L;
public static final int DEFAULT_PAGE_SIZE = 20;

View file

@ -14,13 +14,16 @@
* governing permissions and limitations under the License.
*/
package org.codelibs.fess.pager;
package org.codelibs.fess.app.pager;
import java.io.Serializable;
import java.util.List;
import org.codelibs.fess.Constants;
public class SuggestElevateWordPager {
public class SuggestElevateWordPager implements Serializable {
private static final long serialVersionUID = 1L;
public static final int DEFAULT_PAGE_SIZE = 20;

View file

@ -14,7 +14,7 @@
* governing permissions and limitations under the License.
*/
package org.codelibs.fess.pager;
package org.codelibs.fess.app.pager;
import java.io.Serializable;
import java.util.List;

View file

@ -14,7 +14,7 @@
* governing permissions and limitations under the License.
*/
package org.codelibs.fess.pager;
package org.codelibs.fess.app.pager;
import java.io.Serializable;
import java.util.List;

View file

@ -0,0 +1,136 @@
/*
* 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.app.pager;
import java.io.Serializable;
import java.util.List;
import org.codelibs.fess.Constants;
public class UserPager implements Serializable {
private static final long serialVersionUID = 1L;
public static final int DEFAULT_PAGE_SIZE = 20;
public static final int DEFAULT_CURRENT_PAGE_NUMBER = 1;
private int allRecordCount;
private int allPageCount;
private boolean existPrePage;
private boolean existNextPage;
private List<Integer> pageNumberList;
private int pageSize;
private int currentPageNumber;
public String id;
public String name;
public String[] roles;
public String[] groups;
public String versionNo;
public void clear() {
pageSize = getDefaultPageSize();
currentPageNumber = getDefaultCurrentPageNumber();
id = null;
roles = null;
groups = null;
versionNo = null;
}
protected int getDefaultCurrentPageNumber() {
return DEFAULT_CURRENT_PAGE_NUMBER;
}
public int getAllRecordCount() {
return allRecordCount;
}
public void setAllRecordCount(final int allRecordCount) {
this.allRecordCount = allRecordCount;
}
public int getAllPageCount() {
return allPageCount;
}
public void setAllPageCount(final int allPageCount) {
this.allPageCount = allPageCount;
}
public boolean isExistPrePage() {
return existPrePage;
}
public void setExistPrePage(final boolean existPrePage) {
this.existPrePage = existPrePage;
}
public boolean isExistNextPage() {
return existNextPage;
}
public void setExistNextPage(final boolean existNextPage) {
this.existNextPage = existNextPage;
}
public int getPageSize() {
if (pageSize <= 0) {
pageSize = getDefaultPageSize();
}
return pageSize;
}
public void setPageSize(final int pageSize) {
this.pageSize = pageSize;
}
public int getCurrentPageNumber() {
if (currentPageNumber <= 0) {
currentPageNumber = getDefaultCurrentPageNumber();
}
return currentPageNumber;
}
public void setCurrentPageNumber(final int currentPageNumber) {
this.currentPageNumber = currentPageNumber;
}
public List<Integer> getPageNumberList() {
return pageNumberList;
}
public void setPageNumberList(final List<Integer> pageNumberList) {
this.pageNumberList = pageNumberList;
}
protected int getDefaultPageSize() {
return Constants.DEFAULT_ADMIN_PAGE_SIZE;
}
}

View file

@ -14,13 +14,16 @@
* governing permissions and limitations under the License.
*/
package org.codelibs.fess.pager;
package org.codelibs.fess.app.pager;
import java.io.Serializable;
import java.util.List;
import org.codelibs.fess.Constants;
public class WebAuthenticationPager {
public class WebAuthenticationPager implements Serializable {
private static final long serialVersionUID = 1L;
public static final int DEFAULT_PAGE_SIZE = 20;

View file

@ -14,13 +14,16 @@
* governing permissions and limitations under the License.
*/
package org.codelibs.fess.pager;
package org.codelibs.fess.app.pager;
import java.io.Serializable;
import java.util.List;
import org.codelibs.fess.Constants;
public class WebConfigPager {
public class WebConfigPager implements Serializable {
private static final long serialVersionUID = 1L;
public static final int DEFAULT_PAGE_SIZE = 20;

View file

@ -14,7 +14,7 @@
* governing permissions and limitations under the License.
*/
package org.codelibs.fess.service;
package org.codelibs.fess.app.service;
import java.io.Serializable;
import java.util.List;
@ -22,14 +22,14 @@ import java.util.Map;
import javax.annotation.Resource;
import org.codelibs.fess.crud.CommonConstants;
import org.codelibs.fess.crud.CrudMessageException;
import org.codelibs.core.beans.util.BeanUtil;
import org.codelibs.fess.Constants;
import org.codelibs.fess.app.pager.BoostDocumentRulePager;
import org.codelibs.fess.es.cbean.BoostDocumentRuleCB;
import org.codelibs.fess.es.exbhv.BoostDocumentRuleBhv;
import org.codelibs.fess.es.exentity.BoostDocumentRule;
import org.codelibs.fess.pager.BoostDocumentRulePager;
import org.dbflute.cbean.result.PagingResultBean;
import org.seasar.framework.beans.util.Beans;
import org.dbflute.optional.OptionalEntity;
public class BoostDocumentRuleService implements Serializable {
@ -50,7 +50,7 @@ public class BoostDocumentRuleService implements Serializable {
});
// update pager
Beans.copy(boostDocumentRuleList, boostDocumentRulePager).includes(CommonConstants.PAGER_CONVERSION_RULE).execute();
BeanUtil.copyBeanToBean(boostDocumentRuleList, boostDocumentRulePager, option -> option.include(Constants.PAGER_CONVERSION_RULE));
boostDocumentRulePager.setPageNumberList(boostDocumentRuleList.pageRange(op -> {
op.rangeSize(5);
}).createPageNumberList());
@ -58,20 +58,11 @@ public class BoostDocumentRuleService implements Serializable {
return boostDocumentRuleList;
}
public BoostDocumentRule getBoostDocumentRule(final Map<String, String> keys) {
final BoostDocumentRule boostDocumentRule = boostDocumentRuleBhv.selectEntity(cb -> {
cb.query().docMeta().setId_Equal(keys.get("id"));
setupEntityCondition(cb, keys);
}).orElse(null);//TODO
if (boostDocumentRule == null) {
// TODO exception?
return null;
}
return boostDocumentRule;
public OptionalEntity<BoostDocumentRule> getBoostDocumentRule(final String id) {
return boostDocumentRuleBhv.selectByPK(id);
}
public void store(final BoostDocumentRule boostDocumentRule) throws CrudMessageException {
public void store(final BoostDocumentRule boostDocumentRule) {
setupStoreCondition(boostDocumentRule);
boostDocumentRuleBhv.insertOrUpdate(boostDocumentRule, op -> {
@ -80,7 +71,7 @@ public class BoostDocumentRuleService implements Serializable {
}
public void delete(final BoostDocumentRule boostDocumentRule) throws CrudMessageException {
public void delete(final BoostDocumentRule boostDocumentRule) {
setupDeleteCondition(boostDocumentRule);
boostDocumentRuleBhv.delete(boostDocumentRule, op -> {

View file

@ -14,7 +14,7 @@
* governing permissions and limitations under the License.
*/
package org.codelibs.fess.service;
package org.codelibs.fess.app.service;
import java.io.IOException;
import java.io.Reader;
@ -36,25 +36,24 @@ import javax.annotation.Resource;
import org.apache.commons.logging.Log;
import org.apache.commons.logging.LogFactory;
import org.codelibs.core.CoreLibConstants;
import org.codelibs.core.beans.util.BeanUtil;
import org.codelibs.core.lang.StringUtil;
import org.codelibs.fess.FessSystemException;
import org.codelibs.fess.crud.CommonConstants;
import org.codelibs.fess.crud.CrudMessageException;
import org.codelibs.fess.Constants;
import org.codelibs.fess.app.pager.CrawlingSessionPager;
import org.codelibs.fess.es.cbean.CrawlingSessionCB;
import org.codelibs.fess.es.exbhv.CrawlingSessionBhv;
import org.codelibs.fess.es.exbhv.CrawlingSessionInfoBhv;
import org.codelibs.fess.es.exentity.CrawlingSession;
import org.codelibs.fess.es.exentity.CrawlingSessionInfo;
import org.codelibs.fess.pager.CrawlingSessionPager;
import org.codelibs.fess.exception.FessSystemException;
import org.codelibs.fess.util.ComponentUtil;
import org.dbflute.bhv.readable.EntityRowHandler;
import org.dbflute.cbean.result.ListResultBean;
import org.dbflute.cbean.result.PagingResultBean;
import org.seasar.framework.beans.util.Beans;
import jp.sf.orangesignal.csv.CsvConfig;
import jp.sf.orangesignal.csv.CsvReader;
import jp.sf.orangesignal.csv.CsvWriter;
import com.orangesignal.csv.CsvConfig;
import com.orangesignal.csv.CsvReader;
import com.orangesignal.csv.CsvWriter;
public class CrawlingSessionService implements Serializable {
@ -80,7 +79,7 @@ public class CrawlingSessionService implements Serializable {
});
// update pager
Beans.copy(crawlingSessionList, crawlingSessionPager).includes(CommonConstants.PAGER_CONVERSION_RULE).execute();
BeanUtil.copyBeanToBean(crawlingSessionList, crawlingSessionPager, option -> option.include(Constants.PAGER_CONVERSION_RULE));
crawlingSessionPager.setPageNumberList(crawlingSessionList.pageRange(op -> {
op.rangeSize(5);
}).createPageNumberList());
@ -101,14 +100,14 @@ public class CrawlingSessionService implements Serializable {
return crawlingSession;
}
public void store(final CrawlingSession crawlingSession) throws CrudMessageException {
public void store(final CrawlingSession crawlingSession) {
setupStoreCondition(crawlingSession);
crawlingSessionBhv.insertOrUpdate(crawlingSession);
}
public void delete(final CrawlingSession crawlingSession) throws CrudMessageException {
public void delete(final CrawlingSession crawlingSession) {
setupDeleteCondition(crawlingSession);
crawlingSessionBhv.delete(crawlingSession);

View file

@ -14,7 +14,7 @@
* governing permissions and limitations under the License.
*/
package org.codelibs.fess.service;
package org.codelibs.fess.app.service;
import java.io.Serializable;
import java.util.ArrayList;
@ -23,9 +23,9 @@ import java.util.Map;
import javax.annotation.Resource;
import org.codelibs.core.beans.util.BeanUtil;
import org.codelibs.fess.Constants;
import org.codelibs.fess.crud.CommonConstants;
import org.codelibs.fess.crud.CrudMessageException;
import org.codelibs.fess.app.pager.DataConfigPager;
import org.codelibs.fess.es.cbean.DataConfigCB;
import org.codelibs.fess.es.exbhv.DataConfigBhv;
import org.codelibs.fess.es.exbhv.DataConfigToLabelBhv;
@ -33,9 +33,7 @@ import org.codelibs.fess.es.exbhv.DataConfigToRoleBhv;
import org.codelibs.fess.es.exentity.DataConfig;
import org.codelibs.fess.es.exentity.DataConfigToLabel;
import org.codelibs.fess.es.exentity.DataConfigToRole;
import org.codelibs.fess.pager.DataConfigPager;
import org.dbflute.cbean.result.PagingResultBean;
import org.seasar.framework.beans.util.Beans;
public class DataConfigService implements Serializable {
@ -63,7 +61,7 @@ public class DataConfigService implements Serializable {
});
// update pager
Beans.copy(dataConfigList, dataConfigPager).includes(CommonConstants.PAGER_CONVERSION_RULE).execute();
BeanUtil.copyBeanToBean(dataConfigList, dataConfigPager, option -> option.include(Constants.PAGER_CONVERSION_RULE));
dataConfigPager.setPageNumberList(dataConfigList.pageRange(op -> {
op.rangeSize(5);
}).createPageNumberList());
@ -71,7 +69,7 @@ public class DataConfigService implements Serializable {
return dataConfigList;
}
public void delete(final DataConfig dataConfig) throws CrudMessageException {
public void delete(final DataConfig dataConfig) {
setupDeleteCondition(dataConfig);
dataConfigBhv.delete(dataConfig, op -> {

View file

@ -14,7 +14,7 @@
* governing permissions and limitations under the License.
*/
package org.codelibs.fess.service;
package org.codelibs.fess.app.service;
import java.io.PrintWriter;
import java.io.Serializable;
@ -26,23 +26,21 @@ import java.util.regex.Pattern;
import javax.annotation.Resource;
import org.apache.commons.lang.StringUtils;
import org.apache.commons.lang3.StringUtils;
import org.codelibs.core.beans.util.BeanUtil;
import org.codelibs.core.lang.StringUtil;
import org.codelibs.core.misc.DynamicProperties;
import org.codelibs.fess.Constants;
import org.codelibs.fess.crud.CommonConstants;
import org.codelibs.fess.crud.CrudMessageException;
import org.codelibs.fess.app.pager.FailureUrlPager;
import org.codelibs.fess.es.cbean.FailureUrlCB;
import org.codelibs.fess.es.exbhv.FailureUrlBhv;
import org.codelibs.fess.es.exentity.CrawlingConfig;
import org.codelibs.fess.es.exentity.FailureUrl;
import org.codelibs.fess.helper.SystemHelper;
import org.codelibs.fess.pager.FailureUrlPager;
import org.codelibs.fess.util.ComponentUtil;
import org.dbflute.cbean.result.ListResultBean;
import org.dbflute.cbean.result.PagingResultBean;
import org.seasar.framework.beans.util.Beans;
import org.seasar.framework.container.SingletonS2Container;
import org.lastaflute.di.core.SingletonLaContainer;
public class FailureUrlService implements Serializable {
@ -66,7 +64,7 @@ public class FailureUrlService implements Serializable {
});
// update pager
Beans.copy(failureUrlList, failureUrlPager).includes(CommonConstants.PAGER_CONVERSION_RULE).execute();
BeanUtil.copyBeanToBean(failureUrlList, failureUrlPager, option -> option.include(Constants.PAGER_CONVERSION_RULE));
failureUrlPager.setPageNumberList(failureUrlList.pageRange(op -> {
op.rangeSize(5);
}).createPageNumberList());
@ -87,7 +85,7 @@ public class FailureUrlService implements Serializable {
return failureUrl;
}
public void store(final FailureUrl failureUrl) throws CrudMessageException {
public void store(final FailureUrl failureUrl) {
setupStoreCondition(failureUrl);
failureUrlBhv.insertOrUpdate(failureUrl, op -> {
@ -96,7 +94,7 @@ public class FailureUrlService implements Serializable {
}
public void delete(final FailureUrl failureUrl) throws CrudMessageException {
public void delete(final FailureUrl failureUrl) {
setupDeleteCondition(failureUrl);
failureUrlBhv.delete(failureUrl, op -> {
@ -209,7 +207,7 @@ public class FailureUrlService implements Serializable {
}
public void store(final CrawlingConfig crawlingConfig, final String errorName, final String url, final Throwable e) {
final FailureUrlBhv failureUrlBhv = SingletonS2Container.getComponent(FailureUrlBhv.class);
final FailureUrlBhv failureUrlBhv = SingletonLaContainer.getComponent(FailureUrlBhv.class);
FailureUrl failureUrl = failureUrlBhv.selectEntity(cb -> {
cb.query().setUrl_Equal(url);
if (crawlingConfig != null) {

View file

@ -14,7 +14,7 @@
* governing permissions and limitations under the License.
*/
package org.codelibs.fess.service;
package org.codelibs.fess.app.service;
import java.io.Serializable;
import java.util.List;
@ -22,14 +22,13 @@ import java.util.Map;
import javax.annotation.Resource;
import org.codelibs.fess.crud.CommonConstants;
import org.codelibs.fess.crud.CrudMessageException;
import org.codelibs.core.beans.util.BeanUtil;
import org.codelibs.fess.Constants;
import org.codelibs.fess.app.pager.FileAuthenticationPager;
import org.codelibs.fess.es.cbean.FileAuthenticationCB;
import org.codelibs.fess.es.exbhv.FileAuthenticationBhv;
import org.codelibs.fess.es.exentity.FileAuthentication;
import org.codelibs.fess.pager.FileAuthenticationPager;
import org.dbflute.cbean.result.PagingResultBean;
import org.seasar.framework.beans.util.Beans;
public class FileAuthenticationService implements Serializable {
@ -50,7 +49,7 @@ public class FileAuthenticationService implements Serializable {
});
// update pager
Beans.copy(fileAuthenticationList, fileAuthenticationPager).includes(CommonConstants.PAGER_CONVERSION_RULE).execute();
BeanUtil.copyBeanToBean(fileAuthenticationList, fileAuthenticationPager, option -> option.include(Constants.PAGER_CONVERSION_RULE));
fileAuthenticationPager.setPageNumberList(fileAuthenticationList.pageRange(op -> {
op.rangeSize(5);
}).createPageNumberList());
@ -71,7 +70,7 @@ public class FileAuthenticationService implements Serializable {
return fileAuthentication;
}
public void store(final FileAuthentication fileAuthentication) throws CrudMessageException {
public void store(final FileAuthentication fileAuthentication) {
setupStoreCondition(fileAuthentication);
fileAuthenticationBhv.insertOrUpdate(fileAuthentication, op -> {
@ -80,7 +79,7 @@ public class FileAuthenticationService implements Serializable {
}
public void delete(final FileAuthentication fileAuthentication) throws CrudMessageException {
public void delete(final FileAuthentication fileAuthentication) {
setupDeleteCondition(fileAuthentication);
fileAuthenticationBhv.delete(fileAuthentication, op -> {

View file

@ -14,7 +14,7 @@
* governing permissions and limitations under the License.
*/
package org.codelibs.fess.service;
package org.codelibs.fess.app.service;
import java.io.Serializable;
import java.util.ArrayList;
@ -23,9 +23,9 @@ import java.util.Map;
import javax.annotation.Resource;
import org.codelibs.core.beans.util.BeanUtil;
import org.codelibs.fess.Constants;
import org.codelibs.fess.crud.CommonConstants;
import org.codelibs.fess.crud.CrudMessageException;
import org.codelibs.fess.app.pager.FileConfigPager;
import org.codelibs.fess.es.cbean.FileConfigCB;
import org.codelibs.fess.es.exbhv.FileConfigBhv;
import org.codelibs.fess.es.exbhv.FileConfigToLabelBhv;
@ -33,9 +33,7 @@ import org.codelibs.fess.es.exbhv.FileConfigToRoleBhv;
import org.codelibs.fess.es.exentity.FileConfig;
import org.codelibs.fess.es.exentity.FileConfigToLabel;
import org.codelibs.fess.es.exentity.FileConfigToRole;
import org.codelibs.fess.pager.FileConfigPager;
import org.dbflute.cbean.result.PagingResultBean;
import org.seasar.framework.beans.util.Beans;
public class FileConfigService implements Serializable {
@ -62,7 +60,7 @@ public class FileConfigService implements Serializable {
});
// update pager
Beans.copy(fileConfigList, fileConfigPager).includes(CommonConstants.PAGER_CONVERSION_RULE).execute();
BeanUtil.copyBeanToBean(fileConfigList, fileConfigPager, option -> option.include(Constants.PAGER_CONVERSION_RULE));
fileConfigPager.setPageNumberList(fileConfigList.pageRange(op -> {
op.rangeSize(5);
}).createPageNumberList());
@ -70,7 +68,7 @@ public class FileConfigService implements Serializable {
return fileConfigList;
}
public void delete(final FileConfig fileConfig) throws CrudMessageException {
public void delete(final FileConfig fileConfig) {
setupDeleteCondition(fileConfig);
fileConfigBhv.delete(fileConfig, op -> {

View file

@ -0,0 +1,124 @@
/*
* 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.app.service;
import java.io.Serializable;
import java.util.List;
import java.util.Map;
import javax.annotation.Resource;
import org.codelibs.core.beans.util.BeanUtil;
import org.codelibs.fess.Constants;
import org.codelibs.fess.app.pager.GroupPager;
import org.codelibs.fess.es.cbean.GroupCB;
import org.codelibs.fess.es.exbhv.GroupBhv;
import org.codelibs.fess.es.exentity.Group;
import org.dbflute.cbean.result.PagingResultBean;
public class GroupService implements Serializable {
private static final long serialVersionUID = 1L;
@Resource
protected GroupBhv groupBhv;
public List<Group> getGroupList(final GroupPager groupPager) {
final PagingResultBean<Group> groupList = groupBhv.selectPage(cb -> {
cb.paging(groupPager.getPageSize(), groupPager.getCurrentPageNumber());
setupListCondition(cb, groupPager);
});
// update pager
BeanUtil.copyBeanToBean(groupList, groupPager, option -> option.include(Constants.PAGER_CONVERSION_RULE));
groupPager.setPageNumberList(groupList.pageRange(op -> {
op.rangeSize(5);
}).createPageNumberList());
return groupList;
}
public Group getGroup(final Map<String, String> keys) {
final Group group = groupBhv.selectEntity(cb -> {
cb.query().docMeta().setId_Equal(keys.get("id"));
setupEntityCondition(cb, keys);
}).orElse(null);//TODO
if (group == null) {
// TODO exception?
return null;
}
return group;
}
public void store(final Group group) {
setupStoreCondition(group);
groupBhv.insertOrUpdate(group, op -> {
op.setRefresh(true);
});
}
public void delete(final Group group) {
setupDeleteCondition(group);
groupBhv.delete(group, op -> {
op.setRefresh(true);
});
}
protected void setupListCondition(final GroupCB cb, final GroupPager groupPager) {
if (groupPager.id != null) {
cb.query().docMeta().setId_Equal(groupPager.id);
}
// TODO Long, Integer, String supported only.
// setup condition
cb.query().addOrderBy_Name_Asc();
// search
}
protected void setupEntityCondition(final GroupCB cb, final Map<String, String> keys) {
// setup condition
}
protected void setupStoreCondition(final Group group) {
// setup condition
}
protected void setupDeleteCondition(final Group group) {
// setup condition
}
public List<Group> getAvailableGroupList() {
return groupBhv.selectList(cb -> {
cb.query().matchAll();
});
}
}

View file

@ -14,7 +14,7 @@
* governing permissions and limitations under the License.
*/
package org.codelibs.fess.service;
package org.codelibs.fess.app.service;
import java.io.Serializable;
import java.util.List;
@ -22,15 +22,14 @@ import java.util.Map;
import javax.annotation.Resource;
import org.codelibs.fess.crud.CommonConstants;
import org.codelibs.fess.crud.CrudMessageException;
import org.codelibs.core.beans.util.BeanUtil;
import org.codelibs.fess.Constants;
import org.codelibs.fess.app.pager.JobLogPager;
import org.codelibs.fess.es.cbean.JobLogCB;
import org.codelibs.fess.es.exbhv.JobLogBhv;
import org.codelibs.fess.es.exentity.JobLog;
import org.codelibs.fess.pager.JobLogPager;
import org.codelibs.fess.util.ComponentUtil;
import org.dbflute.cbean.result.PagingResultBean;
import org.seasar.framework.beans.util.Beans;
public class JobLogService implements Serializable {
@ -51,7 +50,7 @@ public class JobLogService implements Serializable {
});
// update pager
Beans.copy(jobLogList, jobLogPager).includes(CommonConstants.PAGER_CONVERSION_RULE).execute();
BeanUtil.copyBeanToBean(jobLogList, jobLogPager, option -> option.include(Constants.PAGER_CONVERSION_RULE));
jobLogPager.setPageNumberList(jobLogList.pageRange(op -> {
op.rangeSize(5);
}).createPageNumberList());
@ -72,7 +71,7 @@ public class JobLogService implements Serializable {
return jobLog;
}
public void store(final JobLog jobLog) throws CrudMessageException {
public void store(final JobLog jobLog) {
setupStoreCondition(jobLog);
jobLogBhv.insertOrUpdate(jobLog, op -> {
@ -81,7 +80,7 @@ public class JobLogService implements Serializable {
}
public void delete(final JobLog jobLog) throws CrudMessageException {
public void delete(final JobLog jobLog) {
setupDeleteCondition(jobLog);
jobLogBhv.delete(jobLog, op -> {

View file

@ -14,7 +14,7 @@
* governing permissions and limitations under the License.
*/
package org.codelibs.fess.service;
package org.codelibs.fess.app.service;
import java.io.Serializable;
import java.util.List;
@ -22,14 +22,13 @@ import java.util.Map;
import javax.annotation.Resource;
import org.codelibs.fess.crud.CommonConstants;
import org.codelibs.fess.crud.CrudMessageException;
import org.codelibs.core.beans.util.BeanUtil;
import org.codelibs.fess.Constants;
import org.codelibs.fess.app.pager.KeyMatchPager;
import org.codelibs.fess.es.cbean.KeyMatchCB;
import org.codelibs.fess.es.exbhv.KeyMatchBhv;
import org.codelibs.fess.es.exentity.KeyMatch;
import org.codelibs.fess.pager.KeyMatchPager;
import org.dbflute.cbean.result.PagingResultBean;
import org.seasar.framework.beans.util.Beans;
public class KeyMatchService implements Serializable {
@ -50,7 +49,7 @@ public class KeyMatchService implements Serializable {
});
// update pager
Beans.copy(keyMatchList, keyMatchPager).includes(CommonConstants.PAGER_CONVERSION_RULE).execute();
BeanUtil.copyBeanToBean(keyMatchList, keyMatchPager, option -> option.include(Constants.PAGER_CONVERSION_RULE));
keyMatchPager.setPageNumberList(keyMatchList.pageRange(op -> {
op.rangeSize(5);
}).createPageNumberList());
@ -71,7 +70,7 @@ public class KeyMatchService implements Serializable {
return keyMatch;
}
public void store(final KeyMatch keyMatch) throws CrudMessageException {
public void store(final KeyMatch keyMatch) {
setupStoreCondition(keyMatch);
keyMatchBhv.insertOrUpdate(keyMatch, op -> {
@ -80,7 +79,7 @@ public class KeyMatchService implements Serializable {
}
public void delete(final KeyMatch keyMatch) throws CrudMessageException {
public void delete(final KeyMatch keyMatch) {
setupDeleteCondition(keyMatch);
keyMatchBhv.delete(keyMatch, op -> {

View file

@ -14,7 +14,7 @@
* governing permissions and limitations under the License.
*/
package org.codelibs.fess.service;
package org.codelibs.fess.app.service;
import java.io.Serializable;
import java.util.ArrayList;
@ -23,19 +23,18 @@ import java.util.Map;
import javax.annotation.Resource;
import org.codelibs.fess.crud.CommonConstants;
import org.codelibs.fess.crud.CrudMessageException;
import org.codelibs.core.beans.util.BeanUtil;
import org.codelibs.fess.Constants;
import org.codelibs.fess.app.pager.LabelTypePager;
import org.codelibs.fess.es.cbean.LabelTypeCB;
import org.codelibs.fess.es.exbhv.LabelToRoleBhv;
import org.codelibs.fess.es.exbhv.LabelTypeBhv;
import org.codelibs.fess.es.exentity.LabelToRole;
import org.codelibs.fess.es.exentity.LabelType;
import org.codelibs.fess.helper.LabelTypeHelper;
import org.codelibs.fess.pager.LabelTypePager;
import org.codelibs.fess.util.ComponentUtil;
import org.dbflute.cbean.result.ListResultBean;
import org.dbflute.cbean.result.PagingResultBean;
import org.seasar.framework.beans.util.Beans;
public class LabelTypeService implements Serializable {
@ -59,7 +58,7 @@ public class LabelTypeService implements Serializable {
});
// update pager
Beans.copy(labelTypeList, labelTypePager).includes(CommonConstants.PAGER_CONVERSION_RULE).execute();
BeanUtil.copyBeanToBean(labelTypeList, labelTypePager, option -> option.include(Constants.PAGER_CONVERSION_RULE));
labelTypePager.setPageNumberList(labelTypeList.pageRange(op -> {
op.rangeSize(5);
}).createPageNumberList());
@ -67,7 +66,7 @@ public class LabelTypeService implements Serializable {
return labelTypeList;
}
public void delete(final LabelType labelType) throws CrudMessageException {
public void delete(final LabelType labelType) {
setupDeleteCondition(labelType);
labelTypeBhv.delete(labelType, op -> {

View file

@ -14,7 +14,7 @@
* governing permissions and limitations under the License.
*/
package org.codelibs.fess.service;
package org.codelibs.fess.app.service;
import java.io.Serializable;
import java.util.List;
@ -22,14 +22,13 @@ import java.util.Map;
import javax.annotation.Resource;
import org.codelibs.fess.crud.CommonConstants;
import org.codelibs.fess.crud.CrudMessageException;
import org.codelibs.core.beans.util.BeanUtil;
import org.codelibs.fess.Constants;
import org.codelibs.fess.app.pager.OverlappingHostPager;
import org.codelibs.fess.es.cbean.OverlappingHostCB;
import org.codelibs.fess.es.exbhv.OverlappingHostBhv;
import org.codelibs.fess.es.exentity.OverlappingHost;
import org.codelibs.fess.pager.OverlappingHostPager;
import org.dbflute.cbean.result.PagingResultBean;
import org.seasar.framework.beans.util.Beans;
public class OverlappingHostService implements Serializable {
@ -50,7 +49,7 @@ public class OverlappingHostService implements Serializable {
});
// update pager
Beans.copy(overlappingHostList, overlappingHostPager).includes(CommonConstants.PAGER_CONVERSION_RULE).execute();
BeanUtil.copyBeanToBean(overlappingHostList, overlappingHostPager, option -> option.include(Constants.PAGER_CONVERSION_RULE));
overlappingHostPager.setPageNumberList(overlappingHostList.pageRange(op -> {
op.rangeSize(5);
}).createPageNumberList());
@ -71,7 +70,7 @@ public class OverlappingHostService implements Serializable {
return overlappingHost;
}
public void store(final OverlappingHost overlappingHost) throws CrudMessageException {
public void store(final OverlappingHost overlappingHost) {
setupStoreCondition(overlappingHost);
overlappingHostBhv.insertOrUpdate(overlappingHost, op -> {
@ -80,7 +79,7 @@ public class OverlappingHostService implements Serializable {
}
public void delete(final OverlappingHost overlappingHost) throws CrudMessageException {
public void delete(final OverlappingHost overlappingHost) {
setupDeleteCondition(overlappingHost);
overlappingHostBhv.delete(overlappingHost, op -> {

View file

@ -14,7 +14,7 @@
* governing permissions and limitations under the License.
*/
package org.codelibs.fess.service;
package org.codelibs.fess.app.service;
import java.io.Serializable;
import java.util.Collection;
@ -23,14 +23,13 @@ import java.util.Map;
import javax.annotation.Resource;
import org.codelibs.fess.crud.CommonConstants;
import org.codelibs.fess.crud.CrudMessageException;
import org.codelibs.core.beans.util.BeanUtil;
import org.codelibs.fess.Constants;
import org.codelibs.fess.app.pager.PathMappingPager;
import org.codelibs.fess.es.cbean.PathMappingCB;
import org.codelibs.fess.es.exbhv.PathMappingBhv;
import org.codelibs.fess.es.exentity.PathMapping;
import org.codelibs.fess.pager.PathMappingPager;
import org.dbflute.cbean.result.PagingResultBean;
import org.seasar.framework.beans.util.Beans;
public class PathMappingService implements Serializable {
@ -47,7 +46,7 @@ public class PathMappingService implements Serializable {
});
// update pager
Beans.copy(pathMappingList, pathMappingPager).includes(CommonConstants.PAGER_CONVERSION_RULE).execute();
BeanUtil.copyBeanToBean(pathMappingList, pathMappingPager, option -> option.include(Constants.PAGER_CONVERSION_RULE));
pathMappingPager.setPageNumberList(pathMappingList.pageRange(op -> {
op.rangeSize(5);
}).createPageNumberList());
@ -69,7 +68,7 @@ public class PathMappingService implements Serializable {
return pathMapping;
}
public void store(final PathMapping pathMapping) throws CrudMessageException {
public void store(final PathMapping pathMapping) {
setupStoreCondition(pathMapping);
pathMappingBhv.insertOrUpdate(pathMapping, op -> {
@ -78,7 +77,7 @@ public class PathMappingService implements Serializable {
}
public void delete(final PathMapping pathMapping) throws CrudMessageException {
public void delete(final PathMapping pathMapping) {
setupDeleteCondition(pathMapping);
pathMappingBhv.delete(pathMapping, op -> {

View file

@ -14,7 +14,7 @@
* governing permissions and limitations under the License.
*/
package org.codelibs.fess.service;
package org.codelibs.fess.app.service;
import java.io.Serializable;
import java.util.List;
@ -22,14 +22,13 @@ import java.util.Map;
import javax.annotation.Resource;
import org.codelibs.fess.crud.CommonConstants;
import org.codelibs.fess.crud.CrudMessageException;
import org.codelibs.core.beans.util.BeanUtil;
import org.codelibs.fess.Constants;
import org.codelibs.fess.app.pager.RequestHeaderPager;
import org.codelibs.fess.es.cbean.RequestHeaderCB;
import org.codelibs.fess.es.exbhv.RequestHeaderBhv;
import org.codelibs.fess.es.exentity.RequestHeader;
import org.codelibs.fess.pager.RequestHeaderPager;
import org.dbflute.cbean.result.PagingResultBean;
import org.seasar.framework.beans.util.Beans;
public class RequestHeaderService implements Serializable {
@ -50,7 +49,7 @@ public class RequestHeaderService implements Serializable {
});
// update pager
Beans.copy(requestHeaderList, requestHeaderPager).includes(CommonConstants.PAGER_CONVERSION_RULE).execute();
BeanUtil.copyBeanToBean(requestHeaderList, requestHeaderPager, option -> option.include(Constants.PAGER_CONVERSION_RULE));
requestHeaderPager.setPageNumberList(requestHeaderList.pageRange(op -> {
op.rangeSize(5);
}).createPageNumberList());
@ -71,7 +70,7 @@ public class RequestHeaderService implements Serializable {
return requestHeader;
}
public void store(final RequestHeader requestHeader) throws CrudMessageException {
public void store(final RequestHeader requestHeader) {
setupStoreCondition(requestHeader);
requestHeaderBhv.insertOrUpdate(requestHeader, op -> {
@ -80,7 +79,7 @@ public class RequestHeaderService implements Serializable {
}
public void delete(final RequestHeader requestHeader) throws CrudMessageException {
public void delete(final RequestHeader requestHeader) {
setupDeleteCondition(requestHeader);
requestHeaderBhv.delete(requestHeader, op -> {

View file

@ -0,0 +1,124 @@
/*
* 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.app.service;
import java.io.Serializable;
import java.util.List;
import java.util.Map;
import javax.annotation.Resource;
import org.codelibs.core.beans.util.BeanUtil;
import org.codelibs.fess.Constants;
import org.codelibs.fess.app.pager.RolePager;
import org.codelibs.fess.es.cbean.RoleCB;
import org.codelibs.fess.es.exbhv.RoleBhv;
import org.codelibs.fess.es.exentity.Role;
import org.dbflute.cbean.result.PagingResultBean;
public class RoleService implements Serializable {
private static final long serialVersionUID = 1L;
@Resource
protected RoleBhv roleBhv;
public List<Role> getRoleList(final RolePager rolePager) {
final PagingResultBean<Role> roleList = roleBhv.selectPage(cb -> {
cb.paging(rolePager.getPageSize(), rolePager.getCurrentPageNumber());
setupListCondition(cb, rolePager);
});
// update pager
BeanUtil.copyBeanToBean(roleList, rolePager, option -> option.include(Constants.PAGER_CONVERSION_RULE));
rolePager.setPageNumberList(roleList.pageRange(op -> {
op.rangeSize(5);
}).createPageNumberList());
return roleList;
}
public Role getRole(final Map<String, String> keys) {
final Role role = roleBhv.selectEntity(cb -> {
cb.query().docMeta().setId_Equal(keys.get("id"));
setupEntityCondition(cb, keys);
}).orElse(null);//TODO
if (role == null) {
// TODO exception?
return null;
}
return role;
}
public void store(final Role role) {
setupStoreCondition(role);
roleBhv.insertOrUpdate(role, op -> {
op.setRefresh(true);
});
}
public void delete(final Role role) {
setupDeleteCondition(role);
roleBhv.delete(role, op -> {
op.setRefresh(true);
});
}
protected void setupListCondition(final RoleCB cb, final RolePager rolePager) {
if (rolePager.id != null) {
cb.query().docMeta().setId_Equal(rolePager.id);
}
// TODO Long, Integer, String supported only.
// setup condition
cb.query().addOrderBy_Name_Asc();
// search
}
protected void setupEntityCondition(final RoleCB cb, final Map<String, String> keys) {
// setup condition
}
protected void setupStoreCondition(final Role role) {
// setup condition
}
protected void setupDeleteCondition(final Role role) {
// setup condition
}
public List<Role> getAvailableRoleList() {
return roleBhv.selectList(cb -> {
cb.query().matchAll();
});
}
}

View file

@ -14,7 +14,7 @@
* governing permissions and limitations under the License.
*/
package org.codelibs.fess.service;
package org.codelibs.fess.app.service;
import java.io.Serializable;
import java.util.List;
@ -22,14 +22,13 @@ import java.util.Map;
import javax.annotation.Resource;
import org.codelibs.fess.crud.CommonConstants;
import org.codelibs.fess.crud.CrudMessageException;
import org.codelibs.core.beans.util.BeanUtil;
import org.codelibs.fess.Constants;
import org.codelibs.fess.app.pager.RoleTypePager;
import org.codelibs.fess.es.cbean.RoleTypeCB;
import org.codelibs.fess.es.exbhv.RoleTypeBhv;
import org.codelibs.fess.es.exentity.RoleType;
import org.codelibs.fess.pager.RoleTypePager;
import org.dbflute.cbean.result.PagingResultBean;
import org.seasar.framework.beans.util.Beans;
public class RoleTypeService implements Serializable {
@ -50,7 +49,7 @@ public class RoleTypeService implements Serializable {
});
// update pager
Beans.copy(roleTypeList, roleTypePager).includes(CommonConstants.PAGER_CONVERSION_RULE).execute();
BeanUtil.copyBeanToBean(roleTypeList, roleTypePager, option -> option.include(Constants.PAGER_CONVERSION_RULE));
roleTypePager.setPageNumberList(roleTypeList.pageRange(op -> {
op.rangeSize(5);
}).createPageNumberList());
@ -71,7 +70,7 @@ public class RoleTypeService implements Serializable {
return roleType;
}
public void store(final RoleType roleType) throws CrudMessageException {
public void store(final RoleType roleType) {
setupStoreCondition(roleType);
roleTypeBhv.insertOrUpdate(roleType, op -> {
@ -80,7 +79,7 @@ public class RoleTypeService implements Serializable {
}
public void delete(final RoleType roleType) throws CrudMessageException {
public void delete(final RoleType roleType) {
setupDeleteCondition(roleType);
roleTypeBhv.delete(roleType, op -> {

View file

@ -14,7 +14,7 @@
* governing permissions and limitations under the License.
*/
package org.codelibs.fess.service;
package org.codelibs.fess.app.service;
import java.io.Serializable;
import java.util.List;
@ -22,16 +22,14 @@ import java.util.Map;
import javax.annotation.Resource;
import org.codelibs.core.beans.util.BeanUtil;
import org.codelibs.fess.Constants;
import org.codelibs.fess.crud.CommonConstants;
import org.codelibs.fess.crud.CrudMessageException;
import org.codelibs.fess.app.pager.ScheduledJobPager;
import org.codelibs.fess.es.cbean.ScheduledJobCB;
import org.codelibs.fess.es.exbhv.ScheduledJobBhv;
import org.codelibs.fess.es.exentity.ScheduledJob;
import org.codelibs.fess.job.JobScheduler;
import org.codelibs.fess.pager.ScheduledJobPager;
import org.dbflute.cbean.result.PagingResultBean;
import org.seasar.framework.beans.util.Beans;
public class ScheduledJobService implements Serializable {
@ -52,7 +50,7 @@ public class ScheduledJobService implements Serializable {
});
// update pager
Beans.copy(scheduledJobList, scheduledJobPager).includes(CommonConstants.PAGER_CONVERSION_RULE).execute();
BeanUtil.copyBeanToBean(scheduledJobList, scheduledJobPager, option -> option.include(Constants.PAGER_CONVERSION_RULE));
scheduledJobPager.setPageNumberList(scheduledJobList.pageRange(op -> {
op.rangeSize(5);
}).createPageNumberList());
@ -73,7 +71,7 @@ public class ScheduledJobService implements Serializable {
return scheduledJob;
}
public void delete(final ScheduledJob scheduledJob) throws CrudMessageException {
public void delete(final ScheduledJob scheduledJob) {
setupDeleteCondition(scheduledJob);
scheduledJobBhv.delete(scheduledJob, op -> {
@ -137,7 +135,7 @@ public class ScheduledJobService implements Serializable {
jobScheduler.register(scheduledJob);
}
public List<ScheduledJob> getCrawloerJobList() {
public List<ScheduledJob> getCrawlerJobList() {
return scheduledJobBhv.selectList(cb -> {
cb.query().setCrawler_Equal(Constants.T);
cb.query().addOrderBy_SortOrder_Asc();

View file

@ -14,7 +14,7 @@
* governing permissions and limitations under the License.
*/
package org.codelibs.fess.service;
package org.codelibs.fess.app.service;
import java.io.IOException;
import java.io.Reader;
@ -28,21 +28,20 @@ import javax.annotation.Resource;
import org.apache.commons.logging.Log;
import org.apache.commons.logging.LogFactory;
import org.codelibs.core.beans.util.BeanUtil;
import org.codelibs.core.lang.StringUtil;
import org.codelibs.fess.crud.CommonConstants;
import org.codelibs.fess.crud.CrudMessageException;
import org.codelibs.fess.Constants;
import org.codelibs.fess.app.pager.SuggestBadWordPager;
import org.codelibs.fess.es.cbean.SuggestBadWordCB;
import org.codelibs.fess.es.exbhv.SuggestBadWordBhv;
import org.codelibs.fess.es.exentity.SuggestBadWord;
import org.codelibs.fess.pager.SuggestBadWordPager;
import org.codelibs.fess.util.ComponentUtil;
import org.dbflute.bhv.readable.EntityRowHandler;
import org.dbflute.cbean.result.PagingResultBean;
import org.seasar.framework.beans.util.Beans;
import jp.sf.orangesignal.csv.CsvConfig;
import jp.sf.orangesignal.csv.CsvReader;
import jp.sf.orangesignal.csv.CsvWriter;
import com.orangesignal.csv.CsvConfig;
import com.orangesignal.csv.CsvReader;
import com.orangesignal.csv.CsvWriter;
public class SuggestBadWordService implements Serializable {
@ -67,7 +66,7 @@ public class SuggestBadWordService implements Serializable {
});
// update pager
Beans.copy(suggestBadWordList, suggestBadWordPager).includes(CommonConstants.PAGER_CONVERSION_RULE).execute();
BeanUtil.copyBeanToBean(suggestBadWordList, suggestBadWordPager, option -> option.include(Constants.PAGER_CONVERSION_RULE));
suggestBadWordPager.setPageNumberList(suggestBadWordList.pageRange(op -> {
op.rangeSize(5);
}).createPageNumberList());
@ -88,17 +87,21 @@ public class SuggestBadWordService implements Serializable {
return suggestBadWord;
}
public void store(final SuggestBadWord suggestBadWord) throws CrudMessageException {
public void store(final SuggestBadWord suggestBadWord) {
setupStoreCondition(suggestBadWord);
suggestBadWordBhv.insertOrUpdate(suggestBadWord);
suggestBadWordBhv.insertOrUpdate(suggestBadWord, op -> {
op.setRefresh(true);
});
}
public void delete(final SuggestBadWord suggestBadWord) throws CrudMessageException {
public void delete(final SuggestBadWord suggestBadWord) {
setupDeleteCondition(suggestBadWord);
suggestBadWordBhv.delete(suggestBadWord);
suggestBadWordBhv.delete(suggestBadWord, op -> {
op.setRefresh(true);
});
}

View file

@ -14,7 +14,7 @@
* governing permissions and limitations under the License.
*/
package org.codelibs.fess.service;
package org.codelibs.fess.app.service;
import java.io.IOException;
import java.io.Reader;
@ -28,21 +28,20 @@ import javax.annotation.Resource;
import org.apache.commons.logging.Log;
import org.apache.commons.logging.LogFactory;
import org.codelibs.core.beans.util.BeanUtil;
import org.codelibs.core.lang.StringUtil;
import org.codelibs.fess.crud.CommonConstants;
import org.codelibs.fess.crud.CrudMessageException;
import org.codelibs.fess.Constants;
import org.codelibs.fess.app.pager.SuggestElevateWordPager;
import org.codelibs.fess.es.cbean.SuggestElevateWordCB;
import org.codelibs.fess.es.exbhv.SuggestElevateWordBhv;
import org.codelibs.fess.es.exentity.SuggestElevateWord;
import org.codelibs.fess.pager.SuggestElevateWordPager;
import org.codelibs.fess.util.ComponentUtil;
import org.dbflute.bhv.readable.EntityRowHandler;
import org.dbflute.cbean.result.PagingResultBean;
import org.seasar.framework.beans.util.Beans;
import jp.sf.orangesignal.csv.CsvConfig;
import jp.sf.orangesignal.csv.CsvReader;
import jp.sf.orangesignal.csv.CsvWriter;
import com.orangesignal.csv.CsvConfig;
import com.orangesignal.csv.CsvReader;
import com.orangesignal.csv.CsvWriter;
public class SuggestElevateWordService implements Serializable {
@ -65,7 +64,7 @@ public class SuggestElevateWordService implements Serializable {
});
// update pager
Beans.copy(suggestElevateWordList, suggestElevateWordPager).includes(CommonConstants.PAGER_CONVERSION_RULE).execute();
BeanUtil.copyBeanToBean(suggestElevateWordList, suggestElevateWordPager, option -> option.include(Constants.PAGER_CONVERSION_RULE));
suggestElevateWordPager.setPageNumberList(suggestElevateWordList.pageRange(op -> {
op.rangeSize(5);
}).createPageNumberList());
@ -86,17 +85,21 @@ public class SuggestElevateWordService implements Serializable {
return suggestElevateWord;
}
public void store(final SuggestElevateWord suggestElevateWord) throws CrudMessageException {
public void store(final SuggestElevateWord suggestElevateWord) {
setupStoreCondition(suggestElevateWord);
suggestElevateWordBhv.insertOrUpdate(suggestElevateWord);
suggestElevateWordBhv.insertOrUpdate(suggestElevateWord, op -> {
op.setRefresh(true);
});
}
public void delete(final SuggestElevateWord suggestElevateWord) throws CrudMessageException {
public void delete(final SuggestElevateWord suggestElevateWord) {
setupDeleteCondition(suggestElevateWord);
suggestElevateWordBhv.delete(suggestElevateWord);
suggestElevateWordBhv.delete(suggestElevateWord, op -> {
op.setRefresh(true);
});
}

View file

@ -14,23 +14,23 @@
* governing permissions and limitations under the License.
*/
package org.codelibs.fess.service;
package org.codelibs.fess.app.service;
import java.util.List;
import java.util.Map;
import javax.annotation.Resource;
import org.codelibs.core.beans.util.BeanUtil;
import org.codelibs.core.lang.StringUtil;
import org.codelibs.fess.crud.CommonConstants;
import org.codelibs.fess.Constants;
import org.codelibs.fess.app.pager.SynonymPager;
import org.codelibs.fess.dict.DictionaryExpiredException;
import org.codelibs.fess.dict.DictionaryFile;
import org.codelibs.fess.dict.DictionaryFile.PagingList;
import org.codelibs.fess.dict.DictionaryManager;
import org.codelibs.fess.dict.synonym.SynonymFile;
import org.codelibs.fess.dict.synonym.SynonymItem;
import org.codelibs.fess.pager.SynonymPager;
import org.seasar.framework.beans.util.Beans;
public class SynonymService {
@Resource
@ -43,7 +43,7 @@ public class SynonymService {
final PagingList<SynonymItem> synonymList = synonymFile.selectList((synonymPager.getCurrentPageNumber() - 1) * pageSize, pageSize);
// update pager
Beans.copy(synonymList, synonymPager).includes(CommonConstants.PAGER_CONVERSION_RULE).execute();
BeanUtil.copyBeanToBean(synonymList, synonymPager, option -> option.include(Constants.PAGER_CONVERSION_RULE));
synonymList.setPageRangeSize(5);
synonymPager.setPageNumberList(synonymList.createPageNumberList());

View file

@ -14,23 +14,23 @@
* governing permissions and limitations under the License.
*/
package org.codelibs.fess.service;
package org.codelibs.fess.app.service;
import java.util.List;
import java.util.Map;
import javax.annotation.Resource;
import org.codelibs.core.beans.util.BeanUtil;
import org.codelibs.core.lang.StringUtil;
import org.codelibs.fess.crud.CommonConstants;
import org.codelibs.fess.Constants;
import org.codelibs.fess.app.pager.UserDictPager;
import org.codelibs.fess.dict.DictionaryExpiredException;
import org.codelibs.fess.dict.DictionaryFile;
import org.codelibs.fess.dict.DictionaryFile.PagingList;
import org.codelibs.fess.dict.DictionaryManager;
import org.codelibs.fess.dict.userdict.UserDictFile;
import org.codelibs.fess.dict.userdict.UserDictItem;
import org.codelibs.fess.pager.UserDictPager;
import org.seasar.framework.beans.util.Beans;
public class UserDictService {
@Resource
@ -44,7 +44,7 @@ public class UserDictService {
userDictFile.selectList((userDictPager.getCurrentPageNumber() - 1) * pageSize, pageSize);
// update pager
Beans.copy(userDictList, userDictPager).includes(CommonConstants.PAGER_CONVERSION_RULE).execute();
BeanUtil.copyBeanToBean(userDictList, userDictPager, option -> option.include(Constants.PAGER_CONVERSION_RULE));
userDictList.setPageRangeSize(5);
userDictPager.setPageNumberList(userDictList.createPageNumberList());

View file

@ -0,0 +1,128 @@
/*
* 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.app.service;
import java.io.Serializable;
import java.util.List;
import java.util.Map;
import javax.annotation.Resource;
import org.codelibs.core.beans.util.BeanUtil;
import org.codelibs.fess.Constants;
import org.codelibs.fess.app.pager.UserPager;
import org.codelibs.fess.es.cbean.UserCB;
import org.codelibs.fess.es.exbhv.UserBhv;
import org.codelibs.fess.es.exentity.User;
import org.dbflute.cbean.result.PagingResultBean;
public class UserService implements Serializable {
private static final long serialVersionUID = 1L;
@Resource
protected UserBhv userBhv;
public UserService() {
super();
}
public List<User> getUserList(final UserPager userPager) {
final PagingResultBean<User> userList = userBhv.selectPage(cb -> {
cb.paging(userPager.getPageSize(), userPager.getCurrentPageNumber());
setupListCondition(cb, userPager);
});
// update pager
BeanUtil.copyBeanToBean(userList, userPager, option -> option.include(Constants.PAGER_CONVERSION_RULE));
userPager.setPageNumberList(userList.pageRange(op -> {
op.rangeSize(5);
}).createPageNumberList());
return userList;
}
public User getUser(final Map<String, String> keys) {
final User user = userBhv.selectEntity(cb -> {
cb.query().docMeta().setId_Equal(keys.get("id"));
setupEntityCondition(cb, keys);
}).orElse(null);//TODO
if (user == null) {
// TODO exception?
return null;
}
return user;
}
public void store(final User user) {
setupStoreCondition(user);
userBhv.insertOrUpdate(user, op -> {
op.setRefresh(true);
});
}
public void delete(final User user) {
setupDeleteCondition(user);
userBhv.delete(user, op -> {
op.setRefresh(true);
});
}
protected void setupListCondition(final UserCB cb, final UserPager userPager) {
if (userPager.id != null) {
cb.query().docMeta().setId_Equal(userPager.id);
}
// TODO Long, Integer, String supported only.
// setup condition
cb.query().addOrderBy_Name_Asc();
// search
}
protected void setupEntityCondition(final UserCB cb, final Map<String, String> keys) {
// setup condition
}
protected void setupStoreCondition(final User user) {
// setup condition
}
protected void setupDeleteCondition(final User user) {
// setup condition
}
public List<User> getAvailableUserList() {
return userBhv.selectList(cb -> {
cb.query().matchAll();
});
}
}

View file

@ -14,7 +14,7 @@
* governing permissions and limitations under the License.
*/
package org.codelibs.fess.service;
package org.codelibs.fess.app.service;
import java.io.Serializable;
import java.util.List;
@ -22,14 +22,13 @@ import java.util.Map;
import javax.annotation.Resource;
import org.codelibs.fess.crud.CommonConstants;
import org.codelibs.fess.crud.CrudMessageException;
import org.codelibs.core.beans.util.BeanUtil;
import org.codelibs.fess.Constants;
import org.codelibs.fess.app.pager.WebAuthenticationPager;
import org.codelibs.fess.es.cbean.WebAuthenticationCB;
import org.codelibs.fess.es.exbhv.WebAuthenticationBhv;
import org.codelibs.fess.es.exentity.WebAuthentication;
import org.codelibs.fess.pager.WebAuthenticationPager;
import org.dbflute.cbean.result.PagingResultBean;
import org.seasar.framework.beans.util.Beans;
public class WebAuthenticationService implements Serializable {
@ -50,7 +49,7 @@ public class WebAuthenticationService implements Serializable {
});
// update pager
Beans.copy(webAuthenticationList, webAuthenticationPager).includes(CommonConstants.PAGER_CONVERSION_RULE).execute();
BeanUtil.copyBeanToBean(webAuthenticationList, webAuthenticationPager, option -> option.include(Constants.PAGER_CONVERSION_RULE));
webAuthenticationPager.setPageNumberList(webAuthenticationList.pageRange(op -> {
op.rangeSize(5);
}).createPageNumberList());
@ -71,7 +70,7 @@ public class WebAuthenticationService implements Serializable {
return webAuthentication;
}
public void store(final WebAuthentication webAuthentication) throws CrudMessageException {
public void store(final WebAuthentication webAuthentication) {
setupStoreCondition(webAuthentication);
webAuthenticationBhv.insertOrUpdate(webAuthentication, op -> {
@ -80,7 +79,7 @@ public class WebAuthenticationService implements Serializable {
}
public void delete(final WebAuthentication webAuthentication) throws CrudMessageException {
public void delete(final WebAuthentication webAuthentication) {
setupDeleteCondition(webAuthentication);
webAuthenticationBhv.delete(webAuthentication, op -> {

View file

@ -14,7 +14,7 @@
* governing permissions and limitations under the License.
*/
package org.codelibs.fess.service;
package org.codelibs.fess.app.service;
import java.io.Serializable;
import java.util.ArrayList;
@ -23,9 +23,9 @@ import java.util.Map;
import javax.annotation.Resource;
import org.codelibs.core.beans.util.BeanUtil;
import org.codelibs.fess.Constants;
import org.codelibs.fess.crud.CommonConstants;
import org.codelibs.fess.crud.CrudMessageException;
import org.codelibs.fess.app.pager.WebConfigPager;
import org.codelibs.fess.es.cbean.WebConfigCB;
import org.codelibs.fess.es.exbhv.WebConfigBhv;
import org.codelibs.fess.es.exbhv.WebConfigToLabelBhv;
@ -33,9 +33,7 @@ import org.codelibs.fess.es.exbhv.WebConfigToRoleBhv;
import org.codelibs.fess.es.exentity.WebConfig;
import org.codelibs.fess.es.exentity.WebConfigToLabel;
import org.codelibs.fess.es.exentity.WebConfigToRole;
import org.codelibs.fess.pager.WebConfigPager;
import org.dbflute.cbean.result.PagingResultBean;
import org.seasar.framework.beans.util.Beans;
public class WebConfigService implements Serializable {
@ -62,7 +60,7 @@ public class WebConfigService implements Serializable {
});
// update pager
Beans.copy(webConfigList, webConfigPager).includes(CommonConstants.PAGER_CONVERSION_RULE).execute();
BeanUtil.copyBeanToBean(webConfigList, webConfigPager, option -> option.include(Constants.PAGER_CONVERSION_RULE));
webConfigPager.setPageNumberList(webConfigList.pageRange(op -> {
op.rangeSize(5);
}).createPageNumberList());
@ -70,7 +68,7 @@ public class WebConfigService implements Serializable {
return webConfigList;
}
public void delete(final WebConfig webConfig) throws CrudMessageException {
public void delete(final WebConfig webConfig) {
setupDeleteCondition(webConfig);
webConfigBhv.delete(webConfig, op -> {

View file

@ -14,15 +14,20 @@
* governing permissions and limitations under the License.
*/
package org.codelibs.fess.helper.impl;
package org.codelibs.fess.app.web;
import org.codelibs.fess.helper.DatabaseHelper;
public class CrudMode {
public static final int LIST = 0;
public class EmptyDatabaseHelperImpl implements DatabaseHelper {
public static final int CREATE = 1;
@Override
public void optimize() {
public static final int EDIT = 2;
public static final int DELETE = 3;
public static final int CONFIRM = 4;
protected CrudMode() {
// nothing
}
}

View file

@ -0,0 +1,46 @@
/*
* 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.app.web;
import org.codelibs.fess.app.web.base.FessSearchAction;
import org.lastaflute.web.Execute;
import org.lastaflute.web.response.HtmlResponse;
public class RootAction extends FessSearchAction {
// ===================================================================================
// Constant
//
// ===================================================================================
// Attribute
//
// ===================================================================================
// Search Execute
// ==============
@Execute
public HtmlResponse index(final RootForm form) {
searchAvailable();
return asHtml(path_IndexJsp).renderWith(data -> {
buildLabelParams(form.fields);
buildInitParams();
});
}
}

View file

@ -0,0 +1,37 @@
/*
* 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.app.web;
import java.io.Serializable;
import java.util.HashMap;
import java.util.Map;
public class RootForm implements Serializable {
private static final long serialVersionUID = 1L;
public Map<String, String[]> fields = new HashMap<>();
//@Maxbytelength(maxbytelength = 1000)
public String query;
public String sort;
public String num;
public String[] lang;
}

View 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.app.web.admin;
import org.codelibs.fess.app.web.admin.wizard.AdminWizardAction;
import org.codelibs.fess.app.web.base.FessAdminAction;
import org.lastaflute.web.Execute;
import org.lastaflute.web.response.HtmlResponse;
public class AdminAction extends FessAdminAction {
// ===================================================================================
// Constant
//
// ===================================================================================
// Attribute
//
// ===================================================================================
// Search Execute
// ==============
@Execute
public HtmlResponse index() {
return redirect(AdminWizardAction.class);
}
}

View file

@ -0,0 +1,337 @@
/*
* 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.app.web.admin.boostdocumentrule;
import javax.annotation.Resource;
import org.codelibs.fess.Constants;
import org.codelibs.fess.annotation.Token;
import org.codelibs.fess.app.pager.BoostDocumentRulePager;
import org.codelibs.fess.app.service.BoostDocumentRuleService;
import org.codelibs.fess.app.web.CrudMode;
import org.codelibs.fess.app.web.base.FessAdminAction;
import org.codelibs.fess.es.exentity.BoostDocumentRule;
import org.codelibs.fess.helper.SystemHelper;
import org.dbflute.optional.OptionalEntity;
import org.lastaflute.web.Execute;
import org.lastaflute.web.callback.ActionRuntime;
import org.lastaflute.web.response.HtmlResponse;
import org.lastaflute.web.response.render.RenderData;
import org.lastaflute.web.validation.VaErrorHook;
/**
* @author shinsuke
*/
public class AdminBoostdocumentruleAction extends FessAdminAction {
// ===================================================================================
// Attribute
// =========
@Resource
private BoostDocumentRuleService boostDocumentRuleService;
@Resource
private BoostDocumentRulePager boostDocumentRulePager;
@Resource
private SystemHelper systemHelper;
// ===================================================================================
// Hook
// ======
@Override
protected void setupHtmlData(final ActionRuntime runtime) {
super.setupHtmlData(runtime);
runtime.registerData("helpLink", systemHelper.getHelpLink("boostDocumentRule"));
}
// ===================================================================================
// Search Execute
// ==============
@Execute
public HtmlResponse index(final SearchForm form) {
return asHtml(path_AdminBoostdocumentrule_IndexJsp).renderWith(data -> {
searchPaging(data, form);
});
}
@Execute
public HtmlResponse list(final Integer pageNumber, final SearchForm form) {
boostDocumentRulePager.setCurrentPageNumber(pageNumber);
return asHtml(path_AdminBoostdocumentrule_IndexJsp).renderWith(data -> {
searchPaging(data, form);
});
}
@Execute
public HtmlResponse search(final SearchForm form) {
copyBeanToBean(form, boostDocumentRulePager, op -> op.exclude(Constants.PAGER_CONVERSION_RULE));
return asHtml(path_AdminBoostdocumentrule_IndexJsp).renderWith(data -> {
searchPaging(data, form);
});
}
@Execute
public HtmlResponse reset(final SearchForm form) {
boostDocumentRulePager.clear();
return asHtml(path_AdminBoostdocumentrule_IndexJsp).renderWith(data -> {
searchPaging(data, form);
});
}
@Execute
public HtmlResponse back(final SearchForm form) {
return asHtml(path_AdminBoostdocumentrule_IndexJsp).renderWith(data -> {
searchPaging(data, form);
});
}
protected void searchPaging(final RenderData data, final SearchForm form) {
data.register("boostDocumentRuleItems", boostDocumentRuleService.getBoostDocumentRuleList(boostDocumentRulePager)); // page navi
// restore from pager
copyBeanToBean(boostDocumentRulePager, form, op -> op.include("id"));
}
// ===================================================================================
// Edit Execute
// ============
// -----------------------------------------------------
// Entry Page
// ----------
@Token(save = true, validate = false)
@Execute
public HtmlResponse createpage() {
return asHtml(path_AdminBoostdocumentrule_EditJsp).useForm(CreateForm.class, op -> {
op.setup(form -> {
form.initialize();
form.crudMode = CrudMode.CREATE;
});
});
}
@Token(save = true, validate = false)
@Execute
public HtmlResponse editpage(final int crudMode, final String id) {
verifyCrudMode(crudMode, CrudMode.EDIT);
return asHtml(path_AdminBoostdocumentrule_EditJsp).useForm(EditForm.class, op -> {
op.setup(form -> {
boostDocumentRuleService.getBoostDocumentRule(id).ifPresent(entity -> {
copyBeanToBean(entity, form, copyOp -> {
copyOp.excludeNull();
});
}).orElse(() -> {
throwValidationError(messages -> messages.addErrorsCrudCouldNotFindCrudTable(GLOBAL, id), toEditHtml());
});
form.crudMode = crudMode;
});
});
}
@Token(save = true, validate = false)
@Execute
public HtmlResponse createagain(final CreateForm form) {
verifyCrudMode(form.crudMode, CrudMode.CREATE);
validate(form, messages -> {}, toEditHtml());
return asHtml(path_AdminBoostdocumentrule_EditJsp);
}
@Token(save = true, validate = false)
@Execute
public HtmlResponse editagain(final EditForm form) {
verifyCrudMode(form.crudMode, CrudMode.EDIT);
validate(form, messages -> {}, toEditHtml());
return asHtml(path_AdminBoostdocumentrule_EditJsp);
}
@Token(save = true, validate = false)
@Execute
public HtmlResponse editfromconfirm(final EditForm form) {
validate(form, messages -> {}, toEditHtml());
form.crudMode = CrudMode.EDIT;
final String id = form.id;
boostDocumentRuleService.getBoostDocumentRule(id).ifPresent(entity -> {
copyBeanToBean(entity, form, op -> {});
}).orElse(() -> {
throwValidationError(messages -> messages.addErrorsCrudCouldNotFindCrudTable(GLOBAL, id), toEditHtml());
});
return asHtml(path_AdminBoostdocumentrule_EditJsp);
}
@Token(save = true, validate = false)
@Execute
public HtmlResponse deletepage(final int crudMode, final String id) {
verifyCrudMode(crudMode, CrudMode.DELETE);
return asHtml(path_AdminBoostdocumentrule_ConfirmJsp).useForm(EditForm.class, op -> {
op.setup(form -> {
boostDocumentRuleService.getBoostDocumentRule(id).ifPresent(entity -> {
copyBeanToBean(entity, form, copyOp -> {
copyOp.excludeNull();
});
}).orElse(() -> {
throwValidationError(messages -> messages.addErrorsCrudCouldNotFindCrudTable(GLOBAL, id), toEditHtml());
});
form.crudMode = crudMode;
});
});
}
@Token(save = true, validate = false)
@Execute
public HtmlResponse deletefromconfirm(final EditForm form) {
validate(form, messages -> {}, toEditHtml());
form.crudMode = CrudMode.DELETE;
final String id = form.id;
boostDocumentRuleService.getBoostDocumentRule(id).ifPresent(entity -> {
copyBeanToBean(entity, form, op -> {});
}).orElse(() -> {
throwValidationError(messages -> messages.addErrorsCrudCouldNotFindCrudTable(GLOBAL, id), toEditHtml());
});
return asHtml(path_AdminBoostdocumentrule_ConfirmJsp);
}
// -----------------------------------------------------
// Confirm
// -------
@Execute
public HtmlResponse confirmpage(final int crudMode, final String id) {
verifyCrudMode(crudMode, CrudMode.CONFIRM);
return asHtml(path_AdminBoostdocumentrule_ConfirmJsp).useForm(EditForm.class, op -> {
op.setup(form -> {
boostDocumentRuleService.getBoostDocumentRule(id).ifPresent(entity -> {
copyBeanToBean(entity, form, copyOp -> {
copyOp.excludeNull();
});
form.crudMode = crudMode;
}).orElse(() -> {
throwValidationError(messages -> messages.addErrorsCrudCouldNotFindCrudTable(GLOBAL, id), toEditHtml());
});
});
});
}
@Token(save = false, validate = true, keep = true)
@Execute
public HtmlResponse confirmfromcreate(final CreateForm form) {
validate(form, messages -> {}, toEditHtml());
form.crudMode = CrudMode.CREATE;
return asHtml(path_AdminBoostdocumentrule_ConfirmJsp);
}
@Token(save = false, validate = true, keep = true)
@Execute
public HtmlResponse confirmfromupdate(final EditForm form) {
validate(form, messages -> {}, toEditHtml());
form.crudMode = CrudMode.EDIT;
return asHtml(path_AdminBoostdocumentrule_ConfirmJsp);
}
// -----------------------------------------------------
// Actually Crud
// -------------
@Token(save = false, validate = true)
@Execute
public HtmlResponse create(final CreateForm form) {
verifyCrudMode(form.crudMode, CrudMode.CREATE);
validate(form, messages -> {}, toEditHtml());
createBoostDocumentRule(form).ifPresent(entity -> {
copyBeanToBean(form, entity, op -> op.exclude(Constants.COMMON_CONVERSION_RULE));
boostDocumentRuleService.store(entity);
saveInfo(messages -> messages.addSuccessCrudCreateCrudTable(GLOBAL));
}).orElse(() -> {
throwValidationError(messages -> messages.addErrorsCrudFailedToCreateCrudTable(GLOBAL), toEditHtml());
});
return redirect(getClass());
}
@Token(save = false, validate = true)
@Execute
public HtmlResponse update(final EditForm form) {
verifyCrudMode(form.crudMode, CrudMode.EDIT);
validate(form, messages -> {}, toEditHtml());
createBoostDocumentRule(form).ifPresent(entity -> {
copyBeanToBean(form, entity, op -> op.exclude(Constants.COMMON_CONVERSION_RULE));
boostDocumentRuleService.store(entity);
saveInfo(messages -> messages.addSuccessCrudUpdateCrudTable(GLOBAL));
}).orElse(() -> {
throwValidationError(messages -> messages.addErrorsCrudCouldNotFindCrudTable(GLOBAL, form.id), toEditHtml());
});
return redirect(getClass());
}
@Execute
public HtmlResponse delete(final EditForm form) {
verifyCrudMode(form.crudMode, CrudMode.DELETE);
validate(form, messages -> {}, toEditHtml());
final String id = form.id;
boostDocumentRuleService.getBoostDocumentRule(id).ifPresent(entity -> {
boostDocumentRuleService.delete(entity);
saveInfo(messages -> messages.addSuccessCrudDeleteCrudTable(GLOBAL));
}).orElse(() -> {
throwValidationError(messages -> messages.addErrorsCrudCouldNotFindCrudTable(GLOBAL, id), toEditHtml());
});
return redirect(getClass());
}
// ===================================================================================
// Assist Logic
// ============
protected OptionalEntity<BoostDocumentRule> createBoostDocumentRule(final CreateForm form) {
final String username = systemHelper.getUsername();
final long currentTime = systemHelper.getCurrentTimeAsLong();
switch (form.crudMode) {
case CrudMode.CREATE:
if (form instanceof CreateForm) {
final BoostDocumentRule entity = new BoostDocumentRule();
entity.setCreatedBy(username);
entity.setCreatedTime(currentTime);
entity.setUpdatedBy(username);
entity.setUpdatedTime(currentTime);
return OptionalEntity.of(entity);
}
break;
case CrudMode.EDIT:
if (form instanceof EditForm) {
return boostDocumentRuleService.getBoostDocumentRule(((EditForm) form).id).map(entity -> {
entity.setUpdatedBy(username);
entity.setUpdatedTime(currentTime);
return entity;
});
}
break;
default:
break;
}
return OptionalEntity.empty();
}
// ===================================================================================
// Small Helper
// ============
protected void verifyCrudMode(final int crudMode, final int expectedMode) {
if (crudMode != expectedMode) {
throwValidationError(messages -> {
messages.addErrorsCrudInvalidMode(GLOBAL, String.valueOf(expectedMode), String.valueOf(crudMode));
}, toEditHtml());
}
}
protected VaErrorHook toEditHtml() {
return () -> {
return asHtml(path_AdminBoostdocumentrule_EditJsp);
};
}
}

Some files were not shown because too many files have changed in this diff Show more