소스 검색

modify design pages and minor fixes

Shinsuke Sugaya 10 년 전
부모
커밋
748f6b7572

+ 5 - 9
src/main/java/org/codelibs/fess/app/web/admin/design/AdminDesignAction.java

@@ -18,7 +18,6 @@ package org.codelibs.fess.app.web.admin.design;
 
 import java.io.File;
 import java.io.FileInputStream;
-import java.io.FileNotFoundException;
 import java.io.Serializable;
 import java.io.UnsupportedEncodingException;
 import java.util.ArrayList;
@@ -184,14 +183,11 @@ public class AdminDesignAction extends FessAdminAction implements Serializable {
         if (file == null) {
             throwValidationError(messages -> messages.addErrorsTargetFileDoesNotExist(GLOBAL, form.fileName), toMainHtml());
         }
-        FileInputStream fis = null;
-        try {
-            fis = new FileInputStream(file);
-        } catch (final FileNotFoundException e) {
-            logger.error("Not found the file: {}", file.getAbsolutePath(), e);
-            throwValidationError(messages -> messages.addErrorsFailedToDownloadFile(GLOBAL, form.fileName), toMainHtml());
-        }
-        return asStream(file.getName()).stream(fis);
+        return asStream(file.getName()).stream(out -> {
+            try (FileInputStream fis = new FileInputStream(file)) {
+                out.write(fis);
+            }
+        });
     }
 
     @Token(save = false, validate = true)

+ 4 - 3
src/main/java/org/codelibs/fess/app/web/base/login/FessLoginAssist.java

@@ -17,7 +17,6 @@ package org.codelibs.fess.app.web.base.login;
 
 import javax.annotation.Resource;
 
-import org.codelibs.fess.app.web.LoginAction;
 import org.codelibs.fess.mylasta.action.FessUserBean;
 import org.codelibs.fess.mylasta.direction.FessConfig;
 import org.dbflute.optional.OptionalEntity;
@@ -102,7 +101,7 @@ public class FessLoginAssist extends TypicalLoginAssist<String, FessUserBean, Ob
     protected void checkPermission(LoginHandlingResource resource) throws LoginRequiredException {
         super.checkPermission(resource);
     }
-    
+
     // ===================================================================================
     //                                                                      Login Resource
     //                                                                      ==============
@@ -113,6 +112,8 @@ public class FessLoginAssist extends TypicalLoginAssist<String, FessUserBean, Ob
 
     @Override
     protected Class<?> getLoginActionType() {
-        return LoginAction.class;
+        // TODO
+        //        return LoginAction.class;
+        throw new UnsupportedOperationException("TODO");
     }
 }

+ 143 - 127
src/main/webapp/WEB-INF/view/admin/design/admin_design.jsp

@@ -1,138 +1,154 @@
-<%@page pageEncoding="UTF-8" contentType="text/html; charset=UTF-8"%><tiles:insert template="/WEB-INF/view/common/admin/layout.jsp"
-	flush="true">
-	<tiles:put name="title">
-		<la:message key="labels.design_configuration" />
-	</tiles:put>
-	<tiles:put name="header" value="/WEB-INF/view/common/admin/header.jsp" />
-	<tiles:put name="footer" value="/WEB-INF/view/common/admin/footer.jsp" />
-	<tiles:put name="menu" value="/WEB-INF/view/common/admin/menu.jsp" />
-	<tiles:put name="menuType" value="design" />
-	<tiles:put name="headerScript" type="string"></tiles:put>
-	<tiles:put name="body" type="string">
+<%@page pageEncoding="UTF-8" contentType="text/html; charset=UTF-8"%><!DOCTYPE html>
+<html>
+<head>
+<meta charset="UTF-8">
+<title>Fess | <la:message key="labels.design_configuration" /></title>
+<jsp:include page="/WEB-INF/view/common/admin2/head.jsp"></jsp:include>
+</head>
+<body class="skin-blue sidebar-mini">
+	<div class="wrapper">
+		<jsp:include page="/WEB-INF/view/common/admin2/header.jsp"></jsp:include>
+		<jsp:include page="/WEB-INF/view/common/admin2/sidebar.jsp">
+			<jsp:param name="menuCategoryType" value="crawl" />
+			<jsp:param name="menuType" value="design" />
+		</jsp:include>
 
-		<div id="main">
+		<div class="content-wrapper">
 
-		<%-- Message: BEGIN --%>
-		<div>
-			<html:messages id="msg" message="true">
-				<div class="alert-message info"><bean:write name="msg" ignore="true" /></div>
-			</html:messages>
-			<html:errors />
-		</div>
-		<%-- Message: END --%>
-
-			<c:if test="${editable}">
-				<div>
-					<h3>
-						<la:message key="labels.design_title_file" />
-					</h3>
-					<script>
-					<!--
-						function confirmToDelete() {
-							if (confirm('<la:message key="labels.design_delete_confirmation"/>')) {
-								return true;
-							} else {
-								return false;
-							}
-						}
-					// -->
-					</script>
-					<la:form>
-						<table class="bordered-table zebra-striped">
-							<tbody>
-								<tr>
-									<th>
-									<html:select property="fileName">
+			<%-- Content Header --%>
+			<section class="content-header">
+				<h1>
+					<la:message key="labels.design_configuration" />
+				</h1>
+			</section>
+			
+			<section class="content">	
+				
+				<div class="row">
+					<div class="col-md-12">
+						<div>
+                            <%--
+							<la:messages id="msg" message="true">
+								<div class="alert-message info"><la:write name="msg" ignore="true" /></div>
+							</la:messages>
+                            --%>
+							<la:errors />
+						</div>
+						<div class="box">
+							<la:form>
+								<%-- Box Header --%>
+								<div class="box-header with-border">
+									<h3>
+										<la:message key="labels.design_title_file" />
+									</h3>
+								</div>
+								<%-- Box Body --%>
+								<div class="box-body">
+									<script>
+									<!--
+										function confirmToDelete() {
+											if (confirm('<la:message key="labels.design_delete_confirmation"/>')) {
+												return true;
+											} else {
+												return false;
+											}
+										}
+									// -->
+									</script>
+									<la:select property="fileName">
 										<c:forEach var="item" varStatus="s" items="${fileNameItems}">
-											<html:option value="${item}">${f:h(item)}</html:option>
+											<la:option value="${item}">${f:h(item)}</la:option>
 										</c:forEach>
-									</html:select>
-									</th>
-									<td style="text-align: center;">
-										<input type="submit" class="btn " name="download"
-											value="<la:message key="labels.design_download_button"/>" />
-										<input type="submit" class="btn "
-											name="delete" onclick="return confirmToDelete();"
-											value="<la:message key="labels.design_delete_button"/>"  />
-									</td>
-								</tr>
-						</table>
-					</la:form>
-				</div>
-
-				<div style="margin-top: 5px;">
-					<h3>
-						<la:message key="labels.design_title_file_upload" />
-					</h3>
-					<la:form action="upload" enctype="multipart/form-data">
-						<table class="bordered-table zebra-striped">
-							<tbody>
-							<tr>
-								<th style="width: 200px;"><la:message
-											key="labels.design_file" /></th>
-									<td style="text-align: center;"><input type="file"
-										name="designFile" style="width: 330;" /></td>
-								</tr>
-								<tr>
-									<th><la:message key="labels.design_file_name" /></th>
-									<td style="text-align: center;"><la:text
-											property="designFileName" style="width:98%;" /></td>
-								</tr>
-							</tbody>
-							<tfoot>
-								<tr>
-									<td colspan="2" style="text-align:center;"><input type="submit" class="btn "
-										name="update"
-										value="<la:message key="labels.design_button_upload"/>" /></td>
-								</tr>
-							</tfoot>
-						</table>
-					</la:form>
-				</div>
-
-				<div style="margin-top: 5px;">
-					<h3>
-						<la:message key="labels.design_file_title_edit" />
-					</h3>
-					<la:form>
-					<table class="bordered-table zebra-striped">
-						<tbody>
-							<tr>
-								<th>
-								<html:select property="fileName" style="width:300px;">
-									<html:option value="index"><la:message key="labels.design_file_index" /></html:option>
-									<html:option value="header"><la:message key="labels.design_file_header" /></html:option>
-									<html:option value="footer"><la:message key="labels.design_file_footer" /></html:option>
-									<html:option value="search"><la:message key="labels.design_file_search" /></html:option>
-									<html:option value="searchResults"><la:message key="labels.design_file_searchResults" /></html:option>
-									<html:option value="searchNoResult"><la:message key="labels.design_file_searchNoResult" /></html:option>
-									<html:option value="help"><la:message key="labels.design_file_help" /></html:option>
-									<html:option value="cache"><la:message key="labels.design_file_cache" /></html:option>
-									<%-- Applet --%>
-									<html:option value="appletLauncher"><la:message key="labels.design_file_appletLauncher" /></html:option>
-									<%-- Error --%>
-									<html:option value="error"><la:message key="labels.design_file_error" /></html:option>
-									<html:option value="errorHeader"><la:message key="labels.design_file_errorHeader" /></html:option>
-									<html:option value="errorFooter"><la:message key="labels.design_file_errorFooter" /></html:option>
-									<html:option value="errorNotFound"><la:message key="labels.design_file_errorNotFound" /></html:option>
-									<html:option value="errorSystem"><la:message key="labels.design_file_errorSystem" /></html:option>
-									<html:option value="errorRedirect"><la:message key="labels.design_file_errorRedirect" /></html:option>
-									<html:option value="errorBadRequest"><la:message key="labels.design_file_errorBadRequest" /></html:option>
-								</html:select>
-								</th>
-								<td style="text-align: center;">
+									</la:select>
+								</div>
+								<%-- Box Footer --%>
+								<div class="box-footer">
+									<input type="submit" class="btn " name="download" value="<la:message key="labels.design_download_button"/>" />
+									<input type="submit" class="btn " name="delete" onclick="return confirmToDelete();" value="<la:message key="labels.design_delete_button"/>"  />
+								</div>
+							</la:form>
+						</div>
+						<div class="box">
+							<la:form action="upload" enctype="multipart/form-data">
+								<%-- Box Header --%>
+								<div class="box-header with-border">
+									<h3>
+										<la:message key="labels.design_title_file_upload" />
+									</h3>
+								</div>
+								<%-- Box Body --%>
+								<div class="box-body">
+									<table class="bordered-table zebra-striped">
+										<tr>
+											<th style="width: 200px;">
+												<la:message key="labels.design_file" />
+											</th>
+											<td style="text-align: center;">
+												<input type="file" name="designFile" style="width: 330;" />
+											</td>
+										</tr>
+										<tr>
+											<th>
+												<la:message key="labels.design_file_name" />
+											</th>
+											<td style="text-align: center;">
+												<la:text property="designFileName" style="width:98%;" />
+											</td>
+										</tr>
+									</table>
+								</div>
+								<%-- Box Footer --%>
+								<div class="box-footer">
+									<input type="submit" class="btn " name="update"	value="<la:message key="labels.design_button_upload"/>" />
+								</div>
+							</la:form>
+						</div>
+						<div class="box">
+							<la:form>
+								<%-- Box Header --%>
+								<div class="box-header with-border">
+									<h3>
+										<la:message key="labels.design_file_title_edit" />
+									</h3>
+								</div>
+								<%-- Box Body --%>
+								<div class="box-body">
+									<la:select property="fileName" style="width:300px;">
+										<la:option value="index"><la:message key="labels.design_file_index" /></la:option>
+										<la:option value="header"><la:message key="labels.design_file_header" /></la:option>
+										<la:option value="footer"><la:message key="labels.design_file_footer" /></la:option>
+										<la:option value="search"><la:message key="labels.design_file_search" /></la:option>
+										<la:option value="searchResults"><la:message key="labels.design_file_searchResults" /></la:option>
+										<la:option value="searchNoResult"><la:message key="labels.design_file_searchNoResult" /></la:option>
+										<la:option value="help"><la:message key="labels.design_file_help" /></la:option>
+										<la:option value="cache"><la:message key="labels.design_file_cache" /></la:option>
+										<%-- Error --%>
+										<la:option value="error"><la:message key="labels.design_file_error" /></la:option>
+										<la:option value="errorHeader"><la:message key="labels.design_file_errorHeader" /></la:option>
+										<la:option value="errorFooter"><la:message key="labels.design_file_errorFooter" /></la:option>
+										<la:option value="errorNotFound"><la:message key="labels.design_file_errorNotFound" /></la:option>
+										<la:option value="errorSystem"><la:message key="labels.design_file_errorSystem" /></la:option>
+										<la:option value="errorRedirect"><la:message key="labels.design_file_errorRedirect" /></la:option>
+										<la:option value="errorBadRequest"><la:message key="labels.design_file_errorBadRequest" /></la:option>
+									</la:select>
+								</div>
+								<%-- Box Footer --%>
+								<div class="box-footer">
 									<input type="submit" class="btn " name="edit"
 										value="<la:message key="labels.design_edit_button"/>" />
 									<input type="submit" class="btn "
 										name="editAsUseDefault"
 										value="<la:message key="labels.design_use_default_button"/>" />
-								</td>
-							</tr>
-					</table>
-					</la:form>
+								</div>
+							</la:form>
+						</div>
+					</div>
 				</div>
-			</c:if>
+				
+			</section>
 		</div>
-
-	</tiles:put>
-</tiles:insert>
+		<jsp:include page="/WEB-INF/view/common/admin2/footer.jsp"></jsp:include>
+	</div>
+	<jsp:include page="/WEB-INF/view/common/admin2/foot.jsp"></jsp:include>
+</body>
+</html>

+ 68 - 41
src/main/webapp/WEB-INF/view/admin/design/admin_design_edit.jsp

@@ -1,44 +1,71 @@
-<%@page pageEncoding="UTF-8" contentType="text/html; charset=UTF-8"%><tiles:insert template="/WEB-INF/view/common/admin/layout.jsp"
-	flush="true">
-	<tiles:put name="title">
-		<la:message key="labels.design_configuration" />
-	</tiles:put>
-	<tiles:put name="header" value="/WEB-INF/view/common/admin/header.jsp" />
-	<tiles:put name="footer" value="/WEB-INF/view/common/admin/footer.jsp" />
-	<tiles:put name="menu" value="/WEB-INF/view/common/admin/menu.jsp" />
-	<tiles:put name="menuType" value="design" />
-	<tiles:put name="headerScript" type="string"></tiles:put>
-	<tiles:put name="body" type="string">
+<%@page pageEncoding="UTF-8" contentType="text/html; charset=UTF-8"%><!DOCTYPE html>
+<html>
+<head>
+<meta charset="UTF-8">
+<title>Fess | <la:message key="labels.design_configuration" /></title>
+<jsp:include page="/WEB-INF/view/common/admin2/head.jsp"></jsp:include>
+</head>
+<body class="skin-blue sidebar-mini">
+	<div class="wrapper">
+		<jsp:include page="/WEB-INF/view/common/admin2/header.jsp"></jsp:include>
+		<jsp:include page="/WEB-INF/view/common/admin2/sidebar.jsp">
+			<jsp:param name="menuCategoryType" value="crawl" />
+			<jsp:param name="menuType" value="design" />
+		</jsp:include>
 
-		<%-- Message: BEGIN --%>
-		<div>
-			<html:messages id="msg" message="true">
-				<div class="alert-message info"><bean:write name="msg" ignore="true" /></div>
-			</html:messages>
-			<html:errors />
-		</div>
-		<%-- Message: END --%>
-		<c:if test="${editable}">
-			<la:form>
-				<div>
-					<h3>
-						<la:message key="labels.design_title_edit_content" />
-					</h3>
-					<h4>${f:h(fileName)}</h4>
-					<div>
-						<la:textarea
-								property="content" style="width:98%" rows="20"></la:textarea>
-					</div>
-					<div style="margin-top:5px;">
-						<input type="submit" class="btn small" name="update"
-							value="<la:message key="labels.design_button_update"/>" />
-						<input type="submit" class="btn small" name="back"
-							value="<la:message key="labels.design_button_back"/>" />
+		<div class="content-wrapper">
+		
+			<%-- Content Header --%>
+			<section class="content-header">
+				<h1>
+					<la:message key="labels.design_configuration" />
+				</h1>
+			</section>
+			
+			<section class="content">
+				
+				<div class="row">
+					<div class="col-md-12">
+						<div>
+                            <%--
+							<la:messages id="msg" message="true">
+								<div class="alert-message info"><la:write name="msg" ignore="true" /></div>
+							</la:messages>
+                            --%>
+							<la:errors />
+						</div>
+						<div class="box">
+							<c:if test="${editable}">
+								<la:form>
+									<%-- Box Header --%>
+									<div class="box-header with-border">
+										<h3>
+											<la:message key="labels.design_title_edit_content" />
+										</h3>
+									</div>
+									<%-- Box Body --%>
+									<div class="box-body">
+										<h4>${f:h(fileName)}</h4>
+										<div>
+											<la:textarea property="content" style="width:98%" rows="20"></la:textarea>
+										</div>
+									</div>
+									<%-- Box Footer --%>
+									<div class="box-footer">
+										<input type="submit" class="btn small" name="update" value="<la:message key="labels.design_button_update"/>" />
+										<input type="submit" class="btn small" name="back" value="<la:message key="labels.design_button_back"/>" />
+									</div>
+									<la:hidden property="fileName" />
+								</la:form>
+							</c:if>
+						</div>
 					</div>
 				</div>
-				<la:hidden property="fileName" />
-			</la:form>
-		</c:if>
-
-	</tiles:put>
-</tiles:insert>
+				
+			</section>
+		</div>
+		<jsp:include page="/WEB-INF/view/common/admin2/footer.jsp"></jsp:include>
+	</div>
+	<jsp:include page="/WEB-INF/view/common/admin2/foot.jsp"></jsp:include>
+</body>
+</html>