Thursday, 24 October 2013

ADF : ViewCriteria : Persisting Query Criteria Results Across Sessions with Oracle MDS

ViewCriteria : Persisting Query Criteria Results Across Sessions with Oracle MDS

Three setups explained in this:
Setup1: store viewcriteria saved search in MDS
Setup2: store <af:table - column change in MDS
Setup3: override <af:table - column persistant change not to store in MDS for particular column.

Setup1:store viewcriteria saved search in MDS

Note :
From the above link we will be able to store all searched criteria in to MDS and it will be retrived next time when the same user logs in.

Setup2: store <af:table - column change in MDS

Enabling Implicit Personalization Across Session


But: If we want to persist (store) the ADF table column changes also in to MDS, we have to add the below code into adf-config.xml file. (For more info refer -> http://blog.us.oracle.com/lift/?97408963)

############################################################################

<adf-faces-config xmlns="http://xmlns.oracle.com/adf/faces/config">
    <persistent-change-manager>
      <persistent-change-manager-class>oracle.adf.view.rich.change.MDSDocumentChangeManager</persistent-change-manager-class>
    </persistent-change-manager>
    <taglib-config>
       <taglib uri="http://xmlns.oracle.com/adf/faces/customizable">
        <tag name="showDetailFrame">
          <attribute name="expansionMode">
            <persist-changes>
              true
            </persist-changes>
          </attribute>
          <attribute name="contentStyle">
            <persist-changes>
              true
            </persist-changes>
          </attribute>
        </tag>
        <tag name="panelCustomizable">
          <persist-operations>
            all
          </persist-operations>
        </tag>
      </taglib>
      <taglib uri="http://xmlns.oracle.com/adf/pageeditor">
        <tag name="layoutCustomizable">
          <persist-operations>
            all
          </persist-operations>
          <attribute name="type">
            <persist-changes>
              true
            </persist-changes>
          </attribute>
        </tag>
      </taglib>
      <taglib uri="http://xmlns.oracle.com/adf/faces/portlet">
        <tag name="portlet">
          <attribute name="expansionMode">
            <persist-changes>
              true
            </persist-changes>
          </attribute>
        </tag>
      </taglib>
      <taglib uri="http://xmlns.oracle.com/adf/faces/rich">
        <tag name="column">
          <attribute name="displayIndex">
            <persist-changes>
              true
            </persist-changes>
          </attribute>
          <attribute name="frozen">
            <persist-changes>
              true
            </persist-changes>
          </attribute>
          <attribute name="noWrap">
            <persist-changes>
              true
            </persist-changes>
          </attribute>
          <attribute name="visible">
            <persist-changes>
              true
            </persist-changes>
          </attribute>
          <attribute name="width">
            <persist-changes>
              true
            </persist-changes>
          </attribute>
        </tag>
      </taglib>
    </taglib-config>

  </adf-faces-config>
#########################################################################


This above setup is applied for all the adf:table -> column -> visible attribute.

Setup3: override <af:table - column persistant change not to store in MDS for particular column.

Some times we may have requirement not to persist particular table-> column, In that case you can go with the below setup.


1. Select af:table -> column component -> go to Property inspector -> expand Advanced tab -> DontPersist select All.
(then all attributes will not be persisted for that particular column, actually this overrides the above adf-config.xml setup only for this particular column)

For More Info : http://fmwdocs.us.oracle.com/doclibs/fmw/E10285_01/web.1111/b31974/ad_persist.htm#CIHDEBFJ




Monday, 21 October 2013

ADF : ViewCriteria: ViewCriteria -> In Advance Mode -> Customization

ViewCriteria: In ViewCriteria -> In Advance Mode -> 

 How to remove drop down choice.


http://myforums.oracle.com/jive3/thread.jspa?messageID=6987958&

http://weblog.singhpora.com/2012/04/how-to-showhide-operators-in-adfquery.html


<ViewCriteriaRow
  Name="vcrow50"
  UpperColumns="1">
   <ViewCriteriaItem
     Name="LastUpdateDate"
     ViewAttribute="LastUpdateDate"
     Operator="="
     Conjunction="AND"
     Required="Optional">
        <CompOper
            Name="LastUpdateDate"
            ToDo="-1"
            Oper="BEFORE"
        </CompOper>

   </ViewCriteriaItem>

Hide some of the fields from "Add Fields" option of View Criteria


http://myforums.oracle.com/jive3/thread.jspa?threadID=1272634&tstart=30





How to Create Custom Operators.

http://docs.oracle.com/cd/E24382_01/web.1112/e16182/web_search_bc.htm#ADFFD2457

http://myforums.oracle.com/jive3/thread.jspa?messageID=7061788&

###############################################################
 <ViewCriteriaRow
      Name="vcrow0"
      UpperColumns="1">
      <ViewCriteriaItem
        Name="Salary"
        ViewAttribute="Salary"
        Operator="="
        Conjunction="AND"
        Value=""
        Required="Optional">
        <CompOper
            Name="Salary"
            ToDo="1"
            OperDescStrCode="greater_salary"
            Oper=">10000"
            MinCardinality="0"
            MaxCardinality="0" >
            <TransientExpression><![CDATA[ return " > 10000"
                ]]></TransientExpression>
        </CompOper>
        </ViewCriteriaItem>
    </ViewCriteriaRow>



##############################################################

 

 





Wednesday, 7 August 2013

UCM : UCM IdcService: GET_SEARCH_RESULTS in binder object can i use ..?

UCM IdcService: GET_SEARCH_RESULTS in binder object can i use <contains>..?

I am querying UCM from java code, below code i am using.

binder.putLocal("IdcService", "GET_SEARCH_RESULTS");

binder.putLocal("QueryText",
"dSecurityGroup <matches> `" + ucmSecurityGroup +"` <AND> <NOT>(xComments <matches> `Processed=YES`)");

we have <matches> in query , |||ly do we have <contains> option...?

############################Solution######################################
From Browser:

We can test by giving different options as shown below.

http://<<Ip address>>:7012/cs/idcplg?IdcService=GET_SEARCH_RESULTS&QueryText=xComments+<substring>+`Processed=YES` -- working (substring is equivalent to "like")

http://<<Ip address>>:7012/cs/idcplg?IdcService=GET_SEARCH_RESULTS&QueryText=xComments+<contains>+`Processed=YES` -- not working

http://<<Ip address>>:7012/cs/idcplg?IdcService=GET_SEARCH_RESULTS&QueryText=xComments+<matches>+`Processed=YES` -- working

Refer - https://blogs.oracle.com/kyle/entry/searching_for_null_values_ucm
From JAVA:
I used code as shown below from java code.

             binder.putLocal("QueryText",
                            "dSecurityGroup <matches> `" + ucmSecurityGroup +"` <AND> dDocAccount <starts> `" +
                            transformedAccount+"` <AND>  ( <NOT>(xComments <substring> `ProcessedBy=`) <OR> xComments <matches> ``) ");

After substituting the value query  becomes:



dDocAccount <matches> `crm$/lead$/import$` <AND> dSecurityGroup <matches> `FAFusionImportExport` <AND>  ( <NOT>(xComments <substring> `ProcessedBy=`) <OR> xComments <matches> ``)
 From UCM Console:

Attached is the query builder where we can test our query is correct or not..




ADF : ViewCriteria: ViewCrietiria applied on ViewLink of ApplicationModule



ViewCrietiria applied on ViewLink of ApplicationModule and dragged as Tree on UI.



Hi All,

I have View Link , for child ViewCritiria is applied.

Eg : DeprtmentVO
|_
EmployeeVO (Applied ViewCritiria)

I am using this view link as Tree table on my UI (The ViewCritiria is not working on child)

but if i use the same link as maste detail table (View Critiria will work on table).

Attached are the 2 files
1. How i am applying ViewCritiria on child
2. How VC is working for Table, and not working for Tree.
------------In VOImpl -> we have to override the below function------------------------------
@Override
public void prepareRowSetForQuery(ViewRowSetImpl vrs, Row[] rows)
{
Boolean isMktImpChildInstance = false;
String viewInstanceName = this.getViewObject().getName();
//isParent checks if the VO is used for fetching only the root territories
isMktImpChildInstance = ("DepartmentROVO_EmployeeROVO_Dept_Empl_Link_EmployeeROVO".equals(viewInstanceName));
//If the logged in user is enterprise admin, fetch only the global territory
if (isMktImpChildInstance)
{
ViewCriteria vc1 = this.getViewCriteria("EmployeeIDROVOCriteria");
vc1.setUseBindVarsForLiterals(false);
this.applyViewCriteria(vc1, true);
}
super.prepareRowSetForQuery(vrs,rows);
}

ADF : Groovy: How to use Groovy Expression for ViewObject -> BindVariable

--------------------------------------In My VOImpl-------------------------------------------------------

import oracle.apps.fnd.applcore.common.ApplSessionUtil;

public String getLoggedInUser(){
String loggedInuser = "";
if(ApplSessionUtil != null){
loggedInuser = ApplSessionUtil.getUserName();
}
return loggedInuser;
}
----------------------------------In VO.xml -> For Bind Variable -> Expression-------------------------

adf.object.viewObject.loggedInUser