TechnologyRediscovery / codenforce

municipal code enforcement database application
GNU General Public License v3.0
2 stars 3 forks source link

CEAR Public Portal Resurrection #233

Open edarsow opened 1 year ago

edarsow commented 1 year ago

Project

CE Action Requests are submitted by public users OR internal users to ask a code officer to review a topic. The goal of this issue is to resurrect the first iteration of this tool that was wired to work with the legacy property and person table. We need to upgrade all CEAR infrastructure to work with our parcel and human tables and their associated objects.

Goal 2

Upgrade the internal management page called ceActionRequests.xhtml to work with the new objects, and to confirm to our new form standard, of which the propertyProfile.xhtml is an example.

Current state

There is a lovely public sequence for submitting the CEARs from the home page called "Submit a concern", but the property search tool is based on property not parcel so the search doesn't work right now, and I'd start with this.

Use the currently working INTERNAL property search as a stock for working search components. We'll need to be simpler on the public end, but the organs will be the same. See restricted/cogstaff/prop/compositions/propertySearch.xhtml : Note that internal search tools use a QueryXXX object that has inside of it a Query Enum, that represents a configuration of parameters to ask the user for and then these are passed into the searchForXXX method on the integrator.

For this public project, we just want to use the Enum value ADDRESS_BLDGANDSTREET for the public query. Follow these steps:

  1. Call initQuery() on the SearchCoordinator and you'll get back QueryProperty object which has in its belly a list of 1 or more SearchParam objects, which holds the actual search strings.
  2. The user fills in the values in the parameter object
  3. Send the query to the SearchCoordinator's runQuery() method
  4. You'll get back THE SAME query object and you can extract the results by calling getBOBResultList() and out comes a bunch of properties.

The public portal flow is located in /public/services/requestCEActionFlow and it is backed by cEActionRequestSubmitBB which likely will need a facelift. Check:

public users

All queries require a Credential, and a credential is only held by a UserAuhorized, so you'll need to ask the UserCoordinator for the Public user through its auth_getPublicUserAuthorized() method. Then you can ask this object for its Credential using either getKeyCard() or getMyCredential() and this is what you'll pass to the SearchCoordintor.

Be on the lookout for a permissions conflict from the SearchCoordinator who examines the queries. The QueryPropertyEnum stores a minimum rank for each query. You'll need to change the minimum rank for Building and Street to a public user.