Checking Existing Portal User

Hi all,
I am new to Web Dynpro Java. Can anyone help me how to check if the user is existing user?
Regards,
Nithya M

Hi,
Go through this code,
try {
     IWDClientUser clientUser = WDClientUser.getCurrentUser();
     clientUser1.getClientUserID());
     clientUser1.getDescription());
     clientUser1.getFirstName());
     clientUser1.getLastName());
     clientUser1.getSalutation());
     clientUser1.getServiceName());
     clientUser1.getTitle());
     clientUser1.getVersion());
     clientUser1.getClass());
     clientUser1.getVersion());
     clientUser.isAnonymouseUser());
     catch (WDUMException e)
        wdComponentAPI.getMessageManager().reportException( e.getMessage(), true);
     e.printStackTrace();
Regards
Padma N

Similar Messages

  • Count total number of existing Portal users..Urgent

    Hello All,
    im working on EP6 SP9 (and SP12).
    I would appreciate if anyone would please guide me - How can I retrieve total number of existing Portal users (<b>using code</b> & not Activity Reporting).
    This is kinda urgent....please I request you all.
    Thanks in Advance.
    Warm Regards,
    Ritu R HUnjan

    Hi ritu,
    Check this code. This will give you the total no of users and the names of all the users:
    package com.hcl;
    import com.sap.security.api.ISearchResult;
    import com.sap.security.api.IUser;
    import com.sap.security.api.IUserFactory;
    import com.sap.security.api.IUserSearchFilter;
    import com.sap.security.api.UMFactory;
    import com.sapportals.portal.prt.component.AbstractPortalComponent;
    import com.sapportals.portal.prt.component.IPortalComponentRequest;
    import com.sapportals.portal.prt.component.IPortalComponentResponse;
    public class PortalUsers extends AbstractPortalComponent
         public void doContent(
              IPortalComponentRequest request,
              IPortalComponentResponse response)
              try
                   IUserFactory userfactory = UMFactory.getUserFactory();
                   IUserSearchFilter userfltr = userfactory.getUserSearchFilter();
                   userfltr.setMaxSearchResultSize(5000);
                   ISearchResult userResult = userfactory.searchUsers(userfltr);
                   int size = userResult.size();
                   response.write("<table><tr><td bgcolor=Green>"+ "Names of the user are:"+ "</td></tr></table>n");
                   while (userResult.hasNext())
                        response.write("<table border=0>n");
                        String uniqueid = (String) userResult.next();
                        IUser user = userfactory.getUser(uniqueid);
                        response.write("<tr><td>"+ user.getDisplayName()+ "</td></tr>n");
                        response.write("</table>n");
                   response.write("<table border=0><tr><td bgcolor=Green>"+ " Total no of users "+ "</td></tr>n");
                   response.write("<tr><td bgcolor=Red>"+ size+ "</td></tr></table>n");
              catch (Exception e)
    I hope this solves your problem
    Regards
    Pravesh
    PS: Please reward points if answer is helpful.

  • How to check whether portal user exists or not using UM API.

    Hi Experts,
    Let us say i need to create an user account "PortalUser",i know how to create an user,setting first name,lastname,password for that.
    but here before creating the portal user, i need to check whether that user exists or not.If user already exists ,then i  need to skip the below for creating the user.
    IUserFactory userFact = UMFactory.getUserFactory();
    IGroupFactory groupFact = UMFactory.getGroupFactory();
    IRoleFactory roleFact = UMFactory.getRoleFactory();
    IUser tuser = userFact.getUserByLogonID("PortalUser");
    IUserMaint newUser = userFact.newUser("PortalUser");
    newUser.setFirstName("PortalUser");
    newUser.setLastName("Test");
    newUser.setEmail("PortalUser.Testatgmaildotcom");
    //Locale PortalLanguage = new Locale(Lang.toLowerCase(), "");
    Locale PortalLang=new Locale("en");
    newUser.setLocale(PortalLang);
    newUser.save();
    newUser.commit();
    IUserAccount userAcc = UMFactory.getUserAccountFactory().newUserAccount("PortalUser", newUser.getUniqueID());
    userAcc.setPassword("test1test$");
    userAcc.save();
    userAcc.commit();     
    Thanks in advance.
    Thanks
    Sony.

    Hi,
    Try this code,
    IUserFactory factory = UMFactory.getUserFactory();
    IUser user = factory.getUserByLogonID(userId);
    lastName = user.getLastName();
    firstName = user.getFirstName();
    refer this pdf,its very helpful
    https://www.sdn.sap.com/irj/servlet/prt/portal/prtroot/com.sap.km.cm.docs/library/events/webinars-nw-rig/using%20the%20user%20management%20api%20with%20ep%20applications%20-%20webinar%20powerpoint.pdf
    Regards,
    Sunaina Reddy T

  • Portal users list

    Why I don't see ALL existing portal users?
    Any ideas?
    Regards,
    Michael

    I solved my problem by myself,thanks

  • Webdynpro - Check if a portal user has a user in R/3 Backend

    Hi Experts,
    i have following problem, and maybe some of you can help me out with an idea or (much better) a solution:
    Our Company is running an Enterprise Portal on NW2004s (SPS 18). Currently i am developing a Java WebDynpro Application for the portal called Transactionstarter. Withhin this application a portal user can simply add a backend System (R/3), a transaction and a Description. This information will be stored in a xml file in userhome in KM. When the user clicks the description, SAP WinGui will open with the transaction he defined before. We use SSO for opening the transaction if the user has a backend user. If not, the loginscreen of the backend will appear.
    All this works fine.
    Now we have the requirement for an automated system check.
    The portal user can run an initial system check. This system check should check all configured backend systems if the portal user has a user in R/3 backend.
    But how can i check if my portal user exists in backend?
    I cannot use JCO because we have a lot of Systems (more than 300 all together) and i don´t want to create a destination for every system. Or did i misunderstood something with JCO?
    Does anyone of you have a solution, how i can check every system, if the portal user has also a backend user?
    Thanks in advance.
    Regards
    Pascal

    Hi Pascal,
    with JCO you can use also the method JCO.createClient:
    public static JCO.Client createClient(java.lang.String client,
                                          java.lang.String user,
                                          java.lang.String passwd,
                                          java.lang.String lang,
                                          java.lang.String mshost,
                                          java.lang.String r3name,
                                          java.lang.String group)
    Creates an instance of a client connection to a remote SAP system (with load balancing)
    Parameters:
    client - SAP logon client
    user - SAP logon user
    passwd - SAP logon password
    lang - SAP logon language
    mshost - Host name of the message server
    r3name - Name of the SAP system
    group - Name of the group of application servers
    Returns:
    the newly created client
    for connections to other systems. So you can avoid to create destinations
    Regards
    Matteo
    Edited by: Matteo Fusi on Apr 1, 2009 11:33 AM

  • How to check if a user exists in the system ?

    Dear Gurus,
    I want to check whether a user ID exists in the system after logon by using VBA. If the user ID exists, then I will update the user's information with external data by using the method user.change.
    When running below codes, error occurs and error msg is: "The persistent key for an business object instance of type USER has not been set. Cannot invoke method EXISTENCECHECK"
    How can I do to check the user ID existence ?
    Set oUser = oBAPICtrl.GetSapObject("user")
    oUser.ExistenceCheck "MyUserID", return:=oReturn
    Thanks and Regards,
    Bao Yan

    Mickey,
    I'm afraid I never did get this to work properly. However, in the way of all bad/good (delete as appropriate) programmers eveywhere I worked around this problem. I was using this code in Banner.asp to change the view based on the user group so if a given session variable was set a user would see a different view. It works fine with no slow down on the page and you should be able to adapt it to what you need.
    Hope this helps.
    Neville
    Note: Application variables are ones I have defined in config.xml.
    Code follows:
    <!--START:INC\common\getgroup.asp-->
    <% 'NAH 29/03/2004 ' 'This check the to see if the current user has the group in their membership that has been defined as the group to provide an alternative view of the portal.' 'The group variable is defined in the config.xml as "ALTVIEWGROUP"'
    'Do not do this is we have already matched the group'If Session("groupMatch") <> "1" and Session("groupMatch") <> "2" then
    Dim pGroup
    pGroup = Application("ALTVIEWGROUP") Set Session("groupMatch") = nothing
    Dim Plumtree
    Set Plumtree = Server.CreateObject("ADODB.Recordset") Plumtree.ActiveConnection = "Driver={SQL Server};Server=" & Application("DBSERVER") & ";Database=" & Application("PLUMTREEDB") & ";" Plumtree.Source = "SELECT GROUPID FROM " & Application("PLUMTREEDBUSER") & ".PTGROUPMEMBERSHIP WHERE (USERID = " & strUserID & ") AND (GROUPID = " & pGroup & ")" Plumtree.CursorType = 3 Plumtree.CursorLocation = 2 Plumtree.LockType = 1 Plumtree.Open()
    'If there are records we should have a match otherwise set the session varible to no match.' If Plumtree.EOF then Session("groupMatch") = "2" Else 'By getting here the user should have the matching group but complete one final check to make sure' If cInt(Plumtree.Fields.Item("GROUPID").Value) = cInt(pGroup) then Session("groupMatch") = "1" Else Session("groupMatch") = "2" End If
    End If
    Plumtree.Close() Set Plumtree = Nothing
    End if%><!--END:INC\common\getgroup.asp-->

  • Error when creating a user - IAM-3010183 : An error occurred while checking if a user already exists with the Common Name generated.

    Error when creating a user - IAM-3010183 : An error occurred while checking if a user already exists with the Common Name generated.

    in OIM 11g R2
    Message was edited by: 2b3c0737-074f-48d0-a760-e24e3ed9a37c

  • How to check the unused users in portal.

    Hi Guru,
    We are doing auditing in Portal server.Can any tell us
    How to check the unused users in portal?.
    Regards,
    Vivek

    Use portal activity reporting  for monitoring the users. This way you can monitor the users in the portal who logged on to the portal.
    Below are things you can monitor from portal activity report iview
    1) number of users logged on during the period of time.
    2) Details of the users who logged on
    3) monitoring particular iview/page
    Check the below threads for more help
    http://help.sap.com/saphelp_nw04s/helpdata/en/47/87329cc84a199ce10000000a42189d/frameset.htm
    http://help.sap.com/saphelp_nw04s/helpdata/en/47/87346dc84a199ce10000000a42189d/frameset.htm
    Raghu

  • Checks users Exists in user group or not?

    Hi All,
    bool userExsists = SPContext.Current.Web.CurrentUser.Groups.Cast<SPGroup>().Any(g => g.Name.ToLower() == "groupname".ToLower());
    Is there ay alternative for findings that user is in group or not? Is it best way to achieve this?

    Hi,
    To check if a user exists in user group, please use the code below:
    string userName = "contoso\\admin";//your user account
    string groupName = "SP Members";// your user group
    using (SPSite spSite = new SPSite("http://sp")) // your site collection URL
    using (SPWeb spWeb = spSite.OpenWeb())
    SPUser user = spWeb.EnsureUser(userName);
    if (user.Groups.Cast<SPGroup>().Any(g => g.Name.Equals(groupName)))
    Console.WriteLine("User " + userName + " is a member of group " + groupName);
    else
    Console.WriteLine("User " + userName + " is NOT a member of group " + groupName);
    Or you can use PowerShell command below:
    $w = get-spweb http://my
    $gs = $w.SiteGroups
    $g = $gs[12]
    $user = $g.Users.GetByEmail("[email protected]")
    if($user -eq $null){write-host "User Not Found"}
    Best regards.
    Thanks
    Victoria Xia
    TechNet Community Support

  • New Portal User options are disabled when trying to create a new User

    Hi All,
    I am trying to create a new portal user profile using the administrator login. While doing that, I am getting all the options ( used to create the new user ) as disabled. Can anybody let me know the reason & solution of such a problem.
    or
    Anyone can provide me the document on how to create the new profile on portal. Thanks.
    Best Regards,
    Chander Kararia
    Edited by: Chander Kararia on Jan 15, 2009 7:26 AM

    Hi Chander,
    I just want to know if you are able to modify the attributes of an existing user. If not then you have been assigned the User Admin role (read only). Please check that. If yes then revert.
    Regards.
    Rajat

  • WDURLGenerator.isSecureURL: Error in Portal User Admin Identity Mgmt

    Hi:
       I've come across a strange error while selected/creating Users in EP 7.0 under UserAdmin > Identity Mgmt > Selecting a User (clicking on user)
    I got the following error:
    <b>java.lang.NoSuchMethodError: com.sap.tc.webdynpro.services.sal.url.api.WDURLGenerator.isSecureURL</b>
    But when I checked the WD Runtime APIs for <u><i>2004S(SP 8,9,10)</i></u> and <i><u>2004(Current Version)</u></i> i didn't find the <b>isSecureURL()</b> at all in all the
    <b>com.sap.tc.webdynpro.services.sal.url.api.WDURLGenerator</b> class.
    So if this is the case why my portal (EP 7.0 SP 9) is referring to isSecureURL() method when I clicked on the newly created User????
    Any suggestionsss guys?? Waiting for the replies..!
    Tnx,
    MS

    Resolved when applied a new level of SP to the existing portal.

  • SAP EP - How to redirect in case of a reqest for a non-existent portal pag

    Hello,
    I am not 100% sure if this is the right forum to ask my question but I will give it a try anyway.
    I would like to customize the error handling of the SAP EP 6.0 in the following way. If a user tries to access a page of the portal that does not exist, the user should receive an error page describing the problem occured and should be redirected to the homepage after a short period of time.
    In a portal environment with default configuration the user would immediately be redirected to the homepage. There is no error message displayed.
    Does anyone know where to start digging? I think I need a better understanding of SAP EP error handling. I appreciate all answers, hints and suggestions.
    Cheers
    Martin
    Message was edited by: Martin Kellermann
    Message was edited by: Martin Kellermann

    Hi guys,
    I am sorry to start discussion on that topic again. But I definitely need some help. Due to Samuli's help I have been able to modify the error handling of the portal in the following way.
    <b>Customization:</b>
    User attempts to access a wrong url within the portal (e.g. http://<portal_server>:50000irjportalwrongurl). Instead of the standard "404 the requested resource is not available" error page I see my own error page. That's nice.
    <b>What did I do:</b>
    I added the following lines to the portal's web.xml (/usr/sap/J2E/JC00/j2ee/cluster/server0/apps/sap.com/irj/servlet_jsp/irj/root/web-infweb.xml):
    <error-page>
      <error-code>404</error-code>
      <location>/customerrors/404.html</location>
    </error-page>
    Additionally, I created a the 404.html file and put it in folder (/usr/sap/J2E/JC00/j2ee/cluster/server0/apps/sap.com/irj/servlet_jsp/irj/root/customerrors/.
    <b>What else?</b>
    Well, I am using KM to make files accessible through the EP platform. If I access a KM file via the portal (http://<portal_server>:50000/irj/servlet/prt/portal/prtroot/com.sap.km.cm.docs/documents/Public%20Documents/Testfile.txt)an extra window opens and shows me the content of the file. In case I enter a wrong url (e.g. http://<portal_server>:50000/irj/servlet/prt/portal/prtroot/com.sap.km.cm.docs/documents/Public%20Documents/wrong_file_name.txt)I see the standard "404 The requested resource is not available" error page. But I want to see my customized error page.
    <b>How to</b>
    I think I have to modify the web.xml of the KM the same way I did for the portal. But I do not know where to find the KM web.xml? Please could someone advise me where to look?
    I appreciate all kinds of help!
    Martin

  • How to get Portal user from a standalone Java application

    Hi,
    I have a standalone Java application from where I need to fetch the Portal User Information like userid and email id.
    I am using the below line of code
    iUser = UMFactory.getUserFactory().getUserByLogonID("e017939");
    I have included the jar file com.sap.security.api , But it was giving me the below exception
    java.lang.NoClassDefFoundError: com/sap/tc/logging/Location
         at com.sap.security.api.UMFactory.<clinit>(UMFactory.java:55)
         at com.am.wcas.java.mailscheduler.kmaccess.FetchDataFromKM.getiUser(FetchDataFromKM.java:29)
         at com.am.ScheduleEmails.main(ScheduleEmails.java:89)
    and I am getting a pop Up message from the Java Virtual Machine Launcher, saying a Fatal Exception has occured and the Program will exit.
    Then I went throught he SDN threads and they asked me to include the
    logging.jar and com.sap.security.perm.api .
    I Included them, then also, it is giving me Exception
    java.lang.NoClassDefFoundError: com/sap/engine/lib/logging/LoggingHelper
         at com.sap.security.api.UMFactory.<clinit>(UMFactory.java:56)
         at com.am.FetchKMData.main(FetchKMData.java:30)
    Exception in thread "main"
    and I am getting a pop Up message from the Java Virtual Machine Launcher, saying a Fatal Exception has occured and the Program will exit.
    Kindly let me know if it is possible to access the User info using UMFactory in a standalone Java application. If yes kindly let me know where i am going wrong.
    Regards,
    Shilpa B.V

    Hi Shilpa,
    1. Check that you have added com.sap.security.api within the Your Project>Libraries folder (under navigation tab) and also added jars in the build path of the Your Project under project>properties>Build Path.
    2. In case you have a DC instead of Web Dynpro Project then you have to add the com.sap.security.api under Your DC>Used DCs and have compile time and runtime dependency added.
    Here java.lang.NoClassDefFoundError is caused basically due to only build time dependency added and reference to the jar missing at runtime. Rest the code to retrieve the current user id using UME API and getUserByLogOnID("....") method with/without portal environment would not be an issue at all.
    Regards,
    Tushar SInha

  • How to access a Portal User Info from a J2EE application?

    Hi,
    I have deployed a j2ee application in portal and its running fine.
    from that application i need to assign some roles to some users.i have the user id.
    so my doubt is can i access the portal user info from this j2ee application?i have some servlets in the j2ee application....can i get the portal user info from this servlet?
    plz help me
    regards,
    Visweswar

    Hi,
    Please check out this to get the portal user information from Java -
    WdClientUser class/Interface to aciehve this.
    Please check out these links on the same -
    WDClientUser.getClientUser IUser
    help needed
    Regards
    Lekha

  • Check java on users PC and give message

    The following code has been written with Java 1.4 and works great, but if a user has Java 1.3 they get an error message and if a user has Java 1.2 nothing happens at all. Is there a way to check if the user is using a version older than 1.4 and if so pop up a message telling them they need to download a newer version of Java?
    import java.awt.*;
    import javax.swing.*;
    import java.awt.event.*;
    import java.util.List;
    import java.io.*;
    import java.util.*;
    import javax.xml.parsers.*;
    import javax.xml.transform.*;
    import javax.xml.transform.dom.*;
    import javax.xml.transform.stream.*;
    import org.w3c.dom.*;
    public class Sametime extends JFrame implements ActionListener {
        private int indentation = -1;
        JPanel panel = new JPanel();
        JTextArea jta = new JTextArea(
        //Instructions for user
        "For a successful buddy list migration do the following:\n"
        + "1. Save your current Sametime Buddy List to your PC.\n   "
        + "The default location should be: C:/Program Files/Lotus/Sametime Client.\n"
        + "  A. Open the Sametime Client.\n"
        + "  B. Click on People\n"
        + "  C. Click on Save List.\n"
        + "  D. Save as your first.last.dat\n"
        + "     Ex. john.doe.dat\n"
        + "NOTE: If you have AOL contacts in your Sametime buddy list they will not be migrated.\n");
        JButton browse = new JButton("Continue");
        JButton exit = new JButton("Exit");
        public Sametime() {
            super("Sametime Buddy List Migration");
            setSize(610, 245);
            Container c = this.getContentPane();
            c.add(panel);
            browse.addActionListener(this);
            exit.addActionListener(this);
            panel.add(jta);
            panel.add(browse);
            panel.add(exit);
            jta.setEditable(false);
            setLookAndFeel();
            setVisible(true);
            setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE);
        } //end Sametime
        public class DATFilter extends javax.swing.filechooser.FileFilter {
            public boolean accept(File f) {
                //if it is a directory -- we want to show it so return true.
                if (f.isDirectory())
                    return true;
                String extension = getExtension(f);//get the extension of the file
                //check to see if the extension is equal to "dat"
                if ((extension.equals("dat")))
                    return true;
                //default -- fall through. False is return on all
                //occasions except:
                //a) the file is a directory
                //b) the file's extension is what we are looking for.
                return false;
            }//end accept
            public String getDescription() {
                return "dat files";
            }//end getDescription
             * Method to get the extension of the file, in lowercase
            private String getExtension(File f) {
                String s = f.getName();
                int i = s.lastIndexOf('.');
                if (i > 0 &&  i < s.length() - 1)
                    return s.substring(i+1).toLowerCase();
                return "";
            }//end getExtension
        }//end class DATFilter
        public void actionPerformed(ActionEvent e) {
            //Default Location for JFileChooser search
            String error = "The file selected is not a .dat file!\n"
            + "Please select your recently saved .dat file and try again.";
            JFileChooser fc = new JFileChooser("/Program Files/Lotus/Sametime Client");
            fc.setFileFilter(new DATFilter());
            fc.setFileSelectionMode( JFileChooser.FILES_ONLY);
            String user = System.getProperty("user.name");// finds who the current user is
            if (e.getSource() == browse) {
                int returnVal = fc.showSaveDialog(Sametime.this);
                if (returnVal == JFileChooser.APPROVE_OPTION) {
                    //if (fc.getSelectedFile().getName().equals(".dat")){
                    if (fc.getSelectedFile().getName().endsWith(".dat")){ // checks to see if selected file is .dat
                    }else{
                        JOptionPane.showMessageDialog(null, error, "Wrong File", JOptionPane.ERROR_MESSAGE);
                        return;
                    }//end else
                    try {
                        String[] contactArray = parseDatFile(fc.getSelectedFile());
                        Document document = createXMLDocument(contactArray);
                        saveToXMLFile(
                        document,
                        new File(
                        "C:/Documents and Settings/" + user +"/My Documents/OLCS/",// looks for directory for list
                        "contacts-list_migration.ctt"));
                    } catch (Exception exc) {
                        File f = new File("C:/Documents and Settings/" + user +"/My Documents/OLCS/");// setting directory for list if not there
                        boolean yes = true;
                        yes = f.mkdir();// creating directory
                        try {
                            String[] contactArray = parseDatFile(fc.getSelectedFile());
                            Document document = createXMLDocument(contactArray);
                            saveToXMLFile(
                            document,
                            new File(
                            "C:/Documents and Settings/" + user +"/My Documents/OLCS/",// used only if the directory didn't exist
                            "contacts-list_migration.ctt"));
                            //exc.printStackTrace();// not sure if this is needed?
                        } catch (Exception exc1) {
                            exc1.printStackTrace();
                        }//end inner catch
                    }// end catch
                }// end if
                if(returnVal==JFileChooser.CANCEL_OPTION){
                    String Warning = "You did not migrate your Sametime buddy list at this time.";
                    JOptionPane.showMessageDialog(null, Warning, "Migration Canceled", JOptionPane.WARNING_MESSAGE);
                    return;
                }else{
                    String thankyou = "Thank You for Migrating your Sametime buddy list to OLCS"
                    + "\nYour new OLCS buddy list has been saved to:"
                    + "\nC:/Documents and Settings/" + user +"/My Documents/OLCS"
                    + "\n as: Contact-List_migration.ctt"
                    + "\n\n To be able to use Contact-List_migration.ctt for Windows Messenger:"
                    + "\n1. Log into Windows Messenger."
                    + "\n2. Click on File"
                    + "\n3. Click on 'Import Contacts from a Saved File...'"
                    + "\n4. Open OLCS in My Documents"
                    + "\n5. Click on 'Contact-list_migration.ctt'"
                    + "\n6. Click Open to import the list."
                    + "\n   A window will pop up confirming that you want to add all of the contacts"
                    + "\n   Click 'yes'"
                    + "\n   Your buddy list is ready to be used.";
                    JOptionPane.showMessageDialog(null, thankyou, "Migration Completed", JOptionPane.INFORMATION_MESSAGE);//Change this when defualt directory is known.
                }//end if else statement
            } //end if
            System.exit( 0 );
            if (e.getSource() == exit) {
                System.exit( 0 );
            } //end if
        } //end actionPerformed
        String[] parseDatFile(File datFile)
        throws Exception    {
            List list = new ArrayList();
            BufferedReader br = new BufferedReader(new FileReader(datFile));
            String line;
            while ((line = br.readLine()) != null) {
                line = line.trim();
                if (line.indexOf("U") != 0)
                    continue;
                int p = line.indexOf("::");
                if (p == -1)
                    continue;
                line = line.substring(p + 2).trim();
                if (line.indexOf("AOL") == 0)
                    continue;
                p = line.indexOf(",");
                if (p != -1)
                    line = line.substring(0, p);
                line = line.trim() + "@mci.com";
                if (list.indexOf(line) == -1)
                    list.add(line);
            }//end while
            br.close();
            String[] contactArray = new String[list.size()];
            list.toArray(contactArray);
            return contactArray;
        }// end String
        // setting up the XML file
        Document createXMLDocument(String[] contactArray) throws Exception {
            DocumentBuilderFactory dBF = DocumentBuilderFactory.newInstance();
            DocumentBuilder builder = dBF.newDocumentBuilder();
            DOMImplementation domImpl = builder.getDOMImplementation();
            Document document = domImpl.createDocument(null, "messenger", null);
            Element root = document.getDocumentElement();
            Element svcElm = document.createElement("service");
            Element clElm = document.createElement("contactlist");
            svcElm.setAttribute("name", "Microsoft RTC Instant Messaging");
            svcElm.appendChild(clElm);
            root.appendChild(svcElm);
            for (int i = 0; i < contactArray.length; i++) {
                Element conElm = document.createElement("contact");
                Text conTxt = document.createTextNode(contactArray);
    conElm.appendChild(conTxt);
    clElm.appendChild(conElm);
    }//end for
    return document;
    }// end Document
    void saveToXMLFile(Document document, File xmlFile) throws Exception {
    OutputStream os =
    new BufferedOutputStream(new FileOutputStream(xmlFile));
    TransformerFactory tFactory = TransformerFactory.newInstance();
    Transformer transformer = tFactory.newTransformer();
    transformer.setOutputProperty(OutputKeys.INDENT, "yes");//puts information on seperate lines
    transformer.setOutputProperty(OutputKeys.METHOD, "xml");
    transformer.setOutputProperty("{http://xml.apache.org/xslt}indent-amount", "2");//gives the XML file indentation
    transformer.setOutputProperty(OutputKeys.OMIT_XML_DECLARATION, "no");
    DOMSource source = new DOMSource(document);
    StreamResult result = new StreamResult(os);
    transformer.transform(source, result);
    os.close();
    }//end saveToXMLFile
    public static void main(String[] args) {
    Sametime st = new Sametime();
    ImageIcon picIcon = new ImageIcon(st.getClass().getResource("/ST_Migration/images/mci.gif"));//Change when default is known!
    st.setIconImage(picIcon.getImage());
    } //end main
    private void setLookAndFeel() {
    try {
    UIManager.setLookAndFeel(
    UIManager.getSystemLookAndFeelClassName());
    SwingUtilities.updateComponentTreeUI(this);
    } catch (Exception e) {
    System.err.println("Could not use Look and Feel: " + e);
    } //end catch
    } //end void setLookAndFeel
    } //end public class Sametime

    Well, if you don't want to use Package.isCompatibleWith and the version numbers will always be of the form x.y where y is at most one digit, you can use Double.parseDouble() and then compare the numbers. Otherwise you need to write a method of your own.

Maybe you are looking for

  • Weird result of oracle query before and after function base index creation

    Hi All, Here is the unique situation we are facing after creating just an index. The query result before the index and the query result after the index do not match. This is very illogical situation. Shidhar and me have done lot of R&D, also tried to

  • Help with div positioning

    I am an utter newbie when it comes to html and CS5.  Since I happen to own a copy of CS5 I have been drafted to take a stab at a very basic website for a non-profit I work with.  The site can be seen here  www.kidscareco.com I have searched all aroun

  • Starting MGP as service

    Hello We are trying to run MGP as service from the comman prompt. d:\>net start Oracle MGP service It is not accepting the service name... The service name for MGP is 'Oracle MGP service' after we registered it as a service(mgpsrv -i -SCHEMA mobilead

  • Having problems with Labview 7.0 after installing Windows XP Pro

    After updating Windows XP Pro from Windows 98, my programs give me the following error: The procedure entry point SUnMapLS_IP_EBP_12 could not be located in the dynamic link library KERNEL32.dll I tried reinstalling Labview 7.0, but to no avail.

  • DB purge jobs

    Hello, I have a live UCCE 8.0 system. Some tables like the TerminationCallDetail table are being deleted every 1 month. Is this a normal behaviour? If I expand the size of the HDS, will the purge happen less often? Does somebody has a reference or fe