Difference between revisions of "HOWTOs and FAQs"
(→FAQs) |
(→Steps - Windows (version 3.4.0s)) |
||
Line 71: | Line 71: | ||
This is to make sure that no activity is occurring in the database and you get a complete backup. | This is to make sure that no activity is occurring in the database and you get a complete backup. | ||
2. Open a CLI (command line) | 2. Open a CLI (command line) | ||
− | 3. Navigate to the folder with the script. | + | 3. Navigate to the folder with the script. |
− | 4. Execute in the CLI, | + | CD %ADEMPIERE_HOME%\utils |
+ | 4. Execute in the CLI, | ||
+ | RUN_DBExport | ||
+ | |||
This will provide some feedback in the CLI. | This will provide some feedback in the CLI. | ||
− | 5. Navigate to the Data folder, | + | 5. Navigate to the Data folder, |
− | 6. Execute | + | CD %ADEMPIERE_HOME%\data |
+ | 6. Execute | ||
+ | DIR | ||
7. Two files should be created, | 7. Two files should be created, | ||
- ExpDat.dmp | - ExpDat.dmp |
Revision as of 00:40, 23 June 2008
Contents
HOWTOs
Creating Alert
https://sourceforge.net/forum/message.php?msg_id=3938031 By: avdalen
I struggled with creating an Alert but now that I have it working, I would like to give a couple of pointers for anyone else who is trying it.
Pre-Requisites
- Emailing must be working. Navigate to General Rules→Client Rules→Client to review, setup and test.
Example 1
- Log in as an admin (or role with appropriate access)
- Navigate to Performance Analysis→Performance Measurement→Alert
- Create a new record, name it Orders (or anything you prefer)
- Select an existing alert processor or create a new one. This alert processor is the component that will send emails the actual emails.
- Enter subject and alert message
- Mark as Valid
- Save record
Alert Rule Tab
- Create a new record, name it Orders Alert (or anything you prefer)
- In the sqlSelect field enter
- "C_ORDER_ID","DOCUMENTNO","DOCSTATUS","TOTALLINES","GRANDTOTAL"
- In the sqlFrom field enter
- C_ORDER
- In the sqlWhere field enter
- ISACTIVE='Y' and ISSOTRX='Y'
- Mark as Valid
- Save record
Alert Recipient Tab
- Create a new record
- Select a User/Contact
- Save record
Testing the new Alert
Start the Application Server if not yet started.
Open compiereMonitor in a browser http://<your server>/compiereMonitor Navigate to the Alert processor that you assigned to your Alert. Click on run now
Navigate back to the Alert processor in the monitor and check the log.
If the alert failed, you would have to navigate back to the Alert window in compiere. Once the necessary corrections have been made, you have to mark the alert and alert rule as Valid again.
NOTE: Remember to restart the Application Server before you attempt to rerun the processor.
Example 2
Send an alert listing completed orders that are due for delivery within the next 7 days.
Create the Alert as per Example 1 above but this time assign the sqlWhere clause on the Alert Tab as:
- sqlWhere clause
- ISACTIVE='Y' and ISSOTRX='Y' and DOCSTATUS='CO' and ISDELIVERED='N' and DATEPROMISED between sysdate and (sysdate +7)
FAQs
RUN_DBExport (Backing Up Adempiere Database)
Adempiere has provided a script (bat / sh) file to perform the exporting of the Adempiere database.
The steps are based on version 3.4.0s. It should be the same on other versions of Adempiere.
Steps - Windows (version 3.4.0s)
1. Ensure you are logged out of Adempiere and the Service has been stopped.
This is to make sure that no activity is occurring in the database and you get a complete backup.
2. Open a CLI (command line) 3. Navigate to the folder with the script.
CD %ADEMPIERE_HOME%\utils
4. Execute in the CLI,
RUN_DBExport
This will provide some feedback in the CLI.
5. Navigate to the Data folder,
CD %ADEMPIERE_HOME%\data
6. Execute
DIR
7. Two files should be created,
- ExpDat.dmp - ExpDat<date&time>.jar
The JAR file is a JAVA compressed file of the "dmp" file. You can delete the ExpDat.dmp file.
Make sure, you backup the "ExpDat<date&time>.jar" in your regular backup cycle.
The "RUN_DBExport" will determine (from saved variables) what type of database you are running and then execute the appropriate "DBEXPORT" script file.
Note, you do not need to use the supplied "RUN_DBExport" script and could run your own preferred database export program.
Create new adempiere database with postgresql
These steps used Adempiere-316 with postgresql-8.1.4 and pljava-1.3 on Centos-4.4. A source rpm for postgresql is available (insert link here). I created a spec file for pljava (this wiki doesn't seem to allow source uploads).
1 - createuser -U postgres -s adempiere -P
- NOTE, adempiere user MUST have superuser privileges. It might be
- possible to create the database as another superuser, e.g. postgres.
2 - createdb adempiere -E UNICODE -O adempiere -U adempiere
- 2a - if pl/pgsql is not installed in template1,
createlang plpgsql -U postgres adempiere
- 2b - if pl/java is not installed in template1,
java org.postgresql.pljava.deploy.Deployer -install -database adempiere
- 2b might not actually be necessary. The next step will complain about
sqlj
being already installed.
3 - psql -d adempiere -U adempiere < Adempiere_pg.dmp > load.log
4 - review load.log if there are errors
5 - psql -d adempiere -U adempiere
- 5a -
select sqlj.install_jar('file:/C:/Adempiere/lib/sqlj.jar','sqlj',true);
- 5b -
SELECT sqlj.set_classpath('adempiere', 'sqlj');
- 5c -
SET search_path TO adempiere,public;
- 5d -
select bpartnerRemitLocation (118);
- 5d is for testing it must return 120, if it returns ok installation of db is completed before 1 and 2 you must drop user and/or database if created for 5a, you must change the path of sql.jar
6 - RUN_setup.sh as adempiere (may need to set XAUTHORITY).
- 6a -
mkdir $ADEMPIERE_HOME/jboss/server/adempiere/log
- ADEMPIERE_HOME *MUST* be $HOME/Adempiere. That is hard-wired in
- serverStart.sh somewhere. Trying to set it to $HOME/Adempiere-316, for
- instance gets
"tail: cannot open `/home/adempiere/Adempiere/jboss/server/adempiere/log/adempiere_20070403172701.log' for reading: No such file or directory"
- 6b - edit
$ADEMPIERE_HOME/jboss/server/adempiere/conf/jboss-service.xml
and add one to the port number forjboss:service=WebService
. Setup assigns the same port to both the web server and
web services - at least it did for me.
Can't access http://server_name:8080 from clients
I've installed Adempiere and I'm not able to connect to it using a windows xp client. From the server machine, going to http://server_name:8080 works and I see the webstart homepage. So does http://127.0.0.1:8080. But wont work if you try to access http://192.168.0.103:8080.
This problem can arise when the client can't resolve the name server_name. Workaround: Install RUN_Setup giving the IP address 192.168.0.103
Troubleshooting customizations
No Identifier records found
Error loading Lookup for a field, this error is shown in the console:
===========> MLookupFactory.getLookup_TableDir: No Identifier records found: CUST_Table
There are no identifier columns defined in CUST_Table. You must mark identifier columns with isIdentifier = 1, 2 ...
No query columns found
Error looking columns in fields of type Search, this error is shown in the console:
===========> InfoGeneral.initInfoTable: No query columns found
Adempiere tries to look String column that appears in any window, the following query is executed: SELECT c.columnname, t.ad_table_id, t.tablename FROM ad_table t INNER JOIN ad_column c ON (t.ad_table_id = c.ad_table_id) WHERE c.ad_reference_id = 10 AND t.tablename = ? -- // Displayed in Window AND EXISTS ( SELECT * FROM ad_field f WHERE f.ad_column_id = c.ad_column_id AND f.isdisplayed = 'Y' AND f.isencrypted = 'N' AND f.obscuretype IS NULL) -- // ORDER BY c.isidentifier DESC, c.seqno If the field is not displayed in any window, it's not taken as search column.
No Info for AD_Table_ID
Adempiere can't found information for a table,, this error is shown in the console: ===========> InfoGeneral.initInfoTable: No Info for AD_Table_ID=1000001 - SELECT ... [11]
Adempiere tries to look for columns that appears in the window associated to the table: SELECT t.ad_table_id, c.columnname, c.ad_reference_id, c.iskey, f.isdisplayed, c.ad_reference_value_id FROM ad_column c INNER JOIN ad_table t ON (c.ad_table_id = t.ad_table_id) INNER JOIN ad_tab tab ON (t.ad_window_id = tab.ad_window_id) INNER JOIN ad_field f ON (tab.ad_tab_id = f.ad_tab_id AND f.ad_column_id = c.ad_column_id) WHERE t.ad_table_id = ? AND (c.iskey = 'Y' OR (f.isencrypted = 'N' AND f.obscuretype IS NULL)) ORDER BY t.created DESC, c.iskey DESC, f.seqno
The following statement associates a window for tables without the association: UPDATE ad_table SET ad_window_id = (SELECT MIN (ad_window_id) FROM ad_tab WHERE ad_tab.ad_table_id = ad_table.ad_table_id) WHERE tablename LIKE 'DICB\_%' ESCAPE '\' AND ad_window_id IS NULL
Window
The history button is not getting active. What should be checked?
The history button is active only if:
- Is first tab selected
- The window type is transaction
- The table must have a Processed column
Development FAQ
Add an information message
ADialog.warn(WindowNo, new ConfirmPanel(),"Information message")
Where to put extensions
You should place your extensions in extend/src. You should define at least this one as Java Sources directory. Others as well if you change standard classes. For PO classes: Then respect coding conventions that can be found in M_Table.getClass(String) Basically : compiere.model.MThisIsMyTable for a table THIS_IS_MY_TABLE For Validation classes: Look at ModelValidationEngine() Define in your Client the field ModelValidationClasses with you validation classes. They must implement ModelValidator. Look at example MyValidator.
You can also define field level business logic using the callout mechanism. Your extension class must implement the Callout interface and then reference in the field setup screen. Make sure Eclipse is setup in Auto Compilation mode. Anyway, all this is based on Reflection so the only thing to make it work is that Eclipse find the classes at the right place.