### Build and Start Application with Maven Jetty Source: https://github.com/nablarch/nablarch-document/blob/main/en/application_framework/application_framework/blank_project/setup_blankProject/setup_WebService.rst Command to build and start the Nablarch JAX-RS application using the Jetty Maven Plugin. The `compile` goal is implicitly executed. ```text mvn jetty:run ``` -------------------------------- ### Sample JSON Service Response Source: https://github.com/nablarch/nablarch-document/blob/main/en/application_framework/application_framework/blank_project/setup_blankProject/setup_WebService.rst Example of the JSON data returned by the `/find/json` service endpoint, showing a list of user objects. ```text [{"userId":1,"kanjiName":"名部楽太郎","kanaName":"なぶらくたろう"},{"userId":2,"kanjiName":"名部楽次郎","kanaName":"なぶらくじろう"}] ``` -------------------------------- ### Start H2 Console Batch File Source: https://github.com/nablarch/nablarch-document/blob/main/en/application_framework/application_framework/blank_project/firstStep_appendix/firststep_complement.rst Command to execute the H2 console batch file to start the H2 database console. It is recommended to use the h2.bat included in the project whose data needs to be checked. ```Batch h2/bin/h2.bat ``` -------------------------------- ### Sample XML Service Response Source: https://github.com/nablarch/nablarch-document/blob/main/en/application_framework/application_framework/blank_project/setup_blankProject/setup_WebService.rst Example of the XML data returned by the `/find/xml` service endpoint, showing a list of user objects. ```xml なぶらくたろう 名部楽太郎 1 なぶらくじろう 名部楽次郎 2 ``` -------------------------------- ### Jetty Application Launch Success Log Source: https://github.com/nablarch/nablarch-document/blob/main/en/application_framework/application_framework/blank_project/setup_blankProject/setup_WebService.rst Console output indicating that the Nablarch application has successfully initialized and started via Jetty. ```text (omitted) 2020-04-28 08:46:53.366 -INFO- nablarch.fw.web.servlet.NablarchServletContextListener [null] boot_proc = [] proc_sys = [jaxrs] req_id = [null] usr_id = [null] [nablarch.fw.web.servlet.NablarchServletContextListener#contextInitialized] initialization completed. ``` -------------------------------- ### Example Tag Setting Configuration String Source: https://github.com/nablarch/nablarch-document/blob/main/en/development_tools/toolbox/JspStaticAnalysis/02_JspStaticAnalysisInstall.rst This snippet provides an example of a tag setting configuration string. It defines patterns for 'ui_local' and 'ui_test' environments, including a regular expression for 'set.tag'. This configuration is typically used within XML files like 'pom.xml' or 'nablarch-tools.xml' for tool setup. ```Configuration ui_local,ui_test,ui_test/.*/set.tag ``` -------------------------------- ### Nablarch: SQL Example for Prefix Like Search Source: https://github.com/nablarch/nablarch-document/blob/main/en/application_framework/application_framework/libraries/database/database.rst Provides a concrete SQL example demonstrating a prefix match for a 'like' search, adhering to Nablarch's specified rules. This query selects users where the name starts with the value provided by the userName parameter. ```sql select * from user where name like :userName% ``` -------------------------------- ### H2 Console Connection Configuration Source: https://github.com/nablarch/nablarch-document/blob/main/en/application_framework/application_framework/blank_project/firstStep_appendix/firststep_complement.rst Configuration details for connecting to the H2 database console. This includes the JDBC URL, username, and password required to establish a connection after the console has started. The JDBC URL specifies the relative path to the data file. ```Configuration Item Value Supplementary notes ============= ========================= ============================================================================ JDBC URL jdbc:h2:../db/SAMPLE Specify the data file location with a relative path from h2.bat. User Name SAMPLE Password SAMPLE ``` -------------------------------- ### Nablarch BOM Dependency Management Definition Example Source: https://github.com/nablarch/nablarch-document/blob/main/en/application_framework/application_framework/blank_project/beforeFirstStep.rst This XML snippet illustrates how the nablarch-bom defines the versions for various Nablarch framework modules within its dependencyManagement section. It shows specific versions for nablarch-core and nablarch-core-applog. ```XML com.nablarch.framework nablarch-core 1.2.2 com.nablarch.framework nablarch-core-applog 1.0.1 ``` -------------------------------- ### Build and Run Nablarch Application with Maven Jetty Source: https://github.com/nablarch/nablarch-document/blob/main/en/application_framework/application_framework/blank_project/setup_blankProject/setup_Web.rst This command uses the Maven Jetty Plugin to build the application and start an embedded Jetty server. The 'jetty:run' goal automatically handles the compilation of the application, making a separate 'compile' step unnecessary. This allows for quick deployment and testing of the web application. ```text mvn jetty:run ``` -------------------------------- ### Example: SETUP_TABLE Data for Database Preparation Source: https://github.com/nablarch/nablarch-document/blob/main/en/development_tools/testing_framework/guide/development_guide/06_TestFWGuide/01_Abstract.rst This example demonstrates the usage of the SETUP_TABLE data type to prepare database records. It shows how to specify the target table ('COMPOSER') and provide tabular data for insertion before test execution. ```Text SETUP_TABLE=COMPOSER +--------+------------+-----------+ | NO | FIRST_NAME | LAST_NAME | +========+============+===========+ | 00001 | Steve | Reich | +--------+------------+-----------+ | 00002 | Phillip | Glass | +--------+------------+-----------+ ``` -------------------------------- ### Nablarch batchlet application successful execution log Source: https://github.com/nablarch/nablarch-document/blob/main/en/application_framework/application_framework/blank_project/setup_blankProject/setup_Jbatch.rst This log output confirms the successful execution of the `sample-batchlet` batch application, detailing the start and completion of the job and its steps. ```text 2020-04-28 10:35:27.002 -INFO- progress [null] boot_proc = [] proc_sys = [batch-ee] req_id = [null] usr_id = [null] start job. job name: [sample-batchlet] 2020-04-28 10:35:27.011 -INFO- progress [null] boot_proc = [] proc_sys = [batch-ee] req_id = [null] usr_id = [null] start step. job name: [sample-batchlet] step name: [step1] 2020-04-28 10:35:27.247 -INFO- progress [null] boot_proc = [] proc_sys = [batch-ee] req_id = [null] usr_id = [null] finish step. job name: [sample-batchlet] step name: [step1] step status: [SUCCESS] 2020-04-28 10:35:27.255 -INFO- progress [null] boot_proc = [] proc_sys = [batch-ee] req_id = [null] usr_id = [null] finish job. job name: [sample-batchlet] ``` -------------------------------- ### Command to Run Jetty Embedded Server with Maven Source: https://github.com/nablarch/nablarch-document/blob/main/en/migration/index.rst This command shows how to start the Jetty embedded server using the `jetty-ee10-maven-plugin` after it has been configured in the `pom.xml`. ```batch mvn jetty:run ``` -------------------------------- ### Download Nablarch Testing Tool JARs with Maven Source: https://github.com/nablarch/nablarch-document/blob/main/en/development_tools/testing_framework/guide/development_guide/08_TestTools/01_HttpDumpTool/02_SetUpHttpDumpTool.rst After configuring the Maven dependencies in your pom.xml, execute this command in your project directory to download the required JAR files. The -DoutputDirectory=lib option ensures the JARs are placed in a 'lib' folder. ```text mvn dependency:copy-dependencies -DoutputDirectory=lib ``` -------------------------------- ### Nablarch chunk application successful execution log Source: https://github.com/nablarch/nablarch-document/blob/main/en/application_framework/application_framework/blank_project/setup_blankProject/setup_Jbatch.rst This log output indicates a successful run of the `sample-chunk` batch application, showing the start and completion of the job and its steps, along with processing statistics. ```text 2020-04-28 10:39:46.955 -INFO- progress [null] boot_proc = [] proc_sys = [batch-ee] req_id = [null] usr_id = [null] start job. job name: [sample-chunk] 2020-04-28 10:39:46.974 -INFO- progress [null] boot_proc = [] proc_sys = [batch-ee] req_id = [null] usr_id = [null] start step. job name: [sample-chunk] step name: [step1] 2020-04-28 10:39:47.202 -INFO- progress [null] boot_proc = [] proc_sys = [batch-ee] req_id = [null] usr_id = [null] job name: [sample-chunk] step name: [step1] input count: [10] 2020-04-28 10:39:47.235 -INFO- progress [null] boot_proc = [] proc_sys = [batch-ee] req_id = [null] usr_id = [null] job name: [sample-chunk] step name: [step1] total tps: [156.25] current tps: [156.25] estimated end time: [2020/04/28 10:39:47.235] remaining count: [5] 2020-04-28 10:39:47.244 -INFO- progress [null] boot_proc = [] proc_sys = [batch-ee] req_id = [null] usr_id = [null] job name: [sample-chunk] step name: [step1] total tps: [243.90] current tps: [625.00] estimated end time: [2020/04/28 10:39:47.243] remaining count: [0] 2020-04-28 10:39:47.257 -INFO- progress [null] boot_proc = [] proc_sys = [batch-ee] req_id = [null] usr_id = [null] finish step. job name: [sample-chunk] step name: [step1] step status: [COMPLETED] 2020-04-28 10:39:47.263 -INFO- progress [null] boot_proc = [] proc_sys = [batch-ee] req_id = [null] usr_id = [null] finish job. job name: [sample-chunk] ``` -------------------------------- ### Example Excel Test Data for ID Generation Source: https://github.com/nablarch/nablarch-document/blob/main/ja/development_tools/testing_framework/guide/development_guide/06_TestFWGuide/03_Tips.rst This example demonstrates the structure of Excel test data for testing ID generation. It includes setup data for the ID generation table (`TEST_SBN_TBL`) and expected values for both the ID generation table and a user information table (`USER_INFO`) after a single ID generation operation. The setup data should only include records for the test range, and the expected value is typically 'setup value + 1' for a single generation. ```Test Data (Excel Format) // 準備データ // 採番用テーブル SETUP_TABLE=TEST_SBN_TBL ========== ============= ID_COL NO_COL ========== ============= 1101 100 ========== ============= // 期待値 // 採番用テーブル EXPECTED_TABLE=TEST_SBN_TBL ========== ============= ID_COL NO_COL ========== ============= 1101 101 ========== ============= // 期待値 // 採番した値が登録されるテーブル(USER_IDに採番された値が登録される。) EXPECTED_TABLE=USER_INFO ========== ============ ============= USER_ID KANJI_NAME KANA_NAME ========== ============ ============= 0000000101 漢字名 カナメイ ========== ============ ============= ``` -------------------------------- ### Build Nablarch Batch Application with Maven Source: https://github.com/nablarch/nablarch-document/blob/main/en/application_framework/application_framework/blank_project/setup_blankProject/setup_NablarchBatch.rst Execute this Maven command to compile and package the Nablarch batch application, preparing it for execution. ```text mvn package ``` -------------------------------- ### Run Docker Container for Web Application Source: https://github.com/nablarch/nablarch-document/blob/main/en/application_framework/application_framework/blank_project/setup_containerBlankProject/setup_ContainerWeb.rst This command starts a Docker container for the `myapp-container-web` application. It runs in detached mode (`-d`), maps port 8080 from the container to the host, mounts a local H2 database volume, and assigns a name to the container. This allows accessing the application via `http://localhost:8080/`. ```text cd myapp-container-web docker run -d -p 8080:8080 -v %CD%\h2:/usr/local/tomcat/h2 --name myapp-container-web myapp-container-web ``` -------------------------------- ### Change Directory to Generated Project Source: https://github.com/nablarch/nablarch-document/blob/main/en/application_framework/application_framework/blank_project/setup_blankProject/setup_WebService.rst Command to navigate into the newly generated `myapp-jaxrs` project directory before building and launching the application. ```text cd myapp-jaxrs ``` -------------------------------- ### Maven Commands for Project Compilation and Dependency Download Source: https://github.com/nablarch/nablarch-document/blob/main/en/development_tools/testing_framework/guide/development_guide/08_TestTools/02_MasterDataSetup/02_ConfigMasterDataSetupTool.rst These Maven commands are executed to compile the project and download all required JAR dependencies into a 'lib' directory. This ensures the master data tool utilizes the same database settings as the project's unit tests. ```text mvn compile mvn dependency:copy-dependencies -DoutputDirectory=lib ``` -------------------------------- ### Run and Stop Local Redis Instance with Docker Source: https://github.com/nablarch/nablarch-document/blob/main/en/application_framework/adaptors/lettuce_adaptor/redisstore_lettuce_adaptor.rst Commands to start a Redis 5.0.9 instance on port 6379 for local testing and how to stop it. This provides a quick way to set up a Redis server without manual installation. ```shell docker run --name redis -d -p 6379:6379 redis:5.0.9 docker stop redis ``` -------------------------------- ### Data Conversion Examples with Placeholders Source: https://github.com/nablarch/nablarch-document/blob/main/en/development_tools/testing_framework/guide/development_guide/06_TestFWGuide/01_Abstract.rst Provides examples of various data conversion rules using a placeholder syntax (e.g., ${type,length}), demonstrating how different input patterns are converted to specific character types and lengths. ```Configuration ${半角英字,5} | geDSfe | Converted to 5 single-byte alphabetic characters. ``` ```Configuration ${全角ひらがな,4} | ぱさぇん | Converted to full-width Hiragana 4 characters. ``` ```Configuration ${半角数字,2}-{半角数字4} | 37-3425 | Anything other than - is converted. ``` ```Configuration ${全角漢字,4}123 | 山川海森123 | Anything other than the end 123 is converted. ``` -------------------------------- ### QUnit Test Environment Setup Source: https://github.com/nablarch/nablarch-document/blob/main/_static/ui_dev/yuidoc/files/nablarch-dev-ui_test-support_ui_test_js_qunit.js.html This JavaScript function handles the setup phase for a QUnit test. It manages module transitions, calls `moduleStart` and `testStart` logging callbacks, extends the test environment with setup/teardown functions, and executes the test's `setup` method within a try-catch block to report failures. ```javascript setup: function() { if ( this.module !== config.previousModule ) { if ( config.previousModule ) { runLoggingCallbacks( "moduleDone", QUnit, { name: config.previousModule, failed: config.moduleStats.bad, passed: config.moduleStats.all - config.moduleStats.bad, total: config.moduleStats.all }); } config.previousModule = this.module; config.moduleStats = { all: 0, bad: 0 }; runLoggingCallbacks( "moduleStart", QUnit, { name: this.module }); } else if ( config.autorun ) { runLoggingCallbacks( "moduleStart", QUnit, { name: this.module }); } config.current = this; this.testEnvironment = extend({ setup: function() {}, teardown: function() {} }, this.moduleTestEnvironment ); runLoggingCallbacks( "testStart", QUnit, { name: this.testName, module: this.module }); // allow utility functions to access the current test environment // TODO why?? QUnit.current_testEnvironment = this.testEnvironment; if ( !config.pollution ) { saveGlobal(); } if ( config.notrycatch ) { this.testEnvironment.setup.call( this.testEnvironment ); return; } try { this.testEnvironment.setup.call( this.testEnvironment ); } catch( e ) { QUnit.pushFailure( "Setup failed on " + this.testName + ": " + ( e.message || e ), extractStacktrace( e, 1 ) ); } } ``` -------------------------------- ### Request Message Body Example (JSON Format) Source: https://github.com/nablarch/nablarch-document/blob/main/en/development_tools/testing_framework/guide/development_guide/05_UnitTestGuide/02_RequestUnitTest/http_real.rst Provides an example of a JSON-formatted request message body, serving as input data for tests. The snippet shows the beginning of a JSON object, indicating the start of the message body structure. ```JSON { ``` -------------------------------- ### Execute Unit Tests for Nablarch Web Project Source: https://github.com/nablarch/nablarch-document/blob/main/en/application_framework/application_framework/blank_project/setup_blankProject/setup_Web.rst Navigate into the newly generated project directory and execute Maven's `test` lifecycle to run included unit tests. This step confirms the successful generation and basic functionality of the blank project, specifically checking screen visibility via `SampleActionRequestTest`. ```text cd myapp-web mvn test ``` -------------------------------- ### Build Nablarch batch application using Maven Source: https://github.com/nablarch/nablarch-document/blob/main/en/application_framework/application_framework/blank_project/setup_blankProject/setup_Jbatch.rst Execute this Maven command to compile and package the Nablarch batch application. This step creates the necessary JAR files for execution. ```text mvn package ``` -------------------------------- ### Configure Master Data Backup Schema Name Source: https://github.com/nablarch/nablarch-document/blob/main/en/development_tools/testing_framework/guide/development_guide/08_TestTools/02_MasterDataSetup/02_ConfigMasterDataSetupTool.rst This snippet shows how to configure the backup schema name for the master data automated recovery function within the `master_data-build.properties` file. The example sets the schema to `nablarch_test_master`. ```bash # Master data backup schema name for test masterdata.test.backup-schema=nablarch_test_master ``` -------------------------------- ### SQL Server Database Configuration Example for Nablarch Source: https://github.com/nablarch/nablarch-document/blob/main/en/application_framework/application_framework/blank_project/CustomizeDB.rst Example configuration for connecting Nablarch applications to a SQL Server database, including the JDBC driver, URL with instance name, user, password, and schema settings in a properties file. ```text nablarch.db.jdbcDriver=com.microsoft.sqlserver.jdbc.SQLServerDriver # jdbc:sqlserver://Host name:Port number;instanceName=Instance name nablarch.db.url=jdbc:sqlserver://localhost:1433;instanceName=SQLEXPRESS nablarch.db.user=SAMPLE nablarch.db.password=SAMPLE nablarch.db.schema=SAMPLE ``` -------------------------------- ### Example MANIFEST.MF for Production Environment Source: https://github.com/nablarch/nablarch-document/blob/main/en/application_framework/application_framework/setting_guide/ManagingEnvironmentalConfiguration/index.rst Shows an example of `META-INF/MANIFEST.MF` content when an artifact is built for the production environment, including the `Target-Environment` entry to confirm the build target. ```none Manifest-Version: 1.0 Built-By: tie301686 Build-Jdk: 1.7.0_60 Created-By: Apache Maven 3.2.3 Target-Environment: Production Environment Archiver-Version: Plexus Archiver ``` -------------------------------- ### Example Micrometer Datadog API Key Configuration Source: https://github.com/nablarch/nablarch-document/blob/main/en/application_framework/adaptors/micrometer_adaptor.rst Illustrates how to configure the 'apiKey' for 'DatadogMeterRegistry' within the 'micrometer.properties' file, following the 'nablarch.micrometer..=' format. This example demonstrates a practical application of the configuration structure. ```properties nablarch.micrometer.datadog.apiKey=YOUR_API_KEY_HERE ``` -------------------------------- ### Navigate to Nablarch Batch Project Directory Source: https://github.com/nablarch/nablarch-document/blob/main/en/application_framework/application_framework/blank_project/setup_blankProject/setup_NablarchBatch.rst Before building or executing the batch application, use this command to change the current directory to the generated Nablarch batch project. ```text cd myapp-batch ``` -------------------------------- ### Accessing JSON Service Endpoint Source: https://github.com/nablarch/nablarch-document/blob/main/en/application_framework/application_framework/blank_project/setup_blankProject/setup_WebService.rst URL to access the sample Nablarch RESTful web service that returns a JSON formatted response. ```text http://localhost:9080/find/json ``` -------------------------------- ### Example Stack Trace for NoClassDefFoundError Source: https://github.com/nablarch/nablarch-document/blob/main/en/migration/index.rst An example stack trace showing a NoClassDefFoundError that can occur during execution, often related to class initialization issues like org.jboss.weld.logging.BeanLogger. This snippet illustrates the typical error output. ```text org.jboss.weld.exceptions.WeldException at org.jboss.weld.executor.AbstractExecutorServices.checkForExceptions (AbstractExecutorServices.java:82) ... Caused by: java.lang.NoClassDefFoundError at jdk.internal.reflect.NativeConstructorAccessorImpl.newInstance0 (Native Method) ... Caused by: java.lang.NoClassDefFoundError:Could not initialize class org.jboss.weld.logging.BeanLogger at org.jboss.weld.util.Beans.getBeanConstructor (Beans.java:279) ``` -------------------------------- ### H2 Database Configuration Example for Nablarch Source: https://github.com/nablarch/nablarch-document/blob/main/en/application_framework/application_framework/blank_project/CustomizeDB.rst Example configuration for connecting Nablarch applications to an H2 database, showing the JDBC driver, URL, user, password, and schema settings in a properties file. ```text nablarch.db.jdbcDriver=org.h2.Driver nablarch.db.url=jdbc:h2:./h2/db/SAMPLE nablarch.db.user=SAMPLE nablarch.db.password=SAMPLE nablarch.db.schema=PUBLIC ``` -------------------------------- ### PostgreSQL Database Configuration Example for Nablarch Source: https://github.com/nablarch/nablarch-document/blob/main/en/application_framework/application_framework/blank_project/CustomizeDB.rst Example configuration for connecting Nablarch applications to a PostgreSQL database, specifying the JDBC driver, URL, user, password, and schema settings in a properties file. ```text nablarch.db.jdbcDriver=org.postgresql.Driver # jdbc:postgresql://Host name:Port number/database name nablarch.db.url=jdbc:postgresql://localhost:5432/postgres nablarch.db.user=sample nablarch.db.password=sample nablarch.db.schema=sample ``` -------------------------------- ### Accessing XML Service Endpoint Source: https://github.com/nablarch/nablarch-document/blob/main/en/application_framework/application_framework/blank_project/setup_blankProject/setup_WebService.rst URL to access the sample Nablarch RESTful web service that returns an XML formatted response. ```text http://localhost:9080/find/xml ``` -------------------------------- ### Nablarch Request Message Input Data Example Source: https://github.com/nablarch/nablarch-document/blob/main/en/development_tools/testing_framework/guide/development_guide/05_UnitTestGuide/02_RequestUnitTest/real.rst Illustrates a simple example of the request statement used as input data for Nablarch tests, indicating the use of `setUpMessages` for message preparation. ```text MESSAGE=setUpMessages ``` -------------------------------- ### Example SQL File Structure and Statements Source: https://github.com/nablarch/nablarch-document/blob/main/en/application_framework/application_framework/libraries/database/database.rst Demonstrates the structure of an SQL file, including SQLID, comments, and parameter binding, as used in Nablarch for managing SQL statements. It shows examples for both a SELECT and an UPDATE statement. ```sql -- XXXXX acquisition SQL -- SQL_ID:GET_XXXX_INFO GET_XXXX_INFO = select col1, col2 from test_table where col1 = :col1 -- XXXXX update SQL -- SQL_ID:UPDATE_XXXX update_xxxx = update test_table set col2 = :col2 where col1 = :col1 ``` -------------------------------- ### Example: EXPECTED_TABLE with Inline Comments Source: https://github.com/nablarch/nablarch-document/blob/main/en/development_tools/testing_framework/guide/development_guide/06_TestFWGuide/01_Abstract.rst This example illustrates how to define expected database data using EXPECTED_TABLE, showcasing the comment feature. Any text starting with '//' in a cell is ignored, allowing for readability notes without affecting the actual test data. ```Text EXPECTED_TABLE=PLAYER +----------+----------+----------+----------+----------------------------+ |NO |FIRST_NAME|LAST_NAME |ADDRESS | | +==========+==========+==========+==========+============================+ |// Number |Name |Surname |Address | | +----------+----------+----------+----------+----------------------------+ |0001 |Andres |Segovia |Spain | | +----------+----------+----------+----------+----------------------------+ |0002 |Julian |Bream |England | // This record is added | +----------+----------+----------+----------+----------------------------+ ``` -------------------------------- ### Oracle Database Configuration Example for Nablarch Source: https://github.com/nablarch/nablarch-document/blob/main/en/application_framework/application_framework/blank_project/CustomizeDB.rst Example configuration for connecting Nablarch applications to an Oracle database, including the JDBC driver, URL format, user, password, and schema settings in a properties file. ```text nablarch.db.jdbcDriver=oracle.jdbc.driver.OracleDriver # jdbc:oracle:thin: @Host name:port number:database SID nablarch.db.url=jdbc:oracle:thin:@localhost:1521/xe nablarch.db.user=sample nablarch.db.password=sample nablarch.db.schema=sample ``` -------------------------------- ### Complete Nablarch Logger Property File Configuration Source: https://github.com/nablarch/nablarch-document/blob/main/en/application_framework/application_framework/libraries/log.rst This comprehensive example provides a full Nablarch property file demonstrating various logger and writer configurations. It includes setups for application logs, SQL logs, monitoring logs, standard output, and defines multiple loggers with specific matching rules, levels, and output destinations. ```properties loggerFactory.className=nablarch.core.log.basic.BasicLoggerFactory writerNames=appLog,sqlLog,monitorLog,stdout # Example of configuring a log file for application writer.appLog.className=nablarch.core.log.basic.FileLogWriter writer.appLog.filePath=/var/log/app/app.log # Example of configuring a log file for SQL output writer.sqlLog.className=nablarch.core.log.basic.FileLogWriter writer.sqlLog.filePath=/var/log/app/sql.log # Example of configuring a log file for monitoring writer.monitorLog.className=nablarch.core.log.basic.FileLogWriter writer.monitorLog.filePath=/var/log/app/monitoring.log # Configuring example for standard output writer.stdout.className=nablarch.core.log.basic.StandardOutputLogWriter availableLoggersNamesOrder=sql,monitoring,access,validation,root # Example of configuring all logger names for log output # Output WARN level or higher to appLog for all logger acquisition. loggers.root.nameRegex=.* loggers.root.level=WARN loggers.root.writerNames=appLog # Example of configuring a specific logger name as a log output target. # For logger acquisition with "MONITOR" specified in logger name # Output ERROR level or higher to appLog, monitorLog. loggers.monitoring.nameRegex=MONITOR loggers.monitoring.level=ERROR ``` -------------------------------- ### HTML Usage Example for Nablarch ShowDialogAction Source: https://github.com/nablarch/nablarch-document/blob/main/_static/ui_dev/yuidoc/files/nablarch-widget-event-dialog_ui_public_js_nablarch_ui_event_ShowDialogAction.js.html Demonstrates how to declare a `ShowDialog` action within HTML using Nablarch's event action attributes. This example configures a confirmation dialog to appear when a form element with a name starting with 'form.userType' has a value of 'admin', prompting the user for confirmation before a change. ```HTML
``` -------------------------------- ### Launch Nablarch Messaging Batch Application (SampleResiBatch) Source: https://github.com/nablarch/nablarch-document/blob/main/en/application_framework/application_framework/blank_project/setup_blankProject/setup_NablarchBatch.rst This command launches the 'SampleResiBatch' application, which implements messaging using tables as queues. Note the differences in the '-diConfig' XML file and '-requestPath' compared to the on-demand batch. ```bash mvn exec:java -Dexec.mainClass=nablarch.fw.launcher.Main ^ -Dexec.args="'-diConfig' 'classpath:resident-batch-boot.xml' '-requestPath' 'SampleResiBatch' '-userId' 'batch_user'" ``` -------------------------------- ### Example Configuration for ApplicationSettingJsonLogFormatter Source: https://github.com/nablarch/nablarch-document/blob/main/en/application_framework/application_framework/libraries/log.rst A properties file example demonstrating how to configure ApplicationSettingJsonLogFormatter to output system settings and business date in JSON format, including specific system setting items. ```Properties applicationSettingLogFormatter.className=nablarch.core.log.app.ApplicationSettingJsonLogFormatter applicationSettingLogFormatter.structuredMessagePrefix=$JSON$ applicationSettingLogFormatter.appSettingTargets=systemSettings applicationSettingLogFormatter.appSettingWithDateTargets=systemSettings,businessDate applicationSettingLogFormatter.systemSettingItems=dbUser,dbUrl,threadCount ``` -------------------------------- ### Launch Nablarch On-Demand Batch Application (SampleBatch) Source: https://github.com/nablarch/nablarch-document/blob/main/en/application_framework/application_framework/blank_project/setup_blankProject/setup_NablarchBatch.rst This command launches the 'SampleBatch' on-demand application using Maven's exec plugin. It specifies the batch configuration XML and the request path, used for confirming basic Nablarch function communications. ```bash mvn exec:java -Dexec.mainClass=nablarch.fw.launcher.Main ^ -Dexec.args="'-diConfig' 'classpath:batch-boot.xml' '-requestPath' 'SampleBatch' '-userId' 'batch_user'" ``` -------------------------------- ### Example HttpAccessLogFormatter Properties Configuration Source: https://github.com/nablarch/nablarch-document/blob/main/en/application_framework/application_framework/libraries/log/http_access_log.rst An example configuration for the HttpAccessLogFormatter, demonstrating how to set its class, structured message prefix, and target fields for different log stages. ```properties httpAccessLogFormatter.className=nablarch.fw.web.handler.HttpAccessJsonLogFormatter httpAccessLogFormatter.structuredMessagePrefix=$JSON$ httpAccessLogFormatter.beginTargets=sessionId,url,method httpAccessLogFormatter.parametersTargets=sessionId,parameters httpAccessLogFormatter.dispatchingClassTargets=sessionId,dispatchingClass httpAccessLogFormatter.endTargets=sessionId,url,statusCode,contentPath httpAccessLogFormatter.beginLabel=HTTP ACCESS BEGIN httpAccessLogFormatter.parametersLabel=PARAMETERS httpAccessLogFormatter.dispatchingClassLabel=DISPATCHING CLASS httpAccessLogFormatter.endLabel=HTTP ACCESS END ``` -------------------------------- ### Configure Maven Dependencies for Nablarch Testing Tool Source: https://github.com/nablarch/nablarch-document/blob/main/en/development_tools/testing_framework/guide/development_guide/08_TestTools/01_HttpDumpTool/02_SetUpHttpDumpTool.rst To use the Request Unit Data Creation Tool, ensure your project's pom.xml includes the nablarch-testing and nablarch-testing-jetty12 dependencies within the element. These are provided with a 'test' scope. ```xml com.nablarch.framework nablarch-testing "test" com.nablarch.framework nablarch-testing-jetty12 "test" ``` -------------------------------- ### Bash: Execute Nablarch Example DB Queue Application Source: https://github.com/nablarch/nablarch-document/blob/main/en/application_framework/application_framework/messaging/db/getting_started/table_queue.rst This Bash command sequence navigates to the application directory, cleans and packages the project, and then executes the main Nablarch launcher class. It specifies the configuration file, request path, and a user ID for the application execution. ```bash $cd nablarch-example-db-queue $mvn clean package $mvn exec:java -Dexec.mainClass=nablarch.fw.launcher.Main ^ -Dexec.args="'-diConfig' 'com/nablarch/example/app/batch/project-creation-service.xml' '-requestPath' 'ProjectCreationService' '-userId' 'samp'" ``` -------------------------------- ### DB2 Database Configuration Example for Nablarch Source: https://github.com/nablarch/nablarch-document/blob/main/en/application_framework/application_framework/blank_project/CustomizeDB.rst Example configuration for connecting Nablarch applications to an IBM DB2 database, detailing the JDBC driver, URL, user, password, and schema settings in a properties file. ```text nablarch.db.jdbcDriver=com.ibm.db2.jcc.DB2Driver # jdbc:db2://Host name:Port number/database name nablarch.db.url=jdbc:db2://localhost:50000/SAMPLE nablarch.db.user=sample nablarch.db.password=sample nablarch.db.schema=sample ``` -------------------------------- ### Verify Successful Application Launch Log Output Source: https://github.com/nablarch/nablarch-document/blob/main/en/application_framework/application_framework/blank_project/setup_blankProject/setup_Web.rst Upon successful launch of the Nablarch application, a specific log message will be output to the console. This snippet shows the key log entry indicating that the NablarchServletContextListener has completed its initialization process, confirming the application is ready. ```text (omitted) 2023-03-30 10:04:42.148 -INFO- nablarch.fw.web.servlet.NablarchServletContextListener [null] boot_proc = [] proc_sys = [web] req_id = [null] usr_id = [null] [nablarch.fw.web.servlet.NablarchServletContextListener#contextInitialized] initialization completed. ``` -------------------------------- ### Nablarch SlideMenu Initial HTML Markup Example Source: https://github.com/nablarch/nablarch-document/blob/main/_static/ui_dev/yuidoc/files/nablarch-widget-slide-menu_ui_public_js_nablarch_ui_SlideMenu.js.html Example HTML markup for the initial display of the Nablarch SlideMenu. It demonstrates the use of the `nablarch_SlideMenu` marker class, along with selectors for open/close buttons and the menu's content area. This setup defines the menu's structure and initial hidden state. ```HTML
...
``` -------------------------------- ### Execute Unit Tests for Nablarch Batch Project Source: https://github.com/nablarch/nablarch-document/blob/main/en/application_framework/application_framework/blank_project/setup_blankProject/setup_NablarchBatch.rst After generating the Nablarch batch project, navigate into the created project directory and execute the Maven test command. This runs the included unit tests, such as SampleBatchActionRequestTest, to confirm that the blank project was successfully generated and the batch can be launched. ```text cd myapp-batch mvn test ``` -------------------------------- ### Example JSON Response for Project Search Source: https://github.com/nablarch/nablarch-document/blob/main/en/application_framework/application_framework/web_service/rest/getting_started/search/index.rst Confirms the expected JSON format response when searching for project information, specifically for customer ID 1. ```javascript [ { "projectId":1, "projectName":"Project 001", "projectType":"development", // Omitted } ] ``` -------------------------------- ### Read Uploaded File from HttpRequest in Nablarch (Java) Source: https://github.com/nablarch/nablarch-document/blob/main/en/application_framework/application_framework/handlers/web/multipart_handler.rst This Java example shows how to retrieve uploaded files from an `HttpRequest` object in Nablarch. It uses `request.getPart("uploadFile")` to get a list of `PartInfo` objects, representing the uploaded files. It also includes a check for empty `partInfoList` and demonstrates getting an `InputStream` from the first `PartInfo` for further processing. ```Java public HttpResponse upload(HttpRequest request, ExecutionContext context) throws IOException { // Acquire the uploaded file List partInfoList = request.getPart("uploadFile"); if (partInfoList.isEmpty()) { // Business error if the uploaded file is not specified } // Process the uploaded file InputStream file = partInfoList.get(0).getInputStream(); // The read process of the uploaded file is performed below. } ``` -------------------------------- ### Build Docker Container Image with Jib Maven Plugin Source: https://github.com/nablarch/nablarch-document/blob/main/en/application_framework/application_framework/blank_project/setup_containerBlankProject/setup_ContainerWeb.rst These commands navigate into the generated project directory and then execute the Jib Maven plugin's `dockerBuild` goal. This goal creates a Docker container image of the web application, leveraging the built-in Jib plugin in the blank project. ```text cd myapp-container-web mvn package jib:dockerBuild ``` -------------------------------- ### Execute Paged SQL Query with SelectOption in Nablarch Java Source: https://github.com/nablarch/nablarch-document/blob/main/en/application_framework/application_framework/libraries/database/database.rst Illustrates how to fetch a specific range of records using Nablarch's paging function. It shows acquiring a database connection, preparing a statement with `SqlPStatement` using a `SelectOption` to define the start position and number of records, and then retrieving the results. This example fetches 10 records starting from the 11th. ```java // Acquire database connection from DbConnectionContext AppDbConnection connection = DbConnectionContext.getConnection(); // Generate the statement object by specifying the SQLID and search range. SqlPStatement statement = connection.prepareStatementBySqlId( "jp.co.tis.sample.action.SampleAction#findUser", new SelectOption(11, 10)); // Execute the search process SqlResultSet result = statement.retrieve(); ``` -------------------------------- ### Nablarch Forward Request Pattern Matching Examples Source: https://github.com/nablarch/nablarch-document/blob/main/en/application_framework/application_framework/handlers/common/request_handler_entry.rst Demonstrates forward matching using the '//' notation in request patterns, including examples for '/app//' and '//*.jsp' and their match results against various request paths. ```APIDOC +----------------+-------------------------+-------------------------------------------+ | requestPattern | Request path | Results | +================+=========================+===========================================+ | /app// | / | Is not called | | +-------------------------+-------------------------------------------+ | | /app/ | Is called | | +-------------------------+-------------------------------------------+ | | /app/admin/ | Is called | | +-------------------------+-------------------------------------------+ | | /app/admin/index.jsp | Is called | +----------------+-------------------------+-------------------------------------------+ | //\*.jsp | /app/index.jsp | Is called | | +-------------------------+-------------------------------------------+ | | /app/admin/index.jsp | Is called | | +-------------------------+-------------------------------------------+ | | /app/index.html | Is not called (does not match '\*.jsp') | +----------------+-------------------------+-------------------------------------------+ ``` -------------------------------- ### Nablarch Custom Tags: Specify Absolute URL (JSP) Source: https://github.com/nablarch/nablarch-document/blob/main/en/application_framework/application_framework/libraries/tag.rst This JSP example shows how to use the `` custom tag to create a hyperlink with an absolute URL, starting with `http` or `https`. ```jsp coastland ``` -------------------------------- ### Navigate to Generated Web Project Directory Source: https://github.com/nablarch/nablarch-document/blob/main/en/application_framework/application_framework/blank_project/setup_blankProject/setup_Web.rst This command changes the current working directory to the 'myapp-web' folder, which is the root of the newly generated Nablarch web project. This step is necessary before executing build or run commands specific to the project. ```text cd myapp-web ``` -------------------------------- ### Configure Nablarch Components for ByType Automatic Injection (XML) Source: https://github.com/nablarch/nablarch-document/blob/main/en/application_framework/application_framework/libraries/repository.rst These XML configuration examples show how to define components in Nablarch's DI container. The first example demonstrates implicit 'ByType' injection where BasicSampleComponent is automatically wired to SampleClient's sampleComponent property. The second example provides the equivalent explicit property definition for clarity. ```xml ``` ```xml ``` -------------------------------- ### Example Log Output with Common Micrometer Tags Source: https://github.com/nablarch/nablarch-document/blob/main/en/application_framework/adaptors/micrometer_adaptor.rst This text snippet shows an example of log output from Nablarch's Micrometer integration after common tags have been configured. It illustrates how the 'foo=FOO' and 'bar=BAR' tags are automatically appended to each metric's log entry, demonstrating the successful application of global tags. ```Text (Omitted) 2020-09-04 17:30:06.656 [INFO ] i.m.c.i.l.LoggingMeterRegistry: process.start.time{bar=BAR,foo=FOO} value=444224h 29m 38.875000064s 2020-09-04 17:30:06.656 [INFO ] i.m.c.i.l.LoggingMeterRegistry: process.uptime{bar=BAR,foo=FOO} value=27.849s 2020-09-04 17:30:06.656 [INFO ] i.m.c.i.l.LoggingMeterRegistry: system.cpu.count{bar=BAR,foo=FOO} value=8 2020-09-04 17:30:06.657 [INFO ] i.m.c.i.l.LoggingMeterRegistry: system.cpu.usage{bar=BAR,foo=FOO} value=0.475654 ``` -------------------------------- ### Example Configuration for Failure Log Formatter Source: https://github.com/nablarch/nablarch-document/blob/main/en/application_framework/application_framework/libraries/log/failure_log.rst This example demonstrates a complete configuration for the failure log formatter using a properties file, setting various parameters like class name, default codes, language, and format strings. ```properties failureLogFormatter.className=nablarch.core.log.app.FailureLogFormatter failureLogFormatter.defaultFailureCode=UNEXPECTED_ERROR failureLogFormatter.defaultMessage=an unexpected exception occurred. failureLogFormatter.language=en failureLogFormatter.notificationFormat=fail_code = [$failureCode$] $message$ failureLogFormatter.analysisFormat=fail_code = [$failureCode$] $message$ failureLogFormatter.derivedRequestIdPropName=insertRequestId failureLogFormatter.derivedUserIdPropName=updatedUserId failureLogFormatter.contactFilePath=classpath:failure-log-contact.properties failureLogFormatter.fwFailureCodeFilePath=classpath:failure-log-fw-codes.properties ``` -------------------------------- ### Start Nablarch Simulator for Different Message Types Source: https://github.com/nablarch/nablarch-document/blob/main/en/biz_samples/11/index.rst The Nablarch simulator can be started by executing specific batch files included in the created execution module. Each file corresponds to a different message type (HTTP or MOM) and direction (incoming or outgoing). ```bat http-incoming-startup.bat http-outgoing-startup.bat mom-incoming-startup.bat mom-outgoing-startup.bat ``` -------------------------------- ### Example Output from LoggingMeterRegistry with LogCountMetrics (Text) Source: https://github.com/nablarch/nablarch-document/blob/main/en/application_framework/adaptors/micrometer_adaptor.rst This text snippet shows an example of the metrics output generated by `LoggingMeterRegistry` when `LogCountMetrics` is enabled. It displays log counts for different levels and loggers, along with their throughput. ```text 2020-12-22 14:25:36.978 [INFO ] i.m.c.i.l.LoggingMeterRegistry: log.count{level=WARN,logger=com.nablarch.example.app.web.action.MetricsAction} throughput=0.4/s 2020-12-22 14:25:41.978 [INFO ] i.m.c.i.l.LoggingMeterRegistry: log.count{level=ERROR,logger=com.nablarch.example.app.web.action.MetricsAction} throughput=1.4/s ``` -------------------------------- ### Example of jakarta.validation Import in Java (Corrected) Source: https://github.com/nablarch/nablarch-document/blob/main/en/migration/index.rst This Java snippet displays the corrected `import` statement for Bean Validation classes. By changing `javax.validation` to `jakarta.validation`, the application becomes compatible with Jakarta EE. ```java import jakarta.validation.ConstraintValidator; ``` -------------------------------- ### Execute Registration Process (Java) Source: https://github.com/nablarch/nablarch-document/blob/main/en/application_framework/application_framework/libraries/session_store/create_example.rst This code block outlines the execution of the registration process. It retrieves the project information from the session store, performs the (omitted) registration logic, and then cleans up by deleting the project data from the session store after the process is complete. ```Java // Fetch input information from the session store Project project = SessionUtil.get(ctx, "project"); // Registration process is omitted // Delete the input information from the session store SessionUtil.delete(ctx, "project"); ``` -------------------------------- ### Build Nablarch Batch Application with Maven Source: https://github.com/nablarch/nablarch-document/blob/main/en/application_framework/application_framework/blank_project/setup_blankProject/setup_NablarchBatch_Dbless.rst This command executes the Maven `package` goal to build the Nablarch batch application. It compiles the source code, runs tests, and packages the application into a distributable format, typically a JAR file, preparing it for execution. ```text mvn package ``` -------------------------------- ### Return from Confirmation to Input Screen (Java) Source: https://github.com/nablarch/nablarch-document/blob/main/en/application_framework/application_framework/libraries/session_store/create_example.rst This snippet manages the return flow from a confirmation screen back to the input screen. It fetches the previously saved project entity from the session, converts it back into a form object, populates the request scope with this form, and finally deletes the project data from the session to clean up. ```Java // Fetch input information from the session store Project project = SessionUtil.get(ctx, "project"); // Convert Entity to Form ProjectForm form = BeanUtil.createAndCopy(ProjectForm.class, project); // Configure input information to the request scope context.setRequestScopedVar("form", form); // Delete the input information from the session store SessionUtil.delete(ctx, "project"); ``` -------------------------------- ### Returning an Internal Forward Response in Java Source: https://github.com/nablarch/nablarch-document/blob/main/en/application_framework/application_framework/handlers/web/forwarding_handler.rst Java code example demonstrating how a business action can return an `HttpResponse` to trigger an internal forward. The response path must start with `forward://` to indicate the internal redirection. ```java public HttpResponse sample(HttpRequest request, ExecutionContext context) { // Business process // Internal forward to initialize the same business action return new HttpResponse("forward://initialize"); } ``` -------------------------------- ### Example LoggingMeterRegistry Metrics Output Source: https://github.com/nablarch/nablarch-document/blob/main/en/application_framework/adaptors/micrometer_adaptor.rst This snippet shows an example of the metrics logged by `LoggingMeterRegistry`. It displays the active and total database connection pool values, indicating the current state of the HikariCP pool after initialization. ```text 2020-12-24 16:37:57.143 [INFO ] i.m.c.i.l.LoggingMeterRegistry: db.pool.active{} value=0 2020-12-24 16:37:57.143 [INFO ] i.m.c.i.l.LoggingMeterRegistry: db.pool.total{} value=5 ``` -------------------------------- ### Execute unit tests for generated Jakarta Batch project Source: https://github.com/nablarch/nablarch-document/blob/main/en/application_framework/application_framework/blank_project/setup_blankProject/setup_Jbatch.rst This command navigates into the generated project directory and executes the included unit tests to confirm successful project generation and communication. The output log confirms the test results. ```text cd myapp-batch-ee mvn test ``` -------------------------------- ### Maven Build Success Log Output Source: https://github.com/nablarch/nablarch-document/blob/main/en/application_framework/application_framework/blank_project/setup_blankProject/setup_WebService.rst This log snippet shows the console output indicating a successful Maven build of the `myapp-jaxrs` project, including test results. ```text (omitted) [INFO] ----------------------< com.example:myapp-jaxrs >----------------------- [INFO] Building myapp-jaxrs 0.1.0 [INFO] --------------------------------[ war ]--------------------------------- (omitted) [INFO] Results: [INFO] [INFO] Tests run: 4, Failures: 0, Errors: 0, Skipped: 0 [INFO] [INFO] ------------------------------------------------------------------------ [INFO] BUILD SUCCESS [INFO] ------------------------------------------------------------------------ (rest is omitted) ``` -------------------------------- ### Transition from Input to Confirmation Screen (Java) Source: https://github.com/nablarch/nablarch-document/blob/main/en/application_framework/application_framework/libraries/session_store/create_example.rst This code handles the transition from an input screen to a confirmation screen. It retrieves input data from the request scope, converts it from a form object to an entity object, and then saves the entity object into the session store for later retrieval during the confirmation or registration process. ```Java // Acquire input information from the request scope ProjectForm form = context.getRequestScopedVar("form"); // Convert Form to Entity Project project = BeanUtil.createAndCopy(Project.class, form); // Save input information in session store SessionUtil.put(ctx, "project", project); ``` -------------------------------- ### HttpServerFactory Configuration (After Jakarta EE Migration) Source: https://github.com/nablarch/nablarch-document/blob/main/en/migration/index.rst This XML snippet illustrates the updated configuration for the `httpServerFactory` component. The class is changed to `HttpServerFactoryJetty12` to ensure the embedded server started by NTF supports Jakarta EE. ```xml ``` -------------------------------- ### Example of javax.validation Import in Java (Requires Change) Source: https://github.com/nablarch/nablarch-document/blob/main/en/migration/index.rst This Java snippet shows an `import` statement for `javax.validation.ConstraintValidator`. This is a Java EE namespace that will cause compilation errors after migrating to Jakarta EE and must be changed to `jakarta`. ```java import javax.validation.ConstraintValidator; ``` -------------------------------- ### Example LoggingMeterRegistry Output Source: https://github.com/nablarch/nablarch-document/blob/main/en/application_framework/adaptors/micrometer_adaptor.rst An example of metrics output when using `LoggingMeterRegistry`, showing a thread count metric with its value. ```text 18-Feb-2021 13:17:38.168 INFO [logging-metrics-publisher] io.micrometer.core.instrument.logging.LoggingMeterRegistry.lambda$publish$3 thread.count.current{} value=10 ``` -------------------------------- ### List Docker Images in Local Repository Source: https://github.com/nablarch/nablarch-document/blob/main/en/application_framework/application_framework/blank_project/setup_containerBlankProject/setup_ContainerWeb.rst This command displays all Docker images stored in the local repository, showing details like repository name, tag, image ID, creation date, and size. It helps verify the presence of built images. ```text docker image ls REPOSITORY TAG IMAGE ID CREATED SIZE myapp-container-web 0.1.0 dd60cbdc7722 50 years ago 449MB myapp-container-web latest dd60cbdc7722 50 years ago 449MB ```