Package com.sun.star.task

Examples of com.sun.star.task.XMasterPasswordHandling


            Object oPasswordContainer = m_xMSF.createInstance("com.sun.star.task.PasswordContainer");
            XPasswordContainer xContainer = (XPasswordContainer)UnoRuntime.queryInterface(XPasswordContainer.class, oPasswordContainer);
            Object oHandler = m_xMSF.createInstance("com.sun.star.task.InteractionHandler");
            XInteractionHandler xHandler = (XInteractionHandler)UnoRuntime.queryInterface(XInteractionHandler.class, oHandler);
            MasterPasswdHandler aMHandler = new MasterPasswdHandler(xHandler);
            XMasterPasswordHandling xMHandling = (XMasterPasswordHandling)UnoRuntime.queryInterface(XMasterPasswordHandling.class, oPasswordContainer);
           
            // allow the storing of the passwords
            xMHandling.allowPersistentStoring(true);
           
            // add a set of users and passwords for the same URL persistently
            for(int i = 0; i < iUserNum1; ++i) {
                xContainer.addPersistent(sURL, aInputUserList1[i].UserName, aInputUserList1[i].Passwords, aMHandler);
            }
            for(int i = 0; i < iUserNum2; ++i) {
                xContainer.addPersistent(sURL, aInputUserList2[i].UserName, aInputUserList2[i].Passwords, aMHandler);
            }
           
            // remove some of the passwords
            for(int i = 0; i < iUserNum1; ++i) {
                xContainer.remove(sURL, aInputUserList1[i].UserName);
            }
           
            // get the result with find() and check it with the expected one
            UrlRecord aRecord = xContainer.find(sURL, aMHandler);
            if(!aRecord.Url.equals(sURL)) {
                m_aTestHelper.Error("URL mismatch. Got " + aRecord.Url + "; should be " + sURL);
                return false;
            }
            if(!m_aTestHelper.sameLists(aRecord.UserList, aInputUserList2)) {
                m_aTestHelper.Error("User list is not the expected");
                return false;
            }
           
            // get the result with getAllPersistent() and check
            UrlRecord aRecords[] = xContainer.getAllPersistent(aMHandler);
            if(!aRecords[0].Url.equals(sURL)) {
                m_aTestHelper.Error("URL mismatch");
                return false;
            }
            if(!m_aTestHelper.sameLists(aRecords[0].UserList, aInputUserList2)) {
                m_aTestHelper.Error("User list is not the expected");
                return false;
            }
           
            // remove all the persistent passwords
            xContainer.removeAllPersistent();
           
            // remove the runtime passwords
            for(int i = 0; i < aRecords[0].UserList.length; ++i) {
                xContainer.remove(sURL, aRecords[0].UserList[i].UserName);
            }
           
            // disallow the storing of the passwords
            xMHandling.allowPersistentStoring(false);
        } catch(Exception e) {
            m_aTestHelper.Error("Exception: " + e);
            return false;
        }
        return true;
View Full Code Here


            Object oPasswordContainer = m_xMSF.createInstance("com.sun.star.task.PasswordContainer");
            XPasswordContainer xContainer = (XPasswordContainer)UnoRuntime.queryInterface(XPasswordContainer.class, oPasswordContainer);
            Object oHandler = m_xMSF.createInstance("com.sun.star.task.InteractionHandler");
            XInteractionHandler xHandler = (XInteractionHandler)UnoRuntime.queryInterface(XInteractionHandler.class, oHandler);
            MasterPasswdHandler aMHandler = new MasterPasswdHandler(xHandler);
            XMasterPasswordHandling xMHandling = (XMasterPasswordHandling)UnoRuntime.queryInterface(XMasterPasswordHandling.class, oPasswordContainer);
           
            // allow the storing of the passwords
            xMHandling.allowPersistentStoring(true);
           
            // add a set of users and passwords for the same URL persistently
            for(int i = 0; i < iPersistentUserNum; i++) {
                xContainer.addPersistent(sURL, aInputUserList[i].UserName, aInputUserList[i].Passwords, aMHandler);
            }
           
            // add a set of users and passwords for the same URL for runtime
            for(int i = 0; i < iRuntimeUserNum; i++) {
                xContainer.add(sURL, aInputUserList[i+iPersistentUserNum].UserName, aInputUserList[i+iPersistentUserNum].Passwords, aMHandler);
            }
           
            // get the result for the URL and check that it contains persistent and runtime passwords
            UrlRecord aRecord = xContainer.find(sURL, aMHandler);
            if(!aRecord.Url.equals(sURL)) {
                m_aTestHelper.Error("URL mismatch. Got " + aRecord.Url + "; should be " + sURL);
                return false;
            }
            if(!m_aTestHelper.sameLists(aRecord.UserList, aInputUserList)) {
                m_aTestHelper.Error("User list is not the expected");
                return false;
            }
           
            // remove all the persistent passwords
            xContainer.removeAllPersistent();
           
             // remove the runtime passwords
            aRecord = xContainer.find(sURL, aMHandler);
            for(int i = 0; i < aRecord.UserList.length; i++) {
                xContainer.remove(sURL, aRecord.UserList[i].UserName);
            }
           
            // disallow the storing of the passwords
            xMHandling.allowPersistentStoring(false);
        }catch(Exception e){
            m_aTestHelper.Error("Exception: " + e);
            return false;
        }
        return true;
View Full Code Here

    protected static boolean PasswordStoringIsAllowed( XComponentContext xContext )
    {
        boolean bResult = false;
        try
        {
            XMasterPasswordHandling xMasterHdl = (XMasterPasswordHandling)UnoRuntime.queryInterface( XMasterPasswordHandling.class, GetPasswordContainer( xContext ) );
            if ( xMasterHdl != null )
                bResult = xMasterHdl.isPersistentStoringAllowed();
        }
        catch( Exception e )
        {
            e.printStackTrace();
        }
View Full Code Here

    protected static boolean PasswordStoringIsAllowed( XComponentContext xContext )
    {
        boolean bResult = false;
        try
        {
            XMasterPasswordHandling xMasterHdl = (XMasterPasswordHandling)UnoRuntime.queryInterface( XMasterPasswordHandling.class, GetPasswordContainer( xContext ) );
            if ( xMasterHdl != null )
                bResult = xMasterHdl.isPersistentStoringAllowed();
        }
        catch( Exception e )
        {
            e.printStackTrace();
        }
View Full Code Here

    protected static boolean PasswordStoringIsAllowed( XComponentContext xContext )
    {
        boolean bResult = false;
        try
        {
            XMasterPasswordHandling xMasterHdl = (XMasterPasswordHandling)UnoRuntime.queryInterface( XMasterPasswordHandling.class, GetPasswordContainer( xContext ) );
            if ( xMasterHdl != null )
                bResult = xMasterHdl.isPersistentStoringAllowed();
        }
        catch( Exception e )
        {
            e.printStackTrace();
        }
View Full Code Here

    protected static boolean PasswordStoringIsAllowed( XComponentContext xContext )
    {
        boolean bResult = false;
        try
        {
            XMasterPasswordHandling xMasterHdl = (XMasterPasswordHandling)UnoRuntime.queryInterface( XMasterPasswordHandling.class, GetPasswordContainer( xContext ) );
            if ( xMasterHdl != null )
                bResult = xMasterHdl.isPersistentStoringAllowed();
        }
        catch( Exception e )
        {
            e.printStackTrace();
        }
View Full Code Here

            Object oPasswordContainer = m_xMSF.createInstance("com.sun.star.task.PasswordContainer");
            XPasswordContainer xContainer = UnoRuntime.queryInterface(XPasswordContainer.class, oPasswordContainer);
            Object oHandler = m_xMSF.createInstance("com.sun.star.task.InteractionHandler");
            XInteractionHandler xHandler = UnoRuntime.queryInterface(XInteractionHandler.class, oHandler);
            MasterPasswdHandler aMHandler = new MasterPasswdHandler(xHandler);
            XMasterPasswordHandling xMHandling = UnoRuntime.queryInterface(XMasterPasswordHandling.class, oPasswordContainer);
           
            // allow the storing of the passwords
            xMHandling.allowPersistentStoring(true);
           
            // add a set of users and passwords for the same URL persistently
            for(int i = 0; i < iUserNum1; ++i) {
                xContainer.addPersistent(sURL, aInputUserList1[i].UserName, aInputUserList1[i].Passwords, aMHandler);
            }
            for(int i = 0; i < iUserNum2; ++i) {
                xContainer.addPersistent(sURL, aInputUserList2[i].UserName, aInputUserList2[i].Passwords, aMHandler);
            }
           
            // remove some of the passwords
            for(int i = 0; i < iUserNum1; ++i) {
                xContainer.remove(sURL, aInputUserList1[i].UserName);
            }
           
            // get the result with find() and check it with the expected one
            UrlRecord aRecord = xContainer.find(sURL, aMHandler);
            if(!aRecord.Url.equals(sURL)) {
                m_aTestHelper.Error("URL mismatch. Got " + aRecord.Url + "; should be " + sURL);
                return false;
            }
            if(!m_aTestHelper.sameLists(aRecord.UserList, aInputUserList2)) {
                m_aTestHelper.Error("User list is not the expected");
                return false;
            }
           
            // get the result with getAllPersistent() and check
            UrlRecord aRecords[] = xContainer.getAllPersistent(aMHandler);
            if(!aRecords[0].Url.equals(sURL)) {
                m_aTestHelper.Error("URL mismatch");
                return false;
            }
            if(!m_aTestHelper.sameLists(aRecords[0].UserList, aInputUserList2)) {
                m_aTestHelper.Error("User list is not the expected");
                return false;
            }
           
            // remove all the persistent passwords
            xContainer.removeAllPersistent();
           
            // remove the runtime passwords
            for(int i = 0; i < aRecords[0].UserList.length; ++i) {
                xContainer.remove(sURL, aRecords[0].UserList[i].UserName);
            }
           
            // disallow the storing of the passwords
            xMHandling.allowPersistentStoring(false);
        } catch(Exception e) {
            m_aTestHelper.Error("Exception: " + e);
            return false;
        }
        return true;
View Full Code Here

            Object oPasswordContainer = m_xMSF.createInstance("com.sun.star.task.PasswordContainer");
            XPasswordContainer xContainer = UnoRuntime.queryInterface(XPasswordContainer.class, oPasswordContainer);
            Object oHandler = m_xMSF.createInstance("com.sun.star.task.InteractionHandler");
            XInteractionHandler xHandler = UnoRuntime.queryInterface(XInteractionHandler.class, oHandler);
            MasterPasswdHandler aMHandler = new MasterPasswdHandler(xHandler);
            XMasterPasswordHandling xMHandling = UnoRuntime.queryInterface(XMasterPasswordHandling.class, oPasswordContainer);
           
            // allow the storing of the passwords
            xMHandling.allowPersistentStoring(true);
           
            // add a set of users and passwords for the same URL persistently
            for(int i = 0; i < iPersistentUserNum; i++) {
                xContainer.addPersistent(sURL, aInputUserList[i].UserName, aInputUserList[i].Passwords, aMHandler);
            }
           
            // add a set of users and passwords for the same URL for runtime
            for(int i = 0; i < iRuntimeUserNum; i++) {
                xContainer.add(sURL, aInputUserList[i+iPersistentUserNum].UserName, aInputUserList[i+iPersistentUserNum].Passwords, aMHandler);
            }
           
            // get the result for the URL and check that it contains persistent and runtime passwords
            UrlRecord aRecord = xContainer.find(sURL, aMHandler);
            if(!aRecord.Url.equals(sURL)) {
                m_aTestHelper.Error("URL mismatch. Got " + aRecord.Url + "; should be " + sURL);
                return false;
            }
            if(!m_aTestHelper.sameLists(aRecord.UserList, aInputUserList)) {
                m_aTestHelper.Error("User list is not the expected");
                return false;
            }
           
            // remove all the persistent passwords
            xContainer.removeAllPersistent();
           
             // remove the runtime passwords
            aRecord = xContainer.find(sURL, aMHandler);
            for(int i = 0; i < aRecord.UserList.length; i++) {
                xContainer.remove(sURL, aRecord.UserList[i].UserName);
            }
           
            // disallow the storing of the passwords
            xMHandling.allowPersistentStoring(false);
        }catch(Exception e){
            m_aTestHelper.Error("Exception: " + e);
            return false;
        }
        return true;
View Full Code Here

            Object oPasswordContainer = m_xMSF.createInstance("com.sun.star.task.PasswordContainer");
            XPasswordContainer xContainer = (XPasswordContainer)UnoRuntime.queryInterface(XPasswordContainer.class, oPasswordContainer);
            Object oHandler = m_xMSF.createInstance("com.sun.star.task.InteractionHandler");
            XInteractionHandler xHandler = (XInteractionHandler)UnoRuntime.queryInterface(XInteractionHandler.class, oHandler);
            MasterPasswdHandler aMHandler = new MasterPasswdHandler(xHandler);
            XMasterPasswordHandling xMHandling = (XMasterPasswordHandling)UnoRuntime.queryInterface(XMasterPasswordHandling.class, oPasswordContainer);
           
            // allow the storing of the passwords
            xMHandling.allowPersistentStoring(true);
           
            // add a set of users and passwords for the same URL persistently
            for(int i = 0; i < iPersistentUserNum; i++) {
                xContainer.addPersistent(sURL, aInputUserList[i].UserName, aInputUserList[i].Passwords, aMHandler);
            }
           
            // add a set of users and passwords for the same URL for runtime
            for(int i = 0; i < iRuntimeUserNum; i++) {
                xContainer.add(sURL, aInputUserList[i+iPersistentUserNum].UserName, aInputUserList[i+iPersistentUserNum].Passwords, aMHandler);
            }
           
            // get the result for the URL and check that it contains persistent and runtime passwords
            UrlRecord aRecord = xContainer.find(sURL, aMHandler);
            if(!aRecord.Url.equals(sURL)) {
                m_aTestHelper.Error("URL mismatch. Got " + aRecord.Url + "; should be " + sURL);
                return false;
            }
            if(!m_aTestHelper.sameLists(aRecord.UserList, aInputUserList)) {
                m_aTestHelper.Error("User list is not the expected");
                return false;
            }
           
            // remove all the persistent passwords
            xContainer.removeAllPersistent();
           
             // remove the runtime passwords
            aRecord = xContainer.find(sURL, aMHandler);
            for(int i = 0; i < aRecord.UserList.length; i++) {
                xContainer.remove(sURL, aRecord.UserList[i].UserName);
            }
           
            // disallow the storing of the passwords
            xMHandling.allowPersistentStoring(false);
        }catch(Exception e){
            m_aTestHelper.Error("Exception: " + e);
            return false;
        }
        return true;
View Full Code Here

            Object oPasswordContainer = m_xMSF.createInstance("com.sun.star.task.PasswordContainer");
            XPasswordContainer xContainer = (XPasswordContainer)UnoRuntime.queryInterface(XPasswordContainer.class, oPasswordContainer);
            Object oHandler = m_xMSF.createInstance("com.sun.star.task.InteractionHandler");
            XInteractionHandler xHandler = (XInteractionHandler)UnoRuntime.queryInterface(XInteractionHandler.class, oHandler);
            MasterPasswdHandler aMHandler = new MasterPasswdHandler(xHandler);
            XMasterPasswordHandling xMHandling = (XMasterPasswordHandling)UnoRuntime.queryInterface(XMasterPasswordHandling.class, oPasswordContainer);
           
            // allow the storing of the passwords
            xMHandling.allowPersistentStoring(true);
           
            // add a set of users and passwords for the same URL persistently
            for(int i = 0; i < iUserNum1; ++i) {
                xContainer.addPersistent(sURL, aInputUserList1[i].UserName, aInputUserList1[i].Passwords, aMHandler);
            }
            for(int i = 0; i < iUserNum2; ++i) {
                xContainer.addPersistent(sURL, aInputUserList2[i].UserName, aInputUserList2[i].Passwords, aMHandler);
            }
           
            // remove some of the passwords
            for(int i = 0; i < iUserNum1; ++i) {
                xContainer.remove(sURL, aInputUserList1[i].UserName);
            }
           
            // get the result with find() and check it with the expected one
            UrlRecord aRecord = xContainer.find(sURL, aMHandler);
            if(!aRecord.Url.equals(sURL)) {
                m_aTestHelper.Error("URL mismatch. Got " + aRecord.Url + "; should be " + sURL);
                return false;
            }
            if(!m_aTestHelper.sameLists(aRecord.UserList, aInputUserList2)) {
                m_aTestHelper.Error("User list is not the expected");
                return false;
            }
           
            // get the result with getAllPersistent() and check
            UrlRecord aRecords[] = xContainer.getAllPersistent(aMHandler);
            if(!aRecords[0].Url.equals(sURL)) {
                m_aTestHelper.Error("URL mismatch");
                return false;
            }
            if(!m_aTestHelper.sameLists(aRecords[0].UserList, aInputUserList2)) {
                m_aTestHelper.Error("User list is not the expected");
                return false;
            }
           
            // remove all the persistent passwords
            xContainer.removeAllPersistent();
           
            // remove the runtime passwords
            for(int i = 0; i < aRecords[0].UserList.length; ++i) {
                xContainer.remove(sURL, aRecords[0].UserList[i].UserName);
            }
           
            // disallow the storing of the passwords
            xMHandling.allowPersistentStoring(false);
        } catch(Exception e) {
            m_aTestHelper.Error("Exception: " + e);
            return false;
        }
        return true;
View Full Code Here

TOP

Related Classes of com.sun.star.task.XMasterPasswordHandling

Copyright © 2018 www.massapicom. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.