Wednesday, August 20, 2014

IE 11 problem workaround - file names messed up


Note: patch 18277370 needed for 11.1.1.7 to run ie 11

All our download links on ie 11 file names looked like they have been url encoded something like:

UTF-8_Q_Bobs=5FBooks=2Epdf=

Really irritating for our users so the quick and dirty for now was to modify (luckily all our download code is common) our download method to reset the headers on the response.




<af:fileDownloadActionListener filename="test.txt"
    contentType="application/octet-stream"
    method="#{bean.startDownload}"/>



    public void startDownload(FacesContext facesContext, OutputStream outputStream) {
        Row docName = (Row)JSFUtils.getFromRequest("ucmCurrentDocument");
        applyIE11Fix(docName);
 ... write file to output stream here ...
    }


    private void applyIE11Fix(String docName) {
        RequestContext requestCtx = RequestContext.getCurrentInstance();
        Agent agent = requestCtx.getAgent();
        String version = agent.getAgentVersion();
        String browser = agent.getAgentName();

        //if ie 11
        if (browser != null && "ie".equals(browser) && version != null && version.startsWith("11")) {

            HttpServletResponse resp = JSFUtils.getResponse();
            String finalName = docName;

            try {
                finalName = URLEncoder.encode(docName, "UTF-8");
            } catch (UnsupportedEncodingException e) {
            }

            resp.setHeader("content-disposition", "attachment; filename=\"" + finalName + "\"");
            resp.setContentType("application/octet-stream");
        }
    }



Wednesday, May 7, 2014

MDS: Update script - NOT RECOMMENDED

For my use only don't use this without understanding what you are doing.

I had a bunch of old MDS features in my menu which was causing our menu to collapse on login.

(The collapse feature was set to not persist so the users had no way of fixing this).


Instead of writing code or purging all settings from MDS for that page I decided on a data fix.

Forgive my sql skills this was a quick and dirty.

SCHEMA: ???_MDS
TABLE : MDS_ATTRIBUTES - this is where all the mds configuration is kept for each item and attribute.
TABLE : MDS_PATHS - this is where the file name for the resource you are looking for is kept. (ie page.jsff) you can also find the user in the path so you can do this for a specific user.

DECLARE
    v_content_id MDS_PATHS.PATH_CONTENTID%TYPE;
    v_col_seq MDS_ATTRIBUTES.ATT_COMP_SEQ%TYPE;

    CURSOR v_path_cursor IS
      SELECT pa.PATH_CONTENTID FROM MDS_PATHS pa WHERE pa.PATH_PARTITION_ID = 3 AND PA.PATH_TYPE = 'DOCUMENT' AND PATH_NAME like '%portalTemplate%';
     
BEGIN
    OPEN v_path_cursor;
    LOOP
        FETCH v_path_cursor INTO v_content_id;
        EXIT WHEN v_path_cursor%NOTFOUND;

        BEGIN
          SELECT ATT_COMP_SEQ into v_col_seq FROM MDS_ATTRIBUTES a WHERE a.att_contentID = v_content_id AND a.ATT_PARTITION_ID = 3 AND a.ATT_VALUE = 'collapsed';
          EXCEPTION
          WHEN no_data_found
          THEN v_col_seq := null;
        END;

        IF v_col_seq IS NOT NULL THEN
          UPDATE MDS_ATTRIBUTES SET ATT_VALUE = 'false'  WHERE att_contentID = v_content_id AND ATT_PARTITION_ID = 3 AND ATT_COMP_SEQ = v_col_seq AND ATT_LOCALNAME = 'value'  AND ATT_VALUE = 'true';
          dbms_output.put_line('updating:' || v_content_id || '-'  || v_col_seq || ' split to false');
        END IF;
       
     END LOOP;
     CLOSE v_path_cursor;
END;
/


COMMIT;

NOTE: Restart Portal servers.

Web Center Content : quick status update

This is not recommended:

I really needed a document to go from status Done to status Released for a presentation on our training environment and did not have time to restore.

(Our indexer was broken because we had files missing due to a db restore but no file system restore)

(In the ???_OCS schema)

Step 1) Find the revision

  SELECT * FROM REVISIONS where ddocname = '1390427192270'

Step 2) Update the revision based on did

UPDATE REVISIONS SET DSTATUS = 'RELEASED', DRELEASESTATE = 'Y', DRELEASEDATE = SYSDATE where did = 109336;

Now I could search for the document yay!


Errors found in the logs:

Universal Content Management - Content Server Indexing aborted.

An error occurred during indexing.
[APP: Oracle Universal Content Management - Content Server] general exception[[
intradoc.common.ServiceException: !csIndexerRenameFailedAbort
        at intradoc.indexer.CommonIndexerBulkLoader.handleLoadError(CommonIndexerBulkLoader.java:614)
        at intradoc.indexer.CommonIndexerBulkLoader.loadRecordWebChange(CommonIndexerBulkLoader.java:247)
        at intradoc.indexer.IndexerBulkLoader.createBulkLoad(IndexerBulkLoader.java:322)
        at intradoc.indexer.IndexerBulkLoader.doWork(IndexerBulkLoader.java:171)
        at intradoc.indexer.Indexer.doIndexing(Indexer.java:419)
        at intradoc.indexer.Indexer.buildIndex(Indexer.java:327)
        at intradoc.server.IndexerMonitor.doIndexing(IndexerMonitor.java:1026)

Friday, March 28, 2014

What helps me with ADF development

UI

FireBug - https://addons.mozilla.org/en-US/firefox/addon/firebug/
Colors - http://www.colorhexa.com
Gimp - http://www.gimp.org/
Fiddler - http://www.telerik.com/fiddler/web-debugging
Selenium - http://docs.seleniumhq.org/

Build
Jenkins
Maven
Ant
Cobetura, PMD, checkstyle

Other
JIRA
Confluence
JMeter


“Always code as if the guy who ends up maintaining your code will be a violent psychopath who knows where you live.”

- Martin Golding

Wednesday, March 19, 2014

BI Publisher : Desktop Installation

Ok so I have 64-bit windows 7, Word 2007 32-bit, 64 bit jrockit

I got an error installing the desktop - said I needed jre 1.6 or above.

So I went to - http://www.java.com/en/download/manual.jsp and downloaded the latest version 7 64bit vm installed this and then installed the 32-bit bi desktop msi.

Everything worked from there.


Friday, January 24, 2014

ADF: dvt:hierarchy viewer not working

A screen of ours that worked in a sub project would not render in our main web center project.
The only clue was that it was a dvt:hierarchy screen and the screen just stayed loading all the time.
To make a long story sort someone had set  disabled in the ADF config file - set it to downgrade and all was good.

Tuesday, November 26, 2013

Ojdeploy : Tuning exercise

First of all all the tuning I am doing is for out continuous integration server because I build time have hit 25 minutes on the solaris 11 machine (on my desktop the same build it takes 11 minutes).

So where I am working is in the "ojdeploy.conf" file located in [jdev location]/jdev/bin


Finding most java settings make a difference and mostly

Using jrockit I have got it down to 21 minutes

AddVMOption -Xmx1g
AddVMOption -Xms1g
AddVMOption -Xverify:none
AddVMOption -Djava.net.preferIPv4Stack=true

Fastest solaris build so far is on the standard 32-bit jdk - weighing in at 18 minutes

AddVMOption -Dapplication.handle.help=true
AddVMOption -Xmx1g
AddVMOption -Xms1g
AddVMOption -Dsun.awt.disablegrab=false
AddVMOption -XX:MaxPermSize=512M
SetJavaHome /usr/java
AddVMOption -Xverify:none
AddVMOption -Djava.net.preferIPv4Stack=true
AddVMOption -XX:PermSize=128m


will update with my findings but parameters like largePages, parallel gc, -server etc just seem to make things worse.


And the greatest build gain so far - using parallel ant tasks, cut my build time in half.