Citation Style Language: Modify the bibliography - citations

I am using Zotero and want to change the bibliography slightly:
<group delimiter="">
<text value=""/>
<text variable="URL"/>
<group prefix=". " suffix="">
<text term="accessed" suffix=" "/>
<date variable="accessed">
<date-part name="day" suffix=" "/>
<date-part name="month" form="" suffix=" "/>
<date-part name="year" form=""/>
</date>
</group>
</group>
In this I suspect the name for the used term in bibliography is used (see below):
accessed 1 March 2017
This I want to change to upper case:
Accessed 1 March 2017
If I change the text term to "Accessed" I get an error
Any suggestions?

You can change <text term="accessed" suffix=" "/> to <text term="accessed" text-case="capitalize-first" suffix=" "/>. See http://docs.citationstyles.org/en/stable/specification.html#text-case.
Alternatively, you can use <text value="Accessed" suffix=" "/>, but generally the use of terms is preferred, because terms allow styles to more easily localize to different languages.

Related

How to implement an editing mode in SAPUI5?

I'm currently building a dynamic table within a sapui5 application. Therefore I'm implementing an editing mode, which is triggered through the click of a button. To change the table cells between view- and edit mode, I defined the following cells:
<items>
<ColumnListItem>
<cells>
<Text text="{Name}" visible="{= !${/editMode}}"/>
<Input value="{Name}" visible="{= ${/editMode}}" change="onChangeName"/>
<Text .../>
<Input .../>
...
</cells>
</ColumnListItem>
</items>
Unfortunately, my code does not work as intended. For example, instead of column 1 switching between the "Text" and "Input" nodes, the text node is displayed in one column and the input node in the following column. How do I get the two nodes in the same column?
View mode (Text text...)
Edit mode (Input value...)
Solved it using SAPUI5's <HBox> tag (Click here for documentation)
The code now looks like that:
<items>
<ColumnListItem>
<cells>
<HBox>
<Text text="{Name}" visible="{= !${/editMode}}"/>
<Input value="{Name}" visible="{= ${/editMode}}" change="onChangeName"/>
</HBox>
<HBox>
<Text .../>
<Input .../>
</HBox>
...
</cells>
</ColumnListItem>
</items>

Expand input suggestion width

Screenshot of the current width:
I'm trying to expand the suggestion popup above.
Since I want to use it in a FilterBar, the Input fields are small and the Table becomes kind of useless. When trying to change the width with the Inspector, it changes back immediately.
The demo code I'm using is rather simple.
<Input xmlns="sap.m"
showSuggestion="true"
showTableSuggestionValueHelp="false"
suggestionRows="{/ZSD_DebiaSet}"
width="200px">
<suggestionColumns>
<Column popinDisplay="Inline" demandPopin="true">
<Label text="Name"/>
</Column>
<Column hAlign="Center" popinDisplay="Inline" demandPopin="true" minScreenWidth="Tablet">
<Label text="Product ID"/>
</Column>
<Column hAlign="Center" popinDisplay="Inline" minScreenWidth="Tablet">
<Label text="Supplier Name"/>
</Column>
<Column hAlign="End" popinDisplay="Inline" demandPopin="true">
<Label text="Price"/>
</Column>
</suggestionColumns>
<suggestionRows>
<ColumnListItem>
<!-- ... -->
</ColumnListItem>
</suggestionRows>
</Input>
Controls extended from sap.m.Input (i.e. including sap.m.MultiInput) have a property called maxSuggestionWidth which will let you have a wider suggestion table than the actual width of your input. Check the property here: https://openui5.hana.ondemand.com/api/sap.m.Input#methods/setMaxSuggestionWidth
If set, the value of this parameter will control the horizontal size of the suggestion list to display more data. This allows suggestion lists to be wider than the input field if there is enough space available. By default, the suggestion list is always as wide as the input field.
Note: The value will be ignored if the actual width of the input field is larger than the specified parameter value.
I added this property with value 500px (just for testing) and the result is the following (The Input width is 200px):
I think this is what you are looking for ^^ Hope it helps!

Can a single cite within a citation reference more than one url/accessed date pairs?

Let's say that I have a reference such as:
title "Hello World"
urls
- http://example.com/foo (accessed 20/03/2018)
- http://example.com/bar (accessed 10/05/2015)
(And let's say that the above reference is processed into a form that a CSL processor can understand; citeproc-js in this case)
Does the CSL specification allow to produce a citation (from this only reference) that looks like this?
Hello World! http://example.com/foo (accessed 20/03/2018); http://example.com/bar (accessed 10/05/2015)
I know I could support one pair with this: (simplified style for the example)
<citation>
<layout>
<text variable="title" suffix=" "/>
<group>
<text variable="URL" suffix=" "/>
<date variable="accessed" prefix="(" suffix=")">
<date-part name="day" suffix="/"/>
<date-part name="month" suffix="/"/>
<date-part name="year"/>
</date>
</group>
</layout>
</citation>
But how do I "iterate" over multiple pairs?
It doesn't seem that the CSL specification nor the schema for CSL data support this. Am I wrong?
You can do this with two citations, e.g.:
- type: webpage
URL: http://example.com/foo (accessed 20/03/2018)
- type: webpage
URL: http://example.com/bar (accessed 10/05/2015)
Style snippet
<citation>
<layout delimiter="; ">
<group>
<text variable="URL" suffix=" "/>
<date variable="accessed" prefix="(" suffix=")">
<date-part name="day" suffix="/"/>
<date-part name="month" suffix="/"/>
<date-part name="year"/>
</date>
</group>
</layout>
</citation>
And then simply include "Hello World!" in the text. Note the delimiter in layout that determines how the two elements are separated.

sap.m.List: Remove Separators and Start Each Item with Bullet

Below is my code: It generates a list with a horizontal separator after every item (Gives a feeling like the rows of the table).
I wish to display it like this instead:
Permissions:
Item 1
Item 2
Item 3
Even if bullet is not possible, at least, plain data one below the other would be nice. I do not want the separator in between.
<List id="PermissionsList"
noDataText="NoPermissions"
includeItemInSelection="true"
items="{PermissionsList>/}"
>
<headerToolbar>
<Toolbar>
<Title
text="Permissions"
level="H3"
/>
</Toolbar>
</headerToolbar>
<StandardListItem title="{PermissionsList>Text}"/>
</List>
You could try
<StandardListItem title="• {PermissionsList>Text}"/>
Which is the html code for bullet point. The alternative is adding a style class and using the :before selector to add whatever you like, it offers more flexibility in terms of styling.
To remove the separators, there's a flag for that:
showSeparators="None"
So the whole thing would be:
<List id="PermissionsList" showSeparators="None" noDataText="NoPermissions" items="{PermissionsList>/}" includeItemInSelection="true">
<headerToolbar>
<Toolbar>
<content>
<Title text="Permissions" level="H3"/>
</content>
</Toolbar>
</headerToolbar>
<StandardListItem title="• {PermissionsList>Text}"/>
</List>

SAPUI5: ObjectAttribute Wrap Text

I am attempting to display a wrapped long text in an ObjectAttribute in an SAP UI5 application:
<List id="__listObjectAttributes" noDataText="Drop list items here" headerText="Shipping Information" items="{Shipments}">
<items>
<ObjectListItem id="__listItemShipments" title="{ShipmentTxt}">
<attributes>
<ObjectAttribute id="__attributeShipmentId" title="Shipment #" text="{Id}"/>
<ObjectAttribute id="__attributeShipmentCode" title="Shipment Code" text="{ShipCd}"/>
<ObjectAttribute id="__attributeShipmentLongText" title="Long Text" text="{LongText}" binding="{ShipmentLongText}"/>
</attributes>
</ObjectListItem>
</items>
</List>
The problem is, when the list is displayed the text is truncated instead of wrapped. I've been looking for ways to wrap the text in an ObjectAttribute, but to no avail.
I have found articles that say both "you can do it" and "you can't do it".
Possible: https://archive.sap.com/discussions/thread/3589475
Not possible: https://experience.sap.com/fiori-design-web/object-list-item/
If it is not possible to add this information to an ObjectAttribute, does anyone know a way to display the same information in a list that will accept wrapped text?
Solution
#Ran Hassid's answer was correct! Using a CustomListItem in combination with a SimpleForm was the best solution. Here is the code I ended up going with:
<List id="__listObjectAttributes" noDataText="Drop list items here" headerText="Shipping Information" items="{Shipments}">
<items>
<CustomListItem id="__listItemShipments">
<content>
<form:SimpleForm id="__formShipmentList" editable="true" layout="GridLayout" labelMinWidth="100">
<form:content>
<!--Id-->
<Label id="__labelShipmentId" text="Id"/>
<Text id="__textShipmentId" text="{Id}"/>
<!--Shipment Code-->
<Label id="__labelShipmentCode" text="Shipment Code"/>
<Text id="__textShipmentCode" text="{ShipCd}"/>
<!--Long text-->
<Label id="__labelShipmentLongText" text="LongText"/>
<Text id="__textShipmentLongText" text="{Longtext}" binding="{ShipmentLongText}"/>
</form:content>
</form:SimpleForm>
</content>
</CustomListItem>
</items>
</List>
Then I added the sap.ui.layout.form to the mvc:View to simplify the code:
<mvc:View xmlns="sap.m" xmlns:mvc="sap.ui.core.mvc" xmlns:semantic="sap.m.semantic" xmlns:form="sap.ui.layout.form" controllerName="shipments.controller.ShipmentDetail">
I think that even if it is possible (I assume via css changes and so on) it is not recommended because it is not part of the ObjectAttribute interface. In order to achieve the same effect you can do one of the following:
Use CustomListItem instead of ObjectListItem and inside the content of it wrap a SimpleForm. The simple form layout should be grid layout because you want to position text next to the title in the same row. In the Text control you can put as longest string as you want and also control on the wrapping of it. So your code should look something like that (I didn't use binding but I assume you will know what to do in your code)
<List noDataText="Drop list items here" id="__list0">
<items>
<CustomListItem type="Navigation" id="__item1">
<content>
<sap.ui.layout.form:SimpleForm xmlns:sap.ui.layout.form="sap.ui.layout.form" xmlns:sap.ui.core="sap.ui.core" editable="true" layout="GridLayout" id="__form0" labelMinWidth="100">
<sap.ui.layout.form:content>
<sap.ui.core:Title text="Title" id="__title0" />
<Label text="Long Text" id="__label1" />
<Text text="Very long text with\nmultiple lines" />
<Label text="Other text" id="__label2" />
<Text text="Some text goes here" />
</sap.ui.layout.form:content>
</sap.ui.layout.form:SimpleForm>
</content>
</CustomListItem>
</items>
</List>
The second option is to use CustomListItem but with VBOX + HBOX. so you have a VBOX which wrap HBOX's and inside each HBOX you put title next to the text.
I recommend to go with the first approach because it's much more clear and responsive.
Good luck.
I would recommend using basic CSS to solve this issue.
XML-View:
...
<ObjectAttribute text="{aVeryLongText}" class="objectAttributeWrapper" />
...
CSS:
.objectAttributeWrapper * {
white-space: pre-line !important;
word-wrap: break-word !important;
}
This will even work if there are changes on the sap.m.ObjectAttribute Interface, since this CSS-Selector grabs all children of the element which we assigned the CSS class to.
Speaking from my experience this was a quick and stable solution. I had to extend a legacy app, where replacing the whole control would result in me needing to rewrite a whole controller.
Works like a charm and didnt break since 1.71.50