Package com.google.enterprise.connector.sharepoint.spiimpl

Examples of com.google.enterprise.connector.sharepoint.spiimpl.SPDocument


      dummySiteListState = currentDummySiteDataList;
    }
    LOGGER.log(Level.INFO, "Getting site data. internalName [ "
        + webState.getWebUrl() + " ] ");
    List<SPDocument> documentList = new ArrayList<SPDocument>();
    SPDocument document = null;

    try {
      // SharePoint Client Context used to create SiteDataWS should point to
      // WebState URL. If not then SharePoint default page will point to
      // incorrect Web ID for Web State.
      SharepointClientContext ctxToPass =
          (SharepointClientContext) tempCtx.clone();
      ctxToPass.setSiteURL(webState.getWebUrl());
      final SiteDataHelper siteData = new SiteDataHelper(ctxToPass);
      // need to check whether the site exist or not and is not null
      if (webState.isExisting() && null != webState) {
        document = siteData.getSiteData(webState);
        document.setParentList(dummySiteListState);
        // Site Home Page document will be added as last doc from
        // dummy list state. This is required for sending delete feed.
      }
    } catch (final Exception e) {
      LOGGER.log(Level.WARNING, "Problem while getting site data. ", e);
   
    // Web Application Policy Document processing.
    // Web Application Policy Document will be associated with each webstate.
    if (sharepointClientContext.isPushAcls()) {
      try {
        AclHelper aclHelper = new AclHelper(sharepointClientContext,
            webState.getWebUrl());
        SPDocument webAppPolicy = aclHelper.getWebApplicationPolicy(webState,
            sharepointClientContext.getFeedType().toString());
        if (webAppPolicy != null) {
          webAppPolicy.setParentList(dummySiteListState);
          documentList.add(webAppPolicy);
        }
      } catch (final Exception e) {
        LOGGER.log(Level.WARNING, "Problem while getting web app policy. ", e);
      }
View Full Code Here


                    if (knownAttachments.contains(url)) {
                      knownAttachments.remove(url);
                    }
                  }
                  final SPDocument doc = new SPDocument(modifiedID, url,
                      baseList.getLastModCal(), SPConstants.NO_AUTHOR,
                      SPConstants.OBJTYPE_ATTACHMENT,
                      baseList.getParentWebState().getTitle(),
                      sharepointClientContext.getFeedType(),
                      listItem.getSPType());
                  doc.setParentList(baseList);

                  listAttachments.add(doc);
                }
              }
            }
View Full Code Here

          final MessageElement child = (MessageElement) itChilds.next();
          if (SPConstants.DATA.equalsIgnoreCase(child.getLocalName())) {
            Iterator<?> itrchild = child.getChildElements();
            while (itrchild.hasNext()) {
              final MessageElement row = (MessageElement) itrchild.next();
              final SPDocument doc = ListsUtil.processListItemElement(
                  sharepointClientContext, row, list, allWebs);
              if (doc != null) {
                listItems.add(doc);
              }
            }
View Full Code Here

    }

    if (null != updatedListItems) {
      for (Object element : updatedListItems) {
        final MessageElement row = (MessageElement) element;
        final SPDocument doc = ListsUtil.processListItemElement(
            sharepointClientContext, row, list, allWebs);
        if (doc != null) {
          listItems.add(doc);
        }
      }
View Full Code Here

        nextPage =
            child.getAttribute(SPConstants.LIST_ITEM_COLLECTION_POSITION_NEXT);
        Iterator<?> itrchild = child.getChildElements();
        while (itrchild.hasNext()) {
          final MessageElement row = (MessageElement) itrchild.next();
          final SPDocument doc = ListsUtil.processListItemElement(
              sharepointClientContext, row, list, null);
          if (doc != null) {
            listItems.add(doc);
          }
        }       
View Full Code Here

                ++maxID;
                continue;
              }
              String docID = list.getListURL() + SPConstants.DOC_TOKEN
                  + Integer.toString(maxID);
              final SPDocument doc = new SPDocument(docID, list.getListURL(),
                  list.getLastModCal(), SPConstants.NO_AUTHOR,
                  SPConstants.OBJTYPE_LIST_ITEM,
                  list.getParentWebState().getTitle(), FeedType.CONTENT_FEED, SPType.SP2007);
              doc.setAction(ActionType.DELETE);
              doc.setParentList(list);
              deletedDocs.add(doc);

              // If this list can contain attachments, assume that
              // each item had attachments and send delete feed
              // for them.
              if (list.canContainAttachments()) {
                final List<String> attachments = list.getAttachmntURLsFor(Util.getOriginalDocId(docID, FeedType.CONTENT_FEED));
                final String originalDocID = docID;
                for (String attchmnt_url : attachments) {
                  docID = SPConstants.ATTACHMENT_SUFFIX_IN_DOCID + "["
                      + attchmnt_url + "]" + originalDocID;
                  final SPDocument attchmnt = new SPDocument(docID,
                      list.getListURL(), list.getLastModCal(),
                      SPConstants.NO_AUTHOR, SPConstants.OBJTYPE_ATTACHMENT,
                      list.getParentWebState().getTitle(),
                      FeedType.CONTENT_FEED, SPType.SP2007);
                  attchmnt.setAction(ActionType.DELETE);
                  attchmnt.setParentList(list);
                  deletedDocs.add(attchmnt);
                }
              }
              ++maxID;
            }

            // If we have sent the complete delete feeds, send one
            // more delete feed corresponding to the list itself.
            // This is not required for alerts. For alerts, just
            // ensure that no more documents are to be sent.
            if (SPConstants.ALERTS_TYPE.equals(list.getType())
                && deletedDocs.size() == 0 && list.isCrawlQueueEmpty()) {
              LOGGER.log(Level.INFO, "Deleting Alerts List for list/library ["
                  + list.getListURL() + "]. ");
              iter.remove();
              keyMap.remove(list.getPrimaryKey());
            } else if (maxID >= biggestID) {
              String docID = null;
              if (!list.isSiteDefaultPage()) {
                docID = list.getListURL() + SPConstants.DOC_TOKEN
                    + list.getPrimaryKey();
                ;
              } else {
                docID = list.getLastDocProcessed().getDocId();
              }
              final SPDocument doc = new SPDocument(docID, list.getListURL(),
                  list.getLastModCal(), SPConstants.NO_AUTHOR,
                  SPConstants.OBJTYPE_LIST_ITEM, list.getParentWebState()
                      .getTitle(), FeedType.CONTENT_FEED, SPType.SP2007);
              doc.setAction(ActionType.DELETE);
              doc.setParentList(list);
              if (!list.isSendListAsDocument() || !isCrawlAspxPages()) {
                // send the listState as a feed only if it was
                // included (not excluded) in the URL pattern
                // matching
                // The other case is SharePoint admin has set a
                // flag at site level to exclude ASPX pages from
                // being crawled and indexed and hence no need
                // send DELETE feed for List
                if (list.isSiteDefaultPage()) {
                  doc.setToBeFed(true);
                } else {
                  doc.setToBeFed(false);
                }
                LOGGER.log( Level.FINE, "List Document marked as not to be fed because ASPX pages are not supposed to be crawled as per exclusion patterns OR SharePoint site level indexing options ");
              }
              deletedDocs.add(doc);
            }
View Full Code Here

      // All the urls which have been left in knownAttachments are
      // considered to be deleted.
      for (String attchmnt_url : knownAttachments) {
        final String docID = SPConstants.ATTACHMENT_SUFFIX_IN_DOCID + "["
            + attchmnt_url + "]" + listItem.getDocId();
        final SPDocument attchmnt = new SPDocument(docID, attchmnt_url,
            baseList.getLastModCal(), SPConstants.NO_AUTHOR,
            SPConstants.OBJTYPE_ATTACHMENT,
            baseList.getParentWebState().getTitle(),
            sharepointClientContext.getFeedType(),
            baseList.getParentWebState().getSharePointType());
        attchmnt.setParentList(baseList);
        attchmnt.setAction(ActionType.DELETE);
        listAttachments.add(attchmnt);
      }
    }

    int countDeleted = (null == knownAttachments) ? 0 : knownAttachments.size();
View Full Code Here

          list.setNextPage("not null");
        }
        break;
      }
      String docID = list.getListURL() + SPConstants.DOC_TOKEN + currentItemID;
      final SPDocument doc = new SPDocument(docID, list.getListURL(),
          list.getLastModCal(), SPConstants.NO_AUTHOR,
          SPConstants.OBJTYPE_LIST_ITEM, list.getParentWebState().getTitle(),
          sharepointClientContext.getFeedType(),
          list.getParentWebState().getSharePointType());
      doc.setAction(ActionType.DELETE);
      listItems.add(doc);
      count++;

      // If this list can contain attachments, assume that each item had
      // attachments and send delete feed for them.
      if (list.canContainAttachments()) {
        final List<String> attachments = list.getAttachmntURLsFor(currentItemID);
        final String originalDocID = docID;
        for (String attchmnt_url : attachments) {
          docID = SPConstants.ATTACHMENT_SUFFIX_IN_DOCID + "[" + attchmnt_url
              + "]" + originalDocID;
          final SPDocument attchmnt = new SPDocument(docID, attchmnt_url,
              list.getLastModCal(), SPConstants.NO_AUTHOR,
              SPConstants.OBJTYPE_ATTACHMENT,
              list.getParentWebState().getTitle(),
              sharepointClientContext.getFeedType(),
              list.getParentWebState().getSharePointType());
          attchmnt.setAction(ActionType.DELETE);
          listItems.add(attchmnt);
          count++;
        }
      }
    }
View Full Code Here

   * @param list the list whose items are to be retrieved
   * @param allItems the collection used to store the discovered items
   */
  private void traverseChangedFolders(final ListState list,
      final List<SPDocument> allItems) {
    SPDocument lastDocument = list.getLastDocForWSRefresh();
    if (null == lastDocument || null == allItems) {
      return;
    }
   
    Iterator<Folder> itrChangedFolders = list.getChangedFolders().iterator();
View Full Code Here

      if (null == obj || !(obj instanceof MessageElement)) {
        continue;
      }
      try {
        final MessageElement row = (MessageElement) obj;
        final SPDocument doc = ListsUtil.processListItemElement(
            sharepointClientContext, row, list, null);
        if (doc == null) {
          LOGGER.info("Skipping the ID [" + row.getAttribute(SPConstants.ID)
              + "] under the List/Library URL " + list.getListURL() + ".");
        } else {
View Full Code Here

TOP

Related Classes of com.google.enterprise.connector.sharepoint.spiimpl.SPDocument

Copyright © 2018 www.massapicom. 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.