Examples of GsaEntry


Examples of com.google.enterprise.apis.client.GsaEntry

  /**
   * Update the screen display information using this instance of GSA Client.
   */
  private void updateGsaInfo() {
    try {
      GsaEntry crawlUrlEntry = gsaClient.getEntry(Terms.FEED_CONFIG, Terms.ENTRY_CRAWL_URLS);
      String startUrl = crawlUrlEntry.getGsaContent(Terms.PROPERTY_START_URLS);
      if (startUrl == null) {
        startUrl = "";
      }
      contentStartUrl.text.setText(startUrl);
      String crawlUrl = crawlUrlEntry.getGsaContent(Terms.PROPERTY_FOLLOW_URLS);
      if (crawlUrl == null) {
        crawlUrl = "";
      }
      contentCrawlUrl.text.setText(crawlUrl);
      String doNotCrawlUrl = crawlUrlEntry.getGsaContent(Terms.PROPERTY_DO_NOT_CRAWL_URLS);
      if (doNotCrawlUrl == null) {
        doNotCrawlUrl = "";
      }
      contentDoNotCrawl.text.setText(doNotCrawlUrl);

     
      GsaEntry freshnessTuningEntry = gsaClient.getEntry(Terms.FEED_CONFIG,
          Terms.ENTRY_FRESHNESS);
      String crawlFrequentlyUrl = freshnessTuningEntry.getGsaContent(Terms.PROPERTY_FREQUENT_URLS);
      if (crawlFrequentlyUrl == null) {
        crawlFrequentlyUrl = "";
      }
      contentCrawlFrequently.text.setText(crawlFrequentlyUrl);
      String crawlInfrequentlyUrl =
          freshnessTuningEntry.getGsaContent(Terms.PROPERTY_ARCHIVE_URLS);
      if (crawlInfrequentlyUrl == null) {
        crawlInfrequentlyUrl = "";
      }
      contentCrawlInfrequently.text.setText(crawlInfrequentlyUrl);
      String forceRecrawlUrl = freshnessTuningEntry.getGsaContent(Terms.PROPERTY_FORCE_URLS);
      if (forceRecrawlUrl == null) {
        forceRecrawlUrl = "";
      }
      contentForceRecrawl.text.setText(forceRecrawlUrl);

      GsaEntry eventEntry = gsaClient.getEntry(Terms.FEED_LOGS,
                                               Terms.ENTRY_EVENT_LOG);
      contentEventLog.text.setText(eventEntry.getGsaContent(Terms.PROPERTY_LOG_CONTENT));
    } catch (ServiceException ex) {
      logger.severe(ex.getMessage());
      JOptionPane.showMessageDialog(null, ex.getMessage());
    } catch (IOException ex) {
      logger.severe(ex.getMessage());
View Full Code Here

Examples of com.google.enterprise.apis.client.GsaEntry

  /* (non-Javadoc)
   * @see sample.commandline.Command#execute()
   */
  @Override
  public String execute() throws MalformedURLException, ServiceException, IOException {
    GsaEntry insertEntry = getEntryFromFile(optionMap.get("input"));
    GsaEntry resultEntry = gsaClient.insertEntry(argsList.get(1), insertEntry);
   
    return getXmlOutput(resultEntry);
  }
View Full Code Here

Examples of com.google.enterprise.apis.client.GsaEntry

   * @throws IOException
   * @throws ParseException
   */
  protected GsaEntry getEntryFromFile(String inputFileName) throws ParseException,
      IOException, ServiceException {
    GsaEntry entry = null;

    ParseSource source = new ParseSource(new FileInputStream(inputFileName));
    entry = GsaEntry.readEntry(source, GsaEntry.class, new ExtensionProfile());

    return entry;
View Full Code Here

Examples of com.google.enterprise.apis.client.GsaEntry

      } else {
        feed = gsaClient.queryFeed(argsList.get(1), optionMap);
      }
      return getXmlOutput(feed);
    } else if (argsList.size() == 3) {
      GsaEntry entry;
      if (optionMap.isEmpty()) {
        entry = gsaClient.getEntry(argsList.get(1), argsList.get(2));
      } else {
        entry = gsaClient.queryEntry(argsList.get(1), argsList.get(2), optionMap);
      }
View Full Code Here

Examples of com.google.enterprise.apis.client.GsaEntry

  /* (non-Javadoc)
   * @see sample.commandline.Command#execute()
   */
  @Override
  public String execute() throws MalformedURLException, ServiceException, IOException {
    GsaEntry updateEntry = getEntryFromFile(optionMap.get("input"));
    GsaEntry resultEntry = gsaClient.updateEntry(argsList.get(1), argsList.get(2), updateEntry);
   
    return getXmlOutput(resultEntry);
  }
View Full Code Here

Examples of com.google.enterprise.apis.client.GsaEntry

    while ((line = bufferReader.readLine()) != null) {
      if (!line.equals("")) {
        String[] result = line.split(" ", 2);
        if (result.length == 2) {
          System.out.println("Add rule: " + line);
          GsaEntry entry = new GsaEntry();
          entry.addGsaContent(Terms.PROPERTY_URL_PATTERN, result[0]);
          entry.addGsaContent(Terms.PROPERTY_POLICY_ACL, result[1]);
          gsaClient.insertEntry(Terms.FEED_POLICY_ACLS, entry);
        }
      }
    }
  }
View Full Code Here

Examples of com.google.enterprise.apis.client.GsaEntry

      LOGGER.logp(Level.FINE, CLASS_NAME, METHOD,
          "Sending ACL for url pattern: " + urlPattern + " with values "
          + acl.toString());
    }
    try {
      GsaEntry entry = new GsaEntry();
      entry.addGsaContent(Terms.PROPERTY_URL_PATTERN, urlPattern);
      entry.addGsaContent(Terms.PROPERTY_POLICY_ACL, acl.toString());
      client.insertEntry(Terms.FEED_POLICY_ACLS, entry);
      LOGGER.logp(Level.FINER, CLASS_NAME, METHOD, "Sent ACL");
    } catch (AuthenticationException e) {
      LOGGER.logp(Level.WARNING, CLASS_NAME, METHOD, e.toString());
      return false;
View Full Code Here
TOP
Copyright © 2018 www.massapi.com. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.