private void createIndex_Resource(ResourceDetail resource) {
    SilverTrace.info(
        "resourceManager",
        "resourceManagerBmEJB.createIndex_Resource()",
        "root.MSG_GEN_ENTER_METHOD",
        "resource = " + resource.toString());
    FullIndexEntry indexEntry = null;

    if (resource != null) {
      // Index the Reservation
      indexEntry = new FullIndexEntry(resource.getInstanceId(), "Resource", resource.getId());
      indexEntry.setTitle(resource.getName());
      indexEntry.setPreView(resource.getDescription());
      if (resource.getUpdateDate() != null) indexEntry.setCreationDate(resource.getUpdateDate());
      else indexEntry.setCreationDate(resource.getCreationDate());
      indexEntry.setCreationUser(resource.getCreaterId());

      String categoryId = resource.getCategoryId();
      if (StringUtil.isDefined(categoryId)) {
        CategoryDetail category = getCategory(categoryId);
        if (category != null) {
          String xmlFormName = category.getForm();
          if (StringUtil.isDefined(xmlFormName)) {
            // indéxation du contenu du formulaire XML
            String xmlFormShortName =
                xmlFormName.substring(xmlFormName.indexOf("/") + 1, xmlFormName.indexOf("."));
            PublicationTemplate pubTemplate;
            try {
              pubTemplate =
                  PublicationTemplateManager.getInstance()
                      .getPublicationTemplate(resource.getInstanceId() + ":" + xmlFormShortName);
              RecordSet set = pubTemplate.getRecordSet();
              set.indexRecord(resource.getId(), xmlFormName, indexEntry);
            } catch (Exception e) {
              throw new ResourcesManagerRuntimeException(
                  "ResourceManagerBmEJB.createIndex_Resource()",
                  SilverpeasRuntimeException.ERROR,
                  "resourcesManager.EX_CREATE_INDEX_FAILED",
                  e);
            }
          }
        }
      }

      IndexEngineProxy.addIndexEntry(indexEntry);
    }
  }
  private void createIndex_Category(CategoryDetail category) {
    SilverTrace.info(
        "resourceManager",
        "resourceManagerBmEJB.createIndex_Category()",
        "root.MSG_GEN_ENTER_METHOD",
        "category = " + category.toString());
    FullIndexEntry indexEntry = null;

    if (category != null) {
      indexEntry = new FullIndexEntry(category.getInstanceId(), "Category", category.getId());
      indexEntry.setTitle(category.getName());
      indexEntry.setPreView(category.getDescription());
      if (category.getUpdateDate() != null) indexEntry.setCreationDate(category.getUpdateDate());
      else indexEntry.setCreationDate(category.getCreationDate());
      indexEntry.setCreationUser(category.getCreaterId());
      IndexEngineProxy.addIndexEntry(indexEntry);
    }
  }
  private void createIndex(ReservationDetail reservation) {
    SilverTrace.info(
        "resourceManager",
        "resourceManagerBmEJB.createIndex()",
        "root.MSG_GEN_ENTER_METHOD",
        "reservation = " + reservation);
    FullIndexEntry indexEntry = null;

    if (reservation != null) {
      // Index the Reservation
      indexEntry =
          new FullIndexEntry(reservation.getInstanceId(), "Reservation", reservation.getId());
      indexEntry.setTitle(reservation.getEvent());
      indexEntry.setPreView(reservation.getReason());
      indexEntry.setCreationDate(reservation.getCreationDate());
      indexEntry.setCreationUser(reservation.getUserId());
      indexEntry.setKeyWords(reservation.getPlace());
      IndexEngineProxy.addIndexEntry(indexEntry);
    }
  }
  private void indexForm(RecordSet recordSet) throws WebPagesException {
    try {
      if (recordSet == null) {
        PublicationTemplate pub = getXMLTemplate();
        recordSet = pub.getRecordSet();
      }
    } catch (Exception e) {
      throw new WebPagesException(
          "WebPagesSessionController.indexForm()",
          SilverpeasException.ERROR,
          "webPages.EX_CANT_GET_FORM",
          e);
    }
    // index data
    try {
      FullIndexEntry indexEntry =
          new FullIndexEntry(getComponentId(), "Component", getComponentId());
      indexEntry.setCreationDate(new Date());
      indexEntry.setCreationUser(getUserId());
      indexEntry.setTitle(getComponentLabel());
      ComponentInstLight component =
          getOrganizationController().getComponentInstLight(getComponentId());
      if (component != null) {
        indexEntry.setPreView(component.getDescription());
      }

      recordSet.indexRecord("0", getUsedXMLTemplateShortname(), indexEntry);

      IndexEngineProxy.addIndexEntry(indexEntry);
    } catch (FormException e) {
      throw new WebPagesException(
          "WebPagesSessionController.indexForm()",
          SilverpeasException.ERROR,
          "webPages.EX_CANT_INDEX_DATA",
          e);
    }
  }
 private void deleteIndex(String objectId, String objectType, String componentId) {
   IndexEntryPK indexEntry = new IndexEntryPK(componentId, objectType, objectId);
   IndexEngineProxy.removeIndexEntry(indexEntry);
 }