Images and Links

Advisor and therefore Outreach support including images and links as part of an Advice Item / campaign. The image itself is uploaded when creating a new Outreach campaign. By default, if an image is specified when creating the campaign in Administration, it is displayed as part of the campaign without a link. However, it is possible to specify a link within the rule set, and within that link to specify an image, referencing the image that has been configured for the campaign.

Within the custom concrete campaign rule set, define a link:

<Class extends="AbstractLink" 
   extendsRuleSet="CoreAdvisorRuleSet" 
     name="ChildCareOptionLinkWithImage">
   
   <Attribute name="name">
     <type>
       <javaclass name="String"/>
     </type>
     <derivation>
       <String value="childCareOptionLinkImage"/>
     </derivation>
   </Attribute>
   
   <Attribute name="target">
     <type>
       <javaclass name="String"/>
     </type>
     <derivation>
       <String value="http://www.yourtargeturl.com"/>
     </derivation>
   </Attribute>
   
   <Attribute name="modal">
     <type>
       <javaclass name="Boolean"/>
     </type>
     <derivation>
       <false/>
     </derivation>
   </Attribute>
   
   <Attribute name="external">
     <type>
       <javaclass name="Boolean"/>
     </type>
     <derivation>
       <true/>
     </derivation>
   </Attribute>
   
   <Attribute name="linkImage">
     <type>
       <ruleclass name="Image" ruleset="CoreAdvisorRuleSet"/>
     </type>
     <derivation>
     <!-- note that this is specified. The parent rule class will 
             specify the image reference from the campaign -->
       <specified/>
     </derivation>
   </Attribute>
   
 </Class>

When declaring this link within the custom implementation of AbstractCampaignAdviceItem, you specify the reference to the image configured in administration: Please refer to the Advisor documentation for further information on defining links and images.

<Attribute name="childCareOptionLinkWithImage">
   <type>
     <ruleclass name="ChildCareOptionLinkWithImage"/>
   </type>
   <derivation>
     <create ruleclass="ChildCareOptionLinkWithImage">
       <specify attribute="linkImage">
         <reference attribute="campaignImage"/>
       </specify>	
     </create>
   </derivation>
 </Attribute>

In order for the links related to image only campaigns to be persisted to the Advisor database tables (and therefore displayed in Outreach Campaigns), an entry in the properties file related to that campaign is required. For example:

AdviceItem.imageOnlyText={link::imageCampaignLinkWithImage}

This entry does not designate a name for the link, but references name of the rules object defined in the campaign rule set to represent this link.