Versions Compared

Key

  • This line was added.
  • This line was removed.
  • Formatting was changed.

...

  • Download from the module repository
  • Grant any required privileges
    • Manage Homepages: Users with this privilege will be able to configure what homepages are assigned to what roles
  • Configure global properties
    • rolebasedhomepage.defaultHomePage: If specified, this will be the default homepage for all users. If unspecified, it will default to a standard OpenMRS homepage

Administration:

...

All administration of Role-Based Homepages can be done via the "Manage Homepages" page, accessible from the Administration section

...

Manage Homepages:

Manage Homepages link helps in creating a new homepage, View the existing homepage or Edit the existing homepage for each role.

Create Using Portlets:

  • Create Using Portlets is used to create homepage using portlets.
  • In this process one can add the portlets from the existing portlets list.
  • Show preview enables to see the preview how the homepage appears.
  • Generate Homepage creates and saves the homepage.

Once the JSP homepage for that role is created the Create Using Portlets button will be disabled, and the Create Using HTML, Add URL, View & Edit buttons in Manage Homepages will be enabled.

Create Using HTML:

  • Create Using HTML is used to create homepage using HTML code.
  • In this process one can write the HTML/JSP code and portlet tags can also be used.
  • Show preview enables to see the preview how the homepage appears.
  • Generate Homepage creates and saves the homepage.

Once the HTML homepage for that role is created the Create Using HTML button will be disabled, and the Create Using Portlets, Add URL, View & Edit buttons in Manage Homepages will be enabled.

Add URL:

  • Add URL is used to point the homepage to an existing URL.
  • In this the home page points to the URL entered in the Redirection URL field.
  • Assign URL sets the url as the homepage

Once the URL is set as homepage for a role then the Add Url button will be disabled, and the Create Using Portlets, Create Using HTML, View & Edit buttons in Manage Homepages will be enabled.

View:

  • The View button will be enabled only once the role has a (any of the 3 types- using portlets, using html, url).
  • The view button enables the user to see the existing homepage for the selected role.

Edit:

  • The Edit button will be enabled once the role has a homepage (any of the 3 types- using portlets, using html, url).
  • If the homepage is created using portlets then the edit page will display all the portlets present in the existing homepage and the user to delete the existing portlets or add new portlets.
  • If the homepage is created using Html then the edit page will be the html edit in which the existing Html code for that homepage will be display.
  • If the homepage is using redirection url then the edit page will be url edit in which the existing url will be displayed.

Delete Homepages

  • Delete Homepages page displays the list of the roles and the type of existing homepage of that role.
  • To deleted the homepages select the homepages to be deleted and click Delete Homepage button.

Add from other modules during the creation of the module

  • The homepage for a role can be added from modules other than rolebasedhomepage by using the uploadHomepage() method present in RoleBasedHomePageService.
  • If the homepage is added using this method from other module and it is started, all the options (Create Using Portlets, Create Using HTML, Add URL, View, Edit) for that role under the Manage Homepages link are disabled.
  • Once this module is stopped or undeployed the Create Using Portlets, CreateHTML & Add URL buttons under the Manage Homepages link are enabled.
  • Method Syntax : uploadHomepage(String role,String htmlCode,String jspName,String url,String moduleId)

Set Homepage:

To set a homepage by using the JSP page, the parameters role, jspName, moduleId must be set with appropriate values and the parameters htmlCode, url must be null.

Example Method call:

Code Block

uploadHomepage(“Clinician”,null,”jsp_name”,nul,”module_id”);

To set a homepage by using the HTML code, the parameters role, htmlCode, moduleId must be set with appropriate values and the parameters jspName, url must be null.

Example Method call:

Code Block

uploadHomepage(“Clinician”,”html_code”,null,nul,”module_id”);

To set a homepage by using the JSP page, the parameters role, jspName, moduleId must be set with appropriate values and the parameters htmlCode, jspName must be null.

Example Method call:

...

. Within this page, you can view all of the current home pages by role. You can preview the home page for a particular role by clicking the "Preview" link next to a Role. You can also preview the home page that will appear for a particular user by entering a username in the supplied box and clicking the "Preview" button. You can edit the home page for a role by clicking on the Role name

Image Added

There are 2 means by which you can configure home pages. The first of these is to specify a URL within the system you wish to use. This can be any page supplied by core or by a module. As directed on the page, you should first navigate to the page you are interested in, and find the URL of this page in the browser. The page you navigate to will have a URL in the form of:

http://localhost:8080/openmrs/admin/index.htm

. The home page configuration for this page should be "admin/index.htm" (i.e. you would omit the

http://localhost:8080/openmrs/

part of the URL from the specification). An example of this is shown to the right.

Image Added