Pages

Wednesday, November 13, 2013

Fetch User's Email Address in UCM Custom Component when using AD as LDAP

I was working on a custom component in UCM and AD was used as LDAP . There was a need to send emails to multiple users subscribed to a custom query. I used the below code to fetch the user's email address in UCM component -

    private String getIndividualUserEmail(String userId) {
        String emailAddress = "";

        try {
            JpsContextFactory ctxf = JpsContextFactory.getContextFactory();
            JpsContext ctx = ctxf.getContext();
            IdentityStoreService storeService =
                ctx.getServiceInstance(IdentityStoreService.class);
            IdentityStore idStore = storeService.getIdmStore();
            SimpleSearchFilter simpleFilter =
                idStore.getSimpleSearchFilter(UserProfile.USER_NAME,
                                              SimpleSearchFilter.TYPE_EQUAL,
                                              userId);
            SearchParameters params =
                new SearchParameters(simpleFilter, SearchParameters.SEARCH_USERS_ONLY);
            SearchResponse sr = idStore.searchProfiles(params);
            System.out.println(sr.getResultCount());
            while (sr.hasNext()) {
                Identity id = sr.next();
                UserProfile profile = (UserProfile)id;
                emailAddress = profile.getBusinessEmail();
                System.out.println("Email :- " + profile.getBusinessEmail());

            }
        } catch (JpsException e) {
            System.out.println("getIndividualUserEmail : JpsException Occured ");
        } catch (IMException e) {
            System.out.println("getIndividualUserEmail : IMException Occured ");
        }
        return emailAddress;
    }

Enjoy

InputListOfValues - Control custom popup launch

I went through the code of ADF Faces Demo-inputListOfValues -
1. It has customPopup in searchFacet.
2. A custom PopuplaunchListener .

If you write someValue in inputField and tab out, customPopupLaunch Listener gets called. It checks if the entered value is complete then popup Launch is cancelled using below code.

event.setLaunchPopup(false); 

Small addition to above requirement : You write the complete value and click lov icon. Popup gets launched... But what if you want to block the popup launch on click of lov icon when complete value is entered.

Thanks to Oracle Forum.. where I got the answer.
https://forums.oracle.com/thread/2598020

All you need to do is short-circuit the JSF Life cycle.

FacesContext.getCurrentInstance().responseComplete();

Enjoy. 

Friday, September 27, 2013

Dynamic Region Refresh Issue


In general when we use dynamic region, we have multiple buttons/links which change the taskflowId and partial trigger on dynamicRegion . This refreshes the taskflow loaded in dynamic Region. Recently I encountered a usecase where dynamic region is not refreshing or reset is not happening.




InputText fields has required="true" and CommandButtons in the above page have immediate="true" so that it is able to navigate to another taskflow. Now as we go ahead with implementation of changing the taskflowId and partialTrigger on dynamicRegion, the value in the inputText field is retained, even though taskflow is reloaded .

Finally I was able to resolve this reset issue with help on Jdeveloper And ADF Forum..https://forums.oracle.com/thread/2585988 . Thanks to Frank.

Solution is to switch the taskflow using below code :
oracle.adf.view.rich.util.ResetUtils.reset(regionId_in_here);

Download the sample from here


Wednesday, September 4, 2013

How to get the current userName in UCM Service Handler


It is very often that current user's username is required in UCM service. Username of the user executing the service can be retrieved using below code :


import java.util.Properties;
import intradoc.shared.UserData;
import intradoc.server.Service;

    private String getCurrentUsername(Service service) {
        UserData userData = service.getUserData();
        Properties properties = userData.getProperties();
        String userName = userData.getProperty("dName");
        return userName;
    }

Enjoy

Sunday, July 14, 2013

Review : Oracle ADF 11gR2 Development Beginner's Guide

Though we have couple of ADF books available in market, but this one Oracle ADF 11gR2 Development Beginner's Guide has is own importance. The book is a real starter for beginners having basic knowledge of Java. Author has explained ADF concepts in below steps :
1. a description of the issue,
2. performance of the execution ("time for action"),
3. an explanation of how the solution works ("what just happened?"),
4. Explore things ("Have a go hero") and
5. Finally a quiz as check for reader to understand whether he learnt concepts or just mugged them up.

Book covers the ADF concepts distributed in 11 chapters as follows:


Chapter 1, Installing and Configuring JDeveloper IDE, familiarization with JDeveloper which is the official IDE for Oracle ADF applications.

Chapter 2, Getting Started with ADF, explains key concepts of Oracle ADF : MVC, Entity Objects, View Objects and Applications Modules.

Chapter 3, Understanding the Model Layer, explains the entity and viewobjects in details.

Chapter 4, Validating and Using the Model Data, covers the validations governed through Model layer. Declaration validation and Groovy usage is explained with simple example.

Chapter 5, Binding the Data, explains the binding between model and view layers of an Oracle ADF application and key concepts involved.

Chapter 6, Displaying the Data. Concept of Page Template and other ADF Components are explained which are required for building Web Pages.

Chapter 7, Working with Navigation Flows, presents the concept of a Task flow and the different types of task flows that ADF offers. ADF Lifecycle is also covered in this chapter.

Chapter 8, Layout with Look and Feel, explains skinning for ADF Applications. Create and deploy skins is also covered with example.

Chapter 9, Implementing Security, is about roles, permissions, and other security concepts related to Oracle ADF security.

Chapter 10, Deploying the ADF Application, explains the deployment of ADF Application. It covers the deployment profile creation including structure of the deployment files and deployment descriptors.

Chapter 11, Advanced Features of ADF, this chapter is all about advance configurations including: tuning Entity Objects, tuning View Objects, debugging ADF applications, among others.


Over all it's a good starter for beginner and reference for intermediate level ADF learners.



Monday, June 17, 2013

How To Locate Intradoc Jar, RIDC Extensions and Site Studio into JDeveloper


Importing RIDC extension into jDeveloper:
(Help -> Check For Updates -> Source -> Install From file)
%MIDDLEWARE_HOME%/Oracle_ECM1/ucm/Distribution/RIDC/jdev


Importing Site Studio extension into jDeveloper:
(Help -> Check For Updates -> Source -> Install From file)
%MIDDLEWARE_HOME%/Oracle_ECM1/ucm/Distribution/SiteStudioExternalApplications/jdev

Intradoc Classes are available as JAR in following location :
 %MIDDLEWARE_HOME%//Oracle_ECM1/ucm/idc/jlib/idcserver.jar


Done

Sunday, June 16, 2013

Webcenter Content UserGuide Overview in Single Page

I am going to talk a little about Webcenter Content here. Nothing new in this post... it is just summary I tried to pull from UserGuide for my reference.

Overview 
When a file is checked in, Content Server stores the original or native file in a central repository for native files. For systems with conversion features installed and enabled, a web-viewable version of file is created and stored in special repository for web-viewable files. When a file cannot be converted, native file is stored in special repository of web-viewable files.
A file checked in to content server is called a Content Item.The native file and any Web-viewable files associated with a content item are called Renditions.

Check out, modify and then checkin will create new revisions of the content item. Every content item in the repository for Web-viewable files has a persistent URL that does not change from one revision to the next. The most current version is always displayed when you point your browser to the URL of a content item.

Metadata is information about a content item, such as the title, author, release date, and so on.When you check in a content item, you assign some metadata values, while Content Server assigns some metadata values automatically. The metadata is stored in a database that works with Content Server.

Users

Content Server defines two types of users:
Consumers:  No modification ...just view .
Contributors: Create , Find, View, Revise , Print permission.




Access Control List (ACL) Security

An access control list is a list of users, groups, or enterprise roles with permission to access or interact with a particular content item.

User Access List
Group Access List
Role Access List

To use access control lists with content items, you assign one or more predefined users, groups, or roles to the item. In addition, you assign the permissions (Read (R), Write (W), Delete (D), or Admin (A)) to each of the access list entries you specify.


Indexing

If your system is configured for full-text search, the indexing engine makes a list of all the words in every file in HTML, PDF, TXT, XML, and other supported formats, and stores the list in a database. After the indexing process completes, the file is released to Content Server.

Images And Videos

Digital Asset Manager functionality can be used to quickly find, group, convert, and download images and videos of various sizes, formats, and resolutions to meet your business needs, all while maintaining a consistency of use across your organization.


Managing Content with Folders and WebDav

Content Server includes components that provide a hierarchical folder interface, similar to a conventional file system, for organizing and managing some or all of the content in the repository.


Folders: This component (FrameworkFolders component) provides a hierarchical folder interface within the browser, similar to a conventional file system, for organizing, locating, and managing repository content and content item metadata. The Folders functionality is installed but disabled by default.

Contribution Folders: This optional component (Folders_g component) provides a hierarchical folder interface within the browser, similar to a conventional file system, for organizing repository content. The component is installed but disabled by default. The newer, Folders component is meant to be a replacement for Contribution Folders.

WebDAV (Web-Based Distributed Authoring and Versioning): Both folder components work with Content Server's built-in WebDAV functionality to allow users to remotely manage and author content using clients that support the WebDAV protocol. The WebDAV interface provides a subset of the options available through the browser interface. In general, you can create, delete, move, and copy both folders and content items, and you can modify and check in content items. To check out content items through the WebDAV interface, you must use a WebDAV client that can open the file. To perform other management tasks, such as specifying or propagating metadata values, you must use the standard browser interface.


Grouping Content into Folios

A folio is a logical grouping or framework to organize content stored in Content Server.
With a simple folio, you collect one or more items in a single level. With an advanced folio, you can organize content in a hierarchy of folders.
An advanced folio can contain folders, called nodes, placeholders for content, called slots, and content items These elements are displayed by default in a hierarchical structure, similar to a standard file system.



Routing Content Through Workflows

The workflow process routes a file for review and approval before it is released to the Content Server repository. You can optionally sign and approve a file with an electronic signature which uniquely identifies the contents of the file at a particular revision and associates the signature with a particular reviewer.

Criteria workflow - files automatically go into a workflow if the values entered in the metadata fields upon check-in meet certain criteria. Criteria workflows are useful for individual content items that are approved by the same reviewers on a regular basis.

Basic workflow - files are specifically identified in the workflow, along with the contributors, reviewers, and steps. This type of workflow requires an administrator to initiate the process, and is best suited for groups of content items that go through a workflow or individual content items with unique workflow requirements.


Monday, March 11, 2013

Taskflow Template usage For Navigation


This post is about usage of taskflow template for handling navigation. Whenever I google about taskflow template, the links available used to show the exceptionHandling done through taskflow template. Wondered about other scenarios where Taskflow Template can be used. Here goes one sample for taskflow template usage.

Consider the following usecase :

Taskflow has multiple pageFragments and  other taskflow call activity. Then how to handle return from the taskflow and enter proper pageFragment or taskflow.


Each pageFragment includes another reusable pageFragment "navigation.jsff " to have links available to navigate across functionality. Sample Fragment Code :



Here goes the sample for navigation.jsff -



Now user is inside view1 of tf1 and click on ViewPersonPolicy link. One way of defining navigation is all taskflows has taskflow return activities (outcome = next action string ) defined so that it returns from the taskflow (tf1 ) and enters proper taskflow as requested.

Here comes the usage of taskflow template. Define all taskflow return activities with proper outcome in template then generate tf1, tf2, and tf3 based on that template . On clicking of any link in navigation.jsff proper taskflow return activity will be used to exit which has outcome for the requested pagefragment.

You will get more idea after looking at the application code available for download here.


DataControl Scope Shared across tabs in dynamic Tab Shell


This post is about illustration of dataControl scope sharing across tabs when using dynamic tab shell template. If you are new to dynamic tab shell template, refer to below two links : -

Dynamic Tabs UI Shell Template Functional UI Pattern ->
http://www.oracle.com/technetwork/developer-tools/adf/uishell-093084.html

A Template with Behaviour By Frank Nimphius->
http://www.oracle.com/technetwork/issue-archive/2012/12-mar/o22adf-1518265.html

What happens when you try to open multiple taskflows ( Having dataControl scope marked as shared ) in different tabs - It gets shared across tabs also.


Download the application and modify database connection to point to your HR Schema.

1. Run the First.jspx. Click on "Start First Activity". Select any department.



2. Now Click on "". You see the row currency is maintained across tabs. Both the taskflows has their datacontrol scope shared.



Try selecting the departments in one taskflow and then open the second taskflow in another tab. You will see that the same department is selected in the departments table.

Sample application can be downloaded from here.