Package com.ebay.sdk.call

Examples of com.ebay.sdk.call.GetFeedbackCall


            Map<String, Object> inMap = FastMap.newInstance();
            inMap.put("productStoreId", productStoreId);
            inMap.put("userLogin", userLogin);
            Map<String, Object> resultUser = dispatcher.runSync("getEbayStoreUser", inMap);
            String userID = (String)resultUser.get("userLoginId");
            GetFeedbackCall feedbackCall = new GetFeedbackCall();
            feedbackCall.setApiContext(apiContext);
            SiteCodeType siteCodeType = EbayStoreHelper.getSiteCodeType(productStoreId,locale, delegator);
            feedbackCall.setSite(siteCodeType);
            feedbackCall.setUserID(userID);
            DetailLevelCodeType[] detailLevelCodeType = {DetailLevelCodeType.RETURN_ALL};
            feedbackCall.setDetailLevel(detailLevelCodeType);
            FeedbackDetailType[] feedback = feedbackCall.getFeedback();
            if (feedback != null) {
                String partyId = null;
                GenericValue userLoginEx = delegator.findByPrimaryKey("UserLogin", UtilMisc.toMap("userLoginId", userID));
                if (userLoginEx == null) {
                    //Party
View Full Code Here


            Map<String, Object> inMap = FastMap.newInstance();
            inMap.put("productStoreId", productStoreId);
            inMap.put("userLogin", userLogin);
            Map<String, Object> resultUser = dispatcher.runSync("getEbayStoreUser", inMap);
            String userID = (String)resultUser.get("userLoginId");
            GetFeedbackCall feedbackCall = new GetFeedbackCall();
            feedbackCall.setApiContext(apiContext);
            SiteCodeType SiteCodeType = EbayStoreHelper.getSiteCodeType(productStoreId,locale, delegator);
            feedbackCall.setSite(SiteCodeType.US);
            feedbackCall.setUserID(userID);
            DetailLevelCodeType[] detailLevelCodeType = {DetailLevelCodeType.RETURN_ALL};
            feedbackCall.setDetailLevel(detailLevelCodeType);
            FeedbackDetailType[] feedback = feedbackCall.getFeedback();
            if (feedback != null) {
                String partyId = null;
                GenericValue userLoginEx = delegator.findByPrimaryKey("UserLogin", UtilMisc.toMap("userLoginId", userID));
                if (userLoginEx == null) {
                    //Party
View Full Code Here

      //Set server URL
      apiContext.setApiServerUrl("https://api.ebay.com/wsapi");
      //Get seller username 
      String uID = ConsoleUtil.readString("Please enter the Ebay account name of the seller you want to get feedbacks from: ");    
     
      GetFeedbackCall feedbackCall = null;
      PaginationType p; 
      ArrayList<FeedbackDetailType[]> aLfDetail = new ArrayList<FeedbackDetailType[]>();
  
      //Predifine number of pages
      int numberOfPages = 1;
     
      for(int i = 0; i < numberOfPages; i++) {
       
        feedbackCall = new GetFeedbackCall(apiContext);
          feedbackCall.setUserID(uID);
         
          DetailLevelCodeType[] detailLevels = new DetailLevelCodeType[] {
                  DetailLevelCodeType.RETURN_ALL
                 
              };
          feedbackCall.setDetailLevel(detailLevels);
         
          p = new PaginationType();
          p.setEntriesPerPage(200);
          p.setPageNumber(i+1);
          feedbackCall.setPagination(p);
        
          //Get feedbacks on page
          aLfDetail.add(feedbackCall.getFeedback());
         
          //Redifine number of pages
          if (i == 0) numberOfPages = feedbackCall.getReturnedPaginationResult().getTotalNumberOfPages();
      }  
     
      //Check feedbacks
      if(aLfDetail.size() > 1) {
        //Create output print writer
        String filePath = System.getProperty("user.dir") + "\\ebay-customer-feedbacks-for-" + uID + ".txt";
        PrintWriter printWr = new PrintWriter(new FileWriter(filePath));
 
        printWr.println("FeedbackID;Role;ItemID;ItemTitle;ItemPrice;getCommentType;CommentTime;CommentingUser;CommentingUserScore;getCommentText");
       
        for (FeedbackDetailType[] fDetail : aLfDetail) {
          for (FeedbackDetailType f : fDetail) {
            try {
              if(f.getRole() == TradingRoleCodeType.SELLER) {
                printWr.println( f.getRole() + ";" + f.getItemID() + ";" + f.getItemTitle()  + ";" + f.getCommentType() + ";" +  f.getCommentingUser() + ";" + f.getCommentText());
              }
            } catch (Exception exep) {
              exep.printStackTrace();
            }
          }
        }
        printWr.close();
        System.out.println("Successfully retieved " + feedbackCall.getReturnedPaginationResult().getTotalNumberOfEntries() + " feedbacks on " + numberOfPages + " pages!");
        System.out.println("Retrieved seller feedbacks were saved in file: \"" + filePath + "\"");
      }
    }
    catch(Exception e) {
    }
View Full Code Here

TOP

Related Classes of com.ebay.sdk.call.GetFeedbackCall

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.