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"
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' )"
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"
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% )
{\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
)
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 ), "," ) );
}
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
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