re white paper

Upload: oproarts

Post on 30-May-2018

218 views

Category:

Documents


0 download

TRANSCRIPT

  • 8/14/2019 Re White Paper

    1/12

    Copyright1997-2010OPRO

    JapanCo.,Ltd.A

    llrightsreserved.

    OPROARTS Apps Report Engine

    OPRO Japan Co., Ltd.

    Integrating Force.com sites with OPROARTS Apps Report Engine

    http://www.opro.net/oproarts/en

    http://www.opro.net/oproarts/enhttp://www.opro.net/oproarts/en
  • 8/14/2019 Re White Paper

    2/12

    Copyright 1997-2010 OPRO Japan Co., Ltd. All rights reserved.

    1

    IntroductionThis whitepaper discusses how users could use OPROARTS Apps Report Engine Force.

    com application along with Force.com sites to develop scalable web applications easily.

    BackgroundOPROARTS Apps Report Engine

    OPROARTS Apps Report Engine (RE) is a Force.com application introduced by OPRO

    Japan Co., Ltd. This application was developed with the objective of overcoming the Force.

    com limitations in developing multi paged PDF documents and reports.

    RE provides the ease of API based PDF document generation on Force.com platform.

    Force.com application developers will be able to use this application to develop multi

    paged PDF documents with great consistency and accuracy.

    It has improved the PDF rendering on Force.com in a number of methods. It has introduceda band based reporting model where users could specify contents for the page header, footer

    and body. This allows the users to have a structure to the documents. They could specify

    this structure on a visualforce page template.

    RE has also improved the page numbering model and has made significant improvements

    on page numbering during mail merge. Default Force.com page numbering methodology

    does not reset the page numbers when the same PDF document is attached to multiple

    recipients or opportunities. But RE allows re-setting of page numbers when merging tomultiple recipients & multiple opportunities. This feature ensures that each recipient will

    receive his/her copy of correctly-page-numbered PDF document.

  • 8/14/2019 Re White Paper

    3/12

    Copyright 1997-2010 OPRO Japan Co., Ltd. All rights reserved.

    2

    Force.com Sites

    Force.com sites platform is a proprietary technology of Salesforce.com. Sites technology

    is expected to revolutionize the web development industry by offering users a web

    development platform different from traditional web hosting model. Users will be able to

    focus on do it yourself web development on their PaaS platform without seeking expertweb hosting. This platform is primarily based on Visualforce technology. Within this new

    cloud based web development paradigm, users could develop applications rapidly without

    building their web sites from the scratch.

    Integration Benefits

    Force.com site paradigm itself is built with the objective of minimizing the web site

    development time. It allows the users and developers to take to Force.com technology

    beyond CRM. Also it allows the users to integrate their web applications with their CRM

    accounts with ease.

    RE also follows the same principle. Its designed with the objective of reducing the

    development time and cost of reports on Force.com. Users could focus more on the contents

    of their reports without worrying about the structure of the reports.

    Furthermore, the RE is developed to reduce the complexity of generated reports by

    introducing template based report development. This allows the users to separate structure

    from content. If you have to alter the report format, you can alter the report template without

    changing the application.

    In addition users could implement multiple features such as document delivery by email

    or fax. It also allows users to attach and download the document with ease. Rather than

    spending development time on implementing the document delivery, it could be done using

    the report engine.

    Solution

    This solution will show how we can integrate Force.com sites with RE to develop a web

    application easily.

    Users will start developing an integrated application by installing RE on their Force.com

    account. Then, they can extend the RE functionality in to their application by making simple

    API calls to the RE application. They could integrate the RE in to the application domainof the web site being developed.

    Extended benefits of this solution include easy integration in to third party service provider

    apps. For instance users could forward the generated PDF output to email to eax service.

  • 8/14/2019 Re White Paper

    4/12

    Copyright 1997-2010 OPRO Japan Co., Ltd. All rights reserved.

    3

    Sample Application of integrating RE with Salesforce Sites.

    In this sample application we have integrated RE with the Force.com sites to develop a web

    application where participant can download the seminar ticket after completing registration

    process.

    Sample application can be accessed from the following link.

    http://reportengine-developer-edition.ap1.force.com/

    Sample Application Steps

    The potential customer (Lead) fills the seminar registration form and clicks on the preferred

    delivery method; download, mail or fax.

    This action triggers a Lead creation in your Salesforce organization and then calls RE to do

    the creation and delivering of the seminar ticket in PDF format.

    How to develop the integrated application:

    1. Sign up for a free Salesforce.com Developer edition account.

    http://wiki.apexdevnet.com/events/regular/registration.php

    2. Install OPROARTS Apps Report Engine from Appexchange.

    http://sites.force.com/appexchange/apex/listingDetail?listingId=a0N30000001tJBS

    EA2

    Youll be able to use this trial-version for 30-days.

    3. Install following unmanaged package which includes sample source files for the

    integration.

    https://login.salesforce.com/?startURL=%2Fpackaging%2FinstallPackage.

    apexp%3Fp0%3D04t900000000bdn

    Note: If RE is not installed already in your production account, an error will be

    displayed. Please refer RE documentation for more details.

    4. Create new Force.com web site.

    Please refer

    http://wiki.developerforce.com/index.php/An_Introduction_to_Force.com_Sites,

    for an in-depth tutorial on how to create your sites page.

  • 8/14/2019 Re White Paper

    5/12

    Copyright 1997-2010 OPRO Japan Co., Ltd. All rights reserved.

    4

    5. Set active home page and enable access to all the Visualforce pages of the RE and

    RE_Sites_Source packages as shown in the following screen shot. Press Public

    Access Settings button and scroll down to Standard Object Permissions. Set read/

    Write permissions for Lead and Contacts standard objects.

    6. Customize the code as described in code walkthrough section in order to integrate thefront-end, data and RE.

  • 8/14/2019 Re White Paper

    6/12

    Copyright 1997-2010 OPRO Japan Co., Ltd. All rights reserved.

    5

    Code Walkthrough Application home page developed using Force.com Sites

    (RE_Sites_Sample).

    Button actions of the Visualforce page invoke the relevant methods in page controller class

    (SiteController class) and create and pass relevant parameters to the RE. Please refer RE

    documentation for more information about parameter settings.

    Following sample code shows how to set parameters for sending emails. You have to

    customize templateUrl and the returnUrl according to the web Address of the newly

    created Force.com site.

    Eg.

    Change http://reportengine-developer-edition.ap1.force.com/apex/BusinessDoc tohttp://******/apex/BusinessDoc.

    ****** will be default web address of the newly created Force.com site.

    Common parameters define the output template. Action parameters set the other parameters

    for mail such as To addresses and Cc addresses for emailing.

  • 8/14/2019 Re White Paper

    7/12

    Copyright 1997-2010 OPRO Japan Co., Ltd. All rights reserved.

    6

    Code sample for controller class of the home page (SiteController).

  • 8/14/2019 Re White Paper

    8/12

    Copyright 1997-2010 OPRO Japan Co., Ltd. All rights reserved.

    7

    Code sample for controller class of the output template (RE_OutputController class).

  • 8/14/2019 Re White Paper

    9/12

    Copyright 1997-2010 OPRO Japan Co., Ltd. All rights reserved.

    8

    Code sample for output visualforce template (BusinessDoc).

    Code sample for brochure (RE_brochure).

  • 8/14/2019 Re White Paper

    10/12

    Copyright 1997-2010 OPRO Japan Co., Ltd. All rights reserved.

    9

    Note: This brochure will be dynamically generated as a PDF and attached to the email sent

    to the user using the application.

    A screenshot of the output PDF

    User can also use an email template to embed rich contents with merged information in the

    mail body(E.g including an image to the email body). This sample scenario demonstrates

    the use of email templates.

    However, to keep things simple, you can set plain text messages as email body using

    emailBody parameter, without using email templates.

  • 8/14/2019 Re White Paper

    11/12

    Copyright 1997-2010 OPRO Japan Co., Ltd. All rights reserved.

    10

    Sample Visualforce code of the email template (RE_Email_Quote).

    Email Confirmation page

    7. Test your application.

    Now you can try out the integrated application and customize further to suit your

    use-case.

  • 8/14/2019 Re White Paper

    12/12

    Copyright 1997-2010 OPRO Japan Co., Ltd. All rights reserved.

    11

    TEL: +81 3-5765-6510

    FAX: +81 3-5765-6560

    Web: http://www.opro.net/oproarts/en

    Email: [email protected]

    OPRO Japan Co., Ltd.6F, Shibashin-Mita Bldg., 3-43-15,

    Shiba, Minato-Ku, Tokyo, 105-0014,

    Japan.

    Benefits

    Integration of RE in to Force.com sites will expand the benefits of Sites platform. It will

    instantly enable developers to implement document generation and delivery features at

    minimal cost and time.

    Reduced web development cost and time Easy integration More precise output generation to end users Easy customization of templates