Re: Fwd: Re: Ask for help, Young developer request

2015-02-26 Thread Bartłomiej Mikos PrimeSoft Polska
I tried any value to not invoke warn window, it not helps. Maybe it is 
my foult wchile loading service manager?.


It is like this:
xLocalContext = BootstrapSocketConnector
.bootstrap(C:\\Program Files (x86)\\LibreOffice 
4\\program\\soffice.exe);

xLocalServiceManager = xLocalContext.getServiceManager();
urlResolver = xLocalServiceManager.createInstanceWithContext(
com.sun.star.bridge.UnoUrlResolver, xLocalContext);
xUnoUrlResolver = (XUnoUrlResolver) UnoRuntime.queryInterface(
XUnoUrlResolver.class, urlResolver);
initialObject = xUnoUrlResolver
.resolve(uno:socket,host=localhost,port=8100;urp;StarOffice.ServiceManager);
XPropertySet xPropertySet = (XPropertySet) 
UnoRuntime.queryInterface(

XPropertySet.class, initialObject);
defaultRemoteContext = 
xPropertySet.getPropertyValue(DefaultContext);

xRemoteContext = (XComponentContext) UnoRuntime.queryInterface(
XComponentContext.class, defaultRemoteContext);
xRemoteServiceManager = xRemoteContext.getServiceManager();
desktop = xRemoteServiceManager.createInstanceWithContext(
com.sun.star.frame.Desktop, xRemoteContext);

and load component like this:
xComponentLoader = UnoRuntime.queryInterface(
XComponentLoader.class, desktop);
xComponent = xComponentLoader.loadComponentFromURL(
sourceURL, _blank, 0, properties);

In initialization of service in java console appears:
CE Warning: -nologo is deprecated.  Use --nologo instead.
CE Warning: -nodefault is deprecated.  Use --nodefault instead.
CE Warning: -norestore is deprecated.  Use --norestore instead.
CE Warning: -nolockcheck is deprecated.  Use --nolockcheck instead.
CE Warning: -accept=socket,host=localhost,port=8100;urp; is 
deprecated.  Use --accept=socket,host=localhost,port=8100;urp; instead.


It can be bug or it can be some king of old initialization from my side. 
Is another correct way to load service and not see this warnings?. (I 
wont use it from java code, not from system script)


W dniu 2015-02-25 o 17:58, Michael Stahl pisze:

On 25.02.2015 09:46, Bartłomiej Mikos PrimeSoft Polska wrote:

Good morning,

I solved the problem. I thougth than UpdateDocMode.NEVER_UPDATE will set
up loading without warning. It is not true, the problem solved set libre
office by hand in options - set update document from on request to
never update. It solving the problem. I thinking now why UpdateDocMode
property not working and how set Never Update documents from code (its
not good idea to setting libre office conf by hand :D).
 PropertyValue[] properties = new PropertyValue[3];

 properties[0] = getHiddenProperty();

 properties[1] = new PropertyValue();
 properties[1].Name = UpdateDocMode;
 properties[1].Value = new Short((short) 1);

which values did you try? 1 is QUIET_UPDATE which *does* update if that
is possible without asking information from user.

did you try NO_UPDATE = 0 too?  if that would also update links then
that would clearly be a bug.




Z poważaniem,
Bartłomiej Mikos
--
Bartłomiej Mikos
software engineer
bartlomiej.mi...@primesoft.pl mailto:bartlomiej.mi...@primesoft.pl
www.primesoft.pl http://www.primesoft.pl

PrimeSoft Polska Sp. z o.o.
ul. Perkuna 25, 61-615 Poznań tel/fax 61/833-17-72
NIP 7831592998 Regon 634610845 KRS 221565 Kapitał zakł. 5pln
NORDEA Bank Polska S.A. PL 50 1440 1130   0336 0806

*Dla Państwa już od 10 lat*
Dnia 25 września 2014 roku odbyła się konferencja 10-lecie PrimeSoft 
Polska: okiem klienta, okiem dostawcy – wymiana doświadczeń 
biznesowych. W wydarzeniu wzięli udział przedstawiciele firm i 
instytucji będących klientami oraz partnerami biznesowymi PrimeSoft 
Polska. Relacja z wydarzenia http://www.youtube.com/watch?v=FjsrjSmaNaQ


___
LibreOffice mailing list
LibreOffice@lists.freedesktop.org
http://lists.freedesktop.org/mailman/listinfo/libreoffice


Re: Fwd: Re: Ask for help, Young developer request

2015-02-25 Thread Michael Stahl
On 25.02.2015 09:46, Bartłomiej Mikos PrimeSoft Polska wrote:
 Good morning,
 
 I solved the problem. I thougth than UpdateDocMode.NEVER_UPDATE will set
 up loading without warning. It is not true, the problem solved set libre
 office by hand in options - set update document from on request to
 never update. It solving the problem. I thinking now why UpdateDocMode
 property not working and how set Never Update documents from code (its
 not good idea to setting libre office conf by hand :D).

 PropertyValue[] properties = new PropertyValue[3];
 
 properties[0] = getHiddenProperty();
 
 properties[1] = new PropertyValue();
 properties[1].Name = UpdateDocMode;
 properties[1].Value = new Short((short) 1);

which values did you try? 1 is QUIET_UPDATE which *does* update if that
is possible without asking information from user.

did you try NO_UPDATE = 0 too?  if that would also update links then
that would clearly be a bug.

___
LibreOffice mailing list
LibreOffice@lists.freedesktop.org
http://lists.freedesktop.org/mailman/listinfo/libreoffice


Fwd: Re: Ask for help, Young developer request

2015-02-25 Thread Bartłomiej Mikos PrimeSoft Polska

Good morning,

I solved the problem. I thougth than UpdateDocMode.NEVER_UPDATE will set 
up loading without warning. It is not true, the problem solved set libre 
office by hand in options - set update document from on request to 
never update. It solving the problem. I thinking now why UpdateDocMode 
property not working and how set Never Update documents from code (its 
not good idea to setting libre office conf by hand :D).


However, thanks for help. If You will have fast answer for no update by 
code, it will be glad to read good tip.


Have a nice day,
Bartłomiej Mikos

--- Treść przekazanej wiadomości ---
Temat:  Re: Ask for help, Young developer request
Data:   Mon, 23 Feb 2015 08:35:30 +0100
Nadawca:Bartłomiej Mikos PrimeSoft Polska 
bartlomiej.mi...@primesoft.pl
Adresat:Andrew Pitonyak and...@pitonyak.org



Good Morning,

I tried use XModifiable to close xlsx file, my method for making pdf 
looks like that:


public void convertToPdf(String sourcePath, String destinyPath)
throws java.lang.Exception {

PropertyValue[] properties = new PropertyValue[3];

properties[0] = getHiddenProperty();

properties[1] = new PropertyValue();
properties[1].Name = UpdateDocMode;
properties[1].Value = new Short((short) 1);

properties[2] = new PropertyValue();
properties[2].Name = ReadOnly;
properties[2].Value = new Boolean(true);

String sourceURL = convertFilePathToURL(sourcePath);
String destinyURL = convertFilePathToURL(destinyPath);

XComponent xComponent = xComponentLoader.loadComponentFromURL(
sourceURL, _blank, 0, properties);

XModel xModel = UnoRuntime.queryInterface(XModel.class, 
xComponent);


XModifiable xModifiable = 
UnoRuntime.queryInterface(XModifiable.class,

xModel);

xModifiable.setModified(false);

XStorable xStorable = null;
if (xComponent != null) {
xStorable = UnoRuntime.queryInterface(XStorable.class, 
xComponent);


if (xStorable != null) {
properties = new PropertyValue[2];
properties[0] = getPDFWriterProperty();
properties[1] = new PropertyValue();
properties[1].Name = Wait;
properties[1].Value = new Boolean(true);

xStorable.storeToURL(destinyURL, properties);
}
}

//I tried use XModifiable here too

if (xStorable != null) {
XCloseable closeable = 
UnoRuntime.queryInterface(XCloseable.class,

xStorable);
if (closeable != null) {
try {
closeable.close(true);
} catch (CloseVetoException closeVetoException) {
   //exception problem
}
} else {
XComponent xComp = 
UnoRuntime.queryInterface(XComponent.class,

xStorable);
xComp.dispose();
}
}
}

It not helps with that issue. Maybe usefull information is that I used 
UpdateDocMode (all options) and there still appears warn window 
update/links [yes][no]. Have You some other tips which can help?.


Thanks you for Your interest,
Have a nice day.

W dniu 2015-02-20 o 14:35, Andrew Pitonyak pisze:

First use XModifiable and if
isModified is true call
setModified to set to false.

See of that helps.

On Feb 20, 2015 3:12 AM, 
=?UTF-8?Q?Bart=C5=82omiej_Mikos_PrimeSoft_Polska?=bartlomiej.mi...@primesoft.pl
  wrote:

Good Morning,

I have problem with use of java LibreOffice Api 4.3

Is a possible way to close XComponent (xlsx type) in save way?.

I have converting to pdf method. I use XStorable.storeToURL() The
converting works fine, but when I try to close like this:

  if (xStorable != null) {
  XCloseable closeable =
UnoRuntime.queryInterface(XCloseable.class, xStorable);
  if (closeable != null) {
  try {
  closeable.close(true);
  } catch (CloseVetoException closeVetoException) {
  //problem with xlsx files, always occure
  }
  } else {
  XComponent xComp =
UnoRuntime.queryInterface(XComponent.class, xStorable);
  xComp.dispose();
  }
  }

I tried to dispose a XController and the XFrame. In that case window is
closed, but in next time XComponentLoader cannot load the XComponent,
problem with socket etc.

Can You tell me what i should do to make it work fine?. Maybe i should
know more about something or You had some simillar problems?.

I hope You will find time to answer,
Have a nice day.


___
LibreOffice mailing list
LibreOffice@lists.freedesktop.org  
http://lists.freedesktop.org/mailman/listinfo/libreoffice  


Z poważaniem,
Bartłomiej Mikos
--
Bartłomiej

Re: Re: Ask for help, Young developer request

2015-02-24 Thread Bartłomiej Mikos PrimeSoft Polska

Hello again,

I am now shure the problem is with update links warning window [yes] [no].

It isnt problem with xslx files, but linked files.

When I manualy choose no option it closing it correctly.

I have problem to load component without Update links warn window.

Is any solution for it?

I am using a XComponentLoader for that with properties

properties[0] = new PropertyValue();
properties[0] = Hidden;
properties[0] = new Boolean(true); //true only for debug in 
hidden mode i dont see the window


properties[1] = new PropertyValue();
properties[1].Name = UpdateDocMode;
properties[1].Value = new Short((short) 1);

properties[2] = new PropertyValue();
properties[2].Name = ReadOnly;
properties[2].Value = new Boolean(true);

properties[3] = new PropertyValue();
properties[3].Name = MacroExecutionMode;
properties[3].Value = new Short((short) 4);

Is some kind of solution for not loading the warning windows and not 
updating links?



Good Morning,

I tried use XModifiable to close xlsx file, my method for making pdf 
looks like that:


public void convertToPdf(String sourcePath, String destinyPath)
throws java.lang.Exception {

PropertyValue[] properties = new PropertyValue[3];

properties[0] = getHiddenProperty();

properties[1] = new PropertyValue();
properties[1].Name = UpdateDocMode;
properties[1].Value = new Short((short) 1);

properties[2] = new PropertyValue();
properties[2].Name = ReadOnly;
properties[2].Value = new Boolean(true);

String sourceURL = convertFilePathToURL(sourcePath);
String destinyURL = convertFilePathToURL(destinyPath);

XComponent xComponent = xComponentLoader.loadComponentFromURL(
sourceURL, _blank, 0, properties);

XModel xModel = UnoRuntime.queryInterface(XModel.class, 
xComponent);


XModifiable xModifiable = 
UnoRuntime.queryInterface(XModifiable.class,

xModel);

xModifiable.setModified(false);

XStorable xStorable = null;
if (xComponent != null) {
xStorable = UnoRuntime.queryInterface(XStorable.class, 
xComponent);


if (xStorable != null) {
properties = new PropertyValue[2];
properties[0] = getPDFWriterProperty();
properties[1] = new PropertyValue();
properties[1].Name = Wait;
properties[1].Value = new Boolean(true);

xStorable.storeToURL(destinyURL, properties);
}
}

//I tried use XModifiable here too

if (xStorable != null) {
XCloseable closeable = 
UnoRuntime.queryInterface(XCloseable.class,

xStorable);
if (closeable != null) {
try {
closeable.close(true);
} catch (CloseVetoException closeVetoException) {
   //exception problem
}
} else {
XComponent xComp = 
UnoRuntime.queryInterface(XComponent.class,

xStorable);
xComp.dispose();
}
}
}

It not helps with that issue. Maybe usefull information is that I used 
UpdateDocMode (all options) and there still appears warn window 
update/links [yes][no]. Have You some other tips which can help?.


Thanks you for Your interest,
Have a nice day.

W dniu 2015-02-20 o 14:35, Andrew Pitonyak pisze:

First use XModifiable and if
isModified is true call
setModified to set to false.

See of that helps.

On Feb 20, 2015 3:12 AM, 
=?UTF-8?Q?Bart=C5=82omiej_Mikos_PrimeSoft_Polska?=bartlomiej.mi...@primesoft.pl
  wrote:

Good Morning,

I have problem with use of java LibreOffice Api 4.3

Is a possible way to close XComponent (xlsx type) in save way?.

I have converting to pdf method. I use XStorable.storeToURL() The
converting works fine, but when I try to close like this:

  if (xStorable != null) {
  XCloseable closeable =
UnoRuntime.queryInterface(XCloseable.class, xStorable);
  if (closeable != null) {
  try {
  closeable.close(true);
  } catch (CloseVetoException closeVetoException) {
  //problem with xlsx files, always occure
  }
  } else {
  XComponent xComp =
UnoRuntime.queryInterface(XComponent.class, xStorable);
  xComp.dispose();
  }
  }

I tried to dispose a XController and the XFrame. In that case window is
closed, but in next time XComponentLoader cannot load the XComponent,
problem with socket etc.

Can You tell me what i should do to make it work fine?. Maybe i should
know more about something or You had some simillar problems?.

I hope You will find time to answer,
Have a nice day.



Re: Fwd: Re: Ask for help, Young developer request

2015-02-24 Thread SOS

probably you must use xStorable.store_As_URL
hope it help

Fernand

On 24/02/2015 10:48, Bartłomiej Mikos PrimeSoft Polska wrote:

Good Morning,

I tried use XModifiable to close xlsx file, my method for making pdf 
looks like that:


public void convertToPdf(String sourcePath, String destinyPath)
throws java.lang.Exception {

PropertyValue[] properties = new PropertyValue[3];

properties[0] = getHiddenProperty();

properties[1] = new PropertyValue();
properties[1].Name = UpdateDocMode;
properties[1].Value = new Short((short) 1);

properties[2] = new PropertyValue();
properties[2].Name = ReadOnly;
properties[2].Value = new Boolean(true);

String sourceURL = convertFilePathToURL(sourcePath);
String destinyURL = convertFilePathToURL(destinyPath);

XComponent xComponent = xComponentLoader.loadComponentFromURL(
sourceURL, _blank, 0, properties);

XModel xModel = UnoRuntime.queryInterface(XModel.class, 
xComponent);


XModifiable xModifiable = 
UnoRuntime.queryInterface(XModifiable.class,

xModel);

xModifiable.setModified(false);

XStorable xStorable = null;
if (xComponent != null) {
xStorable = UnoRuntime.queryInterface(XStorable.class, 
xComponent);


if (xStorable != null) {
properties = new PropertyValue[2];
properties[0] = getPDFWriterProperty();
properties[1] = new PropertyValue();
properties[1].Name = Wait;
properties[1].Value = new Boolean(true);

xStorable.storeToURL(destinyURL, properties);
}
}

//I tried use XModifiable here too

if (xStorable != null) {
XCloseable closeable = 
UnoRuntime.queryInterface(XCloseable.class,

xStorable);
if (closeable != null) {
try {
closeable.close(true);
} catch (CloseVetoException closeVetoException) {
   //exception problem
}
} else {
XComponent xComp = 
UnoRuntime.queryInterface(XComponent.class,

xStorable);
xComp.dispose();
}
}
}

It not helps with that issue. Maybe usefull information is that I used 
UpdateDocMode (all options) and there still appears warn window 
update/links [yes][no]. Have You some other tips which can help?.


Thanks you for Your interest,
Have a nice day.

W dniu 2015-02-20 o 14:35, Andrew Pitonyak pisze:

First use XModifiable and if
isModified is true call
setModified to set to false.

See of that helps.

On Feb 20, 2015 3:12 AM, 
=?UTF-8?Q?Bart=C5=82omiej_Mikos_PrimeSoft_Polska?=bartlomiej.mi...@primesoft.pl
  wrote:

Good Morning,

I have problem with use of java LibreOffice Api 4.3

Is a possible way to close XComponent (xlsx type) in save way?.

I have converting to pdf method. I use XStorable.storeToURL() The
converting works fine, but when I try to close like this:

  if (xStorable != null) {
  XCloseable closeable =
UnoRuntime.queryInterface(XCloseable.class, xStorable);
  if (closeable != null) {
  try {
  closeable.close(true);
  } catch (CloseVetoException closeVetoException) {
  //problem with xlsx files, always occure
  }
  } else {
  XComponent xComp =
UnoRuntime.queryInterface(XComponent.class, xStorable);
  xComp.dispose();
  }
  }

I tried to dispose a XController and the XFrame. In that case window is
closed, but in next time XComponentLoader cannot load the XComponent,
problem with socket etc.

Can You tell me what i should do to make it work fine?. Maybe i should
know more about something or You had some simillar problems?.

I hope You will find time to answer,
Have a nice day.


___
LibreOffice mailing list
LibreOffice@lists.freedesktop.org  
http://lists.freedesktop.org/mailman/listinfo/libreoffice  


Z poważaniem,
Bartłomiej Mikos
--
Bartłomiej Mikos
software engineer
bartlomiej.mi...@primesoft.pl mailto:bartlomiej.mi...@primesoft.pl
www.primesoft.pl http://www.primesoft.pl

PrimeSoft Polska Sp. z o.o.
ul. Perkuna 25, 61-615 Poznań tel/fax 61/833-17-72
NIP 7831592998 Regon 634610845 KRS 221565 Kapitał zakł. 5pln
NORDEA Bank Polska S.A. PL 50 1440 1130   0336 0806

*Dla Państwa już od 10 lat*
Dnia 25 września 2014 roku odbyła się konferencja 10-lecie PrimeSoft 
Polska: okiem klienta, okiem dostawcy – wymiana doświadczeń 
biznesowych. W wydarzeniu wzięli udział przedstawiciele firm i 
instytucji będących klientami oraz partnerami biznesowymi PrimeSoft 
Polska. Relacja z wydarzenia http://www.youtube.com/watch?v=FjsrjSmaNaQ







Ask for help, Young developer request

2015-02-20 Thread Bartłomiej Mikos PrimeSoft Polska

Good Morning,

I have problem with use of java LibreOffice Api 4.3

Is a possible way to close XComponent (xlsx type) in save way?.

I have converting to pdf method. I use XStorable.storeToURL() The 
converting works fine, but when I try to close like this:


if (xStorable != null) {
XCloseable closeable = 
UnoRuntime.queryInterface(XCloseable.class, xStorable);

if (closeable != null) {
try {
closeable.close(true);
} catch (CloseVetoException closeVetoException) {
//problem with xlsx files, always occure
}
} else {
XComponent xComp = 
UnoRuntime.queryInterface(XComponent.class, xStorable);

xComp.dispose();
}
}

I tried to dispose a XController and the XFrame. In that case window is 
closed, but in next time XComponentLoader cannot load the XComponent, 
problem with socket etc.


Can You tell me what i should do to make it work fine?. Maybe i should 
know more about something or You had some simillar problems?.


I hope You will find time to answer,
Have a nice day.


___
LibreOffice mailing list
LibreOffice@lists.freedesktop.org
http://lists.freedesktop.org/mailman/listinfo/libreoffice


Re: Ask for help, Young developer request

2015-02-20 Thread Andrew Pitonyak
First use XModifiable and if
isModified is true call
setModified to set to false.

See of that helps.

On Feb 20, 2015 3:12 AM, =?UTF-8?Q?Bart=C5=82omiej_Mikos_PrimeSoft_Polska?= 
bartlomiej.mi...@primesoft.pl wrote:

 Good Morning, 

 I have problem with use of java LibreOffice Api 4.3 

 Is a possible way to close XComponent (xlsx type) in save way?. 

 I have converting to pdf method. I use XStorable.storeToURL() The 
 converting works fine, but when I try to close like this: 

  if (xStorable != null) { 
  XCloseable closeable = 
 UnoRuntime.queryInterface(XCloseable.class, xStorable); 
  if (closeable != null) { 
  try { 
  closeable.close(true); 
  } catch (CloseVetoException closeVetoException) { 
  //problem with xlsx files, always occure 
  } 
  } else { 
  XComponent xComp = 
 UnoRuntime.queryInterface(XComponent.class, xStorable); 
  xComp.dispose(); 
  } 
  } 

 I tried to dispose a XController and the XFrame. In that case window is 
 closed, but in next time XComponentLoader cannot load the XComponent, 
 problem with socket etc. 

 Can You tell me what i should do to make it work fine?. Maybe i should 
 know more about something or You had some simillar problems?. 

 I hope You will find time to answer, 
 Have a nice day. 


 ___ 
 LibreOffice mailing list 
 LibreOffice@lists.freedesktop.org 
 http://lists.freedesktop.org/mailman/listinfo/libreoffice 
___
LibreOffice mailing list
LibreOffice@lists.freedesktop.org
http://lists.freedesktop.org/mailman/listinfo/libreoffice