{"id":1233,"date":"2014-10-09T08:36:02","date_gmt":"2014-10-09T06:36:02","guid":{"rendered":"http:\/\/www.capri-soft.de\/blog\/?p=1233"},"modified":"2014-10-09T08:36:02","modified_gmt":"2014-10-09T06:36:02","slug":"ibm-doors-dxl-how-to-create-a-new-view-with-layoutdxl-object-text-and-object-heading-several-attributes","status":"publish","type":"post","link":"https:\/\/www.capri-soft.de\/blog\/?p=1233","title":{"rendered":"IBM Doors DXL: How to create a new view with LayoutDXL, Object Text and Object Heading, several attributes"},"content":{"rendered":"<h1>Problem<\/h1>\n<p>A new view with the Main-Column (Object Heading and Object Text), a LayoutDXL Attribute and any other attribute shall be created.<\/p>\n<h1>Approach<\/h1>\n<ul>\n<li>Create View from Default View (overwrite existing)<\/li>\n<li>Delete all columns in the Default View<\/li>\n<li>Insert Columns<\/li>\n<\/ul>\n<h1>Solution<\/h1>\n<p>With this script you can iterate over all Attributes you can select for the view:<\/p>\n<pre class=\"brush: jscript; title: ; notranslate\" title=\"\">\r\nModule m = current;\r\nstring attr;\r\n\r\nfor attr in m do\r\n{\r\n  print attr &quot;\\n&quot;;\r\n}\r\n<\/pre>\n<p>The following script generates the view:<\/p>\n<pre class=\"brush: jscript; title: ; notranslate\" title=\"\">\r\nvoid createViewForModule(Module m, string viewName)\r\n{\t\r\n  \/\/ construct view of attributes chosen\r\n  Column c;\r\n  int n = 0; \/\/ number of existing columns\r\n  int i; \/\/ column index\r\n\t\r\n  View v = view(viewName);\r\n  bool isLoaded = load(m,v);\r\n\r\n  if(!isLoaded)\r\n  {\r\n    \/\/ If the view is not existing\r\n    \/\/ Save the view\r\n    \/\/ Normally the default View \r\n    \/\/ is constructed \t\r\n    \/\/ save(m,v) is not asking\r\n    \/\/ if a view exists -&amp;gt; it \r\n    \/\/ overwrites any view with\r\n    \/\/ the same name\t\r\n    save(m,v);\r\n   }\t\t\r\n\t\r\n   \/\/ count the columns\r\n   for c in m do\r\n   {\r\n      n++; \r\n   }\r\n\t\r\n   \/\/ Delete all columns that were\r\n   \/\/ contained in the default View\r\n   \/\/ used as template\r\n   for(i=1;i&amp;lt;=n;i++)\r\n   {\r\n     delete(column 0); \r\n   }\r\n\t\r\n   \/\/ Add Object Identifier (i.e. CRS-CS-2)\r\n   insert(column 0);\r\n   attribute(column 0, &quot;Object Identifier&quot;);\r\n   width(column 0, 80);\r\n   justify(column 0, left);\r\n\t\r\n    \/\/ Add the main Column (Object Heading+\r\n    \/\/ Object Text) to the View\r\n    Column mainColumn = null;\r\n    mainColumn = insert mainColumn;\r\n    main mainColumn;\r\n    width(mainColumn, 300);\r\n\t\r\n    \/\/ Add Object Identifier (i.e. CRS-CS-2)\r\n    insert(column 2);\r\n    attribute(column 2, &quot;BB_ReqStatus&quot;);\r\n    width(column 2, 80);\t\r\n\t\r\n    \/\/ Create a LayoutDXL Column in a view\r\n    insert(column 3);  \r\n    \/\/ I would recommend to #include scripts\r\n    dxl(column 3, &quot;displayRich \\&quot;huhu\\&quot;&quot;); \r\n    width(column 3, 80);\t\r\n\r\n    \/\/ important! (last column does not appear\r\n    \/\/ otherwise)\r\n    refresh m; \r\n    save view viewName; \r\n}\r\n<\/pre>\n<iframe src=\"http:\/\/www.facebook.com\/plugins\/like.php?href=https%3A%2F%2Fwww.capri-soft.de%2Fblog%2F%3Fp%3D1233&amp;layout=standard&amp;show_faces=true&amp;width=450&amp;action=like&amp;colorscheme=light\" scrolling=\"no\" frameborder=\"0\" allowTransparency=\"true\" style=\"border:none; overflow:hidden; width:450px;margin-top:5px;\"><\/iframe>","protected":false},"excerpt":{"rendered":"<p>Problem A new view with the Main-Column (Object Heading and Object Text), a LayoutDXL Attribute and any other attribute shall be created. Approach Create View from Default View (overwrite existing) Delete all columns in the Default View Insert Columns Solution With this script you can iterate over all Attributes you can select for the view: &hellip; <a href=\"https:\/\/www.capri-soft.de\/blog\/?p=1233\" class=\"more-link\"><span class=\"screen-reader-text\">IBM Doors DXL: How to create a new view with LayoutDXL, Object Text and Object Heading, several attributes<\/span> weiterlesen <span class=\"meta-nav\">&rarr;<\/span><\/a><\/p>\n","protected":false},"author":1,"featured_media":0,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"_monsterinsights_skip_tracking":false,"_monsterinsights_sitenote_active":false,"_monsterinsights_sitenote_note":"","_monsterinsights_sitenote_category":0,"jetpack_post_was_ever_published":false,"_jetpack_newsletter_access":"","_jetpack_dont_email_post_to_subs":false,"_jetpack_newsletter_tier_id":0,"_jetpack_memberships_contains_paywalled_content":false,"_jetpack_memberships_contains_paid_content":false,"footnotes":"","jetpack_publicize_message":"","jetpack_publicize_feature_enabled":true,"jetpack_social_post_already_shared":true,"jetpack_social_options":{"image_generator_settings":{"template":"highway","default_image_id":0,"font":"","enabled":false},"version":2}},"categories":[22,19],"tags":[],"class_list":["post-1233","post","type-post","status-publish","format-standard","hentry","category-dxl","category-ibm-doors"],"jetpack_publicize_connections":[],"jetpack_featured_media_url":"","jetpack_sharing_enabled":true,"jetpack_shortlink":"https:\/\/wp.me\/p4yGeN-jT","jetpack_likes_enabled":true,"jetpack-related-posts":[],"_links":{"self":[{"href":"https:\/\/www.capri-soft.de\/blog\/index.php?rest_route=\/wp\/v2\/posts\/1233","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/www.capri-soft.de\/blog\/index.php?rest_route=\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/www.capri-soft.de\/blog\/index.php?rest_route=\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/www.capri-soft.de\/blog\/index.php?rest_route=\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/www.capri-soft.de\/blog\/index.php?rest_route=%2Fwp%2Fv2%2Fcomments&post=1233"}],"version-history":[{"count":2,"href":"https:\/\/www.capri-soft.de\/blog\/index.php?rest_route=\/wp\/v2\/posts\/1233\/revisions"}],"predecessor-version":[{"id":1235,"href":"https:\/\/www.capri-soft.de\/blog\/index.php?rest_route=\/wp\/v2\/posts\/1233\/revisions\/1235"}],"wp:attachment":[{"href":"https:\/\/www.capri-soft.de\/blog\/index.php?rest_route=%2Fwp%2Fv2%2Fmedia&parent=1233"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/www.capri-soft.de\/blog\/index.php?rest_route=%2Fwp%2Fv2%2Fcategories&post=1233"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/www.capri-soft.de\/blog\/index.php?rest_route=%2Fwp%2Fv2%2Ftags&post=1233"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}