Skip to end of metadata
Go to start of metadata

You are viewing an old version of this page. View the current version.

Compare with Current View Page History

« Previous Version 3 Next »

Set up the preferences

  • Add the 'RestfulJsonNotificationService.serviceUrls' preference and specify your service(s). 

    • You may add more than one Url by clicking on the "Add Value" link

 

Using Optional Parameters

The parameters included with the call to a REST service are set in the Spring configuration. See file applicationContext.xml (notification-portlet-webapp/src/main/webapp/WEB-INF/context/). In that file the Spring bean restfulJsonNotificationServices is configured accordingly and you can revise the "urlParameters" property based on your needs. By default, the url pattern will be similar to this: "https://university.edu/yourFeed/{username}"

<bean id="restfulJsonNotificationService" class="org.jasig.portlet.notice.service.rest.RestfulJsonNotificationService">
        <property name="name" value="restfulJsonNotificationService"/>       
        <property name="usernameEvaluator">
            <bean class="org.jasig.portlet.notice.service.rest.StringLiteralParameterEvaluator"
               p:value="${restfulJsonNotificationService.basicauth.username}"/>
        </property>
        <property name="passwordEvaluator">
            <bean class="org.jasig.portlet.notice.service.rest.StringLiteralParameterEvaluator"
              p:value="${restfulJsonNotificationService.basicauth.password}"/>
        </property>
        <property name="urlParameters">
            <util:map>
                <entry key="username">
                    <bean class="org.jasig.portlet.notice.service.rest.UserAttributeParameterEvaluator">
                        <property name="userAttributeKey" value="user.login.id"/>
                    </bean>
                </entry>
            </util:map>
        </property>
        <property name="restTemplate">
            <bean class="org.springframework.web.client.RestTemplate">
                <property name="requestFactory">
                    <bean class="org.springframework.http.client.CommonsClientHttpRequestFactory">
                        <property name="httpClient" ref="httpClient" />
                    </bean>
                </property>
            </bean>
        </property>
   </bean>

 

 

  • No labels