[Title] Edit web-template script
authorBon-Yong Lee <bonyong.lee@samsung.com>
Sun, 9 Dec 2012 02:23:00 +0000 (11:23 +0900)
committerBon-Yong Lee <bonyong.lee@samsung.com>
Sun, 9 Dec 2012 02:23:00 +0000 (11:23 +0900)
[Desc.]
[Issue]

org.tizen.cli/doc/install/bin_/common.sh
org.tizen.cli/doc/install/bin_/web-template
org.tizen.cli/doc/install/bin_/web-template.bat [changed mode: 0644->0755]
org.tizen.cli/doc/install/realm/config.json
org.tizen.cli/src/org/tizen/cli/exec/AbstractLauncher.java
org.tizen.cli/src/org/tizen/cli/exec/template/ClientMain.java

index 9d9ef65..8c0e8f6 100755 (executable)
@@ -13,6 +13,7 @@ done
 CLASSPATH=$DIR_CONFIG:$JAR
 
 OPT_LOGGING="-Dlog4j.configuration=log4j.xml"
+OPT_DIR_HOME="-Dcli.home=`readlink -f $DIR_HOME`"
 OPT_PRG_NAME="-Dcli.name=$SCRIPT"
 
 READ_ARG="n"
@@ -36,7 +37,7 @@ for WORD in $@; do
         esac
 done
 
-OPT="$OPT_TRACE $OPT_LOGGING $OPT_PRG_NAME"
+OPT="$OPT_TRACE $OPT_LOGGING $OPT_DIR_HOME $OPT_PRG_NAME"
 
 escapeSpace() {
     echo "$(printf "%s" "$ARG"| sed 's/\\/\\\\/g' | sed 's/\"/\\"/g' )"
index d45e24f..9d1167e 100755 (executable)
@@ -24,7 +24,8 @@ for ARG in "$@" ; do
     ARGS="$ARGS $(escapeSpace $ARG)"
 done
 
-OPT="$OPT -Dtizen.template.realm=file:///$DIR_REALM/config.json"
+TIZEN_TEMPLATE_REALM="-Dtizen.template.realm=file://`readlink -f $DIR_HOME`/realm/config.json"
+OPT="$OPT $TIZEN_TEMPLATE_REALM"
 
 EXEC="java -cp $CLASSPATH $OPT $MAIN $ARGS"
 
old mode 100644 (file)
new mode 100755 (executable)
index 67ca299..e2e3e54
@@ -25,7 +25,7 @@ set READ_ARG=n
 
 FOR %%W IN ( %* ) DO ( call:parseArg %%W )
 
-set OPT=%OPT_TRACE% %OPT_LOGGING% %OPT_PRG_NAME% -Dtizen.template.realm=file:///$DIR_REALM\realm\config.json
+set OPT=%OPT_TRACE% %OPT_LOGGING% %OPT_PRG_NAME% -Dtizen.template.realm=file://%CLI_HOME%\realm\config.json
 set EXEC=java -cp %CLI_HOME%\conf -Djava.ext.dirs=%CLI_HOME%\lib %OPT% %MAIN% %*
 
 IF NOT "" == "%OPT_TRACE%" ( echo Command :%EXEC% )
index 18c4bf9..1cbdb78 100755 (executable)
@@ -1,7 +1,7 @@
 {\r
     "id": "tizen-standard-realm",\r
-    "loader": "file:///$DIR_REALM/realm.jar",\r
-    "template-query-url": "file:///$DIR_REALM/template/$${id}.jar",\r
+    "loader": "file://$${CLI_HOME}/realm/realm.jar",\r
+    "template-query-url": "file://$${CLI_HOME}/realm/template/$${id}.jar",\r
     "search-query-type": "directory",\r
-    "search-query-url": "file:///$DIR_REALM/template"\r
+    "search-query-url": "file://$${CLI_HOME}/realm/template"\r
 }
\ No newline at end of file
index 1eac558..b7bedc8 100755 (executable)
@@ -308,13 +308,14 @@ AbstractLauncher
        )
        throws Exception
        {
-           Preference.register( "", new EnvironmentProvider() );
-           Preference.register( "", new SystemPropertiesProvider() );
+           Preference.register( "OS", new EnvironmentProvider() );
+           Preference.register( "JVM", new SystemPropertiesProvider() );
                executor = new CommandLineExecutor(
                        new ConsolePrompter( System.out, new InputStreamReader( System.in ) )
                );
                if ( logger.isTraceEnabled() )
                {
+                   logger.trace( "OS Environment :\n{}", MapUtil.toString( System.getenv() ) );
                        logger.trace( "System properties :\n{}", MapUtil.toString( System.getProperties() ) );
                        logger.trace( "Args :{}", CollectionUtil.concatenate( Arrays.asList( args ), "," ) );
                }
index 823cf77..39e69d9 100755 (executable)
@@ -38,9 +38,11 @@ import org.tizen.cli.command.PluginConstants;
 import org.tizen.cli.command.SearchTemplate;\r
 import org.tizen.cli.exec.AbstractLauncher;\r
 import org.tizen.cli.exec.ILaunchOptions;\r
+import org.tizen.cli.util.TemplateModelProvider;\r
 import org.tizen.common.config.Preference;\r
 import org.tizen.common.verrari.Realm;\r
 import org.tizen.common.verrari.RealmFactory;\r
+import org.tizen.common.verrari.TemplateContext;\r
 \r
 /**\r
  * Command Line Interface to create from template\r
@@ -112,6 +114,8 @@ implements ILaunchOptions
             return ;\r
         }\r
         \r
+        TemplateContext.getInstance().setModelProvider( new TemplateModelProvider( getExecutionContext() ) );\r
+        \r
         final URL url = new URL( urlStr );\r
         Realm realm = null;\r
         try\r