1 /******************************************************************************* 2 * Copyright (c) 2003, 2006 IBM Corporation and others. 3 * All rights reserved. This program and the accompanying materials 4 * are made available under the terms of the Eclipse Public License v1.0 5 * which accompanies this distribution, and is available at 6 * http://www.eclipse.org/legal/epl-v10.html 7 * 8 * Contributors: 9 * IBM Corporation - initial API and implementation 10 *******************************************************************************/ 11 package org.eclipse.help; 12 13 import java.io.*; 14 import java.util.Locale; 15 16 /** 17 * Producer capable of generating or otherwise obtaining contents for help 18 * resources. A plug-in can contribute instance of IHelpContentProducer to 19 * <code>"org.eclipse.help.contentProducer"</code> extension point. When 20 * content for a resource is needed from a plug-in is needed, help tries to 21 * obtain content from instance of this class contributed by the plugin. If 22 * IHelpContentProvider does not return the content, help system searches 23 * doc.zip and plug-in install location for the file and reads its content. 24 * 25 * @since 3.0 26 */ 27 public interface IHelpContentProducer { 28 /** 29 * Obtains content of a specified help resource. If resource for a given 30 * path does not exist, a null should be returned. If topic content is 31 * static, and corresponding file exist in a plug-in directory or doc.zip 32 * file, null might be return as help system can read the file content 33 * itself. 34 * 35 * @param pluginID 36 * unique identifier of a plug-in containing the resource 37 * @param href 38 * path of the resource in a plug-in. 39 * <p> 40 * An href has a format <em>path/to/resource</em> or 41 * <em>path/to/resource?parameter=value1¶meter2=value2...</em> 42 * For example, <em>references/myclass.html</em> may be passed. 43 * </p> 44 * @param locale 45 * used by the client. In most cases, content in a user language 46 * should be produced. 47 * @return InputStream or null if specified resource is not dynamic and 48 * should be read from doc.zip or plug-in install location. 49 */ 50 public InputStream getInputStream(String pluginID, String href, 51 Locale locale); 52 } 53