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

import org.gridlab.gridsphere.layout.impl.PortletFrameEventImpl;
import org.gridlab.gridsphere.portlet.*;
import org.gridlab.gridsphere.portlet.service.PortletServiceUnavailableException;
import org.gridlab.gridsphere.portlet.service.PortletServiceException;
import org.gridlab.gridsphere.portlet.impl.SportletRequest;
import org.gridlab.gridsphere.portlet.impl.SportletResponse;
import org.gridlab.gridsphere.portlet.impl.SportletWindow;
import org.gridlab.gridsphere.portletcontainer.GridSphereEvent;
import org.gridlab.gridsphere.portletcontainer.GridSphereProperties;
import org.gridlab.gridsphere.portletcontainer.PortletErrorMessage;
import org.gridlab.gridsphere.portletcontainer.UserPortletManager;
import org.gridlab.gridsphere.services.user.UserManagerService;

import java.io.IOException;
import java.io.PrintWriter;
import java.util.ArrayList;
import java.util.Iterator;
import java.util.List;

public class PortletFrame extends BasePortletComponent implements PortletTitleBarListener {

    // renderPortlet is true in doView and false on minimized
    private boolean renderPortlet = true;

    private String componentIDStr = null;

    private PortletWindow portletWindow = null;
    private String portletClass = null;
    private PortletTitleBar titleBar = new PortletTitleBar();
    private List listeners = new ArrayList();
    private PortletErrorMessage error = null;

    public PortletFrame() {}

    public void setPortletClass(String portletClass) {
        this.portletClass = portletClass;
    }

    public String getPortletClass() {
        return portletClass;
    }

    public void setPortletTitleBar(PortletTitleBar titleBar) {
        this.titleBar = titleBar;
    }

    public PortletTitleBar getPortletTitleBar() {
        return titleBar;
    }

    public void setWindowState(String windowState) {
        try {
            portletWindow = new SportletWindow(windowState);
        } catch (Exception e) {
        }
    }

    public String getWindowState() {
        return portletWindow.toString();
    }

    public List init(List list) {
        System.err.println("portlet class is: " + portletClass);
        COMPONENT_ID = list.size();
        ComponentIdentifier compId = new ComponentIdentifier();
        compId.setPortletLifecycle(this);
        compId.setPortletClass(portletClass);
        compId.setComponentID(list.size());
        compId.setClassName(this.getClass().getName());
        list.add(compId);
        if (titleBar != null) {
            titleBar.setPortletClass(portletClass);<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.layout.impl.PortletFrameEventImpl;
import org.gridlab.gridsphere.portlet.*;
import org.gridlab.gridsphere.portlet.service.PortletServiceUnavailableException;
import org.gridlab.gridsphere.portlet.service.PortletServiceException;
import org.gridlab.gridsphere.portlet.impl.SportletRequest;
import org.gridlab.gridsphere.portlet.impl.SportletResponse;
import org.gridlab.gridsphere.portlet.impl.SportletWindow;
import org.gridlab.gridsphere.portletcontainer.GridSphereEvent;
import org.gridlab.gridsphere.portletcontainer.GridSphereProperties;
import org.gridlab.gridsphere.portletcontainer.PortletErrorMessage;
import org.gridlab.gridsphere.portletcontainer.UserPortletManager;
import org.gridlab.gridsphere.services.user.UserManagerService;

import java.io.IOException;
import java.io.PrintWriter;
import java.util.ArrayList;
import java.util.Iterator;
import java.util.List;

public class PortletFrame extends BasePortletComponent implements PortletTitleBarListener {

    // renderPortlet is true in doView and false on minimized
    private boolean renderPortlet = true;

    private String componentIDStr = null;

    private PortletWindow portletWindow = null;
    private String portletClass = null;
    private PortletTitleBar titleBar = new PortletTitleBar();
    private List listeners = new ArrayList();
    private PortletErrorMessage error = null;

    public PortletFrame() {}

    public void setPortletClass(String portletClass) {
        this.portletClass = portletClass;
    }

    public String getPortletClass() {
        return portletClass;
    }

    public void setPortletTitleBar(PortletTitleBar titleBar) {
        this.titleBar = titleBar;
    }

    public PortletTitleBar getPortletTitleBar() {
        return titleBar;
    }

    public void setWindowState(String windowState) {
        try {
            portletWindow = new SportletWindow(windowState);
        } catch (Exception e) {
        }
    }

    public String getWindowState() {
        return portletWindow.toString();
    }

    public List init(List list) {
        System.err.println("portlet class is: " + portletClass);
        COMPONENT_ID = list.size();
        componentIDStr = String.valueOf(COMPONENT_ID);
        ComponentIdentifier compId = new ComponentIdentifier();
        compId.setPortletLifecycle(this);
        compId.setPortletClass(portletClass);
        compId.setComponentID(list.size());
        compId.setClassName(this.getClass().getName());
        list.add(compId);
        if (titleBar != null) {
            titleBar.setPortletClass(portletClass);
{'fraction_non_alphanumeric': 0.09154540431018604, 'fraction_numerical': 0.0, 'mean_word_length': 3.931880108991826, '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': '821301', 'n_tokens_mistral': 1575, 'n_tokens_neox': 1520, 'n_words': 307}