You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@ofbiz.apache.org by jl...@apache.org on 2014/11/19 17:27:49 UTC
svn commit: r1640588 - in /ofbiz/trunk/framework: base/config/
entity/src/org/ofbiz/entity/util/ entityext/src/org/ofbiz/entityext/data/
start/src/org/ofbiz/base/start/
Author: jleroux
Date: Wed Nov 19 16:27:49 2014
New Revision: 1640588
URL: http://svn.apache.org/r1640588
Log:
Inconsistencies related to the "java -jar ofbiz.jar" commands when used with arguments https://issues.apache.org/jira/browse/OFBIZ-5872
The help gives you:
c:\projectsASF\ofbiz>java -jar ofbiz.jar -help
Usage: java -jar ofbiz.jar [command] [arguments]
-both -----> Run simultaneously the POS (Point of Sales) application and OFBiz standard
-help, -? ----> This screen
-install -----> Run install (create tables/load data)
-pos -----> Run the POS (Point of Sales) application
-setup -------> Run external application server setup
-start -------> Start the server
-status ------> Status of the server
-shutdown ----> Shutdown the server
-test --------> Run the JUnit test script
[no config] --> Use default config
[no command] -> Start the server w/ default config
But actually only the -help, -status and -shutdown command need a dash.
For now we decided to change the documentation generated by the help command to remove dashes when they are not needed.
To change
-install -----> Run install (create tables/load data)
by
-load-data -----> Create tables/load data
To comment out the
-setup -------> Run external application server setup
line
When done, we will try to have things consistent and re-add the missing dashes to the commands and in the help. Then the "Technical production setup guide" should be updated, pfew...
Added:
ofbiz/trunk/framework/start/src/org/ofbiz/base/start/load-data.properties
- copied, changed from r1640559, ofbiz/trunk/framework/start/src/org/ofbiz/base/start/install.properties
Removed:
ofbiz/trunk/framework/start/src/org/ofbiz/base/start/install.properties
Modified:
ofbiz/trunk/framework/base/config/ofbiz-containers.xml
ofbiz/trunk/framework/entity/src/org/ofbiz/entity/util/EntityDataLoader.java
ofbiz/trunk/framework/entityext/src/org/ofbiz/entityext/data/EntityDataLoadContainer.java
ofbiz/trunk/framework/start/src/org/ofbiz/base/start/Start.java
Modified: ofbiz/trunk/framework/base/config/ofbiz-containers.xml
URL: http://svn.apache.org/viewvc/ofbiz/trunk/framework/base/config/ofbiz-containers.xml?rev=1640588&r1=1640587&r2=1640588&view=diff
==============================================================================
--- ofbiz/trunk/framework/base/config/ofbiz-containers.xml (original)
+++ ofbiz/trunk/framework/base/config/ofbiz-containers.xml Wed Nov 19 16:27:49 2014
@@ -22,7 +22,7 @@ under the License.
xsi:noNamespaceSchemaLocation="http://ofbiz.apache.org/dtds/ofbiz-containers.xsd">
<!-- load the ofbiz component container (always first) -->
- <container name="component-container" loaders="main,rmi,pos,install" class="org.ofbiz.base.container.ComponentContainer"/>
+ <container name="component-container" loaders="main,rmi,pos,load-data" class="org.ofbiz.base.container.ComponentContainer"/>
<container name="component-container-test" loaders="test" class="org.ofbiz.base.container.ComponentContainer">
<property name="ofbiz.instrumenterClassName" value="org.ofbiz.base.config.CoberturaInstrumenter"/>
Modified: ofbiz/trunk/framework/entity/src/org/ofbiz/entity/util/EntityDataLoader.java
URL: http://svn.apache.org/viewvc/ofbiz/trunk/framework/entity/src/org/ofbiz/entity/util/EntityDataLoader.java?rev=1640588&r1=1640587&r2=1640588&view=diff
==============================================================================
--- ofbiz/trunk/framework/entity/src/org/ofbiz/entity/util/EntityDataLoader.java (original)
+++ ofbiz/trunk/framework/entity/src/org/ofbiz/entity/util/EntityDataLoader.java Wed Nov 19 16:27:49 2014
@@ -237,7 +237,7 @@ public class EntityDataLoader {
return 0;
}
- Debug.logVerbose("[install.loadData] Loading XML Resource: \"" + dataUrl.toExternalForm() + "\"", module);
+ Debug.logVerbose("[loadData] Loading XML Resource: \"" + dataUrl.toExternalForm() + "\"", module);
try {
/* The OLD way
@@ -256,7 +256,7 @@ public class EntityDataLoader {
reader.setMaintainTxStamps(maintainTxs);
rowsChanged += reader.parse(dataUrl);
} catch (Exception e) {
- String xmlError = "[install.loadData]: Error loading XML Resource \"" + dataUrl.toExternalForm() + "\"; Error was: " + e.getMessage();
+ String xmlError = "[loadData]: Error loading XML Resource \"" + dataUrl.toExternalForm() + "\"; Error was: " + e.getMessage();
errorMessages.add(xmlError);
Debug.logError(e, xmlError, module);
}
@@ -287,7 +287,7 @@ public class EntityDataLoader {
toBeStored.add(delegator.makeValue("SecurityGroupPermission", "groupId", "FULLADMIN", "permissionId", baseName + "_ADMIN"));
rowsChanged += delegator.storeAll(toBeStored);
} catch (GenericEntityException e) {
- errorMessages.add("[install.generateData] ERROR: Failed Security Generation for entity \"" + baseName + "\"");
+ errorMessages.add("[generateData] ERROR: Failed Security Generation for entity \"" + baseName + "\"");
}
/*
Modified: ofbiz/trunk/framework/entityext/src/org/ofbiz/entityext/data/EntityDataLoadContainer.java
URL: http://svn.apache.org/viewvc/ofbiz/trunk/framework/entityext/src/org/ofbiz/entityext/data/EntityDataLoadContainer.java?rev=1640588&r1=1640587&r2=1640588&view=diff
==============================================================================
--- ofbiz/trunk/framework/entityext/src/org/ofbiz/entityext/data/EntityDataLoadContainer.java (original)
+++ ofbiz/trunk/framework/entityext/src/org/ofbiz/entityext/data/EntityDataLoadContainer.java Wed Nov 19 16:27:49 2014
@@ -94,7 +94,7 @@ public class EntityDataLoadContainer imp
ServiceDispatcher.enableSvcs(false);
/*
- install arguments:
+ load-data arguments:
readers (none, all, seed, demo, ext, etc - configured in entityengine.xml and associated via ofbiz-component.xml)
timeout (transaction timeout default 7200)
delegator (overrides the delegator name configured for the container)
@@ -103,8 +103,11 @@ public class EntityDataLoadContainer imp
file (import a specific XML file)
Example:
- $ java -jar ofbiz.jar -install -readers=seed,demo,ext -timeout=7200 -delegator=default -group=org.ofbiz
- $ java -jar ofbiz.jar -install -file=/tmp/dataload.xml
+ $ java -jar ofbiz.jar -load-data -readers=seed,demo,ext -timeout=7200 -delegator=default -group=org.ofbiz
+ $ java -jar ofbiz.jar -load-data -file=/tmp/dataload.xml
+ Currently no dashes before load-data, see OFBIZ-5872
+ $ java -jar ofbiz.jar load-data -readers=seed,demo,ext -timeout=7200 -delegator=default -group=org.ofbiz
+ $ java -jar ofbiz.jar load-data -file=/tmp/dataload.xml
*/
if (args != null) {
for (String argument: args) {
@@ -174,8 +177,10 @@ public class EntityDataLoadContainer imp
createConstraints = true;
}
} else if ("help".equalsIgnoreCase(argumentName)) {
+ //"java -jar ofbiz.jar -load-data [options]\n" +
+ // Currently no dashes before load-data, see OFBIZ-5872
String helpStr = "\n--------------------------------------\n" +
- "java -jar ofbiz.jar -install [options]\n" +
+ "java -jar ofbiz.jar load-data [options]\n" +
"-component=[name] .... only load from a specific component\n" +
"-delegator=[name] .... use the defined delegator (default-no-eca)\n" +
"-group=[name] ........ override the entity group (org.ofbiz)\n" +
@@ -203,6 +208,7 @@ public class EntityDataLoadContainer imp
/**
* @see org.ofbiz.base.container.Container#start()
*/
+ @Override
public boolean start() throws ContainerException {
if("all-tenants".equals(this.overrideDelegator)) {
if (!EntityUtil.isMultiTenantEnabled()) {
@@ -577,9 +583,11 @@ public class EntityDataLoadContainer imp
/**
* @see org.ofbiz.base.container.Container#stop()
*/
+ @Override
public void stop() throws ContainerException {
}
+ @Override
public String getName() {
return name;
}
Modified: ofbiz/trunk/framework/start/src/org/ofbiz/base/start/Start.java
URL: http://svn.apache.org/viewvc/ofbiz/trunk/framework/start/src/org/ofbiz/base/start/Start.java?rev=1640588&r1=1640587&r2=1640588&view=diff
==============================================================================
--- ofbiz/trunk/framework/start/src/org/ofbiz/base/start/Start.java (original)
+++ ofbiz/trunk/framework/start/src/org/ofbiz/base/start/Start.java Wed Nov 19 16:27:49 2014
@@ -74,19 +74,20 @@ public final class Start {
}
private static void help(PrintStream out) {
+ // Currently some commands have no dash, see OFBIZ-5872
out.println("");
out.println("Usage: java -jar ofbiz.jar [command] [arguments]");
- out.println("-both -----> Run simultaneously the POS (Point of Sales) application and OFBiz standard");
+ out.println("both -----> Runs simultaneously the POS (Point of Sales) application and OFBiz standard");
out.println("-help, -? ----> This screen");
- out.println("-install -----> Run install (create tables/load data)");
- out.println("-pos -----> Run the POS (Point of Sales) application");
- out.println("-setup -------> Run external application server setup");
- out.println("-start -------> Start the server");
- out.println("-status ------> Status of the server");
- out.println("-shutdown ----> Shutdown the server");
- out.println("-test --------> Run the JUnit test script");
- out.println("[no config] --> Use default config");
- out.println("[no command] -> Start the server w/ default config");
+ out.println("load-data -----> Creates tables/load data, eg: load-data -readers=seed,demo,ext -timeout=7200 -delegator=default -group=org.ofbiz. Or: load-data -file=/tmp/dataload.xml");
+ out.println("pos -----> Runs the POS (Point of Sales) application");
+ //out.println("-setup -------> Run external application server setup");
+ out.println("start -------> Starts the server");
+ out.println("-status ------> Gives the status of the server");
+ out.println("-shutdown ----> Shutdowns the server");
+ out.println("test --------> Runs the JUnit test script");
+ out.println("[no config] --> Uses default config");
+ out.println("[no command] -> Starts the server with default config");
}
public static void main(String[] args) throws StartupException {
Copied: ofbiz/trunk/framework/start/src/org/ofbiz/base/start/load-data.properties (from r1640559, ofbiz/trunk/framework/start/src/org/ofbiz/base/start/install.properties)
URL: http://svn.apache.org/viewvc/ofbiz/trunk/framework/start/src/org/ofbiz/base/start/load-data.properties?p2=ofbiz/trunk/framework/start/src/org/ofbiz/base/start/load-data.properties&p1=ofbiz/trunk/framework/start/src/org/ofbiz/base/start/install.properties&r1=1640559&r2=1640588&rev=1640588&view=diff
==============================================================================
--- ofbiz/trunk/framework/start/src/org/ofbiz/base/start/install.properties (original)
+++ ofbiz/trunk/framework/start/src/org/ofbiz/base/start/load-data.properties Wed Nov 19 16:27:49 2014
@@ -28,7 +28,7 @@
# --- StartupLoader implementations to load (in order)
ofbiz.start.loader1=org.ofbiz.base.container.ContainerLoader
-ofbiz.start.loader1.loaders=install
+ofbiz.start.loader1.loaders=load-data
# -- Enable the shutdown hook
#ofbiz.enable.hook=false