001    /**
002     * Copyright (c) 2000-2010 Liferay, Inc. All rights reserved.
003     *
004     * This library is free software; you can redistribute it and/or modify it under
005     * the terms of the GNU Lesser General Public License as published by the Free
006     * Software Foundation; either version 2.1 of the License, or (at your option)
007     * any later version.
008     *
009     * This library is distributed in the hope that it will be useful, but WITHOUT
010     * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS
011     * FOR A PARTICULAR PURPOSE. See the GNU Lesser General Public License for more
012     * details.
013     */
014    
015    package com.liferay.portlet.expando.model;
016    
017    import com.liferay.portal.kernel.exception.PortalException;
018    import com.liferay.portal.kernel.util.UnicodeProperties;
019    import com.liferay.portal.service.ServiceContext;
020    
021    import java.io.Serializable;
022    
023    import java.util.Enumeration;
024    import java.util.Map;
025    
026    /**
027     * @author Raymond Augé
028     */
029    public interface ExpandoBridge {
030    
031            public void addAttribute(String name) throws PortalException;
032    
033            public void addAttribute(String name, int type) throws PortalException;
034    
035            public void addAttribute(String name, int type, Serializable defaultValue)
036                    throws PortalException;
037    
038            public Serializable getAttribute(String name);
039    
040            public Serializable getAttributeDefault(String name);
041    
042            public Enumeration<String> getAttributeNames();
043    
044            public UnicodeProperties getAttributeProperties(String name);
045    
046            public Map<String, Serializable> getAttributes();
047    
048            public int getAttributeType(String name);
049    
050            public String getClassName();
051    
052            public long getClassPK();
053    
054            public long getCompanyId();
055    
056            public boolean hasAttribute(String name);
057    
058            public boolean isIndexEnabled();
059    
060            public void setAttribute(String name, Serializable value);
061    
062            public void setAttributeDefault(String name, Serializable defaultValue);
063    
064            public void setAttributeProperties(
065                    String name, UnicodeProperties properties);
066    
067            public void setAttributes(Map<String, Serializable> attributes);
068    
069            public void setAttributes(ServiceContext serviceContext);
070    
071            public void setClassName(String className);
072    
073            public void setClassPK(long classPK);
074    
075            public void setCompanyId(long companyId);
076    
077            public void setIndexEnabled(boolean indexEnabled);
078    
079    }