更新到最新的 FOP API
我正在寻找更新应用程序以使用最新的 fop API。 该应用程序使用该库的 0.20 版本,例如仍在使用 Driver 类。
我似乎无法找到任何有关如何更新到最新 fop 版本的明智信息。我发现了一些片段,例如应该使用 FOPFactory。
所以我想知道是否有人可以向我推送有关更新到新的(最新)fop API 的资源? 或者是否真的无法更新,我是否需要重写应用程序的这一部分?
PS我找到了 fop 升级 页面(当然),但似乎没有指出两个版本的类/API 之间的相似之处。
I am looking to update an application to use the newest fop API.
The application uses version 0.20 of the library, for example the Driver class is still being used.
I do not seem to be able to find any sensible information on how to update to the newest fop version. I found some snippets, eg that the FOPFactory should be used.
So I was wondering if anyone could give me a push to resources on updating to the new(est) fop API?
Or is it not really possible to update and do I need to rewrite this part of the application?
PS I have found the fop upgrading page (of course) but it does not seem to point out the similarities between classes/APIs of both versions.
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
答案是,这实际上取决于您使用 FOP 的程度。
当我们从 .2* 版本更新到 .9,然后是 1.0 版本时,我们必须进行大量修改,但我们生成了各种各样的 FO(我们将 FO 转换为 PostScript),并且我们需要生成各种 PostScript看看新版本中哪些有效,哪些失败。您可能会找到一个简单的替代品来替代根据您过去所做的事情可能消失的任何东西。
幸运的是,我们将对 Driver 和 Fop 类的引用合并到自定义实用程序中,因此简单地换出使用 FopFactory 的新实用程序引用并不是那么糟糕的过渡。
您的第一步应该是编写一个抽象的 Facade,正如 @Wivani 建议的那样,整合您的旧 fop 引用调用,确保它在您的代码中有效,然后通过使用新代码的实现替换旧的 Facade 来继续前进。
Fop 唯一让我不满意的是社区需要相当长的时间来应用错误补丁并生成新版本。我们在生产中使用 v1 和 XML Graphics 1.4 没有任何问题(生成 PostScript 和 TIFF 文件的基本 FO)。
如果您需要的话,我将在周一补充这篇文章一些帮助代码。
更新
以下是我们过去用来将 FO 文件转换为 PostScript 的内容:
以下是我们现在使用的内容的摘要。
FopFactory 作为实例级代码创建
:
The answer is that it really depends on how much you use of FOP.
When we updated from a .2* version to the .9, then 1.0 version, we had to revise quite a bit, but we generated a large variety of FO (we transformed FO to PostScript) and we needed to generate a variety of PostScripts to see what worked and what failed in the newer versions. You will likely find an easy replacement for anything that might have vanished based on what you used to do.
We had, luckily, consolidated references to the Driver and Fop classes to a custom utility and therefore it wasn't so bad a transition to simply swap out a new utility reference that used the FopFactory.
Your first step should be to write an abstract Facade as @Wivani suggests to consolidate your older fop reference calls, make sure that works in your code, then move forward by replacing your older Facade with an implementation that uses the newer code.
The only thing that has displeased me about Fop is that the community takes quite a while to apply bug patches and generate new releases. We used v1 in production with XML Graphics 1.4 with no problems (basic FO to generate PostScript and TIFF files).
I will supplement this post on Monday with some helper code if you need it.
UPDATE
Here is what we used to use to convert a FO file to PostScript:
Here is an abstract of what we use now.
FopFactory is created as instance-level as
code: