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.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     */
028    public class DefaultWorkflowDefinition
029            implements Serializable, WorkflowDefinition {
030    
031            public InputStream getInputStream() {
032                    return _inputStream;
033            }
034    
035            public String getName() {
036                    return _name;
037            }
038    
039            public Map<String, Object> getOptionalAttributes() {
040                    return _optionalAttributes;
041            }
042    
043            public String getTitle(){
044                    if (_title == null) {
045                            return StringPool.BLANK;
046                    }
047                    else {
048                            return _title;
049                    }
050            }
051    
052            public String getTitle(String languageId) {
053                    return getTitle();
054            }
055    
056            public int getVersion() {
057                    return _version;
058            }
059    
060            public boolean isActive() {
061                    return _active;
062            }
063    
064            public void setActive(boolean active) {
065                    _active = active;
066            }
067    
068            public void setInputStream(InputStream inputStream) {
069                    _inputStream = inputStream;
070            }
071    
072            public void setName(String name) {
073                    _name = name;
074            }
075    
076            public void setOptionalAttributes(Map<String, Object> optionalAttributes) {
077                    _optionalAttributes = optionalAttributes;
078            }
079    
080            public void setTitle(String title) {
081                    _title = title;
082            }
083    
084            public void setVersion(int version) {
085                    _version = version;
086            }
087    
088            private boolean _active;
089            private InputStream _inputStream;
090            private String _name;
091            private Map<String, Object> _optionalAttributes;
092            private String _title;
093            private int _version;
094    
095    }