Package com.sun.star.container

Examples of com.sun.star.container.XNameAccess


            Object oDBForm = Helper.getUnoObjectbyName(xNamedForms, ReportWizard.SOREPORTFORMNAME);
            boolean bgetConnection;
            String sQueryName = "";
            if (oDBForm != null) {
                String sMsg = sMsgHiddenControlMissing + (char) 13 + sMsgEndAutopilot;
                XNameAccess xNamedForm = (XNameAccess) UnoRuntime.queryInterface(XNameAccess.class, oDBForm);
                CurReportDocument.CurDBMetaData.Command = CurReportDocument.oFormHandler.getValueofHiddenControl(xNamedForm, "Command", sMsg);
                String sCommandType = CurReportDocument.oFormHandler.getValueofHiddenControl(xNamedForm, "CommandType", sMsg);
                String sGroupFieldNames = CurReportDocument.oFormHandler.getValueofHiddenControl(xNamedForm, "GroupFieldNames", sMsg);
                String sFieldNames = CurReportDocument.oFormHandler.getValueofHiddenControl(xNamedForm, "FieldNames", sMsg);
                String sRecordFieldNames = CurReportDocument.oFormHandler.getValueofHiddenControl(xNamedForm, "RecordFieldNames", sMsg);
                if (xNamedForm.hasByName("QueryName"))
                    sQueryName = CurReportDocument.oFormHandler.getValueofHiddenControl(xNamedForm, "QueryName", sMsg);
    String[] sFieldNameList =  JavaTools.ArrayoutofString(sFieldNames, ";");
                CurReportDocument.CurDBMetaData.RecordFieldNames = JavaTools.ArrayoutofString(sRecordFieldNames, ";");
                CurReportDocument.CurDBMetaData.GroupFieldNames = JavaTools.ArrayoutofString(sGroupFieldNames, ";");
                CurReportDocument.CurDBMetaData.setCommandType(Integer.valueOf(sCommandType).intValue());
View Full Code Here


     * @return void.
     */
    public void setWizardTemplateDocInfo(String WizardName, String TemplateDescription) {
        try {
            Object uD = Configuration.getConfigurationRoot(xMSF, "/org.openoffice.UserProfile/Data", false);
            XNameAccess xNA = (XNameAccess) UnoRuntime.queryInterface(XNameAccess.class, uD);
            Object gn = xNA.getByName("givenname");
            Object sn = xNA.getByName("sn");
            String fullname = (String)gn + " " + (String)sn;

            Calendar cal = new GregorianCalendar();
            int year = cal.get(Calendar.YEAR);
            int month = cal.get(Calendar.MONTH);
View Full Code Here

                GlobalLogWriter.get().println("Can't get com.sun.star.document.FilterFactory.");
                return null;
            }
            if (aObj != null)
            {
                XNameAccess aNameAccess = (XNameAccess)UnoRuntime.queryInterface(XNameAccess.class, aObj);
                if (aNameAccess != null)
                {
                   
                    // if (_sFilterName.toLowerCase().equals("help"))
                    // {
                    //     System.out.println("Show all possible ElementNames from current version." );
                    // String[] aElementNames = aNameAccess.getElementNames();
                    // for (int i = 0; i<aElementNames.length; i++)
                    // {
                    //     System.out.println(aElementNames[i]);
                    // }
                    //     System.out.println("Must quit.");
                    //     System.out.exit(1);
                    // }
               
                    if (! aNameAccess.hasByName(_sFilterName))
                    {
                        GlobalLogWriter.get().println("FilterFactory.hasByName() says there exist no '" + _sFilterName + "'" );
                        return null;
                    }
                       
                    Object[] aElements = null;
                    String[] aExtensions;
                    try
                    {
                        aElements = (Object[]) aNameAccess.getByName(_sFilterName);
                        if (aElements != null)
                        {
                            String sInternalFilterName = null;
                            // System.out.println("getByName().length: " + String.valueOf(aElements.length));
                            for (int i=0;i<aElements.length; i++)
View Full Code Here

                GlobalLogWriter.get().println("Can't get com.sun.star.document.FilterFactory.");
                return null;
            }
            if (aObj != null)
            {
                XNameAccess aNameAccess = (XNameAccess)UnoRuntime.queryInterface(XNameAccess.class, aObj);
                if (aNameAccess != null)
                {                   
                    if (! aNameAccess.hasByName(_sFilterName))
                    {
                        GlobalLogWriter.get().println("FilterFactory.hasByName() says there exist no '" + _sFilterName + "'" );
                        return null;
                    }
                       
                    Object[] aElements = null;
                    String[] aExtensions;
                    try
                    {
                        aElements = (Object[]) aNameAccess.getByName(_sFilterName);
                        if (aElements != null)
                        {
                            String sServiceName = null;
                            // System.out.println("getByName().length: " + String.valueOf(aElements.length));
                            for (int i=0;i<aElements.length; i++)
View Full Code Here

                GlobalLogWriter.get().println("Can't get com.sun.star.document.TypeDetection.");
                return null;
            }
            if (aTypeDetection != null)
            {
                XNameAccess aNameAccess = (XNameAccess)UnoRuntime.queryInterface(XNameAccess.class, aTypeDetection);
                if (aNameAccess != null)
                {
                   
                    // System.out.println("Show ElementNames" );
                    // String[] aElementNames = aNameAccess.getElementNames();
                    // for (int i = 0; i<aElementNames.length; i++)
                    // {
                    //     System.out.println(aElementNames[i]);
                    // }
               
                    if (! aNameAccess.hasByName(_sInternalFilterName))
                    {
                        GlobalLogWriter.get().println("TypeDetection.hasByName() says there exist no '" + _sInternalFilterName + "'" );
                        return null;
                    }
                       
                    Object[] aElements = null;
                    String[] aExtensions;
                    try
                    {
                        aElements = (Object[]) aNameAccess.getByName(_sInternalFilterName);
                        if (aElements != null)
                        {
                            String sExtension = null;
                            // System.out.println("getByName().length: " + String.valueOf(aElements.length));
                            for (int i=0;i<aElements.length; i++)
View Full Code Here

      {
        m_aTestHelper.Error( "The result of clone is empty!" );
        return false;
      }

      XNameAccess xClonedNameAccess = (XNameAccess) UnoRuntime.queryInterface( XNameAccess.class, xClonedSubStorage );
      if ( xClonedNameAccess == null )
      {
        m_aTestHelper.Error( "XNameAccess is not implemented by the clone!" );
        return false;
      }

      if ( !m_aTestHelper.checkStorageProperties( xClonedSubStorage, "", true, ElementModes.WRITE ) )
        return false;

      if ( xClonedNameAccess.hasElements() )
      {
        m_aTestHelper.Error( "The new substorage still was not commited so it must be empty!" );
        return false;
      }
     
View Full Code Here

      {
        m_aTestHelper.Error( "The result of clone is empty!" );
        return false;
      }

      XNameAccess xClonedNameAccess = (XNameAccess) UnoRuntime.queryInterface( XNameAccess.class, xClonedSubStorage );
      if ( xClonedNameAccess == null )
      {
        m_aTestHelper.Error( "XNameAccess is not implemented by the clone!" );
        return false;
      }

      if ( !m_aTestHelper.checkStorageProperties( xClonedSubStorage, "", true, ElementModes.WRITE ) )
        return false;

      if ( xClonedNameAccess.hasElements() )
      {
        m_aTestHelper.Error( "The new substorage still was not commited so it must be empty!" );
        return false;
      }
     
      if ( !m_aTestHelper.disposeStorage( xClonedSubStorage ) )
        return false;

      xClonedSubStorage = null;
      xClonedNameAccess = null;

      // the new stream was opened, written and closed, that means flashed
      // so the clone must contain all the information
      XStream xClonedSubStream = m_aTestHelper.cloneSubStream( xTempStorage, "SubStream1" );
      if ( !m_aTestHelper.InternalCheckStream( xClonedSubStream, "SubStream1", "MediaType1", true, pBytes1, true ) )
        return false;

      if ( !m_aTestHelper.disposeStream( xClonedSubStream, "SubStream1" ) )
        return false;

      // ==============================
      // commit substorage and check cloning
      // ==============================

      if ( !m_aTestHelper.commitStorage( xTempSubStorage ) )
        return false;

      xClonedSubStorage = m_aTestHelper.cloneSubStorage( m_xStorageFactory, xTempStorage, "SubStorage1" );
      if ( xClonedSubStorage == null )
      {
        m_aTestHelper.Error( "The result of clone is empty!" );
        return false;
      }

      if ( !m_aTestHelper.checkStorageProperties( xClonedSubStorage, "MediaType4", true, ElementModes.WRITE ) )
        return false;

      if ( !m_aTestHelper.checkStream( xClonedSubStorage, "SubStream2", "MediaType2", true, pBytes2 ) )
        return false;

      XStorage xCloneOfRoot = m_aTestHelper.cloneStorage( m_xStorageFactory, xTempStorage );
      if ( xCloneOfRoot == null )
      {
        m_aTestHelper.Error( "The result of root clone is empty!" );
        return false;
      }

      XNameAccess xCloneOfRootNA = (XNameAccess) UnoRuntime.queryInterface( XNameAccess.class, xCloneOfRoot );
      if ( xCloneOfRootNA == null )
      {
        m_aTestHelper.Error( "XNameAccess is not implemented by the root clone!" );
        return false;
      }

      if ( xCloneOfRootNA.hasElements() )
      {
        m_aTestHelper.Error( "The root storage still was not commited so it's clone must be empty!" );
        return false;
      }
     
View Full Code Here

      if ( !m_aTestHelper.removeElement( xResStorage, "SubStorage2" ) )
        return false;
       
      try
      {
        XNameAccess xResAccess = (XNameAccess) UnoRuntime.queryInterface( XNameAccess.class, xResStorage );
        if ( xResAccess.hasByName( "SubStorage2" ) )
          m_aTestHelper.Error( "SubStorage2 must be removed already!" );
      }
      catch( Exception e )
      {
        m_aTestHelper.Error( "Can't get access to root storage, exception: " + e );
View Full Code Here

    public void test(){
        mThreadTimeOut = 10000000;
        XDataSource ds = null;
        System.gc();
        try {
            XNameAccess xNameAccess = (XNameAccess)UnoRuntime.queryInterface(XNameAccess.class,((XMultiServiceFactory)param.getMSF()).createInstance("com.sun.star.sdb.DatabaseContext"));
            ds = (XDataSource)UnoRuntime.queryInterface(XDataSource.class,xNameAccess.getByName("file:///g:/test.odb"));
        } catch(Exception ex) {
                throw new RuntimeException("factory: unable to construct data source" );
        }
       
        try{
View Full Code Here

        // get page styles
        XStyleFamiliesSupplier StyleFam = (XStyleFamiliesSupplier)
            UnoRuntime.queryInterface(
                XStyleFamiliesSupplier.class,
                xSpreadsheetDoc );
        XNameAccess StyleFamNames = StyleFam.getStyleFamilies();
        XStyle StdStyle = null;

        try{
            Object o = StyleFamNames.getByName("PageStyles");
            XNameAccess PageStyles = (XNameAccess)AnyConverter.toObject(
                            new com.sun.star.uno.Type(XNameAccess.class), o);

            o = PageStyles.getByName("Default");
            StdStyle = (XStyle)AnyConverter.toObject(
                            new com.sun.star.uno.Type(XStyle.class), o);
        } catch(com.sun.star.lang.IllegalArgumentException e) {
            failed(e.getMessage());
        } catch(com.sun.star.lang.WrappedTargetException e){
View Full Code Here

TOP

Related Classes of com.sun.star.container.XNameAccess

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.