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.data.type.impl.HTMLRichTextRepositoryElementType;
023import org.ametys.cms.data.type.impl.RichTextRepositoryElementType;
024import org.ametys.cms.transformation.RichTextTransformer;
025import org.ametys.cms.transformation.html.HTMLOutgoingReferencesExtractor;
026import org.ametys.cms.transformation.html.HTMLTransformer;
027
028/**
029 * Type of content which is retrieved from a XML configuration.
030 * TODO document xml configuration
031 * ...
032 * Provides access based on rights and current workflow steps.<p>
033 * It used a configuration file with the following format:
034 * <code><br>
035 * &nbsp;&nbsp;&lt;restrict-to&gt;<br>
036 * &nbsp;&nbsp;&nbsp;&nbsp;[&lt;right type="read|write" id="RIGHT_ID"/&gt;]*
037 * &nbsp;&nbsp;&lt;!-- logical OR between several right id of the same type --&gt;<br>
038 * &nbsp;&nbsp;&nbsp;&nbsp;[&lt;workflow type="read|write" step="3"/&gt;]*
039 * &nbsp;&nbsp;&lt;!-- logical OR between several workflow step of the same type --&gt;<br>
040 * &nbsp;&nbsp;&nbsp;&nbsp;[&lt;cannot type="read|write"/&gt;]*<br>
041 * &nbsp;&nbsp;&lt;/restrict-to&gt;<br>
042 * </code>
043 * @deprecated Differences of RichText implementations are now managed by the {@link RichTextRepositoryElementType} and the {@link HTMLRichTextRepositoryElementType}
044 */
045@Deprecated
046public class HTMLContentType extends DefaultContentType
047{
048    @Override
049    public void service(ServiceManager manager) throws ServiceException
050    {
051        super.service(manager);
052        _richTextTransformer = (RichTextTransformer) manager.lookup(HTMLTransformer.ROLE);
053        _richTextOutgoingReferencesExtractor = (RichTextOutgoingReferencesExtractor) manager.lookup(HTMLOutgoingReferencesExtractor.ROLE);
054        _richTextUpdater = (RichTextUpdater) manager.lookup(HTMLRichTextUpdater.ROLE);
055    }
056}