public void onPostInsert( PostInsertEvent postInsertEvent ) { if ( !RuntimeConfig.getCurrentInstance( intactSession ).isSynchronizedSearchItems() ) { return; } Object obj = postInsertEvent.getEntity(); if ( obj instanceof AnnotatedObject ) { insertSearchItemForAnnotatedObject( ( AnnotatedObject ) obj, false ); } else if ( obj instanceof Xref ) { insertSearchItemForXref( ( Xref ) obj ); } else if ( obj instanceof Alias ) { insertSearchItemForAlias( ( Alias ) obj ); } else { return; } }
public boolean onPreDelete( PreDeleteEvent preDeleteEvent ) { if ( !RuntimeConfig.getCurrentInstance( intactSession ).isSynchronizedSearchItems() ) { return false; } Object obj = preDeleteEvent.getEntity(); if ( obj instanceof AnnotatedObject ) { deleteSearchItemsForAnnotatedObject( ( AnnotatedObject ) obj ); } else if ( obj instanceof Xref ) { deleteSearchItemForXref( ( Xref ) obj ); } else if ( obj instanceof Alias ) { deleteSearchItemForAlias( ( Alias ) obj ); } else { return false; } return false; }
public void onPostUpdate( PostUpdateEvent postUpdateEvent ) { if ( !RuntimeConfig.getCurrentInstance( intactSession ).isSynchronizedSearchItems() ) { return; } Object obj = postUpdateEvent.getEntity(); if ( obj instanceof AnnotatedObject ) { AnnotatedObject ao = ( AnnotatedObject ) obj; deleteSearchItemsForAnnotatedObject( ao ); insertSearchItemForAnnotatedObject( ao, true ); } else if ( obj instanceof Alias ) { Alias alias = ( Alias ) obj; deleteSearchItemsForAnnotatedObject( alias.getParent() ); insertSearchItemForAnnotatedObject( alias.getParent(), true ); } else if ( obj instanceof Xref ) { Xref xref = ( Xref ) obj; deleteSearchItemsForAnnotatedObject( xref.getParent() ); insertSearchItemForAnnotatedObject( xref.getParent(), true ); } else { return; } }