Removal of suburb lookup

Dear Forum Members,

My clinic is based in the UK and the addressing system over here is rather different to the Australian one. In searching the forums I have found several references to internationalisation of the addressing system in openvpms but as far as I can see these have not been implemented.

In adapting openvpms to my proposed use I wish simply to have a free form suburb state and postcode fields with no lookup or validation.

I have attempted perhaps naively to achieve this by commenting out the assertion in suburb and state nodes of contact.location.adl before reloading this file (through the gui). I did not remove the lookup.suburb.adl file as again naively assumed removing the assertion would stop the lookup being referenced. However I am now recieveing the error:

 

Caused by: org.apache.commons.jxpath.JXPathInvalidAccessException: Cannot invoke public java.lang.String org.openvpms.component.business.service.archetype.ArchetypeServiceFunctions.lookup(org.openvpms.component.model.object.IMObject,java.lang.String); Invalid or no valid lookup assertion for node suburb.

 

Could someone give me a tip as to how to completely remove this lookup association in the contact.location?

 

Kind regards

 

Chris

Comment viewing options

Select your preferred way to display the comments and click "Save settings" to activate your changes.

Re: Removal of suburb lookup

You also need to update the description node to remove the openvpms:lookup() call.

E.g.

concat(expr:concatIf(/details/address, ' '),expr:concatIf(/details/suburb,' '),expr:concatIf(/details/postCode, ' '),party:getContactPurposes())

 

 

Note that there are various APIs which expect these nodes to be lookups, and will break if they aren't present. E.g.:

 

Re: Removal of suburb lookup

Hi Tim,

Thanks for that.

I've made changes to the files you suggested. All compiles fine but fails with a null pointer at run time (excerpt of stack trace below).

I was looking at running the webapp from within intelliJ using mvn:jetty run as you suggest in the developer section so that I can put in some breakpoints. Jetty fails to find the jdbc driver.

Could you point me at the correct way to have jetty find the jdbc connector (is it a question of altering the pom.xml to list it as a dependency?)

And might you have a clue from the stack trace where it might be falling over? Does the process after login find all the practice details? Might I have missed an addressformat call somewhere in this initial stage?

 

 Authentication event InteractiveAuthenticationSuccessEvent: admin; details: org.springframework.security.web.authentication.WebAuthenticationDetails@fffd148a: RemoteIpAddress: 127.0.0.1; SessionId: 3F5EB8CB6A046BA0D301DA4534074325
[ERROR,SpringWebContainerServlet,http-nio-8080-exec-1 - admin] null
java.lang.NullPointerException: null
    at org.openvpms.component.business.service.archetype.helper.AbstractNodePropertySet.getArchetype(AbstractNodePropertySet.java:109) ~[openvpms-framework-2.2.3-SNAPSHOT.jar:2.2.3-SNAPSHOT]
    at org.openvpms.component.business.service.archetype.helper.AbstractNodePropertySet.getNode(AbstractNodePropertySet.java:126) ~[openvpms-framework-2.2.3-SNAPSHOT.jar:2.2.3-SNAPSHOT]
    at org.openvpms.component.business.service.archetype.helper.AbstractNodePropertySet.get(AbstractNodePropertySet.java:84) ~[openvpms-framework-2.2.3-SNAPSHOT.jar:2.2.3-SNAPSHOT]
    at org.openvpms.component.system.common.util.AbstractPropertySet.get(AbstractPropertySet.java:251) ~[openvpms-framework-2.2.3-SNAPSHOT.jar:2.2.3-SNAPSHOT]
    at org.openvpms.component.system.common.util.AbstractPropertySet.getInt(AbstractPropertySet.java:99) ~[openvpms-framework-2.2.3-SNAPSHOT.jar:2.2.3-SNAPSHOT]

 

Many thanks

 

Kind regards

 

Chris

Re: Removal of suburb lookup

Can you include the full stack to aid diagnosis?

Jetty should find the JDBC driver without any intervention on your part.
 

You can debug the webapp from within IntelliJ as follows:

1. Go to the Maven panel
2. Click on > OpenVPMS Web App
3. Click on > Plugins
4. Click on > jetty
4. Right click on jetty:run and select Debug

You can debug from the command line as follows:

> cd openvpms-web/openvpms-web-app
> mvnDebug jetty:run

You then need to connect IntelliJ to that as follows:
1. Go to Run - Edit Configurations
2. Click + to add a new configuration
3. Select Remote JVM Debug (may be Remote in earlier IntelliJ versions)
4. Enter a name for the configuration (e.g remote)
5. Enter the Transport and Address corresponding to that displayed by mvnDebug
6. Click OK
7. Select the new configuration from the dropdown
8. Click the Debug button
 

 

Re: Removal of suburb lookup

Thanks for that Tim, I'll give that a try over the weekend. If I continue to have trouble with jetty not finding the mysql driver could you tell me where the pom.xml file in the web-app finds the following variables under the maven jetty plugin section.

<dependencies>
                    <dependency>
                        <groupId>${jdbc.groupId}</groupId>
                        <artifactId>${jdbc.artifactId}</artifactId>
                        <version>${jdbc.version}</version>
                    </dependency>
 </dependencies>

 

I'm concerned that I'm not doing something or don't have something configured correctly that the jetty plugin isn't finding this information.

 

Chris

Re: Removal of suburb lookup

They are defined in the root pom.xml.

In IntelliJ, you can press Ctrl-B on a pom variable and it will jump to where it is defined.
So, in openvpms-web/openvpms-web-app/pom.xml, to find where ${jdbc.artifactId} is defined, move the cursor to the j and press Ctrl-B.

You can also use Find in Files. In the Project window, right click on the project root directory and select Find in Files. Enter <jdbc.artifactId> in the search area.

Finally, it sounds like you have changed your pom.xml files. You can compare any file with the checked-in version by right clicking on it, and selecting Git -> Show Diff. If you have commited changes, you can view the history by selecting Git -> Show History.

 

Syndicate content