001/*
002 *  Copyright 2026 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.plugins.repository.jcr;
017
018import java.util.Collection;
019import java.util.List;
020
021import javax.jcr.Node;
022import javax.jcr.RepositoryException;
023
024import org.ametys.plugins.repository.AmetysRepositoryException;
025import org.ametys.plugins.repository.data.type.ModelItemTypeExtensionPoint;
026import org.ametys.runtime.model.Model;
027
028/**
029 * Implementation of a {@link JCRAmetysObjectFactory},
030 * handling {@link SimpleModelAwareAmetysObject}.<br>
031 */
032public class SimpleModelAwareAmetysObjectFactory extends SimpleAmetysObjectFactory
033{
034    @Override
035    @SuppressWarnings("unchecked")
036    public SimpleModelAwareAmetysObject getAmetysObject(Node node, String parentPath) throws AmetysRepositoryException, RepositoryException
037    {
038        return new SimpleModelAwareAmetysObject(node, parentPath, this);
039    }
040    
041    @Override
042    protected String getModelItemTypeExtensionPointId()
043    {
044        return ModelItemTypeExtensionPoint.ROLE_MODEL_AWARE_BASIC;
045    }
046    
047    /**
048     * retrieves the model of the handled ametys object.
049     * @param ametysObject the handled ametys object
050     * @return the model of the handled ametys object
051     */
052    public Collection<? extends Model> getModel(SimpleModelAwareAmetysObject ametysObject)
053    {
054        return List.of();
055    } 
056}