【问题标题】:How do I compile code for an OpenNTF customization?如何为 OpenNTF 自定义编译代码?
【发布时间】:2014-08-18 21:51:53
【问题描述】:

我们的老板想要使用 OpenNTF 中的 FileExplorer 小部件,以便他们可以将电子邮件拖到文件系统以便与他人共享。他们已经在不同的系统中拥有此类消息的宝库,因此使用共享的 Notes 邮件文件被确定为不可接受的解决方案。他们喜欢 FileExplorer,但对使用主题行命名的电子邮件感到失望。他们已经要求一个 mod 在文件名前加上 FROM 和 DATE 值。

我已经编写了一个修改以在 CopyFileJob.java 文件中使用,并认为 CopyFilesJob 类的复制方法中的以下行将处理重命名。

if (source.isFile()) {
    // only check about modifying filename if it's a file to copy
    final File dest = new File(fDest.getAbsolutePath() + File.separator  + modifyEmailFilename(source.getName()));
...

它调用的代码比较简单,因为电子邮件文件是格式化的文本。

    public static String modifyEmailFilename( String filename ) {
    try {

        int extensionCheck = filename.indexOf(".eml");
        if ( extensionCheck >= 0 ) { 

            String fromResult = "";
            String dateResult = "";
            String fromString = "From:";
            String dateString = "Date:";

            Scanner sc = new Scanner (new File (filename));

            while (sc.hasNextLine()) {
                String nextLine = sc.nextLine();
                int searchIndex = nextLine.indexOf(fromString);
                if ( searchIndex == 0 ) {
                    int startIndex = nextLine.indexOf(":") + 2;
                    int endIndex = nextLine.indexOf("@");
                    fromResult = nextLine.toString().substring(startIndex,endIndex);
                }
                searchIndex = nextLine.indexOf(dateString);
                if ( searchIndex == 0 ) {
                    int startIndex = nextLine.indexOf(",") + 2;
                    int endIndex = nextLine.lastIndexOf(" ");
                    dateResult = nextLine.toString().substring(startIndex,endIndex).replace(" ","_").replace(":","");
                }               
            }

            return fromResult + "_" + dateResult + "_" + filename;
        }
        // when eml is not in the filename, just return the filename
        return filename;

    } catch (Exception e) {
        System.out.println("Error: " + e.getMessage() );
        return "Error";
    }
    return "Finished";
}

我不知道如何重新编译它以实现我的自定义代码并部署它。当然,我没能就地测试它,因为当 OpenNTF 项目有很多组件时,我无法弄清楚编译它的步骤。

【问题讨论】:

    标签: java eclipse plugins eclipse-plugin lotus-notes


    【解决方案1】:

    大卫, Notes 客户端中的一个侧边栏插件有 2-3 个 Eclipse 项目:

    • 一个插件项目
    • 特色项目
    • 一个更新站点项目

    功能包含一个或多个插件。插件可以出现在多个功能中。更新站点包含一项或多项功能。功能可以出现在多个更新站点中。

    这充其量是令人困惑的。但这就是 Eclipse 的方式。 OpenNTF 项目包含所有源代码,因此请下载并将其导入 Domino 设计器(或 Eclipse)到 2-3 项目中。 Mikkel Heisterberg 和 Nathan Freeman 撰写了如何设置 Eclipse 以进行 Notes 插件开发的文章。

    有关插件开发的一般教程,请查看 Lars Vogalla 的教程。

    让我们知道进展如何。

    【讨论】:

    • 还是有点迷茫。我刚刚使用 Mikkel 的指导 lekkimworld.com/pages/eclipse42_notes9.html 为 Notes 9 设置了 Juno,但我不知道“下载 OpenNTF 项目”是什么意思。您是指我要修改的 FileExplorer 项目还是更宏大的项目?任何指向他们网站上某些内容的链接都会有所帮助,因为搜索不会拉出分步指南(可能不存在)。
    • 要修改的文件资源管理器。它包含源代码。您面临 2 个挑战:了解一般插件开发并完成您的更改。第一次检查:ibm.com/developerworks/lotus/library/notes-multimedia
    猜你喜欢
    • 1970-01-01
    • 2016-03-29
    • 2012-05-29
    • 1970-01-01
    • 2018-12-26
    • 2012-03-15
    • 1970-01-01
    • 1970-01-01
    • 2014-01-10
    相关资源
    最近更新 更多