In previous posts, we looked at comparing the Alfresco Development Framework (ADF) to OpenContent Management Suite (OCMS), specifically the search, contributor, and folder interfaces. For this post, we are going to turn our attention to building an application on each of these platforms. Specifically, we’ll look at how clients can build an Alfresco search interface.
Building a Search Interface with ADF
Being a development framework, there are a number of routes to take in order to build a search interface. We could start completely from scratch, building an AngularJS application and utilizing ADF components from where needed. Or, we could clone one of the provided demo applications and start modifying it as needed. At the time of this writing, there are two demo applications provided by Alfresco. One is the demo shell application that is part of the core ADF “Alfresco NG2 Components” codebase. This application is more of a developer resource vs. a user-focused application, so developers that start here will likely need to modify a great deal. Another application available is the Alfresco Example Content Application, which doesn’t have as many features as the demo shell application but is much more user focused. We would predict that Alfresco will add features to the example content application as time goes on.
ADF Demo Application:
Example Content Application:
Given that most organizations want to start with “out of the box”, we would anticipate that most ADF applications will start by simply cloning one of these examples. Both the demo shell and the content application put the primary search focus on the “Google” style header search bar. As previously mentioned in our ADF Search comparison and Share search comparison posts, this type of search isn’t very practical for most ECM use cases.
For clients that want to have a search that’s targeted to a particular object type and allows users to narrow down results based on metadata, a developer would need to build a search interface from scratch utilizing ADF components. Fortunately, the demo shell application has a very simple example that the developer can start from. In the left hand navigation bar, there’s a section titled “Extended Search”. An ADF application developer could use this section to guide in building the search interface. In the Extended Search view, a single textbox allows for the user to enter search criteria:
The field consists of the following html, from search-extended.component.html:
<div id="container-for-custom-input" class="search-extended-input-containers"> <mat-form-field> <label>{{'APP_LAYOUT.WORD_TO_SEARCH' | translate}}</label> <input type="text" matInput id="custom-input" [(ngModel)]="searchedWord" [searchAutocomplete]="auto"> </mat-form-field> </div>
While the demo shell application only provides for one input, the developer could utilize this code to build other fields for the user to enter multiple pieces of metadata.
Once the user hits enter, TypeScript code in search-extended.component.ts kicks off the search:
generateQueryBody(searchTerm: string): QueryBody { if (this.useServiceApproach) { return null; } else { return { query: { query: searchTerm ? `${searchTerm}* OR name:${searchTerm}*` : searchTerm }, include: ['path', 'allowableOperations'], filterQueries: [ /*tslint:disable-next-line */ { query: "TYPE:'cm:folder' OR TYPE:'cm:content'" }, { query: 'NOT cm:creator:System' }] }; } }
In the above code, the developer would tweak the search term as well as add additional filters in the filterQueries section for custom metadata as well as a type specification. After the query executes, the results are placed in an <adf-search> component that is found in search-extended.component.html.
One benefit of the ADF is that since it is a development framework, the system can look and behave exactly as required by the business users. The example applications provide a head start, provided that the applications are acceptable to the business users without extensive modifications. However, at least some level of development is required, and an extensive development effort may be needed depending on user requirements. Additionally, components are ‘configurable’ through code only. Any update to the requirements (ex: modifications to search criteria, adding another document type for searching) require code updates and redeployment across all environments.
Building a Search Interface with OCMS
The OpenContent Management Suite takes a different approach to building the search application. Instead of a development framework, the OpenContent Search module is configured in the administration components using a GUI interface. Here’s an example search interface that can be configured in OCMS:
Here are the configurations that an administrator can make in order to build the search interface:
- Object Type Config – Tells OCMS what repository object types are to be exposed in the application. Per type, the administrator can change any attribute labels as well as filters.
- Search Form – Configure the form for a particular object type search. The administrator can choose particular metadata fields and controls, whether or not full text search is available, and whether or not saved searches should be exposed.
- Search Config – Configure the search sort order and results processing. This is where the administrator can choose how the results table should look, any actions that can be performed on the documents, as well as what happens when the user clicks on a search result.
- Trac Config – The concept of a ‘Trac’ allows OCMS to segment the application based on business function. For example, an Invoice trac could be used for Accounts Payable, and a separate Legal trac could be configured for contracts. Security can be applied to ensure that these two tracs are separate if desired. Once the Search config is configured in the previous step, we assign it to a trac.
Since the above concepts can be difficult to envision, here’s a demo video that shows how to configure a search in OCMS from scratch:
In utilizing the OpenSearch application to build our search interface, no development time is required. Once OCMS is installed, a configuration-only approach is taken to build the interface. If users want updates to the search (additional types, metadata, etc) or new departments want to come online with new document types, no additional development is needed. The application can be configured and updated with no downtime since no deployments are necessary to update and apply configurations.
Summary
OpenContent Management Suite is a configurable application that TSG has been improving over the years at many of our clients, incorporating best practices into the product as it has evolved. For clients that choose to develop an application from scratch using ADF, we would encourage the implementation of our search best practices in these applications.
[…] Changes are immediately reflected in the user interface with no application downtime. Since the above concepts can be difficult to envision, here’s a demo video that shows how to configure a search in OCMS from scratch: […]