<commit_before>/*************************************************************************
*
 * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
 *
 * Copyright 2008 by Sun Microsystems, Inc.
 *
 * OpenOffice.org - a multi-platform office productivity suite
 *
 * $RCSfile: QuerySummary.java,v $
 * $Revision: 1.7 $
 *
 * This file is part of OpenOffice.org.
 *
 * OpenOffice.org is free software: you can redistribute it and/or modify
 * it under the terms of the GNU Lesser General Public License version 3
 * only, as published by the Free Software Foundation.
 *
 * OpenOffice.org is distributed in the hope that it will be useful,
 * but WITHOUT ANY WARRANTY; without even the implied warranty of
 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
 * GNU Lesser General Public License version 3 for more details
 * (a copy is included in the LICENSE file that accompanied this code).
 *
 * You should have received a copy of the GNU Lesser General Public License
 * version 3 along with OpenOffice.org.  If not, see
 * <http://www.openoffice.org/license.html>
 * for a copy of the LGPLv3 License.
 *
 ************************************************************************/package com.sun.star.wizards.query;

import com.sun.star.lang.XMultiServiceFactory;
import com.sun.star.wizards.common.*;
import com.sun.star.wizards.ui.FilterComponent;
import com.sun.star.wizards.ui.*;
import com.sun.star.wizards.db.*;
import com.sun.star.beans.*;

public class QuerySummary extends QueryMetaData {
    final protected int RID_QUERY = 2300;
    final protected int RID_REPORT = 2400;
    String sSummary;
    Resource oResource;
    XMultiServiceFactory xMSF;
    private String sSeparator;
    private String sReturnChar;
    private String sAnd;
    private String sOr;


    public QuerySummary(XMultiServiceFactory _xMSF, Resource _oResource) {
        super(_xMSF);
        this.oResource = _oResource;
        this.xMSF = _xMSF;
        sAnd = oResource.getResText(RID_QUERY + 33);
        sOr = oResource.getResText(RID_QUERY + 34);
        sSeparator = oResource.getResText(RID_QUERY + 91);
        sReturnChar = String.valueOf((char) 13) + String.valueOf((char) 13);
    }

    /*  boolean bAssignAliases =        xDBMetaData.supportsColumnAliasing();
        boolean bSupportsGroupByUnrelated = xDBMetaData.supportsGroupByUnrelated();
        boolean bSupportsOrderByUnrelated = xDBMetaData.supportsOrderByUnrelated();
        boolean bSupportsNumericFunctions = xDBMetaData.getNumericFunctions() != "";
                            xDBMetaData.getMaxColumnsInGroupBy();
                            xDBMetaData.getMaxColumnsInOrderBy();
                            xDBMetaData.getMaxColumnsInSelect();
                            xDBMetaData.getMaxCharLiteralLength();  // gef?hrlich, da h?chstwahrscheinlich nicht sauber in jedem Treiber implementiert!!!!!
      *   */

    public void setSummaryString() {
        try {
            String sFieldNamesFraction = "";
            String sSortingFraction = "";
            String sFilterFraction = "";
            String sAggregateFraction = "";
            String sGroupByFraction = "";
            String sHavingFraction = "";
            sFieldNamesFraction = combineFieldNameFraction() + sReturnChar;
            sSortingFraction = combinePartString(RID_QUERY + 51, SortFieldNames, RID_QUERY + 52, RID_QUERY + 93, new String[] { "<FIELDNAME>", "<SORTMODE>" }) + sReturnChar;
            sFilterFraction = combineFilterNameFraction(this.getFilterConditions(), RID_QUERY + 53, RID_QUERY + 54) + sReturnChar;
            //      if (xDBMetaData.getNumericFunctions().length() > 0)
            //          sAggregateFraction = combinePartString(RID_QUERY + 55, AggregateFieldNames, RID_QUERY + 56, RID_QUERY + 95, new String[]{ "<CALCULATEDFUNCTION>", "<FIELDNAME>"}) + sReturnChar;
            if (xDBMetaData.supportsGroupBy()) {
                sGroupByFraction = combinePartString(RID_QUERY + 57, GroupFieldNames, RID_QUERY + 58) + sReturnChar;
                sHavingFraction = combineFilterNameFraction(getGroupByFilterConditions(), RID_QUERY + 59, RID_QUERY + 60);
            }
            // TODO: remove the last return from the string
            sSummary = sFieldNamesFraction + sSortingFraction + sFilterFraction + sAggregateFraction + sGroupByFraction + sHavingFraction;
            sSummary = JavaTools.replaceSubString(sSummary, "", "~");
        } catch (com.sun.star.uno.Exception exception) {
            exception.printStackTrace(System.out);
        }
    }


    public String getSummaryString() {
        return sSummary;
    }<commit_msg>INTEGRATION: CWS rptwizard01 (1.6.104); FILE MERGED 2008/05/21 10:14:16 lla 172.16.31.10: RESYNC: (1.6-1.7); FILE MERGED 2008/02/14 13:14:58 lla 192.168.127.12: #i86092# cleanups<commit_after>/*************************************************************************
*
 * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
 *
 * Copyright 2008 by Sun Microsystems, Inc.
 *
 * OpenOffice.org - a multi-platform office productivity suite
 *
 * $RCSfile: QuerySummary.java,v $
 * $Revision: 1.8 $
 *
 * This file is part of OpenOffice.org.
 *
 * OpenOffice.org is free software: you can redistribute it and/or modify
 * it under the terms of the GNU Lesser General Public License version 3
 * only, as published by the Free Software Foundation.
 *
 * OpenOffice.org is distributed in the hope that it will be useful,
 * but WITHOUT ANY WARRANTY; without even the implied warranty of
 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
 * GNU Lesser General Public License version 3 for more details
 * (a copy is included in the LICENSE file that accompanied this code).
 *
 * You should have received a copy of the GNU Lesser General Public License
 * version 3 along with OpenOffice.org.  If not, see
 * <http://www.openoffice.org/license.html>
 * for a copy of the LGPLv3 License.
 *
 ************************************************************************/package com.sun.star.wizards.query;

import com.sun.star.lang.XMultiServiceFactory;
import com.sun.star.wizards.common.*;
import com.sun.star.wizards.ui.FilterComponent;
import com.sun.star.wizards.ui.*;
import com.sun.star.wizards.db.*;
import com.sun.star.beans.*;

public class QuerySummary extends QueryMetaData {
    final protected int RID_QUERY = 2300;
    final protected int RID_REPORT = 2400;
    String sSummary;
    Resource oResource;
    XMultiServiceFactory xMSF;
    private String sSeparator;
    private String sReturnChar;
    private String sAnd;
    private String sOr;


    public QuerySummary(XMultiServiceFactory _xMSF, Resource _oResource) {
        super(_xMSF);
        this.oResource = _oResource;
        this.xMSF = _xMSF;
        sAnd = oResource.getResText(RID_QUERY + 33);
        sOr = oResource.getResText(RID_QUERY + 34);
        sSeparator = oResource.getResText(RID_QUERY + 91);
        sReturnChar = String.valueOf((char) 13) + String.valueOf((char) 13);
    }

    /*  boolean bAssignAliases =        xDBMetaData.supportsColumnAliasing();
        boolean bSupportsGroupByUnrelated = xDBMetaData.supportsGroupByUnrelated();
        boolean bSupportsOrderByUnrelated = xDBMetaData.supportsOrderByUnrelated();
        boolean bSupportsNumericFunctions = xDBMetaData.getNumericFunctions() != "";
                            xDBMetaData.getMaxColumnsInGroupBy();
                            xDBMetaData.getMaxColumnsInOrderBy();
                            xDBMetaData.getMaxColumnsInSelect();
                            xDBMetaData.getMaxCharLiteralLength();  // gef?hrlich, da h?chstwahrscheinlich nicht sauber in jedem Treiber implementiert!!!!!
      *   */

    public void setSummaryString() {
        try {
            String sFieldNamesFraction = "";
            String sSortingFraction = "";
            String sFilterFraction = "";
            String sAggregateFraction = "";
            String sGroupByFraction = "";
            String sHavingFraction = "";
            sFieldNamesFraction = combineFieldNameFraction() + sReturnChar;
            sSortingFraction = combinePartString(RID_QUERY + 51, getSortFieldNames(), RID_QUERY + 52, RID_QUERY + 93, new String[] { "<FIELDNAME>", "<SORTMODE>" }) + sReturnChar;
            sFilterFraction = combineFilterNameFraction(this.getFilterConditions(), RID_QUERY + 53, RID_QUERY + 54) + sReturnChar;
            //      if (xDBMetaData.getNumericFunctions().length() > 0)
            //          sAggregateFraction = combinePartString(RID_QUERY + 55, AggregateFieldNames, RID_QUERY + 56, RID_QUERY + 95, new String[]{ "<CALCULATEDFUNCTION>", "<FIELDNAME>"}) + sReturnChar;
            if (xDBMetaData.supportsGroupBy()) {
                sGroupByFraction = combinePartString(RID_QUERY + 57, GroupFieldNames, RID_QUERY + 58) + sReturnChar;
                sHavingFraction = combineFilterNameFraction(getGroupByFilterConditions(), RID_QUERY + 59, RID_QUERY + 60);
            }
            // TODO: remove the last return from the string
            sSummary = sFieldNamesFraction + sSortingFraction + sFilterFraction + sAggregateFraction + sGroupByFraction + sHavingFraction;
            sSummary = JavaTools.replaceSubString(sSummary, "", "~");
        } catch (com.sun.star.uno.Exception exception) {
            exception.printStackTrace(System.out);
        }
    }


    public String getSummaryString() {
        return sSummary;
    }
{'fraction_non_alphanumeric': 0.11979276802706704, 'fraction_numerical': 0.017974201733981815, 'mean_word_length': 3.093033318909563, 'pattern_counts': {'":': 0, '<': 13, '<?xml version=': 0, '>': 15, 'https://': 0, 'lorem ipsum': 0, 'www.': 2, 'xml': 0}, 'pii_count': 2, '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': '2008805', 'n_tokens_mistral': 2827, 'n_tokens_neox': 2660, 'n_words': 695}