Skip to content

Commit

Permalink
Config
Browse files Browse the repository at this point in the history
  • Loading branch information
slominskir committed Jan 17, 2025
1 parent f4408a7 commit cc737b3
Show file tree
Hide file tree
Showing 4 changed files with 20 additions and 4 deletions.
3 changes: 3 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -76,6 +76,9 @@ Uses the [Smoothness Environment Variables](https://github.com/JeffersonLab/smoo
| JAM_EXPIRED_SUBJECT | Subject of emails indicating expiration of permissions and control verifications (ops semi-synchrounous notification of expiration) |
| JAM_DOWNGRADED_SUBJECT | Subject of emails indicating downgrade of control verifications |
| JAM_EMAIL_SENDER | Sender (and from address) of emails |
| JAM_COMPONENT_DETAIL_URL | URL for Component detail linking. Example: https://ace.jlab.org/srm/reports/component?name= |
| JAM_COMPONENT_QUERY_URL | URL for Component search. Proxied. Example: https://ace.jlab.org/srm/data/components |
| JAM_USER_QUERY_URL | URL for User search. Proxied. Example: https://ace.jlab.org/srm/ajax/search-user |

### Database
This application requires an Oracle 18+ database with the following [schema](https://github.com/JeffersonLab/jam/tree/main/container/oracle/initdb.d) installed. The application server hosting this app must also be configured with a JNDI datasource.
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -43,7 +43,12 @@ protected void doGet(HttpServletRequest request, HttpServletResponse response)

String q = request.getParameter("q");

String COMPONENT_QUERY_URL = "https://ace.jlab.org/srm/data/components";
// https://ace.jlab.org/srm/data/components
String COMPONENT_QUERY_URL = System.getenv("JAM_COMPONENT_QUERY_URL");

if(COMPONENT_QUERY_URL == null) {
throw new ServletException("JAM_COMPONENT_QUERY_URL not set");
}

ParamBuilder builder = new ParamBuilder();
builder.add("q", q);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,9 @@
import javax.servlet.http.HttpServlet;
import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpServletResponse;
import javax.xml.registry.infomodel.User;

import org.jlab.smoothness.business.exception.UserFriendlyException;
import org.jlab.smoothness.presentation.util.ParamBuilder;
import org.jlab.smoothness.presentation.util.ServletUtil;

Expand Down Expand Up @@ -43,7 +46,12 @@ protected void doGet(HttpServletRequest request, HttpServletResponse response)

String q = request.getParameter("q");

String USER_QUERY_URL = "https://ace.jlab.org/srm/ajax/search-user";
// https://ace.jlab.org/srm/ajax/search-user
String USER_QUERY_URL = System.getenv("JAM_USER_QUERY_URL");

if(USER_QUERY_URL == null) {
throw new ServletException("JAM_USER_QUERY_URL not set");
}

ParamBuilder builder = new ParamBuilder();
builder.add("term", q);
Expand Down
4 changes: 2 additions & 2 deletions src/main/webapp/WEB-INF/views/credited-controls.jsp
Original file line number Diff line number Diff line change
Expand Up @@ -136,7 +136,7 @@
<span class="small-icon baseline-small-icon not-verified-icon"></span>
</c:otherwise>
</c:choose>
<a href="${env['SRM_COMPONENT_URL']}${fn:escapeXml(component.name)}"><c:out value="${component.name}"/></a>
<a href="${env['JAM_COMPONENT_DETAIL_URL']}${fn:escapeXml(component.name)}"><c:out value="${component.name}"/></a>
</div>
</c:forEach>
</td>
Expand Down Expand Up @@ -307,7 +307,7 @@
<div class="column">
<fieldset>
<legend>Add</legend>
<input type="text" id="component" name="component" placeholder="search for name"/>
<input type="text" id="component" name="component" placeholder="search for name" autocomplete="off"/>
<button id="add-component-button" type="button">Add</button>
</fieldset>
</div>
Expand Down

0 comments on commit cc737b3

Please sign in to comment.