【问题标题】:Lotus Domino 8.5.2 Java Agent , write Metadata to extracted attachments?Lotus Domino 8.5.2 Java 代理,将元数据写入提取的附件?
【发布时间】:2012-08-29 15:02:11
【问题描述】:

我使用的是 Lotus Domino 服务器 8.5.2。使用 Java 调度代理,我可以将几个 Lotus Domino 文档的附件提取到文件系统中(win 32)。想法是提取后我需要向文件添加一些元数据并将文件上传到另一个系统。

是否有人知道,或者可以给我一些提示(最好使用 Java)我如何将一些元数据写入提取的文件?我需要添加一些关键字,更改作者,等等。我明白Lotus Domino 8.5.2 supports Java 6

谢谢!

亚历克斯。

【问题讨论】:

  • 你问的是什么类型的文件?
  • 你好 rhsatrhs。任何类型的附件,如 Office 文件、CAD、Exe、RAR 和 Zip 文件等。有时 Zip 和 RAR 文件被拆分为多个文件...

标签: java lotus-domino lotus


【解决方案1】:

根据this answer,Java 7 具有操作 Windows 元数据的本机能力,但 Java 6 没有。

它确实说您可以使用 Java Native Access (JNA) 来调用本地 DLL,这意味着您应该能够使用 dsofile.dll 来操作元数据。 here 中使用 JNA 从 msvcrt.dll 访问“puts”函数的示例(找不到任何特定于 dsofile.dll 的示例):

界面

package CInterface; 

import com.sun.jna.Library; 

public interface CInterface extends Library 
{ 
      public int puts(String str);
}     

示例类

// JNA Demo. Scriptol.com
package CInterface; 
import com.sun.jna.Library; 
import com.sun.jna.Native;
import com.sun.jna.Platform;

public class hello 
{ 
  public static void main(String[] args) 
  { 
    String mytext = "Hello World!";  
     if (args.length != 1) 
    { 
      System.err.println("You can enter your own text between quotes..."); 
      System.err.println("Syntax: java -jar /jna/dist/demo.jar \"myowntext\"");
    }
    else
       mytext = args[0]; 

    // Library is c for unix and msvcrt for windows
    String libName = "c"; 
    if (System.getProperty("os.name").contains("Windows")) 
    { 
      libName = "msvcrt";  
    } 

    // Loading dynamically the library
    CInterface demo = (CInterface) Native.loadLibrary(libName, CInterface.class); 
    demo.puts(mytext);
  } 
}

【讨论】:

  • 谢谢罗伯!我会试试你的答案。我会发布结果:-)
  • 仍在草稿中,但似乎是正确的道路。一旦我有可读的东西,我会发布;-)
猜你喜欢
  • 2012-06-26
  • 2021-12-16
  • 2013-06-17
  • 1970-01-01
  • 2012-04-06
  • 2014-08-17
  • 2011-07-08
  • 1970-01-01
  • 1970-01-01
相关资源
最近更新 更多