New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

LBAC-13 Added implementation to create RefApp location glopal property #19

Merged
merged 1 commit into from Jul 27, 2018

Conversation

Projects
None yet
2 participants
@suthagar23
Member

suthagar23 commented Jul 26, 2018

Description

This PR contains the implementation to create the refapp location global propery while starting the module.

Ticket Information

Ticekt : https://issues.openmrs.org/browse/LBAC-13

Suthagar23
LBAC-13 Added implementation to create RefApp location glopal property
LBAC-13 Added implementation to create RefApp location glopal property
@@ -14,4 +14,6 @@
public static final String LOCATION_ATTRIBUTE_GLOBAL_PROPERTY_NAME = "locationbasedaccess.locationAttributeUuid";
public static final String LOCATION_USER_PROPERTY_NAME = "locationUuid";
public static final String REF_APP_LOCATION_USER_PROPERTY_NAME = "referenceapplication.locationUserPropertyName";

This comment has been minimized.

@dkayiwa

dkayiwa Jul 27, 2018

Member

Of what value is this GP when you expect the user property to be named as "locationUuid"?

@dkayiwa

dkayiwa Jul 27, 2018

Member

Of what value is this GP when you expect the user property to be named as "locationUuid"?

This comment has been minimized.

@suthagar23

suthagar23 Jul 27, 2018

Member

exactly "locationUuid" as the GP value

@suthagar23

suthagar23 Jul 27, 2018

Member

exactly "locationUuid" as the GP value

This comment has been minimized.

@dkayiwa

dkayiwa Jul 27, 2018

Member

We do not do global properties for fixed values that we know. Otherwise, of what value would the gp be?

@dkayiwa

dkayiwa Jul 27, 2018

Member

We do not do global properties for fixed values that we know. Otherwise, of what value would the gp be?

This comment has been minimized.

@suthagar23

suthagar23 Jul 27, 2018

Member

So can we move the locationUserProperty to a global property name as "locationbasedaccess.locationUserPropertyName"? So the userProperty name also will be fetched from the GP, and use that same value to this RefApp GP as well?

@suthagar23

suthagar23 Jul 27, 2018

Member

So can we move the locationUserProperty to a global property name as "locationbasedaccess.locationUserPropertyName"? So the userProperty name also will be fetched from the GP, and use that same value to this RefApp GP as well?

This comment has been minimized.

@dkayiwa

dkayiwa Jul 27, 2018

Member

What do you think? What are the pros and cons of either side?

@dkayiwa

dkayiwa Jul 27, 2018

Member

What do you think? What are the pros and cons of either side?

This comment has been minimized.

@suthagar23

suthagar23 Jul 27, 2018

Member

No need to create new one, Will reopen this : https://issues.openmrs.org/browse/LBAC-2

@suthagar23

suthagar23 Jul 27, 2018

Member

No need to create new one, Will reopen this : https://issues.openmrs.org/browse/LBAC-2

This comment has been minimized.

@suthagar23

suthagar23 Jul 27, 2018

Member

We decided to drop this idea and go with it for now. So are there any more comments?

@suthagar23

suthagar23 Jul 27, 2018

Member

We decided to drop this idea and go with it for now. So are there any more comments?

This comment has been minimized.

@dkayiwa

dkayiwa Jul 27, 2018

Member

So what are you using the gp for?

@dkayiwa

dkayiwa Jul 27, 2018

Member

So what are you using the gp for?

This comment has been minimized.

@suthagar23

suthagar23 Jul 27, 2018

Member

We need this to connect our module with RefApp module without any direct coupling. Since both need this userPropertyName. So we can connect them through this GP.
Otherwise we need to hardcode this value in both module.

@suthagar23

suthagar23 Jul 27, 2018

Member

We need this to connect our module with RefApp module without any direct coupling. Since both need this userPropertyName. So we can connect them through this GP.
Otherwise we need to hardcode this value in both module.

This comment has been minimized.

@dkayiwa

dkayiwa Jul 27, 2018

Member

Got you! 😊

@dkayiwa

dkayiwa Jul 27, 2018

Member

Got you! 😊

@@ -45,6 +47,18 @@ public void willStart() {
* @see ModuleActivator#started()
*/
public void started() {
String locationUserPropertyName = Context.getAdministrationService().getGlobalProperty(LocationBasedAccessConstants.REF_APP_LOCATION_USER_PROPERTY_NAME);
if(StringUtils.isBlank(locationUserPropertyName)) {
Context.getAdministrationService().setGlobalProperty(LocationBasedAccessConstants.REF_APP_LOCATION_USER_PROPERTY_NAME,

This comment has been minimized.

@dkayiwa

dkayiwa Jul 27, 2018

Member

If you expect the value to be LocationBasedAccessConstants.LOCATION_USER_PROPERTY_NAME, then why are you doing a gp for it?

@dkayiwa

dkayiwa Jul 27, 2018

Member

If you expect the value to be LocationBasedAccessConstants.LOCATION_USER_PROPERTY_NAME, then why are you doing a gp for it?

This comment has been minimized.

@suthagar23

suthagar23 Jul 27, 2018

Member

The reason was, in our module, we can use this LocationBasedAccessConstants.LOCATION_USER_PROPERTY_NAME.
But in the RefApp module, it should be decoupled to use another property names for different usages. So I used the RefApp GP to track that value, and for only our module I used this.

@suthagar23

suthagar23 Jul 27, 2018

Member

The reason was, in our module, we can use this LocationBasedAccessConstants.LOCATION_USER_PROPERTY_NAME.
But in the RefApp module, it should be decoupled to use another property names for different usages. So I used the RefApp GP to track that value, and for only our module I used this.

@dkayiwa dkayiwa merged commit ecfa6c7 into openmrs:master Jul 27, 2018

1 check passed

continuous-integration/travis-ci/pr The Travis CI build passed
Details
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment