Alfresco 中的自动递增(唯一)ID [英] Auto-Incrementing (Unique) ID in Alfresco

查看:29
本文介绍了Alfresco 中的自动递增(唯一)ID的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我正在尝试通过运行脚本来扩展 alfresco 的文档管理.到目前为止,我已经成功地创建了一个具有自定义类型和属性的自定义模型,如下所示:

i am trying to extend alfresco's document management by running a script. So far, i have managed to create a Custom Model with a Custom Type and Property as seen below:

所说的自定义类型在这个自定义模型下(暂时不考虑自定义方面)

the said Custom Type is under this Custom Model (never mind the Custom Aspect for now)

到目前为止自定义类型是有效的,我设法将它应用到某个文档,如下所示(注意控制代码字段)

the custom type is working so far, i managed to apply it to a certain document as you can see below (Notice the Control Code Field)

现在我想做的是添加一个自动递增函数,该函数将被设置为控制代码属性的值(即:[FILE0012])

now what i want to do is to add an auto incrementing function that will be set as the value of the Control Code Property (ie: [FILE0012])

我尝试使用来自 alfresco 的脚本规则,但这些命令似乎仅限于 alfresco 的功能.甚至 alert()console.log 函数都不起作用.我想,如果我可以制作一个脚本来调用 ajax 到我的 php 服务器,我可以提取文档的属性,并将其插入我的数据库并获取 rowid,然后将其附加到单词FILE"上,使其成为 Control Code 属性(即:一个文档被插入到我的数据库中的第 1996 行,那么控制代码是 [FILE1996],这是因为我加入了 '[FILE' and 1996 and ']'

i tried utilizing the scripts rule from alfresco but it seems like the commands are limited to that of alfresco's functionalities. not even alert() or console.log functions work. i thought that if i can make a script that could call an ajax to my php server, i can extract the document's property, and insert it to my database and get the rowid then attach it to a word "FILE" so it becomes the Control Code Property (ie: a document was inserted to my database at row 1996, then the Control code is [FILE1996], this is because i joined '[FILE' and 1996 and ']'

但就像我说的,发生的事情是,javascript 命令仅限于 alfresco 的需要.

but like i said, what happened was, the javascript commands are limited to that of alfresco's needs.

我试图进行研究,但我只遇到了 2 个可追溯到 2006-2010 年的过时(我的意思是过时)线程.这对 Alfresco 当前的构建结构帮助不大.

i tried to make my research but i've only bumped on 2 outdated (and i mean outdated) threads dating back to 2006-2010. which does not help me quite well with Alfresco's current build structure.

我希望有人能在这里帮助我.连接到数据库不是强制性的,但如果我能做到这一点,那么它会给我一个相当惊人的结果.

i hope someone can help me with here. connecting to the database is not mandatory, but if i can make it do as such then it'll give me quite a rather amazing results.

推荐答案

看看cm:countable"方面.您没有唯一性保证 OOTB,因此请考虑这一点.

Take a look at the "cm:countable" aspect. You do not have uniqueness guaranteed OOTB, so take that into account.

示例:http://www.avantec.se/howto-create-an-auto-increment-field-on-an-object-in-alfresco/

这篇关于Alfresco 中的自动递增(唯一)ID的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆