فایل پیوست شامل موارد استانداردی است که در پروژه های Oracle ADF باید رعایت شود.
Abstract</p>
<p>This document sets out ADF code guidelines, practices<br />
and conventions for applications built using ADF<br />
Business Components and ADF Faces Rich Client<br />
(release 11g and greater). The guidelines are<br />
summarized from a number of Oracle documents and<br />
other 3rd party collateral, with the goal of giving<br />
developers and development teams a short circuit on<br />
producing their own best practices collateral.</p>
<p>The document is not a final production, but a living<br />
document that will be extended to cover new information<br />
as discovered or as the ADF framework changes.<br />
سلام در این بلاگ قصد دارم نحوه اتصال وب لاجیک به سایتهایی که SSL هستند را توضیح بدهم.
اگر قصد دارید که مثلاً در داخل یک برنامه مانند JSF یا ADF به وب سایت بانک پاسارگاد متصل شوید تا از نتیجه تراکنش مطلع گردید با یک HTTPClient ساده نمیتوانید این موضوع را حل نمایید زیرا وب لاجیک امکان اتصال را به شما نمیدهد برای این منظور باید فایل crt وب سایت امن را در داخل وب لاجیک وارد نمایید تا یک لینک trust بین سرور ها ایجاد گردد.
مرحله اول گرفتن فایل crt از وب سابت میباشد در تصاویر زیر من نحوه گرفتن فایل را از یک وب سایت نمونه مانند سایت بانک پاسارگاد نمایش داده ام.
مراحل زیر را به ترتیب انجام دهید تا فایل certificate دانلود گردد برای این منظور من از Firefox استفاده کرده ام.
سایت بانک پاسارگاد برای چک کردن وضعیت پرداخت: https://fanapepay.bpi.ir/checktransactionresult.aspx
پس از ذخیره فایل به مسیر jdk مربوط به middleware home بروید در کامپیوتر من این مسیر معادل D:\Oracle\Middleware\jdk160_24\bin
و فایل گرفته شده pasargad.pem را در آن فلدر ذخیره نمایید.
سپس به command prompt رفته و کدهای زیر را به ترتیب اجرا نمایید.
در این مرحله کلمه عبور برابر است باemoTrustKeyStorePassPhrase
در این مرحله برای سوال پرسیده شده کلمه yes را وارد نمایید.
حال وب لاجیک به راحتی میتواند به سابت SSL متصل گردد.
کد ارسال و نمونه برنامه در پیوست وجود دارد.
نمونه کد نوشته شده در managed bean برای ارسال کد به سایت پاسارگاد و خواندن جواب بازگشت
توسط پروژه زیر میتوانید به وب لاجیک متصل گردید و کلیه کارهای زیر را انجام دهید.
اضافه کردن کاربر
حذف کاربر
اضافه کردن کاربر به گروه
چک کردن گروههایی که ماربر در آن عضو است…
لیست کردن تمام کاربران
لیست کردن تمام گروه ها
و خلاصه تمام کارهایی که با کاربران و گروههای وب لاجیک میخواهید انجام دهید.
این پروژه با استفاده از MBEAN به WEBLOGIC متصل میگردد و همانطور که میدانید با اتصال MBEAN درست مانند این است که شما پشت کنسول وبلاجیک هستید.
برای اجرای پروژه کافیست پروژه را در JDeveloper باز نمایید (هر نسخه از 11g) و سپس فایل config.properties را اصلاح نماییدو اطلاعات AdminServer وبلاجیک آن را تنظیم و سپس آن فایل جاوا را اجرا و از توابع داخل آن استفاده نمایید.
Generating PDF file or any sort of file is a common requirement among web portal applications. Generally, the requirement could be getting some data from a database and writing the same on to the file.
Oracle ADF (Application Development Framework) is a fast, simple and rich internet application development framework. Oracle ADF Faces Components are Ajax-enabled components that help in building a rich web user interface for Java EE applications.
When it comes to reports in Oracle ADF, the framework supports a feature called “Export to Excel.” The component supporting that feature isaf:exportCollectionActionListener. But unfortunately, even though it’s a sophisticated tool for designing and developing web applications, it doesn’t have a feature for generating dynamic PDF files. This post will help you understand how to generate PDF and download it on a command button click.
Requirements:
1. Generate some static data PDF file on a command button click.
2. Download the same file to the specified location.
Process:
1. Create a new project.
Here we use Jdeveloper 11g Release (11.1.1.3.0) version. In order to create a new project click on option File > New option in the pane. The dialog appears as below and select Fusion Web Application (ADF).
Once you create a new Application, JDeveloper creates you two projects as shown in the below screen shot.
2. Create a UI Page:
Our goal is to generate a PDF file when clicked on a command button and download the generated file. Now to have that provision we need a UI page with a command button. So we shall create a UI page with simple Command Button.
Step 1: Right on View Controller project, select New option and then JSF page under JSF category.
Step 2: create a Jspx page as shown below.
Note: Make sure you check Create as XML Document option.
Step 3: Once you are done with creating the Jspx file, drag and drop the Panel Box and Command Button from the Common Components palate. The page looks like this:
Step 4: Drag and drop fileDownloadActionListener on to the command button from the Component Palate. And change properties as shown in the below screen.
Properties:
Where Filename is the output file name and Method is the Bean method call when clicked on button.
Source:
3. Create a Bean classes:
To generate a PDF and download the file we need some Java program which runs at the server side and provides the desired results. To make this happen we need a Jar file called IText. In this sample, we used ITextPdf-5.1.3.jar.
Step 1: In order to reflect the classes in the jar file which helps in generating PDF, we need to import the jar file. To import jar file, Click on ViewController > ProjectProperties > Libraries and Classpath > Add Jar/ Directory and import from the location as shown in the below screen shot.
Step2: Create a two bean (java) classes, where one class contains all the Accessors and another class contains the PDF generation and Downloading methods.
Note: The dialog box pop up appearance depends on browser settings. Make sure that you have “Ask before download” option checked in your browser settings.
Hopefully this post is helpful!
Do you have questions or need clarification? Let me know what you think – or have anything to add to this topic. Post in the comments section or click the button, below, and I’ll get back to you!