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.portal.kernel.workflow;
016    
017    import com.liferay.portal.kernel.util.StringPool;
018    
019    import java.io.InputStream;
020    import java.io.Serializable;
021    
022    import java.util.Map;
023    
024    /**
025     * @author Shuyang Zhou
026     * @author Brian Wing Shun Chan
027     * @author Eduardo Lundgren
028     */
029    public class DefaultWorkflowDefinition
030            implements Serializable, WorkflowDefinition {
031    
032            @Override
033            public String getContent() {
034                    return _content;
035            }
036    
037            @Override
038            public InputStream getInputStream() {
039                    return _inputStream;
040            }
041    
042            @Override
043            public String getName() {
044                    return _name;
045            }
046    
047            @Override
048            public Map<String, Object> getOptionalAttributes() {
049                    return _optionalAttributes;
050            }
051    
052            @Override
053            public String getTitle() {
054                    if (_title == null) {
055                            return StringPool.BLANK;
056                    }
057                    else {
058                            return _title;
059                    }
060            }
061    
062            @Override
063            public String getTitle(String languageId) {
064                    return getTitle();
065            }
066    
067            @Override
068            public int getVersion() {
069                    return _version;
070            }
071    
072            @Override
073            public boolean isActive() {
074                    return _active;
075            }
076    
077            public void setActive(boolean active) {
078                    _active = active;
079            }
080    
081            public void setContent(String content) {
082                    _content = content;
083            }
084    
085            public void setInputStream(InputStream inputStream) {
086                    _inputStream = inputStream;
087            }
088    
089            public void setName(String name) {
090                    _name = name;
091            }
092    
093            public void setOptionalAttributes(Map<String, Object> optionalAttributes) {
094                    _optionalAttributes = optionalAttributes;
095            }
096    
097            public void setTitle(String title) {
098                    _title = title;
099            }
100    
101            public void setVersion(int version) {
102                    _version = version;
103            }
104    
105            private boolean _active;
106            private String _content;
107            private InputStream _inputStream;
108            private String _name;
109            private Map<String, Object> _optionalAttributes;
110            private String _title;
111            private int _version;
112    
113    }