IBM Filenet Content Navigator自定义插件 - 编辑属性后,GridX行变为空白

时间:2014-07-28 14:55:11

标签: java javascript plugins filenet-p8 ibm-content-navigator

我正在处理ICN插件并且无法修复此故障,每个结果都会按照网格小部件的方式加载,但只要我在右侧面板上对其进行任何更改并保存它们,网格似乎重新加载该行,但它变为空白,因为它没有加载绑定到我在java代码上指定的列的属性来构建网格。

ICN Plugin Grid 1

ICN Plugin Grid 2

我正在使用ibm redbook中的“第6章使用搜索服务和小部件创建一个功能”演示插件作为示例,但是在这种插件的确切位置我可以使导航器加载这些自定义列及其我想要的属性它在编辑后重新加载?

注意: 默认情况下,列是指这些,默认情况下每行的属性始终为:

row.addAttribute("ID", doc.get_Id().toString(), JSONResultSetRow.TYPE_STRING, null, doc.get_Id().toString());
row.addAttribute("className", doc.getClassName(), JSONResultSetRow.TYPE_STRING, null, doc.getClassName());
row.addAttribute("ModifiedBy", doc.get_LastModifier(), JSONResultSetRow.TYPE_STRING, null, doc.get_LastModifier());
row.addAttribute("LastModified", doc.get_DateLastModified().toString(), JSONResultSetRow.TYPE_TIMESTAMP, null, doc.get_DateLastModified().toString());
row.addAttribute("Version", doc.get_MajorVersionNumber() + "." + doc.get_MinorVersionNumber(), JSONResultSetRow.TYPE_STRING, null, doc.get_MajorVersionNumber() + "." + doc.get_MinorVersionNumber());
row.addAttribute("{NAME}", doc.get_Name(), JSONResultSetRow.TYPE_STRING, null, doc.get_Name());
row.addAttribute("ContentSize", doc.get_ContentSize(), JSONResultSetRow.TYPE_INTEGER, null, null);

根据自定义我的意思是这样的,其中所有内容都是从XML文件加载的:

ArrayList<PluginProperty> pr = pxs.getResults(contextId);
    for (int i = 0; i < pr.size(); i++) {
        String id = "{" + i + "}";
        String propName = pr.get(i).getName();
        String propType = pr.get(i).getType();
        String prop = "";
    .
    .
    .
else if (propType.equalsIgnoreCase("StringList")) {
    int size = doc.getProperties().get(propName).getStringListValue().size();
    for (int j = 0; j < size; j++) {
        prop += doc.getProperties().get(propName).getStringListValue().get(j).toString() + "; ";
    }
}
else if (propType.equalsIgnoreCase("StringValue")) {
    prop = doc.getProperties().get(propName).getStringValue();
}
    .
    .
    .
    row.addAttribute(id, prop, JSONResultSetRow.TYPE_STRING, null, prop);
}

2 个答案:

答案 0 :(得分:1)

保存文档信息数据后,将调用openItem。这会使用最新数据更新项目。

ContentList从_ModelStore.js getValue方法获取单元格值。此方法调用item.getDisplayValue以获取要在单元格中显示的值。很可能要么item.getDisplayValue返回null(或空白),要么_ModelStore没有为此属性调用getValue。

我建议查看从openItem返回的JSON以验证它看起来是否完整。

答案 1 :(得分:0)

终于找到了问题,显然ICN不希望您为行使用自定义ID。 我正在从XML文件中加载一堆行并创建如下行:

ArrayList<PluginProperty> pr = pxs.getResults(contextId);
    for (int i = 0; i < pr.size(); i++) {
        String id = "{" + i + "}";
        String propName = pr.get(i).getName();
        String propType = pr.get(i).getType();
        String prop = "";
    .
    .
    .
else if (propType.equalsIgnoreCase("StringList")) {
    int size = doc.getProperties().get(propName).getStringListValue().size();
    for (int j = 0; j < size; j++) {
        prop += doc.getProperties().get(propName).getStringListValue().get(j).toString() + "; ";
    }
}
else if (propType.equalsIgnoreCase("StringValue")) {
    prop = doc.getProperties().get(propName).getStringValue();
}
    .
    .
    .
    row.addAttribute(id, prop, JSONResultSetRow.TYPE_STRING, null, prop);
}

现在为了使它工作,我被迫将id变量更改为:

String id = pr.get(i).getName();

这样ids将会像&#34; Id&#34;,&#34; DocumentTitle&#34;,&#34; Creator&#34;,&#34; DateCreated&#34;和&#34; DateLastModified&#34;,与每个属性的名称完全相同,而不是&#34; {0}&#34;,&#34; {1}&#34;,&#34; {2} &#34;等。

希望这对其他人有帮助!

相关问题