共计 2228 个字符,预计需要花费 6 分钟才能阅读完成。
My series of Cloud Application Studio Blogs
- How to detect EditMode in an Embedded Component
- Step by step to enable your custom BO with attachment upload functionality
- Step by step to create an Adobe Print form in Cloud application Studio
I began to learn how to use Cloud Application Studio today and I record what I have learned into this blog regarding how to enable attachment upload functionality for my custom BO.
(1) Create a new BO for example TestBO by copying the following source code in Cloud studio and activate it. Here an association to depedent object AttachmentFolder is declared.
import AP.Common.GDT as apCommonGDT;
businessobject TestBO {[Label("Agreement ID")] [AlternativeKey] element AgreementID:ID;
[Label("Start Date")] element StartDate:Date;
[Label("Close Date")] element CloseDate:Date;
[DependentObject(AttachmentFolder)] node Attachment;
}
(2) Create all necessary UI screens via wizard by right clicking the created BO and choose“Create Screens”from context menu. Once done you should have several automatically created artifacts as displayed below.
(3) Assign your business user to the created work center floorplan and after you log on the system, you should see the below OWL with only one“Export”button existing in toolbar. Without New button it is not possible for us to create some test data. As a result we have to create the New button manually.
Open the OWL in UI Designer, select the toolbar in OWL and click“Configure”button in property tab:
Select“My Button”and click the triangle to move it to the right part.
Choose“QuickCreate”as Semantic, and for OnClick property, leave it as blank.
Under Thing Type section, bind the“Associated Thing Type container”to BO ID field.
And then bind this BO ID field to the automatically created Thing Type Object.
Now you could create new BO instance by pressing the New button, and quick create UI will be displayed:
Click the hyperlink and now you can reach the Thing inspector UI.
Remove unused tab and only keep Attachments tab. Locate the document reuse UI from path listed below, drag it from Configuration Explorer and drop to the area of Attachments tab.
Click Bind button, bind Controller root node to the NodeReference Binding under Interface in the right.
Now you could create new attachment file for a given test BO instance.
Once you have created an attachment and successfully saved it, next time you open the Thing inspector UI, you can observe there is a HTTP request which fetches the attachment data from backend.
In the response, the structure fields are exactly mapped to the corresponding fields in attachment DO.
要获取更多 Jerry 的原创文章,请关注公众号 ” 汪子熙 ”: