如何将Control-Parm中的工作流属性传递给Alfresco中的FTL文件?(How to Pass Workflow Propert in Control-Parm to FTL File in Alfresco?)
因此,对于我的项目,我们在Alfresco存储库中有一些javascript代码作为规则运行。 因此,只要新文档进入某个空间,就会动态创建一个新文件夹,并将该文档移动到新创建的空间中。 此外,无论何时创建新文件夹,都会对文档更新属性(期望caseID实际上是基于数据库中序列的动态生成的值):
//Add caseID as a property of the folder var props = new Array(1); props["wf:caseIDNum"] = caseID; var newAspect = newNewSpaceName.addAspect("wf:caseID",props);
但是,现在我们希望能够在我们的工作流程中在share-workflow-form-config-.xml文件中引用新创建的方面/属性,以便它可以作为参数传递给我们的控件模板。 也就是说,目前我们有:
<field id="wf:submitCode" label-id="workflow.field.outcome" set="actions"> <control template="/org/alfresco/components/form/controls/workflow/custom-activiti-transitions.ftl"/> </field>
但我们想要的是如下所示:
<field id="wf:submitCode" label-id="workflow.field.outcome" set="actions"> <control template="/org/alfresco/components/form/controls/workflow/custom-activiti-transitions.ftl"> <control-param name="caseID">wf:caseIDNum</control-param> </control> </field>
所以我的问题是,通过控制参数将变量/属性从工作流模型传递给FTL文件的正确语法是什么?
编辑(10/25/12) -
所以基于这里给出的帮助,我试着像这样修改我的ftl页面......
custom-activiti-transitions.ftl :
<#assign caseID = ""> <#if field.control.params.caseID??> <#assign caseID = field.control.params.caseID> <#else> <#assign caseID = null> </#if> <style type="text/css"> .button { border: 1px solid #666; background: #DCDCDC; padding: 5px; color: #333; text-shadow: 1px 1px #fff; -moz-border-radius: 5px; -webkit-border-radius: 5px border-radius: 5px; cursor: pointer; -moz-box-shadow: 1px 1px 2px rgba(0,0,0,0.3); -webkit-box-shadow: 1px 1px 2px rgba(0,0,0,0.3); box-shadow: 1px 1px 2px rgba(0,0,0,0.3); } a.button:hover { background: #bbb; color: #000; text-shadow: 1px 1px #eee; } a.button:active { position: relative; top: 1px; left: 1px; -moz-box-shadow: none; -webkit-box-shadow: none; box-shadow: none; } </style> <a class="button" href="#" onClick="MyWindow=window.open('http://localhost:8080/alfresco/faces/jsp/custom/CodeSelector.jsp?caseID=${caseID}','My Window','toolbar=no,location=no,directories=no,status=no,menubar=no,scrollbars=no,resizable=no,width=600,height=300'); return false;" style="text-decoration:none" target="_blank"><span>Add Codes</span></a>
在我的share-workflow-form-config.xml中 ,我更改了以下任何实例:
<field id="wf:submitCode" label-id="workflow.field.outcome" set="actions"> <control template="/org/alfresco/components/form/controls/workflow/custom-activiti-transitions.ftl"> </control> </field>
至...
<field id="wf:submitCode" label-id="workflow.field.outcome" set="actions"> <control template="/org/alfresco/components/form/controls/workflow/custom-activiti-transitions.ftl"> <control-param name="caseID">wf:caseIDNum</control-param> </control> </field>
我的问题是在share-workflow-form-config.xml中我指定了
control-param
,我可以让它传递一个像“30”这样的硬编码值。 但是,当我尝试获取工作流属性的值,如wf:caseIDNum
,它返回参数中的实际字符串,如:
http://localhost:8080/alfresco/faces/jsp/custom/CodeSelector.jsp?caseID=wfcaseIDNum
而不是财产的实际价值,即“30”。
关于我可能做错的任何想法?
So for my project, we have some javascript code running as a rule within the Alfresco repository. So whenever a new document comes into a certain space, a new folder is dynamically created and that document is moved into that newly created space. Additionally, whenever a new folder is created, a property is updated like so for the document (expect caseID is actually a dynamically generated value based on a sequence in our database):
//Add caseID as a property of the folder var props = new Array(1); props["wf:caseIDNum"] = caseID; var newAspect = newNewSpaceName.addAspect("wf:caseID",props);
However, now we want to be able to reference that newly created aspect/property during the course of our workflow in our share-workflow-form-config-.xml file so that it can be passed as a parameter to our control template. That is, currently we have:
<field id="wf:submitCode" label-id="workflow.field.outcome" set="actions"> <control template="/org/alfresco/components/form/controls/workflow/custom-activiti-transitions.ftl"/> </field>
But what we want is something like the below:
<field id="wf:submitCode" label-id="workflow.field.outcome" set="actions"> <control template="/org/alfresco/components/form/controls/workflow/custom-activiti-transitions.ftl"> <control-param name="caseID">wf:caseIDNum</control-param> </control> </field>
So my question is, is that the proper syntax to pass a variable/property from the workflow model to the FTL file via the control param?
Edit (10/25/12) -
So based on the help given here, I tried to modify my ftl page like so...
custom-activiti-transitions.ftl:
<#assign caseID = ""> <#if field.control.params.caseID??> <#assign caseID = field.control.params.caseID> <#else> <#assign caseID = null> </#if> <style type="text/css"> .button { border: 1px solid #666; background: #DCDCDC; padding: 5px; color: #333; text-shadow: 1px 1px #fff; -moz-border-radius: 5px; -webkit-border-radius: 5px border-radius: 5px; cursor: pointer; -moz-box-shadow: 1px 1px 2px rgba(0,0,0,0.3); -webkit-box-shadow: 1px 1px 2px rgba(0,0,0,0.3); box-shadow: 1px 1px 2px rgba(0,0,0,0.3); } a.button:hover { background: #bbb; color: #000; text-shadow: 1px 1px #eee; } a.button:active { position: relative; top: 1px; left: 1px; -moz-box-shadow: none; -webkit-box-shadow: none; box-shadow: none; } </style> <a class="button" href="#" onClick="MyWindow=window.open('http://localhost:8080/alfresco/faces/jsp/custom/CodeSelector.jsp?caseID=${caseID}','My Window','toolbar=no,location=no,directories=no,status=no,menubar=no,scrollbars=no,resizable=no,width=600,height=300'); return false;" style="text-decoration:none" target="_blank"><span>Add Codes</span></a>
And in my share-workflow-form-config.xml, I changed any instance of:
<field id="wf:submitCode" label-id="workflow.field.outcome" set="actions"> <control template="/org/alfresco/components/form/controls/workflow/custom-activiti-transitions.ftl"> </control> </field>
to...
<field id="wf:submitCode" label-id="workflow.field.outcome" set="actions"> <control template="/org/alfresco/components/form/controls/workflow/custom-activiti-transitions.ftl"> <control-param name="caseID">wf:caseIDNum</control-param> </control> </field>
My problem is that in the share-workflow-form-config.xml where I specify the
control-param
, I can get it to pass in a hard coded value like "30". However, when I try to get the value of the workflow property likewf:caseIDNum
, it returns the actual string in the parameter like:
http://localhost:8080/alfresco/faces/jsp/custom/CodeSelector.jsp?caseID=wfcaseIDNum
as opposed to the actual value for the property, i.e. "30".
Any ideas on what I could be doing wrong?
原文:https://stackoverflow.com/questions/12977225
最满意答案
You probably won't like this answer, but yes, there is a way: check out the source code and improve the exceptions, then post the patch in the issue tracker.
Hint: search for
throw new MappingException
in this directory, there are only three classes that throw this exception.
相关问答
更多-
下列中不属于面向对象的编程语言的是?[2022-05-30]
a -
需要进行调整以使其运行...... 映射应包含传递的参数定义 (检查第一个元素:
) 这里的问题是我使用的Npgsql版本(版本3.0.5)。 该版本似乎存在问题,并且无法正确处理Geometry,因此这就是为什么我得到null。 降级到Npgsql的2.2.7版本,它的工作原理。 我发现的第二个问题是我无法对具有Identity列的表进行任何插入,因此我必须更改方言,按照此链接帮助我。 我还需要声明,如果不是在rsquare的帮助下我无法解决这个问题,那么在Nhibernte和Npgsql的3.x版本之间实际发现了这个问题。 The issue here was that the vers ...NHibernate EntityPersister获取属性信息(访问属性)(NHibernate EntityPersister get property info (access attribute))[2022-03-29]
我不知道你是否可以从persister中获取这些信息。 我有一个问题,我想知道映射细节,我停止使用元数据API,因为它太高级别。 访问NHIbernate配置可提供更多映射详细信息。 foreach (var classMapping in configuration.ClassMappings) { foreach (var property in classMapping.PropertyIterator) { Console.WriteLine("{0} access={1}", ...我认为这完全取决于您使用什么来连接数据库。 每个模块都会显示不同的错误。 我个人使用sqlalchemy,它会给你详细的错误。 这是一个显示我的意思的例子(注意:这只是一个例子,我个人不支持内联sql): import sqlalchemy connection = sqlalchemy.create_engine('sqlite:///mydb.db') cursor = connection.connect() query = "INSERT INTO my_table (id, name) va ...请参阅NHibernate Docs了解各种生成器。 IMO GUID(Comb)或HiLo具有最佳性能,因为可以在应用程序中生成ID。 如果您使用HiLo,您可以轻松切换到没有该功能的ORM,只需创建一个value > max(Id)的序列,并将其用作列的默认值来模拟自动增量。 注意:在我的项目中,我总是使用HiLo成功,所以我有偏见。 see NHibernate Docs for the various generators. IMO GUID(Comb) or HiLo have the best ...NHibernate碎片(NHibernate shards)[2023-07-29]
我一直在和NH Shards合作,我可以说它运作良好。 事实上,互联网上没有太多的信息和例子。 据我所知,它支持NH的所有数据库。 但它有一些局限性,有些功能尚未完全实现。 它适用于Fluent NHibernate API。 您可以从Java JBoss Hibernate Shards项目中找到大多数可以找到的文档。 考虑到NH Shards来自HShards,这个想法是一样的。 以下是一些有用的链接: NH Shards临时主持人: http : //code.google.com/p/nhshard ...NHibernate - 有没有办法从异常中获取更多信息?(NHibernate - is there a way to get more info from its exceptions?)[2022-08-22]
您可能不会喜欢这个答案,但是,有一种方法:查看源代码并改进异常,然后在问题跟踪器中发布补丁。 提示:在此目录中搜索throw new MappingException ,只有三个类抛出此异常。 You probably won't like this answer, but yes, there is a way: check out the source code and improve the exceptions, then post the patch in the issue tracker. H ...NHibernate.Exceptions.GenericADOException为什么?(NHibernate.Exceptions.GenericADOException why?)[2023-06-26]
看起来像StudentId是Guid 。 尝试: return session .Query() .Where(x => x.Student.StudentId.Equals(studentId)) .ToList(); 编辑:内部异常: Message=Incorrect syntax near the keyword 'Add' 生成的sql有一个名为Add的列,尝试在映射规则中重命名它。 select courseperm0_.PermissionI ... 一个简单的解决方法是使用您自己的IRevisionListener。 在那里你将timestamp值设置为DateTime.UtcNow或其他。 假设你正在使用FluentConfiguration ...... var enversCfg = new FluentConfiguration(); enversCfg.SetRevisionEntity(r => r.Id, r=> r.RevisionDate, yourRevisionListener>(); ... 相关文章
更多- My W3C Custom Mapping File
- 在freemark的ftl文件,参数格式不对
- Java 流(Stream)、文件(File)和IO
- 用‘button’跟‘text’组合代替‘file’,选择文件后点‘submit’,‘file’的值被清空
- PHP 中dirname(_file_)
- xxx is not in the sudoers file解决方法
- 【HDFS】HADOOP DISTRIBUTED FILE SYSTEM
- shell 脚本执行,出现错误bad interpreter: No such file or directory
- file_get_contents 无法读取https的问题解决!
- 工作流及activiti介绍
最新问答
更多- 获取MVC 4使用的DisplayMode后缀(Get the DisplayMode Suffix being used by MVC 4)
- 如何通过引用返回对象?(How is returning an object by reference possible?)
- 矩阵如何存储在内存中?(How are matrices stored in memory?)
- 每个请求的Java新会话?(Java New Session For Each Request?)
- css:浮动div中重叠的标题h1(css: overlapping headlines h1 in floated divs)
- 无论图像如何,Caffe预测同一类(Caffe predicts same class regardless of image)
- xcode语法颜色编码解释?(xcode syntax color coding explained?)
- 在Access 2010 Runtime中使用Office 2000校对工具(Use Office 2000 proofing tools in Access 2010 Runtime)
- 从单独的Web主机将图像传输到服务器上(Getting images onto server from separate web host)
- 从旧版本复制文件并保留它们(旧/新版本)(Copy a file from old revision and keep both of them (old / new revision))
- 西安哪有PLC可控制编程的培训
- 在Entity Framework中选择基类(Select base class in Entity Framework)
- 在Android中出现错误“数据集和渲染器应该不为null,并且应该具有相同数量的系列”(Error “Dataset and renderer should be not null and should have the same number of series” in Android)
- 电脑二级VF有什么用
- Datamapper Ruby如何添加Hook方法(Datamapper Ruby How to add Hook Method)
- 金华英语角.
- 手机软件如何制作
- 用于Android webview中图像保存的上下文菜单(Context Menu for Image Saving in an Android webview)
- 注意:未定义的偏移量:PHP(Notice: Undefined offset: PHP)
- 如何读R中的大数据集[复制](How to read large dataset in R [duplicate])
- Unity 5 Heighmap与地形宽度/地形长度的分辨率关系?(Unity 5 Heighmap Resolution relationship to terrain width / terrain length?)
- 如何通知PipedOutputStream线程写入最后一个字节的PipedInputStream线程?(How to notify PipedInputStream thread that PipedOutputStream thread has written last byte?)
- python的访问器方法有哪些
- DeviceNetworkInformation:哪个是哪个?(DeviceNetworkInformation: Which is which?)
- 在Ruby中对组合进行排序(Sorting a combination in Ruby)
- 网站开发的流程?
- 使用Zend Framework 2中的JOIN sql检索数据(Retrieve data using JOIN sql in Zend Framework 2)
- 条带格式类型格式模式编号无法正常工作(Stripes format type format pattern number not working properly)
- 透明度错误IE11(Transparency bug IE11)
- linux的基本操作命令。。。