<commit_before>/*
 * @author <a href="mailto:<EMAIL>"><NAME></a>
 * @version $Id$
 */
package org.gridlab.gridsphere.layout;

import org.gridlab.gridsphere.portlet.PortletResponse;
import org.gridlab.gridsphere.portlet.PortletLog;
import org.gridlab.gridsphere.portlet.PortletRequest;
import org.gridlab.gridsphere.portlet.PortletContext;

import java.io.IOException;

public class BasePortletComponent extends PortletContainer implements PortletComponent {

    private static PortletLog log = org.gridlab.gridsphere.portlet.impl.SportletLog.getInstance(BasePortletComponent.class);

    protected String width;
    protected String height;
    protected String name;
    protected String fgColor;
    protected String bgColor = "#CCCCCC";
    protected PortletBorder border;
    protected PortletInsets insets;

    public String getBackground() {
        return bgColor;
    }

    public String getForeground() {
        return fgColor;
    }

    public PortletBorder getPortletBorder() {
        return border;
    }

    public PortletInsets getPortletInsets() {
        return insets;
    }

    public String getName() {
        return name;
    }

    public String getHeight() {
        return height;
    }

    public String getWidth() {
        return width;
    }

    public void setBackground(String bgColor) {
        this.bgColor = bgColor;
    }

    public void setForeground(String ggColor) {
        this.fgColor = fgColor;
    }

    public void setPortletBorder(PortletBorder border) {
        this.border = border;
    }

    public void setName(String name) {
        this.name = name;
    }

    public void setHeight(String height) {
        this.height = height;
    }

    public void setWidth(String width) {
        this.width = width;
    }

    public void setPortletInsets(PortletInsets insets) {
        this.insets = insets;
    }

    public void doRender(PortletContext ctx, PortletRequest req, PortletResponse res) throws PortletLayoutException, IOException {
        log.debug("in doRender()");
        req.setAttribute(LayoutProperties.NAME, name);
        req.setAttribute(LayoutProperties.BGCOLOR, bgColor);
        req.setAttribute(LayoutProperties.FGCOLOR, fgColor);
        req.setAttribute(LayoutProperties.HEIGHT, height);
        req.setAttribute(LayoutProperties.WIDTH, width);
    }
}<commit_msg>*** empty log message ***<commit_after>/*
 * @author <a href="mailto:<EMAIL>"><NAME></a>
 * @version $Id$
 */
package org.gridlab.gridsphere.layout;

import org.gridlab.gridsphere.portlet.PortletResponse;
import org.gridlab.gridsphere.portlet.PortletLog;
import org.gridlab.gridsphere.portlet.PortletRequest;
import org.gridlab.gridsphere.portlet.PortletContext;

import java.io.IOException;

public class BasePortletComponent extends PortletContainer implements PortletComponent {

    private static PortletLog log = org.gridlab.gridsphere.portlet.impl.SportletLog.getInstance(BasePortletComponent.class);

    protected String width;
    protected String height;
    protected String name;
    protected String fgColor;
    protected String bgColor = "#CCCCCC";
    protected PortletBorder border;
    protected PortletInsets insets;

    public String getBackground() {
        return bgColor;
    }

    public String getForeground() {
        return fgColor;
    }

    public PortletBorder getPortletBorder() {
        return border;
    }

    public PortletInsets getPortletInsets() {
        return insets;
    }

    public String getName() {
        return name;
    }

    public String getHeight() {
        return height;
    }

    public String getWidth() {
        return width;
    }

    public void setBackground(String bgColor) {
        this.bgColor = bgColor;
    }

    public void setForeground(String ggColor) {
        this.fgColor = fgColor;
    }

    public void setPortletBorder(PortletBorder border) {
        this.border = border;
    }

    public void setName(String name) {
        this.name = name;
    }

    public void setHeight(String height) {
        this.height = height;
    }

    public void setWidth(String width) {
        this.width = width;
    }

    public void setPortletInsets(PortletInsets insets) {
        this.insets = insets;
    }

    /**
     * @deprecated
     */
    public void doRender(PortletContext ctx, PortletRequest req, PortletResponse res) throws PortletLayoutException, IOException {
        log.debug("in doRender()");
        req.setAttribute(LayoutProperties.NAME, name);
        req.setAttribute(LayoutProperties.BGCOLOR, bgColor);
        req.setAttribute(LayoutProperties.FGCOLOR, fgColor);
        req.setAttribute(LayoutProperties.HEIGHT, height);
        req.setAttribute(LayoutProperties.WIDTH, width);
    }

    public void doRenderFirst(PortletContext ctx, PortletRequest req, PortletResponse res) throws PortletLayoutException, IOException {
        log.debug("in doRender()");
        req.setAttribute(LayoutProperties.NAME, name);
        req.setAttribute(LayoutProperties.BGCOLOR, bgColor);
        req.setAttribute(LayoutProperties.FGCOLOR, fgColor);
        req.setAttribute(LayoutProperties.HEIGHT, height);
        req.setAttribute(LayoutProperties.WIDTH, width);
    }

    public void doRenderLast(PortletContext ctx, PortletRequest req, PortletResponse res) throws PortletLayoutException, IOException {
        log.debug("in doRender()");
        req.removeAttribute(LayoutProperties.NAME);
        req.removeAttribute(LayoutProperties.BGCOLOR);
        req.removeAttribute(LayoutProperties.FGCOLOR);
        req.removeAttribute(LayoutProperties.HEIGHT);
        req.removeAttribute(LayoutProperties.WIDTH);
    }
}
{'fraction_non_alphanumeric': 0.09004237288135593, 'fraction_numerical': 0.0, 'mean_word_length': 3.153225806451613, 'pattern_counts': {'":': 0, '<': 11, '<?xml version=': 0, '>': 11, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '3832633', 'n_tokens_mistral': 1606, 'n_tokens_neox': 1572, 'n_words': 350}