Customize the product Menu Item Build

Hello

So I try to change display it products on an element to generate Menu, but I still find myself with my context of IbaseSpec is null. As in the example below, my plugin returns my custom ERROR null error message.  I used a very similar code before and did not have this problem.  Y at - it something I'm doing wrong here?

I've updated the CustomPluginExtensions.XML file as follows:

<Plugin name="MenuItemProductIdentityPlugin" ignoreInheritFromPluginName="true" FactoryURL="Class:ReferencePlugins.FormatPlugins.GSMSpecNumberFormatPluginExtensionFactory,AddStuffToMenuItemBuild"/>

Then my custom plugin looks like this:

using System;
using Xeno.Data;
using Xeno.Prodika.GSMLib.Formulation.DomainModel;
using Xeno.Prodika.PluginExtensions.Context;
using Xeno.Prodika.PluginExtensions.Plugins;
namespace ReferencePlugins.FormatPlugins
{
    public class GSMSpecNumberFormatPluginExtensionFactory : IFormatPluginExtensionFactory
    {
        public IFormatPluginExtension Create()
        {
            return new GSMSpecNumberFormatPluginExtension();
        }
    }
    internal class GSMSpecNumberFormatPluginExtension : IFormatPluginUIExtension, IFormatPluginPrintingExtension
    {
        private const string textUrlTemplate = "<a href=\"#\" OnClick=\"javascript:alert('{0}');return false;\">{1}</a>";
        public string GetTextPrinting(IFormatPluginPrintingContext context)
        {
            IBaseSpec baseSpec = GetBaseSpecFromPrintingContext(context);
            return GetSpecNumberAndEffectiveDate(baseSpec);
        }
        private IBaseSpec GetBaseSpecFromPrintingContext(IFormatPluginPrintingContext pluginPrintingContext)
        {
            object boundPropertyValue = pluginPrintingContext.RenderingContext.GetBoundPropertyValue();
            return GetBaseSpecFromContextObject(boundPropertyValue);
        }
        public string GetTextURL(IFormatPluginContext context)
        {
            string fullText = GetText(context);
            string abbreviatedText = fullText.Substring(0, context.ContextualMaxLength);
            return String.Format(textUrlTemplate, fullText, abbreviatedText);
        }
        public bool UseTextURL(IFormatPluginContext context)
        {
            return GetText(context).Length > context.ContextualMaxLength;
        }
        public string GetText(IFormatPluginContext context)
        {
            IBaseSpec gsmSpec = GetBaseSpecFromContextObject(context.Context);
            return GetSpecNumberAndEffectiveDate(gsmSpec);
        }
        private string GetSpecNumberAndEffectiveDate(IBaseSpec gsmSpec)
        {
            if (gsmSpec == null)
            {
                return "ERROR NULL";
            }
            else
            {
    string status = gsmSpec.SpecSummary.WorkflowStatus.Status;
             string myValue = "Test";     
                    return " [" + status + "] " + "[" + myValue + "]";
            }
        }
        private IBaseSpec GetBaseSpecFromContextObject(object context)
        {
            if (context == null)
                return null;
            if (context is IBaseSpec)
                return (IBaseSpec)context;
            if (context is IFormulationInput)
                return GetReferencedMaterial((IFormulationInput)context);
            return null;
        }
        private IBaseSpec GetReferencedMaterial(IFormulationInput input)
        {
            if (input.IsMaterialReferenceAvailable())
            {
                return (IBaseSpec)input.Material.DataObject;
            }
            return null;
        }
    }
}

I think that GSMSpecStatusFormatPluginExtension is a better reference.

/*

WARNING:

// ===========================================================================

Copyright © 2009 Oracle Corporation, 6373 San Ignacio Avenue,

95119 1200 San Jose, California United States of America; Phone 408.284.4000, fax

408.284.4002, or http://www.oracle.com/>. All rights reserved.

//

This file that was provided by Oracle Corporation in

an Oracle® product for use ONLY by users under license of the product,

contains CONFIDENTIAL and EXCLUSIVE of Oracle information

Corporation.

//

THE USE OF THIS SOFTWARE IS GOVERNED BY THE TERMS OF THE LICENSE

CONTRACT AND PROVIDED WITH THE PRODUCT LIMITED WARRANTY.

//

* IN PARTICULAR, YOU INDEMNIFY YOU AND ORACLE CORPORATION, SA *.

* COMPANIES AND SUPPLIERS, _ * _HARMLESS_ * FROM AND AGAINST ANY CLAIM *.

* OR COMMITMENTS ARISING OUT OF THE USE, REPRODUCTION OR DISTRIBUTION OF *.

* YOUR PROGRAMS, INCLUDING CLAIMS OR LIABILITIES ARISING OUT OF GOLD *.

* RESULTING FROM the USE, MODIFICATION OR DISTRIBUTION OF PROGRAMS OR FILES

* CREATED FROM BASED ON, OR DERIVED FROM THIS SAMPLE SOURCE CODE FILE *.

// ===========================================================================

//

Please refer to the document "Copyright and Trademarks.pdf" in the ReferenceImplementations folder

//

*/

using System;

using Xeno.Data;

using Xeno.Prodika.Common;

using Xeno.Prodika.GSMLib.Formulation.DomainModel;

using Xeno.Prodika.PluginExtensions.Context;

using Xeno.Prodika.PluginExtensions.Plugins;

namespace Xeno.Web.UI.GSMExtensions.Common

{

class GSMSpecStatusFormatPluginFactory: IFormatPluginExtensionFactory

{

public IFormatPluginExtension Create()

{

return new GSMSpecStatusFormatPluginExtension();

}

}

internal class GSMSpecStatusFormatPluginExtension: IFormatPluginUIExtension, IFormatPluginPrintingExtension

{

private const string _formattedStatus = "[{0}];

private const string _formattedPrintingStatus = "[{0}];

public string GetTextPrinting (IFormatPluginPrintingContext framework)

{

ISpecSummary specSummary = GetBaseSpecFromPrintingContext (context);

Return GetFormattedPrintingStatus (GetSpecStatus (specSummary));

}

public string GetTextURL (IFormatPluginContext framework)

{

return String.Empty;

}

public bool UseTextURL (IFormatPluginContext framework)

{

Returns false;

}

public string GetText (IFormatPluginContext context)

{

ISpecSummary specSummary = GetBaseSpecFromContextObject (context. Context);

Return GetFormattedStatus (GetAbbreviatedStatus (context, GetSpecStatus (specSummary)));

}

#region help private

Private static GetAbbreviatedStatus (IFormatPluginContext context, string text)

{

return new StringAbbreviator (context. ContextualMaxLength). GetAbbreviation (text);

}

Private Shared ReadOnly Property GetSpecStatus (ISpecSummary specSummary) as string

{

If (specSummary == null | specSummary.WorkflowStatus == null)

Returns the string. Empty;

Return specSummary.WorkflowStatus.Status;

}

Private Shared ReadOnly Property GetFormattedStatus (string text) as string

{

Return GetFormattedStatus (text, _formattedStatus);

}

Private Shared ReadOnly Property GetFormattedPrintingStatus (string text) as string

{

Return GetFormattedStatus (text, _formattedPrintingStatus);

}

Private Shared Function GetFormattedStatus (String, formatted string text)

{

If (the text. Length == 0)

Returns the string. Empty;

on the other

Return String.Format (format, text);

}

Private Shared ISpecSummary GetBaseSpecFromPrintingContext (IFormatPluginPrintingContext pluginPrintingContext)

{

Object boundPropertyValue = pluginPrintingContext.RenderingContext.GetBoundPropertyValue ();

Return GetBaseSpecFromContextObject (boundPropertyValue);

}

Private Shared ISpecSummary GetBaseSpecFromContextObject (object context)

{

If (context is nothing)

Returns a null value.

If (context is ISpecSummary)

return the context (ISpecSummary);

If (context is IBaseSpec)

return (context (IBaseSpec)). SpecSummary;

If (context is IFormulationInput)

Return GetReferencedMaterial ((IFormulationInput) context);

If (context is IFormulationOutput)

Return GetOutputMaterial ((IFormulationOutput) context);

Returns a null value.

}

Private Shared ISpecSummary GetOutputMaterial (IFormulationOutput output)

{

If (exit. Material.IsReferenced | output. Material.IsExternal)

return (exit (IBaseSpec). Material.DataObject). SpecSummary;

Returns a null value.

}

Private Shared ISpecSummary GetReferencedMaterial (IFormulationInput input)

{

If (entry. IsMaterialReferenceAvailable())

{

return (enter (IBaseSpec). Material.DataObject). SpecSummary;

}

Returns a null value.

}

#endregion

}

}

Tags: Oracle Applications

Similar Questions

  • Getting context object null when using the custom menu item.

    Hi all

    I implemented a sample application to add menu item custom to the list of messages and we test this build on 9000 os 5.0.0.41 Blackberryy 1

    On BB 9000, we have 2 message inbox, A like Blackberry by default message inbox and B as long as the Inbox for the e-mail account, I have set up on BB 900.
    I implemented the menu custom application to add menu on the message list option.
    I see this option on both my inbox, the question that I am facing is when I click on the menu item by selecting the email in the message of default A Blackberry inbox I can get the context object were like when I click on the same message next to the Inbox B I'm always get the context as a NULL object.

    Below is the code I used to add the custom menu item.

    Public Shared Sub main (String [] args)
    {
    If (args! = null & args.length > 0) {}
    call from another entry point. Add menu items mark as Spam and mark as suspects.
    {if(args[0].) (Equals ("GUI"))}
    try {}
                            
    create menu items.

    MyMenu ApplicationMenuItem = new EmailFile();
    Add the menu item in the list view and send by e-mail.
    Amir ApplicationMenuItemRepository = ApplicationMenuItemRepository.getInstance ();
    amir.addMenuItem (ApplicationMenuItemRepository.MENUITEM_MESSAGE_LIST, mymenu);
    } catch (Exception e) {}
    Utility.debugLog (try (), CLASSNAME, 'hand', Utility.EXCEPTION_INFO);
    System.out.println("Error:"+e.ToString());)
    }
    } else {}
    show on the application of spam...
    AppMain _theApp = new AppMain();
    _theApp.enterEventDispatcher ();
    }
    } else {}
    show on the application of spam...
    AppMain _theApp = new AppMain();
    _theApp.enterEventDispatcher ();
    }
    }

    Can we know what is the problem in my code or something I'm missing.

    Thanks in advance.

    Navneet Gupta.

    application menu items have been bugged for ages. There is nothing you can do except change your workflow. in some cases, you can recover the app screen and trying to extract something of these fields, but becomes more difficult in the new OS versions because of custom fields used by rim.

  • How to list the PHONE menu items

    Hello.

    I am building an app that injects the menu and the wheel to the up and down events to access elements of the PHONE menu.

    To be precise, in appeal, at any given time my application needs to choose an item from this menu.

    So I inject the MENU, then the Dial-UP (for a step or two), then ENTER.

    Now, I need to be sure that I pressed the right menu item.

    This is why I would like the ApplicationMenuItemRepository.MENUITEM_PHONE to the list

    Is it possible to do?

    There is no method that returns the menu of a BlackBerry application or the item currently selected in the menu.

  • dynamically create and destroy the custom menu item

    I have a standard TestStand platform that I use on multiple systems.  On some systems, I have a few sequences of calibration and I would like to have the Update menu to have the RunSequence of these sequences of calibration.  I know how to manually create these menu items, but they are no longer valid for some sequence files.  I would use the sequence SequenceFileLoad to dynamically create menu items and the SequenceFileUnload to destroy these menu items.

    I've played around with the API, but cannot determine the correct path to get to the create and destroy the custom menu items.  Does anyone know how this can be done?

    Thank you

    Matthew

    Yes, see the online help for the members of the following APIs:

    Engine.GetEditTimeToolMenuItems

    EditTimeMenuItems

    EditTimeMenuItem

    Basically, you get a collection of tool using Engine.GetEditTimeToolMenuItems () menu items and then call EditTimeMenuItems.Insert () or EditTimeMenuItems.Remove (). If you insert a you get returns an EditTimeMenuItem object on which you can change the settings.

    In addition, since it has an expression to hide items in menu tool, you need not necessarily to destroy, you can hide them instead.

    Hope this helps,

    -Doug

  • How to customize the context menu in the legend of plotting the graph of wave?

    I am currently on the creation of a simulation of various control loops as educational objectives. Here, I have a chart in waveform to different signals. Now my question, how to customize the context menu in the track of the Waveform graph legend => when I click on 'image' behind the Plotnames one menu to open options where you can customize the color etc. or plotwidth. But students should not have access to these settings. How can I change or disable this menu? The context menu for the waveform graph, I've already customized by right click on table of waveform-Advanced online-online menu, but for the legend of conspiracy, I have not found this setting...

    Thanks for your answers... I tried different things, but I don't see a solution yet :-(

    See you soon

    DCP

    Hi, STC,

    There have been a number of suggestions for change or disable the table , right-click menu, but I see that this does not affect the context menu of legend , which is what you ask for help with.

    To prevent completely the menu right-click to work, you must disable the chart control entirely. You can do this by double-clicking on the chart and select Advanced Options > active state > disabled. This will prevent the operator to be able to generate a menu right click on the chart control.

    If however you still wanted the table, make a right click menu to work, but the legend made a right-click menu will be disabled, I see two options:

    1. draw a classic decoration square on the legend and the transparent color. This will prevent the mouse clicks to achieve the legend, and transparent it will not interfere with your user interface appearance.

    2 use a Structure of the event to capture the event filter Popup Menu of Activation?  for the chart control. You can then use the Coords property to determine if the mouse is over the legend or not. If this is the case, send faithful away? right Terminal. It will refuse the context menu when the user clicks on the legend of the plot.

  • How to customize the start menu programs list?

    In older versions of windows, I could go to program files and go to the start menu. Here I could organize program files that appear in my Start menu. For example, I could put all my office programs in a folder called Office and all my games in the games. I can not find the folder on the start menu in windows Explorer and the start menu customize does not address records. Help, please. Thank you.

    Take a look at thi Windows tutorial
    Customize the Start Menu

    http://Windows.Microsoft.com/en-us/Windows-Vista/customize-the-start-menu

  • How to avoid the default menu items?

    All of hell

    I'm developing an app for BlackBerry handheld.  I add menu items that are specific to the different screens of my application by substituting the makeMenu (.) method. I DON'T want to include default menu items...

    Select Mode
    Page view
    To find
    Copy
    Call 12093...
    12093 SMS...
    12093 MMS...
    Add to Contacts

    Now I do menu.deleteAll () in the first line of the makeMenu (.) method. Suggest me if this isn't the right way?

    It deletes all the elements default menu above.

    Now, in the application, the specific menu item get highlighted based on the next action of logic, that I do a menu.setDefault (menuItem).

    But for the instance when some contact number is selected on the screen (usually 'call' option get highlighted on the menu, but here we have removed) the highlight of the menu according to my works item IS NOT pathological and it always shows the menu first point highlighted.

    I suspect it might be because the default menu items have been added (by program then deleted). That's why I decided to override the onMenu (.) method where I'll call makeMenu (...) to the new instance of the Menu (that are not default menu items), so I'll see the menu using menu.show () and then return true.

    Now by the fix above, the highlight of the menu on my terms item works fine regardless of some contact number is highlighted on the screen or not, BUT the menu is displayed on the upper right and not on the bottom left where it should be.

    This approach is correct, or there is a better way to approach this?

    Thank you

    Mukesh

    OK guys... I had the problem!

    The problem is that if any time a highlighted menu item is removed (as in our case, menu item 'Call' is deleted by menu.deleteAll (()) the priority agenda menu get highlighted. This is just the reason why the first menu item get highlighted if the phone number is selected.

    To fix this, I highlight the appropriate menu option by setting up priority for her.

  • Get the current menu item selected

    Hello

    I use Jdeveloper 11.1.2.3.0

    I want to set the property collapse of the separator group based on the selected menu item by using the expression language.

    How to get the current selected menu item.

    Best regards

    Haytham Talha

    Hello

    Here is an example using setPropertyListener to set the selected item and use it to collapse of panelSplitter:

    
         
              
                   
             
            
              
           
         
                   
    
    
         
              
         
         
              
         
    
    

    Jean Lou

  • compare the documents menu item missing

    I downloaded the trial version of adobe XI here: compare two PDFs, the file comparison tool | Adobe Acrobat XI

    I tried to repair the installation, but still not see the view-> menu item to compare Documents

    Thank you

    Make sure that you use Adobe Acrobat, Adobe Reader.

  • Drop menus appear on your mouse on the main Menu items?

    Sorry if this seems obvious, but I am new to Muse. After viewing all the tutorials I can't display the drop down menus on overview of the main menu items (to display submenu choice on the main categories page).

    There must be an easy way to do it. Can anyone offer advice?

    Thanks in advance.

    Hello

    If you have subpages created for top level pages and put you in a menu, while also changing the "Menu Type" to "All the Pages" in the menus, it should appear the submenus when you hover over the top level menu items. Here's a little video that I created to show you how it works: http://screencast.com/t/jEAhCpL8x

    I hope this helps.

    See you soon

    Parikshit

  • Redirect the user to the different menu item

    Hi guys,.

    JHeadstart 11.1.1.3.35

    I use the JhsTree menu structure. One of my menu items is a wizard that goes directly to the insert mode, so at the end of the wizard, I redirect the user to a different group (menu item). The problem is that while the new menu page is displayed to the user, the previous menu item (Assistant menu) is still selected, so that if you try and you reenter the Wizard menu item, nothing happens as the structure of the menu and the page are out of sync (and the menu believes that you are already on the page of the wizard even if you're not)

    My question is, also the creation of a navigation to a different menu item rule, how can I programmatically change the selected menu item?

    See you soon,.
    Brent

    Brent,

    No, you can remove these goods safely.

    Steven Davelaar,
    JHeadstart team.

  • What happened to the context menu item 'Add album artwork' in iTunes 12.4?

    I love the new version 12.4 (return of the sidebar). What happened to the item of the context menu add album work?

    Someone tell me where to find it.

    If the command get Album artwork , it has not seem to be an equivalent command in the menu bar that applies to only one song (or a selection of songs).  Not in the main menu bar or anywhere else.  The command in the menu bar to file-> library-> Get Album artwork is available, but this action applies to your entire library.

    However, if you put your music library in the Albums view (to display the view with the album 'tiles' of the work in a grid), I noticed you pouvez with right-click an album and get the cover.  I think that this applies to all the songs on the selected album (or albums).  I guess that's "a" logical, given that missing album art are generally for all the songs on the album.

  • How can I increase the font size of the Explorer - not the pages - but the browser menu items

    I wants to expand menu items and other items in the toolbar, but can't seem to do it.
    How this is done?

    This extension allows to adjust the font size for the user interface:

    You can use an extension to set a page zoom and the size of the default font on the web pages.

  • Change the camera menu items

    Hi all I invoke the camera of my application. I want to remove a few menu items that is provided by the camera application. How to do this. Thank you very much

    is not possible

  • I want to change the button menu items menu blackberry

    In my blackberry app I want to erase the current option to menu point (Swith application, close, Select) and add new menu button menu options.

    I tried the below code but nothing is happening for me.

    if (blackberry.ui.menu.getMenuItems().length 0) {
          blackberry.ui.menu.clearMenuItems();
        }
        var item = new blackberry.ui.menu.MenuItem(false, 1, "Click Me", customMenuItemClick);
        blackberry.ui.menu.addMenuItem(item);
    
        function customMenuItemClick() {
          alert("user just clicked me");
        }
    

    I inserted ? in the config.xml file
    but no use.

    How to change the menu items

    I would consider removing those as bad practice of the user interface. They appear (as I know) in all the menus in all applications.

    If you use the command combined with separators feature, I think you will find that it is ok?

    I don't know how to remove these default items (did not seek either ;-)))

Maybe you are looking for

  • Lost hundreds of photos

    Updated my computers (MacBook Pro and iMac) to Yosemite (10.11.4) earlier. The iMac iPhotos library resided in an external right here.  Still doesn't work. Yesterday, I decided to move all my photos of the MacBook Pro on the iMac, so I would have the

  • Satellite 1800: Fault pin plastic LCD display!

    "Look at the LCD display screen. If you can see a small image on the screen, backlight fluorescent display screen can be disabled. Light of a flashlight directly to the screen will make it much easier to see if or not there is a screen image actually

  • Convert MOV files must be so complicated?

    I am in my second week of research. Try to learn what everything remains to be done. I tried several video converters. I entered the MOV file and tried to convert several formats used by Windows Movie maker and none of the converted video files would

  • DVD player stopped working

    My DVD on my Dell Inspiron 1545 drive stopped working about 9 months ago.  I uninstalled and reinstalled the program twice and nothing ever changes. I also did test problems, and nothing shows. What can I do about it? Help, please!

  • Drivers for my Vaio PCV-RX670 desktop computer

    I run Windows XP and have damaged drivers for the drive CD CD-S400/A Asus and Pioneer DVR-104 DVD - RW drive - where and how can I find/download/install the appropriate drivers