Browse Source

Added dev-en-HK 4.md

tobychui 5 years ago
parent
commit
df367cd86b
3 changed files with 137 additions and 2 deletions
  1. 18 2
      docs/lang/dev-en-HK/3.md
  2. 116 0
      docs/lang/dev-en-HK/4.md
  3. 3 0
      docs/lang/dev-en-HK/5.md

+ 18 - 2
docs/lang/dev-en-HK/3.md

@@ -87,6 +87,15 @@ To support Virtual Desktop Mode, you would need to program the following items i
 
 *You can choose not to implement the following items and your WebApp will still launch inside VDI mode as a normal iframe element*.
 
+#### Requirement for VDI Mode
+The basic requirement for VDI Mode is simple. We recommend developers to following the following guideline while developing their WebApps to enable better quality control over VDI supporting WebApps. 
+
+1. No redirect to Grid Menu (aka No link in the VDI that can allow the module to be redirected to /AOR/index.php)
+2. Design for Desktop, not Mobile. (Design it so it looks like a Desktop Application)
+3. Do not try to interference other on-screen WebApps unless necessary. (Do not try to call functions on other iframe if possible)
+
+That is it! Follow the guideline above and your webApps will be ready to go!
+
 #### Introduction to ao_module wrapper
 ao_module wrapper is a system API wrapper for the functional bar interface. It includes shortcuts and functions that call to Float Window system, file explorer and more.
 The ao_module wrapper is located under ```script/ao_module.js```. You can include it with the following header.
@@ -106,8 +115,15 @@ if (ao_module_virtualDesktop){
 
 ```
 
+This function can be used to hide menu bar items that is not suitable for VDI modes. 
 See more about ao_module wrapper in the "API Wrapper - ao_module" page.
 
-#### Input Method Editor
-ArOZ VDI Mode support custom IME and provide pipeline for custom written IME to launch within the system. See "Input Method Editor" for more information.
+#### Advanced System APIs
+You can access advance system API with the following function calls to the wrappers. Advance System APIs includes
+- Input Method Editor API
+- File System API
+- Default System Opener
+- AO-Codec (UMFilename conversion on Client Side)
+- FloatWindow Control API
+- Icon manager and utils
 

+ 116 - 0
docs/lang/dev-en-HK/4.md

@@ -0,0 +1,116 @@
+["WebApp Open Format"]
+# WebApp Open Format
+ArOZ Online WebApps sometime will be required to open files / folders from file explorer or Desktop module. There are three main way to open an WebApp on any viewing interface on this system.
+
+1. Direct Open Mode - Open directly like a webpage.
+2. FloatWindow Open Mode - Open with FloatWindow.php with module defined launching parameters
+3. Embedded Open Mode - Open a given file or folder with filepath and filename parameters
+
+## Opening Modes
+### Direct Open Mode
+This opening mode is straight forward. The user's browser will be redirected to the index.html or index.php of the module's root and like a normal websites, there is nothing special other than checking for VDI Mode and hide the buttons / functions that might accidentally bring the user back into the grid menu.
+
+### FloatWindow Open Mode
+FloatWindow Open Mode / fwMode is the method in which Desktop calls while launching an WebApp using Desktop Icons. This function is provided by the "FloatWindow.php" function inside the WebApp root and the php file will be loaded into an iframe hidden in the Function Bar interface. The php should create a FloatWindow using Function Bar build in floatWindow control API. 
+
+Here is an example for the FloatWindow.php
+
+```
+<?php
+include_once '../auth.php';
+?>
+<html>
+<body>
+Now Loading...
+<script src="FloatWindow.js"></script>
+<script>
+var uid = (new Date()).getTime();
+var fw = new FloatWindow("index.php?mode=fw","Audio","music", uid,545,765,undefined,undefined,undefined,true);
+fw.launch();
+</script>
+</body>
+</html>
+```
+
+Here is an example of FloatWindow.js 
+
+```
+class FloatWindow {
+  constructor(src, title, iconTag="folder", uid ,ww=undefined, wh=undefined, posx=undefined, posy=undefined, resizable=true, glassEffect=false) {
+	this.src =  location.href.replace(/[^/]*$/, '') + src;
+	this.title = title;
+	this.iconTag = iconTag;
+	this.uid = uid;
+    this.ww = ww;
+    this.wh = wh;
+	this.posx = posx;
+	this.posy = posy;
+	this.resizable = resizable;
+	this.glassEffect = glassEffect;
+  }
+  
+  // Method
+  launch() {
+    parent.newEmbededWindow(this.src,this.title,this.iconTag,this.uid,this.ww,this.wh,this.posx,this.posy,this.resizable,this.glassEffect);
+	//console.log(this.src,this.title,this.iconTag,this.uid,this.ww,this.wh,this.posx,this.posy,this.resizable,this.glassEffect);
+  }
+}
+```
+
+More detail information of floatWindow launching can be found in "Float Window" page.
+
+### Embedded Open Mode
+Embedded Open Mode (or in another commonly known term: Open {...} with {...}) is a function that allow users to open a file with a module.
+This function require two script: ```index.php``` and ```embedded.php```. Developers can use either one of them to perform the external file opening request. In most case, there are two opening method.
+
+#### Opening Embedded Mode in Virtual Desktop Mode
+Under VDI Mode, the opening of files on Desktop will require ```embedded.php``` for launching.
+The filename and filepath can be get from two get variable ```filename``` and ```filepath```. 
+
+- filename: The filename in human-readable format. This might sometime be empty and for reference only.
+- filepath: The relative path of the file located from the /AOR. 
+
+Here is an example php section to receive the filename and filepath from the launching paramter.
+
+```
+<?php
+$filepath = "";
+$filename = "";
+if (isset($_GET['filepath'])){
+	$filepath = str_replace("./","",str_replace("../","",str_replace("\\","/",$_GET['filepath'])));
+}
+if (isset($_GET['filename'])){
+	$filename = $_GET['filename'];
+}
+?>
+```
+
+If you prefer using a seperate php to handle external file inputs, you can program the handling interface in embedded.php and add the following code in index.php to redirect any File Explorer open-with request to the embedded.php.
+
+```
+if (isset($_GET['filepath'])){
+	header("Location: embedded.php?filepath=" . $_GET['filepath']);
+}
+
+```
+
+#### Open-With on File Explorer
+If the user request embedded open mode in File Explorer, the request will be sent to index.php instead of embedded.php. In this case, the user can choose to redirect the request to embedded.php or handle the request in index.php. In most case, we recommended redirect the request either from index.php to embedded.php or from embedded.php to index.php as this will reduce the development cost of the WebApp.
+
+However, it is worth notice that in most case, users will launch WebApps in either VDI mode or Normal Mode in which in both opening case, the developer should check for VDI Mode for arranging the WebApp interface.
+
+#### Background Worker (Deprecated)
+Provide background worker function with ```backgroundworker.php```. This access method is no longer used since BETA phrase.
+
+### Pass-in Access Path
+The filepath paramter will provide the file location in **relative to /AOR or absolute path from /media/**. Your WebApp module might recive one of the three types of incoming filepaths.
+
+1. Internal Filepath, start with ```./``` (aka /AOR), e.g. ```./Audio/uploads/test.mp3```
+2. External Filepath with extDiskAccess handler, start with ```./SystemAOB/functions/extDiskAccess.php?file=...```
+3. External Filepath without extDiskAccess handler, e.g. ```/media/storage1/test.mp3```
+
+For type 1 and 2, you can directly load them to the user by putting the filepath in ```src``` elements.
+However, for type 3 filepaths, you will need to call to the External Disk Handler using ```./SystemAOB/functions/extDiskAccess.php?file=``` and follow by the absolute of the file. 
+
+
+

+ 3 - 0
docs/lang/dev-en-HK/5.md

@@ -0,0 +1,3 @@
+["File System API"]
+# File System API
+ArOZ Online File System is the core of the whole cloud software system as it provide all the fundemental functions that is required for all WebApp modules.