Dynamic enum instantiation and access

Here's what I would like to do, but I'm not sure if/how it can be done.
Given a set of enum's e1, e2, e3;
1. Specify at runtime the enum I'm interested in as a string "e1".
2. Dynamically create an object of that type.
3. Access the values() method at runtime to see what the constants of e1 are.
I can get this far:
String className = new String("e1");
Class c = Class.forName(className);
Object o = c.newInstance();Step #3 is the issue. I don't know how to cast the object in order to get access to the values() method. The Enum class does not include that method. Anyone know what does that I can cast my object to?
Thanks,
Mark

import java.util.EnumSet;
* @since October 10, 2006, 12:41 PM
* @author Ian Schneider
public enum DynamicEnumAccess {
    A,B,C,D,E,F,G;
    public static void main(String[] args) throws Exception {
        Class<? extends Enum> e = (Class<? extends Enum>) Class.forName("DynamicEnumAccess");
        EnumSet allOf = EnumSet.allOf(e);
        System.out.println(allOf);
}

Similar Messages

  • Dynamic web pages and Access

    I am starting to work on some dynamic web pages to upload
    information to an Access 2003 database using ASP. What I would like
    to do is to give the user a chance to review their information
    before it actually gets sent to the database. That is to say, after
    they fill out the form on the dynamic web page, and click a submit
    button, I would like to bring up a new page with their info
    summarized and give them the chance to review it and/or go back and
    make changes before it actually gets written to the database. Any
    suggestions would be appreciated!

    I'm not sure what the question is. It sounds like you already
    know what you want.
    Have the form post to an asp page that retrieves the form
    values and displays them in the format you want. Give them the
    choice to go back and make changes or submit. The second page can
    also be a form that you dynamically populate from the first page
    values.
    I'm not really sure what the benefit of this is. Why do the
    users need a different page to review what they input from the
    original page? What added value will there be?

  • Dynamic/Static and Accessibility

    Hi,
    Firstly, I apologize if I've posted in the wrong forum.
    I have two pdf's created by LiveCycle.  One is static which supports accessibility and one is dynamic which does not.  My question is, is there a way to get a dynamic pdf to support accessibility or does it's "dynamic" nature preclude this?
    Thanks in advance
    Phil Knight.

    The accessibility is not affected by form type. Are you relying on Acrobat's accessibility or are you setting up the accessibility in LC Designer?
    Paul

  • How to create dynamic View Object and Dynamic Table

    Dear ll
    I want to create a dynamic view object and display the output in a dynamic table on the page.
    I am using Jdeveloper 12c "Studio Edition Version 12.1.2.0.0"
    This what I did:
    1- I created a read only view object with this query "Select sysdate from dual"
    2- I added this View object to the application module
    3- I created a new method that change the query of this View object at runtime
        public void changeVoQuery(String dbViewName) {
            String sqlstm = "Select * From " + dbViewName;
            ViewObject dynamicVo = this.findViewObject("DynamicVo");
            if (dynamicVo != null) {
                dynamicVo.remove();
            dynamicVo = this.createViewObjectFromQueryStmt("DynamicVo", sqlstm);
            dynamicVo.executeQuery();
    4- I run the application module for testing the method and I passed "Scott.Emp" as a parameter and the result was Success
    5- Now I want to show the result of the view on the page, so I draged and dropped the method from the data control as a parameter form
    6- I dragged and dropped the view Object "DynamicVo" as a table and I choose "generate Column Dynamically at runtime". This is the page source
    <af:panelHeader text="#{viewcontrollerBundle.SELECT_DOCUMTN_TYPE}" id="ph1">
            <af:panelFormLayout id="pfl1">
                <af:inputText value="#{bindings.dbViewName.inputValue}" label="#{bindings.dbViewName.hints.label}"
                              required="#{bindings.dbViewName.hints.mandatory}"
                              columns="#{bindings.dbViewName.hints.displayWidth}"
                              maximumLength="#{bindings.dbViewName.hints.precision}"
                              shortDesc="#{bindings.dbViewName.hints.tooltip}" id="it1">
                    <f:validator binding="#{bindings.dbViewName.validator}"/>
                </af:inputText>
                <af:button actionListener="#{bindings.changeVoQuery.execute}" text="changeVoQuery"
                           disabled="#{!bindings.changeVoQuery.enabled}" id="b1"/>
            </af:panelFormLayout>
        </af:panelHeader>
        <af:table value="#{bindings.DynamicVo.collectionModel}" var="row" rows="#{bindings.DynamicVo.rangeSize}"
                  emptyText="#{bindings.DynamicVo.viewable ? 'No data to display.' : 'Access Denied.'}"
                  rowBandingInterval="0" selectedRowKeys="#{bindings.DynamicVo.collectionModel.selectedRow}"
                  selectionListener="#{bindings.DynamicVo.collectionModel.makeCurrent}" rowSelection="single"
                  fetchSize="#{bindings.DynamicVo.rangeSize}" filterModel="#{bindings.DynamicVoQuery.queryDescriptor}"
                  queryListener="#{bindings.DynamicVoQuery.processQuery}" filterVisible="true" varStatus="vs" id="t1"
                  partialTriggers="::b1">
            <af:iterator id="i1" value="#{bindings.DynamicVo.attributesModel.attributes}" var="column">
                <af:column headerText="#{column.label}" sortProperty="#{column.name}" sortable="true" filterable="true"
                           id="c1">
                    <af:dynamicComponent id="d1" attributeModel="#{column}"
                                         value="#{row.bindings[column.name].inputValue}"/>
                </af:column>
            </af:iterator>
        </af:table>
    when I run the page this error is occured
    <Nov 13, 2013 2:51:58 PM AST> <Error> <oracle.adfinternal.view.faces.webapp.rich.RegistrationFilter> <BEA-000000> <ADF_FACES-60096:Server Exception during PPR, #1
    javax.el.ELException: java.lang.NullPointerException
    Caused By: java.lang.NullPointerException
    Can any body help me please
    thanks

    Have you seen Shay's video https://blogs.oracle.com/shay/entry/adf_faces_dynamic_tags_-_for_a
    All you have to do is to use the dynamic table to get your result.
    Timo

  • How to store the value into variable and access it in RMAN script

    I want to create a variable and dynamically assign a numeric value to it (may get the value may be from SQL )and access the value in RMAN script.
    Thanks...Raj

    Raj,
    We have been getting this type of request and it is not possible via RMAN to do that.
    BUT--You could write a sql/plus script to query your variable and produce the RMAN script with the new value.
    Just a suggestion.
    Tammy

  • How do I store VI References in global variables and access them later

    From what I know, Labview automatically deletes VI references when they go out of use. Is there a way for me to override this so that I can access a set of preloaded references in a separate VI? Essentially I would like to open the VI's dynamically into the memory, store the references in global variables and access them at a later time. The VI's I'm referencing won't be known until runtime. I know its not the safest way to do it, but it would be the most productive on my end.
    Thank you
    Clay Upton

    I'm not sure what you mean by "a later time", but a VI reference will remain valid as long as the VI is in memory. If you don't unload the VIs, the references will remain valid.
    If you do need to unload the VIs, for whatever reason, I would suggest the following:
    Create a functional global as your interface for obtaining the references.
    Feed the paths to the VIs into the VI when initializing it (since you don't know which VIs in advance).
    When calling the VI to obtain the references, have the VI check them first (using the Not a Number... primitive). If it sees that they're invalid, it can open a new reference and return that.
    You should note that when a VI is removed from memory, the data space is used is released, so if those VIs are expected to hold data (using shift registers, etc.) this will be a problem.
    The description I've given will only be usable in certain instances (and it has its intricacies), but you didn't really give any details about what you're actually trying to accomplish.
    Try to take over the world!

  • Can I connect an externa hard drive and access files from 2 or more computers wirelessly?

    Is there a way to connect an external hard drive to my linksys modem and access the files wirelessly by 2 or more computers?
    I have a wireless G wrt54G modem working on windows XP a desktop and laptop on my home system. I have a WD “my book” external hard drive with a usb interface. My modem does not have a USB interface.
    At work I also have 4 laptops  using XP and vista and looking to have them all access an external hard drive and printers. I have not selected a hard drive for the work system.
    If yes can I add 2 or more printers and print form all connected computers?
    If yes, is it possible to access the files of the external hard drive (home system) via the internet?
    Thanks in advance for all your help

    First, your WRT54G is a router, not a modem. Different function.
    Yes, you can  "connect an external hard drive... and access the files wirelessly by 2 or more computers," just not that external hard drive. You need one that supports network attachment, with an ethernet connection.
    And you can print to printers from various computer, again if the printers are made to support that.
    The answer to your last question is maybe. Oh, it's definitely possible, but may require learning about static IP addresses, dynamic DNS, firewalls, port forwarding, file sharing...

  • Problems after downloading the lastest version of iTunes for my iPod Touch. Now whenever I switch on my laptop and access the internet I get an error message. 2nd time this has happened and I'm fed up trying to fix it. Anybody having similar problems?

    I've downloaded iTunes 10.5 onto my iPod Touch, no problems but I've now got a constant error message on my laptop everytime I switch it on and access the internet. The message is "The procedure entry point xmlTextReaderConstName could not be located in the dynamic link library libxml2.dll"
    This is the 2nd time this has happened. Last time iTunes Support called and we ran through a load of checks to no avail. The only option was to delete iTunes completely off my laptop and go for a new download of it. Can anybody tell me how to do it - didn't write it down last time, silly me, never thought it would happen again. Also sent an email to iTunes Support - waiting for a response.

    Maybe:
    "Waiting for changes to be applied": Apple Support Communities
    Also I requested that your email address be deleted. Personal responses are not given in this forum

  • Instantiation and Encapsulation

    Hi
    Can any one explain me about instantiation and Encasulation with example, i am new to ABAP Objects.
    Please dont send any links.
    Arun Joseph

    Hi,
    First let me give small introduction to OO ABAP programing.
    Object-oriented programming is a method of implementation in which programs are organized      as cooperative collections of objects, each of which represents  an instance of some class...?
    A class is a set of objects that share a common
    structure and a common behavior
    A class will have attributes ( i.e data definition) and methods ( nothing but functions )
    We can also call  object as Instance of the class.
    Lets see a simple demo class to calcualte SUM of 2 numbers.
    define 2 variables a and b of type i. (Attributes)
    SUM is the method name. this will have the logic to do the sum.
    2 importing paramers and an exporting parameter res for the method.
    Note: you can either create a class either globally or locally..
    Goto SE24 to create Global class, this class will be avaialable for use in all the programs, this is like class library with all global classes.
    Local class is the one which you create in SE38 i.e; your own program,
    by this it is understood that it's scope is only upto that program
    SO let us discuss the example with SE24(global class)
    give a class name, description,
    In the attributes tab, define a and b of type i, level as instance attribute and
    visibility as public That means these attributes are available outside this class also. we will come to this later.
    in the methods tab give name, level as instance, visibilty as pubilc again.
    now double click on the method name, it will take to you to write the code.
    (method implementation)
    just wirte between the method ---endmethod,
    res = num1 + num2.
    come back to methods tab, click on parameters button, to define exporting, importing etc.. paramters for your method,
    define 'res' as an exporting parameter, 2 variables num1 and num2 as importing parameters.Activate the class.
    now you have defined a class.
    whenever you want the logic to sum 2 variables, in all those cases you can make use of the SUM method in this class. This is what Reusability is.A very imp. feature of OO ABAP.
    So now comes Instantiation.
    you can't directly access a class.
    You have to create a reference variable of the type of the class, then create an object with the reference variable. (memory allocation).
    This step is called Instantiation or Instantiating the class
    For this go to se38, in which ever program you want to instatantiate the above class.
    do as below.
    data: obj type ref to zsow_cl1.
    start-of-selection.
    create object obj.
    Now object of the above class is ready for you.
    Now all the contents i.e either attributes or methods etc of the class can be accessed with this object
    now you have to call the method 'sum' of the above class using the above object in your program for the sum functionalty.
    for that click on Pattern button select 'Abap Object Patterns' press enter
    select 'Call method' radio button, give your object name ('OBJ')
    class name  ( ZSOW_CL1)
    give the method name (SUM)
    class and method names can be selected from the F4
    press enter.
    you will get the below line in your program
    CALL METHOD OBJ->SUM
      EXPORTING
        NUM1   =
        NUM2   =
    *  IMPORTING
    *    RES    =
    now define 2 variables of type i to pass the inputs to the method and one more vairable to hold the output coming from the FM
    on the whole code in your se38 is as follows.
    DATA: OBJ TYPE REF TO ZSOW_CL1,
          X TYPE I,
          Y TYPE I,
          Z TYPE I.
    START-OF-SELECTION.
      CREATE OBJECT OBJ.
      X = 10.
      Y = 10.
      CALL METHOD OBJ->SUM
        EXPORTING
          NUM1 = X
          NUM2 = Y
        IMPORTING
          RES  = Z.
      WRITE: Z.
    so Z will give the output.
    Next is Encapsulation
    while defining the method i asked you to give the visibility as Public.
    Visibility can be of 3 types:
                  Public
                  Protected
                  Private
    public means as i said above the method or varaibles can be used outside the class also.as you did above outside the class you have created an object to the class and
    accessed the method.
    private means the attributes/methods that you define in the class can only be accessed in/by the method of the same class, they cannot be accessed anywhere else and outside.
    change your 'a' parameter visibilty to private and try the below code in se38.
    obj->b = 10.
    obj->a = 10.
    1st line doesn't give error, since 'b' is public attribte,
    2nd line will give error since 'a' is now private.
    you can use 'a' in the 'SUM' method if you want.
    Protected means it can't be accessed outside of the class like with the help of object, but can be accessed in  the child class if defined to the above class.
    just post if you have any other doubts after trying this example.
    Do reward points if it helps you.
    Regards,
    Sowjanya

  • EventManager in illustrator and access to the annotationSuite (Scripting)

    Hello,
    Would be really great if illustrator had an eventManager such as the one found in inDesign.
    also it would be great if we had (easy) access to the cpp annotation suite
    Our print company deems CPP plugins to be too much maintenance due to the size of our IT dept and average level of expertise, so developing a plugin in CPP is really not ideal for us to achieve this same functionality. (and we'd probably lose the access to the DOM we enjoy so very much in patchpanel if we made our own cpp plugin?).
    This is my dream
    onOpen(document){
    document.addannotation(x,y,"cool annotation");
    Thanks!

    Consumer and provider proxies are generated at design time and are instantiated and active at runtime. The idea behind proxies is to hide complexities of SOA protocols and standards from the consumer and provider applications. Proxy generation tools are part of SAP SOA middleware.
    To appreciate the beauty of proxies, here is an example: you are implementing SAP SCM TP/VS (Transportation Planning/Vehicle Scheduling) and you want to incorporate a web service provided by PC Miler to receive precise distance between two locations. All you have to do to be able to consume this web service from ABAP is to go to transaction SE80 and generate the client (consumer) proxy based on the WSDL of the service. You do not have to know anything about XML or SOAP. The client proxy will be generated as a global class. All you then need to do is to build a consumer program that instantiates the class and calls a method that corresponds to the service you need.
    It is similarly with the provider proxy. You design your service and at the end of the design phase you generate the proxy, which at this time is just a shell (methods with their interfaces). Then to implement the service you just put your code into this shell. The code implements the logic the service is supposed to provide.
    I hope this helps a bit.
    Regards,
    Andrzej

  • Tab keys and access keys

    I filled in the required info for dynamic textboxes in the
    accessibility panel but the tab keys still do not work in the exe
    file. Flash CS3.
    Any clues?
    Thanks.

    I'm want to change my forms resource file to map a key for next tab and previous tab:
    eg, for Alt+C to exit a form the entry is:
    67 : 8 : "Alt+C" : 32 : "Exit"
    Where 32 is the Forms Function Number.
    Does anyone know what the forms function numbers for next / previous tab are?
    Many Thanks,
    Jayesh Kavia

  • How can multiple users edit and access same ACCESS file

    Hello,
    We have 2 access files and multiple users needs to edit and access those files.
    How can I enable mulitple access but only one user can edit rest of users are in read-only mode for one file and multiple access and edit on the another file.

    Hi,
    You should split your database in a front and backend. Then create two seperate front ends which you can distribute. If you need readonly you can opt for two options, setting the attributes of the file to read only or create a front end with read only forms.
    The last one takes a little more work but is safer than setting the attributes to read only because people can change that back themselfs.
    Maurice

  • How can I dynamically assign prompt and URI to a button in a table?

    I've got a VO returning document name, link and a status flag. My resultsTable for this VO is currently displaying 3 fields: 2 messageStyledText fields for the document name and link text, and a switcher that shows a checkbox image or red X image depending on the value.
    I now want to put a button into this results table that a user can click to launch a subsequent page where they can fill out those related docs. To do this, I'd like to make the prompt of this button = VO.documentName, the Desitination URI of this button = VO.linkText, and then leave the switcher as is. The result might look somethign like this:
    <Form 838C> X
    <Form 1952> \/
    <Form 1234> X
    In this case, Form 1952 ahs been filled out, the others not. Users should be able to click one of the buttons to launch a subsequent page where they can fill the form.
    I found code to walk through a VO results set using an iterator, you'll see that below. Now, stubbed in these 3 steps below:
    --set button dest
    --set button label
    --determine loop end
    I can't see how to do this. I already have the table, so can I walk through the results set and access the results table at the same time?
    I need to be able to set each of the buttons to the right Label (Prompt) and then set each button to the appropriate destination. Here's what I have so far: Thanks in advance!
    public void processRequest(OAPageContext pageContext, OAWebBean webBean)
    super.processRequest(pageContext, webBean);
    * Initializes the detail employee query.
    OAApplicationModule am = pageContext.getApplicationModule(webBean);
    OAViewObject summaryVO = (OAViewObject)am.findViewObject("LANLSupplDocsSummaryVO1");
    if (summaryVO != null)
    // Do not reinitialize the VO unless needed.
    String stringReqHeaderId = pageContext.getParameter("REQ_ID");
    Number defaultReqHeaderId = null;
    try
    defaultReqHeaderId = new Number(stringReqHeaderId);
    catch(Exception e)
    // throw new OAException("AK", "FWK_TBX_INVALID_EMP_NUMBER");
    throw new OAException("ICX", "XXXL_INVALID_NUMBER");
    summaryVO.setWhereClauseParams(null);
    summaryVO.setWhereClauseParam(0,defaultReqHeaderId);
    summaryVO.executeQuery();
    // This controller is associated with the table.
    OATableBean table = (OATableBean)webBean;
    // We need to format the Switcher image column so the image is centered
    // (this isn't done automatically for Switchers as it is for
    // plain image columns). We start by getting the table's
    // column formats.
    // NOTE!!! You must call the prepareForRendering() method on the table before
    // formatting columns. Furthermore, this call must be sequenced after the
    // table is queried, and after you do any control bar manipulation.
    table.prepareForRendering(pageContext);
    DataObjectList columnFormats = table.getColumnFormats();
    DictionaryData columnFormat = null;
    int childIndex = pageContext.findChildIndex(table, "DOC_STATUS");
    // int buttonIndex = pageContext.findChildIndex(table, "DOC_STATUS");
    // int meaningIndex = pageContext.findChildIndex(table, "MEANING");
    columnFormat =(DictionaryData)columnFormats.getItem(childIndex);
    columnFormat.put(COLUMN_DATA_FORMAT_KEY, ICON_BUTTON_FORMAT);
    LANLSupplDocsSummaryVORowImpl row = null;
    // This tells us the number of rows that have been fetched in the
    // row set, and will not pull additional rows in like some of the
    // other "get count" methods.
    int fetchedRowCount = vo.getFetchedRowCount();
    // We use a separate iterator -- even though we could step through the
    // rows without it -- because we don't want to affect row currency.
    RowSetIterator deleteIter = vo.createRowSetIterator("deleteIter");
    if (fetchedRowCount > 0)
    deleteIter.setRangeStart(0);
    deleteIter.setRangeSize(fetchedRowCount);
    for (int i = 0; i < fetchedRowCount; i++)
    row = (LANLSupplDocsSummaryVORowImpl)deleteIter.getRowAtRangeIndex(i);
    // For performance reasons, we generate ViewRowImpls for all
    // View Objects. When we need to obtain an attribute value,
    // we use the named accessors instead of a generic String lookup.
    // Number primaryKey = (Number)row.getAttribute("EmployeeId");
    String formPage = row.getMeaning();
    --set button dest
    --set button label
    --determine loop end
    break; // only one possible selected row in this case
    // Always close the iterator when you're done.
    deleteIter.closeRowSetIterator();
    }

    Thanks Guaravv,
    I'm unable to get this to compile. Here's the errors I'm getting, followed by my controller code. Thanks again!
    Project: LANLSupplementalDocs.jpr
    C:\oracle\jDeveloper\jdevhome\jdev\myprojects\lanl\oracle\apps\icx\por\req\webui\LANLSupplementalDocsSummaryCO.java
    Error(16,46): cannot access class oracle.apps.fnd.framework.webui.beans.OAButtonBean; file oracle\apps\fnd\framework\webui\beans\OAButtonBean.class not found
    Error(124,9): class OAButtonBean not found in class lanl.oracle.apps.icx.por.req.webui.LANLSupplementalDocsSummaryCO
    Error(124,26): class OAButtonBean not found in class lanl.oracle.apps.icx.por.req.webui.LANLSupplementalDocsSummaryCO
    Error(125,9): class OADataBoundValueViewObject not found in class lanl.oracle.apps.icx.por.req.webui.LANLSupplementalDocsSummaryCO
    Error(125,47): class OADataBoundValueViewObject not found in class lanl.oracle.apps.icx.por.req.webui.LANLSupplementalDocsSummaryCO
    Controller:
    /*===========================================================================+
    | Copyright (c) 2001, 2005 Oracle Corporation, Redwood Shores, CA, USA |
    | All rights reserved. |
    +===========================================================================+
    | HISTORY |
    +===========================================================================*/
    package lanl.oracle.apps.icx.por.req.webui;
    import oracle.apps.fnd.common.VersionInfo;
    import oracle.apps.fnd.framework.webui.OAControllerImpl;
    import oracle.apps.fnd.framework.webui.OAPageContext;
    import oracle.apps.fnd.framework.webui.beans.OAWebBean;
    import oracle.cabo.ui.data.DictionaryData;
    import oracle.cabo.ui.data.DataObjectList;
    import oracle.apps.fnd.framework.webui.beans.table.OATableBean;
    import oracle.apps.fnd.framework.webui.beans.OAButtonBean;
    import oracle.apps.fnd.framework.webui.OAWebBeanConstants;
    import oracle.apps.fnd.framework.OAViewObject;
    import oracle.apps.fnd.framework.OAException;
    import oracle.jbo.domain.Number;
    import oracle.apps.fnd.framework.OAApplicationModule;
    //import oracle.apps.fnd.framework.webui.beans.form.OASubmitButtonBean;
    //import oracle.apps.fnd.framework.webui.beans.layout.OASpacerBean;
    //import oracle.apps.fnd.framework.webui.beans.layout.OAPageLayoutBean;
    * Controller for ...
    public class LANLSupplementalDocsSummaryCO extends OAControllerImpl
    public static final String RCS_ID="$Header$";
    public static final boolean RCS_ID_RECORDED =
    VersionInfo.recordClassVersion(RCS_ID, "%packagename%");
    * Layout and page setup logic for a region.
    * @param pageContext the current OA page context
    * @param webBean the web bean corresponding to the region
    public void processRequest(OAPageContext pageContext, OAWebBean webBean)
    super.processRequest(pageContext, webBean);
    * Initializes the detail employee query.
    OAApplicationModule am = pageContext.getApplicationModule(webBean);
    OAViewObject summaryVO = (OAViewObject)am.findViewObject("LANLSupplDocsSummaryVO1");
    if (summaryVO != null)
    // Do not reinitialize the VO unless needed.
    String stringReqHeaderId = pageContext.getParameter("REQ_ID");
    Number defaultReqHeaderId = null;
    try
    defaultReqHeaderId = new Number(stringReqHeaderId);
    catch(Exception e)
    // throw new OAException("AK", "FWK_TBX_INVALID_EMP_NUMBER");
    throw new OAException("ICX", "XXXL_INVALID_NUMBER");
    summaryVO.setWhereClauseParams(null);
    summaryVO.setWhereClauseParam(0,defaultReqHeaderId);
    summaryVO.executeQuery();
    // This controller is associated with the table.
    OATableBean table = (OATableBean)webBean;
    // We need to format the Switcher image column so the image is centered
    // (this isn't done automatically for Switchers as it is for
    // plain image columns). We start by getting the table's
    // column formats.
    // NOTE!!! You must call the prepareForRendering() method on the table before
    // formatting columns. Furthermore, this call must be sequenced after the
    // table is queried, and after you do any control bar manipulation.
    table.prepareForRendering(pageContext);
    DataObjectList columnFormats = table.getColumnFormats();
    DictionaryData columnFormat = null;
    int childIndex = pageContext.findChildIndex(table, "DOC_STATUS");
    // int buttonIndex = pageContext.findChildIndex(table, "DOC_STATUS");
    // int meaningIndex = pageContext.findChildIndex(table, "MEANING");
    columnFormat =(DictionaryData)columnFormats.getItem(childIndex);
    columnFormat.put(COLUMN_DATA_FORMAT_KEY, ICON_BUTTON_FORMAT);
    // LANLSupplDocsSummaryVORowImpl row = null;
    // This tells us the number of rows that have been fetched in the
    // row set, and will not pull additional rows in like some of the
    // other "get count" methods.
    int fetchedRowCount = summaryVO.getFetchedRowCount();
    // We use a separate iterator -- even though we could step through the
    // rows without it -- because we don't want to affect row currency.
    // RowSetIterator deleteIter = vo.createRowSetIterator("deleteIter");
    if (fetchedRowCount > 0)
    for (int i = 0; i < fetchedRowCount; i++)
    OATableBean tableBean = (OATableBean)webBean.findChildRecursive("ResultsTable");
    OAButtonBean m= (OAButtonBean)tableBean.findChildRecursive("DocLauncher");
    OADataBoundValueViewObject tip1 = new OADataBoundValueViewObject(m, "MEANING");
    m.setAttributeValue(oracle.cabo.ui.UIConstants.DESTINATION_ATTR, tip1);
    else
    throw new OAException("ICX", "XXXL_BC");
    }

  • UWC/CE 6.3 and Access Manager 7.1 SSO sometimes fails (seems like a bug)

    PREAMBULA: I started writing this post thinking that our AM SSO setup was at fault in some step. As I was gathering data, checking the doc-links and config files and finally sniffed the servers for HTTP dialogs, I grew pretty sure there's a bug in UWC/CE, AM SDK or Web Server Policy Agent, whatever implements the AM SSO session checking.
    In short, as written below, our "sunmail" server can POST a broken cookie to AM server, if the cookie originally contained a "plus" character. The "plus" is replaced by a "space", invalidating the session check. As we know, "+" is often used in URLs to "escape" the space character. Perhaps some URL cleanup routine backfired here. I have double-checked, it is not the reverse proxy on "psam" breaking things. It is "sunmail" (UWC/CE or Policy Agent, don't know for certain) supplying the broken request. On the few occasions when the AM cookie contains no "plus" characters, the SSO works like a charm (also checked by a sniffer). Whenever there is a "plus", it breaks.
    Is there some known bug or workaround that matches this description?
    Nevertheless, for completeness' sake I kept the description of our setup. Maybe it's at fault after all :)
    We have an installation of JCS5 with the latest patches as of early July 2008. And as the subject implies, we have problems with AM SSO in UWC/CE web-interface. I have reported them before, then they seemed fixed (not occuring for several tests in a row), but as time has shown, something wrong is still there.
    So I'll try to go into deeper detail now, as we've may have overlooked some nuance... Then again, as my sniffer research below shows, this may be an engine bug and these setup details are irrelevant.
    Our setup is split into several Solaris 10 full-root zones hosted on several servers, some of the components are enroute to HA (perhaps we made some mistakes on this part of the way?)
    So, we have the following software stack:
    1) two MMR Directory Servers (DSEE 6.3 = DSEE 6.2 from JCS5 + 125278-07__DSEE_6.3__x86x64 + 125277-07__DSEE_6.3__x86_sol9 patches) working in zones on two different servers. Except for one time when a manually forced ZFS rollback corrupted one of the server instances, no problems here.
    2) two zones with Directory Proxy Servers (6.3, exact versions as above) running at port 389 provide the clients with an illusion that they have a stable Directory Server, even if one of the actual servers is currently rebooting ;)
    These DPS zones are hosted on two different servers as well and are primarily used by LDAP clients (JCS components) running in other zones on the same respective servers.
    3) A zone with Sun Web Server 7.0U1 and Access Manager 7.1 (+ 126357-01__AM71_x86 patch) and Delegated Admin 6.4-4.01 (from JCS5 + 121582-18__COMMCLI64__x86 patch).
    At the moment there is one such zone (named "cos-psam-01.domain.ru" in the logs below), but we expect(-ed) it to become two similar zones as per AM HA setup.
    Zones listed in (1-3) use private IP numbers, they belong in our internal DMZ.
    Zones listed in (4-5) below use public (routed) IP numbers, they belong in our external DMZ.
    4) A zone with Sun Web Server 7.0U1 used primarily as a reverse-proxy server (optionally with a load-balancer libpassthrough.so plugin) successfully used for other hosted projects. One of its configurations now passes connections from an externally routed IP address published as "psam.domain.ru" to "cos-psam-01.domain.ru", per AM HA setup, so HTTP clients believe they work with an Access Manager instance. This zone has a backend interface with a private IP address to communicate with the actual AM instance.
    In AM configuration (both LDAP and file-based) we have configured a site ID with the publicly known name and mentioned both names (psam and cos-psam-01) in organization's realm/dns aliases.
    5) A zone with the rest of the Sun Java Communications Suite 5, as in Messaging Server 6.3 (6.3-6.03 64-bit: ci-5.0-1.03_solx86_x64__Messaging_Server_6.3-2 + patch 126480-09__MSG63__x86-64), UWC/CE 6.3 (from JCS5 + 122794-17__UWC63-4.01_core__x86), Instant Messaging 7.2 (from JCS5 + 118790-29__IM72__x86-1 + 118787-28__IM72__x86-2), Calendar Server 6.3 (from JCS5 + 121658-28__iCS63__x86). The web-components (UWC/CE, IM, /httpbind) are deployed in a Sun Web Server 7.0U1 as well.
    This zone is named "sunmail.domain.ru" and has a routed IP address for direct external access to its servicess.
    The AM SDK part is also patched (126357-01__AM71_x86); it points to the load-balancer name ("psam.domain.ru") as an actual AM server.
    # imsimta version
    Sun Java(tm) System Messaging Server 6.3-6.03 (built Mar 14 2008; 64bit)
    libimta.so 6.3-6.03 (built 17:15:08, Mar 14 2008; 64bit)
    SunOS sunmail 5.10 Generic_127112-07 i86pc i386 i86pc
    While setting up this server set we tried to use AM SSO as the user login method, but it works unreliably.
    "Unreliably" means that while most of the time entering a correct uid and password in Access Manager login page ("http://psam.domain.ru/amserver/UI/Login") does redirect a user back to "http://sunmail.domain.ru/uwc/auth" along with a new cookie, and the user is redirected again to his or her mailbox, sometimes the user receives the UWC/CE login page. Entering the same uid and password here does log him in, but it breaks the whole point of SSO and only increases the end-user routine required to log in :\
    We have also seen the "missing mail tab" problem - if the users point the browser to any hostname different from "sunmail.domain.ru" (i.e. www.mail.domain.ru which is equivalent in DNS), they have only the Address book, Calendar and Options tabs; no webmail. So far this is resolved by Policy Agent forcing The One name of the server.
    Here's the configuration we did specifically for AM SSO:
    1) in AMConfig.properties of "sunmail" and "cos-psam-01" we set up
    com.iplanet.am.cookie.encode=false
    am.encryption.pwd=<the same value>
    all hostname-related parameters point to "psam.domain.ru"
    2) in AMConfig.properties of "cos-psam-01" a number of FQDN equivalence entries are added (so it does not redirect to a server hostname unknown to visitors):
    com.sun.identity.server.fqdnMap[publicname-or-ip]=psam.domain.ru
    com.sun.identity.server.fqdnMap[cos-psam-01.domain.ru]=cos-psam-01.domain.ru
    3) in "msg.conf" on "sunmail" (entries added via configutil):
    local.webmail.sso.amcookiename = iPlanetDirectoryPro
    local.webmail.sso.amnamingurl = http://psam.domain.ru:80/amserver/namingservice
    local.webmail.sso.singlesignoff = yes
    local.webmail.sso.uwcenabled = 1
    service.http.ipsecurity = no
    (perhaps some more options are required? Looking for confirmation about: local.webmail.sso.uwclogouturl local.webmail.sso.uwccontexturi local.webmail.sso.uwchome service.http.allowadminproxy )
    4) Configured Web Policy Agent for Sun Web Server, so that users without an AM session are required to get one. Set up per [http://msg.wikidoc.info/index.php/AM_redirection_using_Policy_Agent], except that com.sun.am.policy.agents.config.notenforced_list points to the many names our server can go known by.
    5) Updated the logout URL in /opt/SUNWuwc/webmail/main.js:
    --- main.js.orig        Sat Jan 26 07:52:09 2008
    +++ main.js     Mon Jul 21 01:06:29 2008
    @@ -667,7 +667,8 @@
    function cleanup() {
       if(laurel)
    -      top.window.location =  getUWCHost() + "/base/UWCMain?op=logout"
    +//      top.window.location =  getUWCHost() + "/base/UWCMain?op=logout"
    +      top.window.location =  "http://sunmail.domain.ru:80/base/UWCMain?op=logout"
       else
           exec('logout', '', 'exit()')
    @@ -1707,7 +1708,8 @@
       if(lg) {
             url = document.location.href
             url = url.substr(0,url.indexOf('webmail'))
    -        uwcurl = url + 'base/UWCMain?op=logout'        
    +//      uwcurl = url + 'base/UWCMain?op=logout'        
    +        uwcurl = "http://sunmail.domain.ru:80/base/UWCMain?op=logout"
       exit()
    }6) Calendar SSO - per docs...
    According to ngrep sniffing,
    1) the browser goes to "http://sunmail.domain.ru/uwc/auth" without any cookies
    2) receives a redirect and goes to "http://psam.domain.ru/amserver/UI/Login?gotoOnFail=http://sunmail.domain.ru:80/uwc&goto=http%3A%2F%2Fsunmail.domain.ru%3A80%2Fuwc%2Fauth"; sends no cookies either.
    3) The first response from the "psam" server (as redirected from "cos-psam-01") sets a few cookies while rendering the login page:
    Set-cookie: JSESSIONID=7EF8F2810D2071CA03CFEAE9972735B2; Path=/
    Set-cookie: AMAuthCookie=AQIC5wM2LY4SfcwuT2ASCrsfO78nXdceEHXeH1+xTqH7C3I=@AAJTSQACMDI=#; Domain=.domain.ru; Path=/
    Set-cookie: amlbcookie=02; Domain=.domain.ru; Path=/
    4) The browser requests the login page resources (javascripts, images, etc) using these cookies, as in this header line:
    Cookie: JSESSIONID=7EF8F2810D2071CA03CFEAE9972735B2; AMAuthCookie=AQIC5wM2LY4SfcwuT2ASCrsfO78nXdceEHXeH1+xTqH7C3I=@AAJTSQACMDI=#; amlbcookie=02
    5) The browser POSTs the login request to "/amserver/UI/Login" and receives a redirection to http://sunmail.domain.ru:80/uwc/auth
    Set-cookie: iPlanetDirectoryPro=AQIC5wM2LY4SfcwuT2ASCrsfO78nXdceEHXeH1+xTqH7C3I=@AAJTSQACMDI=#; Domain=.domain.ru; Path=/
    Set-cookie: AMAuthCookie=LOGOUT; Domain=.domain.ru; Expires=Thu, 01-Jan-1970 00:00:10 GMT; Path=/
    6) The browser requests "http://sunmail.domain.ru/uwc/auth" using the newly set cookie (looks like the old one to me though):
    Cookie: amlbcookie=02; iPlanetDirectoryPro=AQIC5wM2LY4SfcwuT2ASCrsfO78nXdceEHXeH1+xTqH7C3I=@AAJTSQACMDI=#
    7) The "sunmail" web-server checks the AM session validity with the same "psam.domain.ru". It sends a series of POSTs to /amserver/namingservice:
    <?xml version="1.0" encoding="UTF-8" standalone="yes"?>
    <RequestSet vers="1.0" svcid="com.iplanet.am.naming" reqid="685">
    <Request><![CDATA[
    <NamingRequest vers="1.0" reqid="324" sessid="AQIC5wM2LY4SfcwuT2ASCrsfO78nXdceEHXeH1+xTqH7C3I=@AAJTSQACMDI=#">
    <GetNamingProfile>
    </GetNamingProfile>
    </NamingRequest>]]>
    </Request>
    </RequestSet>(receives a large XML list of different Access Manager configuration parameters and URLs)
    ...then a double-request to /amserver/sessionservice:
    <?xml version="1.0" encoding="UTF-8" standalone="yes"?>
    <RequestSet vers="1.0" svcid="Session" reqid="686">
    <Request><![CDATA[
    <SessionRequest vers="1.0" reqid="678">
    <GetSession reset="true">
    <SessionID>AQIC5wM2LY4SfcwuT2ASCrsfO78nXdceEHXeH1+xTqH7C3I=@AAJTSQACMDI=#</SessionID>
    </GetSession>
    </SessionRequest>]]>
    </Request>
    <Request><![CDATA[
    <SessionRequest vers="1.0" reqid="679">
    <AddSessionListener>
    <URL>http://sunmail.domain.ru:80/UpdateAgentCacheServlet?shortcircuit=false</URL>
    <SessionID>AQIC5wM2LY4SfcwuT2ASCrsfO78nXdceEHXeH1+xTqH7C3I=@AAJTSQACMDI=#</SessionID>
    </AddSessionListener>
    </SessionRequest>]]>
    </Request>
    </RequestSet>As a result it receives an XML with a lot of user-specific information (the username, LDAP DN, preferred locale, auth module used, etc.)
    !!!*** Now, the problem part ***!!!
    8) And then "sunmail" POSTs a broken cookie to "psam" (note the space in mid-text, where the "plus" sign was previously). As we know, "+" is often used in URLs to "escape" the space character. Perhaps some URL cleanup routine backfired here.
    I have double-checked, it is not the reverse proxy on "psam" breaking things. It is "sunmail" (UWC/CE or Policy Agent, don't know for certain) supplying the broken request. I looked over the large XML responses to the two previous requests, whenever they mention the session cookie value, the "plus" is there.
    For the most detail I can provide, I'll even paste the whole HTTP packet:
    POST /amserver/sessionservice HTTP/1.1
    Proxy-agent: Sun-Java-System-Web-Server/7.0
    Cookie: iPlanetDirectoryPro=AQIC5wM2LY4SfcwuT2ASCrsfO78nXdceEHXeH1 xTqH7C3I=@AAJTSQACMDI=#;amlbcookie=null
    Content-type: text/xml;charset=UTF-8
    Content-length: 336
    Cache-control: no-cache
    Pragma: no-cache
    User-agent: Java/1.5.0_09
    Accept: text/html, image/gif, image/jpeg, *; q=.2, */*; q=.2
    Host: cos-psam-01.domain.ru
    Client-ip: 194.xxx.xxx.xxx
    Via: 1.1 https-weblb.domain.ru
    Connection: keep-alive
    <?xml version="1.0" encoding="UTF-8" standalone="yes"?>
    <RequestSet vers="1.0" svcid="session" reqid="258">
    <Request><![CDATA[<SessionRequest vers="1.0" reqid="254">
    <GetSession reset="true">
    <SessionID>AQIC5wM2LY4SfcwuT2ASCrsfO78nXdceEHXeH1 xTqH7C3I=@AAJTSQACMDI=#</SessionID>
    </GetSession>
    </SessionRequest>]]></Request>
    </RequestSet> The server's error response is apparent:
    HTTP/1.1 200 OK
    Server: Sun-Java-System-Web-Server/7.0
    Date: Thu, 31 Jul 2008 05:49:50 GMT
    Content-type: text/html
    Transfer-encoding: chunked
    19b
    <?xml version="1.0" encoding="UTF-8" standalone="yes"?>
    <ResponseSet vers="1.0" svcid="session" reqid="258">
    <Response><![CDATA[<SessionResponse vers="1.0" reqid="254">
    <GetSession>
    <Exception>AQIC5wM2LY4SfcwuT2ASCrsfO78nXdceEHXeH1 xTqH7C3I=@AAJTSQACMDI=# Invalid session ID
    AQIC5wM2LY4SfcwuT2ASCrsfO78nXdceEHXeH1 xTqH7C3I=@AAJTSQACMDI=#</Exception>
    </GetSession>
    </SessionResponse>]]></Response>
    </ResponseSet>On the few occasions when the AM cookie contains no "plus" characters, the SSO works like a charm (also checked by a sniffer). Whenever there is a "plus", it breaks.
    For reference, here's a working final request-response (one with a good cookie, as received by the load-balancer web-server). Request looks a bit different:
    POST /amserver/sessionservice HTTP/1.1
    Cookie: iPlanetDirectoryPro=AQIC5wM2LY4Sfcy/5sEzVmuq9z1ggdHOkBDgVFAwfhqvn4U=@AAJTSQACMDI=#;amlbcookie=null
    Content-Type: text/xml;charset=UTF-8
    Content-Length: 379
    Cache-Control: no-cache
    Pragma: no-cache
    User-Agent: Java/1.5.0_09
    Host: psam.domain.ru
    Accept: text/html, image/gif, image/jpeg, *; q=.2, */*; q=.2
    Connection: keep-alive
    <?xml version="1.0" encoding="UTF-8" standalone="yes"?>
    <RequestSet vers="1.0" svcid="session" reqid="281">
    <Request><![CDATA[<SessionRequest vers="1.0" reqid="277">
    <SetProperty>
    <SessionID>AQIC5wM2LY4Sfcy/5sEzVmuq9z1ggdHOkBDgVFAwfhqvn4U=@AAJTSQACMDI=#</SessionID>
    <Property name="uwcstatus" value="active"></Property>
    </SetProperty>
    </SessionRequest>]]></Request>
    </RequestSet> ...and the response is OK:
    <?xml version="1.0" encoding="UTF-8" standalone="yes"?>
    <ResponseSet vers="1.0" svcid="session" reqid="281">
    <Response><![CDATA[<SessionResponse vers="1.0" reqid="277">
    <SetProperty>
    <OK></OK>
    </SetProperty>
    </SessionResponse>]]></Response>
    </ResponseSet>

    There have been a few reports of the same behaviour with other customers - specifically with the handling of the encoding of "+" characters to " ". It relates to how cookie encoding/decoding is performed (as you have already observed).
    The solution for these customers was the following:
    => AM server/client side:
    Ensure that com.iplanet.am.cookie.encode=false in AMConfig.properties and AMAgent.properties on all systems.
    => AM client (UWC) side:
    - Set <property name="encodeCookies" value="false"/> in /var/opt/SUNWuwc/WEB-INF/sun-web.xml. This will prevent UWC from trying to urldecode the cookie it receives and therefore stops it turning the + into a space e.g.
    <?xml version="1.0" encoding="UTF-8"?>
    <!DOCTYPE sun-web-app PUBLIC '-//Sun Microsystems, Inc.//DTD Sun ONE Application Server 7.0 Servlet 2.3//EN' 'file:///net/wajra.india.sun.com/export/share/dtd/sun-web-app_2_3-1.dtd'>
    <sun-web-app>
       <property name="encodeCookies" value="false"/>
       <session-config>
          <session-manager/>
       </session-config>
       <jsp-config/>
    <property name="allowLinking" value="true" />
    </sun-web-app>Regards,
    Shane.

  • How to create and access a Virtual Host on the J2EE WAS?

    Hello, I have searched through the Forums and help.sap.com and found a lot of information on how to set up a Virtual Host on the J2EE server but am having issues with it working.
    The goal is to provide a simple virtual host on the J2EE Portal server to host some static image and HTML files. Previously I had stored these files in the standard publicly accessible SAP J2EE folder location /usr/sap/<SID>/JCxx/j2ee/cluster/serverx/apps/sap.com/com.sap.engine.docs.examples/servlet_jsp/_default/root/. This location is resolved to when using the URL <host>:50000 for example.
    The main issue here is that during Portal support pack applications this folder gets wiped out and we have to remember to save off any custom files and folders in this location and replace them.
    I would like to create a virtual host to store these static files (i.e., branding-image.jpg, etc...).
    I have run through the process of creating the virtual host both using Visual Administrator and <host>:50000/nwa but am not able to get the virtual host name to resolve properly.
    The following are the steps that I have taken. Let's assume the standard SAP portal (i.e., xSS, etc...) is running properly on <host>:50000.
    1. create virtual host via Visual Administrator/NWA called 'sapwebserver1' by using the Create Host option (takes on the attributes of the 'default' standard virtual host)
    2. change the root directory for this virtual server to a custom folder at E:/tmp/mimes (where E:/usr is where the J2EE files are all installed), no start files were set up and nothing else was changed in the new virtual host record, no permissions were changed on the /tmp/mimes folder from whatever the default Windows user permissions are normally set, I am using a local Windows  administrator account but I have not seen any reference in the help files or the examples that indicate that any specific permissions updates need to be made on the virtual host root folder
    3. restarted the J2EE server as well as the HTTP Provider service
    4. before updating the company DNS, I wanted to test this locally on the server and so have updated the server's local HOSTS file with a <host IP address>   sapwebserver1 entry
    5. from that server I can ping the sapwebserver1 virtual host name and it resolves properly to the machine's physical IP address
    According to all of the documentation and examples I have seen I should now be able to (from that server) launch a browser and access the static files in the virtual host by referring to http://sapwebserver1:50000/branding-image.jpg for example. This is not working and the browser just brings up a Cannot display the web page error in IE. By referring to the virtual host name sapwebserver1:50000 it's supposed to hit the J2EE server and based on the host name sapwebserver1 realize that it should resolve to the root directory E:/tmp/mimes. This is not happening. Just as a test I have created a copy of the 'default' virtual host and called it sapwebserver2, updated the local HOSTS file for this entry, and tried to see if that would work like the 'default' host. My expectation was that http://sapwebserver2:50000 would behave the same was as http://<host>:50000 but it too fails to resolve just like the sapwebserver1 virtual host refernce.
    Would anyone happen to have any pointers on what to do next? I just want a simple virtual host to be able to serve up some static images and files.
    Thanks for any insight or assistance you might be able to provide here.
    Graham

    This defeats the purpose of trying to centralize SAP-related web resources on the SAP server. Typically IIS/Apache or other non-SAP servers are under the control of IT and not the SAP BASIS group.
    We simply would like to have a centralized location to store static web files so that they are not overwritten during Portal support pack applications.

Maybe you are looking for

  • Rollback AI 17.1 update and go back to AI 17.0.0

    How can I rollback AI 17.1 update to go back to 17.0.0.  I have issues with SVG 1.1 Tiny header in the new version.

  • How to delete paragraph marks (returns) without affecting spacing, like at the top of the next page

    if you have a large document and you add two returns at the end of every major section or group but one of the two returns goes to next page, how do you keep that return so it doesn't mess up spacing if something is added earlier in document but get

  • Checking  Purchase order Number

    HI  Experts, Can you please suggest me which RFC should i used to check PO exist in R/3 before sending to thirdparty to  Delvery03 Idoc.      The XI mapping calls an RFC in ERP to validate the ASN against the PO Thanks Raj

  • Funds precommitment in a PO

    Hi all, we would like to know if it is possible to post to a funds precommitment (or commitment) instead to a funds reservation when doing a purchase order (MM). Thanks all in advance.

  • HT4623 Greyed out sync to phone button

    Hi I have an iphone 4, which used to be synced with my Mothers itunes, but with my own username and password etc, I have now got itunes of my own and made a purchase tonight on itunes, however this tune will not go on to my phone for some reason...I