001    /**
002     * Copyright (c) 2000-2013 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.Collection;
024    import java.util.Enumeration;
025    import java.util.Map;
026    
027    /**
028     * @author Raymond Aug??
029     */
030    public interface ExpandoBridge {
031    
032            public void addAttribute(String name) throws PortalException;
033    
034            public void addAttribute(String name, boolean secure)
035                    throws PortalException;
036    
037            public void addAttribute(String name, int type) throws PortalException;
038    
039            public void addAttribute(String name, int type, boolean secure)
040                    throws PortalException;
041    
042            public void addAttribute(String name, int type, Serializable defaultValue)
043                    throws PortalException;
044    
045            public void addAttribute(
046                            String name, int type, Serializable defaultValue, boolean secure)
047                    throws PortalException;
048    
049            public Serializable getAttribute(String name);
050    
051            public Serializable getAttribute(String name, boolean secure);
052    
053            public Serializable getAttributeDefault(String name);
054    
055            public Enumeration<String> getAttributeNames();
056    
057            public UnicodeProperties getAttributeProperties(String name);
058    
059            public Map<String, Serializable> getAttributes();
060    
061            public Map<String, Serializable> getAttributes(boolean secure);
062    
063            public Map<String, Serializable> getAttributes(Collection<String> names);
064    
065            public Map<String, Serializable> getAttributes(
066                    Collection<String> names, boolean secure);
067    
068            public int getAttributeType(String name);
069    
070            public String getClassName();
071    
072            public long getClassPK();
073    
074            public long getCompanyId();
075    
076            public boolean hasAttribute(String name);
077    
078            public boolean isIndexEnabled();
079    
080            public void setAttribute(String name, Serializable value);
081    
082            public void setAttribute(String name, Serializable value, boolean secure);
083    
084            public void setAttributeDefault(String name, Serializable defaultValue);
085    
086            public void setAttributeProperties(
087                    String name, UnicodeProperties properties);
088    
089            public void setAttributeProperties(
090                    String name, UnicodeProperties properties, boolean secure);
091    
092            public void setAttributes(Map<String, Serializable> attributes);
093    
094            public void setAttributes(
095                    Map<String, Serializable> attributes, boolean secure);
096    
097            public void setAttributes(ServiceContext serviceContext);
098    
099            public void setAttributes(ServiceContext serviceContext, boolean secure);
100    
101            public void setClassName(String className);
102    
103            public void setClassPK(long classPK);
104    
105            public void setCompanyId(long companyId);
106    
107            public void setIndexEnabled(boolean indexEnabled);
108    
109    }