From: Bon-Yong Lee Date: Sun, 9 Dec 2012 02:23:00 +0000 (+0900) Subject: [Title] Edit web-template script X-Git-Url: http://review.tizen.org/git/?a=commitdiff_plain;h=7c62d39fde4994ebd0577d337bff9d981b38f9f0;p=sdk%2Ftools%2Fcli.git [Title] Edit web-template script [Desc.] [Issue] --- diff --git a/org.tizen.cli/doc/install/bin_/common.sh b/org.tizen.cli/doc/install/bin_/common.sh index 9d9ef65..8c0e8f6 100755 --- a/org.tizen.cli/doc/install/bin_/common.sh +++ b/org.tizen.cli/doc/install/bin_/common.sh @@ -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' )" diff --git a/org.tizen.cli/doc/install/bin_/web-template b/org.tizen.cli/doc/install/bin_/web-template index d45e24f..9d1167e 100755 --- a/org.tizen.cli/doc/install/bin_/web-template +++ b/org.tizen.cli/doc/install/bin_/web-template @@ -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" diff --git a/org.tizen.cli/doc/install/bin_/web-template.bat b/org.tizen.cli/doc/install/bin_/web-template.bat old mode 100644 new mode 100755 index 67ca299..e2e3e54 --- a/org.tizen.cli/doc/install/bin_/web-template.bat +++ b/org.tizen.cli/doc/install/bin_/web-template.bat @@ -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% ) diff --git a/org.tizen.cli/doc/install/realm/config.json b/org.tizen.cli/doc/install/realm/config.json index 18c4bf9..1cbdb78 100755 --- a/org.tizen.cli/doc/install/realm/config.json +++ b/org.tizen.cli/doc/install/realm/config.json @@ -1,7 +1,7 @@ { "id": "tizen-standard-realm", - "loader": "file:///$DIR_REALM/realm.jar", - "template-query-url": "file:///$DIR_REALM/template/$${id}.jar", + "loader": "file://$${CLI_HOME}/realm/realm.jar", + "template-query-url": "file://$${CLI_HOME}/realm/template/$${id}.jar", "search-query-type": "directory", - "search-query-url": "file:///$DIR_REALM/template" + "search-query-url": "file://$${CLI_HOME}/realm/template" } \ No newline at end of file diff --git a/org.tizen.cli/src/org/tizen/cli/exec/AbstractLauncher.java b/org.tizen.cli/src/org/tizen/cli/exec/AbstractLauncher.java index 1eac558..b7bedc8 100755 --- a/org.tizen.cli/src/org/tizen/cli/exec/AbstractLauncher.java +++ b/org.tizen.cli/src/org/tizen/cli/exec/AbstractLauncher.java @@ -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 ), "," ) ); } diff --git a/org.tizen.cli/src/org/tizen/cli/exec/template/ClientMain.java b/org.tizen.cli/src/org/tizen/cli/exec/template/ClientMain.java index 823cf77..39e69d9 100755 --- a/org.tizen.cli/src/org/tizen/cli/exec/template/ClientMain.java +++ b/org.tizen.cli/src/org/tizen/cli/exec/template/ClientMain.java @@ -38,9 +38,11 @@ import org.tizen.cli.command.PluginConstants; import org.tizen.cli.command.SearchTemplate; import org.tizen.cli.exec.AbstractLauncher; import org.tizen.cli.exec.ILaunchOptions; +import org.tizen.cli.util.TemplateModelProvider; import org.tizen.common.config.Preference; import org.tizen.common.verrari.Realm; import org.tizen.common.verrari.RealmFactory; +import org.tizen.common.verrari.TemplateContext; /** * Command Line Interface to create from template @@ -112,6 +114,8 @@ implements ILaunchOptions return ; } + TemplateContext.getInstance().setModelProvider( new TemplateModelProvider( getExecutionContext() ) ); + final URL url = new URL( urlStr ); Realm realm = null; try