View Javadoc
1   package org.kuali.ole.describe.controller;
2   
3   import org.apache.log4j.Logger;
4   import org.kuali.ole.OLEConstants;
5   import org.kuali.ole.QualifiedDublinRecordHandler;
6   import org.kuali.ole.UnQualifiedDublinRecordHandler;
7   import org.kuali.ole.describe.bo.*;
8   import org.kuali.ole.describe.form.EditorForm;
9   import org.kuali.ole.describe.form.WorkBibDublinForm;
10  import org.kuali.ole.docstore.common.document.*;
11  import org.kuali.ole.docstore.common.document.content.enums.DocCategory;
12  import org.kuali.ole.docstore.model.enums.DocFormat;
13  import org.kuali.ole.docstore.model.enums.DocType;
14  import org.kuali.ole.docstore.model.xmlpojo.ingest.AdditionalAttributes;
15  import org.kuali.ole.docstore.model.xmlpojo.ingest.ResponseDocument;
16  import org.kuali.ole.docstore.model.xmlpojo.work.bib.dublin.WorkBibDublinRecord;
17  import org.kuali.ole.describe.service.DocstoreHelperService;
18  import org.kuali.ole.pojo.dublin.unqualified.UnQualifiedDublinRecord;
19  import org.kuali.ole.sys.context.SpringContext;
20  import org.kuali.rice.core.api.config.property.ConfigurationService;
21  import org.kuali.rice.krad.service.BusinessObjectService;
22  import org.kuali.rice.krad.service.KRADServiceLocator;
23  import org.kuali.rice.krad.uif.UifParameters;
24  import org.kuali.rice.krad.util.GlobalVariables;
25  import org.kuali.rice.krad.util.KRADConstants;
26  import org.kuali.rice.krad.web.form.UifFormBase;
27  import org.springframework.validation.BindingResult;
28  import org.springframework.web.bind.annotation.ModelAttribute;
29  import org.springframework.web.bind.annotation.RequestMapping;
30  import org.springframework.web.servlet.ModelAndView;
31  
32  import javax.servlet.http.HttpServletRequest;
33  import javax.servlet.http.HttpServletResponse;
34  import java.text.SimpleDateFormat;
35  import java.util.*;
36  
37  /**
38   * Created with IntelliJ IDEA.
39   * User: pp7788
40   * Date: 12/11/12
41   * Time: 12:02 PM
42   * To change this template use File | Settings | File Templates.
43   */
44  
45  /**
46   * DublinEditorController is the controller class for Dublin Editor
47   */
48  
49  //@Controller
50  //@RequestMapping(value = "/dublincomponents")
51  public class WorkBibDublinEditor
52          extends AbstractEditor
53          implements DocumentEditor {
54      /**
55       * @see org.kuali.rice.krad.web.controller.UifControllerBase#createInitialForm(javax.servlet.http.HttpServletRequest)
56       */
57  
58      private static final Logger LOG = Logger.getLogger(WorkBibDublinEditor.class);
59  
60      private WorkDublinEditorFormDataHandler dublinEditorFormDataHandler;
61      private DocstoreHelperService docstoreHelperService;
62  
63      private static WorkBibDublinEditor workBibDublinEditor = new WorkBibDublinEditor();
64  
65      public static WorkBibDublinEditor getInstance() {
66          return workBibDublinEditor;
67      }
68  
69      private WorkBibDublinEditor() {
70      }
71  
72      /*private boolean  canDisplayBib(String principalId){
73          LOG.debug("Inside the canLoan method");
74          PermissionService service= KimApiServiceLocator.getPermissionService();
75          return  service.hasPermission(principalId,OLEConstants.OlePatron.PATRON_NAMESPACE,OLEConstants.DISPLAY_BIB);
76      }
77  */
78      @Override
79      public EditorForm loadDocument(EditorForm editorForm) {
80          WorkBibDublinForm dublinEditorForm = new WorkBibDublinForm();
81          String docId = editorForm.getDocId();
82          String bibId = editorForm.getBibId();
83          String docFormat = editorForm.getDocFormat();
84          editorForm.setFromDublin(true);
85          List<BibTree> bibTreeList = new ArrayList();
86          BibTree bibTree = null;
87          Bib bib = null;
88  //        editorForm.setHeaderText("Bibliographic Editor - Dublin Core (Unqualified) Format");
89          String directory = SpringContext.getBean(ConfigurationService.class).getPropertyValueAsString(org.kuali.ole.sys.OLEConstants.EXTERNALIZABLE_HELP_URL_KEY);
90          editorForm.setExternalHelpUrl(directory+"/reference/webhelp/OLE/content/ch04s01.html#DublinEditor");
91          editorForm.setHeaderText("Dublin");
92          if (null != docId) {
93              try {
94  
95                  bibTree = getDocstoreClientLocator().getDocstoreClient().retrieveBibTree(docId);
96                  bibTreeList.add(bibTree);
97                  bib = bibTree.getBib();
98                  dublinEditorForm.setBibTreeList(bibTreeList);
99                  if (docFormat.equals(DocFormat.DUBLIN_UNQUALIFIED.getCode())) {
100                     UnQualifiedDublinRecord unQualifiedDublinRecord = new UnQualifiedDublinRecordHandler().fromXML(bib.getContent());
101                     editorForm.setCreatedBy(bib.getStatus());
102                     editorForm.setCreatedDate(bib.getCreatedOn());
103                     editorForm.setUpdatedBy(bib.getUpdatedBy());
104                     editorForm.setUpdatedDate(bib.getUpdatedOn());
105                     editorForm.setStatusUpdatedBy(bib.getStatusUpdatedBy());
106                     editorForm.setStatusUpdatedOn(bib.getStatusUpdatedOn());
107                     editorForm.setStaffOnlyFlagForBib(bib.isStaffOnly());
108                     editorForm.setTitle(getDublinEditorFormDataHandler().buildDublinUnqTitleField(editorForm, unQualifiedDublinRecord));
109                     editorForm.setDublinFieldList(getDublinEditorFormDataHandler().buildDublinUnqEditorFields(editorForm, unQualifiedDublinRecord));
110                     BusinessObjectService boService = KRADServiceLocator.getBusinessObjectService();
111                     Map parentCriteria = new HashMap();
112                     String bibStatusName = bib.getStatus();
113                     parentCriteria.put("bibliographicRecordStatusName", bibStatusName);
114                     OleBibliographicRecordStatus bibliographicRecordStatus = boService
115                             .findByPrimaryKey(OleBibliographicRecordStatus.class, parentCriteria);
116                     editorForm.setOleBibliographicRecordStatus(bibliographicRecordStatus);
117                 } else if (docFormat.equals(DocFormat.DUBLIN_CORE.getCode())) {
118                     WorkBibDublinRecord workBibDublinRecord = new QualifiedDublinRecordHandler().fromXML(bib.getContent());
119                     dublinEditorForm.setDublinFieldList(getDublinEditorFormDataHandler().buildDublinEditorFields(editorForm, workBibDublinRecord));
120                 }
121                 GlobalVariables.getMessageMap().putInfo(KRADConstants.GLOBAL_INFO, "record.load.message");
122             } catch (Exception e) {
123                 LOG.error("Error: Could not load Bib record for id" + docId + ",Cause:" + e.getMessage(), e);
124                 dublinEditorForm.setMessage("Error: Could not load Bib record for id:" + docId);
125             }
126         } else {
127             GlobalVariables.getMessageMap().putInfo(KRADConstants.GLOBAL_INFO, "dublin.editor.new.message");
128         }
129         // addDocumentToTree(editorForm);
130         dublinEditorForm.setViewId("WorkBibDublinEditorViewPage");
131         //dublinEditorForm.setMessage("Please enter details for new Dublin record.");
132         editorForm.setHasLink(false);
133         return dublinEditorForm;
134     }
135 
136 
137     /*private void addDocumentToTree(EditorForm editorForm) {
138         // TODO: Make sure the same document is not added more than once.
139         List<WorkBibDocument> workBibDocumentList = editorForm.getWorkBibDocumentList();
140         int indexOfDocument = 0;
141         int i = 0;
142         String title = "New Bib1";
143         boolean updateTitle = false;
144         if (null == workBibDocumentList) {
145             workBibDocumentList = new ArrayList<WorkBibDocument>();
146         }
147         workBibDocumentList = new ArrayList<WorkBibDocument>();
148         WorkBibDocument tempDocument = new WorkBibDocument();
149         if (null == editorForm.getDocId()) {
150             // LOG.info("workBibDocumentList size before remove-->" + workBibDocumentList.size());
151             for (WorkBibDocument workBibDocument : workBibDocumentList) {
152                 if (workBibDocument.getTitle().equalsIgnoreCase("New Bib1")) {
153                     tempDocument = workBibDocument;
154                     // workBibDocumentList.remove(workBibDocument);
155                 }
156             }
157             workBibDocumentList.remove(tempDocument);
158             // LOG.info("workBibDocumentList size after remove-->" + workBibDocumentList.size());
159 
160             WorkBibDocument workBibDocument = new WorkBibDocument();
161             workBibDocument.setTitle(title);
162             workBibDocumentList.add(workBibDocument);
163         } else {
164             boolean isUpadated = false;
165             for (WorkBibDocument bibDocument : workBibDocumentList) {
166                 if (bibDocument.getId() != null && bibDocument.getId().equals(editorForm.getDocId())) {
167                     isUpadated = true;
168                     break;
169                 } else if (bibDocument.getTitle().equals(title)) {
170                     indexOfDocument = i;
171                     updateTitle = true;
172                     break;
173                 }
174                 i++;
175             }
176             if (!isUpadated) {
177                 WorkBibDocument workBibDocument = new WorkBibDocument();
178                 workBibDocument.setId(editorForm.getDocId());
179                 DocstoreHelperService docstoreHelperService = new DocstoreHelperService();
180                 workBibDocument = docstoreHelperService.getInfoForBibTree(workBibDocument);
181                 if (updateTitle) {
182                     workBibDocumentList.set(indexOfDocument, workBibDocument);
183                 } else {
184                     workBibDocumentList.add(workBibDocument);
185                 }
186             }
187 
188         }
189         editorForm.setWorkBibDocumentList(workBibDocumentList);
190     }*/
191 
192     /*private void updateTreeData(EditorForm editorForm) {
193         int indexOfDocument = 0;
194         List<WorkBibDocument> workBibDocumentList = editorForm.getWorkBibDocumentList();
195         int i = 0;
196         for (WorkBibDocument bibDocument : workBibDocumentList) {
197             if (editorForm.getDocId().equals(bibDocument.getId())) {
198                 indexOfDocument = i;
199                 break;
200             }
201             i++;
202         }
203         DocstoreHelperService docstoreHelperService = new DocstoreHelperService();
204         WorkBibDocument workBibDocument = new WorkBibDocument();
205         workBibDocument.setId(editorForm.getDocId());
206         workBibDocument.setDocFormat(editorForm.getDocFormat());
207         workBibDocument = docstoreHelperService.getInfoForBibTree(workBibDocument);
208 
209         workBibDocumentList.set(indexOfDocument, workBibDocument);
210         editorForm.setWorkBibDocumentList(workBibDocumentList);
211     }*/
212 
213     @Override
214     public EditorForm deleteDocument(EditorForm editorForm) {
215         return new WorkBibDublinForm();
216     }
217 
218     @Override
219     public EditorForm saveDocument(EditorForm editorForm) {
220         WorkBibDublinForm dublinEditorForm = (WorkBibDublinForm) editorForm.getDocumentForm();
221         String bibliographicRecordStatusCode = editorForm.getOleBibliographicRecordStatus().getBibliographicRecordStatusCode();
222         boolean staffOnlyFlag = editorForm.isStaffOnlyFlagForBib();
223         String uuid = editorForm.getDocId();
224         String bibId =  editorForm.getBibId();
225         AdditionalAttributes additionalAttributes = new AdditionalAttributes();
226         ResponseDocument responseDocument = null;
227         Date date = new Date();
228         SimpleDateFormat sdf = new SimpleDateFormat("MM/dd/yyyy HH:mm:ss");
229         String dateStr = sdf.format(date);
230         String user = GlobalVariables.getUserSession().getLoggedInUserPrincipalName();
231         String content = "";
232         String editorStatusMessage = "";
233         BusinessObjectService boService = KRADServiceLocator.getBusinessObjectService();
234         OleBibliographicRecordStatus bibliographicRecordStatus = null;
235         if (bibliographicRecordStatusCode != null) {
236             content = getDublinEditorFormDataHandler().buildDublinRecordForDocStore(editorForm, uuid);
237             Map parentCriteria = new HashMap();
238             parentCriteria.put("bibliographicRecordStatusCode", bibliographicRecordStatusCode);
239             bibliographicRecordStatus = boService.findByPrimaryKey(OleBibliographicRecordStatus.class, parentCriteria);
240         }
241         Bib bib = null;
242         try {
243             if (uuid != null && !uuid.trim().equals("")) {
244 
245                 if (boService != null) {
246 
247                     bib = getDocstoreClientLocator().getDocstoreClient().retrieveBib(bibId);
248                     bib.setStaffOnly(staffOnlyFlag);
249                     bib.setContent(content);
250                     if (bibliographicRecordStatus != null) {
251                         bib.setStatus(bibliographicRecordStatus.getBibliographicRecordStatusName());
252                     } else {
253                         bib.setStatus("");
254                     }
255                     getDocstoreClientLocator().getDocstoreClient().updateBib(bib);
256                     String bibStatusName = bib.getStatus();
257                     editorForm.setCreatedBy(bib.getCreatedBy());
258                     editorForm.setCreatedDate(bib.getCreatedOn());
259                     editorForm.setUpdatedBy(bib.getUpdatedBy());
260                     editorForm.setUpdatedDate(bib.getUpdatedOn());
261                     editorForm.setStatusUpdatedOn(bib.getStatusUpdatedOn());
262                     editorForm.setStatusUpdatedBy(bib.getStatusUpdatedBy());
263                     Map parentCriteria = new HashMap();
264                     parentCriteria.put("bibliographicRecordStatusName", bibStatusName);
265                     bibliographicRecordStatus = boService.findByPrimaryKey(OleBibliographicRecordStatus.class, parentCriteria);
266                     if (bibliographicRecordStatus != null) {
267                         editorForm.setOleBibliographicRecordStatus(bibliographicRecordStatus);
268                     }
269                     editorStatusMessage = "record.update.message";
270                 }
271             } else {
272                 BibTree bibTree = new BibTree();
273                 bib = new BibDcUnqualified();
274                 bib.setCategory(DocCategory.WORK.getCode());
275                 bib.setType(DocType.BIB.getCode());
276                 bib.setFormat(org.kuali.ole.docstore.common.document.content.enums.DocFormat.DUBLIN_UNQUALIFIED.getCode());
277                 bib.setStaffOnly(staffOnlyFlag);
278                 bib.setContent(content);
279                 if (bibliographicRecordStatus != null) {
280                     bib.setStatus(bibliographicRecordStatus.getBibliographicRecordStatusName());
281                 } else {
282                     bib.setStatus("");
283                 }
284                 bibTree.setBib(bib);
285                 HoldingsTree holdingsTree = getHoldingsTree(editorForm.geteResourceId());
286                 bibTree.getHoldingsTrees().add(holdingsTree);
287 
288                 getDocstoreClientLocator().getDocstoreClient().createBib(bib);
289                 holdingsTree.getHoldings().setBib(bib);
290                 getDocstoreClientLocator().getDocstoreClient().createHoldingsTree(holdingsTree);
291                 editorForm.setDocId(bib.getId());
292                 editorForm.setBibId(bib.getId());
293                 List<BibTree> bibTreeList = new ArrayList<>();
294                 bibTreeList.add(bibTree);
295                 editorForm.setBibTreeList(bibTreeList);
296                 editorStatusMessage = "record.create.message";
297                 dublinEditorForm.setUuid("");
298 
299 
300             }
301         } catch (Exception e) {
302             LOG.error("Failed to save record. Cause:" + e.getMessage(), e);
303             dublinEditorForm.setDublinFieldList(Arrays.asList(new WorkDublinEditorField()));
304             dublinEditorForm.setExistingDublinFieldList(new ArrayList<WorkDublinEditorField>());
305             editorStatusMessage = "marc.editor.failure.message";
306         }
307         dublinEditorForm.setViewId("WorkBibDublinEditorViewPage");
308         dublinEditorForm = (WorkBibDublinForm) loadDocument(editorForm);
309         GlobalVariables.getMessageMap().getInfoMessages().clear();
310         GlobalVariables.getMessageMap().putInfo(KRADConstants.GLOBAL_INFO, editorStatusMessage);
311         return dublinEditorForm;
312     }
313 
314     /**
315      * This method   will add the dublin record based on the selected Line index and updates the component.
316      *
317      * @param form
318      * @param result
319      * @param request
320      * @param response
321      * @return ModelAndView
322      */
323     @RequestMapping(params = "methodToCall=addField")
324     public ModelAndView addDublinField(@ModelAttribute("KualiForm") UifFormBase form, BindingResult result,
325                                        HttpServletRequest request, HttpServletResponse response) {
326         WorkBibDublinForm dublinEditorForm = (WorkBibDublinForm) form;
327         int index = Integer.parseInt(form.getActionParamaterValue(UifParameters.SELECTED_LINE_INDEX));
328         index++;
329         List<WorkDublinEditorField> dublinEditorFieldList = dublinEditorForm.getDublinFieldList();
330         dublinEditorFieldList.add(index, new WorkDublinEditorField());
331         //return super.updateComponent(dublinEditorForm, result, request, response);
332         return null;
333     }
334 
335     /**
336      * This method will remove the DublinField based on the index position and updates the component.
337      *
338      * @param form
339      * @param result
340      * @param request
341      * @param response
342      * @return ModelAndView
343      */
344     @RequestMapping(params = "methodToCall=removeField")
345     public ModelAndView removeDublinField(@ModelAttribute("KualiForm") UifFormBase form, BindingResult result,
346                                           HttpServletRequest request, HttpServletResponse response) {
347         WorkBibDublinForm dublinEditorForm = (WorkBibDublinForm) form;
348         int index = Integer.parseInt(form.getActionParamaterValue(UifParameters.SELECTED_LINE_INDEX));
349         String selectedCollection = form.getActionParamaterValue(UifParameters.SELLECTED_COLLECTION_PATH);
350         List<WorkDublinEditorField> dublinEditorFieldList = dublinEditorForm.getDublinFieldList();
351         List<WorkDublinEditorField> existingEditorFieldList;
352         if (dublinEditorFieldList.size() > 1) {
353             dublinEditorFieldList.remove(index);
354         }
355         if (selectedCollection.equalsIgnoreCase("existingDublinFieldList")) {
356             existingEditorFieldList = dublinEditorForm.getExistingDublinFieldList();
357             if (existingEditorFieldList.size() > 0) {
358                 existingEditorFieldList.remove(index);
359             }
360         }
361         //        return super.updateComponent(dublinEditorForm, result, request, response);
362         return null;
363     }
364 
365     /**
366      * This method will ingest new record to docStore if uuid is null else it will update exisiting record.
367      * Once the responce has been received from docStore,then form has been nullified.
368      * if response has not received from docStore then form nullified in catch block.
369      *
370      * @param form
371      * @param result
372      * @param request
373      * @param response
374      * @return ModelAndView
375      */
376     @RequestMapping(params = "methodToCall=submit")
377     public ModelAndView submit(@ModelAttribute("KualiForm") UifFormBase form, BindingResult result,
378                                HttpServletRequest request, HttpServletResponse response) {
379         String responseFromDocstore = null;
380         WorkBibDublinForm dublinEditorForm = (WorkBibDublinForm) form;
381         String uuid = dublinEditorForm.getUuid();
382         String content = getDublinEditorFormDataHandler().buildDublinRecordForDocStore(form, uuid);
383         try {
384             if (uuid != null && !uuid.trim().equals("")) {
385                 responseFromDocstore = getDocstoreHelperService()
386                         .persistToDocstoreForEditor(content, uuid, OLEConstants.UNQUALIFIED_DUBLIN_FORMAT);
387             } else {
388                 responseFromDocstore = getDocstoreHelperService()
389                         .persistToDocstoreForEditor(content, null, OLEConstants.UNQUALIFIED_DUBLIN_FORMAT);
390             }
391             LOG.debug("responseFromDocstore---->" + responseFromDocstore);
392             dublinEditorForm.setDublinFieldList(Arrays.asList(new WorkDublinEditorField()));
393             dublinEditorForm.setExistingDublinFieldList(new ArrayList<WorkDublinEditorField>());
394             dublinEditorForm.setUuid("");
395             //dublinEditorForm.setMessage("Record saved successfully.");
396             GlobalVariables.getMessageMap().putInfo(KRADConstants.GLOBAL_INFO, "record.save.message");
397         } catch (Exception e) {
398             LOG.error("Failed to save record:" + e.getMessage(), e);
399             dublinEditorForm.setDublinFieldList(Arrays.asList(new WorkDublinEditorField()));
400             dublinEditorForm.setExistingDublinFieldList(new ArrayList<WorkDublinEditorField>());
401             //dublinEditorForm.setMessage("Failed to save record.");
402             GlobalVariables.getMessageMap().putInfo(KRADConstants.GLOBAL_INFO, "record.save.fail.message");
403         }
404         //return getUIFModelAndView(dublinEditorForm, "DublinEditorViewPage");
405         return null;
406     }
407 
408     /**
409      * This method will fetch the DublinEditorForm records.
410      *
411      * @param form
412      * @param result
413      * @param request
414      * @param response
415      * @return ModelAndView
416      */
417     @RequestMapping(params = "methodToCall=loadDublinRecord")
418     public ModelAndView loadDublinRecord(@ModelAttribute("KualiForm") UifFormBase form, BindingResult result,
419                                          HttpServletRequest request, HttpServletResponse response) {
420         WorkBibDublinForm dublinEditorForm = (WorkBibDublinForm) form;
421         String uuid = dublinEditorForm.getUuid();
422         try {
423             String docStoreData = getDocstoreHelperService().getDocstoreData(uuid);
424             UnQualifiedDublinRecord unQualifiedDublinRecord = new UnQualifiedDublinRecordHandler()
425                     .fromXML(docStoreData);
426             dublinEditorForm.setExistingDublinFieldList(getDublinEditorFormDataHandler()
427                     .buildDublinUnqEditorFields(dublinEditorForm,
428                             unQualifiedDublinRecord));
429             dublinEditorForm.setDublinFieldList(
430                     new ArrayList<WorkDublinEditorField>(Arrays.asList(new WorkDublinEditorField())));
431             //dublinEditorForm.setUuid("");
432         } catch (Exception e) {
433             LOG.error("Exception:" + e.getMessage(), e);
434         }
435         //return getUIFModelAndView(dublinEditorForm, "DublinEditorViewPage");
436         return null;
437     }
438 
439     /**
440      * Gets the DublinEditorFormDataHandler attribute.
441      *
442      * @return Returns DublinEditorFormDataHandler.
443      */
444     private WorkDublinEditorFormDataHandler getDublinEditorFormDataHandler() {
445         if (null == dublinEditorFormDataHandler) {
446             dublinEditorFormDataHandler = new WorkDublinEditorFormDataHandler();
447         }
448         return dublinEditorFormDataHandler;
449     }
450 
451     /**
452      * Gets the docstoreHelperService attribute.
453      *
454      * @return Returns docstoreHelperService.
455      */
456     private DocstoreHelperService getDocstoreHelperService() {
457         if (null == docstoreHelperService) {
458             return new DocstoreHelperService();
459         }
460         return docstoreHelperService;
461     }
462 
463     /**
464      * Sets the docstoreHelperService attribute value.
465      *
466      * @param docstoreHelperService
467      */
468     public void setDocstoreHelperService(DocstoreHelperService docstoreHelperService) {
469         this.docstoreHelperService = docstoreHelperService;
470     }
471 
472     /**
473      * used for test case.
474      *
475      * @param result
476      * @param request
477      * @param response
478      * @param dublinEditorForm
479      * @return ModelAndView
480      */
481     protected ModelAndView callSuper(BindingResult result, HttpServletRequest request, HttpServletResponse response,
482                                      WorkBibDublinForm dublinEditorForm) {
483         //return super.updateComponent(dublinEditorForm, result, request, response);
484         return null;
485     }
486 
487     @Override
488     public EditorForm addORDeleteFields(EditorForm editorForm, HttpServletRequest request) {
489         String methodName = request.getParameter("methodToCall");
490         if (methodName.equalsIgnoreCase("addField")) {
491             WorkBibDublinForm dublinEditorForm = (WorkBibDublinForm) editorForm.getDocumentForm();
492             int index = Integer.parseInt(editorForm.getActionParamaterValue(UifParameters.SELECTED_LINE_INDEX));
493             index++;
494             List<WorkDublinEditorField> dublinEditorFieldList = editorForm.getDublinFieldList();
495             dublinEditorFieldList.add(index, new WorkDublinEditorField());
496             dublinEditorForm.setDublinFieldList(dublinEditorFieldList);
497             editorForm.setDocumentForm(dublinEditorForm);
498         } else if (methodName.equalsIgnoreCase("removeField")) {
499             WorkBibDublinForm dublinEditorForm = (WorkBibDublinForm) editorForm.getDocumentForm();
500             int index = Integer.parseInt(editorForm.getActionParamaterValue(UifParameters.SELECTED_LINE_INDEX));
501             List<WorkDublinEditorField> editorControlFieldList = editorForm.getDublinFieldList();
502             if (editorControlFieldList.size() > 1) {
503                 editorControlFieldList.remove(index);
504             }
505             editorForm.setDocumentForm(dublinEditorForm);
506         }
507 
508         return editorForm;
509     }
510 
511     @Override
512     public EditorForm deleteVerify(EditorForm editorForm) throws Exception {
513         return null;
514     }
515 
516     @Override
517     public EditorForm delete(EditorForm editorForm) throws Exception {
518         WorkBibDublinForm workBibDublinForm = new WorkBibDublinForm();
519         String docId = editorForm.getDocId();
520         String operation = "delete";
521         getResponseFromDocStore(editorForm, docId, operation);
522         return workBibDublinForm;
523     }
524 
525     @Override
526     public EditorForm addORRemoveExtentOfOwnership(EditorForm editorForm, HttpServletRequest request) {
527         return null;  //To change body of implemented methods use File | Settings | File Templates.
528     }
529 
530     @Override
531     public EditorForm addORRemoveAccessInformationAndHoldingsNotes(EditorForm editorForm, HttpServletRequest request) {
532         return null;  //To change body of implemented methods use File | Settings | File Templates.
533     }
534 
535     @Override
536     public EditorForm addORRemoveItemNote(EditorForm editorForm, HttpServletRequest request) {
537         return null;  //To change body of implemented methods use File | Settings | File Templates.
538     }
539 
540     @Override
541     public EditorForm showBibs(EditorForm editorForm) {
542         return null;
543     }
544 
545     public EditorForm copy(EditorForm editorForm) {
546         return null;
547     }
548 
549 }