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;
}
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;
}
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 + "\"" : "";
}
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;
}
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;
}
Aggregations