0

我想自定义为文档显示的元数据以显示作者的姓名,而不是“修改者”信息。这是我放入的share-config-custom.xml

<config evaluator="string-compare" condition="DocumentLibrary">
    <metadata-templates>
        <template id="customTemplate">
            <line index="10" id="author">{author}</line>
        </template>
    </metadata-templates>
</config>

但是共享不尊重这一点,并且呈现默认元数据。但是,如果我要编辑主配置文件share-documentlibrary-config.xml:然后显示作者的名字。显然,我不想编辑核心文件;所以我真的很感激任何关于我的代码错误的反馈?

另外,这里还有一些 n00b 问题

1) 如果我要添加一些文本来指示该字段,例如:作者:${author},那么它会以相反的顺序显示为 - 'XYZName Author:' 关于为什么会发生这种情况的建议。

2)说如果作者姓名为空,我希望这一行根本不显示;我该怎么做呢?从 MikeH 的博客文章中,我意识到我可能需要编写一个自定义评估器来实现这一点;但我的知识到此为止;是否有我可以首先尝试和构建的工作步骤序列。

3) 是否可以为空间和内容显示不同的元数据?如果可能的话,任何指导将不胜感激。

非常感谢您的时间

4

2 回答 2

1

根据Mike Hatfield 的博客,您需要将更改放在 share-documentlibrary-config.xml 中。你不能在 web-extension 文件夹中创建这个文件吗?我想它应该被捡起来。

如果没有,请尝试将其打包为 *.jar 文件,然后可能会被拾取。

如果这仍然不起作用,请找到 -context 文件,我猜它是 slingshot-documentlibrary-context.xml。在这里它应该加载上面的配置文件。添加一个覆盖,如 share-config-custom.xml 并将其命名为 share-documentlibrary-config-custom.xml,它在 web-extension 文件夹中查找。

于 2012-03-26T09:27:48.010 回答
0

根据您的“如果我要编辑主配置文件:share-documentlibrary-config.xml;然后显示作者的名字。”,然后您可以通过添加replace =“将这些代码写入share-config-custom.xml true”在这样的配置标签中。您应该将配置中的所有文本复制到您的 share-config-custom.xml 并修改您自己的。

    <config evaluator="string-compare" condition="DocumentLibrary" replace="true">
    ...............................
    ...............................
        <metadata-templates>
            <template id="customTemplate">
                <line index="10" id="author">{author}</line>
            </template>
        </metadata-templates>
    ...............................

    </config>
于 2012-07-06T05:43:06.980 回答