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