在Alfresco中查询定制模型

发布于 2024-12-12 06:57:04 字数 1266 浏览 3 评论 0原文

我在 Alfresco 中有一些自定义模型,我需要从存储库中提取方面信息和内容。

我需要传递关键字和模型名称(它是一个方面)来提取与模型关联的内容或方面。

search/{keywords}?model={model?}

这是我用来提取传递模型的内容的 javascript

var docs = search.luceneSearch("@kd\\:commonname_content_type_tag:\"" + model + "\"");

如何连接两个方面属性?

我在 Java 中完成了它,但 Javascript 中的语法似乎完全不同:

queryString  = "+TYPE:\"" + Constants.createQNameString(CommonAspects.NAMESPACE_KD_CONTENT_MODEL, DrugModel.TYPE_SUPPLIER) + "\" ";
queryString += "+@kd\\:SupplierID:" + drugBrandNameBean.getSupplierID();
String supplier = contentQuery.getUUID(queryString);

另一个问题,如何处理 Javascript 文档?我可以访问我的方面吗?

我尝试了类似的方法,但它不起作用:

var docs = search.luceneSearch("@kd\\:commonname_content_type_tag:\"" + model + "\"");    
for (var i=0; i<docs.length; i++) {
    log += "Searching " + commonName + " - Name: " + docs[i].name + "\tPath: " + docs[i].displayPath;
    log += "\tType: " + docs[i].commonname_content_type_tag + "\r\n";
}

提取的行是正确的,但 commonname_content_type_tag 属性始终未定义:

Searching acarbose - Name: exenatide - Contraindication Path: /Company Home/CommonName  Type: undefined

感谢您的帮助!

安德里亚

I've some customized models into Alfresco and I need to extract the aspect information and the content from Repository.

I need, passing the keywords and the model name (it's an aspect), to extract content or the aspects associated to the model.

search/{keywords}?model={model?}

this is the javascript I'm using to extract the content passing the model

var docs = search.luceneSearch("@kd\\:commonname_content_type_tag:\"" + model + "\"");

How can I concatenate two aspects properties?

I did it into Java but the syntax in Javascript seems quite different:

queryString  = "+TYPE:\"" + Constants.createQNameString(CommonAspects.NAMESPACE_KD_CONTENT_MODEL, DrugModel.TYPE_SUPPLIER) + "\" ";
queryString += "+@kd\\:SupplierID:" + drugBrandNameBean.getSupplierID();
String supplier = contentQuery.getUUID(queryString);

Another question, how can I process the Javascript docs? Can I access to my aspects?

I tried something like that but it didn't works:

var docs = search.luceneSearch("@kd\\:commonname_content_type_tag:\"" + model + "\"");    
for (var i=0; i<docs.length; i++) {
    log += "Searching " + commonName + " - Name: " + docs[i].name + "\tPath: " + docs[i].displayPath;
    log += "\tType: " + docs[i].commonname_content_type_tag + "\r\n";
}

The rows extracted are correct but the commonname_content_type_tag properties is always not defined:

Searching acarbose - Name: exenatide - Contraindication Path: /Company Home/CommonName  Type: undefined

Thanks for the help!

Andrea

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(1

完美的未来在梦里 2024-12-19 06:57:04

尝试这样的事情:

docs[i].properties["kd:commonname_content_type_tag"]

Try something like that:

docs[i].properties["kd:commonname_content_type_tag"]
~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文