001    /*
002     * Copyright 2007 The Kuali Foundation
003     * 
004     * Licensed under the Educational Community License, Version 2.0 (the "License");
005     * you may not use this file except in compliance with the License.
006     * You may obtain a copy of the License at
007     * 
008     * http://www.opensource.org/licenses/ecl2.php
009     * 
010     * Unless required by applicable law or agreed to in writing, software
011     * distributed under the License is distributed on an "AS IS" BASIS,
012     * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
013     * See the License for the specific language governing permissions and
014     * limitations under the License.
015     */
016    package org.kuali.rice.kns.web.ui;
017    
018    import java.io.Serializable;
019    
020    import org.apache.commons.lang.StringUtils;
021    import org.kuali.rice.kns.service.KNSServiceLocator;
022    import org.kuali.rice.kns.util.KNSConstants;
023    
024    /**
025     * Represents an extra button that may appear on the lookups or bottom of a
026     * document page.
027     */
028    public class ExtraButton implements Serializable {
029            private String extraButtonSource = "";
030    
031            private String extraButtonAltText = "";
032    
033            private String extraButtonParams = "";
034    
035            private String extraButtonProperty = "";
036    
037            private String extraButtonOnclick = "";
038             
039            public String getExtraButtonAltText() {
040                    return extraButtonAltText;
041            }
042    
043            public void setExtraButtonAltText(String extraButtonAltText) {
044                    this.extraButtonAltText = extraButtonAltText;
045            }
046    
047            public String getExtraButtonParams() {
048                    return extraButtonParams;
049            }
050    
051            public void setExtraButtonParams(String extraButtonParams) {
052                    this.extraButtonParams = extraButtonParams;
053            }
054    
055            public String getExtraButtonProperty() {
056                    return extraButtonProperty;
057            }
058    
059            public void setExtraButtonProperty(String extraButtonProperty) {
060                    this.extraButtonProperty = extraButtonProperty;
061            }
062    
063            public String getExtraButtonSource() {
064                    return extraButtonSource;
065            }
066                
067            public String getExtraButtonOnclick() {
068                return this.extraButtonOnclick;
069            }
070             
071            public void setExtraButtonOnclick(String extraButtonOnclick) {
072                this.extraButtonOnclick = extraButtonOnclick;
073            }
074    
075            public void setExtraButtonSource(String extraButtonSource) {
076                    if (StringUtils.isNotBlank(extraButtonSource)) {
077                            this.extraButtonSource = extraButtonSource
078                                            .replace(
079                                                            "${kr.externalizable.images.url}",
080                                                            KNSServiceLocator
081                                                                            .getKualiConfigurationService()
082                                                                            .getPropertyString(
083                                                                                            KNSConstants.EXTERNALIZABLE_IMAGES_URL_KEY))
084                                            .replace(
085                                                            "${externalizable.images.url}",
086                                                            KNSServiceLocator
087                                                                            .getKualiConfigurationService()
088                                                                            .getPropertyString(
089                                                                                            KNSConstants.APPLICATION_EXTERNALIZABLE_IMAGES_URL_KEY));
090                    }
091            }
092    
093    }