Hi,
I followed closely with the AddSiteLinks /UpdateSiteLinks examples but still have an issue fully implementing getting campaign site links.
1. FeedMappingServiceInterface - Create Map for each FeedMappingID and it's placeholder type.
2. FeedItemServiceInterface - Created a list of FeedItemID (called siteLinkItemIDs) that their feedMappingID is of placeholder type 1 (from the Map in #1)
3. CampaignFeedServiceInterface - got the Feed ID and matching Function. -> here I got stuck - not sure how to user the Matching function to
get the actual site link details .
Is there any example for the "get" implementation?
Help is greatly appreciated.
This is how far I got:
Function f = campaignFeed.getMatchingFunction(); // this is from campaignFeedService
RequestContextOperand requestContextOperand = new RequestContextOperand();
requestContextOperand.setContextType(RequestContextOperandContextType.FEED_ITEM_ID);
Function feedItemFunction = new Function();
feedItemFunction.setLhsOperand(new FunctionArgumentOperand[] {requestContextOperand});
feedItemFunction.setOperator(FunctionOperator.IN);
List<FunctionArgumentOperand> operands = new ArrayList<FunctionArgumentOperand>();
for (long feedItemId : siteLinkItemIDs) {
ConstantOperand constantOperand = new ConstantOperand();
constantOperand.setLongValue(feedItemId);
constantOperand.setType(ConstantOperandConstantType.LONG);
operands.add(constantOperand);
}
feedItemFunction.setRhsOperand(operands.toArray(new FunctionArgumentOperand[operands.size()]));
FunctionOperand feedItemFunctionOperand = new FunctionOperand();
feedItemFunctionOperand.setValue(feedItemFunction);
Function combinedFunction = new Function();
combinedFunction.setOperator(FunctionOperator.AND);
combinedFunction.setLhsOperand(
new FunctionArgumentOperand[] {feedItemFunctionOperand});
CampaignFeed campaignFeed2 = new CampaignFeed();
campaignFeed2.setFeedId(feedId);
campaignFeed2.setCampaignId(campaignId);
campaignFeed2.setMatchingFunction(combinedFunction);
campaignFeed2.setPlaceholderTypes(new int[] {PLACEHOLDER_SITELINKS});
CampaignFeedOperation operation = new CampaignFeedOperation();
operation.setOperand(campaignFeed2);
operation.setOperator(Operator.ADD);
Thanks for any help.
Assaf