IdentifiantMot de passe
Loading...
Mot de passe oublié ?Je m'inscris ! (gratuit)
Navigation

Inscrivez-vous gratuitement
pour pouvoir participer, suivre les réponses en temps réel, voter pour les messages, poser vos propres questions et recevoir la newsletter

Documents Java Discussion :

[UNO] (open office) quelqu'un connait ?


Sujet :

Documents Java

  1. #1
    Nouveau membre du Club

    Profil pro
    Étudiant
    Inscrit en
    Mai 2006
    Messages
    36
    Détails du profil
    Informations personnelles :
    Localisation : France

    Informations professionnelles :
    Activité : Étudiant

    Informations forums :
    Inscription : Mai 2006
    Messages : 36
    Points : 29
    Points
    29
    Par défaut [UNO] (open office) quelqu'un connait ?
    Bonjour à tous !

    s'il vous plait, aidez-moi !!!!

    je cherche à manipuler des fichier sous open office writer en manipulant ce dernier en Java !

    quelqu'un a déjà développé avec UNO ???

  2. #2
    Expert éminent sénior
    Avatar de adiGuba
    Homme Profil pro
    Développeur Java/Web
    Inscrit en
    Avril 2002
    Messages
    13 938
    Détails du profil
    Informations personnelles :
    Sexe : Homme
    Localisation : France

    Informations professionnelles :
    Activité : Développeur Java/Web
    Secteur : Transports

    Informations forums :
    Inscription : Avril 2002
    Messages : 13 938
    Points : 23 190
    Points
    23 190
    Billets dans le blog
    1
    Par défaut
    Salut,


    Il faut se plonger dans la doc : http://udk.openoffice.org/
    C'est ca aussi le boulot de developpeur

    a++

  3. #3
    Membre régulier
    Inscrit en
    Décembre 2005
    Messages
    117
    Détails du profil
    Informations forums :
    Inscription : Décembre 2005
    Messages : 117
    Points : 109
    Points
    109
    Par défaut
    Salut! oui, ça fait un peu peur à première vue, mais c pas compliqué, va jetter un coup d'oeil ici:

    http://api.openoffice.org/docs/Devel...UNO+Components

  4. #4
    Nouveau membre du Club

    Profil pro
    Étudiant
    Inscrit en
    Mai 2006
    Messages
    36
    Détails du profil
    Informations personnelles :
    Localisation : France

    Informations professionnelles :
    Activité : Étudiant

    Informations forums :
    Inscription : Mai 2006
    Messages : 36
    Points : 29
    Points
    29
    Par défaut
    le truc c'est que ça fait plus d'une semaine que je cherche dedans mais je voudrait tous simplement ouvrir l'appli, c'est pour le moment la seule chose qui me coince..
    la manipulation des objets, je pense pouvoir me débrouiller
    mais pour ouvrir un fichier existant dans Open office, avec la fenêtre ouverte... quelqu'un a fait ???

  5. #5
    Nouveau membre du Club

    Profil pro
    Étudiant
    Inscrit en
    Mai 2006
    Messages
    36
    Détails du profil
    Informations personnelles :
    Localisation : France

    Informations professionnelles :
    Activité : Étudiant

    Informations forums :
    Inscription : Mai 2006
    Messages : 36
    Points : 29
    Points
    29
    Par défaut
    N'import quel programme que je lance, comme celui ci qui est dans le Developers Guide :

    Code : Sélectionner tout - Visualiser dans une fenêtre à part
    1
    2
    3
    4
    5
    6
    7
    8
    9
    10
    11
    12
    13
    14
    15
    16
    17
    18
    19
    20
    21
    22
    23
    24
     
    public class FirstunoContact 
    {
    	public static void main(String[] args) 
    	{
    		try 
    		{
    			//	 get the remote office component context
    			com.sun.star.uno.XComponentContext xContext = com.sun.star.comp.helper.Bootstrap.bootstrap();
    			System.out.println("Connected to a running office ...");
    			com.sun.star.lang.XMultiComponentFactory xMCF =	xContext.getServiceManager();
    			String available = (xMCF != null ? "available" : "not available");
    			System.out.println( "remote ServiceManager is " + available );
    		}
    		catch (java.lang.Exception e)
    		{
    			e.printStackTrace();
    		}
    		finally 
    		{
    			System.exit(0);
    		}
    	}
    }
    j'ai un message qui apparait :

    "Missing vcl ressource. This indicates that files vital to localization are missing. You might have a corrupt installation."

    j'ai déja désinstaller et même répérer OOo ...

    quelqu'un a déjà rencontrer ce problème ???

  6. #6
    Membre habitué Avatar de Oui-Oui MB
    Homme Profil pro
    Architecte technique
    Inscrit en
    Avril 2005
    Messages
    111
    Détails du profil
    Informations personnelles :
    Sexe : Homme
    Âge : 40
    Localisation : Belgique

    Informations professionnelles :
    Activité : Architecte technique

    Informations forums :
    Inscription : Avril 2005
    Messages : 111
    Points : 127
    Points
    127
    Par défaut
    Salut !

    As-tu vu ce post ?

  7. #7
    Nouveau membre du Club

    Profil pro
    Étudiant
    Inscrit en
    Mai 2006
    Messages
    36
    Détails du profil
    Informations personnelles :
    Localisation : France

    Informations professionnelles :
    Activité : Étudiant

    Informations forums :
    Inscription : Mai 2006
    Messages : 36
    Points : 29
    Points
    29
    Par défaut
    oui, j'ai lu ce post...

    j'ai trouvé mon problème, je n'utilisais pas les bons fichiers jar : ceux à utiliser sont dans le dossier :
    C:\Program Files\OpenOffice.org 2.0\program\classes\

    il faut importer juh.jar, jurt.jar, unoil.jar, et ridl.jar

    Mais j'ai tout de même un petit problème :
    je souhaiterais pouvoir ouvrir un document exitant, en entrant son chemin
    mais la seule chose que je parviens à faire c'est d'ouvrir un nouveau document vierge.

    voici le code

    Code : Sélectionner tout - Visualiser dans une fenêtre à part
    1
    2
    3
    4
    5
    6
    7
    8
    9
    10
    11
    12
    13
    14
    15
    16
    17
    18
    19
    20
    21
    22
    23
    24
    25
    26
    27
    28
    29
    30
    31
    32
    33
    34
    35
    36
    37
    38
    39
    40
    41
    42
    43
    44
    45
    46
    47
    48
    49
    50
    51
    52
    53
    54
    55
    56
    57
    58
    59
    60
    61
    62
    63
    64
    65
    66
    67
    68
    69
    70
    71
    72
    73
    74
    75
    76
    77
    78
    79
    80
    81
    82
    83
    84
    85
    86
    87
    88
    89
    90
    91
    92
    93
    94
    95
     
     
    /*************************************************************************
    * 
    *                                       Ouvrir un document OpenOffice Writer 
    *     
    *************************************************************************/
     
    import com.sun.star.lang.XComponent;
    import com.sun.star.uno.XComponentContext;
    import com.sun.star.uno.UnoRuntime;
    import com.sun.star.frame.XComponentLoader;
    import com.sun.star.lang.XMultiComponentFactory;
    import com.sun.star.beans.PropertyValue;
     
    public class testSimple 
    {
     
       private XComponentContext xRemoteContext = null;
       private XMultiComponentFactory xRemoteServiceManager = null;
     
       /** crée une nouvelle instance de testSimple */
       public testSimple() 
       {}
     
       /**
        * @param args the command line arguments
        */
       public static void main(String[] args) 
       {
           testSimple test = new testSimple();
           try 
           {
               test.useDocuments();
           }
           catch (java.lang.Exception e)
           {
               System.err.println(e.getMessage());
               e.printStackTrace();
           }
           finally 
           {
               System.exit(0);
           }
       }
     
       protected void useDocuments() throws java.lang.Exception  
       {
           useWriter();
       }
     
       protected void useWriter() throws java.lang.Exception {
           try 
           {
               // create new writer document and get text, then manipulate text
               XComponent xWriterComponent = newDocComponent("swriter");
           }
           catch( com.sun.star.lang.DisposedException e ) 
           {
        	   //works from Patch 1
               xRemoteContext = null;
               throw e;
           }
       }
     
       protected XComponent newDocComponent(String docType) throws java.lang.Exception {
           String loadUrl = "private:factory/" + docType;
           xRemoteServiceManager = this.getRemoteServiceManager();
           Object desktop = xRemoteServiceManager.createInstanceWithContext("com.sun.star.frame.Desktop", xRemoteContext);
           XComponentLoader xComponentLoader = (XComponentLoader)UnoRuntime.queryInterface(XComponentLoader.class, desktop);
    //     the boolean property Hidden tells the office to open a file in hidden mode
           PropertyValue[] loadProps = new PropertyValue[1];
           loadProps[0] = new PropertyValue();
           return xComponentLoader.loadComponentFromURL(loadUrl, "_blank", 0, loadProps);
       }
     
       protected XMultiComponentFactory getRemoteServiceManager() throws java.lang.Exception {
           if (xRemoteContext == null && xRemoteServiceManager == null) 
           {
               try 
               {
                   // First step: get the remote office component context
                   xRemoteContext = com.sun.star.comp.helper.Bootstrap.bootstrap();
                   System.out.println("Connected to a running office ...");
     
                   xRemoteServiceManager = xRemoteContext.getServiceManager();
               }
               catch( Exception e) {
                   e.printStackTrace();
                   System.exit(1);
               }            
           }
           return xRemoteServiceManager;
       }
    }
    je voudrais pouvoir ouvrir mon fichier, soit directement, soit depuis la fenêtre ouverte...

    Quelqu'un a une piste ???

Discussions similaires

  1. Réponses: 4
    Dernier message: 15/05/2008, 17h28
  2. [Tableur Open Office] Protection de cellule
    Par LDS45 dans le forum Autres langages
    Réponses: 1
    Dernier message: 06/06/2005, 17h14
  3. Quelqu'un connait un bon logiciel?
    Par sekiryou dans le forum Applications et environnements graphiques
    Réponses: 3
    Dernier message: 17/05/2005, 20h40
  4. Pilotage Open Office
    Par LitteulKevin dans le forum Autres éditeurs
    Réponses: 5
    Dernier message: 15/09/2004, 14h03
  5. Quelqu'un connait PROGRESS?
    Par sandrine dans le forum Autres SGBD
    Réponses: 23
    Dernier message: 07/05/2004, 11h29

Partager

Partager
  • Envoyer la discussion sur Viadeo
  • Envoyer la discussion sur Twitter
  • Envoyer la discussion sur Google
  • Envoyer la discussion sur Facebook
  • Envoyer la discussion sur Digg
  • Envoyer la discussion sur Delicious
  • Envoyer la discussion sur MySpace
  • Envoyer la discussion sur Yahoo