001/* 002 * (C) Copyright 2006-2009 Nuxeo SA (http://nuxeo.com/) and contributors. 003 * 004 * All rights reserved. This program and the accompanying materials 005 * are made available under the terms of the GNU Lesser General Public License 006 * (LGPL) version 2.1 which accompanies this distribution, and is available at 007 * http://www.gnu.org/licenses/lgpl.html 008 * 009 * This library is distributed in the hope that it will be useful, 010 * but WITHOUT ANY WARRANTY; without even the implied warranty of 011 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU 012 * Lesser General Public License for more details. 013 * 014 * Contributors: 015 * Nuxeo 016 */ 017 018package org.nuxeo.ecm.platform.publisher.remoting.client; 019 020import org.nuxeo.ecm.core.api.DocumentModel; 021import org.nuxeo.ecm.core.api.NuxeoException; 022import org.nuxeo.ecm.platform.publisher.api.AbstractBasePublishedDocumentFactory; 023import org.nuxeo.ecm.platform.publisher.api.PublicationNode; 024import org.nuxeo.ecm.platform.publisher.api.PublishedDocument; 025import org.nuxeo.ecm.platform.publisher.api.PublishedDocumentFactory; 026 027import java.util.Map; 028 029/** 030 * Implementation of {@link PublishedDocumentFactory} for local tree pointing to a remote tree. This basically means 031 * that the only job done by the {@link PublishedDocumentFactory} is snaphoting the document before sending it for 032 * remote publishing. 033 * 034 * @author tiry 035 */ 036public class ClientProxyFactory extends AbstractBasePublishedDocumentFactory implements PublishedDocumentFactory { 037 038 public PublishedDocument publishDocument(DocumentModel doc, PublicationNode targetNode) { 039 throw new IllegalStateException("ClientProxyFactory can not be called to publish locally"); 040 } 041 042 public PublishedDocument publishDocument(DocumentModel doc, PublicationNode targetNode, Map<String, String> params) 043 { 044 throw new IllegalStateException("ClientProxyFactory can not be called to publish locally"); 045 } 046 047 public PublishedDocument wrapDocumentModel(DocumentModel doc) { 048 throw new NuxeoException("this factory can not wrap a PublishedDocument"); 049 } 050 051}