Overriding a single function in sidekick.js?

I made a change to the function called when the "Activate" button is clicked in the CQ 5.4 sidekick.
The function is "getPublishConfig" in sidekick.js.
It works fine when I clone the entire sidekick.js file to [1], and then modify the existing method.
However, I would like to be able to override the getPublishConfig function code only, instead of the entire siteadmin.js, to help control the impact on future CQ upgrades.
I have tried these approaches below, but without luck.  If you have any other direction that perhaps I should look at, I would appreciate the tip.
Thanks!
Sara
Approach 1: I tried the clientlibs approach, but the new code was not being picked up- it was the OOB code that was being executed.   I am pretty sure the clientlibs was set up correctly, because this approach did work for overriding the SiteAdmin.Actions.js functions.  The custom js file contained code like [2].
Approach 2: I also tried to modify init.jsp in the template folder as shown in [3].  This worked in the simple activation cases.  However, when there are assets on the page that also need activating, and the Asset Reference Dialog is shown, then the AssetReferenceSearchDialog.js [4] script fails with an error because dlg.path.push is undefined.  I wonder if it is possible that this approach may have worked for simpler functions, but because of the level of indirection it does not work here?
[1] /apps/cq/ui/widgets/source/widgets/wcm/Sidekick.js
[2] CQ.wcm.Sidekick.getPublishConfig = function() { [snip--custom code]};
[3] CQ.WCM.launchSidekick("<%= currentPage.getPath() %>", {
            propsDialog: "<%= dlgPath == null ? "" : dlgPath %>",
            locked: <%= currentPage.isLocked() %>,
            actions: act,
           getPublishConfig : function() {  [snip--custom code]};
[4] /libs/cq/ui/widgets/source/widgets/wcm/AssetReferenceSearchDialog.js

I think there is a syntax error in line
document.write("<script type='text/javascript' src='/htmls/js/two.js'> <\/script>");
end tag <\/script> is wrong.

Similar Messages

  • How to load 2 xml galleries in single function loop.

    how to load 2 xml galleries in single function loop.
    my function is--------
    var myGalleryXML = new XML();
    myGalleryXML.ignoreWhite = true;
    myGalleryXML.load("gallery.xml");
    function callThumbs()
        _root.createEmptyMovieClip("wall",_root.getNextHighestDepth());
        wall._x = _root.gallery_x;
        wall._y = _root.gallery_y;
        wall.addEventListener(MouseEvent.CLICK);
        var clipLoader = new MovieClipLoader();
        var preloader = new Object();
        clipLoader.addListener(preloader);
            for (i =0; i <6; i++)
            thumbURL = myImages[i].attributes.thumb_url;
            myThumb_mc = wall.createEmptyMovieClip(i, wall.getNextHighestDepth());
            myThumb_mc._x = _root.thumb_height * i;
            myThumb_mc._x = _root.thumb_position = -3100 + (i-j) * 765;
       clipLoader.loadClip("shop/" + thumbURL,myThumb_mc);  // i want to load this  by xml gallery "gallery1.xml"
    preloader.onLoadStart = function(target)
                target.createTextField("my_txt",target.getNextHighestDepth(),0,0,10,10);
                target.my_txt.selectable = false;
            preloader.onLoadProgress = function(target, loadedBytes, totalBytes)
                target.my_txt.text = Math.floor((loadedBytes / totalBytes) * 100);
            preloader.onLoadComplete = function(target)
                new Tween(target, "_alpha", Strong.easeOut, 0, 100, .5, true);
                target.my_txt.removeTextField();
                target.onRelease = function()
                    callFullImage(this._name);
                target.onRollOver = function()
                    this._alpha = 100;
                target.onRollOut = function()
                    this._alpha = 100;
        for (i = 0; i < 6; i++)
            thumbURL = myImages[i].attributes.thumb_url;
            myThumb_mc = wall.createEmptyMovieClip(i, wall.getNextHighestDepth());
            myThumb_mc._x = _root.thumb_height * i;
            myThumb_mc._x = _root.thumb_position = -7210 + (i-j) * 765;
            myThumb_mc._y = _root.thumb_position = 180;
            clipLoader.loadClip("banner/" + thumbURL,myThumb_mc);  // i want to load this  by xml gallery "gallery2.xml"
            preloader.onLoadStart = function(target)
                target.createTextField("my_txt",target.getNextHighestDepth(),0,0,10,10);
                target.my_txt.selectable = false;
            preloader.onLoadProgress = function(target, loadedBytes, totalBytes)
                target.my_txt.text = Math.floor((loadedBytes / totalBytes) * 100);
            preloader.onLoadComplete = function(target)
                new Tween(target, "_alpha", Strong.easeOut, 0, 100, .5, true);
                target.my_txt.removeTextField();
                target.onRelease = function()
                    callFullImage(this._name);
                target.onRollOver = function()
                    this._alpha = 100;
                target.onRollOut = function()
                    this._alpha = 100;

    combine the two xml files into one if you want to create one gallery.
    if you want two different galleries that display at different times, remove the movieclip wall after you're done with gallery1 and execute myGalleryXML.load("gallery2.xml");

  • Single Function module to create inbound and outbound delivery

    Dear Frens,
       I would like to know how VL10A is creating a deliverty document in background mode.
       otherwise can anyone help me with a single function module or BAPI or BADI which creates both
       inbound and outbound delivery.
    Regards
    Priya

    Hi,
    Try FM RV_DELIVERY_CREATE or GN_DELIVERY_CREATE.
    For creating a delivery wrt PO u 1st need to have a sales order i guess.
    Regards,
    Amit

  • Is there a way to combine their query results into a single function

    say I have a bunch of functions that return a query:
    <cffunction name="getDeals" access="remote"
    returntype="query">
    <cffunction name="getDeals2" access="remote"
    returntype="query">
    is there a way to combine their query results into a single
    function that returns a struct of the various results?

    Umm, it's probably more suited to an array - effectively
    making it into a list of queries. You'd then loop the array and
    output each.
    I use a similar approach when creating system messages to the
    user. Most of my functions that are called do their bit, then at
    the end call another function I call "messages". This function
    grabs whatever my function sends and appends it to a messages
    array.
    This way enables me to output a long list of messages -
    because I could be calling several functions at the same time. If I
    just output a message from each function, each one would overwrite
    the other. So I'd get one message at a time.
    Immediately after it's output, I then destroy the message
    array so that old messages aren't kept inside of it.
    Mikey.

  • My machine has gone dead slow. I have to wait for minutes to perform every single function. Like it stopped typing four times during this question.

    My machine has gone dead slow. I have to wait for minutes to perform every single function. Like it stopped typing four times during this question.

    If this started happening without your having made any changes and without a warning of low disk space, then it's likely that the boot drive, or some other hardware component, is failing. Back up all data immediately, then run the Apple Hardware Test or Apple Diagnostics.
    Even if the test is negative, you should make a "Genius" appointment at an Apple Store to have the machine tested more thoroughly.

  • Two button with single function

    I want to create two buttons for single function and one button for one function. For example, I click button1, the screen will show "clicked1"
    If I clicked button2, the screen will show "clicked2". If I click button1 and then click button2, it will show "two button are clicked". However, it does not work in two button with single function. What is the problem? Here is the code.
    import flash.display.MovieClip;
    import flash.events.MouseEvent;
    var button1:MovieClip=new Button1();
    button1.x=200;
    button1.y=200;
    addChild(button1);
    var button2:MovieClip=new Button2();
    button2.x=300;
    button2.y=250;
    addChild(button2);
    button1.addEventListener(MouseEvent.CLICK, onClick);
    button2.addEventListener(MouseEvent.CLICK, onClick2);
    var isClicked:Boolean;
    var isClicked1:Boolean;
    function onClick(evt:MouseEvent):void{
              isClicked=true;
              trace("clicked1");
    function onClick2(evt:MouseEvent):void{
              isClicked1=true;
              trace("clicked2");
    if (isClicked&&isClicked1){
              trace("two buttons are clicked");

    It works but I want the screen only shows the "isClicked" only when I click button1. But now when I click button1, "isClicked" and "two buttons are clicked" show at the same time.
    import flash.display.MovieClip;
    import flash.events.MouseEvent;
    var button1:MovieClip=new Button1();
    button1.x=200;
    button1.y=200;
    addChild(button1);
    var button2:MovieClip=new Button2();
    button2.x=300;
    button2.y=250;
    addChild(button2);
    var isClicked:Boolean;
    var isClicked1:Boolean;
    button1.addEventListener(MouseEvent.CLICK, onClick);
    button2.addEventListener(MouseEvent.CLICK, onClick2);
    button1.addEventListener(MouseEvent.CLICK, onClick3);
    button2.addEventListener(MouseEvent.CLICK, onClick3);
    function onClick(evt:MouseEvent):void{
              isClicked=true;
              trace("clicked1");
    function onClick2(evt:MouseEvent):void{
              isClicked1=true;
              trace("clicked2");
    function onClick3(evt:MouseEvent):void{
              trace("two buttons are clicked");

  • Synchronizing a single function

    If I have a single function which needs only to be threadsafe with itself, would it be more runtime efficient for me to make the function "synchronized" or for me to implement my own semaphore spinlock? Or would it be the same?

    My guess is that using the features built into the language would normally be more "runtime efficient" than writing your own code. And you do realize you are asking us to compare to something that hasn't been written yet by somebody whose coding skills we have no way to evaluate, don't you?
    If it were important for me to know the answer to that question about my environment I would set up a test in my environment and see what happened.

  • Single function printer for MacBook OS 10.6 ?

    I recently upgraded my Mac to OS 10.6 and find that there is no printer driver for the Lexmark Z615 printer I've been happily using. Can anyone suggest a good inexpensive single function printer that will run with my MacBook OS 10.6?  I  do not need bells and whistles, just the ability to print b&w and color.  Thanks!

    Hi Justin,
    Thanks so much for your comment! The printer driver for this printer and OS 10.6 doesn't exist yet; I've checked with Lexmark on that.  I'm really just looking for a printer - don't do photos, don't need a scanner, fax, etc and the printer needs to have a very small footprint as I don't have much space on my desk.  I'll keep looking and will check out HP at your suggestion.

  • Overriding user defined functions? (LD_PRELOAD question)

    Hi,
    Am new to solaris and am using solaris 9.
    Is there a way on solaris to overload my own written function (a user definted function ) .
    On Hp-Ux using LD_PRELOAD I could dynamically load my shared library and override functions is the same possible here?
    I am having a little problem with overriding functions .
    PS:
    Could you please explain in detail how to use them step by step :)
    Thank you very much
    Kind regards :)

    Hi,
    You can use the LD_PRELOAD as on HP-UX, but if you have a 32bits LD, then better use LD_PRELOAD_32, and if it a 64bits then use LD_PRELOAD_64.
    Otherwise YOU MUST TRUST the new LD, by the way, Solaris ONLY trust the /lib, /usr/lib/secure/{32|64}
    Here you can read more information
    http://developers.sun.com/solaris/articles/linker.html
    Thanks,
    Urko
    http://sparcki.blogspot.com

  • Flag for overriding TV zoom function? Or title-safe settings for zoomed video...

    Here's the problem: I've got SD spots with correctly set up title-safe graphics. However, I keep seeing the spots playing on HD TV's where the picture has been set to zoom/stretch, and consequently the title graphics are stretching off-screen.
    So the question's actually a two-parter: Is there a flag I can set in my video that will override an HD set's zoom function and force my spots to play unstretched on these TV's? Or (part two), what graphics boundary settings would I have to use to keep my title graphics on-screen even it the video is zoomed?
    Regarding part two, yeah, I could experiment and find out the settings that will work, but I figure someone's run into this before and has an answer, which would save me a bunch of time...
    Thanks in advance...

    Is there a flag I can set in my video that will override an HD set's zoom function
    Thank God, no!  It's bad enough that disk authors can take away our right to skip FBI warnings and all the other BS on a DVD before we actually get to the movie.

  • Override of PDF Functions in htmlLoader

    Is it possible to override functions in pdf forms processing called by htmlLoader?
    Specifically I want to pass a user password into the document programatically rather than having the dialog box popup.
    Would it be possible to extend the adobe reader class involved and override the specific funtion?
    Thanks

    No. PDFs always render in front of everything else.

  • Can‘t override the create() function

    Hello, I reading the book ESSENTIAL JAVAFX,I found there is something wrong in chapter5's 5.43 choiceDialog,After i type the code in ,ChoiceDialog class like:
    1 public class TextButton extends Control {
    2    public var displayText: String;
    3    public var action: function():Void;
    4    public var disappearOnAction = true;
    5    protected override function create(): Node {
    6        skin = TextButtonSkin {};
    7        super.create();
    }it said:"function create() declared 'override' but does not override another funtion" in the line 5
    i used the javafx1.3 sdk,is it something different between 1.2 and 1.3 in override create() function?

    Yes.
    In [1.2|http://java.sun.com/javafx/1.2/docs/api/javafx.scene.control/javafx.scene.control.Control.html], Control was a CustomNode.
    It is no longer one in [1.3|http://java.sun.com/javafx/1.3/docs/api/javafx.scene.control/javafx.scene.control.Control.html], where it is just a resizable node.

  • Multiple values from a single function to be used SQL

    I have some pl/sql code that calculates multiple values in the same procedure (multiple out parameters).
    Now I want to use these separate values in an SQL select.
    One way to do it, is creating functions for each separate value.
    Performance wise, I don't want to do so.
    I created an object type with 9 number values.
    A function returns the object type and I select it in a subquery.
    The outer query then selects 3 different values from the object in the subquery.
    Unfortunately, a query with 3 rows still results in the function being called 9 times (3 row x 3 values).
    Is there a way to force the object function being called just once per row ?
    Or is there an alternative way?
    I've tried pipelined functions but then I have trouble with the input values for the function that should be taken from another select.
    result will be a view with a key value and the calculated values
    SELECT key_value, calculated_value1, calculated_value2, calculated_value3
    FROM SOME_TABLE

    DROP TABLE TBL
    CREATE TABLE TBL(
    ID NUMBER(10),
    CODE VARCHAR2(20),
    PARENT NUMBER(10)
    INSERT INTO TBL VALUES(1,'A',1);
    INSERT INTO TBL VALUES(2,'B',1);
    INSERT INTO TBL VALUES(3,'C',1);
    INSERT INTO TBL VALUES(4,'D',2);
    INSERT INTO TBL VALUES(5,'E',2);
    INSERT INTO TBL VALUES(6,'F',2);
    CREATE OR REPLACE PACKAGE pck_test IS
    TYPE t_rec IS RECORD(
    value1 NUMBER,
    value2 NUMBER,
    value3 NUMBER);
    TYPE t_tab IS TABLE OF pck_test.t_rec;
    FUNCTION calculate(i_id NUMBER) RETURN pck_test.t_tab
    PIPELINED;
    END pck_test;
    CREATE OR REPLACE PACKAGE BODY pck_test IS
    FUNCTION calculate(i_id NUMBER) RETURN pck_test.t_tab
    PIPELINED IS
    v_return t_rec;
    BEGIN
    v_return.value1 := 1 * i_id;
    v_return.value2 := 2 * i_id;
    v_return.value3 := 3 * i_id;
    PIPE ROW(v_return);
    RETURN;
    END;
    END pck_test;
    now I can use the pipelined function:
    SELECT 1 id, x.value1, x.value2, x.value3
    FROM TABLE(pck_test.calculate(1)) x
    id is hard-coded in this select with value 1
    I want to use TBL.id as the argument for the calculate function.
    I don't know how. I tried this...
    SELECT parent, ID, multi_values.value1, multi_values.value2, multi_values.value3
    FROM (
    SELECT ID, TABLE(pck_test.calculate(ID)) multi_values
    FROM TBL)
    Then the SELECT will be stored as a view.
    In an application, the view will be queried:
    select value1, value2, value3
    from view
    where parent = :parameter

  • Report on users having a single function

    Hi,
    I would like to know what is the best practice to get an analysis on all users having a function (not a SoD)?  Do I need to create a risk type 'critical action' for each function ?
    Thanks
    Bill

    Correct. You could define a Critical risk.
    Claudio

  • Save Points to override APEX DML functions

    I have some APEX pages that run some underlying procedures which do DML functions on 6 different tables. At the start of each of the DML functions which are in PL/SQL packages, I have set Save Points. I process thru a number of additional pages and reach a point where I may need to commit or rollback all those prior changes. Whenver I try to rollback I get ORA-01086 Savepoint 'xxx' never established. How can I check to see if the savepoint gets created so I can determine why the rollback function doesn't work.

    It's likely that APEX is performing a commit during processing, and thus erasing your savepoints.
    See +{thread:id=708781}+ and +{thread:id=2130631}+ for discussion on when APEX will commit. If any of the processing will cause APEX to perform a commit, see if it's possible to reorganize things so that APEX session state processing occurs before/after your transactional processing.
    (Please update your forum profile with a better handle than "user8014695")

Maybe you are looking for