001/* 002 * Copyright 2010 Anyware Services 003 * 004 * Licensed under the Apache License, Version 2.0 (the "License"); 005 * you may not use this file except in compliance with the License. 006 * You may obtain a copy of the License at 007 * 008 * http://www.apache.org/licenses/LICENSE-2.0 009 * 010 * Unless required by applicable law or agreed to in writing, software 011 * distributed under the License is distributed on an "AS IS" BASIS, 012 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 013 * See the License for the specific language governing permissions and 014 * limitations under the License. 015 */ 016package org.ametys.cms.contenttype; 017 018import org.apache.avalon.framework.service.ServiceException; 019import org.apache.avalon.framework.service.ServiceManager; 020 021import org.ametys.cms.content.references.RichTextOutgoingReferencesExtractor; 022import org.ametys.cms.transformation.RichTextTransformer; 023import org.ametys.cms.transformation.html.HTMLOutgoingReferencesExtractor; 024import org.ametys.cms.transformation.html.HTMLTransformer; 025 026/** 027 * Type of content which is retrieved from a XML configuration. 028 * TODO document xml configuration 029 * ... 030 * Provides access based on rights and current workflow steps.<p> 031 * It used a configuration file with the following format: 032 * <code><br> 033 * <restrict-to><br> 034 * [<right type="read|write" id="RIGHT_ID"/>]* 035 * <!-- logical OR between several right id of the same type --><br> 036 * [<workflow type="read|write" step="3"/>]* 037 * <!-- logical OR between several workflow step of the same type --><br> 038 * [<cannot type="read|write"/>]*<br> 039 * </restrict-to><br> 040 * </code> 041 */ 042public class HTMLContentType extends DefaultContentType 043{ 044 @Override 045 public void service(ServiceManager manager) throws ServiceException 046 { 047 super.service(manager); 048 _richTextTransformer = (RichTextTransformer) manager.lookup(HTMLTransformer.ROLE); 049 _richTextOutgoingReferencesExtractor = (RichTextOutgoingReferencesExtractor) manager.lookup(HTMLOutgoingReferencesExtractor.ROLE); 050 _richTextUpdater = (RichTextUpdater) manager.lookup(HTMLRichTextUpdater.ROLE); 051 } 052}