# インストール

## 必要条件

### OZシンクサーバー

* 同期サーバーには、サーバーに**JAVA 8**以降がインストールされている必要があります。
* 受信ポート（例：14127）は、サブビューアーからのアクセスを許可するためにEPGによって使用されます。
* データベースポート（例：8441）は、DBSがデータベースにアクセスするために使用されます。

## OZシンクサーバーのインストール

1. OZ Sync Serverは[こちら](https://drive.google.com/file/d/1q0YEKJgMleVXjD0-PodgHIJk23qUGCtS/view)からダウンロードしてください。
2. それをインストールフォルダー（例：OZRelayServer）に抽出します。 EPGとDBSの2つのサブフォルダーが表示されます。

### DBS (DatabaseServer)設定

SQLiteデータベースは、デフォルトでインストールに含まれています。 必要に応じてOracleを使用できます。

#### DBSフォルダのファイル

| **ファイル名**                                    | **説明**                       |
| -------------------------------------------- | ---------------------------- |
| config/example/application.properties.SQLITE | SQLiteのサンプル                  |
| config/application.properties                | 設定ファイル                       |
| sync.db                                      | DBファイル                       |
| TP\_DBS.jar                                  | 実行可能ファイル                     |
| dbs\_linux.sh                                | Linux bashのコマンドスクリプト         |
| dbs\_unix.sh                                 | Unixのコマンドスクリプト               |
| dbs\_windows.agent.cmd                       | Windows (デモンモード)のコマンドスクリプト   |
| dbs\_windows.console.cmd                     | Windows (コンソールモード)のコマンドスクリプト |

#### application.propertiesの設定

| アイテム                       | **値**                  | **説明**              |
| -------------------------- | ---------------------- | ------------------- |
| server.port                | 8441                   | DBSポート              |
| info.app.notifyServers     | <http://52.77.xxx.xxx> | シンクサーバーサーバーのURLのURL |
| info.app.notifyPort        | 14127                  | EPSポート              |
| info.app.procIndex         | 1                      | DBSシリアル番号           |
| spring.datasource.main.url | jdbc:sqlite:sync.db    | データソース              |

application.propertiesが見つからない場合は、config/example/application.properties.SQLITEをconfig/config.propertiesとしてコピーします。 その後、必要に応じて変更します。

{% hint style="danger" %}
ここに記載されていない項目の値は変更しないでください。
{% endhint %}

#### DBSサーバの開始

OSに応じてコマンドスクリプトを実行します。

{% hint style="warning" %}

* dbs\_windows\_console.cmdによって開始されたDBSは、コマンドウィンドウが閉じられると停止します。
* dbs\_windows\_agent.cmdによって開始されたDBSは、コマンドウィンドウが閉じられても停止しません。
  {% endhint %}

### EPG (EventPushGateway)の設定

#### EPGフォルダのファイル

| ファイル名                     | **説明**                       |
| ------------------------- | ---------------------------- |
| example/config.properties | config.propertiesのサンプル       |
| license/key               | ライセンスファイル                    |
| config.properties         | 設定ファイル                       |
| TP\_EPG.jar               | 実行可能ファイル                     |
| epg\_linux.sh             | Linux bashのコマンドスクリプト         |
| epg\_unix.sh              | Unixのコマンドスクリプト               |
| epg\_windows.agent.cmd    | Windows (デモンモード)のコマンドスクリプト   |
| epg\_windows.console.cmd  | Windows (コンソールモード)のコマンドスクリプト |

#### Setting config.properties

| アイテム                     | **値**                   | Description           |
| ------------------------ | ----------------------- | --------------------- |
| local.host.name          | blank/url               | デフォルトのローカルホスト         |
| local.port               | 14127                   | EPSポート                |
| local.epg.mode           | EPS                     | 大文字                   |
| local.eps.index          | 1                       | EPSシリアル番号             |
| db.server.info.1         | <http://127.0.0.1:8441> | DBSのurlとポート           |
| epg.ssl.enable           | false/true              | SSL証明書を使用するにはtrueに設定  |
| epg.ssl.keyStore         | pfs file path           | PKCS12 SSL証明書ファイルのパッす |
| epg.ssl.keyStorePassword |                         | 証明書パスワード              |

config.propertiesが見つからない場合は、example/config.propertiesをEPGにコピーして変更します。

#### EPGサーバの開始

OSに応じてコマンドスクリプトを実行します。

{% hint style="warning" %}

* epg\_windows\_console.cmdによって起動されたEPGサーバーは、コマンドウィンドウが閉じられると停止します。
* epg\_windows\_agent.cmdによって起動されたEPGサーバーは、コマンドウィンドウを閉じても停止しません。
  {% endhint %}

## OZミラーリングビューアインストール

### ファイルのダウンロード及び配布

1. [ここ](https://drive.google.com/open?id=1jvHkLztyJCUGqxaoneZi4iMcq0dxVUG_)からサンプルアプリケーションをダウンロードします。
2. 2つのフォルダー、**ActiveXviewer**と**mirror**（ミラーリングモジュールとサンプルアプリケーション）、およびファイル**mirror.ozr**（サンプルe-Form）が含まれています。&#x20;
3. **ActiveXviewer**フォルダーと**mirror**をサーバー上のOZサーブレットフォルダーに移動します。\
   `tomcat/webapps/oz-servlet/`
4. **mirror.ozr**をOZサーバーリポジトリ.`WEB-INF/repository_files/samples/`に移動します

### ファイル修正

1. `oz-servlet/mirror/`.に移動します。&#x20;
2. 独自の環境に合わせて、mirror-start.html、mirror-desktop-jsp、mirror-mobile.htmlを変更します。 ozサーバーのURL、.OZRファイルのカテゴリ名、EPGポート、DBSポートなどを変更する必要があります。

### テストインストール

1. **IE browser**ブラウザでmirror-start.htmlファイルを開きます。 *`http://hostname:port/oz-servlet/mirror/mirror-start.html`*
2. デバイスIDに「test」と入力します。
3. &#x20;OZビューアが初めてデスクトップにインストールされます。しばらく時間がかかります。
4. サンプルのe-Formが開いたら、サーバーの設定は成功しています。

{% hint style="warning" %}
**Internet Explorer**でmirror-start.htmlを開いていることを確認してください。
{% endhint %}

## OZ Mobileアプリの設定

OZモバイルアプリの準備の[デモ](/guide/mirroring-viewer/demo.md#mirringudemo)セクションを参照し、`http://hostname:port/oz-servlet/mirror`を指す独自のホームページURLを追加します。

これで、サーバーとのミラーリングを開始できます。 \
詳細については、[デモ](/guide/mirroring-viewer/demo.md#ozmobairuapurino)を参照してください。

## Scripts for e-Form

You need to add some scripts in your .OZR file for mirroring. Open your .OZR and copy the scripts below and paste it into OnExternalEvent of the ReportTemplate. And then save and upload it to OZ Repository Server.

![](/files/-MJoVWuT8s1HYHciuc-m)

```javascript
if(ozarg_1 == "setvalue") {
	var old = This.GetInputValue(ozarg_2);
	if(old != ozarg_3){
		This.SetInputValue(ozarg_2, ozarg_3);
		var comp = This.GetInputComponent(ozarg_2);
		if(comp) {
			comp.TriggerEvent("OnValueChanged");
		}
	}
} else if(ozarg_1 == "getvalue") {
	return This.GetInputValue(ozarg_2);
} else if(ozarg_1 == "setcomment") {
	var page = This.GetPageByIndex(parseInt(ozarg_2));
	page.SetCommentData(ozarg_3);
} else if(ozarg_1 == "getcomment") {
	var page = This.GetPageByIndex(parseInt(ozarg_2));
	if (ozarg_3 == "encode")
		return encodeURI(page.GetCommentData());
	else
		return page.GetCommentData();
} else if(ozarg_1 == "clearcomment") {
	for(var i = 1; i <= This.GetPageCount();i++){
		var page = This.GetPageByIndex(i);
		page.SetCommentData("");
	}
} else if(ozarg_1 == "focus") {
	This.GetInputComponent(ozarg_2).SetFocus(false);
} else if(ozarg_1 == "killfocus") {
	This.GetInputComponent(ozarg_2).KillFocus(false);
}


else if(ozarg_1 == "setkeyboardtype"){
    var obj = GetInputComponent(ozarg_2);
    obj.SetKeyboardType(ozarg_3);
}else if(ozarg_1 == "enable"){
    var obj = GetInputComponent(ozarg_2);
    obj.SetEnable(true);
}else if(ozarg_1 == "disable"){
    var obj = GetInputComponent(ozarg_2);
    obj.SetEnable(false);
}else if(ozarg_1 == "click"){
    var obj = GetInputComponent(ozarg_2);
    obj.Click();
}

var formid = "";
var objComp = "";
if(ozarg_1 != "" && ozarg_1 != null){
	if(ozarg_1 == "_callExternalEvent_"){
		//_MessageBox("ozarg_1 : "+ozarg_1+", ozarg_2 : "+ozarg_2+", ozarg_3 : "+ozarg_3);
		formid = ozarg_2;
		objComp = GetInputComponent(formid);
		objComp.SetText(ozarg_3);
	}else if(ozarg_1 == "_callUserEvent_"){
		formid = ozarg_2;
		objComp = GetInputComponent(formid);
		objComp.Click();
	}
} 
```


---

# Agent Instructions: Querying This Documentation

If you need additional information that is not directly available in this page, you can query the documentation dynamically by asking a question.

Perform an HTTP GET request on the current page URL with the `ask` query parameter:

```
GET https://jp.ozeform.io/guide/mirroring-viewer/installation.md?ask=<question>
```

The question should be specific, self-contained, and written in natural language.
The response will contain a direct answer to the question and relevant excerpts and sources from the documentation.

Use this mechanism when the answer is not explicitly present in the current page, you need clarification or additional context, or you want to retrieve related documentation sections.
