Maximo Anywhere 7.6 - Adding additional field to a list item - Error: Cannot add an item to layout - maximo-anywhere

We are trying to add a field in the SR List screen of Service Request app. We are able to see the additional field's data in the response and see the value in the detail screen. But the same is not visible in the list screen even after we made changes in the WorkListItem.xml. When we looked at the developer logs, we saw an error as below.
Cannot add an item to layout [generated_application_ui_layout_small_WorkListItem_0]. Position [item7] does not exist.
We executed build.xml and also artifact-processor.xml. But if is of no use as we are still getting the error.
Below are code snippets added in the app.xml & WorkListItem.xml.
app.xml
<listItemTemplate id="ServiceRequest.MyReportedSR_serviceRequest_listItemTemplate_WorkListItem" layout="WorkListItem">
.
.
<listtext id="ServiceRequest.MyReportedSR_serviceRequest_WorkListItem_internalpriority" layoutInsertAt="item7" resourceAttribute="internalpriority"/>
</listItemTemplate>
WorkListItem.xml
<layout>
.
.
<row id="row_3">
<column colspan="10" columnid="item7" id="item7_column"/>
</row>
</layout>
Please let us know if we are missing any steps.
Regards,
Karthik

The layoutInsertAt field should point to the id within the layout which is id="item7_column", not "item7".

It looks like the standard Service Requests app has issue when it is referring the Worklistitem layout xml. I have found that there is field mapped to item2 in app.xml but item2 is not present in the layout xml.
I have created a custom layout file copied from the WorkListItem and provided a different name. It worked after referring the new layout xml which included item2(For existing field) and item7 (New Field which we wanted to display) added in the layout xml.

Related

Plone: default display for new created content

I have a browser view my_custom_display, that can be selected for folders using the menu: Display -> my_custom_display.
The problem appears after I select the custom display and I'm trying to create new objects inside the folder with this custom display.
By default all new items seems to have my_custom_display and my solution is to manually fix it with /selectViewTemplate?templateId=folder_listing.
What is the better solution for this situations? (Set a display only for the item itself not any new child inside it.)
(It's annoying because my browser view generates errors if used in wrong place. Yes, I can improve it, but...)
Update:
In /portal_types/Folder/manage_propertiesForm I added my_custom_display in Available view methods. I need it only for specific folders.
Solved by forcing layout setting on folder creation:
<subscriber
for="Products.ATContentTypes.interfaces.IATFolder
Products.Archetypes.event.ObjectInitializedEvent"
handler="my.package.globalhandlers.set_folder_listing_by_default" />
added in configure.cfg.
Then:
def set_folder_listing_by_default(folder, event):
""" Set folder_listing as default Display for new created folders.
"""
folder.setLayout('folder_listing')
Seems not nice, but it solved my issue. :)

Alfresco custom model with sys:base as parent is having property cm:name

I have created a custom model with parent as sys:base and modified the share-config-custom.xml so that I can create the content from the share. After creating the content from share am unable to see the content in share or explore. Instead am getting the below error when checking from document details page.
The item cannot be found. Either you do not have permissions to view the item, it has been removed or it never existed.
In Node browser I can see cm:name in the property field. But as per the alfresco svn, sys:base is not having the property cm:name.
<type name="sys:base">
<title>Base</title>
<mandatory-aspects>
<aspect>sys:referenceable</aspect>
<aspect>sys:localized</aspect>
</mandatory-aspects>
</type>
Can someone please tell how the custom model get the cm:name property?
Also I want to delete the content. Is there any way to delete that content from share or explore?
Thanks in advance!
To delete your content, call the webscript
/slingshot/doclib/action/aspects/node/{store_type}/{store_id}/{id}
and send the sys:temporary as an argument.

Change root element in association picker control in Alfresco Share

I'm using Alfresco Share 4.2c and I have to change a root node of an association picker. When I change some property of my document I want that picker directly points to the folder where my document is placed (parent of my document).
My problem is how to access nodeRef of document from association.ftl. I think that one solution is to use page.url.args.nodeRef, find his parent and add pass it to parameter rootNode. I'm not satisfied with that because it works only if I'm on Edit metadata page and my clients also what to use popup window to manage properties which appears on click Edit Properties link.
In that case I don't have nodeRef of document in url.
Do you have any idea how to solve this?
The best way is to a NodeLocator fur such purposes: http://docs.alfresco.com/4.1/concepts/node-locator-intro.html
the ancestor NodeLocator should be sufficient for your needs. Try the following setting in your form configuration:
<field id="my:association">
<control>
<control-param name="startLocation">{ancestor}</control-param>
</control>
</field>

How to access componentlink field names in third level?

How to access componentlink field names in third level?
I have a schema which contains a field as embeddable schema, in that embeddable schema, I have a component link which is derived from another schema. How can i retrieve the field of that schema?
It really depends on the purpose of those field(s), perhaps you could provide some more information?
Another option not mentioned here is to write your own C# building block to add these 3rd level components to your package. By doing so you make it a lot simpler to work with them in your DWT layout.
For example if your third-level items are used to generate a list of office locations, you could write a C# block to obtain all the relevant office location components and add them to your package as a component list 'Locations' all you would simply need to do in your DWT is loop those items and provide the display you need.
Personally I don't like to use / add functions into DWT, I try to keep it as simple as possible, again if you can provide more information about your scenario that would generate a better answer for you from the community.
As far as I know, you need a special DWT TBB to get some control over your embedded/componentlinks. Maybe you could use Nuno's Get Extensions ? http://www.sdltridionworld.com/community/extension_overview/dreamweaver_get_extension.aspx
Or use Razor Mediator, perhaps:
http://www.sdltridionworld.com/community/2011_extensions/razormediator.aspx
To prevent having to use either the DGX (as MDa suggests) or write a C# TBB (as John Winter suggests), you can also simply call RenderComponentPresentation to render the linked Component with the template that you want to use.
<!-- TemplateBeginRepeat name="Component.Fields.LinkFieldName" -->
##RenderComponentPresentation(Field, "tcm:1-23-32")##
<!-- TemplateEndRepeat -->
Where tcm:1-23-32 it the TCM URI of a Component Template that simply renders the name of the Component as a hyperlink. Inside the DWT that you use in tcm:1-23-32 you can then simply refer to all fields and properties of the linked Component like Component.Title, Component.Fields.Field1, etc.
Note that the relevant topics have been covered already in these other questions/answers:
rendering the title of a linked component - Looping through the multiple component links to get the schema name of the linked component in Dreamweaver TBB in SDL Tridion 2011
getting values of a linked component - Retrieving values of a linked component in Dreamweaver TBB - and making it SiteEditable
handling nested embedded schemas - How to handle nested repeating regions in Dreamweaver TBBs in SDL Tridion 2011 SP1
If somehow these did not help you enough, I suggest you post the XML of your Component and the DWT that you're trying to make work.
Here a quick sample using C#
Session session = engine.GetSession();
Item componentItem = package.GetByName(Package.ComponentName);
Component component = new Component(new TcmUri(componentItem.GetValue("ID")), session);
ItemFields itemFields = new ItemFields(component.Content, component.Schema);
IEnumerable<ComponentLinkField> ie = itemFields.OfType<EmbeddedSchemaField>().OfType<ComponentLinkField>();
for (IEnumerator<ComponentLinkField> e = ie.GetEnumerator(); e.MoveNext(); ) {
Component linkedComponent = e.Current.Value;
}
By using Linq you can navigate through the fields structure really quick and get results. It will give you the Component Links in the third level, of course you can use the same to go deeper in the structure.

How do I customize the print layout of a SharePoint list item?

i need to be able to produce a "pretty" printout of an individual list item's values, with the goals being:
get rid of all navigation
organize data as it would appear on a typical paper form (a customer requirement)
i'm avoiding using InfoPath at this time due to other issues (which i'll post separate questions for...)
for example, i have an individual list item that normally displays similar to the following DispForm.aspx example:
i need a printed version (PrintForm.aspx??) that will display similar to the following example:
from what i can tell, i can't do this just by modifying/creating custom CSS.
it also seems that i can't quite do this just by creating my own "print" version of DispForm.aspx.
any suggestions, ideas, links would be very helpful.
Creating a custom list form is probably what you want. Without the master page attached to it or anything.
You can find a walkthrough here that will get you started:
http://office.microsoft.com/en-us/sharepointdesigner/HA101191111033.aspx
Enjoy.
You could use CSS to hide all the navigation etc. that you don't need using a media="print" stylesheet, but you won't be able to make the exact changes to the layout you've illustrated.
If it doesn't have to be exactly like the example, it would be fairly trivial to hide all but the name->value table and just print that. If you really do need to merge fields and re-layout the table then you likely have to hack up the server-side.
Why can't you create your own version of the page?
Using Sharepoint Designer, you could create a custom aspx page that uses a dataview webpart to do this...
#mortenbpost's link was just what i needed:
Create a new page that contains a custom list form
specifically, here's what you need to do to get a "basic" custom page for a list item -- from which you can completely customize it with XHTML/CSS:
first
ensure your list has all the columns you'll need
second
here's how to create a custom "view" page (virtually the same steps can be followed for a custom "new" or custom "edit" page):
Open MS Office SharePoint Designer
File -> Open Site...
enter your web-site URL
Make sure the "Folder List" Task Pane is visible (Task Panes -> Folder List)
Expand the "Lists" folder
You should see entries like the following:
Announcements
Calendar
...
YOUR LIST NAME
...
Expand the entry with YOUR LIST NAME
You should see entries like the following
Attachments
Items
AllItems.aspx
DispForm.aspx
EditForm.aspx
NewForm.aspx
Right-Click on YOUR LIST NAME
Select New -> ASPX
Re-name the file to something meaningful, like: PrintForm.aspx
Open PrintForm.aspx
View in "Split" mode
In the Code pane, you should see your insert-point inside a blank html form
Insert -> SharePoint Controls -> Custom List Form...
Select YOUR LIST NAME from the first drop-down (List or document library to use for form)
Select "Item" from the second drop-down (Content type to use for form)
Select "Display item form (used to view list items)" (this is where you choose between view, new, edit)
Un-check "Show standard toolbar" when creating a printable form
Click OK
In the Design pane, you should see a basic table layout with labels on the left and values on the right
In the Code pane, you should see such code as the following for every Column in your list (this one's for a "Single line of text" column type):
<tr>
<td width="190px" valign="top" class="ms-formlabel">
<H3 class="ms-standardheader">
<nobr>Column name</nobr>
</H3>
</td>
<td width="400px" valign="top" class="ms-formbody">
<xsl:value-of select="#Column_x0020_name"/>
</td>
</tr>
You can now just take all those <xsl:value-of select="#Column_x0020_name"/> entries and do standard XHTML/CSS layout
To test, save your work
Then, in a web browser, navigate to your SharePoint web-site
Select an item you've already entered data for
Choose "View Item"
In the address bar, replace DispForm.aspx with PrintForm.aspx
some things to keep in mind:
spaces and punctuation characters make for annoying naming of Column name
Column name in the code will have a maximum length of 32 -- any names longer will be truncated, e.g.:
SharePoint Column name: this is a long name
becomes in the code: this_x0020_is_x0020_a_x0020_long
any Column name in the code that would be a duplicate will be length 32 plus a numeric suffix. so, given the above column also exists, we would then have e.g.:
SharePoint Column name: this is a long name also
becomes in the code: this_x0020_is_x0020_a_x0020_long0
if you add columns or modify columns, you'll have to add them in by hand to this page
(do the Insert -> SharePoint Controls -> Custom List Form... on another "dummy" page to get the naming right)
again, i couldn't have done this without #mortenbpost's answer!
*****You can now just take all those entries and do standard XHTML/CSS layout *****
can you expand this with an example on how to do it?
This isn't an answer so much as a note to the above.
Use a custom list form but keep in mind that if any of the columns have versioning turned on you will not be able to get at the "data" easily. For example if one of your colums is a Notes column and everytime someone edits the notes field a new version is appended then none of that is accessible as it's essentially a seperate "list." I'm stuck on this issue as I also have a client asking for a print out which "doesn't look like it's from SharePoint."
Alternatively, you could export to a spreadsheet & print from there.

Resources