Ejemplo n.º 1
0
  /**
   * Returns documentURL property.
   *
   * @param pDocumentID parameter to set.
   * @param pRepository parameter to set.
   * @return documentURL property.
   * @throws RepositoryException - exception
   * @throws UnsupportedEncodingException - exception
   */
  public static String getDocumentURL(String pDocumentID, Repository pRepository)
      throws RepositoryException, UnsupportedEncodingException {
    RepositoryItem document = pRepository.getItem(pDocumentID, ITEM_CASTORAMA_DOCUMENT);

    if (document != null) {
      return SEOUtils.getDocumentURL(document);
    } else {
      return null;
    }
  }
Ejemplo n.º 2
0
  /**
   * Returns productURL property.
   *
   * @param pProductID parameter to set.
   * @param pRepository parameter to set.
   * @return productURL property.
   * @throws RepositoryException - exception
   * @throws UnsupportedEncodingException - exception
   */
  public static String getProductURL(String pProductID, Repository pRepository)
      throws RepositoryException, UnsupportedEncodingException {
    RepositoryItem product = pRepository.getItem(pProductID, "product");

    if (product != null) {
      return SEOUtils.getProductURL(product);
    } else {
      return null;
    }
  }
Ejemplo n.º 3
0
  /**
   * Returns categoryURL property.
   *
   * @param pCategotyID parameter to set.
   * @param pRepository parameter to set.
   * @return categoryURL property.
   * @throws RepositoryException - exception
   * @throws UnsupportedEncodingException - exception
   */
  public static String getCategoryURL(String pCategotyID, Repository pRepository)
      throws RepositoryException, UnsupportedEncodingException {
    RepositoryItem category = pRepository.getItem(pCategotyID, ITEM_CATEGORY);

    if (category != null) {
      return SEOUtils.getCategoryURL(category);
    } else {
      return null;
    }
  }
Ejemplo n.º 4
0
  /**
   * Returns filterURL property.
   *
   * @param pFilter parameter to set.
   * @return filterURL property.
   * @throws UnsupportedEncodingException - exception
   */
  public static String getFilterURL(RepositoryItem pFilter) throws UnsupportedEncodingException {
    String name = (String) pFilter.getPropertyValue("tagTitle");
    name = SEOUtils.prepareNameForURL(name);

    StringBuffer url = new StringBuffer();
    url.append("/conseils-et-forums/")
        .append(name)
        .append('+')
        .append(pFilter.getRepositoryId())
        .append(EXTENSION_HTML);

    return url.toString();
  }
Ejemplo n.º 5
0
  /**
   * Returns topicURL property.
   *
   * @param pTopic parameter to set.
   * @return topicURL property.
   * @throws UnsupportedEncodingException - exception
   */
  public static String getTopicURL(RepositoryItem pTopic) throws UnsupportedEncodingException {
    String name = (String) pTopic.getPropertyValue(PROPERTY_TITLE);
    name = SEOUtils.prepareNameForURL(name);

    StringBuffer url = new StringBuffer();
    url.append("/lancez-vous/")
        .append(name)
        .append('-')
        .append(pTopic.getRepositoryId())
        .append(EXTENSION_HTML);

    return url.toString();
  }
Ejemplo n.º 6
0
  /**
   * Returns productURL property.
   *
   * @param pProduct parameter to set.
   * @return productURL property.
   * @throws UnsupportedEncodingException - exception
   */
  public static String getProductURL(RepositoryItem pProduct) throws UnsupportedEncodingException {
    String name = (String) pProduct.getPropertyValue(PROPERTY_DISPLAY_NAME);
    name = SEOUtils.prepareNameForURL(name);

    StringBuffer url = new StringBuffer();
    url.append('/')
        .append(name)
        .append('-')
        .append(pProduct.getRepositoryId())
        .append(EXTENSION_HTML);

    return url.toString();
  }
Ejemplo n.º 7
0
  /**
   * Returns documentURL property.
   *
   * @param pDocument parameter to set.
   * @return documentURL property.
   * @throws UnsupportedEncodingException - exception
   */
  public static String getDocumentURL(RepositoryItem pDocument)
      throws UnsupportedEncodingException {
    String externalURL = getNotEmptyDocExtURL(pDocument);
    if (externalURL != null) {
      return externalURL;
    }
    String name = (String) pDocument.getPropertyValue(PROPERTY_TITLE);
    name = SEOUtils.prepareNameForURL(name);

    StringBuffer url = new StringBuffer();
    url.append("/doc/")
        .append(name)
        .append('-')
        .append(pDocument.getRepositoryId())
        .append(EXTENSION_DOC);

    return url.toString();
  }