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

My first serious Groovy class ..... decompiling java classes with closures

After I read the chapter 6 "closures" of the book Groovy and Grails Recipe, and I decided to use the power of closures of Groovy for resource (files) with other problem that I had, decompile in one step every class of jar library. Well, the purpose of this class is call an external java decompiler (jad) from a Groovy class and execute the command into directory where the jar file was decompressed. And by using the power of closures executes recursively into this directory until find the classes. Well, no more words, here the class package demo class Executor { // directory where the library(jar) was decompressed def path /** * Execute the decompilation of the classes into the directory defined in the path * @return */ def decompileClasses(){ def directory = new File(path) //make use of closures defined in the Object class directory.eachFileRecurse { def name = it.absolutePath //if the current resource hasn't a .class extension continues with

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

Convert HTML Content to PDF format using Java

I have researched about to convert HTML to PDF. I got 2 approaches. 1. Using Tidy and XSL-FO. 2. Using the project xhtmlrenderer Basically the 1st approach is : 1. Your HTML will need to be validate in according to XHTML, for this you could use Tidy . 2. After you will need to transform this new XHTML document in XLS-FO, you can review this link to find the stylesheet resource ( XHMTL to XLS-FO ). 3. Finally, convert your XLS-FO document in a PDF document. There are 2 links that could help with this approach: http://www.onjava.com/lpt/a/3924 http://www.javaworld.com/javaworld/jw-04-2006/jw-0410-html.html The 2nd approach is using the project xhtmlrenderer (https://xhtmlrenderer.dev.java.net/) This is easier than 1st approach. This tool hides the steps mentioned in the 1st approach and use CSS. This project uses a CSS parser (http://sourceforge.net/projects/cssparser/). the unique problem the I found out was when you want to use external CSS file in your HTML file. In the example use