Downloads Documentation Community Contribute Demo






Show Sidebar
Login | Register

Changeset 5324

Show
Ignore:
Timestamp:
08/20/08 20:27:40 (3 months ago)
Author:
bwolfe
Message:

occ: Fixed concept search order
Fixed main page multiple name search
Made concept pages available to anonymous users

Files:

Legend:

Unmodified
Added
Removed
Modified
Copied
Moved
  • openmrs-contrib/occ/src/main/java/org/openmrs/occ/dao/hibernate/ConceptDaoHibernate.java

    r5085 r5324  
    1616import java.util.Collections; 
    1717import java.util.List; 
     18import java.util.Vector; 
    1819 
    1920import org.hibernate.Criteria; 
     
    8182                List<Integer> occConceptIds = getHibernateTemplate().findByCriteria(crit); 
    8283                 
     84                // if we didn't find any concept ids, return an empty list of concepts 
     85                if (occConceptIds.size() == 0) { 
     86                        return new Vector<Concept>(); 
     87                } 
     88                 
    8389                // get a new criteria object so we can do the query and restrict  
    8490                // on the concept ids; 
     
    137143        crit.createAlias("names", "names"); 
    138144         
    139                 if (search != null && !search.equals("")) 
    140                         crit.add(Expression.like("names.name", search, MatchMode.ANYWHERE)); 
     145                if (search != null && !search.equals("")) { 
     146                        for (String searchPart : search.split(" ")) { 
     147                                String trimmedPart = searchPart.trim(); 
     148                                if (trimmedPart.length() > 0) 
     149                                        crit.add(Expression.like("names.name", trimmedPart, MatchMode.START)); 
     150                        } 
     151                } 
    141152                 
    142153                if (sources != null) 
  • openmrs-contrib/occ/src/main/java/org/openmrs/occ/web/ConceptFormController.java

    r5160 r5324  
    2828import org.apache.commons.logging.Log; 
    2929import org.apache.commons.logging.LogFactory; 
    30 import org.openmrs.occ.OccConstants; 
    3130import org.openmrs.occ.model.Concept; 
    3231import org.openmrs.occ.model.ConceptDescription; 
     
    9089                        if (newConcept == null) 
    9190                                newConcept = oldConcept; 
    92                         return new ModelAndView(new RedirectView(getFormView().toLowerCase() + ".html?occConceptId=" + newConcept.getOccConceptId())); 
     91                         
     92                        return new ModelAndView(new RedirectView("conceptform.html?occConceptId=" + newConcept.getOccConceptId())); 
    9393                } 
    9494 
  • openmrs-contrib/occ/src/main/java/org/openmrs/occ/web/admin/MapConceptsFormController.java

    r5160 r5324  
    7979             
    8080    } 
     81         
     82        protected boolean isFormSubmission(HttpServletRequest request) { 
     83                return !request.getParameterMap().isEmpty(); 
     84        } 
    8185 
    8286        /** 
     
    135139                 
    136140                int page = OccWebUtil.getPage(request); 
    137         int pagesize = 10; // must match the pagesize set in display:tag 
     141        int pagesize = 50; // must match the pagesize set in display:tag 
    138142                 
    139143                // do the actual search 
  • openmrs-contrib/occ/src/main/resources/log4j.xml

    r5085 r5324  
    4141    </logger> 
    4242    
    43     <logger name="org.appfuse"> 
     43    <logger name="org.hibernate.util"> 
    4444        <level value="DEBUG"/> 
    4545    </logger> 
  • openmrs-contrib/occ/src/main/webapp/WEB-INF/security.xml

    r5085 r5324  
    99        <intercept-url pattern="/**/*.html*" access="ROLE_USER" /> 
    1010        <intercept-url pattern="/admin/*" access="ROLE_USER" /> 
     11        <intercept-url pattern="/concepts.html*" filters="none"/> 
     12        <intercept-url pattern="/conceptform.html*" filters="none"/> 
    1113        <intercept-url pattern="/signup.html" filters="none"/> 
    1214        <intercept-url pattern="/localeform.html" filters="none"/> 
  • openmrs-contrib/occ/src/main/webapp/admin/mapconceptsform.jsp

    r5085 r5324  
    3232                <td> 
    3333                        <spring:bind path="command.selectedSources"> 
     34                                <input type="hidden" name="_${status.expression}" > 
    3435                                <select name="${status.expression}" size="3" multiple> 
    3536                                        <c:forEach var="source" items="${sources}"> 
     
    7879 
    7980<display:table name="concepts" class="table" requestURI="" 
    80         id="conceptRow" export="false" pagesize="10" sort="external
     81        id="conceptRow" export="false" pagesize="50" sort="external" excludedParams="*
    8182        decorator="conceptDecorator" partialList="true" size="resultSize"> 
    8283 
  • openmrs-contrib/occ/src/main/webapp/concepts.jsp

    r5085 r5324  
    33<title><fmt:message key="conceptList.title" /></title> 
    44 
    5 <form action="concept.html" method="get"><fmt:message 
     5<form action="concepts.html" method="get"><fmt:message 
    66        key="concept.searchPhrase" />: <input type="text" id="searchPhrase" 
    77        name="searchPhrase" size="18" value="${fn:escapeXml(param.searchPhrase)}"> <fmt:message