This discussion is archived
2 Replies Latest reply: Nov 30, 2012 6:48 AM by Jerome.Dubois RSS

How to overwrite base.js

Jerome.Dubois Newbie
Currently Being Moderated
Hi,


I know it's not recommended but I need to overwrite base.js (weblayout\resources\schema\base.js). One function is in error.

How? And especially, how to deploy it correctly with a component because everytime I modify the file manually, it's overwritten at the restart of Content server.


Thanks to all.

Jay.
  • 1. Re: How to overwrite base.js
    William Phelps Expert
    Currently Being Moderated
    You should actually do this in a component. That way, your change isn't overwritten.

    The base.js file is generated by the system reading the template file identified as "SCHEMA_BASE_JS" in the layouts template definition file. The actual template file is located in "<MIDDLEWARE_HOME>\Oracle_ECM1\ucm\idc\resources\core\templates\schema_base.js"

    I'm assuming you know how to create components. So in a nutshell...
    - Create a new component.
    - In the component, define a new template named "SCHEMA_BASE_JS". Base the template on the file mentioned above.
    - In the Merge Rules Section, merge your template resource table into the table "IdcLayoutTemplates"

    At this point, after enabling the component and restarting the managed server, you have technically overridden the OOTB template. Now make your changes in the template file in your custom component. After making your changes, remember to republish the weblayout files.

    Now realize in this template file, there may be IDOC includes referenced in the template that hold the actual JavaScript code you are overriding. You'll need to add a resource file in your component to place your new includes, and track down the necessary includes. Again, I'm assuming that you are familiar with Component Architecture.

    Good luck.
  • 2. Re: How to overwrite base.js
    Jerome.Dubois Newbie
    Currently Being Moderated
    Well thanks a lot William.

    I had parts of the solution but didn't have an general view of it! :)

Legend

  • Correct Answers - 10 points
  • Helpful Answers - 5 points