Friday, March 29, 2013

ADF: Scroll down to item on your page


I wanted to scroll down to a component in my page and first tried anchor which just did not work on mu input driven screen.

So I tried the af:scrollComponentIntoViewBehavior on my command link and it just worked.

<af:commandLink id="c_cert" text="certify" >
  <af:scrollComponentIntoViewBehavior componentId="sbc4" focus="true" subTargetId="content"/>
</af:commandLink>


... long content


<af:selectBooleanCheckbox value="false" clientComponent="true" id="sbc4"/>



Note: don't do this with anchors on a non read only content page it just get messy

Tuesday, March 26, 2013

ADF: Logger timestamp included

I am doing some performance testing and needed to look at the times produced by the ADF Diagnostic logging items.

Analyze log was not good enough because it is too slow to find the grouped info I needed.

So step one) I loaded my Configure Oracle Diagnostic logging (action menu in the log window) and went straight to the source tab

At the top of the logging .xml file there is an entry

<log_handler name='console-handler' class='oracle.core.ojdl.logging.ConsoleHandler' level='ALL'  formatter='oracle.core.ojdl.weblogic.ConsoleFormatter'/>

it need to be to see the logs in all there glory with timestamps etc <log_handler name='console-handler' class='oracle.core.ojdl.logging.ConsoleHandler' level='ALL'/>

Thursday, March 21, 2013

Oracle Diagnotics logging turning it off : Logging.xml

I mistakenly put oracle Root logger to finest which of course crashed everything. So I restarted JDev then restarted Weblogic horror the setting was still set.

Great so now I could not work.

Solution (thanks google and this oracle doc ): located the logging.xml file in your integrated weblogic server:

C:\Users\[your user]\AppData\Roaming\JDeveloper\system11.1.1.6.38.62.29\DefaultDomain\config\fmwconfig\servers\DefaultServer


Edit it and remove the offending log leve setting. (mine was <logger name='oracle'/ level='FINEST'> ==> <logger name='oracle'/>)

All fixed and working again...

Wednesday, March 20, 2013

Webcenter PS5 migration - Iterative Development setting



Noticed that this setting was different when comparing a newly created ps5 portal project and our current project, might save some time for someone:

In Portal.jws file near the end.

Old
      <hash n="oracle.webcenter.dt.config.WebCenterSettings">
      <value n="iterativeDevelopment" v="false"/>
     </hash>

New
     <hash n="oracle.webcenter.dt.config.WebCenterSettings">
      <value n="iterativeDevelopment" v="true"/>
   </hash>


Or for those with less of an affinity for source :

Friday, March 8, 2013

Start Integrated weblogic 11.1.1.6 hanging 64bit Jrockit

My jdeveloper was hanging on this portion of a new integrated weblogic start.

Module /portalTools/builder of application portalTools [Version=11.1.1.4.0] is transitioning from STATE_NEW to STATE_PREPARED on server DefaultServer.


So I left it overnight and if finally deploy successfully and now everything is working ok.

Webcenter Menu: invalidate cache

We where getting an exception when executing some code that worked on PS3 on PS5. (We are reconstructing our menu based on user roles and we can masquerade as another user on click of a button)

The stack trace of the error included:



<SiteStructureResource><getChildren>
javax.naming.NamingException [Root exception is java.lang.NullPointerException]
at oracle.adfinternal.rc.jndi.CatalogContextWrapper.listBindings(CatalogContextWrapper.java:654)
at oracle.adfinternal.rc.jndi.CatalogContextWrapper.listBindings(CatalogContextWrapper.java:616)


Caused by: java.lang.NullPointerException
at oracle.adfinternal.rc.jndi.FolderContext.loadCache(FolderContext.java:338)
at oracle.adf.rc.spi.jndi.InMemoryContext.checkCacheLoaded(InMemoryContext.java:1401)
at oracle.adfinternal.rc.jndi.FolderContext.loadCache(FolderContext.java:383)

java.lang.reflect.InvocationTargetException
at sun.reflect.GeneratedMethodAccessor916.invoke(Unknown Source)





  public void refreshMenu() {

        SiteStructure model = SiteStructureContext.getInstance().getCurrentModel();
        model.invalidateCache();
        if (this.getLeftMenu() != null)
            AdfFacesContext.getCurrentInstance().addPartialTarget(this.getLeftMenu());
  }


This may not be the best solution but it is a good workaround for what I think is a bug in PS5.





public void refreshMenu() {
        SiteStructure model = SiteStructureContext.getInstance().getCurrentModel();
        model.invalidateCache();
    redirectCurrentPage();
}




public static void redirectCurrentPage() {

  FacesContext fctx = FacesContext.getCurrentInstance();
  ExternalContext ectx = fctx.getExternalContext();

  ControllerContext controllerCtx = null;
  controllerCtx = ControllerContext.getInstance();
  String activityURL =   controllerCtx.getGlobalViewActivityURL(fctx.getViewRoot().getViewId());

  try{
    ectx.redirect(activityURL);
  } catch (IOException e) {
    //Can't redirect
    e.printStackTrace();

  }
}



References:
https://blogs.oracle.com/jdevotnharvest/entry/how_to_efficiently_redirect_an

Wednesday, March 6, 2013

Webcenter Content Default Schemas

DEV_ORAIRM
DEV_OCS
DEV_OCSSEARCH
DEV_URMSERVER
DEV_IPM

@TODO finish this doc with explanations

Oracle XE problems

Had a few issues when trying to connect to oracle xe installed by another user

Getting sqlplus to work
set ORACLE_HOME=C:\oraclexe\app\oracle\product\11.2.0\server
set ORACLE_SID=XE
set PATH=C:\oraclexe\app\oracle\product\11.2.0\server\bin;%PATH%

Connecting as sysdba to change password (ORA-01031: insufficient privileges)
 Type Edit local users in your start menu search bar (Select the first one in the Control panel group)
 Click Groups
 Select ORA_DBA
 Add your user here
 sqlplus / as sysdba from the command prompt with all above variables set
 alter user SYS identified by "newpassword";

Monday, March 4, 2013

OJdeploy: Faster ant build tuning

If you want a quicker ojdeploy experience and you are not on 11.1.2.... and using OJServer the following may help you (along with ojdeply Memory Settings should give you the best you are going to get without splitting the build up and running in parallel):

The more you consolidate your deploys under a single ojdeploy the faster the build:


eg: the first one should be slower

    <ora:ojdeploy xmlns:ora="oraclelib:OJDeployAntTask"
                  executable="${ojdeploy.path}" failonerror="true"
                  ora:statuslog="${basedir}/${oracle.jdeveloper.deploy.dir}/${project.model.deploy.name}-ojdeploy-statuslog.xml"
                  ora:buildscript="${basedir}/${oracle.jdeveloper.deploy.dir}/ojdeploy-build.xml">      <ora:deploy>
        <ora:parameter name="workspace" value="${workspace.fixed.location}"/>
        <ora:parameter name="project" value="${project.model.name}"/>
        <ora:parameter name="profile" value="${project.model.deploy.name}"/>
        <ora:parameter name="nodatasources" value="true"/>
        <ora:parameter name="basedir" value="${basedir}"/>
        <ora:parameter name="nocompile" value="${nocompile}"/>
        <ora:parameter name="clean" value="true"/>
      </ora:deploy>
    </ora:ojdeploy>
    <ora:ojdeploy xmlns:ora="oraclelib:OJDeployAntTask"
                  executable="${ojdeploy.path}" failonerror="true"
                  ora:statuslog="${basedir}/${oracle.jdeveloper.deploy.dir}/${project.deploy.name}-ojdeploy-statuslog.xml"
                  ora:buildscript="${basedir}/${oracle.jdeveloper.deploy.dir}/ojdeploy-build.xml">      <ora:deploy>
        <ora:parameter name="workspace" value="${workspace.fixed.location}"/>
        <ora:parameter name="project" value="${project.name}"/>
        <ora:parameter name="profile" value="${project.deploy.name}"/>
        <ora:parameter name="nodatasources" value="true"/>
        <ora:parameter name="basedir" value="${basedir}"/>
        <ora:parameter name="nocompile" value="${nocompile}"/>
        <ora:parameter name="clean" value="true"/>
      </ora:deploy>
    </ora:ojdeploy>



    <ora:ojdeploy xmlns:ora="oraclelib:OJDeployAntTask"
                  executable="${ojdeploy.path}" failonerror="true"
                  ora:statuslog="${basedir}/${oracle.jdeveloper.deploy.dir}/${project.deploy.name}-ojdeploy-statuslog.xml"
                  ora:buildscript="${basedir}/${oracle.jdeveloper.deploy.dir}/ojdeploy-build.xml">     

      <ora:deploy>
        <ora:parameter name="workspace" value="${workspace.fixed.location}"/>
        <ora:parameter name="project" value="${project.model.name}"/>
        <ora:parameter name="profile" value="${project.model.deploy.name}"/>

        <ora:parameter name="nodatasources" value="true"/>
        <ora:parameter name="basedir" value="${basedir}"/>
        <ora:parameter name="nocompile" value="${nocompile}"/>

        <ora:parameter name="clean" value="true"/>
      </ora:deploy><ora:deploy>
        <ora:parameter name="workspace" value="${workspace.fixed.location}"/>
        <ora:parameter name="project" value="${project.name}"/>
        <ora:parameter name="profile" value="${project.deploy.name}"/>

        <ora:parameter name="nodatasources" value="true"/>
        <ora:parameter name="basedir" value="${basedir}"/>
        <ora:parameter name="nocompile" value="${nocompile}"/>

        <ora:parameter name="clean" value="true"/>
      </ora:deploy>
    </ora:ojdeploy>