Resolving session scoped component in global scope component.

Hi,
I am implementing batch process and i am need to resolve session scoped component in global scoped component.
In global scope component (one of the component referred by my scheduler which also in global scope as usual) and i need to resolve session scoped "/atg/epub/workflow/WorkflowView" component in my scheduler.
I tried all possibilities but nothing worked out. I do not have access to current request, because its batch process. following ways i tried,
1. getResolveName("/atg/epub/workflow/WorkflowView") method of GenericService which is extended by my global scope component -- This returns null.
2. Tried to get the current request on ServletUtils to use resolveName() method on request.
ServletUtlis.getCurrentRequest() - This returns null as expected.
Is there any way to resolve session scoped component in global scope component. Thanks in advance.
Edited by: 938890 on Jun 30, 2012 4:59 AM

Try below :
If you want to resolve the name of a Nucleus component from Java code that is not itself a Nucleus service, you must first initialize Nucleus with this construct:
Nucleus.getGlobalNucleus().resolveName("target component")
where target component is the name of the component you are looking up. Note that this construct works only for components with global scope.
You can also resolve names of Nucleus components using the Java Naming and Directory Interface (JNDI). The following example shows how you can use JNDI to access the Scheduler component:
String jndiName = "dynamo:/atg/dynamo/service/Scheduler";
Context ctx = new javax.naming.InitialContext ();
Scheduler s = (Scheduler) ctx.lookup (jndiName);
reference - oracle ATG docs.
~ Praveer

Similar Messages

  • How to make a global scope component to be thread safe?

    One of my global component preserves states in its member variables, I am afraid that it's might messed up in multi-threading conditions, so how to make a nucleus global component to be thread safe?
    Edited by: user13344577 on Jul 14, 2011 9:45 AM

    Hi,
    Just to help integrate Shaik's and my own seemingly contradictory replies:
    If the member variables in your global component actually need to be globally available, so that multiple threads/sessions need to seem the same data, then you need to use synchronization or some scheme to make this data thread-safe when updating it. If the member variables are non-global data and are simply for convenience of having data available for multiple method calls or something like that, then you should do as I said (don't use synchronization) and use one of my suggestions to avoid this.
    I have seen customers frequently do what I replied about and store non-global data in a global component, and Shaik simply interpreted what "user13344577" is trying to do differently. Clarification is needed to know which of our answers better applies.
    Thanks.
    Nick Glover
    Oracle Support for ATG Products

  • What is the best way or best practise to access the session scoped component in servelt pipeline?

    Hi Experts,
    What is the best way or best practise to access the session scoped component in servelt pipeline?
    Please share your thoughts.
    Thanks,
    ankV

    To resolve components in the session scope you should be using DynamoHttpServletRequest.resolveName(). And of course the DynamoHttpServletRequest can also be used to resolve global and request scoped components so it is pretty handy to use. You can get the DynamoHttpServletRequest request associated with the current thread from ServletUtil.getCurrentRequest().
    You can also reference a session scoped component from another session (or request) scoped component's property file. E.g. to access profile component (which is session scoped) from your custom session scoped component you would typically do this:
    $class=com.company.MyCustomComponent
    $scope=session
    profile=/atg/userprofiling/Profile

  • How to resolve Session Component

    Hi,
    How can we resolve Session component, we know that NucleusResolverUtil.resolveName("component-path") will resolve only global components , and the request.resolveName("component-path") also resolve only global components. If we could have dynamo request we could have resolve it. we are using Different Presentation Layer Framework so we dont have DynamoHttpServletRequest.
    Thanks,
    Edited by: sampro07 on Jun 11, 2012 12:04 PM

    The DynamoServletRequest is initialized when your HttpServletRequest request processed by the dynamo page filter (atg.filter.dspjsp.PageFilter). Check to see if you web.xml has the following lines in it.
    <!-- Dynamo Server Page Filter -->
    <!-- -->
    <!-- This filter invokes the dynamo application framework -->
    <!-- servlet pipeline. -->
    <filter>
    <filter-name>DynamoServerPageFilter</filter-name>
    <display-name>DynamoServerPageFilter</display-name>
    <description>This filter invokes the dynamo application framework servlet pipeline.</description>
    <filter-class>atg.filter.dspjsp.PageFilter</filter-class>
    </filter>
    <!-- Filter Mappings -->
    <!-- -->
    <!-- -->
    <filter-mapping>
    <filter-name>DynamoServerPageFilter</filter-name>
    <url-pattern>/*</url-pattern>
    </filter-mapping>

  • JNDI lookup for request scope component,

    Hi,
    I have 2 web applications part of single ear file.
    Where One application is ATG application having ATG pipeline defined in its web.xml
    and 2nd one is a simple j2ee web application.
    From 2nd application if I try to lookup a request scoped component by following code
    String jndiName = "dynamo:/------compenent path------";
    Context ctx = new javax.naming.InitialContext ();
    Scheduler s = (Scheduler) ctx.lookup (jndiName);
    it shows me following error.
    ** Error Fri Nov 16 11:04:20 CST 2012 1353085460117 / Invalid attempt to resolve component /atg/-------component path------/ in scope global. It is defined in scope request
    Is there any way to resolve it ?
    Edited by: Arvind Pal on Nov 16, 2012 2:00 PM

    It seems the scheduler global component is resolving the request scope component internally.
    For request scope components there should be DynamoHttpServletRequest object in context to resolve.
    DynamoHttpServletRequest object is created as part of servlet pipeline.
    As you request is not going thru servlet pipeline, there is no DynamoHttpServletRequest and hence the request scope components cannot be resolved.
    So check in the scheduler why do you need to resolve the request scope component. Its not good practice to resolve them in schedulers.
    Peace
    Shaik

  • Component Usage "GLOBAL"

    Hello Folks,
    I have heard rumours, that there is a way to communicate between different WDA Application (in Portal) via a global Component.
    The Trick should be, to name to usage of the component just  "GLOBAL", and then the Portal will use the same instance through all Components which uses this Component with the name "GLOBAL". Even in different WDA Applications.
    Unfortunately this doesn't work here. Now we  are unsure about it. Do we something wrong? Or is this rumour just a hoax?
    Can somebody help us?
    Best Regards and thanks ins Advance,
    Bastian Stritt

    Hello Thomas,
    thank you for your answer. I thought something like this...
    But then, how can I communicate between different WDA Applications through different App Servers? Only via Shared Memory or Session Cookies?
    I gave you Points for solving my problem.
    Cheers,
    Bastian Stritt

  • Comfortabl​e Scope Component?

    Hello all,
    I am looking for a comfortable Scope Component for use in LabView that goes beyond a strip chart. The following is what I need:
    Possibility to use marker liners 2 for x- and 2 for y-direction. The differences will be shown and updated while moving a marker line.
    Similarly, points should be available for Minimum /Maximum values etc.
    The signal to be shown comes from the serial port at 115 bps, so the graph has to be fast enough.
    Possibility to zoom in and out.
    Possibility to stop the recording and to save the waveform.
    Possiblity to cut the curve (with cutting lines) and to re-save the cut curve.
    Possibility to edit the graph.
    I would like to load the waveform and have the same possibilities again (zoom, cutting, moving markers etc.)
    Is something like this available for LabView? It can also be an ActiveX Component. Or sombody knows of a c/c++/.net library, whatever.
    I use LabView 7.1
    Best Regards
    Johannes

    Hi Johannes,
    Sure, everything of the points you wrote is possible within LabVIEW.
    You just have to use the Waveform Graph with it's cursors (you can set several coursors for one graph), where you can read out the current cursor position of every cursor using a property node. Exactly you will get an array of clusters which are the several corsors and there attributes like the x and y position. Then you can read out the positions of every corsor, substact them to become the difference. There are also functions available in LabVIEW for min and max values e.g. of an array. Zooming is also possible with the waveform graph. The methode to cut/save/reload the curve will depend on the datatype you are working. If it is an array you can use the different array functions to e.g. cut the curve and save only the resulting values.
    The attached screenshot shows a little example for getting the difference between two cursors position and also the content of one cursors cluster.
    Hope this helps, Christian
    Attachments:
    cursor cluster.jpg ‏34 KB

  • Store Session scoped variable in RequestScoped FormHandler?

    Hi All,
    I need to store a value into session scoped variable in formHandler. Is it possible? For Example, i need to no.of times handleApplyShippingGroups is being called by a User (Session scoped) and write a condition based on that value whose effect is to that User only? But, ShippingGroupFormHandler's scope is "Request"? How to get through this?
    Thanks,
    VishnuVardhan

    Hi,
    You can use the below logic.
    In ShippingGroupFormHandler.properties
    $class = your.custom.Shippinggroup.fomhandler
    profile=/path/to/your/profile/component
    In YourShippingGroupFormHandler.java
    Inside handleApplyShippingGroups(),
    //increment the value
    getProfile.setApplySgCallCount(getApplySgCallCount()++);
    Before that, add the property - applySgCallCount -  to your profile with getter and setters.
    Hope this helps.
    Please keep posting the issues / updates.
    Thanks,
    Gopinath Ramasamy

  • How to get active component of other components component usage

    Hi all,
    let me try to describe you the issue.
    I've got three components interacting with another. Lets call them CA, C1 and C2.
    CA uses both C1 and C2, so CA has component usages CUA1 and CUA2. But C1 also uses C2 with component usage CU12.
    C1 calls an interface method of component usage CU12 (of component C2).
    But although I've got an active component on CA-level for CUA1 (lets call this active component ACT1), C1 does not call the interface method of ACT1. (Even events are not triggered.)
    How can I assign the active component of CUA1 to C1 at runtime and how do I call its interface method from C1?
    Can I search for active components within C1 by name (I've got several active components, how do I differentiate them)?
    Thank you for your help.
    ismail
    FYI: The scenario:
    CA uses C1 as a global search component.
    CA has several list components C2.1, C2.2 etc.
    C2.1 lists all arrival/departure flights from NY. It also offers a minor search functionality for flight regarding NY.
    C2.2 lists all arrival/departure flights from LA. It also offers a minor search functionality for flight regarding LA. etc...
    I want to use C1 as a global search which uses the minor searches of C2.1, C2.2 etc. The outcome of the minor searches shall be displayed in C1, but also in C2.1, C2.2 etc. when I switch to the C2.1, C2.2 etc.
    Example usage 1:
    1. At CA I go to C2.1 and search for all flights to NY from London.
    2. Then I switch to C2.2 and search for all flights from LA to Berlin.
    3. When I switch back to C2.1 the former results remain there, I can still see all flights to NY from London.
    Example usage 2:
    1. At CA I go to C1 and make a global search for all departures to London.
    2. If I now switch to C2.2 I want to see all flights from LA to London, without a search here.
    3. If I now switch to C2.1 I want to see all flights from NY to London, without a search here.

    You use a desktop pane, but save a reference as a JLayeredPane. So make the reference of type JDesktopPane and check out [the documentation API|http://java.sun.com/javase/6/docs/api/javax/swing/JDesktopPane.html#getSelectedFrame()].
    For the next time, bookmark [http://java.sun.com/javase/6/docs/api/] and use you browsers search function to quickly jump to the class you want. Swing component usually also have a link to the relevant tutorial.

  • Using Query String Parameters with Session Scoped bean

    I would like to pass query string parameters from a product page (user clicks on a specific product commandLink) that is request scope to a details page that is session scoped.
    The problem is that the session scoped page only handles the first request. If you view the details of a product and then navigate back to the product page and choose another product ... the details page will not handle the new query string parameters and display the details for the first product chosen.
    Is there a way to make the session scoped bean recognize the query string parameters past the first request?

    I was able to replicate this problem with a very simple app that performs a redirection... just like the real app. Here's the simple app that I put together:
    From request scope page:
    <f:view>
             <h:form>
               <h:commandButton value="Link 1" action="#{reqbean.Link1}"/>
               <br/><br/>
              <h:commandButton value="Link 2" action="#{reqbean.Link2}"/>
            </h:form>
           </f:view>
    From request scope bean:
    public String Link1() throws IOException
        // Add event code here...
        //redirect the user
        FacesContext.getCurrentInstance().getExternalContext().redirect("untitled2.jspx?p=1");
        return null;
      public String Link2() throws IOException
        // Add event code here...
        //redirect the user
        FacesContext.getCurrentInstance().getExternalContext().redirect("untitled2.jspx?p=2");
        return null;
      }At this point... I put a println in the constructor of the session scoped bean because this is where I want to get the query string params. The constructor only gets called the first time a redirect is performed.

  • Add FacesMessage to FacesContext in an session scoped bean HOWTO?

    I have an simple question. How can I add an FacesMessage to the FacesContext in a session scoped bean.
    This code works fine for request scoped beans.
    String message = "Some message";          
    FacesMessage curentMessage = new FacesMessage(message, message);
    curentMessage.setSeverity(FacesMessage.SEVERITY_ERROR); //Mark as ERROR
    context.addMessage(�userForm�, curentMessage);          When I change bean scope to "session" I am getting java.lang.IllegalStateException at the last line when adding message to context.
    Thanks:
    -- Nermin

    I have an simple question. How can I add an
    FacesMessage to the FacesContext in a session scoped
    bean.
    This code works fine for request scoped beans.
    String message = "Some message";          
    FacesMessage curentMessage = new FacesMessage(message,
    message);
    curentMessage.setSeverity(FacesMessage.SEVERITY_ERROR);
    //Mark as ERROR
    context.addMessage(�userForm�, curentMessage);          When I change bean scope to "session" I am getting
    java.lang.IllegalStateException at the last line when
    adding message to context.
    Thanks:
    -- NerminHow do you get "context"? If you are storing it as an instance variable of the bean, then you
    should expect to get an exception. The FacesContext is scoped only to one request. Instead
    of storing it in the bean, use FacesContext.getCurrentInstance() each time you need to use it.

  • Can we access the session scoped variable by simply using its name

    The Java EE 6 Tutorial contains a "Duke's Bookstore Case Study Example”. I could not understand following statements of this case study:
    *bookdetails.xhtml*
    {code}
    <h:outputText value="#{selected.title}"/>
    {code}
    *BookstoreBean.java*
    {code}
    public String details() {
    context()
    .getExternalContext()
    .getSessionMap()
    .put(
    "selected",
    getFeatured());
    return ("bookdetails");
    {code}
    I want to know can we access the session scoped variable in bookdetails.xhtml by simply using its name as done above?

    It is basic Expression Language (EL) functionality, it isn't even specific to JSF. And it isn't specific to the session scope either, you can put beans in any scope (page, request, session, application, flash, conversation, whatever custom scope you create) and reference it using EL by only its name. The thing that you have to take care of is that the bean lives in SOME scope, which can be achieved using JSF specific annotations or configuration files, through CDI or by manually putting the bean in a specific scope through Java code. It's flexible, which is the nature of the Java platform.

  • I want to add DataGrid in my custom component as a child component,

    I want to add DataGrid in my custom component as a child component, can we ?? or should i generate HTML for table creation in my custom component's renderer ?

    I did that:
    for example, if i want to add a Button control in my custom control:
    public void encodeChildren( FacesContext context ) throws IOException
             super.encodeChildren( context );
            //createComponent raises exception.... invalid component type     
            //UIComponent field = FacesContext.getCurrentInstance().getApplication().createComponent( javax.faces.component.html.HtmlInputText.class.getName() );
             HtmlInputText input = new HtmlInputText();
            getChildren().add( input );
        public boolean getRendersChildren()
            return true;
        }Can you give me any example, i want to add child components at run time basically..

  • Can not be resolved session, folder ,store, message[]

    i dont have a clue on what i am missing here. Any nice explanation on the why would be great
    Session cannot be resolved
    Session cannot be resolved or is not a type
    Store cannot be resolved or is not a type
    Folder cannot be resolved
    folder cannot be resolved or is not a type
    Message[] cannot be resolved or is not a type
    import javax.mail.*;
    import javax.mail.internet.*;
    public class fetch_mail {
         public static void main (String args[])
          throws Exception {
         Properties props = new Properties();
         Session session = Session.getDefaultInstance(props, null);
         Store store = session.getStore("pop3");
        store.connect("smtp.host.com", "user", "pwd");
        Folder inbox = store.getFolder("INBOX");
        inbox.open(Folder.READ_ONLY);
        try {
        Message message[] = inbox.getMessages();
        for (int i=0, n=message.length; i<n; i++) {
        String subject = message.getSubject().toString();
    if (subject.startsWith("[test]")) {
    System.out.println("\r" + i + ": "
    + message[i].getFrom()[0]
    + "\t" + message[i].getSubject());
    String content =
    message[i].getContent().toString();
    if (content.length() > 200) {
    content = content.substring(0, 200);
    System.out.print(content);
    catch (IOException e) {
    System.err.println("Caught IOException");
    // Close connection
    inbox.close(false);
    store.close();
    System.exit(0);

    I got it figured out..
    Altho i did inlude the jar files into the Eclipse, i actually need to put them in the jdk jre lib ext folder to get it all to work right.
    mail.jar and activation.jar

  • Is it possible to call a function in a parent component from a child component in Flex 3?

    This is probably a very basic question but have been wondering this for a while.
    I need to call a function located in a parent component and make the call from its child component in Flex 3. Is there a way to access functions in a parent component from the child component? I know I can dispatch an event in the child and add a listener in the parent to call the function, but just wanted to know if could also directly call a parent function from a child (similar to how you can call a function in the main mxml file using Application.application). Thanks

    There are no performance issues, but it is ok if you are using the child component in only one class. Suppose if you want to use the same component as a child to some bunch of parents then i would do like the following
    public interface IParentImplementation{
         function callParentMethod();
    and the parent class should implement this 'IParentImplementation'
    usually like the following line
    public class parentClass extends Canvas implements IParentImplementation{
              public function callParentMethod():void{
         //code
    in the child  you should do something like this.
    (this.parent as IParentImplementation).callParentMethod();
    Here using the Interfaces, we re decoupling the parent and the child
    If this post answers your question or helps, please mark it as such.

Maybe you are looking for

  • Standard user cannot install apps

    I have setup a Mac Mini in my office for several people to use, with me as Admin and others as Standard account.  The problem is, when someone wants to install an app, they always get a prompt to input the Admin's username and password.   From my res

  • AIR app won't debug or compile in FB 4.7

    So I have an AIR app that's been around quite awhile, going back to Flex Builder 3 and AIR 2.x... I've recently upgraded to Flash Builder 4.7 and I had no troubles with this app until today when I tried to run it in Debug mode -- I got some errors ab

  • How to handle attachment in Web Services?

    is there any way to handle attachments in JCAPS Web Services? If you have any white paper/documents please provide me link? Thanks

  • For Macbook pro Retina and Macbook Air Users Please Help

    Hi i Want Ask Macbook pro Retina and Macbook Air Users how use this macs both ( Only how use  both ) we sit many hours on laptop that will hurt our eyes what the macbook less strain on eyes what the best macbook screen not hurt our eyes sorry my engl

  • Midi  start/stop signals

    does any body know if you can get garageband to send/recieve midi start/stop signals. i.e. I want to hit record on garageband and have it signal my drum machine, synth, sequencer or whatever to play