Wiki Markup
{info:title=Jira Ticket}
[https://jira.kuali.org/browse/OLE-2555]
{info}

h1. Instance Editor:

*Purpose:* Editing the instance document within OLE.

*Workflow:* The instance editor should be opened from any screen in which an instance is available for edit/view.

h1. VIEW:   

the Instance editor will contain a left pane/menu (displaying a list of instance/holdings and related items to select from) and a right pane (containing each of the elements within instance/holdings, items, and related metadata). The right pane will break down the elements into logical tabs that group related elements.

   
The Instance Editor View will contain Single Form with Navigation (Tree structure) and two pages ( one for Holdings and the other for Item tab sections), displaying one at a time based on the selected item on left pane. 


h1. !View.png|thumbnail,border=1,width=200!

*Sample code for* *View{*}*:*

<bean id="InstanceEditorView" parent="Uif-FormView">

&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; <property value="Instance Editor"/>

&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; <propertymso-bidi-font-weight:normal">navigation">

&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; <ref bean="LeftPane"/>

&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; </property>

&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; <property>

&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; <list>

&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; <bean parent="*Uif-Page*">

&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; <property name="items">

&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; <list>

&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; <ref bean="*HoldingTabsSection*"/>

&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; </list>

&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; </property>

&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; </bean>

&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; <bean parent="*Uif-Page*">

&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; <property name="items">

&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; <list>

&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<ref bean="*ItemTabsSection*"/>

&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; </list>

&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; </property>

&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; </bean>

&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; </list>

&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; </property>

&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; <property name="footer">

&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; <ref bean="InstanceEditor_Footer" />

&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; </property>

&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; <property value="org.kuali.ole.editor.form.InstanceEditorForm"/>

&nbsp;&nbsp;&nbsp; </bean>

<bean id="*HoldingTabsSection*" parent="*Uif-TabSection*">

&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; <property>

&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; <list>

&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; <ref bean="Holdings"/>

&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; <ref bean="Serial"/>

&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; <ref bean="ActionNotes"/>

&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; <ref bean="ExtentOfOwnership"/>

&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; <ref bean="FormerIdentifiers"/>

&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; </list>

&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; </property>

&nbsp;&nbsp;&nbsp; </bean>

&nbsp;&nbsp;&nbsp; <bean id="ItemTabsSection"&nbsp; &nbsp;parent="*Uif-TabSection*">

&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; <property>

&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; <list>

&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; <ref bean="Item"/>

&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; <ref bean="Location"/>

&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; <ref bean="ElectronicLA"/>

&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; <ref bean="HighDensityStorage"/>

&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; <ref bean="POVendorInfo"/>

&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; </list>

&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; </property>

&nbsp;&nbsp;&nbsp; </bean>



h2. Right Pane\- HoldingTabsSection:


h3. Holdings:&nbsp;&nbsp;&nbsp;

We will use Vertical Box Section with Grid group and Stacked collection.



h3. !HoldingsTab.png|thumbnail,width=200!


h3. Serial:

!Serial.png|thumbnail,width=200!



h3. Action Notes:

For this section, we will use Uif-StackedCollectionSection to repeat entire Action Notes section and Uif-StackedSubCollection-WithinSection to repeat individual fields

h3. Extent of Ownership:&nbsp;

*&nbsp;* !extent.png|thumbnail,width=200!

h3. Former Identifiers:&nbsp;

&nbsp;
*&nbsp;* !FormerIden.png|thumbnail,width=200!

h2. Right Pane\- ItemTabsSection:


h3. Item:

We will use Uif-GridGroup with appropriate controls (text, dropdown).

This tab contains Status, Suppress From Public and Fast Add Flag Metadata fields which can be stored/retrieved from Docstore using Additional Attributes


h3. Location:

We will use Uif-GridGroup with appropriate controls (text, dropdown). And Uif-HorizontalFieldGroup for Call Number section.

h3. Electronic L&A:

We will use Uif-GridGroup with appropriate controls (text, dropdown).

h3. High Density Storage:&nbsp;


h3. !DensityStorage.png|thumbnail,width=100!


h3. PO/Vendor Info:&nbsp;&nbsp;


h3. !VendorInfo.png|thumbnail,width=100!


h2. Audit Details:

The history/audit trail should be available while viewing the instance editor screens. This includes Date Entered, Created By, and multiple Last Updated Date & Last Updated By.
* System Dates/Times should be translated into more easily readable Dates/Times.
* If necessary, use next/prev to paginate the historical updated information.
* This Information should be sortable by date and by user.

*Participants:* InstanceEditorController.java, InstanceEditorView.xml

*Workflow:* Get BIB record through the request in Controller loadInstanceRecord() method.

&nbsp;&nbsp;&nbsp;&nbsp; Set Additional attributes which consists of Date Entered, Created By in both Holdings and Items.

*SampleCode:*

*InstanceEditorController.java*


{code}
public ModeiAndView loadInstanceRecord(@ModelAttribute("KualiForm") UifFormBase form, BindingResult result, HttpServletRequest request, HttpServletResponse response) {

      Set additional attributes for both holdings and items here in this method

}
{code}

*InstanceEditorView.xml*

*//* For Holdings


{code}
<bean id="displayHoldingHistoryLink" parent="Uif-ActionLink" p:actionLabel="Display History" p:clientSideJs="displayHoldingsRecordAuditInfo();"/>
                            <bean id="DisplayHoldingsHistorySection" parent="Uif-VerticalBoxGroup"  p:hidden="true" p:fieldBindingObjectPath="holdingRecordMetaData">
                                <property name="items">
                                    <list>
                                       <bean id="createdSection" parent="Uif-HorizontalBoxSection">
                                            <property name="title" value="CREATED BY"/>
                                            <property name="items">
                                                <list>
                                                    <bean parent="Uif-DataField" p:propertyName="createdBy"
                                                          p:alternateDisplayValue="@

{holdingRecordMetaData.createdBy}
on @

{holdingRecordMetaData.dateEntered}
"
                                                          p:render="@

{holdingRecordMetaData.createdBy ne null}
"/>
                                                </list>
                                            </property>
                                        </bean>
                                        <bean id="BorderSection" parent="Uif-VerticalBoxSection" p:style="height:20px;border-bottom:solid;"/>
                                        <bean id="updatedBySection" parent="Uif-TableCollectionSection" p:layoutManager.numberOfColumns="2" p:style="width:500px">
                                            <property name="title" value="Updated By:" />
                                            <property name="collectionObjectClass"
                                                      value="org.kuali.ole.editor.bo.InstanceRecordUpdatedDetails" />
                                            <property name="propertyName" value="updatedDetailsList" />
                                            <property name="layoutManager.renderSequenceField" value="false" />
                                            <property name="layoutManager.generateAutoSequence" value="false" />
                                            <property name="renderAddLine" value="false"/>
                                            <property name="addLineLabel" value=""/>
                                            <property name="layoutManager.richTable.render" value="true" />
                                            <property name="items">
                                                <list>
                                                    <bean parent="Uif-DataField" p:label="Userid" p:propertyName="lastUpdatedBy">
                                                    </bean>
                                                    <bean parent="Uif-DataField" p:label="Date" p:propertyName="lastUpdated">
                                                    </bean>
                                                </list>
                                            </property>
                                            <property name="renderLineActions" value="false"/>
                                        </bean>
                                    </list>
                                </property>
                            </bean>
{code}
/ For Items


{code}
<bean id="displayItemHistoryLink" parent="Uif-ActionLink" p:actionLabel="Display History" p:clientSideJs="displayItemRecordAuditInfo();"/>
                            <bean id="DisplayItemHistorySection" parent="Uif-VerticalBoxGroup"  p:hidden="true" p:fieldBindingObjectPath="itemRecordMetaData">
                                <property name="items">
                                    <list>
                                        <bean id="itemCreatedSection" parent="Uif-HorizontalBoxSection">
                                            <property name="title" value="CREATED BY"/>
                                            <property name="items">
                                                <list>
                                                    <bean parent="Uif-DataField" p:propertyName="createdBy"
                                                          p:alternateDisplayValue="@

{itemRecordMetaData.createdBy}
on @

{itemRecordMetaData.dateEntered}
"
                                                          p:render="@

{itemRecordMetaData.createdBy ne null}
"/>
                                                </list>
                                            </property>
                                        </bean>
                                        <bean id="itemBorderSection" parent="Uif-VerticalBoxSection" p:style="height:20px;border-bottom:solid;"/>
                                        <bean id="itemUpdatedBySection" parent="Uif-TableCollectionSection" p:layoutManager.numberOfColumns="2" p:style="width:500px">
                                            <property name="title" value="Updated By:" />
                                            <property name="collectionObjectClass"
                                                      value="org.kuali.ole.editor.bo.InstanceRecordUpdatedDetails" />
                                            <property name="propertyName" value="updatedDetailsList" />
                                            <property name="layoutManager.renderSequenceField" value="false" />
                                            <property name="layoutManager.generateAutoSequence" value="false" />
                                            <property name="renderAddLine" value="false"/>
                                            <property name="addLineLabel" value=""/>
                                            <property name="layoutManager.richTable.render" value="true" />
                                            <property name="items">
                                                <list>
                                                    <bean parent="Uif-DataField" p:label="Userid" p:propertyName="lastUpdatedBy">
                                                    </bean>
                                                    <bean parent="Uif-DataField" p:label="Date" p:propertyName="lastUpdated">
                                                    </bean>
                                                </list>
                                            </property>
                                            <property name="renderLineActions" value="false"/>
                                        </bean>
                                    </list>
                                </property>
                            </bean>
{code}
 !image.png|thumbnail,border=1,width=200!






h2. Left Pane:

*Workflow:* Bib record has been selected and the user has indicated they would like to edit the instance/items which are related to it.

Left pane should be Uif-Navigation with Uif-Tree component having hierarchy of Instances and Items related to selected bib.


h3. 1. Load Instance Records for a selected Bib record:

*Participants:* InstanceEditorController.java, InstanceEditorFormDataHandler.java, InstanceEditorView.xml, InstanceEditorForm.java.

*Workflow:*

Get bibId from request in Controller start() Method.

Build data for Left Pane while iterating list of Instance records for bibId.

*Sample Code:*

*InstanceEditorForm.java.*


{code}
private Tree<String, String> instanceHierarchy = new Tree<String, String>()
{code}
// Getters and Setters

*InstanceEditorFormDataHandler.java*

Need to add nodes to Tree by making Holdings as root and items as nodes.


{code}
public InstanceEditorForm buildLeftPaneData(InstanceEditorForm instanceEditorForm)

{ Node<String, String> holdingLevel = new Node<String, String>(textualHolding, textualHolding)  holdingLevel.addChild(new Node<String, String>(itemContent, "Item")); Node<String, String> root = new Node<String, String>("Root", "Root"); root.addChild(holdingLevel); instanceEditorForm.getInstanceHierarchy().setRootElement(root); }
{code}
*torControllerInstanceEditorController.java*



{code}
public ModelAndView start(@ModelAttribute("KualiForm") UifFormBase form, BindingResult result,
                              HttpServletRequest request, HttpServletResponse response)

{ bibId = request.getParameter("bibId"); getInstanceEditorFormDataHandler().buildLeftPaneData(bibId);&nbsp; }


public ModeiAndView loadInstanceRecord(@ModelAttribute("KualiForm") UifFormBase form, BindingResult result, HttpServletRequest request, HttpServletResponse response) {

    calls InstanceEditorFormDataHandler's buildLeftPaneData() method

}
{code}

*InstanceEditorView.xml:*


{code}
<bean id="ExistingRecordNavigation" parent="Uif-TreeSection" p:render="@

{existing eq 'true'}
">

<property name="title" value=""/>

<property name="propertyName" value="instanceHierarchy"/>

</bean>

<bean id="NewRecordNavigation" parent="Uif-VerticalBoxSection" p:render="@

{existing eq 'false'}
">

<property name="items">

<list>

<bean parent="Uif-NavigationActionLink" p:navigateToPageId="HoldingTabs"

p:actionLabel="Holdings"/>

<bean parent="Uif-NavigationActionLink" p:navigateToPageId="ItemTabs"

p:actionLabel="Item"/>

</list>

</property>

</bean>
{code}



h3. 2. Creating a new instance within the instance editor screen:

The system should provide a link or a button that will allow a user to indicate they would like to create a new instance to
be attached to the bibliographic record they are currently looking at the instances off.

 !LeftPane.png|thumbnail,border=1,width=200!

When user clicks the 'Create Instance' button, the result should be to display the instance editor with new (empty) instance and child item -- should be represented on the left hand menu (with a placeholder) so the user has the ability to navigate to the details of the child item and back to the details of the instance. In addition, this will allow users to navigate to the other (existing) instances and items and to create multiple items on the new instance.

*Participants:* InstanceEditorController.java, InstanceEditorFormDataHandler.java, InstanceEditorView.xml


*Sample code:*

&nbsp;&nbsp;&nbsp;

{code}
<bean id="createNewInstance" parent="Uif-SecondaryActionButton" p:methodToCall="createNewInstance" p:actionLabel="Create Instance"/>

&nbsp;&nbsp;&nbsp;    @RequestMapping(params = "methodToCall=createNewInstance")
&nbsp;&nbsp;&nbsp;    public ModelAndView createNewInstance(@ModelAttribute("KualiForm") UifFormBase form, BindingResult result,
                                        HttpServletRequest request, HttpServletResponse response)

{ &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; InstanceEditorForm instanceEditorForm = (InstanceEditorForm) form; &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; //Add New Instance as first record for Uif-Tree in Left pane. &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; HttpServletRequest request, HttpServletResponse response) {
 return super.updateComponent(instanceEditorForm, result, request, response); &nbsp;&nbsp;&nbsp; }
{code}

h4. *Validations*&nbsp;&nbsp;&nbsp;&nbsp; InstanceEditorForm instanceEditorForm = (InstanceEditorForm) form;

&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; //Add New Instance as first record for Uif-Tree in Left pane.

&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; return super.updateComponent(instanceEditorForm, result, request, response);
&nbsp;&nbsp;&nbsp; }

h4. *Validations*&nbsp;:

If the user attempts to click the:

If the user attempts to click the "Create Instance" button while they are working on an un-submitted new
instance, present an error message
&nbsp; 1) If the user attempts to click the "Create Instance" button while they are working on an un-submitted new&nbsp;instance, present an error message&nbsp;("Cannot create additional new instance. Unsaved instance exits.").

&nbsp; 2)&nbsp;If the user attempts to leave this page with an un-submitted new instance, warn them they will lose any unsaved&nbsp;data (An unsaved&nbsp;instance exists are you sure you want to exit? Yes/no)&nbsp;.

&nbsp; 3)&nbsp;If the user attempts to click&nbsp;cancel&nbsp;button with an un-submitted new instance, warn them they will lose any&nbsp;unsaved data&nbsp;(An unsaved&nbsp;instance exists are you sure you want to cancel? Yes/no)&nbsp;.

&nbsp; \*Participants : &nbsp;*InstanceEditorController.java,&nbsp;InstanceEditorForm.java, InstanceEditorView.xml.

&nbsp;&nbsp;*Sample code:&nbsp;*
*&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;*<bean*

{code}
 <bean id="MessageSection" parent="Uif-VerticalBoxSection">
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;                                <property name="items">
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <list>
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;<bean                                      <list>
                                           <bean parent="Uif-MessageField" p:messageText="@

{message}
" p:styleClasses="messageClass"/>&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;>                                      </list>
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;</property>
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; </bean>

                               </property>
                        </bean>
{code}h3. 3. Creating a new Item (on an existing Instance):

&nbsp;Each Instance should have an icon next to it that when clicked will create a new item within that instance
&nbsp;&nbsp;

&nbsp;&nbsp; !aadi create new.png|thumbnail,border=1,width=200!

When user clicks the 'New Item Icon/Button' button, the result should be to display the item editor with new (empty) item -- should be represented on the left hand menu (with a placeholder) so the user has the ability to navigate to the details of the item. In addition, this will allow users to navigate to the other (existing) items and to create multiple items on the new instance.


*Participants:*&nbsp;InstanceEditorController.java, InstanceEditorFormDataHandler.java, InstanceEditorView.xml

*Sample code:*

&nbsp;&nbsp;&nbsp; <bean id="createNewItem" parent="Uif-SecondaryActionButton" p:methodToCall="createNewItem" p:actionLabel="Create New Item"/>

&nbsp;&nbsp;&nbsp; @RequestMapping(params = "methodToCall=createNewItem")
&nbsp;&nbsp;&nbsp; public ModelAndView createNewItem(@ModelAttribute("KualiForm") UifFormBase form, BindingResult result,
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; HttpServletRequest request, HttpServletResponse response){ &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; InstanceEditorForm instanceEditorForm = (InstanceEditorForm) form; &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; //Add New Item as first record for Uif-Tree in Left pane. &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; return super.updateComponent(instanceEditorForm, result, request, response); &nbsp;&nbsp;&nbsp; }

h4. *Validations*&nbsp;:

If the user attempts to click the "Create Instance" button while they are working on an un-submitted new
instance, present an error message
&nbsp; 1) If the user attempts to click the "Create&nbsp;Item" button while they are working on an un-submitted new&nbsp;item, present an error message&nbsp;("Cannot create additional new&nbsp;item. Unsaved&nbsp;item&nbsp;exits.").

&nbsp; 2)&nbsp;If the user attempts to leave this page with an un-submitted new&nbsp;item, warn them they will lose any unsaved&nbsp;data (An unsaved&nbsp;item&nbsp;exists are you sure you want to exit? Yes/no)&nbsp;.

&nbsp; 3)&nbsp;If the user attempts to click&nbsp;cancel&nbsp;button with an un-submitted new&nbsp;item, warn them they will lose any&nbsp;unsaved data&nbsp;(An unsaved&nbsp;item&nbsp;exists are you sure you want to cancel? Yes/no)&nbsp;.

&nbsp;*&nbsp;Participants : &nbsp;*InstanceEditorController.java,&nbsp;InstanceEditorForm.java, InstanceEditorView.xml.

&nbsp;&nbsp;*Sample code:&nbsp;*
*&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;*
{code}
<bean id="MessageSection" parent="Uif-VerticalBoxSection">
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;                                <property name="items">
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <list>
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;<bean                                      <list>
                                           <bean parent="Uif-MessageField" p:messageText="@&nbsp;{message}
" p:styleClasses="messageClass"/>&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;/>                                      </list>
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;</property>
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; </bean>

h1.
                               </property>
                        </bean>
{code}

h1. FORM:

Instance Editor Form will hold all related data to display in UI.


*Sample Form:*

public class InstanceEditorForm extends UifFormBase {

&nbsp;&nbsp;&nbsp; private OleInstance instance;&nbsp;

&nbsp;&nbsp;&nbsp; private InstanceRecordMetaData itemRecordMetaData;

&nbsp;&nbsp;&nbsp; private InstanceRecordMetaData holdingRecordMetaData;

&nbsp;&nbsp;&nbsp; private String uuid;

&nbsp;&nbsp;&nbsp; private Tree<String, String> instanceHierarchy;

&nbsp;&nbsp;&nbsp; private String message;

&nbsp;&nbsp;&nbsp; //getters and setters


}

h1. CONTROLLER:

InstanceEditorController will extend from UifControllerBase and will have the following methods
# start()
# submit()
# loadInstanceRecord()

h1. Test-Cases:

# InstanceEditorController_UT
## testSubmit()
# DocstoreHelperService_UT
## testCreateNewInstanceRecordToDocstore()

h1. DocStore Fields Mapping:

The below link will provide details of Fields using in different tabs along with docstore filed mapping.


*&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;**[Docstore-field-mapping|^Docstore-field-mapping.xlsx]**&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;*


h1. DocStore Handlers :

These handlers are for converting Form data to XML and vice-versa.


# WorkInstanceOlemlRecordProcessor
# WorkHoldingOlemlRecordProcessor
# WorkItemOlemlRecordProcessor

h1. Drop-down source data Mapping:

[dropdown_Source_data|^dropdown_Source_data.xlsx]






















h1. Q&A:

| Scenario | Question | Answer |
| When   the instance is being displayed the instance.instanceIdentifier   (System-assigned unique ID for the Instance Document.) should be visible.   When an item is being displayed the item.itemIdentifier (Maps to MFHD 876 $a   Internal item number - System-assigned unique ID) should be visible. | Where   we need to display this Information? | Display   at the top of each tab |
| Metadata   fields (Last Updated by, Date) | Which   data we need to display?( Means Holdings will contain its own data and item   records will have its own data. Also, from docstore, we will get dateEntered   and lastUpdated only. What about updated By, Created) | When   click on holdings, display holding metadata and when click on Item display   Item data. |
| For   Audit, asking to show at least 10 update initially ( | From   where we can get this information? | Need   to implement logic in docstore (maintain Version) |
| ACCESS   METHOD & RELATIONSHIP / REQUIRED FIELDS \[5\]: These fields are only   required if electronicLocationAndAccess element is used. | Here   what "used" means? | Refers to Required   field. Means if Electronic Location & Access tab is used, then \[5\] is   mandatory |
| Referring   to User requirements document, we do have mock UI screens for Holdings   tab-Location, Serial and Action Notes. | What   about remaining tabs? | No   mock-ups |
| Holdings   and Item tabs | Form   where we can get data for dropdown fields? | Refer   OLE-2806 |
| | What   is the max-length for "token" fields? | | |