Skip to main content

Show the user data of every response for the current Quick Poll in the campaign in a Flex Client, 1st part

In this first part, we will learn the basic about the SAP portal KM library km.appl.ui.quickpoll_api.jar and its configuration for our development environment.

The application that we are going to create will have:

  1. input: the name of campaign to review.
  2. output: every user vote of the current quick poll with detail information of the user. As the figure 2.



Before to begin we must take in account that the following things:

  • The repository path for the quick poll is "/document/QuickPoll".
  • The name of the Quick Poll resource is qp.xml. It is for the current quick poll of the campaign. For the previous and closed quick poll they are located in the history directory of the campaign.
  • The namespace of the quick poll service is "http://sapportals.com/xmlns/cm:service.quickpoll.QPService".
  • The name of the portal service for quick poll is "AppPropertiesRepositoryService".
  • The name of the property is "quickpollvote" (link). This is the most important item because it contains all the info that we will need.


Our final RIA web report will contain information about the every response of current quick poll for the requested campaign, data as full name of the user, email, organization, and finally the vote.


We will create an xml document with the structure as the figure 1.

Figure 1.

The design of the RIA client is shown in the figure 2.

Figure 2

We will create a simple Java project, after we are going to create our pojos entities with the similar structure to the xml structure.

LineQuickPoll.java
LineResponse.java
ReportQuickPoll.java

These classes contain the following attributes with its setter and getter methods. Also they are Serializable, but it is not necessary.


-- LineQuickPoll.java --

private String namePoll;
private String question;
private String statePoll;
private String nameResourceKM;
private Integer totalVotes;
private List listUserResponses;



-- LineResponse.java --
private String userId;
private String userName;
private String email;
private String area;
private String response;



-- ReportQuickPoll.java --
private String nameCampaing;
private List listPolls;


Now, we are going to create our aplication service class, I will name it "SearchService" and it implements the ISearchService interface as I show in the following code.

public interface ISearchService {

/**
* Get the votes per user for the campaign in the current quick poll, the returned text is in an XML Format
* @param map
* @return Return an XML text
* @throws ApplicationException
*/
String getVotesPerCampaingXmlResponse(Map map) throws ApplicationException;

/**
* Get the votes per user for the campaign in the current quick poll
* @param map
* @return Return a ReportQuickPoll object
* @throws ApplicationException
*/
ReportQuickPoll getVotesPerCampaingResponse(Map map) throws ApplicationException;
}

Also I have created a J2EE Server Component Library Project with the purpose to contain all SAP KMC libraries need by the java project, it is only to compilation time, because this libraries are part of the SAP Portal in runtime.

In the next part we are going to review this service class in detail.

Comments

Popular posts from this blog

How to .. Integration Non-SAP J2EE-based Web Applications into SAP Portal with SSO Part 1

We are going to integrate Non-SAP J2EE-based Web Applications into the SAP Portal with Application Integrator and SSO. In this part, I will discuss the overall of these posts and configure the iView with Application Integrator Overview of Integration. To perform this integration must take into account the following steps: Deployment of the portal application for the creation of the system portal object Create and set the type of Application Integrator iView that will contain the applications to integrate. Installing SAPSSOEXT and SAPSECU libraries Deployment of the application gateway called SsoGatewayWeb Changing the target application. This integration has the following restrictions: It applies only for web applications based on J2EE Servlet. Depend exclusively on the sucessful load of the libraries supported by SAP (sapssoext and sapsecu) in both Windows and UNIX environments. The target application must have created a profile for the user id logged to the SAP portal, this sh...

How to .. Integration Non-SAP J2EE-based Web Applications into SAP Portal with SSO Part 2

After we have configured our portal object, we must install the gateway application and modified the target application. 1. Deployment of the Gateway Web J2EE Application : We must to create an j2ee web application with the purpose to be a gateway from every application that want to validate the SAP Ticket Logon. I have created this application because of the problem with the sapssoext library provied from SAP, it can't be loaded from more than one classloader, then this new web application will be the unque application on the server that can load this library. This application could expose 2 or more services, it depends of you. I will mention 2 services: /SsoGatewayWeb/ssojson.dtx : under this URI will happen the vaidation of the SAP Ticket Logon sent by the SAP Portal, it returns a JSON string with the information retrieved from the ticket. /SsoGatewayWeb/sendsso2cookietest : this URI generates HTML content, it generates the string ACL of the certificate file. Both only acc...

WebDynpro for Java: Tutorial of the Basic Usage of RoadMap Component

We will create a local Development component project of the type Web Dynpro as follow Our project will contain only 3 views with the purpose of show the basic usage of the roadMap object. After, we create our component controller RoadMap and the RoadMapView view as follow Now, we will create the 2 views more, the previous one will contain only the RoadMap Object (RoadMapView) used in all the project, the other ones show the flow between screens. Here the list of the 3 views: RoadMapView,  InitView, and ConfirmView. Now, we will add the component RoadMap object (it is on the Standar Complex Group) to the RoadMapView view, but first delete the default object added to the view, after we will need to add two steps (it could be more, depends of your logic) to our roadmap object. In order to do that we will use the Outline view of the NWDS. We add the two steps as follow The type steps to add at the RoadMap object will be ot the "RoadMapStep" type. The name of the steps are: Init...