Skip to content
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

Prov 103:Provider Management UI crashes when we select provider from search result on openmrs platform 2.x.x #47

Closed
wants to merge 35 commits into from
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
35 commits
Select commit Hold shift + click to select a range
3085d83
PROV-103: added a conditional resource to load the NameSupport class …
josephbate Nov 3, 2022
ca18092
more changesin the ProviderManagementActivator to test whether the o…
josephbate Nov 15, 2022
76e8d3a
using java reflection to load the class
josephbate Nov 18, 2022
151358d
my third commit
josephbate Jan 30, 2023
28113a3
my final commit
josephbate Feb 1, 2023
ae537e7
cleaning up and doing backward compatibility
josephbate Feb 9, 2023
3e3b91a
final clean up and backward compatibility
josephbate Feb 10, 2023
0155b32
cleaning up
josephbate Feb 15, 2023
3009579
cleaning up 2
josephbate Feb 15, 2023
e0182c3
rremoving ReflectString.java
josephbate Feb 15, 2023
d56f6eb
cleaning up
josephbate Feb 15, 2023
15cb82f
cleaning
josephbate Feb 15, 2023
0a4101b
reformatting the code
josephbate Feb 15, 2023
721c688
clean
josephbate Feb 16, 2023
209a1ae
clean up
josephbate Feb 16, 2023
cd585a3
clean
josephbate Feb 16, 2023
492870f
clean
josephbate Feb 16, 2023
2e216f5
cleaning
josephbate Feb 16, 2023
2d9e86e
formatting PersonName.java
josephbate Feb 21, 2023
79d7459
final commit
josephbate Feb 21, 2023
d4e05db
edited commit
josephbate Oct 15, 2023
88dae7a
Merge remote-tracking branch 'origin/PROV-103' into PROV-103
josephbate Oct 15, 2023
ddef0be
cleaning up the code
josephbate Oct 15, 2023
4e20d3a
improving on java docs
josephbate Oct 18, 2023
b5e83a5
editing java docs give more info
josephbate Nov 2, 2023
14d33cc
Correcting version
josephbate Nov 2, 2023
645eebe
to solves errors
josephbate Nov 2, 2023
c2d83c9
clean version
josephbate Nov 2, 2023
fb0b080
version for omod pom.xml
josephbate Nov 2, 2023
746194f
cleaning
josephbate Nov 2, 2023
2f23926
Merge pull request #1 from openmrs/master
josephbate Nov 8, 2023
340bfe9
Revert "Prov 103 [issue](https://issues.openmrs.org/browse/PROV-103)…
dkayiwa Nov 8, 2023
c74cde1
Merge branch 'PROV-103' of https://github.com/josephbate/openmrs-modu…
josephbate Nov 9, 2023
3675b42
a clean commit
josephbate Nov 9, 2023
3fe5860
minor changes
josephbate Nov 12, 2023
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion api/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@
<parent>
<groupId>org.openmrs.module</groupId>
<artifactId>providermanagement</artifactId>
<version>2.15.0-SNAPSHOT</version>
<version>2.14.0-SNAPSHOT</version>
</parent>

<artifactId>providermanagement-api</artifactId>
Expand Down
2 changes: 1 addition & 1 deletion omod/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@
<parent>
<groupId>org.openmrs.module</groupId>
<artifactId>providermanagement</artifactId>
<version>2.15.0-SNAPSHOT</version>
<version>2.14.0-SNAPSHOT</version>
</parent>

<artifactId>providermanagement-omod</artifactId>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -14,13 +14,45 @@

package org.openmrs.module.providermanagement.fragment.controller;

import org.openmrs.layout.web.name.NameSupport;
import java.lang.reflect.Method;

import org.openmrs.ui.framework.fragment.FragmentModel;

public class PersonNameFragmentController {

public void controller(FragmentModel model) {
model.addAttribute("layoutTemplate", NameSupport.getInstance().getDefaultLayoutTemplate());
}
/**
* Controller method to retrieve the layout template and add it to the model.
*
* @param model The fragment model to which the layout template will be added.
* @throws Exception If there are any issues during reflection or if the layout template retrieval fails.
*/

public void controller(FragmentModel model) throws Exception{
Class<?> nameSupport;

try {
// Attempt to load the NameSupport class from org.openmrs.layout.name
nameSupport = Class.forName("org.openmrs.layout.name.NameSupport");
} catch (ClassNotFoundException e) {
// If the NameSupport class is not found in org.openmrs.layout.name, try loading it from org.openmrs.layout.web.name
nameSupport = Class.forName("org.openmrs.layout.web.name.NameSupport");
}

if (nameSupport == null) {
// If the NameSupport class couldn't be loaded, return.
return;
}

// Use reflection to invoke the "getInstance" method.
Method getInstance = nameSupport.getDeclaredMethod("getInstance");
Object instance = getInstance.invoke(null);

// Use reflection to invoke the "getDefaultLayoutTemplate" method.
Method getLayoutTemplate = nameSupport.getMethod("getDefaultLayoutTemplate");
Object layoutTemplate = getLayoutTemplate.invoke(instance);

// Add the layoutTemplate to the model.
model.addAttribute("layoutTemplate", layoutTemplate);

}
}
2 changes: 1 addition & 1 deletion pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@

<groupId>org.openmrs.module</groupId>
<artifactId>providermanagement</artifactId>
<version>2.15.0-SNAPSHOT</version>
<version>2.14.0-SNAPSHOT</version>
<packaging>pom</packaging>
<name>Provider Management Module</name>
<description>Allows for the creation of provider roles, as well as the management of provider/provider and provider/patient relationships.</description>
Expand Down
Loading