001/*
002 *  Copyright 2014 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.odf.catalog;
017
018import javax.jcr.Node;
019
020import org.ametys.cms.repository.SimpleIndexableAmetysObject;
021
022/**
023 * Catalog java object
024 */
025public class Catalog extends SimpleIndexableAmetysObject<CatalogFactory>
026{
027    /**
028     * Constructor
029     * @param node The JCR node
030     * @param parentPath The parent path
031     * @param catalogFactory the object factory
032     */
033    public Catalog(Node node, String parentPath, CatalogFactory catalogFactory)
034    {
035        super(node, parentPath, catalogFactory);
036    }
037
038    /**
039     * Get the title of catalog
040     * @return the title
041     */
042    public String getTitle()
043    {
044        return getValue(CatalogModel.TITLE);
045    }
046    
047    /**
048     * Set the title of catalog
049     * @param title the title to set
050     */
051    public void setTitle (String title)
052    {
053        setValue(CatalogModel.TITLE, title);
054    }
055    
056    /**
057     * Set the default state of this catalog
058     * @param isDefault true to set this catalog as the default catalog
059     */
060    public void setDefault(boolean isDefault)
061    {
062        setValue(CatalogModel.IS_DEFAULT, isDefault);
063    }
064    
065    /**
066     * Determines if this catalog is the default catalog
067     * @return true if the catalog is the default catalog
068     */
069    public boolean isDefault()
070    {
071        return getValueOrDefault(CatalogModel.IS_DEFAULT, false);
072    }
073}