Search in sources :

Example 16 with DfDocumentProperties

use of org.dbflute.properties.DfDocumentProperties in project dbflute-core by dbflute.

the class DfSchemaXmlSerializer method createAsCore.

/**
 * Create instance as core process (that is JDBC task).
 * @param dataSource The data source of the database. (NotNull)
 * @return The new instance. (NotNull)
 */
public static DfSchemaXmlSerializer createAsCore(DfSchemaSource dataSource) {
    final DfBuildProperties buildProp = DfBuildProperties.getInstance();
    final DfBasicProperties basicProp = buildProp.getBasicProperties();
    final DfSchemaXmlFacadeProp facadeProp = basicProp.getSchemaXmlFacadeProp();
    final String schemaXml = facadeProp.getProejctSchemaXMLFile();
    final String historyFile = facadeProp.getProjectSchemaHistoryFile();
    final DfSchemaXmlSerializer serializer = newSerializer(dataSource, schemaXml, historyFile);
    final DfDocumentProperties docProp = buildProp.getDocumentProperties();
    final String craftMetaDir = docProp.getCoreCraftMetaDir();
    serializer.enableCraftDiff(dataSource, craftMetaDir, DfCraftDiffAssertDirection.ROLLING_NEXT);
    // to avoid getting nonsense differences in JDBC task
    serializer.keepDefinitionOrderAsPrevious();
    return serializer;
}
Also used : DfDocumentProperties(org.dbflute.properties.DfDocumentProperties) DfBasicProperties(org.dbflute.properties.DfBasicProperties) DfSchemaXmlFacadeProp(org.dbflute.properties.facade.DfSchemaXmlFacadeProp) DfBuildProperties(org.dbflute.DfBuildProperties)

Example 17 with DfDocumentProperties

use of org.dbflute.properties.DfDocumentProperties in project dbflute-core by dbflute.

the class DfProcedureColumnMeta method getColumnCommentForSchemaHtml.

public String getColumnCommentForSchemaHtml() {
    final DfDocumentProperties prop = DfBuildProperties.getInstance().getDocumentProperties();
    String comment = _columnComment;
    comment = prop.resolvePreTextForSchemaHtml(comment);
    return comment;
}
Also used : DfDocumentProperties(org.dbflute.properties.DfDocumentProperties)

Example 18 with DfDocumentProperties

use of org.dbflute.properties.DfDocumentProperties in project dbflute-core by dbflute.

the class DfClassificationGroup method getGroupTitleForSchemaHtml.

public String getGroupTitleForSchemaHtml() {
    final StringBuilder sb = new StringBuilder();
    if (Srl.is_NotNull_and_NotTrimmedEmpty(_groupComment)) {
        sb.append(_groupComment);
    } else {
        sb.append("(no comment)");
    }
    sb.append(" :: ");
    sb.append(_elementNameList);
    final DfDocumentProperties prop = getProperties().getDocumentProperties();
    final String title = prop.resolveAttributeForSchemaHtml(sb.toString());
    return title != null ? " title=\"" + title + "\"" : "";
}
Also used : DfDocumentProperties(org.dbflute.properties.DfDocumentProperties)

Example 19 with DfDocumentProperties

use of org.dbflute.properties.DfDocumentProperties in project dbflute-core by dbflute.

the class DfPropTableLoader method doConvertToMapList.

protected List<Map<String, Object>> doConvertToMapList(final List<JavaPropertiesProperty> propertyList, Map<String, Object> tableMap) {
    final List<String> exceptKeyList = extractExceptKeyList(tableMap);
    final Map<String, String> groupingKeyMap = extractDeterminationMap(tableMap);
    final DfDocumentProperties prop = getDocumentProperties();
    final List<Map<String, Object>> mapList = DfCollectionUtil.newArrayList();
    for (JavaPropertiesProperty property : propertyList) {
        final Map<String, Object> columnMap = DfCollectionUtil.newLinkedHashMap();
        final String propertyKey = property.getPropertyKey();
        if (!isTargetKey(propertyKey, exceptKeyList)) {
            continue;
        }
        columnMap.put("propertyKey", propertyKey);
        final String propertyValue = property.getPropertyValue();
        columnMap.put("propertyValue", propertyValue != null ? propertyValue : "");
        final String valueHtmlEncoded = prop.resolveTextForSimpleLineHtml(propertyValue);
        columnMap.put("propertyValueHtmlEncoded", valueHtmlEncoded != null ? valueHtmlEncoded : "");
        columnMap.put("propertyValueStringLiteral", preparePropertyValueStringLiteral(propertyValue));
        columnMap.put("hasPropertyValue", Srl.is_NotNull_and_NotTrimmedEmpty(propertyValue));
        final String defName = convertToDefName(propertyKey);
        columnMap.put("defName", defName);
        final String camelizedName = Srl.camelize(defName);
        columnMap.put("camelizedName", camelizedName);
        columnMap.put("capCamelName", Srl.initCap(camelizedName));
        columnMap.put("uncapCamelName", Srl.initUncap(camelizedName));
        final List<Integer> variableNumberList = property.getVariableNumberList();
        // old style
        columnMap.put("variableCount", variableNumberList.size());
        columnMap.put("variableNumberCount", variableNumberList.size());
        columnMap.put("variableNumberList", variableNumberList);
        final List<String> variableStringList = property.getVariableStringList();
        columnMap.put("variableStringCount", variableStringList.size());
        columnMap.put("variableStringList", variableStringList);
        columnMap.put("variableArgNameList", property.getVariableArgNameList());
        columnMap.put("variableArgDef", property.getVariableArgDef());
        columnMap.put("variableArgSet", property.getVariableArgSet());
        columnMap.put("hasVariable", !variableStringList.isEmpty());
        final String comment = property.getComment();
        columnMap.put("comment", comment != null ? comment : "");
        final String commentHtmlEncoded = prop.resolveTextForSimpleLineHtml(comment);
        columnMap.put("commentHtmlEncoded", commentHtmlEncoded != null ? commentHtmlEncoded : "");
        columnMap.put("hasComment", Srl.is_NotNull_and_NotTrimmedEmpty(comment));
        columnMap.put("isExtends", property.isExtends());
        columnMap.put("isOverride", property.isOverride());
        columnMap.put("mayBeIntegerProperty", mayBeIntegerProperty(property, comment));
        columnMap.put("mayBeLongProperty", mayBeLongProperty(property, comment));
        columnMap.put("mayBeDecimalProperty", mayBeDecimalProperty(property, comment));
        columnMap.put("mayBeDateProperty", mayBeDateProperty(property, comment));
        columnMap.put("mayBeBooleanProperty", mayBeBooleanProperty(property, comment));
        for (Entry<String, String> entry : groupingKeyMap.entrySet()) {
            final String groupingName = entry.getKey();
            final String keyHint = entry.getValue();
            final String deternationKey = "is" + Srl.initCap(groupingName);
            columnMap.put(deternationKey, isGroupingTarget(propertyKey, keyHint));
        }
        mapList.add(columnMap);
    }
    return mapList;
}
Also used : JavaPropertiesProperty(org.dbflute.helper.jprop.JavaPropertiesProperty) DfDocumentProperties(org.dbflute.properties.DfDocumentProperties) Map(java.util.Map)

Example 20 with DfDocumentProperties

use of org.dbflute.properties.DfDocumentProperties in project dbflute-core by dbflute.

the class DfProcedureMeta method getProcedureCommentForSchemaHtml.

public String getProcedureCommentForSchemaHtml() {
    final DfDocumentProperties prop = getDocumentProperties();
    String comment = _procedureComment;
    comment = prop.resolvePreTextForSchemaHtml(comment);
    return comment;
}
Also used : DfDocumentProperties(org.dbflute.properties.DfDocumentProperties)

Aggregations

DfDocumentProperties (org.dbflute.properties.DfDocumentProperties)34 DfSchemaHtmlBuilder (org.dbflute.logic.doc.schemahtml.DfSchemaHtmlBuilder)4 Map (java.util.Map)3 DfColumnListToStringBuilder (org.dbflute.logic.generate.column.DfColumnListToStringBuilder)3 Entry (java.util.Map.Entry)2 BufferedReader (java.io.BufferedReader)1 BufferedWriter (java.io.BufferedWriter)1 FileInputStream (java.io.FileInputStream)1 FileNotFoundException (java.io.FileNotFoundException)1 FileOutputStream (java.io.FileOutputStream)1 IOException (java.io.IOException)1 InputStreamReader (java.io.InputStreamReader)1 OutputStreamWriter (java.io.OutputStreamWriter)1 UnsupportedEncodingException (java.io.UnsupportedEncodingException)1 BigDecimal (java.math.BigDecimal)1 DfBuildProperties (org.dbflute.DfBuildProperties)1 JavaPropertiesProperty (org.dbflute.helper.jprop.JavaPropertiesProperty)1 DfLanguageDependency (org.dbflute.logic.generate.language.DfLanguageDependency)1 DfLanguageGrammar (org.dbflute.logic.generate.language.grammar.DfLanguageGrammar)1 DfBasicProperties (org.dbflute.properties.DfBasicProperties)1