Foreign domain ou-structure to treeview object...expertise needed

Here is my simple script which works fine on my own domain (first one: TreeViewOwnDomain.ps1). Now I want to read foreign domain and use treeview as same way.
Here is also another script which connect foreign domain and read user data (second one: ForeignDomainUserData.ps1).
Can anyone help me?
function Add-Node {
param ($selectedNode, $name)
$newNode = new-object System.Windows.Forms.TreeNode
$newNode.Name = $name
$newNode.Text = $name
$selectedNode.Nodes.Add($newNode) | Out-Null
return $newNode
function Get-NextLevel {
param ($selectedNode, $dn)
$OUs = Get-ADObject -Filter 'ObjectClass -eq "organizationalUnit" -or ObjectClass -eq "container"' -SearchScope OneLevel -SearchBase $dn
if ($OUs -eq $null) {
$node = Add-Node $selectedNode $dn
} else {
$node = Add-Node $selectedNode $dn
$OUs | % {
Get-NextLevel $node $_.distinguishedName
function Build-TreeViewNew {
param ($tNode, $tDomainDN, $tviewOU1)
# Tab 1
$tNode.text = "Active Directory Hierarchy"
$tNode.Name = "Active Directory Hierarchy"
$tNode.Tag = "root"
$tviewOU1.Nodes.Add($treeNode) | Out-Null
Get-NextLevel $treeNode $tDomainDN
Build-TreeViewNew $treeNode "DC=w12,DC=local" $treeviewOU1
$JobEncrypted = Get-Content "C:\Tools\PowershellScripts\Test\encrypted_password_PS.txt" | ConvertTo-SecureString
$JobCredential = New-Object System.Management.Automation.PsCredential($JobUsername, $JobEncrypted)
$SessionX = New-PSSEssion -ComputerName "192.168.xxx.xxx" -Credential $JobCredential -ErrorAction 'SilentlyContinue'
Enter-PSSession -Session $SessionX
$t = Invoke-Command -Session $SessionX -ScriptBlock {
$tmp = $null
$t1 = (Get-ADUser Administrator).distinguishedName; $tmp += $t1; $tmp += "`n"
$t2 = (Get-ADUser Administrator -Properties *).description; $tmp += $t2; $tmp += "`n"
$tmp
Exit-PSSession
$richtextboxOU1.Text = $t

Hi Jyrkis700,
If you want to add the other domain's information to TreeView, you can try the cmdlet "Get-ADUser -Server otherdoman.com -Credential otherdomain\Administrator" instead of "Invoke-Command" and "Enter-Pssession":
Get-ADUser ann –Server test.server.com -Credentail TEST\Administrator
Reference from:
Adding/removing members from another forest or domain to groups in Active Directory
In addition, to work with TreeView, this script may be helpful for you:
PowerShell help browser using Windows Forms and TreeView Control
If I have any misunderstanding, please let me know.
If you have any feedback on our support, please click here.
Best Regards,
Anna
TechNet Community Support

Similar Messages

  • ORA-29857: domain indexes and/or secondary objects exist in the tablespace

    I tried to drop tablespace APPS_TS_TX_DATA using drop tablespace APPS_TS_TX_DATA including contents and datafiles cascade constraints.
    I got error ORA-29857: domain indexes and/or secondary objects exist in the tablespace.
    After I have dropped all domain indexes, then tried to drop tablespace again, I still got the same error. I have searched metalink regarding this error, there is no hit.
    What exactly objects in the tablespace are prevenng dropping the tablespaces?

    BANNER
    Oracle Database 10g Enterprise Edition Release 10.2.0.4.0 - 64bi
    PL/SQL Release 10.2.0.4.0 - Production
    CORE 10.2.0.4.0 Production
    TNS for Solaris: Version 10.2.0.4.0 - Production
    NLSRTL Version 10.2.0.4.0 - Production
    ILMU88>
    ILMU88> SELECT COUNT(*)
    2 FROM dba_segments
    WHERE tablespace_name = 'APPS_TS_TX_DATA';
    3
    COUNT(*)
    14190
    drop tablespace APPS_TS_TX_DATA including contents and datafiles cascade constraints;
    drop tablespace APPS_TS_TX_DATA including contents and datafiles cascade constraints
    ERROR at line 1:
    ORA-29857: domain indexes and/or secondary objects exist in the tablespace

  • Structure approach N Object-oriented approach

    Hi everyone
    I will be very thankful if someone could explain to me how could we change a written java program using the structure approach into object-oriented approach.
    I mean what main command do i have to use?
    thanks!

    Huh?

  • Create structure for dependent objects

    Hi All,
    Can any one tell me why there is no create structure for dependent objects?

    Hi Rehman,
    Thanks for your reply. I am looking forward for your document. My Email ID  [email protected]
    Reema,
    I have checked the check box. The Thumbnail column is coming but if I upload a picture or any document the thumbnail column still remains blank.
    Looking forward for your help.
    Warm regards
    Purnendu

  • With Java Persistence, are DAOs (data access objects) still needed?

    I have just looked at the Java Persistence tutorial and it says each table row of a database can be represented as a Java Persistence entity instance.
    The definition of an "entity" is very much like how you would define the class of an equivalent DAO.
    So I am wondering... should DAOs still be used ? or can persistence entities completely replace them?

    Hi,
    I am saying that if you use JPA then you will not be making a DAO class, for example if you have a Person.java object you will not need to make a PersonDAO.java object.
    For example, if using JPA you Person.java object would look like this example below...
    Of course, the classes that call person object may need to call some JPA manager APIs or some JTA transaction APIs. If you use EJB session beans to call the JP{A entity then you dont have to have any code, as ou can see here
    https://blueprints.dev.java.net/bpcatalog/ee5/persistence/ejbfacade.html
    if you do not use EJBs in a pure web app then you will likely manually write code to manage transactions and entity manager APIs such as
    https://blueprints.dev.java.net/bpcatalog/ee5/persistence/webfacade.html
    See Person.java entuty example below and see there is no DAO code.
    @Entity
    public class Person implements java.io.Serializable {
        private int personId;
        private String userName;
        private String firstName;
        private String lastName;
        private String summary;
        public Person() { }
    @Id
    public int getPersonId() {
    return personId;
    public String getUserName() {
    return userName;
    public String getFirstName() {
    return firstName;
    public String getLastName() {
    return lastName;
    public String getSummary(){
    return summary;
    public void setPersonId(int personId) {
    this.personId = personId;
    public void setUserName(String userName) {
    this.userName = userName;
    public void setFirstName(String firstName) {
    this.firstName = firstName;
    public void setLastName(String lastName) {
    this.lastName = lastName;
    public void setSummary(String summary) {
    this.summary = summary;
    }

  • My sender and the receiver message types structures are same.do I need to m

    Hi all,
    My sender and the receiver message types structures are same.do I need to mapping in this case.
    If it is not required .Let me know in detail,How to proceed.
    Thanks,
    Srinivasa

    Hi,
    If is just to pass the message (as the sender source is the same as the receiver source),
    first you should have the Message Interface of you message
    then you should configure the Receiver determination, as the sender interface use your message interface and in the interface determination you can use the same message interface (same name). You dont have to add any mapping, just let empty and save. Just use one message interface for sender a receive.
    Any questins let me know.
    Regards,
    Lpbuff

  • Problem: Portal Content Structure (Javascript error: object required)

    Hello,
    i have a problem with my Internet Explorer 7 and the Enterprise Portal 6.0 SP 16. After the login, the Navigation Structure of the Portal Content isn't shown, after a while a error message pops up saying: error: object required.
    The Portal is functional in Firefox 3.0 so i suggest that the problem is based on the internet explorer Browser.
    Maybe someone has an idea and can help me resolving this annoying problem. Java from Sun is installed an activated in IE.
    Thank you!
    here a screenshot
    http://s6b.directupload.net/images/081016/oy2nau9e.jpg
    Edited by: Mehmet Apaydin on Oct 16, 2008 10:49 AM

    solved!
    something really timewasting. I just had to add the site as a trusted site in IE. But it only works if you youse the NAME e.g. www.sapportal60:50000/irj/portal, using the ip adress dosn't work and that's what i did in the first place.
    with best regards
    Mehmet Apaydin

  • Difference between domain controllers and group policy objects in GPMC

    Hello,
    Am in confusion, someone can tel me the difference between
    1.Domain controllers>default domain controller policy  and
    2.Group policy object>default domain controller policy
    In Group policy management console and also i would like know where to define these categories. I normally use second option.
    I have attached screenshot for your information.
     regards,
    Dharanesh,

    This first/upper item is a link to the GPO, the second/lower item is the actual GPO.
    (notice the link, has a shortcut arrow showing)
    by default, when you double-click on a link, a message will display which says "you have clicked on a link....." and the messagbox offers a checkbox for "do not display this message again..."
    Effectively they are equivalent to a shortcut-to-a-file vs. the actual file.
    Don
    (Please take a moment to "Vote as Helpful" and/or "Mark as Answer", where applicable.
    This helps the community, keeps the forums tidy, and recognises useful contributions. Thanks!)

  • Dragging case structure to include objects

    Hi,
    This might be a very noob question.
    I have made a case structure with a lot of code inside it. And I also have a lot of objects/code outside it, so that the outputs from the code inside the case structure go to the ones outside it.
    Now I want to include the objects that were outside, inside the case structure. There is a LOT of code outside too, it is a pain to increase the structure size, and then cut/paste the objects inside. Not to mention the multitude of rewiring.
    Is there a way to include the objects outside when i extend the case structure over them? Right now it just pushes them and does not inlcude them inside it. I have tried all combinations: Ctrl drag, Ctrl+shift drag etc..
    Thank You

    The problem with that is that there are multiple cases.
    If I remove the case structure, it will retain the case that is currently displayed but delete all the other cases behind it.

  • Structural Authorisation - Unrelated Objects

    Hi all,
    We are facing an issue in structural authorisation of OM objects. The user wants to have authorisation of all objects under his root Org unit alongwith any objects that are unrelated (having no relationship with any Org unit / Positions).
    Is this possible with standard configuration? How can this be achieved?
    Regards,
    VK

    Hi VK
    Yes it is possible.
    You have to create your own function module and assign it to a structural authorization profile (field T77PR-PFUNC)
    In this function module, as semvladigo says you have to collect all required unrelated objects and return them via OBJ_TAB interface table.
    as a reference please check the following function modules:
    RH_GET_MANAGER_ASSIGNMENT
    RH_GET_ORG_ASSIGNMENT
    Regards,
    Sergey

  • Advanced: Publishing to multiple domains (Folder structure, Podcast URL's)

    Hi everybody!
    I am sooo excited, yet so frustrated here: I realize iWeb is being launched as a consumer app, and so have enjoyed the additional functionality Apple has brought with redirects, and personal domain availability, but have fallen in love with the program and want to use it (along with the other iApp methodology) to make my other sites. I can't (or don't want to) wait until further developement can occur, or the market dynamic with other authoring apps allow for a more clear roadmap. Basically I want to make different sites, and switch between them (using Transit for FTP functionality), and then also be able to 'revert to default', so that one-click .mac publishing can ensue. I realize off the bat that this is a big order, and various aspects have been covered by everyone here, but want to lay out what my specific problems are and how I've been doing things.
    First, I was going to just 'Go with the flow', using the program as-is, making "New Sites" from the file menu, then going in by "Showing Package Contents" in the ~/Library/Application Support/iWeb/Domain file, then parsing the sites out to each separate subdirectory on my hosts' server. Then I came upon the dialog box prompt to specify the URL upon saving (which it states is required for the blogs' RSS feed). This is what prompted me to start-over again, creating a new Domain NewName.sites2 file for each 'Site', and things at least played swimmingly it seemed, as each retained their-own site-specific URL, and, upon closing all and reopening the original Domain file could go back to publishing from iPhoto etc.. for the web.mac.com/username workflow. Great, but this is cumbersome, and more importantly I am worried that this could cause problems down the road with filenames, and paths, and I am not even attempting any more blogs etc..
    Are there any suggestions, including "Hey don't even keep going on this way?" I am understanding that the advanced features only work on .Mac, but what about podcasting- what would be involved to at least include a live podcast linked to iTunes on my own host- and would the extra work required be not straightforward, especially if the nature would involve change and updates to the code with the addresses/links? I know how to make the Podcasts and know basic HTML, but am new the syndication thing, but at the same time, realize that I'd have to do it regardless of what authoring app I would use.
    Suppose I make a site, publish it to my server, then update the site. Would peoples' bookmarks be screwed up? Would a podcast still appear in iTunes if it were accepted? Could any advanced features be used? And if a 'workaround', or even hardcoding could be show to me, would this issue of needing to add on to the site and make changes cause existing work and its links to be disrupted each time?
    Thank you so much in advance.

    Suppose I make a site, publish it to my server, then update the site. Would peoples' bookmarks be screwed up?
    Peoples bookmarks will normally only be screwed up if you change the names of your sites and pages inside the iweb app. If you have sent them to http://www.myname.com/sitename/welcome.html, best not to change the sitename to something else or change welcome to home.

  • Populating base structure from persistent object

    Let's say I create a peristent class, ZCL_PWIDGET.
    ZCA_PWIDGET and ZCB_PWIDGET are created on my behalf.
    Let's say I map data in all the fields from table ZWIDGET .
    ZWIDGET has 1 Key field, KEY1, and five data fields, C1-C5.
    I think I can retrieve data from the tables and create a runtime instance of my class using
    DATA:  this_widget TYPE REF TO zcl_pwidget.
    this_widget=>agent->get_persistent( I_KEY1= '1234' ).
    Can someone tell me how to populate wa_widget ( I think I can use a map attributes call, but I don't quite understand how).
    Data : wa_widget type zwidget.
    Thanks...
    ...Mike

    Thanks, but I'm looking for a way to populate wa_widget in one fell swoop.
    Is there a way to populate all (or most) of the fields of wa_widget at one time, like...
    wa_widget = this_widget->get_ALL_fields_from_persistent_mapping
    How do folks do this in practice ?
    Thanks...
    ...Mike

  • Using all types of resultset Objects i need a single program

    i think all of u know that there are 8 types of resultset objects are there in jdbc technology i.e
    # next() - moves the cursor forward one row. Returns true if the cursor is now positioned on a row and false if the cursor is positioned after the last row.
    # previous() - moves the cursor backwards one row. Returns true if the cursor is now positioned on a row and false if the cursor is positioned before the first row.
    # first() - moves the cursor to the first row in the ResultSet object. Returns true if the cursor is now positioned on the first row and false if the ResultSet object
    does not contain any rows.
    # last() - moves the cursor to the last row in the ResultSet object. Returns true if the cursor is now positioned on the last row and false if the ResultSet object
    does not contain any rows.
    # beforeFirst() - positions the cursor at the start of the ResultSet object, before the first row. If the ResultSet object does not contain any rows, this method has
    no effect.
    # afterLast() - positions the cursor at the end of the ResultSet object, after the last row. If the ResultSet object does not contain any rows, this method has no effect.
    # relative(int rows) - moves the cursor relative to its current position.
    # absolute(int n) - positions the cursor on the n-th row of the ResultSet object.
    Using all these result set methods i need a sample program all these methods must be used in a single program itself

    BalajiEnntech123 wrote:
    i think all of u know that there are 8 types of resultset objects are there in jdbc technology i.e I don't know who "u" are but they're wrong if they think there are "8 types of resultset objects are there in jdbc technology".
    They'd be especially wrong to think that the methods you mention are "types of resultset objects".

  • New to ABAP Objects. Need help using events

    Hi all,
    I got a program from one of the text books which has the output as
             pursur helps pilot
             stewardess helps passenger on seat 11
             stewardess helps passenger on seat 17
    I am trying to modify this program to get an output:
    purser helps pilot
    stewardess helps passenger on seat 11 to have 2 foodservice.
    stewardess helps passenger on seat 11 to have 2 drinkservice.
    stewardess helps passenger on seat 17
    stewardess helps passenger on seat 17 to have 1 foodservice.
    stewardess helps passenger on seat 17 to have 1 drinkservice.
    stewardess helps passenger on seat 21
    stewardess helps passenger on seat 21 to have 3 foodservice.
    stewardess helps passenger on seat 21 to have 3 drinkservice.
    stewardess helps passenger on seat 25
    stewardess helps passenger on seat 25 to have 1 foodservice.
    stewardess helps passenger on seat 25 to have 1 drinkservice.
    stewardess helps passenger on seat 31
    stewardess helps passenger on seat 31 to have 2 foodservice.
    stewardess helps passenger on seat 31 to have 2 drinkservice.
    I have modified the program and am getting some errors. The program is:
    REPORT  Z_KMADHUR_PROGRAM5.
    class declarations.
    class pilot definition.
    public section.
    methods: call_flight_attendant.
    EVENTS: call_button_presses.
    endclass.
    class passenger definition.
    public section.
    methods: constructor importing value(i_seatnumber) type i,
             service_number importing value(i_servicenumber) type i,
             service_type importing value(i_servicetype) type i,
             call_for_help.
    EVENTS: call_button_pressed exporting value(e_seatnumber) type i,
            call_service_number exporting value(e_servicenumber) type i,
            call_service_type exporting value(e_servicetype) type i.
    PROTECTED SECTION.
    data seatnumber type i.
    data servicenumber type i.
    data servicetype type i.
    endclass.
    class flight_attendant DEFINITION.
    PUBLIC SECTION.
    METHODS: constructor
             importing i_id type string,
             help_the_pilot for EVENT
             call_button_presses OF pilot,
             help_a_passenger FOR EVENT
             call_button_pressed OF passenger
             IMPORTING e_seatnumber, e_wervicenumber, e_servicetype.
             PROTECTED SECTION.
    DATA id TYPE string.
    ENDCLASS.
    class Implementations
    class pilot implementation.
    method call_flight_attendant.
    RAISE EVENT call_button_presses.
    ENDMETHOD.
    ENDCLASS.
             class passenger implementation.
             method: constructor.
             seatnumber = i_seatnumber.
             servicenumber = servicenumber.
             servicetype = servicetype.
             endmethod.
             method: call_for_help.
                      RAISE EVENT: call_button_pressed
                      EXPORTING e_seatnumber = seatnumber,
                      RAISE EVENT call_service_number
                      exporting e_servicenumber = servicenumber,
                      RAISE EVENT call_service_type
                      exporting e_servicetype = servicetype.
                      endmethod.
                      endclass.
    class flight_attendant implementation.
    method constructor.
    id = i_id.
    endmethod.
    method help_the_pilot.
    write: / id, 'helps pilot'.
    endmethod.
    method: help_a_passenger.
    write: / id, 'helps passenger on seat',
    e_seatnumber.
    write:  'to have', e_servicenumber.
    write: e_servicetype.
    endmethod.
    endclass.
    global data
    DATA: o_pilot type ref to pilot,
          o_passenger_1 type ref to passenger,
          o_passenger_2 type ref to passenger,
          o_passenger_3 type ref to passenger,
          o_passenger_4 type ref to passenger,
          o_passenger_5 type ref to passenger.
    DATA: o_purser type ref to flight_attendant,
          o_stewardess type REF to flight_attendant,
          0_foodservice type REF to flight_attendant.
          0_drinkservice type REF to flight_attendant.
    classical processing blocks
          start-of-selection.
          create object: o_pilot,
          o_passenger_1 exporting i_seatnumber = 11,
          o_passenger_2 exporting i_seatnumber = 17,
          o_passenger_2 exporting i_seatnumber = 21,
          o_passenger_2 exporting i_seatnumber = 25,
          o_passenger_2 exporting i_seatnumber = 31.
    create object: o_purser
                   exporting i_id = 'purser',
                   o_stewardess
                   exporting i_id = 'stewardess',
                   o_foodservice
                   exporting i_id = 'foodservice',
                   o_drinkservice
                   exporting i_id = 'drinkservice'.
    set handler: o_purser->help_the_pilot for o_pilot,
                 o_stewardess->help_a_passenger for all instances.
    call method: o_pilot->call_flight_attendant,
    o_passenger_1->call_for_help,
    o_passenger_2->call_for_help.
    I am getting an error "object type passenger doesnot have an event RAISE".
    Any help is appreciated.
    Thanks in advance
    Thanks..

    Hi Madhuri,
    the error that you are getting 'statement is not accessible' is just because u didnt end the data statements with '.'...it is ','...check that
    one more thing when you are creating the object passenger you have to export the 'service number' and the 'service type' also along with 'seatnumber' as you have declared that way in the constructor.
    i made the changes...please check the code..there are no errors but please pass suitable values according to your requirement. right now all the events are getting triggered.
    check this changed code..code in bold
    *& Report  ZTEST_EVENTS
    REPORT  ZTEST_EVENTS.
    class declarations.
    CLASS PILOT DEFINITION.
      PUBLIC SECTION.
        METHODS: CALL_FLIGHT_ATTENDANT.
        EVENTS: CALL_BUTTON_PRESSES.
    ENDCLASS.                    "pilot DEFINITION
          CLASS passenger DEFINITION
    CLASS PASSENGER DEFINITION.
      PUBLIC SECTION.
        METHODS: CONSTRUCTOR IMPORTING VALUE(I_SEATNUMBER) TYPE I
                                      VALUE(I_SERVICENUMBER) TYPE I
                                         VALUE(I_SERVICETYPE) TYPE I,
        CALL_FOR_HELP.
        EVENTS: CALL_BUTTON_PRESSED EXPORTING VALUE(E_SEATNUMBER) TYPE I,
        CALL_SERVICE_NUMBER EXPORTING VALUE(E_SERVICENUMBER) TYPE I,
        CALL_SERVICE_TYPE EXPORTING VALUE(E_SERVICETYPE) TYPE I.
      PROTECTED SECTION.
        DATA SEATNUMBER TYPE I.
        DATA SERVICENUMBER TYPE I.
        DATA SERVICETYPE TYPE I.
    ENDCLASS.                    "passenger DEFINITION
          CLASS flight_attendant DEFINITION
    CLASS FLIGHT_ATTENDANT DEFINITION.
      PUBLIC SECTION.
        METHODS: CONSTRUCTOR
        IMPORTING I_ID TYPE STRING,
        HELP_THE_PILOT FOR EVENT
        CALL_BUTTON_PRESSES OF PILOT,
        HELP_A_PASSENGER FOR EVENT
        CALL_BUTTON_PRESSED OF PASSENGER
        IMPORTING E_SEATNUMBER,
    <b>    CALL_SERVICE_PRESSED FOR EVENT
        CALL_SERVICE_NUMBER OF PASSENGER
        IMPORTING E_SERVICENUMBER,
        CALL_TYPE_PRESSED FOR EVENT
        CALL_SERVICE_TYPE OF PASSENGER
        IMPORTING  E_SERVICETYPE.</b>
      PROTECTED SECTION.
        DATA ID TYPE STRING.
    ENDCLASS.                    "flight_attendant DEFINITION
    class Implementations
    CLASS PILOT IMPLEMENTATION.
      METHOD CALL_FLIGHT_ATTENDANT.
        RAISE EVENT CALL_BUTTON_PRESSES.
      ENDMETHOD.                    "call_flight_attendant
    ENDCLASS.                    "pilot IMPLEMENTATION
          CLASS passenger IMPLEMENTATION
    CLASS PASSENGER IMPLEMENTATION.
      METHOD: CONSTRUCTOR.
        SEATNUMBER = I_SEATNUMBER.
        SERVICENUMBER = I_SERVICENUMBER.
        SERVICETYPE = I_SERVICETYPE.
      ENDMETHOD.                    "constructor
      METHOD: CALL_FOR_HELP.
        RAISE EVENT: CALL_BUTTON_PRESSED
        EXPORTING E_SEATNUMBER = SEATNUMBER.
    <b>    RAISE EVENT: CALL_SERVICE_NUMBER
        EXPORTING E_SERVICENUMBER = SERVICENUMBER.
        RAISE EVENT: CALL_SERVICE_TYPE
        EXPORTING E_SERVICETYPE = SERVICETYPE.</b>
      ENDMETHOD.                    "call_type_help
    ENDCLASS.                    "passenger IMPLEMENTATION
          CLASS flight_attendant IMPLEMENTATION
    CLASS FLIGHT_ATTENDANT IMPLEMENTATION.
      METHOD CONSTRUCTOR.
        ID = I_ID.
      ENDMETHOD.                    "constructor
      METHOD HELP_THE_PILOT.
        WRITE: / ID, 'helps pilot'.
      ENDMETHOD.                    "help_the_pilot
      METHOD: HELP_A_PASSENGER.
        WRITE: / ID, 'helps passenger on seat',
        E_SEATNUMBER.
      ENDMETHOD.                    "help_a_passenger
    <b>  METHOD CALL_SERVICE_PRESSED.
        WRITE: 'to have serviceno', E_SERVICENUMBER.
      ENDMETHOD.                    "call_service_pressed
      METHOD CALL_TYPE_PRESSED..
        WRITE: 'service type' ,E_SERVICETYPE.
      ENDMETHOD.</b>                    "call_type_pressed
    ENDCLASS.                    "flight_attendant IMPLEMENTATION
    global data
    DATA: O_PILOT TYPE REF TO PILOT,
    O_PASSENGER_1 TYPE REF TO PASSENGER,
    O_PASSENGER_2 TYPE REF TO PASSENGER,
    O_PASSENGER_3 TYPE REF TO PASSENGER,
    O_PASSENGER_4 TYPE REF TO PASSENGER,
    O_PASSENGER_5 TYPE REF TO PASSENGER.
    DATA: O_PURSER TYPE REF TO FLIGHT_ATTENDANT,
    O_STEWARDESS TYPE REF TO FLIGHT_ATTENDANT,
    O_FOODSERVICE TYPE REF TO FLIGHT_ATTENDANT,
    O_DRINKSERVICE TYPE REF TO FLIGHT_ATTENDANT.
    classical processing blocks
    START-OF-SELECTION.
      CREATE OBJECT: O_PILOT,
      O_PASSENGER_1 EXPORTING I_SEATNUMBER = 11
                              I_SERVICENUMBER = 12
                              I_SERVICETYPE = 13,
       O_PASSENGER_2 EXPORTING I_SEATNUMBER = 14
                              I_SERVICENUMBER = 15
                              I_SERVICETYPE = 16,
       O_PASSENGER_3 EXPORTING I_SEATNUMBER = 17
                              I_SERVICENUMBER = 18
                              I_SERVICETYPE = 19,
       O_PASSENGER_4 EXPORTING I_SEATNUMBER = 20
                              I_SERVICENUMBER = 21
                              I_SERVICETYPE = 22,
    O_PASSENGER_5 EXPORTING I_SEATNUMBER = 23
                              I_SERVICENUMBER = 24
                              I_SERVICETYPE = 25.
    *o_passenger_2 exporting i_seatnumber = 17,
    *o_passenger_2 exporting i_seatnumber = 21,
    *o_passenger_2 exporting i_seatnumber = 25,
    *o_passenger_2 exporting i_seatnumber = 31.
      CREATE OBJECT: O_PURSER
      EXPORTING I_ID = 'purser',
      O_STEWARDESS
      EXPORTING I_ID = 'stewardess',
      O_FOODSERVICE
      EXPORTING I_ID = 'foodservice',
      O_DRINKSERVICE
      EXPORTING I_ID = 'drinkservice'.
      SET HANDLER: O_PURSER->HELP_THE_PILOT FOR O_PILOT,
      O_STEWARDESS->HELP_A_PASSENGER FOR ALL INSTANCES,
    <b> O_STEWARDESS->CALL_SERVICE_PRESSED FOR ALL INSTANCES,
      O_STEWARDESS->CALL_TYPE_PRESSED FOR ALL INSTANCES.</b>
      CALL METHOD: O_PILOT->CALL_FLIGHT_ATTENDANT,
      O_PASSENGER_1->CALL_FOR_HELP.
    similarly call the methods for the other objects also.
    Regards,
    Vidya

  • Failed to create object.Help needed

    Hi, I have some program here, the BPDU class and also the RootBridge class. The BPDU class is just a simple class with all the getMethods and the setMethods. For the RootBridge class, it is suppose to connect to the JDBC ODBC database, and create arraylist and retrieve the mac address, priority and also the port id from the database. However, when I tried to create a BPDU object, it gives me an error saying :
    --------------------Configuration: j2sdk1.4.2_01 <Default>--------------------
    F:\new Project FYP\RootBridge.java:43: BPDU(java.lang.String,double,java.lang.String,int,java.lang.String,java.lang.String) in BPDU cannot be applied to ()
                        BPDU bpdu =new BPDU();
    ^
    1 error
    Here are the classes:
    BPDU class:
    public class BPDU
         private String BridgeIDMac;
         private double BridgeIDPriority;
         private String MsgType;
         private int CostPath;
         private String PortID;
         private String ComputerName;
         public BPDU(String BridgeIDMac, double BridgeIDPriority,String MsgType,int CostPath, String PortID, String ComputerName)
              this.BridgeIDMac=BridgeIDMac;
              this.BridgeIDPriority=BridgeIDPriority;
              this.MsgType=MsgType;
              this.CostPath=CostPath;
              this.PortID=PortID;
              this.ComputerName=ComputerName;
         public String getBridgeIDMac()
              return BridgeIDMac;
         public double getBridgeIDPriority()
              return BridgeIDPriority;
         public String getMsgType()
              return MsgType;
         public int getCostPath()
              return CostPath;
         public String getPortID()
              return PortID;
         public String getComputerName()
              return ComputerName;
         //SET METHODS
         public void setBridgeIDMac(String mac)
              BridgeIDMac=mac;
         public void setBridgeIDPriority(double priority)
              BridgeIDPriority=priority;
         public void setMsgType(String msg)
              MsgType=msg;
         public void setCostPath(int costpath)
              CostPath=costpath;
         public void setPortID(String portid)
              PortID=portid;
         public void setComputerName(String computername)
              ComputerName=computername;
    RootBridge Class:
    import java.util.*;
    import java.sql.*;
    import java.io.*;
    import java.net.*;
    import java.lang.*;
    public class RootBridge
         private Connection con;
         private String macaddress;
         private int priority;
         private int portid;
         public RootBridge()
              try
                   //ESTABLISH THE JDBC DATABASE CONNECTION
                   Class.forName("sun.jdbc.odbc.JdbcOdbcDriver");
                   con = DriverManager.getConnection("jdbc:odbc:BPDU");
              catch(ClassNotFoundException c)
                   System.out.println(c+": JDBC Driver Could Not Be Loaded.");
              catch(SQLException s)
                   System.out.println(s+": Database Connection Could Not Be Established.");
         //TO RETRIEVE THE COMPUTER NAME  IN DATABASE
         public ArrayList retrieveComputerName()
              ArrayList arraylist=new ArrayList();
              try
                   PreparedStatement p=con.prepareStatement("Select ComputerName from BPDU");
                   ResultSet rs= p.executeQuery();
                   if(rs.next())
                        //************Here is the error
                                                                                         BPDU bpdu =new BPDU();                    bpdu.setComputerName(rs.getString("ComputerName"));
                        arraylist.add(bpdu);
              catch(SQLException s)
                   System.out.println(s+": Could not retrieve computer name from database");
              return arraylist;
         //to get the mac address that belong to the computer
         public BPDU retrieveMacAddress(String computername)
              System.out.println("DB1"+computername);
              try
                   PreparedStatement p=con.prepareStatement("Select BridgeIDMAC from BPDU where ComputerName=?" );
                   System.out.println("DB2"+computername);
                   p.setString(1,computername);
                   p.setString(2,computername);
                   p.setString(3,computername);
                   ResultSet rs=p.executeQuery();
                   if(rs.next())
                        macaddress=rs.getString("BridgeIDMAC");
                   System.out.println("DB4"+macaddress);
              catch(SQLException s)
                   System.out.println(s+": Could not retrieve the mac address from database");
         //to retrieve priority from database
         public BPDU retrievePriority(String computername)
              System.out.println("DB1"+computername);
              try
                   PreparedStatement p=con.prepareStatement("Select BridgeIDPriority from BPDU where ComputerName=?" );
                   System.out.println("DB2"+computername);
                   p.setString(1,computername);
                   p.setString(2,computername);
                   p.setString(3,computername);
                   ResultSet rs=p.executeQuery();
                   if(rs.next())
                        priority=rs.getInt("BridgeIDPriority");
                   System.out.println("DB4"+priority);
              catch(SQLException s)
                   System.out.println(s+": Could not retrieve the priority from database");
         //to retrieve port id from database
         public BPDU retrievePortID(String computername)
              System.out.println("DB1"+computername);
              try
                   PreparedStatement p=con.prepareStatement("Select PortID from BPDU where ComputerName=?" );
                   System.out.println("DB2"+computername);
                   p.setString(1,computername);
                   p.setString(2,computername);
                   p.setString(3,computername);
                   ResultSet rs=p.executeQuery();
                   if(rs.next())
                        portid=rs.getInt("PortID");
                   System.out.println("DB4"+portid);
              catch(SQLException s)
                   System.out.println(s+": Could not retrieve the port id from database");
    }Please see //************Here is the error in the Root Bridge class.Help me to solve the problem.Thank You very much

    Hi,
    The error message means that the BPDU class doesn't have an empty constructor. You must pass the in needed arguments to the BPDU constuctor.
    /Kaj

Maybe you are looking for