How do you pass parameter to a methodaction and get methoditerator back?

I'm using Jdeveloper 10.1.3.5 with BC
I'm authenticating using Active Directory - this part is working fine.
However I need to be able to search the Active Directory and allow an administrator to select users to add to a custom database table. The database table has the login and name. When someone logins in, I make sure they are in the user table. But the administrator needs to be able to add other users for use in drop downs (Buyers, Product Managers, etc). The users have these roles assigned to them (assigned roles are stored in another table).
The problem is getting the data from Active Directory and displaying it in a table that the user can select from. I tried creating a method in my application module that takes two parameters - a login pattern and name pattern that are used for searching. I'm returning an ArrayList - I think I need to modify my return type. I do have the code to access Active Directory working. I added the method to the client interface. When I tried to create a page by draging the method onto the page as a parameter form and the results as a read only table, everything looks fine, but I have the following problems
1. it runs the method with no parameters when the form is first accessed - currently I return an empty ArrayList since I don't want to return the entire Active Directory - I get the following error three times - JBO-25003: Object java.util of type ApplicationModule not found
2. If I proceed to enter a parameter and press the button, the method is still called with no parameter (can tell by debugging) and I get the error again three times
So how am I supposed to do this? I know how to do it with views that access database, but here I need code to access Active Directory. I tried to do programmic view object, with no better success.
Here is the pagedef of my page
<executables>
<variableIterator id="variables">
<variable Type="java.lang.String" Name="getADUsers_loginPattern"
IsQueriable="false"/>
<variable Type="java.lang.String" Name="getADUsers_namePattern"
IsQueriable="false"/>
</variableIterator>
<methodIterator id="getADUsersIter" Binds="getADUsers.result"
DataControl="NpiAppModuleDataControl" RangeSize="10"
BeanClass="java.util.ArrayList" />
</executables>
<bindings>
<methodAction id="getADUsers" MethodName="getADUsers"
RequiresUpdateModel="true" Action="999"
IsViewObjectMethod="false"
DataControl="NpiAppModuleDataControl"
InstanceName="NpiAppModuleDataControl.dataProvider"
ReturnName="NpiAppModuleDataControl.methodResults.NpiAppModuleDataControl_dataProvider_getADUsers_result">
<NamedData NDName="loginPattern" NDType="java.lang.String"
NDValue="${bindings.getADUsers_loginPattern}"/>
<NamedData NDName="namePattern" NDType="java.lang.String"
NDValue="${bindings.getADUsers_namePattern}"/>
</methodAction>
<attributeValues id="loginPattern" IterBinding="variables">
<AttrNames>
<Item Value="getADUsers_loginPattern"/>
</AttrNames>
</attributeValues>
<attributeValues id="namePattern" IterBinding="variables">
<AttrNames>
<Item Value="getADUsers_namePattern"/>
</AttrNames>
</attributeValues>
<table id="getADUsers1" IterBinding="getADUsersIter">
<AttrNames>
<Item Value="element"/>
</AttrNames>
</table>
</bindings>
and here is my method
public ArrayList getADUsers(String loginPattern, String namePattern) {
//load properties from file
Properties props = new Properties();
try {
Common.loadProperties(props, PROPS_FILE);
} catch (IOException e) {
throw new RuntimeException(e);
ArrayList users = new ArrayList();
Hashtable env = new Hashtable();
env.put(Context.INITIAL_CONTEXT_FACTORY,"com.sun.jndi.ldap.LdapCtxFactory");
env.put(Context.PROVIDER_URL, props.getProperty(PROVIDER_URL));
env.put(Context.SECURITY_AUTHENTICATION, "simple");
env.put(Context.SECURITY_PRINCIPAL, props.getProperty(SECURITY_PRINCIPAL));
env.put(Context.SECURITY_CREDENTIALS, props.getProperty(SECURITY_CREDENTIALS));
DirContext dctx = null;
NamingEnumeration results = null;
String filter = null;
String login = null;
String name = null;
if (loginPattern != null && !loginPattern.equals(""))
filter = "(&(objectCategory=person)(objectClass=user)(sAMAccountName="+loginPattern.replace('%', '*')+")";
if (namePattern != null && !namePattern.equals(""))
if (filter == null) {
filter = "(&(objectCategory=person)(objectClass=user)(cn="+namePattern.replace('%', '*')+"))";
} else {
filter = filter+"(cn="+namePattern.replace('%', '*')+"))";
} else {
if (filter != null) {
filter = filter +")";
try {
if (filter != null) {
dctx = new InitialDirContext(env);
SearchControls controls = new SearchControls();
controls.setSearchScope(SearchControls.SUBTREE_SCOPE);
results = dctx.search(props.getProperty(SEARCHBASE), filter, controls);
while (results.hasMore()) {
SearchResult searchResult = (SearchResult) results.next();
Attributes attributes = searchResult.getAttributes();
Attribute attr = attributes.get("cn");
name = (String) attr.get();
attr = attributes.get("sAMAccountName");
login = (String) attr.get();
users.add(new String[] {login, name});
} catch (NamingException e) {
throw new RuntimeException(e);
} finally {
if (results != null) {
try {
results.close();
} catch (Exception e) {
if (dctx != null) {
try {
dctx.close();
} catch (Exception e) {
return users;
Thanks for your help.
Edited by: user2159804 on Aug 2, 2011 10:53 AM

If I remove the read only table and thus the methoditerator, the errors go away and I can see that my method is getting called with the parameters when the button is pushed.
It looks like my problem is trying to display the results of the method. I tried to create a class to for the user with properties of login and name. And in changed the method to return List<ADUser>. Still same errors. And I changed the method to return null if both parameters were null. With this I can see that the method is getting called by the methoditerator when the page is first displayed and when the button is pushed with null parameters followed by the call from the ExecuteWithParams with the parameter.
Thanks for the link, but since my problem isn't really the parameters but the displaying of the list of data, it didn't really help.

Similar Messages

  • How do you uninstall Quicktime 7.1.3 and get back to 7.1.2

    As many of you seem to be experiencing, Quicktime 7.1.3 is causing iPhoto 6 to crash when pictures edited in Photoshop are opened in iPhoto.
    I want to get back to Quicktime 7.1.2 so that I can use iPhoto properly.

    Hi there,
    The only way to go back in time is to use your install disk and run an archive and install... but then you will need to upgrade again incrementally
    I would try posting your question either in the G5 forum or the quicktime forum here: http://discussions.apple.com/category.jspa?categoryID=122
    Rick
    iMac G5 iSight 20" - 30G iPOD in Slimming Black -   Mac OS X (10.4.7)   - HP Pav 15" WS and Toshiba Sat 17" WS LP's - Canon 20D & A620

  • How do you download windows on to mac and get it setup?

    HELP ME!!!!!!!

    Windows on Intel Macs
    There are presently several alternatives for running Windows on Intel Macs.
         1. Install the Apple Boot Camp software.  Purchase Windows
             XP w/Service Pak2, Vista, or Windows 7.  For Boot Camp
             4.0 and above you can only use Windows 7 or later. Follow
             instructions in the Boot Camp documentation on
             installation of Boot Camp, creating Driver CD, and
             installing Windows.  Boot Camp enables you to boot the
             computer into OS X or Windows.
         2. Parallels Desktop for Mac and Windows XP, Vista Business,
             Vista Ultimate, or Windows 7.  Parallels is software
             virtualization that enables running Windows concurrently
             with OS X.
         3. VM Fusion and Windows XP, Vista Business, Vista Ultimate,
             or Windows 7.  VM Fusion is software virtualization that
             enables running Windows concurrently with OS X.
         4. CrossOver which enables running many Windows
             applications without having to install Windows.  The
             Windows applications can run concurrently with OS X.
         5. VirtualBox is an Open Source freeware virtual machine such
             as VM Fusion and Parallels that was developed by Solaris.
             It is not as fully developed for the Mac as Parallels and VM
             Fusion.
    Note that VirtualBox, Parallels, and VM Fusion can also run other operating systems such as Linux, Unix, OS/2, Solaris, etc.  There are performance differences between dual-boot systems and virtualization.  The latter tend to be a little slower (not much) and do not provide the video performance of the dual-boot system. See MacTech Labs- Virtualization Benchmarks, January 2013 | MacTech for comparisons of Boot Camp, Parallels, and VM Fusion. Benchmarks of all of the above except Crossover can be found in Benchmarking Parallels, Fusion, and VirtualBox Against Boot Camp - The Mac Observer. Boot Camp is only available with Leopard or later. Except for Crossover and a couple of similar alternatives like DarWine you must have a valid installer disc for Windows.
    You must also have an internal optical drive for installing Windows. Windows cannot be installed from an external optical drive.

  • HT4858 How do you access a previous iCloud backup to get photos back?

    I have an iPhone 4 that has a previous iCloud backup with 3+ GB. I am trying to somehow retrieve all my old photos which were cleared after beta iOS 7 was locked.

    Welcome to the Apple Support Communities
    See > http://pondini.org/TM/E3.html

  • How do I pass parameter to different portlet regions from another page?

    How do I pass parameter to different portlet regions from
    another page?
    I have a page that with two regions. Each region has a report
    that uses the same information to generate its report.
    Individually running the reports, I can use p_arg_names and
    p_arg_values to get what I want. However, when I run the page
    that has both portlets, my .show is gone and I cannot get it to
    use the p_arg_names, etc. Do you have any idea how to overcome
    this? Thanks for any help.

    How do I pass parameter to different portlet regions from
    another page?
    I have a page that with two regions. Each region has a report
    that uses the same information to generate its report.
    Individually running the reports, I can use p_arg_names and
    p_arg_values to get what I want. However, when I run the page
    that has both portlets, my .show is gone and I cannot get it to
    use the p_arg_names, etc. Do you have any idea how to overcome
    this? Thanks for any help.

  • How can I pass parameter from report to form?

    Hi :)
    Now I try to build conference room like this by using form
    and report. And i design that when users click at group report
    then i'll show page that contain questions report and add
    question form. And question form and report must receive the
    same parameter from group report.
    First Problem: is I don't know how group report send the
    same parameter to question report and add question report at the
    same time. And is it possible??? If not please suggest me what
    should I do???
    Second Problem: is I don't know how can I pass parameter from
    report to form. I don't know the way to do it.
    Please tell me!!! Please...
    I look forward to hearing from all of you.
    Thank You.

    One way is to create a link based on that form and attach that
    link with the report. Through links you can pass parameters

  • How do you pass XML as a URL param?

    How do you pass XML as a URL param?
    Thanks!

    I don't know why I wasn't thinking about this when I made my
    last post. If they're pasting some XML into a form, that's one
    thing. But if they need to send XML to your site from their own,
    you can setup a Coldfusion Component (CFC) as a Web Service to
    accept XML through a WSDL call.
    Check out the
    Coldfusion
    Developers Center for
    articles
    on creating web services

  • How do you pass shell scripts with cocoa?

    How do you pass shell scripts with cocoa?

    You asked for more detail -- I don't know if this is what you were referring to or not, but here's a little more detail on how to use the system() function if that's what you wanted to know.
    As etresoft mentioned, the system() function can be useful for the kind of thing you are talking about. You will need to write the following statement at the top of your code if you want to use it:
    #include <stdlib.h>
    To use the system() function, simply put the command as you would write it in the Terminal between double quotes between the parenthesis. For example, something as simple as:
    system("ls");
    I don't what the practical use of the above statement would be, but it will run, and that's the general format for the system() function. So just put between the quotes whatever command you want to send.
    Hope there was something helpful here.

  • (264361962) Q ADVC-27 How do you pass the security info to access the EJB?

    Q<ADVC-27> How do you pass the security info to access the EJB?
    A<ADVC-27> Authentication for web service users must occur at the web layer. This
    means providing appropriate web resource definitions and restrictions in the web.xml
    file for your project. The most common and useful form of security for application
    interaction is via client-side certificates. Then the client identity is transmitted
    to the EJB is the same way as in regular J2EE environments. There is a complete description
    on security on e-docs:
    http://edocs.bea.com/workshop/docs70/help/guide/security/ovwSecurity.html
    Adam

    You need to ask Apple to reset your security questions. To do this, click here and pick a method; if that page doesn't list one for your country or you're unable to call, fill out and submit this form.
    (119093)

  • How can I pass a file refnum into and out of external c++ code? What type does it convert to in c++?

    I am trying to write external c++ code that will read a file already opened by Labview and therefore assigned a refnum. (Unfortunately, I definately can't use the standard Labview vis.) However I am not sure what c++ type to use in order to manage the refnum.
    All help and thoughts appreciated. Thanks,
    Joanna

    You could do ALL your file handling in C or C++ (MFC CFile for
    example) and pass Microsoft file handles into and out of LabVIEW
    instead of LabVIEW file references into and out of C. This may be an
    easier way to attack the problem.
    You could create a DLL in MSVC that exports a FileOpen function, a
    FileClose function and a FileRead and/or FileWrite Function and then
    call that DLL from place to place as required in your code.
    It would help us if you would explain what kind of data you are trying
    to read or write and what the application is. Is it binary data?
    text files? Do you need some special Win32 file system feature like
    file mapped memory? I guess what I am asking is what is your
    motivation for doing file handling in C or C++?
    Douglas De Clue
    LabVIEW developer
    [email protected]
    "Rolf" wrote in message news:...
    > A LabVIEW file refnum is an internal Magic Cookie to LabVIEW and there is no
    > way to directly extract the actual information assigned to that Magic
    > Cookie.
    > However the CIN Reference Manual describes one function which allows to
    > retrieve a lower level "File" handle and at least on Windows 32 bit and
    > LabVIEW
    > from version 5 up to and including 6.1 this "File" LabVIEW datatype directly
    > maps
    > to the Win32 API "FILE" Handle.
    >
    > The function to use is
    >
    > MgErr FRefNumToFD(LVRefNum refNum, File *fdp);
    >
    > It is declared in extcode.h or one of its dependant headers and exported
    > from "labview.lib"
    > all located in the cintools directory and you can link this lib also to a
    > normal DLL project.
    > However calling this DLL then from any other process than LabVIEW or a
    > LabVIEW
    > executable will not initialize the DLL anymore correctly.
    >
    > Your best option if you need to write in C(++) should be to use the LabVIEW
    > file manager
    > functions described on the External Code Manual (manual/lvexcode.pdf) on
    > this File handle.
    > If you need to use directly some Win32 API functions with it please note
    > that although currently
    > the "File" in the LabVIEW file manager functions matches the FILE in Windows
    > 32 bit API
    > functions this is an undocumented and hence unsupported feature. The next
    > LabVIEW version
    > may actually use a different datatype for its "File" parameter to the
    > LabVIEW file manager calls
    > and your use of assuming File == FILE may simply crash.
    >
    > Also operating on a file refnum in LabVIEW which has been accessed directly
    > with Win API
    > functions may result in strange behaviour such as the file read/write mark
    > not being updated as
    > you would maybe expect it.
    >
    > "Jo" wrote in message
    > news:50650000000800000016520000-1023576873000@exch​ange.ni.com...
    > > How can I pass a file refnum into and out of external c++ code? What
    > > type does it convert to in c++?
    > >
    > > I am trying to write external c++ code that will read a file already
    > > opened by Labview and therefore assigned a refnum. (Unfortunately, I
    > > definately can't use the standard Labview vis.) However I am not sure
    > > what c++ type to use in order to manage the refnum.
    > > All help and thoughts appreciated. Thanks,
    > > Joanna

  • How do I pass an error status from my java code back to the Program Job Ser

    How do I pass an error status from my java code back to the Program Job Server?
    I have a jar program object that reports a scheduled status of "Success" even if the java code errors out.

    Exceptions thrown from the program object are ignored by the program job server.
    You need to configure the Program Object, then stream out a special string sequence to the stdout of the Program Object, to set the scheduled instance status to Failed.
    Look up SAP KBase  1201804 - How to programmatically set the status of a Program object to "Failed"
    Sincerely,
    Ted Ueda

  • How do you have 2 Safari windows open and show both pages simultaneously on the monitor

    How do you keep open 2 Safari windows and show both pages on monitor?

    While in Safari with your first window open go to the File menu and select New Window. That will open the second window on which you can navigate to your second web page. Resize both windows to fit on your display.

  • How do you take pictures from one library and put in another library??

    How do you take pictures from one library and put in another library??

    Options:
    1. Export from iPhoto A to the Finder, then import to iPhoto B
    This gets the photo over, but no versions, no edit history and not all the metadata
    2. Use iPhoto Library Manager
    This gets everything: versions, edit history and all the metadata.
    Regards
    TD

  • How can you determine a file creation date and know if it's been altered since the creation date

    I need to know how to determine a file creation date on an ipad.  If someone creates a document/note on an ipad how can you tell when it was created and if it has been altered since?

    Unless you are using a third party app that provides that functionality, in iOS the only thing youcan access is the last edit/save date and time, which is fairly evident in the user interface for documents and notes. Some apps that handle MS Office files may provide that, but ican't say first hand.

  • How do you save your photos in iPhoto and be able to find the photos when you are in different programs. When i try to find them I can only find the iPhotos not the individual photos.

    How do you save your photos in iPhoto and be able to find the photos when you are in different programs. When i try to find them I can only find the iPhotos not the individual photos.

    Use the media browser. In every open/attach window in tithe lower left hand corner under media ==> photos ==> iPhoto
    LN

Maybe you are looking for

  • Warning in a Report running on Oracle Applications 11.5.9 RDBMS 9.2.0.70

    on running a report a warning appears in GL and this warning also come on some of other reports in view log of this warning error is APP-FND-00500: AFPPRN recieved a return code of failure from routine FDUPRN.An error occured while AOL tried to spawn

  • HT204370 Download stuck

    My download gets to a certain point and will not continue. Any advise? I have tried numerous times and keep getting stuck. I have a steady Internet connection, can view and do other things that require Internet but the movie I am attempting to downlo

  • Quicktime 7.5 install broken

    I have tried to install 7.5 via software update and also as the standalone version. On each occasion it reaches ~70% and then says the source media is damaged and cannot continue. I have fixed all permissions, used disk utility, run all Chron scripts

  • Reading XML from JavaScript

    Dear All, I am in need of reading an XML file data and to do some manupulation in Javascript. I am using "Microsoft.XMLDOM" parser and I have problem in accessing the child node. I am able to locate a node thru var x= xmlDoc.getElementsByTagName("nam

  • IPhone WiFi Connection problem solved (ios v 6.1.2)

    I recently spent time going through a verry irritating problem with my iphone...  I installed a new router at home and initially all was well... my LAN connection worked... my wireless connection was strong and it took no time to get my AppleTV, iPad