001/* 002 * Copyright (c) 2006-2013 Nuxeo SA (http://nuxeo.com/) and others. 003 * 004 * All rights reserved. This program and the accompanying materials 005 * are made available under the terms of the Eclipse Public License v1.0 006 * which accompanies this distribution, and is available at 007 * http://www.eclipse.org/legal/epl-v10.html 008 * 009 * Contributors: 010 * Vladimir Pasquier <vpasquier@nuxeo.com> 011 */ 012package org.nuxeo.ecm.automation.test.adapter; 013 014import org.apache.commons.logging.Log; 015import org.apache.commons.logging.LogFactory; 016import org.nuxeo.ecm.automation.core.operations.business.adapter.BusinessAdapter; 017import org.nuxeo.ecm.core.api.DocumentModel; 018 019/** 020 * Document Model Adapter example server side 021 */ 022public class BusinessBeanAdapter extends BusinessAdapter { 023 024 private static final Log log = LogFactory.getLog(BusinessBeanAdapter.class); 025 026 /** 027 * Default constructor is needed for jackson mapping 028 */ 029 public BusinessBeanAdapter() { 030 super(); 031 } 032 033 public BusinessBeanAdapter(DocumentModel documentModel) { 034 super(documentModel); 035 } 036 037 public String getTitle() { 038 return (String) getDocument().getPropertyValue("dc:title"); 039 } 040 041 public void setTitle(String value) { 042 getDocument().setPropertyValue("dc:title", value); 043 } 044 045 public String getDescription() { 046 return (String) getDocument().getPropertyValue("dc:description"); 047 } 048 049 public void setDescription(String value) { 050 getDocument().setPropertyValue("dc:description", value); 051 } 052 053 public String getNote() { 054 return (String) getDocument().getPropertyValue("note:note"); 055 } 056 057 public void setNote(String value) { 058 getDocument().setPropertyValue("note:note", value); 059 } 060 061 public Object getObject() { 062 return new String("object"); 063 } 064 065 public void setObject(Object object) { 066 067 } 068 069}