U bent hier: Home > Blog > Java

Hibernate Search: AND functionaliteit


Erik Pelgrim, 19 april 2012
Dit is deel 4 van een reeks van 4 artikelen in de serie Hibernate Search

Mijn laatste blogpost “Hibernate Search: Aantal hits” ging over het tonen van het totaal aantal resultaten bij een persoon in de zoekfunctie. Een volgend probleem doet zich voor als in het beknopte overzicht de gebruiker de specifieke resultaten van een medewerker wil zien. Indien hij op de knop “details” klikt, ziet hij wel alle resultaten, maar moet hij daarin alsnog de specifieke medewerker opzoeken. Dit is niet echt gebruiksvriendelijk.

Het toevoegen van een zoekterm biedt hier een oplossing voor. Door AND en Medewerker te selecteren en in de zoekterm ‘Pelgrim’ in te vullen blijven alleen de resultaten van Erik Pelgrim over (screenshot). (meer…)

Hibernate Search: Aantal hits


Erik Pelgrim,
Dit is deel 3 van een reeks van 4 artikelen in de serie Hibernate Search

Mijn vorige post over Hibernate Search eindigde dat je zoekresultaten mbt tot verschillende Cv-onderdelen samen in een collectie kan bijhouden zodat ze ook samen in een resultaten tabel op het scherm komen.

Mocht je echter op een veelvoorkomende term zoeken komt er een erg lange lijst uit met veel medewerkers met per medewerker ook nog veel resultaten. Aangezien er maar een stuk of 10-20 resultaten tegelijk op het scherm komen, zie je van veel medewerkers helemaal niets en van sommige juist heel veel (zie screenshot). Dit geeft geen duidelijk overzicht van je zoekresultaat. Een oplossing hiervoor zou zijn om het totale aantal resultaten per medewerker te tonen. Dit is in Java op te lossen door een andere collectie aan te maken: een HashMap, gebaseerd op name value pairs, waar je per medewerker het aantal hits (resultaten) opslaat. (meer…)

Hibernate Search: zoeken op meerdere onderdelen


Erik Pelgrim,
Dit is deel 2 van een reeks van 4 artikelen in de serie Hibernate Search

In mijn vorige blogpost “Snel zoeken met Hibernate Search” werd Hibernate Search gepromoot, een technologie waarmee in het interne CV systeem genaamd Tracsy snelle zoekfunctionaliteit gemaakt is. In deze blogpost bespreek ik een zelfgeschreven uitbreiding op de basisfunctionaliteit.

Hibernate Search biedt alleen de mogelijkheid om op 1 java klasse tegelijkertijd te zoeken. Aangezien in Tracsy de java-objecten 1 op 1 overeenkomen met de CV onderdelen en database tabellen, kan er in principe maar op 1 onderdeel tegelijkertijd gezocht worden. Hibernate Search biedt wel de mogelijkheid om op meerdere velden (database kolommen) ineens te zoeken. Voor een Cv houdt dit in dat bijvoorbeeld op de velden “activiteit”, “omgeving” en “methodieken” van een projectervaring tegelijkertijd gezocht kan worden. Als resultaat van de zoekopdracht wordt een lijst met projectervaring objecten teruggegeven. Omdat alle Cv onderdelen een veld medewerker (via een foreign key) bevatten, kan bij alle zoekresultaten de naam van de betreffende medewerker getoond worden. (meer…)

Snel zoeken met Hibernate Search


Erik Pelgrim,
Dit is deel 1 van een reeks van 4 artikelen in de serie Hibernate Search

Intern bij Transfer is er een applicatie genaamd Tracsy waar alle medewerkers hun kennis en ervaring bijhouden. Dit is op de eerste plaats bedoeld om snel een actuele CV uit te kunnen draaien en naar de klant te sturen.

In een bedrijf als Transfer met meer dan 100 medewerkers levert dit meer informatie op dan managers en recruiters ten alle tijden paraat kunnen houden. Dit heeft als gevolg dat als er een opdracht binnenkomt niet altijd meteen met zekerheid ingeschat kan worden of iemand met de juiste kennis hiervoor beschikbaar is. Dit vraagt om functionaliteit waarin snel en eenvoudig personen opgezocht kunnen worden met specifieke kennis. Dit is in de applicatie gebouwd met Hibernate Search. (meer…)

ADF custom attribute validation in the Impl-class


Johan Tuitel, 17 februari 2012

The standard validation in ADF application is done by setting the attribute required. The disadvantage of this functionality, is that the validation is to early and not validating when a form is filled in. To do this we need to customize the validating of our application.

We can do this by validating the value in the Impl class of the Entity you use in the page.

1. Replace the required=”true” attribute on the input component into a showRequired=”true”, this can by jheadstart template or manually.

2. Open the Impl class and override the validateEntity() method

  protected void validateEntity() {
} (meer…)

ADF 11g: Create custom pending changes popup


Johan Tuitel,

In ADF applications we have a standard Pending Changes Popup. In this popup, the application handles the standard rollback of the record.

We found out that it is not work correctly for our application, therefore we need to create a custom Pending Changes Popup. (meer…)

Running ADF Application: Cannot read from policy store


Johan Tuitel,

When running an application ADF I get an error in the Weblogic server:

oracle.security.jps.JpsRuntimeException: Cannot read from policy store

Then you have a problem with the system-jazn-data.xml.

The system-jazn-data.xml is corrupt and you need to fix the corrupted xml file in your user map.

1. Find the system-jazn-data.xml file. I found it in:

jdevdata\system11.1.1.4.37.59.23\DefaultDomain\config\fmwconfig

But the system version is dependent of the version you use.

2. Make the file usable for the webserver, this can be done by setting the old content into the corrupted file or clean the file. My suggestion is to use old content because you don’t have any data loss, the old content can be found in de jdev11114 map.

Java with Spring/Hibernate, Simple Howto


Paul Boekschoten, 16 februari 2012

This item is to show how you can setup a Spring/Hibernate framework to communicate with your database and store and retrieve information.
The example does not show all the import statements and locations of the files as that is up to the programmer to decide and implement correctly.
At the bottom you will find a list of the used libraries and versions to get it all working.

Let’s start with the assumption we have an Oracle database in which we would like to store the details of a person.
For example: Name (string), hair color (string) and length (integer).
It is a simple database with only one table where this information is stored. (meer…)

Using CSS stylesheet to customize your application 11g


Johan Tuitel, 3 februari 2012

In my project, I needed to customize the ADF 11g application.

Here are the steps what you need to do to make use of CSS in you’re application

1. Create a xml-file called trinidad-skins.xml(if not present) in ViewController > Web Content > WEB-INF. (meer…)

Make use of custom ‘Number’ converter in ADF application with Jheadstart 11g


Johan Tuitel, 20 januari 2012

When we need to convert ‘Number’ values in the front-end, we have the standard:

<af:convertNumber />

But we want a custom converter for the number values in the application.

To do this for the whole application, we need to adjust the jag-config.xml.

1. Go to ViewController > Resources > config and open jag-config.xml.

2. Search for property name=”libraries” under this property you will find

<value>default/common/common_items.vm</value>

3. Replace this one with a custom reference e.g.

<value>UrgencyRequest/common/demo_items.vm</value>

4. Next is to make this new demo_items.vm template and copy the content from the original common_items.vm template to the new template.

5. Search for #macro (NUMBER_CONVERTER) and insert a custom converter:

<f:converter binding=”#{DemoNumberConverter}” />

Example:

  #macro (NUMBER_CONVERTER)
#if(${JHS.current.item.numberItem})
<f:converter binding=”#{DemoNumberConverter}” />
#end
#end

Eerdere artikelen »