use of org.dbflute.exception.DfIllegalPropertySettingException in project dbflute-core by dbflute.
the class DfPropHtmlManager method assertPropHtmlRootFileExists.
protected void assertPropHtmlRootFileExists(Map<String, DfPropHtmlFileAttribute> defaultEnvMap, String requestName, String rootFile) {
if (!defaultEnvMap.isEmpty()) {
return;
}
final ExceptionMessageBuilder br = new ExceptionMessageBuilder();
br.addNotice("Not found the root file for PropertiesHtml.");
br.addItem("Request Name");
br.addElement(requestName);
br.addItem("Root File");
br.addElement(rootFile);
final String msg = br.buildExceptionMessage();
throw new DfIllegalPropertySettingException(msg);
}
use of org.dbflute.exception.DfIllegalPropertySettingException in project dbflute-core by dbflute.
the class DfPropHtmlRequest method checkEnvOnlyNoLang.
protected void checkEnvOnlyNoLang(String propertyKey, DfPropHtmlProperty property) {
if (_envOnlyFloatLeft && property.getLangTypeSet().size() >= 2) {
final ExceptionMessageBuilder br = new ExceptionMessageBuilder();
br.addNotice("Env only mode but two lang types exist.");
br.addItem("Advice");
br.addElement("You cannot use isEnvOnlyFloatLeft if lang type is plural");
br.addElement("in request of PropertiesHtml.");
br.addItem("Request");
br.addElement(_requestName);
br.addItem("Property");
br.addElement(propertyKey);
br.addItem("Lang Types");
br.addElement(property.getLangTypeSet());
final String msg = br.buildExceptionMessage();
throw new DfIllegalPropertySettingException(msg);
}
}
use of org.dbflute.exception.DfIllegalPropertySettingException in project dbflute-core by dbflute.
the class DfAdditionalForeignKeyInitializer method getForeignColumnNameList.
protected List<String> getForeignColumnNameList(String foreignKeyName, final String foreignTableName) {
List<String> foreignColumnNameList = getForeignColumnNameList(foreignKeyName);
if (foreignColumnNameList != null && !foreignColumnNameList.isEmpty()) {
return foreignColumnNameList;
}
foreignColumnNameList = DfCollectionUtil.newArrayList();
final List<Column> foreignPrimaryKeyList = getTable(foreignTableName).getPrimaryKey();
if (foreignPrimaryKeyList.isEmpty()) {
final ExceptionMessageBuilder br = new ExceptionMessageBuilder();
br.addNotice("Not found primary key on the foreign table of additionalForeignKey.");
br.addItem("Advice");
br.addElement("Foreign table should have primary keys.");
br.addItem("Additional FK");
br.addElement(foreignKeyName);
br.addItem("Foreign Table");
br.addElement(foreignTableName);
final String msg = br.buildExceptionMessage();
throw new DfIllegalPropertySettingException(msg);
}
for (Column column : foreignPrimaryKeyList) {
foreignColumnNameList.add(column.getName());
}
return foreignColumnNameList;
}
use of org.dbflute.exception.DfIllegalPropertySettingException in project dbflute-core by dbflute.
the class DfClsTopGroupListArranger method throwClassificationGroupingMapReferenceNotFoundException.
protected void throwClassificationGroupingMapReferenceNotFoundException(List<DfClassificationGroup> groupList, DfClassificationGroup group, String refName) {
final ExceptionMessageBuilder br = new ExceptionMessageBuilder();
br.addNotice("Not found the refenrece in the grouping map.");
br.addItem("Classification Name");
br.addElement(group.getClassificationName());
br.addItem("Group Name");
br.addElement(group.getGroupName());
br.addItem("NotFound Name");
br.addElement(refName);
br.addItem("Defined Group");
for (DfClassificationGroup defined : groupList) {
br.addElement(defined);
}
final String msg = br.buildExceptionMessage();
throw new DfIllegalPropertySettingException(msg);
}
use of org.dbflute.exception.DfIllegalPropertySettingException in project dbflute-core by dbflute.
the class DfLastaFlutePropertiesHtmlReflector method reflectFrom.
// ===================================================================================
// Prepare FreeGen
// ===============
public void reflectFrom(Map<String, Object> lastafluteMap) {
logger.info("Before LastaFlute refecting, existing propertiesHtml settigs: " + _propHtmlMap.keySet());
final boolean lastaEnv = isUseLastaEnv(lastafluteMap);
boolean hasCommonEnv = false;
boolean hasCommonConfig = false;
boolean hasCommonLabel = false;
boolean hasCommonMessage = false;
@SuppressWarnings("unchecked") final Map<String, Object> commonMap = (Map<String, Object>) lastafluteMap.get("commonMap");
if (commonMap != null) {
final String path = (String) commonMap.get("path");
@SuppressWarnings("unchecked") final List<String> propertiesHtmlList = (List<String>) commonMap.getOrDefault(PROPERTIES_HTML_KEY, Collections.emptyList());
for (String propertiesHtml : propertiesHtmlList) {
logger.info("...Reflecting common propertiesHtml settigs: " + propertiesHtml + ", " + path);
if ("env".equals(propertiesHtml)) {
setupEnv(_uncapServiceName, path, false, false, lastaEnv);
hasCommonEnv = true;
} else if ("config".equals(propertiesHtml)) {
setupConfig(_uncapServiceName, path, hasCommonEnv, false, false);
hasCommonConfig = true;
} else if ("label".equals(propertiesHtml)) {
setupLabel(_uncapServiceName, path, false, false);
hasCommonLabel = true;
} else if ("message".equals(propertiesHtml)) {
setupMessage(_uncapServiceName, path, hasCommonLabel, false, false);
hasCommonMessage = true;
} else {
String msg = "Unkonwn type for commonMap's propertiesHtml: " + propertiesHtml;
throw new DfIllegalPropertySettingException(msg);
}
}
}
boolean hasAppEnv = false;
boolean hasAppLabel = false;
@SuppressWarnings("unchecked") final Map<String, Map<String, Object>> appMap = (Map<String, Map<String, Object>>) lastafluteMap.get("appMap");
if (appMap != null) {
for (Entry<String, Map<String, Object>> entry : appMap.entrySet()) {
final String appName = entry.getKey();
final Map<String, Object> defMap = entry.getValue();
final String path = (String) defMap.get("path");
@SuppressWarnings("unchecked") final List<String> propertiesHtmlList = (List<String>) defMap.getOrDefault(PROPERTIES_HTML_KEY, Collections.emptyList());
for (String propertiesHtml : propertiesHtmlList) {
logger.info("...Reflecting application propertiesHtml settigs: " + appName + "." + propertiesHtml);
if ("env".equals(propertiesHtml)) {
setupEnv(appName, path, hasCommonEnv, hasCommonConfig, lastaEnv);
hasAppEnv = true;
} else if ("config".equals(propertiesHtml)) {
setupConfig(appName, path, hasCommonEnv, hasCommonConfig, hasAppEnv);
} else if ("label".equals(propertiesHtml)) {
setupLabel(appName, path, hasCommonLabel, hasCommonMessage);
hasAppLabel = true;
} else if ("message".equals(propertiesHtml)) {
setupMessage(appName, path, hasCommonLabel, hasCommonMessage, hasAppLabel);
} else {
String msg = "Unkonwn type for appMap's propertiesHtml: " + propertiesHtml;
throw new DfIllegalPropertySettingException(msg);
}
}
}
}
showPropertiesHtmlSettings();
}
Aggregations