From 4d8086b0b1c95b79f8ef4ec65b9d11e853a78224 Mon Sep 17 00:00:00 2001 From: Cho Woongsuk Date: Thu, 16 Jul 2015 18:54:05 +0900 Subject: [PATCH] add launch_mode and reload for web configuration editor Change-Id: I6880a969f13544e297da22d591ce578e7cd088d7 Signed-off-by: Cho Woongsuk --- .../html/web_tools/config_editor_w.htm | 76 +++++++++++++++++++--- .../html/web/tizen/application/application_w.htm | 24 +++++++ 2 files changed, 91 insertions(+), 9 deletions(-) diff --git a/org.tizen.devtools/html/web_tools/config_editor_w.htm b/org.tizen.devtools/html/web_tools/config_editor_w.htm index bd5ba25..e22c169 100644 --- a/org.tizen.devtools/html/web_tools/config_editor_w.htm +++ b/org.tizen.devtools/html/web_tools/config_editor_w.htm @@ -491,11 +491,27 @@

Expected children:

Example:

<tizen:app-control>
-   <tizen:src name="view.html"/>
+   <tizen:src name="view.html" reload="disable"/>
    <tizen:operation name="http://tizen.org/appcontrol/operation/view"/>
    <tizen:uri name="http"/>
    <tizen:mime name="image/jpeg"/>
@@ -521,9 +537,21 @@
        
  • id

    Mandatory; Tizen application ID, which is a combination of the Tizen package ID and project name. The application ID is unique in the device.

    The project name is a set of characters (0~9, a~z, A~Z) randomly generated by the SDK. The minimum value is 1 byte and maximum value is 52 bytes.

  • package

    Mandatory; Tizen package ID generated by the SDK, comprises of 10 characters (0~9, a~z, A~Z). The package ID is unique in the Tizen Store.

  • required_version

    Mandatory; Tizen API version required for running the Web application

  • +
  • launch_mode

    Optional; Sets what launch mode can be supported (available values: single(default), group, caller)

    o single: launched as a main application

    o group: launched as a sub application

    o caller: caller application defines the launch mode with the app_control_set_launch_mode() function

    Since: 2.4

  • + + + + + + + + + +
    Note
    The launch_mode attribute is supported from Tizen 2.4 onwards. If the required_version in the config.xml file of an application is set to a version before Tizen 2.4, and the launch_mode attribute is used, the application will fail to install.

    Example:

    <tizen:application id="1234abcDEF.projectname"
                        package="1234abcDEF"
    -                   required_version="2.1" />

    +                   required_version="2.4" +                   launch_mode="caller" />

    @@ -784,7 +812,18 @@
  • id

    Mandatory; Tizen application ID, which is a combination of the Tizen wearable package ID and project name. The application ID is unique in the device.

    The project name is a set of characters (0~9, a~z, A~Z) randomly generated by the SDK. The minimum value is 1 byte and maximum value is 52 bytes.

  • package

    Mandatory; Tizen wearable package ID generated by the SDK, comprises of 10 characters (0~9, a~z, A~Z). The package ID is unique in the Samsung Apps.

  • required_version

    Mandatory; Tizen API version required for running the Web application

  • -
  • ambient_support

    Optional; Sets whether the Web application supports the ambient mode (available values: enable, disable (default))

    If this option is enabled, the application can be shown in the ambient mode.

  • +
  • launch_mode

    Optional; Sets what launch mode can be supported (available values: single(default), group, caller)

    o single: launched as a main application

    o group: launched as a sub application

    o caller: caller application defines the launch mode with the app_control_set_launch_mode() function

    Since: 2.4
  • + + + + + + + + + +
    Note
    The launch_mode attribute is supported from Tizen 2.4 onwards. If the required_version in the config.xml file of an application is set to a version before Tizen 2.4, and the launch_mode attribute is used, the application will fail to install.
    +
  • ambient_support

    Optional; Sets whether the Web application supports the ambient mode (available values: enable, disable (default))

    If this option is enabled, the application can be shown in the ambient mode.

    Since: 2.3.1
  • @@ -793,14 +832,17 @@ + + +
    The ambient_support option is only used for watch applications, and ignored in all non-watch applications.
    The ambient_support attribute is supported from Tizen 2.3.1 onwards. If the required_version in the config.xml file of an application is set to a version before Tizen 2.3.1, and the ambient_support attribute is used, the application will fail to install.

    Example:

    <tizen:application id="1234abcDEF.projectname"  
                        package="1234abcDEF"
    -                   required_version="2.1"
    +                   required_version="2.4"
    +                   launch_mode="caller"
                        ambient_support="enable" />

    - @@ -839,11 +881,27 @@

    Expected children:

    Example:

    <tizen:app-control>
    -   <tizen:src name="view.html"/>
    +   <tizen:src name="view.html" reload="disable"/>
        <tizen:operation name="http://tizen.org/appcontrol/operation/view"/>
        <tizen:uri name="http"/>
        <tizen:mime name="image/jpeg"/>
    @@ -1322,4 +1380,4 @@ var s = document.getElementsByTagName('script')[0]; s.parentNode.insertBefore(ga
     
     
     
    -
    \ No newline at end of file
    +
    diff --git a/org.tizen.guides/html/web/tizen/application/application_w.htm b/org.tizen.guides/html/web/tizen/application/application_w.htm
    index c870047..dfd7b4e 100644
    --- a/org.tizen.guides/html/web/tizen/application/application_w.htm
    +++ b/org.tizen.guides/html/web/tizen/application/application_w.htm
    @@ -430,6 +430,30 @@ var appControl = new tizen.ApplicationControl("http://tizen.org/appcontrol/
        <mime name="audio/*"/>
     </tizen:app-control>
    +

    Using "appcontrol" event instead of page reloading

    + +

    When a web application receives an application control request from another application, the receiving application finds the proper page for that request and loads that page. If the found page is already loaded and displayed, the page is reloaded (refreshed) to process the incoming application control request. However, in some case, a web application may handle an application control request without reloading the page in order to keep the previous context.

    +

    From Tizen 2.4 onwards, the web runtime provides a way to handle application control requests without page reloading by extending the <tizen:app-control> element of the config.xml file and sending a new appcontrol event to the receiving application.

    +

    The following code example demonstrates a service description in the config.xml file which can handle an image editing application control request and does not reload the web page.

    +
    +<tizen:app-control>
    +   <src name="edit.html" reload="disable"/>
    +   <operation name="http://tizen.org/appcontrol/operation/edit"/>
    +   <mime name="image/*"/>
    +</tizen:app-control>
    + +

    The reload attribute is newly added to the src element. The reload attribute is used to set whether the page should or should not be reloaded when an application control request is received. The reload attribute is optional and the default value is enable. If the reload attribute is not set in the src element, the default value is set to enable and the page will reload.

    +

    If the currently loaded page is selected by an incoming application control request, and the reload attribute of the service description is set to disable, then an appcontrol event is dispatched to that page instead of reloading that page. By using an appcontrol event listener, the web application can get the requested information by calling the getRequestedAppControl() method of the Application interface. An appcontrol event is only dispatched if the reload attribute of the service description is set to disable.

    +

    The following code example demonstrates adding an appcontrol event listener and handling an event:

    +
    +Window.addEventListener("appcontrol", function onAppControl()
    +{
    +   var reqAppControl = tizen.application.getCurrentApplication.getRequestedAppControl();
    +   if (reqAppControl)
    +   {
    +      // handle application control request
    +   }
    +});
    -- 2.7.4