From svnnotify @ sourceforge.jp Sun Jun 1 08:19:26 2008 From: svnnotify @ sourceforge.jp (svnnotify @ sourceforge.jp) Date: Sun, 01 Jun 2008 08:19:26 +0900 Subject: [pal-cvs 3207] [944] added SSLRedirectValve to redirect to ssl or non-ssl page. Message-ID: <1212275966.218433.3402.nullmailer@users.sourceforge.jp> Revision: 944 http://svn.sourceforge.jp/cgi-bin/viewcvs.cgi?root=pal&view=rev&rev=944 Author: shinsuke Date: 2008-06-01 08:19:25 +0900 (Sun, 01 Jun 2008) Log Message: ----------- added SSLRedirectValve to redirect to ssl or non-ssl page. Added Paths: ----------- pal-portal/branches/pal-portal-1.x/portal/jetspeed-2/components/portal/src/java/jp/sf/pal/portal/redirect/ pal-portal/branches/pal-portal-1.x/portal/jetspeed-2/components/portal/src/java/jp/sf/pal/portal/redirect/impl/ pal-portal/branches/pal-portal-1.x/portal/jetspeed-2/components/portal/src/java/jp/sf/pal/portal/redirect/impl/SSLRedirectValveImpl.java -------------- next part -------------- Added: pal-portal/branches/pal-portal-1.x/portal/jetspeed-2/components/portal/src/java/jp/sf/pal/portal/redirect/impl/SSLRedirectValveImpl.java =================================================================== --- pal-portal/branches/pal-portal-1.x/portal/jetspeed-2/components/portal/src/java/jp/sf/pal/portal/redirect/impl/SSLRedirectValveImpl.java (rev 0) +++ pal-portal/branches/pal-portal-1.x/portal/jetspeed-2/components/portal/src/java/jp/sf/pal/portal/redirect/impl/SSLRedirectValveImpl.java 2008-05-31 23:19:25 UTC (rev 944) @@ -0,0 +1,154 @@ +package jp.sf.pal.portal.redirect.impl; + +import java.io.IOException; + +import javax.servlet.http.HttpServletRequest; + +import org.apache.commons.logging.Log; +import org.apache.commons.logging.LogFactory; +import org.apache.jetspeed.om.page.ContentPage; +import org.apache.jetspeed.om.page.Fragment; +import org.apache.jetspeed.pipeline.PipelineException; +import org.apache.jetspeed.pipeline.valve.AbstractValve; +import org.apache.jetspeed.pipeline.valve.ValveContext; +import org.apache.jetspeed.request.RequestContext; + +public class SSLRedirectValveImpl extends AbstractValve +{ + + private static final String QUERY_SEPARATOR = "?"; + + private static final String REDIRECT_TO_SSL_PAGE_KEY = "redirect.to.ssl.page"; + + protected Log log = LogFactory.getLog(SSLRedirectValveImpl.class); + + private static final String TRUE = "true"; + + private static final String FALSE = "false"; + + private static final String PORT_SEPARATOR = ":"; + + private static final String SCHEME_SEPARATOR = "://"; + + private static final String HTTP_SCHEME = "http"; + + private static final String HTTPS_SCHEME = "https"; + + private static final int DEFAULT_HTTPS_PORT = 443; + + private static final int DEFAULT_HTTP_PORT = 80; + + private String redirectToSSLPageKey; + + private int httpPort; + + private int httpsPort; + + public SSLRedirectValveImpl() + { + redirectToSSLPageKey = REDIRECT_TO_SSL_PAGE_KEY; + httpPort = DEFAULT_HTTP_PORT; + httpsPort = DEFAULT_HTTPS_PORT; + } + + public SSLRedirectValveImpl(String redirectToSSLPageKey, int httpPort, + int httpsPort) + { + this.redirectToSSLPageKey = redirectToSSLPageKey; + this.httpPort = httpPort; + this.httpsPort = httpsPort; + } + + public void invoke(RequestContext request, ValveContext context) + throws PipelineException + { + ContentPage page = request.getPage(); + if (page != null) + { + Fragment fragment = page.getRootFragment(); + if (fragment != null) + { + String value = fragment.getProperty(redirectToSSLPageKey); + if (value != null) + { + if (TRUE.equals(value)) + { + // check if the page is redirected to SSL page + String scheme = request.getRequest().getScheme(); + if (HTTP_SCHEME.equals(scheme)) + { + try + { + sendRedirect(request, HTTPS_SCHEME, httpsPort, + DEFAULT_HTTPS_PORT); + return; + } + catch (IOException e) + { + log + .warn( + "Could not redirect to a SSL page.", + e); + } + } + } + else if (FALSE.equals(value)) + { + // check if the page is redirected to non-SSL page + String scheme = request.getRequest().getScheme(); + if (HTTPS_SCHEME.equals(scheme)) + { + try + { + sendRedirect(request, HTTP_SCHEME, httpPort, + DEFAULT_HTTP_PORT); + return; + } + catch (IOException e) + { + log + .warn( + "Could not redirect to a non-SSL page.", + e); + } + } + } + } + } + } + + // Pass control to the next Valve in the Pipeline + context.invokeNext(request); + } + + protected void sendRedirect(RequestContext request, String scheme, + int port, int defaultPort) throws IOException + { + HttpServletRequest servletRequest = request.getRequest(); + StringBuffer url = new StringBuffer(); + url.append(scheme).append(SCHEME_SEPARATOR).append( + servletRequest.getServerName()); + if (port != defaultPort) + { + url.append(PORT_SEPARATOR).append(port); + } + url.append(servletRequest.getContextPath()); + url.append(servletRequest.getServletPath()); + if (servletRequest.getPathInfo() != null) + { + url.append(servletRequest.getPathInfo()); + } + if (servletRequest.getQueryString() != null) + { + url.append(QUERY_SEPARATOR); + url.append(servletRequest.getQueryString()); + } + request.getResponse().sendRedirect(url.toString()); + } + + public String toString() + { + return "SSLRedirectValve"; + } + +} Property changes on: pal-portal/branches/pal-portal-1.x/portal/jetspeed-2/components/portal/src/java/jp/sf/pal/portal/redirect/impl/SSLRedirectValveImpl.java ___________________________________________________________________ Name: svn:eol-style + native From svnnotify @ sourceforge.jp Mon Jun 2 07:07:04 2008 From: svnnotify @ sourceforge.jp (svnnotify @ sourceforge.jp) Date: Mon, 02 Jun 2008 07:07:04 +0900 Subject: [pal-cvs 3208] [945] replaced with meta redirect. Message-ID: <1212358024.819893.1630.nullmailer@users.sourceforge.jp> Revision: 945 http://svn.sourceforge.jp/cgi-bin/viewcvs.cgi?root=pal&view=rev&rev=945 Author: shinsuke Date: 2008-06-02 07:07:04 +0900 (Mon, 02 Jun 2008) Log Message: ----------- replaced with meta redirect. Modified Paths: -------------- pal-portal/branches/pal-portal-1.x/portal/jetspeed-2/components/portal/src/java/jp/sf/pal/portal/redirect/impl/SSLRedirectValveImpl.java -------------- next part -------------- Modified: pal-portal/branches/pal-portal-1.x/portal/jetspeed-2/components/portal/src/java/jp/sf/pal/portal/redirect/impl/SSLRedirectValveImpl.java =================================================================== --- pal-portal/branches/pal-portal-1.x/portal/jetspeed-2/components/portal/src/java/jp/sf/pal/portal/redirect/impl/SSLRedirectValveImpl.java 2008-05-31 23:19:25 UTC (rev 944) +++ pal-portal/branches/pal-portal-1.x/portal/jetspeed-2/components/portal/src/java/jp/sf/pal/portal/redirect/impl/SSLRedirectValveImpl.java 2008-06-01 22:07:04 UTC (rev 945) @@ -1,6 +1,7 @@ package jp.sf.pal.portal.redirect.impl; import java.io.IOException; +import java.io.PrintWriter; import javax.servlet.http.HttpServletRequest; @@ -16,6 +17,10 @@ public class SSLRedirectValveImpl extends AbstractValve { + private static final String REDIRECT_CONTENT_SUFFIX = "\"/>"; + + private static final String REDIRECT_CONTENT_PREFIX = " Revision: 946 http://svn.sourceforge.jp/cgi-bin/viewcvs.cgi?root=pal&view=rev&rev=946 Author: shinsuke Date: 2008-06-03 17:32:45 +0900 (Tue, 03 Jun 2008) Log Message: ----------- changed attribute order. Modified Paths: -------------- pal-portal/branches/pal-portal-1.x/portal/jetspeed-2/src/webapp/WEB-INF/templates/layout/html/columns/layout.vm pal-portal/branches/pal-portal-1.x/portal/jetspeed-2/src/webapp/decorations/layout/default/header.vm pal-portal/branches/pal-portal-1.x/portal/jetspeed-2/src/webapp/decorations/layout/nextgen/header.vm -------------- next part -------------- Modified: pal-portal/branches/pal-portal-1.x/portal/jetspeed-2/src/webapp/WEB-INF/templates/layout/html/columns/layout.vm =================================================================== --- pal-portal/branches/pal-portal-1.x/portal/jetspeed-2/src/webapp/WEB-INF/templates/layout/html/columns/layout.vm 2008-06-01 22:07:04 UTC (rev 945) +++ pal-portal/branches/pal-portal-1.x/portal/jetspeed-2/src/webapp/WEB-INF/templates/layout/html/columns/layout.vm 2008-06-03 08:32:45 UTC (rev 946) @@ -50,7 +50,7 @@ #foreach ($_action in $_actions) #if($_action.actionName == "edit") #set ($pagePref = "${jetspeed.basePath}/system/customizer/site-editor.psml?mode=${rc.request.servletPath}&path=${psrc.managedPage}&returnPath=${profiledPage}") - + #end #end #end Modified: pal-portal/branches/pal-portal-1.x/portal/jetspeed-2/src/webapp/decorations/layout/default/header.vm =================================================================== --- pal-portal/branches/pal-portal-1.x/portal/jetspeed-2/src/webapp/decorations/layout/default/header.vm 2008-06-01 22:07:04 UTC (rev 945) +++ pal-portal/branches/pal-portal-1.x/portal/jetspeed-2/src/webapp/decorations/layout/default/header.vm 2008-06-03 08:32:45 UTC (rev 946) @@ -46,7 +46,7 @@ - +
- Modified: pal-admin/trunk/src/main/webapp/view/permission/folderPermissionEdit.html =================================================================== --- pal-admin/trunk/src/main/webapp/view/permission/folderPermissionEdit.html 2008-06-04 22:22:50 UTC (rev 951) +++ pal-admin/trunk/src/main/webapp/view/permission/folderPermissionEdit.html 2008-06-04 22:30:42 UTC (rev 952) @@ -6,17 +6,13 @@ -
- + +
- - Portlet - + Portlet - - Page - + Page
@@ -30,7 +26,6 @@
-
@@ -87,8 +82,8 @@
+
- Modified: pal-admin/trunk/src/main/webapp/view/permission/folderPermissionList.html =================================================================== --- pal-admin/trunk/src/main/webapp/view/permission/folderPermissionList.html 2008-06-04 22:22:50 UTC (rev 951) +++ pal-admin/trunk/src/main/webapp/view/permission/folderPermissionList.html 2008-06-04 22:30:42 UTC (rev 952) @@ -7,15 +7,12 @@
+
- - Portlet - + Portlet - - Page - + Page
@@ -28,7 +25,6 @@
-
@@ -89,8 +85,8 @@
-
+ Modified: pal-admin/trunk/src/main/webapp/view/permission/pagePermissionConfirm.html =================================================================== --- pal-admin/trunk/src/main/webapp/view/permission/pagePermissionConfirm.html 2008-06-04 22:22:50 UTC (rev 951) +++ pal-admin/trunk/src/main/webapp/view/permission/pagePermissionConfirm.html 2008-06-04 22:30:42 UTC (rev 952) @@ -6,16 +6,12 @@ -
- + +
- - Portlet - - - Folder - + Portlet + Folder
@@ -31,7 +27,6 @@
-
@@ -80,8 +75,8 @@
+ -
Modified: pal-admin/trunk/src/main/webapp/view/permission/pagePermissionEdit.html =================================================================== --- pal-admin/trunk/src/main/webapp/view/permission/pagePermissionEdit.html 2008-06-04 22:22:50 UTC (rev 951) +++ pal-admin/trunk/src/main/webapp/view/permission/pagePermissionEdit.html 2008-06-04 22:30:42 UTC (rev 952) @@ -6,16 +6,12 @@ -
- + +
- - Portlet - - - Folder - + Portlet + Folder
@@ -30,7 +26,6 @@
-
@@ -87,8 +82,8 @@
+ -
Modified: pal-admin/trunk/src/main/webapp/view/permission/pagePermissionList.html =================================================================== --- pal-admin/trunk/src/main/webapp/view/permission/pagePermissionList.html 2008-06-04 22:22:50 UTC (rev 951) +++ pal-admin/trunk/src/main/webapp/view/permission/pagePermissionList.html 2008-06-04 22:30:42 UTC (rev 952) @@ -7,14 +7,11 @@
+
- - Portlet - - - Folder - + Portlet + Folder
@@ -28,7 +25,6 @@
-
@@ -89,8 +85,8 @@
- +
Modified: pal-admin/trunk/src/main/webapp/view/permission/portletPermissionConfirm.html =================================================================== --- pal-admin/trunk/src/main/webapp/view/permission/portletPermissionConfirm.html 2008-06-04 22:22:50 UTC (rev 951) +++ pal-admin/trunk/src/main/webapp/view/permission/portletPermissionConfirm.html 2008-06-04 22:30:42 UTC (rev 952) @@ -6,17 +6,13 @@ -
- + +
- - Folder - - - Page - + Folder + Page
@@ -31,7 +27,6 @@
-
@@ -80,8 +75,8 @@
+ -
Modified: pal-admin/trunk/src/main/webapp/view/permission/portletPermissionEdit.html =================================================================== --- pal-admin/trunk/src/main/webapp/view/permission/portletPermissionEdit.html 2008-06-04 22:22:50 UTC (rev 951) +++ pal-admin/trunk/src/main/webapp/view/permission/portletPermissionEdit.html 2008-06-04 22:30:42 UTC (rev 952) @@ -6,17 +6,13 @@ -
- + +
- - Folder - - - Page - + Folder + Page
@@ -30,7 +26,6 @@
-
@@ -87,8 +82,8 @@
+ -
Modified: pal-admin/trunk/src/main/webapp/view/permission/portletPermissionList.html =================================================================== --- pal-admin/trunk/src/main/webapp/view/permission/portletPermissionList.html 2008-06-04 22:22:50 UTC (rev 951) +++ pal-admin/trunk/src/main/webapp/view/permission/portletPermissionList.html 2008-06-04 22:30:42 UTC (rev 952) @@ -7,15 +7,12 @@
+
- - Folder - - - Page - + Folder + Page
@@ -28,7 +25,6 @@
-
@@ -89,8 +85,8 @@
- +
Modified: pal-admin/trunk/src/main/webapp/view/portletmanager/portletActionConfirm.html =================================================================== --- pal-admin/trunk/src/main/webapp/view/portletmanager/portletActionConfirm.html 2008-06-04 22:22:50 UTC (rev 951) +++ pal-admin/trunk/src/main/webapp/view/portletmanager/portletActionConfirm.html 2008-06-04 22:30:42 UTC (rev 952) @@ -6,15 +6,12 @@ -
- - + +
- - Deployer - + Deployer
@@ -23,7 +20,6 @@
-
@@ -52,7 +48,7 @@
- +
Modified: pal-admin/trunk/src/main/webapp/view/portletmanager/portletList.html =================================================================== --- pal-admin/trunk/src/main/webapp/view/portletmanager/portletList.html 2008-06-04 22:22:50 UTC (rev 951) +++ pal-admin/trunk/src/main/webapp/view/portletmanager/portletList.html 2008-06-04 22:30:42 UTC (rev 952) @@ -7,12 +7,11 @@
+
- - Deployer - + Deployer
@@ -21,15 +20,12 @@
-
- - Refresh - + Refresh
@@ -38,14 +34,8 @@
- - <<Previous - - - Next>> - + <<Previous + Next>>
@@ -105,16 +95,10 @@
- - <<Previous - - - Next>> - + <<Previous + Next>>
-
+
Modified: pal-admin/trunk/src/main/webapp/view/profiler/ruleConfirm.html =================================================================== --- pal-admin/trunk/src/main/webapp/view/profiler/ruleConfirm.html 2008-06-04 22:22:50 UTC (rev 951) +++ pal-admin/trunk/src/main/webapp/view/profiler/ruleConfirm.html 2008-06-04 22:30:42 UTC (rev 952) @@ -6,9 +6,9 @@ -
- +
+
List | @@ -20,7 +20,6 @@
-
@@ -68,8 +67,8 @@
+ -
Modified: pal-admin/trunk/src/main/webapp/view/profiler/ruleCriterionConfirm.html =================================================================== --- pal-admin/trunk/src/main/webapp/view/profiler/ruleCriterionConfirm.html 2008-06-04 22:22:50 UTC (rev 951) +++ pal-admin/trunk/src/main/webapp/view/profiler/ruleCriterionConfirm.html 2008-06-04 22:30:42 UTC (rev 952) @@ -6,10 +6,9 @@ -
- - +
+
List | @@ -22,7 +21,6 @@
-
@@ -94,8 +92,8 @@
- +
Modified: pal-admin/trunk/src/main/webapp/view/profiler/ruleCriterionEdit.html =================================================================== --- pal-admin/trunk/src/main/webapp/view/profiler/ruleCriterionEdit.html 2008-06-04 22:22:50 UTC (rev 951) +++ pal-admin/trunk/src/main/webapp/view/profiler/ruleCriterionEdit.html 2008-06-04 22:30:42 UTC (rev 952) @@ -6,9 +6,8 @@ -
- - + +
List | @@ -22,7 +21,6 @@
-
@@ -97,13 +95,13 @@
-
-
+
Modified: pal-admin/trunk/src/main/webapp/view/profiler/ruleCriterionList.html =================================================================== --- pal-admin/trunk/src/main/webapp/view/profiler/ruleCriterionList.html 2008-06-04 22:22:50 UTC (rev 951) +++ pal-admin/trunk/src/main/webapp/view/profiler/ruleCriterionList.html 2008-06-04 22:30:42 UTC (rev 952) @@ -6,9 +6,9 @@ -
- +
+
| New | Back to Rule List @@ -19,7 +19,6 @@
-
@@ -86,8 +85,8 @@
- +
Modified: pal-admin/trunk/src/main/webapp/view/profiler/ruleEdit.html =================================================================== --- pal-admin/trunk/src/main/webapp/view/profiler/ruleEdit.html 2008-06-04 22:22:50 UTC (rev 951) +++ pal-admin/trunk/src/main/webapp/view/profiler/ruleEdit.html 2008-06-04 22:30:42 UTC (rev 952) @@ -6,9 +6,9 @@ -
- +
+
List | @@ -19,7 +19,6 @@
-
@@ -73,8 +72,8 @@
+ -
Modified: pal-admin/trunk/src/main/webapp/view/profiler/ruleList.html =================================================================== --- pal-admin/trunk/src/main/webapp/view/profiler/ruleList.html 2008-06-04 22:22:50 UTC (rev 951) +++ pal-admin/trunk/src/main/webapp/view/profiler/ruleList.html 2008-06-04 22:30:42 UTC (rev 952) @@ -8,6 +8,7 @@
+
| New
@@ -17,7 +18,6 @@
-
@@ -67,8 +67,8 @@
+ -
Modified: pal-admin/trunk/src/main/webapp/view/role/roleConfirm.html =================================================================== --- pal-admin/trunk/src/main/webapp/view/role/roleConfirm.html 2008-06-04 22:22:50 UTC (rev 951) +++ pal-admin/trunk/src/main/webapp/view/role/roleConfirm.html 2008-06-04 22:30:42 UTC (rev 952) @@ -7,15 +7,12 @@
+
- - User - + User - - Group - + Group
@@ -30,7 +27,6 @@
-
@@ -50,7 +46,7 @@
- +
Modified: pal-admin/trunk/src/main/webapp/view/role/roleEdit.html =================================================================== --- pal-admin/trunk/src/main/webapp/view/role/roleEdit.html 2008-06-04 22:22:50 UTC (rev 951) +++ pal-admin/trunk/src/main/webapp/view/role/roleEdit.html 2008-06-04 22:30:42 UTC (rev 952) @@ -7,15 +7,12 @@
+
- - User - + User - - Group - + Group
@@ -30,7 +27,6 @@
-
@@ -51,7 +47,7 @@ onclick="location.href='roleConfirm.html'" class="portlet-form-button"/>
+ -
Modified: pal-admin/trunk/src/main/webapp/view/role/roleList.html =================================================================== --- pal-admin/trunk/src/main/webapp/view/role/roleList.html 2008-06-04 22:22:50 UTC (rev 951) +++ pal-admin/trunk/src/main/webapp/view/role/roleList.html 2008-06-04 22:30:42 UTC (rev 952) @@ -7,15 +7,12 @@
+
- - User - + User - - Group - + Group
@@ -29,7 +26,6 @@
-
@@ -71,7 +67,7 @@ te:rendered="#{role_roleListPage.nextPageNumber!=null}">Next>>
- +
Modified: pal-admin/trunk/src/main/webapp/view/securityconstraint/globalSecurityConstraintConfirm.html =================================================================== --- pal-admin/trunk/src/main/webapp/view/securityconstraint/globalSecurityConstraintConfirm.html 2008-06-04 22:22:50 UTC (rev 951) +++ pal-admin/trunk/src/main/webapp/view/securityconstraint/globalSecurityConstraintConfirm.html 2008-06-04 22:30:42 UTC (rev 952) @@ -6,13 +6,11 @@ -
- + +
- - Definitions - + Definitions
@@ -28,7 +26,6 @@
-
@@ -52,8 +49,8 @@
+ -
Modified: pal-admin/trunk/src/main/webapp/view/securityconstraint/globalSecurityConstraintEdit.html =================================================================== --- pal-admin/trunk/src/main/webapp/view/securityconstraint/globalSecurityConstraintEdit.html 2008-06-04 22:22:50 UTC (rev 951) +++ pal-admin/trunk/src/main/webapp/view/securityconstraint/globalSecurityConstraintEdit.html 2008-06-04 22:30:42 UTC (rev 952) @@ -6,13 +6,11 @@ -
- + +
- - Definitions - + Definitions
@@ -27,7 +25,6 @@
-
@@ -50,8 +47,8 @@
+ -
Modified: pal-admin/trunk/src/main/webapp/view/securityconstraint/globalSecurityConstraintList.html =================================================================== --- pal-admin/trunk/src/main/webapp/view/securityconstraint/globalSecurityConstraintList.html 2008-06-04 22:22:50 UTC (rev 951) +++ pal-admin/trunk/src/main/webapp/view/securityconstraint/globalSecurityConstraintList.html 2008-06-04 22:30:42 UTC (rev 952) @@ -7,11 +7,10 @@
+
- - Definitions - + Definitions
@@ -25,7 +24,6 @@
-
@@ -73,8 +71,8 @@
- +
Modified: pal-admin/trunk/src/main/webapp/view/securityconstraint/securityDefinitionConfirm.html =================================================================== --- pal-admin/trunk/src/main/webapp/view/securityconstraint/securityDefinitionConfirm.html 2008-06-04 22:22:50 UTC (rev 951) +++ pal-admin/trunk/src/main/webapp/view/securityconstraint/securityDefinitionConfirm.html 2008-06-04 22:30:42 UTC (rev 952) @@ -6,14 +6,12 @@ -
- + +
- - Globals - + Globals
@@ -28,7 +26,6 @@
-
@@ -52,8 +49,8 @@
+ -
Modified: pal-admin/trunk/src/main/webapp/view/securityconstraint/securityDefinitionConstraintList.html =================================================================== --- pal-admin/trunk/src/main/webapp/view/securityconstraint/securityDefinitionConstraintList.html 2008-06-04 22:22:50 UTC (rev 951) +++ pal-admin/trunk/src/main/webapp/view/securityconstraint/securityDefinitionConstraintList.html 2008-06-04 22:30:42 UTC (rev 952) @@ -6,14 +6,12 @@ -
- + +
- - Globals - + Globals
List | @@ -24,7 +22,6 @@
-
@@ -54,9 +51,7 @@ @@ -93,8 +88,8 @@

+
- Modified: pal-admin/trunk/src/main/webapp/view/securityconstraint/securityDefinitionEdit.html =================================================================== --- pal-admin/trunk/src/main/webapp/view/securityconstraint/securityDefinitionEdit.html 2008-06-04 22:22:50 UTC (rev 951) +++ pal-admin/trunk/src/main/webapp/view/securityconstraint/securityDefinitionEdit.html 2008-06-04 22:30:42 UTC (rev 952) @@ -6,14 +6,12 @@ -
- + +
- - Globals - + Globals
@@ -27,7 +25,6 @@
-
@@ -50,8 +47,8 @@
+ -
Modified: pal-admin/trunk/src/main/webapp/view/securityconstraint/securityDefinitionList.html =================================================================== --- pal-admin/trunk/src/main/webapp/view/securityconstraint/securityDefinitionList.html 2008-06-04 22:22:50 UTC (rev 951) +++ pal-admin/trunk/src/main/webapp/view/securityconstraint/securityDefinitionList.html 2008-06-04 22:30:42 UTC (rev 952) @@ -7,12 +7,11 @@
+
- - Globals - + Globals
@@ -25,7 +24,6 @@
-
@@ -74,8 +72,8 @@
- +
Modified: pal-admin/trunk/src/main/webapp/view/user/userAttributeConfirm.html =================================================================== --- pal-admin/trunk/src/main/webapp/view/user/userAttributeConfirm.html 2008-06-04 22:22:50 UTC (rev 951) +++ pal-admin/trunk/src/main/webapp/view/user/userAttributeConfirm.html 2008-06-04 22:30:42 UTC (rev 952) @@ -7,15 +7,12 @@
+
- - Role - - - Group - + Role + Group
@@ -29,29 +26,20 @@
-
- - Basic - + Basic | - - Role - + Role | - - Group - + Group | | - - Profiling Rule - + Profiling Rule
@@ -75,7 +63,7 @@ - + Modified: pal-admin/trunk/src/main/webapp/view/user/userAttributeEdit.html =================================================================== --- pal-admin/trunk/src/main/webapp/view/user/userAttributeEdit.html 2008-06-04 22:22:50 UTC (rev 951) +++ pal-admin/trunk/src/main/webapp/view/user/userAttributeEdit.html 2008-06-04 22:30:42 UTC (rev 952) @@ -7,15 +7,12 @@ +
- - Role - - - Group - + Role + Group
@@ -29,29 +26,20 @@
-
- - Basic - + Basic | - - Role - + Role | - - Group - + Group | | - - Profiling Rule - + Profiling Rule
@@ -79,7 +67,7 @@ onclick="location.href='userAttributeConfirm.html'" class="portlet-form-button"/> + - Modified: pal-admin/trunk/src/main/webapp/view/user/userAttributeList.html =================================================================== --- pal-admin/trunk/src/main/webapp/view/user/userAttributeList.html 2008-06-04 22:22:50 UTC (rev 951) +++ pal-admin/trunk/src/main/webapp/view/user/userAttributeList.html 2008-06-04 22:30:42 UTC (rev 952) @@ -7,15 +7,12 @@ +
- - Role - - - Group - + Role + Group
@@ -29,29 +26,20 @@
-
- - Basic - + Basic | - - Role - + Role | - - Group - + Group | | - - Profiling Rule - + Profiling Rule
@@ -98,7 +86,7 @@ Next>>
- + Modified: pal-admin/trunk/src/main/webapp/view/user/userConfirm.html =================================================================== --- pal-admin/trunk/src/main/webapp/view/user/userConfirm.html 2008-06-04 22:22:50 UTC (rev 951) +++ pal-admin/trunk/src/main/webapp/view/user/userConfirm.html 2008-06-04 22:30:42 UTC (rev 952) @@ -7,15 +7,12 @@ +
- - Role - - - Group - + Role + Group
@@ -30,7 +27,6 @@
-
@@ -83,7 +79,7 @@
- + Modified: pal-admin/trunk/src/main/webapp/view/user/userCreate.html =================================================================== --- pal-admin/trunk/src/main/webapp/view/user/userCreate.html 2008-06-04 22:22:50 UTC (rev 951) +++ pal-admin/trunk/src/main/webapp/view/user/userCreate.html 2008-06-04 22:30:42 UTC (rev 952) @@ -7,15 +7,12 @@ +
- - Role - - - Group - + Role + Group
@@ -29,7 +26,6 @@
-
@@ -74,7 +70,7 @@ onclick="location.href='userConfirm.html'" class="portlet-form-button"/>
+ - Modified: pal-admin/trunk/src/main/webapp/view/user/userEdit.html =================================================================== --- pal-admin/trunk/src/main/webapp/view/user/userEdit.html 2008-06-04 22:22:50 UTC (rev 951) +++ pal-admin/trunk/src/main/webapp/view/user/userEdit.html 2008-06-04 22:30:42 UTC (rev 952) @@ -7,6 +7,7 @@ +
@@ -29,7 +30,6 @@
-
@@ -37,21 +37,13 @@
| - - Role - + Role | - - Group - + Group | - - User Attribute - + User Attribute | - - Profiling Rule - + Profiling Rule
@@ -109,7 +101,7 @@ onclick="location.href='userEdit.html'" class="portlet-form-button"/> + - Modified: pal-admin/trunk/src/main/webapp/view/user/userGroupEdit.html =================================================================== --- pal-admin/trunk/src/main/webapp/view/user/userGroupEdit.html 2008-06-04 22:22:50 UTC (rev 951) +++ pal-admin/trunk/src/main/webapp/view/user/userGroupEdit.html 2008-06-04 22:30:42 UTC (rev 952) @@ -7,15 +7,12 @@ +
- - Role - - - Group - + Role + Group
@@ -29,29 +26,20 @@
-
- - Basic - + Basic | - - Role - + Role | | - - User Attribute - + User Attribute | - - Profiling Rule - + Profiling Rule
@@ -88,7 +76,7 @@ onclick="location.href='userList.html'" class="portlet-form-button"/> + - Modified: pal-admin/trunk/src/main/webapp/view/user/userList.html =================================================================== --- pal-admin/trunk/src/main/webapp/view/user/userList.html 2008-06-04 22:22:50 UTC (rev 951) +++ pal-admin/trunk/src/main/webapp/view/user/userList.html 2008-06-04 22:30:42 UTC (rev 952) @@ -7,15 +7,12 @@ +
- - Role - - - Group - + Role + Group
@@ -29,7 +26,6 @@
-
@@ -86,7 +82,7 @@ te:rendered="#{user_userListPage.nextPageNumber!=null}">Next>>
- + Modified: pal-admin/trunk/src/main/webapp/view/user/userProfilingRuleEdit.html =================================================================== --- pal-admin/trunk/src/main/webapp/view/user/userProfilingRuleEdit.html 2008-06-04 22:22:50 UTC (rev 951) +++ pal-admin/trunk/src/main/webapp/view/user/userProfilingRuleEdit.html 2008-06-04 22:30:42 UTC (rev 952) @@ -7,15 +7,12 @@ +
- - Role - - - Group - + Role + Group
@@ -29,27 +26,18 @@
-
- - Basic - + Basic | - - Role - + Role | - - Group - + Group | - - User Attribute - + User Attribute |
@@ -91,7 +79,7 @@ onclick="location.href='userList.html'" class="portlet-form-button"/>
+ - Modified: pal-admin/trunk/src/main/webapp/view/user/userRoleEdit.html =================================================================== --- pal-admin/trunk/src/main/webapp/view/user/userRoleEdit.html 2008-06-04 22:22:50 UTC (rev 951) +++ pal-admin/trunk/src/main/webapp/view/user/userRoleEdit.html 2008-06-04 22:30:42 UTC (rev 952) @@ -7,15 +7,12 @@ +
- - Role - - - Group - + Role + Group
@@ -29,29 +26,20 @@
-
- - Basic - + Basic | | - - Group - + Group | - - User Attribute - + User Attribute | - - Profiling Rule - + Profiling Rule
@@ -88,7 +76,7 @@ onclick="location.href='userList.html'" class="portlet-form-button"/> + - From svnnotify @ sourceforge.jp Thu Jun 5 07:40:39 2008 From: svnnotify @ sourceforge.jp (svnnotify @ sourceforge.jp) Date: Thu, 05 Jun 2008 07:40:39 +0900 Subject: [pal-cvs 3216] [953] replaced with fixed teeda. Message-ID: <1212619239.434770.20778.nullmailer@users.sourceforge.jp> Revision: 953 http://svn.sourceforge.jp/cgi-bin/viewcvs.cgi?root=pal&view=rev&rev=953 Author: shinsuke Date: 2008-06-05 07:40:39 +0900 (Thu, 05 Jun 2008) Log Message: ----------- replaced with fixed teeda. skipped javadoc on a build process. Modified Paths: -------------- pal-admin/trunk/pom.xml -------------- next part -------------- Modified: pal-admin/trunk/pom.xml =================================================================== --- pal-admin/trunk/pom.xml 2008-06-04 22:30:42 UTC (rev 952) +++ pal-admin/trunk/pom.xml 2008-06-04 22:40:39 UTC (rev 953) @@ -82,6 +82,7 @@ + @@ -140,13 +142,8 @@ org.seasar.teeda - teeda-core - 1.0.13 - - - org.seasar.teeda teeda-extension - 1.0.13 + 1.0.13-sp2-20080605 org.seasar.teeda From svnnotify @ sourceforge.jp Thu Jun 5 08:57:19 2008 From: svnnotify @ sourceforge.jp (svnnotify @ sourceforge.jp) Date: Thu, 05 Jun 2008 08:57:19 +0900 Subject: [pal-cvs 3217] [954] escaped a display name and description. Message-ID: <1212623839.532153.18299.nullmailer@users.sourceforge.jp> Revision: 954 http://svn.sourceforge.jp/cgi-bin/viewcvs.cgi?root=pal&view=rev&rev=954 Author: shinsuke Date: 2008-06-05 08:57:19 +0900 (Thu, 05 Jun 2008) Log Message: ----------- escaped a display name and description. Modified Paths: -------------- pal-portal/branches/pal-portal-1.x/portal/jetspeed-2/components/portal/src/java/org/apache/jetspeed/layout/impl/GetPortletsAction.java -------------- next part -------------- Modified: pal-portal/branches/pal-portal-1.x/portal/jetspeed-2/components/portal/src/java/org/apache/jetspeed/layout/impl/GetPortletsAction.java =================================================================== --- pal-portal/branches/pal-portal-1.x/portal/jetspeed-2/components/portal/src/java/org/apache/jetspeed/layout/impl/GetPortletsAction.java 2008-06-04 22:40:39 UTC (rev 953) +++ pal-portal/branches/pal-portal-1.x/portal/jetspeed-2/components/portal/src/java/org/apache/jetspeed/layout/impl/GetPortletsAction.java 2008-06-04 23:57:19 UTC (rev 954) @@ -25,6 +25,7 @@ import java.util.Locale; import java.util.Map; +import org.apache.commons.lang.StringEscapeUtils; import org.apache.commons.logging.Log; import org.apache.commons.logging.LogFactory; import org.apache.jetspeed.JetspeedActions; @@ -165,9 +166,10 @@ { image = "images/portlets/applications-internet.png"; } - list.add(new PortletInfo(uniqueName, portlet - .getDisplayNameText(locale), portlet - .getDescriptionText(locale), image)); + list.add(new PortletInfo(uniqueName, StringEscapeUtils + .escapeHtml(portlet.getDisplayNameText(locale)), + StringEscapeUtils.escapeHtml(portlet + .getDescriptionText(locale)), image)); } } Collections.sort(list, this); From svnnotify @ sourceforge.jp Thu Jun 5 09:23:21 2008 From: svnnotify @ sourceforge.jp (svnnotify @ sourceforge.jp) Date: Thu, 05 Jun 2008 09:23:21 +0900 Subject: [pal-cvs 3218] [955] set multiple username to cookie. Message-ID: <1212625401.085892.8318.nullmailer@users.sourceforge.jp> Revision: 955 http://svn.sourceforge.jp/cgi-bin/viewcvs.cgi?root=pal&view=rev&rev=955 Author: shinsuke Date: 2008-06-05 09:23:20 +0900 (Thu, 05 Jun 2008) Log Message: ----------- set multiple username to cookie. Modified Paths: -------------- pal-portal/branches/pal-portal-1.x/portal/jetspeed-2/components/portal/src/java/jp/sf/pal/portal/filter/CookieTransferFilter.java -------------- next part -------------- Modified: pal-portal/branches/pal-portal-1.x/portal/jetspeed-2/components/portal/src/java/jp/sf/pal/portal/filter/CookieTransferFilter.java =================================================================== --- pal-portal/branches/pal-portal-1.x/portal/jetspeed-2/components/portal/src/java/jp/sf/pal/portal/filter/CookieTransferFilter.java 2008-06-04 23:57:19 UTC (rev 954) +++ pal-portal/branches/pal-portal-1.x/portal/jetspeed-2/components/portal/src/java/jp/sf/pal/portal/filter/CookieTransferFilter.java 2008-06-05 00:23:20 UTC (rev 955) @@ -35,9 +35,8 @@ protected static final String IS_TRANSFERRED = "jp.sf.pal.portal.login.TransferredInfo"; - // see JSR 168 PLT.D - // an username and password are defined as "username" and "password". - // a format of transferrred.info is "=,..". + // a format of transferred.info is "=,..". + // Notes: an user name are defined as "username". protected static final String TRANSFERRED_INFO = "transferred.info"; protected static final String PATH = "path"; @@ -58,8 +57,6 @@ protected boolean secure = false; - protected String usernameKey; - protected Map transferredInfo; public void init(FilterConfig filterConfig) throws ServletException @@ -97,15 +94,7 @@ { String k = pair.substring(0, index); String v = pair.substring(index + 1); - - if (USERNAME.equals(v)) - { - usernameKey = k; - } - else - { - transferredInfo.put(k, v); - } + transferredInfo.put(k, v); } } } @@ -125,7 +114,6 @@ { path = null; domain = null; - usernameKey = null; transferredInfo = null; } @@ -147,12 +135,6 @@ .getComponentManager().getComponent( "org.apache.jetspeed.security.UserManager"); - if (usernameKey != null) - { - hResponse.addCookie(createNewCookie(usernameKey, - username)); - } - if (!transferredInfo.isEmpty()) { try @@ -165,14 +147,24 @@ while (itr.hasNext()) { Map.Entry entry = (Map.Entry) itr.next(); - String value = userAttributes - .get((String) entry.getValue(), - EMPTY_STRING); - if (!value.equals(EMPTY_STRING)) + if (USERNAME.equals(entry.getValue())) { hResponse.addCookie(createNewCookie( - (String) entry.getKey(), value)); + (String) entry.getKey(), username)); } + else + { + String value = userAttributes.get( + (String) entry.getValue(), + EMPTY_STRING); + if (!value.equals(EMPTY_STRING)) + { + hResponse + .addCookie(createNewCookie( + (String) entry.getKey(), + value)); + } + } } } catch (SecurityException e) @@ -195,11 +187,6 @@ if (checkTransferredInfo(hRequest, true)) { - if (usernameKey != null) - { - hResponse.addCookie(createExpiredCookie(usernameKey)); - } - if (!transferredInfo.isEmpty()) { Iterator itr = transferredInfo.entrySet().iterator(); From svnnotify @ sourceforge.jp Thu Jun 5 09:28:22 2008 From: svnnotify @ sourceforge.jp (svnnotify @ sourceforge.jp) Date: Thu, 05 Jun 2008 09:28:22 +0900 Subject: [pal-cvs 3219] [956] fixed JS2-882 Message-ID: <1212625702.272257.12963.nullmailer@users.sourceforge.jp> Revision: 956 http://svn.sourceforge.jp/cgi-bin/viewcvs.cgi?root=pal&view=rev&rev=956 Author: shinsuke Date: 2008-06-05 09:28:22 +0900 (Thu, 05 Jun 2008) Log Message: ----------- fixed JS2-882 Modified Paths: -------------- pal-portal/branches/pal-portal-1.x/portal/jetspeed-2/components/cm/src/java/org/apache/jetspeed/cache/impl/EhPortletWindowCache.java -------------- next part -------------- Modified: pal-portal/branches/pal-portal-1.x/portal/jetspeed-2/components/cm/src/java/org/apache/jetspeed/cache/impl/EhPortletWindowCache.java =================================================================== --- pal-portal/branches/pal-portal-1.x/portal/jetspeed-2/components/cm/src/java/org/apache/jetspeed/cache/impl/EhPortletWindowCache.java 2008-06-05 00:23:20 UTC (rev 955) +++ pal-portal/branches/pal-portal-1.x/portal/jetspeed-2/components/cm/src/java/org/apache/jetspeed/cache/impl/EhPortletWindowCache.java 2008-06-05 00:28:22 UTC (rev 956) @@ -16,6 +16,7 @@ */ package org.apache.jetspeed.cache.impl; +import java.util.Collections; import java.util.HashMap; import java.util.HashSet; import java.util.Iterator; @@ -54,7 +55,7 @@ public EhPortletWindowCache(Ehcache ehcache) { super(ehcache); - portletEntityIdToEntityid = new HashMap(); + portletEntityIdToEntityid = Collections.synchronizedMap(new HashMap()); } /* From svnnotify @ sourceforge.jp Thu Jun 5 09:39:30 2008 From: svnnotify @ sourceforge.jp (svnnotify @ sourceforge.jp) Date: Thu, 05 Jun 2008 09:39:30 +0900 Subject: [pal-cvs 3220] [957] fixed JS2-883 Message-ID: <1212626370.004303.23149.nullmailer@users.sourceforge.jp> Revision: 957 http://svn.sourceforge.jp/cgi-bin/viewcvs.cgi?root=pal&view=rev&rev=957 Author: shinsuke Date: 2008-06-05 09:39:29 +0900 (Thu, 05 Jun 2008) Log Message: ----------- fixed JS2-883 Modified Paths: -------------- pal-portal/branches/pal-portal-1.x/portal/jetspeed-2/components/page-manager/src/java/org/apache/jetspeed/om/folder/impl/FolderImpl.java -------------- next part -------------- Modified: pal-portal/branches/pal-portal-1.x/portal/jetspeed-2/components/page-manager/src/java/org/apache/jetspeed/om/folder/impl/FolderImpl.java =================================================================== --- pal-portal/branches/pal-portal-1.x/portal/jetspeed-2/components/page-manager/src/java/org/apache/jetspeed/om/folder/impl/FolderImpl.java 2008-06-05 00:28:22 UTC (rev 956) +++ pal-portal/branches/pal-portal-1.x/portal/jetspeed-2/components/page-manager/src/java/org/apache/jetspeed/om/folder/impl/FolderImpl.java 2008-06-05 00:39:29 UTC (rev 957) @@ -62,6 +62,8 @@ public class FolderImpl extends NodeImpl implements Folder { + private static final String PAGE_MANAGER_COMPONENT = "org.apache.jetspeed.page.PageManager"; + private String defaultPage; private String skin; @@ -1189,7 +1191,7 @@ if (pageManager == null) { pageManager = (PageManager) Jetspeed.getComponentManager() - .getComponent("PageManager"); + .getComponent(PAGE_MANAGER_COMPONENT); } return pageManager; } From svnnotify @ sourceforge.jp Thu Jun 5 09:49:22 2008 From: svnnotify @ sourceforge.jp (svnnotify @ sourceforge.jp) Date: Thu, 05 Jun 2008 09:49:22 +0900 Subject: [pal-cvs 3221] [958] fixed JS2-884 Message-ID: <1212626962.362031.32196.nullmailer@users.sourceforge.jp> Revision: 958 http://svn.sourceforge.jp/cgi-bin/viewcvs.cgi?root=pal&view=rev&rev=958 Author: shinsuke Date: 2008-06-05 09:49:22 +0900 (Thu, 05 Jun 2008) Log Message: ----------- fixed JS2-884 Modified Paths: -------------- pal-portal/branches/pal-portal-1.x/portal/jetspeed-2/src/webapp/WEB-INF/assembly/security-spi-atn.xml -------------- next part -------------- Modified: pal-portal/branches/pal-portal-1.x/portal/jetspeed-2/src/webapp/WEB-INF/assembly/security-spi-atn.xml =================================================================== --- pal-portal/branches/pal-portal-1.x/portal/jetspeed-2/src/webapp/WEB-INF/assembly/security-spi-atn.xml 2008-06-05 00:39:29 UTC (rev 957) +++ pal-portal/branches/pal-portal-1.x/portal/jetspeed-2/src/webapp/WEB-INF/assembly/security-spi-atn.xml 2008-06-05 00:49:22 UTC (rev 958) @@ -130,7 +130,10 @@ - PROPAGATION_REQUIRED + PROPAGATION_REQUIRED + PROPAGATION_REQUIRED + PROPAGATION_REQUIRED + PROPAGATION_SUPPORTS From svnnotify @ sourceforge.jp Thu Jun 5 10:00:40 2008 From: svnnotify @ sourceforge.jp (svnnotify @ sourceforge.jp) Date: Thu, 05 Jun 2008 10:00:40 +0900 Subject: [pal-cvs 3222] [959] fixed JS2-849 Message-ID: <1212627640.322658.9885.nullmailer@users.sourceforge.jp> Revision: 959 http://svn.sourceforge.jp/cgi-bin/viewcvs.cgi?root=pal&view=rev&rev=959 Author: shinsuke Date: 2008-06-05 10:00:40 +0900 (Thu, 05 Jun 2008) Log Message: ----------- fixed JS2-849 Modified Paths: -------------- pal-portal/branches/pal-portal-1.x/portal/jetspeed-2/components/registry/src/java/org/apache/jetspeed/components/portletentity/PortletEntityImpl.java pal-portal/branches/pal-portal-1.x/portal/jetspeed-2/components/registry/src/test/org/apache/jetspeed/components/portletentity/TestPortletEntityDAO.java -------------- next part -------------- Modified: pal-portal/branches/pal-portal-1.x/portal/jetspeed-2/components/registry/src/java/org/apache/jetspeed/components/portletentity/PortletEntityImpl.java =================================================================== --- pal-portal/branches/pal-portal-1.x/portal/jetspeed-2/components/registry/src/java/org/apache/jetspeed/components/portletentity/PortletEntityImpl.java 2008-06-05 00:49:22 UTC (rev 958) +++ pal-portal/branches/pal-portal-1.x/portal/jetspeed-2/components/registry/src/java/org/apache/jetspeed/components/portletentity/PortletEntityImpl.java 2008-06-05 01:00:40 UTC (rev 959) @@ -88,8 +88,6 @@ protected Map perPrincipalPrefs = new HashMap(); - protected Map originalValues; - private PortletApplicationEntity applicationEntity = null; private PortletWindowList portletWindows = new PortletWindowListImpl(); @@ -178,7 +176,6 @@ { mergePreferencesSet(preferenceSet); } - backupValues(preferenceSet); dirty = true; } } @@ -223,8 +220,6 @@ preferenceValues); } } - - backupValues(preferenceSet); dirty = true; } } @@ -263,29 +258,6 @@ } } - /** - *

- * backupValues - *

- * - * - */ - protected void backupValues(PreferenceSet preferenceSet) - { - originalValues = new HashMap(); - Iterator itr = preferenceSet.iterator(); - while (itr.hasNext()) - { - PrefsPreference pref = (PrefsPreference) itr.next(); - - String[] currentValues = pref.getValueArray(); - String[] backUp = new String[currentValues.length]; - System.arraycopy(currentValues, 0, backUp, 0, currentValues.length); - originalValues.put(pref.getName(), backUp); - - } - } - public PortletDefinition getPortletDefinition() { // there are cases when jetspeed gets initialized before @@ -371,10 +343,6 @@ .get(principal); pac.storePreferenceSet(preferenceSet, this); dirty = false; - if (preferenceSet != null) - { - backupValues(preferenceSet); - } } private void storeToPage() throws IOException @@ -414,10 +382,6 @@ } dirty = false; - if (preferenceSet != null) - { - backupValues(preferenceSet); - } } /** @@ -430,51 +394,8 @@ public void reset() throws IOException { - PrefsPreferenceSetImpl preferenceSet = (PrefsPreferenceSetImpl) perPrincipalPrefs - .get(getPrincipal()); - try - { - if (originalValues != null && preferenceSet != null) - { - Iterator prefs = preferenceSet.iterator(); - - while (prefs.hasNext()) - { - PrefsPreference pref = (PrefsPreference) prefs.next(); - if (originalValues.containsKey(pref.getName())) - { - pref.setValues((String[]) originalValues.get(pref - .getName())); - } - else - { - preferenceSet.remove(pref); - } - preferenceSet.flush(); - } - - Iterator keys = originalValues.keySet().iterator(); - while (keys.hasNext()) - { - String key = (String) keys.next(); - if (preferenceSet.get(key) == null) - { - preferenceSet.add(key, Arrays - .asList((String[]) originalValues.get(key))); - } - } - } - dirty = false; - backupValues(preferenceSet); - } - catch (BackingStoreException e) - { - String msg = "Preference backing store failed: " + e.toString(); - IOException ioe = new IOException(msg); - ioe.initCause(e); - throw ioe; - } - + dirty = true; + getPreferenceSet(getPrincipal()); } // internal methods used for debugging purposes only Modified: pal-portal/branches/pal-portal-1.x/portal/jetspeed-2/components/registry/src/test/org/apache/jetspeed/components/portletentity/TestPortletEntityDAO.java =================================================================== --- pal-portal/branches/pal-portal-1.x/portal/jetspeed-2/components/registry/src/test/org/apache/jetspeed/components/portletentity/TestPortletEntityDAO.java 2008-06-05 00:49:22 UTC (rev 958) +++ pal-portal/branches/pal-portal-1.x/portal/jetspeed-2/components/registry/src/test/org/apache/jetspeed/components/portletentity/TestPortletEntityDAO.java 2008-06-05 01:00:40 UTC (rev 959) @@ -147,20 +147,6 @@ assertEquals("2", pref.getValueAt(0)); - entity.reset(); - - pref = (PreferenceComposite) prefs.get("pref1"); - - assertEquals("1", pref.getValueAt(0)); - - prefs.remove(pref); - - assertNull(prefs.get("pref1")); - - entity.reset(); - - assertNotNull(prefs.get("pref1")); - prefs.add("pref2", Arrays.asList(new String[] {"2", "3"})); @@ -190,22 +176,11 @@ } assertEquals(3, count); - entity.reset(); - - prefsValues = pref2.getValues(); - count = 0; - while (prefsValues.hasNext()) - { - assertEquals(String.valueOf(count + 2), prefsValues.next()); - count++; - } - assertEquals(2, count); - // testing preferences null values assignments fix, issue JS2-607 pref2.setValueAt(0, null); assertNull("pref2.value[0] should be null", pref2.getValueAt(0)); String[] values = pref2.getValueArray(); - assertEquals(2, values.length); + assertEquals(3, values.length); assertNull("pref2.value[0] should be null", values[0]); assertEquals("3", values[1]); pref2.setValues(new String[] @@ -220,14 +195,10 @@ pref2.setValues((String[]) null); assertFalse(pref2.isValueSet()); assertTrue(pref2.getValueArray().length == 0); - entity.reset(); - assertTrue(pref2.getValueArray().length == 2); pref2.setValues(new String[] {}); assertFalse(pref2.isValueSet()); assertTrue(pref2.getValueArray().length == 0); - entity.reset(); - assertTrue(pref2.getValueArray().length == 2); MutablePortletEntity entity2 = entityAccess .getPortletEntityForFragment(f1); From svnnotify @ sourceforge.jp Thu Jun 5 10:24:31 2008 From: svnnotify @ sourceforge.jp (svnnotify @ sourceforge.jp) Date: Thu, 05 Jun 2008 10:24:31 +0900 Subject: [pal-cvs 3223] [960] fixed JS2-886 Message-ID: <1212629071.456831.1183.nullmailer@users.sourceforge.jp> Revision: 960 http://svn.sourceforge.jp/cgi-bin/viewcvs.cgi?root=pal&view=rev&rev=960 Author: shinsuke Date: 2008-06-05 10:24:31 +0900 (Thu, 05 Jun 2008) Log Message: ----------- fixed JS2-886 Modified Paths: -------------- pal-portal/branches/pal-portal-1.x/portal/jetspeed-2/components/prefs/src/java/org/apache/jetspeed/prefs/impl/NodeImplProxy.java pal-portal/branches/pal-portal-1.x/portal/jetspeed-2/components/prefs/src/java/org/apache/jetspeed/prefs/impl/PreferencesImpl.java -------------- next part -------------- Modified: pal-portal/branches/pal-portal-1.x/portal/jetspeed-2/components/prefs/src/java/org/apache/jetspeed/prefs/impl/NodeImplProxy.java =================================================================== --- pal-portal/branches/pal-portal-1.x/portal/jetspeed-2/components/prefs/src/java/org/apache/jetspeed/prefs/impl/NodeImplProxy.java 2008-06-05 01:00:40 UTC (rev 959) +++ pal-portal/branches/pal-portal-1.x/portal/jetspeed-2/components/prefs/src/java/org/apache/jetspeed/prefs/impl/NodeImplProxy.java 2008-06-05 01:24:31 UTC (rev 960) @@ -20,11 +20,16 @@ import java.sql.Timestamp; import java.util.Collection; +import org.apache.commons.logging.Log; +import org.apache.commons.logging.LogFactory; import org.apache.jetspeed.prefs.om.Node; public class NodeImplProxy implements Node { + /** Logger. */ + private static final Log log = LogFactory.getLog(NodeImplProxy.class); + private Node node = null; private boolean dirty = false; @@ -162,8 +167,24 @@ } catch (Exception e) { - e.printStackTrace(); - node = null; + try + { + // try again, we may have ran out of connections as reproduced + // May 2008 + provider.redoNode(this, node.getFullPath(), node.getNodeType()); + dirty = false; + } + catch (Exception e2) + { + throw new RuntimeException( + "Failed to reset preference node. Unable to load node.", + e2); + } + // e.printStackTrace(); + if (log.isDebugEnabled()) + { + log.debug("re-create node: " + node.getFullPath(), e); + } } } Modified: pal-portal/branches/pal-portal-1.x/portal/jetspeed-2/components/prefs/src/java/org/apache/jetspeed/prefs/impl/PreferencesImpl.java =================================================================== --- pal-portal/branches/pal-portal-1.x/portal/jetspeed-2/components/prefs/src/java/org/apache/jetspeed/prefs/impl/PreferencesImpl.java 2008-06-05 01:00:40 UTC (rev 959) +++ pal-portal/branches/pal-portal-1.x/portal/jetspeed-2/components/prefs/src/java/org/apache/jetspeed/prefs/impl/PreferencesImpl.java 2008-06-05 01:24:31 UTC (rev 960) @@ -83,51 +83,57 @@ throws IllegalStateException { super(parent, nodeName); - try { - if (parent != null) - { - this.node = prefsProvider.createNode(parent.getNode(), - nodeName, nodeType, this.absolutePath()); - } - else - { - this.node = prefsProvider.createNode(null, nodeName, nodeType, - this.absolutePath()); - } - - newNode = true; + node = prefsProvider.getNode(this.absolutePath(), nodeType); + newNode = false; } - catch (FailedToCreateNodeException e) + catch (NodeDoesNotExistException e1) { - IllegalStateException ise = new IllegalStateException( - "Failed to create new Preferences of type " + nodeType - + " for path " + this.absolutePath()); - ise.initCause(e); - throw ise; - } - catch (NodeAlreadyExistsException e) - { try { - node = prefsProvider.getNode(this.absolutePath(), nodeType); - newNode = false; + if (parent != null) + { + this.node = prefsProvider.createNode(parent.getNode(), + nodeName, nodeType, this.absolutePath()); + } + else + { + this.node = prefsProvider.createNode(null, nodeName, + nodeType, this.absolutePath()); + } + + newNode = true; } - catch (NodeDoesNotExistException e1) + catch (FailedToCreateNodeException e) { - // If we get this at this point something is very wrong IllegalStateException ise = new IllegalStateException( - "Unable to create node for Preferences of type " - + nodeType - + " for path " - + this.absolutePath() - + ". If you see this exception at this, it more than likely means that the Preferences backing store is corrupt."); - ise.initCause(e1); + "Failed to create new Preferences of type " + nodeType + + " for path " + this.absolutePath()); + ise.initCause(e); throw ise; } + catch (NodeAlreadyExistsException e) + { + try + { + node = prefsProvider.getNode(this.absolutePath(), nodeType); + newNode = false; + } + catch (NodeDoesNotExistException e2) + { + // If we get this at this point something is very wrong + IllegalStateException ise = new IllegalStateException( + "Unable to create node for Preferences of type " + + nodeType + + " for path " + + this.absolutePath() + + ". If you see this exception at this, it more than likely means that the Preferences backing store is corrupt."); + ise.initCause(e2); + throw ise; + } + } } - } /** From svnnotify @ sourceforge.jp Thu Jun 5 10:34:15 2008 From: svnnotify @ sourceforge.jp (svnnotify @ sourceforge.jp) Date: Thu, 05 Jun 2008 10:34:15 +0900 Subject: [pal-cvs 3224] [961] patch for j2 663332. Message-ID: <1212629655.003450.8489.nullmailer@users.sourceforge.jp> Revision: 961 http://svn.sourceforge.jp/cgi-bin/viewcvs.cgi?root=pal&view=rev&rev=961 Author: shinsuke Date: 2008-06-05 10:34:14 +0900 (Thu, 05 Jun 2008) Log Message: ----------- patch for j2 663332. Modified Paths: -------------- pal-portal/branches/pal-portal-1.x/portal/jetspeed-2/components/portal/src/java/org/apache/jetspeed/pipeline/valve/impl/CleanupValveImpl.java -------------- next part -------------- Modified: pal-portal/branches/pal-portal-1.x/portal/jetspeed-2/components/portal/src/java/org/apache/jetspeed/pipeline/valve/impl/CleanupValveImpl.java =================================================================== --- pal-portal/branches/pal-portal-1.x/portal/jetspeed-2/components/portal/src/java/org/apache/jetspeed/pipeline/valve/impl/CleanupValveImpl.java 2008-06-05 01:24:31 UTC (rev 960) +++ pal-portal/branches/pal-portal-1.x/portal/jetspeed-2/components/portal/src/java/org/apache/jetspeed/pipeline/valve/impl/CleanupValveImpl.java 2008-06-05 01:34:14 UTC (rev 961) @@ -16,6 +16,9 @@ */ package org.apache.jetspeed.pipeline.valve.impl; +import java.io.ByteArrayOutputStream; +import java.io.ObjectOutputStream; +import java.util.Enumeration; import java.util.Stack; import javax.servlet.RequestDispatcher; @@ -39,7 +42,7 @@ * attempts to includde them. * * @author Scott T. Weaver - * @version $Id: CleanupValveImpl.java 516448 2007-03-09 16:25:47Z ate $ + * @version $Id$ * */ public class CleanupValveImpl extends AbstractValve implements CleanupValve @@ -81,6 +84,10 @@ rd.include(httpRequest, request.getResponse()); } } + if (log.isDebugEnabled()) + { + dumpSession(request); + } } catch (Exception e) { @@ -99,4 +106,49 @@ return "CleanupValveImpl"; } + public void dumpSession(RequestContext context) + { + try + { + int count = 0; + ByteArrayOutputStream bout = new ByteArrayOutputStream(); + ObjectOutputStream out = new ObjectOutputStream(bout); + Enumeration e = context.getRequest().getSession() + .getAttributeNames(); + while (e.hasMoreElements()) + { + String name = (String) e.nextElement(); + Object o = context.getSessionAttribute(name); + serializeObject(name, o); + out.writeObject(o); + count++; + } + out.close(); + log.debug("Session object: " + count); + log.debug("Session footprint: " + bout.size()); + } + catch (Throwable t) + { + log.debug("Exception in dumpSession().", t); + } + } + + public void serializeObject(String name, Object o) + { + try + { + ByteArrayOutputStream bout = new ByteArrayOutputStream(); + ObjectOutputStream out = new ObjectOutputStream(bout); + out.writeObject(o); + out.close(); + log.debug("o = " + name + ", " + o + ", size = " + bout.size()); + } + catch (Throwable t) + { + log + .debug( + "Exception in serializeObject(String name, Object o).", + t); + } + } } From svnnotify @ sourceforge.jp Thu Jun 5 10:41:31 2008 From: svnnotify @ sourceforge.jp (svnnotify @ sourceforge.jp) Date: Thu, 05 Jun 2008 10:41:31 +0900 Subject: [pal-cvs 3225] [962] fixed JS2-862 Message-ID: <1212630091.573653.13528.nullmailer@users.sourceforge.jp> Revision: 962 http://svn.sourceforge.jp/cgi-bin/viewcvs.cgi?root=pal&view=rev&rev=962 Author: shinsuke Date: 2008-06-05 10:41:31 +0900 (Thu, 05 Jun 2008) Log Message: ----------- fixed JS2-862 Modified Paths: -------------- pal-portal/branches/pal-portal-1.x/portal/jetspeed-2/components/portal/src/java/org/apache/jetspeed/layout/impl/PortletPlacementContextImpl.java -------------- next part -------------- Modified: pal-portal/branches/pal-portal-1.x/portal/jetspeed-2/components/portal/src/java/org/apache/jetspeed/layout/impl/PortletPlacementContextImpl.java =================================================================== --- pal-portal/branches/pal-portal-1.x/portal/jetspeed-2/components/portal/src/java/org/apache/jetspeed/layout/impl/PortletPlacementContextImpl.java 2008-06-05 01:34:14 UTC (rev 961) +++ pal-portal/branches/pal-portal-1.x/portal/jetspeed-2/components/portal/src/java/org/apache/jetspeed/layout/impl/PortletPlacementContextImpl.java 2008-06-05 01:41:31 UTC (rev 962) @@ -815,7 +815,7 @@ if (fragment != null) { if (foundFragment == null - || foundFragment.getId() != fragment.getId()) + || !foundFragment.getId().equals(fragment.getId())) { sourceDesc = (sourceDesc == null ? "getFragmentAtExpectedCoordinate" : sourceDesc); @@ -852,6 +852,11 @@ out.append("row is out of bounds, "); out.append("row-count=").append(colFragCount); } + if (foundFragment != null) + { + out.append(" - found fragment ").append( + foundFragment.getId()); + } out.append(")"); throw new PortletPlacementException(out.toString()); } From svnnotify @ sourceforge.jp Thu Jun 5 11:36:19 2008 From: svnnotify @ sourceforge.jp (svnnotify @ sourceforge.jp) Date: Thu, 05 Jun 2008 11:36:19 +0900 Subject: [pal-cvs 3226] [963] rollback of creating user. Message-ID: <1212633379.185271.31810.nullmailer@users.sourceforge.jp> Revision: 963 http://svn.sourceforge.jp/cgi-bin/viewcvs.cgi?root=pal&view=rev&rev=963 Author: shinsuke Date: 2008-06-05 11:36:18 +0900 (Thu, 05 Jun 2008) Log Message: ----------- rollback of creating user. Modified Paths: -------------- pal-admin/trunk/src/main/java/jp/sf/pal/admin/logic/SecurityProviderLogic.java pal-admin/trunk/src/main/java/jp/sf/pal/admin/service/UserManagementService.java pal-admin/trunk/src/main/java/jp/sf/pal/admin/web/user/UserConfirmPage.java pal-admin/trunk/src/main/resources/appMessages.properties pal-admin/trunk/src/main/resources/appMessages_ja.properties -------------- next part -------------- Modified: pal-admin/trunk/src/main/java/jp/sf/pal/admin/logic/SecurityProviderLogic.java =================================================================== --- pal-admin/trunk/src/main/java/jp/sf/pal/admin/logic/SecurityProviderLogic.java 2008-06-05 01:41:31 UTC (rev 962) +++ pal-admin/trunk/src/main/java/jp/sf/pal/admin/logic/SecurityProviderLogic.java 2008-06-05 02:36:18 UTC (rev 963) @@ -333,7 +333,7 @@ } - public void insertUser(User user) throws PALAdminException { + public void insertUser(User user) throws CommonException { //Debug if (PALAdminConstants.DEBUG) { return; @@ -341,12 +341,14 @@ if (PALAdminUtil.isEmpty(user.getName()) || PALAdminUtil.isEmpty(user.getPassword())) { - throw new PALAdminException( - "Invalid user name or password. username=" + user.getName() - + ", password=" + user.getPassword()); + throw new CommonException("username.or.password.is.null"); } - //TODO check duplicate name + // check duplicate name + if (getUserManager().userExists(user.getName())) { + throw new CommonException("username.already.exists"); + } + try { // Add user getUserManager().addUser(user.getName(), user.getPassword()); @@ -429,20 +431,29 @@ getPageManager().updateFolder(userFolder); getPageManager().reset(); } catch (FolderNotUpdatedException e) { - //TODO remove user throw new CommonException("could.not.update.folder", "Could not update a folder: " + userFolder.getPath(), e); } catch (NodeException e) { - //TODO remove user throw new CommonException("could.not.update.folder", "Could not update a folder: " + userFolder.getPath(), e); } } + } catch (CommonException e) { + try { + // remove user + deleteUser(user); + } catch (PALAdminException e1) { + } + throw e; } catch (Exception e) { - logger.error("Could not create user: " + user, e); - throw new PALAdminException(e); + try { + // remove user + deleteUser(user); + } catch (PALAdminException e1) { + } + throw new CommonException("failed.to.add.new.user", e); } } Modified: pal-admin/trunk/src/main/java/jp/sf/pal/admin/service/UserManagementService.java =================================================================== --- pal-admin/trunk/src/main/java/jp/sf/pal/admin/service/UserManagementService.java 2008-06-05 01:41:31 UTC (rev 962) +++ pal-admin/trunk/src/main/java/jp/sf/pal/admin/service/UserManagementService.java 2008-06-05 02:36:18 UTC (rev 963) @@ -44,6 +44,7 @@ import jp.sf.pal.admin.web.user.UserListPage; import jp.sf.pal.admin.web.user.UserProfilingRuleEditPage; import jp.sf.pal.admin.web.user.UserRoleEditPage; +import jp.sf.pal.common.CommonException; import org.seasar.teeda.extension.util.LabelHelper; @@ -150,7 +151,7 @@ } - public void insert(AbstractUserPage page) throws PALAdminException { + public void insert(AbstractUserPage page) throws CommonException { User entity = new User(); userDxo.convert(page, entity); securityProviderLogic.insertUser(entity); Modified: pal-admin/trunk/src/main/java/jp/sf/pal/admin/web/user/UserConfirmPage.java =================================================================== --- pal-admin/trunk/src/main/java/jp/sf/pal/admin/web/user/UserConfirmPage.java 2008-06-05 01:41:31 UTC (rev 962) +++ pal-admin/trunk/src/main/java/jp/sf/pal/admin/web/user/UserConfirmPage.java 2008-06-05 02:36:18 UTC (rev 963) @@ -22,6 +22,7 @@ import jp.sf.pal.admin.PALAdminException; import jp.sf.pal.admin.util.PALAdminUtil; import jp.sf.pal.admin.web.CrudType; +import jp.sf.pal.common.CommonException; import jp.sf.pal.common.util.FacesMessageUtil; import org.seasar.framework.log.Logger; @@ -79,7 +80,11 @@ getUserManagementService().insert(this); FacesMessageUtil.addInfoMessage("added.new.user", new Object[] { getName() }); - } catch (PALAdminException e) { + } catch (CommonException e) { + FacesMessageUtil.addErrorMessage(e.getMessageId(), + new Object[] { getName() }); + logger.error("Failed to add a new user: " + getName(), e); + } catch (Exception e) { FacesMessageUtil.addErrorMessage("failed.to.add.new.user", new Object[] { getName() }); logger.error("Failed to add a new user: " + getName(), e); Modified: pal-admin/trunk/src/main/resources/appMessages.properties =================================================================== --- pal-admin/trunk/src/main/resources/appMessages.properties 2008-06-05 01:41:31 UTC (rev 962) +++ pal-admin/trunk/src/main/resources/appMessages.properties 2008-06-05 02:36:18 UTC (rev 963) @@ -103,6 +103,8 @@ could.not.update.password=Could not update a password. Please contact a site administrator. updated.user.info=Updated user information +username.already.exists=Username already exists. +username.or.password.is.null=Username or Password are null. could.not.access.folder=Could not access the target folder. Please contact a site administrator. could.not.access.page=Could not access the target page. Please contact a site administrator. could.not.find.page=Could not find the target page. Please contact a site administrator. Modified: pal-admin/trunk/src/main/resources/appMessages_ja.properties =================================================================== --- pal-admin/trunk/src/main/resources/appMessages_ja.properties 2008-06-05 01:41:31 UTC (rev 962) +++ pal-admin/trunk/src/main/resources/appMessages_ja.properties 2008-06-05 02:36:18 UTC (rev 963) @@ -103,6 +103,8 @@ could.not.update.password=\u30d1\u30b9\u30ef\u30fc\u30c9\u3092\u66f4\u65b0\u3067\u304d\u307e\u305b\u3093\u3002\u7ba1\u7406\u8005\u306b\u304a\u554f\u3044\u5408\u308f\u305b\u304f\u3060\u3055\u3044\u3002 updated.user.info=\u30e6\u30fc\u30b6\u30fc\u60c5\u5831\u3092\u66f4\u65b0\u3057\u307e\u3057\u305f\u3002 +username.already.exists=\u305d\u306e\u30e6\u30fc\u30b6\u30fc\u540d\u306f\u65e2\u306b\u5b58\u5728\u3057\u307e\u3059\u3002 +username.or.password.is.null=\u30e6\u30fc\u30b6\u30fc\u540d\u307e\u305f\u306f\u30d1\u30b9\u30ef\u30fc\u30c9\u304c\u7a7a\u3067\u3059\u3002 could.not.access.folder=\u6307\u5b9a\u3057\u305f\u30d5\u30a9\u30eb\u30c0\u306b\u30a2\u30af\u30bb\u30b9\u3067\u304d\u307e\u305b\u3093\u3002\u7ba1\u7406\u8005\u306b\u304a\u554f\u3044\u5408\u308f\u305b\u304f\u3060\u3055\u3044\u3002 could.not.access.page=\u6307\u5b9a\u3057\u305f\u30da\u30fc\u30b8\u306b\u30a2\u30af\u30bb\u30b9\u3067\u304d\u307e\u305b\u3093\u3002\u7ba1\u7406\u8005\u306b\u304a\u554f\u3044\u5408\u308f\u305b\u304f\u3060\u3055\u3044\u3002 could.not.find.page=\u6307\u5b9a\u3057\u305f\u30da\u30fc\u30b8\u304c\u898b\u3064\u304b\u308a\u307e\u305b\u3093\u3002\u7ba1\u7406\u8005\u306b\u304a\u554f\u3044\u5408\u308f\u305b\u304f\u3060\u3055\u3044\u3002 From svnnotify @ sourceforge.jp Thu Jun 5 13:57:34 2008 From: svnnotify @ sourceforge.jp (svnnotify @ sourceforge.jp) Date: Thu, 05 Jun 2008 13:57:34 +0900 Subject: [pal-cvs 3227] [964] removed debug code. Message-ID: <1212641854.393916.21426.nullmailer@users.sourceforge.jp> Revision: 964 http://svn.sourceforge.jp/cgi-bin/viewcvs.cgi?root=pal&view=rev&rev=964 Author: shinsuke Date: 2008-06-05 13:57:34 +0900 (Thu, 05 Jun 2008) Log Message: ----------- removed debug code. fixed null url problem. Modified Paths: -------------- pal-admin/trunk/src/main/java/jp/sf/pal/admin/PALAdminConstants.java pal-admin/trunk/src/main/java/jp/sf/pal/admin/filter/UserManagementFilter.java pal-admin/trunk/src/main/java/jp/sf/pal/admin/logic/SecurityProviderLogic.java pal-admin/trunk/src/main/java/jp/sf/pal/admin/service/SiteEditorService.java -------------- next part -------------- Modified: pal-admin/trunk/src/main/java/jp/sf/pal/admin/PALAdminConstants.java =================================================================== --- pal-admin/trunk/src/main/java/jp/sf/pal/admin/PALAdminConstants.java 2008-06-05 02:36:18 UTC (rev 963) +++ pal-admin/trunk/src/main/java/jp/sf/pal/admin/PALAdminConstants.java 2008-06-05 04:57:34 UTC (rev 964) @@ -18,7 +18,6 @@ import org.apache.jetspeed.om.folder.Folder; public class PALAdminConstants { - public static final boolean DEBUG = false; public static final String PREFIX = "jp.sf.pal.admin."; Modified: pal-admin/trunk/src/main/java/jp/sf/pal/admin/filter/UserManagementFilter.java =================================================================== --- pal-admin/trunk/src/main/java/jp/sf/pal/admin/filter/UserManagementFilter.java 2008-06-05 02:36:18 UTC (rev 963) +++ pal-admin/trunk/src/main/java/jp/sf/pal/admin/filter/UserManagementFilter.java 2008-06-05 04:57:34 UTC (rev 964) @@ -73,56 +73,55 @@ public void init(PortletFilterConfig filterConfig) throws PortletException { PortletConfig portletConfig = filterConfig.getPortletConfig(); PortletContext portletContext = portletConfig.getPortletContext(); - if (!PALAdminConstants.DEBUG) { - // securityProvider - securityProvider = (SecurityProvider) portletContext - .getAttribute(PALAdminConstants.CPS_SECURITY_PROVIDER_COMPONENT); - if (securityProvider == null) { - throw new PortletException( - "Failed to find the Security Provider on portlet initialization"); - } - // userManager - userManager = (UserManager) portletContext - .getAttribute(CommonPortletServices.CPS_USER_MANAGER_COMPONENT); - if (userManager == null) { - throw new PortletException( - "Failed to find the User Manager on portlet initialization"); - } + // securityProvider + securityProvider = (SecurityProvider) portletContext + .getAttribute(PALAdminConstants.CPS_SECURITY_PROVIDER_COMPONENT); + if (securityProvider == null) { + throw new PortletException( + "Failed to find the Security Provider on portlet initialization"); + } - // groupManager - groupManager = (GroupManager) portletContext - .getAttribute(CommonPortletServices.CPS_GROUP_MANAGER_COMPONENT); - if (groupManager == null) { - throw new PortletException( - "Failed to find the Group Manager on portlet initialization"); - } + // userManager + userManager = (UserManager) portletContext + .getAttribute(CommonPortletServices.CPS_USER_MANAGER_COMPONENT); + if (userManager == null) { + throw new PortletException( + "Failed to find the User Manager on portlet initialization"); + } - // roleManager - roleManager = (RoleManager) portletContext - .getAttribute(CommonPortletServices.CPS_ROLE_MANAGER_COMPONENT); - if (roleManager == null) { - throw new PortletException( - "Failed to find the Role Manager on portlet initialization"); - } + // groupManager + groupManager = (GroupManager) portletContext + .getAttribute(CommonPortletServices.CPS_GROUP_MANAGER_COMPONENT); + if (groupManager == null) { + throw new PortletException( + "Failed to find the Group Manager on portlet initialization"); + } - // profiler - profiler = (Profiler) portletContext - .getAttribute(CommonPortletServices.CPS_PROFILER_COMPONENT); - if (null == profiler) { - throw new PortletException( - "Failed to find the Profiler on portlet initialization"); - } + // roleManager + roleManager = (RoleManager) portletContext + .getAttribute(CommonPortletServices.CPS_ROLE_MANAGER_COMPONENT); + if (roleManager == null) { + throw new PortletException( + "Failed to find the Role Manager on portlet initialization"); + } - // pageManager - pageManager = (PageManager) portletContext - .getAttribute(CommonPortletServices.CPS_PAGE_MANAGER_COMPONENT); - if (null == pageManager) { - throw new PortletException( - "Failed to find the Page Manager on portlet initialization"); - } + // profiler + profiler = (Profiler) portletContext + .getAttribute(CommonPortletServices.CPS_PROFILER_COMPONENT); + if (null == profiler) { + throw new PortletException( + "Failed to find the Profiler on portlet initialization"); + } + // pageManager + pageManager = (PageManager) portletContext + .getAttribute(CommonPortletServices.CPS_PAGE_MANAGER_COMPONENT); + if (null == pageManager) { + throw new PortletException( + "Failed to find the Page Manager on portlet initialization"); } + } /* Modified: pal-admin/trunk/src/main/java/jp/sf/pal/admin/logic/SecurityProviderLogic.java =================================================================== --- pal-admin/trunk/src/main/java/jp/sf/pal/admin/logic/SecurityProviderLogic.java 2008-06-05 02:36:18 UTC (rev 963) +++ pal-admin/trunk/src/main/java/jp/sf/pal/admin/logic/SecurityProviderLogic.java 2008-06-05 04:57:34 UTC (rev 964) @@ -260,14 +260,6 @@ // public List getUsers(UserPager pager) throws PALAdminException { - //Debug - if (PALAdminConstants.DEBUG) { - List list = new ArrayList(); - User entity = new User(); - entity.setName("USER"); - list.add(entity); - return list; - } if (pager.getAuthenticationProviderName() == null) { pager @@ -334,10 +326,6 @@ } public void insertUser(User user) throws CommonException { - //Debug - if (PALAdminConstants.DEBUG) { - return; - } if (PALAdminUtil.isEmpty(user.getName()) || PALAdminUtil.isEmpty(user.getPassword())) { @@ -483,10 +471,6 @@ } public void deleteUser(User user) throws PALAdminException { - //Debug - if (PALAdminConstants.DEBUG) { - return; - } try { getUserManager().removeUser(user.getName()); @@ -715,14 +699,6 @@ // public List getRoles(RolePager pager) { - //Debug - if (PALAdminConstants.DEBUG) { - List list = new ArrayList(); - Role r = new Role(); - r.setName("ROLE"); - list.add(r); - return list; - } List roleList = new ArrayList(); List principals = getRoleSecurityHandler() @@ -752,10 +728,6 @@ } public void insertRole(Role role) throws PALAdminException { - //Debug - if (PALAdminConstants.DEBUG) { - return; - } try { getRoleManager().addRole(role.getName()); @@ -765,10 +737,6 @@ } public void deleteRole(Role role) throws PALAdminException { - //Debug - if (PALAdminConstants.DEBUG) { - return; - } try { getRoleManager().removeRole(role.getName()); @@ -778,12 +746,6 @@ } public List getRoleNames() { - //Debug - if (PALAdminConstants.DEBUG) { - List list = new ArrayList(); - list.add("ROLE"); - return list; - } List roleList = new ArrayList(); List principals = getRoleSecurityHandler() @@ -820,14 +782,6 @@ // public List getGroups(GroupPager pager) { - //Debug - if (PALAdminConstants.DEBUG) { - List list = new ArrayList(); - Group entity = new Group(); - entity.setName("GROUP"); - list.add(entity); - return list; - } List groupList = new ArrayList(); List principals = getGroupSecurityHandler() @@ -857,10 +811,6 @@ } public void insertGroup(Group group) throws PALAdminException { - //Debug - if (PALAdminConstants.DEBUG) { - return; - } try { getGroupManager().addGroup(group.getName()); @@ -870,10 +820,6 @@ } public void deleteGroup(Group group) throws PALAdminException { - //Debug - if (PALAdminConstants.DEBUG) { - return; - } try { getGroupManager().removeGroup(group.getName()); @@ -883,12 +829,6 @@ } public List getGroupNames() { - //Debug - if (PALAdminConstants.DEBUG) { - List list = new ArrayList(); - list.add("GROUP"); - return list; - } List groupList = new ArrayList(); List principals = getGroupSecurityHandler() @@ -904,12 +844,6 @@ //TODO String to User public List getGroupNamesForUsername(String username) { - //Debug - if (PALAdminConstants.DEBUG) { - List list = new ArrayList(); - list.add("GROUP"); - return list; - } List groupList = new ArrayList(); Set principals = getSecurityProvider() @@ -923,12 +857,6 @@ } public List getRoleNamesForUsername(String username) { - //Debug - if (PALAdminConstants.DEBUG) { - List list = new ArrayList(); - list.add("GROUP"); - return list; - } List roleList = new ArrayList(); Set principals = getSecurityProvider() Modified: pal-admin/trunk/src/main/java/jp/sf/pal/admin/service/SiteEditorService.java =================================================================== --- pal-admin/trunk/src/main/java/jp/sf/pal/admin/service/SiteEditorService.java 2008-06-05 02:36:18 UTC (rev 963) +++ pal-admin/trunk/src/main/java/jp/sf/pal/admin/service/SiteEditorService.java 2008-06-05 04:57:34 UTC (rev 964) @@ -655,16 +655,19 @@ } public String getReturnPathURL(String mode, String returnPath) { - //"${req.scheme}://${req.serverName}:${req.serverPort}${req.contextPath}/ HttpServletRequest request = getSiteEditorLogic().getRequestContext() .getRequest(); StringBuffer buf = new StringBuffer(); - buf.append(request.getScheme()).append("://").append( - request.getServerName()).append(":").append( - request.getServerPort()).append(request.getContextPath()); - - if (!buf.toString().endsWith("/")) { - buf.append(mode); + if (request.getScheme() != null) { + //"${req.scheme}://${req.serverName}:${req.serverPort}${req.contextPath}/ + buf.append(request.getScheme()).append("://").append( + request.getServerName()).append(":").append( + request.getServerPort()).append(request.getContextPath()); + if (!buf.toString().endsWith("/")) { + buf.append(mode); + } else { + buf.append(mode.substring(1)); + } } else { buf.append(mode.substring(1)); } @@ -677,16 +680,18 @@ } public String getViewURL(String path) { - //"${req.scheme}://${req.serverName}:${req.serverPort}${req.contextPath}/ HttpServletRequest request = getSiteEditorLogic().getRequestContext() .getRequest(); StringBuffer buf = new StringBuffer(); - buf.append(request.getScheme()).append("://").append( - request.getServerName()).append(":").append( - request.getServerPort()).append(request.getContextPath()); + if (request.getScheme() != null) { + //"${req.scheme}://${req.serverName}:${req.serverPort}${req.contextPath}/ + buf.append(request.getScheme()).append("://").append( + request.getServerName()).append(":").append( + request.getServerPort()).append(request.getContextPath()); - if (!buf.toString().endsWith("/")) { - buf.append("/"); + if (!buf.toString().endsWith("/")) { + buf.append("/"); + } } buf.append("configure/"); From svnnotify @ sourceforge.jp Tue Jun 10 12:22:46 2008 From: svnnotify @ sourceforge.jp (svnnotify @ sourceforge.jp) Date: Tue, 10 Jun 2008 12:22:46 +0900 Subject: [pal-cvs 3228] [965] added overflow for ie bug. Message-ID: <1213068166.040688.2393.nullmailer@users.sourceforge.jp> Revision: 965 http://svn.sourceforge.jp/cgi-bin/viewcvs.cgi?root=pal&view=rev&rev=965 Author: shinsuke Date: 2008-06-10 12:22:45 +0900 (Tue, 10 Jun 2008) Log Message: ----------- added overflow for ie bug. Modified Paths: -------------- pal-portal/branches/pal-portal-1.x/portal/jetspeed-2/src/webapp/WEB-INF/templates/layout/html/columns/layout.vm -------------- next part -------------- Modified: pal-portal/branches/pal-portal-1.x/portal/jetspeed-2/src/webapp/WEB-INF/templates/layout/html/columns/layout.vm =================================================================== --- pal-portal/branches/pal-portal-1.x/portal/jetspeed-2/src/webapp/WEB-INF/templates/layout/html/columns/layout.vm 2008-06-05 04:57:34 UTC (rev 964) +++ pal-portal/branches/pal-portal-1.x/portal/jetspeed-2/src/webapp/WEB-INF/templates/layout/html/columns/layout.vm 2008-06-10 03:22:45 UTC (rev 965) @@ -72,7 +72,7 @@ #foreach($column in $columnLayout.columns) #set($columnFloat = $columnLayout.getColumnFloat($columnIndex)) #set($columnWidth = $columnLayout.getColumnWidth($columnIndex)) -
+
#foreach($f in $column)## Set up coordinates for this fragment #set($coords = $columnLayout.getCoordinate($f)) #set($col = $coords.x) From svnnotify @ sourceforge.jp Tue Jun 10 14:14:16 2008 From: svnnotify @ sourceforge.jp (svnnotify @ sourceforge.jp) Date: Tue, 10 Jun 2008 14:14:16 +0900 Subject: [pal-cvs 3229] [966] version 1.1 Message-ID: <1213074856.351883.30167.nullmailer@users.sourceforge.jp> Revision: 966 http://svn.sourceforge.jp/cgi-bin/viewcvs.cgi?root=pal&view=rev&rev=966 Author: shinsuke Date: 2008-06-10 14:14:16 +0900 (Tue, 10 Jun 2008) Log Message: ----------- version 1.1 Modified Paths: -------------- pal-admin/trunk/pom.xml -------------- next part -------------- Modified: pal-admin/trunk/pom.xml =================================================================== --- pal-admin/trunk/pom.xml 2008-06-10 03:22:45 UTC (rev 965) +++ pal-admin/trunk/pom.xml 2008-06-10 05:14:16 UTC (rev 966) @@ -3,7 +3,7 @@ 4.0.0 jp.sf.pal pal-admin - 1.1-SNAPSHOT + 1.1 war Administration tools for PAL Portal From svnnotify @ sourceforge.jp Tue Jun 10 14:15:15 2008 From: svnnotify @ sourceforge.jp (svnnotify @ sourceforge.jp) Date: Tue, 10 Jun 2008 14:15:15 +0900 Subject: [pal-cvs 3230] [967] 1.1 Message-ID: <1213074915.721217.30586.nullmailer@users.sourceforge.jp> Revision: 967 http://svn.sourceforge.jp/cgi-bin/viewcvs.cgi?root=pal&view=rev&rev=967 Author: shinsuke Date: 2008-06-10 14:15:15 +0900 (Tue, 10 Jun 2008) Log Message: ----------- 1.1 Added Paths: ----------- pal-admin/tags/pal-admin-1.1/ -------------- next part -------------- Copied: pal-admin/tags/pal-admin-1.1 (from rev 966, pal-admin/trunk) From svnnotify @ sourceforge.jp Tue Jun 10 14:22:15 2008 From: svnnotify @ sourceforge.jp (svnnotify @ sourceforge.jp) Date: Tue, 10 Jun 2008 14:22:15 +0900 Subject: [pal-cvs 3231] [968] pal-admin 1.1 Message-ID: <1213075335.967974.5371.nullmailer@users.sourceforge.jp> Revision: 968 http://svn.sourceforge.jp/cgi-bin/viewcvs.cgi?root=pal&view=rev&rev=968 Author: shinsuke Date: 2008-06-10 14:22:15 +0900 (Tue, 10 Jun 2008) Log Message: ----------- pal-admin 1.1 Modified Paths: -------------- pal-portal/branches/pal-portal-1.x/portlets/resources/jp/sf/pal/pal-admin.properties -------------- next part -------------- Modified: pal-portal/branches/pal-portal-1.x/portlets/resources/jp/sf/pal/pal-admin.properties =================================================================== --- pal-portal/branches/pal-portal-1.x/portlets/resources/jp/sf/pal/pal-admin.properties 2008-06-10 05:15:15 UTC (rev 967) +++ pal-portal/branches/pal-portal-1.x/portlets/resources/jp/sf/pal/pal-admin.properties 2008-06-10 05:22:15 UTC (rev 968) @@ -10,8 +10,8 @@ cvs.module.name= # SVN -svn.repository.path=http://svn.sourceforge.jp/svnroot/pal/pal-admin/trunk/ -#svn.repository.path=http://svn.sourceforge.jp/svnroot/pal/pal-admin/tags/pal-admin-0.7 +#svn.repository.path=http://svn.sourceforge.jp/svnroot/pal/pal-admin/trunk/ +svn.repository.path=http://svn.sourceforge.jp/svnroot/pal/pal-admin/tags/pal-admin-1.1 svn.revision=HEAD svn.module.name=pal-admin From svnnotify @ sourceforge.jp Tue Jun 10 14:22:30 2008 From: svnnotify @ sourceforge.jp (svnnotify @ sourceforge.jp) Date: Tue, 10 Jun 2008 14:22:30 +0900 Subject: [pal-cvs 3232] [969] version 1.0.5 Message-ID: <1213075350.263901.5467.nullmailer@users.sourceforge.jp> Revision: 969 http://svn.sourceforge.jp/cgi-bin/viewcvs.cgi?root=pal&view=rev&rev=969 Author: shinsuke Date: 2008-06-10 14:22:30 +0900 (Tue, 10 Jun 2008) Log Message: ----------- version 1.0.5 Modified Paths: -------------- pal-portal/branches/pal-portal-1.x/build.properties -------------- next part -------------- Modified: pal-portal/branches/pal-portal-1.x/build.properties =================================================================== --- pal-portal/branches/pal-portal-1.x/build.properties 2008-06-10 05:22:15 UTC (rev 968) +++ pal-portal/branches/pal-portal-1.x/build.properties 2008-06-10 05:22:30 UTC (rev 969) @@ -4,7 +4,7 @@ container.name=PAL Portal container.separator=/ container.version.major=1 -container.version.minor=0.5-dev +container.version.minor=0.5 container.info.file=commons/src/java/org/apache/jetspeed/container/resources/ContainerInfo.properties override.prop.file=src/webapp/WEB-INF/conf/override.properties portlets.home=${basedir}/portlets From karma @ users.sourceforge.jp Tue Jun 10 20:49:48 2008 From: karma @ users.sourceforge.jp (KATOH Yasufumi) Date: Tue, 10 Jun 2008 20:49:48 +0900 Subject: [pal-cvs 3233] CVS-Update: weather committed by karma Message-ID: <1213098588.131578.3795.nullmailer@users.sourceforge.jp> Update of /cvsroot/pal/weather In directory sf-cvs:/tmp/cvs-serv3787 Modified Files: project.properties Log Message: add maven repository info. weather/project.properties 1.3 -> 1.4 (modified) http://cvs.sourceforge.jp/cgi-bin/viewcvs.cgi/pal/weather/project.properties.diff?r1=1.3&r2=1.4 =================================================================== RCS file: weather/project.properties,v retrieving revision 1.3 retrieving revision 1.4 diff -u -r1.3 -r1.4 --- project.properties 2007/02/26 10:13:52 1.3 +++ project.properties 2008/06/10 11:49:47 1.4 @@ -27,3 +27,4 @@ # repo #maven.repo.remote = http://www.bluesunrise.com/maven/, http://www.ibiblio.org/maven/, http://dist.codehaus.org/, http://people.apache.org/repository/, http://marevol-utils.sourceforge.jp/maven/, http://seasar.sourceforge.jp/maven/, http://www.marevol.com/maven +maven.repo.remote = http://mirrors.ibiblio.org/pub/mirrors/maven/ \ No newline at end of file From svnnotify @ sourceforge.jp Tue Jun 10 21:46:23 2008 From: svnnotify @ sourceforge.jp (svnnotify @ sourceforge.jp) Date: Tue, 10 Jun 2008 21:46:23 +0900 Subject: [pal-cvs 3234] [970] added maxAge option to AuditActivity Message-ID: <1213101983.788783.21079.nullmailer@users.sourceforge.jp> Revision: 970 http://svn.sourceforge.jp/cgi-bin/viewcvs.cgi?root=pal&view=rev&rev=970 Author: shinsuke Date: 2008-06-10 21:46:23 +0900 (Tue, 10 Jun 2008) Log Message: ----------- added maxAge option to AuditActivity Modified Paths: -------------- pal-portal/branches/pal-portal-1.x/portal/jetspeed-2/components/statistics/src/java/org/apache/jetspeed/audit/impl/AuditActivityImpl.java pal-portal/branches/pal-portal-1.x/portal/jetspeed-2/src/webapp/WEB-INF/assembly/statistics.xml -------------- next part -------------- Modified: pal-portal/branches/pal-portal-1.x/portal/jetspeed-2/components/statistics/src/java/org/apache/jetspeed/audit/impl/AuditActivityImpl.java =================================================================== --- pal-portal/branches/pal-portal-1.x/portal/jetspeed-2/components/statistics/src/java/org/apache/jetspeed/audit/impl/AuditActivityImpl.java 2008-06-10 05:22:30 UTC (rev 969) +++ pal-portal/branches/pal-portal-1.x/portal/jetspeed-2/components/statistics/src/java/org/apache/jetspeed/audit/impl/AuditActivityImpl.java 2008-06-10 12:46:23 UTC (rev 970) @@ -48,9 +48,12 @@ protected boolean enabled = true; + protected int maxAge; + public AuditActivityImpl(DataSource dataSource) { this.ds = dataSource; + maxAge = 0; } public void setEnabled(boolean enabled) @@ -63,6 +66,16 @@ return this.enabled; } + public int getMaxAge() + { + return maxAge; + } + + public void setMaxAge(int maxAge) + { + this.maxAge = maxAge; + } + public DataSource getDataSource() { return ds; @@ -138,6 +151,14 @@ stm.setString(9, afterValue); stm.setString(10, description); stm.execute(); + if (maxAge > 0) + { + PreparedStatement stm2 = con + .prepareStatement("DELETE FROM ADMIN_ACTIVITY WHERE TIME_STAMP < ?"); + stm2.setTimestamp(1, new Timestamp(System.currentTimeMillis() + + ((long) maxAge * 1000))); + stm2.execute(); + } } catch (SQLException e) { @@ -195,6 +216,15 @@ stm.setString(8, afterValue); stm.setString(9, description); stm.executeUpdate(); + if (maxAge > 0) + { + PreparedStatement stm2 = con + .prepareStatement("DELETE FROM USER_ACTIVITY WHERE TIME_STAMP < ?"); + stm2.setTimestamp(1, new Timestamp(System + .currentTimeMillis() + + ((long) maxAge * 1000))); + stm2.execute(); + } } catch (SQLException e) { Modified: pal-portal/branches/pal-portal-1.x/portal/jetspeed-2/src/webapp/WEB-INF/assembly/statistics.xml =================================================================== --- pal-portal/branches/pal-portal-1.x/portal/jetspeed-2/src/webapp/WEB-INF/assembly/statistics.xml 2008-06-10 05:22:30 UTC (rev 969) +++ pal-portal/branches/pal-portal-1.x/portal/jetspeed-2/src/webapp/WEB-INF/assembly/statistics.xml 2008-06-10 12:46:23 UTC (rev 970) @@ -57,6 +57,8 @@ > true + + 2592000 From svnnotify @ sourceforge.jp Tue Jun 10 21:50:27 2008 From: svnnotify @ sourceforge.jp (svnnotify @ sourceforge.jp) Date: Tue, 10 Jun 2008 21:50:27 +0900 Subject: [pal-cvs 3235] [971] wrong operator.. Message-ID: <1213102227.438075.24541.nullmailer@users.sourceforge.jp> Revision: 971 http://svn.sourceforge.jp/cgi-bin/viewcvs.cgi?root=pal&view=rev&rev=971 Author: shinsuke Date: 2008-06-10 21:50:27 +0900 (Tue, 10 Jun 2008) Log Message: ----------- wrong operator.. Modified Paths: -------------- pal-portal/branches/pal-portal-1.x/portal/jetspeed-2/components/statistics/src/java/org/apache/jetspeed/audit/impl/AuditActivityImpl.java -------------- next part -------------- Modified: pal-portal/branches/pal-portal-1.x/portal/jetspeed-2/components/statistics/src/java/org/apache/jetspeed/audit/impl/AuditActivityImpl.java =================================================================== --- pal-portal/branches/pal-portal-1.x/portal/jetspeed-2/components/statistics/src/java/org/apache/jetspeed/audit/impl/AuditActivityImpl.java 2008-06-10 12:46:23 UTC (rev 970) +++ pal-portal/branches/pal-portal-1.x/portal/jetspeed-2/components/statistics/src/java/org/apache/jetspeed/audit/impl/AuditActivityImpl.java 2008-06-10 12:50:27 UTC (rev 971) @@ -156,7 +156,7 @@ PreparedStatement stm2 = con .prepareStatement("DELETE FROM ADMIN_ACTIVITY WHERE TIME_STAMP < ?"); stm2.setTimestamp(1, new Timestamp(System.currentTimeMillis() - + ((long) maxAge * 1000))); + - ((long) maxAge * 1000))); stm2.execute(); } } @@ -222,7 +222,7 @@ .prepareStatement("DELETE FROM USER_ACTIVITY WHERE TIME_STAMP < ?"); stm2.setTimestamp(1, new Timestamp(System .currentTimeMillis() - + ((long) maxAge * 1000))); + - ((long) maxAge * 1000))); stm2.execute(); } } From shinsuke @ users.sourceforge.jp Wed Jun 11 18:25:55 2008 From: shinsuke @ users.sourceforge.jp (Shinsuke SUGAYA) Date: Wed, 11 Jun 2008 18:25:55 +0900 Subject: [pal-cvs 3236] CVS-Update: site/xdocs committed by shinsuke Message-ID: <1213176355.608560.13782.nullmailer@users.sourceforge.jp> Update of /cvsroot/pal/site/xdocs In directory sf-cvs:/tmp/cvs-serv13779/xdocs Modified Files: download.xml Log Message: replaced with a list created by javascript. site/xdocs/download.xml 1.9 -> 1.10 (modified) http://cvs.sourceforge.jp/cgi-bin/viewcvs.cgi/pal/site/xdocs/download.xml.diff?r1=1.9&r2=1.10 =================================================================== RCS file: site/xdocs/download.xml,v retrieving revision 1.9 retrieving revision 1.10 diff -u -r1.9 -r1.10 --- download.xml 2007/02/27 23:54:59 1.9 +++ download.xml 2008/06/11 09:25:55 1.10 @@ -11,200 +11,9 @@

現在、ダウンロード可能なポータルサーバー、ポータルアプリケーション、および、ライブラリは以下の通りです。

- - -
- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
最新リリース情報
パッケージバージョンリリース日リリースメモ / 変更履歴ダウンロード
addresslist0.32006-09-14 07:05Document / DocumentDownload
blog1.52006-11-07 21:11Document / DocumentDownload
bridges-myfaces0.82006-09-11 22:58Document / DocumentDownload
charttest0.22006-09-26 06:15Document / DocumentDownload
cms-portlet0.42007-01-19 06:48Document / DocumentDownload
facesdevfilter0.12006-12-17 08:36Document / DocumentDownload
facesresponsefilter0.22007-01-13 22:54Document / DocumentDownload
googlegadgets0.22006-10-14 14:06Document / DocumentDownload
helloworld1.12006-11-12 06:33Document / DocumentDownload
jmap0.12006-09-25 06:43Document / DocumentDownload
jsfhelloworld0.22006-09-15 21:55Document / DocumentDownload
jstock0.62007-01-17 17:08Document / DocumentDownload
notepad0.32006-09-15 20:51Document / DocumentDownload
pal-portal1.0-beta32006-12-31 15:16Document / DocumentDownload
portletoutputoptimizer0.22007-02-18 18:08Document / DocumentDownload
s2helloworld1.02006-04-22 07:03Document / DocumentDownload
searchselector0.12006-08-30 07:20Document / DocumentDownload
teeda-ajax-portlet1.02006-12-01 21:46Document / DocumentDownload
todolist0.32006-09-15 20:53Document / DocumentDownload
tomahawkbridge0.9.12007-01-13 22:56Document / DocumentDownload
vfs-portlets1.42007-01-21 16:19Document / DocumentDownload
weather1.02007-02-26 19:28Document / DocumentDownload
webparts0.12006-10-08 08:59Document / DocumentDownload
wiki0.12007-02-28 08:33Document / DocumentDownload
yahoosearch0.12005-12-28 06:52Document / DocumentDownload
[全リリース物件の表示]
- +
+ +
From shinsuke @ users.sourceforge.jp Wed Jun 11 18:25:55 2008 From: shinsuke @ users.sourceforge.jp (Shinsuke SUGAYA) Date: Wed, 11 Jun 2008 18:25:55 +0900 Subject: [pal-cvs 3237] CVS-Update: site/xdocs/en committed by shinsuke Message-ID: <1213176355.731318.13790.nullmailer@users.sourceforge.jp> Update of /cvsroot/pal/site/xdocs/en In directory sf-cvs:/tmp/cvs-serv13779/xdocs/en Modified Files: download.xml Log Message: replaced with a list created by javascript. site/xdocs/en/download.xml 1.9 -> 1.10 (modified) http://cvs.sourceforge.jp/cgi-bin/viewcvs.cgi/pal/site/xdocs/en/download.xml.diff?r1=1.9&r2=1.10 =================================================================== RCS file: site/xdocs/en/download.xml,v retrieving revision 1.9 retrieving revision 1.10 diff -u -r1.9 -r1.10 --- download.xml 2007/02/27 23:54:59 1.9 +++ download.xml 2008/06/11 09:25:55 1.10 @@ -11,200 +11,9 @@

Available Portal Server, Portlets and Libraries are:

- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
Latest File Releases
PackageVersionDateNotes / Change LogDownload
addresslist0.32006-09-14 07:05Document / DocumentDownload
blog1.52006-11-07 21:11Document / DocumentDownload
bridges-myfaces0.82006-09-11 22:58Document / DocumentDownload
charttest0.22006-09-26 06:15Document / DocumentDownload
cms-portlet0.42007-01-19 06:48Document / DocumentDownload
facesdevfilter0.12006-12-17 08:36Document / DocumentDownload
facesresponsefilter0.22007-01-13 22:54Document / DocumentDownload
googlegadgets0.22006-10-14 14:06Document / DocumentDownload
helloworld1.12006-11-12 06:33Document / DocumentDownload
jmap0.12006-09-25 06:43Document / DocumentDownload
jsfhelloworld0.22006-09-15 21:55Document / DocumentDownload
jstock0.62007-01-17 17:08Document / DocumentDownload
notepad0.32006-09-15 20:51Document / DocumentDownload
pal-portal1.0-beta32006-12-31 15:16Document / DocumentDownload
portletoutputoptimizer0.22007-02-18 18:08Document / DocumentDownload
s2helloworld1.02006-04-22 07:03Document / DocumentDownload
searchselector0.12006-08-30 07:20Document / DocumentDownload
teeda-ajax-portlet1.02006-12-01 21:46Document / DocumentDownload
todolist0.32006-09-15 20:53Document / DocumentDownload
tomahawkbridge0.9.12007-01-13 22:56Document / DocumentDownload
vfs-portlets1.42007-01-21 16:19Document / DocumentDownload
weather1.02007-02-26 19:28Document / DocumentDownload
webparts0.12006-10-08 08:59Document / DocumentDownload
wiki0.12007-02-28 08:33Document / DocumentDownload
yahoosearch0.12005-12-28 06:52Document / DocumentDownload
[View ALL Project Files]
- +
+ +
From svnnotify @ sourceforge.jp Wed Jun 11 21:45:10 2008 From: svnnotify @ sourceforge.jp (svnnotify @ sourceforge.jp) Date: Wed, 11 Jun 2008 21:45:10 +0900 Subject: [pal-cvs 3238] [972] close statement. Message-ID: <1213188310.615198.6139.nullmailer@users.sourceforge.jp> Revision: 972 http://svn.sourceforge.jp/cgi-bin/viewcvs.cgi?root=pal&view=rev&rev=972 Author: shinsuke Date: 2008-06-11 21:45:10 +0900 (Wed, 11 Jun 2008) Log Message: ----------- close statement. Modified Paths: -------------- pal-portal/branches/pal-portal-1.x/portal/jetspeed-2/components/statistics/src/java/org/apache/jetspeed/audit/impl/AuditActivityImpl.java -------------- next part -------------- Modified: pal-portal/branches/pal-portal-1.x/portal/jetspeed-2/components/statistics/src/java/org/apache/jetspeed/audit/impl/AuditActivityImpl.java =================================================================== --- pal-portal/branches/pal-portal-1.x/portal/jetspeed-2/components/statistics/src/java/org/apache/jetspeed/audit/impl/AuditActivityImpl.java 2008-06-10 12:50:27 UTC (rev 971) +++ pal-portal/branches/pal-portal-1.x/portal/jetspeed-2/components/statistics/src/java/org/apache/jetspeed/audit/impl/AuditActivityImpl.java 2008-06-11 12:45:10 UTC (rev 972) @@ -134,6 +134,7 @@ { Connection con = null; PreparedStatement stm = null; + PreparedStatement stm2 = null; try { Timestamp timestamp = new Timestamp(System.currentTimeMillis()); @@ -153,7 +154,7 @@ stm.execute(); if (maxAge > 0) { - PreparedStatement stm2 = con + stm2 = con .prepareStatement("DELETE FROM ADMIN_ACTIVITY WHERE TIME_STAMP < ?"); stm2.setTimestamp(1, new Timestamp(System.currentTimeMillis() - ((long) maxAge * 1000))); @@ -169,6 +170,7 @@ try { if (stm != null) stm.close(); + if (stm2 != null) stm2.close(); } catch (SQLException se) { @@ -200,6 +202,7 @@ { Connection con = null; PreparedStatement stm = null; + PreparedStatement stm2 = null; try { Timestamp timestamp = new Timestamp(System.currentTimeMillis()); @@ -218,7 +221,7 @@ stm.executeUpdate(); if (maxAge > 0) { - PreparedStatement stm2 = con + stm2 = con .prepareStatement("DELETE FROM USER_ACTIVITY WHERE TIME_STAMP < ?"); stm2.setTimestamp(1, new Timestamp(System .currentTimeMillis() @@ -236,6 +239,7 @@ try { if (stm != null) stm.close(); + if (stm2 != null) stm2.close(); } catch (SQLException se) { From svnnotify @ sourceforge.jp Wed Jun 11 22:34:31 2008 From: svnnotify @ sourceforge.jp (svnnotify @ sourceforge.jp) Date: Wed, 11 Jun 2008 22:34:31 +0900 Subject: [pal-cvs 3239] [973] created ant-installer Message-ID: <1213191271.827484.11285.nullmailer@users.sourceforge.jp> Revision: 973 http://svn.sourceforge.jp/cgi-bin/viewcvs.cgi?root=pal&view=rev&rev=973 Author: shinsuke Date: 2008-06-11 22:34:31 +0900 (Wed, 11 Jun 2008) Log Message: ----------- created ant-installer Added Paths: ----------- pal-portal/modules/ant-installer/ -------------- next part -------------- From svnnotify @ sourceforge.jp Wed Jun 11 22:34:45 2008 From: svnnotify @ sourceforge.jp (svnnotify @ sourceforge.jp) Date: Wed, 11 Jun 2008 22:34:45 +0900 Subject: [pal-cvs 3240] [974] created trunk Message-ID: <1213191285.441485.11363.nullmailer@users.sourceforge.jp> Revision: 974 http://svn.sourceforge.jp/cgi-bin/viewcvs.cgi?root=pal&view=rev&rev=974 Author: shinsuke Date: 2008-06-11 22:34:45 +0900 (Wed, 11 Jun 2008) Log Message: ----------- created trunk Added Paths: ----------- pal-portal/modules/ant-installer/trunk/ -------------- next part -------------- From svnnotify @ sourceforge.jp Wed Jun 11 22:36:41 2008 From: svnnotify @ sourceforge.jp (svnnotify @ sourceforge.jp) Date: Wed, 11 Jun 2008 22:36:41 +0900 Subject: [pal-cvs 3241] [975] ant installer beta0.8 Message-ID: <1213191401.380117.12796.nullmailer@users.sourceforge.jp> Revision: 975 http://svn.sourceforge.jp/cgi-bin/viewcvs.cgi?root=pal&view=rev&rev=975 Author: shinsuke Date: 2008-06-11 22:36:41 +0900 (Wed, 11 Jun 2008) Log Message: ----------- ant installer beta0.8 Added Paths: ----------- pal-portal/modules/ant-installer/trunk/CHANGELOG.txt pal-portal/modules/ant-installer/trunk/antinstaller-icon.png pal-portal/modules/ant-installer/trunk/antlib/ pal-portal/modules/ant-installer/trunk/antlib/ant-antlr.jar pal-portal/modules/ant-installer/trunk/antlib/ant-apache-bcel.jar pal-portal/modules/ant-installer/trunk/antlib/ant-apache-bsf.jar pal-portal/modules/ant-installer/trunk/antlib/ant-apache-log4j.jar pal-portal/modules/ant-installer/trunk/antlib/ant-apache-oro.jar pal-portal/modules/ant-installer/trunk/antlib/ant-apache-regexp.jar pal-portal/modules/ant-installer/trunk/antlib/ant-apache-resolver.jar pal-portal/modules/ant-installer/trunk/antlib/ant-commons-logging.jar pal-portal/modules/ant-installer/trunk/antlib/ant-commons-net.jar pal-portal/modules/ant-installer/trunk/antlib/ant-jai.jar pal-portal/modules/ant-installer/trunk/antlib/ant-javamail.jar pal-portal/modules/ant-installer/trunk/antlib/ant-jdepend.jar pal-portal/modules/ant-installer/trunk/antlib/ant-jmf.jar pal-portal/modules/ant-installer/trunk/antlib/ant-jsch.jar pal-portal/modules/ant-installer/trunk/antlib/ant-junit.jar pal-portal/modules/ant-installer/trunk/antlib/ant-launcher.jar pal-portal/modules/ant-installer/trunk/antlib/ant-netrexx.jar pal-portal/modules/ant-installer/trunk/antlib/ant-nodeps.jar pal-portal/modules/ant-installer/trunk/antlib/ant-starteam.jar pal-portal/modules/ant-installer/trunk/antlib/ant-stylebook.jar pal-portal/modules/ant-installer/trunk/antlib/ant-swing.jar pal-portal/modules/ant-installer/trunk/antlib/ant-testutil.jar pal-portal/modules/ant-installer/trunk/antlib/ant-trax.jar pal-portal/modules/ant-installer/trunk/antlib/ant-weblogic.jar pal-portal/modules/ant-installer/trunk/antlib/ant.jar pal-portal/modules/ant-installer/trunk/antlib/junit-3.8.jar pal-portal/modules/ant-installer/trunk/antlib/xercesImpl.jar pal-portal/modules/ant-installer/trunk/antlib/xml-apis.jar pal-portal/modules/ant-installer/trunk/build/ pal-portal/modules/ant-installer/trunk/build/build.xml pal-portal/modules/ant-installer/trunk/demo/ pal-portal/modules/ant-installer/trunk/demo/DEMO-README.txt pal-portal/modules/ant-installer/trunk/demo/README.txt pal-portal/modules/ant-installer/trunk/demo/antinstaller-icon.ico pal-portal/modules/ant-installer/trunk/demo/artifacts/ pal-portal/modules/ant-installer/trunk/demo/artifacts/demo-installer.jar pal-portal/modules/ant-installer/trunk/demo/artifacts/installpack.zip pal-portal/modules/ant-installer/trunk/demo/bin/ pal-portal/modules/ant-installer/trunk/demo/bin/run.cmd pal-portal/modules/ant-installer/trunk/demo/bin/run.sh pal-portal/modules/ant-installer/trunk/demo/build-demo.xml pal-portal/modules/ant-installer/trunk/demo/checkConfig.sh pal-portal/modules/ant-installer/trunk/demo/classes/ pal-portal/modules/ant-installer/trunk/demo/classes/org/ pal-portal/modules/ant-installer/trunk/demo/classes/org/tp23/ pal-portal/modules/ant-installer/trunk/demo/classes/org/tp23/demo/ pal-portal/modules/ant-installer/trunk/demo/classes/org/tp23/demo/Demonstration.class pal-portal/modules/ant-installer/trunk/demo/classes/resources/ pal-portal/modules/ant-installer/trunk/demo/classes/resources/demo.png pal-portal/modules/ant-installer/trunk/demo/config/ pal-portal/modules/ant-installer/trunk/demo/config/demo.properties pal-portal/modules/ant-installer/trunk/demo/config/example-config.xml pal-portal/modules/ant-installer/trunk/demo/doc/ pal-portal/modules/ant-installer/trunk/demo/doc/allclasses-frame.html pal-portal/modules/ant-installer/trunk/demo/doc/allclasses-noframe.html pal-portal/modules/ant-installer/trunk/demo/doc/constant-values.html pal-portal/modules/ant-installer/trunk/demo/doc/deprecated-list.html pal-portal/modules/ant-installer/trunk/demo/doc/help-doc.html pal-portal/modules/ant-installer/trunk/demo/doc/index-all.html pal-portal/modules/ant-installer/trunk/demo/doc/index.html pal-portal/modules/ant-installer/trunk/demo/doc/org/ pal-portal/modules/ant-installer/trunk/demo/doc/org/tp23/ pal-portal/modules/ant-installer/trunk/demo/doc/org/tp23/demo/ pal-portal/modules/ant-installer/trunk/demo/doc/org/tp23/demo/Demonstration.html pal-portal/modules/ant-installer/trunk/demo/doc/org/tp23/demo/package-frame.html pal-portal/modules/ant-installer/trunk/demo/doc/org/tp23/demo/package-summary.html pal-portal/modules/ant-installer/trunk/demo/doc/org/tp23/demo/package-tree.html pal-portal/modules/ant-installer/trunk/demo/doc/overview-tree.html pal-portal/modules/ant-installer/trunk/demo/doc/package-list pal-portal/modules/ant-installer/trunk/demo/doc/packages.html pal-portal/modules/ant-installer/trunk/demo/doc/resources/ pal-portal/modules/ant-installer/trunk/demo/doc/resources/inherit.gif pal-portal/modules/ant-installer/trunk/demo/doc/stylesheet.css pal-portal/modules/ant-installer/trunk/demo/install.cmd pal-portal/modules/ant-installer/trunk/demo/install.sh pal-portal/modules/ant-installer/trunk/demo/installclasspath/ pal-portal/modules/ant-installer/trunk/demo/installclasspath/resources/ pal-portal/modules/ant-installer/trunk/demo/installclasspath/resources/GPL.txt pal-portal/modules/ant-installer/trunk/demo/installclasspath/resources/gkmain_inv.png pal-portal/modules/ant-installer/trunk/demo/installclasspath/resources/greens.png pal-portal/modules/ant-installer/trunk/demo/installclasspath/resources/rockstiles.png pal-portal/modules/ant-installer/trunk/demo/installer/ pal-portal/modules/ant-installer/trunk/demo/installer/antinstall-config.xml pal-portal/modules/ant-installer/trunk/demo/installer/build.xml pal-portal/modules/ant-installer/trunk/demo/src/ pal-portal/modules/ant-installer/trunk/demo/src/org/ pal-portal/modules/ant-installer/trunk/demo/src/org/tp23/ pal-portal/modules/ant-installer/trunk/demo/src/org/tp23/demo/ pal-portal/modules/ant-installer/trunk/demo/src/org/tp23/demo/Demonstration.java pal-portal/modules/ant-installer/trunk/demo/src/resources/ pal-portal/modules/ant-installer/trunk/demo/src/resources/demo.png pal-portal/modules/ant-installer/trunk/icons/ pal-portal/modules/ant-installer/trunk/icons/128x128/ pal-portal/modules/ant-installer/trunk/icons/128x128/apps/ pal-portal/modules/ant-installer/trunk/icons/128x128/apps/AntInstaller.png pal-portal/modules/ant-installer/trunk/icons/16x16/ pal-portal/modules/ant-installer/trunk/icons/16x16/apps/ pal-portal/modules/ant-installer/trunk/icons/16x16/apps/AntInstaller.png pal-portal/modules/ant-installer/trunk/icons/22x22/ pal-portal/modules/ant-installer/trunk/icons/22x22/apps/ pal-portal/modules/ant-installer/trunk/icons/22x22/apps/AntInstaller.png pal-portal/modules/ant-installer/trunk/icons/24x24/ pal-portal/modules/ant-installer/trunk/icons/24x24/AntInstaller.ico pal-portal/modules/ant-installer/trunk/icons/24x24/apps/ pal-portal/modules/ant-installer/trunk/icons/24x24/apps/AntInstaller.png pal-portal/modules/ant-installer/trunk/icons/32x32/ pal-portal/modules/ant-installer/trunk/icons/32x32/apps/ pal-portal/modules/ant-installer/trunk/icons/32x32/apps/AntInstaller.png pal-portal/modules/ant-installer/trunk/icons/48x48/ pal-portal/modules/ant-installer/trunk/icons/48x48/AntInstaller.png pal-portal/modules/ant-installer/trunk/icons/48x48/apps/ pal-portal/modules/ant-installer/trunk/icons/48x48/apps/AntInstaller.png pal-portal/modules/ant-installer/trunk/icons/64x64/ pal-portal/modules/ant-installer/trunk/icons/64x64/apps/ pal-portal/modules/ant-installer/trunk/icons/64x64/apps/AntInstaller.png pal-portal/modules/ant-installer/trunk/images/ pal-portal/modules/ant-installer/trunk/images/AntInstaller-text-logo-50.png pal-portal/modules/ant-installer/trunk/images/AntInstaller-text-logo-bw.png pal-portal/modules/ant-installer/trunk/images/AntInstaller-text-logo-onwhite.png pal-portal/modules/ant-installer/trunk/images/AntInstaller-text-logo.png pal-portal/modules/ant-installer/trunk/images/README.txt pal-portal/modules/ant-installer/trunk/images/extract-images/ pal-portal/modules/ant-installer/trunk/images/extract-images/crystal/ pal-portal/modules/ant-installer/trunk/images/extract-images/crystal/extract-image.png pal-portal/modules/ant-installer/trunk/images/extract-images/crystal-images.txt pal-portal/modules/ant-installer/trunk/images/extract-images/crystal2/ pal-portal/modules/ant-installer/trunk/images/extract-images/crystal2/extract-image.png pal-portal/modules/ant-installer/trunk/images/extract-images/crystal3/ pal-portal/modules/ant-installer/trunk/images/extract-images/crystal3/extract-image.png pal-portal/modules/ant-installer/trunk/images/extract-images/default/ pal-portal/modules/ant-installer/trunk/images/extract-images/default/extract-image.png pal-portal/modules/ant-installer/trunk/images/extract-images/default-images.txt pal-portal/modules/ant-installer/trunk/images/navicons/ pal-portal/modules/ant-installer/trunk/images/navicons/amaranth/ pal-portal/modules/ant-installer/trunk/images/navicons/amaranth/resources/ pal-portal/modules/ant-installer/trunk/images/navicons/amaranth/resources/icons/ pal-portal/modules/ant-installer/trunk/images/navicons/amaranth/resources/icons/LICENSE pal-portal/modules/ant-installer/trunk/images/navicons/amaranth/resources/icons/back.png pal-portal/modules/ant-installer/trunk/images/navicons/amaranth/resources/icons/cancel.png pal-portal/modules/ant-installer/trunk/images/navicons/amaranth/resources/icons/finish.png pal-portal/modules/ant-installer/trunk/images/navicons/amaranth/resources/icons/next.png pal-portal/modules/ant-installer/trunk/images/navicons/amaranth/resources/icons/ok.png pal-portal/modules/ant-installer/trunk/images/navicons/amaranth/resources/icons/showdetails.png pal-portal/modules/ant-installer/trunk/images/navicons/bluecurve/ pal-portal/modules/ant-installer/trunk/images/navicons/bluecurve/resources/ pal-portal/modules/ant-installer/trunk/images/navicons/bluecurve/resources/icons/ pal-portal/modules/ant-installer/trunk/images/navicons/bluecurve/resources/icons/LICENSE pal-portal/modules/ant-installer/trunk/images/navicons/bluecurve/resources/icons/back.png pal-portal/modules/ant-installer/trunk/images/navicons/bluecurve/resources/icons/cancel.png pal-portal/modules/ant-installer/trunk/images/navicons/bluecurve/resources/icons/finish.png pal-portal/modules/ant-installer/trunk/images/navicons/bluecurve/resources/icons/next.png pal-portal/modules/ant-installer/trunk/images/navicons/bluecurve/resources/icons/ok.png pal-portal/modules/ant-installer/trunk/images/navicons/bluecurve/resources/icons/showdetails.png pal-portal/modules/ant-installer/trunk/images/navicons/crystalsvg/ pal-portal/modules/ant-installer/trunk/images/navicons/crystalsvg/resources/ pal-portal/modules/ant-installer/trunk/images/navicons/crystalsvg/resources/icons/ pal-portal/modules/ant-installer/trunk/images/navicons/crystalsvg/resources/icons/LICENSE pal-portal/modules/ant-installer/trunk/images/navicons/crystalsvg/resources/icons/back.png pal-portal/modules/ant-installer/trunk/images/navicons/crystalsvg/resources/icons/cancel.png pal-portal/modules/ant-installer/trunk/images/navicons/crystalsvg/resources/icons/finish.png pal-portal/modules/ant-installer/trunk/images/navicons/crystalsvg/resources/icons/next.png pal-portal/modules/ant-installer/trunk/images/navicons/crystalsvg/resources/icons/ok.png pal-portal/modules/ant-installer/trunk/images/navicons/crystalsvg/resources/icons/showdetails.png pal-portal/modules/ant-installer/trunk/images/navicons/eclipse/ pal-portal/modules/ant-installer/trunk/images/navicons/eclipse/resources/ pal-portal/modules/ant-installer/trunk/images/navicons/eclipse/resources/icons/ pal-portal/modules/ant-installer/trunk/images/navicons/eclipse/resources/icons/LICENSE pal-portal/modules/ant-installer/trunk/images/navicons/eclipse/resources/icons/back.png pal-portal/modules/ant-installer/trunk/images/navicons/eclipse/resources/icons/cancel.png pal-portal/modules/ant-installer/trunk/images/navicons/eclipse/resources/icons/finish.png pal-portal/modules/ant-installer/trunk/images/navicons/eclipse/resources/icons/next.png pal-portal/modules/ant-installer/trunk/images/navicons/eclipse/resources/icons/ok.png pal-portal/modules/ant-installer/trunk/images/navicons/eclipse/resources/icons/showdetails.png pal-portal/modules/ant-installer/trunk/images/navicons/krystaline/ pal-portal/modules/ant-installer/trunk/images/navicons/krystaline/resources/ pal-portal/modules/ant-installer/trunk/images/navicons/krystaline/resources/icons/ pal-portal/modules/ant-installer/trunk/images/navicons/krystaline/resources/icons/LICENSE pal-portal/modules/ant-installer/trunk/images/navicons/krystaline/resources/icons/back.png pal-portal/modules/ant-installer/trunk/images/navicons/krystaline/resources/icons/cancel.png pal-portal/modules/ant-installer/trunk/images/navicons/krystaline/resources/icons/finish.png pal-portal/modules/ant-installer/trunk/images/navicons/krystaline/resources/icons/next.png pal-portal/modules/ant-installer/trunk/images/navicons/krystaline/resources/icons/ok.png pal-portal/modules/ant-installer/trunk/images/navicons/krystaline/resources/icons/showdetails.png pal-portal/modules/ant-installer/trunk/images/resources/ pal-portal/modules/ant-installer/trunk/images/resources/AntInstaller.png pal-portal/modules/ant-installer/trunk/images/resources/LICENSE-ant-install.txt pal-portal/modules/ant-installer/trunk/images/resources/antbar.png pal-portal/modules/ant-installer/trunk/images/resources/banner23.png pal-portal/modules/ant-installer/trunk/images/resources/extract-image.png pal-portal/modules/ant-installer/trunk/images/resources/gkmain_inv.png pal-portal/modules/ant-installer/trunk/images/resources/gothbar.gif pal-portal/modules/ant-installer/trunk/images/resources/greens.png pal-portal/modules/ant-installer/trunk/images/resources/icons/ pal-portal/modules/ant-installer/trunk/images/resources/makewavesdawn.png pal-portal/modules/ant-installer/trunk/images/resources/rockstiles.png pal-portal/modules/ant-installer/trunk/images/titlebars/ pal-portal/modules/ant-installer/trunk/images/titlebars/antbar.png pal-portal/modules/ant-installer/trunk/images/titlebars/banner23.png pal-portal/modules/ant-installer/trunk/images/titlebars/default-images.txt pal-portal/modules/ant-installer/trunk/images/titlebars/empty-template.png pal-portal/modules/ant-installer/trunk/images/titlebars/gothbar.gif pal-portal/modules/ant-installer/trunk/images/titlebars/greens.png pal-portal/modules/ant-installer/trunk/images/titlebars/makewavesdawn.png pal-portal/modules/ant-installer/trunk/images/titlebars/rockstiles.png pal-portal/modules/ant-installer/trunk/images/tool-credits.txt pal-portal/modules/ant-installer/trunk/kde-icons/ pal-portal/modules/ant-installer/trunk/kde-icons/AntInstaller.png pal-portal/modules/ant-installer/trunk/kde-icons/antinstaller-demo.desktop pal-portal/modules/ant-installer/trunk/kde-icons/antinstaller-docs.desktop pal-portal/modules/ant-installer/trunk/kde-icons/antinstaller-wizard.desktop pal-portal/modules/ant-installer/trunk/lib/ pal-portal/modules/ant-installer/trunk/lib/LICENSE-ant-install.txt pal-portal/modules/ant-installer/trunk/lib/LICENSE-ant.txt pal-portal/modules/ant-installer/trunk/lib/LICENSE-dom.txt pal-portal/modules/ant-installer/trunk/lib/LICENSE-jgoodies.txt pal-portal/modules/ant-installer/trunk/lib/LICENSE-sax.txt pal-portal/modules/ant-installer/trunk/lib/LICENSE-sysout.txt pal-portal/modules/ant-installer/trunk/lib/LICENSE-xerces.txt pal-portal/modules/ant-installer/trunk/lib/ai-icons-amaranth.jar pal-portal/modules/ant-installer/trunk/lib/ai-icons-bluecurve.jar pal-portal/modules/ant-installer/trunk/lib/ai-icons-crystalsvg.jar pal-portal/modules/ant-installer/trunk/lib/ai-icons-eclipse.jar pal-portal/modules/ant-installer/trunk/lib/ai-icons-krystaline.jar pal-portal/modules/ant-installer/trunk/lib/ant-installer-ext.jar pal-portal/modules/ant-installer/trunk/lib/ant-installer.jar pal-portal/modules/ant-installer/trunk/lib/jgoodies-edited-1_2_2.jar pal-portal/modules/ant-installer/trunk/lib/xercesImpl.jar pal-portal/modules/ant-installer/trunk/lib/xml-apis.jar pal-portal/modules/ant-installer/trunk/src/ pal-portal/modules/ant-installer/trunk/src/README.txt pal-portal/modules/ant-installer/trunk/src/org/ pal-portal/modules/ant-installer/trunk/src/org/tp23/ pal-portal/modules/ant-installer/trunk/src/org/tp23/antinstaller/ pal-portal/modules/ant-installer/trunk/src/org/tp23/antinstaller/DefaultPropertiesFileRenderer.java pal-portal/modules/ant-installer/trunk/src/org/tp23/antinstaller/ExplicitPropertiesFileRenderer.java pal-portal/modules/ant-installer/trunk/src/org/tp23/antinstaller/InstallException.java pal-portal/modules/ant-installer/trunk/src/org/tp23/antinstaller/Installer.java pal-portal/modules/ant-installer/trunk/src/org/tp23/antinstaller/InstallerContext.java pal-portal/modules/ant-installer/trunk/src/org/tp23/antinstaller/PropertiesFileRenderer.java pal-portal/modules/ant-installer/trunk/src/org/tp23/antinstaller/ResourceBundleHelper.java pal-portal/modules/ant-installer/trunk/src/org/tp23/antinstaller/ValidationException.java pal-portal/modules/ant-installer/trunk/src/org/tp23/antinstaller/antinstall-config-0.2.dtd pal-portal/modules/ant-installer/trunk/src/org/tp23/antinstaller/antinstall-config-0.3.dtd pal-portal/modules/ant-installer/trunk/src/org/tp23/antinstaller/antinstall-config-0.4.dtd pal-portal/modules/ant-installer/trunk/src/org/tp23/antinstaller/antinstall-config-0.5.dtd pal-portal/modules/ant-installer/trunk/src/org/tp23/antinstaller/antinstall-config-0.6.dtd pal-portal/modules/ant-installer/trunk/src/org/tp23/antinstaller/antinstall-config-0.7.dtd pal-portal/modules/ant-installer/trunk/src/org/tp23/antinstaller/antinstall-config-0.8.dtd pal-portal/modules/ant-installer/trunk/src/org/tp23/antinstaller/antmod/ pal-portal/modules/ant-installer/trunk/src/org/tp23/antinstaller/antmod/FeedbackListener.java pal-portal/modules/ant-installer/trunk/src/org/tp23/antinstaller/antmod/Jdk14RegexpMatcher.java pal-portal/modules/ant-installer/trunk/src/org/tp23/antinstaller/antmod/Jdk14RegexpRegexp.java pal-portal/modules/ant-installer/trunk/src/org/tp23/antinstaller/antmod/Launcher.java pal-portal/modules/ant-installer/trunk/src/org/tp23/antinstaller/antmod/Main.java pal-portal/modules/ant-installer/trunk/src/org/tp23/antinstaller/antmod/ProjectHelper3.java pal-portal/modules/ant-installer/trunk/src/org/tp23/antinstaller/antmod/RegexpMatcherFactory.java pal-portal/modules/ant-installer/trunk/src/org/tp23/antinstaller/antmod/RuntimeLauncher.java pal-portal/modules/ant-installer/trunk/src/org/tp23/antinstaller/antmod/package.html pal-portal/modules/ant-installer/trunk/src/org/tp23/antinstaller/antmod/taskdefs/ pal-portal/modules/ant-installer/trunk/src/org/tp23/antinstaller/antmod/taskdefs/GetResourceTask.java pal-portal/modules/ant-installer/trunk/src/org/tp23/antinstaller/antmod/taskdefs/LogTask.java pal-portal/modules/ant-installer/trunk/src/org/tp23/antinstaller/antmod/taskdefs/MessageTask.java pal-portal/modules/ant-installer/trunk/src/org/tp23/antinstaller/antmod/taskdefs/PropertyTask.java pal-portal/modules/ant-installer/trunk/src/org/tp23/antinstaller/input/ pal-portal/modules/ant-installer/trunk/src/org/tp23/antinstaller/input/AppRootInput.java pal-portal/modules/ant-installer/trunk/src/org/tp23/antinstaller/input/CheckboxInput.java pal-portal/modules/ant-installer/trunk/src/org/tp23/antinstaller/input/CommentOutput.java pal-portal/modules/ant-installer/trunk/src/org/tp23/antinstaller/input/ConditionalField.java pal-portal/modules/ant-installer/trunk/src/org/tp23/antinstaller/input/ConfirmPasswordTextInput.java pal-portal/modules/ant-installer/trunk/src/org/tp23/antinstaller/input/DateInput.java pal-portal/modules/ant-installer/trunk/src/org/tp23/antinstaller/input/DirectoryInput.java pal-portal/modules/ant-installer/trunk/src/org/tp23/antinstaller/input/ExtValidatedTextInput.java pal-portal/modules/ant-installer/trunk/src/org/tp23/antinstaller/input/FileInput.java pal-portal/modules/ant-installer/trunk/src/org/tp23/antinstaller/input/HiddenPropertyInput.java pal-portal/modules/ant-installer/trunk/src/org/tp23/antinstaller/input/InputException.java pal-portal/modules/ant-installer/trunk/src/org/tp23/antinstaller/input/InputField.java pal-portal/modules/ant-installer/trunk/src/org/tp23/antinstaller/input/LargeSelectInput.java pal-portal/modules/ant-installer/trunk/src/org/tp23/antinstaller/input/OSSpecific.java pal-portal/modules/ant-installer/trunk/src/org/tp23/antinstaller/input/OutputField.java pal-portal/modules/ant-installer/trunk/src/org/tp23/antinstaller/input/PasswordTextInput.java pal-portal/modules/ant-installer/trunk/src/org/tp23/antinstaller/input/ResultContainer.java pal-portal/modules/ant-installer/trunk/src/org/tp23/antinstaller/input/SecretPropertyField.java pal-portal/modules/ant-installer/trunk/src/org/tp23/antinstaller/input/SelectInput.java pal-portal/modules/ant-installer/trunk/src/org/tp23/antinstaller/input/Target.java pal-portal/modules/ant-installer/trunk/src/org/tp23/antinstaller/input/TargetInput.java pal-portal/modules/ant-installer/trunk/src/org/tp23/antinstaller/input/TargetSelectInput.java pal-portal/modules/ant-installer/trunk/src/org/tp23/antinstaller/input/UnvalidatedTextInput.java pal-portal/modules/ant-installer/trunk/src/org/tp23/antinstaller/input/ValidatedTextInput.java pal-portal/modules/ant-installer/trunk/src/org/tp23/antinstaller/input/Validator.java pal-portal/modules/ant-installer/trunk/src/org/tp23/antinstaller/input/package.html pal-portal/modules/ant-installer/trunk/src/org/tp23/antinstaller/page/ pal-portal/modules/ant-installer/trunk/src/org/tp23/antinstaller/page/LicensePage.java pal-portal/modules/ant-installer/trunk/src/org/tp23/antinstaller/page/Page.java pal-portal/modules/ant-installer/trunk/src/org/tp23/antinstaller/page/ProgressPage.java pal-portal/modules/ant-installer/trunk/src/org/tp23/antinstaller/page/SimpleInputPage.java pal-portal/modules/ant-installer/trunk/src/org/tp23/antinstaller/page/SplashPage.java pal-portal/modules/ant-installer/trunk/src/org/tp23/antinstaller/page/TextPage.java pal-portal/modules/ant-installer/trunk/src/org/tp23/antinstaller/page/package.html pal-portal/modules/ant-installer/trunk/src/org/tp23/antinstaller/renderer/ pal-portal/modules/ant-installer/trunk/src/org/tp23/antinstaller/renderer/AntOutputRenderer.java pal-portal/modules/ant-installer/trunk/src/org/tp23/antinstaller/renderer/MessageRenderer.java pal-portal/modules/ant-installer/trunk/src/org/tp23/antinstaller/renderer/PageRenderer.java pal-portal/modules/ant-installer/trunk/src/org/tp23/antinstaller/renderer/RendererFactory.java pal-portal/modules/ant-installer/trunk/src/org/tp23/antinstaller/renderer/Res.properties pal-portal/modules/ant-installer/trunk/src/org/tp23/antinstaller/renderer/Res_de.properties pal-portal/modules/ant-installer/trunk/src/org/tp23/antinstaller/renderer/Res_es.properties pal-portal/modules/ant-installer/trunk/src/org/tp23/antinstaller/renderer/Res_es_EU.properties pal-portal/modules/ant-installer/trunk/src/org/tp23/antinstaller/renderer/package.html pal-portal/modules/ant-installer/trunk/src/org/tp23/antinstaller/renderer/swing/ pal-portal/modules/ant-installer/trunk/src/org/tp23/antinstaller/renderer/swing/AIButton.java pal-portal/modules/ant-installer/trunk/src/org/tp23/antinstaller/renderer/swing/AICheckBox.java pal-portal/modules/ant-installer/trunk/src/org/tp23/antinstaller/renderer/swing/AILabel.java pal-portal/modules/ant-installer/trunk/src/org/tp23/antinstaller/renderer/swing/AIPasswordField.java pal-portal/modules/ant-installer/trunk/src/org/tp23/antinstaller/renderer/swing/AIRadioButton.java pal-portal/modules/ant-installer/trunk/src/org/tp23/antinstaller/renderer/swing/AIShortTextField.java pal-portal/modules/ant-installer/trunk/src/org/tp23/antinstaller/renderer/swing/AITextfield.java pal-portal/modules/ant-installer/trunk/src/org/tp23/antinstaller/renderer/swing/AppRootInputRenderer.java pal-portal/modules/ant-installer/trunk/src/org/tp23/antinstaller/renderer/swing/CheckboxInputRenderer.java pal-portal/modules/ant-installer/trunk/src/org/tp23/antinstaller/renderer/swing/ClasspathHTMLEditorKit.java pal-portal/modules/ant-installer/trunk/src/org/tp23/antinstaller/renderer/swing/CommentOutputRenderer.java pal-portal/modules/ant-installer/trunk/src/org/tp23/antinstaller/renderer/swing/ConditionalFieldRenderer.java pal-portal/modules/ant-installer/trunk/src/org/tp23/antinstaller/renderer/swing/ConfirmPasswordTextInputRenderer.java pal-portal/modules/ant-installer/trunk/src/org/tp23/antinstaller/renderer/swing/DateInputRenderer.java pal-portal/modules/ant-installer/trunk/src/org/tp23/antinstaller/renderer/swing/DirectoryInputRenderer.java pal-portal/modules/ant-installer/trunk/src/org/tp23/antinstaller/renderer/swing/ExtValidatedTextInputRenderer.java pal-portal/modules/ant-installer/trunk/src/org/tp23/antinstaller/renderer/swing/FileInputRenderer.java pal-portal/modules/ant-installer/trunk/src/org/tp23/antinstaller/renderer/swing/HiddenPropertyInputRenderer.java pal-portal/modules/ant-installer/trunk/src/org/tp23/antinstaller/renderer/swing/LargeSelectInputRenderer.java pal-portal/modules/ant-installer/trunk/src/org/tp23/antinstaller/renderer/swing/LicensePageRenderer.java pal-portal/modules/ant-installer/trunk/src/org/tp23/antinstaller/renderer/swing/PageCompletionListener.java pal-portal/modules/ant-installer/trunk/src/org/tp23/antinstaller/renderer/swing/PasswordTextInputRenderer.java pal-portal/modules/ant-installer/trunk/src/org/tp23/antinstaller/renderer/swing/ProgressPageRenderer.java pal-portal/modules/ant-installer/trunk/src/org/tp23/antinstaller/renderer/swing/ProgressPanel.java pal-portal/modules/ant-installer/trunk/src/org/tp23/antinstaller/renderer/swing/SelectInputRenderer.java pal-portal/modules/ant-installer/trunk/src/org/tp23/antinstaller/renderer/swing/SimpleInputPageRenderer.java pal-portal/modules/ant-installer/trunk/src/org/tp23/antinstaller/renderer/swing/SizeConstants.java pal-portal/modules/ant-installer/trunk/src/org/tp23/antinstaller/renderer/swing/SplashPageRenderer.java pal-portal/modules/ant-installer/trunk/src/org/tp23/antinstaller/renderer/swing/SwingInstallerContext.java pal-portal/modules/ant-installer/trunk/src/org/tp23/antinstaller/renderer/swing/SwingMessageRenderer.java pal-portal/modules/ant-installer/trunk/src/org/tp23/antinstaller/renderer/swing/SwingOutputFieldRenderer.java pal-portal/modules/ant-installer/trunk/src/org/tp23/antinstaller/renderer/swing/SwingPageRenderer.java pal-portal/modules/ant-installer/trunk/src/org/tp23/antinstaller/renderer/swing/TargetInputRenderer.java pal-portal/modules/ant-installer/trunk/src/org/tp23/antinstaller/renderer/swing/TargetSelectInputRenderer.java pal-portal/modules/ant-installer/trunk/src/org/tp23/antinstaller/renderer/swing/TextPageRenderer.java pal-portal/modules/ant-installer/trunk/src/org/tp23/antinstaller/renderer/swing/UnvalidatedTextInputRenderer.java pal-portal/modules/ant-installer/trunk/src/org/tp23/antinstaller/renderer/swing/ValidatedTextInputRenderer.java pal-portal/modules/ant-installer/trunk/src/org/tp23/antinstaller/renderer/swing/package.html pal-portal/modules/ant-installer/trunk/src/org/tp23/antinstaller/renderer/swing/plaf/ pal-portal/modules/ant-installer/trunk/src/org/tp23/antinstaller/renderer/swing/plaf/LookAndFeelFactory.java pal-portal/modules/ant-installer/trunk/src/org/tp23/antinstaller/renderer/swing/plaf/ModMetalLookAndFeel.java pal-portal/modules/ant-installer/trunk/src/org/tp23/antinstaller/renderer/swing/plaf/ModMetalTheme.java pal-portal/modules/ant-installer/trunk/src/org/tp23/antinstaller/renderer/text/ pal-portal/modules/ant-installer/trunk/src/org/tp23/antinstaller/renderer/text/AbstractTextPageRenderer.java pal-portal/modules/ant-installer/trunk/src/org/tp23/antinstaller/renderer/text/AppRootInputRenderer.java pal-portal/modules/ant-installer/trunk/src/org/tp23/antinstaller/renderer/text/CheckboxInputRenderer.java pal-portal/modules/ant-installer/trunk/src/org/tp23/antinstaller/renderer/text/CommentOutputRenderer.java pal-portal/modules/ant-installer/trunk/src/org/tp23/antinstaller/renderer/text/ConditionalFieldRenderer.java pal-portal/modules/ant-installer/trunk/src/org/tp23/antinstaller/renderer/text/ConfirmPasswordTextInputRenderer.java pal-portal/modules/ant-installer/trunk/src/org/tp23/antinstaller/renderer/text/DateInputRenderer.java pal-portal/modules/ant-installer/trunk/src/org/tp23/antinstaller/renderer/text/DirectoryInputRenderer.java pal-portal/modules/ant-installer/trunk/src/org/tp23/antinstaller/renderer/text/ExtValidatedTextInputRenderer.java pal-portal/modules/ant-installer/trunk/src/org/tp23/antinstaller/renderer/text/FileInputRenderer.java pal-portal/modules/ant-installer/trunk/src/org/tp23/antinstaller/renderer/text/HiddenPropertyInputRenderer.java pal-portal/modules/ant-installer/trunk/src/org/tp23/antinstaller/renderer/text/LargeSelectInputRenderer.java pal-portal/modules/ant-installer/trunk/src/org/tp23/antinstaller/renderer/text/LicensePageRenderer.java pal-portal/modules/ant-installer/trunk/src/org/tp23/antinstaller/renderer/text/Pager.java pal-portal/modules/ant-installer/trunk/src/org/tp23/antinstaller/renderer/text/PasswordTextInputRenderer.java pal-portal/modules/ant-installer/trunk/src/org/tp23/antinstaller/renderer/text/ProgressPageRenderer.java pal-portal/modules/ant-installer/trunk/src/org/tp23/antinstaller/renderer/text/Res.properties pal-portal/modules/ant-installer/trunk/src/org/tp23/antinstaller/renderer/text/Res_de.properties pal-portal/modules/ant-installer/trunk/src/org/tp23/antinstaller/renderer/text/Res_es.properties pal-portal/modules/ant-installer/trunk/src/org/tp23/antinstaller/renderer/text/Res_es_EU.properties pal-portal/modules/ant-installer/trunk/src/org/tp23/antinstaller/renderer/text/SelectInputRenderer.java pal-portal/modules/ant-installer/trunk/src/org/tp23/antinstaller/renderer/text/SimpleInputPageRenderer.java pal-portal/modules/ant-installer/trunk/src/org/tp23/antinstaller/renderer/text/SplashPageRenderer.java pal-portal/modules/ant-installer/trunk/src/org/tp23/antinstaller/renderer/text/TargetInputRenderer.java pal-portal/modules/ant-installer/trunk/src/org/tp23/antinstaller/renderer/text/TargetSelectInputRenderer.java pal-portal/modules/ant-installer/trunk/src/org/tp23/antinstaller/renderer/text/TextMessageRenderer.java pal-portal/modules/ant-installer/trunk/src/org/tp23/antinstaller/renderer/text/TextOutputFieldRenderer.java pal-portal/modules/ant-installer/trunk/src/org/tp23/antinstaller/renderer/text/TextPageRenderer.java pal-portal/modules/ant-installer/trunk/src/org/tp23/antinstaller/renderer/text/UnvalidatedTextInputRenderer.java pal-portal/modules/ant-installer/trunk/src/org/tp23/antinstaller/renderer/text/ValidatedTextInputRenderer.java pal-portal/modules/ant-installer/trunk/src/org/tp23/antinstaller/renderer/text/package.html pal-portal/modules/ant-installer/trunk/src/org/tp23/antinstaller/runtime/ pal-portal/modules/ant-installer/trunk/src/org/tp23/antinstaller/runtime/AntRunner.java pal-portal/modules/ant-installer/trunk/src/org/tp23/antinstaller/runtime/AutoSwingRunner.java pal-portal/modules/ant-installer/trunk/src/org/tp23/antinstaller/runtime/AutoTextRunner.java pal-portal/modules/ant-installer/trunk/src/org/tp23/antinstaller/runtime/ConfigurationException.java pal-portal/modules/ant-installer/trunk/src/org/tp23/antinstaller/runtime/ConfigurationLoader.java pal-portal/modules/ant-installer/trunk/src/org/tp23/antinstaller/runtime/ExecInstall.java pal-portal/modules/ant-installer/trunk/src/org/tp23/antinstaller/runtime/IfPropertyHelper.java pal-portal/modules/ant-installer/trunk/src/org/tp23/antinstaller/runtime/Logger.java pal-portal/modules/ant-installer/trunk/src/org/tp23/antinstaller/runtime/Runner.java pal-portal/modules/ant-installer/trunk/src/org/tp23/antinstaller/runtime/SimpleLogger.java pal-portal/modules/ant-installer/trunk/src/org/tp23/antinstaller/runtime/SwingRunner.java pal-portal/modules/ant-installer/trunk/src/org/tp23/antinstaller/runtime/TextRunner.java pal-portal/modules/ant-installer/trunk/src/org/tp23/antinstaller/runtime/VersionHelper.java pal-portal/modules/ant-installer/trunk/src/org/tp23/antinstaller/runtime/exe/ pal-portal/modules/ant-installer/trunk/src/org/tp23/antinstaller/runtime/exe/AntLauncherFilter.java pal-portal/modules/ant-installer/trunk/src/org/tp23/antinstaller/runtime/exe/AntProjectFilter.java pal-portal/modules/ant-installer/trunk/src/org/tp23/antinstaller/runtime/exe/CreateLoggerFilter.java pal-portal/modules/ant-installer/trunk/src/org/tp23/antinstaller/runtime/exe/CreateUIFilter.java pal-portal/modules/ant-installer/trunk/src/org/tp23/antinstaller/runtime/exe/ExecuteFilter.java pal-portal/modules/ant-installer/trunk/src/org/tp23/antinstaller/runtime/exe/ExecuteRunnerFilter.java pal-portal/modules/ant-installer/trunk/src/org/tp23/antinstaller/runtime/exe/FilterChain.java pal-portal/modules/ant-installer/trunk/src/org/tp23/antinstaller/runtime/exe/FilterFactory.java pal-portal/modules/ant-installer/trunk/src/org/tp23/antinstaller/runtime/exe/FinalizerFilter.java pal-portal/modules/ant-installer/trunk/src/org/tp23/antinstaller/runtime/exe/InputStreamLoadConfigFilter.java pal-portal/modules/ant-installer/trunk/src/org/tp23/antinstaller/runtime/exe/LoadConfigFilter.java pal-portal/modules/ant-installer/trunk/src/org/tp23/antinstaller/runtime/exe/PropertyLoaderFilter.java pal-portal/modules/ant-installer/trunk/src/org/tp23/antinstaller/runtime/exe/PropertyPrinterFilter.java pal-portal/modules/ant-installer/trunk/src/org/tp23/antinstaller/runtime/exe/nonextractor.fconfig pal-portal/modules/ant-installer/trunk/src/org/tp23/antinstaller/runtime/exe/script.fconfig pal-portal/modules/ant-installer/trunk/src/org/tp23/antinstaller/runtime/exe/selfextractor.fconfig pal-portal/modules/ant-installer/trunk/src/org/tp23/antinstaller/runtime/logic/ pal-portal/modules/ant-installer/trunk/src/org/tp23/antinstaller/runtime/logic/CompoundExpression.java pal-portal/modules/ant-installer/trunk/src/org/tp23/antinstaller/runtime/logic/EndsWithTest.java pal-portal/modules/ant-installer/trunk/src/org/tp23/antinstaller/runtime/logic/EqualsTest.java pal-portal/modules/ant-installer/trunk/src/org/tp23/antinstaller/runtime/logic/Expression.java pal-portal/modules/ant-installer/trunk/src/org/tp23/antinstaller/runtime/logic/ExpressionBuilder.java pal-portal/modules/ant-installer/trunk/src/org/tp23/antinstaller/runtime/logic/GreaterThanOrEqualsTest.java pal-portal/modules/ant-installer/trunk/src/org/tp23/antinstaller/runtime/logic/LessThanOrEqualsTest.java pal-portal/modules/ant-installer/trunk/src/org/tp23/antinstaller/runtime/logic/LiteralValue.java pal-portal/modules/ant-installer/trunk/src/org/tp23/antinstaller/runtime/logic/LogicalAndTest.java pal-portal/modules/ant-installer/trunk/src/org/tp23/antinstaller/runtime/logic/LogicalOrTest.java pal-portal/modules/ant-installer/trunk/src/org/tp23/antinstaller/runtime/logic/LogicalTest.java pal-portal/modules/ant-installer/trunk/src/org/tp23/antinstaller/runtime/logic/NotEqualsTest.java pal-portal/modules/ant-installer/trunk/src/org/tp23/antinstaller/runtime/logic/SimpleExpression.java pal-portal/modules/ant-installer/trunk/src/org/tp23/antinstaller/runtime/logic/SingleExpressionTest.java pal-portal/modules/ant-installer/trunk/src/org/tp23/antinstaller/runtime/logic/StartsWithTest.java pal-portal/modules/ant-installer/trunk/src/org/tp23/antinstaller/runtime/logic/StringLengthComparator.java pal-portal/modules/ant-installer/trunk/src/org/tp23/antinstaller/runtime/logic/TestOperator.java pal-portal/modules/ant-installer/trunk/src/org/tp23/antinstaller/runtime/logic/Value.java pal-portal/modules/ant-installer/trunk/src/org/tp23/antinstaller/runtime/logic/ValuesTest.java pal-portal/modules/ant-installer/trunk/src/org/tp23/antinstaller/runtime/logic/VariableValue.java pal-portal/modules/ant-installer/trunk/src/org/tp23/antinstaller/selfextract/ pal-portal/modules/ant-installer/trunk/src/org/tp23/antinstaller/selfextract/NonExtractor.java pal-portal/modules/ant-installer/trunk/src/org/tp23/antinstaller/selfextract/ProgressIndicator.java pal-portal/modules/ant-installer/trunk/src/org/tp23/antinstaller/selfextract/ResourceExtractor.java pal-portal/modules/ant-installer/trunk/src/org/tp23/antinstaller/selfextract/SelfExtractor.java pal-portal/modules/ant-installer/trunk/src/org/tp23/antinstaller/selfextract/package.html pal-portal/modules/ant-installer/trunk/src/org/tp23/gui/ pal-portal/modules/ant-installer/trunk/src/org/tp23/gui/GBCF.java pal-portal/modules/ant-installer/trunk/src/org/tp23/gui/widget/ pal-portal/modules/ant-installer/trunk/src/org/tp23/gui/widget/DefaultingDirectoryChooser.java pal-portal/modules/ant-installer/trunk/src/org/tp23/gui/widget/FollowingJTextArea.java pal-portal/modules/ant-installer/trunk/src/org/tp23/gui/widget/JTextAreaPrintStream.java pal-portal/modules/ant-installer/trunk/src/org/tp23/gui/widget/SelectFileAction.java pal-portal/modules/ant-installer/trunk/src/org/tp23/gui/widget/SystemOutJTextArea.java pal-portal/modules/ant-installer/trunk/src/resources/ pal-portal/modules/ant-installer/trunk/src/resources/AntInstaller.png pal-portal/modules/ant-installer/trunk/src/resources/LICENSE-ant-install.txt pal-portal/modules/ant-installer/trunk/src/resources/antbar.png pal-portal/modules/ant-installer/trunk/src/resources/banner23.png pal-portal/modules/ant-installer/trunk/src/resources/extract-image.png pal-portal/modules/ant-installer/trunk/src/resources/gkmain_inv.png pal-portal/modules/ant-installer/trunk/src/resources/gothbar.gif pal-portal/modules/ant-installer/trunk/src/resources/greens.png pal-portal/modules/ant-installer/trunk/src/resources/icons/ pal-portal/modules/ant-installer/trunk/src/resources/icons/LICENSE pal-portal/modules/ant-installer/trunk/src/resources/icons/back.png pal-portal/modules/ant-installer/trunk/src/resources/icons/cancel.png pal-portal/modules/ant-installer/trunk/src/resources/icons/finish.png pal-portal/modules/ant-installer/trunk/src/resources/icons/next.png pal-portal/modules/ant-installer/trunk/src/resources/icons/ok.png pal-portal/modules/ant-installer/trunk/src/resources/icons/showdetails.png pal-portal/modules/ant-installer/trunk/src/resources/makewavesdawn.png pal-portal/modules/ant-installer/trunk/src/resources/rockstiles.png pal-portal/modules/ant-installer/trunk/src_ext/ pal-portal/modules/ant-installer/trunk/src_ext/org/ pal-portal/modules/ant-installer/trunk/src_ext/org/tp23/ pal-portal/modules/ant-installer/trunk/src_ext/org/tp23/antinstaller/ pal-portal/modules/ant-installer/trunk/src_ext/org/tp23/antinstaller/runtime/ pal-portal/modules/ant-installer/trunk/src_ext/org/tp23/antinstaller/runtime/exe/ pal-portal/modules/ant-installer/trunk/src_ext/org/tp23/antinstaller/runtime/exe/ReleaseNotesFilter.java pal-portal/modules/ant-installer/trunk/src_ext/org/tp23/antinstaller/runtime/exe/ReleaseNotesFrame.java pal-portal/modules/ant-installer/trunk/src_ext/org/tp23/antinstaller/taskdefs/ pal-portal/modules/ant-installer/trunk/src_ext/org/tp23/antinstaller/taskdefs/Installer.java pal-portal/modules/ant-installer/trunk/src_ext/org/tp23/antinstaller/taskdefs/KdeIconTask.java pal-portal/modules/ant-installer/trunk/src_ext/org/tp23/antinstaller/taskdefs/ValidateConfig.java pal-portal/modules/ant-installer/trunk/src_ext/org/tp23/antinstaller/util/ pal-portal/modules/ant-installer/trunk/src_ext/org/tp23/antinstaller/util/CreateLanguagePack.java pal-portal/modules/ant-installer/trunk/src_ext/org/tp23/antinstaller/util/LangPackFileRenderer.java pal-portal/modules/ant-installer/trunk/templates/ pal-portal/modules/ant-installer/trunk/templates/defaultproject/ pal-portal/modules/ant-installer/trunk/templates/defaultproject/README.txt pal-portal/modules/ant-installer/trunk/templates/defaultproject/antinstall-config-template.xml pal-portal/modules/ant-installer/trunk/templates/defaultproject/antinstall-config.xml pal-portal/modules/ant-installer/trunk/templates/defaultproject/build-self-extractor-template.sh pal-portal/modules/ant-installer/trunk/templates/defaultproject/build-template.xml pal-portal/modules/ant-installer/trunk/templates/defaultproject/build.xml pal-portal/modules/ant-installer/trunk/templates/defaultproject/cp/ pal-portal/modules/ant-installer/trunk/templates/defaultproject/cp/resources/ pal-portal/modules/ant-installer/trunk/templates/defaultproject/cp/resources/makewavesdawn.png pal-portal/modules/ant-installer/trunk/templates/defaultproject/create-installer-template.xml pal-portal/modules/ant-installer/trunk/templates/defaultproject/runtemplate.cmd pal-portal/modules/ant-installer/trunk/templates/defaultproject/runtemplate.sh pal-portal/modules/ant-installer/trunk/windows-icons/ pal-portal/modules/ant-installer/trunk/windows-icons/AntInstaller.ico pal-portal/modules/ant-installer/trunk/windows-icons/installIcons-docs.cmd pal-portal/modules/ant-installer/trunk/windows-icons/installIcons-docs.inf pal-portal/modules/ant-installer/trunk/wizard.cmd pal-portal/modules/ant-installer/trunk/wizard.sh -------------- next part -------------- Added: pal-portal/modules/ant-installer/trunk/CHANGELOG.txt =================================================================== --- pal-portal/modules/ant-installer/trunk/CHANGELOG.txt (rev 0) +++ pal-portal/modules/ant-installer/trunk/CHANGELOG.txt 2008-06-11 13:36:41 UTC (rev 975) @@ -0,0 +1,217 @@ +CHANGELOG + + +======================================== +version 0.2 +Fixed a bug with the ordering of targets. +Added app-root element. +Hid the passwords and added a new properties file renderer with more verbose output. +Fiddled with windoze script. (help wanted its not good scripting) + +======================================== +version 0.3 +Introduced fixed basedir for build.xml files to remove dependency on current + directory. +Introduced SelfExtractor code to deliver installers as a single Jar file. +Fixed some intermittent bugs in the sysout.jar library. +Improved feedback of running Ant tasks. +Added different default values for windows and Unix for directories and files. +Added an ifTarget attribute to conditionally show installation pages. +Added a Date input type. + +======================================== +version 0.4 +Fixed un-important error in the install-config.xml for the demo application. +Fixed more bugs in sysout.jar related to reusing the graphics buffer. +Added popup to save/clear in the sysout.jar. +Fixed double printing in sysout.jar. +Added corner button to sysout.jar to jump to final message. +UI improvements including focusing correct buttons and better layouts. +Changes to the way Properties are saved internally in preparation for allowing + ${prop.name} syntax in future versions. + +======================================== +version 0.5 +Fixed an introduced bug when an input page is skipped in text mode. +Added paging to the license page in text mode. +Fixed bug printing passwords to properties file. +Big internal changes to the way properties are stored and referenced + to allow ${refs}. +Other internal changes to the name of InputFields that do not actually + collect input to OutputField. +Allow the use of .. in file and directory references and display the + correct absolute path reference. + +======================================== +version 0.6 +The XML DTD should be upgraded to 0.6 to use some new features. +Added a modified version of JGoodies' (excelent) Look And Feel to reduce + the size of the installers and include and option for anti-aliased fonts + in the swing GUI. + - Anti-aliasing is resource intensive but good looking. + - The package name has been changed to maintain compatibility on the classpath + with the original JGoodies files, the new package is org.tp23.jgoodies. +Added a splash page feature to show an image. +Added an (optional) image to the extract progress window. +Added a new input type large-select for drop down lists. +Fixed errors from targets on the first page in the Swing UI. +Fixed errors if defaultValue is null. (however it should not be set to null) +Fixed a bug in the selfextractor when the jar is saved in a path with spaces + or other non text characters. +Added documents about the scrolling in license page. +Removed images from the default build of antinstaller.jar + - Any existing builds that are to be upgraded and use the default images, + should add the images to the classpath. The images are included in the + download in the /images directory. +The online manual has been updated, all the changes are included in the download. +Added some of the new features to the examples and the AnInstaller installer. + +======================================== +version 0.7 +File and Directory choosers will now show hidden files . + Thanks to Markus Dueringer for the tip. +Environment variables can now be accesses in default values with the + ${env.ProgramFiles} syntax. - thanks again to Markus Dueringer +Also the Java system properties can be accessed with the "java." prefix. + - e.g ${java.user.name} +Show details button was not big enough in some LAFs - thanks to Mike Watts. +There are known issues with the directory selector and the Metouia LAF, + I can't replicate the issues but if you have problems. + a) use the modified JGoodies which apparently does not have this problem. + b) keep the stack traces and report them please! + When using the selfextractor from windows or X users will probably not + see the errors anyway. +Better defaulting is included for the Directory chooser + the home directory will be shown less often, it was particularly annoying + when the chooser is used to create a new directory + +======================================== +version 0.7.1 +Bug fix in Defaulting Directory Chooser that manifested in not being able to see + directories in app-root. +RFE-1154368 Can't install from a read only source fixed. + The log file is written to the temp dir if it cannot write to the current dir. + The ant.install.properties file is only written if it can be since it is + primarily for debug. + - There is no requirement to add + to the build file any more properties will be added directly to the + build as with secret properties. + +======================================== +version 0.7.2 +Changed the implementation of the Progress Details so selecting text is now possible. + This is more stable too. It has the side effect of keeping the whole System.out + and System.err in memory which is only an issue for veeerrry long builds on + machines with too little RAM. +Changed minor bug where directly edited (not via the chooser) file inputs were + replaced with defaults if the user when back. +Added TargetSelectInput by Mark Anderson providing the option of radio buttons + for targets instead of checkboxes. +Fixed an introduced bug launching from the root drive when ANT_HOME was not set. +Introduced a new "NonExtractor" this is a replacement mechanism to the SelfExtractor. + The Jar is still used to run the installer but the files are not extracted + by default. + In the build.xml files should be specifically extracted using unzip with + nested patternsets to specify the files to extract. + This provide opportunities to improve the performance of installers. + Unzipping can now be performed directly into the installation directories rather + than unzipping and then copying or moving. + Also the antinstaller classes and LookAndFeel and Xerces need no longer + be extracted. +Added an new feature to the ifProperty attribute so the property being tested can + come from the environment or the java system properties. + for example ifProperty="${env.SHELL}=/bin/bash thanks to Eddyrun. + The old syntax of property=value is deprecated in favour of ${property}=value + N.B. ${property}=${value} is NOT supported. +Big internal changes to the Execution class to use a filter pattern currently + hardcoded but with intent to allow pluggable pre and post install tasks. + +======================================== +version 0.7.3 +Added overflow="true" to simple input page. +GridBag Layout used instead of absolute positioning modified to support overflow size + difference. +More Images and Icons added to a separate download. +Added GUI tools for Quick start. +A Much more flexible ifProperty syntax supporting some standard operator with non +standard syntax (see the docs). +Fixed a fatal introduced bug in the console version installer + +======================================== +version 0.7.4 +Added an optional feature to hide password on the console. set textMask="true". + N.B. this does not work in eclipse's console and may not be a stable solution +Implemented plugable filter chains to add steps to the install process. + An example releaseNotes plugin is provided. +Added ext-validated type for pluggable field validation as yet unteset + and undocumented. +Added an Ant task to build installers using Ant. +Added a modified version of the MetalLookAndFeel to reduce download size and still + be able to get the required amount of text in labels and buttons. +Added LookAndFeel names : "default"|"jgoodies", "greymetal" or "null" . +Further testing to allow downloads without including xercesImpl.jar or xml-apis.jar +Added progress pane enhancements to show the targets running for visual feedback of + install progress without having to monitor the output logs which can be + ugly/confusing. +XMLValiation of test scripts and minor changes in the DTD. +Extended validation of config and integrated validation into the installer Ant task. +N.B. passing command line parameters to the build is an override of the detection + method, start scripts should be modified if the default behaviour is requried. + e.g. java -cp $CP org.tp23.antinstaller.runtime.ExecInstaller default . + will not override the default behaviour or trying X and falling back + to text/console +Added an untested feature for including arbitrary validation classes ExtValidated +Assorted fixes for i18n. +app-root no longer creates the directory if it is missing. + +======================================== +version 0.8 +Added features to load defaults from previous installs and perform almost silent + installs property names and targets must not end with the string -targets, + this is validated in the config checker. +Comments expand property values. +Multiline comments via use of explanatoryText and a null displayText value. +Fixed a display bug in the progress renderer if there were more than 5 + targets and none that were dependencies. +PropertyLoaderFilter added, any users with custom .fconfig files should + ensure thier custom versions are still compatible. +Added a release notes feature that is a tad tricky to install so + contact for details. +Added HTML page feature that allows using the Java HTML rendering to display + a page of HTML property references are expanded so the page can contain + ${property.name} syntax to give feed back of selected properties. + Images are loaded from the classpath so the following syntax will locate + and display an image <img src="/resources/temazo.png">. + Java HTML rendering is poor at best and only html3.2 , + so dont expect firefox quality rendering ;) + The java renderer handles PNG properly though so nice . + trancparency effects can be achieved. +Fixed bug in validation if only target-selects are used. +Extended i18n for antinstall-config.xml files using ResourceBundles + called LanguagePack +GUI tool for creating LanguagePack files. +Changes to the Expression code for ifProperty attributes + The original syntax is not 100% compatible e.g. my.property=value1 + will not work it should be converted to ${my.property}=value1. +Initial work on loading existing values if found to automate installs. + Not quite silent installs but save repeating entries. +Added ability to stretch the GUI horizontally, but still using fixed widths. + Set the wide attribute in the installer element to configure width + e.g. 600:275 +Added the ability to deliver different install types in the same Jar which + can be selected on the command line with -type [install type]. +Added icons to the buttons in the swing GUI, the installer Ant task now takes + a new attribute called icons to specify which icon pack to use. +Added ability to run special Ant tasks mid build, the same build-xml file is used + but the message rendering and logging is different in the antinstaller- tasks +Added icons for kde and windows to the AntInstaller SelfExtractor, lots of Ant + hacking to avoid extra dependencies. +Migrated classes from sysout.jar into the core src packages +Renamed ant-ext.jar to ant-installer-ext.jar + all build files will need to be updated \ No newline at end of file Property changes on: pal-portal/modules/ant-installer/trunk/CHANGELOG.txt ___________________________________________________________________ Name: svn:eol-style + native Added: pal-portal/modules/ant-installer/trunk/antinstaller-icon.png =================================================================== (Binary files differ) Property changes on: pal-portal/modules/ant-installer/trunk/antinstaller-icon.png ___________________________________________________________________ Name: svn:mime-type + image/png Added: pal-portal/modules/ant-installer/trunk/antlib/ant-antlr.jar =================================================================== (Binary files differ) Property changes on: pal-portal/modules/ant-installer/trunk/antlib/ant-antlr.jar ___________________________________________________________________ Name: svn:mime-type + application/octet-stream Added: pal-portal/modules/ant-installer/trunk/antlib/ant-apache-bcel.jar =================================================================== (Binary files differ) Property changes on: pal-portal/modules/ant-installer/trunk/antlib/ant-apache-bcel.jar ___________________________________________________________________ Name: svn:mime-type + application/octet-stream Added: pal-portal/modules/ant-installer/trunk/antlib/ant-apache-bsf.jar =================================================================== (Binary files differ) Property changes on: pal-portal/modules/ant-installer/trunk/antlib/ant-apache-bsf.jar ___________________________________________________________________ Name: svn:mime-type + application/octet-stream Added: pal-portal/modules/ant-installer/trunk/antlib/ant-apache-log4j.jar =================================================================== (Binary files differ) Property changes on: pal-portal/modules/ant-installer/trunk/antlib/ant-apache-log4j.jar ___________________________________________________________________ Name: svn:mime-type + application/octet-stream Added: pal-portal/modules/ant-installer/trunk/antlib/ant-apache-oro.jar =================================================================== (Binary files differ) Property changes on: pal-portal/modules/ant-installer/trunk/antlib/ant-apache-oro.jar ___________________________________________________________________ Name: svn:mime-type + application/octet-stream Added: pal-portal/modules/ant-installer/trunk/antlib/ant-apache-regexp.jar =================================================================== (Binary files differ) Property changes on: pal-portal/modules/ant-installer/trunk/antlib/ant-apache-regexp.jar ___________________________________________________________________ Name: svn:mime-type + application/octet-stream Added: pal-portal/modules/ant-installer/trunk/antlib/ant-apache-resolver.jar =================================================================== (Binary files differ) Property changes on: pal-portal/modules/ant-installer/trunk/antlib/ant-apache-resolver.jar ___________________________________________________________________ Name: svn:mime-type + application/octet-stream Added: pal-portal/modules/ant-installer/trunk/antlib/ant-commons-logging.jar =================================================================== (Binary files differ) Property changes on: pal-portal/modules/ant-installer/trunk/antlib/ant-commons-logging.jar ___________________________________________________________________ Name: svn:mime-type + application/octet-stream Added: pal-portal/modules/ant-installer/trunk/antlib/ant-commons-net.jar =================================================================== (Binary files differ) Property changes on: pal-portal/modules/ant-installer/trunk/antlib/ant-commons-net.jar ___________________________________________________________________ Name: svn:mime-type + application/octet-stream Added: pal-portal/modules/ant-installer/trunk/antlib/ant-jai.jar =================================================================== (Binary files differ) Property changes on: pal-portal/modules/ant-installer/trunk/antlib/ant-jai.jar ___________________________________________________________________ Name: svn:mime-type + application/octet-stream Added: pal-portal/modules/ant-installer/trunk/antlib/ant-javamail.jar =================================================================== (Binary files differ) Property changes on: pal-portal/modules/ant-installer/trunk/antlib/ant-javamail.jar ___________________________________________________________________ Name: svn:mime-type + application/octet-stream Added: pal-portal/modules/ant-installer/trunk/antlib/ant-jdepend.jar =================================================================== (Binary files differ) Property changes on: pal-portal/modules/ant-installer/trunk/antlib/ant-jdepend.jar ___________________________________________________________________ Name: svn:mime-type + application/octet-stream Added: pal-portal/modules/ant-installer/trunk/antlib/ant-jmf.jar =================================================================== (Binary files differ) Property changes on: pal-portal/modules/ant-installer/trunk/antlib/ant-jmf.jar ___________________________________________________________________ Name: svn:mime-type + application/octet-stream Added: pal-portal/modules/ant-installer/trunk/antlib/ant-jsch.jar =================================================================== (Binary files differ) Property changes on: pal-portal/modules/ant-installer/trunk/antlib/ant-jsch.jar ___________________________________________________________________ Name: svn:mime-type + application/octet-stream Added: pal-portal/modules/ant-installer/trunk/antlib/ant-junit.jar =================================================================== (Binary files differ) Property changes on: pal-portal/modules/ant-installer/trunk/antlib/ant-junit.jar ___________________________________________________________________ Name: svn:mime-type + application/octet-stream Added: pal-portal/modules/ant-installer/trunk/antlib/ant-launcher.jar =================================================================== (Binary files differ) Property changes on: pal-portal/modules/ant-installer/trunk/antlib/ant-launcher.jar ___________________________________________________________________ Name: svn:mime-type + application/octet-stream Added: pal-portal/modules/ant-installer/trunk/antlib/ant-netrexx.jar =================================================================== (Binary files differ) Property changes on: pal-portal/modules/ant-installer/trunk/antlib/ant-netrexx.jar ___________________________________________________________________ Name: svn:mime-type + application/octet-stream Added: pal-portal/modules/ant-installer/trunk/antlib/ant-nodeps.jar =================================================================== (Binary files differ) Property changes on: pal-portal/modules/ant-installer/trunk/antlib/ant-nodeps.jar ___________________________________________________________________ Name: svn:mime-type + application/octet-stream Added: pal-portal/modules/ant-installer/trunk/antlib/ant-starteam.jar =================================================================== (Binary files differ) Property changes on: pal-portal/modules/ant-installer/trunk/antlib/ant-starteam.jar ___________________________________________________________________ Name: svn:mime-type + application/octet-stream Added: pal-portal/modules/ant-installer/trunk/antlib/ant-stylebook.jar =================================================================== (Binary files differ) Property changes on: pal-portal/modules/ant-installer/trunk/antlib/ant-stylebook.jar ___________________________________________________________________ Name: svn:mime-type + application/octet-stream Added: pal-portal/modules/ant-installer/trunk/antlib/ant-swing.jar =================================================================== (Binary files differ) Property changes on: pal-portal/modules/ant-installer/trunk/antlib/ant-swing.jar ___________________________________________________________________ Name: svn:mime-type + application/octet-stream Added: pal-portal/modules/ant-installer/trunk/antlib/ant-testutil.jar =================================================================== (Binary files differ) Property changes on: pal-portal/modules/ant-installer/trunk/antlib/ant-testutil.jar ___________________________________________________________________ Name: svn:mime-type + application/octet-stream Added: pal-portal/modules/ant-installer/trunk/antlib/ant-trax.jar =================================================================== (Binary files differ) Property changes on: pal-portal/modules/ant-installer/trunk/antlib/ant-trax.jar ___________________________________________________________________ Name: svn:mime-type + application/octet-stream Added: pal-portal/modules/ant-installer/trunk/antlib/ant-weblogic.jar =================================================================== (Binary files differ) Property changes on: pal-portal/modules/ant-installer/trunk/antlib/ant-weblogic.jar ___________________________________________________________________ Name: svn:mime-type + application/octet-stream Added: pal-portal/modules/ant-installer/trunk/antlib/ant.jar =================================================================== (Binary files differ) Property changes on: pal-portal/modules/ant-installer/trunk/antlib/ant.jar ___________________________________________________________________ Name: svn:mime-type + application/octet-stream Added: pal-portal/modules/ant-installer/trunk/antlib/junit-3.8.jar =================================================================== (Binary files differ) Property changes on: pal-portal/modules/ant-installer/trunk/antlib/junit-3.8.jar ___________________________________________________________________ Name: svn:mime-type + application/octet-stream Added: pal-portal/modules/ant-installer/trunk/antlib/xercesImpl.jar =================================================================== (Binary files differ) Property changes on: pal-portal/modules/ant-installer/trunk/antlib/xercesImpl.jar ___________________________________________________________________ Name: svn:mime-type + application/octet-stream Added: pal-portal/modules/ant-installer/trunk/antlib/xml-apis.jar =================================================================== (Binary files differ) Property changes on: pal-portal/modules/ant-installer/trunk/antlib/xml-apis.jar ___________________________________________________________________ Name: svn:mime-type + application/octet-stream Added: pal-portal/modules/ant-installer/trunk/build/build.xml =================================================================== --- pal-portal/modules/ant-installer/trunk/build/build.xml (rev 0) +++ pal-portal/modules/ant-installer/trunk/build/build.xml 2008-06-11 13:36:41 UTC (rev 975) @@ -0,0 +1,147 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + Property changes on: pal-portal/modules/ant-installer/trunk/build/build.xml ___________________________________________________________________ Name: svn:eol-style + native Added: pal-portal/modules/ant-installer/trunk/demo/DEMO-README.txt =================================================================== --- pal-portal/modules/ant-installer/trunk/demo/DEMO-README.txt (rev 0) +++ pal-portal/modules/ant-installer/trunk/demo/DEMO-README.txt 2008-06-11 13:36:41 UTC (rev 975) @@ -0,0 +1,13 @@ +This Demo is a very simple example of what AntInstaller and Ant can do + +The installer performs the following tasks +extracts an installpack.zip pack of files to a temporary directory +install the selected components in the directory of the users choice +performs an ant replace operation on the config file in {installDir}/config/example-config.xml +deletes the temporary direcotry + +Clearly this is not a realworld example. + +The replace Ant task is a very usefull operation for installations, and of course the +full power of ant is at your disposal at the time the installation is performed. It is probably +best to be specific about the optional tasks that are included. Property changes on: pal-portal/modules/ant-installer/trunk/demo/DEMO-README.txt ___________________________________________________________________ Name: svn:eol-style + native Added: pal-portal/modules/ant-installer/trunk/demo/README.txt =================================================================== --- pal-portal/modules/ant-installer/trunk/demo/README.txt (rev 0) +++ pal-portal/modules/ant-installer/trunk/demo/README.txt 2008-06-11 13:36:41 UTC (rev 975) @@ -0,0 +1 @@ +This is an example readme file Property changes on: pal-portal/modules/ant-installer/trunk/demo/README.txt ___________________________________________________________________ Name: svn:eol-style + native Added: pal-portal/modules/ant-installer/trunk/demo/antinstaller-icon.ico =================================================================== (Binary files differ) Property changes on: pal-portal/modules/ant-installer/trunk/demo/antinstaller-icon.ico ___________________________________________________________________ Name: svn:mime-type + image/x-icon Added: pal-portal/modules/ant-installer/trunk/demo/artifacts/demo-installer.jar =================================================================== (Binary files differ) Property changes on: pal-portal/modules/ant-installer/trunk/demo/artifacts/demo-installer.jar ___________________________________________________________________ Name: svn:mime-type + application/octet-stream Added: pal-portal/modules/ant-installer/trunk/demo/artifacts/installpack.zip =================================================================== (Binary files differ) Property changes on: pal-portal/modules/ant-installer/trunk/demo/artifacts/installpack.zip ___________________________________________________________________ Name: svn:mime-type + application/octet-stream Added: pal-portal/modules/ant-installer/trunk/demo/bin/run.cmd =================================================================== --- pal-portal/modules/ant-installer/trunk/demo/bin/run.cmd (rev 0) +++ pal-portal/modules/ant-installer/trunk/demo/bin/run.cmd 2008-06-11 13:36:41 UTC (rev 975) @@ -0,0 +1,19 @@ + @ echo off + +if "%JAVA_HOME%" == "" goto nojava + +set CLASSPATH=.\classes + +echo CLASSPATH:%CLASSPATH% +echo JAVA_HOME:%JAVA_HOME% + +%JAVA_HOME%\bin\java -cp %CLASSPATH% org.tp23.demo.Demonstration + +goto end + +:nojava +echo Set JAVA_HOME environment variable +goto end + + +:end \ No newline at end of file Property changes on: pal-portal/modules/ant-installer/trunk/demo/bin/run.cmd ___________________________________________________________________ Name: svn:eol-style + native Added: pal-portal/modules/ant-installer/trunk/demo/bin/run.sh =================================================================== --- pal-portal/modules/ant-installer/trunk/demo/bin/run.sh (rev 0) +++ pal-portal/modules/ant-installer/trunk/demo/bin/run.sh 2008-06-11 13:36:41 UTC (rev 975) @@ -0,0 +1,26 @@ +#!/bin/sh + +if [ "$JAVA_HOME" = "" ] ; then + echo set JAVA_HOME; + exit 1; +fi + +# find the command called's root e.g. ./build/ +dir=`expr match "$0" '\(.*\)run.sh'` +echo command called $0 directory + +# if it we did not call ./ change to the directory we called +if [ "$dir" != "./" ] ; then + if [ "$dir" != "" ] ; then + echo changing to $dir + cd "$dir" ; + fi +fi +CLASSPATH=$CLASSPATH:./classes + +echo $CLASSPATH +echo $JAVA_HOME + +$JAVA_HOME/bin/java -cp $CLASSPATH org.tp23.demo.Demonstration + + Property changes on: pal-portal/modules/ant-installer/trunk/demo/bin/run.sh ___________________________________________________________________ Name: svn:eol-style + native Added: pal-portal/modules/ant-installer/trunk/demo/build-demo.xml =================================================================== --- pal-portal/modules/ant-installer/trunk/demo/build-demo.xml (rev 0) +++ pal-portal/modules/ant-installer/trunk/demo/build-demo.xml 2008-06-11 13:36:41 UTC (rev 975) @@ -0,0 +1,103 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + Property changes on: pal-portal/modules/ant-installer/trunk/demo/build-demo.xml ___________________________________________________________________ Name: svn:eol-style + native Added: pal-portal/modules/ant-installer/trunk/demo/checkConfig.sh =================================================================== --- pal-portal/modules/ant-installer/trunk/demo/checkConfig.sh (rev 0) +++ pal-portal/modules/ant-installer/trunk/demo/checkConfig.sh 2008-06-11 13:36:41 UTC (rev 975) @@ -0,0 +1,35 @@ +#!/bin/sh + +# This script check the configuration in the scripts directory + +# find the command called's root e.g. ./build/ +dir=`expr match "$0" '\(.*\)checkConfig.sh'` +# if it we did not call ./ change to the directory we called +if [ "$dir" != "./" ] ; then + if [ "$dir" != "" ] ; then + echo changing to $dir + cd "$dir" ; + fi +fi + + +# Installer requires Java +if [ "$JAVA_HOME" = "" ] ; then + echo Installer requires Java available from http://java.sun.com + echo If you have Java installed you may just need to set the variable JAVA_HOME + exit 1; +fi + +# Installer from command line classpath +CLASSPATH=./installlib/xercesImpl.jar +CLASSPATH=$CLASSPATH:./installlib/xml-apis.jar +CLASSPATH=$CLASSPATH:./installlib/ant-installer.jar +CLASSPATH=$CLASSPATH:./installlib/ant-installer-ext.jar +CLASSPATH=$CLASSPATH:./antlib/ant.jar +CLASSPATH=$CLASSPATH:./antlib/ant-launcher.jar + +COMMAND=$JAVA_HOME/bin/java + +#echo $COMMAND -classpath $CLASSPATH org.tp23.antinstaller.runtime.ExecInstall $1 + +$COMMAND -classpath $CLASSPATH org.tp23.antinstaller.runtime.ConfigurationLoader . Property changes on: pal-portal/modules/ant-installer/trunk/demo/checkConfig.sh ___________________________________________________________________ Name: svn:executable + * Name: svn:eol-style + native Added: pal-portal/modules/ant-installer/trunk/demo/classes/org/tp23/demo/Demonstration.class =================================================================== (Binary files differ) Property changes on: pal-portal/modules/ant-installer/trunk/demo/classes/org/tp23/demo/Demonstration.class ___________________________________________________________________ Name: svn:mime-type + application/octet-stream Added: pal-portal/modules/ant-installer/trunk/demo/classes/resources/demo.png =================================================================== (Binary files differ) Property changes on: pal-portal/modules/ant-installer/trunk/demo/classes/resources/demo.png ___________________________________________________________________ Name: svn:mime-type + image/png Added: pal-portal/modules/ant-installer/trunk/demo/config/demo.properties =================================================================== --- pal-portal/modules/ant-installer/trunk/demo/config/demo.properties (rev 0) +++ pal-portal/modules/ant-installer/trunk/demo/config/demo.properties 2008-06-11 13:36:41 UTC (rev 975) @@ -0,0 +1,7 @@ +# +# Installtion properties +# +TextProperty=@TextProperty@ +BooleanProperty=@BooleanProperty@ +Colour=@Colour@ +SelectedFile=@SelectedFile@ Property changes on: pal-portal/modules/ant-installer/trunk/demo/config/demo.properties ___________________________________________________________________ Name: svn:eol-style + native Added: pal-portal/modules/ant-installer/trunk/demo/config/example-config.xml =================================================================== --- pal-portal/modules/ant-installer/trunk/demo/config/example-config.xml (rev 0) +++ pal-portal/modules/ant-installer/trunk/demo/config/example-config.xml 2008-06-11 13:36:41 UTC (rev 975) @@ -0,0 +1,9 @@ + + + + + + + + + Property changes on: pal-portal/modules/ant-installer/trunk/demo/config/example-config.xml ___________________________________________________________________ Name: svn:eol-style + native Added: pal-portal/modules/ant-installer/trunk/demo/doc/allclasses-frame.html =================================================================== --- pal-portal/modules/ant-installer/trunk/demo/doc/allclasses-frame.html (rev 0) +++ pal-portal/modules/ant-installer/trunk/demo/doc/allclasses-frame.html 2008-06-11 13:36:41 UTC (rev 975) @@ -0,0 +1,31 @@ + + + + + + + +All Classes + + + + + + + + + + +All Classes +
+ + + + + +
Demonstration +
+
+ + + Property changes on: pal-portal/modules/ant-installer/trunk/demo/doc/allclasses-frame.html ___________________________________________________________________ Name: svn:eol-style + native Added: pal-portal/modules/ant-installer/trunk/demo/doc/allclasses-noframe.html =================================================================== --- pal-portal/modules/ant-installer/trunk/demo/doc/allclasses-noframe.html (rev 0) +++ pal-portal/modules/ant-installer/trunk/demo/doc/allclasses-noframe.html 2008-06-11 13:36:41 UTC (rev 975) @@ -0,0 +1,31 @@ + + + + + + + +All Classes + + + + + + + + + + +All Classes +
+ + + + + +
Demonstration +
+
+ + + Property changes on: pal-portal/modules/ant-installer/trunk/demo/doc/allclasses-noframe.html ___________________________________________________________________ Name: svn:eol-style + native Added: pal-portal/modules/ant-installer/trunk/demo/doc/constant-values.html =================================================================== --- pal-portal/modules/ant-installer/trunk/demo/doc/constant-values.html (rev 0) +++ pal-portal/modules/ant-installer/trunk/demo/doc/constant-values.html 2008-06-11 13:36:41 UTC (rev 975) @@ -0,0 +1,135 @@ + + + + + + + +Constant Field Values + + + + + + + + + + + + + + + + + + + + + + + + + +
+ +
+ + + +
+
+

+Constant Field Values

+
+
+Contents
    +
+ +
+ + + + + + + + + + + + + + + +
+ +
+ + + +
+ + + Property changes on: pal-portal/modules/ant-installer/trunk/demo/doc/constant-values.html ___________________________________________________________________ Name: svn:eol-style + native Added: pal-portal/modules/ant-installer/trunk/demo/doc/deprecated-list.html =================================================================== --- pal-portal/modules/ant-installer/trunk/demo/doc/deprecated-list.html (rev 0) +++ pal-portal/modules/ant-installer/trunk/demo/doc/deprecated-list.html 2008-06-11 13:36:41 UTC (rev 975) @@ -0,0 +1,131 @@ + + + + + + + +Deprecated List + + + + + + + + + + + + + + + + + + + + + + + + + +
+ +
+ + + +
+
+

+Deprecated API

+
+
+ + + + + + + + + + + + + + + +
+ +
+ + + +
+ + + Property changes on: pal-portal/modules/ant-installer/trunk/demo/doc/deprecated-list.html ___________________________________________________________________ Name: svn:eol-style + native Added: pal-portal/modules/ant-installer/trunk/demo/doc/help-doc.html =================================================================== --- pal-portal/modules/ant-installer/trunk/demo/doc/help-doc.html (rev 0) +++ pal-portal/modules/ant-installer/trunk/demo/doc/help-doc.html 2008-06-11 13:36:41 UTC (rev 975) @@ -0,0 +1,180 @@ + + + + + + + +API Help + + + + + + + + + + + + + + + + + + + + + + + + + +
+ +
+ + + +
+
+

+How This API Document Is Organized

+
+This API (Application Programming Interface) document has pages corresponding to the items in the navigation bar, described as follows.

+Package

+
+ +

+Each package has a page that contains a list of its classes and interfaces, with a summary for each. This page can contain four categories:

    +
  • Interfaces (italic)
  • Classes
  • Exceptions
  • Errors
+
+

+Class/Interface

+
+ +

+Each class, interface, nested class and nested interface has its own separate page. Each of these pages has three sections consisting of a class/interface description, summary tables, and detailed member descriptions:

    +
  • Class inheritance diagram
  • Direct Subclasses
  • All Known Subinterfaces
  • All Known Implementing Classes
  • Class/interface declaration
  • Class/interface description +

    +

  • Nested Class Summary
  • Field Summary
  • Constructor Summary
  • Method Summary +

    +

  • Field Detail
  • Constructor Detail
  • Method Detail
+Each summary entry contains the first sentence from the detailed description for that item. The summary entries are alphabetical, while the detailed descriptions are in the order they appear in the source code. This preserves the logical groupings established by the programmer.
+

+Tree (Class Hierarchy)

+
+There is a Class Hierarchy page for all packages, plus a hierarchy for each package. Each hierarchy page contains a list of classes and a list of interfaces. The classes are organized by inheritance structure starting with java.lang.Object. The interfaces do not inherit from java.lang.Object.
    +
  • When viewing the Overview page, clicking on "Tree" displays the hierarchy for all packages.
  • When viewing a particular package, class or interface page, clicking "Tree" displays the hierarchy for only that package.
+
+

+Deprecated API

+
+The Deprecated API page lists all of the API that have been deprecated. A deprecated API is not recommended for use, generally due to improvements, and a replacement API is usually given. Deprecated APIs may be removed in future implementations.
+

+Index

+
+The Index contains an alphabetic list of all classes, interfaces, constructors, methods, and fields.
+

+Prev/Next

+These links take you to the next or previous class, interface, package, or related page.

+Frames/No Frames

+These links show and hide the HTML frames. All pages are available with or without frames. +

+

+Serialized Form

+Each serializable or externalizable class has a description of its serialization fields and methods. This information is of interest to re-implementors, not to developers using the API. While there is no link in the navigation bar, you can get to this information by going to any serialized class and clicking "Serialized Form" in the "See also" section of the class description. +

+ + +This help file applies to API documentation generated using the standard doclet. + +
+


+ + + + + + + + + + + + + + + +
+ +
+ + + +
+ + + Property changes on: pal-portal/modules/ant-installer/trunk/demo/doc/help-doc.html ___________________________________________________________________ Name: svn:eol-style + native Added: pal-portal/modules/ant-installer/trunk/demo/doc/index-all.html =================================================================== --- pal-portal/modules/ant-installer/trunk/demo/doc/index-all.html (rev 0) +++ pal-portal/modules/ant-installer/trunk/demo/doc/index-all.html 2008-06-11 13:36:41 UTC (rev 975) @@ -0,0 +1,147 @@ + + + + + + + +Index + + + + + + + + + + + + + + + + + + + + + + + + + +
+ +
+ + + +D M O
+

+D

+
+
Demonstration - class org.tp23.demo.Demonstration.
Title: Example Application
Demonstration() - +Constructor for class org.tp23.demo.Demonstration +
  +
+
+

+M

+
+
main(String[]) - +Static method in class org.tp23.demo.Demonstration +
  +
+
+

+O

+
+
org.tp23.demo - package org.tp23.demo
 
+
+D M O + + + + + + + + + + + + + + +
+ +
+ + + +
+ + + Property changes on: pal-portal/modules/ant-installer/trunk/demo/doc/index-all.html ___________________________________________________________________ Name: svn:eol-style + native Added: pal-portal/modules/ant-installer/trunk/demo/doc/index.html =================================================================== --- pal-portal/modules/ant-installer/trunk/demo/doc/index.html (rev 0) +++ pal-portal/modules/ant-installer/trunk/demo/doc/index.html 2008-06-11 13:36:41 UTC (rev 975) @@ -0,0 +1,24 @@ + + + + + + + +Generated Documentation (Untitled) + + + + + + +<H2> +Frame Alert</H2> + +<P> +This document is designed to be viewed using the frames feature. If you see this message, you are using a non-frame-capable web client. +<BR> +Link to<A HREF="org/tp23/demo/package-summary.html">Non-frame version.</A> + + + Property changes on: pal-portal/modules/ant-installer/trunk/demo/doc/index.html ___________________________________________________________________ Name: svn:eol-style + native Added: pal-portal/modules/ant-installer/trunk/demo/doc/org/tp23/demo/Demonstration.html =================================================================== --- pal-portal/modules/ant-installer/trunk/demo/doc/org/tp23/demo/Demonstration.html (rev 0) +++ pal-portal/modules/ant-installer/trunk/demo/doc/org/tp23/demo/Demonstration.html 2008-06-11 13:36:41 UTC (rev 975) @@ -0,0 +1,263 @@ + + + + + + + +Demonstration + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
+ +
+ + + +
+ +

+ +org.tp23.demo +
+Class Demonstration

+
+java.lang.Object
+  extended byorg.tp23.demo.Demonstration
+
+
+
+
public class Demonstration
extends java.lang.Object
+ +

+

Title: Example Application

+

Description: Prints Hello World, trys to do it in a pop up box + if a Throwable is thrown (e.g. no X) it prints to System.out

+

Copyright: Copyright (c) 2004

+

Company: tp23

+

+ +

+

+
Version:
+
1.0
+
Author:
+
Paul Hinds
+
+
+ +

+ + + + + + + + + + + + + + + + +
+Constructor Summary
Demonstration() + +
+           
+  + + + + + + + + + + + +
+Method Summary
+static voidmain(java.lang.String[] args) + +
+           
+ + + + + + + +
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
+  +

+ + + + + + + + + + + +
+Constructor Detail
+ +

+Demonstration

+
+public Demonstration()
+
+
+ + + + + + + + +
+Method Detail
+ +

+main

+
+public static void main(java.lang.String[] args)
+
+
+
+
+
+ +
+ + + + + + + + + + + + + + + + + + + +
+ +
+ + + +
+ + + Property changes on: pal-portal/modules/ant-installer/trunk/demo/doc/org/tp23/demo/Demonstration.html ___________________________________________________________________ Name: svn:eol-style + native Added: pal-portal/modules/ant-installer/trunk/demo/doc/org/tp23/demo/package-frame.html =================================================================== --- pal-portal/modules/ant-installer/trunk/demo/doc/org/tp23/demo/package-frame.html (rev 0) +++ pal-portal/modules/ant-installer/trunk/demo/doc/org/tp23/demo/package-frame.html 2008-06-11 13:36:41 UTC (rev 975) @@ -0,0 +1,33 @@ + + + + + + + +org.tp23.demo + + + + + + + + + + + +org.tp23.demo + + + + +
+Classes  + +
+Demonstration
+ + + + Property changes on: pal-portal/modules/ant-installer/trunk/demo/doc/org/tp23/demo/package-frame.html ___________________________________________________________________ Name: svn:eol-style + native Added: pal-portal/modules/ant-installer/trunk/demo/doc/org/tp23/demo/package-summary.html =================================================================== --- pal-portal/modules/ant-installer/trunk/demo/doc/org/tp23/demo/package-summary.html (rev 0) +++ pal-portal/modules/ant-installer/trunk/demo/doc/org/tp23/demo/package-summary.html 2008-06-11 13:36:41 UTC (rev 975) @@ -0,0 +1,145 @@ + + + + + + + +org.tp23.demo + + + + + + + + + + + + + + + + + + + + + + + + + + +
+ +
+ + + +
+

+Package org.tp23.demo +

+ + + + + + + + + +
+Class Summary
DemonstrationTitle: Example Application
+  + +

+


+ + + + + + + + + + + + + + + +
+ +
+ + + +
+ + + Property changes on: pal-portal/modules/ant-installer/trunk/demo/doc/org/tp23/demo/package-summary.html ___________________________________________________________________ Name: svn:eol-style + native Added: pal-portal/modules/ant-installer/trunk/demo/doc/org/tp23/demo/package-tree.html =================================================================== --- pal-portal/modules/ant-installer/trunk/demo/doc/org/tp23/demo/package-tree.html (rev 0) +++ pal-portal/modules/ant-installer/trunk/demo/doc/org/tp23/demo/package-tree.html 2008-06-11 13:36:41 UTC (rev 975) @@ -0,0 +1,139 @@ + + + + + + + +org.tp23.demo Class Hierarchy + + + + + + + + + + + + + + + + + + + + + + + + + +
+ +
+ + + +
+
+

+Hierarchy For Package org.tp23.demo +

+
+

+Class Hierarchy +

+ +
+ + + + + + + + + + + + + + + +
+ +
+ + + +
+ + + Property changes on: pal-portal/modules/ant-installer/trunk/demo/doc/org/tp23/demo/package-tree.html ___________________________________________________________________ Name: svn:eol-style + native Added: pal-portal/modules/ant-installer/trunk/demo/doc/overview-tree.html =================================================================== --- pal-portal/modules/ant-installer/trunk/demo/doc/overview-tree.html (rev 0) +++ pal-portal/modules/ant-installer/trunk/demo/doc/overview-tree.html 2008-06-11 13:36:41 UTC (rev 975) @@ -0,0 +1,141 @@ + + + + + + + +Class Hierarchy + + + + + + + + + + + + + + + + + + + + + + + + + +
+ +
+ + + +
+
+

+Hierarchy For All Packages

+
+
+
Package Hierarchies:
org.tp23.demo
+
+

+Class Hierarchy +

+ +
+ + + + + + + + + + + + + + + +
+ +
+ + + +
+ + + Property changes on: pal-portal/modules/ant-installer/trunk/demo/doc/overview-tree.html ___________________________________________________________________ Name: svn:eol-style + native Added: pal-portal/modules/ant-installer/trunk/demo/doc/package-list =================================================================== --- pal-portal/modules/ant-installer/trunk/demo/doc/package-list (rev 0) +++ pal-portal/modules/ant-installer/trunk/demo/doc/package-list 2008-06-11 13:36:41 UTC (rev 975) @@ -0,0 +1 @@ +org.tp23.demo Added: pal-portal/modules/ant-installer/trunk/demo/doc/packages.html =================================================================== --- pal-portal/modules/ant-installer/trunk/demo/doc/packages.html (rev 0) +++ pal-portal/modules/ant-installer/trunk/demo/doc/packages.html 2008-06-11 13:36:41 UTC (rev 975) @@ -0,0 +1,32 @@ + + + + + + + + + + + + + + + + + + +
+ +
+ +
+
+The front page has been relocated.Please see: +
+          Frame version +
+          Non-frame version.
+ + + Property changes on: pal-portal/modules/ant-installer/trunk/demo/doc/packages.html ___________________________________________________________________ Name: svn:eol-style + native Added: pal-portal/modules/ant-installer/trunk/demo/doc/resources/inherit.gif =================================================================== (Binary files differ) Property changes on: pal-portal/modules/ant-installer/trunk/demo/doc/resources/inherit.gif ___________________________________________________________________ Name: svn:mime-type + application/octet-stream Added: pal-portal/modules/ant-installer/trunk/demo/doc/stylesheet.css =================================================================== --- pal-portal/modules/ant-installer/trunk/demo/doc/stylesheet.css (rev 0) +++ pal-portal/modules/ant-installer/trunk/demo/doc/stylesheet.css 2008-06-11 13:36:41 UTC (rev 975) @@ -0,0 +1,29 @@ +/* Javadoc style sheet */ + +/* Define colors, fonts and other style attributes here to override the defaults */ + +/* Page background color */ +body { background-color: #FFFFFF } + +/* Headings */ +h1 { font-size: 145% } + +/* Table colors */ +.TableHeadingColor { background: #CCCCFF } /* Dark mauve */ +.TableSubHeadingColor { background: #EEEEFF } /* Light mauve */ +.TableRowColor { background: #FFFFFF } /* White */ + +/* Font used in left-hand frame lists */ +.FrameTitleFont { font-size: 100%; font-family: Helvetica, Arial, sans-serif } +.FrameHeadingFont { font-size: 90%; font-family: Helvetica, Arial, sans-serif } +.FrameItemFont { font-size: 90%; font-family: Helvetica, Arial, sans-serif } + +/* Navigation bar fonts and colors */ +.NavBarCell1 { background-color:#EEEEFF;} /* Light mauve */ +.NavBarCell1Rev { background-color:#00008B;} /* Dark Blue */ +.NavBarFont1 { font-family: Arial, Helvetica, sans-serif; color:#000000;} +.NavBarFont1Rev { font-family: Arial, Helvetica, sans-serif; color:#FFFFFF;} + +.NavBarCell2 { font-family: Arial, Helvetica, sans-serif; background-color:#FFFFFF;} +.NavBarCell3 { font-family: Arial, Helvetica, sans-serif; background-color:#FFFFFF;} + Property changes on: pal-portal/modules/ant-installer/trunk/demo/doc/stylesheet.css ___________________________________________________________________ Name: svn:eol-style + native Added: pal-portal/modules/ant-installer/trunk/demo/install.cmd =================================================================== --- pal-portal/modules/ant-installer/trunk/demo/install.cmd (rev 0) +++ pal-portal/modules/ant-installer/trunk/demo/install.cmd 2008-06-11 13:36:41 UTC (rev 975) @@ -0,0 +1,44 @@ + @ echo off +REM #!/bin/sh +if "%JAVA_HOME%" == "" goto nojava + +setlocal + +set AI_LIB=..\lib +set ANT_LIB=..\antlib +set CLASSPATH=%AI_LIB%\xercesImpl.jar;%AI_LIB%\xml-apis.jar;%AI_LIB%\ant-installer.jar +set CLASSPATH=%CLASSPATH%;%AI_LIB%\jgoodies-edited-1_2_2.jar +set CLASSPATH=%CLASSPATH%;%ANT_LIB%\ant.jar;%ANT_LIB%\ant-launcher.jar +set CLASSPATH=%CLASSPATH%;.\installclasspath + + + +REM set CLASSPATH=%CLASSPATH%;.\installlib\ant-weblogic.jar;.\installlib\ant-javamail.jar + +set INTERFACE=default +set COMMAND=%JAVA_HOME%\bin\java +if "%1" == "text" goto settext +if "%1" == "swing" goto setswing +goto install + +:settext +set COMMAND=%JAVA_HOME%\bin\java +set INTERFACE=text +goto install + +:setswing +set COMMAND=%JAVA_HOME%\bin\javaw +set INTERFACE=swing +goto install + +:install + +start "AntInstaller" "%COMMAND%" -classpath %CLASSPATH% org.tp23.antinstaller.runtime.ExecInstall %INTERFACE% . +goto end + +:nojava +echo you must install java to run this applicaiton +goto end + +endlocal +:end \ No newline at end of file Property changes on: pal-portal/modules/ant-installer/trunk/demo/install.cmd ___________________________________________________________________ Name: svn:eol-style + native Added: pal-portal/modules/ant-installer/trunk/demo/install.sh =================================================================== --- pal-portal/modules/ant-installer/trunk/demo/install.sh (rev 0) +++ pal-portal/modules/ant-installer/trunk/demo/install.sh 2008-06-11 13:36:41 UTC (rev 975) @@ -0,0 +1,37 @@ +#!/bin/sh + +# find the command called's root e.g. ./build/ +dir=`expr match "$0" '\(.*\)install.sh'` +# if it we did not call ./ change to the directory we called +if [ "$dir" != "./" ] ; then + if [ "$dir" != "" ] ; then + echo changing to $dir + cd "$dir" ; + fi +fi + + + +if [ "$JAVA_HOME" = "" ] ; then + echo set JAVA_HOME; + exit 1; +fi + +AI_LIB=../lib +ANT_LIB=../antlib +CLASSPATH=${AI_LIB}/xercesImpl.jar:${AI_LIB}/xml-apis.jar:${AI_LIB}/ant-installer.jar +CLASSPATH=$CLASSPATH:${AI_LIB}/jgoodies-edited-1_2_2.jar +CLASSPATH=$CLASSPATH:${ANT_LIB}/ant.jar:${ANT_LIB}/ant-launcher.jar +CLASSPATH=$CLASSPATH:./installclasspath + + +### add other ant jars required here and add them to the install package +#CLASSPATH=$CLASSPATH:./installlib/ant-weblogic.jar:./installlib/ant-javamail.jar + +COMMAND=$JAVA_HOME/bin/java +INTERFACE=default +if [ "$1" != "" ] ; then + INTERFACE=$1; +fi + +$COMMAND -classpath $CLASSPATH org.tp23.antinstaller.runtime.ExecInstall $INTERFACE . Property changes on: pal-portal/modules/ant-installer/trunk/demo/install.sh ___________________________________________________________________ Name: svn:executable + * Name: svn:eol-style + native Added: pal-portal/modules/ant-installer/trunk/demo/installclasspath/resources/GPL.txt =================================================================== --- pal-portal/modules/ant-installer/trunk/demo/installclasspath/resources/GPL.txt (rev 0) +++ pal-portal/modules/ant-installer/trunk/demo/installclasspath/resources/GPL.txt 2008-06-11 13:36:41 UTC (rev 975) @@ -0,0 +1,148 @@ +GNU LESSER GENERAL PUBLIC LICENSE +Version 2.1, February 1999 + +Copyright (C) 1991, 1999 Free Software Foundation, Inc. 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA Everyone is permitted to copy and distribute verbatim copies of this license document, but changing it is not allowed. + +[This is the first released version of the Lesser GPL. It also counts as the successor of the GNU Library Public License, version 2, hence the version number 2.1.] + +Preamble + +The licenses for most software are designed to take away your freedom to share and change it. By contrast, the GNU General Public Licenses are intended to guarantee your freedom to share and change free software--to make sure the software is free for all its users. + +This license, the Lesser General Public License, applies to some specially designated software packages--typically libraries--of the Free Software Foundation and other authors who decide to use it. You can use it too, but we suggest you first think carefully about whether this license or the ordinary General Public License is the better strategy to use in any particular case, based on the explanations below. + +When we speak of free software, we are referring to freedom of use, not price. Our General Public Licenses are designed to make sure that you have the freedom to distribute copies of free software (and charge for this service if you wish); that you receive source code or can get it if you want it; that you can change the software and use pieces of it in new free programs; and that you are informed that you can do these things. + +To protect your rights, we need to make restrictions that forbid distributors to deny you these rights or to ask you to surrender these rights. These restrictions translate to certain responsibilities for you if you distribute copies of the library or if you modify it. + +For example, if you distribute copies of the library, whether gratis or for a fee, you must give the recipients all the rights that we gave you. You must make sure that they, too, receive or can get the source code. If you link other code with the library, you must provide complete object files to the recipients, so that they can relink them with the library after making changes to the library and recompiling it. And you must show them these terms so they know their rights. + +We protect your rights with a two-step method: (1) we copyright the library, and (2) we offer you this license, which gives you legal permission to copy, distribute and/or modify the library. + +To protect each distributor, we want to make it very clear that there is no warranty for the free library. Also, if the library is modified by someone else and passed on, the recipients should know that what they have is not the original version, so that the original author's reputation will not be affected by problems that might be introduced by others. + +Finally, software patents pose a constant threat to the existence of any free program. We wish to make sure that a company cannot effectively restrict the users of a free program by obtaining a restrictive license from a patent holder. Therefore, we insist that any patent license obtained for a version of the library must be consistent with the full freedom of use specified in this license. + +Most GNU software, including some libraries, is covered by the ordinary GNU General Public License. This license, the GNU Lesser General Public License, applies to certain designated libraries, and is quite different from the ordinary General Public License. We use this license for certain libraries in order to permit linking those libraries into non-free programs. + +When a program is linked with a library, whether statically or using a shared library, the combination of the two is legally speaking a combined work, a derivative of the original library. The ordinary General Public License therefore permits such linking only if the entire combination fits its criteria of freedom. The Lesser General Public License permits more lax criteria for linking other code with the library. + +We call this license the "Lesser" General Public License because it does Less to protect the user's freedom than the ordinary General Public License. It also provides other free software developers Less of an advantage over competing non-free programs. These disadvantages are the reason we use the ordinary General Public License for many libraries. However, the Lesser license provides advantages in certain special circumstances. + +For example, on rare occasions, there may be a special need to encourage the widest possible use of a certain library, so that it becomes a de-facto standard. To achieve this, non-free programs must be allowed to use the library. A more frequent case is that a free library does the same job as widely used non-free libraries. In this case, there is little to gain by limiting the free library to free software only, so we use the Lesser General Public License. + +In other cases, permission to use a particular library in non-free programs enables a greater number of people to use a large body of free software. For example, permission to use the GNU C Library in non-free programs enables many more people to use the whole GNU operating system, as well as its variant, the GNU/Linux operating system. + +Although the Lesser General Public License is Less protective of the users' freedom, it does ensure that the user of a program that is linked with the Library has the freedom and the wherewithal to run that program using a modified version of the Library. + +The precise terms and conditions for copying, distribution and modification follow. Pay close attention to the difference between a "work based on the library" and a "work that uses the library". The former contains code derived from the library, whereas the latter must be combined with the library in order to run. + +GNU LESSER GENERAL PUBLIC LICENSE +TERMS AND CONDITIONS FOR COPYING, DISTRIBUTION AND MODIFICATION + +0. This License Agreement applies to any software library or other program which contains a notice placed by the copyright holder or other authorized party saying it may be distributed under the terms of this Lesser General Public License (also called "this License"). Each licensee is addressed as "you". + +A "library" means a collection of software functions and/or data prepared so as to be conveniently linked with application programs (which use some of those functions and data) to form executables. + +The "Library", below, refers to any such software library or work which has been distributed under these terms. A "work based on the Library" means either the Library or any derivative work under copyright law: that is to say, a work containing the Library or a portion of it, either verbatim or with modifications and/or translated straightforwardly into another language. (Hereinafter, translation is included without limitation in the term "modification".) + +"Source code" for a work means the preferred form of the work for making modifications to it. For a library, complete source code means all the source code for all modules it contains, plus any associated interface definition files, plus the scripts used to control compilation and installation of the library. + +Activities other than copying, distribution and modification are not covered by this License; they are outside its scope. The act of running a program using the Library is not restricted, and output from such a program is covered only if its contents constitute a work based on the Library (independent of the use of the Library in a tool for writing it). Whether that is true depends on what the Library does and what the program that uses the Library does. + +1. You may copy and distribute verbatim copies of the Library's complete source code as you receive it, in any medium, provided that you conspicuously and appropriately publish on each copy an appropriate copyright notice and disclaimer of warranty; keep intact all the notices that refer to this License and to the absence of any warranty; and distribute a copy of this License along with the Library. + +You may charge a fee for the physical act of transferring a copy, and you may at your option offer warranty protection in exchange for a fee. + +2. You may modify your copy or copies of the Library or any portion of it, thus forming a work based on the Library, and copy and distribute such modifications or work under the terms of Section 1 above, provided that you also meet all of these conditions: + +a) The modified work must itself be a software library. + +b) You must cause the files modified to carry prominent notices stating that you changed the files and the date of any change. + +c) You must cause the whole of the work to be licensed at no charge to all third parties under the terms of this License. + +d) If a facility in the modified Library refers to a function or a table of data to be supplied by an application program that uses the facility, other than as an argument passed when the facility is invoked, then you must make a good faith effort to ensure that, in the event an application does not supply such function or table, the facility still operates, and performs whatever part of its purpose remains meaningful. + +(For example, a function in a library to compute square roots has a purpose that is entirely well-defined independent of the application. Therefore, Subsection 2d requires that any application-supplied function or table used by this function must be optional: if the application does not supply it, the square root function must still compute square roots.) + +These requirements apply to the modified work as a whole. If identifiable sections of that work are not derived from the Library, and can be reasonably considered independent and separate works in themselves, then this License, and its terms, do not apply to those sections when you distribute them as separate works. But when you distribute the same sections as part of a whole which is a work based on the Library, the distribution of the whole must be on the terms of this License, whose permissions for other licensees extend to the entire whole, and thus to each and every part regardless of who wrote it. + +Thus, it is not the intent of this section to claim rights or contest your rights to work written entirely by you; rather, the intent is to exercise the right to control the distribution of derivative or collective works based on the Library. + +In addition, mere aggregation of another work not based on the Library with the Library (or with a work based on the Library) on a volume of a storage or distribution medium does not bring the other work under the scope of this License. + +3. You may opt to apply the terms of the ordinary GNU General Public License instead of this License to a given copy of the Library. To do this, you must alter all the notices that refer to this License, so that they refer to the ordinary GNU General Public License, version 2, instead of to this License. (If a newer version than version 2 of the ordinary GNU General Public License has appeared, then you can specify that version instead if you wish.) Do not make any other change in these notices. + +Once this change is made in a given copy, it is irreversible for that copy, so the ordinary GNU General Public License applies to all subsequent copies and derivative works made from that copy. + +This option is useful when you wish to copy part of the code of the Library into a program that is not a library. + +4. You may copy and distribute the Library (or a portion or derivative of it, under Section 2) in object code or executable form under the terms of Sections 1 and 2 above provided that you accompany it with the complete corresponding machine-readable source code, which must be distributed under the terms of Sections 1 and 2 above on a medium customarily used for software interchange. + +If distribution of object code is made by offering access to copy from a designated place, then offering equivalent access to copy the source code from the same place satisfies the requirement to distribute the source code, even though third parties are not compelled to copy the source along with the object code. + +5. A program that contains no derivative of any portion of the Library, but is designed to work with the Library by being compiled or linked with it, is called a "work that uses the Library". Such a work, in isolation, is not a derivative work of the Library, and therefore falls outside the scope of this License. + +However, linking a "work that uses the Library" with the Library creates an executable that is a derivative of the Library (because it contains portions of the Library), rather than a "work that uses the library". The executable is therefore covered by this License. Section 6 states terms for distribution of such executables. + +When a "work that uses the Library" uses material from a header file that is part of the Library, the object code for the work may be a derivative work of the Library even though the source code is not. Whether this is true is especially significant if the work can be linked without the Library, or if the work is itself a library. The threshold for this to be true is not precisely defined by law. + +If such an object file uses only numerical parameters, data structure layouts and accessors, and small macros and small inline functions (ten lines or less in length), then the use of the object file is unrestricted, regardless of whether it is legally a derivative work. (Executables containing this object code plus portions of the Library will still fall under Section 6.) + +Otherwise, if the work is a derivative of the Library, you may distribute the object code for the work under the terms of Section 6. Any executables containing that work also fall under Section 6, whether or not they are linked directly with the Library itself. + +6. As an exception to the Sections above, you may also combine or link a "work that uses the Library" with the Library to produce a work containing portions of the Library, and distribute that work under terms of your choice, provided that the terms permit modification of the work for the customer's own use and reverse engineering for debugging such modifications. + +You must give prominent notice with each copy of the work that the Library is used in it and that the Library and its use are covered by this License. You must supply a copy of this License. If the work during execution displays copyright notices, you must include the copyright notice for the Library among them, as well as a reference directing the user to the copy of this License. Also, you must do one of these things: + +a) Accompany the work with the complete corresponding machine-readable source code for the Library including whatever changes were used in the work (which must be distributed under Sections 1 and 2 above); and, if the work is an executable linked with the Library, with the complete machine-readable "work that uses the Library", as object code and/or source code, so that the user can modify the Library and then relink to produce a modified executable containing the modified Library. (It is understood that the user who changes the contents of definitions files in the Library will not necessarily be able to recompile the application to use the modified definitions.) + +b) Use a suitable shared library mechanism for linking with the Library. A suitable mechanism is one that (1) uses at run time a copy of the library already present on the user's computer system, rather than copying library functions into the executable, and (2) will operate properly with a modified version of the library, if the user installs one, as long as the modified version is interface-compatible with the version that the work was made with. + +c) Accompany the work with a written offer, valid for at least three years, to give the same user the materials specified in Subsection 6a, above, for a charge no more than the cost of performing this distribution. + +d) If distribution of the work is made by offering access to copy from a designated place, offer equivalent access to copy the above specified materials from the same place. + +e) Verify that the user has already received a copy of these materials or that you have already sent this user a copy. + +For an executable, the required form of the "work that uses the Library" must include any data and utility programs needed for reproducing the executable from it. However, as a special exception, the materials to be distributed need not include anything that is normally distributed (in either source or binary form) with the major components (compiler, kernel, and so on) of the operating system on which the executable runs, unless that component itself accompanies the executable. + +It may happen that this requirement contradicts the license restrictions of other proprietary libraries that do not normally accompany the operating system. Such a contradiction means you cannot use both them and the Library together in an executable that you distribute. + +7. You may place library facilities that are a work based on the Library side-by-side in a single library together with other library facilities not covered by this License, and distribute such a combined library, provided that the separate distribution of the work based on the Library and of the other library facilities is otherwise permitted, and provided that you do these two things: + +a) Accompany the combined library with a copy of the same work based on the Library, uncombined with any other library facilities. This must be distributed under the terms of the Sections above. + +b) Give prominent notice with the combined library of the fact that part of it is a work based on the Library, and explaining where to find the accompanying uncombined form of the same work. + +8. You may not copy, modify, sublicense, link with, or distribute the Library except as expressly provided under this License. Any attempt otherwise to copy, modify, sublicense, link with, or distribute the Library is void, and will automatically terminate your rights under this License. However, parties who have received copies, or rights, from you under this License will not have their licenses terminated so long as such parties remain in full compliance. + +9. You are not required to accept this License, since you have not signed it. However, nothing else grants you permission to modify or distribute the Library or its derivative works. These actions are prohibited by law if you do not accept this License. Therefore, by modifying or distributing the Library (or any work based on the Library), you indicate your acceptance of this License to do so, and all its terms and conditions for copying, distributing or modifying the Library or works based on it. + +10. Each time you redistribute the Library (or any work based on the Library), the recipient automatically receives a license from the original licensor to copy, distribute, link with or modify the Library subject to these terms and conditions. You may not impose any further restrictions on the recipients' exercise of the rights granted herein. You are not responsible for enforcing compliance by third parties with this License. + +11. If, as a consequence of a court judgment or allegation of patent infringement or for any other reason (not limited to patent issues), conditions are imposed on you (whether by court order, agreement or otherwise) that contradict the conditions of this License, they do not excuse you from the conditions of this License. If you cannot distribute so as to satisfy simultaneously your obligations under this License and any other pertinent obligations, then as a consequence you may not distribute the Library at all. For example, if a patent license would not permit royalty-free redistribution of the Library by all those who receive copies directly or indirectly through you, then the only way you could satisfy both it and this License would be to refrain entirely from distribution of the Library. + +If any portion of this section is held invalid or unenforceable under any particular circumstance, the balance of the section is intended to apply, and the section as a whole is intended to apply in other circumstances. + +It is not the purpose of this section to induce you to infringe any patents or other property right claims or to contest validity of any such claims; this section has the sole purpose of protecting the integrity of the free software distribution system which is implemented by public license practices. Many people have made generous contributions to the wide range of software distributed through that system in reliance on consistent application of that system; it is up to the author/donor to decide if he or she is willing to distribute software through any other system and a licensee cannot impose that choice. + +This section is intended to make thoroughly clear what is believed to be a consequence of the rest of this License. + +12. If the distribution and/or use of the Library is restricted in certain countries either by patents or by copyrighted interfaces, the original copyright holder who places the Library under this License may add an explicit geographical distribution limitation excluding those countries, so that distribution is permitted only in or among countries not thus excluded. In such case, this License incorporates the limitation as if written in the body of this License. + +13. The Free Software Foundation may publish revised and/or new versions of the Lesser General Public License from time to time. Such new versions will be similar in spirit to the present version, but may differ in detail to address new problems or concerns. + +Each version is given a distinguishing version number. If the Library specifies a version number of this License which applies to it and "any later version", you have the option of following the terms and conditions either of that version or of any later version published by the Free Software Foundation. If the Library does not specify a license version number, you may choose any version ever published by the Free Software Foundation. + +14. If you wish to incorporate parts of the Library into other free programs whose distribution conditions are incompatible with these, write to the author to ask for permission. For software which is copyrighted by the Free Software Foundation, write to the Free Software Foundation; we sometimes make exceptions for this. Our decision will be guided by the two goals of preserving the free status of all derivatives of our free software and of promoting the sharing and reuse of software generally. + +NO WARRANTY + +15. BECAUSE THE LIBRARY IS LICENSED FREE OF CHARGE, THERE IS NO WARRANTY FOR THE LIBRARY, TO THE EXTENT PERMITTED BY APPLICABLE LAW. EXCEPT WHEN OTHERWISE STATED IN WRITING THE COPYRIGHT HOLDERS AND/OR OTHER PARTIES PROVIDE THE LIBRARY "AS IS" WITHOUT WARRANTY OF ANY KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE. THE ENTIRE RISK AS TO THE QUALITY AND PERFORMANCE OF THE LIBRARY IS WITH YOU. SHOULD THE LIBRARY PROVE DEFECTIVE, YOU ASSUME THE COST OF ALL NECESSARY SERVICING, REPAIR OR CORRECTION. + +16. IN NO EVENT UNLESS REQUIRED BY APPLICABLE LAW OR AGREED TO IN WRITING WILL ANY COPYRIGHT HOLDER, OR ANY OTHER PARTY WHO MAY MODIFY AND/OR REDISTRIBUTE THE LIBRARY AS PERMITTED ABOVE, BE LIABLE TO YOU FOR DAMAGES, INCLUDING ANY GENERAL, SPECIAL, INCIDENTAL OR CONSEQUENTIAL DAMAGES ARISING OUT OF THE USE OR INABILITY TO USE THE LIBRARY (INCLUDING BUT NOT LIMITED TO LOSS OF DATA OR DATA BEING RENDERED INACCURATE OR LOSSES SUSTAINED BY YOU OR THIRD PARTIES OR A FAILURE OF THE LIBRARY TO OPERATE WITH ANY OTHER SOFTWARE), EVEN IF SUCH HOLDER OR OTHER PARTY HAS BEEN ADVISED OF THE POSSIBILITY OF SUCH DAMAGES. + +END OF TERMS AND CONDITIONS + Property changes on: pal-portal/modules/ant-installer/trunk/demo/installclasspath/resources/GPL.txt ___________________________________________________________________ Name: svn:eol-style + native Added: pal-portal/modules/ant-installer/trunk/demo/installclasspath/resources/gkmain_inv.png =================================================================== (Binary files differ) Property changes on: pal-portal/modules/ant-installer/trunk/demo/installclasspath/resources/gkmain_inv.png ___________________________________________________________________ Name: svn:mime-type + image/png Added: pal-portal/modules/ant-installer/trunk/demo/installclasspath/resources/greens.png =================================================================== (Binary files differ) Property changes on: pal-portal/modules/ant-installer/trunk/demo/installclasspath/resources/greens.png ___________________________________________________________________ Name: svn:mime-type + image/png Added: pal-portal/modules/ant-installer/trunk/demo/installclasspath/resources/rockstiles.png =================================================================== (Binary files differ) Property changes on: pal-portal/modules/ant-installer/trunk/demo/installclasspath/resources/rockstiles.png ___________________________________________________________________ Name: svn:mime-type + image/png Added: pal-portal/modules/ant-installer/trunk/demo/installer/antinstall-config.xml =================================================================== --- pal-portal/modules/ant-installer/trunk/demo/installer/antinstall-config.xml (rev 0) +++ pal-portal/modules/ant-installer/trunk/demo/installer/antinstall-config.xml 2008-06-11 13:36:41 UTC (rev 975) @@ -0,0 +1,133 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + Property changes on: pal-portal/modules/ant-installer/trunk/demo/installer/antinstall-config.xml ___________________________________________________________________ Name: svn:eol-style + native Added: pal-portal/modules/ant-installer/trunk/demo/installer/build.xml =================================================================== --- pal-portal/modules/ant-installer/trunk/demo/installer/build.xml (rev 0) +++ pal-portal/modules/ant-installer/trunk/demo/installer/build.xml 2008-06-11 13:36:41 UTC (rev 975) @@ -0,0 +1,107 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + Property changes on: pal-portal/modules/ant-installer/trunk/demo/installer/build.xml ___________________________________________________________________ Name: svn:eol-style + native Added: pal-portal/modules/ant-installer/trunk/demo/src/org/tp23/demo/Demonstration.java =================================================================== --- pal-portal/modules/ant-installer/trunk/demo/src/org/tp23/demo/Demonstration.java (rev 0) +++ pal-portal/modules/ant-installer/trunk/demo/src/org/tp23/demo/Demonstration.java 2008-06-11 13:36:41 UTC (rev 975) @@ -0,0 +1,85 @@ +package org.tp23.demo; + +import java.io.File; +import java.io.FileInputStream; +import java.io.FileNotFoundException; +import java.io.IOException; +import java.io.InputStream; +import java.util.Iterator; +import java.util.Properties; + +import javax.swing.ImageIcon; +import javax.swing.JOptionPane; +import javax.swing.JFrame; + +/** + * + *

Title: Example Application

+ *

Description: Prints Hello World, trys to do it in a pop up box +* if a Throwable is thrown (e.g. no X) it prints to System.out

+ *

Copyright: Copyright (c) 2004

+ *

Company: tp23

+ * @author Paul Hinds + * @version 1.0 + */ +public class Demonstration { + private static ImageIcon icon ; + static{ + try { + InputStream in = Demonstration.class.getResourceAsStream("/resources/demo.png"); + byte[] data = new byte[11437]; + for (int i = 0; i < data.length; i++) { + data[i]=(byte)in.read(); + } + icon = new ImageIcon(data); + } + catch (IOException e) { + e.printStackTrace(); + } + } + + public static void main(String[] args) { + try{ + JOptionPane.showMessageDialog(null, + "Demo Application \n\n" + + "Deployed with: "+ + "http://antinstaller.sourceforge.net \n" + + "Built by: "+ + "http://ant.apache.org \n" + + "See also: "+ + "http://httpfileserver.sourceforge.net \n\n" + + "This project is Apache licensed \n\n" + + "Properties selected while installing \n\n" + + initProps(), + "About - Demo App", + JOptionPane.INFORMATION_MESSAGE, + icon); + }catch(Throwable t){ + System.out.println("Hello World"); + } + System.exit(0); + } + private static String initProps() { + StringBuffer userProperties = new StringBuffer(); + try { + Properties props = new Properties(); + props.load(new FileInputStream(new File("./config/demo.properties"))); + Iterator iter = props.keySet().iterator(); + while(iter.hasNext()){ + String key = (String)iter.next(); + userProperties.append(key) + .append("=") + .append(props.getProperty(key)) + .append('\n'); + } + } + catch (FileNotFoundException e) { + e.printStackTrace(); + } + catch (IOException e) { + e.printStackTrace(); + } + return userProperties.toString(); + } + +} Property changes on: pal-portal/modules/ant-installer/trunk/demo/src/org/tp23/demo/Demonstration.java ___________________________________________________________________ Name: svn:eol-style + native Added: pal-portal/modules/ant-installer/trunk/demo/src/resources/demo.png =================================================================== (Binary files differ) Property changes on: pal-portal/modules/ant-installer/trunk/demo/src/resources/demo.png ___________________________________________________________________ Name: svn:mime-type + image/png Added: pal-portal/modules/ant-installer/trunk/icons/128x128/apps/AntInstaller.png =================================================================== (Binary files differ) Property changes on: pal-portal/modules/ant-installer/trunk/icons/128x128/apps/AntInstaller.png ___________________________________________________________________ Name: svn:mime-type + image/png Added: pal-portal/modules/ant-installer/trunk/icons/16x16/apps/AntInstaller.png =================================================================== (Binary files differ) Property changes on: pal-portal/modules/ant-installer/trunk/icons/16x16/apps/AntInstaller.png ___________________________________________________________________ Name: svn:mime-type + image/png Added: pal-portal/modules/ant-installer/trunk/icons/22x22/apps/AntInstaller.png =================================================================== (Binary files differ) Property changes on: pal-portal/modules/ant-installer/trunk/icons/22x22/apps/AntInstaller.png ___________________________________________________________________ Name: svn:mime-type + image/png Added: pal-portal/modules/ant-installer/trunk/icons/24x24/AntInstaller.ico =================================================================== (Binary files differ) Property changes on: pal-portal/modules/ant-installer/trunk/icons/24x24/AntInstaller.ico ___________________________________________________________________ Name: svn:mime-type + image/x-icon Added: pal-portal/modules/ant-installer/trunk/icons/24x24/apps/AntInstaller.png =================================================================== (Binary files differ) Property changes on: pal-portal/modules/ant-installer/trunk/icons/24x24/apps/AntInstaller.png ___________________________________________________________________ Name: svn:mime-type + image/png Added: pal-portal/modules/ant-installer/trunk/icons/32x32/apps/AntInstaller.png =================================================================== (Binary files differ) Property changes on: pal-portal/modules/ant-installer/trunk/icons/32x32/apps/AntInstaller.png ___________________________________________________________________ Name: svn:mime-type + image/png Added: pal-portal/modules/ant-installer/trunk/icons/48x48/AntInstaller.png =================================================================== (Binary files differ) Property changes on: pal-portal/modules/ant-installer/trunk/icons/48x48/AntInstaller.png ___________________________________________________________________ Name: svn:mime-type + image/png Added: pal-portal/modules/ant-installer/trunk/icons/48x48/apps/AntInstaller.png =================================================================== (Binary files differ) Property changes on: pal-portal/modules/ant-installer/trunk/icons/48x48/apps/AntInstaller.png ___________________________________________________________________ Name: svn:mime-type + image/png Added: pal-portal/modules/ant-installer/trunk/icons/64x64/apps/AntInstaller.png =================================================================== (Binary files differ) Property changes on: pal-portal/modules/ant-installer/trunk/icons/64x64/apps/AntInstaller.png ___________________________________________________________________ Name: svn:mime-type + image/png Added: pal-portal/modules/ant-installer/trunk/images/AntInstaller-text-logo-50.png =================================================================== (Binary files differ) Property changes on: pal-portal/modules/ant-installer/trunk/images/AntInstaller-text-logo-50.png ___________________________________________________________________ Name: svn:mime-type + image/png Added: pal-portal/modules/ant-installer/trunk/images/AntInstaller-text-logo-bw.png =================================================================== (Binary files differ) Property changes on: pal-portal/modules/ant-installer/trunk/images/AntInstaller-text-logo-bw.png ___________________________________________________________________ Name: svn:mime-type + image/png Added: pal-portal/modules/ant-installer/trunk/images/AntInstaller-text-logo-onwhite.png =================================================================== (Binary files differ) Property changes on: pal-portal/modules/ant-installer/trunk/images/AntInstaller-text-logo-onwhite.png ___________________________________________________________________ Name: svn:mime-type + image/png Added: pal-portal/modules/ant-installer/trunk/images/AntInstaller-text-logo.png =================================================================== (Binary files differ) Property changes on: pal-portal/modules/ant-installer/trunk/images/AntInstaller-text-logo.png ___________________________________________________________________ Name: svn:mime-type + image/png Added: pal-portal/modules/ant-installer/trunk/images/README.txt =================================================================== --- pal-portal/modules/ant-installer/trunk/images/README.txt (rev 0) +++ pal-portal/modules/ant-installer/trunk/images/README.txt 2008-06-11 13:36:41 UTC (rev 975) @@ -0,0 +1,21 @@ +AntInstaller Image Readme + + +This pack is spearate from the main AntInstaller download +for two reasons +1) to keep the size of the ant-installer.jar down +2) to allow inclusion of the (excelent) crystal icons +licensed under LGPL + +All default Icons and images are licensed under Apache2.0 + by Paul Hinds + +Crystal Icons + http://www.everaldo.com/crystal.html + +N.B. everaldo produces comercial icons as well it should +not be assumed that everaldo icons are LGPL generally. +Icons in this pack are based on icons included with KDE +which are LGPL. +Personal/Business contact with everaldo send direct +e-mail to everaldo @ everaldo.com \ No newline at end of file Property changes on: pal-portal/modules/ant-installer/trunk/images/README.txt ___________________________________________________________________ Name: svn:eol-style + native Added: pal-portal/modules/ant-installer/trunk/images/extract-images/crystal/extract-image.png =================================================================== (Binary files differ) Property changes on: pal-portal/modules/ant-installer/trunk/images/extract-images/crystal/extract-image.png ___________________________________________________________________ Name: svn:mime-type + image/png Added: pal-portal/modules/ant-installer/trunk/images/extract-images/crystal-images.txt =================================================================== --- pal-portal/modules/ant-installer/trunk/images/extract-images/crystal-images.txt (rev 0) +++ pal-portal/modules/ant-installer/trunk/images/extract-images/crystal-images.txt 2008-06-11 13:36:41 UTC (rev 975) @@ -0,0 +1,4 @@ +Crystal Icons from KDE install + +http://www.everaldo.com/crystal.html +License : LGPL \ No newline at end of file Property changes on: pal-portal/modules/ant-installer/trunk/images/extract-images/crystal-images.txt ___________________________________________________________________ Name: svn:eol-style + native Added: pal-portal/modules/ant-installer/trunk/images/extract-images/crystal2/extract-image.png =================================================================== (Binary files differ) Property changes on: pal-portal/modules/ant-installer/trunk/images/extract-images/crystal2/extract-image.png ___________________________________________________________________ Name: svn:mime-type + image/png Added: pal-portal/modules/ant-installer/trunk/images/extract-images/crystal3/extract-image.png =================================================================== (Binary files differ) Property changes on: pal-portal/modules/ant-installer/trunk/images/extract-images/crystal3/extract-image.png ___________________________________________________________________ Name: svn:mime-type + image/png Added: pal-portal/modules/ant-installer/trunk/images/extract-images/default/extract-image.png =================================================================== (Binary files differ) Property changes on: pal-portal/modules/ant-installer/trunk/images/extract-images/default/extract-image.png ___________________________________________________________________ Name: svn:mime-type + image/png Added: pal-portal/modules/ant-installer/trunk/images/extract-images/default-images.txt =================================================================== --- pal-portal/modules/ant-installer/trunk/images/extract-images/default-images.txt (rev 0) +++ pal-portal/modules/ant-installer/trunk/images/extract-images/default-images.txt 2008-06-11 13:36:41 UTC (rev 975) @@ -0,0 +1,5 @@ +Default Icons: Paul Hinds + +http://java.riereta.net + +License: Apache 2.0 \ No newline at end of file Property changes on: pal-portal/modules/ant-installer/trunk/images/extract-images/default-images.txt ___________________________________________________________________ Name: svn:eol-style + native Added: pal-portal/modules/ant-installer/trunk/images/navicons/amaranth/resources/icons/LICENSE =================================================================== --- pal-portal/modules/ant-installer/trunk/images/navicons/amaranth/resources/icons/LICENSE (rev 0) +++ pal-portal/modules/ant-installer/trunk/images/navicons/amaranth/resources/icons/LICENSE 2008-06-11 13:36:41 UTC (rev 975) @@ -0,0 +1,505 @@ + GNU LESSER GENERAL PUBLIC LICENSE + Version 2.1, February 1999 + + Copyright (C) 1991, 1999 Free Software Foundation, Inc. + 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA + Everyone is permitted to copy and distribute verbatim copies + of this license document, but changing it is not allowed. + +[This is the first released version of the Lesser GPL. It also counts + as the successor of the GNU Library Public License, version 2, hence + the version number 2.1.] + + Preamble + + The licenses for most software are designed to take away your +freedom to share and change it. By contrast, the GNU General Public +Licenses are intended to guarantee your freedom to share and change +free software--to make sure the software is free for all its users. + + This license, the Lesser General Public License, applies to some +specially designated software packages--typically libraries--of the +Free Software Foundation and other authors who decide to use it. You +can use it too, but we suggest you first think carefully about whether +this license or the ordinary General Public License is the better +strategy to use in any particular case, based on the explanations below. + + When we speak of free software, we are referring to freedom of use, +not price. Our General Public Licenses are designed to make sure that +you have the freedom to distribute copies of free software (and charge +for this service if you wish); that you receive source code or can get +it if you want it; that you can change the software and use pieces of +it in new free programs; and that you are informed that you can do +these things. + + To protect your rights, we need to make restrictions that forbid +distributors to deny you these rights or to ask you to surrender these +rights. These restrictions translate to certain responsibilities for +you if you distribute copies of the library or if you modify it. + + For example, if you distribute copies of the library, whether gratis +or for a fee, you must give the recipients all the rights that we gave +you. You must make sure that they, too, receive or can get the source +code. If you link other code with the library, you must provide +complete object files to the recipients, so that they can relink them +with the library after making changes to the library and recompiling +it. And you must show them these terms so they know their rights. + + We protect your rights with a two-step method: (1) we copyright the +library, and (2) we offer you this license, which gives you legal +permission to copy, distribute and/or modify the library. + + To protect each distributor, we want to make it very clear that +there is no warranty for the free library. Also, if the library is +modified by someone else and passed on, the recipients should know +that what they have is not the original version, so that the original +author's reputation will not be affected by problems that might be +introduced by others. + + Finally, software patents pose a constant threat to the existence of +any free program. We wish to make sure that a company cannot +effectively restrict the users of a free program by obtaining a +restrictive license from a patent holder. Therefore, we insist that +any patent license obtained for a version of the library must be +consistent with the full freedom of use specified in this license. + + Most GNU software, including some libraries, is covered by the +ordinary GNU General Public License. This license, the GNU Lesser +General Public License, applies to certain designated libraries, and +is quite different from the ordinary General Public License. We use +this license for certain libraries in order to permit linking those +libraries into non-free programs. + + When a program is linked with a library, whether statically or using +a shared library, the combination of the two is legally speaking a +combined work, a derivative of the original library. The ordinary +General Public License therefore permits such linking only if the +entire combination fits its criteria of freedom. The Lesser General +Public License permits more lax criteria for linking other code with +the library. + + We call this license the "Lesser" General Public License because it +does Less to protect the user's freedom than the ordinary General +Public License. It also provides other free software developers Less +of an advantage over competing non-free programs. These disadvantages +are the reason we use the ordinary General Public License for many +libraries. However, the Lesser license provides advantages in certain +special circumstances. + + For example, on rare occasions, there may be a special need to +encourage the widest possible use of a certain library, so that it becomes +a de-facto standard. To achieve this, non-free programs must be +allowed to use the library. A more frequent case is that a free +library does the same job as widely used non-free libraries. In this +case, there is little to gain by limiting the free library to free +software only, so we use the Lesser General Public License. + + In other cases, permission to use a particular library in non-free +programs enables a greater number of people to use a large body of +free software. For example, permission to use the GNU C Library in +non-free programs enables many more people to use the whole GNU +operating system, as well as its variant, the GNU/Linux operating +system. + + Although the Lesser General Public License is Less protective of the +users' freedom, it does ensure that the user of a program that is +linked with the Library has the freedom and the wherewithal to run +that program using a modified version of the Library. + + The precise terms and conditions for copying, distribution and +modification follow. Pay close attention to the difference between a +"work based on the library" and a "work that uses the library". The +former contains code derived from the library, whereas the latter must +be combined with the library in order to run. + + GNU LESSER GENERAL PUBLIC LICENSE + TERMS AND CONDITIONS FOR COPYING, DISTRIBUTION AND MODIFICATION + + 0. This License Agreement applies to any software library or other +program which contains a notice placed by the copyright holder or +other authorized party saying it may be distributed under the terms of +this Lesser General Public License (also called "this License"). +Each licensee is addressed as "you". + + A "library" means a collection of software functions and/or data +prepared so as to be conveniently linked with application programs +(which use some of those functions and data) to form executables. + + The "Library", below, refers to any such software library or work +which has been distributed under these terms. A "work based on the +Library" means either the Library or any derivative work under +copyright law: that is to say, a work containing the Library or a +portion of it, either verbatim or with modifications and/or translated +straightforwardly into another language. (Hereinafter, translation is +included without limitation in the term "modification".) + + "Source code" for a work means the preferred form of the work for +making modifications to it. For a library, complete source code means +all the source code for all modules it contains, plus any associated +interface definition files, plus the scripts used to control compilation +and installation of the library. + + Activities other than copying, distribution and modification are not +covered by this License; they are outside its scope. The act of +running a program using the Library is not restricted, and output from +such a program is covered only if its contents constitute a work based +on the Library (independent of the use of the Library in a tool for +writing it). Whether that is true depends on what the Library does +and what the program that uses the Library does. + + 1. You may copy and distribute verbatim copies of the Library's +complete source code as you receive it, in any medium, provided that +you conspicuously and appropriately publish on each copy an +appropriate copyright notice and disclaimer of warranty; keep intact +all the notices that refer to this License and to the absence of any +warranty; and distribute a copy of this License along with the +Library. + + You may charge a fee for the physical act of transferring a copy, +and you may at your option offer warranty protection in exchange for a +fee. + + 2. You may modify your copy or copies of the Library or any portion +of it, thus forming a work based on the Library, and copy and +distribute such modifications or work under the terms of Section 1 +above, provided that you also meet all of these conditions: + + a) The modified work must itself be a software library. + + b) You must cause the files modified to carry prominent notices + stating that you changed the files and the date of any change. + + c) You must cause the whole of the work to be licensed at no + charge to all third parties under the terms of this License. + + d) If a facility in the modified Library refers to a function or a + table of data to be supplied by an application program that uses + the facility, other than as an argument passed when the facility + is invoked, then you must make a good faith effort to ensure that, + in the event an application does not supply such function or + table, the facility still operates, and performs whatever part of + its purpose remains meaningful. + + (For example, a function in a library to compute square roots has + a purpose that is entirely well-defined independent of the + application. Therefore, Subsection 2d requires that any + application-supplied function or table used by this function must + be optional: if the application does not supply it, the square + root function must still compute square roots.) + +These requirements apply to the modified work as a whole. If +identifiable sections of that work are not derived from the Library, +and can be reasonably considered independent and separate works in +themselves, then this License, and its terms, do not apply to those +sections when you distribute them as separate works. But when you +distribute the same sections as part of a whole which is a work based +on the Library, the distribution of the whole must be on the terms of +this License, whose permissions for other licensees extend to the +entire whole, and thus to each and every part regardless of who wrote +it. + +Thus, it is not the intent of this section to claim rights or contest +your rights to work written entirely by you; rather, the intent is to +exercise the right to control the distribution of derivative or +collective works based on the Library. + +In addition, mere aggregation of another work not based on the Library +with the Library (or with a work based on the Library) on a volume of +a storage or distribution medium does not bring the other work under +the scope of this License. + + 3. You may opt to apply the terms of the ordinary GNU General Public +License instead of this License to a given copy of the Library. To do +this, you must alter all the notices that refer to this License, so +that they refer to the ordinary GNU General Public License, version 2, +instead of to this License. (If a newer version than version 2 of the +ordinary GNU General Public License has appeared, then you can specify +that version instead if you wish.) Do not make any other change in +these notices. + + Once this change is made in a given copy, it is irreversible for +that copy, so the ordinary GNU General Public License applies to all +subsequent copies and derivative works made from that copy. + + This option is useful when you wish to copy part of the code of +the Library into a program that is not a library. + + 4. You may copy and distribute the Library (or a portion or +derivative of it, under Section 2) in object code or executable form +under the terms of Sections 1 and 2 above provided that you accompany +it with the complete corresponding machine-readable source code, which +must be distributed under the terms of Sections 1 and 2 above on a +medium customarily used for software interchange. + + If distribution of object code is made by offering access to copy +from a designated place, then offering equivalent access to copy the +source code from the same place satisfies the requirement to +distribute the source code, even though third parties are not +compelled to copy the source along with the object code. + + 5. A program that contains no derivative of any portion of the +Library, but is designed to work with the Library by being compiled or +linked with it, is called a "work that uses the Library". Such a +work, in isolation, is not a derivative work of the Library, and +therefore falls outside the scope of this License. + + However, linking a "work that uses the Library" with the Library +creates an executable that is a derivative of the Library (because it +contains portions of the Library), rather than a "work that uses the +library". The executable is therefore covered by this License. +Section 6 states terms for distribution of such executables. + + When a "work that uses the Library" uses material from a header file +that is part of the Library, the object code for the work may be a +derivative work of the Library even though the source code is not. +Whether this is true is especially significant if the work can be +linked without the Library, or if the work is itself a library. The +threshold for this to be true is not precisely defined by law. + + If such an object file uses only numerical parameters, data +structure layouts and accessors, and small macros and small inline +functions (ten lines or less in length), then the use of the object +file is unrestricted, regardless of whether it is legally a derivative +work. (Executables containing this object code plus portions of the +Library will still fall under Section 6.) + + Otherwise, if the work is a derivative of the Library, you may +distribute the object code for the work under the terms of Section 6. +Any executables containing that work also fall under Section 6, +whether or not they are linked directly with the Library itself. + + 6. As an exception to the Sections above, you may also combine or +link a "work that uses the Library" with the Library to produce a +work containing portions of the Library, and distribute that work +under terms of your choice, provided that the terms permit +modification of the work for the customer's own use and reverse +engineering for debugging such modifications. + + You must give prominent notice with each copy of the work that the +Library is used in it and that the Library and its use are covered by +this License. You must supply a copy of this License. If the work +during execution displays copyright notices, you must include the +copyright notice for the Library among them, as well as a reference +directing the user to the copy of this License. Also, you must do one +of these things: + + a) Accompany the work with the complete corresponding + machine-readable source code for the Library including whatever + changes were used in the work (which must be distributed under + Sections 1 and 2 above); and, if the work is an executable linked + with the Library, with the complete machine-readable "work that + uses the Library", as object code and/or source code, so that the + user can modify the Library and then relink to produce a modified + executable containing the modified Library. (It is understood + that the user who changes the contents of definitions files in the + Library will not necessarily be able to recompile the application + to use the modified definitions.) + + b) Use a suitable shared library mechanism for linking with the + Library. A suitable mechanism is one that (1) uses at run time a + copy of the library already present on the user's computer system, + rather than copying library functions into the executable, and (2) + will operate properly with a modified version of the library, if + the user installs one, as long as the modified version is + interface-compatible with the version that the work was made with. + + c) Accompany the work with a written offer, valid for at + least three years, to give the same user the materials + specified in Subsection 6a, above, for a charge no more + than the cost of performing this distribution. + + d) If distribution of the work is made by offering access to copy + from a designated place, offer equivalent access to copy the above + specified materials from the same place. + + e) Verify that the user has already received a copy of these + materials or that you have already sent this user a copy. + + For an executable, the required form of the "work that uses the +Library" must include any data and utility programs needed for +reproducing the executable from it. However, as a special exception, +the materials to be distributed need not include anything that is +normally distributed (in either source or binary form) with the major +components (compiler, kernel, and so on) of the operating system on +which the executable runs, unless that component itself accompanies +the executable. + + It may happen that this requirement contradicts the license +restrictions of other proprietary libraries that do not normally +accompany the operating system. Such a contradiction means you cannot +use both them and the Library together in an executable that you +distribute. + + 7. You may place library facilities that are a work based on the +Library side-by-side in a single library together with other library +facilities not covered by this License, and distribute such a combined +library, provided that the separate distribution of the work based on +the Library and of the other library facilities is otherwise +permitted, and provided that you do these two things: + + a) Accompany the combined library with a copy of the same work + based on the Library, uncombined with any other library + facilities. This must be distributed under the terms of the + Sections above. + + b) Give prominent notice with the combined library of the fact + that part of it is a work based on the Library, and explaining + where to find the accompanying uncombined form of the same work. + + 8. You may not copy, modify, sublicense, link with, or distribute +the Library except as expressly provided under this License. Any +attempt otherwise to copy, modify, sublicense, link with, or +distribute the Library is void, and will automatically terminate your +rights under this License. However, parties who have received copies, +or rights, from you under this License will not have their licenses +terminated so long as such parties remain in full compliance. + + 9. You are not required to accept this License, since you have not +signed it. However, nothing else grants you permission to modify or +distribute the Library or its derivative works. These actions are +prohibited by law if you do not accept this License. Therefore, by +modifying or distributing the Library (or any work based on the +Library), you indicate your acceptance of this License to do so, and +all its terms and conditions for copying, distributing or modifying +the Library or works based on it. + + 10. Each time you redistribute the Library (or any work based on the +Library), the recipient automatically receives a license from the +original licensor to copy, distribute, link with or modify the Library +subject to these terms and conditions. You may not impose any further +restrictions on the recipients' exercise of the rights granted herein. +You are not responsible for enforcing compliance by third parties with +this License. + + 11. If, as a consequence of a court judgment or allegation of patent +infringement or for any other reason (not limited to patent issues), +conditions are imposed on you (whether by court order, agreement or +otherwise) that contradict the conditions of this License, they do not +excuse you from the conditions of this License. If you cannot +distribute so as to satisfy simultaneously your obligations under this +License and any other pertinent obligations, then as a consequence you +may not distribute the Library at all. For example, if a patent +license would not permit royalty-free redistribution of the Library by +all those who receive copies directly or indirectly through you, then +the only way you could satisfy both it and this License would be to +refrain entirely from distribution of the Library. + +If any portion of this section is held invalid or unenforceable under any +particular circumstance, the balance of the section is intended to apply, +and the section as a whole is intended to apply in other circumstances. + +It is not the purpose of this section to induce you to infringe any +patents or other property right claims or to contest validity of any +such claims; this section has the sole purpose of protecting the +integrity of the free software distribution system which is +implemented by public license practices. Many people have made +generous contributions to the wide range of software distributed +through that system in reliance on consistent application of that +system; it is up to the author/donor to decide if he or she is willing +to distribute software through any other system and a licensee cannot +impose that choice. + +This section is intended to make thoroughly clear what is believed to +be a consequence of the rest of this License. + + 12. If the distribution and/or use of the Library is restricted in +certain countries either by patents or by copyrighted interfaces, the +original copyright holder who places the Library under this License may add +an explicit geographical distribution limitation excluding those countries, +so that distribution is permitted only in or among countries not thus +excluded. In such case, this License incorporates the limitation as if +written in the body of this License. + + 13. The Free Software Foundation may publish revised and/or new +versions of the Lesser General Public License from time to time. +Such new versions will be similar in spirit to the present version, +but may differ in detail to address new problems or concerns. + +Each version is given a distinguishing version number. If the Library +specifies a version number of this License which applies to it and +"any later version", you have the option of following the terms and +conditions either of that version or of any later version published by +the Free Software Foundation. If the Library does not specify a +license version number, you may choose any version ever published by +the Free Software Foundation. + + 14. If you wish to incorporate parts of the Library into other free +programs whose distribution conditions are incompatible with these, +write to the author to ask for permission. For software which is +copyrighted by the Free Software Foundation, write to the Free +Software Foundation; we sometimes make exceptions for this. Our +decision will be guided by the two goals of preserving the free status +of all derivatives of our free software and of promoting the sharing +and reuse of software generally. + + NO WARRANTY + + 15. BECAUSE THE LIBRARY IS LICENSED FREE OF CHARGE, THERE IS NO +WARRANTY FOR THE LIBRARY, TO THE EXTENT PERMITTED BY APPLICABLE LAW. +EXCEPT WHEN OTHERWISE STATED IN WRITING THE COPYRIGHT HOLDERS AND/OR +OTHER PARTIES PROVIDE THE LIBRARY "AS IS" WITHOUT WARRANTY OF ANY +KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING, BUT NOT LIMITED TO, THE +IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR +PURPOSE. THE ENTIRE RISK AS TO THE QUALITY AND PERFORMANCE OF THE +LIBRARY IS WITH YOU. SHOULD THE LIBRARY PROVE DEFECTIVE, YOU ASSUME +THE COST OF ALL NECESSARY SERVICING, REPAIR OR CORRECTION. + + 16. IN NO EVENT UNLESS REQUIRED BY APPLICABLE LAW OR AGREED TO IN +WRITING WILL ANY COPYRIGHT HOLDER, OR ANY OTHER PARTY WHO MAY MODIFY +AND/OR REDISTRIBUTE THE LIBRARY AS PERMITTED ABOVE, BE LIABLE TO YOU +FOR DAMAGES, INCLUDING ANY GENERAL, SPECIAL, INCIDENTAL OR +CONSEQUENTIAL DAMAGES ARISING OUT OF THE USE OR INABILITY TO USE THE +LIBRARY (INCLUDING BUT NOT LIMITED TO LOSS OF DATA OR DATA BEING +RENDERED INACCURATE OR LOSSES SUSTAINED BY YOU OR THIRD PARTIES OR A +FAILURE OF THE LIBRARY TO OPERATE WITH ANY OTHER SOFTWARE), EVEN IF +SUCH HOLDER OR OTHER PARTY HAS BEEN ADVISED OF THE POSSIBILITY OF SUCH +DAMAGES. + + END OF TERMS AND CONDITIONS + + How to Apply These Terms to Your New Libraries + + If you develop a new library, and you want it to be of the greatest +possible use to the public, we recommend making it free software that +everyone can redistribute and change. You can do so by permitting +redistribution under these terms (or, alternatively, under the terms of the +ordinary General Public License). + + To apply these terms, attach the following notices to the library. It is +safest to attach them to the start of each source file to most effectively +convey the exclusion of warranty; and each file should have at least the +"copyright" line and a pointer to where the full notice is found. + + + Copyright (C) + + This library is free software; you can redistribute it and/or + modify it under the terms of the GNU Lesser General Public + License as published by the Free Software Foundation; either + version 2.1 of the License, or (at your option) any later version. + + This library 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 for more details. + + You should have received a copy of the GNU Lesser General Public + License along with this library; if not, write to the Free Software + Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA + +Also add information on how to contact you by electronic and paper mail. + +You should also get your employer (if you work as a programmer) or your +school, if any, to sign a "copyright disclaimer" for the library, if +necessary. Here is a sample; alter the names: + + Yoyodyne, Inc., hereby disclaims all copyright interest in the + library `Frob' (a library for tweaking knobs) written by James Random Hacker. + + , 1 April 1990 + Ty Coon, President of Vice + +That's all there is to it! + + + Added: pal-portal/modules/ant-installer/trunk/images/navicons/amaranth/resources/icons/back.png =================================================================== (Binary files differ) Property changes on: pal-portal/modules/ant-installer/trunk/images/navicons/amaranth/resources/icons/back.png ___________________________________________________________________ Name: svn:mime-type + image/png Added: pal-portal/modules/ant-installer/trunk/images/navicons/amaranth/resources/icons/cancel.png =================================================================== (Binary files differ) Property changes on: pal-portal/modules/ant-installer/trunk/images/navicons/amaranth/resources/icons/cancel.png ___________________________________________________________________ Name: svn:mime-type + image/png Added: pal-portal/modules/ant-installer/trunk/images/navicons/amaranth/resources/icons/finish.png =================================================================== (Binary files differ) Property changes on: pal-portal/modules/ant-installer/trunk/images/navicons/amaranth/resources/icons/finish.png ___________________________________________________________________ Name: svn:mime-type + image/png Added: pal-portal/modules/ant-installer/trunk/images/navicons/amaranth/resources/icons/next.png =================================================================== (Binary files differ) Property changes on: pal-portal/modules/ant-installer/trunk/images/navicons/amaranth/resources/icons/next.png ___________________________________________________________________ Name: svn:mime-type + image/png Added: pal-portal/modules/ant-installer/trunk/images/navicons/amaranth/resources/icons/ok.png =================================================================== (Binary files differ) Property changes on: pal-portal/modules/ant-installer/trunk/images/navicons/amaranth/resources/icons/ok.png ___________________________________________________________________ Name: svn:mime-type + image/png Added: pal-portal/modules/ant-installer/trunk/images/navicons/amaranth/resources/icons/showdetails.png =================================================================== (Binary files differ) Property changes on: pal-portal/modules/ant-installer/trunk/images/navicons/amaranth/resources/icons/showdetails.png ___________________________________________________________________ Name: svn:mime-type + image/png Added: pal-portal/modules/ant-installer/trunk/images/navicons/bluecurve/resources/icons/LICENSE =================================================================== --- pal-portal/modules/ant-installer/trunk/images/navicons/bluecurve/resources/icons/LICENSE (rev 0) +++ pal-portal/modules/ant-installer/trunk/images/navicons/bluecurve/resources/icons/LICENSE 2008-06-11 13:36:41 UTC (rev 975) @@ -0,0 +1,56 @@ +The Fedora Project + +Individual Contributor License Agreement (CLA) + +[WWW] http://fedoraproject.org/wiki/Legal/Licenses/CLA + +Thank you for your interest in The Fedora Project (the "Project"). In order to clarify the intellectual property license granted with Contributions from any person or entity, Red Hat, Inc. ("Red Hat"), as maintainer of the Project, must have a Contributor License Agreement (CLA) on file that has been signed by each Contributor, indicating agreement to the license terms below. This license is for Your protection as a Contributor as well as the protection of the Project and its users; it does not change your rights to use your own Contributions for any other purpose. + +You and the Project hereby accept and agree to the following terms and conditions: + + * + + 1. Contributors and Contributions. + o + + A. The Project and any individual or legal entity that voluntarily submits to the Project a Contribution are collectively addressed herein as "Contributors". For legal entities, the entity making a Contribution and all other entities that control, are controlled by, or are under common control with that entity are considered to be a single Contributor. For the purposes of this definition, "control" means (i) the power, direct or indirect, to cause the direction or management of such entity, whether by contract or otherwise, or (ii) ownership of fifty percent (50%) or more of the outstanding shares, or (iii) beneficial ownership of such entity. + o + + B. A "Contribution" is any original work, including any modification or addition to an existing work, that has been submitted for inclusion in, or documentation of, any of the products owned or managed by the Project, where such work originates from that particular Contributor or from some entity acting on behalf of that Contributor. + o + + C. A Contribution is "submitted" when any form of electronic, verbal, or written communication is sent to the Project, including but not limited to communication on electronic mailing lists, source code control systems, and issue tracking systems that are managed by, or on behalf of, the Project for the purpose of discussing or improving software or documentation of the Project, but excluding communication that is conspicuously marked or otherwise designated in writing by you as "Not a Contribution." + o + + D. Any Contribution submitted by you to the Project shall be under the terms and conditions of this License, without any additional terms or conditions, unless you explicitly state otherwise in the submission. + * + + 2. Contributor Grant of License. You hereby grant to Red Hat, Inc., on behalf of the Project, and to recipients of software distributed by the Project: + o + + (a) a perpetual, non-exclusive, worldwide, fully paid-up, royalty free, irrevocable copyright license to reproduce, prepare derivative works of, publicly display, publicly perform, sublicense, and distribute your Contribution and such derivative works; and, + o + + (b) a perpetual, non-exclusive, worldwide, fully paid-up, royalty free, irrevocable (subject to Section 3) patent license to make, have made, use, offer to sell, sell, import, and otherwise transfer your Contribution and derivative works thereof, where such license applies only to those patent claims licensable by you that are necessarily infringed by your Contribution alone or by combination of your Contribution with the work to which you submitted the Contribution. Except for the license granted in this section, you reserve all right, title and interest in and to your Contributions. + * + + 3. Reciprocity. As of the date any such litigation is filed, your patent grant shall immediately terminate with respect to any party that institutes patent litigation against you (including a cross-claim or counterclaim in a lawsuit) alleging that your Contribution, or the work to which you have contributed, constitutes direct or contributory patent infringement. + * + + 4. You represent that you are legally entitled to grant the above license. If your employer(s) has rights to intellectual property that you create that includes your Contributions, you represent that you have received permission to make Contributions on behalf of that employer, that your employer has waived such rights for your Contributions to the Project, or that your employer has executed a separate Corporate CLA with the Project. + * + + 5. You represent that each of your Contributions is your original creation (see section 7 for submissions on behalf of others). You represent that your Contribution submission(s) include complete details of any third-party license or other restriction (including, but not limited to, related copyright, patents and trademarks) of which you are personally aware and which are associated with any part of your Contribution. + * + + 6. You are not expected to provide support for your Contributions, except to the extent you desire to provide support. You may provide support for free, for a fee, or not at all. Your Contributions are provided on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied, including, without limitation, any warranties or conditions of NON-INFRINGEMENT, MERCHANTABILITY, or FITNESS FOR A PARTICULAR PURPOSE. + * + + 7. Should you wish to submit work that is not your original creation, you may submit it to the Project separately from any Contribution, identifying the complete details of its source and of any license or other restriction (including, but not limited to, related patents, trademarks, and license agreements) of which you are personally aware, and conspicuously marking the work as "Submitted on behalf of a third-party: [named here]". + * + + 8. You agree to notify the Project of any facts or circumstances of which you become aware that would make these representations inaccurate in any respect. + * + + 9. The Project is under no obligations to accept and include every contribution. + Added: pal-portal/modules/ant-installer/trunk/images/navicons/bluecurve/resources/icons/back.png =================================================================== (Binary files differ) Property changes on: pal-portal/modules/ant-installer/trunk/images/navicons/bluecurve/resources/icons/back.png ___________________________________________________________________ Name: svn:mime-type + image/png Added: pal-portal/modules/ant-installer/trunk/images/navicons/bluecurve/resources/icons/cancel.png =================================================================== (Binary files differ) Property changes on: pal-portal/modules/ant-installer/trunk/images/navicons/bluecurve/resources/icons/cancel.png ___________________________________________________________________ Name: svn:mime-type + image/png Added: pal-portal/modules/ant-installer/trunk/images/navicons/bluecurve/resources/icons/finish.png =================================================================== (Binary files differ) Property changes on: pal-portal/modules/ant-installer/trunk/images/navicons/bluecurve/resources/icons/finish.png ___________________________________________________________________ Name: svn:mime-type + image/png Added: pal-portal/modules/ant-installer/trunk/images/navicons/bluecurve/resources/icons/next.png =================================================================== (Binary files differ) Property changes on: pal-portal/modules/ant-installer/trunk/images/navicons/bluecurve/resources/icons/next.png ___________________________________________________________________ Name: svn:mime-type + image/png Added: pal-portal/modules/ant-installer/trunk/images/navicons/bluecurve/resources/icons/ok.png =================================================================== (Binary files differ) Property changes on: pal-portal/modules/ant-installer/trunk/images/navicons/bluecurve/resources/icons/ok.png ___________________________________________________________________ Name: svn:mime-type + image/png Added: pal-portal/modules/ant-installer/trunk/images/navicons/bluecurve/resources/icons/showdetails.png =================================================================== (Binary files differ) Property changes on: pal-portal/modules/ant-installer/trunk/images/navicons/bluecurve/resources/icons/showdetails.png ___________________________________________________________________ Name: svn:mime-type + image/png Added: pal-portal/modules/ant-installer/trunk/images/navicons/crystalsvg/resources/icons/LICENSE =================================================================== --- pal-portal/modules/ant-installer/trunk/images/navicons/crystalsvg/resources/icons/LICENSE (rev 0) +++ pal-portal/modules/ant-installer/trunk/images/navicons/crystalsvg/resources/icons/LICENSE 2008-06-11 13:36:41 UTC (rev 975) @@ -0,0 +1,12 @@ +This copyright and license notice covers the images in this directory. +Note the license notice contains an add-on. + +KDE Crystal theme icons. +Copyright (C) 2002 and following years KDE Artists +This library is free software; you can redistribute it and/or modify it under +the terms of the GNU Lesser General Public License as published by the Free +Software Foundation, version 2.1 of the License. + +This library 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 for more details. \ No newline at end of file Added: pal-portal/modules/ant-installer/trunk/images/navicons/crystalsvg/resources/icons/back.png =================================================================== (Binary files differ) Property changes on: pal-portal/modules/ant-installer/trunk/images/navicons/crystalsvg/resources/icons/back.png ___________________________________________________________________ Name: svn:mime-type + image/png Added: pal-portal/modules/ant-installer/trunk/images/navicons/crystalsvg/resources/icons/cancel.png =================================================================== (Binary files differ) Property changes on: pal-portal/modules/ant-installer/trunk/images/navicons/crystalsvg/resources/icons/cancel.png ___________________________________________________________________ Name: svn:mime-type + image/png Added: pal-portal/modules/ant-installer/trunk/images/navicons/crystalsvg/resources/icons/finish.png =================================================================== (Binary files differ) Property changes on: pal-portal/modules/ant-installer/trunk/images/navicons/crystalsvg/resources/icons/finish.png ___________________________________________________________________ Name: svn:mime-type + image/png Added: pal-portal/modules/ant-installer/trunk/images/navicons/crystalsvg/resources/icons/next.png =================================================================== (Binary files differ) Property changes on: pal-portal/modules/ant-installer/trunk/images/navicons/crystalsvg/resources/icons/next.png ___________________________________________________________________ Name: svn:mime-type + image/png Added: pal-portal/modules/ant-installer/trunk/images/navicons/crystalsvg/resources/icons/ok.png =================================================================== (Binary files differ) Property changes on: pal-portal/modules/ant-installer/trunk/images/navicons/crystalsvg/resources/icons/ok.png ___________________________________________________________________ Name: svn:mime-type + image/png Added: pal-portal/modules/ant-installer/trunk/images/navicons/crystalsvg/resources/icons/showdetails.png =================================================================== (Binary files differ) Property changes on: pal-portal/modules/ant-installer/trunk/images/navicons/crystalsvg/resources/icons/showdetails.png ___________________________________________________________________ Name: svn:mime-type + image/png Added: pal-portal/modules/ant-installer/trunk/images/navicons/eclipse/resources/icons/LICENSE =================================================================== --- pal-portal/modules/ant-installer/trunk/images/navicons/eclipse/resources/icons/LICENSE (rev 0) +++ pal-portal/modules/ant-installer/trunk/images/navicons/eclipse/resources/icons/LICENSE 2008-06-11 13:36:41 UTC (rev 975) @@ -0,0 +1,86 @@ +Eclipse Public License - v 1.0 + +THE ACCOMPANYING PROGRAM IS PROVIDED UNDER THE TERMS OF THIS ECLIPSE PUBLIC LICENSE ("AGREEMENT"). ANY USE, REPRODUCTION OR DISTRIBUTION OF THE PROGRAM CONSTITUTES RECIPIENT?? ACCEPTANCE OF THIS AGREEMENT. + +1. DEFINITIONS + +"Contribution" means: + + a) in the case of the initial Contributor, the initial code and documentation distributed under this Agreement, and + b) in the case of each subsequent Contributor: + + i)changes to the Program, and + + ii)additions to the Program; + + where such changes and/or additions to the Program originate from and are distributed by that particular Contributor. A Contribution 'originates' from a Contributor if it was added to the Program by such Contributor itself or anyone acting on such Contributor?? behalf. Contributions do not include additions to the Program which: (i) are separate modules of software distributed in conjunction with the Program under their own license agreement, and (ii) are not derivative works of the Program. + +"Contributor" means any person or entity that distributes the Program. + +"Licensed Patents " mean patent claims licensable by a Contributor which are necessarily infringed by the use or sale of its Contribution alone or when combined with the Program. + +"Program" means the Contributions distributed in accordance with this Agreement. + +"Recipient" means anyone who receives the Program under this Agreement, including all Contributors. + +2. GRANT OF RIGHTS + +a) Subject to the terms of this Agreement, each Contributor hereby grants Recipient a non-exclusive, worldwide, royalty-free copyright license to reproduce, prepare derivative works of, publicly display, publicly perform, distribute and sublicense the Contribution of such Contributor, if any, and such derivative works, in source code and object code form. + +b) Subject to the terms of this Agreement, each Contributor hereby grants Recipient a non-exclusive, worldwide, royalty-free patent license under Licensed Patents to make, use, sell, offer to sell, import and otherwise transfer the Contribution of such Contributor, if any, in source code and object code form. This patent license shall apply to the combination of the Contribution and the Program if, at the time the Contribution is added by the Contributor, such addition of the Contribution causes such combination to be covered by the Licensed Patents. The patent license shall not apply to any other combinations which include the Contribution. No hardware per se is licensed hereunder. + +c) Recipient understands that although each Contributor grants the licenses to its Contributions set forth herein, no assurances are provided by any Contributor that the Program does not infringe the patent or other intellectual property rights of any other entity. Each Contributor disclaims any liability to Recipient for claims brought by any other entity based on infringement of intellectual property rights or otherwise. As a condition to exercising the rights and licenses granted hereunder, each Recipient hereby assumes sole responsibility to secure any other intellectual property rights needed, if any. For example, if a third party patent license is required to allow Recipient to distribute the Program, it is Recipient?? responsibility to acquire that license before distributing the Program. + +d) Each Contributor represents that to its knowledge it has sufficient copyright rights in its Contribution, if any, to grant the copyright license set forth in this Agreement. + +3. REQUIREMENTS + +A Contributor may choose to distribute the Program in object code form under its own license agreement, provided that: + + a) it complies with the terms and conditions of this Agreement; and + + b) its license agreement: + + i) effectively disclaims on behalf of all Contributors all warranties and conditions, express and implied, including warranties or conditions of title and non-infringement, and implied warranties or conditions of merchantability and fitness for a particular purpose; + + ii) effectively excludes on behalf of all Contributors all liability for damages, including direct, indirect, special, incidental and consequential damages, such as lost profits; + + iii) states that any provisions which differ from this Agreement are offered by that Contributor alone and not by any other party; and + + iv) states that source code for the Program is available from such Contributor, and informs licensees how to obtain it in a reasonable manner on or through a medium customarily used for software exchange. + +When the Program is made available in source code form: + + a) it must be made available under this Agreement; and + + b) a copy of this Agreement must be included with each copy of the Program. + +Contributors may not remove or alter any copyright notices contained within the Program. + +Each Contributor must identify itself as the originator of its Contribution, if any, in a manner that reasonably allows subsequent Recipients to identify the originator of the Contribution. + +4. COMMERCIAL DISTRIBUTION + +Commercial distributors of software may accept certain responsibilities with respect to end users, business partners and the like. While this license is intended to facilitate the commercial use of the Program, the Contributor who includes the Program in a commercial product offering should do so in a manner which does not create potential liability for other Contributors. Therefore, if a Contributor includes the Program in a commercial product offering, such Contributor ("Commercial Contributor") hereby agrees to defend and indemnify every other Contributor ("Indemnified Contributor") against any losses, damages and costs (collectively "Losses") arising from claims, lawsuits and other legal actions brought by a third party against the Indemnified Contributor to the extent caused by the acts or omissions of such Commercial Contributor in connection with its distribution of the Program in a commercial product offering. The obligations in this section do not apply to any claims or Losses relating to any actual or alleged intellectual property infringement. In order to qualify, an Indemnified Contributor must: a) promptly notify the Commercial Contributor in writing of such claim, and b) allow the Commercial Contributor to control, and cooperate with the Commercial Contributor in, the defense and any related settlement negotiations. The Indemnified Contributor may participate in any such claim at its own expense. + +For example, a Contributor might include the Program in a commercial product offering, Product X. That Contributor is then a Commercial Contributor. If that Commercial Contributor then makes performance claims, or offers warranties related to Product X, those performance claims and warranties are such Commercial Contributor?? responsibility alone. Under this section, the Commercial Contributor would have to defend claims against the other Contributors related to those performance claims and warranties, and if a court requires any other Contributor to pay any damages as a result, the Commercial Contributor must pay those damages. + +5. NO WARRANTY + +EXCEPT AS EXPRESSLY SET FORTH IN THIS AGREEMENT, THE PROGRAM IS PROVIDED ON AN "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED INCLUDING, WITHOUT LIMITATION, ANY WARRANTIES OR CONDITIONS OF TITLE, NON-INFRINGEMENT, MERCHANTABILITY OR FITNESS FOR A PARTICULAR PURPOSE. Each Recipient is solely responsible for determining the appropriateness of using and distributing the Program and assumes all risks associated with its exercise of rights under this Agreement , including but not limited to the risks and costs of program errors, compliance with applicable laws, damage to or loss of data, programs or equipment, and unavailability or interruption of operations. + +6. DISCLAIMER OF LIABILITY + +EXCEPT AS EXPRESSLY SET FORTH IN THIS AGREEMENT, NEITHER RECIPIENT NOR ANY CONTRIBUTORS SHALL HAVE ANY LIABILITY FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING WITHOUT LIMITATION LOST PROFITS), HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OR DISTRIBUTION OF THE PROGRAM OR THE EXERCISE OF ANY RIGHTS GRANTED HEREUNDER, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGES. + +7. GENERAL + +If any provision of this Agreement is invalid or unenforceable under applicable law, it shall not affect the validity or enforceability of the remainder of the terms of this Agreement, and without further action by the parties hereto, such provision shall be reformed to the minimum extent necessary to make such provision valid and enforceable. + +If Recipient institutes patent litigation against any entity (including a cross-claim or counterclaim in a lawsuit) alleging that the Program itself (excluding combinations of the Program with other software or hardware) infringes such Recipient?? patent(s), then such Recipient?? rights granted under Section 2(b) shall terminate as of the date such litigation is filed. + +All Recipient?? rights under this Agreement shall terminate if it fails to comply with any of the material terms or conditions of this Agreement and does not cure such failure in a reasonable period of time after becoming aware of such noncompliance. If all Recipient?? rights under this Agreement terminate, Recipient agrees to cease use and distribution of the Program as soon as reasonably practicable. However, Recipient?? obligations under this Agreement and any licenses granted by Recipient relating to the Program shall continue and survive. + +Everyone is permitted to copy and distribute copies of this Agreement, but in order to avoid inconsistency the Agreement is copyrighted and may only be modified in the following manner. The Agreement Steward reserves the right to publish new versions (including revisions) of this Agreement from time to time. No one other than the Agreement Steward has the right to modify this Agreement. The Eclipse Foundation is the initial Agreement Steward. The Eclipse Foundation may assign the responsibility to serve as the Agreement Steward to a suitable separate entity. Each new version of the Agreement will be given a distinguishing version number. The Program (including Contributions) may always be distributed subject to the version of the Agreement under which it was received. In addition, after a new version of the Agreement is published, Contributor may elect to distribute the Program (including its Contributions) under the new version. Except as expressly stated in Sections 2(a) and 2(b) above, Recipient receives no rights or licenses to the intellectual property of any Contributor under this Agreement, whether expressly, by implication, estoppel or otherwise. All rights in the Program not expressly granted under this Agreement are reserved. + +This Agreement is governed by the laws of the State of New York and the intellectual property laws of the United States of America. No party to this Agreement will bring a legal action under this Agreement more than one year after the cause of action arose. Each party waives its rights to a jury trial in any resulting litigation. \ No newline at end of file Added: pal-portal/modules/ant-installer/trunk/images/navicons/eclipse/resources/icons/back.png =================================================================== (Binary files differ) Property changes on: pal-portal/modules/ant-installer/trunk/images/navicons/eclipse/resources/icons/back.png ___________________________________________________________________ Name: svn:mime-type + image/png Added: pal-portal/modules/ant-installer/trunk/images/navicons/eclipse/resources/icons/cancel.png =================================================================== (Binary files differ) Property changes on: pal-portal/modules/ant-installer/trunk/images/navicons/eclipse/resources/icons/cancel.png ___________________________________________________________________ Name: svn:mime-type + image/png Added: pal-portal/modules/ant-installer/trunk/images/navicons/eclipse/resources/icons/finish.png =================================================================== (Binary files differ) Property changes on: pal-portal/modules/ant-installer/trunk/images/navicons/eclipse/resources/icons/finish.png ___________________________________________________________________ Name: svn:mime-type + image/png Added: pal-portal/modules/ant-installer/trunk/images/navicons/eclipse/resources/icons/next.png =================================================================== (Binary files differ) Property changes on: pal-portal/modules/ant-installer/trunk/images/navicons/eclipse/resources/icons/next.png ___________________________________________________________________ Name: svn:mime-type + image/png Added: pal-portal/modules/ant-installer/trunk/images/navicons/eclipse/resources/icons/ok.png =================================================================== (Binary files differ) Property changes on: pal-portal/modules/ant-installer/trunk/images/navicons/eclipse/resources/icons/ok.png ___________________________________________________________________ Name: svn:mime-type + image/png Added: pal-portal/modules/ant-installer/trunk/images/navicons/eclipse/resources/icons/showdetails.png =================================================================== (Binary files differ) Property changes on: pal-portal/modules/ant-installer/trunk/images/navicons/eclipse/resources/icons/showdetails.png ___________________________________________________________________ Name: svn:mime-type + image/png Added: pal-portal/modules/ant-installer/trunk/images/navicons/krystaline/resources/icons/LICENSE =================================================================== --- pal-portal/modules/ant-installer/trunk/images/navicons/krystaline/resources/icons/LICENSE (rev 0) +++ pal-portal/modules/ant-installer/trunk/images/navicons/krystaline/resources/icons/LICENSE 2008-06-11 13:36:41 UTC (rev 975) @@ -0,0 +1,504 @@ + GNU LESSER GENERAL PUBLIC LICENSE + Version 2.1, February 1999 + + Copyright (C) 1991, 1999 Free Software Foundation, Inc. + 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA + Everyone is permitted to copy and distribute verbatim copies + of this license document, but changing it is not allowed. + +[This is the first released version of the Lesser GPL. It also counts + as the successor of the GNU Library Public License, version 2, hence + the version number 2.1.] + + Preamble + + The licenses for most software are designed to take away your +freedom to share and change it. By contrast, the GNU General Public +Licenses are intended to guarantee your freedom to share and change +free software--to make sure the software is free for all its users. + + This license, the Lesser General Public License, applies to some +specially designated software packages--typically libraries--of the +Free Software Foundation and other authors who decide to use it. You +can use it too, but we suggest you first think carefully about whether +this license or the ordinary General Public License is the better +strategy to use in any particular case, based on the explanations below. + + When we speak of free software, we are referring to freedom of use, +not price. Our General Public Licenses are designed to make sure that +you have the freedom to distribute copies of free software (and charge +for this service if you wish); that you receive source code or can get +it if you want it; that you can change the software and use pieces of +it in new free programs; and that you are informed that you can do +these things. + + To protect your rights, we need to make restrictions that forbid +distributors to deny you these rights or to ask you to surrender these +rights. These restrictions translate to certain responsibilities for +you if you distribute copies of the library or if you modify it. + + For example, if you distribute copies of the library, whether gratis +or for a fee, you must give the recipients all the rights that we gave +you. You must make sure that they, too, receive or can get the source +code. If you link other code with the library, you must provide +complete object files to the recipients, so that they can relink them +with the library after making changes to the library and recompiling +it. And you must show them these terms so they know their rights. + + We protect your rights with a two-step method: (1) we copyright the +library, and (2) we offer you this license, which gives you legal +permission to copy, distribute and/or modify the library. + + To protect each distributor, we want to make it very clear that +there is no warranty for the free library. Also, if the library is +modified by someone else and passed on, the recipients should know +that what they have is not the original version, so that the original +author's reputation will not be affected by problems that might be +introduced by others. + + Finally, software patents pose a constant threat to the existence of +any free program. We wish to make sure that a company cannot +effectively restrict the users of a free program by obtaining a +restrictive license from a patent holder. Therefore, we insist that +any patent license obtained for a version of the library must be +consistent with the full freedom of use specified in this license. + + Most GNU software, including some libraries, is covered by the +ordinary GNU General Public License. This license, the GNU Lesser +General Public License, applies to certain designated libraries, and +is quite different from the ordinary General Public License. We use +this license for certain libraries in order to permit linking those +libraries into non-free programs. + + When a program is linked with a library, whether statically or using +a shared library, the combination of the two is legally speaking a +combined work, a derivative of the original library. The ordinary +General Public License therefore permits such linking only if the +entire combination fits its criteria of freedom. The Lesser General +Public License permits more lax criteria for linking other code with +the library. + + We call this license the "Lesser" General Public License because it +does Less to protect the user's freedom than the ordinary General +Public License. It also provides other free software developers Less +of an advantage over competing non-free programs. These disadvantages +are the reason we use the ordinary General Public License for many +libraries. However, the Lesser license provides advantages in certain +special circumstances. + + For example, on rare occasions, there may be a special need to +encourage the widest possible use of a certain library, so that it becomes +a de-facto standard. To achieve this, non-free programs must be +allowed to use the library. A more frequent case is that a free +library does the same job as widely used non-free libraries. In this +case, there is little to gain by limiting the free library to free +software only, so we use the Lesser General Public License. + + In other cases, permission to use a particular library in non-free +programs enables a greater number of people to use a large body of +free software. For example, permission to use the GNU C Library in +non-free programs enables many more people to use the whole GNU +operating system, as well as its variant, the GNU/Linux operating +system. + + Although the Lesser General Public License is Less protective of the +users' freedom, it does ensure that the user of a program that is +linked with the Library has the freedom and the wherewithal to run +that program using a modified version of the Library. + + The precise terms and conditions for copying, distribution and +modification follow. Pay close attention to the difference between a +"work based on the library" and a "work that uses the library". The +former contains code derived from the library, whereas the latter must +be combined with the library in order to run. + + GNU LESSER GENERAL PUBLIC LICENSE + TERMS AND CONDITIONS FOR COPYING, DISTRIBUTION AND MODIFICATION + + 0. This License Agreement applies to any software library or other +program which contains a notice placed by the copyright holder or +other authorized party saying it may be distributed under the terms of +this Lesser General Public License (also called "this License"). +Each licensee is addressed as "you". + + A "library" means a collection of software functions and/or data +prepared so as to be conveniently linked with application programs +(which use some of those functions and data) to form executables. + + The "Library", below, refers to any such software library or work +which has been distributed under these terms. A "work based on the +Library" means either the Library or any derivative work under +copyright law: that is to say, a work containing the Library or a +portion of it, either verbatim or with modifications and/or translated +straightforwardly into another language. (Hereinafter, translation is +included without limitation in the term "modification".) + + "Source code" for a work means the preferred form of the work for +making modifications to it. For a library, complete source code means +all the source code for all modules it contains, plus any associated +interface definition files, plus the scripts used to control compilation +and installation of the library. + + Activities other than copying, distribution and modification are not +covered by this License; they are outside its scope. The act of +running a program using the Library is not restricted, and output from +such a program is covered only if its contents constitute a work based +on the Library (independent of the use of the Library in a tool for +writing it). Whether that is true depends on what the Library does +and what the program that uses the Library does. + + 1. You may copy and distribute verbatim copies of the Library's +complete source code as you receive it, in any medium, provided that +you conspicuously and appropriately publish on each copy an +appropriate copyright notice and disclaimer of warranty; keep intact +all the notices that refer to this License and to the absence of any +warranty; and distribute a copy of this License along with the +Library. + + You may charge a fee for the physical act of transferring a copy, +and you may at your option offer warranty protection in exchange for a +fee. + + 2. You may modify your copy or copies of the Library or any portion +of it, thus forming a work based on the Library, and copy and +distribute such modifications or work under the terms of Section 1 +above, provided that you also meet all of these conditions: + + a) The modified work must itself be a software library. + + b) You must cause the files modified to carry prominent notices + stating that you changed the files and the date of any change. + + c) You must cause the whole of the work to be licensed at no + charge to all third parties under the terms of this License. + + d) If a facility in the modified Library refers to a function or a + table of data to be supplied by an application program that uses + the facility, other than as an argument passed when the facility + is invoked, then you must make a good faith effort to ensure that, + in the event an application does not supply such function or + table, the facility still operates, and performs whatever part of + its purpose remains meaningful. + + (For example, a function in a library to compute square roots has + a purpose that is entirely well-defined independent of the + application. Therefore, Subsection 2d requires that any + application-supplied function or table used by this function must + be optional: if the application does not supply it, the square + root function must still compute square roots.) + +These requirements apply to the modified work as a whole. If +identifiable sections of that work are not derived from the Library, +and can be reasonably considered independent and separate works in +themselves, then this License, and its terms, do not apply to those +sections when you distribute them as separate works. But when you +distribute the same sections as part of a whole which is a work based +on the Library, the distribution of the whole must be on the terms of +this License, whose permissions for other licensees extend to the +entire whole, and thus to each and every part regardless of who wrote +it. + +Thus, it is not the intent of this section to claim rights or contest +your rights to work written entirely by you; rather, the intent is to +exercise the right to control the distribution of derivative or +collective works based on the Library. + +In addition, mere aggregation of another work not based on the Library +with the Library (or with a work based on the Library) on a volume of +a storage or distribution medium does not bring the other work under +the scope of this License. + + 3. You may opt to apply the terms of the ordinary GNU General Public +License instead of this License to a given copy of the Library. To do +this, you must alter all the notices that refer to this License, so +that they refer to the ordinary GNU General Public License, version 2, +instead of to this License. (If a newer version than version 2 of the +ordinary GNU General Public License has appeared, then you can specify +that version instead if you wish.) Do not make any other change in +these notices. + + Once this change is made in a given copy, it is irreversible for +that copy, so the ordinary GNU General Public License applies to all +subsequent copies and derivative works made from that copy. + + This option is useful when you wish to copy part of the code of +the Library into a program that is not a library. + + 4. You may copy and distribute the Library (or a portion or +derivative of it, under Section 2) in object code or executable form +under the terms of Sections 1 and 2 above provided that you accompany +it with the complete corresponding machine-readable source code, which +must be distributed under the terms of Sections 1 and 2 above on a +medium customarily used for software interchange. + + If distribution of object code is made by offering access to copy +from a designated place, then offering equivalent access to copy the +source code from the same place satisfies the requirement to +distribute the source code, even though third parties are not +compelled to copy the source along with the object code. + + 5. A program that contains no derivative of any portion of the +Library, but is designed to work with the Library by being compiled or +linked with it, is called a "work that uses the Library". Such a +work, in isolation, is not a derivative work of the Library, and +therefore falls outside the scope of this License. + + However, linking a "work that uses the Library" with the Library +creates an executable that is a derivative of the Library (because it +contains portions of the Library), rather than a "work that uses the +library". The executable is therefore covered by this License. +Section 6 states terms for distribution of such executables. + + When a "work that uses the Library" uses material from a header file +that is part of the Library, the object code for the work may be a +derivative work of the Library even though the source code is not. +Whether this is true is especially significant if the work can be +linked without the Library, or if the work is itself a library. The +threshold for this to be true is not precisely defined by law. + + If such an object file uses only numerical parameters, data +structure layouts and accessors, and small macros and small inline +functions (ten lines or less in length), then the use of the object +file is unrestricted, regardless of whether it is legally a derivative +work. (Executables containing this object code plus portions of the +Library will still fall under Section 6.) + + Otherwise, if the work is a derivative of the Library, you may +distribute the object code for the work under the terms of Section 6. +Any executables containing that work also fall under Section 6, +whether or not they are linked directly with the Library itself. + + 6. As an exception to the Sections above, you may also combine or +link a "work that uses the Library" with the Library to produce a +work containing portions of the Library, and distribute that work +under terms of your choice, provided that the terms permit +modification of the work for the customer's own use and reverse +engineering for debugging such modifications. + + You must give prominent notice with each copy of the work that the +Library is used in it and that the Library and its use are covered by +this License. You must supply a copy of this License. If the work +during execution displays copyright notices, you must include the +copyright notice for the Library among them, as well as a reference +directing the user to the copy of this License. Also, you must do one +of these things: + + a) Accompany the work with the complete corresponding + machine-readable source code for the Library including whatever + changes were used in the work (which must be distributed under + Sections 1 and 2 above); and, if the work is an executable linked + with the Library, with the complete machine-readable "work that + uses the Library", as object code and/or source code, so that the + user can modify the Library and then relink to produce a modified + executable containing the modified Library. (It is understood + that the user who changes the contents of definitions files in the + Library will not necessarily be able to recompile the application + to use the modified definitions.) + + b) Use a suitable shared library mechanism for linking with the + Library. A suitable mechanism is one that (1) uses at run time a + copy of the library already present on the user's computer system, + rather than copying library functions into the executable, and (2) + will operate properly with a modified version of the library, if + the user installs one, as long as the modified version is + interface-compatible with the version that the work was made with. + + c) Accompany the work with a written offer, valid for at + least three years, to give the same user the materials + specified in Subsection 6a, above, for a charge no more + than the cost of performing this distribution. + + d) If distribution of the work is made by offering access to copy + from a designated place, offer equivalent access to copy the above + specified materials from the same place. + + e) Verify that the user has already received a copy of these + materials or that you have already sent this user a copy. + + For an executable, the required form of the "work that uses the +Library" must include any data and utility programs needed for +reproducing the executable from it. However, as a special exception, +the materials to be distributed need not include anything that is +normally distributed (in either source or binary form) with the major +components (compiler, kernel, and so on) of the operating system on +which the executable runs, unless that component itself accompanies +the executable. + + It may happen that this requirement contradicts the license +restrictions of other proprietary libraries that do not normally +accompany the operating system. Such a contradiction means you cannot +use both them and the Library together in an executable that you +distribute. + + 7. You may place library facilities that are a work based on the +Library side-by-side in a single library together with other library +facilities not covered by this License, and distribute such a combined +library, provided that the separate distribution of the work based on +the Library and of the other library facilities is otherwise +permitted, and provided that you do these two things: + + a) Accompany the combined library with a copy of the same work + based on the Library, uncombined with any other library + facilities. This must be distributed under the terms of the + Sections above. + + b) Give prominent notice with the combined library of the fact + that part of it is a work based on the Library, and explaining + where to find the accompanying uncombined form of the same work. + + 8. You may not copy, modify, sublicense, link with, or distribute +the Library except as expressly provided under this License. Any +attempt otherwise to copy, modify, sublicense, link with, or +distribute the Library is void, and will automatically terminate your +rights under this License. However, parties who have received copies, +or rights, from you under this License will not have their licenses +terminated so long as such parties remain in full compliance. + + 9. You are not required to accept this License, since you have not +signed it. However, nothing else grants you permission to modify or +distribute the Library or its derivative works. These actions are +prohibited by law if you do not accept this License. Therefore, by +modifying or distributing the Library (or any work based on the +Library), you indicate your acceptance of this License to do so, and +all its terms and conditions for copying, distributing or modifying +the Library or works based on it. + + 10. Each time you redistribute the Library (or any work based on the +Library), the recipient automatically receives a license from the +original licensor to copy, distribute, link with or modify the Library +subject to these terms and conditions. You may not impose any further +restrictions on the recipients' exercise of the rights granted herein. +You are not responsible for enforcing compliance by third parties with +this License. + + 11. If, as a consequence of a court judgment or allegation of patent +infringement or for any other reason (not limited to patent issues), +conditions are imposed on you (whether by court order, agreement or +otherwise) that contradict the conditions of this License, they do not +excuse you from the conditions of this License. If you cannot +distribute so as to satisfy simultaneously your obligations under this +License and any other pertinent obligations, then as a consequence you +may not distribute the Library at all. For example, if a patent +license would not permit royalty-free redistribution of the Library by +all those who receive copies directly or indirectly through you, then +the only way you could satisfy both it and this License would be to +refrain entirely from distribution of the Library. + +If any portion of this section is held invalid or unenforceable under any +particular circumstance, the balance of the section is intended to apply, +and the section as a whole is intended to apply in other circumstances. + +It is not the purpose of this section to induce you to infringe any +patents or other property right claims or to contest validity of any +such claims; this section has the sole purpose of protecting the +integrity of the free software distribution system which is +implemented by public license practices. Many people have made +generous contributions to the wide range of software distributed +through that system in reliance on consistent application of that +system; it is up to the author/donor to decide if he or she is willing +to distribute software through any other system and a licensee cannot +impose that choice. + +This section is intended to make thoroughly clear what is believed to +be a consequence of the rest of this License. + + 12. If the distribution and/or use of the Library is restricted in +certain countries either by patents or by copyrighted interfaces, the +original copyright holder who places the Library under this License may add +an explicit geographical distribution limitation excluding those countries, +so that distribution is permitted only in or among countries not thus +excluded. In such case, this License incorporates the limitation as if +written in the body of this License. + + 13. The Free Software Foundation may publish revised and/or new +versions of the Lesser General Public License from time to time. +Such new versions will be similar in spirit to the present version, +but may differ in detail to address new problems or concerns. + +Each version is given a distinguishing version number. If the Library +specifies a version number of this License which applies to it and +"any later version", you have the option of following the terms and +conditions either of that version or of any later version published by +the Free Software Foundation. If the Library does not specify a +license version number, you may choose any version ever published by +the Free Software Foundation. + + 14. If you wish to incorporate parts of the Library into other free +programs whose distribution conditions are incompatible with these, +write to the author to ask for permission. For software which is +copyrighted by the Free Software Foundation, write to the Free +Software Foundation; we sometimes make exceptions for this. Our +decision will be guided by the two goals of preserving the free status +of all derivatives of our free software and of promoting the sharing +and reuse of software generally. + + NO WARRANTY + + 15. BECAUSE THE LIBRARY IS LICENSED FREE OF CHARGE, THERE IS NO +WARRANTY FOR THE LIBRARY, TO THE EXTENT PERMITTED BY APPLICABLE LAW. +EXCEPT WHEN OTHERWISE STATED IN WRITING THE COPYRIGHT HOLDERS AND/OR +OTHER PARTIES PROVIDE THE LIBRARY "AS IS" WITHOUT WARRANTY OF ANY +KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING, BUT NOT LIMITED TO, THE +IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR +PURPOSE. THE ENTIRE RISK AS TO THE QUALITY AND PERFORMANCE OF THE +LIBRARY IS WITH YOU. SHOULD THE LIBRARY PROVE DEFECTIVE, YOU ASSUME +THE COST OF ALL NECESSARY SERVICING, REPAIR OR CORRECTION. + + 16. IN NO EVENT UNLESS REQUIRED BY APPLICABLE LAW OR AGREED TO IN +WRITING WILL ANY COPYRIGHT HOLDER, OR ANY OTHER PARTY WHO MAY MODIFY +AND/OR REDISTRIBUTE THE LIBRARY AS PERMITTED ABOVE, BE LIABLE TO YOU +FOR DAMAGES, INCLUDING ANY GENERAL, SPECIAL, INCIDENTAL OR +CONSEQUENTIAL DAMAGES ARISING OUT OF THE USE OR INABILITY TO USE THE +LIBRARY (INCLUDING BUT NOT LIMITED TO LOSS OF DATA OR DATA BEING +RENDERED INACCURATE OR LOSSES SUSTAINED BY YOU OR THIRD PARTIES OR A +FAILURE OF THE LIBRARY TO OPERATE WITH ANY OTHER SOFTWARE), EVEN IF +SUCH HOLDER OR OTHER PARTY HAS BEEN ADVISED OF THE POSSIBILITY OF SUCH +DAMAGES. + + END OF TERMS AND CONDITIONS + + How to Apply These Terms to Your New Libraries + + If you develop a new library, and you want it to be of the greatest +possible use to the public, we recommend making it free software that +everyone can redistribute and change. You can do so by permitting +redistribution under these terms (or, alternatively, under the terms of the +ordinary General Public License). + + To apply these terms, attach the following notices to the library. It is +safest to attach them to the start of each source file to most effectively +convey the exclusion of warranty; and each file should have at least the +"copyright" line and a pointer to where the full notice is found. + + + Copyright (C) + + This library is free software; you can redistribute it and/or + modify it under the terms of the GNU Lesser General Public + License as published by the Free Software Foundation; either + version 2.1 of the License, or (at your option) any later version. + + This library 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 for more details. + + You should have received a copy of the GNU Lesser General Public + License along with this library; if not, write to the Free Software + Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA + +Also add information on how to contact you by electronic and paper mail. + +You should also get your employer (if you work as a programmer) or your +school, if any, to sign a "copyright disclaimer" for the library, if +necessary. Here is a sample; alter the names: + + Yoyodyne, Inc., hereby disclaims all copyright interest in the + library `Frob' (a library for tweaking knobs) written by James Random Hacker. + + , 1 April 1990 + Ty Coon, President of Vice + +That's all there is to it! + + Added: pal-portal/modules/ant-installer/trunk/images/navicons/krystaline/resources/icons/back.png =================================================================== (Binary files differ) Property changes on: pal-portal/modules/ant-installer/trunk/images/navicons/krystaline/resources/icons/back.png ___________________________________________________________________ Name: svn:mime-type + image/png Added: pal-portal/modules/ant-installer/trunk/images/navicons/krystaline/resources/icons/cancel.png =================================================================== (Binary files differ) Property changes on: pal-portal/modules/ant-installer/trunk/images/navicons/krystaline/resources/icons/cancel.png ___________________________________________________________________ Name: svn:mime-type + image/png Added: pal-portal/modules/ant-installer/trunk/images/navicons/krystaline/resources/icons/finish.png =================================================================== (Binary files differ) Property changes on: pal-portal/modules/ant-installer/trunk/images/navicons/krystaline/resources/icons/finish.png ___________________________________________________________________ Name: svn:mime-type + image/png Added: pal-portal/modules/ant-installer/trunk/images/navicons/krystaline/resources/icons/next.png =================================================================== (Binary files differ) Property changes on: pal-portal/modules/ant-installer/trunk/images/navicons/krystaline/resources/icons/next.png ___________________________________________________________________ Name: svn:mime-type + image/png Added: pal-portal/modules/ant-installer/trunk/images/navicons/krystaline/resources/icons/ok.png =================================================================== (Binary files differ) Property changes on: pal-portal/modules/ant-installer/trunk/images/navicons/krystaline/resources/icons/ok.png ___________________________________________________________________ Name: svn:mime-type + image/png Added: pal-portal/modules/ant-installer/trunk/images/navicons/krystaline/resources/icons/showdetails.png =================================================================== (Binary files differ) Property changes on: pal-portal/modules/ant-installer/trunk/images/navicons/krystaline/resources/icons/showdetails.png ___________________________________________________________________ Name: svn:mime-type + image/png Added: pal-portal/modules/ant-installer/trunk/images/resources/AntInstaller.png =================================================================== (Binary files differ) Property changes on: pal-portal/modules/ant-installer/trunk/images/resources/AntInstaller.png ___________________________________________________________________ Name: svn:mime-type + image/png Added: pal-portal/modules/ant-installer/trunk/images/resources/LICENSE-ant-install.txt =================================================================== --- pal-portal/modules/ant-installer/trunk/images/resources/LICENSE-ant-install.txt (rev 0) +++ pal-portal/modules/ant-installer/trunk/images/resources/LICENSE-ant-install.txt 2008-06-11 13:36:41 UTC (rev 975) @@ -0,0 +1,202 @@ + + Apache License + Version 2.0, January 2004 + http://www.apache.org/licenses/ + + TERMS AND CONDITIONS FOR USE, REPRODUCTION, AND DISTRIBUTION + + 1. Definitions. + + "License" shall mean the terms and conditions for use, reproduction, + and distribution as defined by Sections 1 through 9 of this document. + + "Licensor" shall mean the copyright owner or entity authorized by + the copyright owner that is granting the License. + + "Legal Entity" shall mean the union of the acting entity and all + other entities that control, are controlled by, or are under common + control with that entity. For the purposes of this definition, + "control" means (i) the power, direct or indirect, to cause the + direction or management of such entity, whether by contract or + otherwise, or (ii) ownership of fifty percent (50%) or more of the + outstanding shares, or (iii) beneficial ownership of such entity. + + "You" (or "Your") shall mean an individual or Legal Entity + exercising permissions granted by this License. + + "Source" form shall mean the preferred form for making modifications, + including but not limited to software source code, documentation + source, and configuration files. + + "Object" form shall mean any form resulting from mechanical + transformation or translation of a Source form, including but + not limited to compiled object code, generated documentation, + and conversions to other media types. + + "Work" shall mean the work of authorship, whether in Source or + Object form, made available under the License, as indicated by a + copyright notice that is included in or attached to the work + (an example is provided in the Appendix below). + + "Derivative Works" shall mean any work, whether in Source or Object + form, that is based on (or derived from) the Work and for which the + editorial revisions, annotations, elaborations, or other modifications + represent, as a whole, an original work of authorship. For the purposes + of this License, Derivative Works shall not include works that remain + separable from, or merely link (or bind by name) to the interfaces of, + the Work and Derivative Works thereof. + + "Contribution" shall mean any work of authorship, including + the original version of the Work and any modifications or additions + to that Work or Derivative Works thereof, that is intentionally + submitted to Licensor for inclusion in the Work by the copyright owner + or by an individual or Legal Entity authorized to submit on behalf of + the copyright owner. For the purposes of this definition, "submitted" + means any form of electronic, verbal, or written communication sent + to the Licensor or its representatives, including but not limited to + communication on electronic mailing lists, source code control systems, + and issue tracking systems that are managed by, or on behalf of, the + Licensor for the purpose of discussing and improving the Work, but + excluding communication that is conspicuously marked or otherwise + designated in writing by the copyright owner as "Not a Contribution." + + "Contributor" shall mean Licensor and any individual or Legal Entity + on behalf of whom a Contribution has been received by Licensor and + subsequently incorporated within the Work. + + 2. Grant of Copyright License. Subject to the terms and conditions of + this License, each Contributor hereby grants to You a perpetual, + worldwide, non-exclusive, no-charge, royalty-free, irrevocable + copyright license to reproduce, prepare Derivative Works of, + publicly display, publicly perform, sublicense, and distribute the + Work and such Derivative Works in Source or Object form. + + 3. Grant of Patent License. Subject to the terms and conditions of + this License, each Contributor hereby grants to You a perpetual, + worldwide, non-exclusive, no-charge, royalty-free, irrevocable + (except as stated in this section) patent license to make, have made, + use, offer to sell, sell, import, and otherwise transfer the Work, + where such license applies only to those patent claims licensable + by such Contributor that are necessarily infringed by their + Contribution(s) alone or by combination of their Contribution(s) + with the Work to which such Contribution(s) was submitted. If You + institute patent litigation against any entity (including a + cross-claim or counterclaim in a lawsuit) alleging that the Work + or a Contribution incorporated within the Work constitutes direct + or contributory patent infringement, then any patent licenses + granted to You under this License for that Work shall terminate + as of the date such litigation is filed. + + 4. Redistribution. You may reproduce and distribute copies of the + Work or Derivative Works thereof in any medium, with or without + modifications, and in Source or Object form, provided that You + meet the following conditions: + + (a) You must give any other recipients of the Work or + Derivative Works a copy of this License; and + + (b) You must cause any modified files to carry prominent notices + stating that You changed the files; and + + (c) You must retain, in the Source form of any Derivative Works + that You distribute, all copyright, patent, trademark, and + attribution notices from the Source form of the Work, + excluding those notices that do not pertain to any part of + the Derivative Works; and + + (d) If the Work includes a "NOTICE" text file as part of its + distribution, then any Derivative Works that You distribute must + include a readable copy of the attribution notices contained + within such NOTICE file, excluding those notices that do not + pertain to any part of the Derivative Works, in at least one + of the following places: within a NOTICE text file distributed + as part of the Derivative Works; within the Source form or + documentation, if provided along with the Derivative Works; or, + within a display generated by the Derivative Works, if and + wherever such third-party notices normally appear. The contents + of the NOTICE file are for informational purposes only and + do not modify the License. You may add Your own attribution + notices within Derivative Works that You distribute, alongside + or as an addendum to the NOTICE text from the Work, provided + that such additional attribution notices cannot be construed + as modifying the License. + + You may add Your own copyright statement to Your modifications and + may provide additional or different license terms and conditions + for use, reproduction, or distribution of Your modifications, or + for any such Derivative Works as a whole, provided Your use, + reproduction, and distribution of the Work otherwise complies with + the conditions stated in this License. + + 5. Submission of Contributions. Unless You explicitly state otherwise, + any Contribution intentionally submitted for inclusion in the Work + by You to the Licensor shall be under the terms and conditions of + this License, without any additional terms or conditions. + Notwithstanding the above, nothing herein shall supersede or modify + the terms of any separate license agreement you may have executed + with Licensor regarding such Contributions. + + 6. Trademarks. This License does not grant permission to use the trade + names, trademarks, service marks, or product names of the Licensor, + except as required for reasonable and customary use in describing the + origin of the Work and reproducing the content of the NOTICE file. + + 7. Disclaimer of Warranty. Unless required by applicable law or + agreed to in writing, Licensor provides the Work (and each + Contributor provides its Contributions) on an "AS IS" BASIS, + WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or + implied, including, without limitation, any warranties or conditions + of TITLE, NON-INFRINGEMENT, MERCHANTABILITY, or FITNESS FOR A + PARTICULAR PURPOSE. You are solely responsible for determining the + appropriateness of using or redistributing the Work and assume any + risks associated with Your exercise of permissions under this License. + + 8. Limitation of Liability. In no event and under no legal theory, + whether in tort (including negligence), contract, or otherwise, + unless required by applicable law (such as deliberate and grossly + negligent acts) or agreed to in writing, shall any Contributor be + liable to You for damages, including any direct, indirect, special, + incidental, or consequential damages of any character arising as a + result of this License or out of the use or inability to use the + Work (including but not limited to damages for loss of goodwill, + work stoppage, computer failure or malfunction, or any and all + other commercial damages or losses), even if such Contributor + has been advised of the possibility of such damages. + + 9. Accepting Warranty or Additional Liability. While redistributing + the Work or Derivative Works thereof, You may choose to offer, + and charge a fee for, acceptance of support, warranty, indemnity, + or other liability obligations and/or rights consistent with this + License. However, in accepting such obligations, You may act only + on Your own behalf and on Your sole responsibility, not on behalf + of any other Contributor, and only if You agree to indemnify, + defend, and hold each Contributor harmless for any liability + incurred by, or claims asserted against, such Contributor by reason + of your accepting any such warranty or additional liability. + + END OF TERMS AND CONDITIONS + + APPENDIX: How to apply the Apache License to your work. + + To apply the Apache License to your work, attach the following + boilerplate notice, with the fields enclosed by brackets "[]" + replaced with your own identifying information. (Don't include + the brackets!) The text should be enclosed in the appropriate + comment syntax for the file format. We also recommend that a + file or class name and description of purpose be included on the + same "printed page" as the copyright notice for easier + identification within third-party archives. + + Copyright 2005 Paul Hinds + + Licensed under the Apache License, Version 2.0 (the "License"); + you may not use this file except in compliance with the License. + You may obtain a copy of the License at + + http://www.apache.org/licenses/LICENSE-2.0 + + Unless required by applicable law or agreed to in writing, software + distributed under the License is distributed on an "AS IS" BASIS, + WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + See the License for the specific language governing permissions and + limitations under the License. Property changes on: pal-portal/modules/ant-installer/trunk/images/resources/LICENSE-ant-install.txt ___________________________________________________________________ Name: svn:eol-style + native Added: pal-portal/modules/ant-installer/trunk/images/resources/antbar.png =================================================================== (Binary files differ) Property changes on: pal-portal/modules/ant-installer/trunk/images/resources/antbar.png ___________________________________________________________________ Name: svn:mime-type + image/png Added: pal-portal/modules/ant-installer/trunk/images/resources/banner23.png =================================================================== (Binary files differ) Property changes on: pal-portal/modules/ant-installer/trunk/images/resources/banner23.png ___________________________________________________________________ Name: svn:mime-type + image/png Added: pal-portal/modules/ant-installer/trunk/images/resources/extract-image.png =================================================================== (Binary files differ) Property changes on: pal-portal/modules/ant-installer/trunk/images/resources/extract-image.png ___________________________________________________________________ Name: svn:mime-type + image/png Added: pal-portal/modules/ant-installer/trunk/images/resources/gkmain_inv.png =================================================================== (Binary files differ) Property changes on: pal-portal/modules/ant-installer/trunk/images/resources/gkmain_inv.png ___________________________________________________________________ Name: svn:mime-type + image/png Added: pal-portal/modules/ant-installer/trunk/images/resources/gothbar.gif =================================================================== (Binary files differ) Property changes on: pal-portal/modules/ant-installer/trunk/images/resources/gothbar.gif ___________________________________________________________________ Name: svn:mime-type + application/octet-stream Added: pal-portal/modules/ant-installer/trunk/images/resources/greens.png =================================================================== (Binary files differ) Property changes on: pal-portal/modules/ant-installer/trunk/images/resources/greens.png ___________________________________________________________________ Name: svn:mime-type + image/png Added: pal-portal/modules/ant-installer/trunk/images/resources/makewavesdawn.png =================================================================== (Binary files differ) Property changes on: pal-portal/modules/ant-installer/trunk/images/resources/makewavesdawn.png ___________________________________________________________________ Name: svn:mime-type + image/png Added: pal-portal/modules/ant-installer/trunk/images/resources/rockstiles.png =================================================================== (Binary files differ) Property changes on: pal-portal/modules/ant-installer/trunk/images/resources/rockstiles.png ___________________________________________________________________ Name: svn:mime-type + image/png Added: pal-portal/modules/ant-installer/trunk/images/titlebars/antbar.png =================================================================== (Binary files differ) Property changes on: pal-portal/modules/ant-installer/trunk/images/titlebars/antbar.png ___________________________________________________________________ Name: svn:mime-type + image/png Added: pal-portal/modules/ant-installer/trunk/images/titlebars/banner23.png =================================================================== (Binary files differ) Property changes on: pal-portal/modules/ant-installer/trunk/images/titlebars/banner23.png ___________________________________________________________________ Name: svn:mime-type + image/png Added: pal-portal/modules/ant-installer/trunk/images/titlebars/default-images.txt =================================================================== --- pal-portal/modules/ant-installer/trunk/images/titlebars/default-images.txt (rev 0) +++ pal-portal/modules/ant-installer/trunk/images/titlebars/default-images.txt 2008-06-11 13:36:41 UTC (rev 975) @@ -0,0 +1,5 @@ +Default Icons: Paul Hinds + +http://java.riereta.net + +License: Apache 2.0 \ No newline at end of file Property changes on: pal-portal/modules/ant-installer/trunk/images/titlebars/default-images.txt ___________________________________________________________________ Name: svn:eol-style + native Added: pal-portal/modules/ant-installer/trunk/images/titlebars/empty-template.png =================================================================== (Binary files differ) Property changes on: pal-portal/modules/ant-installer/trunk/images/titlebars/empty-template.png ___________________________________________________________________ Name: svn:mime-type + image/png Added: pal-portal/modules/ant-installer/trunk/images/titlebars/gothbar.gif =================================================================== (Binary files differ) Property changes on: pal-portal/modules/ant-installer/trunk/images/titlebars/gothbar.gif ___________________________________________________________________ Name: svn:mime-type + application/octet-stream Added: pal-portal/modules/ant-installer/trunk/images/titlebars/greens.png =================================================================== (Binary files differ) Property changes on: pal-portal/modules/ant-installer/trunk/images/titlebars/greens.png ___________________________________________________________________ Name: svn:mime-type + image/png Added: pal-portal/modules/ant-installer/trunk/images/titlebars/makewavesdawn.png =================================================================== (Binary files differ) Property changes on: pal-portal/modules/ant-installer/trunk/images/titlebars/makewavesdawn.png ___________________________________________________________________ Name: svn:mime-type + image/png Added: pal-portal/modules/ant-installer/trunk/images/titlebars/rockstiles.png =================================================================== (Binary files differ) Property changes on: pal-portal/modules/ant-installer/trunk/images/titlebars/rockstiles.png ___________________________________________________________________ Name: svn:mime-type + image/png Added: pal-portal/modules/ant-installer/trunk/images/tool-credits.txt =================================================================== --- pal-portal/modules/ant-installer/trunk/images/tool-credits.txt (rev 0) +++ pal-portal/modules/ant-installer/trunk/images/tool-credits.txt 2008-06-11 13:36:41 UTC (rev 975) @@ -0,0 +1,17 @@ + + + _-------_ + \ ()0o< / + \ /|\ / + \ / + \ / + 揃 +Default icons created with + + - inkscape - +http://www.inkscape.org + + - and the gimp - + http://www.gimp.org + + Property changes on: pal-portal/modules/ant-installer/trunk/images/tool-credits.txt ___________________________________________________________________ Name: svn:eol-style + native Added: pal-portal/modules/ant-installer/trunk/kde-icons/AntInstaller.png =================================================================== (Binary files differ) Property changes on: pal-portal/modules/ant-installer/trunk/kde-icons/AntInstaller.png ___________________________________________________________________ Name: svn:mime-type + image/png Added: pal-portal/modules/ant-installer/trunk/kde-icons/antinstaller-demo.desktop =================================================================== --- pal-portal/modules/ant-installer/trunk/kde-icons/antinstaller-demo.desktop (rev 0) +++ pal-portal/modules/ant-installer/trunk/kde-icons/antinstaller-demo.desktop 2008-06-11 13:36:41 UTC (rev 975) @@ -0,0 +1,14 @@ +[Desktop Entry] +Comment=AntInstaller Demo +Path=@installDir@ +Icon=@installDir@/kde-icons/AntInstaller.png +Exec=java -jar '@installDir@/demo/artifacts/demo-installer.jar' +Name=AntInstaller Demo +StartupNotify=true +Terminal=0 +TerminalOptions= +Type=Application +Encoding=UTF-8 +X-KDE-SubstituteUID=false +X-KDE-Username= +Categories=Development;Java \ No newline at end of file Added: pal-portal/modules/ant-installer/trunk/kde-icons/antinstaller-docs.desktop =================================================================== --- pal-portal/modules/ant-installer/trunk/kde-icons/antinstaller-docs.desktop (rev 0) +++ pal-portal/modules/ant-installer/trunk/kde-icons/antinstaller-docs.desktop 2008-06-11 13:36:41 UTC (rev 975) @@ -0,0 +1,14 @@ +[Desktop Entry] +Comment=AntInstaller Docs +Path=@installDir@ +Icon=@installDir@/kde-icons/AntInstaller.png +Exec=kfmclient exec '@installDir@/web/index.html' +Name=AntInstaller Docs +StartupNotify=true +Terminal=0 +TerminalOptions= +Type=Application +Encoding=UTF-8 +X-KDE-SubstituteUID=false +X-KDE-Username= +Categories=Development;Java \ No newline at end of file Added: pal-portal/modules/ant-installer/trunk/kde-icons/antinstaller-wizard.desktop =================================================================== --- pal-portal/modules/ant-installer/trunk/kde-icons/antinstaller-wizard.desktop (rev 0) +++ pal-portal/modules/ant-installer/trunk/kde-icons/antinstaller-wizard.desktop 2008-06-11 13:36:41 UTC (rev 975) @@ -0,0 +1,14 @@ +[Desktop Entry] +Comment=AntInstaller Project Wizard +Path=@installDir@ +Icon=@installDir@/kde-icons/AntInstaller.png +Exec='@installDir@/wizard.sh' +Name=AntInstaller Wizard +StartupNotify=true +Terminal=0 +TerminalOptions= +Type=Application +Encoding=UTF-8 +X-KDE-SubstituteUID=false +X-KDE-Username= +Categories=Development;Java \ No newline at end of file Added: pal-portal/modules/ant-installer/trunk/lib/LICENSE-ant-install.txt =================================================================== --- pal-portal/modules/ant-installer/trunk/lib/LICENSE-ant-install.txt (rev 0) +++ pal-portal/modules/ant-installer/trunk/lib/LICENSE-ant-install.txt 2008-06-11 13:36:41 UTC (rev 975) @@ -0,0 +1,202 @@ + + Apache License + Version 2.0, January 2004 + http://www.apache.org/licenses/ + + TERMS AND CONDITIONS FOR USE, REPRODUCTION, AND DISTRIBUTION + + 1. Definitions. + + "License" shall mean the terms and conditions for use, reproduction, + and distribution as defined by Sections 1 through 9 of this document. + + "Licensor" shall mean the copyright owner or entity authorized by + the copyright owner that is granting the License. + + "Legal Entity" shall mean the union of the acting entity and all + other entities that control, are controlled by, or are under common + control with that entity. For the purposes of this definition, + "control" means (i) the power, direct or indirect, to cause the + direction or management of such entity, whether by contract or + otherwise, or (ii) ownership of fifty percent (50%) or more of the + outstanding shares, or (iii) beneficial ownership of such entity. + + "You" (or "Your") shall mean an individual or Legal Entity + exercising permissions granted by this License. + + "Source" form shall mean the preferred form for making modifications, + including but not limited to software source code, documentation + source, and configuration files. + + "Object" form shall mean any form resulting from mechanical + transformation or translation of a Source form, including but + not limited to compiled object code, generated documentation, + and conversions to other media types. + + "Work" shall mean the work of authorship, whether in Source or + Object form, made available under the License, as indicated by a + copyright notice that is included in or attached to the work + (an example is provided in the Appendix below). + + "Derivative Works" shall mean any work, whether in Source or Object + form, that is based on (or derived from) the Work and for which the + editorial revisions, annotations, elaborations, or other modifications + represent, as a whole, an original work of authorship. For the purposes + of this License, Derivative Works shall not include works that remain + separable from, or merely link (or bind by name) to the interfaces of, + the Work and Derivative Works thereof. + + "Contribution" shall mean any work of authorship, including + the original version of the Work and any modifications or additions + to that Work or Derivative Works thereof, that is intentionally + submitted to Licensor for inclusion in the Work by the copyright owner + or by an individual or Legal Entity authorized to submit on behalf of + the copyright owner. For the purposes of this definition, "submitted" + means any form of electronic, verbal, or written communication sent + to the Licensor or its representatives, including but not limited to + communication on electronic mailing lists, source code control systems, + and issue tracking systems that are managed by, or on behalf of, the + Licensor for the purpose of discussing and improving the Work, but + excluding communication that is conspicuously marked or otherwise + designated in writing by the copyright owner as "Not a Contribution." + + "Contributor" shall mean Licensor and any individual or Legal Entity + on behalf of whom a Contribution has been received by Licensor and + subsequently incorporated within the Work. + + 2. Grant of Copyright License. Subject to the terms and conditions of + this License, each Contributor hereby grants to You a perpetual, + worldwide, non-exclusive, no-charge, royalty-free, irrevocable + copyright license to reproduce, prepare Derivative Works of, + publicly display, publicly perform, sublicense, and distribute the + Work and such Derivative Works in Source or Object form. + + 3. Grant of Patent License. Subject to the terms and conditions of + this License, each Contributor hereby grants to You a perpetual, + worldwide, non-exclusive, no-charge, royalty-free, irrevocable + (except as stated in this section) patent license to make, have made, + use, offer to sell, sell, import, and otherwise transfer the Work, + where such license applies only to those patent claims licensable + by such Contributor that are necessarily infringed by their + Contribution(s) alone or by combination of their Contribution(s) + with the Work to which such Contribution(s) was submitted. If You + institute patent litigation against any entity (including a + cross-claim or counterclaim in a lawsuit) alleging that the Work + or a Contribution incorporated within the Work constitutes direct + or contributory patent infringement, then any patent licenses + granted to You under this License for that Work shall terminate + as of the date such litigation is filed. + + 4. Redistribution. You may reproduce and distribute copies of the + Work or Derivative Works thereof in any medium, with or without + modifications, and in Source or Object form, provided that You + meet the following conditions: + + (a) You must give any other recipients of the Work or + Derivative Works a copy of this License; and + + (b) You must cause any modified files to carry prominent notices + stating that You changed the files; and + + (c) You must retain, in the Source form of any Derivative Works + that You distribute, all copyright, patent, trademark, and + attribution notices from the Source form of the Work, + excluding those notices that do not pertain to any part of + the Derivative Works; and + + (d) If the Work includes a "NOTICE" text file as part of its + distribution, then any Derivative Works that You distribute must + include a readable copy of the attribution notices contained + within such NOTICE file, excluding those notices that do not + pertain to any part of the Derivative Works, in at least one + of the following places: within a NOTICE text file distributed + as part of the Derivative Works; within the Source form or + documentation, if provided along with the Derivative Works; or, + within a display generated by the Derivative Works, if and + wherever such third-party notices normally appear. The contents + of the NOTICE file are for informational purposes only and + do not modify the License. You may add Your own attribution + notices within Derivative Works that You distribute, alongside + or as an addendum to the NOTICE text from the Work, provided + that such additional attribution notices cannot be construed + as modifying the License. + + You may add Your own copyright statement to Your modifications and + may provide additional or different license terms and conditions + for use, reproduction, or distribution of Your modifications, or + for any such Derivative Works as a whole, provided Your use, + reproduction, and distribution of the Work otherwise complies with + the conditions stated in this License. + + 5. Submission of Contributions. Unless You explicitly state otherwise, + any Contribution intentionally submitted for inclusion in the Work + by You to the Licensor shall be under the terms and conditions of + this License, without any additional terms or conditions. + Notwithstanding the above, nothing herein shall supersede or modify + the terms of any separate license agreement you may have executed + with Licensor regarding such Contributions. + + 6. Trademarks. This License does not grant permission to use the trade + names, trademarks, service marks, or product names of the Licensor, + except as required for reasonable and customary use in describing the + origin of the Work and reproducing the content of the NOTICE file. + + 7. Disclaimer of Warranty. Unless required by applicable law or + agreed to in writing, Licensor provides the Work (and each + Contributor provides its Contributions) on an "AS IS" BASIS, + WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or + implied, including, without limitation, any warranties or conditions + of TITLE, NON-INFRINGEMENT, MERCHANTABILITY, or FITNESS FOR A + PARTICULAR PURPOSE. You are solely responsible for determining the + appropriateness of using or redistributing the Work and assume any + risks associated with Your exercise of permissions under this License. + + 8. Limitation of Liability. In no event and under no legal theory, + whether in tort (including negligence), contract, or otherwise, + unless required by applicable law (such as deliberate and grossly + negligent acts) or agreed to in writing, shall any Contributor be + liable to You for damages, including any direct, indirect, special, + incidental, or consequential damages of any character arising as a + result of this License or out of the use or inability to use the + Work (including but not limited to damages for loss of goodwill, + work stoppage, computer failure or malfunction, or any and all + other commercial damages or losses), even if such Contributor + has been advised of the possibility of such damages. + + 9. Accepting Warranty or Additional Liability. While redistributing + the Work or Derivative Works thereof, You may choose to offer, + and charge a fee for, acceptance of support, warranty, indemnity, + or other liability obligations and/or rights consistent with this + License. However, in accepting such obligations, You may act only + on Your own behalf and on Your sole responsibility, not on behalf + of any other Contributor, and only if You agree to indemnify, + defend, and hold each Contributor harmless for any liability + incurred by, or claims asserted against, such Contributor by reason + of your accepting any such warranty or additional liability. + + END OF TERMS AND CONDITIONS + + APPENDIX: How to apply the Apache License to your work. + + To apply the Apache License to your work, attach the following + boilerplate notice, with the fields enclosed by brackets "[]" + replaced with your own identifying information. (Don't include + the brackets!) The text should be enclosed in the appropriate + comment syntax for the file format. We also recommend that a + file or class name and description of purpose be included on the + same "printed page" as the copyright notice for easier + identification within third-party archives. + + Copyright [yyyy] [name of copyright owner] + + Licensed under the Apache License, Version 2.0 (the "License"); + you may not use this file except in compliance with the License. + You may obtain a copy of the License at + + http://www.apache.org/licenses/LICENSE-2.0 + + Unless required by applicable law or agreed to in writing, software + distributed under the License is distributed on an "AS IS" BASIS, + WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + See the License for the specific language governing permissions and + limitations under the License. Property changes on: pal-portal/modules/ant-installer/trunk/lib/LICENSE-ant-install.txt ___________________________________________________________________ Name: svn:eol-style + native Added: pal-portal/modules/ant-installer/trunk/lib/LICENSE-ant.txt =================================================================== --- pal-portal/modules/ant-installer/trunk/lib/LICENSE-ant.txt (rev 0) +++ pal-portal/modules/ant-installer/trunk/lib/LICENSE-ant.txt 2008-06-11 13:36:41 UTC (rev 975) @@ -0,0 +1,203 @@ +/* + * Apache License + * Version 2.0, January 2004 + * http://www.apache.org/licenses/ + * + * TERMS AND CONDITIONS FOR USE, REPRODUCTION, AND DISTRIBUTION + * + * 1. Definitions. + * + * "License" shall mean the terms and conditions for use, reproduction, + * and distribution as defined by Sections 1 through 9 of this document. + * + * "Licensor" shall mean the copyright owner or entity authorized by + * the copyright owner that is granting the License. + * + * "Legal Entity" shall mean the union of the acting entity and all + * other entities that control, are controlled by, or are under common + * control with that entity. For the purposes of this definition, + * "control" means (i) the power, direct or indirect, to cause the + * direction or management of such entity, whether by contract or + * otherwise, or (ii) ownership of fifty percent (50%) or more of the + * outstanding shares, or (iii) beneficial ownership of such entity. + * + * "You" (or "Your") shall mean an individual or Legal Entity + * exercising permissions granted by this License. + * + * "Source" form shall mean the preferred form for making modifications, + * including but not limited to software source code, documentation + * source, and configuration files. + * + * "Object" form shall mean any form resulting from mechanical + * transformation or translation of a Source form, including but + * not limited to compiled object code, generated documentation, + * and conversions to other media types. + * + * "Work" shall mean the work of authorship, whether in Source or + * Object form, made available under the License, as indicated by a + * copyright notice that is included in or attached to the work + * (an example is provided in the Appendix below). + * + * "Derivative Works" shall mean any work, whether in Source or Object + * form, that is based on (or derived from) the Work and for which the + * editorial revisions, annotations, elaborations, or other modifications + * represent, as a whole, an original work of authorship. For the purposes + * of this License, Derivative Works shall not include works that remain + * separable from, or merely link (or bind by name) to the interfaces of, + * the Work and Derivative Works thereof. + * + * "Contribution" shall mean any work of authorship, including + * the original version of the Work and any modifications or additions + * to that Work or Derivative Works thereof, that is intentionally + * submitted to Licensor for inclusion in the Work by the copyright owner + * or by an individual or Legal Entity authorized to submit on behalf of + * the copyright owner. For the purposes of this definition, "submitted" + * means any form of electronic, verbal, or written communication sent + * to the Licensor or its representatives, including but not limited to + * communication on electronic mailing lists, source code control systems, + * and issue tracking systems that are managed by, or on behalf of, the + * Licensor for the purpose of discussing and improving the Work, but + * excluding communication that is conspicuously marked or otherwise + * designated in writing by the copyright owner as "Not a Contribution." + * + * "Contributor" shall mean Licensor and any individual or Legal Entity + * on behalf of whom a Contribution has been received by Licensor and + * subsequently incorporated within the Work. + * + * 2. Grant of Copyright License. Subject to the terms and conditions of + * this License, each Contributor hereby grants to You a perpetual, + * worldwide, non-exclusive, no-charge, royalty-free, irrevocable + * copyright license to reproduce, prepare Derivative Works of, + * publicly display, publicly perform, sublicense, and distribute the + * Work and such Derivative Works in Source or Object form. + * + * 3. Grant of Patent License. Subject to the terms and conditions of + * this License, each Contributor hereby grants to You a perpetual, + * worldwide, non-exclusive, no-charge, royalty-free, irrevocable + * (except as stated in this section) patent license to make, have made, + * use, offer to sell, sell, import, and otherwise transfer the Work, + * where such license applies only to those patent claims licensable + * by such Contributor that are necessarily infringed by their + * Contribution(s) alone or by combination of their Contribution(s) + * with the Work to which such Contribution(s) was submitted. If You + * institute patent litigation against any entity (including a + * cross-claim or counterclaim in a lawsuit) alleging that the Work + * or a Contribution incorporated within the Work constitutes direct + * or contributory patent infringement, then any patent licenses + * granted to You under this License for that Work shall terminate + * as of the date such litigation is filed. + * + * 4. Redistribution. You may reproduce and distribute copies of the + * Work or Derivative Works thereof in any medium, with or without + * modifications, and in Source or Object form, provided that You + * meet the following conditions: + * + * (a) You must give any other recipients of the Work or + * Derivative Works a copy of this License; and + * + * (b) You must cause any modified files to carry prominent notices + * stating that You changed the files; and + * + * (c) You must retain, in the Source form of any Derivative Works + * that You distribute, all copyright, patent, trademark, and + * attribution notices from the Source form of the Work, + * excluding those notices that do not pertain to any part of + * the Derivative Works; and + * + * (d) If the Work includes a "NOTICE" text file as part of its + * distribution, then any Derivative Works that You distribute must + * include a readable copy of the attribution notices contained + * within such NOTICE file, excluding those notices that do not + * pertain to any part of the Derivative Works, in at least one + * of the following places: within a NOTICE text file distributed + * as part of the Derivative Works; within the Source form or + * documentation, if provided along with the Derivative Works; or, + * within a display generated by the Derivative Works, if and + * wherever such third-party notices normally appear. The contents + * of the NOTICE file are for informational purposes only and + * do not modify the License. You may add Your own attribution + * notices within Derivative Works that You distribute, alongside + * or as an addendum to the NOTICE text from the Work, provided + * that such additional attribution notices cannot be construed + * as modifying the License. + * + * You may add Your own copyright statement to Your modifications and + * may provide additional or different license terms and conditions + * for use, reproduction, or distribution of Your modifications, or + * for any such Derivative Works as a whole, provided Your use, + * reproduction, and distribution of the Work otherwise complies with + * the conditions stated in this License. + * + * 5. Submission of Contributions. Unless You explicitly state otherwise, + * any Contribution intentionally submitted for inclusion in the Work + * by You to the Licensor shall be under the terms and conditions of + * this License, without any additional terms or conditions. + * Notwithstanding the above, nothing herein shall supersede or modify + * the terms of any separate license agreement you may have executed + * with Licensor regarding such Contributions. + * + * 6. Trademarks. This License does not grant permission to use the trade + * names, trademarks, service marks, or product names of the Licensor, + * except as required for reasonable and customary use in describing the + * origin of the Work and reproducing the content of the NOTICE file. + * + * 7. Disclaimer of Warranty. Unless required by applicable law or + * agreed to in writing, Licensor provides the Work (and each + * Contributor provides its Contributions) on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or + * implied, including, without limitation, any warranties or conditions + * of TITLE, NON-INFRINGEMENT, MERCHANTABILITY, or FITNESS FOR A + * PARTICULAR PURPOSE. You are solely responsible for determining the + * appropriateness of using or redistributing the Work and assume any + * risks associated with Your exercise of permissions under this License. + * + * 8. Limitation of Liability. In no event and under no legal theory, + * whether in tort (including negligence), contract, or otherwise, + * unless required by applicable law (such as deliberate and grossly + * negligent acts) or agreed to in writing, shall any Contributor be + * liable to You for damages, including any direct, indirect, special, + * incidental, or consequential damages of any character arising as a + * result of this License or out of the use or inability to use the + * Work (including but not limited to damages for loss of goodwill, + * work stoppage, computer failure or malfunction, or any and all + * other commercial damages or losses), even if such Contributor + * has been advised of the possibility of such damages. + * + * 9. Accepting Warranty or Additional Liability. While redistributing + * the Work or Derivative Works thereof, You may choose to offer, + * and charge a fee for, acceptance of support, warranty, indemnity, + * or other liability obligations and/or rights consistent with this + * License. However, in accepting such obligations, You may act only + * on Your own behalf and on Your sole responsibility, not on behalf + * of any other Contributor, and only if You agree to indemnify, + * defend, and hold each Contributor harmless for any liability + * incurred by, or claims asserted against, such Contributor by reason + * of your accepting any such warranty or additional liability. + * + * END OF TERMS AND CONDITIONS + * + * APPENDIX: How to apply the Apache License to your work. + * + * To apply the Apache License to your work, attach the following + * boilerplate notice, with the fields enclosed by brackets "[]" + * replaced with your own identifying information. (Don't include + * the brackets!) The text should be enclosed in the appropriate + * comment syntax for the file format. We also recommend that a + * file or class name and description of purpose be included on the + * same "printed page" as the copyright notice for easier + * identification within third-party archives. + * + * Copyright [yyyy] [name of copyright owner] + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ Property changes on: pal-portal/modules/ant-installer/trunk/lib/LICENSE-ant.txt ___________________________________________________________________ Name: svn:eol-style + native Added: pal-portal/modules/ant-installer/trunk/lib/LICENSE-dom.txt =================================================================== --- pal-portal/modules/ant-installer/trunk/lib/LICENSE-dom.txt (rev 0) +++ pal-portal/modules/ant-installer/trunk/lib/LICENSE-dom.txt 2008-06-11 13:36:41 UTC (rev 975) @@ -0,0 +1,71 @@ +This license came from: +http://www.w3.org/Consortium/Legal/copyright-software-19980720 + + +W3C?SOFTWARE NOTICE AND LICENSE +Copyright ?1994-2001 World +Wide Web Consortium, World +Wide Web Consortium, (Massachusetts Institute of +Technology, Institut National de +Recherche en Informatique et en Automatique, Keio University). All Rights Reserved. +http://www.w3.org/Consortium/Legal/ + +This W3C work (including software, documents, or other related +items) is being provided by the copyright holders under the +following license. By obtaining, using and/or copying this work, +you (the licensee) agree that you have read, understood, and will +comply with the following terms and conditions: +Permission to use, copy, modify, and distribute this software +and its documentation, with or without modification,?for any +purpose and without fee or royalty is hereby granted, provided that +you include the following on ALL copies of the software and +documentation or portions thereof, including modifications, that +you make: + +The full text of this NOTICE in a location viewable to users of +the redistributed or derivative work. + +Any pre-existing intellectual property disclaimers, notices, or +terms and conditions. If none exist, a short notice of the +following form (hypertext is preferred, text is permitted) should +be used within the body of any redistributed or derivative code: +"Copyright ?[$date-of-software] World Wide Web Consortium, (Massachusetts Institute of +Technology, Institut National de +Recherche en Informatique et en Automatique, Keio University). All Rights Reserved. +http://www.w3.org/Consortium/Legal/" + +Notice of any changes or modifications to the W3C files, +including the date changes were made. (We recommend you provide +URIs to the location from which the code is derived.) + +THIS SOFTWARE AND DOCUMENTATION IS PROVIDED "AS IS," AND +COPYRIGHT HOLDERS MAKE NO REPRESENTATIONS OR WARRANTIES, EXPRESS OR +IMPLIED, INCLUDING BUT NOT LIMITED TO, WARRANTIES OF +MERCHANTABILITY OR FITNESS FOR ANY PARTICULAR PURPOSE OR THAT THE +USE OF THE SOFTWARE OR DOCUMENTATION WILL NOT INFRINGE ANY THIRD +PARTY PATENTS, COPYRIGHTS, TRADEMARKS OR OTHER RIGHTS. +COPYRIGHT HOLDERS WILL NOT BE LIABLE FOR ANY DIRECT, INDIRECT, +SPECIAL OR CONSEQUENTIAL DAMAGES ARISING OUT OF ANY USE OF THE +SOFTWARE OR DOCUMENTATION. + +The name and trademarks of copyright holders may NOT be used in +advertising or publicity pertaining to the software without +specific, written prior permission. Title to copyright in this +software and any associated documentation will at all times remain +with copyright holders. +____________________________________ +This formulation of W3C's notice and license became active on +August 14 1998 so as to improve compatibility with GPL. This +version ensures that W3C software licensing terms are no more +restrictive than GPL and consequently W3C software may be +distributed in GPL packages. See the older formulation for the +policy prior to this date. Please see our Copyright FAQ for common +questions about using materials from +our site, including specific terms and conditions for packages like +libwww, Amaya, and Jigsaw. +Other questions about this notice can be +directed to site-policy @ w3.org. + +webmaster Property changes on: pal-portal/modules/ant-installer/trunk/lib/LICENSE-dom.txt ___________________________________________________________________ Name: svn:eol-style + native Added: pal-portal/modules/ant-installer/trunk/lib/LICENSE-jgoodies.txt =================================================================== --- pal-portal/modules/ant-installer/trunk/lib/LICENSE-jgoodies.txt (rev 0) +++ pal-portal/modules/ant-installer/trunk/lib/LICENSE-jgoodies.txt 2008-06-11 13:36:41 UTC (rev 975) @@ -0,0 +1,31 @@ + + The BSD License for the JGoodies Looks + ====================================== + +Copyright (c) 2001-2004 JGoodies Karsten Lentzsch. All rights reserved. + +Redistribution and use in source and binary forms, with or without +modification, are permitted provided that the following conditions are met: + + o Redistributions of source code must retain the above copyright notice, + this list of conditions and the following disclaimer. + + o Redistributions in binary form must reproduce the above copyright notice, + this list of conditions and the following disclaimer in the documentation + and/or other materials provided with the distribution. + + o Neither the name of JGoodies Karsten Lentzsch nor the names of + its contributors may be used to endorse or promote products derived + from this software without specific prior written permission. + +THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" +AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, +THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR +PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR +CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, +EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, +PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; +OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, +WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR +OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, +EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. Property changes on: pal-portal/modules/ant-installer/trunk/lib/LICENSE-jgoodies.txt ___________________________________________________________________ Name: svn:eol-style + native Added: pal-portal/modules/ant-installer/trunk/lib/LICENSE-sax.txt =================================================================== --- pal-portal/modules/ant-installer/trunk/lib/LICENSE-sax.txt (rev 0) +++ pal-portal/modules/ant-installer/trunk/lib/LICENSE-sax.txt 2008-06-11 13:36:41 UTC (rev 975) @@ -0,0 +1,20 @@ +This license came from: http://www.megginson.com/SAX/copying.html + However please note future versions of SAX may be covered + under http://saxproject.org/?selected=pd + + +This page is now out of date -- see the new SAX site at +http://www.saxproject.org/ for more up-to-date +releases and other information. Please change your bookmarks. + + +SAX2 is Free! + +I hereby abandon any property rights to SAX 2.0 (the Simple API for +XML), and release all of the SAX 2.0 source code, compiled code, and +documentation contained in this distribution into the Public Domain. +SAX comes with NO WARRANTY or guarantee of fitness for any +purpose. + +David Megginson, david @ megginson.com +2000-05-05 \ No newline at end of file Property changes on: pal-portal/modules/ant-installer/trunk/lib/LICENSE-sax.txt ___________________________________________________________________ Name: svn:eol-style + native Added: pal-portal/modules/ant-installer/trunk/lib/LICENSE-sysout.txt =================================================================== --- pal-portal/modules/ant-installer/trunk/lib/LICENSE-sysout.txt (rev 0) +++ pal-portal/modules/ant-installer/trunk/lib/LICENSE-sysout.txt 2008-06-11 13:36:41 UTC (rev 975) @@ -0,0 +1,202 @@ + + Apache License + Version 2.0, January 2004 + http://www.apache.org/licenses/ + + TERMS AND CONDITIONS FOR USE, REPRODUCTION, AND DISTRIBUTION + + 1. Definitions. + + "License" shall mean the terms and conditions for use, reproduction, + and distribution as defined by Sections 1 through 9 of this document. + + "Licensor" shall mean the copyright owner or entity authorized by + the copyright owner that is granting the License. + + "Legal Entity" shall mean the union of the acting entity and all + other entities that control, are controlled by, or are under common + control with that entity. For the purposes of this definition, + "control" means (i) the power, direct or indirect, to cause the + direction or management of such entity, whether by contract or + otherwise, or (ii) ownership of fifty percent (50%) or more of the + outstanding shares, or (iii) beneficial ownership of such entity. + + "You" (or "Your") shall mean an individual or Legal Entity + exercising permissions granted by this License. + + "Source" form shall mean the preferred form for making modifications, + including but not limited to software source code, documentation + source, and configuration files. + + "Object" form shall mean any form resulting from mechanical + transformation or translation of a Source form, including but + not limited to compiled object code, generated documentation, + and conversions to other media types. + + "Work" shall mean the work of authorship, whether in Source or + Object form, made available under the License, as indicated by a + copyright notice that is included in or attached to the work + (an example is provided in the Appendix below). + + "Derivative Works" shall mean any work, whether in Source or Object + form, that is based on (or derived from) the Work and for which the + editorial revisions, annotations, elaborations, or other modifications + represent, as a whole, an original work of authorship. For the purposes + of this License, Derivative Works shall not include works that remain + separable from, or merely link (or bind by name) to the interfaces of, + the Work and Derivative Works thereof. + + "Contribution" shall mean any work of authorship, including + the original version of the Work and any modifications or additions + to that Work or Derivative Works thereof, that is intentionally + submitted to Licensor for inclusion in the Work by the copyright owner + or by an individual or Legal Entity authorized to submit on behalf of + the copyright owner. For the purposes of this definition, "submitted" + means any form of electronic, verbal, or written communication sent + to the Licensor or its representatives, including but not limited to + communication on electronic mailing lists, source code control systems, + and issue tracking systems that are managed by, or on behalf of, the + Licensor for the purpose of discussing and improving the Work, but + excluding communication that is conspicuously marked or otherwise + designated in writing by the copyright owner as "Not a Contribution." + + "Contributor" shall mean Licensor and any individual or Legal Entity + on behalf of whom a Contribution has been received by Licensor and + subsequently incorporated within the Work. + + 2. Grant of Copyright License. Subject to the terms and conditions of + this License, each Contributor hereby grants to You a perpetual, + worldwide, non-exclusive, no-charge, royalty-free, irrevocable + copyright license to reproduce, prepare Derivative Works of, + publicly display, publicly perform, sublicense, and distribute the + Work and such Derivative Works in Source or Object form. + + 3. Grant of Patent License. Subject to the terms and conditions of + this License, each Contributor hereby grants to You a perpetual, + worldwide, non-exclusive, no-charge, royalty-free, irrevocable + (except as stated in this section) patent license to make, have made, + use, offer to sell, sell, import, and otherwise transfer the Work, + where such license applies only to those patent claims licensable + by such Contributor that are necessarily infringed by their + Contribution(s) alone or by combination of their Contribution(s) + with the Work to which such Contribution(s) was submitted. If You + institute patent litigation against any entity (including a + cross-claim or counterclaim in a lawsuit) alleging that the Work + or a Contribution incorporated within the Work constitutes direct + or contributory patent infringement, then any patent licenses + granted to You under this License for that Work shall terminate + as of the date such litigation is filed. + + 4. Redistribution. You may reproduce and distribute copies of the + Work or Derivative Works thereof in any medium, with or without + modifications, and in Source or Object form, provided that You + meet the following conditions: + + (a) You must give any other recipients of the Work or + Derivative Works a copy of this License; and + + (b) You must cause any modified files to carry prominent notices + stating that You changed the files; and + + (c) You must retain, in the Source form of any Derivative Works + that You distribute, all copyright, patent, trademark, and + attribution notices from the Source form of the Work, + excluding those notices that do not pertain to any part of + the Derivative Works; and + + (d) If the Work includes a "NOTICE" text file as part of its + distribution, then any Derivative Works that You distribute must + include a readable copy of the attribution notices contained + within such NOTICE file, excluding those notices that do not + pertain to any part of the Derivative Works, in at least one + of the following places: within a NOTICE text file distributed + as part of the Derivative Works; within the Source form or + documentation, if provided along with the Derivative Works; or, + within a display generated by the Derivative Works, if and + wherever such third-party notices normally appear. The contents + of the NOTICE file are for informational purposes only and + do not modify the License. You may add Your own attribution + notices within Derivative Works that You distribute, alongside + or as an addendum to the NOTICE text from the Work, provided + that such additional attribution notices cannot be construed + as modifying the License. + + You may add Your own copyright statement to Your modifications and + may provide additional or different license terms and conditions + for use, reproduction, or distribution of Your modifications, or + for any such Derivative Works as a whole, provided Your use, + reproduction, and distribution of the Work otherwise complies with + the conditions stated in this License. + + 5. Submission of Contributions. Unless You explicitly state otherwise, + any Contribution intentionally submitted for inclusion in the Work + by You to the Licensor shall be under the terms and conditions of + this License, without any additional terms or conditions. + Notwithstanding the above, nothing herein shall supersede or modify + the terms of any separate license agreement you may have executed + with Licensor regarding such Contributions. + + 6. Trademarks. This License does not grant permission to use the trade + names, trademarks, service marks, or product names of the Licensor, + except as required for reasonable and customary use in describing the + origin of the Work and reproducing the content of the NOTICE file. + + 7. Disclaimer of Warranty. Unless required by applicable law or + agreed to in writing, Licensor provides the Work (and each + Contributor provides its Contributions) on an "AS IS" BASIS, + WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or + implied, including, without limitation, any warranties or conditions + of TITLE, NON-INFRINGEMENT, MERCHANTABILITY, or FITNESS FOR A + PARTICULAR PURPOSE. You are solely responsible for determining the + appropriateness of using or redistributing the Work and assume any + risks associated with Your exercise of permissions under this License. + + 8. Limitation of Liability. In no event and under no legal theory, + whether in tort (including negligence), contract, or otherwise, + unless required by applicable law (such as deliberate and grossly + negligent acts) or agreed to in writing, shall any Contributor be + liable to You for damages, including any direct, indirect, special, + incidental, or consequential damages of any character arising as a + result of this License or out of the use or inability to use the + Work (including but not limited to damages for loss of goodwill, + work stoppage, computer failure or malfunction, or any and all + other commercial damages or losses), even if such Contributor + has been advised of the possibility of such damages. + + 9. Accepting Warranty or Additional Liability. While redistributing + the Work or Derivative Works thereof, You may choose to offer, + and charge a fee for, acceptance of support, warranty, indemnity, + or other liability obligations and/or rights consistent with this + License. However, in accepting such obligations, You may act only + on Your own behalf and on Your sole responsibility, not on behalf + of any other Contributor, and only if You agree to indemnify, + defend, and hold each Contributor harmless for any liability + incurred by, or claims asserted against, such Contributor by reason + of your accepting any such warranty or additional liability. + + END OF TERMS AND CONDITIONS + + APPENDIX: How to apply the Apache License to your work. + + To apply the Apache License to your work, attach the following + boilerplate notice, with the fields enclosed by brackets "[]" + replaced with your own identifying information. (Don't include + the brackets!) The text should be enclosed in the appropriate + comment syntax for the file format. We also recommend that a + file or class name and description of purpose be included on the + same "printed page" as the copyright notice for easier + identification within third-party archives. + + Copyright [yyyy] [name of copyright owner] + + Licensed under the Apache License, Version 2.0 (the "License"); + you may not use this file except in compliance with the License. + You may obtain a copy of the License at + + http://www.apache.org/licenses/LICENSE-2.0 + + Unless required by applicable law or agreed to in writing, software + distributed under the License is distributed on an "AS IS" BASIS, + WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + See the License for the specific language governing permissions and + limitations under the License. Property changes on: pal-portal/modules/ant-installer/trunk/lib/LICENSE-sysout.txt ___________________________________________________________________ Name: svn:eol-style + native Added: pal-portal/modules/ant-installer/trunk/lib/LICENSE-xerces.txt =================================================================== --- pal-portal/modules/ant-installer/trunk/lib/LICENSE-xerces.txt (rev 0) +++ pal-portal/modules/ant-installer/trunk/lib/LICENSE-xerces.txt 2008-06-11 13:36:41 UTC (rev 975) @@ -0,0 +1,56 @@ +/* + * The Apache Software License, Version 1.1 + * + * + * Copyright (c) 1999-2002 The Apache Software Foundation. All rights + * reserved. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions + * are met: + * + * 1. Redistributions of source code must retain the above copyright + * notice, this list of conditions and the following disclaimer. + * + * 2. Redistributions in binary form must reproduce the above copyright + * notice, this list of conditions and the following disclaimer in + * the documentation and/or other materials provided with the + * distribution. + * + * 3. The end-user documentation included with the redistribution, + * if any, must include the following acknowledgment: + * "This product includes software developed by the + * Apache Software Foundation (http://www.apache.org/)." + * Alternately, this acknowledgment may appear in the software itself, + * if and wherever such third-party acknowledgments normally appear. + * + * 4. The names "Xerces" and "Apache Software Foundation" must + * not be used to endorse or promote products derived from this + * software without prior written permission. For written + * permission, please contact apache @ apache.org. + * + * 5. Products derived from this software may not be called "Apache", + * nor may "Apache" appear in their name, without prior written + * permission of the Apache Software Foundation. + * + * THIS SOFTWARE IS PROVIDED ``AS IS'' AND ANY EXPRESSED OR IMPLIED + * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES + * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE + * DISCLAIMED. IN NO EVENT SHALL THE APACHE SOFTWARE FOUNDATION OR + * ITS CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, + * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT + * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF + * USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND + * ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, + * OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT + * OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF + * SUCH DAMAGE. + * ==================================================================== + * + * This software consists of voluntary contributions made by many + * individuals on behalf of the Apache Software Foundation and was + * originally based on software copyright (c) 1999, International + * Business Machines, Inc., http://www.ibm.com. For more + * information on the Apache Software Foundation, please see + * . + */ Property changes on: pal-portal/modules/ant-installer/trunk/lib/LICENSE-xerces.txt ___________________________________________________________________ Name: svn:eol-style + native Added: pal-portal/modules/ant-installer/trunk/lib/ai-icons-amaranth.jar =================================================================== (Binary files differ) Property changes on: pal-portal/modules/ant-installer/trunk/lib/ai-icons-amaranth.jar ___________________________________________________________________ Name: svn:mime-type + application/octet-stream Added: pal-portal/modules/ant-installer/trunk/lib/ai-icons-bluecurve.jar =================================================================== (Binary files differ) Property changes on: pal-portal/modules/ant-installer/trunk/lib/ai-icons-bluecurve.jar ___________________________________________________________________ Name: svn:mime-type + application/octet-stream Added: pal-portal/modules/ant-installer/trunk/lib/ai-icons-crystalsvg.jar =================================================================== (Binary files differ) Property changes on: pal-portal/modules/ant-installer/trunk/lib/ai-icons-crystalsvg.jar ___________________________________________________________________ Name: svn:mime-type + application/octet-stream Added: pal-portal/modules/ant-installer/trunk/lib/ai-icons-eclipse.jar =================================================================== (Binary files differ) Property changes on: pal-portal/modules/ant-installer/trunk/lib/ai-icons-eclipse.jar ___________________________________________________________________ Name: svn:mime-type + application/octet-stream Added: pal-portal/modules/ant-installer/trunk/lib/ai-icons-krystaline.jar =================================================================== (Binary files differ) Property changes on: pal-portal/modules/ant-installer/trunk/lib/ai-icons-krystaline.jar ___________________________________________________________________ Name: svn:mime-type + application/octet-stream Added: pal-portal/modules/ant-installer/trunk/lib/ant-installer-ext.jar =================================================================== (Binary files differ) Property changes on: pal-portal/modules/ant-installer/trunk/lib/ant-installer-ext.jar ___________________________________________________________________ Name: svn:mime-type + application/octet-stream Added: pal-portal/modules/ant-installer/trunk/lib/ant-installer.jar =================================================================== (Binary files differ) Property changes on: pal-portal/modules/ant-installer/trunk/lib/ant-installer.jar ___________________________________________________________________ Name: svn:mime-type + application/octet-stream Added: pal-portal/modules/ant-installer/trunk/lib/jgoodies-edited-1_2_2.jar =================================================================== (Binary files differ) Property changes on: pal-portal/modules/ant-installer/trunk/lib/jgoodies-edited-1_2_2.jar ___________________________________________________________________ Name: svn:mime-type + application/octet-stream Added: pal-portal/modules/ant-installer/trunk/lib/xercesImpl.jar =================================================================== (Binary files differ) Property changes on: pal-portal/modules/ant-installer/trunk/lib/xercesImpl.jar ___________________________________________________________________ Name: svn:mime-type + application/octet-stream Added: pal-portal/modules/ant-installer/trunk/lib/xml-apis.jar =================================================================== (Binary files differ) Property changes on: pal-portal/modules/ant-installer/trunk/lib/xml-apis.jar ___________________________________________________________________ Name: svn:mime-type + application/octet-stream Added: pal-portal/modules/ant-installer/trunk/src/README.txt =================================================================== --- pal-portal/modules/ant-installer/trunk/src/README.txt (rev 0) +++ pal-portal/modules/ant-installer/trunk/src/README.txt 2008-06-11 13:36:41 UTC (rev 975) @@ -0,0 +1,109 @@ + +This SelfExtracting archive should be run with Java to start the installation. +________________________________________________________________________________ + +If Java1.4 is installed correctly simply double click the .jar file in your +file browser. + + +To run the installer from the commandline +WINDOWS + C:\> javaw -jar [installer-file].jar +UNIX + > java -jar [installer-file].jar + + +If the .jar extension has been reregistered you will need to specify the Java +command + +WINDOWS + + Right mouse click on the file and select "Open with" then "javaw" + + +LINUX + + Konquerer (KDE) right mouse click and select "Open with" then "java" + + + + + +TROUBLESHOOTING +________________________________________________________________________________ + + +WINDOWS +________________________________________________________________________________ +If you do not have the "javaw" entry in the "Open with" list + Check that you have a current version of Java ( >1.4 ) installed. + The Sun Java installation process registers javaw with .jars in the + installation. + You can reinstall Java if you still have the original installer. + If you don't have the installer, or don't want to reinstall Java, you can + modify the registration of the .jar extension. + In Explorer select "Tools" then "Folder options" + Select the "File types" tab + First check to see if teh JAR Extension is in the list + JAR extension IS in the list + click the "Change" button + find javaw in the list of files + click OK + JAR extension NOT in list + click the New button + enter "jar" as the file extension + Enter as the file type + + + + + +LINUX +________________________________________________________________________________ + +Using X + +Log in to the shell as the user that is running X +Ensure you have exported your DISPLAY variable (echo $DISPLAY) if not export it +> export DISPLAY=127.0.0.1:0 + +Check the default java is the correct version +> java -version + + If the java binary is not found, but you do have Java installed + Add the bin directory of the Java installation to your path + > export PATH=$PATH:[path to Java]/bin + run the installer with > java -jar [installer-file].jar + + If the default java version is below 1.4 + If you do NOT have a recent version installed anywhere on your system + install the Sun Java JRE or SDK for linux. + If/when you DO have a recent version of Java installed + find the location of the java installation + e.g /usr/java/j2sdk1.4.2_04 + export the JAVA_HOME variable of the installation + > export JAVA_HOME=/usr/java/j2sdk1.4.2_04 + run the following command + > $JAVA_HOME/bin/java -jar [installer-file].jar + You should consider adding the export JAVA_HOME entry to your profile + and/or ensure the location of the JAVA_HOME/bin directory for Java >1.4 + is in your PATH + + If the default java version IS above 1.4 + run the installer with > java -jar [installer-file].jar + + +Without X (command line) + +The installer will run on the command line with a text interface if it is not +possible to load the GUI. +running the following command without a DISPLAY variable or in runlevel 3 will +start the installer in text mode +> java -jar [installer-file].jar + + + + + + + \ No newline at end of file Property changes on: pal-portal/modules/ant-installer/trunk/src/README.txt ___________________________________________________________________ Name: svn:eol-style + native Added: pal-portal/modules/ant-installer/trunk/src/org/tp23/antinstaller/DefaultPropertiesFileRenderer.java =================================================================== --- pal-portal/modules/ant-installer/trunk/src/org/tp23/antinstaller/DefaultPropertiesFileRenderer.java (rev 0) +++ pal-portal/modules/ant-installer/trunk/src/org/tp23/antinstaller/DefaultPropertiesFileRenderer.java 2008-06-11 13:36:41 UTC (rev 975) @@ -0,0 +1,108 @@ +/* + * Copyright 2005 Paul Hinds + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +package org.tp23.antinstaller; + +import java.io.File; +import java.io.FileOutputStream; +import java.util.Iterator; +import java.util.List; +import java.util.Properties; + +import org.tp23.antinstaller.input.ConditionalField; +import org.tp23.antinstaller.input.InputField; +import org.tp23.antinstaller.input.OutputField; +import org.tp23.antinstaller.input.SecretPropertyField; +import org.tp23.antinstaller.page.Page; + + + +/** + * + *

Outputs the completed Pages as a java Properties file.

+ * @author Paul Hinds + * @version $Id: DefaultPropertiesFileRenderer.java,v 1.8 2007/01/09 22:41:41 teknopaul Exp $ + */ +public class DefaultPropertiesFileRenderer + implements PropertiesFileRenderer { + + public DefaultPropertiesFileRenderer() { + } + + public void renderProperties(InstallerContext ctx, File baseDir){ + Installer installer = ctx.getInstaller(); + Page[] completedPages = installer.getPages(); + Properties props = new Properties(); + props.put(FILE_ROOT_PROPERTY, baseDir.getAbsolutePath()); + props.setProperty(INSTALLER_VERSION_PROPERTY, + ctx.getInstaller().getVersion()); + + + for (int i = 0; i < completedPages.length; i++) { + OutputField[] fields = completedPages[i].getOutputField(); + + retrieveProperties( fields, props ); + + // print targets selected + List targets = completedPages[i].getTargets(ctx); + if(targets.size() > 0){ + Iterator iterator = targets.iterator(); + StringBuffer targetProperty = new StringBuffer(); + while (iterator.hasNext()) { + String target = (String) iterator.next(); + targetProperty.append(target).append(","); + } + props.put(completedPages[i].getName() + TARGETS_SUFFIX, targetProperty.toString()); + } + + } + try { + File antInstallProperties = new File(baseDir.getAbsolutePath(), PROPERTIES_FILE_NAME); + FileOutputStream fos = new FileOutputStream(antInstallProperties); + props.store(fos, + "Ant Installer - AutoGenerated properties"); + fos.close(); + } + catch (Throwable ex) { + if(ctx.getInstaller().isVerbose()) { + ctx.log(ex); + } + //swallow Exceptions as in contract for this method + } + } + + private void retrieveProperties( OutputField[] fields, Properties props ) { + for (int f = 0; f < fields.length; f++) { + if (fields[f] instanceof SecretPropertyField) { + //InputField field = (InputField)fields[f]; + //props.put(field.getProperty(), "XXXXXXXX"); + } + else if( fields[f] instanceof ConditionalField ) { + ConditionalField confField = (ConditionalField) fields[f]; + retrieveProperties( confField.getFields(), props ); + } + else if (fields[f] instanceof InputField) { + InputField field = (InputField)fields[f]; + + String result = field.getInputResult(); + //Temporary fix for PR 1353906 + if( result == null ) { + result = ""; + } + props.put(field.getProperty(), result); + } + } + } +} Property changes on: pal-portal/modules/ant-installer/trunk/src/org/tp23/antinstaller/DefaultPropertiesFileRenderer.java ___________________________________________________________________ Name: svn:eol-style + native Added: pal-portal/modules/ant-installer/trunk/src/org/tp23/antinstaller/ExplicitPropertiesFileRenderer.java =================================================================== --- pal-portal/modules/ant-installer/trunk/src/org/tp23/antinstaller/ExplicitPropertiesFileRenderer.java (rev 0) +++ pal-portal/modules/ant-installer/trunk/src/org/tp23/antinstaller/ExplicitPropertiesFileRenderer.java 2008-06-11 13:36:41 UTC (rev 975) @@ -0,0 +1,218 @@ +/* + * Copyright 2005 Paul Hinds + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +package org.tp23.antinstaller; + +import java.io.BufferedWriter; +import java.io.File; +import java.io.FileWriter; +import java.util.Date; +import java.util.Iterator; +import java.util.List; + +import org.tp23.antinstaller.input.ConditionalField; +import org.tp23.antinstaller.input.InputField; +import org.tp23.antinstaller.input.OutputField; +import org.tp23.antinstaller.input.SecretPropertyField; +import org.tp23.antinstaller.page.Page; + +/** + *

Outputs the completed Pages as a Java Properties file. The file produced is compatible + * with java.util.Properties.

+ *

Output is commented as it is printed to aid debugging

+ * @see http://java.sun.com/docs/books/jls/second_edition/html/lexical.doc.html#100850 + * @author Paul Hinds + * @version $Id: ExplicitPropertiesFileRenderer.java,v 1.9 2007/01/09 22:41:41 teknopaul Exp $ + */ +public class ExplicitPropertiesFileRenderer + implements PropertiesFileRenderer { + + private static String newLine = System.getProperty("line.separator"); + private static final char[] hexidecimals = { '0', '1', '2', '3', '4', '5', '6', '7', '8', '9', 'A', 'B', 'C', 'D', 'E', 'F' }; + + public ExplicitPropertiesFileRenderer() { + } + + public void renderProperties(InstallerContext ctx, File baseDir){ + Installer installer = ctx.getInstaller(); + Page[] completedPages = installer.getPages(); + + StringBuffer propertiesData = new StringBuffer(); + propertiesData.append("### Ant Installer - properties auto generated on "); + propertiesData.append( convert(new Date().toString(), true) ); + propertiesData.append(newLine); + propertiesData.append(newLine); + + propertiesData.append(FILE_ROOT_PROPERTY); + propertiesData.append(" = "); + propertiesData.append( convert(baseDir.getAbsolutePath(), true) ); + propertiesData.append(newLine); + + propertiesData.append(INSTALLER_VERSION_PROPERTY); + propertiesData.append(" = "); + propertiesData.append( convert(ctx.getInstaller().getVersion(), true) ); + propertiesData.append(newLine); + + propertiesData.append(newLine); + String property = null; + String value = null; + + + for (int i = 0; i < completedPages.length; i++) { + OutputField[] fields = completedPages[i].getOutputField(); + + propertiesData.append(newLine); + propertiesData.append("## Properties from Page:" + completedPages[i].getName()); + propertiesData.append(newLine); + + retrievePropertiesData( fields, propertiesData ); + + // print targets selected + List targets = completedPages[i].getTargets(ctx); + if(targets.size() > 0){ + Iterator iterator = targets.iterator(); + StringBuffer targetProperty = new StringBuffer(); + while (iterator.hasNext()) { + String target = (String) iterator.next(); + targetProperty.append(target).append(","); + } + propertiesData.append("# Targets selected for page"); + propertiesData.append(newLine); + property = convert(completedPages[i].getName() + TARGETS_SUFFIX, true); + value = convert(targetProperty.toString(), true); + propertiesData.append(property + " = " + value); + propertiesData.append(newLine); + + } + } + try { + File antInstallProperties = new File(baseDir.getAbsolutePath(), PROPERTIES_FILE_NAME); + FileWriter fos = new FileWriter(antInstallProperties); + BufferedWriter writer = new BufferedWriter(fos); + writer.write(propertiesData.toString()); + writer.flush(); + fos.close(); + } + catch (Throwable ex) { + if(ctx.getInstaller().isVerbose()) { + ctx.log(ex); + } + //swallow Exceptions as in the contract for this method + } + } + private void retrievePropertiesData( OutputField[] fields, StringBuffer propertiesData ) { + String property = null; + String value = null; + + for (int f = 0; f < fields.length; f++) { + if (fields[f] instanceof SecretPropertyField) { + InputField field = (InputField) fields[f]; + //String result = field.getInputResult(); + propertiesData.append("# Property hidden " + printClass(fields[f].getClass())); + propertiesData.append(newLine); + property = convert(field.getProperty(), true); + propertiesData.append("#" + property + "=XXXXXXXX"); + propertiesData.append(newLine); + } + else if (fields[f] instanceof ConditionalField ) { + ConditionalField confField = (ConditionalField) fields[f]; + retrievePropertiesData( confField.getFields(), propertiesData ); + } + else if (fields[f] instanceof InputField) { + InputField field = (InputField) fields[f]; + String result = field.getInputResult(); + propertiesData.append("# " + printClass(fields[f].getClass())); + propertiesData.append(newLine); + + property = convert(field.getProperty(), true); + value = convert(result, false); + propertiesData.append(property + " = " + value); + propertiesData.append(newLine); + } + } + } + + private String printClass(Class clazz) { + String name = clazz.getName(); + int lastDot = name.lastIndexOf('.'); + return name.substring(lastDot, name.length()); + } + + private String convert(String input, boolean doSpaces) { + if (input == null) { + // this happens when a page is skipped in text mode + return ""; + } + int num = input.length(); + StringBuffer sb = new StringBuffer(num); + + for (int i = 0; i < num; i++) { + char c = input.charAt(i); + switch (c) { + case ' ': + if (i == 0 || doSpaces) { + sb.append('\\'); + } + sb.append(' '); + break; + case '\n': + sb.append("\\n"); + break; + case '\r': + sb.append("\\r"); + break; + case '\\': + sb.append("\\\\"); + break; + case '\t': + sb.append("\\t"); + break; + case '\f': + sb.append("\\f"); + break; + case '=': + sb.append("\\="); + break; + case ':': + sb.append("\\:"); + break; + case '#': + sb.append("\\#"); + break; + case '!': + sb.append("\\!"); + break; + + default: + if ( (c < 0x0020) || (c > 0x007e) ) { + sb.append("\\u") + .append(hex( (c >> 12) & 0xF)) + .append(hex( (c >> 8) & 0xF)) + .append(hex( (c >> 4) & 0xF)) + .append(hex(c & 0xF)); + } + else { + sb.append(c); + } + } + } + return sb.toString(); + } + + private char hex(int val) { + return hexidecimals[ (val & 0xF)]; + } + +} Property changes on: pal-portal/modules/ant-installer/trunk/src/org/tp23/antinstaller/ExplicitPropertiesFileRenderer.java ___________________________________________________________________ Name: svn:eol-style + native Added: pal-portal/modules/ant-installer/trunk/src/org/tp23/antinstaller/InstallException.java =================================================================== --- pal-portal/modules/ant-installer/trunk/src/org/tp23/antinstaller/InstallException.java (rev 0) +++ pal-portal/modules/ant-installer/trunk/src/org/tp23/antinstaller/InstallException.java 2008-06-11 13:36:41 UTC (rev 975) @@ -0,0 +1,67 @@ +/* + * Copyright 2005 Paul Hinds + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +package org.tp23.antinstaller; + +import java.io.PrintStream; +import java.io.PrintWriter; + +/** + * + *

Custom Installation Exception, Hopefully compatible with JDK1.3 and 1.4

+ * @author Paul Hinds + * @version $Id: InstallException.java,v 1.1.1.1 2005/10/18 18:20:51 teknopaul Exp $ + */ +public class InstallException extends Exception{ + + private Throwable cause; + + public InstallException() { + } + public InstallException(String message) { + super(message); + } + public InstallException(String message,Throwable cause) { + super(message); + this.cause = cause; + } + public Throwable getException() { + return cause; + } + public Throwable getCause() { + return getException(); + } + public void printStackTrace() { + printStackTrace(System.err); + } + public void printStackTrace(PrintStream ps) { + synchronized (ps) { + super.printStackTrace(ps); + if (cause != null) { + ps.println("--- Nested Exception ---"); + cause.printStackTrace(ps); + } + } + } + public void printStackTrace(PrintWriter pw) { + synchronized (pw) { + super.printStackTrace(pw); + if (cause != null) { + pw.println("--- Nested Exception ---"); + cause.printStackTrace(pw); + } + } + } +} Property changes on: pal-portal/modules/ant-installer/trunk/src/org/tp23/antinstaller/InstallException.java ___________________________________________________________________ Name: svn:eol-style + native Added: pal-portal/modules/ant-installer/trunk/src/org/tp23/antinstaller/Installer.java =================================================================== --- pal-portal/modules/ant-installer/trunk/src/org/tp23/antinstaller/Installer.java (rev 0) +++ pal-portal/modules/ant-installer/trunk/src/org/tp23/antinstaller/Installer.java 2008-06-11 13:36:41 UTC (rev 975) @@ -0,0 +1,277 @@ +/* + * Copyright 2005 Paul Hinds + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +package org.tp23.antinstaller; + +import java.util.List; +import java.util.MissingResourceException; +import java.util.ResourceBundle; +import java.util.Vector; + +import org.tp23.antinstaller.input.OutputField; +import org.tp23.antinstaller.input.ResultContainer; +import org.tp23.antinstaller.page.Page; +import org.tp23.antinstaller.renderer.swing.SizeConstants; +import org.tp23.antinstaller.runtime.IfPropertyHelper; +import org.tp23.antinstaller.runtime.VersionHelper; +import org.tp23.antinstaller.runtime.exe.ExecuteRunnerFilter.AbortException; + + + +/** + *

Object representation of the Installer element in the config.

+ *

This object holds the reference to all the Pages which in tern hold references + * to the InputFields, All the properties in the Installer element are held at this level + * as is the ResultContainer

+ * @author Paul Hinds + * @version $Id: Installer.java,v 1.9 2007/01/28 08:44:41 teknopaul Exp $ + */ +public class Installer { + + + // i18n support + private static ResourceBundle langPack = null; + static{ + try { + langPack = ResourceBundle.getBundle("resources.LanguagePack"); + } catch (MissingResourceException e) { + // ignore, signifies no lang packs installed + } + } + + private String name; + private String minJavaVersion = "1.4"; + private String ui;// permitted UI override values + private boolean verbose; + private boolean debug; + private String lookAndFeel; + private String wide; + private String windowIcon; + private String defaultImageResource; + private String finishButtonText = "Install"; + private String antialiased; + private String loadDefaults; + private String version = "0.0"; + + private Page[] pages; + private ResultContainer resultContainer = new ResultContainer(); + + public Installer() { + } + + public String getName() { + return name; + } + + public void setName(String name) { + this.name = name; + } + + + public String getMinJavaVersion() { + return minJavaVersion; + } + + public void setMinJavaVersion(String minJavaVersion) throws AbortException { + if(minJavaVersion != null && ! "".equals(minJavaVersion) ) { + VersionHelper helper = new VersionHelper(); + if( ! helper.equalOrHigher(System.getProperty("java.version"), minJavaVersion, true) ) { + throw new AbortException("Incorrect Java version, installer requires: " + minJavaVersion); + } + } + this.minJavaVersion = minJavaVersion; + } + + public Page[] getPages() { + return pages; + } + + public void setPages(Page[] pages) { + this.pages = pages; + } + + /** + * returns full ui attribute with spaces removed (the string is not parsed into tokens). + * e.g. "text,swint,swing-auto" + * @return + */ + public String getUi() { + return ui; + } + + /** + * Sets the ui attrribute removing any whitespace + * @param ui + */ + public void setUi(String ui) { + this.ui = ui.replaceAll("\\s", ""); + } + + public boolean supportsAutoBuild(){ + return ui != null && ui.indexOf("-auto") > -1; + } + + public boolean isVerbose() { + return verbose; + } + public void setVerbose(boolean verbose) { + this.verbose = verbose; + } + public void setVerbose(String strVerbose) { + this.verbose = OutputField.isTrue(strVerbose); + } + + public boolean isDebug() { + return debug; + } + public void setDebug(boolean debug) { + this.debug = debug; + } + public void setDebug(String strDebug) { + this.debug = OutputField.isTrue(strDebug); + } + + + public String getLookAndFeel() { + return lookAndFeel; + } + + public void setLookAndFeel(String lookAndFeel) { + this.lookAndFeel = lookAndFeel; + } + + public String getWindowIcon() { + return windowIcon; + } + + public void setWindowIcon(String windowIcon) { + this.windowIcon = windowIcon; + } + + public String getDefaultImageResource() { + return defaultImageResource; + } + + public void setDefaultImageResource(String defaultImageResource) { + this.defaultImageResource = defaultImageResource; + } + + public String getFinishButtonText() { + if(langPack != null){ + return langPack.getString("finishButtonText"); + } + return finishButtonText; + } + + public void setFinishButtonText(String finishButtonText) { + this.finishButtonText = finishButtonText; + } + + public ResultContainer getResultContainer() { + return resultContainer; + } + + public String getAntialiased() { + return antialiased; + } + + public void setAntialiased(String antialiased) { + this.antialiased = antialiased; + } + + public String getWide() { + return wide; + } + + public void setWide(String wide) { + try { + this.wide = wide; + parseWideValue(wide); + } catch (Exception e) { + // ignore use defaults + } + } + public void parseWideValue(String wide) throws NumberFormatException, StringIndexOutOfBoundsException{ + int pageWidth = Integer.parseInt(wide.substring(0, wide.indexOf(':'))); + int labelWidth = Integer.parseInt(wide.substring(wide.indexOf(':') + 1, wide.length())); + SizeConstants.PAGE_WIDTH = pageWidth; + SizeConstants.LABEL_WIDTH = labelWidth; + } + + public String getLoadDefaults() { + return loadDefaults; + } + + public void setLoadDefaults(String loadDefaults) { + this.loadDefaults = loadDefaults; + } + + /** + * Returns the list of selected targets from the installer obeying + * page order. This method is + * probably only usefull after the UI screens have finished. Using prior to that + * bear in mind that the user in the Swing GUI can go back and reselect + * targets that were not selected previously. + * Page targets for pages that were not shown are not returned in the list + * @return Returns a Vector since Ant requires this for the Project class (Should be a List) + * @throws InstallException + */ + public Vector getTargets(InstallerContext ctx){ + Vector argsList = new Vector(); + for (int i = 0; i < getPages().length; i++) { + Page page = getPages()[i]; + List pageTargets = page.getPageTargets(); + boolean shown = conditionalDisplay(page, ctx); + for (int pt = 0; pt < pageTargets.size(); pt++) { + Page.IndexedTarget target = (Page.IndexedTarget)pageTargets.get(pt); + if( ! argsList.contains(target.getTarget()) && + shown){ + argsList.add(target.getTarget()); + } + } + List elementTargets = page.getElementTargets(); + for (int pt = 0; pt < elementTargets.size(); pt++) { + Page.IndexedTarget target = (Page.IndexedTarget)elementTargets.get(pt); + if( ! argsList.contains(target.getTarget()) ){ + argsList.add(target.getTarget()); + } + } + } + return argsList; + } + + /** + * @return boolean true if the page was to be shown + * @throws InstallException + */ + private boolean conditionalDisplay(Page page, InstallerContext ctx){ + try { + IfPropertyHelper helper = new IfPropertyHelper(ctx); + return helper.ifProperty(page) && helper.ifTarget(page, ctx.getInstaller().getPages()); + } catch (InstallException e) { + throw new RuntimeException("ifProperty runtime exception"); + } + } + + public String getVersion() { + return version; + } + + public void setVersion(String version) { + this.version = version; + } + + +} Property changes on: pal-portal/modules/ant-installer/trunk/src/org/tp23/antinstaller/Installer.java ___________________________________________________________________ Name: svn:eol-style + native Added: pal-portal/modules/ant-installer/trunk/src/org/tp23/antinstaller/InstallerContext.java =================================================================== --- pal-portal/modules/ant-installer/trunk/src/org/tp23/antinstaller/InstallerContext.java (rev 0) +++ pal-portal/modules/ant-installer/trunk/src/org/tp23/antinstaller/InstallerContext.java 2008-06-11 13:36:41 UTC (rev 975) @@ -0,0 +1,271 @@ +/* + * Copyright 2005 Paul Hinds + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +package org.tp23.antinstaller; + +import java.io.File; +import java.util.Enumeration; +import java.util.Iterator; +import java.util.Properties; +import java.util.Vector; + +import org.apache.tools.ant.BuildListener; +import org.apache.tools.ant.taskdefs.Execute; +import org.tp23.antinstaller.page.Page; +import org.tp23.antinstaller.renderer.AntOutputRenderer; +import org.tp23.antinstaller.renderer.MessageRenderer; +import org.tp23.antinstaller.runtime.Logger; +import org.tp23.antinstaller.runtime.Runner; +import org.tp23.antinstaller.runtime.exe.AntLauncherFilter; +import org.tp23.antinstaller.runtime.exe.LoadConfigFilter; +/** + * + *

A single InstallerContext is created by the ExecInstall class and + * exist for the duration of the Install screens and the runing of + * the Ant Script.

+ * @author Paul Hinds + * @version $Id: InstallerContext.java,v 1.10 2007/01/28 08:44:41 teknopaul Exp $ + */ +public class InstallerContext { + + /** + * This is the prefix for environment variables, unlike Ant this is fixed to + * the common prefix of "env". If you dont like this complain to the bug reports + * on sourceforge + */ + public static final String ENV_PREFIX = "env."; + /** + * This is the prefix for Java system property variables. + * This is fixed to "java." + */ + public static final String JAVA_PREFIX = "java."; + + private Logger logger = null; + private Installer installer = null; + private MessageRenderer messageRenderer = null; + private AntOutputRenderer antOutputRenderer = null; + private Runner runner = null; + private Page currentPage = null; + private java.io.File fileRoot = null; // ant basedir + private BuildListener buildListener = null; + private AntLauncherFilter antRunner = null; + private String uIOverride = null; + private String installerConfigFile = LoadConfigFilter.INSTALLER_CONFIG_FILE; + private String antBuildFile = "build.xml"; + private String configResource; + + + // called after the Ant part has been run + private boolean installedSucceded = false; + + public InstallerContext() { + } + + public void setInstallSucceded(boolean installedSucceded){ + this.installedSucceded=installedSucceded; + } + public boolean isInstallSucceded(){ + return installedSucceded; + } + + public void log(String message){ + if(logger != null) { + logger.log(message); + } + } + public void log(Throwable message){ + if(logger != null) { + logger.log(message); + } + } + public void log(boolean vebose, Throwable message){ + if(vebose && logger != null) { + logger.log(message); + } + } + + /** + * Check to see if the system is windoze to be able to return the correct prompted + * directories. This method should be IsNotWindows since it assumes anything + * that is not windows is Unix + * @return boolean true if not windows in the os.name System Property + */ + public static boolean isUnix(){ + return System.getProperty("os.name").toLowerCase().indexOf("windows") == -1; + } + + /** + * Use the standard Ant way to load the environment variables, this is not all inclusive + * (but will be come Java 1.5 I imagine) + * @return Properties + */ + public static Properties getEnvironment(){ + Properties props = new Properties(); + try { + Vector osEnv = Execute.getProcEnvironment(); + for (Enumeration e = osEnv.elements(); e.hasMoreElements(); ) { + String entry = (String) e.nextElement(); + int pos = entry.indexOf('='); + if (pos != -1) { + props.put(ENV_PREFIX + entry.substring(0, pos), + entry.substring(pos + 1)); + } + } + } + catch (Exception ex) { + // swallow exceptions so this can be loaded statically + // bit of a bugger if you need the environment on Mac OS 9 but not all apps + // do so we don't want to die inother situations + System.out.println("Can't load environment:"+ex.getClass()+","+ex.getMessage()); + } + Properties javaSysProps = System.getProperties(); + Iterator iter = javaSysProps.keySet().iterator(); + while (iter.hasNext()) { + Object key = (Object)iter.next(); + props.put(JAVA_PREFIX+key.toString(),javaSysProps.get(key)); + } + return props; + } + + // Bean methods + public Installer getInstaller() { + return installer; + } + + public String getMinJavaVersion() { + return installer.getMinJavaVersion(); + } + + public MessageRenderer getMessageRenderer() { + return messageRenderer; + } + + public void setMessageRenderer(MessageRenderer messageRenderer) { + this.messageRenderer = messageRenderer; + this.messageRenderer.setInstallerContext(this); + } + + public AntOutputRenderer getAntOutputRenderer() { + return antOutputRenderer; + } + + public void setAntOutputRenderer(AntOutputRenderer antOutputRenderer) { + this.antOutputRenderer = antOutputRenderer; + } + + public Page getCurrentPage() { + return currentPage; + } + + public void setCurrentPage(Page currentPage) { + this.currentPage = currentPage; + } + /** + * in SelfExtractor - the directory the install has extracted to
+ * in Scripted installs - the base directory of the install
+ * in NonExtractor - the temporary space created for the build
+ * @return + */ + public File getFileRoot() { + return fileRoot; + } + + public void setFileRoot(File fileRoot) { + this.fileRoot = fileRoot; + } + + public org.apache.tools.ant.BuildListener getBuildListener() { + return buildListener; + } + + public void setBuildListener(org.apache.tools.ant.BuildListener buildListener) { + this.buildListener = buildListener; + } + + public AntLauncherFilter getAntRunner() { + return antRunner; + } + + public void setAntRunner(AntLauncherFilter antRunner) { + this.antRunner = antRunner; + } + + public Logger getLogger() { + return logger; + } + + public void setLogger(Logger logger) { + this.logger = logger; + } + + public Runner getRunner() { + return runner; + } + + public void setRunner(Runner runner) { + this.runner = runner; + } + + public void setInstaller(Installer installer) { + this.installer = installer; + } + + public String getUIOverride() { + return uIOverride; + } + + public void setUIOverride(String override) { + uIOverride = override; + } + + public boolean isAutoBuild(){ + return uIOverride != null && uIOverride.indexOf("-auto") > -1; + } + + /** + * RFE 1569628, the antinstaller config file to use, defaults to antinstall-config.xml + * @return + */ + public String getInstallerConfigFile() { + return installerConfigFile; + } + + public void setInstallerConfigFile(String installerConfigFile) { + this.installerConfigFile = installerConfigFile; + } + /** + * RFE 1569628, the build file to use, defaults to build.xml + * There should never be any path info, that is derived elsewhere + * @return + */ + public String getAntBuildFile() { + return antBuildFile; + } + + public void setAntBuildFile(String antBuildFile) { + this.antBuildFile = antBuildFile; + } + + public String getConfigResource() { + return configResource; + } + + public void setConfigResource(String configResource) { + this.configResource = configResource; + } +} + + + Property changes on: pal-portal/modules/ant-installer/trunk/src/org/tp23/antinstaller/InstallerContext.java ___________________________________________________________________ Name: svn:eol-style + native Added: pal-portal/modules/ant-installer/trunk/src/org/tp23/antinstaller/PropertiesFileRenderer.java =================================================================== --- pal-portal/modules/ant-installer/trunk/src/org/tp23/antinstaller/PropertiesFileRenderer.java (rev 0) +++ pal-portal/modules/ant-installer/trunk/src/org/tp23/antinstaller/PropertiesFileRenderer.java 2008-06-11 13:36:41 UTC (rev 975) @@ -0,0 +1,43 @@ +/* + * Copyright 2005 Paul Hinds + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +package org.tp23.antinstaller; + +import java.io.File; +/** + * + *

Renders a properties file in the base directory for Ant to use and + * available for viewing after for Debug

+ * In earlier versions this was the only way to access properties it is now + * mostly redundant. + * @author Paul Hinds + * @version $Id: PropertiesFileRenderer.java,v 1.4 2006/12/23 04:07:23 teknopaul Exp $ + */ +public interface PropertiesFileRenderer { + + public static final String FILE_ROOT_PROPERTY = "basedir"; + public static final String INSTALLER_VERSION_PROPERTY = "ant.install.config.version"; + public static final String PROPERTIES_FILE_NAME = "ant.install.properties"; + public static final String TARGETS_SUFFIX = "-targets"; + + /** + * This method no longer throws IOException since the requirement to print properties + * has been removed. By default properties will be printed since they are usefull + * for debug but classes implementing this method should swallow all Exceptions + * @param ctx InstallerContext + * @param baseDir File + */ + public void renderProperties(InstallerContext ctx, File baseDir); +} Property changes on: pal-portal/modules/ant-installer/trunk/src/org/tp23/antinstaller/PropertiesFileRenderer.java ___________________________________________________________________ Name: svn:eol-style + native Added: pal-portal/modules/ant-installer/trunk/src/org/tp23/antinstaller/ResourceBundleHelper.java =================================================================== --- pal-portal/modules/ant-installer/trunk/src/org/tp23/antinstaller/ResourceBundleHelper.java (rev 0) +++ pal-portal/modules/ant-installer/trunk/src/org/tp23/antinstaller/ResourceBundleHelper.java 2008-06-11 13:36:41 UTC (rev 975) @@ -0,0 +1,111 @@ +/* + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +package org.tp23.antinstaller; + +import java.text.MessageFormat; +import java.util.MissingResourceException; +import java.util.ResourceBundle; + +/** + * Helper class that will catch missing bundle entries and handle formatting + * of message strings + * + * @author mwilson + * @version $Id + * @since 0.7.4 patch 7 + */ +public class ResourceBundleHelper +{ + private String bundleName; + private ResourceBundle resourceBundle; + + private static final Object[] EMPTY_OBJ_ARRAY = new Object[0]; + private static final String EMPTY_STRING = ""; + + public ResourceBundleHelper( final String bundleName ) + { + this.bundleName = bundleName; + resourceBundle = ResourceBundle.getBundle( bundleName ); + } + + public String getMessage( final String key ) + { + return getMessage( key, EMPTY_OBJ_ARRAY ); + } + + public String getMessage( final String key, final Object obj ) + { + return getMessage( key, new Object[] { obj } ); + } + + /** + * Return a formatted message string. + * @param key resource bundle key + * @param objArray array of objects that will be used with formatting + * string + * @return formatted string or error message if the resource bundle + * entry is missing + */ + public String getMessage( String key, Object objArray[] ) + { + String message; + + //Replace null values with empty strings - safer + for( int i = 0; i < objArray.length; i++ ) + { + if( objArray[i] == null ) + { + objArray[i] = EMPTY_STRING; + } + } + + String formatStr = null; + + try + { + formatStr = resourceBundle.getString( key ); + } + catch( MissingResourceException missingResExc ) + { + //Handle missing resource below... + } + + if( formatStr == null ) + { + StringBuffer strBuffer = new StringBuffer( "Message entry with key " ); + strBuffer.append( key ); + strBuffer.append( " is missing from resource bundle " ); + strBuffer.append( bundleName ); + strBuffer.append( "\n" ); + strBuffer.append( bundleName ); + strBuffer.append( ":: " ); + strBuffer.append( key ); + for( int i = 0; i < objArray.length; i++ ) + { + strBuffer.append( " " ); + strBuffer.append( objArray[i].toString() ); + } + + message = strBuffer.toString(); + } + else + { + MessageFormat msgformat = new MessageFormat( formatStr ); + message = msgformat.format( ( (Object) ( objArray ) ) ); + } + + return message; + } + +} Property changes on: pal-portal/modules/ant-installer/trunk/src/org/tp23/antinstaller/ResourceBundleHelper.java ___________________________________________________________________ Name: svn:eol-style + native Added: pal-portal/modules/ant-installer/trunk/src/org/tp23/antinstaller/ValidationException.java =================================================================== --- pal-portal/modules/ant-installer/trunk/src/org/tp23/antinstaller/ValidationException.java (rev 0) +++ pal-portal/modules/ant-installer/trunk/src/org/tp23/antinstaller/ValidationException.java 2008-06-11 13:36:41 UTC (rev 975) @@ -0,0 +1,32 @@ +/* + * Copyright 2005 Paul Hinds + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +package org.tp23.antinstaller; +/** + * + *

Thrown if there is a failure during validation of human entered input.

+ * @author Paul Hinds + * @version $Id: ValidationException.java,v 1.1.1.1 2005/10/18 18:20:52 teknopaul Exp $ + */ +public class ValidationException extends InstallException{ + public ValidationException() { + } + public ValidationException(String message) { + super(message); + } + public ValidationException(String message,Throwable cause) { + super(message,cause); + } +} Property changes on: pal-portal/modules/ant-installer/trunk/src/org/tp23/antinstaller/ValidationException.java ___________________________________________________________________ Name: svn:eol-style + native Added: pal-portal/modules/ant-installer/trunk/src/org/tp23/antinstaller/antinstall-config-0.2.dtd =================================================================== --- pal-portal/modules/ant-installer/trunk/src/org/tp23/antinstaller/antinstall-config-0.2.dtd (rev 0) +++ pal-portal/modules/ant-installer/trunk/src/org/tp23/antinstaller/antinstall-config-0.2.dtd 2008-06-11 13:36:41 UTC (rev 975) @@ -0,0 +1,120 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + Property changes on: pal-portal/modules/ant-installer/trunk/src/org/tp23/antinstaller/antinstall-config-0.2.dtd ___________________________________________________________________ Name: svn:eol-style + native Added: pal-portal/modules/ant-installer/trunk/src/org/tp23/antinstaller/antinstall-config-0.3.dtd =================================================================== --- pal-portal/modules/ant-installer/trunk/src/org/tp23/antinstaller/antinstall-config-0.3.dtd (rev 0) +++ pal-portal/modules/ant-installer/trunk/src/org/tp23/antinstaller/antinstall-config-0.3.dtd 2008-06-11 13:36:41 UTC (rev 975) @@ -0,0 +1,121 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + Property changes on: pal-portal/modules/ant-installer/trunk/src/org/tp23/antinstaller/antinstall-config-0.3.dtd ___________________________________________________________________ Name: svn:eol-style + native Added: pal-portal/modules/ant-installer/trunk/src/org/tp23/antinstaller/antinstall-config-0.4.dtd =================================================================== --- pal-portal/modules/ant-installer/trunk/src/org/tp23/antinstaller/antinstall-config-0.4.dtd (rev 0) +++ pal-portal/modules/ant-installer/trunk/src/org/tp23/antinstaller/antinstall-config-0.4.dtd 2008-06-11 13:36:41 UTC (rev 975) @@ -0,0 +1,122 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + Property changes on: pal-portal/modules/ant-installer/trunk/src/org/tp23/antinstaller/antinstall-config-0.4.dtd ___________________________________________________________________ Name: svn:eol-style + native Added: pal-portal/modules/ant-installer/trunk/src/org/tp23/antinstaller/antinstall-config-0.5.dtd =================================================================== --- pal-portal/modules/ant-installer/trunk/src/org/tp23/antinstaller/antinstall-config-0.5.dtd (rev 0) +++ pal-portal/modules/ant-installer/trunk/src/org/tp23/antinstaller/antinstall-config-0.5.dtd 2008-06-11 13:36:41 UTC (rev 975) @@ -0,0 +1,125 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + Property changes on: pal-portal/modules/ant-installer/trunk/src/org/tp23/antinstaller/antinstall-config-0.5.dtd ___________________________________________________________________ Name: svn:eol-style + native Added: pal-portal/modules/ant-installer/trunk/src/org/tp23/antinstaller/antinstall-config-0.6.dtd =================================================================== --- pal-portal/modules/ant-installer/trunk/src/org/tp23/antinstaller/antinstall-config-0.6.dtd (rev 0) +++ pal-portal/modules/ant-installer/trunk/src/org/tp23/antinstaller/antinstall-config-0.6.dtd 2008-06-11 13:36:41 UTC (rev 975) @@ -0,0 +1,132 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + Property changes on: pal-portal/modules/ant-installer/trunk/src/org/tp23/antinstaller/antinstall-config-0.6.dtd ___________________________________________________________________ Name: svn:eol-style + native Added: pal-portal/modules/ant-installer/trunk/src/org/tp23/antinstaller/antinstall-config-0.7.dtd =================================================================== --- pal-portal/modules/ant-installer/trunk/src/org/tp23/antinstaller/antinstall-config-0.7.dtd (rev 0) +++ pal-portal/modules/ant-installer/trunk/src/org/tp23/antinstaller/antinstall-config-0.7.dtd 2008-06-11 13:36:41 UTC (rev 975) @@ -0,0 +1,157 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + Property changes on: pal-portal/modules/ant-installer/trunk/src/org/tp23/antinstaller/antinstall-config-0.7.dtd ___________________________________________________________________ Name: svn:eol-style + native Added: pal-portal/modules/ant-installer/trunk/src/org/tp23/antinstaller/antinstall-config-0.8.dtd =================================================================== --- pal-portal/modules/ant-installer/trunk/src/org/tp23/antinstaller/antinstall-config-0.8.dtd (rev 0) +++ pal-portal/modules/ant-installer/trunk/src/org/tp23/antinstaller/antinstall-config-0.8.dtd 2008-06-11 13:36:41 UTC (rev 975) @@ -0,0 +1,205 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + Property changes on: pal-portal/modules/ant-installer/trunk/src/org/tp23/antinstaller/antinstall-config-0.8.dtd ___________________________________________________________________ Name: svn:eol-style + native Added: pal-portal/modules/ant-installer/trunk/src/org/tp23/antinstaller/antmod/FeedbackListener.java =================================================================== --- pal-portal/modules/ant-installer/trunk/src/org/tp23/antinstaller/antmod/FeedbackListener.java (rev 0) +++ pal-portal/modules/ant-installer/trunk/src/org/tp23/antinstaller/antmod/FeedbackListener.java 2008-06-11 13:36:41 UTC (rev 975) @@ -0,0 +1,104 @@ +/* + * Copyright 2005 Paul Hinds + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +package org.tp23.antinstaller.antmod; + +import java.util.ResourceBundle; + +import org.apache.tools.ant.BuildEvent; +import org.apache.tools.ant.BuildListener; +import org.tp23.antinstaller.renderer.swing.SwingInstallerContext; +/** + * + *

Reports a message in the swing UI this mesage is reported in the + * top of the window.

+ *

The Listeners should apparently never uses System.out or System.err

+ * This class is not really an Ant modification since it simply implements + * a public interface but is here on the offchance that one day Ant changes + * it's APIs + * @author Paul Hinds + * @version $Id: FeedbackListener.java,v 1.1.1.1 2005/10/18 18:20:52 teknopaul Exp $ + */ +public class FeedbackListener implements BuildListener{ + + private final SwingInstallerContext swingCtx; + private static final ResourceBundle res = ResourceBundle.getBundle("org.tp23.antinstaller.renderer.Res"); + + public FeedbackListener(SwingInstallerContext swingCtx) { + this.swingCtx=swingCtx; + } + + /** + * buildStarted This event results in User notification + * + * @param buildEvent BuildEvent + */ + public void buildStarted(BuildEvent buildEvent) { + //swingCtx.provideAntFeedBack(buildEvent.getMessage()); + swingCtx.buildStarted(buildEvent); + } + + /** + * buildFinished This event results in User notification + * + * @param buildEvent BuildEvent + */ + public void buildFinished(BuildEvent buildEvent) { + swingCtx.provideAntFeedBack(res.getString("installFinished")); + swingCtx.buildFinished(buildEvent); + } + + /** + * targetStarted This event results in User notification + * + * @param buildEvent BuildEvent + */ + public void targetStarted(BuildEvent buildEvent) { + swingCtx.provideAntFeedBack(res.getString("running")+buildEvent.getTarget()); + swingCtx.targetStarted(buildEvent); + } + + /** + * targetFinished This event is ignored + * @param buildEvent BuildEvent + */ + public void targetFinished(BuildEvent buildEvent) { + swingCtx.targetFinished(buildEvent); + } + + /** + * taskStarted This event is ignored + * @param buildEvent BuildEvent + */ + public void taskStarted(BuildEvent buildEvent) { + //swingCtx.provideAntFeedBack(buildEvent.getMessage()); + } + + /** + * taskFinished This event is ignored + * @param buildEvent BuildEvent + */ + public void taskFinished(BuildEvent buildEvent) { + //swingCtx.provideAntFeedBack(buildEvent.getMessage()); + } + + /** + * messageLogged This event is ignored + * @param buildEvent BuildEvent + */ + public void messageLogged(BuildEvent buildEvent) { + //swingCtx.provideAntFeedBack(buildEvent.getMessage()); + } +} Property changes on: pal-portal/modules/ant-installer/trunk/src/org/tp23/antinstaller/antmod/FeedbackListener.java ___________________________________________________________________ Name: svn:eol-style + native Added: pal-portal/modules/ant-installer/trunk/src/org/tp23/antinstaller/antmod/Jdk14RegexpMatcher.java =================================================================== --- pal-portal/modules/ant-installer/trunk/src/org/tp23/antinstaller/antmod/Jdk14RegexpMatcher.java (rev 0) +++ pal-portal/modules/ant-installer/trunk/src/org/tp23/antinstaller/antmod/Jdk14RegexpMatcher.java 2008-06-11 13:36:41 UTC (rev 975) @@ -0,0 +1,139 @@ +/* + * Copyright 2001-2004 The Apache Software Foundation + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + * + */ + +package org.tp23.antinstaller.antmod; + +import java.util.Vector; +import java.util.regex.Matcher; +import java.util.regex.Pattern; +import java.util.regex.PatternSyntaxException; + +import org.apache.tools.ant.BuildException; +import org.apache.tools.ant.util.regexp.RegexpMatcher; +import org.apache.tools.ant.util.regexp.RegexpUtil; + +/** + * Implementation of RegexpMatcher for the built-in regexp matcher of + * JDK 1.4. UNIX_LINES option is enabled as a default. + * + */ +public class Jdk14RegexpMatcher implements RegexpMatcher { + + private String pattern; + + public Jdk14RegexpMatcher() { + } + + /** + * Set the regexp pattern from the String description. + */ + public void setPattern(String pattern) { + this.pattern = pattern; + } + + /** + * Get a String representation of the regexp pattern + */ + public String getPattern() { + return pattern; + } + + protected Pattern getCompiledPattern(int options) + throws BuildException { + int cOptions = getCompilerOptions(options); + try { + Pattern p = Pattern.compile(this.pattern, cOptions); + return p; + } catch (PatternSyntaxException e) { + throw new BuildException(e); + } + } + + /** + * Does the given argument match the pattern? + */ + public boolean matches(String argument) throws BuildException { + return matches(argument, MATCH_DEFAULT); + } + + /** + * Does the given argument match the pattern? + */ + public boolean matches(String input, int options) + throws BuildException { + try { + Pattern p = getCompiledPattern(options); + return p.matcher(input).find(); + } catch (Exception e) { + throw new BuildException(e); + } + } + + /** + * Returns a Vector of matched groups found in the argument. + * + *

Group 0 will be the full match, the rest are the + * parenthesized subexpressions

. + */ + public Vector getGroups(String argument) throws BuildException { + return getGroups(argument, MATCH_DEFAULT); + } + + /** + * Returns a Vector of matched groups found in the argument. + * + *

Group 0 will be the full match, the rest are the + * parenthesized subexpressions

. + */ + public Vector getGroups(String input, int options) + throws BuildException { + Pattern p = getCompiledPattern(options); + Matcher matcher = p.matcher(input); + if (!matcher.find()) { + return null; + } + Vector v = new Vector(); + int cnt = matcher.groupCount(); + for (int i = 0; i <= cnt; i++) { + String match = matcher.group(i); + // treat non-matching groups as empty matches + if (match == null) { + match = ""; + } + v.addElement(match); + } + return v; + } + + protected int getCompilerOptions(int options) { + // be strict about line separator + int cOptions = Pattern.UNIX_LINES; + + if (RegexpUtil.hasFlag(options, MATCH_CASE_INSENSITIVE)) { + cOptions |= Pattern.CASE_INSENSITIVE; + } + if (RegexpUtil.hasFlag(options, MATCH_MULTILINE)) { + cOptions |= Pattern.MULTILINE; + } + if (RegexpUtil.hasFlag(options, MATCH_SINGLELINE)) { + cOptions |= Pattern.DOTALL; + } + + return cOptions; + } + +} Property changes on: pal-portal/modules/ant-installer/trunk/src/org/tp23/antinstaller/antmod/Jdk14RegexpMatcher.java ___________________________________________________________________ Name: svn:eol-style + native Added: pal-portal/modules/ant-installer/trunk/src/org/tp23/antinstaller/antmod/Jdk14RegexpRegexp.java =================================================================== --- pal-portal/modules/ant-installer/trunk/src/org/tp23/antinstaller/antmod/Jdk14RegexpRegexp.java (rev 0) +++ pal-portal/modules/ant-installer/trunk/src/org/tp23/antinstaller/antmod/Jdk14RegexpRegexp.java 2008-06-11 13:36:41 UTC (rev 975) @@ -0,0 +1,92 @@ +/* + * Copyright 2001-2004 The Apache Software Foundation + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + * + */ +package org.tp23.antinstaller.antmod; + + +import java.util.regex.Matcher; +import java.util.regex.Pattern; + +import org.apache.tools.ant.BuildException; +import org.apache.tools.ant.util.regexp.Regexp; +import org.apache.tools.ant.util.regexp.RegexpUtil; + + +/*** + * Regular expression implementation using the JDK 1.4 regular expression package + */ +public class Jdk14RegexpRegexp extends Jdk14RegexpMatcher implements Regexp { + + public Jdk14RegexpRegexp() { + super(); + } + + protected int getSubsOptions(int options) { + int subsOptions = REPLACE_FIRST; + if (RegexpUtil.hasFlag(options, REPLACE_ALL)) { + subsOptions = REPLACE_ALL; + } + return subsOptions; + } + + public String substitute(String input, String argument, int options) + throws BuildException { + // translate \1 to $(1) so that the Matcher will work + StringBuffer subst = new StringBuffer(); + for (int i = 0; i < argument.length(); i++) { + char c = argument.charAt(i); + if (c == '$') { + subst.append('\\'); + subst.append('$'); + } else if (c == '\\') { + if (++i < argument.length()) { + c = argument.charAt(i); + int value = Character.digit(c, 10); + if (value > -1) { + subst.append("$").append(value); + } else { + subst.append(c); + } + } else { + // XXX - should throw an exception instead? + subst.append('\\'); + } + } else { + subst.append(c); + } + } + argument = subst.toString(); + + int sOptions = getSubsOptions(options); + Pattern p = getCompiledPattern(options); + StringBuffer sb = new StringBuffer(); + + Matcher m = p.matcher(input); + if (RegexpUtil.hasFlag(sOptions, REPLACE_ALL)) { + sb.append(m.replaceAll(argument)); + } else { + boolean res = m.find(); + if (res) { + m.appendReplacement(sb, argument); + m.appendTail(sb); + } else { + sb.append(input); + } + } + + return sb.toString(); + } +} Property changes on: pal-portal/modules/ant-installer/trunk/src/org/tp23/antinstaller/antmod/Jdk14RegexpRegexp.java ___________________________________________________________________ Name: svn:eol-style + native Added: pal-portal/modules/ant-installer/trunk/src/org/tp23/antinstaller/antmod/Launcher.java =================================================================== --- pal-portal/modules/ant-installer/trunk/src/org/tp23/antinstaller/antmod/Launcher.java (rev 0) +++ pal-portal/modules/ant-installer/trunk/src/org/tp23/antinstaller/antmod/Launcher.java 2008-06-11 13:36:41 UTC (rev 975) @@ -0,0 +1,250 @@ +/* + * Copyright 2003-2004 The Apache Software Foundation + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + * + */ +package org.tp23.antinstaller.antmod; + +import java.io.File; +import java.net.MalformedURLException; +import java.net.URL; +import java.net.URLClassLoader; +import java.util.ArrayList; +import java.util.Iterator; +import java.util.List; +import java.util.Map; +import java.util.Properties; +import java.util.StringTokenizer; + +import org.apache.tools.ant.launch.LaunchException; +import org.apache.tools.ant.launch.Locator; +import org.tp23.antinstaller.InstallerContext; + + + +/** + * This is a launcher for Ant. + * + * This file has been modified by Paul Hinds for Antinstaller and is not the same + * as the one delivered with Ant 1.6 + * + * @since Ant 1.6 + * @version $Id: Launcher.java,v 1.1.1.1 2005/10/18 18:20:54 teknopaul Exp $ + */ +public class Launcher { + /** The Ant Home property */ + public static final String ANTHOME_PROPERTY = "ant.home"; + + + /** The Ant Library Directory property */ + public static final String ANTLIBDIR_PROPERTY = "ant.library.dir"; + + + /** The location of a per-user library directory */ + public static final String USER_LIBDIR = ".ant/lib"; + + + /** The startup class that is to be run */ + public static final String MAIN_CLASS = "org.apache.tools.ant.Main"; + + private final Map allProperties; + + + +/** + * Addtional Constructor to pass password properties to Ant + * without saving them to a file. + * Added by Paul Hinds + * @param allProperties Properties + */ + public Launcher(Map allProperties) { + this.allProperties = allProperties; + } + + + +/** + * Run the launcher to launch Ant + * + * @param args the command line arguments + * + * @exception MalformedURLException if the URLs required for the classloader + * cannot be created. + */ + public int run(String[] args, InstallerContext cxt) throws LaunchException, MalformedURLException { + + try { + + String antHomeProperty = System.getProperty(ANTHOME_PROPERTY); + File antHome = null; + + File jarDir = null; + + File sourceJar = Locator.getClassSource(getClass()); + jarDir = sourceJar.getParentFile(); + + if (antHomeProperty != null) { + antHome = new File(antHomeProperty); + } + + if (antHome == null || !antHome.exists()) { + antHome = jarDir.getParentFile(); + System.setProperty(ANTHOME_PROPERTY, antHome.getAbsolutePath()); + } + + if (!antHome.exists()) { + throw new LaunchException("Ant home is set incorrectly or ant could not be located"); + } + + List libPaths = new ArrayList(); + List argList = new ArrayList(); + String[] newArgs; + + for (int i = 0; i < args.length; ++i) { + if (args[i].equals("-lib")) { + if (i == args.length - 1) { + throw new LaunchException("The -lib argument must be followed by a library location"); + } + libPaths.add(args[++i]); + } + else { + argList.add(args[i]); + } + } + + if (libPaths.size() == 0) { + newArgs = args; + } + else { + newArgs = (String[]) argList.toArray(new String[0]); + } + + List libPathURLs = new ArrayList(); + for (Iterator i = libPaths.iterator(); i.hasNext(); ) { + String libPath = (String) i.next(); + StringTokenizer myTokenizer + = new StringTokenizer(libPath, System.getProperty("path.separator")); + while (myTokenizer.hasMoreElements()) { + String elementName = myTokenizer.nextToken(); + File element = new File(elementName); + if (elementName.indexOf("%") != -1 && !element.exists()) { + continue; + } + if (element.isDirectory()) { + // add any jars in the directory + URL[] dirURLs = Locator.getLocationURLs(element); + for (int j = 0; j < dirURLs.length; ++j) { + libPathURLs.add(dirURLs[j]); + } + } + + libPathURLs.add(element.toURL()); + } + } + + URL[] libJars = (URL[]) libPathURLs.toArray(new URL[0]); + + // Now try and find JAVA_HOME + File toolsJar = Locator.getToolsJar(); + + // determine ant library directory for system jars: use property + // or default using location of ant-launcher.jar + File antLibDir = null; + String antLibDirProperty = System.getProperty(ANTLIBDIR_PROPERTY); + if (antLibDirProperty != null) { + antLibDir = new File(antLibDirProperty); + } + if ( (antLibDir == null) || !antLibDir.exists()) { + antLibDir = jarDir; + System.setProperty(ANTLIBDIR_PROPERTY, antLibDir.getAbsolutePath()); + } + URL[] systemJars = Locator.getLocationURLs(antLibDir); + + File userLibDir + = new File(System.getProperty("user.home"), USER_LIBDIR); + URL[] userJars = Locator.getLocationURLs(userLibDir); + + + int numJars = libJars.length + userJars.length + systemJars.length; + if (toolsJar != null) { + numJars++; + } + URL[] jars = new URL[numJars]; + System.arraycopy(libJars, 0, jars, 0, libJars.length); + System.arraycopy(userJars, 0, jars, libJars.length, userJars.length); + System.arraycopy(systemJars, 0, jars, userJars.length + libJars.length, + systemJars.length); + + if (toolsJar != null) { + jars[jars.length - 1] = toolsJar.toURL(); + } + + + // now update the class.path property + StringBuffer baseClassPath + = new StringBuffer(System.getProperty("java.class.path")); + if (baseClassPath.charAt(baseClassPath.length() - 1) + == File.pathSeparatorChar) { + baseClassPath.setLength(baseClassPath.length() - 1); + } + + for (int i = 0; i < jars.length; ++i) { + baseClassPath.append(File.pathSeparatorChar); + baseClassPath.append(Locator.fromURI(jars[i].toString())); + } + + System.setProperty("java.class.path", baseClassPath.toString()); + + URLClassLoader loader = new URLClassLoader(jars); + Thread.currentThread().setContextClassLoader(loader); + try { + Main main = new Main(); + Properties props = new Properties(); + props.putAll(allProperties); + return main.startAnt(newArgs, props, null, cxt); + } + catch (Throwable t) { + t.printStackTrace(); + return 1; + } + } + catch (Throwable ex) { + // Essentially all of the above is nice to have as far as AntInstaller is concerned + // ant.home may not be available when installing and application on a client that does not + // have and never will have Ant. However the code is left since sometimes AntInstaller can be used + // for a general gui for Ant builds and features such and ANT_HOME/lib are useful + try { + System.setProperty(ANTHOME_PROPERTY, new File(".").getAbsolutePath()); + Main main = new Main(); + // fix for bug:1177191 + // remove the -lib as discovered by Mark Anderson + String[] newArgs = new String[args.length-2]; + for(int i=0,n=0;i + * If you integrating Ant into some other tool, this is not the class + * to use as an entry point. Please see the source code of this + * class to see how it manipulates the Ant project classes. + * +* This file has been modified by Paul Hinds for Antinstaller and is not the same +* as the one delivered with Ant 1.6 +* @version $Id: Main.java,v 1.5 2007/01/12 10:41:48 anothermwilson Exp $ + */ +public class Main implements AntMain { + + /** The default build file name. */ + public static final String DEFAULT_BUILD_FILENAME = "build.xml"; + + /** Our current message output status. Follows Project.MSG_XXX. */ + private int msgOutputLevel = Project.MSG_INFO; + + /** File that we are using for configuration. */ + private File buildFile; /* null */ + + /** Stream to use for logging. */ + private static PrintStream out = System.out; + + /** Stream that we are using for logging error messages. */ + private static PrintStream err = System.err; + + /** The build targets. */ + private Vector targets = new Vector(); + + /** Set of properties that can be used by tasks. */ + private Properties definedProps = new Properties(); + + /** Names of classes to add as listeners to project. */ + private Vector listeners = new Vector(1); + + /** File names of property files to load on startup. */ + private Vector propertyFiles = new Vector(1); + + /** Indicates whether this build is to support interactive input */ + private boolean allowInput = true; + + /** keep going mode */ + private boolean keepGoingMode = false; + + /** + * The Ant logger class. There may be only one logger. It will have + * the right to use the 'out' PrintStream. The class must implements the + * BuildLogger interface. + */ + private String loggerClassname = null; + + /** + * The Ant InputHandler class. There may be only one input + * handler. + */ + private String inputHandlerClassname = null; + + /** + * Whether or not output to the log is to be unadorned. + */ + private boolean emacsMode = false; + + /** + * Whether or not this instance has successfully been + * constructed and is ready to run. + */ + private boolean readyToRun = false; + + /** + * Whether or not we should only parse and display the project help + * information. + */ + private boolean projectHelp = false; + + /** + * Whether or not a logfile is being used. This is used to + * check if the output streams must be closed. + */ + private static boolean isLogFileUsed = false; + + /** + * optional thread priority + */ + private Integer threadPriority = null; + /** + * Installer Context + */ + private InstallerContext ctx = null; + + /** + * Prints the message of the Throwable if it (the message) is not + * null. + * + * @param t Throwable to print the message of. + * Must not be null. + */ + private static void printMessage(Throwable t) { + String message = t.getMessage(); + if (message != null) { + System.err.println(message); + } + } + + /** + * Creates a new instance of this class using the + * arguments specified, gives it any extra user properties which have been + * specified, and then runs the build using the classloader provided. + * + * @param args Command line arguments. Must not be null. + * @param additionalUserProperties Any extra properties to use in this + * build. May be null, which is the equivalent to + * passing in an empty set of properties. + * @param coreLoader Classloader used for core classes. May be + * null in which case the system classloader is used. + */ + public static void start(String[] args, Properties additionalUserProperties, + ClassLoader coreLoader) { + throw new UnsupportedOperationException("Required by Ant interface but not used"); + //Main m = new Main(); + //m.startAnt(args, additionalUserProperties, coreLoader); + } + + + public void startAnt(String[] args, Properties additionalUserProperties, + ClassLoader coreLoader) { + throw new UnsupportedOperationException("Required by Ant interface but not used"); + //startAnt(args, additionalUserProperties, coreLoader, null); // FindBugs does not like this + } + /** + * Start Ant + * @param args command line args + * @param additionalUserProperties properties to set beyond those that + * may be specified on the args list + * @param coreLoader - not used + * @return the return code that was used for System.exit() in the original Ant + * + * @since Ant 1.6 + */ + public int startAnt(String[] args, Properties additionalUserProperties, + ClassLoader coreLoader, InstallerContext ctx) { + this.ctx = ctx; + out = ctx.getAntOutputRenderer().getOut(); + err = ctx.getAntOutputRenderer().getErr(); + try { + Diagnostics.validateVersion(); + processArgs(args); + } catch (Throwable exc) { + handleLogfile(); + printMessage(exc); + return 1; + } + + if (additionalUserProperties != null) { + for (Enumeration e = additionalUserProperties.keys(); + e.hasMoreElements();) { + String key = (String) e.nextElement(); + String property = additionalUserProperties.getProperty(key); + definedProps.put(key, property); + } + } + + // expect the worst + int exitCode = 1; + try { + try { + runBuild(coreLoader); + exitCode = 0; + } catch (ExitStatusException ese) { + exitCode = ese.getStatus(); + if (exitCode != 0) { + throw ese; + } + } + } catch (BuildException be) { + if (err != System.err) { + printMessage(be); + } + } catch (Throwable exc) { + exc.printStackTrace(); + printMessage(exc); + } finally { + handleLogfile(); + } + //mod by Paul Hinds + return exitCode; + //System.exit(exitCode); + } + + /** + * Close logfiles, if we have been writing to them. + * + * @since Ant 1.6 + */ + private static void handleLogfile() { + if (isLogFileUsed) { + if (out != null) { + try { + out.close(); + } catch (final Exception e) { + //ignore + } + } + if (err != null) { + try { + err.close(); + } catch (final Exception e) { + //ignore + } + } + } + } + + /** + * Command line entry point. This method kicks off the building + * of a project object and executes a build using either a given + * target or the default target. + * + * @param args Command line arguments. Must not be null. + */ +// public static void main(String[] args) { +// start(args, null, null); +// } +// + /** + * Constructor used when creating Main for later arg processing + * and startup + */ + public Main() { + } + + /** + * Sole constructor, which parses and deals with command line + * arguments. + * + * @param args Command line arguments. Must not be null. + * + * @exception BuildException if the specified build file doesn't exist + * or is a directory. + * + * @deprecated + */ + protected Main(String[] args) throws BuildException { + processArgs(args); + } + + /** + * Process command line arguments. + * When ant is started from Launcher, the -lib argument does not get + * passed through to this routine. + * + * @param args the command line arguments. + * + * @since Ant 1.6 + */ + private void processArgs(String[] args) { + String searchForThis = null; + PrintStream logTo = null; + + // cycle through given args + + for (int i = 0; i < args.length; i++) { + String arg = args[i]; + + if (arg.equals("-help") || arg.equals("-h")) { + printUsage(); + return; + } else if (arg.equals("-version")) { + printVersion(); + return; + } else if (arg.equals("-diagnostics")) { + Diagnostics.doReport(System.out); + return; + } else if (arg.equals("-quiet") || arg.equals("-q")) { + msgOutputLevel = Project.MSG_WARN; + } else if (arg.equals("-verbose") || arg.equals("-v")) { + printVersion(); + msgOutputLevel = Project.MSG_VERBOSE; + } else if (arg.equals("-debug") || arg.equals("-d")) { + printVersion(); + msgOutputLevel = Project.MSG_DEBUG; + } else if (arg.equals("-noinput")) { + allowInput = false; + } else if (arg.equals("-logfile") || arg.equals("-l")) { + try { + File logFile = new File(args[i + 1]); + i++; + logTo = new PrintStream(new FileOutputStream(logFile)); + isLogFileUsed = true; + } catch (IOException ioe) { + String msg = "Cannot write on the specified log file. " + + "Make sure the path exists and you have write " + + "permissions."; + throw new BuildException(msg); + } catch (ArrayIndexOutOfBoundsException aioobe) { + String msg = "You must specify a log file when " + + "using the -log argument"; + throw new BuildException(msg); + } + } else if (arg.equals("-buildfile") || arg.equals("-file") + || arg.equals("-f")) { + try { + buildFile = new File(args[i + 1].replace('/', File.separatorChar)); + i++; + } catch (ArrayIndexOutOfBoundsException aioobe) { + String msg = "You must specify a buildfile when " + + "using the -buildfile argument"; + throw new BuildException(msg); + } + } else if (arg.equals("-listener")) { + try { + listeners.addElement(args[i + 1]); + i++; + } catch (ArrayIndexOutOfBoundsException aioobe) { + String msg = "You must specify a classname when " + + "using the -listener argument"; + throw new BuildException(msg); + } + } else if (arg.startsWith("-D")) { + + /* Interestingly enough, we get to here when a user + * uses -Dname=value. However, in some cases, the OS + * goes ahead and parses this out to args + * {"-Dname", "value"} + * so instead of parsing on "=", we just make the "-D" + * characters go away and skip one argument forward. + * + * I don't know how to predict when the JDK is going + * to help or not, so we simply look for the equals sign. + */ + + String name = arg.substring(2, arg.length()); + String value = null; + int posEq = name.indexOf("="); + if (posEq > 0) { + value = name.substring(posEq + 1); + name = name.substring(0, posEq); + } else if (i < args.length - 1) { + value = args[++i]; + } else { + throw new BuildException("Missing value for property " + + name); + } + + definedProps.put(name, value); + } else if (arg.equals("-logger")) { + if (loggerClassname != null) { + throw new BuildException("Only one logger class may " + + " be specified."); + } + try { + loggerClassname = args[++i]; + } catch (ArrayIndexOutOfBoundsException aioobe) { + throw new BuildException("You must specify a classname when" + + " using the -logger argument"); + } + } else if (arg.equals("-inputhandler")) { + if (inputHandlerClassname != null) { + throw new BuildException("Only one input handler class may " + + "be specified."); + } + try { + inputHandlerClassname = args[++i]; + } catch (ArrayIndexOutOfBoundsException aioobe) { + throw new BuildException("You must specify a classname when" + + " using the -inputhandler" + + " argument"); + } + } else if (arg.equals("-emacs") || arg.equals("-e")) { + emacsMode = true; + } else if (arg.equals("-projecthelp") || arg.equals("-p")) { + // set the flag to display the targets and quit + projectHelp = true; + } else if (arg.equals("-find") || arg.equals("-s")) { + // eat up next arg if present, default to build.xml + if (i < args.length - 1) { + searchForThis = args[++i]; + } else { + searchForThis = DEFAULT_BUILD_FILENAME; + } + } else if (arg.startsWith("-propertyfile")) { + try { + propertyFiles.addElement(args[i + 1]); + i++; + } catch (ArrayIndexOutOfBoundsException aioobe) { + String msg = "You must specify a property filename when " + + "using the -propertyfile argument"; + throw new BuildException(msg); + } + } else if (arg.equals("-k") || arg.equals("-keep-going")) { + keepGoingMode = true; + } else if (arg.equals("-nice")) { + try { + threadPriority=Integer.decode(args[i + 1]); + } catch (ArrayIndexOutOfBoundsException aioobe) { + throw new BuildException( + "You must supply a niceness value (1-10)"+ + " after the -nice option"); + } catch (NumberFormatException e) { + throw new BuildException("Unrecognized niceness value: " + + args[i + 1]); + } + i++; + if(threadPriority.intValue()Thread.MAX_PRIORITY) { + throw new BuildException( + "Niceness value is out of the range 1-10"); + } + } else if (arg.startsWith("-")) { + // we don't have any more args to recognize! + String msg = "Unknown argument: " + arg; + System.out.println(msg); + printUsage(); + throw new BuildException(""); + } else { + // if it's no other arg, it may be the target + targets.addElement(arg); + } + } + + // if buildFile was not specified on the command line, + if (buildFile == null) { + // but -find then search for it + if (searchForThis != null) { + buildFile = findBuildFile(System.getProperty("user.dir"), + searchForThis); + } else { + buildFile = new File(DEFAULT_BUILD_FILENAME); + } + } + + // make sure buildfile exists + if (!buildFile.exists()) { + System.out.println("Buildfile: " + buildFile + " does not exist!"); + throw new BuildException("Build failed"); + } + + // make sure it's not a directory (this falls into the ultra + // paranoid lets check everything category + + if (buildFile.isDirectory()) { + System.out.println("What? Buildfile: " + buildFile + " is a dir!"); + throw new BuildException("Build failed"); + } + + // Load the property files specified by -propertyfile + for (int propertyFileIndex = 0; + propertyFileIndex < propertyFiles.size(); + propertyFileIndex++) { + String filename + = (String) propertyFiles.elementAt(propertyFileIndex); + Properties props = new Properties(); + FileInputStream fis = null; + try { + fis = new FileInputStream(filename); + props.load(fis); + } catch (IOException e) { + System.out.println("Could not load property file " + + filename + ": " + e.getMessage()); + } finally { + if (fis != null) { + try { + fis.close(); + } catch (IOException e) { + // ignore + } + } + } + + // ensure that -D properties take precedence + Enumeration propertyNames = props.propertyNames(); + while (propertyNames.hasMoreElements()) { + String name = (String) propertyNames.nextElement(); + if (definedProps.getProperty(name) == null) { + definedProps.put(name, props.getProperty(name)); + } + } + } + + if (msgOutputLevel >= Project.MSG_INFO) { + System.out.println("Buildfile: " + buildFile); + } + + if (logTo != null) { + out = logTo; + err = logTo; + System.setOut(out); + System.setErr(err); + } + readyToRun = true; + } + + /** + * Helper to get the parent file for a given file. + *

+ * Added to simulate File.getParentFile() from JDK 1.2. + * @deprecated + * + * @param file File to find parent of. Must not be null. + * @return Parent file or null if none + */ + private File getParentFile(File file) { + File parent = file.getParentFile(); + + if (parent != null && msgOutputLevel >= Project.MSG_VERBOSE) { + System.out.println("Searching in " + parent.getAbsolutePath()); + } + + return parent; + } + + /** + * Search parent directories for the build file. + *

+ * Takes the given target as a suffix to append to each + * parent directory in search of a build file. Once the + * root of the file-system has been reached an exception + * is thrown. + * + * @param start Leaf directory of search. + * Must not be null. + * @param suffix Suffix filename to look for in parents. + * Must not be null. + * + * @return A handle to the build file if one is found + * + * @exception BuildException if no build file is found + */ + private File findBuildFile(String start, String suffix) + throws BuildException { + if (msgOutputLevel >= Project.MSG_INFO) { + System.out.println("Searching for " + suffix + " ..."); + } + + File parent = new File(new File(start).getAbsolutePath()); + File file = new File(parent, suffix); + + // check if the target file exists in the current directory + while (!file.exists()) { + // change to parent directory + parent = getParentFile(parent); + + // if parent is null, then we are at the root of the fs, + // complain that we can't find the build file. + if (parent == null) { + throw new BuildException("Could not locate a build file!"); + } + + // refresh our file handle + file = new File(parent, suffix); + } + + return file; + } + + /** + * Executes the build. If the constructor for this instance failed + * (e.g. returned after issuing a warning), this method returns + * immediately. + * + * @param coreLoader The classloader to use to find core classes. + * May be null, in which case the + * system classloader is used. + * + * @exception BuildException if the build fails + */ + private void runBuild(ClassLoader coreLoader) throws BuildException { + + if (!readyToRun) { + return; + } + + final Project project = new Project(); + project.setCoreLoader(coreLoader); + + Throwable error = null; + + try { + addBuildListeners(project); + addInputHandler(project); + + PrintStream err = System.err; + PrintStream out = System.out; + InputStream in = System.in; + + // use a system manager that prevents from System.exit() + // only in JDK > 1.1 + SecurityManager oldsm = null; + if (!JavaEnvUtils.isJavaVersion(JavaEnvUtils.JAVA_1_0) + && !JavaEnvUtils.isJavaVersion(JavaEnvUtils.JAVA_1_1)) { + oldsm = System.getSecurityManager(); + + //SecurityManager can not be installed here for backwards + //compatibility reasons (PD). Needs to be loaded prior to + //ant class if we are going to implement it. + //System.setSecurityManager(new NoExitSecurityManager()); + } + try { + if (allowInput) { + project.setDefaultInputStream(System.in); + } + //System.setIn(new DemuxInputStream(project)); + //System.setOut(new PrintStream(new DemuxOutputStream(project, false))); + //System.setErr(new PrintStream(new DemuxOutputStream(project, true))); + + + if (!projectHelp) { + project.fireBuildStarted(); + } + + // set the thread priorities + if (threadPriority != null) { + try { + project.log("Setting Ant's thread priority to " + + threadPriority,Project.MSG_VERBOSE); + Thread.currentThread().setPriority(threadPriority.intValue()); + } catch (SecurityException swallowed) { + //we cannot set the priority here. + project.log("A security manager refused to set the -nice value"); + } + } + + project.init(); + project.setUserProperty("ant.version", getAntVersion()); + + // set user-define properties + Enumeration e = definedProps.keys(); + while (e.hasMoreElements()) { + String arg = (String) e.nextElement(); + String value = (String) definedProps.get(arg); + project.setUserProperty(arg, value); + } + + project.setUserProperty("ant.file", + buildFile.getAbsolutePath()); + project.setKeepGoingMode(keepGoingMode); + + ProjectHelper.configureProject(project, buildFile); + + project.setBasedir(definedProps.getProperty(PropertiesFileRenderer.FILE_ROOT_PROPERTY)); + + + if (projectHelp) { + printDescription(project); + printTargets(project, msgOutputLevel > Project.MSG_INFO); + return; + } + + // make sure that we have a target to execute + if (targets.size() == 0) { + if (project.getDefaultTarget() != null) { + targets.addElement(project.getDefaultTarget()); + } + } + project.executeTargets(targets); + } finally { + // put back the original security manager + //The following will never eval to true. (PD) + if (oldsm != null) { + System.setSecurityManager(oldsm); + } + + System.setOut(out); + System.setErr(err); + System.setIn(in); + } + } catch (RuntimeException exc) { + error = exc; + throw exc; + } catch (Error err) { + error = err; + throw err; + } finally { + if (!projectHelp) { + project.fireBuildFinished(error); + } else if (error != null) { + project.log(error.toString(), Project.MSG_ERR); + } + } + } + + /** + * Adds the listeners specified in the command line arguments, + * along with the default listener, to the specified project. + * + * @param project The project to add listeners to. + * Must not be null. + */ + protected void addBuildListeners(Project project) { + + // Add the default listener + project.addBuildListener(createLogger()); + + //Add the AntInstaller Listener + if(ctx.getBuildListener()!=null){ + project.addBuildListener(ctx.getBuildListener()); + } + + for (int i = 0; i < listeners.size(); i++) { + String className = (String) listeners.elementAt(i); + try { + BuildListener listener = + (BuildListener) Class.forName(className).newInstance(); + if (project != null) { + project.setProjectReference(listener); + } + project.addBuildListener(listener); + } catch (Throwable exc) { + throw new BuildException("Unable to instantiate listener " + + className, exc); + } + } + } + + /** + * Creates the InputHandler and adds it to the project. + * + * @param project the project instance. + * + * @exception BuildException if a specified InputHandler + * implementation could not be loaded. + */ + private void addInputHandler(Project project) throws BuildException { + InputHandler handler = null; + if (inputHandlerClassname == null) { + handler = new DefaultInputHandler(); + } else { + try { + handler = (InputHandler) + (Class.forName(inputHandlerClassname).newInstance()); + if (project != null) { + project.setProjectReference(handler); + } + } catch (ClassCastException e) { + String msg = "The specified input handler class " + + inputHandlerClassname + + " does not implement the InputHandler interface"; + throw new BuildException(msg); + } catch (Exception e) { + String msg = "Unable to instantiate specified input handler " + + "class " + inputHandlerClassname + " : " + + e.getClass().getName(); + throw new BuildException(msg); + } + } + project.setInputHandler(handler); + } + + // XXX: (Jon Skeet) Any reason for writing a message and then using a bare + // RuntimeException rather than just using a BuildException here? Is it + // in case the message could end up being written to no loggers (as the + // loggers could have failed to be created due to this failure)? + /** + * Creates the default build logger for sending build events to the ant + * log. + * + * @return the logger instance for this build. + */ + private BuildLogger createLogger() { + BuildLogger logger = null; + if (loggerClassname != null) { + try { + Class loggerClass = Class.forName(loggerClassname); + logger = (BuildLogger) (loggerClass.newInstance()); + } catch (ClassCastException e) { + System.err.println("The specified logger class " + + loggerClassname + + " does not implement the BuildLogger interface"); + throw new RuntimeException(); + } catch (Exception e) { + System.err.println("Unable to instantiate specified logger " + + "class " + loggerClassname + " : " + + e.getClass().getName()); + throw new RuntimeException(); + } + } else { + logger = new DefaultLogger(); + } + + logger.setMessageOutputLevel(msgOutputLevel); + logger.setOutputPrintStream(out); + logger.setErrorPrintStream(err); + logger.setEmacsMode(emacsMode); + + return logger; + } + + /** + * Prints the usage information for this class to System.out. + */ + private static void printUsage() { + String lSep = System.getProperty("line.separator"); + StringBuffer msg = new StringBuffer(); + msg.append("ant [options] [target [target2 [target3] ...]]" + lSep); + msg.append("Options: " + lSep); + msg.append(" -help, -h print this message" + lSep); + msg.append(" -projecthelp, -p print project help information" + lSep); + msg.append(" -version print the version information and exit" + lSep); + msg.append(" -diagnostics print information that might be helpful to" + lSep); + msg.append(" diagnose or report problems." + lSep); + msg.append(" -quiet, -q be extra quiet" + lSep); + msg.append(" -verbose, -v be extra verbose" + lSep); + msg.append(" -debug, -d print debugging information" + lSep); + msg.append(" -emacs, -e produce logging information without adornments" + lSep); + msg.append(" -lib specifies a path to search for jars and classes" + lSep); + msg.append(" -logfile use given file for log" + lSep); + msg.append(" -l ''" + lSep); + msg.append(" -logger the class which is to perform logging" + lSep); + msg.append(" -listener add an instance of class as a project listener" + lSep); + msg.append(" -noinput do not allow interactive input" + lSep); + msg.append(" -buildfile use given buildfile" + lSep); + msg.append(" -file ''" + lSep); + msg.append(" -f ''" + lSep); + msg.append(" -D= use value for given property" + lSep); + msg.append(" -keep-going, -k execute all targets that do not depend" + lSep); + msg.append(" on failed target(s)" + lSep); + msg.append(" -propertyfile load all properties from file with -D" + lSep); + msg.append(" properties taking precedence" + lSep); + msg.append(" -inputhandler the class which will handle input requests" + lSep); + msg.append(" -find (s)earch for buildfile towards the root of" + lSep); + msg.append(" -s the filesystem and use it" + lSep); + msg.append(" -nice number A niceness value for the main thread:" + lSep + + " 1 (lowest) to 10 (highest); 5 is the default" + lSep); + System.out.println(msg.toString()); + } + + /** + * Prints the Ant version information to System.out. + * + * @exception BuildException if the version information is unavailable + */ + private static void printVersion() throws BuildException { + System.out.println(getAntVersion()); + } + + /** + * Cache of the Ant version information when it has been loaded. + */ + private static String antVersion = null; + + /** + * Returns the Ant version information, if available. Once the information + * has been loaded once, it's cached and returned from the cache on future + * calls. + * + * @return the Ant version information as a String + * (always non-null) + * + * @exception BuildException if the version information is unavailable + */ + public static synchronized String getAntVersion() throws BuildException { + if (antVersion == null) { + try { + Properties props = new Properties(); + InputStream in = + Main.class.getResourceAsStream("/org/apache/tools/ant/version.txt"); + props.load(in); + in.close(); + + StringBuffer msg = new StringBuffer(); + msg.append("Apache Ant version "); + msg.append(props.getProperty("VERSION")); + msg.append(" compiled on "); + msg.append(props.getProperty("DATE")); + antVersion = msg.toString(); + } catch (IOException ioe) { + throw new BuildException("Could not load the version information:" + + ioe.getMessage()); + } catch (NullPointerException npe) { + throw new BuildException("Could not load the version information."); + } + } + return antVersion; + } + + /** + * Prints the description of a project (if there is one) to + * System.out. + * + * @param project The project to display a description of. + * Must not be null. + */ + private static void printDescription(Project project) { + if (project.getDescription() != null) { + project.log(project.getDescription()); + } + } + + /** + * Prints a list of all targets in the specified project to + * System.out, optionally including subtargets. + * + * @param project The project to display a description of. + * Must not be null. + * @param printSubTargets Whether or not subtarget names should also be + * printed. + */ + private static void printTargets(Project project, boolean printSubTargets) { + // find the target with the longest name + int maxLength = 0; + Enumeration ptargets = project.getTargets().elements(); + String targetName; + String targetDescription; + Target currentTarget; + // split the targets in top-level and sub-targets depending + // on the presence of a description + Vector topNames = new Vector(); + Vector topDescriptions = new Vector(); + Vector subNames = new Vector(); + + while (ptargets.hasMoreElements()) { + currentTarget = (Target) ptargets.nextElement(); + targetName = currentTarget.getName(); + if (targetName.equals("")) { + continue; + } + targetDescription = currentTarget.getDescription(); + // maintain a sorted list of targets + if (targetDescription == null) { + int pos = findTargetPosition(subNames, targetName); + subNames.insertElementAt(targetName, pos); + } else { + int pos = findTargetPosition(topNames, targetName); + topNames.insertElementAt(targetName, pos); + topDescriptions.insertElementAt(targetDescription, pos); + if (targetName.length() > maxLength) { + maxLength = targetName.length(); + } + } + } + + printTargets(project, topNames, topDescriptions, "Main targets:", + maxLength); + //if there were no main targets, we list all subtargets + //as it means nothing has a description + if (topNames.size() == 0) { + printSubTargets = true; + } + if (printSubTargets) { + printTargets(project, subNames, null, "Other targets:", 0); + } + + String defaultTarget = project.getDefaultTarget(); + if (defaultTarget != null && !"".equals(defaultTarget)) { + // shouldn't need to check but... + project.log("Default target: " + defaultTarget); + } + } + + /** + * Searches for the correct place to insert a name into a list so as + * to keep the list sorted alphabetically. + * + * @param names The current list of names. Must not be null. + * @param name The name to find a place for. + * Must not be null. + * + * @return the correct place in the list for the given name + */ + private static int findTargetPosition(Vector names, String name) { + int res = names.size(); + for (int i = 0; i < names.size() && res == names.size(); i++) { + if (name.compareTo((String) names.elementAt(i)) < 0) { + res = i; + } + } + return res; + } + + /** + * Writes a formatted list of target names to System.out + * with an optional description. + * + * + * @param project the project instance. + * @param names The names to be printed. + * Must not be null. + * @param descriptions The associated target descriptions. + * May be null, in which case + * no descriptions are displayed. + * If non-null, this should have + * as many elements as names. + * @param heading The heading to display. + * Should not be null. + * @param maxlen The maximum length of the names of the targets. + * If descriptions are given, they are padded to this + * position so they line up (so long as the names really + * are shorter than this). + */ + private static void printTargets(Project project, Vector names, + Vector descriptions, String heading, + int maxlen) { + // now, start printing the targets and their descriptions + String lSep = System.getProperty("line.separator"); + // got a bit annoyed that I couldn't find a pad function + String spaces = " "; + while (spaces.length() <= maxlen) { + spaces += spaces; + } + StringBuffer msg = new StringBuffer(); + msg.append(heading); + msg.append(lSep); + msg.append(lSep); + for (int i = 0; i < names.size(); i++) { + msg.append(" "); + msg.append(names.elementAt(i)); + if (descriptions != null) { + msg.append(spaces.substring(0, maxlen - ((String) names.elementAt(i)).length() + 2)); + msg.append(descriptions.elementAt(i)); + } + msg.append(lSep); + } + project.log(msg.toString()); + } +} Property changes on: pal-portal/modules/ant-installer/trunk/src/org/tp23/antinstaller/antmod/Main.java ___________________________________________________________________ Name: svn:eol-style + native Added: pal-portal/modules/ant-installer/trunk/src/org/tp23/antinstaller/antmod/ProjectHelper3.java =================================================================== --- pal-portal/modules/ant-installer/trunk/src/org/tp23/antinstaller/antmod/ProjectHelper3.java (rev 0) +++ pal-portal/modules/ant-installer/trunk/src/org/tp23/antinstaller/antmod/ProjectHelper3.java 2008-06-11 13:36:41 UTC (rev 975) @@ -0,0 +1,1043 @@ +/* + * Copyright 2000-2004 The Apache Software Foundation + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + * + */ + +package org.tp23.antinstaller.antmod; + +import java.io.File; +import java.io.FileInputStream; +import java.io.FileNotFoundException; +import java.io.IOException; +import java.io.InputStream; +import java.io.UnsupportedEncodingException; +import java.net.URL; +import java.util.Hashtable; +import java.util.Stack; + +import org.apache.tools.ant.BuildException; +import org.apache.tools.ant.Location; +import org.apache.tools.ant.Project; +import org.apache.tools.ant.ProjectHelper; +import org.apache.tools.ant.RuntimeConfigurable; +import org.apache.tools.ant.Target; +import org.apache.tools.ant.Task; +import org.apache.tools.ant.UnknownElement; +import org.apache.tools.ant.helper.AntXMLContext; +import org.apache.tools.ant.util.FileUtils; +import org.apache.tools.ant.util.JAXPUtils; +import org.xml.sax.Attributes; +import org.xml.sax.InputSource; +import org.xml.sax.Locator; +import org.xml.sax.SAXException; +import org.xml.sax.SAXParseException; +import org.xml.sax.XMLReader; +import org.xml.sax.helpers.DefaultHandler; + +/** + * Sax2 based project reader + * +* This file has been modified by Paul Hinds for Antinstaller and is not the same +* as the ProjectHelper2 delivered with Ant 1.6 although almost identical + */ +public class ProjectHelper3 extends ProjectHelper { + /* Stateless */ + + // singletons - since all state is in the context + private static AntHandler elementHandler = new ElementHandler(); + private static AntHandler targetHandler = new TargetHandler(); + private static AntHandler mainHandler = new MainHandler(); + private static AntHandler projectHandler = new ProjectHandler(); + + /** + * helper for path -> URI and URI -> path conversions. + */ + private static FileUtils fu = FileUtils.newFileUtils(); + + /** + * Parse an unknown element from a url + * + * @param project the current project + * @param source the url containing the task + * @return a configured task + * @exception BuildException if an error occurs + */ + public UnknownElement parseUnknownElement(Project project, URL source) + throws BuildException { + Target dummyTarget = new Target(); + dummyTarget.setProject(project); + + AntXMLContext context = new AntXMLContext(project); + context.addTarget(dummyTarget); + context.setImplicitTarget(dummyTarget); + + parse(context.getProject(), source, + new RootHandler(context, elementHandler)); + Task[] tasks = dummyTarget.getTasks(); + if (tasks.length != 1) { + throw new BuildException("No tasks defined"); + } + return (UnknownElement) tasks[0]; + } + /** + * Parse a source xml input. + * + * @param project the current project + * @param source the xml source + * @exception BuildException if an error occurs + */ + public void parse(Project project, Object source) + throws BuildException { + getImportStack().addElement(source); + //System.out.println("Adding " + source); + AntXMLContext context = null; + context = (AntXMLContext) project.getReference("ant.parsing.context"); +// System.out.println("Parsing " + getImportStack().size() + " " + +// context+ " " + getImportStack() ); + if (context == null) { + context = new AntXMLContext(project); + project.addReference("ant.parsing.context", context); + project.addReference("ant.targets", context.getTargets()); + } + + if (getImportStack().size() > 1) { + // we are in an imported file. + context.setIgnoreProjectTag(true); + Target currentTarget = context.getCurrentTarget(); + try { + Target newCurrent = new Target(); + newCurrent.setProject(project); + newCurrent.setName(""); + context.setCurrentTarget(newCurrent); + parse(project, source, new RootHandler(context, mainHandler)); + newCurrent.execute(); + } finally { + context.setCurrentTarget(currentTarget); + } + } else { + // top level file + parse(project, source, new RootHandler(context, mainHandler)); + // Execute the top-level target + context.getImplicitTarget().execute(); + } + } + + /** + * Parses the project file, configuring the project as it goes. + * + * @param project the current project + * @param source the xml source + * @param handler the root handler to use (contains the current context) + * @exception BuildException if the configuration is invalid or cannot + * be read + */ + public void parse(Project project, Object source, RootHandler handler) + throws BuildException { + + AntXMLContext context = handler.context; + + File buildFile = null; + URL url = null; + String buildFileName = null; + + if (source instanceof File) { + buildFile = (File) source; + buildFile = fu.normalize(buildFile.getAbsolutePath()); + context.setBuildFile(buildFile); + buildFileName = buildFile.toString(); +// } else if (source instanceof InputStream ) { + } else if (source instanceof URL) { +// These commented out code is the only difference +// between this class and ProjectHelper2 +// if (handler.getCurrentAntHandler() != elementHandler) { +// throw new BuildException( +// "Source " + source.getClass().getName() +// + " not supported by this plugin for " +// + " non task xml"); +// } + url = (URL) source; + buildFileName = url.toString(); +// } else if (source instanceof InputSource ) { + } else { + throw new BuildException("Source " + source.getClass().getName() + + " not supported by this plugin"); + } + + InputStream inputStream = null; + InputSource inputSource = null; + + + try { + /** + * SAX 2 style parser used to parse the given file. + */ + XMLReader parser = JAXPUtils.getNamespaceXMLReader(); + + String uri = null; + if (buildFile != null) { + uri = fu.toURI(buildFile.getAbsolutePath()); + inputStream = new FileInputStream(buildFile); + } else { + inputStream = url.openStream(); + uri = url.toString(); // ?? OK ?? + } + + inputSource = new InputSource(inputStream); + if (uri != null) { + inputSource.setSystemId(uri); + } + project.log("parsing buildfile " + buildFileName + + " with URI = " + uri, Project.MSG_VERBOSE); + + DefaultHandler hb = handler; + + parser.setContentHandler(hb); + parser.setEntityResolver(hb); + parser.setErrorHandler(hb); + parser.setDTDHandler(hb); + parser.parse(inputSource); + } catch (SAXParseException exc) { + Location location = new Location(exc.getSystemId(), + exc.getLineNumber(), exc.getColumnNumber()); + + Throwable t = exc.getException(); + if (t instanceof BuildException) { + BuildException be = (BuildException) t; + if (be.getLocation() == Location.UNKNOWN_LOCATION) { + be.setLocation(location); + } + throw be; + } + + throw new BuildException(exc.getMessage(), t, location); + } catch (SAXException exc) { + Throwable t = exc.getException(); + if (t instanceof BuildException) { + throw (BuildException) t; + } + throw new BuildException(exc.getMessage(), t); + } catch (FileNotFoundException exc) { + throw new BuildException(exc); + } catch (UnsupportedEncodingException exc) { + throw new BuildException("Encoding of project file " + + buildFileName + " is invalid.", + exc); + } catch (IOException exc) { + throw new BuildException("Error reading project file " + + buildFileName + ": " + exc.getMessage(), + exc); + } finally { + if (inputStream != null) { + try { + inputStream.close(); + } catch (IOException ioe) { + // ignore this + } + } + } + } + + /** + * The common superclass for all SAX event handlers used to parse + * the configuration file. + * + * The context will hold all state information. At each time + * there is one active handler for the current element. It can + * use onStartChild() to set an alternate handler for the child. + */ + public static class AntHandler { + /** + * Handles the start of an element. This base implementation does + * nothing. + * + * @param uri the namespace URI for the tag + * @param tag The name of the element being started. + * Will not be null. + * @param qname The qualified name of the element. + * @param attrs Attributes of the element being started. + * Will not be null. + * @param context The context that this element is in. + * + * @exception SAXParseException if this method is not overridden, or in + * case of error in an overridden version + */ + public void onStartElement(String uri, String tag, String qname, + Attributes attrs, + AntXMLContext context) + throws SAXParseException { + } + + /** + * Handles the start of an element. This base implementation just + * throws an exception - you must override this method if you expect + * child elements. + * + * @param uri The namespace uri for this element. + * @param tag The name of the element being started. + * Will not be null. + * @param qname The qualified name for this element. + * @param attrs Attributes of the element being started. + * Will not be null. + * @param context The current context. + * @return a handler (in the derived classes) + * + * @exception SAXParseException if this method is not overridden, or in + * case of error in an overridden version + */ + public AntHandler onStartChild(String uri, String tag, String qname, + Attributes attrs, + AntXMLContext context) + throws SAXParseException { + throw new SAXParseException("Unexpected element \"" + qname + + " \"", context.getLocator()); + } + + /** + * Handle the end of a element. + * + * @param uri the namespace uri of the element + * @param tag the tag of the element + * @param qname the qualified name of the element + * @param context the current context + * @exception SAXParseException if an error occurs + */ + public void onEndChild(String uri, String tag, String qname, + AntXMLContext context) + throws SAXParseException { + } + + /** + * This method is called when this element and all elements nested into it have been + * handled. I.e., this happens at the </end_tag_of_the_element>. + * @param uri the namespace uri for this element + * @param tag the element name + * @param context the current context + */ + public void onEndElement(String uri, String tag, + AntXMLContext context) { + } + + /** + * Handles text within an element. This base implementation just + * throws an exception, you must override it if you expect content. + * + * @param buf A character array of the text within the element. + * Will not be null. + * @param start The start element in the array. + * @param count The number of characters to read from the array. + * @param context The current context. + * + * @exception SAXParseException if this method is not overridden, or in + * case of error in an overridden version + */ + public void characters(char[] buf, int start, int count, AntXMLContext context) + throws SAXParseException { + String s = new String(buf, start, count).trim(); + + if (s.length() > 0) { + throw new SAXParseException("Unexpected text \"" + s + + "\"", context.getLocator()); + } + } + + /** + * Will be called every time a namespace is reached. + * It'll verify if the ns was processed, and if not load the task + * definitions. + * @param uri The namespace uri. + */ + protected void checkNamespace(String uri) { + + } + } + + /** + * Handler for ant processing. Uses a stack of AntHandlers to + * implement each element ( the original parser used a recursive behavior, + * with the implicit execution stack ) + */ + public static class RootHandler extends DefaultHandler { + private Stack antHandlers = new Stack(); + private AntHandler currentHandler = null; + private AntXMLContext context; + + /** + * Creates a new RootHandler instance. + * + * @param context The context for the handler. + * @param rootHandler The handler for the root element. + */ + public RootHandler(AntXMLContext context, AntHandler rootHandler) { + currentHandler = rootHandler; + antHandlers.push(currentHandler); + this.context = context; + } + + /** + * Returns the current ant handler object. + * @return the current ant handler. + */ + public AntHandler getCurrentAntHandler() { + return currentHandler; + } + + /** + * Resolves file: URIs relative to the build file. + * + * @param publicId The public identifier, or null + * if none is available. Ignored in this + * implementation. + * @param systemId The system identifier provided in the XML + * document. Will not be null. + * @return an inputsource for this identifier + */ + public InputSource resolveEntity(String publicId, + String systemId) { + + context.getProject().log("resolving systemId: " + + systemId, Project.MSG_VERBOSE); + + if (systemId.startsWith("file:")) { + String path = fu.fromURI(systemId); + + File file = new File(path); + if (!file.isAbsolute()) { + file = fu.resolveFile(context.getBuildFileParent(), path); + } + try { + InputSource inputSource = + new InputSource(new FileInputStream(file)); + inputSource.setSystemId(fu.toURI(file.getAbsolutePath())); + return inputSource; + } catch (FileNotFoundException fne) { + context.getProject().log(file.getAbsolutePath() + + " could not be found", Project.MSG_WARN); + } + + } + // use default if not file or file not found + return null; + } + + /** + * Handles the start of a project element. A project handler is created + * and initialised with the element name and attributes. + * + * @param uri The namespace uri for this element. + * @param tag The name of the element being started. + * Will not be null. + * @param qname The qualified name for this element. + * @param attrs Attributes of the element being started. + * Will not be null. + * + * @exception org.xml.sax.SAXParseException if the tag given is not + * "project" + */ + public void startElement(String uri, String tag, String qname, Attributes attrs) + throws SAXParseException { + AntHandler next + = currentHandler.onStartChild(uri, tag, qname, attrs, context); + antHandlers.push(currentHandler); + currentHandler = next; + currentHandler.onStartElement(uri, tag, qname, attrs, context); + } + + /** + * Sets the locator in the project helper for future reference. + * + * @param locator The locator used by the parser. + * Will not be null. + */ + public void setDocumentLocator(Locator locator) { + context.setLocator(locator); + } + + /** + * Handles the end of an element. Any required clean-up is performed + * by the onEndElement() method and then the original handler + * is restored to the parser. + * + * @param uri The namespace URI for this element. + * @param name The name of the element which is ending. + * Will not be null. + * @param qName The qualified name for this element. + * + * @exception SAXException in case of error (not thrown in + * this implementation) + * + */ + public void endElement(String uri, String name, String qName) throws SAXException { + currentHandler.onEndElement(uri, name, context); + AntHandler prev = (AntHandler) antHandlers.pop(); + currentHandler = prev; + if (currentHandler != null) { + currentHandler.onEndChild(uri, name, qName, context); + } + } + + /** + * Handle text within an element, calls currentHandler.characters. + * + * @param buf A character array of the test. + * @param start The start offset in the array. + * @param count The number of characters to read. + * @exception SAXParseException if an error occurs + */ + public void characters(char[] buf, int start, int count) + throws SAXParseException { + currentHandler.characters(buf, start, count, context); + } + + /** + * Start a namespace prefix to uri mapping + * + * @param prefix the namespace prefix + * @param uri the namespace uri + */ + public void startPrefixMapping(String prefix, String uri) { + context.startPrefixMapping(prefix, uri); + } + + /** + * End a namepace prefix to uri mapping + * + * @param prefix the prefix that is not mapped anymore + */ + public void endPrefixMapping(String prefix) { + context.endPrefixMapping(prefix); + } + } + + /** + * The main handler - it handles the <project> tag. + * + * @see AntHandler + */ + public static class MainHandler extends AntHandler { + + /** + * Handle the project tag + * + * @param uri The namespace uri. + * @param name The element tag. + * @param qname The element qualified name. + * @param attrs The attributes of the element. + * @param context The current context. + * @return The project handler that handles subelements of project + * @exception SAXParseException if the qualified name is not "project". + */ + public AntHandler onStartChild(String uri, String name, String qname, + Attributes attrs, + AntXMLContext context) + throws SAXParseException { + if (name.equals("project") + && (uri.equals("") || uri.equals(ANT_CORE_URI))) { + return ProjectHelper3.projectHandler; + } else { +// if (context.importlevel > 0) { +// // we are in an imported file. Allow top-level . +// if (qname.equals( "target" ) ) +// return ProjectHelper3.targetHandler; +// } + throw new SAXParseException("Unexpected element \"" + qname + + "\" " + name, context.getLocator()); + } + } + } + + /** + * Handler for the top level "project" element. + */ + public static class ProjectHandler extends AntHandler { + + /** + * Initialisation routine called after handler creation + * with the element name and attributes. The attributes which + * this handler can deal with are: "default", + * "name", "id" and "basedir". + * + * @param uri The namespace URI for this element. + * @param tag Name of the element which caused this handler + * to be created. Should not be null. + * Ignored in this implementation. + * @param qname The qualified name for this element. + * @param attrs Attributes of the element which caused this + * handler to be created. Must not be null. + * @param context The current context. + * + * @exception SAXParseException if an unexpected attribute is + * encountered or if the "default" attribute + * is missing. + */ + public void onStartElement(String uri, String tag, String qname, + Attributes attrs, + AntXMLContext context) + throws SAXParseException { + String id = null; + String baseDir = null; + boolean nameAttributeSet = false; + + Project project = context.getProject(); + + /** XXX I really don't like this - the XML processor is still + * too 'involved' in the processing. A better solution (IMO) + * would be to create UE for Project and Target too, and + * then process the tree and have Project/Target deal with + * its attributes ( similar with Description ). + * + * If we eventually switch to ( or add support for ) DOM, + * things will work smoothly - UE can be avoided almost completely + * ( it could still be created on demand, for backward compatibility ) + */ + + for (int i = 0; i < attrs.getLength(); i++) { + String attrUri = attrs.getURI(i); + if (attrUri != null + && !attrUri.equals("") + && !attrUri.equals(uri)) { + continue; // Ignore attributes from unknown uris + } + String key = attrs.getLocalName(i); + String value = attrs.getValue(i); + + if (key.equals("default")) { + if (value != null && !value.equals("")) { + if (!context.isIgnoringProjectTag()) { + project.setDefault(value); + } + } + } else if (key.equals("name")) { + if (value != null) { + context.setCurrentProjectName(value); + nameAttributeSet = true; + if (!context.isIgnoringProjectTag()) { + project.setName(value); + project.addReference(value, project); + } + } + } else if (key.equals("id")) { + if (value != null) { + // What's the difference between id and name ? + if (!context.isIgnoringProjectTag()) { + project.addReference(value, project); + } + } + } else if (key.equals("basedir")) { + if (!context.isIgnoringProjectTag()) { + baseDir = value; + } + } else { + // XXX ignore attributes in a different NS ( maybe store them ? ) + throw new SAXParseException("Unexpected attribute \"" + + attrs.getQName(i) + "\"", context.getLocator()); + } + } + + // XXX Move to Project ( so it is shared by all helpers ) + String antFileProp = "ant.file." + context.getCurrentProjectName(); + String dup = project.getProperty(antFileProp); + if (dup != null && nameAttributeSet) { + File dupFile = new File(dup); + if (context.isIgnoringProjectTag() + && !dupFile.equals(context.getBuildFile())) { + project.log("Duplicated project name in import. Project " + + context.getCurrentProjectName() + " defined first in " + + dup + " and again in " + context.getBuildFile(), + Project.MSG_WARN); + } + } + + if (context.getBuildFile() != null) { + project.setUserProperty("ant.file." + + context.getCurrentProjectName(), + context.getBuildFile().toString()); + } + + if (context.isIgnoringProjectTag()) { + // no further processing + return; + } + // set explicitly before starting ? + if (project.getProperty("basedir") != null) { + project.setBasedir(project.getProperty("basedir")); + } else { + // Default for baseDir is the location of the build file. + if (baseDir == null) { + project.setBasedir(context.getBuildFileParent().getAbsolutePath()); + } else { + // check whether the user has specified an absolute path + if ((new File(baseDir)).isAbsolute()) { + project.setBasedir(baseDir); + } else { + project.setBaseDir(fu.resolveFile( + context.getBuildFileParent(), baseDir)); + } + } + } + + project.addTarget("", context.getImplicitTarget()); + context.setCurrentTarget(context.getImplicitTarget()); + } + + /** + * Handles the start of a top-level element within the project. An + * appropriate handler is created and initialised with the details + * of the element. + * + * @param uri The namespace URI for this element. + * @param name The name of the element being started. + * Will not be null. + * @param qname The qualified name for this element. + * @param attrs Attributes of the element being started. + * Will not be null. + * @param context The context for this element. + * @return a target or an element handler. + * + * @exception org.xml.sax.SAXParseException if the tag given is not + * "taskdef", "typedef", + * "property", "target" + * or a data type definition + */ + public AntHandler onStartChild(String uri, String name, String qname, + Attributes attrs, + AntXMLContext context) + throws SAXParseException { + if (name.equals("target") + && (uri.equals("") || uri.equals(ANT_CORE_URI))) { + return ProjectHelper3.targetHandler; + } else { + return ProjectHelper3.elementHandler; + } + } + + } + + /** + * Handler for "target" elements. + */ + public static class TargetHandler extends AntHandler { + + /** + * Initialisation routine called after handler creation + * with the element name and attributes. The attributes which + * this handler can deal with are: "name", + * "depends", "if", + * "unless", "id" and + * "description". + * + * @param uri The namespace URI for this element. + * @param tag Name of the element which caused this handler + * to be created. Should not be null. + * Ignored in this implementation. + * @param qname The qualified name for this element. + * @param attrs Attributes of the element which caused this + * handler to be created. Must not be null. + * @param context The current context. + * + * @exception SAXParseException if an unexpected attribute is encountered + * or if the "name" attribute is missing. + */ + public void onStartElement(String uri, String tag, String qname, + Attributes attrs, + AntXMLContext context) + throws SAXParseException { + String name = null; + String depends = ""; + + Project project = context.getProject(); + Target target = new Target(); + target.setProject(project); + context.addTarget(target); + + for (int i = 0; i < attrs.getLength(); i++) { + String attrUri = attrs.getURI(i); + if (attrUri != null + && !attrUri.equals("") + && !attrUri.equals(uri)) { + continue; // Ignore attributes from unknown uris + } + String key = attrs.getLocalName(i); + String value = attrs.getValue(i); + + if (key.equals("name")) { + name = value; + if ("".equals(name)) { + throw new BuildException("name attribute must " + + "not be empty"); + } + } else if (key.equals("depends")) { + depends = value; + } else if (key.equals("if")) { + target.setIf(value); + } else if (key.equals("unless")) { + target.setUnless(value); + } else if (key.equals("id")) { + if (value != null && !value.equals("")) { + context.getProject().addReference(value, target); + } + } else if (key.equals("description")) { + target.setDescription(value); + } else { + throw new SAXParseException("Unexpected attribute \"" + + key + "\"", context.getLocator()); + } + } + + if (name == null) { + throw new SAXParseException("target element appears without " + + "a name attribute", context.getLocator()); + } + + Hashtable currentTargets = project.getTargets(); + + // If the name has already been defined ( import for example ) + if (currentTargets.containsKey(name)) { + if (!context.isIgnoringProjectTag()) { + // not in a import'ed file + throw new BuildException( + "Duplicate target '" + name + "'", + new Location(context.getLocator().getSystemId(), + context.getLocator().getLineNumber(), + context.getLocator().getColumnNumber())); + } + // Alter the name. + if (context.getCurrentProjectName() != null) { + String newName = context.getCurrentProjectName() + + "." + name; + project.log("Already defined in main or a previous import, " + + "define " + name + " as " + newName, + Project.MSG_VERBOSE); + name = newName; + } else { + project.log("Already defined in main or a previous import, " + + "ignore " + name, Project.MSG_VERBOSE); + name = null; + } + } + + if (name != null) { + target.setName(name); + project.addOrReplaceTarget(name, target); + } + + // take care of dependencies + if (depends.length() > 0) { + target.setDepends(depends); + } + } + + /** + * Handles the start of an element within a target. + * + * @param uri The namespace URI for this element. + * @param name The name of the element being started. + * Will not be null. + * @param qname The qualified name for this element. + * @param attrs Attributes of the element being started. + * Will not be null. + * @param context The current context. + * @return an element handler. + * + * @exception SAXParseException if an error occurs when initialising + * the appropriate child handler + */ + public AntHandler onStartChild(String uri, String name, String qname, + Attributes attrs, + AntXMLContext context) + throws SAXParseException { + return ProjectHelper3.elementHandler; + } + + /** + * Handle the end of the project, sets the current target of the + * context to be the implicit target. + * + * @param uri The namespace URI of the element. + * @param tag The name of the element. + * @param context The current context. + */ + public void onEndElement(String uri, String tag, AntXMLContext context) { + context.setCurrentTarget(context.getImplicitTarget()); + } + } + + /** + * Handler for all project elements ( tasks, data types ) + */ + public static class ElementHandler extends AntHandler { + + /** + * Constructor. + */ + public ElementHandler() { + } + + /** + * Initialisation routine called after handler creation + * with the element name and attributes. This configures + * the element with its attributes and sets it up with + * its parent container (if any). Nested elements are then + * added later as the parser encounters them. + * + * @param uri The namespace URI for this element. + * @param tag Name of the element which caused this handler + * to be created. Must not be null. + * @param qname The qualified name for this element. + * @param attrs Attributes of the element which caused this + * handler to be created. Must not be null. + * @param context The current context. + * + * @exception SAXParseException in case of error (not thrown in + * this implementation) + */ + public void onStartElement(String uri, String tag, String qname, + Attributes attrs, + AntXMLContext context) + throws SAXParseException { + RuntimeConfigurable parentWrapper = context.currentWrapper(); + Object parent = null; + + if (parentWrapper != null) { + parent = parentWrapper.getProxy(); + } + + /* UnknownElement is used for tasks and data types - with + delayed eval */ + UnknownElement task = new UnknownElement(tag); + task.setProject(context.getProject()); + task.setNamespace(uri); + task.setQName(qname); + task.setTaskType( + ProjectHelper.genComponentName(task.getNamespace(), tag)); + task.setTaskName(qname); + + Location location = new Location(context.getLocator().getSystemId(), + context.getLocator().getLineNumber(), + context.getLocator().getColumnNumber()); + task.setLocation(location); + task.setOwningTarget(context.getCurrentTarget()); + + context.configureId(task, attrs); + + if (parent != null) { + // Nested element + ((UnknownElement) parent).addChild(task); + } else { + // Task included in a target ( including the default one ). + context.getCurrentTarget().addTask(task); + } + + // container.addTask(task); + // This is a nop in UE: task.init(); + + RuntimeConfigurable wrapper + = new RuntimeConfigurable(task, task.getTaskName()); + + for (int i = 0; i < attrs.getLength(); i++) { + String name = attrs.getLocalName(i); + String attrUri = attrs.getURI(i); + if (attrUri != null + && !attrUri.equals("") + && !attrUri.equals(uri)) { + name = attrUri + ":" + attrs.getQName(i); + } + String value = attrs.getValue(i); + // PR: Hack for ant-type value + // an ant-type is a component name which can + // be namespaced, need to extract the name + // and convert from qualified name to uri/name + if (ANT_TYPE.equals(name) + || (ANT_CORE_URI.equals(attrUri) + && ANT_TYPE.equals(attrs.getLocalName(i)))) { + name = ANT_TYPE; + int index = value.indexOf(":"); + if (index != -1) { + String prefix = value.substring(0, index); + String mappedUri = context.getPrefixMapping(prefix); + if (mappedUri == null) { + throw new BuildException( + "Unable to find XML NS prefix " + prefix); + } + value = ProjectHelper.genComponentName( + mappedUri, value.substring(index + 1)); + } + } + wrapper.setAttribute(name, value); + } + + if (parentWrapper != null) { + parentWrapper.addChild(wrapper); + } + + context.pushWrapper(wrapper); + } + + /** + * Adds text to the task, using the wrapper + * + * @param buf A character array of the text within the element. + * Will not be null. + * @param start The start element in the array. + * @param count The number of characters to read from the array. + * @param context The current context. + * + * @exception SAXParseException if the element doesn't support text + * + * @see ProjectHelper#addText(Project,java.lang.Object,char[],int,int) + */ + public void characters(char[] buf, int start, int count, + AntXMLContext context) + throws SAXParseException { + RuntimeConfigurable wrapper = context.currentWrapper(); + wrapper.addText(buf, start, count); + } + + /** + * Handles the start of an element within a target. Task containers + * will always use another task handler, and all other tasks + * will always use a nested element handler. + * + * @param uri The namespace URI for this element. + * @param tag The name of the element being started. + * Will not be null. + * @param qname The qualified name for this element. + * @param attrs Attributes of the element being started. + * Will not be null. + * @param context The current context. + * @return The handler for elements. + * + * @exception SAXParseException if an error occurs when initialising + * the appropriate child handler + */ + public AntHandler onStartChild(String uri, String tag, String qname, + Attributes attrs, + AntXMLContext context) + throws SAXParseException { + return ProjectHelper3.elementHandler; + } + + /** + * Handles the end of the element. This pops the wrapper from + * the context. + * + * @param uri The namespace URI for the element. + * @param tag The name of the element. + * @param context The current context. + */ + public void onEndElement(String uri, String tag, AntXMLContext context) { + context.popWrapper(); + } + } +} Property changes on: pal-portal/modules/ant-installer/trunk/src/org/tp23/antinstaller/antmod/ProjectHelper3.java ___________________________________________________________________ Name: svn:eol-style + native Added: pal-portal/modules/ant-installer/trunk/src/org/tp23/antinstaller/antmod/RegexpMatcherFactory.java =================================================================== --- pal-portal/modules/ant-installer/trunk/src/org/tp23/antinstaller/antmod/RegexpMatcherFactory.java (rev 0) +++ pal-portal/modules/ant-installer/trunk/src/org/tp23/antinstaller/antmod/RegexpMatcherFactory.java 2008-06-11 13:36:41 UTC (rev 975) @@ -0,0 +1,43 @@ +/* + * Copyright 2005 Paul Hinds + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +package org.tp23.antinstaller.antmod; + +import org.apache.tools.ant.BuildException; +import org.apache.tools.ant.util.regexp.RegexpMatcher; + + +/** + * This class exists because the default Regexp handler is not part of ant.jar + * @author Paul Hinds + * @version $Id: RegexpMatcherFactory.java,v 1.2 2006/12/21 00:03:05 teknopaul Exp $ + */ +public class RegexpMatcherFactory { + + /** + * + */ + public RegexpMatcherFactory() { + super(); + } + public RegexpMatcher newRegexpMatcher() throws BuildException { + try{ + return new org.apache.tools.ant.util.regexp.RegexpMatcherFactory().newRegexpMatcher(null); + } + catch(BuildException be){ + return new Jdk14RegexpMatcher(); + } + } +} Property changes on: pal-portal/modules/ant-installer/trunk/src/org/tp23/antinstaller/antmod/RegexpMatcherFactory.java ___________________________________________________________________ Name: svn:eol-style + native Added: pal-portal/modules/ant-installer/trunk/src/org/tp23/antinstaller/antmod/RuntimeLauncher.java =================================================================== --- pal-portal/modules/ant-installer/trunk/src/org/tp23/antinstaller/antmod/RuntimeLauncher.java (rev 0) +++ pal-portal/modules/ant-installer/trunk/src/org/tp23/antinstaller/antmod/RuntimeLauncher.java 2008-06-11 13:36:41 UTC (rev 975) @@ -0,0 +1,144 @@ +/* + * Copyright 2003-2004 The Apache Software Foundation + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + * + */ +package org.tp23.antinstaller.antmod; + +import java.io.File; +import java.net.URL; +import java.util.HashMap; +import java.util.Iterator; +import java.util.Map; + +import org.apache.tools.ant.Project; +import org.apache.tools.ant.ProjectHelper; +import org.tp23.antinstaller.InstallerContext; +import org.tp23.antinstaller.antmod.taskdefs.LogTask; +import org.tp23.antinstaller.antmod.taskdefs.MessageTask; +import org.tp23.antinstaller.antmod.taskdefs.PropertyTask; +import org.tp23.antinstaller.runtime.ExecInstall; +import org.tp23.antinstaller.selfextract.NonExtractor; +import org.tp23.antinstaller.selfextract.SelfExtractor; + + + +/** + * This is a launcher for Ant which swallows all messages and logs. + * + * This file has been modified by Paul Hinds for Antinstaller and is not the same + * as the one delivered with Ant 1.6 + * + * @since Ant 1.6 + * @version $Id$ + */ +public class RuntimeLauncher { + + public final static String CONTEXT_REFERENCE = "antinstaller.internal.context"; + + private final Map allProperties = new HashMap(); + private final Project project = new Project(); + private InstallerContext ctx; + + public RuntimeLauncher(InstallerContext ctx) { + this.ctx = ctx; + } + + public void updateProps(){ + allProperties.clear(); + allProperties.putAll(InstallerContext.getEnvironment()); + allProperties.putAll(ctx.getInstaller().getResultContainer().getAllProperties()); + // add properties + String arg; + String value; + Iterator iter = allProperties.keySet().iterator(); + while (iter.hasNext()) { + arg = (String) iter.next(); + value = (String) allProperties.get(arg); + project.setUserProperty(arg, value); + } + } + + public void parseProject(){ + project.setCoreLoader(this.getClass().getClassLoader()); + //project.addBuildListener(this); + project.init(); + + ProjectHelper helper = new ProjectHelper3(); + project.addReference("ant.projectHelper", helper); + + //SelfExtractor requirements + if(SelfExtractor.CONFIG_RESOURCE == ctx.getConfigResource()){ + File buildXml = new File(ctx.getFileRoot(), ctx.getAntBuildFile()); + if(!buildXml.exists()){ + ctx.log("No build file found??: " + buildXml); + } + helper.parse(project, buildXml); + project.setUserProperty("ant.file", buildXml.getAbsolutePath()); + } + + //NonExtractor requirements + if(NonExtractor.CONFIG_RESOURCE == ctx.getConfigResource()){ + URL buildIS = this.getClass().getResource("/" + ctx.getAntBuildFile()); + helper.parse(project, buildIS); + project.setUserProperty("ant.file", buildIS.toExternalForm()); + try { + File enclosingJar = SelfExtractor.getEnclosingJar(this); + project.setUserProperty(NonExtractor.ANTINSTALLER_JAR_PROPERTY, enclosingJar.getAbsolutePath()); + } catch (RuntimeException e) { + ctx.log("No enclosing jar found"); + } + } + + //Scripted install requirements + if(ExecInstall.CONFIG_RESOURCE == ctx.getConfigResource()){ + File buildXml = new File(ctx.getFileRoot(), ctx.getAntBuildFile()); + helper.parse(project, buildXml); + if(!buildXml.exists()){ + ctx.log("No build file found??: " + buildXml); + } + project.setUserProperty("ant.file", buildXml.getAbsolutePath()); + } + + project.setBaseDir(ctx.getFileRoot()); + + // clever stuff for callbacks + project.addReference(CONTEXT_REFERENCE, ctx); + project.addTaskDefinition("antinstaller-property", PropertyTask.class); + project.addTaskDefinition("antinstaller-message", MessageTask.class); + project.addTaskDefinition("antinstaller-log", LogTask.class); + + } + /** + * Run the launcher to launch Ant with a specific target, there is no classpath + * additions set or ant.home; everything should be loaded for this to run correctly. + * + * @param args the command line arguments + */ + public int run(String target){ + try { + ctx.getLogger().log("internal target execution started:" + target); + project.fireBuildStarted(); + project.executeTarget(target); + project.fireBuildFinished(null); + ctx.getLogger().log("internal target execution successful:" + target); + return 0; + } + catch (Throwable t) { + ctx.getLogger().log("internal target execution error:" + target); + ctx.getLogger().log(ctx.getInstaller(), t); + return 1; + } + } +} Property changes on: pal-portal/modules/ant-installer/trunk/src/org/tp23/antinstaller/antmod/RuntimeLauncher.java ___________________________________________________________________ Name: svn:eol-style + native Added: pal-portal/modules/ant-installer/trunk/src/org/tp23/antinstaller/antmod/package.html =================================================================== --- pal-portal/modules/ant-installer/trunk/src/org/tp23/antinstaller/antmod/package.html (rev 0) +++ pal-portal/modules/ant-installer/trunk/src/org/tp23/antinstaller/antmod/package.html 2008-06-11 13:36:41 UTC (rev 975) @@ -0,0 +1,9 @@ + + + + +Contains modifications of Apache Ant code. + Property changes on: pal-portal/modules/ant-installer/trunk/src/org/tp23/antinstaller/antmod/package.html ___________________________________________________________________ Name: svn:eol-style + native Added: pal-portal/modules/ant-installer/trunk/src/org/tp23/antinstaller/antmod/taskdefs/GetResourceTask.java =================================================================== --- pal-portal/modules/ant-installer/trunk/src/org/tp23/antinstaller/antmod/taskdefs/GetResourceTask.java (rev 0) +++ pal-portal/modules/ant-installer/trunk/src/org/tp23/antinstaller/antmod/taskdefs/GetResourceTask.java 2008-06-11 13:36:41 UTC (rev 975) @@ -0,0 +1,73 @@ +/* + * Copyright 2005 Paul Hinds + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +package org.tp23.antinstaller.antmod.taskdefs; + +import java.io.File; +import java.io.IOException; + +import org.apache.tools.ant.BuildException; +import org.apache.tools.ant.Task; +import org.tp23.antinstaller.selfextract.ResourceExtractor; +/** + * Extracts a resource from the classpath into the filesystem + * @author teknopaul + * + */ +public class GetResourceTask extends Task{ + + String resource; + String dest; + String regex; + String replace; + + public void execute() throws BuildException{ + try { + ResourceExtractor re = new ResourceExtractor(); + if(regex != null){ + re.copyResource(resource, new File(dest), regex, replace); + } + else{ + re.copyResourceBinary(resource, new File(dest)); + } + } catch (IOException e) { + throw new BuildException(e.getMessage()); + } + } + public String getDest() { + return dest; + } + public void setDest(String file) { + this.dest = file; + } + public String getResource() { + return resource; + } + public void setResource(String resource) { + this.resource = resource; + } + public String getReplace() { + return replace; + } + public void setReplace(String replace) { + this.replace = replace; + } + public String getRegex() { + return regex; + } + public void setRegex(String token) { + this.regex = token; + } +} Property changes on: pal-portal/modules/ant-installer/trunk/src/org/tp23/antinstaller/antmod/taskdefs/GetResourceTask.java ___________________________________________________________________ Name: svn:eol-style + native Added: pal-portal/modules/ant-installer/trunk/src/org/tp23/antinstaller/antmod/taskdefs/LogTask.java =================================================================== --- pal-portal/modules/ant-installer/trunk/src/org/tp23/antinstaller/antmod/taskdefs/LogTask.java (rev 0) +++ pal-portal/modules/ant-installer/trunk/src/org/tp23/antinstaller/antmod/taskdefs/LogTask.java 2008-06-11 13:36:41 UTC (rev 975) @@ -0,0 +1,54 @@ +/* + * Copyright 2005 Paul Hinds + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +package org.tp23.antinstaller.antmod.taskdefs; + +import org.apache.tools.ant.BuildException; +import org.apache.tools.ant.Task; +import org.tp23.antinstaller.InstallerContext; +import org.tp23.antinstaller.antmod.RuntimeLauncher; +/** + * usage: + * <antinstaller-log message="log message"/> + * @author teknopaul + * + */ +public class LogTask extends Task { + + private String message; + /** + * Ant Tasks must have a noargs constructor + */ + public LogTask(){ + } + + /** + * the "main" method + */ + public void execute() throws BuildException { + InstallerContext ctx = (InstallerContext)getProject().getReference(RuntimeLauncher.CONTEXT_REFERENCE); + ctx.log(message); + } + + public String getMessage() { + return message; + } + + public void setMessage(String message) { + this.message = message; + } + + +} Property changes on: pal-portal/modules/ant-installer/trunk/src/org/tp23/antinstaller/antmod/taskdefs/LogTask.java ___________________________________________________________________ Name: svn:eol-style + native Added: pal-portal/modules/ant-installer/trunk/src/org/tp23/antinstaller/antmod/taskdefs/MessageTask.java =================================================================== --- pal-portal/modules/ant-installer/trunk/src/org/tp23/antinstaller/antmod/taskdefs/MessageTask.java (rev 0) +++ pal-portal/modules/ant-installer/trunk/src/org/tp23/antinstaller/antmod/taskdefs/MessageTask.java 2008-06-11 13:36:41 UTC (rev 975) @@ -0,0 +1,54 @@ +/* + * Copyright 2005 Paul Hinds + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +package org.tp23.antinstaller.antmod.taskdefs; + +import org.apache.tools.ant.BuildException; +import org.apache.tools.ant.Task; +import org.tp23.antinstaller.InstallerContext; +import org.tp23.antinstaller.antmod.RuntimeLauncher; +/** + * usage: + * <antinstaller-message message="output"/> + * @author teknopaul + * + */ +public class MessageTask extends Task { + + private String message; + /** + * Ant Tasks must have a noargs constructor + */ + public MessageTask(){ + } + + /** + * the "main" method + */ + public void execute() throws BuildException { + InstallerContext ctx = (InstallerContext)getProject().getReference(RuntimeLauncher.CONTEXT_REFERENCE); + ctx.getMessageRenderer().printMessage(message); + } + + public String getMessage() { + return message; + } + + public void setMessage(String message) { + this.message = message; + } + + +} Property changes on: pal-portal/modules/ant-installer/trunk/src/org/tp23/antinstaller/antmod/taskdefs/MessageTask.java ___________________________________________________________________ Name: svn:eol-style + native Added: pal-portal/modules/ant-installer/trunk/src/org/tp23/antinstaller/antmod/taskdefs/PropertyTask.java =================================================================== --- pal-portal/modules/ant-installer/trunk/src/org/tp23/antinstaller/antmod/taskdefs/PropertyTask.java (rev 0) +++ pal-portal/modules/ant-installer/trunk/src/org/tp23/antinstaller/antmod/taskdefs/PropertyTask.java 2008-06-11 13:36:41 UTC (rev 975) @@ -0,0 +1,114 @@ +/* + * Copyright 2005 Paul Hinds + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +package org.tp23.antinstaller.antmod.taskdefs; + +import java.io.IOException; +import java.io.InputStream; +import java.util.Properties; + +import org.apache.tools.ant.BuildException; +import org.apache.tools.ant.Task; +import org.tp23.antinstaller.InstallerContext; +import org.tp23.antinstaller.antmod.RuntimeLauncher; +/** + * usage: + * <antinstaller-property name="property.name" value="myValue"/> + *
+ * or: + * <antinstaller-property resource="/resources/my.props"/> + * @author teknopaul + * + */ +public final class PropertyTask extends Task { + + private String name; + private String value; + private String resource; + /** + * Ant Tasks must have a noargs constructor + */ + public PropertyTask(){ + } + + /** + * the "main" method + */ + public void execute() throws BuildException { + if(resource != null){ + executeResource(); + } + else { + if(name == null || value == null) { + throw new BuildException("either resource or (name and value) can not be null for antinstaller-property task"); + } + executePropVal(); + } + } + + private void executePropVal(){ + InstallerContext ctx = (InstallerContext)getProject().getReference(RuntimeLauncher.CONTEXT_REFERENCE); + ctx.log("setting property: name=" + name + ", value=" + value); + ctx.getInstaller().getResultContainer().setProperty(name, value); + } + + // FindBugs - this class should stay final since getResourceAsStream() may not work in subclasses + private void executeResource() throws BuildException{ + InstallerContext ctx = (InstallerContext)getProject().getReference(RuntimeLauncher.CONTEXT_REFERENCE); + InputStream is = this.getClass().getResourceAsStream(resource); + if(is == null){ + ctx.log("Can not find resource: " + resource); + throw new BuildException("Can not find resource: " + resource); + } + try { + Properties props = new Properties(); + props.load(is); + is.close(); + if(ctx.getInstaller().isVerbose()){ + ctx.log("loaded properties: " + props.size()); + } + + ctx.getInstaller().getResultContainer().getAllProperties().putAll(props); + } catch (IOException e) { + ctx.log("Can not load resource: " + resource); + throw new BuildException("Can not load resource: " + resource); + } + } + + public String getName() { + return name; + } + + public void setName(String name) { + this.name = name; + } + + public String getValue() { + return value; + } + + public void setValue(String value) { + this.value = value; + } + + public String getResource() { + return resource; + } + + public void setResource(String resource) { + this.resource = resource; + } + +} Property changes on: pal-portal/modules/ant-installer/trunk/src/org/tp23/antinstaller/antmod/taskdefs/PropertyTask.java ___________________________________________________________________ Name: svn:eol-style + native Added: pal-portal/modules/ant-installer/trunk/src/org/tp23/antinstaller/input/AppRootInput.java =================================================================== --- pal-portal/modules/ant-installer/trunk/src/org/tp23/antinstaller/input/AppRootInput.java (rev 0) +++ pal-portal/modules/ant-installer/trunk/src/org/tp23/antinstaller/input/AppRootInput.java 2008-06-11 13:36:41 UTC (rev 975) @@ -0,0 +1,162 @@ +/* + * Copyright 2005 Paul Hinds + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +package org.tp23.antinstaller.input; + +import java.io.File; +import java.util.ResourceBundle; + +import org.tp23.antinstaller.InstallerContext; +import org.tp23.antinstaller.ValidationException; +import org.tp23.antinstaller.renderer.MessageRenderer; + +/** + * + *

Input type to select a directory and validate it by checking the existence of + * files relative to the directory selected. An Expected use for this is to find the + * Application root of an exiting app on the clients machine. for example to find + * Tomcat, ask the user to select the tomcat root and check the existence of ./conf/tomcat-users.xml + * and ./webapps

+ * @author Paul Hinds + * @version $Id: AppRootInput.java,v 1.2 2005/10/23 14:39:20 teknopaul Exp $ + */ +public class AppRootInput + extends DirectoryInput { + + private static final ResourceBundle res = ResourceBundle.getBundle("org.tp23.antinstaller.renderer.Res"); + + + private String checkFile1; + private String checkFile2; + private String checkDir1; + private String checkDir2; + + public AppRootInput() { + } + + /** + * Called to validate the user input + */ + public boolean validate(InstallerContext cxt) throws ValidationException{ + if (getInputResult() == null)return false; + MessageRenderer mr = cxt.getMessageRenderer(); + String directorySelected = getInputResult(); + File file = new File(directorySelected); + // removed in response to BUG:1303230 +// if(!file.exists()){ +// if(mr.prompt(res.getString("dirNotExistCreate"))){ +// boolean ok = file.mkdirs(); +// if(!ok)mr.printMessage(res.getString("dirNotCreated")); +// } +// } + if(!file.isDirectory()){ + mr.printMessage(res.getString("dirNotExist")+":"+file.getAbsolutePath()); + return false; + } + else if(checkFile1!=null && ! checkExists(mr,file,checkFile1)){ + return false ; + } + else if(checkFile2!=null && ! checkExists(mr,file,checkFile2)){ + return false ; + } + else if(checkDir1!=null && ! checkExists(mr,file,checkDir1)){ + return false ; + } + else if(checkDir2!=null && ! checkExists(mr,file,checkDir2)){ + return false ; + } + return true; + } + + private boolean checkExists(MessageRenderer mr,File root,String check){ + File checkFile = new File(root,checkFile1); + if(!checkFile.exists()){ + reportMissing(mr,checkFile); + return false; + } + return true; + } + + private void reportMissing(MessageRenderer mr,File missing){ + StringBuffer message = new StringBuffer(); + message.append(res.getString("appRootInvalid")); + message.append(System.getProperty("line.separator")); + if(missing.isDirectory()){ + message.append(res.getString("dirNotExist")); + } + else{ + message.append(res.getString("fileNotExist")); + } + message.append(":"); + message.append(missing.getAbsolutePath()); + mr.printMessage(message.toString()); + } + + + + public String getCheckDir1() { + return checkDir1; + } + + public String getCheckDir2() { + return checkDir2; + } + + public String getCheckFile1() { + return checkFile1; + } + + public String getCheckFile2() { + return checkFile2; + } + + public void setCheckFile2(String checkFile2) { + this.checkFile2 = checkFile2; + } + + public void setCheckFile1(String checkFile1) { + this.checkFile1 = checkFile1; + } + + public void setCheckDir2(String checkDir2) { + this.checkDir2 = checkDir2; + } + + public void setCheckDir1(String checkDir1) { + this.checkDir1 = checkDir1; + } + + /** + * Used by checkConfig to validate the configuration file. + * Not used at runtime. + * @return boolean + */ + public boolean validateObject() { + if(getDisplayText()==null){ + System.out.println("AppRoot:displayText must be set"); + return false; + } + if(getProperty()==null){ + System.out.println("AppRoot:property must be set"); + return false; + } + if(getDefaultValue()==null){ + System.out.println("AppRoot:defaultValue must be set"); + return false; + } + return true; + } + +} Property changes on: pal-portal/modules/ant-installer/trunk/src/org/tp23/antinstaller/input/AppRootInput.java ___________________________________________________________________ Name: svn:eol-style + native Added: pal-portal/modules/ant-installer/trunk/src/org/tp23/antinstaller/input/CheckboxInput.java =================================================================== --- pal-portal/modules/ant-installer/trunk/src/org/tp23/antinstaller/input/CheckboxInput.java (rev 0) +++ pal-portal/modules/ant-installer/trunk/src/org/tp23/antinstaller/input/CheckboxInput.java 2008-06-11 13:36:41 UTC (rev 975) @@ -0,0 +1,86 @@ +/* + * Copyright 2005 Paul Hinds + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +package org.tp23.antinstaller.input; + + +import org.tp23.antinstaller.InstallerContext; +import org.tp23.antinstaller.ValidationException; + + + +/** + * + *

Input type for boolean choices represented as a checkbox in swing and a yes/no option + * on the command line

+ * @author Paul Hinds + * @version $Id: CheckboxInput.java,v 1.3 2006/12/07 02:42:22 teknopaul Exp $ + */ +public class CheckboxInput + extends InputField{ + + + private String force; + + public CheckboxInput() { + } + + public String getForce() { + return force; + } + + public void setForce(String force) { + this.force = force; + } + + public void setValue(String trueOrFalse){ + setInputResult(trueOrFalse); + } + /** + * Called to validate the user input + * @TODO should validate against non internationalized true or false flags + */ + public boolean validate(InstallerContext cxt) throws ValidationException{ + return true; + } + + + /** + * Used by checkConfig to validate the configuration file. + * Not used at runtime. + * @return boolean + */ + public boolean validateObject() { + if(getProperty()==null){ + System.out.println("Checkbox:property must be set"); + return false; + } + if(getDisplayText()==null){ + System.out.println("Checkbox:displayText must be set"); + return false; + } + if(!InputField.requiredBoolean(getDefaultValue())){ + System.out.println("Checkbox:defaultValue must be true or false"); + return false; + } + if(!InputField.optionalBoolean(getForce())){ + System.out.println("Checkbox:defaultValue must be true or false or null"); + return false; + } + return true; + } + + +} Property changes on: pal-portal/modules/ant-installer/trunk/src/org/tp23/antinstaller/input/CheckboxInput.java ___________________________________________________________________ Name: svn:eol-style + native Added: pal-portal/modules/ant-installer/trunk/src/org/tp23/antinstaller/input/CommentOutput.java =================================================================== --- pal-portal/modules/ant-installer/trunk/src/org/tp23/antinstaller/input/CommentOutput.java (rev 0) +++ pal-portal/modules/ant-installer/trunk/src/org/tp23/antinstaller/input/CommentOutput.java 2008-06-11 13:36:41 UTC (rev 975) @@ -0,0 +1,97 @@ +/* + * Copyright 2005 Paul Hinds + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +package org.tp23.antinstaller.input; + + +import org.tp23.antinstaller.InstallerContext; +import org.tp23.antinstaller.ValidationException; + + + +/** + * + *

This "Input type" is strictly for Output! Unlike all the other + * concrete classes in this package CommentOutputs refer to text + * that will be printed but nothing will be collected from + * the user.

+ * The text outputted in Comments will have property values resolved + * if they are in the format ${property.name} + * @author Paul Hinds + * @version $Id: CommentOutput.java,v 1.2 2006/03/24 18:25:58 teknopaul Exp $ + */ +public class CommentOutput + extends OutputField { + + private String bold; + private String title; + + public CommentOutput() { + } + + public String getBold() { + return bold; + } + + public void setBold(String bold) { + this.bold = bold; + } + + public String getTitle() { + return title; + } + + public void setTitle(String title) { + this.title = title; + } + + public String getDisplayText() { + return resultContainer.getDefaultValue(super.getDisplayText()) ; + } + + public String getExplanatoryText() { + return resultContainer.getDefaultValue(super.getExplanatoryText()); + } + + /** + * Called to validate the user input + */ + public boolean validate(InstallerContext cxt) throws ValidationException{ + return true; + } + + + /** + * Used by checkConfig to validate the configuration file. + * Not used at runtime. + * @return boolean + */ + public boolean validateObject() { +// null accepted now if only using explanatory text +// if(getDisplayText() == null){ +// System.out.println("Comment:displayText must be set"); +// return false; +// } + if(!InputField.optionalBoolean(getBold())){ + System.out.println("Comment:bold must be true or false or null:" + getBold()); + return false; + } + if(!InputField.optionalBoolean(getTitle())){ + System.out.println("Comment:title must be true or false or null:" + getTitle()); + return false; + } + return true; + } +} Property changes on: pal-portal/modules/ant-installer/trunk/src/org/tp23/antinstaller/input/CommentOutput.java ___________________________________________________________________ Name: svn:eol-style + native Added: pal-portal/modules/ant-installer/trunk/src/org/tp23/antinstaller/input/ConditionalField.java =================================================================== --- pal-portal/modules/ant-installer/trunk/src/org/tp23/antinstaller/input/ConditionalField.java (rev 0) +++ pal-portal/modules/ant-installer/trunk/src/org/tp23/antinstaller/input/ConditionalField.java 2008-06-11 13:36:41 UTC (rev 975) @@ -0,0 +1,119 @@ +/* + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +package org.tp23.antinstaller.input; + +import org.tp23.antinstaller.InstallerContext; +import org.tp23.antinstaller.ValidationException; +import org.tp23.antinstaller.runtime.ConfigurationException; +import org.tp23.antinstaller.runtime.logic.Expression; +import org.tp23.antinstaller.runtime.logic.ExpressionBuilder; + +/** + * Container for other OutputField members that will be + * conditionally updated. Typical use is with <hidden> + * to conditionally set property values. + * + * @author mwilson + * @version $Id + * @since 0.7.4 patch 7 + */ +public class ConditionalField extends InputField { + + private String ifProperty; + private Expression expression; + private InputField[] fields; + + public void setIfProperty(final String expressionStr) { + this.ifProperty = expressionStr; + } + + public String getIfProperty() { + return ifProperty; + } + + public InputField[] getFields() { + return fields; + } + + public void setFields(InputField[] fields) { + this.fields = fields; + } + + /** + * Runtime validation of user input + * + * @param context Installer context + * @return true if user input is valid, otherwise false + * @throws ValidationException + */ + public boolean validate(InstallerContext context) + throws ValidationException { + try { + getExpression(); + if ((fields != null) && (fields.length > 0)) { + int i = 0; + for (; (i < fields.length) && (fields[i].validate(context)); i++) { + } + + if (i == fields.length) { + return true; + } + } + } catch (ConfigurationException configExc) { + if(context.getInstaller().isVerbose()) { + context.log(configExc); + } + } + return false; + } + + /** + * Build-time validation of installer configuration file + * + * @return true if configuration is ok, otherwise false + */ + public boolean validateObject() { + try { + getExpression(); + if ((fields != null) && (fields.length > 0)) { + int i = 0; + for (; (i < fields.length) && (fields[i].validateObject()); i++) { + } + + if (i == fields.length) { + return true; + } + + System.out.println("Invalid field:" + fields[i]); + } + } catch (ConfigurationException configExc) { + System.out.println("Invalid conditional expression: " + configExc); + } + return false; + } + + /** + * Get the conditional expression in preparation for evaluation + * + * @throws ConfigurationException if the expression is invalid + */ + public Expression getExpression() throws ConfigurationException { + if (expression == null) { + expression = ExpressionBuilder.parseLogicalExpressions(resultContainer, ifProperty); + } + + return expression; + } +} Property changes on: pal-portal/modules/ant-installer/trunk/src/org/tp23/antinstaller/input/ConditionalField.java ___________________________________________________________________ Name: svn:eol-style + native Added: pal-portal/modules/ant-installer/trunk/src/org/tp23/antinstaller/input/ConfirmPasswordTextInput.java =================================================================== --- pal-portal/modules/ant-installer/trunk/src/org/tp23/antinstaller/input/ConfirmPasswordTextInput.java (rev 0) +++ pal-portal/modules/ant-installer/trunk/src/org/tp23/antinstaller/input/ConfirmPasswordTextInput.java 2008-06-11 13:36:41 UTC (rev 975) @@ -0,0 +1,70 @@ +/* + * Copyright 2005 Paul Hinds + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +package org.tp23.antinstaller.input; + +import org.tp23.antinstaller.InstallerContext; +import org.tp23.antinstaller.ValidationException; + +/** + * a second password filed that checks to see if a password entered twice matches + * @author Paul Hinds + * @version $Id$ + */ +public class ConfirmPasswordTextInput + extends PasswordTextInput +{ + private String origField; + + /** + * Called to validate the user input, if the confirm flag is set + * and there is a password field on the same page with the same property name + * both passwords must match for validation to pass + */ + public boolean validate(InstallerContext ctx) throws ValidationException{ + OutputField[] otherFields = ctx.getCurrentPage().getOutputField(); + for (int i = 0; i < otherFields.length; i++) { + if(otherFields[i] instanceof PasswordTextInput && + otherFields[i] != this){ + PasswordTextInput pwd = (PasswordTextInput)otherFields[i]; + if(pwd.getProperty().equals(getOrigField())){ + return this.getInputResult().equals(pwd.getInputResult()); + } + } + } + throw new ValidationException("Confirm password requires a PasswordTextInput, on the same page, with property " + getOrigField()); + } + + public boolean validateObject() { + if ( ! super.validateObject()){ + return false; + } + if(getOrigField() == null){ + System.out.println("ConfirmPassword:origField must be set"); + return false; + } + // @TODO check the orig field exists + return true; + } + + public String getOrigField() { + return origField; + } + + public void setOrigField(String origField) { + this.origField = origField; + } + +} Property changes on: pal-portal/modules/ant-installer/trunk/src/org/tp23/antinstaller/input/ConfirmPasswordTextInput.java ___________________________________________________________________ Name: svn:eol-style + native Added: pal-portal/modules/ant-installer/trunk/src/org/tp23/antinstaller/input/DateInput.java =================================================================== --- pal-portal/modules/ant-installer/trunk/src/org/tp23/antinstaller/input/DateInput.java (rev 0) +++ pal-portal/modules/ant-installer/trunk/src/org/tp23/antinstaller/input/DateInput.java 2008-06-11 13:36:41 UTC (rev 975) @@ -0,0 +1,107 @@ +/* + * Copyright 2005 Paul Hinds + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +package org.tp23.antinstaller.input; + + +import java.text.DateFormat; +import java.text.ParseException; +import java.text.SimpleDateFormat; +import java.util.Date; + +import org.tp23.antinstaller.InstallerContext; +import org.tp23.antinstaller.ValidationException; + + +/** + * + *

Free text input type with validation a SimpleDataFormat instance.

+ *

By default the date format is dd/MM/yyyy unless it + * is overriden in teh antinstall-config.xml file.

+ * @author Paul Hinds + * @version $Id: DateInput.java,v 1.1.1.1 2005/10/18 18:20:54 teknopaul Exp $ + */ +public class DateInput + extends InputField{ + + private String dateFormat = "dd/MM/yyyy"; + private DateFormat formatter = new SimpleDateFormat(dateFormat); + + public DateInput() { + formatter.setLenient(false); + } + + public String getDateFormat() { + return dateFormat; + } + public void setDateFormat(String dateFormat) { + try { + formatter = new SimpleDateFormat(dateFormat); + formatter.setLenient(false); + this.dateFormat = dateFormat; + } + catch (RuntimeException e) { + throw new InputException("Invalid date format in DateInput"); + } + } + + public void setValue(String dir){ + setInputResult(dir); + } + + /** + * Called to validate the user input + */ + public boolean validate(InstallerContext cxt) throws ValidationException{ + if (getInputResult() == null)return false; + String toTest = getInputResult(); + try { + formatter.parse(toTest); + } + catch (ParseException ex) { + return false; + } + return true; + } + + public void setDefaultValue(String defaultValue) { + if(defaultValue.equals("TODAY")){ + this.defaultValue = formatter.format(new Date()); + } else { + this.defaultValue = defaultValue; + } + } + + /** + * Used by checkConfig to validate the configuration file. + * Not used at runtime. + * @return boolean + */ + public boolean validateObject() { + if(getDisplayText()==null){ + System.out.println("Date:displayText must be set"); + return false; + } + if(getProperty()==null){ + System.out.println("Date:property must be set"); + return false; + } + if(getDefaultValue()==null){ + System.out.println("Date:defaultValue must be set"); + return false; + } + return true; + } +} Property changes on: pal-portal/modules/ant-installer/trunk/src/org/tp23/antinstaller/input/DateInput.java ___________________________________________________________________ Name: svn:eol-style + native Added: pal-portal/modules/ant-installer/trunk/src/org/tp23/antinstaller/input/DirectoryInput.java =================================================================== --- pal-portal/modules/ant-installer/trunk/src/org/tp23/antinstaller/input/DirectoryInput.java (rev 0) +++ pal-portal/modules/ant-installer/trunk/src/org/tp23/antinstaller/input/DirectoryInput.java 2008-06-11 13:36:41 UTC (rev 975) @@ -0,0 +1,156 @@ +/* + * Copyright 2005 Paul Hinds + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +package org.tp23.antinstaller.input; + +import java.io.File; +import java.util.ResourceBundle; + +import org.tp23.antinstaller.InstallerContext; +import org.tp23.antinstaller.ValidationException; +import org.tp23.antinstaller.renderer.MessageRenderer; + +/** + *

Input type to select a directory

+ *

+ *

Copyright: Copyright (c) 2004

+ *

Company: tp23

+ * @author Paul Hinds + * @version $Id: DirectoryInput.java,v 1.5 2007/01/28 10:25:48 teknopaul Exp $ + */ +public class DirectoryInput + extends OSSpecific { + + private static final ResourceBundle res = ResourceBundle.getBundle("org.tp23.antinstaller.renderer.Res"); + + + private boolean abort = false; + private String create; + private String checkExists; + + public DirectoryInput() { + } + + /** + * Called to validate the user input + */ + public boolean validate(InstallerContext cxt) throws ValidationException{ + if (getInputResult() == null)return false; + MessageRenderer mr = cxt.getMessageRenderer(); + String selectedName = getInputResult(); + // handle no directory option + if( "".equals(selectedName) ){ + if( InputField.isTrue(create) || InputField.isTrue(checkExists) ){ + mr.printMessage(res.getString("dirNotExist")); + return false; + } + else { + return true; + } + } + File file = new File(selectedName); + if(InputField.isTrue(create)){ + if(!file.exists()){ + try { + if(mr.prompt(res.getString("dirNotExistCreate") + "\n" + file.getAbsolutePath())){ + boolean ok = file.mkdirs(); + if(!ok){ + mr.printMessage(res.getString("dirNotCreated")); + } + } + } + catch (Exception ex) { + mr.printMessage(res.getString("canNotCreateFile") + "\n" + file.getAbsolutePath()); + //FIXME should not throw here, should do something better so users on linux can chmod where necessary + // then try again + throw new ValidationException(res.getString("canNotCreateFile"),ex); + + } + } + } + if(InputField.isTrue(checkExists)){ +// if( ( !file.exists() || !file.isDirectory() ) && triedToCreate){ +// //TODO add some usefull text here to explain that we can not continue +// } + if(!file.exists() || !file.isDirectory()){ + mr.printMessage(res.getString("dirNotExist") + "\n" + file.getAbsolutePath()); + return false; + } + } + return true; + } + + public boolean isAbort() { + return abort; + } + + public void setAbort(boolean abort) { + this.abort = abort; + } + + public String getCreate() { + return create; + } + public void setCreate(String create) { + this.create = create; + } + public void setValue(String dir){ + setInputResult(dir); + } + + public String getCheckExists() { + return checkExists; + } + + public void setCheckExists(String checkExists) { + this.checkExists = checkExists; + } + + /** + * Used by checkConfig to validate the configuration file. + * Not used at runtime. + * @return boolean + */ + public boolean validateObject() { + if(getDisplayText() == null){ + System.out.println("Directory:displayText must be set"); + return false; + } + if(getProperty() == null){ + System.out.println("Directory:property must be set"); + return false; + } + if(getDefaultValue() == null){ + System.out.println("Directory:defaultValue must be set"); + return false; + } + if(getDefaultValue().equals("")){ + if( isTrue(getCreate()) || isTrue(getCheckExists()) ) { + System.out.println("Directory:defaultValue must be set if checkExists or create are true"); + return false; + } + } + if(!InputField.optionalBoolean(getCreate())){ + System.out.println("Directory:create must be true or false or null"); + return false; + } + if(!InputField.optionalBoolean(getCheckExists())){ + System.out.println("Directory:checkExists must be true or false or null"); + return false; + } + return true; + } + +} Property changes on: pal-portal/modules/ant-installer/trunk/src/org/tp23/antinstaller/input/DirectoryInput.java ___________________________________________________________________ Name: svn:eol-style + native Added: pal-portal/modules/ant-installer/trunk/src/org/tp23/antinstaller/input/ExtValidatedTextInput.java =================================================================== --- pal-portal/modules/ant-installer/trunk/src/org/tp23/antinstaller/input/ExtValidatedTextInput.java (rev 0) +++ pal-portal/modules/ant-installer/trunk/src/org/tp23/antinstaller/input/ExtValidatedTextInput.java 2008-06-11 13:36:41 UTC (rev 975) @@ -0,0 +1,108 @@ +/* + * Copyright 2005 Paul Hinds + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +package org.tp23.antinstaller.input; + + + +import org.tp23.antinstaller.InstallerContext; +import org.tp23.antinstaller.ValidationException; + + +/** + * + *

Free text input type with validation using a custon supplied class.

+ * This enable very coplext validation, for example, a class could be written + * to validate a port number enterd by a user that tries to open a socket + * on the port and returns false to the validate method if the socket is in use. + * @author Paul Hinds + * @version $Id: ExtValidatedTextInput.java,v 1.2 2007/01/09 22:41:41 teknopaul Exp $ + */ +public class ExtValidatedTextInput + extends ValidatedTextInput{ + + private String validationClass; + private Validator validator; + private Throwable throwable ; + + public ExtValidatedTextInput() { + } + + public void setValue(String dir){ + setInputResult(dir); + } + public String getValidationClass() { + return validationClass; + } + public void setValidationClass(String validationClass) { + this.validationClass = validationClass; + try { + validator = (Validator)Class.forName(validationClass).newInstance(); + } + catch (Exception ex) { + throw new InputException("Invalid Class in ExtValidated text input"); + } + } + + /** + * Called to validate the user input + */ + public boolean validate(InstallerContext ctx) throws ValidationException{ + String result = getInputResult(); + try{ + validator.validate(result,ctx); + throwable = null; + return true; + } + catch(Throwable t){ + throwable = t; + return false; + } + + } + /** + * @return Returns the validator. + */ + public Validator getValidator() { + return validator; + } + + /** + * Used by checkConfig to validate the configuration file. + * Not used at runtime. + * @return boolean + */ + public boolean validateObject() { + if(getDisplayText() == null){ + System.out.println("ExtValidated:displayText must be set"); + return false; + } + if(getProperty() == null){ + System.out.println("ExtValidated:property must be set"); + return false; + } + if(getValidationClass() == null){ + System.out.println("ExtValidated:validationClass must be set"); + return false; + } + return true; + } + /** + * @return Returns the throwable. + */ + public Throwable getThrowable() { + return throwable; + } +} Property changes on: pal-portal/modules/ant-installer/trunk/src/org/tp23/antinstaller/input/ExtValidatedTextInput.java ___________________________________________________________________ Name: svn:eol-style + native Added: pal-portal/modules/ant-installer/trunk/src/org/tp23/antinstaller/input/FileInput.java =================================================================== --- pal-portal/modules/ant-installer/trunk/src/org/tp23/antinstaller/input/FileInput.java (rev 0) +++ pal-portal/modules/ant-installer/trunk/src/org/tp23/antinstaller/input/FileInput.java 2008-06-11 13:36:41 UTC (rev 975) @@ -0,0 +1,100 @@ +/* + * Copyright 2005 Paul Hinds + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +package org.tp23.antinstaller.input; + +import java.io.File; + +import org.tp23.antinstaller.InstallerContext; +import org.tp23.antinstaller.ValidationException; + + +/** + * + *

Input type to select a directory

+ *

+ *

Copyright: Copyright (c) 2004

+ *

Company: tp23

+ * @author Paul Hinds + * @version $Id: FileInput.java,v 1.2 2007/01/28 10:25:48 teknopaul Exp $ + */ +public class FileInput + extends OSSpecific{ + + private boolean abort = false; + private String checkExists; + + public FileInput() { + } + + /** + * Called to validate the user input + */ + public boolean validate(InstallerContext ctx) throws ValidationException{ + if (getInputResult() == null) { // this does not happen + return false; + } + if(InputField.isTrue(checkExists)){ + File file = new File(getInputResult()); + if(!file.exists()){ + return false; + } + } + return true; + } + + public boolean isAbort() { + return abort; + } + + public void setAbort(boolean abort) { + this.abort = abort; + } + + public String getCheckExists() { + return checkExists; + } + public void setCheckExists(String checkExists) { + this.checkExists = checkExists; + } + public void setValue(String dir){ + setInputResult(dir); + } + + /** + * Used by checkConfig to validate the configuration file. + * Not used at runtime. + * @return boolean + */ + public boolean validateObject() { + if(getDisplayText()==null){ + System.out.println("File:displayText must be set"); + return false; + } + if(getProperty()==null){ + System.out.println("File:property must be set"); + return false; + } + if(getDefaultValue()==null){ + System.out.println("File:defaultValue must be set"); + return false; + } + if(!InputField.optionalBoolean(getCheckExists())){ + System.out.println("File:checkExists must be true or false or null"); + return false; + } + return true; + } +} Property changes on: pal-portal/modules/ant-installer/trunk/src/org/tp23/antinstaller/input/FileInput.java ___________________________________________________________________ Name: svn:eol-style + native Added: pal-portal/modules/ant-installer/trunk/src/org/tp23/antinstaller/input/HiddenPropertyInput.java =================================================================== --- pal-portal/modules/ant-installer/trunk/src/org/tp23/antinstaller/input/HiddenPropertyInput.java (rev 0) +++ pal-portal/modules/ant-installer/trunk/src/org/tp23/antinstaller/input/HiddenPropertyInput.java 2008-06-11 13:36:41 UTC (rev 975) @@ -0,0 +1,67 @@ +/* + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +package org.tp23.antinstaller.input; + +import org.tp23.antinstaller.InstallerContext; +import org.tp23.antinstaller.ValidationException; + +/** + * @author mwilson + * @version $Id + * @since 0.7.4 patch 6 + */ +public class HiddenPropertyInput extends InputField +{ + + public HiddenPropertyInput() + { + } + + public void setValue( String propValue ) + { + //Use default value to allow updates when page re-displayed + setDefaultValue( propValue ); + } + + /** + * Called to validate the non-existent user input + */ + public boolean validate( InstallerContext cxt ) throws ValidationException + { + return true; + } + + /** + * Used by checkConfig to validate the configuration file. + * Not used at runtime. + * + * @return boolean + */ + public boolean validateObject() + { + + final String typeName = "hidden"; + if( getProperty() == null ) + { + System.out.println( typeName + ": property must be set" ); + return false; + } + if( getDefaultValue() == null ) + { + System.out.println( typeName + ": value must be set" ); + return false; + } + return true; + } +} Property changes on: pal-portal/modules/ant-installer/trunk/src/org/tp23/antinstaller/input/HiddenPropertyInput.java ___________________________________________________________________ Name: svn:eol-style + native Added: pal-portal/modules/ant-installer/trunk/src/org/tp23/antinstaller/input/InputException.java =================================================================== --- pal-portal/modules/ant-installer/trunk/src/org/tp23/antinstaller/input/InputException.java (rev 0) +++ pal-portal/modules/ant-installer/trunk/src/org/tp23/antinstaller/input/InputException.java 2008-06-11 13:36:41 UTC (rev 975) @@ -0,0 +1,12 @@ +package org.tp23.antinstaller.input; + + +/** + * @author Paul Hinds + * @version $Id: InputException.java,v 1.1.1.1 2005/10/18 18:20:55 teknopaul Exp $ + */ +public class InputException extends RuntimeException { + public InputException(String message){ + super(message); + } +} Property changes on: pal-portal/modules/ant-installer/trunk/src/org/tp23/antinstaller/input/InputException.java ___________________________________________________________________ Name: svn:eol-style + native Added: pal-portal/modules/ant-installer/trunk/src/org/tp23/antinstaller/input/InputField.java =================================================================== --- pal-portal/modules/ant-installer/trunk/src/org/tp23/antinstaller/input/InputField.java (rev 0) +++ pal-portal/modules/ant-installer/trunk/src/org/tp23/antinstaller/input/InputField.java 2008-06-11 13:36:41 UTC (rev 975) @@ -0,0 +1,107 @@ +/* + * Copyright 2005 Paul Hinds + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +package org.tp23.antinstaller.input; + +import java.util.MissingResourceException; +import java.util.ResourceBundle; + +/** + * + *

Object representation of an inputField XML Element

+ *

Also used to hold data of the results of the installer questions

+ * @author Paul Hinds + * @version $Id: InputField.java,v 1.4 2006/12/07 02:50:27 teknopaul Exp $ + */ +public abstract class InputField + extends OutputField { + + // i18n support + private static ResourceBundle langPack = null; + static{ + try { + langPack = ResourceBundle.getBundle("resources.LanguagePack"); + } catch (MissingResourceException e) { + // ignore, signifies no lang packs installed + } + } + + private String property; + protected String defaultValue; + + /** + * Flag to indicate that the user has already editted this field + */ + private boolean editted = false; + + public InputField() { + } + + public String getDisplayText() { + if(langPack != null){ + return langPack.getString(getProperty() + ".displayText"); + } + return displayText; + } + public String getExplanatoryText() { + if(langPack != null){ + try { + return langPack.getString(getProperty() + ".explanatoryText"); + } catch (MissingResourceException e) { + // ignore and return null explanatoryText is optional + } + } + return explanatoryText; + } + + /** + * Returns the input result if there is one and if this is a PropertyField + * @return String + */ + public String getInputResult() { + return resultContainer.getProperty(property); + } + + public void setInputResult(String inputResult) { + resultContainer.setProperty(property, inputResult); + } + public boolean isEditted() { + return editted; + } + public void setEditted(boolean editted) { + this.editted = editted; + } + public void setResultContainer(ResultContainer resultContainer) { + this.resultContainer = resultContainer; + } + + public String getProperty() { + return property; + } + + public void setProperty(String property) { + this.property = property; + } + + public String getDefaultValue() { + return resultContainer.getDefaultValue(defaultValue); + } + + public void setDefaultValue(String defaultValue) { + this.defaultValue = defaultValue; + } + + +} Property changes on: pal-portal/modules/ant-installer/trunk/src/org/tp23/antinstaller/input/InputField.java ___________________________________________________________________ Name: svn:eol-style + native Added: pal-portal/modules/ant-installer/trunk/src/org/tp23/antinstaller/input/LargeSelectInput.java =================================================================== --- pal-portal/modules/ant-installer/trunk/src/org/tp23/antinstaller/input/LargeSelectInput.java (rev 0) +++ pal-portal/modules/ant-installer/trunk/src/org/tp23/antinstaller/input/LargeSelectInput.java 2008-06-11 13:36:41 UTC (rev 975) @@ -0,0 +1,151 @@ +/* + * Copyright 2005 Paul Hinds + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +package org.tp23.antinstaller.input; + + +import java.util.MissingResourceException; +import java.util.ResourceBundle; + +import org.tp23.antinstaller.InstallerContext; +import org.tp23.antinstaller.ValidationException; + + + +/** + * + *

Input type to choose a single value from a (numbered) list of options

+ *

This input is designed to handle larger lists of options

+ *

Copyright: Copyright (c) 2004

+ *

Company: tp23

+ * @author Paul Hinds + * @version $Id: LargeSelectInput.java,v 1.3 2006/12/07 02:50:27 teknopaul Exp $ + */ +public class LargeSelectInput + extends InputField{ + + // i18n support + private static ResourceBundle langPack = null; + private int optionIdx = 0; + static{ + try { + langPack = ResourceBundle.getBundle("resources.LanguagePack"); + } catch (MissingResourceException e) { + // ignore, signifies no lang packs installed + } + } + + private LargeSelectInput.Option[] options; + + public LargeSelectInput() { + } + + + public LargeSelectInput.Option[] getOptions() { + return options; + } + + public void setOptions(LargeSelectInput.Option[] options) { + this.options = options; + } + public Option getNewOption(){ + return new Option(); + } + + public class Option { + + private int idx = ++optionIdx; + private String text; + public String value; + public void setText(String text) { + this.text = text; + } + public String getText() { + if(langPack != null){ + return langPack.getString(getProperty() + "." + idx +".displayText"); + } + return text; + } + } + + public void setValue(String dir){ + setInputResult(dir); + } + /** + * Called to validate the user input + */ + public boolean validate(InstallerContext cxt) throws ValidationException{ + if(getInputResult()==null)return false; + String value = getInputResult(); + boolean ok = false; + for (int i = 0; i < options.length; i++) { + ok |= options[i].value.equals(value); + } + return ok; + } + + + + /** + * Used by checkConfig to validate the configuration file. + * Not used at runtime. + * @return boolean + */ + public boolean validateObject() { + if(getDisplayText()==null){ + System.out.println("LargeSelect:displayText must be set"); + return false; + } + if(getProperty()==null){ + System.out.println("LargeSelect:property must be set"); + return false; + } + if(getDefaultValue()==null){ + System.out.println("LargeSelect:defaultValue must be set"); + return false; + } + if(getOptions()==null){ + System.out.println("LargeSelect:option must have at least two options"); + return false; + } + if(getOptions().length<2){ + System.out.println("LargeSelect:option must have at least two options"); + return false; + } + for (int i = 0; i < getOptions().length; i++) { + Option o = getOptions()[i]; + if(o.getText()==null){ + System.out.println("LargeSelect:option:text must be set"); + return false; + } + if(o.value==null){ + System.out.println("LargeSelect:option:value must be set"); + return false; + } + } + boolean defaultExists = false; + for (int i = 0; i < getOptions().length; i++) { + Option o = getOptions()[i]; + if(o.value.equals(getDefaultValue())){ + defaultExists=true; + } + } + if(!defaultExists){ + System.out.println("LargeSelect:option:Default must be one of the options"); + return false; + } + return true; + } +} Property changes on: pal-portal/modules/ant-installer/trunk/src/org/tp23/antinstaller/input/LargeSelectInput.java ___________________________________________________________________ Name: svn:eol-style + native Added: pal-portal/modules/ant-installer/trunk/src/org/tp23/antinstaller/input/OSSpecific.java =================================================================== --- pal-portal/modules/ant-installer/trunk/src/org/tp23/antinstaller/input/OSSpecific.java (rev 0) +++ pal-portal/modules/ant-installer/trunk/src/org/tp23/antinstaller/input/OSSpecific.java 2008-06-11 13:36:41 UTC (rev 975) @@ -0,0 +1,49 @@ +/* + * Copyright 2005 Paul Hinds + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +package org.tp23.antinstaller.input; + +import org.tp23.antinstaller.InstallerContext; +/** + * Operating System Specific input fields have different default values for Unix and Windoze + * TODO something more with defaults for optionally supporting more OSs + */ +public abstract class OSSpecific extends InputField { + + private String defaultValueWin; + + public String getDefaultValue(boolean correctForOS) { + if(InstallerContext.isUnix() || defaultValueWin == null){ + if("".equals(defaultValue)){ + return ""; + } + return resultContainer.getDefaultFileRef(defaultValue); + } + else { + if("".equals(defaultValueWin)){ + return ""; + } + return resultContainer.getDefaultFileRef(defaultValueWin); + } + } + + public String getDefaultValueWin() { + return defaultValueWin; + } + + public void setDefaultValueWin(String defaultValueWin) { + this.defaultValueWin = defaultValueWin; + } +} Property changes on: pal-portal/modules/ant-installer/trunk/src/org/tp23/antinstaller/input/OSSpecific.java ___________________________________________________________________ Name: svn:eol-style + native Added: pal-portal/modules/ant-installer/trunk/src/org/tp23/antinstaller/input/OutputField.java =================================================================== --- pal-portal/modules/ant-installer/trunk/src/org/tp23/antinstaller/input/OutputField.java (rev 0) +++ pal-portal/modules/ant-installer/trunk/src/org/tp23/antinstaller/input/OutputField.java 2008-06-11 13:36:41 UTC (rev 975) @@ -0,0 +1,146 @@ +/* + * Copyright 2005 Paul Hinds + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +package org.tp23.antinstaller.input; + +import java.util.MissingResourceException; +import java.util.ResourceBundle; + +import org.tp23.antinstaller.InstallerContext; +import org.tp23.antinstaller.ValidationException; +/** + * This is the super class of all "Input types". It is called OutputField since + * it handles the base features of "Input types" for outputing text for + * the user to read. It also encapsulates some convenience methods for + * interpreting boolean values from the command line and in configuration files. + */ +public abstract class OutputField { + + // i18n support + private static ResourceBundle langPack = null; + private static int commentIdx = 0; + static{ + try { + langPack = ResourceBundle.getBundle("resources.LanguagePack"); + } catch (MissingResourceException e) { + // ignore, signifies no lang packs installed + } + } + + /* This is redundant unless language packs are used + */ + private String name = "comment." + ++commentIdx; + + protected String displayText; + protected String explanatoryText; + protected ResultContainer resultContainer; + + public OutputField() { + + } + + /* This is redundant unless language packs are used + */ + public String getName() { + return name; + } + + /* This is redundant unless language packs are used + */ + public void setName(String name) { + this.name = name; + } + + public String getDisplayText() { + if(langPack != null){ + return langPack.getString(getName() + ".displayText"); + } + return displayText; + } + + public void setDisplayText(String displayText) { + this.displayText = displayText; + } + + public String getExplanatoryText() { + if(langPack != null){ + try { + return langPack.getString(getName() + ".explanatoryText"); + } catch (MissingResourceException e) { + // ignore and return null explanatoryText is optional + } + } + return explanatoryText; + } + + public void setExplanatoryText(String explanatoryText) { + this.explanatoryText = explanatoryText; + } + + public void setResultContainer(ResultContainer resultContainer) { + this.resultContainer = resultContainer; + } + + /** + * Validate the user input (or lack of it) + * This method should return false if the validation fails an throw an exception + * if it is not possible to validate or there is an error. + * + * @param cxt InstallerContext + * @throws ValidationException thrown in error conditions not validation failure + * @return boolean + */ + public abstract boolean validate(InstallerContext cxt) throws ValidationException; + + /** + * Used to validate the configuration, this can be run prior to distributing the + * installer to check that the config is valid. Will not be used at runtime. + * @throws ValidationException + * @return boolean + */ + public abstract boolean validateObject(); + + //////////////////////Static convenience methods + + /** true if specified and true or yes. + * N.B it is possible for X, isTrue(X) == isFalse(X); + * This occurs if the value is null. + */ + public static boolean isTrue(String value){ + if(value == null)return false; + return value.equalsIgnoreCase("true") || value.equalsIgnoreCase("yes"); + } + /** same as isTrue() but default is false if not specified */ + public static boolean isFalse(String value){ + if(value == null)return false; + return value.equalsIgnoreCase("false") || value.equalsIgnoreCase("no"); + } + /** + * Return true if the value is set to true or false, returns false if the value is null + * @param value String + * @return boolean + */ + public static boolean requiredBoolean(String value){ + return isTrue(value) || isFalse(value); + } + /** + * Return true if the value is set to true or false, returns false if the value is null + * @param value String + * @return boolean + */ + public static boolean optionalBoolean(String value){ + return value == null || isTrue(value) || isFalse(value); + } +} Property changes on: pal-portal/modules/ant-installer/trunk/src/org/tp23/antinstaller/input/OutputField.java ___________________________________________________________________ Name: svn:eol-style + native Added: pal-portal/modules/ant-installer/trunk/src/org/tp23/antinstaller/input/PasswordTextInput.java =================================================================== --- pal-portal/modules/ant-installer/trunk/src/org/tp23/antinstaller/input/PasswordTextInput.java (rev 0) +++ pal-portal/modules/ant-installer/trunk/src/org/tp23/antinstaller/input/PasswordTextInput.java 2008-06-11 13:36:41 UTC (rev 975) @@ -0,0 +1,75 @@ +/* + * Copyright 2005 Paul Hinds + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +package org.tp23.antinstaller.input; + + +/** + * + *

Free validated text input type that does not echo the value in the GUI.

+ *

This class implements SecretPropertyField so the + * values are not printed in the properties file. It is the responsibility of the renderer + * not to show the password. Hiding is currently not supported on the console.

+ * @author Paul Hinds + * @version $Id: PasswordTextInput.java,v 1.3 2006/12/21 00:03:09 teknopaul Exp $ + */ +public class PasswordTextInput + extends ValidatedTextInput implements SecretPropertyField +{ + + private String textMask = "false"; + + /** + * @return Returns true if text masking is requested. + */ + public String getTextMask() { + return textMask; + } + /** + * @param textMask The textMask value true or false. + */ + public void setTextMask(String textMask) { + this.textMask = textMask; + } + /** + * Used by checkConfig to validate the configuration file + * not at runtime + * @return boolean + */ + public boolean validateObject() { + if( ! InputField.optionalBoolean(getTextMask())){ + System.out.println("Comment:textMask must be true or false or null:" + getTextMask()); + return false; + } + if(getDisplayText() == null){ + System.out.println("Password:displayText must be set"); + return false; + } + if(getProperty() == null){ + System.out.println("Password:property must be set"); + return false; + } + if(getDefaultValue() == null){ + System.out.println("Password:defaultValue must be set"); + return false; + } + if(getRegex() == null){ + System.out.println("Password:regex must be set"); + return false; + } + return true; + } + +} Property changes on: pal-portal/modules/ant-installer/trunk/src/org/tp23/antinstaller/input/PasswordTextInput.java ___________________________________________________________________ Name: svn:eol-style + native Added: pal-portal/modules/ant-installer/trunk/src/org/tp23/antinstaller/input/ResultContainer.java =================================================================== --- pal-portal/modules/ant-installer/trunk/src/org/tp23/antinstaller/input/ResultContainer.java (rev 0) +++ pal-portal/modules/ant-installer/trunk/src/org/tp23/antinstaller/input/ResultContainer.java 2008-06-11 13:36:41 UTC (rev 975) @@ -0,0 +1,190 @@ +/* + * Copyright 2005 Paul Hinds + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +package org.tp23.antinstaller.input; + +import java.io.File; +import java.io.IOException; +import java.util.HashMap; +import java.util.Map; +import java.util.Properties; + +import org.tp23.antinstaller.InstallerContext; + + + +/** + *

Data Holder for results of the data collection and convenience methods for + * obtaining default values containing ${prop.name}/blah syntax

+ * @todo Ensure in the validator (and Docs) that developers only add ${refs} for properties set on earlier pages + * @author Paul Hinds + * @version $Id: ResultContainer.java,v 1.6 2007/01/28 10:25:48 teknopaul Exp $ + */ +public class ResultContainer { + + private HashMap properties = new HashMap(); + private Properties environment = InstallerContext.getEnvironment(); + private File installRoot; + + public ResultContainer() { + } + + /** + * fetch a string for File and Directory inputs that expands ${refs} and + * also creates absolute paths from relative paths in the default value + * @param defaultString String + * @return String + */ + public String getDefaultFileRef(String defaultString){ + if(defaultString == null) { + return null; + } + + String expandedRefs = getDefaultValue(defaultString); + File ref = new File(expandedRefs); + if(!ref.isAbsolute()){ + String path = null; + try { + path = new File(installRoot, expandedRefs).getCanonicalPath(); + } + catch (IOException ex) { + // this is a bugger, but it should not happen it implies . or .. + // can not be resolved, all we can do is return the . or .. and hope + // it works later + path = new File(installRoot, expandedRefs).getAbsolutePath(); + } + return path; + } else { + String path = ref.getAbsolutePath(); + return path; + } + } + + /** + * + * Handles dereferenceing ${propName} syntax in default value fields + * @param defaultString String a plain String or a String with ${ref} references + * @return String + */ + public String getDefaultValue(String defaultString) { + if(defaultString == null) { + return null; + } + + char[] characters = defaultString.toCharArray(); + char c; + StringBuffer result = new StringBuffer(); + + StringBuffer propertyNameBuffer = new StringBuffer(); + boolean inProp = false; // state flag indicating parsing a propertyName + for (int i = 0; i < characters.length;) { + c = characters[i]; + if ( c == '$' && ( characters.length > i + 1 && characters[i + 1] == '{' ) ){ + if(inProp){ + //Nested property + int endIndex = defaultString.indexOf( '}', i + 1 ); + if( endIndex != -1 ) { + ++endIndex; + propertyNameBuffer.append( getDefaultValue( defaultString.substring( i, endIndex ) ) ); + i = endIndex; + continue; + } + else { + result.append(propertyNameBuffer.toString()); + propertyNameBuffer = new StringBuffer(); + } + } + else{ + inProp = true; + propertyNameBuffer.append(c); + ++i; + continue; + } + } + else if (c == '{') { + if (inProp) { + propertyNameBuffer.append(c); + if(characters[i - 1] != '$') { + inProp=false; + result.append(propertyNameBuffer.toString()); + propertyNameBuffer = new StringBuffer(); + } + ++i; + continue; + } + } + else if (c == '}') { + if (inProp) { + appendProperty(propertyNameBuffer, result); + propertyNameBuffer = new StringBuffer(); + inProp = false; + ++i; + continue; + } + } + if (!inProp) result.append(c); + else propertyNameBuffer.append(c); + ++i; + } + if(propertyNameBuffer.length() != 0) { + result.append(propertyNameBuffer.toString()); + } + return result.toString(); + } + + + + public HashMap getResults() { + return properties; + } + public void setProperty(String key, String value){ + properties.put(key, value); + } + public String getProperty(String key){ + return (String)properties.get(key); + } + + public void setInstallRoot(File installRoot) { + this.installRoot = installRoot; + } + /** + * @since 0.7.1 to support installs from readonly media + * @return Map + */ + public Map getAllProperties(){ + return properties; + } + + /** + * Appends the property if found or inserts an empty string. + * This method now supports loading environment variables. + * @param propertyNameBuffer StringBuffer + * @param result StringBuffer + */ + private void appendProperty(StringBuffer propertyNameBuffer, StringBuffer result) { + String propertyName = propertyNameBuffer.toString(); + String key = propertyName.substring(2); + String value = (String)properties.get(key); + if(value == null && key.startsWith(InstallerContext.ENV_PREFIX)) { + value = environment.getProperty(key); + } + if(value == null && key.startsWith(InstallerContext.JAVA_PREFIX)) { + value = environment.getProperty(key); + } + if (value != null) { + result.append(value); + } + } +} Property changes on: pal-portal/modules/ant-installer/trunk/src/org/tp23/antinstaller/input/ResultContainer.java ___________________________________________________________________ Name: svn:eol-style + native Added: pal-portal/modules/ant-installer/trunk/src/org/tp23/antinstaller/input/SecretPropertyField.java =================================================================== --- pal-portal/modules/ant-installer/trunk/src/org/tp23/antinstaller/input/SecretPropertyField.java (rev 0) +++ pal-portal/modules/ant-installer/trunk/src/org/tp23/antinstaller/input/SecretPropertyField.java 2008-06-11 13:36:41 UTC (rev 975) @@ -0,0 +1,30 @@ +/* + * Copyright 2005 Paul Hinds + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +package org.tp23.antinstaller.input; + +/** + * + *

An InputField that should not have its property printed to the properties + * file, probably for security reasons such as a PasswordTextInput

+ *

It is imperative that all classes that implement this interface extend +* InputField

+ *

Copyright: Copyright (c) 2004

+ *

Company: tp23

+ * @author Paul Hinds + * @version $Id: SecretPropertyField.java,v 1.1.1.1 2005/10/18 18:20:55 teknopaul Exp $ + */ +public interface SecretPropertyField{ +} Property changes on: pal-portal/modules/ant-installer/trunk/src/org/tp23/antinstaller/input/SecretPropertyField.java ___________________________________________________________________ Name: svn:eol-style + native Added: pal-portal/modules/ant-installer/trunk/src/org/tp23/antinstaller/input/SelectInput.java =================================================================== --- pal-portal/modules/ant-installer/trunk/src/org/tp23/antinstaller/input/SelectInput.java (rev 0) +++ pal-portal/modules/ant-installer/trunk/src/org/tp23/antinstaller/input/SelectInput.java 2008-06-11 13:36:41 UTC (rev 975) @@ -0,0 +1,152 @@ +/* + * Copyright 2005 Paul Hinds + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +package org.tp23.antinstaller.input; + + +import java.util.MissingResourceException; +import java.util.ResourceBundle; + +import org.tp23.antinstaller.InstallerContext; +import org.tp23.antinstaller.ValidationException; + + + +/** + * + *

Input type to choose a single value from a (numbered) list of options

+ *

N.B. subclassed for TargetSelectInput

+ *

Copyright: Copyright (c) 2004

+ *

Company: tp23

+ * @author Paul Hinds + * @version $Id: SelectInput.java,v 1.4 2006/12/07 02:50:27 teknopaul Exp $ + */ +public class SelectInput + extends InputField{ + + // i18n support + private static ResourceBundle langPack = null; + private int optionIdx = 0; + static{ + try { + langPack = ResourceBundle.getBundle("resources.LanguagePack"); + } catch (MissingResourceException e) { + // ignore, signifies no lang packs installed + } + } + + private SelectInput.Option[] options; + + public SelectInput() { + } + + + public SelectInput.Option[] getOptions() { + return options; + } + + public void setOptions(SelectInput.Option[] options) { + this.options = options; + } + public Option getNewOption(){ + return new Option(); + } + + public class Option { + + private int idx = ++optionIdx; + private String text; + public String value; + + public void setText(String text) { + this.text = text; + } + public String getText() { + if(langPack != null){ + return langPack.getString(getProperty() + "." + idx +".displayText"); + } + return text; + } + } + + public void setValue(String value){ + setInputResult(value); + } + + public boolean validate(InstallerContext cxt) throws ValidationException{ + if(getInputResult() == null){ + return false; + } + String value = getInputResult(); + boolean ok = false; + for (int i = 0; i < options.length; i++) { + ok |= options[i].value.equals(value); + } + return ok; + } + + + + /** + * Used by checkConfig to validate the configuration file. + * Not used at runtime. + * @return boolean + */ + public boolean validateObject() { + if(getDisplayText()==null){ + System.out.println("Select:displayText must be set"); + return false; + } + if(getProperty()==null){ + System.out.println("Select:property must be set"); + return false; + } + if(getDefaultValue()==null){ + System.out.println("Select:defaultValue must be set"); + return false; + } + if(getOptions()==null){ + System.out.println("Select:option must have at least two options"); + return false; + } + if(getOptions().length<2){ + System.out.println("Select:option must have at least two options"); + return false; + } + for (int i = 0; i < getOptions().length; i++) { + Option o = getOptions()[i]; + if(o.getText()==null){ + System.out.println("Select:option:text must be set"); + return false; + } + if(o.value==null){ + System.out.println("Select:option:value must be set"); + return false; + } + } + boolean defaultExists = false; + for (int i = 0; i < getOptions().length; i++) { + Option o = getOptions()[i]; + if(o.value.equals(getDefaultValue())){ + defaultExists=true; + } + } + if(!defaultExists){ + System.out.println("Select:option:Default must be one of the options"); + return false; + } + return true; + } +} Property changes on: pal-portal/modules/ant-installer/trunk/src/org/tp23/antinstaller/input/SelectInput.java ___________________________________________________________________ Name: svn:eol-style + native Added: pal-portal/modules/ant-installer/trunk/src/org/tp23/antinstaller/input/Target.java =================================================================== --- pal-portal/modules/ant-installer/trunk/src/org/tp23/antinstaller/input/Target.java (rev 0) +++ pal-portal/modules/ant-installer/trunk/src/org/tp23/antinstaller/input/Target.java 2008-06-11 13:36:41 UTC (rev 975) @@ -0,0 +1,11 @@ +package org.tp23.antinstaller.input; +/** + * Indicates the input type is a target based type and requires special + * processing in the properties loader + * @author teknopaul + * + */ +public interface Target { + public int getIdx(); + public String getTarget(); +} Property changes on: pal-portal/modules/ant-installer/trunk/src/org/tp23/antinstaller/input/Target.java ___________________________________________________________________ Name: svn:eol-style + native Added: pal-portal/modules/ant-installer/trunk/src/org/tp23/antinstaller/input/TargetInput.java =================================================================== --- pal-portal/modules/ant-installer/trunk/src/org/tp23/antinstaller/input/TargetInput.java (rev 0) +++ pal-portal/modules/ant-installer/trunk/src/org/tp23/antinstaller/input/TargetInput.java 2008-06-11 13:36:41 UTC (rev 975) @@ -0,0 +1,209 @@ +/* + * Copyright 2005 Paul Hinds + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +package org.tp23.antinstaller.input; + + +import org.tp23.antinstaller.InstallerContext; +import org.tp23.antinstaller.ValidationException; + + +/** + * + *

Input type to select targets to install

+ * If the osSpecific flag is set the OS of the current system will + * be appended to the name of the target actually by ant run so that different + * Targets can be run according to the target platform. + * This feature goes against the principles of + * building cross platform installers, but is provided so that common installer + * tasks such as creating icons and shortcuts can be run on Windows for + * all those useless users who can't run a command script ;) + *
+ * Currently there are two modes strict and not strict (lax).

+ *

Strict target will return the target name plus the exact String in the + * System Property "os.name" this means you will have to provide targets for + * every possible OS version. See + * this page for a list of possible values + * There are a great many but you may not want to consider some of the options.

+ *

Lax target will return one of the following strings only + *

    + *
  • "[target-name]-linux" - Linux
  • + *
  • "[target-name]-mac" - Mac OS and Mac OS X
  • + *
  • "[target-name]-sun" - SunOS and Solaris
  • + *
  • "[target-name]-win" - Windows *
  • + *
  • "[target-name]-other" - any thing else
  • + *

so you only have to create 5 ant targets to support all the cases. + *

Copyright: Copyright (c) 2004

+ *

Company: tp23

+ * @author Paul Hinds + * @version $Id: TargetInput.java,v 1.3 2006/12/07 02:42:22 teknopaul Exp $ + */ +public class TargetInput + extends InputField + implements Target{ + + + private String target; + private String force; + private String osSpecific; + private String strict; + //targets are ordered + private int idx; + + private static int globalIdx = 1; + + public TargetInput() { + idx = getGlobalIdx(); + } + + public String getTarget() { + if(isTrue(osSpecific)){ + return getOSSpecificTarget(); + } else { + return target; + } + } + + /** + * Used to fetch the target value that was set in the config file + * @return + */ + public String getTargetName() { + return target; + } + + public void setTarget(String target) { + this.target = target; + setProperty(target); + } + + public String getForce() { + return force; + } + + public void setForce(String force) { + this.force = force; + } + + + public String getStrict() { + return strict; + } + + public void setStrict(String strict) { + this.strict = strict; + } + + public String getOsSpecific() { + return osSpecific; + } + + public void setOsSpecific(String osSpecific) { + this.osSpecific = osSpecific; + } + + /** + * Called to validate the user input + */ + public boolean validate(InstallerContext cxt) throws ValidationException { + //setInputResult(target); + return true; + } + + + + /** + * Used by checkConfig to validate the configuration file. + * Not used at runtime. + * @return boolean + */ + public boolean validateObject() { + if(getDisplayText()==null){ + System.out.println("Target:displayText must be set"); + return false; + } + if(getTarget()==null){ + System.out.println("Target:target must be set"); + return false; + } +// if(getTarget().equals("default")){ +// System.out.println("Target:target can not be \"default\""); +// return false; +// } + if(!InputField.optionalBoolean(getForce())){ + System.out.println("Target:force must be true or false or null"); + return false; + } + if(!InputField.optionalBoolean(getStrict())){ + System.out.println("Target:strict must be true or false or null"); + return false; + } + if(!InputField.optionalBoolean(getOsSpecific())){ + System.out.println("Target:osSpecific must be true or false or null"); + return false; + } + if(!InputField.requiredBoolean(getDefaultValue())){ + System.out.println("Target:defaultValue must be true or false"); + return false; + } + return true; + } + public int getIdx() { + return idx; + } + public static int getGlobalIdx() { + return globalIdx++; + } + + public String getOSSpecificTarget() { + if(isTrue(strict)){ + return getStrictTarget(); + } + else return getLaxTarget(); + } + + private String getStrictTarget(){ + return target + getOsSpecificSuffix(); + } + + private String getLaxTarget(){ + return target + getLaxOsSpecificSuffix(); + } + + /** + * N.B. should have added a "-" but to late to change now and not important + * @return + */ + public static String getOsSpecificSuffix(){ + return System.getProperty("os.name"); + } + public static String getLaxOsSpecificSuffix(){ + String osName = System.getProperty("os.name").toLowerCase(); + if(osName.indexOf("linux") != -1){ + return "-linux"; + } + if(osName.indexOf("mac") != -1){ + return "-mac"; + } + if(osName.indexOf("windows") != -1){ + return "-win"; + } + if(osName.indexOf("solaris") != -1 || osName.indexOf("sunos") != -1){ + return "-sun"; + } + return "-other"; + + } +} Property changes on: pal-portal/modules/ant-installer/trunk/src/org/tp23/antinstaller/input/TargetInput.java ___________________________________________________________________ Name: svn:eol-style + native Added: pal-portal/modules/ant-installer/trunk/src/org/tp23/antinstaller/input/TargetSelectInput.java =================================================================== --- pal-portal/modules/ant-installer/trunk/src/org/tp23/antinstaller/input/TargetSelectInput.java (rev 0) +++ pal-portal/modules/ant-installer/trunk/src/org/tp23/antinstaller/input/TargetSelectInput.java 2008-06-11 13:36:41 UTC (rev 975) @@ -0,0 +1,100 @@ +/* + * Copyright 2005 Paul Hinds, Mark Anderson + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +package org.tp23.antinstaller.input; + + +/** + * + *

Input type to choose a single value from a (numbered) list of options + * which will be rendered as radio buttons in the Swing GUI

+ * REF: 1177206 + * @author Paul Hinds, Mark Anderson + * @version $Id: TargetSelectInput.java,v 1.4 2006/12/21 00:03:08 teknopaul Exp $ + */ +public class TargetSelectInput + extends SelectInput + implements Target{ + + //targets are ordered + private int idx; + + public TargetSelectInput() { + idx = TargetInput.getGlobalIdx(); + } + + public int getIdx() { + return idx; + } + + public String getTarget(){ + return super.getDefaultValue(); + } + + /** + * Used by checkConfig to validate the configuration file. + * Not used at runtime. + * @return boolean + */ + public boolean validateObject() { + if(getDisplayText() == null){ + System.out.println("TargetSelect:displayText must be set"); + return false; + } + if(getProperty() == null){ + System.out.println("TargetSelect:property must be set"); + return false; + } + if(getDefaultValue() == null){ + System.out.println("TargetSelect:defaultValue must be set"); + return false; + } + if(getOptions() == null){ + System.out.println("TargetSelect:option must have at least two options"); + return false; + } + if(getOptions().length < 2){ + System.out.println("TargetSelect:option must have at least two options"); + return false; + } + for (int i = 0; i < getOptions().length; i++) { + Option o = getOptions()[i]; + if(o.getText() == null){ + System.out.println("TargetSelect:option:text must be set"); + return false; + } + if(o.value == null){ + System.out.println("TargetSelect:option:value must be set"); + return false; + } + } + boolean defaultExists = false; + for (int i = 0; i < getOptions().length; i++) { + Option o = getOptions()[i]; + if(o.value.equals(getDefaultValue())){ + defaultExists=true; + } +// if(o.value.equals("default")){ +// System.out.println("Target:target can not be \"default\""); +// return false; +// } + } + if(!defaultExists){ + System.out.println("TargetSelect:option:Default must be one of the options"); + return false; + } + return true; + } +} Property changes on: pal-portal/modules/ant-installer/trunk/src/org/tp23/antinstaller/input/TargetSelectInput.java ___________________________________________________________________ Name: svn:eol-style + native Added: pal-portal/modules/ant-installer/trunk/src/org/tp23/antinstaller/input/UnvalidatedTextInput.java =================================================================== --- pal-portal/modules/ant-installer/trunk/src/org/tp23/antinstaller/input/UnvalidatedTextInput.java (rev 0) +++ pal-portal/modules/ant-installer/trunk/src/org/tp23/antinstaller/input/UnvalidatedTextInput.java 2008-06-11 13:36:41 UTC (rev 975) @@ -0,0 +1,66 @@ +/* + * Copyright 2005 Paul Hinds + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +package org.tp23.antinstaller.input; + + +import org.tp23.antinstaller.InstallerContext; +import org.tp23.antinstaller.ValidationException; + + +/** + * + *

Free text input type

+ * @author Paul Hinds + * @version $Id: UnvalidatedTextInput.java,v 1.1.1.1 2005/10/18 18:20:54 teknopaul Exp $ + */ +public class UnvalidatedTextInput + extends InputField{ + + public UnvalidatedTextInput() { + } + + public void setValue(String dir){ + setInputResult(dir); + } + + /** + * Called to validate the user input + */ + public boolean validate(InstallerContext cxt) throws ValidationException{ + return true; + } + + /** + * Used by checkConfig to validate the configuration file. + * Not used at runtime. + * @return boolean + */ + public boolean validateObject() { + if(getDisplayText()==null){ + System.out.println("Simple:displayText must be set"); + return false; + } + if(getProperty()==null){ + System.out.println("Simple:property must be set"); + return false; + } + if(getDefaultValue()==null){ + System.out.println("Simple:defualtValue must be set"); + return false; + } + return true; + } +} Property changes on: pal-portal/modules/ant-installer/trunk/src/org/tp23/antinstaller/input/UnvalidatedTextInput.java ___________________________________________________________________ Name: svn:eol-style + native Added: pal-portal/modules/ant-installer/trunk/src/org/tp23/antinstaller/input/ValidatedTextInput.java =================================================================== --- pal-portal/modules/ant-installer/trunk/src/org/tp23/antinstaller/input/ValidatedTextInput.java (rev 0) +++ pal-portal/modules/ant-installer/trunk/src/org/tp23/antinstaller/input/ValidatedTextInput.java 2008-06-11 13:36:41 UTC (rev 975) @@ -0,0 +1,113 @@ +/* + * Copyright 2005 Paul Hinds + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +package org.tp23.antinstaller.input; + + +import java.util.regex.Matcher; +import java.util.regex.Pattern; + +import org.apache.tools.ant.BuildException; +import org.tp23.antinstaller.InstallerContext; +import org.tp23.antinstaller.ValidationException; + + +/** + * + *

Free text input type with validation using regular expressions

+ * @author Paul Hinds + * @version $Id: ValidatedTextInput.java,v 1.2 2006/12/21 00:03:09 teknopaul Exp $ + */ +public class ValidatedTextInput + extends InputField{ + + private String regex; + private Pattern pattern; + //private RegexpMatcher matcher; // use ant version in an attempt to support jdk1.3 + + public ValidatedTextInput() { + } + + public void setValue(String dir){ + setInputResult(dir); + } + public String getRegex() { + return regex; + } + public void setRegex(String regex) { + this.regex = regex; + try { + //matcher = new RegexpMatcherFactory().newRegexpMatcher(); + //matcher.setPattern(regex); + pattern = Pattern.compile(regex); + } + catch (BuildException ex) { + throw new InputException("Invalid regex in Validated text input"); + } + } + + /** + * Called to validate the user input + */ + public boolean validate(InstallerContext cxt) throws ValidationException{ + try { + if (getInputResult() == null)return false; + String toTest = getInputResult(); + + Matcher matcher = pattern.matcher(toTest); + //boolean matches = matcher.matches(toTest); + boolean matches = matcher.matches(); + + return matches; + } + catch (Throwable e) { + cxt.log(e); + return false; + } + } + + /** + * Used by checkConfig to validate the configuration file. + * Not used at runtime. + * @return boolean + */ + public boolean validateObject() { + if(getDisplayText()==null){ + System.out.println("Validated:displayText must be set"); + return false; + } + if(getProperty()==null){ + System.out.println("Validated:property must be set"); + return false; + } + if(getDefaultValue()==null){ + System.out.println("Validated:defaultValue must be set"); + return false; + } + if(getRegex()==null){ + System.out.println("Validated:regex must be set"); + return false; + } + try{ + //matcher = new RegexpMatcherFactory().newRegexpMatcher(); + //matcher.setPattern(getRegex()); + } + catch(Exception e){ + System.out.println("Validated:regex must compile"); + + } + return true; + } +} Property changes on: pal-portal/modules/ant-installer/trunk/src/org/tp23/antinstaller/input/ValidatedTextInput.java ___________________________________________________________________ Name: svn:eol-style + native Added: pal-portal/modules/ant-installer/trunk/src/org/tp23/antinstaller/input/Validator.java =================================================================== --- pal-portal/modules/ant-installer/trunk/src/org/tp23/antinstaller/input/Validator.java (rev 0) +++ pal-portal/modules/ant-installer/trunk/src/org/tp23/antinstaller/input/Validator.java 2008-06-11 13:36:41 UTC (rev 975) @@ -0,0 +1,40 @@ +package org.tp23.antinstaller.input; + +import java.util.Locale; + +import org.tp23.antinstaller.InstallerContext; + + +/** + * A no args constructor should be provided + * @author Paul Hinds + * @version $Id: Validator.java,v 1.1.1.1 2005/10/18 18:20:54 teknopaul Exp $ + */ +public interface Validator { + + /** + * Validate the user entry. The InstallerContext is provided to allow + * conditional failure based on user input. for example the implementation + * of this class could call the following code after failing to open a socket + *
+	 * boolean usrOverride = ctx.getMessageRenderer().prompt("Prot not available are you sure?");
+	 * if(userOverride)return true;
+	 * else{
+	 * 	throw new SocketException();
+	 * }
+	 * 
+ * @param text may be null it is up to the validator to decide if null or "" + * is acceptable + * @throws Exception + */ + public void validate(String text,InstallerContext ctx)throws Exception; + /** + * This method should return a string for every exception that might be + * thrown by the validate method. The top level Throwable should be + * handled at least. + * @param ex + * @param l Locale (ignored, but one day we should be internationalized) + * @return + */ + public String getErrorMessage(Throwable ex,Locale l); +} Property changes on: pal-portal/modules/ant-installer/trunk/src/org/tp23/antinstaller/input/Validator.java ___________________________________________________________________ Name: svn:eol-style + native Added: pal-portal/modules/ant-installer/trunk/src/org/tp23/antinstaller/input/package.html =================================================================== --- pal-portal/modules/ant-installer/trunk/src/org/tp23/antinstaller/input/package.html (rev 0) +++ pal-portal/modules/ant-installer/trunk/src/org/tp23/antinstaller/input/package.html 2008-06-11 13:36:41 UTC (rev 975) @@ -0,0 +1,9 @@ + + + + +Contains classes for representing Input/Output elements and holding the data collected for each input type. + Property changes on: pal-portal/modules/ant-installer/trunk/src/org/tp23/antinstaller/input/package.html ___________________________________________________________________ Name: svn:eol-style + native Added: pal-portal/modules/ant-installer/trunk/src/org/tp23/antinstaller/page/LicensePage.java =================================================================== --- pal-portal/modules/ant-installer/trunk/src/org/tp23/antinstaller/page/LicensePage.java (rev 0) +++ pal-portal/modules/ant-installer/trunk/src/org/tp23/antinstaller/page/LicensePage.java 2008-06-11 13:36:41 UTC (rev 975) @@ -0,0 +1,52 @@ +/* + * Copyright 2005 Paul Hinds + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +package org.tp23.antinstaller.page; + + +/** + * + *

Represents a license page witha resouce that contains the text of the licenses

+ *

+ *

Copyright: Copyright (c) 2004

+ *

Company: tp23

+ * @author Paul Hinds + * @version $Id: LicensePage.java,v 1.1.1.1 2005/10/18 18:21:04 teknopaul Exp $ + */ +public class LicensePage + extends Page { + + private String resource; + private String usePaging; + + public LicensePage() { + } + + public String getResource() { + return resource; + } + + public void setResource(String resource) { + this.resource = resource; + } + + public String getUsePaging() { + return usePaging; + } + + public void setUsePaging(String usePaging) { + this.usePaging = usePaging; + } +} Property changes on: pal-portal/modules/ant-installer/trunk/src/org/tp23/antinstaller/page/LicensePage.java ___________________________________________________________________ Name: svn:eol-style + native Added: pal-portal/modules/ant-installer/trunk/src/org/tp23/antinstaller/page/Page.java =================================================================== --- pal-portal/modules/ant-installer/trunk/src/org/tp23/antinstaller/page/Page.java (rev 0) +++ pal-portal/modules/ant-installer/trunk/src/org/tp23/antinstaller/page/Page.java 2008-06-11 13:36:41 UTC (rev 975) @@ -0,0 +1,284 @@ +/* + * Copyright 2005 Paul Hinds + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +package org.tp23.antinstaller.page; + +import java.util.ArrayList; +import java.util.Iterator; +import java.util.List; +import java.util.MissingResourceException; +import java.util.ResourceBundle; +import java.util.Set; +import java.util.StringTokenizer; +import java.util.TreeSet; + +import org.tp23.antinstaller.InstallException; +import org.tp23.antinstaller.InstallerContext; +import org.tp23.antinstaller.input.OutputField; +import org.tp23.antinstaller.input.TargetInput; +import org.tp23.antinstaller.runtime.IfPropertyHelper; +/** + * + *

Represents a page in the installer.

+ *

This object maintians an ordered list of targets that have been selected +* so that when ant is run the targets are run in the correct order. If +* Targets exist in multiple pages they are run in the order they appear in the config file.

+ *

Copyright: Copyright (c) 2004

+ *

Company: tp23

+ * @author Paul Hinds + * @version $Id: Page.java,v 1.10 2007/01/19 00:24:36 teknopaul Exp $ + */ + +public abstract class Page { + +// i18n support + private static ResourceBundle langPack = null; + static{ + try { + langPack = ResourceBundle.getBundle("LanguagePack"); + } catch (MissingResourceException e) { + // ignore, signifies no lang packs installed + } + } + + //private static final int MAX_TARGETS = 10; + private String name; + private String displayText; + private String imageResource; + private OutputField[] outputField; + private boolean abort; + /** + * target to be called as the installer is running + */ + private String postDisplayTarget; + private Set targets = new TreeSet(); + + public Page() { + } + + public String getName() { + return name; + } + + public void setName(String name) { + this.name = name; + } + + public String getDisplayText() { + if(langPack != null){ + return langPack.getString("page." + getName() + ".displayText"); + } + return displayText; + } + + public void setDisplayText(String displayText) { + this.displayText = displayText; + } + + public String getImageResource() { + return imageResource; + } + + public void setImageResource(String imageResource) { + this.imageResource = imageResource; + } + + public OutputField[] getOutputField() { + return outputField; + } + + public void setOutputField(OutputField[] outputField) { + this.outputField = outputField; + } + + public String getPostDisplayTarget() { + return postDisplayTarget; + } + + public void setPostDisplayTarget(String runtimeTarget) { + this.postDisplayTarget = runtimeTarget; + } + + + /** + * These are the ant targets that will be run, this is decided after + * the Page has been displayed. For example if the user chooses not + * to enter a field that may signify that a target should not be run + * @return A sorted List a list of Ant targets as Strings; + * @throws InstallException + */ + public List getTargets(InstallerContext ctx) { + List results = new ArrayList(targets.size()); + try { + Iterator iter = targets.iterator(); + IfPropertyHelper helper = new IfPropertyHelper(ctx); + while(iter.hasNext()){ + IndexedTarget idxTarget = (IndexedTarget)iter.next(); + if( IndexedTarget.PAGE.equals(idxTarget.getTargetType()) ){ + if( helper.ifProperty(this) || helper.ifTarget(this, ctx.getInstaller().getPages() ) ){ + results.add(idxTarget.target); + } + } + else{ + results.add(idxTarget.target); + } + } + } catch (InstallException e) { + // should not happen at runtime if ifProperty has been validated + e.printStackTrace(); + ctx.log(ctx.getInstaller().isVerbose(), e); + throw new RuntimeException(); + } + return results; + } + /** + * get input targets that are selected and all page targets, independent of + * the ifProperty value + * @return + */ + public List getAllTargets() { + List results = new ArrayList(targets.size()); + Iterator iter = targets.iterator(); + while(iter.hasNext()){ + IndexedTarget idxTarget = (IndexedTarget)iter.next(); + results.add(idxTarget.target); + } + return results; + } + /** + * Comma separated list of targets for this page, called when parsing the + * config file + * @param target String + */ + public void setTarget(String targetList) { + StringTokenizer st = new StringTokenizer(targetList, ","); + while (st.hasMoreTokens()) { + targets.add(new IndexedTarget(TargetInput.getGlobalIdx(), + st.nextToken(), + IndexedTarget.PAGE)); + } + } + /** + * Adds an INPUT target to the Page config + * @param idx + * @param target + */ + public void addTarget(int idx, String target) { + this.targets.add(new IndexedTarget(idx, target, IndexedTarget.INPUT)); + } + public void removeTarget(int idx) { + this.targets.remove(new IndexedTarget(idx, null)); + } + /** + * returns true if the page has the current target set + * @param target String + * @return boolean + */ + public boolean isTarget(String target) { + if(target == null){ + return false; + } + Iterator iter = targets.iterator(); + while(iter.hasNext()) { + IndexedTarget idxTarget = (IndexedTarget)iter.next(); + if(idxTarget.target.equals(target)){ + return true; + } + } + return false; + } + + /** + * @return a List of IndexedTarget objects + */ + public List getPageTargets(){ + List toReturn = new ArrayList(targets.size()); + Iterator iter = targets.iterator(); + while(iter.hasNext()) { + IndexedTarget idxTarget = (IndexedTarget)iter.next(); + if( IndexedTarget.PAGE.equals(idxTarget.targetType) ){ + toReturn.add(idxTarget); + } + } + return toReturn; + } + + /** + * @return a List of IndexedTarget objects + */ + public List getElementTargets(){ + List toReturn = new ArrayList(targets.size()); + Iterator iter = targets.iterator(); + while(iter.hasNext()) { + IndexedTarget idxTarget = (IndexedTarget)iter.next(); + if( IndexedTarget.INPUT.equals(idxTarget.targetType) ){ + toReturn.add(idxTarget); + } + } + return toReturn; + } + /** + * This is called after the page is displayed, a page can return false to indicate + * that the installation should abort. Should be false if the cancel button is pressed. + * System.exit is not called to allow the installer to clean up temporary files. + * @return boolean + */ + public boolean isAbort() { + return abort; + } + + public void setAbort(boolean abort) { + this.abort = abort; + } + public static class IndexedTarget implements Comparable{ + + private static final String PAGE = "page"; + private static final String INPUT = "input"; + + int idx; + String target; + String targetType = INPUT; + + IndexedTarget(int idx, String target){ + this.idx = idx; + this.target = target; + } + IndexedTarget(int idx, String target, String targetType){ + this.idx = idx; + this.target = target; + this.targetType = targetType; + } + + public boolean equals(Object target){ + IndexedTarget test = (IndexedTarget)target; + return test.idx == idx; + } + // FindBugs - part of equals() contract + public int hashCode(){ + return this.idx; + } + public int compareTo(Object o) { + IndexedTarget test = (IndexedTarget)o; + return idx - test.idx; + } + public String getTarget() { + return target; + } + public String getTargetType() { + return targetType; + } + + } +} Property changes on: pal-portal/modules/ant-installer/trunk/src/org/tp23/antinstaller/page/Page.java ___________________________________________________________________ Name: svn:eol-style + native Added: pal-portal/modules/ant-installer/trunk/src/org/tp23/antinstaller/page/ProgressPage.java =================================================================== --- pal-portal/modules/ant-installer/trunk/src/org/tp23/antinstaller/page/ProgressPage.java (rev 0) +++ pal-portal/modules/ant-installer/trunk/src/org/tp23/antinstaller/page/ProgressPage.java 2008-06-11 13:36:41 UTC (rev 975) @@ -0,0 +1,43 @@ +/* + * Copyright 2005 Paul Hinds + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +package org.tp23.antinstaller.page; + +import org.tp23.antinstaller.input.OutputField; + +public class ProgressPage extends Page{ + + private boolean showTargets = true; + + + public ProgressPage() { + } + /** + * @return Returns the showTargets. + */ + public boolean isShowTargets() { + return showTargets; + } + /** + * @param showTargets indicates that the graphical display of + * progress should be used in the Swing renderer + */ + public void setShowTargets(boolean showTargets) { + this.showTargets = showTargets; + } + public void setShowTargets(String strShowTargets) { + this.showTargets = OutputField.isTrue(strShowTargets); + } +} Property changes on: pal-portal/modules/ant-installer/trunk/src/org/tp23/antinstaller/page/ProgressPage.java ___________________________________________________________________ Name: svn:eol-style + native Added: pal-portal/modules/ant-installer/trunk/src/org/tp23/antinstaller/page/SimpleInputPage.java =================================================================== --- pal-portal/modules/ant-installer/trunk/src/org/tp23/antinstaller/page/SimpleInputPage.java (rev 0) +++ pal-portal/modules/ant-installer/trunk/src/org/tp23/antinstaller/page/SimpleInputPage.java 2008-06-11 13:36:41 UTC (rev 975) @@ -0,0 +1,57 @@ +/* + * Copyright 2005 Paul Hinds + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +package org.tp23.antinstaller.page; + +import org.tp23.antinstaller.input.OutputField; + + + +public class SimpleInputPage + extends Page { + + + private String ifTarget; + private String ifProperty; + private boolean overflow; + + public SimpleInputPage() { + } + + public String getIfTarget() { + return ifTarget; + } + + public void setIfTarget(String ifTarget) { + this.ifTarget = ifTarget; + } + public String getIfProperty() { + return ifProperty; + } + public void setIfProperty(String ifProperty) { + this.ifProperty = ifProperty; + } + + public boolean isOverflow() { + return overflow; + } + public void setOverflow(boolean overflow) { + this.overflow = overflow; + } + public void setOverflow(String strOverflow) { + this.overflow = OutputField.isTrue(strOverflow); + } + +} Property changes on: pal-portal/modules/ant-installer/trunk/src/org/tp23/antinstaller/page/SimpleInputPage.java ___________________________________________________________________ Name: svn:eol-style + native Added: pal-portal/modules/ant-installer/trunk/src/org/tp23/antinstaller/page/SplashPage.java =================================================================== --- pal-portal/modules/ant-installer/trunk/src/org/tp23/antinstaller/page/SplashPage.java (rev 0) +++ pal-portal/modules/ant-installer/trunk/src/org/tp23/antinstaller/page/SplashPage.java 2008-06-11 13:36:41 UTC (rev 975) @@ -0,0 +1,40 @@ +/* + * Copyright 2005 Paul Hinds + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +package org.tp23.antinstaller.page; + +public class SplashPage + extends Page { + private String splashResource; + private String altText; + public SplashPage() { + } + + public String getSplashResource() { + return splashResource; + } + + public void setSplashResource(String splashResource) { + this.splashResource = splashResource; + } + + public String getAltText() { + return altText; + } + + public void setAltText(String altText) { + this.altText = altText; + } +} Property changes on: pal-portal/modules/ant-installer/trunk/src/org/tp23/antinstaller/page/SplashPage.java ___________________________________________________________________ Name: svn:eol-style + native Added: pal-portal/modules/ant-installer/trunk/src/org/tp23/antinstaller/page/TextPage.java =================================================================== --- pal-portal/modules/ant-installer/trunk/src/org/tp23/antinstaller/page/TextPage.java (rev 0) +++ pal-portal/modules/ant-installer/trunk/src/org/tp23/antinstaller/page/TextPage.java 2008-06-11 13:36:41 UTC (rev 975) @@ -0,0 +1,42 @@ +/* + * Copyright 2005 Paul Hinds + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +package org.tp23.antinstaller.page; + +public class TextPage + extends Page { + + private String htmlResource; + private String textResource; + + public TextPage() { + } + + public String getHtmlResource() { + return htmlResource; + } + + public void setHtmlResource(String htmlResource) { + this.htmlResource = htmlResource; + } + + public String getTextResource() { + return textResource; + } + + public void setTextResource(String textResource) { + this.textResource = textResource; + } +} Property changes on: pal-portal/modules/ant-installer/trunk/src/org/tp23/antinstaller/page/TextPage.java ___________________________________________________________________ Name: svn:eol-style + native Added: pal-portal/modules/ant-installer/trunk/src/org/tp23/antinstaller/page/package.html =================================================================== --- pal-portal/modules/ant-installer/trunk/src/org/tp23/antinstaller/page/package.html (rev 0) +++ pal-portal/modules/ant-installer/trunk/src/org/tp23/antinstaller/page/package.html 2008-06-11 13:36:41 UTC (rev 975) @@ -0,0 +1,9 @@ + + + + +Contains holders for the three different types of Page in an installer and the base class. + Property changes on: pal-portal/modules/ant-installer/trunk/src/org/tp23/antinstaller/page/package.html ___________________________________________________________________ Name: svn:eol-style + native Added: pal-portal/modules/ant-installer/trunk/src/org/tp23/antinstaller/renderer/AntOutputRenderer.java =================================================================== --- pal-portal/modules/ant-installer/trunk/src/org/tp23/antinstaller/renderer/AntOutputRenderer.java (rev 0) +++ pal-portal/modules/ant-installer/trunk/src/org/tp23/antinstaller/renderer/AntOutputRenderer.java 2008-06-11 13:36:41 UTC (rev 975) @@ -0,0 +1,24 @@ +/* + * Copyright 2005 Paul Hinds + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +package org.tp23.antinstaller.renderer; + +import java.io.PrintStream; + +public interface AntOutputRenderer { + public PrintStream getOut(); + public PrintStream getErr(); + +} Property changes on: pal-portal/modules/ant-installer/trunk/src/org/tp23/antinstaller/renderer/AntOutputRenderer.java ___________________________________________________________________ Name: svn:eol-style + native Added: pal-portal/modules/ant-installer/trunk/src/org/tp23/antinstaller/renderer/MessageRenderer.java =================================================================== --- pal-portal/modules/ant-installer/trunk/src/org/tp23/antinstaller/renderer/MessageRenderer.java (rev 0) +++ pal-portal/modules/ant-installer/trunk/src/org/tp23/antinstaller/renderer/MessageRenderer.java 2008-06-11 13:36:41 UTC (rev 975) @@ -0,0 +1,42 @@ +/* + * Copyright 2005 Paul Hinds + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +package org.tp23.antinstaller.renderer; + +import org.tp23.antinstaller.InstallerContext; +/** + * + *

Abstract message renderer asking user questions or providing feedback

+ *

+ *

Copyright: Copyright (c) 2004

+ *

Company: tp23

+ * @author Paul Hinds + * @version $Id: MessageRenderer.java,v 1.1.1.1 2005/10/18 18:20:59 teknopaul Exp $ + */ +public interface MessageRenderer { + + public void setInstallerContext(InstallerContext ctx); + /** + * Print a message for which there is not option to reply + * @param message String + */ + public void printMessage(String message); + /** + * ask the user for Yes or No + * @param message String + * @return boolean true = Yes false = No + */ + public boolean prompt(String message); +} Property changes on: pal-portal/modules/ant-installer/trunk/src/org/tp23/antinstaller/renderer/MessageRenderer.java ___________________________________________________________________ Name: svn:eol-style + native Added: pal-portal/modules/ant-installer/trunk/src/org/tp23/antinstaller/renderer/PageRenderer.java =================================================================== --- pal-portal/modules/ant-installer/trunk/src/org/tp23/antinstaller/renderer/PageRenderer.java (rev 0) +++ pal-portal/modules/ant-installer/trunk/src/org/tp23/antinstaller/renderer/PageRenderer.java 2008-06-11 13:36:41 UTC (rev 975) @@ -0,0 +1,25 @@ +/* + * Copyright 2005 Paul Hinds + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +package org.tp23.antinstaller.renderer; + +import org.tp23.antinstaller.InstallerContext; +import org.tp23.antinstaller.page.Page; + +public interface PageRenderer { + public void setContext(InstallerContext ctx); + public InstallerContext getContext(); + public boolean renderPage(Page page) throws Exception; +} Property changes on: pal-portal/modules/ant-installer/trunk/src/org/tp23/antinstaller/renderer/PageRenderer.java ___________________________________________________________________ Name: svn:eol-style + native Added: pal-portal/modules/ant-installer/trunk/src/org/tp23/antinstaller/renderer/RendererFactory.java =================================================================== --- pal-portal/modules/ant-installer/trunk/src/org/tp23/antinstaller/renderer/RendererFactory.java (rev 0) +++ pal-portal/modules/ant-installer/trunk/src/org/tp23/antinstaller/renderer/RendererFactory.java 2008-06-11 13:36:41 UTC (rev 975) @@ -0,0 +1,136 @@ +/* + * Copyright 2005 Paul Hinds + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +package org.tp23.antinstaller.renderer; + +import org.tp23.antinstaller.input.OutputField; +import org.tp23.antinstaller.page.Page; +import org.tp23.antinstaller.renderer.swing.SwingOutputFieldRenderer; +import org.tp23.antinstaller.renderer.swing.SwingPageRenderer; +import org.tp23.antinstaller.renderer.text.AbstractTextPageRenderer; +import org.tp23.antinstaller.renderer.text.TextOutputFieldRenderer; + + + +/** + * + *

Fetches an instance of a Renderers by using the class of the method parameter and + * a naming convention

+ *

+ *

Copyright: Copyright (c) 2004

+ *

Company: tp23

+ * @author Paul Hinds + * @version $Id: RendererFactory.java,v 1.3 2006/12/21 00:03:30 teknopaul Exp $ + */ +public class RendererFactory { + public RendererFactory() { + } + + public static TextOutputFieldRenderer getTextRenderer(OutputField field) throws ClassNotFoundException { + String fullyQualified = field.getClass().getName(); + int lastDot = fullyQualified.lastIndexOf('.'); + if (lastDot == -1) { + throw new UnsupportedOperationException("InputField can not be a member of the default package"); + } + int prevDot = fullyQualified.substring(0,lastDot-1).lastIndexOf('.', lastDot - 1); + if (prevDot == -1) { + throw new UnsupportedOperationException("InputField can not be a member of a single level package"); + } + StringBuffer rendererClassName = new StringBuffer(); + rendererClassName.append(fullyQualified.substring(0, prevDot)); + rendererClassName.append(".renderer.text."); + rendererClassName.append(fullyQualified.substring(lastDot + 1)); + rendererClassName.append("Renderer"); + try { + Class clazz = Class.forName(rendererClassName.toString()); + return (TextOutputFieldRenderer) clazz.newInstance(); + } + catch (Exception ex) { + throw new ClassNotFoundException("Class does not meet the contract for TextInputFieldRenderer:" + rendererClassName); + } + } + + public static AbstractTextPageRenderer getTextPageRenderer(Page page) throws ClassNotFoundException { + String fullyQualified = page.getClass().getName(); + int lastDot = fullyQualified.lastIndexOf('.'); + if (lastDot == -1) { + throw new UnsupportedOperationException("Pages can not be a member of the default package"); + } + int prevDot = fullyQualified.substring(0,lastDot-1).lastIndexOf('.', lastDot - 1); + if (prevDot == -1) { + throw new UnsupportedOperationException("Pages can not be a member of a single level package"); + } + StringBuffer rendererClassName = new StringBuffer(); + rendererClassName.append(fullyQualified.substring(0, prevDot)); + rendererClassName.append(".renderer.text."); + rendererClassName.append(fullyQualified.substring(lastDot + 1)); + rendererClassName.append("Renderer"); + try { + Class clazz = Class.forName(rendererClassName.toString()); + return (AbstractTextPageRenderer) clazz.newInstance(); + } + catch (Exception ex) { + throw new ClassNotFoundException("Class does not meet the contract for TextPageRenderer:" + rendererClassName); + } + } + public static SwingPageRenderer getSwingPageRenderer(Page page) throws ClassNotFoundException { + String fullyQualified = page.getClass().getName(); + int lastDot = fullyQualified.lastIndexOf('.'); + if (lastDot == -1) { + throw new UnsupportedOperationException("Pages can not be a member of the default package"); + } + int prevDot = fullyQualified.substring(0,lastDot-1).lastIndexOf('.', lastDot - 1); + if (prevDot == -1) { + throw new UnsupportedOperationException("Pages can not be a member of a single level package"); + } + StringBuffer rendererClassName = new StringBuffer(); + rendererClassName.append(fullyQualified.substring(0, prevDot)); + rendererClassName.append(".renderer.swing."); + rendererClassName.append(fullyQualified.substring(lastDot + 1)); + rendererClassName.append("Renderer"); + try { + Class clazz = Class.forName(rendererClassName.toString()); + return (SwingPageRenderer) clazz.newInstance(); + } + catch (Exception ex) { + throw new ClassNotFoundException("Class does not meet the contract for SwingPageRenderer:" + rendererClassName); + } + } + + public static SwingOutputFieldRenderer getSwingRenderer(OutputField field) throws ClassNotFoundException { + String fullyQualified = field.getClass().getName(); + int lastDot = fullyQualified.lastIndexOf('.'); + if (lastDot == -1) { + throw new UnsupportedOperationException("OutputField can not be a member of the default package"); + } + int prevDot = fullyQualified.substring(0,lastDot-1).lastIndexOf('.', lastDot - 1); + if (prevDot == -1) { + throw new UnsupportedOperationException("OutputField can not be a member of a single level package"); + } + StringBuffer rendererClassName = new StringBuffer(); + rendererClassName.append(fullyQualified.substring(0, prevDot)); + rendererClassName.append(".renderer.swing."); + rendererClassName.append(fullyQualified.substring(lastDot + 1)); + rendererClassName.append("Renderer"); + try { + Class clazz = Class.forName(rendererClassName.toString()); + return (SwingOutputFieldRenderer) clazz.newInstance(); + } + catch (Exception ex) { + ex.printStackTrace(); + throw new ClassNotFoundException("Class does not meet the contract for SwingInputFieldRenderer:" + rendererClassName); + } + } +} Property changes on: pal-portal/modules/ant-installer/trunk/src/org/tp23/antinstaller/renderer/RendererFactory.java ___________________________________________________________________ Name: svn:eol-style + native Added: pal-portal/modules/ant-installer/trunk/src/org/tp23/antinstaller/renderer/Res.properties =================================================================== --- pal-portal/modules/ant-installer/trunk/src/org/tp23/antinstaller/renderer/Res.properties (rev 0) +++ pal-portal/modules/ant-installer/trunk/src/org/tp23/antinstaller/renderer/Res.properties 2008-06-11 13:36:41 UTC (rev 975) @@ -0,0 +1,48 @@ +#org.tp23.antinstaller.renderer.Res +#Wed Nov 10 01:06:42 CET 2004 + +dirNotExistCreate=The Directory does not exist, create it? +dirNotExist=The Directory does not exist +fileNotExist=The File does not exist +dirNotCreated=The Directory could not be created +canNotCreateFile=Can not create file +appRootInvalid=This directory does not appear to be the root of the application +selectFile=Select File +selectFolder=Select Folder +notValidSelection=Not a valid selection +showDetails=Show Details + +#Default loading +promptLoadDefaults=Installation configuration found. Load the existing configuration? +promptMissingDefaultPassword=A password was not found it may have been omitted for security reasons, it will be set to the default. + +click=Click +toContinue=to continue +failed=Failed +exit=Exit +complete=Complete +finished=Finished +extracting=Extracting... +installFinished=Install Finished +running=Running: + +backButton=Back +cancelButton=Cancel +nextButton=Next + +output=Output +errors=Errors +notCorrectFormat=The field is not of the correct format +notCorrectPasswordFormat=The password is not of the correct format +passwordsDoNotMatch=The passwords do not match +installationFailed=Install failed +propertiesVersionMismatch=Some options are missing from the previous version and must be manually entered, continue? + +Finished=Finished +Failed=Failed, view the error messages +ant.failure=Ant run failed - examine the error logs for details + +#Text for license page buttons +license.next.text=Accept +license.cancel.text=Reject + Property changes on: pal-portal/modules/ant-installer/trunk/src/org/tp23/antinstaller/renderer/Res.properties ___________________________________________________________________ Name: svn:eol-style + native Added: pal-portal/modules/ant-installer/trunk/src/org/tp23/antinstaller/renderer/Res_de.properties =================================================================== --- pal-portal/modules/ant-installer/trunk/src/org/tp23/antinstaller/renderer/Res_de.properties (rev 0) +++ pal-portal/modules/ant-installer/trunk/src/org/tp23/antinstaller/renderer/Res_de.properties 2008-06-11 13:36:41 UTC (rev 975) @@ -0,0 +1,48 @@ +#org.tp23.antinstaller.renderer.Res +#Wed Nov 10 01:06:42 CET 2004 + +dirNotExistCreate=Das Verzeichnis existiert nicht, erzeugen? +dirNotExist=Das Verzeichnis existiert nicht +fileNotExist=Die Datei existiert nicht +dirNotCreated=Das Verzeichnis konnte nicht erzeugt werden +canNotCreateFile=Kann die Datei nicht erzeugen +appRootInvalid=Das Verzeichnis scheint nicht das Wurzelverzeichnis der Applikation zu sein +selectFile=Datei ausw?len +selectFolder=Verzeichnis ausw?len +notValidSelection=Keine g?tige Auswahl +showDetails=Details anzeigen + +#Default loading +promptLoadDefaults=Installation configuration found. Load the existing configuration? +promptMissingDefaultPassword=A password was not found it may have been omitted for security reasons, it will be set to the default. + +click=Klicken +toContinue=zum Fortfahren +failed=fehlgeschlagen +exit=Beenden +complete=Fertigstellen +finished=abgeschlossen +extracting=Auspacken ... +installFinished=Installation beendet +running=Ausf?rung: + +backButton=Zur?k +cancelButton=Abbrechen +nextButton=Weiter + +output=Ausgabe +errors=Fehler +notCorrectFormat=Der Wert hat nicht das vorgegebene Format +notCorrectPasswordFormat=Das Kennwort hat nicht das vorgegebene Format +passwordsDoNotMatch=The passwords do not match +installationFailed=Installation fehlgeschlagen +propertiesVersionMismatch=Some properties are missing from and must be manually entered, continue? + +Finished=Fertig +Failed=Fehlgeschlagen, Details siehe Fehlermeldungen +ant.failure=Ant run failed - examine the error logs for details + +#Text for license page buttons +license.next.text=Accept +license.cancel.text=Reject + Property changes on: pal-portal/modules/ant-installer/trunk/src/org/tp23/antinstaller/renderer/Res_de.properties ___________________________________________________________________ Name: svn:eol-style + native Added: pal-portal/modules/ant-installer/trunk/src/org/tp23/antinstaller/renderer/Res_es.properties =================================================================== --- pal-portal/modules/ant-installer/trunk/src/org/tp23/antinstaller/renderer/Res_es.properties (rev 0) +++ pal-portal/modules/ant-installer/trunk/src/org/tp23/antinstaller/renderer/Res_es.properties 2008-06-11 13:36:41 UTC (rev 975) @@ -0,0 +1,47 @@ +#org.tp23.antinstaller.renderer.Res +#Wed Nov 10 01:06:42 CET 2004 + +dirNotExistCreate=El directorio no existe, quieres crearlo? +dirNotExist=El directorio no existe. +fileNotExist=El fichero no existe. +dirNotCreated=El directorio no se ha creado. +canNotCreateFile=No se puede crear el fichero. +appRootInvalid=Este directorio no parece ser la raiz de la aplicaci?. +selectFile=Seleccionar fichero. +selectFolder=Seleccionar carpeta. +notValidSelection=No es una opci? v?ida. +showDetails=Ense?r detalles. + +#Default loading +promptLoadDefaults=Configuracion de instalaci? encontrada. Carga configuraci?? +promptMissingDefaultPassword=A password was not found it may have been omitted for security reasons, it will be set to the default. + +click=Click +toContinue=Para continuar +failed= Intento Fallido +exit=Salir +complete=Completar +finished=Terminado +extracting=Extrayendo... +installFinished=Se ha terminado la instalaci? +running=Ejecutando: + +backButton=Atras +cancelButton=Cancelar +nextButton=Proxima + +output=Salida +errors=Errores +notCorrectFormat=El fichero no tiene un formato adecuado. +notCorrectPasswordFormat=El fichero no tiene un formato adecuado. +passwordsDoNotMatch=Las contrase?s tienen que ser iguales +installationFailed=Instalaci? fallado +propertiesVersionMismatch=Faltan datos del versi? anterior, continuar y entrar los manualmente? + +Finished=Terminado +Failed=Intento fallido, ense?r mensajes de error +ant.failure=Ant run failed - examine the error logs for details + +#Text for license page buttons +license.next.text=Aceptar +license.cancel.text=Cancellar \ No newline at end of file Property changes on: pal-portal/modules/ant-installer/trunk/src/org/tp23/antinstaller/renderer/Res_es.properties ___________________________________________________________________ Name: svn:eol-style + native Added: pal-portal/modules/ant-installer/trunk/src/org/tp23/antinstaller/renderer/Res_es_EU.properties =================================================================== --- pal-portal/modules/ant-installer/trunk/src/org/tp23/antinstaller/renderer/Res_es_EU.properties (rev 0) +++ pal-portal/modules/ant-installer/trunk/src/org/tp23/antinstaller/renderer/Res_es_EU.properties 2008-06-11 13:36:41 UTC (rev 975) @@ -0,0 +1,47 @@ +#org.tp23.antinstaller.renderer.Res +#Wed Nov 10 01:06:42 CET 2004 + +dirNotExistCreate=Direktorioa ez da existitzen, sortu nahi al duzu? +dirNotExist=Direktorioa ez da existitzen. +fileNotExist=Fitxategia ez da existitzen. +dirNotCreated=Ezin izan da direktorioa sortu. +canNotCreateFile=Fitxategia ezin da sortu. +appRootInvalid=Ez dirutdi direktorio hay aplikazioaren erroa denik. +selectFile=Fitxategia aukeratu. +selectFolder=karpeta aukeratu. +notValidSelection=Ez da aukera onargarria. +showDetails=Erakutsi xehetasunak. + +#Default loading +promptLoadDefaults=Instalazio konfigurazio bat aurkituta. Kargatu instalazioa? +promptMissingDefaultPassword=A password was not found it may have been omitted for security reasons, it will be set to the default. + +click=Sakatu +toContinue=Jarraitzeko +failed=Hutsegitea +exit=Atera +complete=Bukatu +finished=Bukatuta +extracting=Ateratzen... +installFinished=Instalazioa bukatuta. +running=Exekutatzen: + +backButton=Atzera +cancelButton=Ezeztatu +nextButton=Hurrengoa + +output=Irteera +errors=Akatsak +notCorrectFormat=Fitxategia ez da formatu egokikoa. +notCorrectPasswordFormat=Fitxategia ez da formatu egokikoa. +passwordsDoNotMatch=Pasa hitzak berdinak izan behar dira +installationFailed=Instalaci? fallado +propertiesVersionMismatch=Faltan datos del versi? anterior, continuar y entrar los manualmente? + +Finished=Bukatuta +Failed=Huts egin da, erakutsi akats mezuak +ant.failure=Ant run failed - examine the error logs for details + +#Text for license page buttons +license.next.text=Aceptar +license.cancel.text=Cancellar \ No newline at end of file Property changes on: pal-portal/modules/ant-installer/trunk/src/org/tp23/antinstaller/renderer/Res_es_EU.properties ___________________________________________________________________ Name: svn:eol-style + native Added: pal-portal/modules/ant-installer/trunk/src/org/tp23/antinstaller/renderer/package.html =================================================================== --- pal-portal/modules/ant-installer/trunk/src/org/tp23/antinstaller/renderer/package.html (rev 0) +++ pal-portal/modules/ant-installer/trunk/src/org/tp23/antinstaller/renderer/package.html 2008-06-11 13:36:41 UTC (rev 975) @@ -0,0 +1,10 @@ + + + + +Classes of this package follow a strict naming convention to define the supported renderers +for a specific input class. + Property changes on: pal-portal/modules/ant-installer/trunk/src/org/tp23/antinstaller/renderer/package.html ___________________________________________________________________ Name: svn:eol-style + native Added: pal-portal/modules/ant-installer/trunk/src/org/tp23/antinstaller/renderer/swing/AIButton.java =================================================================== --- pal-portal/modules/ant-installer/trunk/src/org/tp23/antinstaller/renderer/swing/AIButton.java (rev 0) +++ pal-portal/modules/ant-installer/trunk/src/org/tp23/antinstaller/renderer/swing/AIButton.java 2008-06-11 13:36:41 UTC (rev 975) @@ -0,0 +1,71 @@ +/* + * Copyright 2005 Paul Hinds + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +package org.tp23.antinstaller.renderer.swing; + +import java.awt.Dimension; + +import javax.swing.Action; +import javax.swing.Icon; +import javax.swing.JButton; + + +/** + * A JButton with altered prefered size to facilitate fixing the width + * but still using a GridBagLayout + * @author Paul Hinds + * @version $Id: AIButton.java,v 1.2 2006/12/09 15:26:09 teknopaul Exp $ + */ +public class AIButton extends JButton { + + public AIButton() { + super(); + } + + public AIButton(String text) { + super(text); + } + + public AIButton(Action a) { + super(a); + } + + public AIButton(Icon icon) { + super(icon); + } + + public AIButton(String text, Icon icon) { + super(text, icon); + } + + private Dimension prefSize = new Dimension(SizeConstants.BUTTON_WIDTH, + SizeConstants.FIELD_HEIGHT); + + public Dimension getMinimumSize() { + return prefSize; + } + + public Dimension getPreferredSize() { + return prefSize; + } + public void setOverflow(Dimension prefSize) { + this.prefSize = prefSize; + } + + public Dimension getMaximumSize() { + return prefSize; + } + +} \ No newline at end of file Property changes on: pal-portal/modules/ant-installer/trunk/src/org/tp23/antinstaller/renderer/swing/AIButton.java ___________________________________________________________________ Name: svn:eol-style + native Added: pal-portal/modules/ant-installer/trunk/src/org/tp23/antinstaller/renderer/swing/AICheckBox.java =================================================================== --- pal-portal/modules/ant-installer/trunk/src/org/tp23/antinstaller/renderer/swing/AICheckBox.java (rev 0) +++ pal-portal/modules/ant-installer/trunk/src/org/tp23/antinstaller/renderer/swing/AICheckBox.java 2008-06-11 13:36:41 UTC (rev 975) @@ -0,0 +1,82 @@ +/* + * Copyright 2005 Paul Hinds + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +package org.tp23.antinstaller.renderer.swing; + +import java.awt.Dimension; + +import javax.swing.Action; +import javax.swing.Icon; +import javax.swing.JCheckBox; + + +/** + * A JCheckBox with altered prefered size to facilitate fixing the width + * but still using a GridBagLayout + * @author Paul Hinds + * @version $Id: AICheckBox.java,v 1.2 2006/12/09 15:26:09 teknopaul Exp $ + */ +public class AICheckBox extends JCheckBox { + + public AICheckBox() { + super(); + } + + public AICheckBox(String text) { + super(text); + } + + public AICheckBox(String text, boolean selected) { + super(text, selected); + } + + public AICheckBox(Action a) { + super(a); + } + + public AICheckBox(Icon icon) { + super(icon); + } + + public AICheckBox(Icon icon, boolean selected) { + super(icon, selected); + } + + public AICheckBox(String text, Icon icon) { + super(text, icon); + } + + public AICheckBox(String text, Icon icon, boolean selected) { + super(text, icon, selected); + } + + private Dimension prefSize = new Dimension(SizeConstants.FIELD_WIDTH, SizeConstants.FIELD_HEIGHT); + + public Dimension getMinimumSize() { + return prefSize; + } + + public Dimension getPreferredSize() { + return prefSize; + } + public void setOverflow(Dimension prefSize) { + this.prefSize = prefSize; + } + + public Dimension getMaximumSize() { + return prefSize; + } + +} Property changes on: pal-portal/modules/ant-installer/trunk/src/org/tp23/antinstaller/renderer/swing/AICheckBox.java ___________________________________________________________________ Name: svn:eol-style + native Added: pal-portal/modules/ant-installer/trunk/src/org/tp23/antinstaller/renderer/swing/AILabel.java =================================================================== --- pal-portal/modules/ant-installer/trunk/src/org/tp23/antinstaller/renderer/swing/AILabel.java (rev 0) +++ pal-portal/modules/ant-installer/trunk/src/org/tp23/antinstaller/renderer/swing/AILabel.java 2008-06-11 13:36:41 UTC (rev 975) @@ -0,0 +1,65 @@ +/* + * Copyright 2005 Paul Hinds + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +package org.tp23.antinstaller.renderer.swing; + +import java.awt.Dimension; + +import javax.swing.Icon; +import javax.swing.JLabel; + + +/** + * A JLabel with altered prefered size to facilitate fixing the width + * but still using a GridBagLayout + * @author Paul Hinds + * @version $Id: AILabel.java,v 1.2 2006/12/09 15:26:09 teknopaul Exp $ + */ +public class AILabel extends JLabel { + + public AILabel() { + super(); + } + public AILabel(String text) { + super(text); + } + public AILabel(String text, int horizontalAlignment) { + super(text, horizontalAlignment); + } + public AILabel(Icon image) { + super(image); + } + public AILabel(Icon image, int horizontalAlignment) { + super(image, horizontalAlignment); + } + public AILabel(String text, Icon icon, int horizontalAlignment) { + super(text, icon, horizontalAlignment); + } + private Dimension prefSize= new Dimension(SizeConstants.LABEL_WIDTH, + SizeConstants.FIELD_HEIGHT); + public Dimension getMinimumSize() { + return prefSize; + } + public Dimension getPreferredSize() { + return prefSize; + } + public void setOverflow(Dimension prefSize) { + this.prefSize = prefSize; + } + public Dimension getMaximumSize() { + return prefSize; + } + +} Property changes on: pal-portal/modules/ant-installer/trunk/src/org/tp23/antinstaller/renderer/swing/AILabel.java ___________________________________________________________________ Name: svn:eol-style + native Added: pal-portal/modules/ant-installer/trunk/src/org/tp23/antinstaller/renderer/swing/AIPasswordField.java =================================================================== --- pal-portal/modules/ant-installer/trunk/src/org/tp23/antinstaller/renderer/swing/AIPasswordField.java (rev 0) +++ pal-portal/modules/ant-installer/trunk/src/org/tp23/antinstaller/renderer/swing/AIPasswordField.java 2008-06-11 13:36:41 UTC (rev 975) @@ -0,0 +1,52 @@ +package org.tp23.antinstaller.renderer.swing; + +import java.awt.Dimension; + +import javax.swing.JPasswordField; +import javax.swing.text.Document; + + +/** + * @author Paul Hinds + * @version $Id: AIPasswordField.java,v 1.3 2006/12/21 00:02:59 teknopaul Exp $ + */ +public class AIPasswordField extends JPasswordField { + + public AIPasswordField() { + super(); + } + + public AIPasswordField(int columns) { + super(columns); + } + + public AIPasswordField(String text) { + super(text); + } + + public AIPasswordField(String text, int columns) { + super(text, columns); + } + + public AIPasswordField(Document doc, String txt, int columns) { + super(doc, txt, columns); + } + + private Dimension prefSize = new Dimension(SizeConstants.FIELD_WIDTH, SizeConstants.FIELD_HEIGHT); + + public Dimension getMinimumSize() { + return prefSize; + } + + public Dimension getPreferredSize() { + return prefSize; + } + public void setOverflow(Dimension prefSize) { + this.prefSize = prefSize; + } + + public Dimension getMaximumSize() { + return prefSize; + } + +} Property changes on: pal-portal/modules/ant-installer/trunk/src/org/tp23/antinstaller/renderer/swing/AIPasswordField.java ___________________________________________________________________ Name: svn:eol-style + native Added: pal-portal/modules/ant-installer/trunk/src/org/tp23/antinstaller/renderer/swing/AIRadioButton.java =================================================================== --- pal-portal/modules/ant-installer/trunk/src/org/tp23/antinstaller/renderer/swing/AIRadioButton.java (rev 0) +++ pal-portal/modules/ant-installer/trunk/src/org/tp23/antinstaller/renderer/swing/AIRadioButton.java 2008-06-11 13:36:41 UTC (rev 975) @@ -0,0 +1,82 @@ +/* + * Copyright 2005 Paul Hinds + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +package org.tp23.antinstaller.renderer.swing; + +import java.awt.Dimension; + +import javax.swing.Action; +import javax.swing.Icon; +import javax.swing.JRadioButton; + + +/** + * A JRadioButton with altered prefered size to facilitate fixing the width + * but still using a GridBagLayout + * @author Paul Hinds + * @version $Id: AIRadioButton.java,v 1.2 2006/12/09 15:26:09 teknopaul Exp $ + */ +public class AIRadioButton extends JRadioButton { + + public AIRadioButton() { + super(); + } + + public AIRadioButton(String text) { + super(text); + } + + public AIRadioButton(String text, boolean selected) { + super(text, selected); + } + + public AIRadioButton(Action a) { + super(a); + } + + public AIRadioButton(Icon icon) { + super(icon); + } + + public AIRadioButton(Icon icon, boolean selected) { + super(icon, selected); + } + + public AIRadioButton(String text, Icon icon) { + super(text, icon); + } + + public AIRadioButton(String text, Icon icon, boolean selected) { + super(text, icon, selected); + } + + private Dimension prefSize = new Dimension(SizeConstants.FIELD_WIDTH, SizeConstants.FIELD_HEIGHT); + + public Dimension getMinimumSize() { + return prefSize; + } + + public Dimension getPreferredSize() { + return prefSize; + } + public void setOverflow(Dimension prefSize) { + this.prefSize = prefSize; + } + + public Dimension getMaximumSize() { + return prefSize; + } + +} Property changes on: pal-portal/modules/ant-installer/trunk/src/org/tp23/antinstaller/renderer/swing/AIRadioButton.java ___________________________________________________________________ Name: svn:eol-style + native Added: pal-portal/modules/ant-installer/trunk/src/org/tp23/antinstaller/renderer/swing/AIShortTextField.java =================================================================== --- pal-portal/modules/ant-installer/trunk/src/org/tp23/antinstaller/renderer/swing/AIShortTextField.java (rev 0) +++ pal-portal/modules/ant-installer/trunk/src/org/tp23/antinstaller/renderer/swing/AIShortTextField.java 2008-06-11 13:36:41 UTC (rev 975) @@ -0,0 +1,71 @@ +/* + * Copyright 2005 Paul Hinds + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +package org.tp23.antinstaller.renderer.swing; + +import java.awt.Dimension; + +import javax.swing.JTextField; +import javax.swing.text.Document; + + +/** + * A JTextField with altered prefered size to facilitate fixing the width + * but still using a GridBagLayout. This text field is for use inconjunction + * with a button for example file chooser. + * @author Paul Hinds + * @version $Id: AIShortTextField.java,v 1.2 2006/12/09 15:26:10 teknopaul Exp $ + */ +public class AIShortTextField extends JTextField { + + public AIShortTextField() { + super(); + } + + public AIShortTextField(int columns) { + super(columns); + } + + public AIShortTextField(String text) { + super(text); + } + + public AIShortTextField(String text, int columns) { + super(text, columns); + } + + public AIShortTextField(Document doc, String text, int columns) { + super(doc, text, columns); + } + + private Dimension prefSize = new Dimension(SizeConstants.SHORT_FIELD_WIDTH, SizeConstants.FIELD_HEIGHT); + + public Dimension getMinimumSize() { + return prefSize; + } + + public Dimension getPreferredSize() { + return prefSize; + } + public void setOverflow(Dimension prefSize) { + this.prefSize = prefSize; + } + + public Dimension getMaximumSize() { + return prefSize; + } + + +} Property changes on: pal-portal/modules/ant-installer/trunk/src/org/tp23/antinstaller/renderer/swing/AIShortTextField.java ___________________________________________________________________ Name: svn:eol-style + native Added: pal-portal/modules/ant-installer/trunk/src/org/tp23/antinstaller/renderer/swing/AITextfield.java =================================================================== --- pal-portal/modules/ant-installer/trunk/src/org/tp23/antinstaller/renderer/swing/AITextfield.java (rev 0) +++ pal-portal/modules/ant-installer/trunk/src/org/tp23/antinstaller/renderer/swing/AITextfield.java 2008-06-11 13:36:41 UTC (rev 975) @@ -0,0 +1,70 @@ +/* + * Copyright 2005 Paul Hinds + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +package org.tp23.antinstaller.renderer.swing; + +import java.awt.Dimension; + +import javax.swing.JTextField; +import javax.swing.text.Document; + + +/** + * A JTextField with altered prefered size to facilitate fixing the width + * but still using a GridBagLayout + * @author Paul Hinds + * @version $Id: AITextfield.java,v 1.2 2006/12/09 15:26:09 teknopaul Exp $ + */ +public class AITextfield extends JTextField { + + public AITextfield() { + super(); + } + + public AITextfield(int columns) { + super(columns); + } + + public AITextfield(String text) { + super(text); + } + + public AITextfield(String text, int columns) { + super(text, columns); + } + + public AITextfield(Document doc, String text, int columns) { + super(doc, text, columns); + } + + private Dimension prefSize = new Dimension(SizeConstants.FIELD_WIDTH, SizeConstants.FIELD_HEIGHT); + + public Dimension getMinimumSize() { + return prefSize; + } + + public Dimension getPreferredSize() { + return prefSize; + } + public void setOverflow(Dimension prefSize) { + this.prefSize = prefSize; + } + + public Dimension getMaximumSize() { + return prefSize; + } + + +} \ No newline at end of file Property changes on: pal-portal/modules/ant-installer/trunk/src/org/tp23/antinstaller/renderer/swing/AITextfield.java ___________________________________________________________________ Name: svn:eol-style + native Added: pal-portal/modules/ant-installer/trunk/src/org/tp23/antinstaller/renderer/swing/AppRootInputRenderer.java =================================================================== --- pal-portal/modules/ant-installer/trunk/src/org/tp23/antinstaller/renderer/swing/AppRootInputRenderer.java (rev 0) +++ pal-portal/modules/ant-installer/trunk/src/org/tp23/antinstaller/renderer/swing/AppRootInputRenderer.java 2008-06-11 13:36:41 UTC (rev 975) @@ -0,0 +1,20 @@ +/* + * Copyright 2005 Paul Hinds + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +package org.tp23.antinstaller.renderer.swing; + +public class AppRootInputRenderer + extends DirectoryInputRenderer { +} Property changes on: pal-portal/modules/ant-installer/trunk/src/org/tp23/antinstaller/renderer/swing/AppRootInputRenderer.java ___________________________________________________________________ Name: svn:eol-style + native Added: pal-portal/modules/ant-installer/trunk/src/org/tp23/antinstaller/renderer/swing/CheckboxInputRenderer.java =================================================================== --- pal-portal/modules/ant-installer/trunk/src/org/tp23/antinstaller/renderer/swing/CheckboxInputRenderer.java (rev 0) +++ pal-portal/modules/ant-installer/trunk/src/org/tp23/antinstaller/renderer/swing/CheckboxInputRenderer.java 2008-06-11 13:36:41 UTC (rev 975) @@ -0,0 +1,90 @@ +/* + * Copyright 2005 Paul Hinds + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +package org.tp23.antinstaller.renderer.swing; + +import java.awt.event.ActionEvent; +import java.awt.event.ActionListener; + +import javax.swing.JLabel; +import javax.swing.JPanel; + +import org.tp23.antinstaller.input.CheckboxInput; +import org.tp23.antinstaller.input.InputField; +import org.tp23.antinstaller.input.OutputField; +import org.tp23.gui.GBCF; + +public class CheckboxInputRenderer + extends SwingOutputFieldRenderer { + + protected CheckboxInput inputField; + + protected JLabel fieldLabel = new AILabel(); + protected AICheckBox checkBox = new AICheckBox(); + + public CheckboxInputRenderer() { + } + public void initComponent(JPanel parent){ + try { + jbInit(); + } + catch(Exception e) { + e.printStackTrace(); + } + } + + + + public void setOutputField(OutputField inputField) { + this.inputField = (CheckboxInput)inputField; + } + public void updateInputField(){ + boolean selected = checkBox.isSelected(); + if(selected)inputField.setValue("true"); + else inputField.setValue("false"); + } + public void updateDefaultValue(){ + if(!inputField.isEditted()){ + String newDefault = inputField.getDefaultValue(); + checkBox.setSelected(InputField.isTrue(newDefault)); + } + } + + private void jbInit() throws Exception { + fieldLabel.setText(inputField.getDisplayText()); + checkBox.setSelected(OutputField.isTrue(inputField.getDefaultValue())); + checkBox.setEnabled(!OutputField.isTrue(inputField.getForce())); + checkBox.addActionListener(new ActionListener() { + public void actionPerformed(ActionEvent e) { + updateInputField(); + inputField.setEditted(true); + } + }); + } + public int addSelf(JPanel content, GBCF cf, int row, boolean overflow) { + content.add(fieldLabel, cf.getCell(row, 0)); + content.add(checkBox, cf.getCell(row, 1)); + if(overflow){ + checkBox.setOverflow(SizeConstants.OVERFLOW_FIELD_SIZE); + } + return ++row; + } + + /** + * renderError + */ + public void renderError() { + } +} Property changes on: pal-portal/modules/ant-installer/trunk/src/org/tp23/antinstaller/renderer/swing/CheckboxInputRenderer.java ___________________________________________________________________ Name: svn:eol-style + native Added: pal-portal/modules/ant-installer/trunk/src/org/tp23/antinstaller/renderer/swing/ClasspathHTMLEditorKit.java =================================================================== --- pal-portal/modules/ant-installer/trunk/src/org/tp23/antinstaller/renderer/swing/ClasspathHTMLEditorKit.java (rev 0) +++ pal-portal/modules/ant-installer/trunk/src/org/tp23/antinstaller/renderer/swing/ClasspathHTMLEditorKit.java 2008-06-11 13:36:41 UTC (rev 975) @@ -0,0 +1,54 @@ +/* + * Copyright 2005 Paul Hinds + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +package org.tp23.antinstaller.renderer.swing; + +import java.net.URL; + +import javax.swing.text.Element; +import javax.swing.text.View; +import javax.swing.text.ViewFactory; +import javax.swing.text.html.HTML; +import javax.swing.text.html.HTMLEditorKit; +import javax.swing.text.html.ImageView; +/** + * HTMLEditor kit that replaces the source of images in the document + * with resources loaded from the classpath. + * @author teknopaul + */ +public class ClasspathHTMLEditorKit extends HTMLEditorKit { + + public ViewFactory getViewFactory(){ + + return new HTMLEditorKit.HTMLFactory(){ + + public View create(Element elem){ + if(! elem.getName().equals("img")){ + return super.create(elem); + } + return new ImageView(elem){ + public URL getImageURL() { + String src = (String)getElement().getAttributes(). + getAttribute(HTML.Attribute.SRC); + return TextPageRenderer.class.getResource(src); + } + }; + } + + }; + + } + +} Property changes on: pal-portal/modules/ant-installer/trunk/src/org/tp23/antinstaller/renderer/swing/ClasspathHTMLEditorKit.java ___________________________________________________________________ Name: svn:eol-style + native Added: pal-portal/modules/ant-installer/trunk/src/org/tp23/antinstaller/renderer/swing/CommentOutputRenderer.java =================================================================== --- pal-portal/modules/ant-installer/trunk/src/org/tp23/antinstaller/renderer/swing/CommentOutputRenderer.java (rev 0) +++ pal-portal/modules/ant-installer/trunk/src/org/tp23/antinstaller/renderer/swing/CommentOutputRenderer.java 2008-06-11 13:36:41 UTC (rev 975) @@ -0,0 +1,115 @@ +/* + * Copyright 2005 Paul Hinds + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +package org.tp23.antinstaller.renderer.swing; + +import java.awt.Dimension; +import java.awt.Font; + +import javax.swing.JLabel; +import javax.swing.JPanel; +import javax.swing.text.JTextComponent; + +import org.tp23.antinstaller.input.CommentOutput; +import org.tp23.antinstaller.input.OutputField; +import org.tp23.gui.GBCF; + +public class CommentOutputRenderer + extends SwingOutputFieldRenderer { + + protected AILabel fieldLabel = new AILabel(); + // hack callback, should move this to superclass + protected JTextComponent explanatoryTextField; + + private static Font boldCommentFont; + private static Font titleCommentFont; + static{ + boldCommentFont = new JLabel().getFont();// reusing the variable + try { + boldCommentFont = new Font(boldCommentFont.getFamily(), Font.BOLD, boldCommentFont.getSize()); + titleCommentFont = new Font(boldCommentFont.getFamily(), Font.BOLD, 16); + } + catch (Exception ex) { + // lets not fail due to font errors + } + } + + public CommentOutputRenderer() { + } + + public void initComponent(JPanel parent){ + try { + jbInit(); + } + catch(Exception e) { + e.printStackTrace(); + } + } + + public void setOutputField(OutputField outputField) { + this.outputField = (CommentOutput)outputField;// trap ClassCast bugs early + } + public void updateInputField(){ + } + +// hack callback, should move this to superclass + public JTextComponent getExplanatoryTextField() { + return explanatoryTextField; + } +// hack callback, should move this to superclass + public void setExplanatoryTextField(JTextComponent explanatoryTextField) { + this.explanatoryTextField = explanatoryTextField; + } + /** + * Since comments may now include expanded properties this should be called when the + * field is rendered. For no ONLY comment fields have property values expanded + */ + public void updateDefaultValue(){ + fieldLabel.setText(outputField.getDisplayText()); + if(explanatoryTextField != null) { + explanatoryTextField.setText(outputField.getExplanatoryText()); + } + } + private void jbInit() throws Exception { + + // FindBugs - cast is performed here to avoid overriding protected superclass field + CommentOutput cOutputField = (CommentOutput)outputField; + + fieldLabel.setText(cOutputField.getDisplayText()); + + if( OutputField.isTrue(cOutputField.getBold()) ){ + fieldLabel.setFont(boldCommentFont); + } + if( OutputField.isTrue(cOutputField.getTitle()) ){ + fieldLabel.setFont(titleCommentFont); + } + } + public int addSelf(JPanel content, GBCF cf, int row, boolean overflow) { + content.add(fieldLabel, cf.getSpan(row)); + if(overflow){ + fieldLabel.setOverflow(SizeConstants.OVERFLOW_TOTAL_SIZE); + } else { + fieldLabel.setOverflow(new Dimension(SizeConstants.FIELD_WIDTH + SizeConstants.LABEL_WIDTH, SizeConstants.FIELD_HEIGHT)); + } + return ++row; + } + + + /** + * renderError + */ + public void renderError() { + } +} Property changes on: pal-portal/modules/ant-installer/trunk/src/org/tp23/antinstaller/renderer/swing/CommentOutputRenderer.java ___________________________________________________________________ Name: svn:eol-style + native Added: pal-portal/modules/ant-installer/trunk/src/org/tp23/antinstaller/renderer/swing/ConditionalFieldRenderer.java =================================================================== --- pal-portal/modules/ant-installer/trunk/src/org/tp23/antinstaller/renderer/swing/ConditionalFieldRenderer.java (rev 0) +++ pal-portal/modules/ant-installer/trunk/src/org/tp23/antinstaller/renderer/swing/ConditionalFieldRenderer.java 2008-06-11 13:36:41 UTC (rev 975) @@ -0,0 +1,111 @@ +/* + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +package org.tp23.antinstaller.renderer.swing; + +import java.util.ArrayList; + +import javax.swing.JPanel; + +import org.tp23.antinstaller.ResourceBundleHelper; +import org.tp23.antinstaller.input.ConditionalField; +import org.tp23.antinstaller.input.InputField; +import org.tp23.antinstaller.renderer.RendererFactory; +import org.tp23.antinstaller.runtime.ConfigurationException; +import org.tp23.antinstaller.runtime.logic.Expression; +import org.tp23.gui.GBCF; + +/** + * Conditionally render a collection of fields. + * For now, will ONLY handle <hiddeb> fields + * + * @author mwilson + * @version $Id + * @since 0.7.4 patch 7 + */ +public class ConditionalFieldRenderer extends SwingOutputFieldRenderer { + + private ResourceBundleHelper resHelper = new ResourceBundleHelper( "org.tp23.antinstaller.renderer.Res" ); + private ConditionalField condField; + private ArrayList renderers = new ArrayList( ); + + public ConditionalFieldRenderer() { + } + + public void initComponent( JPanel parent ) { + + condField = (ConditionalField) outputField; + InputField[] fields = condField.getFields(); + + for (int i = 0; i < fields.length; i++) { + try { + SwingOutputFieldRenderer renderer = RendererFactory.getSwingRenderer(fields[i]); + renderer.setOutputField(fields[i]); + renderer.setInstallerContext(ctx); + renderers.add( renderer ); + } + catch( ClassNotFoundException clsNotFndExc ) { + + } + } + + } + + public void updateInputField() { + + if( expressionIsTrue() ) { + int listSize = renderers.size(); + for( int i = 0; i < listSize; i++ ) { + SwingOutputFieldRenderer renderer = (SwingOutputFieldRenderer) renderers.get( i ); + renderer.updateInputField(); + } + } + + } + + public void updateDefaultValue() { + if( expressionIsTrue() ) { + int listSize = renderers.size(); + for( int i = 0; i < listSize; i++ ) { + SwingOutputFieldRenderer renderer = (SwingOutputFieldRenderer) renderers.get( i ); + renderer.updateDefaultValue(); + } + } + } + + public void renderError() { + int listSize = renderers.size(); + for( int i = 0; i < listSize; i++ ) { + SwingOutputFieldRenderer renderer = (SwingOutputFieldRenderer) renderers.get( i ); + renderer.renderError(); + } + } + + public int addSelf( JPanel content, GBCF cf, int row, boolean overflow ) { + return row; + } + + private boolean expressionIsTrue() { + Expression expr = null; + + try { + expr = condField.getExpression(); + } + catch( ConfigurationException configExc ) { + ctx.log( resHelper.getMessage( "invalid.conditional.expression", configExc ) ); + return false; + } + + return expr.evaluate(); + } +} Property changes on: pal-portal/modules/ant-installer/trunk/src/org/tp23/antinstaller/renderer/swing/ConditionalFieldRenderer.java ___________________________________________________________________ Name: svn:eol-style + native Added: pal-portal/modules/ant-installer/trunk/src/org/tp23/antinstaller/renderer/swing/ConfirmPasswordTextInputRenderer.java =================================================================== --- pal-portal/modules/ant-installer/trunk/src/org/tp23/antinstaller/renderer/swing/ConfirmPasswordTextInputRenderer.java (rev 0) +++ pal-portal/modules/ant-installer/trunk/src/org/tp23/antinstaller/renderer/swing/ConfirmPasswordTextInputRenderer.java 2008-06-11 13:36:41 UTC (rev 975) @@ -0,0 +1,27 @@ +/* + * Copyright 2005 Paul Hinds + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +package org.tp23.antinstaller.renderer.swing; + +import java.util.ResourceBundle; + +public class ConfirmPasswordTextInputRenderer extends PasswordTextInputRenderer{ + + private static final ResourceBundle res = ResourceBundle.getBundle("org.tp23.antinstaller.renderer.Res"); + + protected String getErrorMessage(){ + return res.getString("passwordsDoNotMatch"); + } +} Property changes on: pal-portal/modules/ant-installer/trunk/src/org/tp23/antinstaller/renderer/swing/ConfirmPasswordTextInputRenderer.java ___________________________________________________________________ Name: svn:eol-style + native Added: pal-portal/modules/ant-installer/trunk/src/org/tp23/antinstaller/renderer/swing/DateInputRenderer.java =================================================================== --- pal-portal/modules/ant-installer/trunk/src/org/tp23/antinstaller/renderer/swing/DateInputRenderer.java (rev 0) +++ pal-portal/modules/ant-installer/trunk/src/org/tp23/antinstaller/renderer/swing/DateInputRenderer.java 2008-06-11 13:36:41 UTC (rev 975) @@ -0,0 +1,104 @@ +/* + * Copyright 2005 Paul Hinds + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +package org.tp23.antinstaller.renderer.swing; + +import java.awt.Color; +import java.awt.event.FocusAdapter; +import java.awt.event.FocusEvent; +import java.awt.event.KeyAdapter; +import java.awt.event.KeyEvent; +import java.util.ResourceBundle; + +import javax.swing.JPanel; + +import org.tp23.antinstaller.input.DateInput; +import org.tp23.antinstaller.input.OutputField; +import org.tp23.antinstaller.renderer.MessageRenderer; +import org.tp23.gui.GBCF; + +public class DateInputRenderer + extends SwingOutputFieldRenderer { + + private static final ResourceBundle res = ResourceBundle.getBundle("org.tp23.antinstaller.renderer.Res"); + + protected DateInput inputField; + + protected AILabel fieldLabel = new AILabel(); + protected AITextfield jTextField = new AITextfield(); + protected Color origFore; + + public DateInputRenderer() { + origFore = jTextField.getForeground(); + } + + public void initComponent(JPanel parent){ + try { + jbInit(); + } + catch(Exception e) { + e.printStackTrace(); + } + } + + public void setOutputField(OutputField inputField) { + this.inputField = (DateInput)inputField; + this.inputField.setValue(this.inputField.getDefaultValue()); + } + public void updateInputField(){ + inputField.setValue(jTextField.getText()); + } + public void updateDefaultValue(){ + if(!inputField.isEditted())jTextField.setText(inputField.getDefaultValue()); + } + + private void jbInit() throws Exception { + fieldLabel.setText(inputField.getDisplayText()); + jTextField.setText(inputField.getDefaultValue()); + jTextField.addKeyListener(new KeyAdapter() { + public void keyTyped(KeyEvent e) { + if(e.getKeyChar() != '\t'){ + inputField.setEditted(true); + } + } + }); + jTextField.addFocusListener(new FocusAdapter() { + public void focusLost(FocusEvent fe){ + jTextField.setForeground(origFore); + } + }); + } + public int addSelf(JPanel content, GBCF cf, int row,boolean overflow) { + content.add(fieldLabel, cf.getCell(row, 0)); + content.add(jTextField, cf.getCell(row, 1)); + if(overflow){ + jTextField.setOverflow(SizeConstants.OVERFLOW_FIELD_SIZE); + } + return ++row; + } + + + /** + * renderError + */ + public void renderError() { + MessageRenderer mr = ctx.getMessageRenderer(); + mr.printMessage(res.getString("notCorrectFormat") + "\n\n " + inputField.getDateFormat()); + //fixed BUG1295944 mr.printMessage("The field is not of the correct format\n\n "+inputField.getDateFormat()); + this.jTextField.requestFocus(); + this.jTextField.setForeground(Color.red); + } + +} Property changes on: pal-portal/modules/ant-installer/trunk/src/org/tp23/antinstaller/renderer/swing/DateInputRenderer.java ___________________________________________________________________ Name: svn:eol-style + native Added: pal-portal/modules/ant-installer/trunk/src/org/tp23/antinstaller/renderer/swing/DirectoryInputRenderer.java =================================================================== --- pal-portal/modules/ant-installer/trunk/src/org/tp23/antinstaller/renderer/swing/DirectoryInputRenderer.java (rev 0) +++ pal-portal/modules/ant-installer/trunk/src/org/tp23/antinstaller/renderer/swing/DirectoryInputRenderer.java 2008-06-11 13:36:41 UTC (rev 975) @@ -0,0 +1,143 @@ +/* + * Copyright 2005 Paul Hinds + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +package org.tp23.antinstaller.renderer.swing; + +import java.awt.BorderLayout; +import java.awt.Dimension; +import java.awt.event.ActionEvent; +import java.awt.event.ActionListener; +import java.io.File; +import java.util.ResourceBundle; + +import javax.swing.JFileChooser; +import javax.swing.JPanel; + +import org.tp23.antinstaller.input.DirectoryInput; +import org.tp23.antinstaller.input.OutputField; +import org.tp23.gui.GBCF; +import org.tp23.gui.widget.DefaultingDirectoryChooser; + +public class DirectoryInputRenderer + extends SwingOutputFieldRenderer { + + private static final ResourceBundle res = ResourceBundle.getBundle("org.tp23.antinstaller.renderer.Res"); + + private static final String EMPTY_STRING = ""; + protected DirectoryInput inputField; + private boolean createMode; + private DefaultingDirectoryChooser chooser = null; + + protected AILabel fieldLabel = new AILabel(); + protected AIShortTextField jTextField = new AIShortTextField(); + protected AIButton browseButton = new AIButton(); + protected JPanel browsePanel = new JPanel(); + private JPanel parent; + + public DirectoryInputRenderer() { + } + public void initComponent(JPanel parent){ + this.parent = parent; + try { + jbInit(); + } + catch(Exception e) { + e.printStackTrace(); + } + } + + public void setOutputField(OutputField inputField) { + this.inputField = (DirectoryInput)inputField; + this.inputField.setValue(this.inputField.getDefaultValue(true)); + this.createMode = OutputField.isTrue(this.inputField.getCreate()); + + } + public void updateInputField(){ + if( !inputField.getDefaultValue(true).equals(jTextField.getText()) ){ + inputField.setEditted(true); + } + inputField.setValue(jTextField.getText()); + } + public void updateDefaultValue(){ + if(!inputField.isEditted())jTextField.setText(inputField.getDefaultValue(true)); + } + + private void jbInit() throws Exception { + BorderLayout bl = new BorderLayout(); + //bl.setHgap(3); + browsePanel.setLayout(bl); + fieldLabel.setText(inputField.getDisplayText()); + jTextField.setText(inputField.getDefaultValue(true)); + browsePanel.add(jTextField, BorderLayout.CENTER); + browsePanel.add(browseButton, BorderLayout.EAST); + browseButton.addActionListener(new ActionListener() { + public void actionPerformed(ActionEvent e) { + File selectedFile = null; + if(chooser==null){ + chooser = new DefaultingDirectoryChooser(createMode); + chooser.setFileHidingEnabled(false); + } + + //PR 1468823 - if input is cleared, dialogue won't be displayed + String dirPath = jTextField.getText(); + if( dirPath == null ) { + dirPath = EMPTY_STRING; + } + dirPath = dirPath.trim(); + + if( dirPath.length() == 0 ) { + dirPath = inputField.getDefaultValue(true); + jTextField.setText(dirPath); + } + chooser.setDefaultDirectory(new File(dirPath)); + + int returnVal = chooser.showDialog(parent, e.getActionCommand()); + if (returnVal == JFileChooser.APPROVE_OPTION) { + selectedFile = chooser.getSelectedFile(); + } + if (selectedFile != null) { + jTextField.setText(selectedFile.getAbsolutePath()); + inputField.setValue(selectedFile.getAbsolutePath()); + inputField.setEditted(true); + } + } + }); + browseButton.setText(res.getString("selectFolder")); + browseButton.setPreferredSize(new Dimension(150, SizeConstants.FIELD_HEIGHT)); + + jTextField.addActionListener(new ActionListener() { + public void actionPerformed(ActionEvent e) { + updateInputField(); + } + }); + + } + public int addSelf(JPanel content,GBCF cf, int row,boolean overflow) { + content.add(fieldLabel,cf.getCell(row,0)); + content.add(browsePanel,cf.getCell(row,1)); + if(overflow){ + jTextField.setOverflow(SizeConstants.OVERFLOW_SHORT_FIELD_SIZE); + } + return ++row; + } + + + /** + * renderError + */ + public void renderError() { + jTextField.requestFocus(); + } +} Property changes on: pal-portal/modules/ant-installer/trunk/src/org/tp23/antinstaller/renderer/swing/DirectoryInputRenderer.java ___________________________________________________________________ Name: svn:eol-style + native Added: pal-portal/modules/ant-installer/trunk/src/org/tp23/antinstaller/renderer/swing/ExtValidatedTextInputRenderer.java =================================================================== --- pal-portal/modules/ant-installer/trunk/src/org/tp23/antinstaller/renderer/swing/ExtValidatedTextInputRenderer.java (rev 0) +++ pal-portal/modules/ant-installer/trunk/src/org/tp23/antinstaller/renderer/swing/ExtValidatedTextInputRenderer.java 2008-06-11 13:36:41 UTC (rev 975) @@ -0,0 +1,40 @@ +/* + * Copyright 2005 Paul Hinds + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +package org.tp23.antinstaller.renderer.swing; + +import java.awt.Color; + +import org.tp23.antinstaller.input.ExtValidatedTextInput; +import org.tp23.antinstaller.input.Validator; +import org.tp23.antinstaller.renderer.MessageRenderer; + +public class ExtValidatedTextInputRenderer + extends ValidatedTextInputRenderer { + + /** + * renderError + */ + public void renderError() { + MessageRenderer mr = ctx.getMessageRenderer(); + ExtValidatedTextInput extVal = (ExtValidatedTextInput)inputField; + Validator validator = extVal.getValidator(); + Throwable t = extVal.getThrowable(); + mr.printMessage(validator.getErrorMessage(t, null)); + this.jTextField.requestFocus(); + this.jTextField.setForeground(Color.red); + } + +} Property changes on: pal-portal/modules/ant-installer/trunk/src/org/tp23/antinstaller/renderer/swing/ExtValidatedTextInputRenderer.java ___________________________________________________________________ Name: svn:eol-style + native Added: pal-portal/modules/ant-installer/trunk/src/org/tp23/antinstaller/renderer/swing/FileInputRenderer.java =================================================================== --- pal-portal/modules/ant-installer/trunk/src/org/tp23/antinstaller/renderer/swing/FileInputRenderer.java (rev 0) +++ pal-portal/modules/ant-installer/trunk/src/org/tp23/antinstaller/renderer/swing/FileInputRenderer.java 2008-06-11 13:36:41 UTC (rev 975) @@ -0,0 +1,139 @@ +/* + * Copyright 2005 Paul Hinds + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +package org.tp23.antinstaller.renderer.swing; + +import java.awt.BorderLayout; +import java.awt.Color; +import java.awt.Dimension; +import java.awt.event.ActionEvent; +import java.awt.event.ActionListener; +import java.awt.event.FocusAdapter; +import java.awt.event.FocusEvent; +import java.io.File; +import java.util.ResourceBundle; + +import javax.swing.JFileChooser; +import javax.swing.JPanel; + +import org.tp23.antinstaller.input.FileInput; +import org.tp23.antinstaller.input.OutputField; +import org.tp23.antinstaller.renderer.MessageRenderer; +import org.tp23.gui.GBCF; + +public class FileInputRenderer + extends SwingOutputFieldRenderer { + + private static final ResourceBundle res = ResourceBundle.getBundle("org.tp23.antinstaller.renderer.Res"); + + protected FileInput inputField; + + protected AILabel fieldLabel = new AILabel(); + protected AIShortTextField jTextField = new AIShortTextField(); + protected AIButton browseButton = new AIButton(); + protected JPanel browsePanel = new JPanel(); + private Color origFore = jTextField.getForeground(); + private JPanel parent; + + public FileInputRenderer() { + } + public void initComponent(JPanel parent){ + this.parent=parent; + try { + jbInit(); + } + catch(Exception e) { + e.printStackTrace(); + } + } + + public void setOutputField(OutputField inputField) { + this.inputField = (FileInput)inputField; + this.inputField.setValue(this.inputField.getDefaultValue(true)); + } + public void updateInputField(){ + if( !inputField.getDefaultValue(true).equals(jTextField.getText()) ){ + inputField.setEditted(true); + } + inputField.setValue(jTextField.getText()); + } + public void updateDefaultValue(){ + if(!inputField.isEditted())jTextField.setText(inputField.getDefaultValue(true)); + } + + private void jbInit() throws Exception { + BorderLayout bl = new BorderLayout(); + //bl.setHgap(3); + browsePanel.setLayout(bl); + fieldLabel.setText(inputField.getDisplayText()); + jTextField.setText(inputField.getDefaultValue(true)); + browsePanel.add(jTextField, BorderLayout.CENTER); + browsePanel.add(browseButton, BorderLayout.EAST); + browseButton.addActionListener(new ActionListener() { + public void actionPerformed(ActionEvent e) { + File selectedFile = null; + + JFileChooser chooser = new JFileChooser(); + chooser.setFileHidingEnabled(false); + chooser.setFileSelectionMode(JFileChooser.FILES_ONLY); + if (jTextField.getText() != null) { + chooser.setCurrentDirectory(new File(jTextField.getText()).getParentFile()); + } + int returnVal = chooser.showDialog(parent, e.getActionCommand()); + if (returnVal == JFileChooser.APPROVE_OPTION) { + selectedFile = chooser.getSelectedFile(); + } + if (selectedFile != null) { + jTextField.setText(selectedFile.getAbsolutePath()); + inputField.setValue(selectedFile.getAbsolutePath()); + inputField.setEditted(true); + } + } + }); + browseButton.setText(res.getString("selectFile")); + browseButton.setPreferredSize(new Dimension(150, SizeConstants.FIELD_HEIGHT)); + + jTextField.addActionListener(new ActionListener() { + public void actionPerformed(ActionEvent e) { + updateInputField(); + } + }); + jTextField.addFocusListener(new FocusAdapter() { + public void focusLost(FocusEvent fe){ + jTextField.setForeground(origFore); + } + }); + + } + public int addSelf(JPanel content,GBCF cf, int row,boolean overflow) { + content.add(fieldLabel,cf.getCell(row,0)); + content.add(browsePanel,cf.getCell(row,1)); + if(overflow){ + jTextField.setOverflow(SizeConstants.OVERFLOW_SHORT_FIELD_SIZE); + } + return ++row; + } + + + /** + * renderError + */ + public void renderError() { + MessageRenderer mr = ctx.getMessageRenderer(); + mr.printMessage(res.getString("fileNotExist")); + this.jTextField.requestFocus(); + this.jTextField.setForeground(Color.red); + } +} Property changes on: pal-portal/modules/ant-installer/trunk/src/org/tp23/antinstaller/renderer/swing/FileInputRenderer.java ___________________________________________________________________ Name: svn:eol-style + native Added: pal-portal/modules/ant-installer/trunk/src/org/tp23/antinstaller/renderer/swing/HiddenPropertyInputRenderer.java =================================================================== --- pal-portal/modules/ant-installer/trunk/src/org/tp23/antinstaller/renderer/swing/HiddenPropertyInputRenderer.java (rev 0) +++ pal-portal/modules/ant-installer/trunk/src/org/tp23/antinstaller/renderer/swing/HiddenPropertyInputRenderer.java 2008-06-11 13:36:41 UTC (rev 975) @@ -0,0 +1,66 @@ +/* + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +package org.tp23.antinstaller.renderer.swing; + +import javax.swing.JPanel; + +import org.tp23.antinstaller.input.HiddenPropertyInput; +import org.tp23.antinstaller.input.OutputField; +import org.tp23.gui.GBCF; + +/** + * Swing UI hidden property renderer - displays nothing + * + * @author mwilson + * @version $Id + * @since 0.7.4 patch 6 + */ +public class HiddenPropertyInputRenderer extends SwingOutputFieldRenderer +{ + HiddenPropertyInput inputField; + + public void setOutputField( OutputField ioField ) + { + inputField = (HiddenPropertyInput) ioField; + inputField.setInputResult( inputField.getDefaultValue() ); + } + + public void initComponent( JPanel parent ) + { + + } + + public void updateInputField() + { + + } + + public void updateDefaultValue() + { + if( !inputField.isEditted() ) + { + inputField.setInputResult( inputField.getDefaultValue() ); + } + } + + public void renderError() + { + + } + + public int addSelf( JPanel content, GBCF cf, int row, boolean overflow ) + { + return row; + } +} Property changes on: pal-portal/modules/ant-installer/trunk/src/org/tp23/antinstaller/renderer/swing/HiddenPropertyInputRenderer.java ___________________________________________________________________ Name: svn:eol-style + native Added: pal-portal/modules/ant-installer/trunk/src/org/tp23/antinstaller/renderer/swing/LargeSelectInputRenderer.java =================================================================== --- pal-portal/modules/ant-installer/trunk/src/org/tp23/antinstaller/renderer/swing/LargeSelectInputRenderer.java (rev 0) +++ pal-portal/modules/ant-installer/trunk/src/org/tp23/antinstaller/renderer/swing/LargeSelectInputRenderer.java 2008-06-11 13:36:41 UTC (rev 975) @@ -0,0 +1,116 @@ +/* + * Copyright 2005 Paul Hinds + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +package org.tp23.antinstaller.renderer.swing; + +import java.awt.event.ItemEvent; +import java.awt.event.ItemListener; +import java.util.ResourceBundle; + +import javax.swing.JComboBox; +import javax.swing.JLabel; +import javax.swing.JPanel; + +import org.tp23.antinstaller.input.LargeSelectInput; +import org.tp23.antinstaller.input.OutputField; +import org.tp23.gui.GBCF; + +public class LargeSelectInputRenderer + extends SwingOutputFieldRenderer { + + private static final ResourceBundle res = ResourceBundle.getBundle("org.tp23.antinstaller.renderer.Res"); + + protected LargeSelectInput inputField; + + protected JLabel fieldLabel = new AILabel(); + protected JComboBox optionCombo = new JComboBox(); + + //private int numOfEntries = 2; + + public LargeSelectInputRenderer() { + } + public void initComponent(JPanel parent){ + try { + jbInit(); + } + catch(Exception e) { + e.printStackTrace(); + } + } + + + + public void setOutputField(OutputField inputField) { + this.inputField=(LargeSelectInput)inputField; + //this.numOfEntries=this.inputField.getOptions().length; + } + public void updateInputField(){ + + int selectedIdx = optionCombo.getSelectedIndex(); + if (selectedIdx != -1) { + inputField.setValue(inputField.getOptions()[selectedIdx].value); + + }else{ + inputField.setValue(inputField.getDefaultValue()); + } + } + public void updateDefaultValue(){ + if(!inputField.isEditted()){ + + String newDefault = inputField.getDefaultValue(); + + for(int i=0;iRenders the license page

+ *

+ *

Copyright: Copyright (c) 2004

+ *

Company: tp23

+* @todo this could be an input type and simple renderer + * @author Paul Hinds + * @version $Id: LicensePageRenderer.java,v 1.5 2007/01/12 10:49:09 anothermwilson Exp $ + */ +public class LicensePageRenderer + extends SwingPageRenderer { + + private static final ResourceBundle res = ResourceBundle.getBundle("org.tp23.antinstaller.renderer.Res"); + + private JTextArea licenseTextArea = new JTextArea(); + private JScrollPane scrollPane = new JScrollPane(); + + public LicensePageRenderer(){ + } + + public boolean validateFields()throws ValidationException{ + return true; // @todo option to force accepting or tick box to accept + } + + public void instanceInit() throws Exception { + String resource = ((LicensePage)page).getResource(); + InputStream licensein = this.getClass().getResourceAsStream(resource); + if (licensein == null) { + throw new ConfigurationException("License resource '" + resource + "' is missing from installer"); + } + BufferedReader reader = new BufferedReader(new InputStreamReader(licensein)); + StringBuffer sb = new StringBuffer(); + String line; + while((line = reader.readLine()) != null){ + sb.append(line); + sb.append('\n'); + } + + licenseTextArea.setText(sb.toString()); + licenseTextArea.setTabSize(4); + licenseTextArea.setAutoscrolls(true); + licenseTextArea.setCaretPosition(0); + licenseTextArea.setEditable(false); + licenseTextArea.setLineWrap(true); + licenseTextArea.setWrapStyleWord(true); + licenseTextArea.setBorder(BorderFactory.createEmptyBorder(2, 2, 2, 2)); + scrollPane.getViewport().add(licenseTextArea); + scrollPane.setVerticalScrollBarPolicy(JScrollPane.VERTICAL_SCROLLBAR_ALWAYS); + scrollPane.setBorder(BorderFactory.createCompoundBorder( + BorderFactory.createEmptyBorder(4, 4, 4, 4), + BorderFactory.createEtchedBorder())); + this.add(scrollPane, BorderLayout.CENTER); + + getNextButton().setText( res.getString( "license.next.text" ) ); + getNextButton().setIcon(getImage("/resources/icons/ok.png")); + getCancelButton().setText( res.getString( "license.cancel.text" ) ); + + } + + public void updateInputFields(){ + ; + } + + + + /** + * updateDefaultValues + */ + public void updateDefaultValues() { + } +} Property changes on: pal-portal/modules/ant-installer/trunk/src/org/tp23/antinstaller/renderer/swing/LicensePageRenderer.java ___________________________________________________________________ Name: svn:eol-style + native Added: pal-portal/modules/ant-installer/trunk/src/org/tp23/antinstaller/renderer/swing/PageCompletionListener.java =================================================================== --- pal-portal/modules/ant-installer/trunk/src/org/tp23/antinstaller/renderer/swing/PageCompletionListener.java (rev 0) +++ pal-portal/modules/ant-installer/trunk/src/org/tp23/antinstaller/renderer/swing/PageCompletionListener.java 2008-06-11 13:36:41 UTC (rev 975) @@ -0,0 +1,33 @@ +/* + * Copyright 2005 Paul Hinds + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +package org.tp23.antinstaller.renderer.swing; + +import org.tp23.antinstaller.page.Page; +/** + * + *

Called when a page is complete and the user presses next. +* At this point the pages fields are validated. If validation passes +* the next page is shown

+ *

+ *

Copyright: Copyright (c) 2004

+ *

Company: tp23

+ * @author Paul Hinds + * @version $Id: PageCompletionListener.java,v 1.1.1.1 2005/10/18 18:21:01 teknopaul Exp $ + */ +public interface PageCompletionListener { + public void pageComplete(Page page); + public void pageBack(Page page); +} Property changes on: pal-portal/modules/ant-installer/trunk/src/org/tp23/antinstaller/renderer/swing/PageCompletionListener.java ___________________________________________________________________ Name: svn:eol-style + native Added: pal-portal/modules/ant-installer/trunk/src/org/tp23/antinstaller/renderer/swing/PasswordTextInputRenderer.java =================================================================== --- pal-portal/modules/ant-installer/trunk/src/org/tp23/antinstaller/renderer/swing/PasswordTextInputRenderer.java (rev 0) +++ pal-portal/modules/ant-installer/trunk/src/org/tp23/antinstaller/renderer/swing/PasswordTextInputRenderer.java 2008-06-11 13:36:41 UTC (rev 975) @@ -0,0 +1,66 @@ +/* + * Copyright 2005 Paul Hinds + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +package org.tp23.antinstaller.renderer.swing; + +import java.awt.Color; +import java.awt.event.KeyAdapter; +import java.awt.event.KeyEvent; +import java.util.ResourceBundle; + +import javax.swing.JPanel; + +import org.tp23.antinstaller.renderer.MessageRenderer; +import org.tp23.gui.GBCF; + +public class PasswordTextInputRenderer extends ValidatedTextInputRenderer{ + + private static final ResourceBundle res = ResourceBundle.getBundle("org.tp23.antinstaller.renderer.Res"); + + public PasswordTextInputRenderer() { + this.jTextField = new AIPasswordField(); + origFore = jTextField.getForeground(); // this is lazy there must be a way to shift this line of code to the superclass (is it worth it) + } + + + public void renderError() { + MessageRenderer mr = ctx.getMessageRenderer(); + mr.printMessage( getErrorMessage() ); + // fixed BUG:1295944 mr.printMessage("The password is not of the correct format\n\n e.g. "+inputField.getDefaultValue()); + this.jTextField.requestFocus(); + this.jTextField.setForeground(Color.red); + jTextField.addKeyListener(new KeyAdapter() { + public void keyTyped(KeyEvent e) { + if(e.getKeyChar() != '\t'){ + inputField.setEditted(true); + } + } + }); + } + public int addSelf(JPanel content, GBCF cf, int row, boolean overflow) { + content.add(fieldLabel, cf.getCell(row, 0)); + content.add(jTextField, cf.getCell(row, 1)); + if(overflow){ + ((AIPasswordField)jTextField).setOverflow(SizeConstants.OVERFLOW_FIELD_SIZE); + } + return ++row; + } + protected String getErrorMessage(){ + return res.getString("notCorrectPasswordFormat") + + "\n\n e.g. " + + inputField.getDefaultValue(); + } + +} Property changes on: pal-portal/modules/ant-installer/trunk/src/org/tp23/antinstaller/renderer/swing/PasswordTextInputRenderer.java ___________________________________________________________________ Name: svn:eol-style + native Added: pal-portal/modules/ant-installer/trunk/src/org/tp23/antinstaller/renderer/swing/ProgressPageRenderer.java =================================================================== --- pal-portal/modules/ant-installer/trunk/src/org/tp23/antinstaller/renderer/swing/ProgressPageRenderer.java (rev 0) +++ pal-portal/modules/ant-installer/trunk/src/org/tp23/antinstaller/renderer/swing/ProgressPageRenderer.java 2008-06-11 13:36:41 UTC (rev 975) @@ -0,0 +1,196 @@ +/* + * Copyright 2005 Paul Hinds + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +package org.tp23.antinstaller.renderer.swing; + +import java.awt.BorderLayout; +import java.awt.Dimension; +import java.awt.Insets; +import java.awt.Rectangle; +import java.awt.event.ActionEvent; +import java.awt.event.ActionListener; +import java.io.PrintStream; +import java.util.ResourceBundle; + +import javax.swing.BorderFactory; +import javax.swing.JLabel; +import javax.swing.JPanel; +import javax.swing.JScrollPane; +import javax.swing.JTabbedPane; +import javax.swing.JToggleButton; + +import org.tp23.antinstaller.page.ProgressPage; +import org.tp23.antinstaller.renderer.AntOutputRenderer; +import org.tp23.gui.widget.SystemOutJTextArea; +/** + * + *

Copyright: Copyright (c) 2004

+ *

Company: tp23

+ * @todo change absolute to Border layout and panels + * @author Paul Hinds + * @version $Id: ProgressPageRenderer.java,v 1.4 2006/12/21 00:03:00 teknopaul Exp $ + */ +public class ProgressPageRenderer + extends SwingPageRenderer + implements AntOutputRenderer { + + private static final ResourceBundle res = ResourceBundle.getBundle("org.tp23.antinstaller.renderer.Res"); + private static final int MESSAGE_PANEL_HEIGHT = 30; + + private JPanel contentPanel = new JPanel(); + + private JTabbedPane jTabbedPane = new JTabbedPane(); + private JPanel messagesPanel = new JPanel(); + private BorderLayout borderLayout1 = new BorderLayout(); + private JToggleButton jToggleButton = new JToggleButton(); + private JLabel feedBackLabel = new JLabel(); + + private SystemOutJTextArea outPanel = new SystemOutJTextArea(); + private SystemOutJTextArea errPanel = new SystemOutJTextArea(); + + private boolean showTargets = true; + private JScrollPane progressScrollPane = new JScrollPane();; + private ProgressPanel progressPanel; + + public ProgressPageRenderer() { + errPanel.setAsSystemErr(); + outPanel.setAsSystemOut(); + } + /** + * getErr + * @return PrintStream + */ + public PrintStream getErr() { + return errPanel.getOut(); + } + /** + * getOut + * @return PrintStream + */ + public PrintStream getOut() { + return outPanel.getOut(); + } + + + /** + * instanceInit + */ + public void instanceInit() { + showTargets = ((ProgressPage)page).isShowTargets(); + contentPanel.setLayout(borderLayout1); + this.add(contentPanel,BorderLayout.CENTER); + + //progressScrollPane.setVerticalScrollBarPolicy(JScrollPane.VERTICAL_SCROLLBAR_ALWAYS); + + messagesPanel.setLayout(null); + Dimension messPanelSize = new Dimension(SizeConstants.PAGE_WIDTH,MESSAGE_PANEL_HEIGHT); + messagesPanel.setSize(messPanelSize); + messagesPanel.setPreferredSize(messPanelSize); + messagesPanel.setMaximumSize(messPanelSize); + messagesPanel.setMinimumSize(messPanelSize); + + //FIXME not i18n properly since the sentence is not correct ordering in German + feedBackLabel.setText(res.getString("click")+" "+ctx.getInstaller().getFinishButtonText()+" "+res.getString("toContinue")); + feedBackLabel.setBounds(new Rectangle(115, 7, 272, 22)); + jToggleButton.setText(res.getString("showDetails")); + jToggleButton.setBounds(new Rectangle(5, 7, 104, 22)); + jToggleButton.setMargin(new Insets(0,0,0,0)); + messagesPanel.add(jToggleButton, null); + messagesPanel.add(feedBackLabel, null); + jToggleButton.addActionListener(new ActionListener(){ + public void actionPerformed(ActionEvent e) { + if(jToggleButton.isSelected()){ + if(showTargets){ + contentPanel.remove(progressScrollPane); + } + contentPanel.add(jTabbedPane, BorderLayout.CENTER); + contentPanel.doLayout(); + contentPanel.repaint(); + } + else { + contentPanel.remove(jTabbedPane); + if(showTargets){ + contentPanel.add(progressScrollPane, BorderLayout.CENTER); + progressScrollPane.revalidate(); + } + contentPanel.doLayout(); + contentPanel.repaint(); + } + } + }); + jToggleButton.setIcon(getImage("/resources/icons/showdetails.png")); + contentPanel.add(messagesPanel, BorderLayout.NORTH); + + if(showTargets){ + progressScrollPane.setBorder(BorderFactory.createEmptyBorder(10,5,5,5)); + contentPanel.add(progressScrollPane, BorderLayout.CENTER); + } + jTabbedPane.add(res.getString("output"), outPanel); + jTabbedPane.add(res.getString("errors"), errPanel); +// if(OutputField.isTrue( ctx.getInstaller().getAntialiased())){ +// outPanel.setAntialiased(true); +// errPanel.setAntialiased(true); +// } + + //jTabbedPane.setVisible(false); + jTabbedPane.setBorder(BorderFactory.createEmptyBorder(5,5,5,5)); + contentPanel.setMaximumSize(new Dimension(SizeConstants.PAGE_WIDTH, Integer.MAX_VALUE)); + contentPanel.setMinimumSize(new Dimension(SizeConstants.PAGE_WIDTH, 100)); + contentPanel.setPreferredSize(new Dimension(SizeConstants.PAGE_WIDTH, SizeConstants.PAGE_HEIGHT-100)); + //contentPanel.add(jTabbedPane, null); + //jTabbedPane.setBounds(new Rectangle(4, MESSAGE_PANEL_HEIGHT, PAGE_WIDTH-12, 214)); + + this.getNextButton().setEnabled(false); + this.getFinishButton().setText(ctx.getInstaller().getFinishButtonText()); + this.getFinishButton().setEnabled(true); + } + + public void setContext(SwingInstallerContext swingCtx){ + super.setContext(swingCtx); + if(showTargets){ + progressPanel = new ProgressPanel(swingCtx.getInstallerContext()); + progressScrollPane.getViewport().add(progressPanel); + this.swingCtx.setProgressPanel(progressPanel); + } + this.swingCtx.setFeedBackLabel(feedBackLabel); + } + + + /** + * updateInputFields + */ + public void updateInputFields() { + + } + + + + /** + * validateFields + * + * @return boolean + */ + public boolean validateFields() { + return true; + } + + + + /** + * updateDefaultValues + */ + public void updateDefaultValues() { + } +} Property changes on: pal-portal/modules/ant-installer/trunk/src/org/tp23/antinstaller/renderer/swing/ProgressPageRenderer.java ___________________________________________________________________ Name: svn:eol-style + native Added: pal-portal/modules/ant-installer/trunk/src/org/tp23/antinstaller/renderer/swing/ProgressPanel.java =================================================================== --- pal-portal/modules/ant-installer/trunk/src/org/tp23/antinstaller/renderer/swing/ProgressPanel.java (rev 0) +++ pal-portal/modules/ant-installer/trunk/src/org/tp23/antinstaller/renderer/swing/ProgressPanel.java 2008-06-11 13:36:41 UTC (rev 975) @@ -0,0 +1,279 @@ +/* + * Copyright 2005 Paul Hinds + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +package org.tp23.antinstaller.renderer.swing; + +import java.awt.Color; +import java.awt.Dimension; +import java.awt.Font; +import java.awt.Graphics; +import java.awt.Graphics2D; +import java.awt.Rectangle; +import java.awt.RenderingHints; +import java.util.ArrayList; +import java.util.Iterator; +import java.util.List; + +import javax.swing.JPanel; +import javax.swing.Scrollable; + +import org.apache.tools.ant.BuildEvent; +import org.apache.tools.ant.Target; +import org.tp23.antinstaller.InstallerContext; + + +/** + * Progress panel prints a graphical view of the progress of the Ant targets + * being run. It supports displaying one layer of dependent targets. + * @author Paul Hinds + * @version $Id: ProgressPanel.java,v 1.5 2006/12/21 00:02:59 teknopaul Exp $ + */ +public class ProgressPanel extends JPanel implements Scrollable{ + + public static final int tHeight = 19; + public static final int leftIndent = 15; + public static final int DONE = 0; + public static final int INPROGRESS = 1; + public static final int TODO = 2; + private static final Color progressColor = new Color(0, 125, 0); + private static final Font mainFont = new Font("Dialog", Font.PLAIN, 11); + private static final Font subFont = new Font("Dialog", Font.PLAIN, 10); + List targets = null; + + private final InstallerContext ctx; + private int mainTargetPos = 0; + private ProgressModel currentPM = null; + + public ProgressPanel(InstallerContext ctx) { + super(true); + this.ctx = ctx; + } + + public synchronized void prepareCalledTargets(){ + List targetStrings = ctx.getInstaller().getTargets(ctx); + Iterator iter = targetStrings.iterator(); + targets = new ArrayList(); + while (iter.hasNext()) { + String tgt = (String) iter.next(); + targets.add(new ProgressModel(tgt)); + } + this.setSize(getSize());// panel size changes + revalidate(); + repaint(); + } + /** + * This method assumes that we are send target started methods in order + * but that we do not have the information about "depends" targets and have to + * insert the information as it arrives. If a TargetStarted event arrives that + * is not the expected target is is assumed to be a depends. + * @param buildEvent + */ + public synchronized void targetStarted(BuildEvent buildEvent){ + try { + Target tgt = buildEvent.getTarget(); + ProgressModel pm = (ProgressModel)targets.get(mainTargetPos); + pm.state = INPROGRESS; + if(tgt.getName().equals(pm.name)){ + // main target + currentPM = pm; + mainTargetPos++; + revalidate(); + repaint(); + } + else { + //dependency + ProgressModel dependency = new ProgressModel(tgt.getName()); + dependency.state = INPROGRESS; + if(currentPM != null){ + currentPM.state = DONE;// this to catch antcall strangenesses + } + currentPM = dependency; + pm.subTargets.add(dependency); + this.setSize(getSize());// panel size changes + revalidate(); + repaint(); + } + } + catch (Exception e) { + ctx.log(e); + } + } + public synchronized void targetFinished() { + // BUG 1494105 reports NPE here, looks like no targets specified in his antinstaller-config.xml + currentPM.state = DONE; + } + + /** + * N.B. buildFinished must be fired manually in Ant + */ + public synchronized void buildFinished() { + // this is done because antcall sometimes results in targetFinished not being called + setToDone(targets); + repaint(); + } + + private void setToDone(List pModels){ + if(pModels == null || pModels.size() == 0){ + return; + } + Iterator iter = pModels.iterator(); + while (iter.hasNext()) { + ProgressModel pm = (ProgressModel)iter.next(); + pm.state = DONE; + setToDone(pm.subTargets); + } + } + /** + */ + public synchronized void paintComponent(Graphics g){ + super.paintComponent(g); + if(targets == null){ + return; + } +// g.setColor(getBackground()); +// g.fillRect(g.getClipBounds().x, +// g.getClipBounds().y, +// g.getClipBounds().width, +// g.getClipBounds().height); + Iterator iter = targets.iterator(); + int offset = 0; + for(int i = 1; iter.hasNext(); i++){ + ProgressModel pmodel = (ProgressModel)iter.next(); + drawTarget(pmodel, (Graphics2D)g, offset, i < targets.size(), i > 1); + offset += tHeight; + offset += pmodel.subTargets.size() * tHeight; + } + } + + public synchronized Dimension getPreferredSize(){ + return getSize(); + } + /** + * @see java.awt.Component#getSize() + */ + public synchronized Dimension getSize() { + if(targets == null){ + return new Dimension(SizeConstants.PAGE_WIDTH, tHeight * 5); + } + int count = targets.size(); + Iterator iter = targets.iterator(); + while(iter.hasNext()){ + ProgressModel pmodel = (ProgressModel)iter.next(); + count += pmodel.subTargets.size(); + } + return new Dimension(SizeConstants.PAGE_WIDTH, count * tHeight); + } + /** + * + * @param target the main target to be rendered + * @param g + * @param yOffset the vertical offset where this target should be drawn + * @param hasMore if false this target is the last in the list + * @param hasPrev if false this target is the first in the list + */ + private void drawTarget(ProgressModel target, Graphics2D g, + int yOffset, boolean hasMore, boolean hasPrev){ + g.setFont(mainFont); + g.setRenderingHint(RenderingHints.KEY_ANTIALIASING, RenderingHints.VALUE_ANTIALIAS_ON); + g.setColor(Color.gray); + //7 vertical line (up) + if(hasPrev){ + g.drawLine(leftIndent + 8, yOffset, leftIndent + 8, yOffset + 8); + } + //7 vertical line (down) + if(hasMore || target.subTargets.size() > 0){ + g.drawLine(leftIndent + 8, (tHeight/2) + yOffset, + leftIndent + 8, tHeight + yOffset); + } + // sideways line + int xOffset = 0; + g.drawLine(leftIndent + 8, 8 + yOffset, leftIndent + xOffset + 20, 8 + yOffset); + if(target.state == DONE){ + g.setColor(Color.darkGray); + } + if(target.state == INPROGRESS){ + g.setColor(progressColor); + } + if(target.state == TODO){ + g.setColor(Color.gray); + } + g.fillRoundRect(leftIndent + xOffset + 3, yOffset + 4, 11, 9, 7, 7); + g.setColor(Color.black); + g.drawString(target.name, leftIndent + xOffset + 22, 13 + yOffset); + if(target.subTargets.size() > 0){ + Iterator iter = target.subTargets.iterator(); + for(int i = 1; iter.hasNext(); i++){ + drawSubTarget((ProgressModel)iter.next(), g, + yOffset += tHeight, hasMore | i < target.subTargets.size()); + } + } + } + private void drawSubTarget(ProgressModel target, Graphics2D g, + int yOffset, boolean hasMore){ + g.setFont(subFont); + g.setRenderingHint(RenderingHints.KEY_ANTIALIASING, RenderingHints.VALUE_ANTIALIAS_ON); + g.setColor(Color.gray); + //7 vertical line (up) + g.drawLine(leftIndent + 8, yOffset, leftIndent + 8, yOffset + 8); + //7 vertical line (down) + if(hasMore){ + g.drawLine(leftIndent + 8, (tHeight/2) + yOffset, leftIndent + 8, tHeight + yOffset); + } + int xOffset = 15; + // sideways line + g.drawLine(leftIndent + 8, 8 + yOffset, leftIndent + xOffset + 4, 8 + yOffset); + if(target.state == DONE){ + g.setColor(Color.darkGray); + } + if(target.state == INPROGRESS){ + g.setColor(progressColor); + } + if(target.state == TODO){ + g.setColor(Color.gray); + } + g.fillRoundRect(leftIndent + xOffset + 4, yOffset + 5, 9, 7, 7, 7); + g.setColor(Color.black); + g.drawString(target.name, leftIndent + xOffset + 15, 12 + yOffset); + } + + public synchronized Dimension getPreferredScrollableViewportSize(){ + return getPreferredSize(); + } + public synchronized int getScrollableUnitIncrement(Rectangle visibleRect, int orientation, int direction){ + return tHeight; + } + public synchronized int getScrollableBlockIncrement(Rectangle visibleRect, int orientation, int direction){ + return tHeight * 3; + } + public synchronized boolean getScrollableTracksViewportWidth(){ + return true; + } + public synchronized boolean getScrollableTracksViewportHeight(){ + return false; + } + public static class ProgressModel{ + int state = TODO; + String name; + List subTargets = new ArrayList(); + + public ProgressModel(String name){ + this.name = name; + } + + int getHeight(){ + return tHeight + subTargets.size() * tHeight; + } + } +} Property changes on: pal-portal/modules/ant-installer/trunk/src/org/tp23/antinstaller/renderer/swing/ProgressPanel.java ___________________________________________________________________ Name: svn:eol-style + native Added: pal-portal/modules/ant-installer/trunk/src/org/tp23/antinstaller/renderer/swing/SelectInputRenderer.java =================================================================== --- pal-portal/modules/ant-installer/trunk/src/org/tp23/antinstaller/renderer/swing/SelectInputRenderer.java (rev 0) +++ pal-portal/modules/ant-installer/trunk/src/org/tp23/antinstaller/renderer/swing/SelectInputRenderer.java 2008-06-11 13:36:41 UTC (rev 975) @@ -0,0 +1,138 @@ +/* + * Copyright 2005 Paul Hinds + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +package org.tp23.antinstaller.renderer.swing; + +import java.awt.event.ItemEvent; +import java.awt.event.ItemListener; +import java.util.Enumeration; +import java.util.ResourceBundle; + +import javax.swing.ButtonGroup; +import javax.swing.JLabel; +import javax.swing.JPanel; +import javax.swing.JRadioButton; + +import org.tp23.antinstaller.input.OutputField; +import org.tp23.antinstaller.input.SelectInput; +import org.tp23.gui.GBCF; + +public class SelectInputRenderer + extends SwingOutputFieldRenderer { + + private static final ResourceBundle res = ResourceBundle.getBundle("org.tp23.antinstaller.renderer.Res"); + + protected SelectInput inputField; + + protected JLabel fieldLabel = new AILabel(); + protected ButtonGroup optionGroup = new ButtonGroup(); + + public SelectInputRenderer() { + } + public void initComponent(JPanel parent){ + try { + jbInit(); + } + catch(Exception e) { + ctx.log(e.getMessage()); + if(ctx.getInstaller().isVerbose()) { + ctx.log(e); + } + } + } + + + + public void setOutputField(OutputField inputField) { + this.inputField = (SelectInput)inputField; + } + public void updateInputField(){ + Enumeration enumumeration = optionGroup.getElements(); + int i = 0; + for(; enumumeration.hasMoreElements(); i++){ + JRadioButton o = (JRadioButton)enumumeration.nextElement(); + if(o.isSelected()) { + inputField.setValue(inputField.getOptions()[i].value); + break; + } + } + if(i > inputField.getOptions().length) { + inputField.setValue(inputField.getDefaultValue()); + } + } + public void updateDefaultValue() { + if(!inputField.isEditted()) { + String newDefault = inputField.getDefaultValue(); + Enumeration enumeration = optionGroup.getElements(); + for(int i = 0; enumeration.hasMoreElements(); i++){ + if(newDefault.equals(inputField.getOptions()[i].value)) { + JRadioButton jrb = (JRadioButton) enumeration.nextElement(); + jrb.setSelected(true); + // @todo should break? + } else { + enumeration.nextElement(); + } + } + } + } + + private void jbInit() throws Exception { + fieldLabel.setText(inputField.getDisplayText()); + SelectInput.Option[] options = inputField.getOptions(); + + for (int i = 0; i < options.length; i++) { + JRadioButton jrb = new AIRadioButton(options[i].getText()); + optionGroup.add(jrb); + if(options[i].value.equals(inputField.getDefaultValue())){ + jrb.setSelected(true); + } + jrb.addItemListener(new ItemListener(){ + public void itemStateChanged(ItemEvent e) { + inputField.setEditted(true); + } + }); + } + } + public int addSelf(JPanel content,GBCF cf, int row,boolean overflow) { + content.add(fieldLabel,cf.getCell(row, 0)); + Enumeration enumeration = optionGroup.getElements(); + // there should be at least two + enumeration.hasMoreElements(); + AIRadioButton jrb = (AIRadioButton)enumeration.nextElement(); + content.add(jrb,cf.getCell(row++, 1)); + if(overflow) { + jrb.setOverflow(SizeConstants.OVERFLOW_FIELD_SIZE); + } + JPanel empty = new JPanel(); + while(enumeration.hasMoreElements()){ + jrb = (AIRadioButton)enumeration.nextElement(); + content.add(empty,cf.getCell(row, 0)); + content.add(jrb,cf.getCell(row++, 1)); + if(overflow) { + jrb.setOverflow(SizeConstants.OVERFLOW_FIELD_SIZE); + } + } + return row; + } + + /** + * renderError + */ + public void renderError() { + ctx.getMessageRenderer().printMessage(res.getString("notValidSelection")); + // fixed BUG:1295944 ctx.getMessageRenderer().printMessage("Not a valid selection"); + //optionGroup.requestFocus(); + } +} Property changes on: pal-portal/modules/ant-installer/trunk/src/org/tp23/antinstaller/renderer/swing/SelectInputRenderer.java ___________________________________________________________________ Name: svn:eol-style + native Added: pal-portal/modules/ant-installer/trunk/src/org/tp23/antinstaller/renderer/swing/SimpleInputPageRenderer.java =================================================================== --- pal-portal/modules/ant-installer/trunk/src/org/tp23/antinstaller/renderer/swing/SimpleInputPageRenderer.java (rev 0) +++ pal-portal/modules/ant-installer/trunk/src/org/tp23/antinstaller/renderer/swing/SimpleInputPageRenderer.java 2008-06-11 13:36:41 UTC (rev 975) @@ -0,0 +1,170 @@ +/* + * Copyright 2005 Paul Hinds + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +package org.tp23.antinstaller.renderer.swing; + +import java.awt.BorderLayout; +import java.awt.Color; +import java.awt.Dimension; +import java.awt.Font; +import java.awt.GridBagLayout; +import java.awt.Insets; +import java.util.ArrayList; + +import javax.swing.BorderFactory; +import javax.swing.JLabel; +import javax.swing.JPanel; +import javax.swing.JScrollPane; +import javax.swing.JTextArea; + +import org.tp23.antinstaller.ValidationException; +import org.tp23.antinstaller.input.CommentOutput; +import org.tp23.antinstaller.input.OutputField; +import org.tp23.antinstaller.page.SimpleInputPage; +import org.tp23.antinstaller.renderer.RendererFactory; +import org.tp23.gui.GBCF; + +/** + * + *

This PageRenderer just renders a list of SwingInputRenderers using +* a BoxLayout

+ *

+ *

Copyright: Copyright (c) 2004

+ *

Company: tp23

+ * @author Paul Hinds + * @version $Id: SimpleInputPageRenderer.java,v 1.6 2006/12/27 21:46:35 teknopaul Exp $ + */ +public class SimpleInputPageRenderer + extends SwingPageRenderer { + + //Prevent displayText and explanatoryText being rendered using different fonts + private static final Font defaultFont = new JLabel().getFont(); + + private JPanel contentPanel = new JPanel(); + + private GridBagLayout gridLayout = new GridBagLayout(); + private GBCF cf = new GBCF(); // GridBagConstraintsFactory + private boolean overflow = false; + // used in overflow + JScrollPane scroller = null; + + + private ArrayList renderers = new ArrayList(); + + public SimpleInputPageRenderer(){ + } + + public boolean validateFields() throws ValidationException { + OutputField[] fields = page.getOutputField(); + for (int i = 0; i < fields.length; i++) { + if(!fields[i].validate(ctx)){ + SwingOutputFieldRenderer renderer = (SwingOutputFieldRenderer)renderers.get(i); + renderer.renderError(); + return false; + } + } + return true; + } + public void updateInputFields(){ + for (int i = 0; i < renderers.size(); i++) { + ((SwingOutputFieldRenderer)renderers.get(i)).updateInputField(); + } + } + + public void updateDefaultValues(){ + for (int i = 0; i < renderers.size(); i++) { + ((SwingOutputFieldRenderer)renderers.get(i)).updateDefaultValue(); + } + } + + public void instanceInit() throws Exception { + overflow = ((SimpleInputPage)page).isOverflow(); + if(overflow){ + //WARNING this causes flickering in the UI + contentPanel.setMaximumSize(new Dimension(SizeConstants.PAGE_WIDTH - 50, SizeConstants.PAGE_HEIGHT)); + scroller = new JScrollPane(); + scroller.setHorizontalScrollBarPolicy(JScrollPane.HORIZONTAL_SCROLLBAR_AS_NEEDED); + scroller.setVerticalScrollBarPolicy(JScrollPane.VERTICAL_SCROLLBAR_AS_NEEDED); + scroller.setBorder(BorderFactory.createCompoundBorder( + BorderFactory.createEmptyBorder(4,4,4,4), + BorderFactory.createEtchedBorder() + )); + add(scroller, BorderLayout.CENTER); + scroller.getViewport().add(contentPanel); + //contentPanel.setBackground(Color.red); + } + else { + this.add(contentPanel, BorderLayout.CENTER); + contentPanel.setBorder(BorderFactory.createEmptyBorder(SizeConstants.TOP_INDENT, 4, 4, 4)); + } + + OutputField[] fields = page.getOutputField(); + contentPanel.setDoubleBuffered(true); + contentPanel.setLayout(gridLayout); + int row = 0; + for (int i = 0; i < fields.length; i++) { + SwingOutputFieldRenderer renderer = RendererFactory.getSwingRenderer(fields[i]); + String text = fields[i].getExplanatoryText(); + if(fields[i].getExplanatoryText() != null){ + JTextArea area = new DisplayTextArea(contentPanel.getBackground(), contentPanel.getForeground()); + area.setIgnoreRepaint(true); + area.setFont( defaultFont ); + area.setText(text); + contentPanel.add(area, cf.getSpan(row++)); + if(fields[i] instanceof CommentOutput){ + CommentOutputRenderer crenderer = (CommentOutputRenderer)renderer; + crenderer.setExplanatoryTextField(area); + if(fields[i].getDisplayText() == null){ + continue; + } + } + } + renderer.setOutputField(fields[i]); + renderer.setInstallerContext(ctx); + renderer.initComponent(contentPanel); + row = renderer.addSelf(contentPanel, cf, row, overflow); + renderers.add(renderer); + } + contentPanel.add(new JPanel(), cf.getVertGlue(row++)); + } +} +/** + * A JTextArea that is not editable and looks like a JLabel but uses + * JTextAreas ability to wrap. Also has a fixed prefered width; + * @author Paul Hinds + * @version $Id: SimpleInputPageRenderer.java,v 1.6 2006/12/27 21:46:35 teknopaul Exp $ + */ +class DisplayTextArea extends JTextArea{ + DisplayTextArea(Color back, Color fore){ + super(); + this.setBackground(back); + this.setForeground(fore); + this.setLineWrap(true); + this.setWrapStyleWord(true); + this.setEditable(false); + this.setSelectionColor(back); + this.setSelectionColor(back); + this.setMargin(new Insets(5,0,0,0)); + } + + public Dimension getPreferredSize(){ + Dimension pref = super.getPreferredSize(); + return new Dimension(SizeConstants.PAGE_WIDTH - 40, pref.height); + } + public Dimension getMinimumSize(){ + Dimension pref = super.getMinimumSize(); + return new Dimension(SizeConstants.PAGE_WIDTH - 40, pref.height); + } +} Property changes on: pal-portal/modules/ant-installer/trunk/src/org/tp23/antinstaller/renderer/swing/SimpleInputPageRenderer.java ___________________________________________________________________ Name: svn:eol-style + native Added: pal-portal/modules/ant-installer/trunk/src/org/tp23/antinstaller/renderer/swing/SizeConstants.java =================================================================== --- pal-portal/modules/ant-installer/trunk/src/org/tp23/antinstaller/renderer/swing/SizeConstants.java (rev 0) +++ pal-portal/modules/ant-installer/trunk/src/org/tp23/antinstaller/renderer/swing/SizeConstants.java 2008-06-11 13:36:41 UTC (rev 975) @@ -0,0 +1,48 @@ +/* + * Copyright 2005 Paul Hinds + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +package org.tp23.antinstaller.renderer.swing; + +import java.awt.Dimension; +/** + * Extracted contants with aim of making these variables configurable + * @author teknopaul + */ +public class SizeConstants { + + // Page size constants + public static int PAGE_WIDTH = 472; // orig value 472 + public static int PAGE_HEIGHT = 400;// orig value 400 + public static int LABEL_WIDTH = 175;// orig value 175 + + public static int TITLE_IMAGE_HEIGHT = 100; + public static int TITLE_PANEL_HEIGHT = 75; // suspect this is irrelevant + + // Field size constants + public static int LEFT_INDENT = 15; + public static int TOP_INDENT = 8; + public static int BUTTON_WIDTH = 90; // file and directory chooser + public static int FIELD_HEIGHT = 20;// field Y + public static int FIELD_WIDTH = SizeConstants.PAGE_WIDTH - SizeConstants.LABEL_WIDTH - SizeConstants.LEFT_INDENT; + public static int SHORT_FIELD_WIDTH = FIELD_WIDTH - SizeConstants.BUTTON_WIDTH; + // overflow resizing + // in the gridbaglayout is seems that only preferred size + // is significant + private static int OVERFLOW_REDUCTION = 40; + public static Dimension OVERFLOW_FIELD_SIZE = new Dimension(FIELD_WIDTH - OVERFLOW_REDUCTION, FIELD_HEIGHT); + public static Dimension OVERFLOW_SHORT_FIELD_SIZE = new Dimension(FIELD_WIDTH - SizeConstants.BUTTON_WIDTH - OVERFLOW_REDUCTION, FIELD_HEIGHT); + public static Dimension OVERFLOW_TOTAL_SIZE = new Dimension(FIELD_WIDTH + SizeConstants.LABEL_WIDTH - OVERFLOW_REDUCTION, FIELD_HEIGHT); + +} Property changes on: pal-portal/modules/ant-installer/trunk/src/org/tp23/antinstaller/renderer/swing/SizeConstants.java ___________________________________________________________________ Name: svn:eol-style + native Added: pal-portal/modules/ant-installer/trunk/src/org/tp23/antinstaller/renderer/swing/SplashPageRenderer.java =================================================================== --- pal-portal/modules/ant-installer/trunk/src/org/tp23/antinstaller/renderer/swing/SplashPageRenderer.java (rev 0) +++ pal-portal/modules/ant-installer/trunk/src/org/tp23/antinstaller/renderer/swing/SplashPageRenderer.java 2008-06-11 13:36:41 UTC (rev 975) @@ -0,0 +1,72 @@ +/* + * Copyright 2005 Paul Hinds + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +package org.tp23.antinstaller.renderer.swing; + +import java.awt.BorderLayout; +import java.io.ByteArrayOutputStream; +import java.io.InputStream; + +import javax.swing.ImageIcon; +import javax.swing.JLabel; + +import org.tp23.antinstaller.ValidationException; +import org.tp23.antinstaller.page.SplashPage; +import org.tp23.antinstaller.runtime.ConfigurationException; +/** + * A page containing only a single image. + * + * @author teknopaul + */ +public class SplashPageRenderer extends SwingPageRenderer{ + + private JLabel imagePanel = new JLabel(); + + public SplashPageRenderer() { + } + public boolean validateFields()throws ValidationException{ + return true; + } + + public void instanceInit() throws Exception { + String resource = ((SplashPage)page).getSplashResource(); + ByteArrayOutputStream baos = new ByteArrayOutputStream(); + InputStream in = this.getClass().getResourceAsStream(resource); + if(in == null) { + throw new ConfigurationException("Splash page resource is missing: " + resource); + } + byte[] buffer = new byte[2048]; + int read = -1; + while ( (read = in.read(buffer)) != -1) { + baos.write(buffer, 0, read); + } + ImageIcon icon = new ImageIcon(baos.toByteArray()); + imagePanel.setHorizontalAlignment(JLabel.CENTER); + imagePanel.setIcon(icon); + this.add(imagePanel, BorderLayout.CENTER); + } + + public void updateInputFields(){ + ; + } + + + + /** + * updateDefaultValues + */ + public void updateDefaultValues() { + } +} Property changes on: pal-portal/modules/ant-installer/trunk/src/org/tp23/antinstaller/renderer/swing/SplashPageRenderer.java ___________________________________________________________________ Name: svn:eol-style + native Added: pal-portal/modules/ant-installer/trunk/src/org/tp23/antinstaller/renderer/swing/SwingInstallerContext.java =================================================================== --- pal-portal/modules/ant-installer/trunk/src/org/tp23/antinstaller/renderer/swing/SwingInstallerContext.java (rev 0) +++ pal-portal/modules/ant-installer/trunk/src/org/tp23/antinstaller/renderer/swing/SwingInstallerContext.java 2008-06-11 13:36:41 UTC (rev 975) @@ -0,0 +1,149 @@ +/* + * Copyright 2005 Paul Hinds + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +package org.tp23.antinstaller.renderer.swing; + +import javax.swing.JFrame; +import javax.swing.JLabel; +import javax.swing.SwingUtilities; + +import org.apache.tools.ant.BuildEvent; +import org.tp23.antinstaller.InstallerContext; +import org.tp23.antinstaller.runtime.SwingRunner; + +public class SwingInstallerContext{ + + private static JFrame masterFrame; + private JLabel feedBackPanel; + private ProgressPanel progressPanel; + private InstallerContext ctx; + + public SwingInstallerContext(InstallerContext ctx, + JFrame masterFrame) { + this.ctx = ctx; + SwingInstallerContext.masterFrame = masterFrame; + } + + public JFrame getMasterFrame() { + return masterFrame; + } + public SwingRunner getSwingRunner() { + return (SwingRunner)ctx.getRunner(); + } + + public void setFeedBackLabel(JLabel feedBackPanel) { + this.feedBackPanel = feedBackPanel; + } + /** + * The progress panel is optional so not calling this method + * should not cause errors or NPEs + * @param progressPanel + */ + public void setProgressPanel(ProgressPanel progressPanel) { + this.progressPanel = progressPanel; + } + + public void buildStarted(BuildEvent buildEvent) { + provideAntFeedBack(buildEvent.getMessage()); + try { + SwingUtilities.invokeAndWait(new Runnable(){ + public void run(){ + if(SwingInstallerContext.this.progressPanel != null){ + SwingInstallerContext.this.progressPanel.prepareCalledTargets(); + } + } + }); + } catch (Exception e) { //Interrupted or InvocationTarget + SwingInstallerContext.this.ctx.log(e); + } + } + + public void buildFinished(BuildEvent buildEvent) { + if(this.progressPanel != null){ + try { + SwingUtilities.invokeLater(new Runnable(){ + public void run(){ + SwingInstallerContext.this.progressPanel.buildFinished(); + } + }); + } catch (Exception e) { //Interrupted or InvocationTarget + SwingInstallerContext.this.ctx.log(e); + } + } + } + + public void targetStarted(BuildEvent buildEvent) { + TargetStarted targetStarted = new TargetStarted(); + targetStarted.buildEvent = buildEvent; + try { + if(this.progressPanel != null){ + //Invoke and wait used since strict ordering od started and finished is requried + SwingUtilities.invokeAndWait(targetStarted); + } + } catch (Exception e) { //Interrupted or InvocationTarget + SwingInstallerContext.this.ctx.log(e); + } + } + + public void targetFinished(BuildEvent buildEvent) { + try { + //Invoke and wait used since strict ordering od started and finished is requried + SwingUtilities.invokeAndWait(new Runnable(){ + public void run(){ + if(SwingInstallerContext.this.progressPanel != null){ + SwingInstallerContext.this.progressPanel.targetFinished(); + } + } + }); + } catch (Exception e) { //Interrupted or InvocationTarget + SwingInstallerContext.this.ctx.log(e); + } + } + + public void provideAntFeedBack(String message){ + // We should never have Ant running without a ProgressPane + // but do an if null here in case future FilterChains are different + ProvideAntFeedBack provideAntFeedBack = new ProvideAntFeedBack(); + provideAntFeedBack.message = message; + try { + if(feedBackPanel != null){ + SwingUtilities.invokeLater(provideAntFeedBack); + } + } catch (Exception e) { //Interrupted or InvocationTarget + SwingInstallerContext.this.ctx.log(e); + } + } + + + /** + * @return Returns the ctx. + */ + public InstallerContext getInstallerContext() { + return ctx; + } + + private class TargetStarted implements Runnable{ + private BuildEvent buildEvent; + public void run(){ + SwingInstallerContext.this.progressPanel.targetStarted(buildEvent); + } + } + private class ProvideAntFeedBack implements Runnable{ + private String message; + public void run(){ + SwingInstallerContext.this.feedBackPanel.setText(message); + } + } +} Property changes on: pal-portal/modules/ant-installer/trunk/src/org/tp23/antinstaller/renderer/swing/SwingInstallerContext.java ___________________________________________________________________ Name: svn:eol-style + native Added: pal-portal/modules/ant-installer/trunk/src/org/tp23/antinstaller/renderer/swing/SwingMessageRenderer.java =================================================================== --- pal-portal/modules/ant-installer/trunk/src/org/tp23/antinstaller/renderer/swing/SwingMessageRenderer.java (rev 0) +++ pal-portal/modules/ant-installer/trunk/src/org/tp23/antinstaller/renderer/swing/SwingMessageRenderer.java 2008-06-11 13:36:41 UTC (rev 975) @@ -0,0 +1,113 @@ +/* + * Copyright 2005 Paul Hinds + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +package org.tp23.antinstaller.renderer.swing; + +import javax.swing.JFrame; +import javax.swing.JOptionPane; +import javax.swing.SwingUtilities; + +import org.tp23.antinstaller.InstallerContext; +import org.tp23.antinstaller.renderer.MessageRenderer; +/** + * + *

Render User messages in Popup windows

+ *

+ *

Copyright: Copyright (c) 2004

+ *

Company: tp23

+ * @author Paul Hinds + * @version $Id: SwingMessageRenderer.java,v 1.4 2006/12/21 00:02:59 teknopaul Exp $ + */ +public class SwingMessageRenderer + implements MessageRenderer { + + private InstallerContext ctx = null; + private JFrame owner = null; + + + public SwingMessageRenderer() { + } + public SwingMessageRenderer(InstallerContext ctx) { + this.ctx = ctx; + } + + public void setInstallerContext(InstallerContext ctx){ + this.ctx = ctx; + } + public void printMessage(String message){ + MessageRunnable messageRunnable = new MessageRunnable(); + messageRunnable.message = message; + if(SwingUtilities.isEventDispatchThread()){ + messageRunnable.run(); + } + else{ + try { + SwingUtilities.invokeAndWait(messageRunnable); + } catch (Exception e) { // Interrupted or InvocationTarget + ctx.log(e); + } + } + } + + public boolean prompt(String message){ + OptionRunnable optionRunnable = new OptionRunnable(); + optionRunnable.message = message; + if(SwingUtilities.isEventDispatchThread()){ + optionRunnable.run(); + } + else{ + try { + SwingUtilities.invokeAndWait(optionRunnable); + } catch (Exception e) { // Interrupted or InvocationTarget + ctx.log(e); + } + } + return optionRunnable.ok; + } + /** + * @param owner The owner to set. + */ + public void setOwner(JFrame owner) { + this.owner = owner; + } + + private class MessageRunnable implements Runnable{ + String message; + + public void run() { + JOptionPane.showMessageDialog(SwingMessageRenderer.this.owner, + message, "Message", JOptionPane.INFORMATION_MESSAGE ); + } + + } + + private class OptionRunnable implements Runnable{ + String message; + boolean ok; + public void run() { + int ret = JOptionPane.showConfirmDialog(SwingMessageRenderer.this.owner, + message, + "Question", + JOptionPane.YES_NO_OPTION); + if (ret == JOptionPane.YES_OPTION) { + ok = true; + } + else { + ok = false; + } + } + + } +} Property changes on: pal-portal/modules/ant-installer/trunk/src/org/tp23/antinstaller/renderer/swing/SwingMessageRenderer.java ___________________________________________________________________ Name: svn:eol-style + native Added: pal-portal/modules/ant-installer/trunk/src/org/tp23/antinstaller/renderer/swing/SwingOutputFieldRenderer.java =================================================================== --- pal-portal/modules/ant-installer/trunk/src/org/tp23/antinstaller/renderer/swing/SwingOutputFieldRenderer.java (rev 0) +++ pal-portal/modules/ant-installer/trunk/src/org/tp23/antinstaller/renderer/swing/SwingOutputFieldRenderer.java 2008-06-11 13:36:41 UTC (rev 975) @@ -0,0 +1,86 @@ +/* + * Copyright 2005 Paul Hinds + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +package org.tp23.antinstaller.renderer.swing; + +import javax.swing.JPanel; + +import org.tp23.antinstaller.InstallerContext; +import org.tp23.antinstaller.input.OutputField; +import org.tp23.gui.GBCF; +/** + * + *

Instances of this interface should have a no args constructor. +* They sould +* be Swing JComponent (e.g. subclass JPanel) and render normally responding +* to update paint and requests to change Look & Feel in a normal way.

+ *

Instances of this class should follow the naming convention. for each OutputField +* Xxx in the package org.tp23.antinstaller.input there should exist a SwingOutputFieldRenderer +* called org.tp23.antinstaller.renderer.swing.XxxRenderer

+ *

Copyright: Copyright (c) 2004

+ *

Company: tp23

+ * @author Paul Hinds + * @version $Id: SwingOutputFieldRenderer.java,v 1.5 2007/01/04 22:57:17 teknopaul Exp $ + */ +public abstract class SwingOutputFieldRenderer{ + + //TODO From FindBugs - sometimes this field is not used in subclasses to avoid casting + // replace with for example, getInputField() that casts in InputRenderers + // requires work in ConditionalFieldRenderer + protected OutputField outputField; + protected InstallerContext ctx; + + /** + * this should hold a local reference and set the input fields default value + * if one exists + * @param inputField InputField + */ + public void setOutputField(OutputField outputField){ + this.outputField = outputField; + } + /** + * Init the swing components + */ + public abstract void initComponent(JPanel parent); + /** + * Called by the Page prior to firing pagecompletion events + */ + public abstract void updateInputField(); + /** + * Called to update the defaults from the ResultContainer + */ + public abstract void updateDefaultValue(); + + /** + * Called when validation fails + */ + public abstract void renderError(); + /** + * Called when the renderer should add itself to the content pane; + * @param content the panel to which the Renderer should add itself + * @param GridBagConstraintsFactory + * @param row the current row index in the table + * @param components should adjust preferred size when the overflow flag is set + * to compensate for width loss due to the scroll bar + * @return the row index after adding all its components + */ + public abstract int addSelf(JPanel content, GBCF cf, int row, boolean overflow); + + public void setInstallerContext(InstallerContext ctx){ + this.ctx = ctx; + } + + +} Property changes on: pal-portal/modules/ant-installer/trunk/src/org/tp23/antinstaller/renderer/swing/SwingOutputFieldRenderer.java ___________________________________________________________________ Name: svn:eol-style + native Added: pal-portal/modules/ant-installer/trunk/src/org/tp23/antinstaller/renderer/swing/SwingPageRenderer.java =================================================================== --- pal-portal/modules/ant-installer/trunk/src/org/tp23/antinstaller/renderer/swing/SwingPageRenderer.java (rev 0) +++ pal-portal/modules/ant-installer/trunk/src/org/tp23/antinstaller/renderer/swing/SwingPageRenderer.java 2008-06-11 13:36:41 UTC (rev 975) @@ -0,0 +1,269 @@ +/* + * Copyright 2005 Paul Hinds + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +package org.tp23.antinstaller.renderer.swing; + +import java.awt.BorderLayout; +import java.awt.Color; +import java.awt.Dimension; +import java.awt.Font; +import java.awt.GridLayout; +import java.awt.event.ActionEvent; +import java.awt.event.ActionListener; +import java.io.ByteArrayOutputStream; +import java.io.InputStream; +import java.util.ResourceBundle; + +import javax.swing.BorderFactory; +import javax.swing.ImageIcon; +import javax.swing.JButton; +import javax.swing.JLabel; +import javax.swing.JPanel; +import javax.swing.border.Border; + +import org.tp23.antinstaller.InstallerContext; +import org.tp23.antinstaller.ValidationException; +import org.tp23.antinstaller.page.Page; + +/** + * + *

Abstract super class for page renderers. setPage will always be called.

+ *

Subclasses should implement instanceInit for initialising swing components + * on the page.

+ * @author Paul Hinds + * @version $Id: SwingPageRenderer.java,v 1.10 2007/01/19 00:24:35 teknopaul Exp $ + */ +public abstract class SwingPageRenderer + extends JPanel { + + private static final ResourceBundle res = ResourceBundle.getBundle("org.tp23.antinstaller.renderer.Res"); + + // gui components + private BorderLayout borderLayout1 = new BorderLayout(); + + // holds the next back buttons etc + private JPanel controlPanel = new JPanel(); + + private JButton backButton = new JButton(); + private JButton cancelButton = new JButton(); + private JButton nextButton = new JButton(); + private JButton finishButton = new JButton(); + + private JPanel titlePanel = new JPanel(); + private JLabel titleLabel = new JLabel(); + private JLabel imagePanel = new JLabel(); // Graphic for the installer + private GridLayout titleLayout = new GridLayout(); + + // app components + protected Page page; + protected SwingInstallerContext swingCtx; + protected InstallerContext ctx; + protected PageCompletionListener listener; + private Border bevelBorder; + + + private static Font titleFont; + static{ + titleFont = new JLabel().getFont(); + try { + titleFont = new Font(titleFont.getFamily(), Font.BOLD, 14); + } + catch (Exception ex) { + // lets not fail due to font errors + } + } + + public SwingPageRenderer(){ + super(); + } + public void setPage(Page page){ + this.page = page; + try { + jbInit(); + } + catch (Exception e) { + ctx.log(e.getMessage()); + if(ctx.getInstaller().isVerbose()) { + ctx.log(e); + } + } + } + + public void setContext(SwingInstallerContext swingCtx){ + this.ctx = swingCtx.getInstallerContext(); + this.swingCtx = swingCtx; + } + + + private void jbInit() throws Exception { + + this.setDoubleBuffered(true); + //emptyBorder = BorderFactory.createEmptyBorder(2,5,2,2); + //bevelBorder = BorderFactory.createCompoundBorder(BorderFactory.createBevelBorder(BevelBorder.LOWERED,Color.white,Color.white,new Color(116, 116, 112),new Color(166, 166, 161)),BorderFactory.createEmptyBorder(2,SwingInputFieldRenderer.LEFT_INDENT,2,2)); + bevelBorder = BorderFactory.createCompoundBorder(BorderFactory.createLineBorder(Color.black,1),BorderFactory.createEmptyBorder(2,SizeConstants.LEFT_INDENT,2,2)); + bevelBorder = BorderFactory.createCompoundBorder(BorderFactory.createEtchedBorder(),BorderFactory.createEmptyBorder(2,SizeConstants.LEFT_INDENT,2,2)); + Border tripleBorder = BorderFactory.createCompoundBorder(BorderFactory.createEmptyBorder(3,4,1,4),bevelBorder); + this.setLayout(borderLayout1); + titleLabel.setBorder(tripleBorder); + controlPanel.setBorder(tripleBorder); + + this.add(titlePanel, BorderLayout.NORTH); + this.add(controlPanel, BorderLayout.SOUTH); + + // title panel + titlePanel.add(imagePanel, null); + titlePanel.add(titleLabel, null); + + titlePanel.setLayout(titleLayout); + titleLayout.setColumns(1); + titleLayout.setHgap(0); + titleLayout.setRows(2); + titleLayout.setVgap(2); + titlePanel.setMinimumSize(new Dimension(SizeConstants.PAGE_WIDTH, SizeConstants.TITLE_PANEL_HEIGHT)); + titlePanel.setMaximumSize(new Dimension(SizeConstants.PAGE_WIDTH, SizeConstants.TITLE_PANEL_HEIGHT)); + titlePanel.setPreferredSize(new Dimension(SizeConstants.PAGE_WIDTH, SizeConstants.TITLE_PANEL_HEIGHT)); + + titleLabel.setText(page.getDisplayText()); + titleLabel.setFont(titleFont); + setImage(page.getImageResource()); + imagePanel.setMinimumSize(new Dimension(SizeConstants.PAGE_WIDTH, SizeConstants.TITLE_IMAGE_HEIGHT)); + imagePanel.setMaximumSize(new Dimension(SizeConstants.PAGE_WIDTH, SizeConstants.TITLE_IMAGE_HEIGHT)); + imagePanel.setPreferredSize(new Dimension(SizeConstants.PAGE_WIDTH, SizeConstants.TITLE_IMAGE_HEIGHT)); + + // Ctrl Panel + controlPanel.add(cancelButton, null); + controlPanel.add(backButton, null); + controlPanel.add(nextButton, null); + controlPanel.add(finishButton, null); + backButton.setText(res.getString("backButton"));// "<< Back"); + cancelButton.setText(res.getString("cancelButton"));// "Cancel"); + nextButton.setText(res.getString("nextButton"));// "Next >>"); + finishButton.setText(ctx.getInstaller().getFinishButtonText()); + finishButton.setEnabled(false); + setEventListeners(); + setIcons(); + } + public abstract void instanceInit() throws Exception ; + public abstract void updateInputFields(); + public abstract void updateDefaultValues(); + public abstract boolean validateFields()throws ValidationException; + + public void setPageCompletionListener(PageCompletionListener listener){ + this.listener = listener; + } + + private void setImage(String resource) throws Exception{ + if(resource == null){ + resource = ctx.getInstaller().getDefaultImageResource(); + } + ImageIcon icon = getImage(resource); + imagePanel.setIcon(icon); + } + + protected ImageIcon getImage(String resource){ + try { + if (resource != null) { + ByteArrayOutputStream baos = new ByteArrayOutputStream(); + InputStream in = this.getClass().getResourceAsStream(resource); + byte[] buffer = new byte[2048]; + int read = -1; + while ( (read = in.read(buffer)) != -1) { + baos.write(buffer, 0, read); + } + ImageIcon icon = new ImageIcon(baos.toByteArray()); + return icon; + } + } + catch (Exception ex) { + ctx.log("Can't load image resource:" + resource); + if(ctx.getInstaller().isVerbose()){ + ctx.log(ex); + } + } + return null; + } + + + private void setEventListeners(){ + backButton.addActionListener(new ActionListener(){ + public void actionPerformed(ActionEvent e){ + listener.pageBack(page); + } + }); + cancelButton.addActionListener(new ActionListener(){ + public void actionPerformed(ActionEvent e){ + page.setAbort(true); + if (ctx.getInstaller().isVerbose()) { + ctx.log("Abort called"); + } + listener.pageComplete(page); + } + }); + nextButton.addActionListener(new ActionListener(){ + public void actionPerformed(ActionEvent e){ + listener.pageComplete(page); + + } + }); + finishButton.addActionListener(new ActionListener(){ + public void actionPerformed(ActionEvent e){ + if(finishButton.getText().equals(res.getString("exit"))) { + //TODO FindBugs this will prevent cleanup in FinalizerFilter + System.exit(0); + } + listener.pageComplete(page); + //((SwingInstallerContext)ctx).getSwingRunner().finish(); + } + }); + } + + private void setIcons(){ + backButton.setIcon(getImage("/resources/icons/back.png")); + cancelButton.setIcon(getImage("/resources/icons/cancel.png")); + nextButton.setIcon(getImage("/resources/icons/next.png")); + finishButton.setIcon(getImage("/resources/icons/finish.png")); + } + + public JButton getCancelButton() { + return cancelButton; + } + + public InstallerContext getCtx() { + return ctx; + } + + public JPanel getControlPanel() { + return controlPanel; + } + + public JLabel getImagePanel() { + return imagePanel; + } + + public JButton getNextButton() { + return nextButton; + } + + public JLabel getTitleLabel() { + return titleLabel; + } + public JButton getFinishButton() { + return finishButton; + } + public JButton getBackButton() { + return backButton; + } + +} Property changes on: pal-portal/modules/ant-installer/trunk/src/org/tp23/antinstaller/renderer/swing/SwingPageRenderer.java ___________________________________________________________________ Name: svn:eol-style + native Added: pal-portal/modules/ant-installer/trunk/src/org/tp23/antinstaller/renderer/swing/TargetInputRenderer.java =================================================================== --- pal-portal/modules/ant-installer/trunk/src/org/tp23/antinstaller/renderer/swing/TargetInputRenderer.java (rev 0) +++ pal-portal/modules/ant-installer/trunk/src/org/tp23/antinstaller/renderer/swing/TargetInputRenderer.java 2008-06-11 13:36:41 UTC (rev 975) @@ -0,0 +1,104 @@ +/* + * Copyright 2005 Paul Hinds + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +package org.tp23.antinstaller.renderer.swing; + +import java.awt.event.ActionEvent; +import java.awt.event.ActionListener; + +import javax.swing.JPanel; + +import org.tp23.antinstaller.input.InputField; +import org.tp23.antinstaller.input.OutputField; +import org.tp23.antinstaller.input.TargetInput; +import org.tp23.gui.GBCF; + +public class TargetInputRenderer + extends SwingOutputFieldRenderer { + + protected TargetInput outputField; + + protected AILabel fieldLabel = new AILabel(); + protected AICheckBox targetCheckBox = new AICheckBox(); + + public TargetInputRenderer() { + } + public void initComponent(JPanel parent){ + try { + jbInit(); + } + catch(Exception e) { + ctx.log(e.getMessage()); + if(ctx.getInstaller().isVerbose()) { + ctx.log(e); + } + + } + } + + + + public void setOutputField(OutputField outputField) { + this.outputField = (TargetInput)outputField; + } + public void updateInputField(){ + String target = outputField.getTarget(); + int targetIdx = outputField.getIdx(); + boolean selected = targetCheckBox.isSelected(); + outputField.setInputResult(String.valueOf(selected)); + if(selected && !ctx.getCurrentPage().getAllTargets().contains(target)){ + ctx.getCurrentPage().addTarget(targetIdx, target); + } + else if(!selected && ctx.getCurrentPage().isTarget(target)){ + ctx.getCurrentPage().removeTarget(targetIdx); + } + } + public void updateDefaultValue(){ + if(!outputField.isEditted()){ + targetCheckBox.setSelected(InputField.isTrue(outputField.getDefaultValue())); + } + } + + private void jbInit() throws Exception { + fieldLabel.setText(outputField.getDisplayText()); + targetCheckBox.setSelected(InputField.isTrue(outputField.getDefaultValue())); + if(InputField.isTrue(outputField.getForce())){ + targetCheckBox.setEnabled(false); + } + + targetCheckBox.addActionListener(new ActionListener() { + public void actionPerformed(ActionEvent e) { + updateInputField(); + outputField.setEditted(true); + } + }); + } + public int addSelf(JPanel content,GBCF cf, int row,boolean overflow) { + content.add(fieldLabel,cf.getCell(row, 0)); + content.add(targetCheckBox,cf.getCell(row, 1)); + if(overflow){ + targetCheckBox.setOverflow(SizeConstants.OVERFLOW_FIELD_SIZE); + } + return ++row; + } + + + + /** + * renderError + */ + public void renderError() { + } +} Property changes on: pal-portal/modules/ant-installer/trunk/src/org/tp23/antinstaller/renderer/swing/TargetInputRenderer.java ___________________________________________________________________ Name: svn:eol-style + native Added: pal-portal/modules/ant-installer/trunk/src/org/tp23/antinstaller/renderer/swing/TargetSelectInputRenderer.java =================================================================== --- pal-portal/modules/ant-installer/trunk/src/org/tp23/antinstaller/renderer/swing/TargetSelectInputRenderer.java (rev 0) +++ pal-portal/modules/ant-installer/trunk/src/org/tp23/antinstaller/renderer/swing/TargetSelectInputRenderer.java 2008-06-11 13:36:41 UTC (rev 975) @@ -0,0 +1,53 @@ +/* + * Copyright 2005 Paul Hinds, Mark Anderson + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +package org.tp23.antinstaller.renderer.swing; + +import java.util.Enumeration; + +import javax.swing.JRadioButton; + +import org.tp23.antinstaller.input.TargetSelectInput; +/** + * + * @author Paul Hinds, Mark Anderson + * @version $Id: TargetSelectInputRenderer.java,v 1.3 2006/08/04 17:13:24 anothermwilson Exp $ + */ +public class TargetSelectInputRenderer + extends SelectInputRenderer { + + public TargetSelectInputRenderer() { + } + + public void updateInputField(){ + Enumeration enumeration = optionGroup.getElements(); + int targetIdx = ((TargetSelectInput)inputField).getIdx(); + int i = 0; + for(; enumeration.hasMoreElements(); i++){ + JRadioButton o = (JRadioButton)enumeration.nextElement(); + ctx.getCurrentPage().removeTarget(targetIdx); + if(o.isSelected()){ + String target = inputField.getOptions()[i].value; + ctx.getCurrentPage().addTarget(targetIdx, target); + inputField.setValue(target); + break; + } + } + if(i > inputField.getOptions().length){ + inputField.setValue(inputField.getDefaultValue()); + } + } + +} Property changes on: pal-portal/modules/ant-installer/trunk/src/org/tp23/antinstaller/renderer/swing/TargetSelectInputRenderer.java ___________________________________________________________________ Name: svn:eol-style + native Added: pal-portal/modules/ant-installer/trunk/src/org/tp23/antinstaller/renderer/swing/TextPageRenderer.java =================================================================== --- pal-portal/modules/ant-installer/trunk/src/org/tp23/antinstaller/renderer/swing/TextPageRenderer.java (rev 0) +++ pal-portal/modules/ant-installer/trunk/src/org/tp23/antinstaller/renderer/swing/TextPageRenderer.java 2008-06-11 13:36:41 UTC (rev 975) @@ -0,0 +1,113 @@ +/* + * Copyright 2005 Paul Hinds + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +package org.tp23.antinstaller.renderer.swing; + +import java.awt.BorderLayout; +import java.io.BufferedReader; +import java.io.InputStream; +import java.io.InputStreamReader; + +import javax.swing.BorderFactory; +import javax.swing.JLabel; +import javax.swing.JScrollPane; +import javax.swing.JTextPane; +import javax.swing.text.html.HTMLEditorKit; + +import org.tp23.antinstaller.ValidationException; +import org.tp23.antinstaller.page.TextPage; +import org.tp23.antinstaller.runtime.ConfigurationException; +/** + * A page containing a text file's contents, may be HTML in swing. + * The HTML supported is the standard Swing subset of HTML3.2 so + * it really just adds a bit of formatting and looks pretty bad. + * The page is also parsed and property references in the document + * are converted to the runtime values. + * e.g. ${java.user.name} would be replaced with the current user in the HTML text. + * + * Both the html page and embeded images are loaded from the classpath so + * can be packaged in the jar. + * + * The default font and background are determined by + * the LAF. + * @author teknopaul + * + */ +public class TextPageRenderer extends SwingPageRenderer{ + + private JTextPane textPane = new JTextPane(); + private StringBuffer buffer = new StringBuffer(); + + public TextPageRenderer() { + } + + public boolean validateFields()throws ValidationException{ + return true; + } + + public void instanceInit() throws Exception { + final String resource = ((TextPage)page).getHtmlResource(); + InputStream in = this.getClass().getResourceAsStream(resource); + if(in == null){ + throw new ConfigurationException("Html page resource is missing:" + resource); + } + BufferedReader br = new BufferedReader(new InputStreamReader(in)); + String read = null; + while ( (read = br.readLine()) != null) { + buffer.append(read); + } + // as per FindBugs + br.close(); + + JLabel defaults = new JLabel(); + textPane.setBackground(defaults.getBackground()); + textPane.setEditable(false); + textPane.setContentType("text/html"); + HTMLEditorKit classpathKit = new ClasspathHTMLEditorKit(); + textPane.setEditorKit(classpathKit); + textPane.setAutoscrolls(true); + + String rule = "body{font-family:" + defaults.getFont().getFamily() + + ";font-size:" + defaults.getFont().getSize() + "}"; + classpathKit.getStyleSheet().addRule(rule); + textPane.setBorder(BorderFactory.createEmptyBorder()); + + JScrollPane scroller = new JScrollPane(); + scroller.setHorizontalScrollBarPolicy(JScrollPane.HORIZONTAL_SCROLLBAR_AS_NEEDED); + scroller.setVerticalScrollBarPolicy(JScrollPane.VERTICAL_SCROLLBAR_AS_NEEDED); + scroller.setBorder(BorderFactory.createCompoundBorder( + BorderFactory.createEmptyBorder(4, 4, 4, 4), + BorderFactory.createEtchedBorder() + )); + add(scroller, BorderLayout.CENTER); + scroller.getViewport().add(textPane); + this.add(scroller, BorderLayout.CENTER); + } + + public void updateInputFields(){ + } + + + + /** + * updateDefaultValues + */ + public void updateDefaultValues() { + // parse property references + String parsedHtml = ctx.getInstaller().getResultContainer().getDefaultValue(buffer.toString()); + textPane.setText(parsedHtml); + textPane.setCaretPosition(0); + } +} Property changes on: pal-portal/modules/ant-installer/trunk/src/org/tp23/antinstaller/renderer/swing/TextPageRenderer.java ___________________________________________________________________ Name: svn:eol-style + native Added: pal-portal/modules/ant-installer/trunk/src/org/tp23/antinstaller/renderer/swing/UnvalidatedTextInputRenderer.java =================================================================== --- pal-portal/modules/ant-installer/trunk/src/org/tp23/antinstaller/renderer/swing/UnvalidatedTextInputRenderer.java (rev 0) +++ pal-portal/modules/ant-installer/trunk/src/org/tp23/antinstaller/renderer/swing/UnvalidatedTextInputRenderer.java 2008-06-11 13:36:41 UTC (rev 975) @@ -0,0 +1,95 @@ +/* + * Copyright 2005 Paul Hinds + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +package org.tp23.antinstaller.renderer.swing; + +import java.awt.event.ActionEvent; +import java.awt.event.ActionListener; +import java.awt.event.KeyAdapter; +import java.awt.event.KeyEvent; + +import javax.swing.JPanel; + +import org.tp23.antinstaller.input.OutputField; +import org.tp23.antinstaller.input.UnvalidatedTextInput; +import org.tp23.gui.GBCF; + +public class UnvalidatedTextInputRenderer + extends SwingOutputFieldRenderer { + + protected UnvalidatedTextInput inputField; + + protected AILabel fieldLabel = new AILabel(); + protected AITextfield jTextField = new AITextfield(); + + public UnvalidatedTextInputRenderer() { + } + + public void initComponent(JPanel parent){ + try { + jbInit(); + } + catch(Exception e) { + ctx.log(e.getMessage()); + if(ctx.getInstaller().isVerbose()) { + ctx.log(e); + } + + } + } + + public void setOutputField(OutputField inputField) { + this.inputField=(UnvalidatedTextInput)inputField; + this.inputField.setValue(this.inputField.getDefaultValue()); + } + public void updateInputField(){ + inputField.setValue(jTextField.getText()); + } + public void updateDefaultValue(){ + if(!inputField.isEditted())jTextField.setText(inputField.getDefaultValue()); + } + + private void jbInit() throws Exception { + fieldLabel.setText(inputField.getDisplayText()); + jTextField.setText(inputField.getDefaultValue()); + jTextField.addActionListener(new ActionListener() { + public void actionPerformed(ActionEvent e) { + updateInputField(); + } + }); + jTextField.addKeyListener(new KeyAdapter() { + public void keyTyped(KeyEvent e) { + if (e.getKeyChar() != '\t') { + inputField.setEditted(true); + } + } + }); + + } + public int addSelf(JPanel content,GBCF cf, int row,boolean overflow) { + content.add(fieldLabel,cf.getCell(row,0)); + content.add(jTextField,cf.getCell(row,1)); + if(overflow){ + jTextField.setOverflow(SizeConstants.OVERFLOW_FIELD_SIZE); + } + return ++row; + } + + /** + * renderError + */ + public void renderError() { + } +} Property changes on: pal-portal/modules/ant-installer/trunk/src/org/tp23/antinstaller/renderer/swing/UnvalidatedTextInputRenderer.java ___________________________________________________________________ Name: svn:eol-style + native Added: pal-portal/modules/ant-installer/trunk/src/org/tp23/antinstaller/renderer/swing/ValidatedTextInputRenderer.java =================================================================== --- pal-portal/modules/ant-installer/trunk/src/org/tp23/antinstaller/renderer/swing/ValidatedTextInputRenderer.java (rev 0) +++ pal-portal/modules/ant-installer/trunk/src/org/tp23/antinstaller/renderer/swing/ValidatedTextInputRenderer.java 2008-06-11 13:36:41 UTC (rev 975) @@ -0,0 +1,111 @@ +/* + * Copyright 2005 Paul Hinds + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +package org.tp23.antinstaller.renderer.swing; + +import java.awt.Color; +import java.awt.event.FocusAdapter; +import java.awt.event.FocusEvent; +import java.awt.event.KeyAdapter; +import java.awt.event.KeyEvent; +import java.util.ResourceBundle; + +import javax.swing.JPanel; +import javax.swing.JTextField; + +import org.tp23.antinstaller.input.OutputField; +import org.tp23.antinstaller.input.ValidatedTextInput; +import org.tp23.antinstaller.renderer.MessageRenderer; +import org.tp23.gui.GBCF; + +public class ValidatedTextInputRenderer extends SwingOutputFieldRenderer { + + private static final ResourceBundle res = ResourceBundle.getBundle("org.tp23.antinstaller.renderer.Res"); + + protected ValidatedTextInput inputField; + protected AILabel fieldLabel = new AILabel(); + protected JTextField jTextField = new AITextfield(); + protected Color origFore; + + public ValidatedTextInputRenderer() { + origFore = jTextField.getForeground(); + } + + public void initComponent(JPanel parent) { + try { + jbInit(); + } catch (Exception e) { + ctx.log(e.getMessage()); + if (ctx.getInstaller().isVerbose()) { + ctx.log(e); + } + + } + } + + public void setOutputField(OutputField inputField) { + this.inputField = (ValidatedTextInput) inputField; + this.inputField.setValue(this.inputField.getDefaultValue()); + } + + public void updateInputField() { + inputField.setValue(jTextField.getText()); + } + + public void updateDefaultValue() { + if (!inputField.isEditted()) { + jTextField.setText(inputField.getDefaultValue()); + } + } + + private void jbInit() throws Exception { + fieldLabel.setText(inputField.getDisplayText()); + jTextField.setText(inputField.getDefaultValue()); + + jTextField.addFocusListener(new FocusAdapter() { + public void focusLost(FocusEvent fe) { + jTextField.setForeground(origFore); + } + }); + jTextField.addKeyListener(new KeyAdapter() { + public void keyTyped(KeyEvent e) { + if (e.getKeyChar() != '\t') { + inputField.setEditted(true); + } + } + }); + } + + public int addSelf(JPanel content, GBCF cf, int row, boolean overflow) { + content.add(fieldLabel, cf.getCell(row, 0)); + content.add(jTextField, cf.getCell(row, 1)); + if (overflow) { + ((AITextfield) jTextField).setOverflow(SizeConstants.OVERFLOW_FIELD_SIZE); + } + return ++row; + } + + /** + * renderError + */ + public void renderError() { + MessageRenderer mr = ctx.getMessageRenderer(); + mr.printMessage(res.getString("notCorrectFormat") + "\n\n e.g. " + + inputField.getDefaultValue()); + this.jTextField.requestFocus(); + this.jTextField.setForeground(Color.red); + } + +} Property changes on: pal-portal/modules/ant-installer/trunk/src/org/tp23/antinstaller/renderer/swing/ValidatedTextInputRenderer.java ___________________________________________________________________ Name: svn:eol-style + native Added: pal-portal/modules/ant-installer/trunk/src/org/tp23/antinstaller/renderer/swing/package.html =================================================================== --- pal-portal/modules/ant-installer/trunk/src/org/tp23/antinstaller/renderer/swing/package.html (rev 0) +++ pal-portal/modules/ant-installer/trunk/src/org/tp23/antinstaller/renderer/swing/package.html 2008-06-11 13:36:41 UTC (rev 975) @@ -0,0 +1,9 @@ + + + + +Renderers for the Swing UI. + Property changes on: pal-portal/modules/ant-installer/trunk/src/org/tp23/antinstaller/renderer/swing/package.html ___________________________________________________________________ Name: svn:eol-style + native Added: pal-portal/modules/ant-installer/trunk/src/org/tp23/antinstaller/renderer/swing/plaf/LookAndFeelFactory.java =================================================================== --- pal-portal/modules/ant-installer/trunk/src/org/tp23/antinstaller/renderer/swing/plaf/LookAndFeelFactory.java (rev 0) +++ pal-portal/modules/ant-installer/trunk/src/org/tp23/antinstaller/renderer/swing/plaf/LookAndFeelFactory.java 2008-06-11 13:36:41 UTC (rev 975) @@ -0,0 +1,105 @@ +/* + * Copyright 2005 Paul Hinds + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +package org.tp23.antinstaller.renderer.swing.plaf; + +import java.lang.reflect.Method; + +import javax.swing.LookAndFeel; +import javax.swing.UIManager; + +import org.tp23.antinstaller.InstallerContext; +import org.tp23.antinstaller.input.OutputField; + + +/** + * @author Paul Hinds + * @version $Id: LookAndFeelFactory.java,v 1.9 2007/01/28 21:31:08 teknopaul Exp $ + */ +public class LookAndFeelFactory { + + public static final String DEFAULT_LAF = "org.tp23.jgoodies.plaf.plastic.PlasticXPLookAndFeel"; + public static final String GREYMETAL_LAF = "greymetal"; + public static final String NATIVE_LAF = "native"; + public static final String JGOODIES_LAF = "jgoodies"; + public static final String NULL_LAF = "null"; + + private final String specifiedLAF; + private final InstallerContext ctx; + /** + * + */ + public LookAndFeelFactory(InstallerContext ctx) { + this.ctx = ctx; + this.specifiedLAF = ctx.getInstaller().getLookAndFeel(); + } + + public void setLAF(){ + String lafClassName = null; + try{ + lafClassName = getLafFromToken(specifiedLAF); + if(lafClassName == null){ + return; + } + LookAndFeel look = (LookAndFeel)Class.forName(lafClassName).newInstance(); + ctx.log("Setting look and feel:" + lafClassName); + UIManager.setLookAndFeel(look); + + boolean antialias = OutputField.isTrue(ctx.getInstaller().getAntialiased()); + // Reflection used here to avoid dependencies on JGoodies + if(antialias){ + Method setAntialiased = look.getClass().getMethod("setAntiAliased", new Class[]{boolean.class}); + if(setAntialiased != null){ + ctx.log("Setting antialiasing:" + antialias); + // JDK1.5 warning fix + Object[] args = new Boolean[]{new Boolean(antialias)}; + setAntialiased.invoke(null, args); + } + } + }catch(Exception ex ){ + ctx.getLogger().log("Can not correctly set Look And Feel:" + ex.getMessage()); + ctx.getLogger().log(ctx.getInstaller(), ex); + } + } + + public static boolean isDefault(String laf){ + return ( laf == null || laf.equals(JGOODIES_LAF) || laf.equals(DEFAULT_LAF) ); + } + /** + * Gets a look and feel class name respecting the tokens supported + * such as jgoodies, null, native and greymetal + * @param token + * @return look and feel class name + */ + public static String getLafFromToken(String token) { + String laf = null; + if(token == null || token.equals(JGOODIES_LAF)) { + laf = DEFAULT_LAF; + } + else if(token.equals(NULL_LAF)) { + laf = null; + } + else if(token.equals(NATIVE_LAF)) { + laf = UIManager.getSystemLookAndFeelClassName(); + } + else if(token.equals(GREYMETAL_LAF)) { + laf = "org.tp23.antinstaller.renderer.swing.plaf.ModMetalLookAndFeel"; + } + else { + laf = token; + } + return laf; + } +} Property changes on: pal-portal/modules/ant-installer/trunk/src/org/tp23/antinstaller/renderer/swing/plaf/LookAndFeelFactory.java ___________________________________________________________________ Name: svn:eol-style + native Added: pal-portal/modules/ant-installer/trunk/src/org/tp23/antinstaller/renderer/swing/plaf/ModMetalLookAndFeel.java =================================================================== --- pal-portal/modules/ant-installer/trunk/src/org/tp23/antinstaller/renderer/swing/plaf/ModMetalLookAndFeel.java (rev 0) +++ pal-portal/modules/ant-installer/trunk/src/org/tp23/antinstaller/renderer/swing/plaf/ModMetalLookAndFeel.java 2008-06-11 13:36:41 UTC (rev 975) @@ -0,0 +1,118 @@ +/* + * Copyright 2005 Paul Hinds + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +package org.tp23.antinstaller.renderer.swing.plaf; + +import java.awt.Font; +import java.awt.Insets; + +import javax.swing.LookAndFeel; +import javax.swing.UIDefaults; +import javax.swing.UIManager; +import javax.swing.plaf.metal.MetalLookAndFeel; + + +/** + * This LAF is a replacement for Metal for those of us who can't stand the + * exsessive use of the BOLD font in the default MetalLookAndFeel + * but don't want a heavy LAF that uses excessive memory or increases download + * size. The excessive use of Sun's corporate color purple has also been + * removed, but icons have been left as they are since they would add + * to the download size significantly. + * @author Paul Hinds + * @version $Id: ModMetalLookAndFeel.java,v 1.3 2006/12/21 00:03:03 teknopaul Exp $ + */ +public class ModMetalLookAndFeel extends MetalLookAndFeel { + + private static final long serialVersionUID = 1L; + private static boolean isInstalled = false; + protected static final Font defaultFont = new Font("Dialog",Font.PLAIN,11); + + + public ModMetalLookAndFeel(){ + if(!isInstalled){ + isInstalled = true; + UIManager.installLookAndFeel(new javax.swing.UIManager.LookAndFeelInfo("ModMetal", "org.tp23.laf.modmetal.ModMetalLookAndFeel")); + } + } + public static void setAntiAliased(boolean antialiased){ + + } + + public String getID(){ + return "ModMetalLookAndFeel"; + } + + public String getName() + { + return "ModMetalLookAndFeel"; + } + + public String getDescription(){ + return "Metal LAF with minor changes to default Fonts"; + } + + public boolean isNativeLookAndFeel(){ + return false; + } + + public boolean isSupportedLookAndFeel(){ + return true; + } + + protected void initClassDefaults(UIDefaults table){ + super.initClassDefaults(table); + } + + protected void createDefaultTheme(){ + setCurrentTheme(new ModMetalTheme()); + super.createDefaultTheme(); + } + + protected void initSystemColorDefaults(UIDefaults table){ + super.initSystemColorDefaults(table); + } + + protected void initComponentDefaults(UIDefaults table){ + super.initComponentDefaults(table); + table.put("Button.font", defaultFont); + table.put("Checkbox.font", defaultFont); + table.put("CheckboxMenuItem.font", defaultFont); + table.put("ComboBox.font", defaultFont); + table.put("ComboBox.font", defaultFont); + table.put("FormattedTextField.font", defaultFont); + table.put("Label.font", defaultFont); + table.put("List.font", defaultFont); + table.put("Menu.font", defaultFont); + table.put("MenuItem.font", defaultFont); + table.put("PopupMenu.font", defaultFont); + table.put("ProgressBar.font", defaultFont); + table.put("RadioButton.font", defaultFont); + table.put("RadioButtonMenuItem.font", defaultFont); + table.put("TextArea.font", defaultFont); + table.put("TextField.font", defaultFont); + table.put("TextPane.font", defaultFont); + table.put("TabbedPane.font", defaultFont); + table.put("ToggleButton.font", defaultFont); + table.put("Tree.font", defaultFont); + table.put("Viewport.font", defaultFont); + table.put("OptionPane.errorIcon", LookAndFeel.makeIcon(MetalLookAndFeel.class, "icons/Error.gif")); + table.put("OptionPane.informationIcon", LookAndFeel.makeIcon(MetalLookAndFeel.class, "icons/Inform.gif")); + table.put("OptionPane.warningIcon", LookAndFeel.makeIcon(MetalLookAndFeel.class, "icons/Warn.gif")); + table.put("Button.margin", new Insets(2,4,2,4)); + } + +} + Property changes on: pal-portal/modules/ant-installer/trunk/src/org/tp23/antinstaller/renderer/swing/plaf/ModMetalLookAndFeel.java ___________________________________________________________________ Name: svn:eol-style + native Added: pal-portal/modules/ant-installer/trunk/src/org/tp23/antinstaller/renderer/swing/plaf/ModMetalTheme.java =================================================================== --- pal-portal/modules/ant-installer/trunk/src/org/tp23/antinstaller/renderer/swing/plaf/ModMetalTheme.java (rev 0) +++ pal-portal/modules/ant-installer/trunk/src/org/tp23/antinstaller/renderer/swing/plaf/ModMetalTheme.java 2008-06-11 13:36:41 UTC (rev 975) @@ -0,0 +1,53 @@ +/* + * Copyright 2005 Paul Hinds + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +package org.tp23.antinstaller.renderer.swing.plaf; + +import javax.swing.plaf.ColorUIResource; +import javax.swing.plaf.metal.DefaultMetalTheme; + +/** + * @author Paul Hinds + * @version $Id: ModMetalTheme.java,v 1.4 2006/12/21 00:03:03 teknopaul Exp $ + */ +public class ModMetalTheme extends DefaultMetalTheme{ + + private static final ColorUIResource primary1 = new ColorUIResource( + 102, 102, 102); + private static final ColorUIResource primary2 = new ColorUIResource( + 153, 153, 153); + private static final ColorUIResource primary3 = new ColorUIResource( + 204, 204, 204); + + + private static final ColorUIResource secondary1 = new ColorUIResource( + 192, 192, 192); + private static final ColorUIResource secondary2 = new ColorUIResource( + 213, 213, 213); + private static final ColorUIResource secondary3 = new ColorUIResource( + 234, 234, 234); + + + // these are blue in Metal Default Theme + protected ColorUIResource getPrimary1() { return primary1; } + protected ColorUIResource getPrimary2() { return primary2; } + protected ColorUIResource getPrimary3() { return primary3; } + + // these are gray in Metal Default Theme + protected ColorUIResource getSecondary1() { return secondary1; } + protected ColorUIResource getSecondary2() { return secondary2; } + protected ColorUIResource getSecondary3() { return secondary3; } + +} Property changes on: pal-portal/modules/ant-installer/trunk/src/org/tp23/antinstaller/renderer/swing/plaf/ModMetalTheme.java ___________________________________________________________________ Name: svn:eol-style + native Added: pal-portal/modules/ant-installer/trunk/src/org/tp23/antinstaller/renderer/text/AbstractTextPageRenderer.java =================================================================== --- pal-portal/modules/ant-installer/trunk/src/org/tp23/antinstaller/renderer/text/AbstractTextPageRenderer.java (rev 0) +++ pal-portal/modules/ant-installer/trunk/src/org/tp23/antinstaller/renderer/text/AbstractTextPageRenderer.java 2008-06-11 13:36:41 UTC (rev 975) @@ -0,0 +1,121 @@ +/* + * Copyright 2005 Paul Hinds + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +package org.tp23.antinstaller.renderer.text; + +import java.io.BufferedReader; +import java.io.IOException; +import java.io.PrintStream; +import java.util.ResourceBundle; + +import org.tp23.antinstaller.InstallException; +import org.tp23.antinstaller.InstallerContext; +import org.tp23.antinstaller.page.Page; +import org.tp23.antinstaller.renderer.PageRenderer; +/** + * renamed from TextPageRenderer in version 0.8 to enable + * the use of the page type TextPage, TextPageRenderer is now + * the renderer for these page types + * @author teknopaul + * + */ +public abstract class AbstractTextPageRenderer + implements PageRenderer { + + public static final int PAGE_BLANK_LINES = 20; + public static final int PAGE_DECO_WIDTH = 80; + + protected BufferedReader reader; + protected PrintStream out; + private InstallerContext ctx; + + + public AbstractTextPageRenderer() { + } + + public void setContext(InstallerContext ctx){ + this.ctx = ctx; + } + public InstallerContext getContext(){ + return ctx; + } + + public void init( BufferedReader reader, PrintStream out){ + this.out = out; + this.reader = reader; + } + /** + * + * @param page Page + * @throws InstallException + * @return boolean false implys user aborted + */ + public abstract boolean renderPage(Page page) throws InstallException; + + protected void printHeader(Page page) throws IOException{ + for (int i = 0; i < PAGE_BLANK_LINES; i++) { + out.println(); + } + + + for (int i = 0; i < PAGE_DECO_WIDTH; i++) { + out.print('~'); + } + out.println(); + out.println(" " + page.getDisplayText()); + for (int i = 0; i < PAGE_DECO_WIDTH; i++) { + out.print('~'); + } + out.println(); + out.println(); + out.println(); + } + + private static final ResourceBundle res = ResourceBundle.getBundle("org.tp23.antinstaller.renderer.text.Res"); + private static final char[] affimativeChars = parseChars(res.getString("affirmativeChars")); + + private static char[] parseChars(String commaSeparated){ + char[] input = commaSeparated.toCharArray(); + char[] theChars = new char[input.length]; + int j = 0; + for (int i = 0; i < input.length; i++) { + if(Character.isWhitespace(input[i]))continue; + if(',' == input[i]) { + continue; + } + else theChars[j++] = input[i]; + } + char[] toReturn = new char[j]; + System.arraycopy(theChars,0,toReturn,0,j); + return toReturn; + } + + /** + * does the string represent true default = true + * @param entered String + * @return boolean + */ + protected boolean isTrue(String entered){ + if(entered.length() == 0) { + return true; + } + char first = entered.charAt(0); + boolean isTrue= false; + for (int i = 0; i < affimativeChars.length; i++) { + isTrue |= Character.toUpperCase(first) == affimativeChars[i]; + } + return isTrue; + } +} Property changes on: pal-portal/modules/ant-installer/trunk/src/org/tp23/antinstaller/renderer/text/AbstractTextPageRenderer.java ___________________________________________________________________ Name: svn:eol-style + native Added: pal-portal/modules/ant-installer/trunk/src/org/tp23/antinstaller/renderer/text/AppRootInputRenderer.java =================================================================== --- pal-portal/modules/ant-installer/trunk/src/org/tp23/antinstaller/renderer/text/AppRootInputRenderer.java (rev 0) +++ pal-portal/modules/ant-installer/trunk/src/org/tp23/antinstaller/renderer/text/AppRootInputRenderer.java 2008-06-11 13:36:41 UTC (rev 975) @@ -0,0 +1,20 @@ +/* + * Copyright 2005 Paul Hinds + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +package org.tp23.antinstaller.renderer.text; + +public class AppRootInputRenderer + extends DirectoryInputRenderer { +} Property changes on: pal-portal/modules/ant-installer/trunk/src/org/tp23/antinstaller/renderer/text/AppRootInputRenderer.java ___________________________________________________________________ Name: svn:eol-style + native Added: pal-portal/modules/ant-installer/trunk/src/org/tp23/antinstaller/renderer/text/CheckboxInputRenderer.java =================================================================== --- pal-portal/modules/ant-installer/trunk/src/org/tp23/antinstaller/renderer/text/CheckboxInputRenderer.java (rev 0) +++ pal-portal/modules/ant-installer/trunk/src/org/tp23/antinstaller/renderer/text/CheckboxInputRenderer.java 2008-06-11 13:36:41 UTC (rev 975) @@ -0,0 +1,93 @@ +/* + * Copyright 2005 Paul Hinds + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +package org.tp23.antinstaller.renderer.text; + +import java.io.BufferedReader; +import java.io.IOException; +import java.io.PrintStream; +import java.util.ResourceBundle; + +import org.tp23.antinstaller.InstallerContext; +import org.tp23.antinstaller.input.CheckboxInput; +import org.tp23.antinstaller.input.InputField; +import org.tp23.antinstaller.input.OutputField; + + +public class CheckboxInputRenderer + implements TextOutputFieldRenderer { + + private static final ResourceBundle res = ResourceBundle.getBundle("org.tp23.antinstaller.renderer.text.Res"); + + protected InstallerContext ctx; + + public CheckboxInputRenderer() { + } + + public void setContext(InstallerContext ctx) { + this.ctx = ctx; + } + + public void renderOutput(OutputField field, BufferedReader reader, PrintStream out) throws IOException { + CheckboxInput iField = (CheckboxInput) field; + out.print(iField.getDisplayText()); + out.print(" ["); + out.print(res.getString("_default_")); + out.print(":"); + out.print(iField.getDefaultValue()); + out.print("]"); + if (InputField.isTrue(iField.getForce())) { + out.println(res.getString("_required_")); + iField.setValue(iField.getDefaultValue()); + return; + } + else { + out.println(); + } + + + String input = reader.readLine(); + out.println(); + if (input == null || input.trim().equals("")) { + input = iField.getDefaultValue(); + } + if(InputField.isTrue(input)){ + iField.setValue("true"); + } + //@TODO should accept true or false only and complain toher wise looping till sensible input + //else if (InputField.isFalse(input)){ + // iField.setValue("false"); + //} + else{ + iField.setValue("false"); + } + } + + public boolean isAbort() { + return false; + } + + + + /** + * renderError + * + * @param field InputField + * @param in InputStream + * @param out PrintStream + */ + public void renderError(OutputField field, BufferedReader reader, PrintStream out) { + } +} Property changes on: pal-portal/modules/ant-installer/trunk/src/org/tp23/antinstaller/renderer/text/CheckboxInputRenderer.java ___________________________________________________________________ Name: svn:eol-style + native Added: pal-portal/modules/ant-installer/trunk/src/org/tp23/antinstaller/renderer/text/CommentOutputRenderer.java =================================================================== --- pal-portal/modules/ant-installer/trunk/src/org/tp23/antinstaller/renderer/text/CommentOutputRenderer.java (rev 0) +++ pal-portal/modules/ant-installer/trunk/src/org/tp23/antinstaller/renderer/text/CommentOutputRenderer.java 2008-06-11 13:36:41 UTC (rev 975) @@ -0,0 +1,68 @@ +/* + * Copyright 2005 Paul Hinds + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +package org.tp23.antinstaller.renderer.text; + +import java.io.BufferedReader; +import java.io.IOException; +import java.io.PrintStream; + +import org.tp23.antinstaller.InstallerContext; +import org.tp23.antinstaller.input.CommentOutput; +import org.tp23.antinstaller.input.OutputField; + + +public class CommentOutputRenderer + implements TextOutputFieldRenderer { + protected InstallerContext ctx; + + public CommentOutputRenderer() { + } + + public void setContext(InstallerContext ctx) { + this.ctx = ctx; + } + + public void renderOutput(OutputField field, BufferedReader reader, PrintStream out) throws IOException { + CommentOutput comField = (CommentOutput) field; + String text = field.getDisplayText(); + if(text == null){ + return; + } + + if( OutputField.isTrue(comField.getBold()) ){ + text = text.toUpperCase(); + } + else if( OutputField.isTrue(comField.getTitle()) ){ + text = text.toUpperCase(); + } + + out.println(text); + } + public boolean isAbort(){ + return false; + } + + + + /** + * renderError + * + * @param field InputField + * @param out PrintStream + */ + public void renderError(OutputField field, BufferedReader reader, PrintStream out) { + } +} Property changes on: pal-portal/modules/ant-installer/trunk/src/org/tp23/antinstaller/renderer/text/CommentOutputRenderer.java ___________________________________________________________________ Name: svn:eol-style + native Added: pal-portal/modules/ant-installer/trunk/src/org/tp23/antinstaller/renderer/text/ConditionalFieldRenderer.java =================================================================== --- pal-portal/modules/ant-installer/trunk/src/org/tp23/antinstaller/renderer/text/ConditionalFieldRenderer.java (rev 0) +++ pal-portal/modules/ant-installer/trunk/src/org/tp23/antinstaller/renderer/text/ConditionalFieldRenderer.java 2008-06-11 13:36:41 UTC (rev 975) @@ -0,0 +1,85 @@ +/* + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +package org.tp23.antinstaller.renderer.text; + +import java.io.BufferedReader; +import java.io.IOException; +import java.io.PrintStream; + +import org.tp23.antinstaller.InstallException; +import org.tp23.antinstaller.InstallerContext; +import org.tp23.antinstaller.ResourceBundleHelper; +import org.tp23.antinstaller.ValidationException; +import org.tp23.antinstaller.input.ConditionalField; +import org.tp23.antinstaller.input.OutputField; +import org.tp23.antinstaller.runtime.ConfigurationException; + +/** + * Conditionally render a collection of fields + * + * @author mwilson + * @version $Id + * @since 0.7.4.patch 7 + */ +public class ConditionalFieldRenderer implements TextOutputFieldRenderer +{ + private static final ResourceBundleHelper res = new ResourceBundleHelper("org.tp23.antinstaller.renderer.text.Res"); + + private InstallerContext context; + + public void setContext( InstallerContext context ) + { + this.context = context; + } + + public void renderOutput( OutputField field, BufferedReader reader, PrintStream out ) + throws ValidationException, InstallException, IOException + { + ConditionalField conditional = (ConditionalField) field; + + try + { + + OutputField[] fields = null; + + if( conditional.getExpression().evaluate() ) + { + fields = conditional.getFields(); + + SimpleInputPageRenderer.renderFields( context, fields, reader, out); + } + } + catch( ConfigurationException configExc ) + { + throw new InstallException( res.getMessage( "invalid.conditional.expression", conditional.getIfProperty()), + configExc ); + } + catch( ClassNotFoundException clsNotFoundExc ) + { + throw new InstallException( res.getMessage( "text.render.not.found" ), + clsNotFoundExc ); + } + } + + public void renderError( OutputField field, BufferedReader reader, PrintStream out ) throws IOException + { + //renderOutput will have already rendered any errors + } + + public boolean isAbort() + { + return false; + } +} Property changes on: pal-portal/modules/ant-installer/trunk/src/org/tp23/antinstaller/renderer/text/ConditionalFieldRenderer.java ___________________________________________________________________ Name: svn:eol-style + native Added: pal-portal/modules/ant-installer/trunk/src/org/tp23/antinstaller/renderer/text/ConfirmPasswordTextInputRenderer.java =================================================================== --- pal-portal/modules/ant-installer/trunk/src/org/tp23/antinstaller/renderer/text/ConfirmPasswordTextInputRenderer.java (rev 0) +++ pal-portal/modules/ant-installer/trunk/src/org/tp23/antinstaller/renderer/text/ConfirmPasswordTextInputRenderer.java 2008-06-11 13:36:41 UTC (rev 975) @@ -0,0 +1,13 @@ +package org.tp23.antinstaller.renderer.text; + +import java.util.ResourceBundle; + +public class ConfirmPasswordTextInputRenderer extends PasswordTextInputRenderer { + + private static final ResourceBundle res = ResourceBundle.getBundle("org.tp23.antinstaller.renderer.Res"); + + protected String getErrorMessage(){ + return res.getString("passwordsDoNotMatch"); + } + +} Property changes on: pal-portal/modules/ant-installer/trunk/src/org/tp23/antinstaller/renderer/text/ConfirmPasswordTextInputRenderer.java ___________________________________________________________________ Name: svn:eol-style + native Added: pal-portal/modules/ant-installer/trunk/src/org/tp23/antinstaller/renderer/text/DateInputRenderer.java =================================================================== --- pal-portal/modules/ant-installer/trunk/src/org/tp23/antinstaller/renderer/text/DateInputRenderer.java (rev 0) +++ pal-portal/modules/ant-installer/trunk/src/org/tp23/antinstaller/renderer/text/DateInputRenderer.java 2008-06-11 13:36:41 UTC (rev 975) @@ -0,0 +1,66 @@ +/* + * Copyright 2005 Paul Hinds + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +package org.tp23.antinstaller.renderer.text; + +import java.io.BufferedReader; +import java.io.IOException; +import java.io.PrintStream; +import java.util.ResourceBundle; + +import org.tp23.antinstaller.InstallerContext; +import org.tp23.antinstaller.input.DateInput; +import org.tp23.antinstaller.input.OutputField; + + +public class DateInputRenderer + implements TextOutputFieldRenderer { + + private static final ResourceBundle res = ResourceBundle.getBundle("org.tp23.antinstaller.renderer.text.Res"); + + protected InstallerContext ctx; + public DateInputRenderer() { + } + + public void setContext(InstallerContext ctx) { + this.ctx = ctx; + } + + public void renderOutput(OutputField field, BufferedReader reader, PrintStream out) throws IOException { + DateInput iField = (DateInput) field; + out.print(field.getDisplayText()); + + out.print(" ["); + out.print(res.getString("_default_")); + out.print(":"); + out.print(iField.getDefaultValue()); + out.println("]"); + +// @TODO check this from the patch submitted for bug 1469254 + String input = reader.readLine(); + + out.println(); + if(input==null || input.equals(""))input = iField.getDefaultValue(); + iField.setInputResult(input); + } + public void renderError(OutputField field, BufferedReader reader, PrintStream out) throws IOException{ + DateInput iField = (DateInput) field; + out.println("The input is not in the correct format:"+iField.getDateFormat()); + renderOutput(field, reader, out); + } + public boolean isAbort(){ + return false; + } +} Property changes on: pal-portal/modules/ant-installer/trunk/src/org/tp23/antinstaller/renderer/text/DateInputRenderer.java ___________________________________________________________________ Name: svn:eol-style + native Added: pal-portal/modules/ant-installer/trunk/src/org/tp23/antinstaller/renderer/text/DirectoryInputRenderer.java =================================================================== --- pal-portal/modules/ant-installer/trunk/src/org/tp23/antinstaller/renderer/text/DirectoryInputRenderer.java (rev 0) +++ pal-portal/modules/ant-installer/trunk/src/org/tp23/antinstaller/renderer/text/DirectoryInputRenderer.java 2008-06-11 13:36:41 UTC (rev 975) @@ -0,0 +1,86 @@ +/* + * Copyright 2005 Paul Hinds + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +package org.tp23.antinstaller.renderer.text; + +import java.io.BufferedReader; +import java.io.File; +import java.io.IOException; +import java.io.PrintStream; +import java.util.ResourceBundle; + +import org.tp23.antinstaller.InstallerContext; +import org.tp23.antinstaller.input.DirectoryInput; +import org.tp23.antinstaller.input.OutputField; + +public class DirectoryInputRenderer implements TextOutputFieldRenderer { + + private static final ResourceBundle res = ResourceBundle.getBundle("org.tp23.antinstaller.renderer.text.Res"); + + protected InstallerContext ctx; + + public DirectoryInputRenderer() { + } + + public void setContext(InstallerContext ctx) { + this.ctx = ctx; + } + + public void renderOutput(OutputField field, BufferedReader reader, PrintStream out) throws IOException { + DirectoryInput iField = (DirectoryInput) field; + out.print(iField.getDisplayText()); + + out.print(" ["); + out.print(res.getString("_default_")); + out.print(":"); + out.print(iField.getDefaultValue(true)); + out.print("]"); + + out.println(); + String input = reader.readLine(); + out.println(); + if (input == null || input.equals("")) { + input = iField.getDefaultValue(true); + if("".equals(input)) { // if we have empty default and empty input getAbsolutePath() produces a temporary directory + iField.setInputResult(""); + } + else { + iField.setInputResult(new File(input).getAbsolutePath()); + } + } + else { + iField.setInputResult(new File(input).getAbsolutePath()); + } + } + + public boolean isAbort() { + return false; + } + + /** + * renderError + * + * @param field + * InputField + * @param in + * InputStream + * @param out + * PrintStream + */ + public void renderError(OutputField field, BufferedReader reader, PrintStream out) throws IOException { + renderOutput(field, reader, out); + } + +} Property changes on: pal-portal/modules/ant-installer/trunk/src/org/tp23/antinstaller/renderer/text/DirectoryInputRenderer.java ___________________________________________________________________ Name: svn:eol-style + native Added: pal-portal/modules/ant-installer/trunk/src/org/tp23/antinstaller/renderer/text/ExtValidatedTextInputRenderer.java =================================================================== --- pal-portal/modules/ant-installer/trunk/src/org/tp23/antinstaller/renderer/text/ExtValidatedTextInputRenderer.java (rev 0) +++ pal-portal/modules/ant-installer/trunk/src/org/tp23/antinstaller/renderer/text/ExtValidatedTextInputRenderer.java 2008-06-11 13:36:41 UTC (rev 975) @@ -0,0 +1,38 @@ +/* + * Copyright 2005 Paul Hinds + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +package org.tp23.antinstaller.renderer.text; + +import java.io.BufferedReader; +import java.io.IOException; +import java.io.PrintStream; + +import org.tp23.antinstaller.input.ExtValidatedTextInput; +import org.tp23.antinstaller.input.OutputField; +import org.tp23.antinstaller.input.Validator; + + +public class ExtValidatedTextInputRenderer + extends ValidatedTextInputRenderer { + + public void renderError(OutputField field, BufferedReader reader, PrintStream out) throws IOException{ + ExtValidatedTextInput extVal = (ExtValidatedTextInput) field; + Validator validator = extVal.getValidator(); + Throwable t = extVal.getThrowable(); + String message = validator.getErrorMessage(t,null); + out.println(message); + renderOutput(field, reader, out); + } +} Property changes on: pal-portal/modules/ant-installer/trunk/src/org/tp23/antinstaller/renderer/text/ExtValidatedTextInputRenderer.java ___________________________________________________________________ Name: svn:eol-style + native Added: pal-portal/modules/ant-installer/trunk/src/org/tp23/antinstaller/renderer/text/FileInputRenderer.java =================================================================== --- pal-portal/modules/ant-installer/trunk/src/org/tp23/antinstaller/renderer/text/FileInputRenderer.java (rev 0) +++ pal-portal/modules/ant-installer/trunk/src/org/tp23/antinstaller/renderer/text/FileInputRenderer.java 2008-06-11 13:36:41 UTC (rev 975) @@ -0,0 +1,70 @@ +/* + * Copyright 2005 Paul Hinds + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +package org.tp23.antinstaller.renderer.text; + +import java.io.BufferedReader; +import java.io.File; +import java.io.IOException; +import java.io.PrintStream; +import java.util.ResourceBundle; + +import org.tp23.antinstaller.InstallerContext; +import org.tp23.antinstaller.input.FileInput; +import org.tp23.antinstaller.input.OutputField; +import org.tp23.antinstaller.renderer.MessageRenderer; + + +public class FileInputRenderer + implements TextOutputFieldRenderer { + + private static final ResourceBundle res = ResourceBundle.getBundle("org.tp23.antinstaller.renderer.text.Res"); + + protected InstallerContext ctx; + public FileInputRenderer() { + } + + public void setContext(InstallerContext ctx) { + this.ctx = ctx; + } + + public void renderOutput(OutputField field, BufferedReader reader, PrintStream out) throws IOException { + FileInput iField = (FileInput) field; + out.print(iField.getDisplayText()); + + out.print(" ["); + out.print(res.getString("_default_")); + out.print(":"); + out.print(iField.getDefaultValue(true)); + out.print("]"); + + out.println(); + String input = reader.readLine(); + out.println(); + if(input == null || input.equals("")){ + input = iField.getDefaultValue(true); + } + iField.setInputResult(new File(input).getAbsolutePath()); + } + public void renderError(OutputField field, BufferedReader reader, PrintStream out) throws IOException{ + MessageRenderer mr = ctx.getMessageRenderer(); + mr.printMessage(res.getString("fileDoesNotExist")); + renderOutput(field, reader, out); + } + public boolean isAbort(){ + return false; + } + +} Property changes on: pal-portal/modules/ant-installer/trunk/src/org/tp23/antinstaller/renderer/text/FileInputRenderer.java ___________________________________________________________________ Name: svn:eol-style + native Added: pal-portal/modules/ant-installer/trunk/src/org/tp23/antinstaller/renderer/text/HiddenPropertyInputRenderer.java =================================================================== --- pal-portal/modules/ant-installer/trunk/src/org/tp23/antinstaller/renderer/text/HiddenPropertyInputRenderer.java (rev 0) +++ pal-portal/modules/ant-installer/trunk/src/org/tp23/antinstaller/renderer/text/HiddenPropertyInputRenderer.java 2008-06-11 13:36:41 UTC (rev 975) @@ -0,0 +1,58 @@ +/* + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +package org.tp23.antinstaller.renderer.text; + +import java.io.BufferedReader; +import java.io.IOException; +import java.io.PrintStream; + +import org.tp23.antinstaller.InstallerContext; +import org.tp23.antinstaller.input.HiddenPropertyInput; +import org.tp23.antinstaller.input.OutputField; + +/** + * Text UI Renderer for hidden properties - displays nothing + * + * @author mwilson + * @version $Id + * @since 0.7.4 patch 6 + */ +public class HiddenPropertyInputRenderer implements TextOutputFieldRenderer +{ + + public void setContext( InstallerContext ctx ) + { + + } + + public void renderOutput( OutputField field, BufferedReader reader, PrintStream out ) throws IOException + { + HiddenPropertyInput propertyField = (HiddenPropertyInput) field; + + if( !propertyField.isEditted() ) + { + propertyField.setInputResult( propertyField.getDefaultValue() ); + } + } + + public void renderError( OutputField field, BufferedReader reader, PrintStream out ) throws IOException + { + + } + + public boolean isAbort() + { + return false; + } +} Property changes on: pal-portal/modules/ant-installer/trunk/src/org/tp23/antinstaller/renderer/text/HiddenPropertyInputRenderer.java ___________________________________________________________________ Name: svn:eol-style + native Added: pal-portal/modules/ant-installer/trunk/src/org/tp23/antinstaller/renderer/text/LargeSelectInputRenderer.java =================================================================== --- pal-portal/modules/ant-installer/trunk/src/org/tp23/antinstaller/renderer/text/LargeSelectInputRenderer.java (rev 0) +++ pal-portal/modules/ant-installer/trunk/src/org/tp23/antinstaller/renderer/text/LargeSelectInputRenderer.java 2008-06-11 13:36:41 UTC (rev 975) @@ -0,0 +1,115 @@ +/* + * Copyright 2005 Paul Hinds + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +package org.tp23.antinstaller.renderer.text; + +import java.io.BufferedReader; +import java.io.IOException; +import java.io.PrintStream; +import java.util.ResourceBundle; + +import org.tp23.antinstaller.InstallerContext; +import org.tp23.antinstaller.input.LargeSelectInput; +import org.tp23.antinstaller.input.OutputField; + + +public class LargeSelectInputRenderer + implements TextOutputFieldRenderer { + + private static final ResourceBundle res = ResourceBundle.getBundle("org.tp23.antinstaller.renderer.text.Res"); + private static final String nextChar = res.getString("nextChar"); + + protected InstallerContext ctx; + public LargeSelectInputRenderer() { + } + + public void setContext(InstallerContext ctx) { + this.ctx = ctx; + } + + public void renderOutput(OutputField field, BufferedReader reader, PrintStream out) throws IOException { + LargeSelectInput iField = (LargeSelectInput) field; + + printText(iField,out,reader); + String input = reader.readLine(); + out.println(); + if(input == null || input.equals("")) { + input = iField.getDefaultValue(); + } + else { + try { + int idx = Integer.parseInt(input.trim()); + input = iField.getOptions()[idx - 1].value; + } catch(Exception numFormatOrIndexOutOfBounds) { + return; + } + } + iField.setInputResult(input); + } + + public boolean isAbort(){ + return false; + } + private void printText(LargeSelectInput iField, PrintStream out,BufferedReader reader) throws IOException{ + out.println(iField.getDisplayText()); + LargeSelectInput.Option[] options = iField.getOptions(); + out.print(" "); + out.println(res.getString("availableOptions")); + StringBuffer optionsData = new StringBuffer(); + for (int i = 0; i < options.length; i++) { + optionsData.append(" "); + optionsData.append(i+1); + optionsData.append(") "); + optionsData.append(options[i].getText()); + if(iField.getDefaultValue().equals(options[i].value)){ + optionsData.append(" ["); + optionsData.append(res.getString("_default_")); + optionsData.append("]"); + } + optionsData.append("\n"); + } + optionsData.append(" "); + optionsData.append(res.getString("enterNumber")).append("\n"); + Pager pager = new Pager(optionsData.toString()); + String command = null; + do { + if (!pager.next(out)) { + break; + } + out.println(); + out.println(getNextInstructions()); + command = reader.readLine(); + } + while (command.toUpperCase().startsWith( nextChar )); + pager.rest(out); + + } + + + + /** + * renderError + * + * @param field InputField + * @param out PrintStream + */ + public void renderError(OutputField field, BufferedReader reader, PrintStream out) throws IOException { + ctx.getMessageRenderer().printMessage("Not a valid selection"); + renderOutput(field, reader, out); + } + private String getNextInstructions() { + return res.getString("large_select_next"); + } +} Property changes on: pal-portal/modules/ant-installer/trunk/src/org/tp23/antinstaller/renderer/text/LargeSelectInputRenderer.java ___________________________________________________________________ Name: svn:eol-style + native Added: pal-portal/modules/ant-installer/trunk/src/org/tp23/antinstaller/renderer/text/LicensePageRenderer.java =================================================================== --- pal-portal/modules/ant-installer/trunk/src/org/tp23/antinstaller/renderer/text/LicensePageRenderer.java (rev 0) +++ pal-portal/modules/ant-installer/trunk/src/org/tp23/antinstaller/renderer/text/LicensePageRenderer.java 2008-06-11 13:36:41 UTC (rev 975) @@ -0,0 +1,119 @@ +/* + * Copyright 2005 Paul Hinds + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +package org.tp23.antinstaller.renderer.text; + +import java.io.BufferedReader; +import java.io.IOException; +import java.io.InputStream; +import java.io.InputStreamReader; +import java.util.ResourceBundle; + +import org.tp23.antinstaller.InstallException; +import org.tp23.antinstaller.runtime.ConfigurationException; +import org.tp23.antinstaller.page.LicensePage; +import org.tp23.antinstaller.page.Page; + + +public class LicensePageRenderer + extends AbstractTextPageRenderer { + + private static final ResourceBundle res = ResourceBundle.getBundle("org.tp23.antinstaller.renderer.text.Res"); + private static final String nextChar = res.getString("nextChar"); + + private boolean usePaging = false; + + public LicensePageRenderer() { + } + + public boolean renderPage(Page page) throws InstallException { + if (page instanceof LicensePage) { + LicensePage lPage = (LicensePage) page; + String strUsePaging = lPage.getUsePaging(); + usePaging = strUsePaging!=null && isTrue(strUsePaging); + return renderLicensePage(lPage); + } + else { + throw new InstallException("Wrong Renderer in LicensePageRenderer.renderPage"); + } + } + + private boolean renderLicensePage(LicensePage page) throws InstallException { + try { + BufferedReader commandReader = reader; + out.println(); + out.println(res.getString("clickViewLicense")); + commandReader.readLine(); + + String resource = page.getResource(); + InputStream licensein = this.getClass().getResourceAsStream(resource); + if (licensein == null) { + throw new ConfigurationException("License resource '" + resource + "' is missing from installer"); + } + BufferedReader reader = new BufferedReader(new InputStreamReader(licensein)); + printHeader(page); + String lineread = null; + StringBuffer sb = new StringBuffer(); + + while ( (lineread = reader.readLine()) != null) { + sb.append(lineread); + sb.append('\n'); + } + // as per FindBugs + reader.close(); + + String command = null; + Pager pager = new Pager(sb.toString()); + if (usePaging) { + do { + if (!pager.next(out)) { + break; + } + out.println(); + out.println(getNextInstructions()); + command = commandReader.readLine(); + } + while (command.toUpperCase().startsWith(nextChar)); + pager.rest(out); + } + else { + out.println(pager.getText()); + } + + for (int i = 0; i < PAGE_DECO_WIDTH; i++) { + out.print('~'); + } + out.println(); + out.println(res.getString("licenseAccept")); + command = commandReader.readLine(); + command = command.trim(); + if (isTrue(command)) { + return true; + } + else { + page.setAbort(true); + return false; + } + } + catch (IOException ex) { + throw new InstallException("Not able to read license file", ex); + } + } + + private String getNextInstructions() { + return res.getString("license_next"); + } +} + Property changes on: pal-portal/modules/ant-installer/trunk/src/org/tp23/antinstaller/renderer/text/LicensePageRenderer.java ___________________________________________________________________ Name: svn:eol-style + native Added: pal-portal/modules/ant-installer/trunk/src/org/tp23/antinstaller/renderer/text/Pager.java =================================================================== --- pal-portal/modules/ant-installer/trunk/src/org/tp23/antinstaller/renderer/text/Pager.java (rev 0) +++ pal-portal/modules/ant-installer/trunk/src/org/tp23/antinstaller/renderer/text/Pager.java 2008-06-11 13:36:41 UTC (rev 975) @@ -0,0 +1,101 @@ +/* + * Copyright 2005 Paul Hinds + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +package org.tp23.antinstaller.renderer.text; + +import java.io.PrintStream; + + +/** + * + *

Used for the Text/Console input to show pages of text as opposed to displaying +* a long list of text that scrolls off the top of the page.

+ *

Copyright: Copyright (c) 2004

+ *

Company: tp23

+ * @author Paul Hinds + * @version $Id: Pager.java,v 1.2 2006/12/21 00:09:19 teknopaul Exp $ + */ +public class Pager { + + private char[] text; + private int linesPerPage = 20; + private int charsPerLine = 80; + private int stringIndex = 0; + + public Pager(String text) { + this.text = text.toCharArray(); + } + public Pager(){ + } + + public String getText() { + return new String(text); + } + + public void setText(String text) { + this.text = text.toCharArray(); + } + /** + * Print the rest of the text + */ + public void rest(PrintStream out){ + while(next(out)); +} + /** + * Print the next page + * @param out PrintStream + * @return boolean true if there is more text + */ + public boolean next(PrintStream out){ + int lineChars = 0; + int lastSpace = -1; + // loop past charaters, increment with lines + char[] lineBuffer = new char[charsPerLine+1]; + for (int lines = 0; lines < linesPerPage;) { + if(stringIndex >= text.length){ + return false; + } + lineBuffer[lineChars] = text[stringIndex]; + if(text[stringIndex] == ' '){ + lastSpace = lineChars; + } + if(text[stringIndex] == '\n'){ + String tmp = new String(lineBuffer, 0, lineChars + 1); + out.print(tmp); + lines++; + lineChars = 0; + lastSpace = -1; + } + else if(lineChars == charsPerLine){ + // handle lines ending with the last full word + if(lastSpace != -1){ + out.println(new String(lineBuffer, 0, lastSpace)); + stringIndex = stringIndex - (charsPerLine - lastSpace); + } + else { + out.println(new String(lineBuffer, 0, lineChars)); + } + lines++; + lineChars = 0; + lastSpace = -1; + } + else{ + lineChars++; + } + stringIndex++; + } + return true; + } +} Property changes on: pal-portal/modules/ant-installer/trunk/src/org/tp23/antinstaller/renderer/text/Pager.java ___________________________________________________________________ Name: svn:eol-style + native Added: pal-portal/modules/ant-installer/trunk/src/org/tp23/antinstaller/renderer/text/PasswordTextInputRenderer.java =================================================================== --- pal-portal/modules/ant-installer/trunk/src/org/tp23/antinstaller/renderer/text/PasswordTextInputRenderer.java (rev 0) +++ pal-portal/modules/ant-installer/trunk/src/org/tp23/antinstaller/renderer/text/PasswordTextInputRenderer.java 2008-06-11 13:36:41 UTC (rev 975) @@ -0,0 +1,167 @@ +/* + * Copyright 2005 Paul Hinds + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +package org.tp23.antinstaller.renderer.text; + +import java.io.BufferedReader; +import java.io.IOException; +import java.io.PrintStream; +import java.util.ResourceBundle; + +import org.tp23.antinstaller.InstallerContext; +import org.tp23.antinstaller.input.OutputField; +import org.tp23.antinstaller.input.PasswordTextInput; + + +public class PasswordTextInputRenderer extends ValidatedTextInputRenderer + + implements TextOutputFieldRenderer { + + private static final ResourceBundle res = ResourceBundle.getBundle("org.tp23.antinstaller.renderer.text.Res"); + + public PasswordTextInputRenderer() { + } + + public void setContext(InstallerContext ctx) { + this.ctx = ctx; + } + + public void renderOutput(OutputField field, BufferedReader reader, PrintStream out) throws IOException { + PasswordTextInput iField = (PasswordTextInput) field; + StringBuffer displayText = new StringBuffer(); + displayText.append(field.getDisplayText()); + displayText.append(" ["); + displayText.append(res.getString("_default_")); + displayText.append(":"); + displayText.append(iField.getDefaultValue()); + displayText.append("]"); + + String input = null; + if(OutputField.isTrue(iField.getTextMask())){ + input = new PasswordField().getPassword(displayText.toString()); + System.out.print("\r "); + } + else { + out.println(displayText.toString()); + input = reader.readLine(); + } + + out.println(); + out.println(); + if(input == null || input.equals("")){ + input = iField.getDefaultValue(); + } + iField.setInputResult(input); + } + public void renderError(OutputField field, BufferedReader reader, PrintStream out) throws IOException{ + out.println(getErrorMessage()); + renderOutput(field, reader, out); + } + public boolean isAbort(){ + return false; + } + + protected String getErrorMessage(){ + return res.getString("notCorrectPasswordFormat"); + } + + // shame this does not work + // does any one know a way to not echo passwords? +// private String readInput(InputStreamReader reader, PrintStream out) throws IOException{ +// StringBuffer sb = new StringBuffer(); +// char c = 0; +// while((c=(char)reader.read())!='\n'){ +// if(c==8)sb.setLength(sb.length()-1); +// sb.append(c); +// out.print((char)8); +// out.flush(); +// } +// return sb.toString(); +// } + + /* + * + * Taken from the SUN website + * @author Paul Hinds + * @version $Id: PasswordTextInputRenderer.java,v 1.4 2007/01/04 22:57:18 teknopaul Exp $ + */ + class MaskingThread extends Thread { + private boolean stop = false; + private int index; + private String prompt; + + public MaskingThread(String prompt) { + this.prompt = prompt; + } + + public void run() { + while (!stop) { + try { + // attempt masking at this rate + this.sleep(1); + } + catch (InterruptedException iex) { + iex.printStackTrace(); + } + if (!stop) { + System.out.print("\r" + prompt + " \r" + prompt); + } + System.out.flush(); + } + } + + public void stopMasking() { + this.stop = true; + } + } + + public class PasswordField { + + /** + *@param prompt The prompt to display to the user. + *@return The password as entered by the user. + */ + String getPassword(String prompt) throws IOException { + // password holder + StringBuffer password = new StringBuffer(); + MaskingThread maskingthread = new MaskingThread(prompt); + Thread thread = new Thread(maskingthread); + thread.start(); + // block until enter is pressed + while (true) { + char c = (char) System.in.read(); + // assume enter pressed, stop masking + maskingthread.stopMasking(); + if (c == '\r') { + c = (char) System.in.read(); + if (c == '\n') { + break; + } + else { + continue; + } + } + else if (c == '\n') { + break; + } + else { + // store the password + password.append(c); + } + } + return password.toString(); + } + } +} Property changes on: pal-portal/modules/ant-installer/trunk/src/org/tp23/antinstaller/renderer/text/PasswordTextInputRenderer.java ___________________________________________________________________ Name: svn:eol-style + native Added: pal-portal/modules/ant-installer/trunk/src/org/tp23/antinstaller/renderer/text/ProgressPageRenderer.java =================================================================== --- pal-portal/modules/ant-installer/trunk/src/org/tp23/antinstaller/renderer/text/ProgressPageRenderer.java (rev 0) +++ pal-portal/modules/ant-installer/trunk/src/org/tp23/antinstaller/renderer/text/ProgressPageRenderer.java 2008-06-11 13:36:41 UTC (rev 975) @@ -0,0 +1,68 @@ +/* + * Copyright 2005 Paul Hinds + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +package org.tp23.antinstaller.renderer.text; + +import java.io.IOException; +import java.io.PrintStream; + +import org.tp23.antinstaller.InstallException; +import org.tp23.antinstaller.page.Page; +import org.tp23.antinstaller.renderer.AntOutputRenderer; + + +public class ProgressPageRenderer extends AbstractTextPageRenderer implements AntOutputRenderer { + + public ProgressPageRenderer() { + } + + /** + * getErr + * + * @return PrintStream + */ + public PrintStream getErr() { + return System.err; + } + + + + /** + * getOut + * + * @return PrintStream + */ + public PrintStream getOut() { + return System.out; + } + + + + /** + * renderPage + * + * @param page Page + * @return boolean + */ + public boolean renderPage(Page page) throws InstallException { + try { + printHeader(page); + } + catch (IOException ex) { + throw new InstallException("Can not print header");// not very likely!! + } + return true; + } +} Property changes on: pal-portal/modules/ant-installer/trunk/src/org/tp23/antinstaller/renderer/text/ProgressPageRenderer.java ___________________________________________________________________ Name: svn:eol-style + native Added: pal-portal/modules/ant-installer/trunk/src/org/tp23/antinstaller/renderer/text/Res.properties =================================================================== --- pal-portal/modules/ant-installer/trunk/src/org/tp23/antinstaller/renderer/text/Res.properties (rev 0) +++ pal-portal/modules/ant-installer/trunk/src/org/tp23/antinstaller/renderer/text/Res.properties 2008-06-11 13:36:41 UTC (rev 975) @@ -0,0 +1,16 @@ +#org.tp23.antinstaller.renderer.text.Res +#Wed Nov 10 00:25:59 CET 2004 + +_required_=required +_default_=default +true=true +affirmativeChars=T,Y +licenseAccept=Do you accept the license? Y or N [default\:Y] +clickViewLicense=Press enter to view the license agreement +clickViewText=Press enter to continue +enterNumber=Enter a number +fileDoesNotExist=The File does not exist +license_next=enter 'N' for the next page, enter anything else to scroll to the the end +large_select_next=enter 'N' for the next page, enter anything else to scroll to the the end +nextChar=N +availableOptions=view available options Property changes on: pal-portal/modules/ant-installer/trunk/src/org/tp23/antinstaller/renderer/text/Res.properties ___________________________________________________________________ Name: svn:eol-style + native Added: pal-portal/modules/ant-installer/trunk/src/org/tp23/antinstaller/renderer/text/Res_de.properties =================================================================== --- pal-portal/modules/ant-installer/trunk/src/org/tp23/antinstaller/renderer/text/Res_de.properties (rev 0) +++ pal-portal/modules/ant-installer/trunk/src/org/tp23/antinstaller/renderer/text/Res_de.properties 2008-06-11 13:36:41 UTC (rev 975) @@ -0,0 +1,17 @@ +#org.tp23.antinstaller.renderer.text.Res +#Wed Nov 10 00:25:59 CET 2004 + +_required_=erforderlich +_default_=Voreinstellung +true=wahr +affirmativeChars=W,J +licenseAccept=Akzeptieren Sie diese Lizenz? J oder N [Vorgabe\:J] +clickViewLicense=Dr?ken Sie die Eingabetaste, um die Lizenzvereinbarung anzusehen +clickViewText=Press enter to continue +enterNumber=Geben Sie eine Zahl ein +fileDoesNotExist=Die Datei existiert nicht +license_next=Geben Sie 'N' f? die n?hste Seite ein, oder eine andere +Taste, um zum Ende zu springen +large_select_next=Geben Sie 'N' f? die n?hste Seite ein, oder eine andere Taste, um zum Ende zu springen +nextChar=N +availableOptions=Verf?bare Optionen ansehen \ No newline at end of file Property changes on: pal-portal/modules/ant-installer/trunk/src/org/tp23/antinstaller/renderer/text/Res_de.properties ___________________________________________________________________ Name: svn:eol-style + native Added: pal-portal/modules/ant-installer/trunk/src/org/tp23/antinstaller/renderer/text/Res_es.properties =================================================================== --- pal-portal/modules/ant-installer/trunk/src/org/tp23/antinstaller/renderer/text/Res_es.properties (rev 0) +++ pal-portal/modules/ant-installer/trunk/src/org/tp23/antinstaller/renderer/text/Res_es.properties 2008-06-11 13:36:41 UTC (rev 975) @@ -0,0 +1,15 @@ +#org.tp23.antinstaller.renderer.text.Res +#Wed Nov 10 00:25:59 CET 2004 +_required_=Requerido +_default_=Por defecto +true=Verdad +affirmativeChars=S,V +licenseAccept=Aceptar la licencia? S o N [Por defecto\:Y] +clickViewLicense=Pulsar intro para ver licencia. +clickViewText=Pulsar intro para continuar. +enterNumber=Introduzca un nmero. +fileDoesNotExist=El fichero no existe. +license_next=Pulse 'S' para ver la siguiente p?ina, pulse cualquier otra tecla para ir al final. +large_select_next=Pulse 'S' para ver la siguiente p?ina, pulse cualquier otra tecla para ir al final. +nextChar=S +availableOptions=Ver opciones disponibles. Property changes on: pal-portal/modules/ant-installer/trunk/src/org/tp23/antinstaller/renderer/text/Res_es.properties ___________________________________________________________________ Name: svn:eol-style + native Added: pal-portal/modules/ant-installer/trunk/src/org/tp23/antinstaller/renderer/text/Res_es_EU.properties =================================================================== --- pal-portal/modules/ant-installer/trunk/src/org/tp23/antinstaller/renderer/text/Res_es_EU.properties (rev 0) +++ pal-portal/modules/ant-installer/trunk/src/org/tp23/antinstaller/renderer/text/Res_es_EU.properties 2008-06-11 13:36:41 UTC (rev 975) @@ -0,0 +1,15 @@ +#org.tp23.antinstaller.renderer.text.Res +#Wed Nov 10 00:25:59 CET 2004 +_required_=Beharrezkoa +_default_=Lehenetsia +true=Egia +affirmativeChars=E,B +licenseAccept=Baimena onartzen duzu? E,B edo N [Lehenetsia\:Y] +clickViewLicense=Sakatu hemen baimena ikusteko. +clickViewText=Pulsar intro para continuar. +enterNumber=Sartu zenbaki bat. +fileDoesNotExist=Fitztegia ez da existitzen. +license_next=Sakatu 'N' hurrengo horrialdea ikusteko, sakatu beste edozer gauza bukaerara joateko. +large_select_next=Sakatu 'N' hurrengo horrialdea ikusteko, sakatu beste edozer gauza bukaerara joateko. +nextChar=N +availableOptions=ikusi aukerak Property changes on: pal-portal/modules/ant-installer/trunk/src/org/tp23/antinstaller/renderer/text/Res_es_EU.properties ___________________________________________________________________ Name: svn:eol-style + native Added: pal-portal/modules/ant-installer/trunk/src/org/tp23/antinstaller/renderer/text/SelectInputRenderer.java =================================================================== --- pal-portal/modules/ant-installer/trunk/src/org/tp23/antinstaller/renderer/text/SelectInputRenderer.java (rev 0) +++ pal-portal/modules/ant-installer/trunk/src/org/tp23/antinstaller/renderer/text/SelectInputRenderer.java 2008-06-11 13:36:41 UTC (rev 975) @@ -0,0 +1,95 @@ +/* + * Copyright 2005 Paul Hinds + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +package org.tp23.antinstaller.renderer.text; + +import java.io.BufferedReader; +import java.io.IOException; +import java.io.PrintStream; +import java.util.ResourceBundle; + +import org.tp23.antinstaller.InstallerContext; +import org.tp23.antinstaller.input.OutputField; +import org.tp23.antinstaller.input.SelectInput; + + +public class SelectInputRenderer + implements TextOutputFieldRenderer { + + private static final ResourceBundle res = ResourceBundle.getBundle("org.tp23.antinstaller.renderer.text.Res"); + + protected InstallerContext ctx; + public SelectInputRenderer() { + } + + public void setContext(InstallerContext ctx) { + this.ctx = ctx; + } + + public void renderOutput(OutputField field, BufferedReader reader, PrintStream out) throws IOException { + SelectInput iField = (SelectInput) field; + printText(iField,out); + + String input = reader.readLine(); + out.println(); + if(input == null || input.equals("")){ + input = iField.getDefaultValue(); + } + else { + try { + int idx = Integer.parseInt(input.trim()); + input = iField.getOptions()[idx - 1].value; + } catch(Exception numFormatOrIndexOutOfBounds){ + return; + } + } + iField.setInputResult(input); + } + public boolean isAbort(){ + return false; + } + private void printText(SelectInput iField, PrintStream out) throws IOException{ + out.println(iField.getDisplayText()); + SelectInput.Option[] options = iField.getOptions(); + out.print(" "); + out.println(res.getString("enterNumber")); + for (int i = 0; i < options.length; i++) { + out.print(" "); + out.print(i+1); + out.print(") "); + out.print(options[i].getText()); + if(iField.getDefaultValue().equals(options[i].value)){ + out.print(" ["); + out.print(res.getString("_default_")); + out.print("]"); + } + out.println(); + } + } + + + + /** + * renderError + * + * @param field InputField + * @param in InputStream + * @param out PrintStream + */ + public void renderError(OutputField field, BufferedReader reader, PrintStream out) throws IOException { + ctx.getMessageRenderer().printMessage("Not a valid selection"); + renderOutput(field, reader, out); + } +} Property changes on: pal-portal/modules/ant-installer/trunk/src/org/tp23/antinstaller/renderer/text/SelectInputRenderer.java ___________________________________________________________________ Name: svn:eol-style + native Added: pal-portal/modules/ant-installer/trunk/src/org/tp23/antinstaller/renderer/text/SimpleInputPageRenderer.java =================================================================== --- pal-portal/modules/ant-installer/trunk/src/org/tp23/antinstaller/renderer/text/SimpleInputPageRenderer.java (rev 0) +++ pal-portal/modules/ant-installer/trunk/src/org/tp23/antinstaller/renderer/text/SimpleInputPageRenderer.java 2008-06-11 13:36:41 UTC (rev 975) @@ -0,0 +1,91 @@ +/* + * Copyright 2005 Paul Hinds + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +package org.tp23.antinstaller.renderer.text; + +import java.io.BufferedReader; +import java.io.IOException; +import java.io.PrintStream; + +import org.tp23.antinstaller.InstallException; +import org.tp23.antinstaller.InstallerContext; +import org.tp23.antinstaller.ValidationException; +import org.tp23.antinstaller.input.OutputField; +import org.tp23.antinstaller.page.Page; +import org.tp23.antinstaller.page.SimpleInputPage; +import org.tp23.antinstaller.renderer.RendererFactory; + +public class SimpleInputPageRenderer + extends AbstractTextPageRenderer { + + public SimpleInputPageRenderer() { + } + + public boolean renderPage(Page page) throws InstallException{ + if (page instanceof SimpleInputPage) { + try { + return renderSimpleInputPage( (SimpleInputPage) page); + } + catch (ClassNotFoundException ex) { + // this would be a code error + throw new InstallException("Cant find acceptable TextField renderer in SimpleInputPageRenderer.renderPage:" + ex.getMessage(), + ex); + } + } + else { + //this would be a code error + throw new InstallException("Wrong Renderer in SimpleInputPageRenderer.renderPage"); + } + } + + private boolean renderSimpleInputPage(SimpleInputPage page) + throws InstallException, ClassNotFoundException, ValidationException + { + + try { + printHeader(page); + OutputField[] fields = page.getOutputField(); + return renderFields( getContext(), fields, reader, out ); + } + catch (IOException ex) { + // If you cant write to the console there is not much you can do + throw new InstallException("IOException",ex); + } + } + + public static boolean renderFields( InstallerContext context, OutputField[] fields, BufferedReader reader, PrintStream out ) + throws ClassNotFoundException, IOException, ValidationException, InstallException + { + + for (int f = 0; f < fields.length; f++) { + String text = fields[f].getExplanatoryText(); + if(text != null){ + out.println(text); + out.println(); + } + + TextOutputFieldRenderer frenderer = RendererFactory.getTextRenderer(fields[f]); + frenderer.setContext( context ); + frenderer.renderOutput(fields[f], reader, out); + if (frenderer.isAbort()) { + return false; + } + while(!fields[f].validate( context ) ){ + frenderer.renderError(fields[f], reader, out); + }; + } + return true; + } +} Property changes on: pal-portal/modules/ant-installer/trunk/src/org/tp23/antinstaller/renderer/text/SimpleInputPageRenderer.java ___________________________________________________________________ Name: svn:eol-style + native Added: pal-portal/modules/ant-installer/trunk/src/org/tp23/antinstaller/renderer/text/SplashPageRenderer.java =================================================================== --- pal-portal/modules/ant-installer/trunk/src/org/tp23/antinstaller/renderer/text/SplashPageRenderer.java (rev 0) +++ pal-portal/modules/ant-installer/trunk/src/org/tp23/antinstaller/renderer/text/SplashPageRenderer.java 2008-06-11 13:36:41 UTC (rev 975) @@ -0,0 +1,49 @@ +/* + * Copyright 2005 Paul Hinds + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +package org.tp23.antinstaller.renderer.text; + +import java.io.IOException; + +import org.tp23.antinstaller.InstallException; +import org.tp23.antinstaller.page.Page; +import org.tp23.antinstaller.page.SplashPage; + +public class SplashPageRenderer extends AbstractTextPageRenderer { + public SplashPageRenderer() { + } + public boolean renderPage(Page page) throws InstallException { + if (page instanceof SplashPage) { + SplashPage sPage = (SplashPage) page; + return renderSplashPage(sPage); + } + else { + throw new InstallException("Wrong Renderer in SplashPageRenderer.renderPage"); + } + } + private boolean renderSplashPage(SplashPage page) throws InstallException { + try { + printHeader(page); + out.println(); + out.println(page.getAltText()); + + reader.read(); + return true; + } + catch (IOException ex) { + throw new InstallException("IOException"); + } + } +} Property changes on: pal-portal/modules/ant-installer/trunk/src/org/tp23/antinstaller/renderer/text/SplashPageRenderer.java ___________________________________________________________________ Name: svn:eol-style + native Added: pal-portal/modules/ant-installer/trunk/src/org/tp23/antinstaller/renderer/text/TargetInputRenderer.java =================================================================== --- pal-portal/modules/ant-installer/trunk/src/org/tp23/antinstaller/renderer/text/TargetInputRenderer.java (rev 0) +++ pal-portal/modules/ant-installer/trunk/src/org/tp23/antinstaller/renderer/text/TargetInputRenderer.java 2008-06-11 13:36:41 UTC (rev 975) @@ -0,0 +1,96 @@ +/* + * Copyright 2005 Paul Hinds + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +package org.tp23.antinstaller.renderer.text; + +import java.io.BufferedReader; +import java.io.IOException; +import java.io.PrintStream; +import java.util.ResourceBundle; + +import org.tp23.antinstaller.InstallerContext; +import org.tp23.antinstaller.input.InputField; +import org.tp23.antinstaller.input.OutputField; +import org.tp23.antinstaller.input.TargetInput; + + +public class TargetInputRenderer + implements TextOutputFieldRenderer { + + private static final ResourceBundle res = ResourceBundle.getBundle("org.tp23.antinstaller.renderer.text.Res"); + + protected InstallerContext ctx; + public TargetInputRenderer() { + } + + public void setContext(InstallerContext ctx) { + this.ctx = ctx; + } + + public void renderOutput(OutputField field, BufferedReader reader, PrintStream out) throws IOException { + TargetInput iField = (TargetInput) field; + out.println("Install the following component?"); + out.print(iField.getDisplayText()); + + out.print(" ["); + out.print(res.getString("_default_")); + out.print(":"); + out.print(iField.getDefaultValue()); + out.print("]"); + + if (InputField.isTrue(iField.getForce())) { + out.print(" ["); + out.print(res.getString("_required_")); + out.println("]"); + ctx.getCurrentPage().addTarget(iField.getIdx(), iField.getTarget()); + iField.setInputResult("true"); + out.println(); + return; + } + + + + out.println(); + String input = reader.readLine(); + out.println(); + if (input == null || input.trim().equals("")){ + input = iField.getDefaultValue(); + } + if(InputField.isTrue(input)){ + ctx.getCurrentPage().addTarget(iField.getIdx(), iField.getTarget()); + iField.setInputResult("true"); + } + else{ + ctx.getCurrentPage().removeTarget(iField.getIdx()); + iField.setInputResult("false"); + } + + } + + public boolean isAbort() { + return false; + } + + + + /** + * renderError + * + * @param field InputField + * @param out PrintStream + */ + public void renderError(OutputField field, BufferedReader reader, PrintStream out) { + } +} Property changes on: pal-portal/modules/ant-installer/trunk/src/org/tp23/antinstaller/renderer/text/TargetInputRenderer.java ___________________________________________________________________ Name: svn:eol-style + native Added: pal-portal/modules/ant-installer/trunk/src/org/tp23/antinstaller/renderer/text/TargetSelectInputRenderer.java =================================================================== --- pal-portal/modules/ant-installer/trunk/src/org/tp23/antinstaller/renderer/text/TargetSelectInputRenderer.java (rev 0) +++ pal-portal/modules/ant-installer/trunk/src/org/tp23/antinstaller/renderer/text/TargetSelectInputRenderer.java 2008-06-11 13:36:41 UTC (rev 975) @@ -0,0 +1,79 @@ +/* + * Copyright 2005 Paul Hinds, Mark Anderson + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +package org.tp23.antinstaller.renderer.text; + +import java.io.BufferedReader; +import java.io.IOException; +import java.io.PrintStream; +import java.util.ResourceBundle; + +import org.tp23.antinstaller.input.OutputField; +import org.tp23.antinstaller.input.TargetSelectInput; + +/** + * + * @author Paul Hinds, Mark Anderson + * @version $Id: TargetSelectInputRenderer.java,v 1.3 2007/01/09 22:41:40 teknopaul Exp $ + */ +public class TargetSelectInputRenderer + extends SelectInputRenderer { + + private static final ResourceBundle res = ResourceBundle.getBundle("org.tp23.antinstaller.renderer.text.Res"); + + public TargetSelectInputRenderer() { + } + + public void renderOutput(OutputField field, BufferedReader reader, PrintStream out) throws IOException { + TargetSelectInput iField = (TargetSelectInput) field; + printText(iField,out); + + String input = reader.readLine(); + out.println(); + if(input == null || input.equals("")) + input = iField.getDefaultValue(); + else{ + try{ + int idx = Integer.parseInt(input.trim()); + input = iField.getOptions()[idx - 1].value; + } catch(Exception numFormatOrIndexOutOfBounds) { + return; + } + } + ctx.getCurrentPage().removeTarget(iField.getIdx()); + ctx.getCurrentPage().addTarget(iField.getIdx(), input); + iField.setInputResult(input); + } + + private void printText(TargetSelectInput iField, PrintStream out) throws IOException{ + out.println(iField.getDisplayText()); + TargetSelectInput.Option[] options = iField.getOptions(); + out.print(" "); + out.println(res.getString("enterNumber")); + for (int i = 0; i < options.length; i++) { + out.print(" "); + out.print(i+1); + out.print(") "); + out.print(options[i].getText()); + if(iField.getDefaultValue().equals(options[i].value)){ + out.print(" ["); + out.print(res.getString("_default_")); + out.print("]"); + } + out.println(); + } + } + +} Property changes on: pal-portal/modules/ant-installer/trunk/src/org/tp23/antinstaller/renderer/text/TargetSelectInputRenderer.java ___________________________________________________________________ Name: svn:eol-style + native Added: pal-portal/modules/ant-installer/trunk/src/org/tp23/antinstaller/renderer/text/TextMessageRenderer.java =================================================================== --- pal-portal/modules/ant-installer/trunk/src/org/tp23/antinstaller/renderer/text/TextMessageRenderer.java (rev 0) +++ pal-portal/modules/ant-installer/trunk/src/org/tp23/antinstaller/renderer/text/TextMessageRenderer.java 2008-06-11 13:36:41 UTC (rev 975) @@ -0,0 +1,74 @@ +/* + * Copyright 2005 Paul Hinds + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +package org.tp23.antinstaller.renderer.text; + +import java.io.BufferedReader; +import java.io.IOException; +import java.io.InputStreamReader; + +import org.tp23.antinstaller.InstallerContext; +import org.tp23.antinstaller.renderer.MessageRenderer; + +/** + * + *

Render user messages to the console

+ *

+ *

Copyright: Copyright (c) 2004

+ *

Company: tp23

+ * @author Paul Hinds + * @version $Id: TextMessageRenderer.java,v 1.3 2007/01/09 22:41:40 teknopaul Exp $ + */ +public class TextMessageRenderer + implements MessageRenderer { + + private InstallerContext ctx = null; + + public TextMessageRenderer() { + } + + public void setInstallerContext(InstallerContext ctx){ + this.ctx = ctx; + } + public void printMessage(String message){ + System.out.println(message); + } + + public boolean prompt(String message){ + try { + System.out.println(message); + // FIXME need to read directly from InputStreamReader and stop at first \n or \r + // test the following +// InputStreamReader isr = new InputStreamReader(System.in); +// int intChar = -1; +// StringBuffer sb = new StringBuffer(); +// while((intChar = isr.read()) != -1 && intChar != '\n' && intChar != '\r'){ +// sb.append((char)intChar); +// } +// String line = sb.toString(); + + BufferedReader reader = new BufferedReader(new InputStreamReader(System.in)); + String line = reader.readLine(); + if (line != null && !line.equals("") && line.trim().length() > 0) { + return Character.toUpperCase(line.trim().charAt(0)) == 'Y' || + Character.toUpperCase(line.trim().charAt(0)) == 'T' ; + } + return false; + } + catch (IOException ex) { + throw new RuntimeException("IOException", ex); + } + } +} Property changes on: pal-portal/modules/ant-installer/trunk/src/org/tp23/antinstaller/renderer/text/TextMessageRenderer.java ___________________________________________________________________ Name: svn:eol-style + native Added: pal-portal/modules/ant-installer/trunk/src/org/tp23/antinstaller/renderer/text/TextOutputFieldRenderer.java =================================================================== --- pal-portal/modules/ant-installer/trunk/src/org/tp23/antinstaller/renderer/text/TextOutputFieldRenderer.java (rev 0) +++ pal-portal/modules/ant-installer/trunk/src/org/tp23/antinstaller/renderer/text/TextOutputFieldRenderer.java 2008-06-11 13:36:41 UTC (rev 975) @@ -0,0 +1,53 @@ +/* + * Copyright 2005 Paul Hinds + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +package org.tp23.antinstaller.renderer.text; + +import java.io.BufferedReader; +import java.io.IOException; +import java.io.PrintStream; + +import org.tp23.antinstaller.InstallException; +import org.tp23.antinstaller.InstallerContext; +import org.tp23.antinstaller.input.OutputField; + + + +/** + * + *

Renders text OutputFields, TextOutputFieldRenderer should provide a no args constructor.

+ *

The package name for TextOutputFieldRenderer is critical

+ * BufferedInputStream is used for input to prevent new Buffered reader swallowing more input from the + * input stream than is strictly required + *

Copyright: Copyright (c) 2004

+ *

Company: tp23

+ * @author Paul Hinds + * @version $Id: TextOutputFieldRenderer.java,v 1.4 2006/12/21 00:03:01 teknopaul Exp $ + */ +public interface TextOutputFieldRenderer { + public void setContext(InstallerContext ctx); + + public void renderOutput(OutputField field, BufferedReader reader, PrintStream out) throws InstallException, IOException; + /** + * Called when validation fails + * @param field InputField + * @param in InputStream + * @param out PrintStream + * @throws IOException + */ + public void renderError(OutputField field, BufferedReader reader, PrintStream out) throws IOException; + /** fields have abort for text since each field has its own input line*/ + public boolean isAbort(); +} Property changes on: pal-portal/modules/ant-installer/trunk/src/org/tp23/antinstaller/renderer/text/TextOutputFieldRenderer.java ___________________________________________________________________ Name: svn:eol-style + native Added: pal-portal/modules/ant-installer/trunk/src/org/tp23/antinstaller/renderer/text/TextPageRenderer.java =================================================================== --- pal-portal/modules/ant-installer/trunk/src/org/tp23/antinstaller/renderer/text/TextPageRenderer.java (rev 0) +++ pal-portal/modules/ant-installer/trunk/src/org/tp23/antinstaller/renderer/text/TextPageRenderer.java 2008-06-11 13:36:41 UTC (rev 975) @@ -0,0 +1,101 @@ +/* + * Copyright 2005 Paul Hinds + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +package org.tp23.antinstaller.renderer.text; + +import java.io.BufferedReader; +import java.io.IOException; +import java.io.InputStream; +import java.io.InputStreamReader; +import java.util.ResourceBundle; + +import org.tp23.antinstaller.InstallException; +import org.tp23.antinstaller.page.Page; +import org.tp23.antinstaller.page.TextPage; + + +public class TextPageRenderer + extends AbstractTextPageRenderer { + + private static final ResourceBundle res = ResourceBundle.getBundle("org.tp23.antinstaller.renderer.text.Res"); + private static final String nextChar = res.getString("nextChar"); + + public TextPageRenderer() { + } + + public boolean renderPage(Page page) throws InstallException { + if (page instanceof TextPage) { + TextPage lPage = (TextPage) page; + return renderTextPage(lPage); + } + else { + throw new InstallException("Wrong Renderer in TextPageRenderer.renderPage"); + } + } + + private boolean renderTextPage(TextPage page) throws InstallException { + try { + BufferedReader commandReader = reader;//new BufferedReader(new InputStreamReader(in)); + + String resource = page.getTextResource(); + InputStream textin = this.getClass().getResourceAsStream(resource); + BufferedReader reader = new BufferedReader(new InputStreamReader(textin)); + printHeader(page); + String lineread = null; + StringBuffer sb = new StringBuffer(); + + while ( (lineread = reader.readLine()) != null) { + sb.append(lineread); + sb.append('\n'); + } + // as per FindBugs + reader.close(); + + // parse property references + String parsedText = getContext().getInstaller().getResultContainer().getDefaultValue(sb.toString()); + + String command = null; + Pager pager = new Pager(parsedText); + do { + if (!pager.next(out)) { + break; + } + out.println(); + out.println(getNextInstructions()); + command = commandReader.readLine(); + } + while (command.toUpperCase().startsWith(nextChar)); + pager.rest(out); + + for (int i = 0; i < PAGE_DECO_WIDTH; i++) { + out.print('~'); + } + + out.println(); + out.println(res.getString("clickViewText")); + commandReader.readLine(); + + return true; + } + catch (IOException ex) { + throw new InstallException("Not able to read text file", ex); + } + } + + private String getNextInstructions() { + return res.getString("license_next"); + } +} + Property changes on: pal-portal/modules/ant-installer/trunk/src/org/tp23/antinstaller/renderer/text/TextPageRenderer.java ___________________________________________________________________ Name: svn:eol-style + native Added: pal-portal/modules/ant-installer/trunk/src/org/tp23/antinstaller/renderer/text/UnvalidatedTextInputRenderer.java =================================================================== --- pal-portal/modules/ant-installer/trunk/src/org/tp23/antinstaller/renderer/text/UnvalidatedTextInputRenderer.java (rev 0) +++ pal-portal/modules/ant-installer/trunk/src/org/tp23/antinstaller/renderer/text/UnvalidatedTextInputRenderer.java 2008-06-11 13:36:41 UTC (rev 975) @@ -0,0 +1,74 @@ +/* + * Copyright 2005 Paul Hinds + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +package org.tp23.antinstaller.renderer.text; + +import java.io.BufferedReader; +import java.io.IOException; +import java.io.PrintStream; +import java.util.ResourceBundle; + +import org.tp23.antinstaller.InstallerContext; +import org.tp23.antinstaller.input.OutputField; +import org.tp23.antinstaller.input.UnvalidatedTextInput; + + +public class UnvalidatedTextInputRenderer + implements TextOutputFieldRenderer { + + private static final ResourceBundle res = ResourceBundle.getBundle("org.tp23.antinstaller.renderer.text.Res"); + + protected InstallerContext ctx; + public UnvalidatedTextInputRenderer() { + } + + public void setContext(InstallerContext ctx) { + this.ctx = ctx; + } + + public void renderOutput(OutputField field, BufferedReader reader, PrintStream out) throws IOException { + UnvalidatedTextInput iField = (UnvalidatedTextInput) field; + out.print(field.getDisplayText()); + + out.print(" ["); + out.print(res.getString("_default_")); + out.print(":"); + out.print(iField.getDefaultValue()); + out.print("]"); + + + //BufferedReader reader = new BufferedReader(new InputStreamReader(in)); + out.println(); + String input = reader.readLine(); + out.println(); + if(input==null || input.equals(""))input=iField.getDefaultValue(); + iField.setInputResult(input); + } + public boolean isAbort(){ + return false; + } + + + + /** + * renderError + * + * @param field InputField + * @param in InputStream + * @param out PrintStream + */ + public void renderError(OutputField field, BufferedReader reader, PrintStream out) { + } +} Property changes on: pal-portal/modules/ant-installer/trunk/src/org/tp23/antinstaller/renderer/text/UnvalidatedTextInputRenderer.java ___________________________________________________________________ Name: svn:eol-style + native Added: pal-portal/modules/ant-installer/trunk/src/org/tp23/antinstaller/renderer/text/ValidatedTextInputRenderer.java =================================================================== --- pal-portal/modules/ant-installer/trunk/src/org/tp23/antinstaller/renderer/text/ValidatedTextInputRenderer.java (rev 0) +++ pal-portal/modules/ant-installer/trunk/src/org/tp23/antinstaller/renderer/text/ValidatedTextInputRenderer.java 2008-06-11 13:36:41 UTC (rev 975) @@ -0,0 +1,66 @@ +/* + * Copyright 2005 Paul Hinds + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +package org.tp23.antinstaller.renderer.text; + +import java.io.BufferedReader; +import java.io.IOException; +import java.io.PrintStream; +import java.util.ResourceBundle; + +import org.tp23.antinstaller.InstallerContext; +import org.tp23.antinstaller.input.OutputField; +import org.tp23.antinstaller.input.ValidatedTextInput; + + +public class ValidatedTextInputRenderer + implements TextOutputFieldRenderer { + + private static final ResourceBundle res = ResourceBundle.getBundle("org.tp23.antinstaller.renderer.text.Res"); + + protected InstallerContext ctx; + public ValidatedTextInputRenderer() { + } + + public void setContext(InstallerContext ctx) { + this.ctx = ctx; + } + + public void renderOutput(OutputField field, BufferedReader reader, PrintStream out) throws IOException { + ValidatedTextInput iField = (ValidatedTextInput) field; + out.print(field.getDisplayText()); + + out.print(" ["); + out.print(res.getString("_default_")); + out.print(":"); + out.print(iField.getDefaultValue()); + out.println("]"); + + + //BufferedReader reader = new BufferedReader(new InputStreamReader(in)); + String input = reader.readLine(); + out.println(); + if(input==null || input.equals(""))input=iField.getDefaultValue(); + iField.setInputResult(input); + } + public void renderError(OutputField field, BufferedReader reader, PrintStream out) throws IOException{ + //ValidatedTextInput iField = (ValidatedTextInput) field; + out.println("The input is not of the correct format"); + renderOutput(field, reader, out); + } + public boolean isAbort(){ + return false; + } +} Property changes on: pal-portal/modules/ant-installer/trunk/src/org/tp23/antinstaller/renderer/text/ValidatedTextInputRenderer.java ___________________________________________________________________ Name: svn:eol-style + native Added: pal-portal/modules/ant-installer/trunk/src/org/tp23/antinstaller/renderer/text/package.html =================================================================== --- pal-portal/modules/ant-installer/trunk/src/org/tp23/antinstaller/renderer/text/package.html (rev 0) +++ pal-portal/modules/ant-installer/trunk/src/org/tp23/antinstaller/renderer/text/package.html 2008-06-11 13:36:41 UTC (rev 975) @@ -0,0 +1,9 @@ + + + + +Renderers for the command line interface. + Property changes on: pal-portal/modules/ant-installer/trunk/src/org/tp23/antinstaller/renderer/text/package.html ___________________________________________________________________ Name: svn:eol-style + native Added: pal-portal/modules/ant-installer/trunk/src/org/tp23/antinstaller/runtime/AntRunner.java =================================================================== --- pal-portal/modules/ant-installer/trunk/src/org/tp23/antinstaller/runtime/AntRunner.java (rev 0) +++ pal-portal/modules/ant-installer/trunk/src/org/tp23/antinstaller/runtime/AntRunner.java 2008-06-11 13:36:41 UTC (rev 975) @@ -0,0 +1,54 @@ +/* + * Copyright 2005 Paul Hinds + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +package org.tp23.antinstaller.runtime; + +import org.tp23.antinstaller.InstallerContext; +import org.tp23.antinstaller.antmod.RuntimeLauncher; +import org.tp23.antinstaller.page.Page; + +/** + * Abstract Runner superclass that handles the runPost(page) to execute + * ant tasks mid display. + * @author teknopaul + */ +public abstract class AntRunner implements Runner{ + + private RuntimeLauncher launcher = null; + private InstallerContext ctx; + + public AntRunner(InstallerContext ctx) { + this.ctx = ctx; + } + + protected void runPost(Page page){ + String postTarget = page.getPostDisplayTarget(); + if(postTarget != null){ + if(launcher == null){ + prepareLauncher(); + } + launcher.updateProps(); + launcher.run(postTarget); + } + } + /** + * This should never get run if there are no postTargets + * + */ + private void prepareLauncher(){ + launcher = new RuntimeLauncher(ctx); + launcher.parseProject(); + } +} Property changes on: pal-portal/modules/ant-installer/trunk/src/org/tp23/antinstaller/runtime/AntRunner.java ___________________________________________________________________ Name: svn:eol-style + native Added: pal-portal/modules/ant-installer/trunk/src/org/tp23/antinstaller/runtime/AutoSwingRunner.java =================================================================== --- pal-portal/modules/ant-installer/trunk/src/org/tp23/antinstaller/runtime/AutoSwingRunner.java (rev 0) +++ pal-portal/modules/ant-installer/trunk/src/org/tp23/antinstaller/runtime/AutoSwingRunner.java 2008-06-11 13:36:41 UTC (rev 975) @@ -0,0 +1,53 @@ +/* + * Copyright 2005 Paul Hinds + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +package org.tp23.antinstaller.runtime; + +import java.util.List; + +import org.tp23.antinstaller.InstallerContext; +import org.tp23.antinstaller.page.Page; +import org.tp23.antinstaller.renderer.swing.SwingPageRenderer; +/** + * Swing runner that starts with the last page bypassing all the other pages. + * This will be used during auto builds where the properties are already known. + * @author teknopaul + * + */ +public class AutoSwingRunner extends SwingRunner { + + public AutoSwingRunner(InstallerContext ctx){ + super(ctx); + } + protected void showFirstPage() throws Exception { + Page[] pages = installer.getPages(); + // run all postDisplayTargets as if the pages were shown + for (int i = 0; i < pages.length; i++) { + Page page = pages[i]; + if(page.getPostDisplayTarget() != null){ + if( ifHelper.ifProperty(page) && + ifHelper.ifTarget(page, ctx.getInstaller().getPages()) ){ // page would have been shown + runPost(page); + } + } + } + + // shows the LAST page directly which should be the Progress page + ctx.setCurrentPage(pages[pages.length - 1]); + List pageRenderers = getPageRenderers(); + renderNext((SwingPageRenderer)pageRenderers.get(pageRenderers.size() - 1)); + } + +} Property changes on: pal-portal/modules/ant-installer/trunk/src/org/tp23/antinstaller/runtime/AutoSwingRunner.java ___________________________________________________________________ Name: svn:eol-style + native Added: pal-portal/modules/ant-installer/trunk/src/org/tp23/antinstaller/runtime/AutoTextRunner.java =================================================================== --- pal-portal/modules/ant-installer/trunk/src/org/tp23/antinstaller/runtime/AutoTextRunner.java (rev 0) +++ pal-portal/modules/ant-installer/trunk/src/org/tp23/antinstaller/runtime/AutoTextRunner.java 2008-06-11 13:36:41 UTC (rev 975) @@ -0,0 +1,45 @@ +/* + * Copyright 2005 Paul Hinds + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +package org.tp23.antinstaller.runtime; + +import java.io.IOException; + +import org.tp23.antinstaller.InstallException; +import org.tp23.antinstaller.InstallerContext; +import org.tp23.antinstaller.page.Page; + +public class AutoTextRunner extends TextRunner { + + public AutoTextRunner(InstallerContext ctx) throws IOException{ + super(ctx); + } + + public boolean runInstaller() throws InstallException { + Page[] pages = installer.getPages(); + // run all postDisplayTargets as if the pages were shown + for (int i = 0; i < pages.length; i++) { + Page page = pages[i]; + if(page.getPostDisplayTarget() != null) { + if( ifHelper.ifProperty(page) && + ifHelper.ifTarget(page, ctx.getInstaller().getPages()) ) { // page would have been shown + runPost(page); + } + } + } + + return true; + } +} Property changes on: pal-portal/modules/ant-installer/trunk/src/org/tp23/antinstaller/runtime/AutoTextRunner.java ___________________________________________________________________ Name: svn:eol-style + native Added: pal-portal/modules/ant-installer/trunk/src/org/tp23/antinstaller/runtime/ConfigurationException.java =================================================================== --- pal-portal/modules/ant-installer/trunk/src/org/tp23/antinstaller/runtime/ConfigurationException.java (rev 0) +++ pal-portal/modules/ant-installer/trunk/src/org/tp23/antinstaller/runtime/ConfigurationException.java 2008-06-11 13:36:41 UTC (rev 975) @@ -0,0 +1,38 @@ +/* + * Copyright 2005 Paul Hinds + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +package org.tp23.antinstaller.runtime; + +import org.tp23.antinstaller.InstallException; + + +/** + *

A Runtime exception that implies the config file is wrong.

+ */ +public class ConfigurationException + extends InstallException { + public ConfigurationException() { + super(); + } + + public ConfigurationException(String message) { + super(message); + } + + public ConfigurationException(String message, Throwable cause) { + super(message, cause); + } + +} Property changes on: pal-portal/modules/ant-installer/trunk/src/org/tp23/antinstaller/runtime/ConfigurationException.java ___________________________________________________________________ Name: svn:eol-style + native Added: pal-portal/modules/ant-installer/trunk/src/org/tp23/antinstaller/runtime/ConfigurationLoader.java =================================================================== --- pal-portal/modules/ant-installer/trunk/src/org/tp23/antinstaller/runtime/ConfigurationLoader.java (rev 0) +++ pal-portal/modules/ant-installer/trunk/src/org/tp23/antinstaller/runtime/ConfigurationLoader.java 2008-06-11 13:36:41 UTC (rev 975) @@ -0,0 +1,353 @@ +/* + * Copyright 2005 Paul Hinds + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +package org.tp23.antinstaller.runtime; + +import java.io.File; +import java.io.IOException; +import java.util.ArrayList; +import java.util.HashSet; +import java.util.Iterator; +import java.util.Set; + +import org.tp23.antinstaller.InstallException; +import org.tp23.antinstaller.Installer; +import org.tp23.antinstaller.PropertiesFileRenderer; +import org.tp23.antinstaller.input.ConditionalField; +import org.tp23.antinstaller.input.InputField; +import org.tp23.antinstaller.input.OutputField; +import org.tp23.antinstaller.input.ResultContainer; +import org.tp23.antinstaller.input.SelectInput; +import org.tp23.antinstaller.input.TargetInput; +import org.tp23.antinstaller.input.TargetSelectInput; +import org.tp23.antinstaller.page.Page; +import org.tp23.antinstaller.page.ProgressPage; +import org.tp23.antinstaller.page.SimpleInputPage; +import org.tp23.antinstaller.renderer.swing.plaf.LookAndFeelFactory; +import org.tp23.antinstaller.runtime.exe.LoadConfigFilter; +import org.tp23.antinstaller.runtime.exe.PropertyLoaderFilter; +import org.tp23.antinstaller.runtime.logic.ExpressionBuilder; +/** + * + *

Loads the configuration file into memory as an Installer object.

+ *

This class also contains the main() method to check the config files for common errors

+ *

Copyright: Copyright (c) 2004

+ *

Company: tp23

+ * @todo this should be an interface not a class + * @author Paul Hinds + * @version $Id: ConfigurationLoader.java,v 1.15 2007/01/28 08:44:43 teknopaul Exp $ + */ +public class ConfigurationLoader extends LoadConfigFilter{ + + /** + * Command line config checker + * @param args String[] + * @throws InstallException + */ + public static void main(String[] args) { + ConfigurationLoader configurationLoader = new ConfigurationLoader(); + String configFile = INSTALLER_CONFIG_FILE; + if(args.length > 1 && args[1].endsWith(".xml")){ + configFile = args[1]; + } + int ret = 1; + try { + configurationLoader.readConfig(new File(args[0]), configFile); + ret = configurationLoader.validate(); + + if(ret > 0){ + System.out.println("VALIDATION FAILED"); + } + } + catch (ConfigurationException ex) { + ex.printStackTrace(); + System.exit(ret); + } + catch (IOException ex) { + ex.printStackTrace(); + System.exit(ret); + } catch (InstallException ex) { + // probably ifProperty syntax wrong + ex.printStackTrace(); + System.exit(ret); + } + } + + /** + * This method is not valid until super.readConfig() has been run + * @return + */ + public Installer getInstaller(){ + return installer; + } + + public int validate() throws IOException, ConfigurationException, InstallException{ + Page[] pages = installer.getPages(); + boolean foundErrors = false; + Set pageNames = new HashSet(); + Set targets = new HashSet(); + Set propertyNames = new HashSet(); + Set pagePropertyNames = null; + + if(validateInstallerAttributes()){ + foundErrors = true; + } + + for (int p = 0; p < pages.length; p++) { + System.out.println("Checking page: " + pages[p].getName() ); + if(pageNames.contains(pages[p].getName())){ + System.out.println("Error: page name '" + + pages[p].getName() + + "' repeated - auto loading of configuration will fail"); + foundErrors = true; + } + pageNames.add(pages[p].getName()); + + //TODO check page requirements + //test ifProperty syntax + // TODO passes validation even if nothing will evaluate + if (pages[p] instanceof SimpleInputPage) { + SimpleInputPage sPage = (SimpleInputPage)pages[p]; + if(sPage.getIfProperty() != null){ + try { + ResultContainer mock = new ResultContainer(); + ExpressionBuilder.parseLogicalExpressions( mock, + sPage.getIfProperty() ); + } + catch( ConfigurationException configExc ){ + System.out.println("Error: loading ifProperty," + sPage.getIfProperty() + " ,page: " + pages[p].getName() ); + foundErrors = true; + } + } + } + + + pagePropertyNames = new HashSet(); + + OutputField[] fields = pages[p].getOutputField(); + for (int f = 0; f < fields.length; f++) { + if(!fields[f].validateObject()){ + foundErrors = true; + System.out.println("Error in page:" + pages[p].getName()); + } + if(fields[f] instanceof TargetInput){ + TargetInput tgtInput = (TargetInput)fields[f]; + targets.add(tgtInput.getTarget()); + } + if(fields[f] instanceof InputField && !(fields[f] instanceof ConditionalField) ){ + InputField genericInput = (InputField)fields[f]; + if(genericInput.getProperty().endsWith(PropertiesFileRenderer.TARGETS_SUFFIX)){ + System.out.println("Error: invalid property name:" + genericInput.getProperty()); + System.out.println("InputField names must not end with -targets"); + } + String propertyName = genericInput.getProperty(); + //System.out.println("Checking page.property: " + pages[p].getName() + "," + propertyName ); + if(propertyNames.contains(propertyName)){ + //foundErrors = true; + System.out.println("Repeated property name:" + propertyName); + System.out.println("Loading defaults from file will probably not work:" + propertyName); + } + else{ + propertyNames.add(propertyName); + } + // repeated properties on the same page are an error always + if(pagePropertyNames.contains(propertyName)){ + foundErrors = true; + System.out.println("Repeated property name: page=" + + pages[p].getName() + ", property=" + propertyName); + } + else{ + pagePropertyNames.add(propertyName); + } + + } + } + + } + System.out.println("Finished checking config inputs"); + // check page structure + if(!(pages[pages.length-1] instanceof ProgressPage)){ + foundErrors = true; + System.out.println("Last Page should be a progress page"); + } + else{ + if (pages[pages.length-1].getPostDisplayTarget() != null){ + foundErrors = true; + System.out.println("Progress pages do not support postDisplayTarget"); + } + } + // check for targets + int numOfPageTargets = 0; + for (int p = 0; p < pages.length; p++) { + numOfPageTargets += pages[p].getAllTargets().size(); + } + if(numOfPageTargets == 0){ + System.out.println("Warning: No Page Targets (not a problem if there are target input types)"); + } + + Iterator iter = targets.iterator(); + while (iter.hasNext()) { + String tgt = (String) iter.next(); + if(tgt.endsWith(PropertiesFileRenderer.TARGETS_SUFFIX)){ + System.out.println("Error: invalid target name:" + tgt); + System.out.println("Target names must not end with -targets"); + foundErrors = true; + } + } + + //@todo check targets exist in build.xml remember OSSpecific could be tricky to validate + + int numOfTargetInputs = 0; + // check ifTargets + ArrayList targetsSoFar = new ArrayList(); + for (int p = 0; p < pages.length; p++) { + if(pages[p] instanceof SimpleInputPage){ + SimpleInputPage simple = (SimpleInputPage)pages[p]; + String ifTarget = simple.getIfTarget(); + if(ifTarget != null && !targetsSoFar.contains(ifTarget)){ + System.out.println("ifTarget=" + ifTarget); + System.out.println("ifTarget will never test true, no prior target in page:"+pages[p].getName()); + // disabled due to bug 1412658 could be reinstated with proper test and OSSpecific handling + //foundErrors = true; + } + } + // add after to ensure testing previous pages + targetsSoFar.addAll(pages[p].getAllTargets()); + OutputField[] fields = pages[p].getOutputField(); + for (int f = 0; f < fields.length; f++) { + if(fields[f] instanceof TargetInput){ + if(numOfTargetInputs == 0){ + System.out.println("Found target input type"); + } + numOfTargetInputs++; + TargetInput ti = (TargetInput)fields[f]; + targetsSoFar.add(ti.getTarget()); + } + if(fields[f] instanceof TargetSelectInput){ + if(numOfTargetInputs == 0){ + System.out.println("Found target input type"); + } + numOfTargetInputs++; + TargetSelectInput ti = (TargetSelectInput)fields[f]; + SelectInput.Option[] options = ti.getOptions(); + for (int i = 0; i < options.length; i++) { + SelectInput.Option option = options[i]; + targetsSoFar.add(option.value); + } + } + } + } + if(numOfPageTargets == 0 && numOfTargetInputs == 0){ + System.out.println("Warning: No targets found, installer may do nothing."); + } +// if(targetsSoFar.contains("default")){ +// System.out.println("Target:target can not be \"default\""); +// foundErrors = true; +// } + + + System.out.println("Finished checking config"); + if(!foundErrors){ + return 0; + } + return 1; + } + + private boolean validateInstallerAttributes(){ + + System.out.println("Checking installer: " + installer.getName() ); + boolean foundErrors = false; + + String[] validBooleanValues = {"true", "false"}; + foundErrors |= validateValue("antialiased", installer.getAntialiased(), true, validBooleanValues); + + // done in DTD + //foundErrors |= validateValue("verbose", installer.isVerbose(), true, validBooleanValues); + //foundErrors |= validateValue("debug", installer.isDebug(), true, validBooleanValues); + + String[] validLAFValues = {LookAndFeelFactory.DEFAULT_LAF, + LookAndFeelFactory.GREYMETAL_LAF, + LookAndFeelFactory.NATIVE_LAF, + LookAndFeelFactory.JGOODIES_LAF, + LookAndFeelFactory.NULL_LAF }; + if( validateValue("lookAndFeel", installer.getLookAndFeel(), true, validLAFValues) ){ + System.out.println("Warning: non standard LookAndFeel ensure the correct classes are on the classpath at runtime:" + installer.getLookAndFeel()); + } + + if (installer.getName() == null){ + System.out.println("Error: installer element attribute does not exist: name"); + foundErrors = true; + } + + try { + String wide = installer.getWide(); + if(wide != null){ + installer.parseWideValue(wide); + } + } catch (Exception e) { + System.out.println("Error: installer element attribute incorrect format (e.g. 600:275): wide"); + foundErrors = true; + } + + String[] validLoadDefaultValues = {PropertyLoaderFilter.FALSE, + PropertyLoaderFilter.LOAD, + PropertyLoaderFilter.PROMPT, + PropertyLoaderFilter.PROMPT_AUTO}; + + boolean loadDefaultsNull = true; + if( installer.supportsAutoBuild() ){ + loadDefaultsNull = false; + } + foundErrors |= validateValue("loadDefaults", installer.getLoadDefaults(), loadDefaultsNull, validLoadDefaultValues); + + VersionHelper vHelper = new VersionHelper(); + if( installer.supportsAutoBuild() ){ + if( ! vHelper.isValid(installer.getVersion()) ){ + System.out.println("Error: invalid version attribute, required for -auto builds:" + installer.getVersion()); + foundErrors = true; + } + } + if(installer.getVersion() != null){ + if( ! vHelper.isValid(installer.getVersion()) ){ + System.out.println("Error: invalid version attribute format examples 1.2.0 , 0.2beta:" + installer.getVersion()); + foundErrors = true; + } + } + + return foundErrors; + } + /** + * @return foundErrors (true if there was an error) + */ + private boolean validateValue(String att, String value, boolean allowsNull, String[] validValues){ + if(value == null){ + if(!allowsNull){ + System.out.println("Error: installer element attribute does not exist: " + att); + return true; + } + return false; + } + else { + for (int i = 0; i < validValues.length; i++) { + if(validValues[i].equals(value)){ + return false; + } + } + System.out.println("Error: installer element attribute not valid value: " + att); + return true; + } + } + +} Property changes on: pal-portal/modules/ant-installer/trunk/src/org/tp23/antinstaller/runtime/ConfigurationLoader.java ___________________________________________________________________ Name: svn:eol-style + native Added: pal-portal/modules/ant-installer/trunk/src/org/tp23/antinstaller/runtime/ExecInstall.java =================================================================== --- pal-portal/modules/ant-installer/trunk/src/org/tp23/antinstaller/runtime/ExecInstall.java (rev 0) +++ pal-portal/modules/ant-installer/trunk/src/org/tp23/antinstaller/runtime/ExecInstall.java 2008-06-11 13:36:41 UTC (rev 975) @@ -0,0 +1,266 @@ +/* + * Copyright 2005 Paul Hinds + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +package org.tp23.antinstaller.runtime; + +import java.io.File; +import java.util.ResourceBundle; + +import org.tp23.antinstaller.InstallException; +import org.tp23.antinstaller.InstallerContext; +import org.tp23.antinstaller.renderer.MessageRenderer; +import org.tp23.antinstaller.runtime.exe.ExecuteFilter; +import org.tp23.antinstaller.runtime.exe.ExecuteRunnerFilter; +import org.tp23.antinstaller.runtime.exe.FilterChain; +import org.tp23.antinstaller.runtime.exe.FilterFactory; +import org.tp23.antinstaller.runtime.exe.FinalizerFilter; +import org.tp23.antinstaller.selfextract.SelfExtractor; + + + +/** + * This is the Applications entry point, it has a main method to run the + * installer. The main method is only for scripted installs. + * + * It is here that the command line options are parsed and it + * is determined which type of install (swing or text) will be run. + *

Reads the config, determines the runner, runs it and outputs the + * properties file, The Ant targets are then called by the AntRunner. + * This class also builds the internal Objects from the XML config file.

+ *

This class can also be called by external tools to launch the installer + * currently two options are provided to lauch from Jars.

+ *

Copyright: Copyright (c) 2004

+ *

Company: tp23

+ * @author Paul Hinds + * @version $Id: ExecInstall.java,v 1.9 2007/01/19 00:24:36 teknopaul Exp $ + */ +public class ExecInstall { + + private static final ResourceBundle res = ResourceBundle.getBundle("org.tp23.antinstaller.renderer.Res"); + public static final String CONFIG_RESOURCE = "/org/tp23/antinstaller/runtime/exe/script.fconfig"; + + private final InstallerContext ctx = new InstallerContext(); + private FilterChain chain; + /** + * @param chain chain of filters to be executed + */ + public ExecInstall(FilterChain chain){ + this.chain = chain; + } + + + + /** + * Execute the installer, this reads the config fetches a runner and runs the install. + * Once the install pages have finished an AntRunner is used to run Ant + */ + public void exec() { + + ExecuteFilter[] filters = null; + try { + chain.init(ctx); + filters = chain.getFilters(); + } + catch (Exception e) { + // This is a developer error or the package has not been built correctly + // It should never happen in a tested build + e.printStackTrace(); + System.exit(1); // called manually since in Win it was not shutting down properly + } +loop: for (int i = 0; i < filters.length; i++) { + try{ + ctx.log("Filter: " + filters[i].getClass().getName()); + filters[i].exec(ctx); + } + catch (ExecuteRunnerFilter.AbortException abort){ + MessageRenderer vLogger = ctx.getMessageRenderer(); + vLogger.printMessage(abort.getMessage()); + ctx.log("Aborted"); + FinalizerFilter ff = (FinalizerFilter)filters[filters.length - 1]; + ff.exec(ctx); + System.exit(1); + } + catch (Exception ex) { + + // write errors to the log + ctx.log("Installation error: " + ex.getMessage() + ": " + ex.getClass().toString()); + boolean verbose = true; // be verbose if we cant load the config + if(ctx.getInstaller() != null) { + verbose = ctx.getInstaller().isVerbose(); + } + ctx.log(verbose, ex); + + // write detailed errors to stdout for the GUI screens and text + if (ctx.getRunner() instanceof TextRunner) { + if(verbose){ + ex.printStackTrace(); + } + } + else { + if(verbose){ + ex.printStackTrace(System.err); + } + } + + // report the error to the user + MessageRenderer vLogger = ctx.getMessageRenderer(); + if(vLogger != null){ + vLogger.printMessage(res.getString("installationFailed") + "\n" + ex.getMessage()); + //Fixed BUG:1295944 vLogger.printMessage("Install failed\n" + ex.getMessage()); + } else { + System.err.println(res.getString("installationFailed") + ex.getClass().getName()); + System.err.println(ex.getMessage()); + } + + if(ctx.getRunner() != null){ + ctx.getRunner().fatalError(); + break loop; + } + else { // the screens did not even start e.g. XML config error + System.exit(1); + } + } + } + + } + + + + + + /** + *

Runs the installer from a script.

+ * + * This install can be run from a set of files for example from a CD. + * @see org.tp23.antinstaller.selfextract.NonExtractor + * @see org.tp23.antinstaller.selfextract.SelfExtractor + * + * @param args String[] args are "default" or "swing" or "text" followed by the root directory of the install + */ + public static void main(String[] args) { + try { + FilterChain chain = FilterFactory.factory(CONFIG_RESOURCE); + ExecInstall installExec = new ExecInstall(chain); + if(installExec.parseArgs(args, true)){ + installExec.exec(); + } + } + catch (InstallException e) { + // Installer developer error + System.out.println("Cant load filter chain:/org/tp23/antinstaller/runtime/exe/script.fconfig"); + e.printStackTrace(); + } + } + + /** + * This method has been designed for backward compatibility with + * existing scripts. The root dir is passed on the command line for scripted + * installs but is determined automatically for installs from self-extracting Jars + * @param args + * @param requiresRootDir set to true if the args must include the root directory + */ + public boolean parseArgs(String[] args, boolean requiresRootDir){ + String uiOverride = null; + String installType = null; + String installRoot = null; + + int i = 0; + if(args.length > i && !args[i].startsWith("-")) { + uiOverride = args[i]; + i++; + ctx.setUIOverride(uiOverride); + } + + if(requiresRootDir){ + if(args.length > i && !args[i].startsWith("-")) { + installRoot = args[i]; + i++; + ctx.setFileRoot(new File(installRoot)); + } + else{ + printUsage(); + return false; + } + } + // additional params should all have a -something prefix + for (; i < args.length; i++) { + // RFE 1569628 + if("-type".equals(args[i]) && args.length > i + 1){ + installType = args[i + 1]; + i++; + String configFileName = "antinstall-config-" + installType + ".xml"; + String buildFileName = "build-" + installType + ".xml"; + ctx.setInstallerConfigFile(configFileName); + ctx.setAntBuildFile(buildFileName); + } + } + + return true; + } + + private static void printUsage(){ + System.out.println("Usage java -cp $CLASSPATH org.tp23.antinstaller.ExecInstall [text|swing|default] [install root] (-type [buildtype])"); + } + + + /** + * Sets the UI override from the command line + * @param installRoot + */ +// public void setUIOverride(String override) { +// ctx.setUIOverride(override); +// } + /** + * This is generated by the Main class which knows where it has + * extracted or where it has run from + * @param installRoot + */ + public void setInstallRoot(File installRoot) { + ctx.setFileRoot(installRoot); + } + + /** + * This is AntInstalls temporary space which will generally be deleted + * except in debug mode when it is left to view the build process. + * installRoot and tempRoot can be the same if the directory + * is a new empty directory + * @param tempDir directory to be used for temporary storage + */ + public void setTempRoot(File tempDir) { + addShutdownHook(tempDir); + } + /** + * This shutdown hook is to facilitate debugging the app can be left open + * in the GUI view and the resources will not be deleted. Upon exit + * temporary files will be removed. This is required because the + * deleteOnExit() method fails if the directory is filled with files. + * @param tempDir + */ + private void addShutdownHook(final File tempDir){ + Runnable hook = new Runnable(){ + public void run(){ + if(ctx.getInstaller() != null && + ctx.getInstaller().isDebug()) return; + if(tempDir != null && tempDir.exists() && tempDir.isDirectory()){ + SelfExtractor.deleteRecursive(tempDir); + } + } + }; + Thread cleanUp = new Thread(hook); + cleanUp.setDaemon(true); + Runtime.getRuntime().addShutdownHook(cleanUp); + } + +} Property changes on: pal-portal/modules/ant-installer/trunk/src/org/tp23/antinstaller/runtime/ExecInstall.java ___________________________________________________________________ Name: svn:eol-style + native Added: pal-portal/modules/ant-installer/trunk/src/org/tp23/antinstaller/runtime/IfPropertyHelper.java =================================================================== --- pal-portal/modules/ant-installer/trunk/src/org/tp23/antinstaller/runtime/IfPropertyHelper.java (rev 0) +++ pal-portal/modules/ant-installer/trunk/src/org/tp23/antinstaller/runtime/IfPropertyHelper.java 2008-06-11 13:36:41 UTC (rev 975) @@ -0,0 +1,89 @@ +/* + * Copyright 2005 Paul Hinds + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +package org.tp23.antinstaller.runtime; + +import org.tp23.antinstaller.InstallException; +import org.tp23.antinstaller.InstallerContext; +import org.tp23.antinstaller.page.Page; +import org.tp23.antinstaller.page.SimpleInputPage; +import org.tp23.antinstaller.runtime.logic.Expression; +import org.tp23.antinstaller.runtime.logic.ExpressionBuilder; + + +/** + *

Encapsulates code fo the ifProperty feature

+ * N.B. It is the installer generator's responsibility to ensure that properties passed + * to the less than or greater than test are valid Numbers. + * The internal Java format used is a Double so avalid regex would be + * something like [0-9]+\.*[0-9]* or [0-9]+ for an Integer. + * The rather strange -= and += syntax is used because > and < + * must be escaped to &gt; and &lt; in XML attributes and the legibility + * of the configuration files would be impared. + * REF: 1145496 + * @author Paul Hinds + * @version $Id: IfPropertyHelper.java,v 1.5 2007/01/19 00:24:36 teknopaul Exp $ + */ +public class IfPropertyHelper { + + private InstallerContext ctx = null; + public IfPropertyHelper(InstallerContext ctx){ + this.ctx = ctx; + } + + /** + * @return boolean true to SHOW the page + */ + public boolean ifProperty(Page next) throws InstallException { + // show page if ifProperty is specified and property is correct + if(next instanceof SimpleInputPage) { + SimpleInputPage conditionalPage = (SimpleInputPage) next; + String ifProperty = conditionalPage.getIfProperty(); + if (ifProperty != null) { + Expression expression; + try { + expression = ExpressionBuilder.parseLogicalExpressions( ctx.getInstaller().getResultContainer(), + ifProperty ); + } + catch( ConfigurationException configExc ) { + throw new InstallException( "Error parsing ifProperty condition for page " + next.getName(), + configExc ); + } + return expression.evaluate(); + } + + } + return true; // show the page by default + } + + /** + * @return boolean true to SHOW the page + */ + public boolean ifTarget(Page next, Page[] pages){ + // skip iftarget specified and target is missing + if(next instanceof SimpleInputPage){ + SimpleInputPage conditionalPage = (SimpleInputPage) next; + String ifTarget = conditionalPage.getIfTarget(); + if (ifTarget != null) { + boolean show = false; + for (int p = 0; p < pages.length; p++) { + show |= pages[p].isTarget(ifTarget); + } + return show; + } + } + return true; + } +} Property changes on: pal-portal/modules/ant-installer/trunk/src/org/tp23/antinstaller/runtime/IfPropertyHelper.java ___________________________________________________________________ Name: svn:eol-style + native Added: pal-portal/modules/ant-installer/trunk/src/org/tp23/antinstaller/runtime/Logger.java =================================================================== --- pal-portal/modules/ant-installer/trunk/src/org/tp23/antinstaller/runtime/Logger.java (rev 0) +++ pal-portal/modules/ant-installer/trunk/src/org/tp23/antinstaller/runtime/Logger.java 2008-06-11 13:36:41 UTC (rev 975) @@ -0,0 +1,44 @@ +/* + * Copyright 2005 Paul Hinds + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +package org.tp23.antinstaller.runtime; + +import java.io.IOException; + +import org.tp23.antinstaller.Installer; + +public interface Logger { + + public void log(String message); + + public void log(Throwable exception); + + /** + * Logs the stack trace only if the installer is in verbose mode + * @param installer + * @param exception + */ + public void log(Installer installer, Throwable exception); + + public void setFileName(String fileName) throws IOException; + + /** + * Get the name of the file used for logging + * @return path to file or null if not initialised + */ + public String getFileName(); + + public void close(); +} Property changes on: pal-portal/modules/ant-installer/trunk/src/org/tp23/antinstaller/runtime/Logger.java ___________________________________________________________________ Name: svn:eol-style + native Added: pal-portal/modules/ant-installer/trunk/src/org/tp23/antinstaller/runtime/Runner.java =================================================================== --- pal-portal/modules/ant-installer/trunk/src/org/tp23/antinstaller/runtime/Runner.java (rev 0) +++ pal-portal/modules/ant-installer/trunk/src/org/tp23/antinstaller/runtime/Runner.java 2008-06-11 13:36:41 UTC (rev 975) @@ -0,0 +1,56 @@ +/* + * Copyright 2005 Paul Hinds + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +package org.tp23.antinstaller.runtime; + +import org.tp23.antinstaller.InstallException; + + + +/** + * + *

A Runner runs the user interaction screens, not ant. + * The base interface for TextRunner and SwingRunner

+ *

Instances of this interface should have a constructor that takes + * an InstallerContext as an argument

+ * Due to historic bad naming convention there exists an AntRunner which has + * no connection to this interface. + *

Copyright: Copyright (c) 2004

+ *

Company: tp23

+ * @author Paul Hinds + * @version $Id: Runner.java,v 1.2 2006/03/24 18:27:28 teknopaul Exp $ + */ + +public interface Runner { + + /** + * Renders the installer screens. This method should block until + * the UI has finished + * @throws InstallException + * @return boolean false implies user aborted + */ + public boolean runInstaller() throws InstallException; + + /** + * Called after Ant has finished so the Runner can clean up or provide feedback + */ + public void antFinished(); + + /** + * Called if the install failed for some reason and can not continue; + * + */ + public void fatalError(); +} Property changes on: pal-portal/modules/ant-installer/trunk/src/org/tp23/antinstaller/runtime/Runner.java ___________________________________________________________________ Name: svn:eol-style + native Added: pal-portal/modules/ant-installer/trunk/src/org/tp23/antinstaller/runtime/SimpleLogger.java =================================================================== --- pal-portal/modules/ant-installer/trunk/src/org/tp23/antinstaller/runtime/SimpleLogger.java (rev 0) +++ pal-portal/modules/ant-installer/trunk/src/org/tp23/antinstaller/runtime/SimpleLogger.java 2008-06-11 13:36:41 UTC (rev 975) @@ -0,0 +1,120 @@ +/* + * Copyright 2005 Paul Hinds + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +package org.tp23.antinstaller.runtime; + +import java.io.BufferedWriter; +import java.io.FileWriter; +import java.io.IOException; +import java.io.PrintWriter; +import java.io.StringWriter; + +import org.tp23.antinstaller.Installer; + +/** + * A Logger class that does not report errors + * + * @author Paul Hinds + * @version $Id: SimpleLogger.java,v 1.4 2007/01/19 00:24:36 teknopaul Exp $ + */ +public class SimpleLogger implements Logger { + + BufferedWriter fos; + + private String fileName; + + public SimpleLogger() { + } + + /** + * This method initialises the logger + */ + public void setFileName(String fileName) { + this.fileName = fileName; + try { + fos = new BufferedWriter(new FileWriter(fileName, false)); + fos.write("Logger initialized"); + fos.newLine(); + } catch (IOException e) { + fos = null; + } + } + + public String getFileName() { + return fileName; + } + + public void log(String message) { + if (fos == null) { + return; + } + try { + fos.write(message); + fos.newLine(); + fos.flush(); + } catch (Exception ex) { + throw new RuntimeException("Can not write to logs"); + } + } + + public void log(Installer installer, Throwable exception) { + if (installer != null && installer.isVerbose()) { + log(exception); + } + } + + public void log(Throwable exception) { + if (fos == null) { + return; + } + try { + StringWriter writer = new StringWriter(); + exception.printStackTrace(new PrintWriter(writer)); + String s = writer.getBuffer().toString(); + fos.write(s); + fos.newLine(); + } catch (IOException ex) { + throw new RuntimeException("Can not write to logs"); + } + } + + public void close() { + try { + if (fos != null) { + fos.flush(); + fos.close(); + fos = null; + } + } catch (IOException e) { + System.err.println("Can't close logger"); + } + } + + /** + * Called by the garbage collector on an object when garbage collection + * determines that there are no more references to the object. + * + * @throws Throwable + * the Exception raised by this method + * @todo Implement this java.lang.Object method + */ + protected void finalize() throws Throwable { + if (fos != null) { + fos.flush(); + fos.close(); + } + } + +} Property changes on: pal-portal/modules/ant-installer/trunk/src/org/tp23/antinstaller/runtime/SimpleLogger.java ___________________________________________________________________ Name: svn:eol-style + native Added: pal-portal/modules/ant-installer/trunk/src/org/tp23/antinstaller/runtime/SwingRunner.java =================================================================== --- pal-portal/modules/ant-installer/trunk/src/org/tp23/antinstaller/runtime/SwingRunner.java (rev 0) +++ pal-portal/modules/ant-installer/trunk/src/org/tp23/antinstaller/runtime/SwingRunner.java 2008-06-11 13:36:41 UTC (rev 975) @@ -0,0 +1,387 @@ +/* + * Copyright 2005 Paul Hinds + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +package org.tp23.antinstaller.runtime; + +import java.awt.GraphicsConfiguration; +import java.io.ByteArrayOutputStream; +import java.io.InputStream; +import java.util.ArrayList; +import java.util.List; +import java.util.ResourceBundle; + +import javax.swing.ImageIcon; +import javax.swing.JFrame; + +import org.tp23.antinstaller.InstallException; +import org.tp23.antinstaller.Installer; +import org.tp23.antinstaller.InstallerContext; +import org.tp23.antinstaller.ValidationException; +import org.tp23.antinstaller.antmod.FeedbackListener; +import org.tp23.antinstaller.page.Page; +import org.tp23.antinstaller.renderer.AntOutputRenderer; +import org.tp23.antinstaller.renderer.RendererFactory; +import org.tp23.antinstaller.renderer.swing.PageCompletionListener; +import org.tp23.antinstaller.renderer.swing.SizeConstants; +import org.tp23.antinstaller.renderer.swing.SwingInstallerContext; +import org.tp23.antinstaller.renderer.swing.SwingMessageRenderer; +import org.tp23.antinstaller.renderer.swing.SwingPageRenderer; + +/** + *

Runs the installer in a JFrame window

+ *

This class uses the Installer object tree as its data source and renderers + * from the org.tp23.antinstaller.renderer.swing package

+ * Runners must also create a MessageRenderer and make it available in the + * InstallerContext + *

Copyright: Copyright (c) 2004

+ *

Company: tp23

+ * + * @author Paul Hinds + * @version $Id: SwingRunner.java,v 1.11 2007/01/19 00:24:36 teknopaul Exp $ + */ +public class SwingRunner extends AntRunner implements Runner, PageCompletionListener { + + private static final ResourceBundle res = ResourceBundle.getBundle("org.tp23.antinstaller.renderer.Res"); + + + protected SwingInstallerContext swingCtx = null; + private JFrame frame = new JFrame(); + private List pageRenderers; + private volatile boolean doAnt = false; + protected Thread initialThread; + protected IfPropertyHelper ifHelper; + // context local property refs + protected InstallerContext ctx; + protected Logger logger; + protected Installer installer; + + public SwingRunner(InstallerContext ctx) { + super(ctx); + swingCtx = new SwingInstallerContext(ctx, frame); + + SwingMessageRenderer smr = new SwingMessageRenderer(); + smr.setOwner(frame); + ctx.setMessageRenderer(smr); + + ctx.setBuildListener(new FeedbackListener(swingCtx)); + + ifHelper = new IfPropertyHelper(ctx); + logger = ctx.getLogger(); + installer = ctx.getInstaller(); + this.ctx = ctx; + } + + /** + * Renders the installer in a Swing GUI, this method blocks until + * the UI has finished + * + * @return boolean false implies user aborted + * @throws InstallException + */ + public boolean runInstaller() throws InstallException { + try { + frame.setTitle(installer.getName()); + frame.setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE); + frame.setSize(SizeConstants.PAGE_WIDTH, SizeConstants.PAGE_HEIGHT); + frame.getRootPane().setDoubleBuffered(true); + setLocation(frame); + setIcon(frame, installer); + + preparePages(installer.getPages(), ctx); + showFirstPage(); + // need to block here until pages are complete + initialThread = Thread.currentThread(); + try { + Thread.sleep(Long.MAX_VALUE); + } + catch (InterruptedException ex1) { + + } + return doAnt; + } + catch (Exception ex) { + logger.log("Fatal exception: " + ex.getMessage()); + if (ctx.getInstaller().isVerbose()) { + logger.log(ex); + } + ctx.getMessageRenderer().printMessage("Fatal exception: " + ex.getMessage()); + throw new InstallException("", ex); + } + } + + public void pageBack(Page page) { + if (page.isAbort()) { + abort(); + return; + } + Page[] pages = installer.getPages(); + for (int i = 0; i < pages.length; i++) { + if (pages[i] == page) { + // found current page + if (i > 0) { + + //skip pages if the ifTarget or ifProperty attributes exist and fail + int nextIdx = i - 1; + try { + while (true) { + if (!ifHelper.ifTarget(pages[nextIdx], pages) || + !ifHelper.ifProperty(pages[nextIdx])) { + //Continue looping + --nextIdx; + } else { + break; + } + } + } + catch (InstallException instExc) { + logger.log("InstallException rendering page:" + page.getName()); + logger.log(installer, instExc); + } + + //for(;ifTargetSkip(pages[nextIdx], pages);nextIdx--); + + SwingPageRenderer renderer = (SwingPageRenderer) pageRenderers.get(nextIdx); + ctx.setCurrentPage(pages[nextIdx]); + try { + renderNext(renderer); + } + catch (InstallException ex) { + logger.log("InstallExcepiton rendering page:" + page.getName()); + logger.log(installer, ex); + } + catch (ClassNotFoundException ex) { + logger.log("ClassNotFoundException rendering page:" + page.getName()); + logger.log(installer, ex); + } + return; + } + } + } + } + + /** + * Called when a page is complete and the next button is pressed. + * This method is called by the event thread that looses exceptions so Throwable + * is caught + * + * @param page Page + */ + public void pageComplete(Page page) { + try { + if (page.isAbort()) { + abort(); + return; + } + runPost(page); + Page[] pages = installer.getPages(); + SwingPageRenderer currentRenderer; + for (int i = 0; i < pages.length; i++) { + if (pages[i] == page) { // found current page + currentRenderer = (SwingPageRenderer) pageRenderers.get(i); + // check validation + boolean validationPassed = false; + try { + currentRenderer.updateInputFields(); + validationPassed = currentRenderer.validateFields(); + } catch (ValidationException ve) { + logger.log("ValidationException rendering page:" + page.getName()); + logger.log(installer, ve); + return; + } + if (!validationPassed) { + return; + } + + + if (i < pages.length - 1) { + + //more pages left + + // skip the page if the ifTarget or ifProperty dictate it + int nextIdx = i + 1; + while (true) { + if (!ifHelper.ifTarget(pages[nextIdx], pages) || + !ifHelper.ifProperty(pages[nextIdx])) { + //Continue looping + nextIdx++; + } else { + break; + } + } + + + SwingPageRenderer renderer = (SwingPageRenderer) pageRenderers.get(nextIdx); + ctx.setCurrentPage(pages[nextIdx]); + try { + renderNext(renderer); + } + catch (InstallException ex) { + logger.log("InstallException rendering page:" + page.getName()); + logger.log(installer, ex); + } + catch (ClassNotFoundException ex) { + logger.log("ClassNotFoundException rendering page:" + page.getName()); + logger.log(installer, ex); + } + return; + } + if (i == pages.length - 1) { + // all done + currentRenderer.getBackButton().setEnabled(false); + currentRenderer.getNextButton().setEnabled(false); + currentRenderer.getFinishButton().setEnabled(false); + doAnt = true; + initialThread.interrupt(); + return; + } + } + } + } + catch (Throwable e) { + ctx.log("Throwable during page completion:" + e.getMessage()); + if (ctx.getInstaller().isVerbose()) { + ctx.log(e); + } + } + } + + protected void showFirstPage() throws Exception { + ctx.setCurrentPage(installer.getPages()[0]); + renderNext((SwingPageRenderer) pageRenderers.get(0)); + } + + + private void preparePages(Page[] pages, InstallerContext ctx) throws Exception { + pageRenderers = new ArrayList(); + for (int i = 0; i < pages.length; i++) { + SwingPageRenderer renderer = RendererFactory.getSwingPageRenderer(pages[i]); + if (i == 0) { + renderer.getBackButton().setEnabled(false); + } + renderer.setContext(swingCtx); + renderer.setPageCompletionListener(this); + renderer.setPage(pages[i]); + renderer.instanceInit(); + pageRenderers.add(renderer); + if (renderer instanceof AntOutputRenderer) { + ctx.setAntOutputRenderer((AntOutputRenderer) renderer); + } + } + } + + protected void renderNext(SwingPageRenderer renderer) throws ClassNotFoundException, InstallException { + renderer.updateDefaultValues(); + frame.getContentPane().removeAll(); + frame.getContentPane().add(renderer); + frame.getContentPane().repaint(); + frame.show(); + if (renderer.getNextButton().isEnabled()) { + renderer.getNextButton().requestFocus(); + } else if (renderer.getFinishButton().isEnabled()) { + renderer.getFinishButton().requestFocus(); + } + } + + private void setLocation(JFrame frame) { + GraphicsConfiguration config = frame.getGraphicsConfiguration(); + int x = (int) config.getBounds().getCenterX() - (SizeConstants.PAGE_WIDTH / 2); + int y = (int) config.getBounds().getCenterY() - (SizeConstants.PAGE_HEIGHT / 2); + frame.setLocation(x, y); + frame.setResizable(false); + } + + private void setIcon(JFrame frame, Installer installer) { + String iconResource = installer.getWindowIcon(); + try { + if (iconResource == null) { + return; + } + InputStream in = this.getClass().getResourceAsStream(iconResource); + ByteArrayOutputStream baos = new ByteArrayOutputStream(); + byte[] buffer = new byte[256]; + int read = 0; // The number of bytes read from the stream + for (read = in.read(buffer); read != -1; read = in.read(buffer)) { + baos.write(buffer, 0, read); + } + ImageIcon icon = new ImageIcon(baos.toByteArray()); + //Image icon = Toolkit.getDefaultToolkit().createImage(baos.toByteArray()); + frame.setIconImage(icon.getImage()); + } + catch (Exception ex) { + // we can live with out an icon + logger.log("Can not load icon resource: " + iconResource); + logger.log(installer, ex); + } + } + + public void antFinished() { + SwingPageRenderer renderer = (SwingPageRenderer) pageRenderers.get(pageRenderers.size() - 1); + renderer.getBackButton().setEnabled(false); + renderer.getNextButton().setEnabled(false); + renderer.getCancelButton().setEnabled(false); + renderer.getFinishButton().setText(res.getString("exit")); + renderer.getFinishButton().setEnabled(true); + renderer.getFinishButton().requestFocus(); + renderer.getTitleLabel().setText(res.getString("complete")); + ctx.getAntOutputRenderer().getErr().flush(); + ctx.getAntOutputRenderer().getOut().flush(); + ctx.getMessageRenderer().printMessage(res.getString("finished")); + } + + public void fatalError() { + List renderers = getPageRenderers(); + if ((renderers != null) && (renderers.size() > 0)) { + SwingPageRenderer renderer = (SwingPageRenderer) renderers.get(renderers.size() - 1); + renderer.getBackButton().setEnabled(false); + renderer.getNextButton().setEnabled(false); + renderer.getCancelButton().setEnabled(false); + renderer.getFinishButton().setText(res.getString("exit")); + renderer.getFinishButton().setEnabled(true); + renderer.getFinishButton().requestFocus(); + renderer.getTitleLabel().setText(res.getString("failed")); + } + // else - we're done here, or should we call abort()? + } + + /** + * Returns a string representation of the object. + * + * @return a string representation of the object. + */ + public String toString() { + return "SwingRunner"; + } + + private void abort() { + this.doAnt = false; + initialThread.interrupt(); + } + + /** + * @return Returns the frame. + */ + public JFrame getFrame() { + return frame; + } + + /** + * This method is only valid after the PageRenderers have been generated + * + * @return Returns the pageRenderers. + */ + public List getPageRenderers() { + return pageRenderers; + } +} Property changes on: pal-portal/modules/ant-installer/trunk/src/org/tp23/antinstaller/runtime/SwingRunner.java ___________________________________________________________________ Name: svn:eol-style + native Added: pal-portal/modules/ant-installer/trunk/src/org/tp23/antinstaller/runtime/TextRunner.java =================================================================== --- pal-portal/modules/ant-installer/trunk/src/org/tp23/antinstaller/runtime/TextRunner.java (rev 0) +++ pal-portal/modules/ant-installer/trunk/src/org/tp23/antinstaller/runtime/TextRunner.java 2008-06-11 13:36:41 UTC (rev 975) @@ -0,0 +1,143 @@ +/* + * Copyright 2005 Paul Hinds + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +package org.tp23.antinstaller.runtime; + +import java.io.BufferedReader; +import java.io.IOException; +import java.io.InputStreamReader; +import java.io.PrintStream; +import java.util.ResourceBundle; + +import org.tp23.antinstaller.InstallException; +import org.tp23.antinstaller.Installer; +import org.tp23.antinstaller.InstallerContext; +import org.tp23.antinstaller.page.Page; +import org.tp23.antinstaller.page.SimpleInputPage; +import org.tp23.antinstaller.renderer.AntOutputRenderer; +import org.tp23.antinstaller.renderer.RendererFactory; +import org.tp23.antinstaller.renderer.text.AbstractTextPageRenderer; +import org.tp23.antinstaller.renderer.text.TextMessageRenderer; + + + +/** + * + *

Runs the installer from the text only command line (console)

+ *

This class uses the Installer object tree as its data source and renderers + * from the org.tp23.antinstaller.renderer.text package

+ *

Copyright (c) 2004

+ *

Company: tp23

+ * @author Paul Hinds + * @version $Id: TextRunner.java,v 1.10 2007/01/19 00:24:36 teknopaul Exp $ + */ +public class TextRunner extends AntRunner + implements Runner { + + private static final ResourceBundle res = ResourceBundle.getBundle("org.tp23.antinstaller.renderer.Res"); + + protected final InstallerContext ctx; + protected final Installer installer; + private final Logger logger; + protected final IfPropertyHelper ifHelper; + + public TextRunner(InstallerContext ctx) throws IOException { + super(ctx); + this.ctx = ctx; + this.installer = ctx.getInstaller(); + this.logger = ctx.getLogger(); + ctx.setMessageRenderer(new TextMessageRenderer()); + ctx.setAntOutputRenderer(new AntOutputRenderer(){ + public PrintStream getErr() { + return System.err; + } + public PrintStream getOut() { + return System.out; + } + + }); + this.ifHelper = new IfPropertyHelper(ctx); + } + + /** + * Renders the installer on the command line, this method blocks until + * the UI has finished + * @throws InstallException + * @return boolean false implies the install was aborted + */ + public boolean runInstaller() throws InstallException { + try { + return renderPages(installer.getPages()); + } + catch (Exception ex) { + logger.log("FATAL exception during installation:"+ex.getMessage()); + logger.log(installer, ex); + + ctx.getMessageRenderer().printMessage(res.getString("installationFailed") + ":" + ex.getMessage()); + //Fixed BUG: ctx.getMessageRenderer().printMessage("Installation failed:"+ex.getMessage()); + throw new InstallException("Installation failed", ex); + } + } + + + private boolean renderPages(Page[] pages) throws ClassNotFoundException, InstallException{ + Page next = null; + for (int i = 0; i < pages.length; i++) { + next = pages[i]; + + if(next instanceof SimpleInputPage){ + // skip iftarget specified and missing + if(!ifHelper.ifTarget(next, pages))continue; + // skip page if ifProperty is specified and property is missing + if(!ifHelper.ifProperty(next))continue; + } + + AbstractTextPageRenderer renderer = RendererFactory.getTextPageRenderer(next); + renderer.setContext(ctx); + renderer.init( new BufferedReader(new InputStreamReader(System.in)), System.out); + ctx.setCurrentPage(next); + renderer.renderPage(next); + if (next.isAbort()){ + return false; + } + runPost(next); + } + return true; + } + public InstallerContext getInstallerContext() { + return ctx; + } + + + + /** + * Called when Ant has finished its work + */ + public void antFinished() { + System.out.println(res.getString("finished")); + //System.exit(0); + } + /** + * Called is Ant failed to install correctly + */ + public void fatalError(){ + System.out.println(res.getString("failed")); + //System.exit(1); + } + + public String toString() { + return "TextRunner"; + } +} Property changes on: pal-portal/modules/ant-installer/trunk/src/org/tp23/antinstaller/runtime/TextRunner.java ___________________________________________________________________ Name: svn:eol-style + native Added: pal-portal/modules/ant-installer/trunk/src/org/tp23/antinstaller/runtime/VersionHelper.java =================================================================== --- pal-portal/modules/ant-installer/trunk/src/org/tp23/antinstaller/runtime/VersionHelper.java (rev 0) +++ pal-portal/modules/ant-installer/trunk/src/org/tp23/antinstaller/runtime/VersionHelper.java 2008-06-11 13:36:41 UTC (rev 975) @@ -0,0 +1,234 @@ +/* + * Copyright 2005 Paul Hinds + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +package org.tp23.antinstaller.runtime; + +import java.util.StringTokenizer; + +/** + * Version helper accepts version numbers of the following format. + * [major][clause].[minor][clause].[minor][clause].... ad infinitum + * + * If the Java flag is set to true an attempt is made to parse the string as if it were + * returned by System.getProperty("java.version"); + * Since pre 1.3.1 the system is not parsable the default is to accept the string + * if there is a format error. + * + * For the non java syntax getting the string wrong will result in failed tests + * @author teknopaul + * + */ +public class VersionHelper { + + public static final String CLAUSE_ALPHA = "alpha"; + public static final String CLAUSE_BETA = "beta"; + public static final String CLAUSE_GAMMA = "gamma"; + public static final String CLAUSE_JAVA_BETA = "ea"; + + public boolean equalOrHigher(final String test, final String version) { + return equalOrHigher(test, version, false); + } + + public boolean majorVersionCompatible(final String test, final String version) { + return getMajorVersion(test) == getMajorVersion(version); + } + + /** + * + * @param test java version string being tested + * @param version java version string being used as reference + * @param javaSyntax + * @return true if the value of test is greater than or equal to the value of version + */ + public boolean equalOrHigher(final String test, final String version, final boolean javaSyntax) { + try { + StringTokenizer testSt = new StringTokenizer(test, "."); + StringTokenizer verSt = new StringTokenizer(version, "."); + + while (true) { + boolean testMore = testSt.hasMoreTokens(); + boolean verMore = verSt.hasMoreTokens(); + if( ! testMore || ! verMore ){ + break; + } + String testToken = testSt.nextToken(); + String verToken = verSt.nextToken(); + short testVer = getVersion(testToken); + short versionVer = getVersion(verToken); + if( testVer == versionVer ) { + if ( equalClause(getClause( testToken ), getClause(verToken)) ) { + continue; + } + else { + return higherClause(getClause( testToken ), getClause( verToken ), javaSyntax); + } + } + return testVer > versionVer ; + } + // equal up to one not having minor details + if( countDots(test) >= countDots(version) ){ + return true; + } + return test.equals(version); + } catch (Exception e) { + // syntax exceptions + if(javaSyntax){ + return true; // return true for Java since pre 1.3.1 or other JVMs could get any old rubbish + } + return false; + } + } + + public boolean isValid(final String version) { + try { + StringTokenizer verSt = new StringTokenizer(version, "."); + + boolean verMore = false; + int i = 0; + for (; verMore = verSt.hasMoreTokens(); i++) { + + String verToken = verSt.nextToken(); + if("".equals(verToken)){ + return false; + } + // may throw NumberFormatExceptions + getVersion(verToken); + String clause = getClause(verToken); + if( ! "".equals(clause)){ + short clauseS = clauseToShort(clause); + if( ! (clauseS == 1 || clauseS == 2 || clauseS == 3 )){ + return false; + } + } + } + if( ! verMore && i == 0) { + return false; // nothing there! + } + return true; + + } + catch (Exception e) { + // syntax exceptions + return false; + } + } + /** + * @return the number part of the clause + */ + private short getVersion(final String section) { + StringBuffer sb = new StringBuffer(); + for (int i = 0; i < section.length(); i++) { + char c = section.charAt(i); + if(Character.isDigit(c)) { + sb.append(c); + } + else{ + return Short.parseShort( sb.toString() ); + } + } + if(sb.length() > 0) { + return Short.parseShort( sb.toString() ); + } + return 0; + } + + /** + * @return the clause eg beta or "" + */ + private String getClause(final String section) { + for (int i = 0; i < section.length(); i++) { + char c = section.charAt(i); + if(Character.isDigit(c)) { + continue; + } + else { + return section.substring(i); + } + } + return ""; + } + + private boolean higherClause(final String test, final String clause, final boolean javaSyntax) { + if(javaSyntax) { + return clauseJavaToShort(test) > clauseJavaToShort(clause); + } + else { + return clauseToShort(test) > clauseToShort(clause); + } + + } + private boolean equalClause(final String test, final String clause) { + return clauseToShort(test) == clauseToShort(clause); + } + + private short clauseToShort(String clause) { + if(clause.startsWith("-")){ + clause = clause.substring(1); // knock off java style 1-beta dashes + } + if( CLAUSE_ALPHA.equals(clause) ) { + return 3; + } + else if( CLAUSE_BETA.equals(clause) ) { + return 2; + } + else if( CLAUSE_GAMMA.equals(clause) ) { + return 1; + } + if(clause.startsWith("_")) { // java build version support 1_03-ea-beta (discarding the sub sub clause "-ea-beta" because I'm lazy) + int hasDash = clause.indexOf('-'); + if(hasDash > -1) { + return Short.parseShort(clause.substring(1, hasDash)); + } + else { + return Short.parseShort(clause.substring(1)); + } + } + else return Short.MAX_VALUE; // no clause assumes higher + } + + private short clauseJavaToShort(String clause) { + if(clause.startsWith("-")){ + clause = clause.substring(1); // knock off java style 1-beta dashes + } + else if( CLAUSE_JAVA_BETA.equals(clause) ) { // -ea early access are assumed to be less good + return -2; + } + if(clause.startsWith("_")) { // java build version support 1_03-ea-beta (discarding the sub sub clause "-ea-beta" because I'm lazy) + int hasDash = clause.indexOf('-'); + if(hasDash > -1) { + return Short.parseShort(clause.substring(1, hasDash)); + } + else { + return Short.parseShort(clause.substring(1)); + } + } + else return 0; // no clause assumes lower in Java speak + } + + private short countDots(final String fullver){ + short count = 0; + for (int i = 0; i < fullver.length(); i++) { + if(fullver.charAt(i) == '.') { + count++; + } + } + return count; + } + + private short getMajorVersion(String test){ + return getVersion(test); + } + +} Property changes on: pal-portal/modules/ant-installer/trunk/src/org/tp23/antinstaller/runtime/VersionHelper.java ___________________________________________________________________ Name: svn:eol-style + native Added: pal-portal/modules/ant-installer/trunk/src/org/tp23/antinstaller/runtime/exe/AntLauncherFilter.java =================================================================== --- pal-portal/modules/ant-installer/trunk/src/org/tp23/antinstaller/runtime/exe/AntLauncherFilter.java (rev 0) +++ pal-portal/modules/ant-installer/trunk/src/org/tp23/antinstaller/runtime/exe/AntLauncherFilter.java 2008-06-11 13:36:41 UTC (rev 975) @@ -0,0 +1,106 @@ +/* + * Copyright 2005 Paul Hinds + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +package org.tp23.antinstaller.runtime.exe; + +import java.util.List; +import java.util.Map; + +import org.tp23.antinstaller.InstallException; +import org.tp23.antinstaller.InstallerContext; +import org.tp23.antinstaller.ResourceBundleHelper; +import org.tp23.antinstaller.antmod.Launcher; + +/** + * + *

Runs the Ant script using the Apache Ant launcher.

+ *

This runner uses a modified version of the Apache launcher to provide us + * with feed back as to the state of the install

+ *

Copyright: Copyright (c) 2004

+ *

Company: tp23

+ * @todo get better feed back and progress for the targets that have run successfully + * @todo this should be an interface not a class + * @author Paul Hinds + * @version $Id: AntLauncherFilter.java,v 1.6 2007/01/12 14:47:44 anothermwilson Exp $ + */ +public class AntLauncherFilter implements ExecuteFilter { + + private static final ResourceBundleHelper resHelper = new ResourceBundleHelper("org.tp23.antinstaller.renderer.Res"); + + + public AntLauncherFilter() { + } + + public void exec(InstallerContext ctx) throws InstallException { + if(ctx.getInstaller().isVerbose())ctx.log("Starting Ant Launcher"); + + try { + + //TODO this should be refactored to installer + List argsList = ctx.getInstaller().getTargets(ctx); + + String[] argsArr = new String[argsList.size() + 4]; + argsList.toArray(argsArr); + + if (ctx.getInstaller().isVerbose()) { + ctx.log("Running targets:" + printArray(argsArr)); + } + System.out.println("Targets:"+printArray(argsArr)); + + argsArr[argsArr.length-2] = "-lib"; + argsArr[argsArr.length-1] = "antlib"; + + argsArr[argsArr.length-4] = "-buildfile"; + argsArr[argsArr.length - 3] = ctx.getFileRoot().getAbsolutePath() + + System.getProperty("file.separator") + + ctx.getAntBuildFile(); + + //Launcher uses stdout and stderr by default + System.setOut(ctx.getAntOutputRenderer().getOut()); + System.setErr(ctx.getAntOutputRenderer().getErr()); + + Map properties = ctx.getInstaller().getResultContainer().getAllProperties(); + Launcher launcher = new Launcher(properties); + int ok = launcher.run(argsArr, ctx); + if(ok!=0) { + throw new InstallException( resHelper.getMessage( "ant.failure" ) ); + //the default ctx.setInstallSucceded(false); + } + else { + ctx.setInstallSucceded(true); + } + ctx.log("Ant finished"); + ctx.getRunner().antFinished(); + } + catch (Throwable ex) { + throw new InstallException("Error running the install, " + ex.getMessage(), ex); + } + } + /** + * Used for debug to print the targets to system.out + * @param args Object[] + * @return String + */ + private String printArray(Object[] args){ + StringBuffer sb = new StringBuffer(); + for (int i = 0; i < args.length-4; i++) { + if (i > 0) { + sb.append(','); + } + sb.append(args[i]); + } + return sb.toString(); + } +} Property changes on: pal-portal/modules/ant-installer/trunk/src/org/tp23/antinstaller/runtime/exe/AntLauncherFilter.java ___________________________________________________________________ Name: svn:eol-style + native Added: pal-portal/modules/ant-installer/trunk/src/org/tp23/antinstaller/runtime/exe/AntProjectFilter.java =================================================================== --- pal-portal/modules/ant-installer/trunk/src/org/tp23/antinstaller/runtime/exe/AntProjectFilter.java (rev 0) +++ pal-portal/modules/ant-installer/trunk/src/org/tp23/antinstaller/runtime/exe/AntProjectFilter.java 2008-06-11 13:36:41 UTC (rev 975) @@ -0,0 +1,289 @@ +/* + * Copyright 2005 Paul Hinds + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +package org.tp23.antinstaller.runtime.exe; + +import java.io.File; +import java.io.FileOutputStream; +import java.io.IOException; +import java.io.InputStream; +import java.io.PrintStream; +import java.net.MalformedURLException; +import java.net.URL; +import java.net.URLClassLoader; +import java.util.Iterator; +import java.util.Map; +import java.util.Properties; + +import org.apache.tools.ant.BuildException; +import org.apache.tools.ant.BuildListener; +import org.apache.tools.ant.DefaultLogger; +import org.apache.tools.ant.Diagnostics; +import org.apache.tools.ant.Project; +import org.apache.tools.ant.ProjectHelper; +import org.apache.tools.ant.input.DefaultInputHandler; +import org.apache.tools.ant.launch.Locator; +import org.tp23.antinstaller.InstallException; +import org.tp23.antinstaller.InstallerContext; +import org.tp23.antinstaller.antmod.ProjectHelper3; +import org.tp23.antinstaller.selfextract.NonExtractor; +import org.tp23.antinstaller.selfextract.SelfExtractor; +/** + * + *

This AntRunner runs Ant builds directly from a Jar without having to extract + * the build.xml to temporary space.

+ *

+ *

Copyright: Copyright (c) 2004

+ *

Company: tp23

+ * @author Paul Hinds + * @version $Id: AntProjectFilter.java,v 1.10 2007/01/28 08:44:39 teknopaul Exp $ + */ +public class AntProjectFilter implements ExecuteFilter{ + + //TODO certain jars are added from Ant default directories that are probably not needed + + private static String antVersion = null; + + /** The Ant Home property - from default Launcher */ + public static final String ANTHOME_PROPERTY = "ant.home"; + + /** The location of a per-user library directory - from default Launcher */ + public static final String USER_LIBDIR = ".ant/lib"; + + public AntProjectFilter() { + } + + /** + * run Ant + * + * @param ctx InstallerContext + * @throws InstallException + * @todo Implement this org.tp23.antinstaller.runtime.AntRunner method + */ + public void exec(InstallerContext ctx) throws InstallException { + if(ctx.getInstaller().isVerbose()) { + ctx.log("Starting Ant Project"); + } + + try { + + Project project = new Project(); + appendClassPath(); + setAntHome(ctx); + project.setCoreLoader(this.getClass().getClassLoader()); + + DefaultLogger antLogger = new DefaultLogger(); + antLogger.setOutputPrintStream(ctx.getAntOutputRenderer().getOut()); + antLogger.setErrorPrintStream(ctx.getAntOutputRenderer().getErr()); + antLogger.setMessageOutputLevel(Project.MSG_INFO); + BuildListener bl = ctx.getBuildListener(); + if(bl != null){ + project.addBuildListener(bl); + } + project.addBuildListener(antLogger); + + /* + * Log useful ant task output to the log file to help debugging + * and for customer support + */ + final String logFileName = ctx.getLogger().getFileName(); + if( logFileName != null && logFileName.length() > 0 ) + { + PrintStream stream = new PrintStream( new FileOutputStream(logFileName, true), true); + DefaultLogger antFileLogger = new DefaultLogger(); + antFileLogger.setOutputPrintStream( stream ); + antFileLogger.setErrorPrintStream( stream ); + int logLevel = (ctx.getInstaller().isVerbose()) + ? Project.MSG_VERBOSE + : Project.MSG_INFO; + antFileLogger.setMessageOutputLevel( logLevel ); + + project.addBuildListener( antFileLogger ); + } + + // irrelevant really but might help someone on a command line + project.setInputHandler(new DefaultInputHandler()); + project.fireBuildStarted(); + + project.init(); + project.setUserProperty("ant.version", getAntVersion()); + + + // add properties + // N.B. properties are not loaded from the file it exists for debugging installers + String arg; + String value; + Map properties = ctx.getInstaller().getResultContainer().getAllProperties(); + Iterator iter = properties.keySet().iterator(); + while (iter.hasNext()) { + arg = (String) iter.next(); + value = (String) properties.get(arg); + project.setUserProperty(arg, value); + } + + // From here we immitate Main + try { + Diagnostics.validateVersion(); + } catch (Throwable exc) { + // minimal messages for the benefit of the command line install + System.err.println("Version error:" + exc.getClass() + "," + exc.getMessage()); + return; + } + + ProjectHelper helper = new ProjectHelper3(); + project.addReference("ant.projectHelper", helper); + + File buildXml = new File(ctx.getFileRoot(), ctx.getAntBuildFile()); + if(buildXml.exists()){ + helper.parse(project, buildXml); + project.setUserProperty("ant.file",buildXml.getAbsolutePath()); + } else { + URL buildIS = this.getClass().getResource("/" + ctx.getAntBuildFile()); + helper.parse(project, buildIS); + project.setUserProperty("ant.file", buildIS.toExternalForm()); + } + + File enclosingJar = SelfExtractor.getEnclosingJar(this); + project.setUserProperty(NonExtractor.ANTINSTALLER_JAR_PROPERTY , enclosingJar.getAbsolutePath()); + System.out.println(NonExtractor.ANTINSTALLER_JAR_PROPERTY + enclosingJar.getAbsolutePath()); + + //what is this !?! project.setKeepGoingMode(keepGoingMode); + + project.setBaseDir(ctx.getFileRoot()); + + project.executeTargets(ctx.getInstaller().getTargets(ctx)); + project.fireBuildFinished(null); + ctx.setInstallSucceded(true); + ctx.log("Ant finished"); + } + catch (Throwable e) { + throw new InstallException("Error running the install, " + e.getMessage(), e); + } + finally { + ctx.getRunner().antFinished(); + } + } + + + public static synchronized String getAntVersion() throws BuildException { + if (antVersion == null) { + try { + Properties props = new Properties(); + InputStream in = + AntProjectFilter.class.getResourceAsStream("/org/apache/tools/ant/version.txt"); + props.load(in); + in.close(); + + StringBuffer msg = new StringBuffer(); + msg.append("Apache Ant version "); + msg.append(props.getProperty("VERSION")); + msg.append(" compiled on "); + msg.append(props.getProperty("DATE")); + antVersion = msg.toString(); + } catch (IOException ioe) { + throw new BuildException("Could not load the version information:" + + ioe.getMessage()); + } catch (NullPointerException npe) { + throw new BuildException("Could not load the version information."); + } + } + return antVersion; + } + + /** + * Append extra Ant jars to the classpath the original classpath + * is not removed incase the installer is launched from a script + * + */ + private static void appendClassPath(){ + try { + // now update the class.path property + StringBuffer baseClassPath + = new StringBuffer(System.getProperty("java.class.path")); + if (baseClassPath.charAt(baseClassPath.length() - 1) + == File.pathSeparatorChar) { + baseClassPath.setLength(baseClassPath.length() - 1); + } + URL[] jars = getLibPaths(); + for (int i = 0; i < jars.length; ++i) { + baseClassPath.append(File.pathSeparatorChar); + baseClassPath.append(Locator.fromURI(jars[i].toString())); + } + + System.setProperty("java.class.path", baseClassPath.toString()); + + URLClassLoader loader = new URLClassLoader(jars); + Thread.currentThread().setContextClassLoader(loader); + } + catch (MalformedURLException e) { + // swallow exception, normally all resources are already loaded + System.err.println("Invalid Jar path"); + } + } + + + /** + * Ant home is not a requirement but can exist prior to loading + * the default Ant mechanism of using the current Jars parent + * is consipicuously absent, do not rely on ANT_HOME out side of a + * controlled environment (e.g. a normal install) + */ + private static void setAntHome(InstallerContext ctx){ + String antHomeProperty = System.getProperty(ANTHOME_PROPERTY); + if(antHomeProperty==null){ + System.setProperty(ANTHOME_PROPERTY, ctx.getFileRoot().getAbsolutePath()); + } + } + + /** + * To maintain compatability with previous verisons currently the only + * Ant command line argument supported is the -lib parameter with the value + * "antlib" + * @TODO this should probably be removed + * @throws MalformedURLException + */ + private static URL[] getLibPaths() throws MalformedURLException{ + + // add all Jars from the ./antlib directory at the time of the build + // this is NOT based on ANT_HOME + URL[] libJars = Locator.getLocationURLs(new File("antlib")); + + // add all the Jars from ~/.ant/lib + // this is probably irrelevant for a normal install + URL[] userJars = Locator.getLocationURLs(new File(USER_LIBDIR)); + + // Now try and find JAVA_HOME + File toolsJar = Locator.getToolsJar(); + + int jarsLength = libJars.length + userJars.length + (toolsJar!=null?1:0); + URL[] allJars = new URL[jarsLength]; + int i = 0; + if(toolsJar != null){ + allJars[i++] = toolsJar.toURL(); + } + if(libJars.length != 0){ + System.arraycopy(libJars, 0, allJars, i, libJars.length); + i += libJars.length; + } + if(userJars.length != 0){ + System.arraycopy(userJars, 0, allJars, i, userJars.length); + //i+=userJars.length; + //assert(allJars.length=i-1); + } + return libJars; + } + + +} Property changes on: pal-portal/modules/ant-installer/trunk/src/org/tp23/antinstaller/runtime/exe/AntProjectFilter.java ___________________________________________________________________ Name: svn:eol-style + native Added: pal-portal/modules/ant-installer/trunk/src/org/tp23/antinstaller/runtime/exe/CreateLoggerFilter.java =================================================================== --- pal-portal/modules/ant-installer/trunk/src/org/tp23/antinstaller/runtime/exe/CreateLoggerFilter.java (rev 0) +++ pal-portal/modules/ant-installer/trunk/src/org/tp23/antinstaller/runtime/exe/CreateLoggerFilter.java 2008-06-11 13:36:41 UTC (rev 975) @@ -0,0 +1,68 @@ +/* + * Copyright 2005 Paul Hinds + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +package org.tp23.antinstaller.runtime.exe; + +import java.io.File; + +import org.tp23.antinstaller.InstallerContext; +import org.tp23.antinstaller.runtime.SimpleLogger; + + +/** + * Creates a suitable logger for the install. The logging does not + * throw exceptions since it is mainly for debug and we dont want to + * stop an install just because logging is not working + * @author Paul Hinds + * @version $Id: CreateLoggerFilter.java,v 1.3 2007/01/09 22:41:40 teknopaul Exp $ + */ +public class CreateLoggerFilter implements ExecuteFilter { + + public static final String LOG_FILE_NAME = "ant.install.log"; + + /** + */ + public void exec(InstallerContext ctx){ + SimpleLogger logger = new SimpleLogger(); + ctx.setLogger( logger ); + try { + String defaultName = "./ant.install.log"; + // @since 0.7.1 RFE-1154368 for installs from CD where ./ is not writable + File defaultFile = new File(defaultName); + try { + if( !defaultFile.exists() ){ + defaultFile.createNewFile(); + } + } + catch(Exception e) { + ;// ignore canWrite() will return false + } + if(defaultFile.canWrite()) { + logger.setFileName(defaultName); + } + else { + String tempDir = ctx.getFileRoot().getAbsolutePath(); + logger.setFileName(tempDir+System.getProperty("file.separator") + LOG_FILE_NAME); + } + ctx.log("Ant basedir:" + ctx.getFileRoot().getCanonicalPath()); + } + catch (Throwable ex1) { + ex1.printStackTrace(); + logger.close(); + // swallow exceptions + } + } + +} Property changes on: pal-portal/modules/ant-installer/trunk/src/org/tp23/antinstaller/runtime/exe/CreateLoggerFilter.java ___________________________________________________________________ Name: svn:eol-style + native Added: pal-portal/modules/ant-installer/trunk/src/org/tp23/antinstaller/runtime/exe/CreateUIFilter.java =================================================================== --- pal-portal/modules/ant-installer/trunk/src/org/tp23/antinstaller/runtime/exe/CreateUIFilter.java (rev 0) +++ pal-portal/modules/ant-installer/trunk/src/org/tp23/antinstaller/runtime/exe/CreateUIFilter.java 2008-06-11 13:36:41 UTC (rev 975) @@ -0,0 +1,132 @@ +/* + * Copyright 2005 Paul Hinds + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +package org.tp23.antinstaller.runtime.exe; + +import java.io.IOException; +import java.util.StringTokenizer; + +import org.tp23.antinstaller.InstallException; +import org.tp23.antinstaller.InstallerContext; +import org.tp23.antinstaller.renderer.swing.plaf.LookAndFeelFactory; +import org.tp23.antinstaller.runtime.AutoSwingRunner; +import org.tp23.antinstaller.runtime.AutoTextRunner; +import org.tp23.antinstaller.runtime.Runner; +import org.tp23.antinstaller.runtime.SwingRunner; +import org.tp23.antinstaller.runtime.TextRunner; + + +/** + * Creates the Runner instance for the execution UI and sets up an appropriate + * message renderer. + * @author Paul Hinds + * @version $Id: CreateUIFilter.java,v 1.7 2007/01/28 17:49:15 teknopaul Exp $ + */ +public class CreateUIFilter implements ExecuteFilter { + + /** + * @see org.tp23.antinstaller.runtime.exe.ExecuteFilter#exec(org.tp23.antinstaller.InstallerContext) + */ + public void exec(InstallerContext ctx) throws InstallException { + try { + if(ctx.getInstaller().isVerbose()){ + ctx.log("Creating UI classes"); + } + ctx.setRunner(getRunner(ctx)); + ctx.log("Created UI classes"); + } + catch (IOException e) { + throw new InstallException("Unable to create the user interface", e); + } + catch (InstallException e) { + throw new InstallException(e.getMessage(), e); + } + } + /** + * Determines which Runner to use text or swing or "auto" UIs which skip past the properties sreens. + * @param override String if this paramter is not null it will be used. If + * swing and there is no graphics environment the install will fail, if it is left + * as null a check is made to see if there is a Graphics Environment and swing is used + * if there are no errors, if there are errors the system falls back to the text console + * + * @throws IOException + * @return Runner + */ + private Runner getRunner(InstallerContext ctx) throws IOException, InstallException { + + if(ctx.getUIOverride() != null){ + if (ctx.getUIOverride().equalsIgnoreCase("swing")){ + if(isUi("swing", ctx.getInstaller().getUi())){ + new LookAndFeelFactory(ctx).setLAF(); + return new SwingRunner(ctx); + }else{ + throw new InstallException("Not a permited UI override, swing is not allowed"); + } + } + + if (ctx.getUIOverride().equalsIgnoreCase("text")){ + if(isUi("text", ctx.getInstaller().getUi())){ + return new TextRunner(ctx); + }else{ + throw new InstallException("Not a permited UI override, text is not allowed"); + } + } + + if (ctx.getUIOverride().equalsIgnoreCase("swing-auto")){ + if(isUi("swing-auto", ctx.getInstaller().getUi())){ + new LookAndFeelFactory(ctx).setLAF(); + return new AutoSwingRunner(ctx); + }else{ + throw new InstallException("Not a permited UI override, swing-auto is not allowed"); + } + } + + if (ctx.getUIOverride().equalsIgnoreCase("text-auto")){ + if(isUi("text-auto", ctx.getInstaller().getUi())){ + return new AutoTextRunner(ctx); + }else{ + throw new InstallException("Not a permited UI override, text-auto is not allowed"); + } + } + + } + //else do stuff to work out if there is a graphics context + try{ + java.awt.GraphicsEnvironment.getLocalGraphicsEnvironment(); + /* + * Above test is not enough to be sure that we can use the graphics env + * so do remaining setup within try/catch block + */ + new LookAndFeelFactory(ctx).setLAF(); + return new SwingRunner(ctx); + } catch (Throwable e){ + System.out.println("No graphics environment available, reverting to text"); + System.out.println(); + return new TextRunner(ctx); + } + } + + + private boolean isUi(String ui, String commaSeparatedUiList){ + StringTokenizer st = new StringTokenizer(commaSeparatedUiList, ","); + while(st.hasMoreTokens()){ + if(st.nextToken().equals(ui)){ + return true; + } + } + return false; + } + +} Property changes on: pal-portal/modules/ant-installer/trunk/src/org/tp23/antinstaller/runtime/exe/CreateUIFilter.java ___________________________________________________________________ Name: svn:eol-style + native Added: pal-portal/modules/ant-installer/trunk/src/org/tp23/antinstaller/runtime/exe/ExecuteFilter.java =================================================================== --- pal-portal/modules/ant-installer/trunk/src/org/tp23/antinstaller/runtime/exe/ExecuteFilter.java (rev 0) +++ pal-portal/modules/ant-installer/trunk/src/org/tp23/antinstaller/runtime/exe/ExecuteFilter.java 2008-06-11 13:36:41 UTC (rev 975) @@ -0,0 +1,31 @@ +/* + * Copyright 2005 Paul Hinds + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +package org.tp23.antinstaller.runtime.exe; + +import org.tp23.antinstaller.InstallException; +import org.tp23.antinstaller.InstallerContext; + + +/** + * The Execute engine is being replaced with a filter pattern to enable + * further extension of the system, Initiallly a hardcoded filter chain + * will be used subsequently to be replaced by a pluggable mechanism. + * @author Paul Hinds + * @version $Id: ExecuteFilter.java,v 1.1.1.1 2005/10/18 18:20:57 teknopaul Exp $ + */ +public interface ExecuteFilter { + public void exec(InstallerContext ctx) throws InstallException; +} Property changes on: pal-portal/modules/ant-installer/trunk/src/org/tp23/antinstaller/runtime/exe/ExecuteFilter.java ___________________________________________________________________ Name: svn:eol-style + native Added: pal-portal/modules/ant-installer/trunk/src/org/tp23/antinstaller/runtime/exe/ExecuteRunnerFilter.java =================================================================== --- pal-portal/modules/ant-installer/trunk/src/org/tp23/antinstaller/runtime/exe/ExecuteRunnerFilter.java (rev 0) +++ pal-portal/modules/ant-installer/trunk/src/org/tp23/antinstaller/runtime/exe/ExecuteRunnerFilter.java 2008-06-11 13:36:41 UTC (rev 975) @@ -0,0 +1,48 @@ +/* + * Copyright 2005 Paul Hinds + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +package org.tp23.antinstaller.runtime.exe; + +import org.tp23.antinstaller.InstallException; +import org.tp23.antinstaller.InstallerContext; + + +/** + * Executes the Screens part of the build + * @author Paul Hinds + * @version $Id: ExecuteRunnerFilter.java,v 1.3 2006/12/21 01:48:51 teknopaul Exp $ + */ +public class ExecuteRunnerFilter implements ExecuteFilter { + + /** + * @see org.tp23.antinstaller.runtime.exe.ExecuteFilter#exec(org.tp23.antinstaller.InstallerContext) + */ + public void exec(InstallerContext ctx) throws InstallException { + if(ctx.getInstaller().isVerbose()){ + ctx.log("Starting UI Screens"); + } + boolean ok = ctx.getRunner().runInstaller(); + if(!ok){ + throw new AbortException("Install Aborted"); + } + ctx.log("Install screens rendered"); + } + + public static class AbortException extends InstallException{ + public AbortException(String message){ + super(message); + } + } +} Property changes on: pal-portal/modules/ant-installer/trunk/src/org/tp23/antinstaller/runtime/exe/ExecuteRunnerFilter.java ___________________________________________________________________ Name: svn:eol-style + native Added: pal-portal/modules/ant-installer/trunk/src/org/tp23/antinstaller/runtime/exe/FilterChain.java =================================================================== --- pal-portal/modules/ant-installer/trunk/src/org/tp23/antinstaller/runtime/exe/FilterChain.java (rev 0) +++ pal-portal/modules/ant-installer/trunk/src/org/tp23/antinstaller/runtime/exe/FilterChain.java 2008-06-11 13:36:41 UTC (rev 975) @@ -0,0 +1,32 @@ +/* + * Copyright 2005 Paul Hinds + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +package org.tp23.antinstaller.runtime.exe; + +import org.tp23.antinstaller.InstallerContext; + + +/** + * A filter chain is a series of operations to be run by the ExecInstall class. + * This defines the sequence of events in the installer and provides for pluggable + * extra sequences for example post installtion messages or running the application. + * All FilterChains should end in a FinalizerFilter. + * @author Paul Hinds + * @version $Id: FilterChain.java,v 1.1.1.1 2005/10/18 18:20:57 teknopaul Exp $ + */ +public interface FilterChain { + public void init(InstallerContext ctx); + public ExecuteFilter[] getFilters(); +} Property changes on: pal-portal/modules/ant-installer/trunk/src/org/tp23/antinstaller/runtime/exe/FilterChain.java ___________________________________________________________________ Name: svn:eol-style + native Added: pal-portal/modules/ant-installer/trunk/src/org/tp23/antinstaller/runtime/exe/FilterFactory.java =================================================================== --- pal-portal/modules/ant-installer/trunk/src/org/tp23/antinstaller/runtime/exe/FilterFactory.java (rev 0) +++ pal-portal/modules/ant-installer/trunk/src/org/tp23/antinstaller/runtime/exe/FilterFactory.java 2008-06-11 13:36:41 UTC (rev 975) @@ -0,0 +1,86 @@ +/* + * Copyright 2005 Paul Hinds + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +package org.tp23.antinstaller.runtime.exe; + +import java.io.BufferedReader; +import java.io.IOException; +import java.io.InputStream; +import java.io.InputStreamReader; +import java.util.ArrayList; +import java.util.List; + +import org.tp23.antinstaller.InstallException; +import org.tp23.antinstaller.InstallerContext; + + +/** + * Loads FilterChains from resource files on the classpath with lists of class + * names listed in order. In the files lines starting with # and blank + * lines are ignored + * @author Paul Hinds + * @version $Id: FilterFactory.java,v 1.4 2007/01/04 22:57:18 teknopaul Exp $ + */ +public class FilterFactory { + + public static final String FILTER_RESOURCE = "/antinstall-config.fconfig"; + + private FilterFactory() { + } + + public static FilterChain factory(String configResource) throws InstallException{ + try { + InputStream is = FilterFactory.class.getResourceAsStream(configResource); + BufferedReader br = new BufferedReader(new InputStreamReader(is)); + String filterClass = null; + final List filterChain = new ArrayList(); + while((filterClass = br.readLine())!=null){ + if(filterClass.startsWith("#"))continue; + filterClass = filterClass.trim(); + if(filterClass.equals("")){ + continue; + } + filterChain.add( Class.forName(filterClass).newInstance() ); + } + br.close(); + return new DynamicFilterChain(configResource, filterChain); + } + catch (IOException e) { + e.printStackTrace(); + } + catch (Exception e) { + e.printStackTrace(); + } + throw new InstallException("Can not create FilterChain"); + } + + static class DynamicFilterChain implements FilterChain{ + + private ExecuteFilter[] filters; + private String configResource; + + private DynamicFilterChain(String configResource, List filterChain){ + this.configResource = configResource; + filters = new ExecuteFilter[filterChain.size()]; + filterChain.toArray(filters); + } + public void init(InstallerContext ctx){ + ctx.setConfigResource(configResource); + } + public ExecuteFilter[] getFilters(){ + return filters; + } + }; +} Property changes on: pal-portal/modules/ant-installer/trunk/src/org/tp23/antinstaller/runtime/exe/FilterFactory.java ___________________________________________________________________ Name: svn:eol-style + native Added: pal-portal/modules/ant-installer/trunk/src/org/tp23/antinstaller/runtime/exe/FinalizerFilter.java =================================================================== --- pal-portal/modules/ant-installer/trunk/src/org/tp23/antinstaller/runtime/exe/FinalizerFilter.java (rev 0) +++ pal-portal/modules/ant-installer/trunk/src/org/tp23/antinstaller/runtime/exe/FinalizerFilter.java 2008-06-11 13:36:41 UTC (rev 975) @@ -0,0 +1,47 @@ +/* + * Copyright 2005 Paul Hinds + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +package org.tp23.antinstaller.runtime.exe; + +import org.tp23.antinstaller.InstallerContext; + + +/** + * This filter is called at the end of the install. This is not the + * last Java operation since a shutDownHook is present to delete temporary + * files and in the GUI version the screen should not dissappear. + * All filter chains must end in a FinalizerFilter or subclass + * and the exec method must not throw an Exception. + * + * @author Paul Hinds + * @version $Id: FinalizerFilter.java,v 1.3 2007/01/04 22:57:17 teknopaul Exp $ + */ +public class FinalizerFilter implements ExecuteFilter { + + // TODO as per FindBugs the System.exit(0) in SwingPageRenderer prevents this running + /** + * @see org.tp23.antinstaller.runtime.exe.ExecuteFilter#exec(org.tp23.antinstaller.InstallerContext) + */ + public void exec(InstallerContext ctx){ + try { + ctx.log("Finalizing"); + ctx.getLogger().close(); + } + catch (Throwable e) { + e.printStackTrace(); + } + } + +} Property changes on: pal-portal/modules/ant-installer/trunk/src/org/tp23/antinstaller/runtime/exe/FinalizerFilter.java ___________________________________________________________________ Name: svn:eol-style + native Added: pal-portal/modules/ant-installer/trunk/src/org/tp23/antinstaller/runtime/exe/InputStreamLoadConfigFilter.java =================================================================== --- pal-portal/modules/ant-installer/trunk/src/org/tp23/antinstaller/runtime/exe/InputStreamLoadConfigFilter.java (rev 0) +++ pal-portal/modules/ant-installer/trunk/src/org/tp23/antinstaller/runtime/exe/InputStreamLoadConfigFilter.java 2008-06-11 13:36:41 UTC (rev 975) @@ -0,0 +1,51 @@ +/* + * Copyright 2005 Paul Hinds + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +package org.tp23.antinstaller.runtime.exe; + +import java.io.IOException; +import java.io.InputStream; + +import org.tp23.antinstaller.InstallException; +import org.tp23.antinstaller.InstallerContext; +import org.tp23.antinstaller.runtime.ConfigurationException; + + +/** + * @author Paul Hinds + * @version $Id: InputStreamLoadConfigFilter.java,v 1.4 2007/01/28 08:44:39 teknopaul Exp $ + */ +public class InputStreamLoadConfigFilter extends LoadConfigFilter { + + public void exec(InstallerContext ctx) throws InstallException { + this.ctx = ctx; + + try { + InputStream config = this.getClass().getResourceAsStream("/" + ctx.getInstallerConfigFile()); + if(config == null){ // passed in incorrectly on the command line or bad installer + throw new IOException(); + } + readConfig(ctx.getFileRoot(), config); + ctx.setInstaller(installer); + ctx.log("Config loaded"); + } + catch (IOException e) { + throw new InstallException("Not able to load and read the AntInstaller config",e); + } + catch (ConfigurationException e) { + throw new InstallException("Not able to load and read the AntInstaller config",e); + } + } +} Property changes on: pal-portal/modules/ant-installer/trunk/src/org/tp23/antinstaller/runtime/exe/InputStreamLoadConfigFilter.java ___________________________________________________________________ Name: svn:eol-style + native Added: pal-portal/modules/ant-installer/trunk/src/org/tp23/antinstaller/runtime/exe/LoadConfigFilter.java =================================================================== --- pal-portal/modules/ant-installer/trunk/src/org/tp23/antinstaller/runtime/exe/LoadConfigFilter.java (rev 0) +++ pal-portal/modules/ant-installer/trunk/src/org/tp23/antinstaller/runtime/exe/LoadConfigFilter.java 2008-06-11 13:36:41 UTC (rev 975) @@ -0,0 +1,477 @@ +/* + * Copyright 2005 Paul Hinds + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +package org.tp23.antinstaller.runtime.exe; + +import java.io.File; +import java.io.FileInputStream; +import java.io.IOException; +import java.io.InputStream; +import java.lang.reflect.InvocationTargetException; +import java.lang.reflect.Method; +import java.util.ArrayList; + +import javax.xml.parsers.DocumentBuilder; +import javax.xml.parsers.DocumentBuilderFactory; + +import org.tp23.antinstaller.InstallException; +import org.tp23.antinstaller.Installer; +import org.tp23.antinstaller.InstallerContext; +import org.tp23.antinstaller.input.AppRootInput; +import org.tp23.antinstaller.input.CheckboxInput; +import org.tp23.antinstaller.input.CommentOutput; +import org.tp23.antinstaller.input.ConditionalField; +import org.tp23.antinstaller.input.ConfirmPasswordTextInput; +import org.tp23.antinstaller.input.DateInput; +import org.tp23.antinstaller.input.DirectoryInput; +import org.tp23.antinstaller.input.ExtValidatedTextInput; +import org.tp23.antinstaller.input.FileInput; +import org.tp23.antinstaller.input.HiddenPropertyInput; +import org.tp23.antinstaller.input.InputField; +import org.tp23.antinstaller.input.LargeSelectInput; +import org.tp23.antinstaller.input.OutputField; +import org.tp23.antinstaller.input.PasswordTextInput; +import org.tp23.antinstaller.input.SelectInput; +import org.tp23.antinstaller.input.TargetInput; +import org.tp23.antinstaller.input.TargetSelectInput; +import org.tp23.antinstaller.input.UnvalidatedTextInput; +import org.tp23.antinstaller.input.ValidatedTextInput; +import org.tp23.antinstaller.page.LicensePage; +import org.tp23.antinstaller.page.Page; +import org.tp23.antinstaller.page.ProgressPage; +import org.tp23.antinstaller.page.SimpleInputPage; +import org.tp23.antinstaller.page.SplashPage; +import org.tp23.antinstaller.page.TextPage; +import org.tp23.antinstaller.runtime.ConfigurationException; +import org.w3c.dom.Document; +import org.w3c.dom.Element; +import org.w3c.dom.NamedNodeMap; +import org.w3c.dom.Node; +import org.w3c.dom.NodeList; +import org.xml.sax.EntityResolver; +import org.xml.sax.InputSource; + + +/** + * Loads the Ant Install configuration and sets the Installer object back + * into the context. A similar technique to the apache digester is used to + * populate object attributes in this class. + * N.B. The only types that can be set for object attributes are Strings, booleans + * or ints. + * @author Paul Hinds + * @version $Id: LoadConfigFilter.java,v 1.9 2007/01/28 08:44:39 teknopaul Exp $ + */ +public class LoadConfigFilter implements ExecuteFilter { + + //TODO move to InstallerContext + public static final String INSTALLER_CONFIG_FILE = "antinstall-config.xml"; + + protected Installer installer = new Installer(); + protected InstallerContext ctx; + + /** + * @see org.tp23.antinstaller.runtime.exe.ExecuteFilter#exec(org.tp23.antinstaller.InstallerContext) + */ + public void exec(InstallerContext ctx) throws InstallException { + this.ctx = ctx; + + try { + installer = readConfig(ctx.getFileRoot(), ctx.getInstallerConfigFile()); + ctx.setInstaller(installer); + ctx.log("Config loaded"); + } + catch (IOException e) { + throw new InstallException("Not able to load and read the AntInstaller config", e); + } + catch (ConfigurationException e) { + throw new InstallException("Not able to load and read the AntInstaller config", e); + } + } + + /** + * Currently read the config using any available XML parser + * This method reads the config from the file system + * @param fileRoot The directory where the config file is stored + * @param the name of the configuration file (usually antinstall-config.xml) + * @return Installer + */ + public Installer readConfig(File fileRoot, String fileName) throws IOException, ConfigurationException { + + installer.getResultContainer().setInstallRoot(fileRoot); + + File config = new File(fileRoot, fileName); + if(!config.exists()){ // passed in incorrectly on the command line or bad installer + throw new IOException(); + } + InputSource xmlInp = new InputSource(new FileInputStream(config)); + readConfig(xmlInp); + + return installer; + } + /** + * This overloaded method reads from the provided input stream to facilitate + * reading configs directly from the Jar, the file root is still needed + * for Ant's basedir. Used by InputStreamLoadConfigFilter + * @return Installer + */ + protected Installer readConfig(File fileRoot, InputStream configSource) throws IOException, ConfigurationException { + + installer.getResultContainer().setInstallRoot(fileRoot); + + InputSource xmlInp = new InputSource(configSource); + readConfig(xmlInp); + + return installer; + } + /** + * Currently read the config using any available XML parser + * @todo read the installer with only xerces + * @return Installer + */ + protected Installer readConfig(InputSource xmlInp) throws IOException, ConfigurationException { + + Document doc = null; + try { + + DocumentBuilderFactory docBuilderFactory = DocumentBuilderFactory.newInstance(); + DocumentBuilder parser = docBuilderFactory.newDocumentBuilder(); + + // RFE [ 1475361 ] Using a custom entity resolver + String entityResolverClass = System.getProperty("antinstaller.EntityResolverClass"); + EntityResolver er = null; + if(entityResolverClass != null){ + try{ + er = (EntityResolver)Class.forName(entityResolverClass).newInstance(); + } + catch(Exception e){ + // Property error use default this is a very specific requirement + er = new CustomEntityResolver(); + } + } + else{ + er = new CustomEntityResolver(); + } + + parser.setEntityResolver(er); + + doc = parser.parse(xmlInp); + Element root = doc.getDocumentElement(); + root.normalize(); + setProperties(installer, root.getAttributes()); + NodeList allPages = root.getElementsByTagName("page"); + //TODO make this pluggable + getPages(installer, allPages); + + } + catch (Exception e) { + throw new IOException("DomFactory error: caused by:" + e.getClass() + ":" + e.getMessage()); + } + return installer; + } + + + /** + * Used when reading the config + * @param allPages NodeList + * @throws ConfigurationException + */ + private void getPages(Installer installerConfig, NodeList allPages) throws ConfigurationException { + ArrayList pages = new ArrayList(); + for (int i = 0; i < allPages.getLength(); i++) { + Element pageElem = (Element) allPages.item(i); + Page page = getPageType(pageElem.getAttribute("type")); + setProperties(page, pageElem.getAttributes()); + pages.add(page); + getOutputFields(page, pageElem); + } + Page[] pageArr = new Page[pages.size()]; + pages.toArray(pageArr); + installerConfig.setPages(pageArr); + } + /** + * Used when reading the config + * @param page Page + * @param pageElem Element + * @throws ConfigurationException + */ + private void getOutputFields(Page page, Element pageElem) throws ConfigurationException { + page.setOutputField( getInnerOutputFields( pageElem )); + } + + private OutputField[] getInnerOutputFields( Element elem) throws ConfigurationException { + NodeList allFields = elem.getChildNodes(); + ArrayList fields = new ArrayList(); + for (int i = 0; i < allFields.getLength(); i++) { + if(! (allFields.item(i) instanceof Element))continue; + Element fieldElem = (Element)allFields.item(i); + OutputField field = getOutputFieldType(fieldElem.getNodeName(), fieldElem); + if(field != null){ + setProperties(field, fieldElem.getAttributes()); + fields.add(field); + field.setResultContainer(installer.getResultContainer()); + } + } + OutputField[] fieldArr = new OutputField[fields.size()]; + + return (OutputField[])fields.toArray(fieldArr); + } + + /** + * Used when reading the config + * @param type String + * @throws ConfigurationException + * @return Page + */ + private Page getPageType(String type) throws ConfigurationException { + if (type.equalsIgnoreCase("license")) { + return new LicensePage(); + } + else if (type.equalsIgnoreCase("input")) { + return new SimpleInputPage(); + } + else if (type.equalsIgnoreCase("progress")) { + return new ProgressPage(); + } + else if (type.equalsIgnoreCase("splash")) { + return new SplashPage(); + } + else if (type.equalsIgnoreCase("text")) { + return new TextPage(); + } + throw new ConfigurationException("Unknown Page type:" + type); + } + /** + * Used when reading the config + * @param type String + * @param field Element + * @throws ConfigurationException + * @return InputField + */ + private OutputField getOutputFieldType(String type, Element field) throws ConfigurationException { + if (type.equalsIgnoreCase("text")) { + return new UnvalidatedTextInput(); + } + else if (type.equalsIgnoreCase("directory")) { + return new DirectoryInput(); + } + else if (type.equalsIgnoreCase("target")) { + return new TargetInput(); + } + else if (type.equalsIgnoreCase("file")) { + return new FileInput(); + } + else if (type.equalsIgnoreCase("comment")) { + return new CommentOutput(); + } + else if (type.equalsIgnoreCase("checkbox")) { + return new CheckboxInput(); + } + else if (type.equalsIgnoreCase("validated")) { + return new ValidatedTextInput(); + } + else if (type.equalsIgnoreCase("ext-validated")) { + return new ExtValidatedTextInput(); + } + else if (type.equalsIgnoreCase("password")) { + return new PasswordTextInput(); + } + else if (type.equalsIgnoreCase("password-confirm")) { + return new ConfirmPasswordTextInput(); + } + else if (type.equalsIgnoreCase("hidden")) { + return new HiddenPropertyInput(); + } + else if (type.equalsIgnoreCase("date")) { + return new DateInput(); + } + else if (type.equalsIgnoreCase("app-root")) { + return new AppRootInput(); + } + else if (type.equalsIgnoreCase("conditional")) { + ConditionalField conditionalField = new ConditionalField(); + OutputField[] outFields = getInnerOutputFields( field ); + InputField[] inFields = new InputField[ outFields.length ]; + for( int i = 0; i < outFields.length; i++ ) { + inFields[i] = (InputField) outFields[i]; + } + conditionalField.setFields( inFields ); + return conditionalField; + } + else if (type.equalsIgnoreCase("select")) { + SelectInput sInput = new SelectInput(); + NodeList allOptions = field.getElementsByTagName("option"); + ArrayList options = new ArrayList(); + for (int i = 0; i < allOptions.getLength(); i++) { + Element optionElem = (Element) allOptions.item(i); + SelectInput.Option option = sInput.getNewOption(); + option.setText(optionElem.getAttribute("text")); + option.value = optionElem.getAttribute("value"); + options.add(option); + } + SelectInput.Option[] optionArr = new SelectInput.Option[options.size()]; + options.toArray(optionArr); + sInput.setOptions(optionArr); + + return sInput; + } + else if (type.equalsIgnoreCase("target-select")) { + TargetSelectInput sInput = new TargetSelectInput(); + NodeList allOptions = field.getElementsByTagName("option"); + ArrayList options = new ArrayList(); + for (int i = 0; i < allOptions.getLength(); i++) { + Element optionElem = (Element) allOptions.item(i); + SelectInput.Option option = sInput.getNewOption(); + option.setText(optionElem.getAttribute("text")); + option.value = optionElem.getAttribute("value"); + options.add(option); + } + SelectInput.Option[] optionArr = new SelectInput.Option[options.size()]; + options.toArray(optionArr); + sInput.setOptions(optionArr); + + return sInput; + } + else if (type.equalsIgnoreCase("large-select")) { + LargeSelectInput sInput = new LargeSelectInput(); + NodeList allOptions = field.getElementsByTagName("option"); + ArrayList options = new ArrayList(); + for (int i = 0; i < allOptions.getLength(); i++) { + Element optionElem = (Element) allOptions.item(i); + LargeSelectInput.Option option = sInput.getNewOption(); + option.setText(optionElem.getAttribute("text")); + option.value = optionElem.getAttribute("value"); + options.add(option); + } + LargeSelectInput.Option[] optionArr = new LargeSelectInput.Option[options.size()]; + options.toArray(optionArr); + sInput.setOptions(optionArr); + + return sInput; + } + System.out.println("Unrecognised Input Element:"+type); + return null; + //throw new ConfigurationException("Unknown Input Field type:" + type); + } + + + + /** + * Calls bean setter methods based on attribures found. Could use BeanUtils here + * but we want to stay clear of external dependencies. + * @param bean Object + * @param map NamedNodeMap + */ + private void setProperties(Object bean, NamedNodeMap map) { + int numAtts = map.getLength(); + for (int a = 0; a < numAtts; a++) { + Node attribute = map.item(a); + String name = attribute.getNodeName(); + String value = attribute.getNodeValue(); + String methodName = "set" + Character.toUpperCase(name.charAt(0)) + name.substring(1); + Method[] allMethods = bean.getClass().getMethods(); + for (int m = 0; m < allMethods.length; m++) { + if (allMethods[m].getName().equals(methodName)) { + try { + Class[] parameters = allMethods[m].getParameterTypes(); + Object[] paramValues; + if (parameters[0].equals(Boolean.class)) { + paramValues = new Boolean[1]; + if ( OutputField.isTrue(value) ) { + paramValues[0] = Boolean.TRUE; + } + else { + paramValues[0] = Boolean.FALSE; + } + } + else + if (parameters[0].equals(Integer.class)) { + paramValues = new Integer[1]; + paramValues[0] = new Integer(value); + } + else { + paramValues = new String[1]; + paramValues[0] = value; + } + allMethods[m].invoke(bean, paramValues); + continue; + } + catch (IndexOutOfBoundsException ex) { + // not the setter we are looking for + // this is the wrong overloaded method + continue; + } + // Ignore reflection errors and continue + catch (IllegalArgumentException e) { + } + catch (IllegalAccessException e) { + } + catch (InvocationTargetException e) { + } + } + } + } + } + + private static class CustomEntityResolver implements EntityResolver{ + public InputSource resolveEntity(String publicId, String systemId) { + + if (publicId.equals("-//tp23 //DTD Ant Installer Config//EN") && + systemId.equals("http://antinstaller.sf.net/dtd/antinstall-config-0.2.dtd")) { + InputSource localSrc = new InputSource(this.getClass().getResourceAsStream( + "/org/tp23/antinstaller/antinstall-config-0.2.dtd")); + return localSrc; + } + if (publicId.equals("-//tp23 //DTD Ant Installer Config//EN") && + systemId.equals("http://antinstaller.sf.net/dtd/antinstall-config-0.3.dtd")) { + InputSource localSrc = new InputSource(this.getClass().getResourceAsStream( + "/org/tp23/antinstaller/antinstall-config-0.3.dtd")); + return localSrc; + } + if (publicId.equals("-//tp23 //DTD Ant Installer Config//EN") && + systemId.equals("http://antinstaller.sf.net/dtd/antinstall-config-0.4.dtd")) { + InputSource localSrc = new InputSource(this.getClass().getResourceAsStream( + "/org/tp23/antinstaller/antinstall-config-0.4.dtd")); + return localSrc; + } + if (publicId.equals("-//tp23 //DTD Ant Installer Config//EN") && + systemId.equals("http://antinstaller.sf.net/dtd/antinstall-config-0.5.dtd")) { + InputSource localSrc = new InputSource(this.getClass().getResourceAsStream( + "/org/tp23/antinstaller/antinstall-config-0.5.dtd")); + return localSrc; + } + if (publicId.equals("-//tp23 //DTD Ant Installer Config//EN") && + systemId.equals("http://antinstaller.sf.net/dtd/antinstall-config-0.6.dtd")) { + InputSource localSrc = new InputSource(this.getClass().getResourceAsStream( + "/org/tp23/antinstaller/antinstall-config-0.6.dtd")); + return localSrc; + } + if (publicId.equals("-//tp23 //DTD Ant Installer Config//EN") && + systemId.equals("http://antinstaller.sf.net/dtd/antinstall-config-0.7.dtd")) { + InputSource localSrc = new InputSource(this.getClass().getResourceAsStream( + "/org/tp23/antinstaller/antinstall-config-0.7.dtd")); + return localSrc; + } + if (publicId.equals("-//tp23 //DTD Ant Installer Config//EN") && + systemId.equals("http://antinstaller.sf.net/dtd/antinstall-config-0.8.dtd")) { + InputSource localSrc = new InputSource(this.getClass().getResourceAsStream( + "/org/tp23/antinstaller/antinstall-config-0.8.dtd")); + return localSrc; + } + else { + return null; + } + } + } +} Property changes on: pal-portal/modules/ant-installer/trunk/src/org/tp23/antinstaller/runtime/exe/LoadConfigFilter.java ___________________________________________________________________ Name: svn:eol-style + native Added: pal-portal/modules/ant-installer/trunk/src/org/tp23/antinstaller/runtime/exe/PropertyLoaderFilter.java =================================================================== --- pal-portal/modules/ant-installer/trunk/src/org/tp23/antinstaller/runtime/exe/PropertyLoaderFilter.java (rev 0) +++ pal-portal/modules/ant-installer/trunk/src/org/tp23/antinstaller/runtime/exe/PropertyLoaderFilter.java 2008-06-11 13:36:41 UTC (rev 975) @@ -0,0 +1,419 @@ +/* + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limiations under the License. + */ + +package org.tp23.antinstaller.runtime.exe; + +import java.io.File; +import java.io.FileInputStream; +import java.io.FileNotFoundException; +import java.io.IOException; +import java.util.ArrayList; +import java.util.Collections; +import java.util.Iterator; +import java.util.List; +import java.util.Properties; +import java.util.ResourceBundle; +import java.util.StringTokenizer; + +import org.tp23.antinstaller.InstallException; +import org.tp23.antinstaller.Installer; +import org.tp23.antinstaller.InstallerContext; +import org.tp23.antinstaller.PropertiesFileRenderer; +import org.tp23.antinstaller.input.ConditionalField; +import org.tp23.antinstaller.input.InputField; +import org.tp23.antinstaller.input.OutputField; +import org.tp23.antinstaller.input.PasswordTextInput; +import org.tp23.antinstaller.input.TargetInput; +import org.tp23.antinstaller.input.TargetSelectInput; +import org.tp23.antinstaller.page.Page; +import org.tp23.antinstaller.runtime.VersionHelper; +import org.tp23.antinstaller.runtime.exe.ExecuteRunnerFilter.AbortException; + + +/** + * Loads properties from a file of default properties if found. + * the Installer element should define an attribute + * loadDefaults with one of the following values. + *
  • false - do not look for defaults
  • + *
  • prompt - look for properties and ask if they should be used if found
  • + *
  • load - look for defaults if found load them
  • + *
  • prompt-auto - wierd case where installer permits zero user interaction running only from antinstaller-config.xml defaults
  • + * + * N.B. this is not a generic property loader but one specifically for properties files + * generated by a previous run of an identical installer or one that according to the version + * number is compatible, see PropertyTask for loading other property sets + * FIXME i18n for AbortExceptoins + * @author teknopaul + * + */ +public class PropertyLoaderFilter implements ExecuteFilter { + + private static final ResourceBundle res = ResourceBundle.getBundle("org.tp23.antinstaller.renderer.Res"); + + public static final String LOAD = "true"; + public static final String PROMPT = "prompt"; + public static final String PROMPT_AUTO = "prompt-auto"; + public static final String FALSE = "false"; + public static final String DEFAULT_PROPERTIES_FILE_PROPERTY = "antinstaller.properties"; + + private final String fileNameProperty; + + private int definedPropertiesCount; + + /** + * Default constructor required for an ExecuteFilter implementation. + * The default property name given by @see{DEFAULT_PROPERTIES_FILE_PROPERTY} + * is used with this constructor + */ + public PropertyLoaderFilter() { + this( DEFAULT_PROPERTIES_FILE_PROPERTY ); + } + + /** + * Constructor that allows the name of the property containg the properties file + * to be specified + * + * @param fileNameProperty property containing the name of file + */ + public PropertyLoaderFilter( final String fileNameProperty ) { + this.fileNameProperty = fileNameProperty; + } + + /** + * Execute the filter action - in this case pre-setting InputField values + * with values loaded from a properties file (if present) + * + * @see org.tp23.antinstaller.runtime.exe.ExecuteFilter + * @param ctx context data + * @throws InstallException if an error occurred loading pre-defined properties + */ + public void exec(InstallerContext ctx) throws InstallException { + + Installer installer = ctx.getInstaller(); + String loadDefaults = installer.getLoadDefaults(); + if(installer.isVerbose()) { + ctx.log("loadDefaults attribute:" + loadDefaults); + } + boolean load = false; + if(loadDefaults == null || FALSE.equals(loadDefaults)) { + if(installer.isVerbose()) { + ctx.log("Not loading defaults"); + } + return; + } + + ctx.log( "Checking for predefined properties"); + Properties predefinedProps = loadPredefinedProperties( ctx, fileNameProperty ); + + definedPropertiesCount = predefinedProps.size(); + + boolean foundProps = false; + if( definedPropertiesCount == 0 ) { + ctx.log( "No predefined properties"); + } + else{ + foundProps = true; + } + + if( foundProps && PROMPT.equals(loadDefaults) ) { + load = ctx.getMessageRenderer().prompt(res.getString("promptLoadDefaults")); + } + else if( foundProps && PROMPT_AUTO.equals(loadDefaults)) { + load = ctx.getMessageRenderer().prompt(res.getString("promptLoadDefaults")); + } + else if( foundProps && LOAD.equals(loadDefaults) ) { + load = true; + } + + if( (!foundProps || !load) && + ctx.isAutoBuild() && + PROMPT.equals(loadDefaults) ) { + ctx.log( "Cant run -auto install without properties"); + throw new AbortException("Install Aborted: cant load ant.install.properties"); + } + + if(load) { + if(installer.isVerbose()) { + ctx.log("Loading defaults"); + } + + // version control + String propertiesVersion = predefinedProps.getProperty(PropertiesFileRenderer.INSTALLER_VERSION_PROPERTY); + String configVersion = ctx.getInstaller().getVersion(); + if(propertiesVersion != null) { + VersionHelper helper = new VersionHelper(); + if( ( ! propertiesVersion.equals(configVersion)) && + helper.equalOrHigher(configVersion , propertiesVersion) ) { + + // let major versions pass but prompt for differences + if( (! ctx.isAutoBuild()) && helper.majorVersionCompatible(configVersion , propertiesVersion) ){ + if( ! ctx.getMessageRenderer().prompt(res.getString("propertiesVersionMismatch")) ){ + throw new AbortException("Install Aborted: existing configuration is not compatible, config version: " + configVersion); + } + } + else { + throw new AbortException("Install Aborted: existing configuration is not compatible, config version: " + configVersion); + } + } + + } + else { + throw new AbortException("Install Aborted: local ant.install.properties missing config version, must be equal or lower than: " + configVersion); + } + // end version control + + Page[] allPages = installer.getPages(); + handleDefaults( ctx, allPages, predefinedProps ); + + } + } + + /* + * Use the supplied properties to pre-populate the page fields + */ + private void handleDefaults( InstallerContext ctx, Page[] allPages, Properties props ) throws InstallException { + for( int i = 0; i < allPages.length; i++ ) { + OutputField[] fields = allPages[i].getOutputField(); + setInputValues( ctx, allPages[i], fields, props ); + } + } + + private void setInputValues( InstallerContext ctx, Page page, OutputField[] outputFields, Properties props ) + throws InstallException { + //Should never happen, but guard against it + if( outputFields == null ) { + return; + } + + // find relevant targets + String targets = props.getProperty(page.getName() + PropertiesFileRenderer.TARGETS_SUFFIX); + List targetsList = splitTargets(targets); + + for (int j = 0; j < outputFields.length; j++) { + OutputField field = outputFields[j]; + + if( field instanceof ConditionalField ) { + ConditionalField condField = (ConditionalField) field; + setInputValues( ctx, page, condField.getFields(), props ); + } + else if( field instanceof InputField ) { + InputField input = (InputField)field; + String propName = input.getProperty(); + if( props.containsKey( propName ) ) { + String value = props.getProperty(propName); + + if( ctx.getInstaller().isDebug() ) { + ctx.log( "Setting " + propName + "=" + value ); + } + + input.setDefaultValue(value); // does not evaluate references + input.setInputResult(value); + input.setEditted( true ); + + if(field instanceof PasswordTextInput) { + if(value == null ){ + ctx.getMessageRenderer().printMessage(res.getString("promptMissingDefaultPassword")); + + } + } + + // TARGET TYPES + if(field instanceof TargetInput) { + // Target and SelectTarget + TargetInput tgtInput = (TargetInput)field; + page.removeTarget(tgtInput.getIdx()); + // if target was selected + if( ! InputField.isFalse(value)) { + page.addTarget(tgtInput.getIdx(), tgtInput.getTarget()); // returns the OS specific suffix if relevant + // DEBUG + if( ! targetsList.contains(tgtInput.getTarget()) ){ + // could be caused by someone trying to copy a file across platforms (not a good idea) + ctx.log("Defaults error: targets list for page " + page.getName() + + " should contain a TargetInput that was true"); + } + } + else { + if(InputField.isTrue( tgtInput.getForce()) ) { + String msg = "Defaults error: forced target for page " + page.getName() + + " has been removed"; + ctx.log(msg); + throw new InstallException(msg); + } + } + } + if(field instanceof TargetSelectInput) { + TargetSelectInput tgtInput = (TargetSelectInput)field; + page.removeTarget(tgtInput.getIdx()); + // one target must be selected (what if the page was not shown??) + page.addTarget(tgtInput.getIdx(), value); + } + } + } + //TODO: Should properties that are present in properties file but which do not appear + // as an InputField be set in the ResultContainer so that they can be used by later + // "if" conditions? - no other properties should be loaded separately from additional + // resource files if there is a requirement for that using an postDisplayTarget - PH + } + + //Page targets should be handled by the config loader process and indexed correctly + List pageTargets = page.getTargets(ctx); + Iterator iter = targetsList.iterator(); + while (iter.hasNext()) { + String targetPerProps = (String) iter.next(); + if( ! pageTargets.contains(targetPerProps)) { + ctx.log("Defaults warning: targets list for page " + page.getName() + + " should contain " + targetPerProps); + } + } + + } + + /** + * Check if external properties have been loaded + * + * @return true if an external properties file was configured and contained + * at least one property + */ + protected boolean isPropertiesLoaded() { + return (definedPropertiesCount > 0); + } + + /* + * Primarily for unit testing + */ + int getPropertiesFoundCount() { + return definedPropertiesCount; + } + + /** + * Load properties from a properties file if present. + * The name of the properties file is checked for in the following order. + *

    + * If the parameter fileNamePropertyName is not null: + *

      + *
    • the environment is checked for an environmentvariable with that name
    • + *
    • java system properties are checked for a property with that name
    • + *
    + * If the file name has not been found, or if fileNamePropertyName == null + * then the default file name is used - @see{org.tp23.antinstaller.PropertiesFileRenderer#PROPERTIES_FILE_NAME} + * + * @param context installer context + * @param fileNamePropertyName name of environment variable or java system property containing the + * name of the properties file to be loaded or null + * @return properties + * @throws InstallException if the properties file is missing or an error occurs loading it + */ + private Properties loadPredefinedProperties( final InstallerContext context, + final String fileNamePropertyName ) + throws InstallException { + + Properties contextProps = InstallerContext.getEnvironment(); + String propertiesFileName = null; + boolean failSilently = true; + + if( fileNamePropertyName != null ) { + propertiesFileName = contextProps.getProperty( InstallerContext.ENV_PREFIX + fileNamePropertyName ); + + if( propertiesFileName == null ) { + propertiesFileName = + contextProps.getProperty( InstallerContext.JAVA_PREFIX + fileNamePropertyName ); + } + + if( propertiesFileName != null ) { + //Properties have been passed explicitly to installer so must load them + failSilently = false; + } + } + + if( propertiesFileName == null ) { + propertiesFileName = PropertiesFileRenderer.PROPERTIES_FILE_NAME; + } + + Properties definedProperties = new Properties( ); + + if( propertiesFileName != null ) { + File definedPropertiesFile = new File( propertiesFileName ); + context.log( "Loading pre-defined properties from file " + + definedPropertiesFile.getAbsolutePath()); + + //TODO: Support loading properties file from via classloader as a resource + try { + FileInputStream istream = new FileInputStream( definedPropertiesFile ); + definedProperties.load( istream ); + istream.close(); + } + catch( FileNotFoundException fnfExc ) { + if( !failSilently ) { + throw new InstallException( "Defined properties file " + + definedPropertiesFile.getAbsolutePath() + + " doesn't exist" ); + } + } + catch( IOException ioExc ) { + if( !failSilently ) { + throw new InstallException( "Unable to read contents of defined properties file " + + definedPropertiesFile.getAbsolutePath(), + ioExc ); + } + } + + if( context.getInstaller().isDebug() ) { + logPropertiesLoaded( context, definedProperties, definedPropertiesFile ); + } + + } + + return definedProperties; + } + + + // Debug - log properties loaded + private void logPropertiesLoaded( final InstallerContext context, + final Properties properties, + final File propertiesFile ) { + Iterator iterator = properties.keySet().iterator(); + context.log( "Predefined properties (" + + definedPropertiesCount + + ") loaded from " + + propertiesFile.getAbsolutePath() + + "..." ); + while( iterator.hasNext() ) { + String key = (String) iterator.next(); + context.log( key + "=" + properties.getProperty( key ) ); + } + } + + /* + * Could do a String.split(",") but want to avoid 1.4 specific stuff generally + * @param commaSeparated + * @return + */ + private List splitTargets(String commaSeparated) { + if(commaSeparated == null) { + return Collections.EMPTY_LIST; + } + StringTokenizer st = new StringTokenizer(commaSeparated, ","); + List targets = new ArrayList(); + while (st.hasMoreElements()) { + String element = st.nextToken(); + if(element != null){ + element = element.trim(); + if(element.length() > 0){ + targets.add(element.trim()); + } + } + } + return targets; + } +} Property changes on: pal-portal/modules/ant-installer/trunk/src/org/tp23/antinstaller/runtime/exe/PropertyLoaderFilter.java ___________________________________________________________________ Name: svn:eol-style + native Added: pal-portal/modules/ant-installer/trunk/src/org/tp23/antinstaller/runtime/exe/PropertyPrinterFilter.java =================================================================== --- pal-portal/modules/ant-installer/trunk/src/org/tp23/antinstaller/runtime/exe/PropertyPrinterFilter.java (rev 0) +++ pal-portal/modules/ant-installer/trunk/src/org/tp23/antinstaller/runtime/exe/PropertyPrinterFilter.java 2008-06-11 13:36:41 UTC (rev 975) @@ -0,0 +1,83 @@ +/* + * Copyright 2005 Paul Hinds + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +package org.tp23.antinstaller.runtime.exe; + +import java.io.File; +import java.io.IOException; + +import org.tp23.antinstaller.DefaultPropertiesFileRenderer; +import org.tp23.antinstaller.ExplicitPropertiesFileRenderer; +import org.tp23.antinstaller.InstallException; +import org.tp23.antinstaller.InstallerContext; +import org.tp23.antinstaller.PropertiesFileRenderer; +import org.tp23.antinstaller.input.ResultContainer; + + +/** + * @author Paul Hinds + * @version $Id: PropertyPrinterFilter.java,v 1.5 2006/12/28 00:57:53 teknopaul Exp $ + */ +public class PropertyPrinterFilter implements ExecuteFilter { + + /** + * @see org.tp23.antinstaller.runtime.exe.ExecuteFilter#exec(org.tp23.antinstaller.InstallerContext) + */ + public void exec(InstallerContext ctx) throws InstallException { + ResultContainer results = ctx.getInstaller().getResultContainer(); + results.setProperty(PropertiesFileRenderer.FILE_ROOT_PROPERTY, + ctx.getFileRoot().getAbsolutePath()); + + printProperties(ctx); + + if(ctx.getInstaller().isVerbose()){ + ctx.log("Properties printed:" + ctx.getFileRoot().getAbsolutePath() + + File.separatorChar + PropertiesFileRenderer.PROPERTIES_FILE_NAME); + } + } + /** + * + * @param installer Installer + * @throws IOException + */ + private void printProperties(InstallerContext ctx) { + PropertiesFileRenderer propRenderer; + if(ctx.getInstaller().isVerbose()){ + propRenderer = new ExplicitPropertiesFileRenderer(); + } + else{ + propRenderer = new DefaultPropertiesFileRenderer(); + } + // render properties for reuse in auto builds + File currentDir = new File("."); + ctx.log("auto build supported: " + ctx.getInstaller().supportsAutoBuild()); + boolean alreadyWritten = false; + if(currentDir.canWrite() && ctx.getInstaller().supportsAutoBuild()){ + if(ctx.getInstaller().isVerbose()){ + try { + ctx.log("Rendering properties in the current directory: " + currentDir.getCanonicalPath()); + } catch (IOException e) { + // oh well never mind + } + } + propRenderer.renderProperties(ctx, currentDir); + alreadyWritten = true; + } + if( ! currentDir.equals(ctx.getFileRoot()) || !alreadyWritten){ + propRenderer.renderProperties(ctx, ctx.getFileRoot()); + } + } + +} Property changes on: pal-portal/modules/ant-installer/trunk/src/org/tp23/antinstaller/runtime/exe/PropertyPrinterFilter.java ___________________________________________________________________ Name: svn:eol-style + native Added: pal-portal/modules/ant-installer/trunk/src/org/tp23/antinstaller/runtime/exe/nonextractor.fconfig =================================================================== --- pal-portal/modules/ant-installer/trunk/src/org/tp23/antinstaller/runtime/exe/nonextractor.fconfig (rev 0) +++ pal-portal/modules/ant-installer/trunk/src/org/tp23/antinstaller/runtime/exe/nonextractor.fconfig 2008-06-11 13:36:41 UTC (rev 975) @@ -0,0 +1,11 @@ +# +# Default config for the NonExtractor +# +org.tp23.antinstaller.runtime.exe.CreateLoggerFilter +org.tp23.antinstaller.runtime.exe.InputStreamLoadConfigFilter +org.tp23.antinstaller.runtime.exe.CreateUIFilter +org.tp23.antinstaller.runtime.exe.PropertyLoaderFilter +org.tp23.antinstaller.runtime.exe.ExecuteRunnerFilter +org.tp23.antinstaller.runtime.exe.PropertyPrinterFilter +org.tp23.antinstaller.runtime.exe.AntProjectFilter +org.tp23.antinstaller.runtime.exe.FinalizerFilter \ No newline at end of file Added: pal-portal/modules/ant-installer/trunk/src/org/tp23/antinstaller/runtime/exe/script.fconfig =================================================================== --- pal-portal/modules/ant-installer/trunk/src/org/tp23/antinstaller/runtime/exe/script.fconfig (rev 0) +++ pal-portal/modules/ant-installer/trunk/src/org/tp23/antinstaller/runtime/exe/script.fconfig 2008-06-11 13:36:41 UTC (rev 975) @@ -0,0 +1,11 @@ +# +# Default config for the Install started with a script +# +org.tp23.antinstaller.runtime.exe.CreateLoggerFilter +org.tp23.antinstaller.runtime.exe.LoadConfigFilter +org.tp23.antinstaller.runtime.exe.CreateUIFilter +org.tp23.antinstaller.runtime.exe.PropertyLoaderFilter +org.tp23.antinstaller.runtime.exe.ExecuteRunnerFilter +org.tp23.antinstaller.runtime.exe.PropertyPrinterFilter +org.tp23.antinstaller.runtime.exe.AntLauncherFilter +org.tp23.antinstaller.runtime.exe.FinalizerFilter \ No newline at end of file Added: pal-portal/modules/ant-installer/trunk/src/org/tp23/antinstaller/runtime/exe/selfextractor.fconfig =================================================================== --- pal-portal/modules/ant-installer/trunk/src/org/tp23/antinstaller/runtime/exe/selfextractor.fconfig (rev 0) +++ pal-portal/modules/ant-installer/trunk/src/org/tp23/antinstaller/runtime/exe/selfextractor.fconfig 2008-06-11 13:36:41 UTC (rev 975) @@ -0,0 +1,11 @@ +# +# Default config for the SelfExtractor +# +org.tp23.antinstaller.runtime.exe.CreateLoggerFilter +org.tp23.antinstaller.runtime.exe.LoadConfigFilter +org.tp23.antinstaller.runtime.exe.CreateUIFilter +org.tp23.antinstaller.runtime.exe.PropertyLoaderFilter +org.tp23.antinstaller.runtime.exe.ExecuteRunnerFilter +org.tp23.antinstaller.runtime.exe.PropertyPrinterFilter +org.tp23.antinstaller.runtime.exe.AntLauncherFilter +org.tp23.antinstaller.runtime.exe.FinalizerFilter \ No newline at end of file Added: pal-portal/modules/ant-installer/trunk/src/org/tp23/antinstaller/runtime/logic/CompoundExpression.java =================================================================== --- pal-portal/modules/ant-installer/trunk/src/org/tp23/antinstaller/runtime/logic/CompoundExpression.java (rev 0) +++ pal-portal/modules/ant-installer/trunk/src/org/tp23/antinstaller/runtime/logic/CompoundExpression.java 2008-06-11 13:36:41 UTC (rev 975) @@ -0,0 +1,38 @@ +/* + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +package org.tp23.antinstaller.runtime.logic; + +/** + * @author mwilson + * @version $Id: CompoundExpression.java,v 1.1 2006/09/08 19:16:22 + * anothermwilson Exp $ + * @since 0.7.4 patch 2 + */ +public class CompoundExpression implements Expression { + + private Expression expression1; + private LogicalTest test; + private Expression expression2; + + public CompoundExpression(Expression expr1, final LogicalTest logicalTest, Expression expr2) { + this.expression1 = expr1; + this.expression2 = expr2; + this.test = logicalTest; + } + + public boolean evaluate() { + return test.getTestResult(expression1, expression2); + } +} Property changes on: pal-portal/modules/ant-installer/trunk/src/org/tp23/antinstaller/runtime/logic/CompoundExpression.java ___________________________________________________________________ Name: svn:eol-style + native Added: pal-portal/modules/ant-installer/trunk/src/org/tp23/antinstaller/runtime/logic/EndsWithTest.java =================================================================== --- pal-portal/modules/ant-installer/trunk/src/org/tp23/antinstaller/runtime/logic/EndsWithTest.java (rev 0) +++ pal-portal/modules/ant-installer/trunk/src/org/tp23/antinstaller/runtime/logic/EndsWithTest.java 2008-06-11 13:36:41 UTC (rev 975) @@ -0,0 +1,33 @@ +/* + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +package org.tp23.antinstaller.runtime.logic; + +/** + * @author mwilson + * @version $Id: EndsWithTest.java,v 1.2 2006/12/21 00:03:18 teknopaul Exp $ + * @since 0.7.4 patch 2 + */ +public class EndsWithTest extends ValuesTest { + + private static final String[] TEST_TOKENS = { "$=" }; + + public String[] getTestTokens() { + return TEST_TOKENS; + } + + protected boolean getTestResult(final String value, final String expectedValue) { + return (value != null) && value.endsWith(expectedValue); + + } +} Property changes on: pal-portal/modules/ant-installer/trunk/src/org/tp23/antinstaller/runtime/logic/EndsWithTest.java ___________________________________________________________________ Name: svn:eol-style + native Added: pal-portal/modules/ant-installer/trunk/src/org/tp23/antinstaller/runtime/logic/EqualsTest.java =================================================================== --- pal-portal/modules/ant-installer/trunk/src/org/tp23/antinstaller/runtime/logic/EqualsTest.java (rev 0) +++ pal-portal/modules/ant-installer/trunk/src/org/tp23/antinstaller/runtime/logic/EqualsTest.java 2008-06-11 13:36:41 UTC (rev 975) @@ -0,0 +1,42 @@ +/* + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +package org.tp23.antinstaller.runtime.logic; + +/** + * @author mwilson + * @version $Id: EqualsTest.java,v 1.2 2006/12/21 00:03:18 teknopaul Exp $ + * @since 0.7.4 patch 2 + */ +public class EqualsTest extends ValuesTest { + + private static final String[] TEST_TOKENS = { "==", "=" }; + + public String[] getTestTokens() { + return TEST_TOKENS; + } + + protected boolean getTestResult(final String propValue, final String expectedValue) { + // Where the expected value is null, empty string must also match + if (expectedValue == null) { + return (propValue == null) || propValue.equals(""); + } + + if ((propValue != null) && propValue.equals(expectedValue)) { + return true; + } + + return false; + } +} Property changes on: pal-portal/modules/ant-installer/trunk/src/org/tp23/antinstaller/runtime/logic/EqualsTest.java ___________________________________________________________________ Name: svn:eol-style + native Added: pal-portal/modules/ant-installer/trunk/src/org/tp23/antinstaller/runtime/logic/Expression.java =================================================================== --- pal-portal/modules/ant-installer/trunk/src/org/tp23/antinstaller/runtime/logic/Expression.java (rev 0) +++ pal-portal/modules/ant-installer/trunk/src/org/tp23/antinstaller/runtime/logic/Expression.java 2008-06-11 13:36:41 UTC (rev 975) @@ -0,0 +1,25 @@ +/* + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +package org.tp23.antinstaller.runtime.logic; + +/** + * @author mwilson + * @version $Id: Expression.java,v 1.2 2006/12/21 00:03:18 teknopaul Exp $ + * @since 0.7.4 patch 2 + */ + +public interface Expression { + public boolean evaluate(); +} Property changes on: pal-portal/modules/ant-installer/trunk/src/org/tp23/antinstaller/runtime/logic/Expression.java ___________________________________________________________________ Name: svn:eol-style + native Added: pal-portal/modules/ant-installer/trunk/src/org/tp23/antinstaller/runtime/logic/ExpressionBuilder.java =================================================================== --- pal-portal/modules/ant-installer/trunk/src/org/tp23/antinstaller/runtime/logic/ExpressionBuilder.java (rev 0) +++ pal-portal/modules/ant-installer/trunk/src/org/tp23/antinstaller/runtime/logic/ExpressionBuilder.java 2008-06-11 13:36:41 UTC (rev 975) @@ -0,0 +1,211 @@ +/* + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +package org.tp23.antinstaller.runtime.logic; + +import java.util.Arrays; +import java.util.Comparator; +import java.util.HashMap; +import java.util.Map; + +import org.tp23.antinstaller.input.ResultContainer; +import org.tp23.antinstaller.runtime.ConfigurationException; + +/** + * @author mwilson + * @version $Id: ExpressionBuilder.java,v 1.2 2006/12/21 00:03:18 teknopaul Exp $ + * @since 0.7.4 patch 2 + */ +public class ExpressionBuilder { + private static final int GROUPING_START_OPERATOR = '('; + + private static final int GROUPING_END_OPERATOR = ')'; + + private static final ValuesTest[] testValueConditions = { + new EndsWithTest(), + new EqualsTest(), + new GreaterThanOrEqualsTest(), + new LessThanOrEqualsTest(), + new NotEqualsTest(), + new StartsWithTest() + }; + + private static final LogicalTest[] testLogicalConditions = { + new LogicalAndTest(), + new LogicalOrTest() + }; + + private static final SingleExpressionTest SINGLE_EXPRESSION_TEST = new SingleExpressionTest(); + + private static Map tokenMap = new HashMap(); + + private static String[] valueTokens; + + private static String[] logicalTokens; + + static { + for (int i = 0; i < testValueConditions.length; i++) { + String[] tmpTokens = testValueConditions[i].getTestTokens(); + for (int j = 0; j < tmpTokens.length; j++) { + tokenMap.put(tmpTokens[j], testValueConditions[i]); + } + } + + valueTokens = new String[tokenMap.size()]; + int index = 0; + for (int i = 0; i < testValueConditions.length; i++) { + String[] tmpTokens = testValueConditions[i].getTestTokens(); + for (int j = 0; j < tmpTokens.length; j++) { + valueTokens[index++] = tmpTokens[j]; + } + } + + Comparator lengthComparator = new StringLengthComparator(); + + //Have to sort so that longest test operator is checked for first + Arrays.sort(valueTokens, lengthComparator); + + index = 0; + final int mapInitialSize = tokenMap.size(); + + for (int i = 0; i < testLogicalConditions.length; i++) { + String[] tmpTokens = testLogicalConditions[i].getTestTokens(); + for (int j = 0; j < tmpTokens.length; j++) { + tokenMap.put(tmpTokens[j], testLogicalConditions[i]); + } + } + + logicalTokens = new String[tokenMap.size() - mapInitialSize]; + for (int i = 0; i < testLogicalConditions.length; i++) { + String[] tmpTokens = testLogicalConditions[i].getTestTokens(); + for (int j = 0; j < tmpTokens.length; j++) { + logicalTokens[index++] = tmpTokens[j]; + } + } + + Arrays.sort(logicalTokens, lengthComparator); + + } + + public static Expression parseLogicalExpressions(ResultContainer container, String exprStr) throws ConfigurationException { + int startIndex = skipWhiteSpace(exprStr, 0); + int index = exprStr.indexOf(GROUPING_START_OPERATOR, startIndex); + + if (index == -1) { + return getSimpleExpression(container, exprStr.substring(startIndex)); + } + + if (index != 0) { + throw new ConfigurationException("Illegal ifProperty value: If present, grouping operator " + GROUPING_START_OPERATOR + + " must be at start of property string"); + } + + ++startIndex; //Skip over grouping operator + + int endIndex = exprStr.indexOf(GROUPING_END_OPERATOR, startIndex); + + if (endIndex == -1) { + throw new ConfigurationException("Missing closing grouping bracket " + GROUPING_END_OPERATOR + " in expression " + exprStr); + } + + //Check that this isn't an attempt tu use nested logical tests - not supported + int tstIndex = exprStr.indexOf(GROUPING_START_OPERATOR, startIndex); + if ((tstIndex != -1) && (tstIndex < endIndex)) { + throw new ConfigurationException("Nesting of logical operations is not supported: " + exprStr); + } + + try { + Expression expr1 = parseLogicalExpressions(container, exprStr.substring(startIndex, endIndex)); + + LogicalTest test = null; + + startIndex = endIndex + 1; + + //Look for logical operator token + String logicalToken = getLogicalToken(exprStr, startIndex); + + for (int i = 0; i < logicalTokens.length; i++) { + + if (logicalTokens[i].compareTo(logicalToken) == 0) { + test = (LogicalTest) tokenMap.get(logicalTokens[i]); + index = exprStr.indexOf(logicalTokens[i], startIndex); + startIndex = index + logicalTokens[i].length(); + break; + } + } + + if (test == null) { + return new CompoundExpression(expr1, SINGLE_EXPRESSION_TEST, null); + } else { + startIndex = skipWhiteSpace(exprStr, startIndex); + String expr2Str = exprStr.substring(startIndex, exprStr.length()); + return new CompoundExpression(expr1, test, parseLogicalExpressions(container, expr2Str)); + + } + } catch (Exception e) { + throw new ConfigurationException("Invalid ifProperty expression"); + } + } + + private static Expression getSimpleExpression(ResultContainer resultContainer, String exprStr) throws ConfigurationException { + try { + int index = -1; + int i; + + for (i = 0; i < valueTokens.length; i++) { + index = exprStr.indexOf(valueTokens[i]); + + if (index != -1) { + break; + } + } + + return new SimpleExpression(resultContainer, exprStr.substring(0, index), (ValuesTest) tokenMap.get(valueTokens[i]), exprStr + .substring(index + valueTokens[i].length())); + } catch (Exception e) { // can be StringIndexOutOfBoundsException - PH + throw new ConfigurationException("Invalid ifProperty expression"); + } + } + + private static int skipWhiteSpace(final String str, final int startIndex) { + final int strLen = str.length(); + int index = startIndex; + + while (index < strLen) { + if ((str.charAt(index) != ' ') && (str.charAt(index) != '\t')) { + break; + } + + ++index; + } + + return index; + } + + private static String getLogicalToken(final String str, final int startIndex) { + final int strLen = str.length(); + int tokenStart = skipWhiteSpace(str, startIndex); + int endIndex = tokenStart; + + while (endIndex < strLen) { + int chr = str.charAt(endIndex); + if ((chr == ' ') || (chr == '\t') || (chr == GROUPING_START_OPERATOR)) { + break; + } + + ++endIndex; + } + + return str.substring(tokenStart, endIndex); + } +} Property changes on: pal-portal/modules/ant-installer/trunk/src/org/tp23/antinstaller/runtime/logic/ExpressionBuilder.java ___________________________________________________________________ Name: svn:eol-style + native Added: pal-portal/modules/ant-installer/trunk/src/org/tp23/antinstaller/runtime/logic/GreaterThanOrEqualsTest.java =================================================================== --- pal-portal/modules/ant-installer/trunk/src/org/tp23/antinstaller/runtime/logic/GreaterThanOrEqualsTest.java (rev 0) +++ pal-portal/modules/ant-installer/trunk/src/org/tp23/antinstaller/runtime/logic/GreaterThanOrEqualsTest.java 2008-06-11 13:36:41 UTC (rev 975) @@ -0,0 +1,33 @@ +/* + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +package org.tp23.antinstaller.runtime.logic; + +/** + * @author mwilson + * @version $Id: GreaterThanOrEqualsTest.java,v 1.1 2006/09/08 19:16:27 + * anothermwilson Exp $ + * @since 0.7.4 patch 2 + */ +public class GreaterThanOrEqualsTest extends ValuesTest { + + private static final String[] TEST_TOKENS = { "+=" }; + + public String[] getTestTokens() { + return TEST_TOKENS; + } + + protected boolean getTestResult(final String value1, final String value2) { + return Double.parseDouble(value1) >= Double.parseDouble(value2); + } +} Property changes on: pal-portal/modules/ant-installer/trunk/src/org/tp23/antinstaller/runtime/logic/GreaterThanOrEqualsTest.java ___________________________________________________________________ Name: svn:eol-style + native Added: pal-portal/modules/ant-installer/trunk/src/org/tp23/antinstaller/runtime/logic/LessThanOrEqualsTest.java =================================================================== --- pal-portal/modules/ant-installer/trunk/src/org/tp23/antinstaller/runtime/logic/LessThanOrEqualsTest.java (rev 0) +++ pal-portal/modules/ant-installer/trunk/src/org/tp23/antinstaller/runtime/logic/LessThanOrEqualsTest.java 2008-06-11 13:36:41 UTC (rev 975) @@ -0,0 +1,33 @@ +/* + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +package org.tp23.antinstaller.runtime.logic; + +/** + * @author mwilson + * @version $Id: LessThanOrEqualsTest.java,v 1.1 2006/09/08 19:16:27 + * anothermwilson Exp $ + * @since 0.7.4 patch 2 + */ +public class LessThanOrEqualsTest extends ValuesTest { + + private static final String[] TEST_TOKENS = { "-=" }; + + public String[] getTestTokens() { + return TEST_TOKENS; + } + + protected boolean getTestResult(final String value1, final String value2) { + return Double.parseDouble(value1) <= Double.parseDouble(value2); + } +} Property changes on: pal-portal/modules/ant-installer/trunk/src/org/tp23/antinstaller/runtime/logic/LessThanOrEqualsTest.java ___________________________________________________________________ Name: svn:eol-style + native Added: pal-portal/modules/ant-installer/trunk/src/org/tp23/antinstaller/runtime/logic/LiteralValue.java =================================================================== --- pal-portal/modules/ant-installer/trunk/src/org/tp23/antinstaller/runtime/logic/LiteralValue.java (rev 0) +++ pal-portal/modules/ant-installer/trunk/src/org/tp23/antinstaller/runtime/logic/LiteralValue.java 2008-06-11 13:36:41 UTC (rev 975) @@ -0,0 +1,38 @@ +/* + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +package org.tp23.antinstaller.runtime.logic; + +/** + * @author mwilson + * @version $Id: LiteralValue.java,v 1.2 2006/12/21 00:03:18 teknopaul Exp $ + * @since 0.7.4 patch 2 + */ +public class LiteralValue implements Value { + + public static final String NULL = "null"; + private final String value; + + public LiteralValue(final String value) { + if ((value != null) && (value.equals(NULL))) { + this.value = null; + } else { + this.value = value; + } + } + + public String getValue() { + return value; + } +} Property changes on: pal-portal/modules/ant-installer/trunk/src/org/tp23/antinstaller/runtime/logic/LiteralValue.java ___________________________________________________________________ Name: svn:eol-style + native Added: pal-portal/modules/ant-installer/trunk/src/org/tp23/antinstaller/runtime/logic/LogicalAndTest.java =================================================================== --- pal-portal/modules/ant-installer/trunk/src/org/tp23/antinstaller/runtime/logic/LogicalAndTest.java (rev 0) +++ pal-portal/modules/ant-installer/trunk/src/org/tp23/antinstaller/runtime/logic/LogicalAndTest.java 2008-06-11 13:36:41 UTC (rev 975) @@ -0,0 +1,41 @@ +/* + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +package org.tp23.antinstaller.runtime.logic; + +/** + * @author mwilson + * @version $Id: LogicalAndTest.java,v 1.1 2006/09/08 19:16:28 anothermwilson + * Exp $ + * @since 0.7.4 patch 2 + */ +public class LogicalAndTest implements LogicalTest { + + private static final String[] TEST_TOKENS = { "&&", "AND" }; + + public String[] getTestTokens() { + return TEST_TOKENS; + } + + public boolean getTestResult(Expression expression1, Expression expression2) { + + boolean result = false; + + if (expression1 != null && expression2 != null) { + result = expression1.evaluate() && expression2.evaluate(); + } + + return result; + } +} Property changes on: pal-portal/modules/ant-installer/trunk/src/org/tp23/antinstaller/runtime/logic/LogicalAndTest.java ___________________________________________________________________ Name: svn:eol-style + native Added: pal-portal/modules/ant-installer/trunk/src/org/tp23/antinstaller/runtime/logic/LogicalOrTest.java =================================================================== --- pal-portal/modules/ant-installer/trunk/src/org/tp23/antinstaller/runtime/logic/LogicalOrTest.java (rev 0) +++ pal-portal/modules/ant-installer/trunk/src/org/tp23/antinstaller/runtime/logic/LogicalOrTest.java 2008-06-11 13:36:41 UTC (rev 975) @@ -0,0 +1,43 @@ +/* + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +package org.tp23.antinstaller.runtime.logic; + +/** + * @author mwilson + * @version $Id: LogicalOrTest.java,v 1.2 2006/12/21 00:03:18 teknopaul Exp $ + * @since 0.7.4 patch 2 + */ +public class LogicalOrTest implements LogicalTest { + + private static final String[] TEST_TOKENS = { "||", "OR" }; + + public String[] getTestTokens() { + return TEST_TOKENS; + } + + public boolean getTestResult(Expression expression1, Expression expression2) { + boolean isTrue = false; + + if (expression1 != null) { + isTrue = expression1.evaluate(); + } + if (!isTrue && (expression2 != null)) { + isTrue = expression2.evaluate(); + } + + return isTrue; + + } +} Property changes on: pal-portal/modules/ant-installer/trunk/src/org/tp23/antinstaller/runtime/logic/LogicalOrTest.java ___________________________________________________________________ Name: svn:eol-style + native Added: pal-portal/modules/ant-installer/trunk/src/org/tp23/antinstaller/runtime/logic/LogicalTest.java =================================================================== --- pal-portal/modules/ant-installer/trunk/src/org/tp23/antinstaller/runtime/logic/LogicalTest.java (rev 0) +++ pal-portal/modules/ant-installer/trunk/src/org/tp23/antinstaller/runtime/logic/LogicalTest.java 2008-06-11 13:36:41 UTC (rev 975) @@ -0,0 +1,27 @@ +/* + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +package org.tp23.antinstaller.runtime.logic; + +/** + * @author mwilson + * @version $Id: LogicalTest.java,v 1.2 2006/12/21 00:03:18 teknopaul Exp $ + * @since 0.7.4 patch 2 + */ + +public interface LogicalTest extends TestOperator { + + public boolean getTestResult(Expression expression1, Expression expression2); + +} Property changes on: pal-portal/modules/ant-installer/trunk/src/org/tp23/antinstaller/runtime/logic/LogicalTest.java ___________________________________________________________________ Name: svn:eol-style + native Added: pal-portal/modules/ant-installer/trunk/src/org/tp23/antinstaller/runtime/logic/NotEqualsTest.java =================================================================== --- pal-portal/modules/ant-installer/trunk/src/org/tp23/antinstaller/runtime/logic/NotEqualsTest.java (rev 0) +++ pal-portal/modules/ant-installer/trunk/src/org/tp23/antinstaller/runtime/logic/NotEqualsTest.java 2008-06-11 13:36:41 UTC (rev 975) @@ -0,0 +1,38 @@ +/* + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +package org.tp23.antinstaller.runtime.logic; + +/** + * @author mwilson + * @version $Id: NotEqualsTest.java,v 1.2 2006/12/21 00:03:18 teknopaul Exp $ + * @since 0.7.4 patch 2 + */ +public class NotEqualsTest extends ValuesTest { + + private static final String[] TEST_TOKENS = { "!=" }; + + public String[] getTestTokens() { + return TEST_TOKENS; + } + + protected boolean getTestResult(final String propValue, final String expectedValue) { + if (expectedValue == null) { + return propValue != null && !propValue.equals(""); + } + + return (propValue == null) || !propValue.equals(expectedValue); + + } +} Property changes on: pal-portal/modules/ant-installer/trunk/src/org/tp23/antinstaller/runtime/logic/NotEqualsTest.java ___________________________________________________________________ Name: svn:eol-style + native Added: pal-portal/modules/ant-installer/trunk/src/org/tp23/antinstaller/runtime/logic/SimpleExpression.java =================================================================== --- pal-portal/modules/ant-installer/trunk/src/org/tp23/antinstaller/runtime/logic/SimpleExpression.java (rev 0) +++ pal-portal/modules/ant-installer/trunk/src/org/tp23/antinstaller/runtime/logic/SimpleExpression.java 2008-06-11 13:36:41 UTC (rev 975) @@ -0,0 +1,68 @@ +/* + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +package org.tp23.antinstaller.runtime.logic; + +import org.tp23.antinstaller.input.ResultContainer; +import org.tp23.antinstaller.runtime.ConfigurationException; + +/** + * @author mwilson + * @version $Id: SimpleExpression.java,v 1.1 2006/09/08 19:16:30 anothermwilson + * Exp $ + * @since 0.7.4 patch 2 + */ +public class SimpleExpression implements Expression { + + private final Value value1; + private final ValuesTest testCondition; + private final Value value2; + private final String literalValue1; + private final String literalValue2; + + public SimpleExpression( + final ResultContainer resultContainer, + final String value1, + final ValuesTest test, + final String value2) + throws ConfigurationException { + + this.literalValue1 = value1; + this.value1 = getValue(resultContainer, value1); + this.testCondition = test; + this.literalValue2 = value2; + this.value2 = getValue(resultContainer, value2); + + } + + public boolean evaluate() { + return testCondition.getTestResult(value1, value2); + } + + private Value getValue(ResultContainer container, String valueStr) throws ConfigurationException { + if ( (valueStr.length() > 0) && (valueStr.charAt(0) == '$') ) { + if ( valueStr.startsWith("${") && valueStr.endsWith("}") ) { + return new VariableValue(container, valueStr); + } else { + throw new ConfigurationException("Badly formed variable: '" + valueStr + "'"); + } + } else { + return new LiteralValue(valueStr); + } + } + + public String toString() { + return "[" + literalValue1 + "==" + literalValue2 + "]"; + } +} Property changes on: pal-portal/modules/ant-installer/trunk/src/org/tp23/antinstaller/runtime/logic/SimpleExpression.java ___________________________________________________________________ Name: svn:eol-style + native Added: pal-portal/modules/ant-installer/trunk/src/org/tp23/antinstaller/runtime/logic/SingleExpressionTest.java =================================================================== --- pal-portal/modules/ant-installer/trunk/src/org/tp23/antinstaller/runtime/logic/SingleExpressionTest.java (rev 0) +++ pal-portal/modules/ant-installer/trunk/src/org/tp23/antinstaller/runtime/logic/SingleExpressionTest.java 2008-06-11 13:36:41 UTC (rev 975) @@ -0,0 +1,34 @@ +/* + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +package org.tp23.antinstaller.runtime.logic; + +/** + * @author mwilson + * @version $Id: SingleExpressionTest.java,v 1.1 2006/09/08 19:16:30 + * anothermwilson Exp $ + * @since 0.7.4 patch 2 + */ +public class SingleExpressionTest implements LogicalTest { + + private static final String[] EMPTY_TOKEN_LIST = new String[0]; + + public boolean getTestResult(Expression expression1, Expression expression2) { + return expression1.evaluate(); + } + + public String[] getTestTokens() { + return EMPTY_TOKEN_LIST; + } +} Property changes on: pal-portal/modules/ant-installer/trunk/src/org/tp23/antinstaller/runtime/logic/SingleExpressionTest.java ___________________________________________________________________ Name: svn:eol-style + native Added: pal-portal/modules/ant-installer/trunk/src/org/tp23/antinstaller/runtime/logic/StartsWithTest.java =================================================================== --- pal-portal/modules/ant-installer/trunk/src/org/tp23/antinstaller/runtime/logic/StartsWithTest.java (rev 0) +++ pal-portal/modules/ant-installer/trunk/src/org/tp23/antinstaller/runtime/logic/StartsWithTest.java 2008-06-11 13:36:41 UTC (rev 975) @@ -0,0 +1,35 @@ +/* + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +package org.tp23.antinstaller.runtime.logic; + +/** + * @author mwilson + * @version $Id: StartsWithTest.java,v 1.1 2006/09/08 19:16:30 anothermwilson + * Exp $ + * @since 0.7.4 patch 2 + */ +public class StartsWithTest extends ValuesTest { + + private static final String[] TEST_TOKENS = { "^=" }; + + public String[] getTestTokens() { + return TEST_TOKENS; + } + + protected boolean getTestResult(final String value1, final String value2) { + return (value1 != null) && value1.startsWith(value2); + + } +} Property changes on: pal-portal/modules/ant-installer/trunk/src/org/tp23/antinstaller/runtime/logic/StartsWithTest.java ___________________________________________________________________ Name: svn:eol-style + native Added: pal-portal/modules/ant-installer/trunk/src/org/tp23/antinstaller/runtime/logic/StringLengthComparator.java =================================================================== --- pal-portal/modules/ant-installer/trunk/src/org/tp23/antinstaller/runtime/logic/StringLengthComparator.java (rev 0) +++ pal-portal/modules/ant-installer/trunk/src/org/tp23/antinstaller/runtime/logic/StringLengthComparator.java 2008-06-11 13:36:41 UTC (rev 975) @@ -0,0 +1,46 @@ +/* + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +package org.tp23.antinstaller.runtime.logic; + +import java.util.Comparator; + +import org.apache.tools.ant.taskdefs.Length; + +/** + * Compare strings based on their length. Used by ExpressionBuilder to ensure + * that longest match is attempted first. + * + * @author mwilson + * @version $Id: StringLengthComparator.java,v 1.1 2006/09/08 19:16:31 + * anothermwilson Exp $ + * @since 0.7.4 patch 2 + */ + +public class StringLengthComparator implements Comparator { + + /** + * Sort by descending String length + * + * @param o1 first string + * @param o2 second string + * @return difference between the length of o2 and o1 + */ + public int compare(Object o1, Object o2) { + String str1 = (String) o1; + String str2 = (String) o2; + return (str2.length() - str1.length()); + } + +} Property changes on: pal-portal/modules/ant-installer/trunk/src/org/tp23/antinstaller/runtime/logic/StringLengthComparator.java ___________________________________________________________________ Name: svn:eol-style + native Added: pal-portal/modules/ant-installer/trunk/src/org/tp23/antinstaller/runtime/logic/TestOperator.java =================================================================== --- pal-portal/modules/ant-installer/trunk/src/org/tp23/antinstaller/runtime/logic/TestOperator.java (rev 0) +++ pal-portal/modules/ant-installer/trunk/src/org/tp23/antinstaller/runtime/logic/TestOperator.java 2008-06-11 13:36:41 UTC (rev 975) @@ -0,0 +1,27 @@ +/* + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +package org.tp23.antinstaller.runtime.logic; + +/** + * @author mwilson + * @version $Id: TestOperator.java,v 1.2 2006/12/21 00:03:18 teknopaul Exp $ + * @since 0.7.4 patch 2 + */ + +public interface TestOperator { + + public String[] getTestTokens(); + +} Property changes on: pal-portal/modules/ant-installer/trunk/src/org/tp23/antinstaller/runtime/logic/TestOperator.java ___________________________________________________________________ Name: svn:eol-style + native Added: pal-portal/modules/ant-installer/trunk/src/org/tp23/antinstaller/runtime/logic/Value.java =================================================================== --- pal-portal/modules/ant-installer/trunk/src/org/tp23/antinstaller/runtime/logic/Value.java (rev 0) +++ pal-portal/modules/ant-installer/trunk/src/org/tp23/antinstaller/runtime/logic/Value.java 2008-06-11 13:36:41 UTC (rev 975) @@ -0,0 +1,26 @@ +/* + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +package org.tp23.antinstaller.runtime.logic; + +/** + * @author mwilson + * @version $Id: Value.java,v 1.2 2006/12/21 00:03:18 teknopaul Exp $ + * @since 0.7.4 patch 2 + */ + +public interface Value { + + public String getValue(); +} Property changes on: pal-portal/modules/ant-installer/trunk/src/org/tp23/antinstaller/runtime/logic/Value.java ___________________________________________________________________ Name: svn:eol-style + native Added: pal-portal/modules/ant-installer/trunk/src/org/tp23/antinstaller/runtime/logic/ValuesTest.java =================================================================== --- pal-portal/modules/ant-installer/trunk/src/org/tp23/antinstaller/runtime/logic/ValuesTest.java (rev 0) +++ pal-portal/modules/ant-installer/trunk/src/org/tp23/antinstaller/runtime/logic/ValuesTest.java 2008-06-11 13:36:41 UTC (rev 975) @@ -0,0 +1,30 @@ +/* + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +package org.tp23.antinstaller.runtime.logic; + +/** + * @author mwilson + * @version $Id: ValuesTest.java,v 1.2 2006/12/21 00:03:18 teknopaul Exp $ + * @since 0.7.4 patch 2 + */ + +public abstract class ValuesTest implements TestOperator { + + public boolean getTestResult(final Value value1, final Value value2) { + return getTestResult(value1.getValue(), value2.getValue()); + } + + abstract protected boolean getTestResult(final String value1Str, final String value2Str); +} Property changes on: pal-portal/modules/ant-installer/trunk/src/org/tp23/antinstaller/runtime/logic/ValuesTest.java ___________________________________________________________________ Name: svn:eol-style + native Added: pal-portal/modules/ant-installer/trunk/src/org/tp23/antinstaller/runtime/logic/VariableValue.java =================================================================== --- pal-portal/modules/ant-installer/trunk/src/org/tp23/antinstaller/runtime/logic/VariableValue.java (rev 0) +++ pal-portal/modules/ant-installer/trunk/src/org/tp23/antinstaller/runtime/logic/VariableValue.java 2008-06-11 13:36:41 UTC (rev 975) @@ -0,0 +1,42 @@ +/* + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +package org.tp23.antinstaller.runtime.logic; + +import org.tp23.antinstaller.input.ResultContainer; + +/** + * @author mwilson + * @version $Id: VariableValue.java,v 1.2 2006/12/21 00:03:18 teknopaul Exp $ + * @since 0.7.4 patch 2 + */ +public class VariableValue implements Value { + + private final ResultContainer valueHolder; + private final String propertyName; + + public VariableValue(final ResultContainer container, final String propertyName) { + valueHolder = container; + this.propertyName = propertyName; + } + + public String getValue() { + /* + * Use somewhat misleadingly named method getDefaultValue() It doesn't + * return the default value, it returns the current value of a property + * referenced by the use of ${propertyname} syntax + */ + return valueHolder.getDefaultValue(propertyName); + } +} Property changes on: pal-portal/modules/ant-installer/trunk/src/org/tp23/antinstaller/runtime/logic/VariableValue.java ___________________________________________________________________ Name: svn:eol-style + native Added: pal-portal/modules/ant-installer/trunk/src/org/tp23/antinstaller/selfextract/NonExtractor.java =================================================================== --- pal-portal/modules/ant-installer/trunk/src/org/tp23/antinstaller/selfextract/NonExtractor.java (rev 0) +++ pal-portal/modules/ant-installer/trunk/src/org/tp23/antinstaller/selfextract/NonExtractor.java 2008-06-11 13:36:41 UTC (rev 975) @@ -0,0 +1,66 @@ + /* + * Copyright 2005 Paul Hinds + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +package org.tp23.antinstaller.selfextract; + +import java.io.File; + +import org.tp23.antinstaller.InstallException; +import org.tp23.antinstaller.runtime.ExecInstall; +import org.tp23.antinstaller.runtime.exe.FilterChain; +import org.tp23.antinstaller.runtime.exe.FilterFactory; + +/** + * This class is a replacement for the SelfExtractor that provides a similar + * function to the SelfExtractor but avoids the need to extract all the + * files prior to running the build. When using this extractor the project + * is run from the Jar but It is the Ant builds responsibility to access + * resources from within the Jar the Jar itself can be referenced using + * the Ant property "antinstaller.jar". The build file is automatically read + * from the Jar. + * @author Paul Hinds + * @version $Id: NonExtractor.java,v 1.4 2006/12/15 21:16:39 teknopaul Exp $ + */ +public class NonExtractor extends SelfExtractor{ + + /** used by AntProjectFilter */ + public static final String ANTINSTALLER_JAR_PROPERTY = "antinstaller.jar"; + public static final String CONFIG_RESOURCE = "/org/tp23/antinstaller/runtime/exe/nonextractor.fconfig"; + + /** + * Run method to use from the command line. This is fired via an entry in the + * MANIFEST.MF in the Jar + *@param args The command line arguments + */ + public static void main(String[] args) { + try { + SelfExtractor extractor = null; + extractor = new NonExtractor(); + FilterChain chain = FilterFactory.factory(CONFIG_RESOURCE); + ExecInstall installExec = new ExecInstall(chain); + installExec.parseArgs(args, false); + + // create temporary space for the build to be removed on exit + File temp = extractor.makeTempDir(); + installExec.setTempRoot(temp); + installExec.setInstallRoot(temp); + installExec.exec(); + } + catch (InstallException e) { + System.out.println("Can't load filter chain: " + CONFIG_RESOURCE); + e.printStackTrace(); + } + } +} Property changes on: pal-portal/modules/ant-installer/trunk/src/org/tp23/antinstaller/selfextract/NonExtractor.java ___________________________________________________________________ Name: svn:eol-style + native Added: pal-portal/modules/ant-installer/trunk/src/org/tp23/antinstaller/selfextract/ProgressIndicator.java =================================================================== --- pal-portal/modules/ant-installer/trunk/src/org/tp23/antinstaller/selfextract/ProgressIndicator.java (rev 0) +++ pal-portal/modules/ant-installer/trunk/src/org/tp23/antinstaller/selfextract/ProgressIndicator.java 2008-06-11 13:36:41 UTC (rev 975) @@ -0,0 +1,163 @@ +/* + * Copyright 2005 Paul Hinds + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +package org.tp23.antinstaller.selfextract; + +import java.awt.BorderLayout; +import java.awt.Cursor; +import java.awt.Dimension; +import java.awt.GraphicsConfiguration; +import java.awt.GridBagConstraints; +import java.awt.GridBagLayout; +import java.awt.Insets; +import java.io.ByteArrayOutputStream; +import java.io.InputStream; +import java.util.ResourceBundle; + +import javax.swing.BorderFactory; +import javax.swing.ImageIcon; +import javax.swing.JFrame; +import javax.swing.JLabel; +import javax.swing.JPanel; +import javax.swing.JProgressBar; +import javax.swing.UIManager; +import javax.swing.border.BevelBorder; +import javax.swing.border.Border; + + + +/** + * + *

    Frame to indicate progress of the extraction of a SelfExctracting archive

    + *

    + *

    Copyright: Copyright (c) 2004

    + *

    Company: tp23

    + * @author Paul Hinds + * @version $Id: ProgressIndicator.java,v 1.3 2007/01/28 08:44:40 teknopaul Exp $ + */ +public class ProgressIndicator + extends JFrame { + + public static final String IMAGE_RESOURCE = "/resources/extract-image.png"; + private static final ResourceBundle res = ResourceBundle.getBundle("org.tp23.antinstaller.renderer.Res"); + + private JPanel jPanel1 = new JPanel(); + private JProgressBar jProgressBar1 = new JProgressBar(); + private JLabel textLabel = new JLabel(); + private Border border1; + private int max = 0; + private static int PAGE_WIDTH = 160; + private static int PAGE_HEIGHT = 110; // 35 is text + bar + private String title = res.getString("extracting"); + private JLabel imagePanel = new JLabel(); + GridBagLayout gridBagLayout1 = new GridBagLayout(); + private boolean useIcon = true; + + + + public ProgressIndicator(int max) { + this.max = max; + jbInit(); + } + + public ProgressIndicator(int max, String title) { + this.max = max; + this.title = title; + jbInit(); + } + + private void setLocation() { + GraphicsConfiguration config = getGraphicsConfiguration(); + int x = (int) config.getBounds().getCenterX() - (PAGE_WIDTH / 2); + int y = (int) config.getBounds().getCenterY() - (PAGE_HEIGHT / 2); + setLocation(x, y); + } + + + private void jbInit() { + border1 = BorderFactory.createCompoundBorder( + BorderFactory.createBevelBorder(BevelBorder.RAISED), + BorderFactory.createEmptyBorder(4, 4, 4, 4)); + jPanel1.setLayout(gridBagLayout1); + int row = 0; + this.getContentPane().add(jPanel1, BorderLayout.CENTER); + if (useIcon) { + PAGE_HEIGHT = 110; + setImage(); + jPanel1.add(imagePanel, new GridBagConstraints(0, row++, 1, 1, 0.1, 0.9 + , GridBagConstraints.CENTER, GridBagConstraints.HORIZONTAL, new Insets(0, 0, 0, 0), 0, 0)); + this.setSize(new Dimension(PAGE_WIDTH, PAGE_HEIGHT)); + } + else { + PAGE_HEIGHT = 40; + this.setSize(new Dimension(PAGE_WIDTH, 35)); + } + jPanel1.setBorder(border1); + jPanel1.setMaximumSize(new Dimension(PAGE_WIDTH, PAGE_HEIGHT)); + jPanel1.setMinimumSize(new Dimension(PAGE_WIDTH, PAGE_HEIGHT)); + jPanel1.setPreferredSize(new Dimension(PAGE_WIDTH, PAGE_HEIGHT)); + textLabel.setText(title); + this.setTitle(title); + jPanel1.add(textLabel, new GridBagConstraints(0, row++, 1, 1, 0.1, 0.1 + , GridBagConstraints.WEST, GridBagConstraints.HORIZONTAL, new Insets(0, 0, 0, 0), 0, 0)); + jPanel1.add(jProgressBar1, new GridBagConstraints(0, row++, 1, 1, 0.1, 0.1 + , GridBagConstraints.SOUTH, GridBagConstraints.HORIZONTAL, new Insets(0, 0, 0, 0), 0, 0)); + jProgressBar1.setMinimum(0); + jProgressBar1.setMaximum(max); + this.setCursor(Cursor.getPredefinedCursor(Cursor.WAIT_CURSOR)); + this.setSize(new Dimension(PAGE_WIDTH, PAGE_HEIGHT)); + this.setResizable(false); + this.setUndecorated(true); + setLocation(); + } + + public void tick() { + jProgressBar1.setValue(jProgressBar1.getValue() + 1); + } + + private void setImage() { + try { + ByteArrayOutputStream baos = new ByteArrayOutputStream(); + InputStream in = this.getClass().getResourceAsStream(IMAGE_RESOURCE); + byte[] buffer = new byte[2048]; + int read = -1; + while ( (read = in.read(buffer)) != -1) { + baos.write(buffer, 0, read); + } + ImageIcon icon = new ImageIcon(baos.toByteArray()); + imagePanel.setHorizontalAlignment(JLabel.CENTER); + imagePanel.setIcon(icon); + } + catch (Exception ex) { + } + } + + /** + * TODO move to JUnit + * @param args + */ + public static void main(String[] args) { + try { + ProgressIndicator indicator = null; + indicator = new ProgressIndicator(200); + indicator.show(); + UIManager.setLookAndFeel("org.tp23.jgoodies.plaf.plastic.PlasticXPLookAndFeel"); + } + catch (Exception ex) { + // not concerned about Look and Feel + } + + } +} Property changes on: pal-portal/modules/ant-installer/trunk/src/org/tp23/antinstaller/selfextract/ProgressIndicator.java ___________________________________________________________________ Name: svn:eol-style + native Added: pal-portal/modules/ant-installer/trunk/src/org/tp23/antinstaller/selfextract/ResourceExtractor.java =================================================================== --- pal-portal/modules/ant-installer/trunk/src/org/tp23/antinstaller/selfextract/ResourceExtractor.java (rev 0) +++ pal-portal/modules/ant-installer/trunk/src/org/tp23/antinstaller/selfextract/ResourceExtractor.java 2008-06-11 13:36:41 UTC (rev 975) @@ -0,0 +1,74 @@ +/* + * Copyright 2005 Paul Hinds + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +package org.tp23.antinstaller.selfextract; + +import java.io.BufferedReader; +import java.io.File; +import java.io.FileOutputStream; +import java.io.IOException; +import java.io.InputStream; +import java.io.InputStreamReader; +/** + * Copies resources from the Classpath to the filesystem replacing regex with replacement + * and correcting line endings + * @author teknopaul + * + */ +public class ResourceExtractor { + + /** + * @param resource Must start with / e.g. /org/tp23/myFile.txt + * @param dest + * @throws IOException + */ + public void copyResource(String resource, File dest, String regex, String replace) throws IOException{ + InputStream is = this.getClass().getResourceAsStream(resource); + if(is == null){ + throw new IOException("Can not find resource: " + resource); + } + InputStreamReader isr = new InputStreamReader(is); + BufferedReader br = new BufferedReader(isr); + FileOutputStream bos = new FileOutputStream(dest); + String line = null; + while((line = br.readLine()) != null){ + bos.write(line.replaceAll(regex, replace).getBytes()); + bos.write(System.getProperty("line.separator").getBytes()); + } + bos.flush(); + bos.close(); + br.close(); + } + /** + * @param resource Must start with / e.g. /org/tp23/myFile.txt + * @param dest + * @throws IOException + */ + public void copyResourceBinary(String resource, File dest) throws IOException{ + InputStream is = this.getClass().getResourceAsStream(resource); + if(is == null){ + throw new IOException("Can not find resource: " + resource); + } + FileOutputStream bos = new FileOutputStream(dest); + byte[] buffer = new byte[1024]; + for(int read = 0; (read = is.read(buffer)) > 0; ){ + bos.write(buffer, 0, read); + } + bos.flush(); + bos.close(); + is.close(); + } + +} Property changes on: pal-portal/modules/ant-installer/trunk/src/org/tp23/antinstaller/selfextract/ResourceExtractor.java ___________________________________________________________________ Name: svn:eol-style + native Added: pal-portal/modules/ant-installer/trunk/src/org/tp23/antinstaller/selfextract/SelfExtractor.java =================================================================== --- pal-portal/modules/ant-installer/trunk/src/org/tp23/antinstaller/selfextract/SelfExtractor.java (rev 0) +++ pal-portal/modules/ant-installer/trunk/src/org/tp23/antinstaller/selfextract/SelfExtractor.java 2008-06-11 13:36:41 UTC (rev 975) @@ -0,0 +1,483 @@ +/* + * Copyright 2005 Paul Hinds + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +package org.tp23.antinstaller.selfextract; + +import java.awt.HeadlessException; +import java.io.BufferedOutputStream; +import java.io.File; +import java.io.FileFilter; +import java.io.FileInputStream; +import java.io.FileNotFoundException; +import java.io.FileOutputStream; +import java.io.IOException; +import java.net.URL; +import java.util.ArrayList; +import java.util.jar.JarEntry; +import java.util.jar.JarFile; +import java.util.jar.JarInputStream; + +import javax.swing.JOptionPane; +import javax.swing.UIManager; + +import org.tp23.antinstaller.InstallException; +import org.tp23.antinstaller.renderer.swing.plaf.LookAndFeelFactory; +import org.tp23.antinstaller.runtime.ExecInstall; +import org.tp23.antinstaller.runtime.exe.FilterChain; +import org.tp23.antinstaller.runtime.exe.FilterFactory; + +/** + * + *

    Finds a file reference to the Jar that loads this class and then extracts that Jar + * to a temporary directory

    + *

    + * @author Paul Hinds + * @version $Id: SelfExtractor.java,v 1.10 2007/01/28 08:44:40 teknopaul Exp $ + */ +public class SelfExtractor { + + public static final String CONFIG_RESOURCE = "/org/tp23/antinstaller/runtime/exe/selfextractor.fconfig"; + + private File extractDir; + private File archiveFile; + private boolean overwrite = true; + + private static int DEFAULT_BUFFER_SIZE = 1024; + private int BUFFER_SIZE = DEFAULT_BUFFER_SIZE; + private static boolean graphicsEnv = false; + private static String lookAndFeel = null; + + /** + * returns the Jar that the reference object was loaded from. If it was not + * loaded from a jar this methods behaviour is undefined + * @TODO define what happens + * @param reference + * @return A java.io.File reference to the Jar + */ + public static File getEnclosingJar(Object reference) { + String thisClass = "/" + reference.getClass().getName().replace('.','/') + ".class"; + URL jarUrl = reference.getClass().getResource(thisClass); + String stringForm = jarUrl.toString(); + //String fileForm = jarUrl.getFile(); + + File file = null; + int endIdx = stringForm.indexOf("!/"); + if(endIdx != -1){ + String unescaped = null; + String fileNamePart = stringForm.substring("jar:file:".length(), endIdx); + file = new File(fileNamePart); + if ( ! file.exists()) { + // try to unescape encase the URL Handler has escaped the " " to %20 + unescaped = unescape(fileNamePart); + file = new File(unescaped); + } + return file; + } + throw new RuntimeException("Failed expanding Jar."); + } + + /** + * Constructor for the SelfExtractor object. Directly after constructing + * an instance the init() method should be called unless subclassing + */ + public SelfExtractor() { + } + + /** + * This has been moved from the default constructor to facilitate subclassing + * @return true if the lookAndFeel worked + */ + public void init(){ + System.out.println("Loading self extractor..."); + archiveFile = getEnclosingJar(this); + makeTempDir(); + try { + JarFile thisJar = new JarFile(archiveFile); + lookAndFeel = thisJar.getManifest().getMainAttributes().getValue("Look-And-Feel"); + lookAndFeel = LookAndFeelFactory.getLafFromToken(lookAndFeel); + if(lookAndFeel != null) { + UIManager.setLookAndFeel(lookAndFeel); + } + } + catch (Throwable ex) { + // not concerned about Look and Feel + } + } + + /** + * Creates a new empty temporary directory for the file extraction + * @return + */ + protected File makeTempDir(){ + String tempDir = System.getProperty("java.io.tmpdir"); + extractDir = new File(tempDir, "antinstall"); + int idx = 0; + while (extractDir.exists()) { + extractDir = new File(tempDir, "antinstall" + (idx++)); + } + extractDir.mkdirs(); + extractDir.deleteOnExit(); + return extractDir; + } + + /** + * Constructor for the SelfExtractor object that sets the buffersize in use. + * The write buffer is the same size as the write buffer size because the read buffer reads + * decompressed bytes + * @param newBufferSize the size of the read buffer + */ + public SelfExtractor(int newBufferSize) { + BUFFER_SIZE = newBufferSize; + archiveFile = getEnclosingJar(this); + } + + /** + * Sets the Directory into which the file will be extracted + * + *@param newExtractDir The new extract directory + */ + public void setExtractDir(File newExtractDir) { + extractDir = newExtractDir; + } + + /** + * changes the archive to be extracted + *@param newArchiveFile The new archiveFile value + */ + public void setArchiveFile(File newArchiveFile) { + archiveFile = newArchiveFile; + } + + /** + * Gets the Directory into which the files will be extracted that + * is currently set in the ZipExtractor object + *@return The extract directory value + */ + public File getExtractDir() { + return extractDir; + } + + /** + * Gets the set in the ZipExtractor + *@return The archiveFile value + */ + public boolean isOverwrite() { + return overwrite; + } + + /** + * Gets the Directory into which the files will be extracted that + * is currently set in the ZipExtractor object + *@return The extract directory value + */ + public void setOverwrite(boolean overwrite) { + this.overwrite = overwrite; + } + + /** + * Gets the set in the ZipExtractor + *@return The archiveFile value + */ + public File getArchiveFile() { + return archiveFile; + } + + /** + * Opens up the zip and gets a list of the files in it. If the zip file + * or the temp file have not been set NullPointerExceptions will get thrown + *@param vebose if true Prints out a list of the zips + * contents on to the command line + *@return an ArrayList of String objects that will + * be as per the path in the zip + *@exception FileNotFoundException Description of Exception + *@exception IOException Description of Exception + */ + public ArrayList getList(boolean vebose) throws FileNotFoundException, IOException { + JarInputStream zis = new JarInputStream(new FileInputStream(archiveFile)); + JarEntry entry = null; + ArrayList result = new ArrayList(); + while ( (entry = zis.getNextJarEntry()) != null) { + if (vebose) { + System.out.println(entry.getName()); + } + result.add(entry.getName()); + } + return result; + } + + /** + * @return the number of files in the jar + * @throws FileNotFoundException + * @throws IOException + */ + public int getFileCount() throws FileNotFoundException, IOException { + JarInputStream zis = new JarInputStream(new FileInputStream(archiveFile)); + int count = 0; + while ( zis.getNextJarEntry() != null) { + count++; + } + return count; + } + + /** + * Opens up the zip and extracts the files to the temp dir. + * + *@param vebose if true Prints out a list of the zips contents on to System.out + *@return an ArrayList of java.io.File objects that + * will be as per the path in the zip with the root being the temp dir + *@exception FileNotFoundException + *@exception IOException + */ + public ArrayList extract(boolean vebose, boolean isX) throws FileNotFoundException, IOException { + int fileCount = getFileCount(); + ProgressIndicator indicator = null; + if(isX){ + try { + indicator = new ProgressIndicator(fileCount); + indicator.show(); + } + catch ( Exception exc ) { + /* + * Chances are, there are problems with the graphics environment + * so trying falling back to text mode + */ + graphicsEnv = false; + isX = false; + } + + } + JarInputStream zis = new JarInputStream(new FileInputStream(archiveFile)); + JarEntry entry = null; + ArrayList result = new ArrayList(); + while ( (entry = zis.getNextJarEntry()) != null) { + if (vebose) { + System.out.println("Extracting:" + entry.getName()); + } + result.add(extract(zis, entry)); + if (isX) { + indicator.tick(); + } + } + if (isX) { + indicator.hide(); + } + zis.close(); + return result; + } + + + + /** + * Extract a single file from the stream. N.B. the stream must be in the correct + * position for this to work + *@param zis ZipInputStream open and ready + *@param entry A valid entry read from the stream + *@return The inflated file generated in the temp dir + *@exception FileNotFoundException + *@exception IOException + */ + private File extract(JarInputStream zis, JarEntry entry) throws FileNotFoundException, IOException { + createPath(entry.getName()); + File fileToUse = new File(extractDir, entry.getName()); + if (fileToUse.exists()) { + if (!overwrite) { + return fileToUse; + } + } + else { + fileToUse.createNewFile(); + } + if (fileToUse.isDirectory()) { + return fileToUse; + } + + BufferedOutputStream bos = new BufferedOutputStream(new FileOutputStream(fileToUse), BUFFER_SIZE); + byte[] bytes = new byte[BUFFER_SIZE]; + int len = 0; + while ( (len = zis.read(bytes)) >= 0) { + bos.write(bytes, 0, len); + } + bos.close(); + zis.closeEntry(); + return fileToUse; + } + + /** + * This adds all the necessary directories in the root of the zip path to the + * temp dir. + *@param entryName The string name in the Zip file (virtual path) + *@exception IOException if the directories can not be made + */ + private void createPath(String entryName) throws IOException { + int slashIdx = entryName.lastIndexOf('/'); + if (slashIdx >= 0) { + // there is path info + String firstPath = entryName.substring(0, slashIdx); + File dir = new File(extractDir, firstPath); + if (!dir.exists()) { + dir.mkdirs(); + } + } + } + + /** + * Run method to use from the command line. This is fired via an entry in the + * MANIFEST.MF in the Jar + *@param args The command line arguments + */ + public static void main(String[] args) { + testX(); + // FIXME move after parseArgs() and set graphicsEnv if text selected + // will need to test SelfExtractor and comment parseArgs() to ensure + // no side effects in the future. + SelfExtractor extractor = null; + try { + boolean verbose = false; + extractor = new SelfExtractor(); + extractor.init(); + extractor.extract(verbose, graphicsEnv); + } + catch (Exception e) { + e.printStackTrace(); + String tempDir = "unknown"; + if(extractor != null){ + tempDir = extractor.getExtractDir().getAbsolutePath(); + } + String warning = "Could not extract Jar file to directory:" + tempDir; + printXorTextWarning(warning); + } + + try { + FilterChain chain = FilterFactory.factory(CONFIG_RESOURCE); + ExecInstall installExec = new ExecInstall(chain); + installExec.parseArgs(args, false); + installExec.setInstallRoot(extractor.getExtractDir()); + // removes files on exit + installExec.setTempRoot(extractor.getExtractDir()); + + installExec.exec(); + } + catch (InstallException e1) { + System.out.println("Cant load filter chain:/org/tp23/antinstaller/runtime/exe/selfextractor.fconfig"); + e1.printStackTrace(); + } + } + + /** + * This tests for the existence of a graphics environment and sets an + * internal flag so the test does not have to be repeated, it may be expensive. + * Prior to running this method the isGraphicsEnv() method will be invalid. + */ + protected static void testX(){ + try { + java.awt.GraphicsEnvironment.getLocalGraphicsEnvironment(); + try { + boolean headless = java.awt.GraphicsEnvironment.isHeadless(); + if(headless) { + graphicsEnv = false; + return; + } + } catch (Throwable e) { + // JDK 1.3 does not have the isHeadless() method but may still work in other situations + } + graphicsEnv = true; + } + catch (Throwable e) { + // thus graphicsEnv stays false; + } + } + + /** + * @see #testX() + * @return true if an X or windows environment is available + */ + protected boolean isGraphicsEnv(){ + return graphicsEnv; + } + + protected static void printXorTextWarning(String warning){ + if(graphicsEnv){ + try { + JOptionPane.showMessageDialog(null, warning); + } + catch( HeadlessException headlessExc ) { + graphicsEnv = false; + System.out.println(warning); + } + } + else { + System.out.println(warning); + } + } + + public static int deleteRecursive(File directory) { + int count = 0; + File[] files = directory.listFiles(new FileFilter() { + public boolean accept(File file) { + return!file.isDirectory(); + } + }); + for (int i = 0; i < files.length; i++) { + files[i].delete(); + count++; + } + File[] dirs = directory.listFiles(new FileFilter() { + public boolean accept(File file) { + return file.isDirectory(); + } + }); + for (int i = 0; i < dirs.length; i++) { + count += deleteRecursive(dirs[i]); + } + directory.delete(); + return count; + } + + /** + * UN-URL encode string + * TODO should this not support UNICODE escapes + */ + private static String unescape(final String s) { + StringBuffer sb = new StringBuffer(s.length()); + + for (int i = 0; i < s.length(); i++) { + char c = s.charAt(i); + switch (c) { + case '%': { + try { + sb.append( (char) Integer.parseInt(s.substring(i + 1, i + 3), 16)); + i += 2; + break; + } + catch (NumberFormatException nfe) { + throw new IllegalArgumentException(); + } + catch (StringIndexOutOfBoundsException siob) { + String end = s.substring(i); + sb.append(end); + if (end.length() == 2) i++; + } + break; + } + default: { + sb.append(c); + break; + } + } + } + return sb.toString(); + } + +} Property changes on: pal-portal/modules/ant-installer/trunk/src/org/tp23/antinstaller/selfextract/SelfExtractor.java ___________________________________________________________________ Name: svn:eol-style + native Added: pal-portal/modules/ant-installer/trunk/src/org/tp23/antinstaller/selfextract/package.html =================================================================== --- pal-portal/modules/ant-installer/trunk/src/org/tp23/antinstaller/selfextract/package.html (rev 0) +++ pal-portal/modules/ant-installer/trunk/src/org/tp23/antinstaller/selfextract/package.html 2008-06-11 13:36:41 UTC (rev 975) @@ -0,0 +1,14 @@ + + + + +Classes to extract the jar from which this package is loaded. + +The self extracting method is to obtain a temporary directory from java.io.File +and extract the files there. The baseDir for Ant is then set to this directory and it is +treated as if it were the current directory (although it is not and ./ references +will not work. + Property changes on: pal-portal/modules/ant-installer/trunk/src/org/tp23/antinstaller/selfextract/package.html ___________________________________________________________________ Name: svn:eol-style + native Added: pal-portal/modules/ant-installer/trunk/src/org/tp23/gui/GBCF.java =================================================================== --- pal-portal/modules/ant-installer/trunk/src/org/tp23/gui/GBCF.java (rev 0) +++ pal-portal/modules/ant-installer/trunk/src/org/tp23/gui/GBCF.java 2008-06-11 13:36:41 UTC (rev 975) @@ -0,0 +1,117 @@ +/* + * Copyright 2005 Paul Hinds + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +package org.tp23.gui; + +import java.awt.GridBagConstraints; +import java.awt.Insets; +/** + * GBCF Grib Bag Constraints Factory. This class exists mostly + * for tidying up code that used the exsivly verbose GridBagConstraints + * object, hence the shortened class name. + * By default a two column equal with table is assumed, to support other + * column layouts use the constructor that take an array of column wieghts + * Factory class for generating constraints for a equal width column table. + * the table is similar to the following table rendered in HTML + * + * + * + * + * + * + * + * + * + * + * + * + * + *
    datadata
    data
    datadata
    datadata
    + * @author not attributable + * @version 1.0 + */ +public class GBCF { + + protected Insets insets = new Insets(1,4,1,4); + protected Insets noinsets = new Insets(0,0,0,0); + protected double[] columnWeights= new double[]{0.5,0.5}; + + public GBCF(){ + + } + /** + * to support more than two columns or vary the column wieghtings + * @param columnWeights double[] + */ + public GBCF(double[] columnWeights){ + this.columnWeights=columnWeights; + } + /** + * + * @param row int the 0 indexed row + * @param col int the 0 indexed column + * @param span boolean does cell span both columns + * @return GridBagConstraints + */ + public GridBagConstraints getCell(int row,int col){ + return new GridBagConstraints(col, //gridx + row, //gridy + 1, //gridwidth + 1, //gridheight + columnWeights[col],//weightx + 0.0, //weithty + GridBagConstraints.WEST, // anchor + GridBagConstraints.NONE, //fill + insets, // insets + 1, //ipadx + 1 //ipady + ); + } + /** + * + * @param row int the 0 indexed row + * @param first boolean is this the first column or the second + * @param span boolean does cell span both columns + * @return GridBagConstraints + */ + public GridBagConstraints getSpan(int row){ + return new GridBagConstraints(0, //gridx + row, //gridy + 2, //gridwidth + 1, //gridheight + columnWeights[0],//weightx + 0.0, //weithty + GridBagConstraints.WEST, // anchor + GridBagConstraints.NONE, //fill + insets, // insets + 1, //ipadx + 1 //ipady + ); + } + public GridBagConstraints getVertGlue(int row){ + return new GridBagConstraints(0, //gridx + row, //gridy + 2, //gridwidth + 1, //gridheight + columnWeights[0],//weightx + 1.0, //weithty + GridBagConstraints.NORTHWEST, // anchor + GridBagConstraints.NONE, //fill + noinsets, // insets + 0, //ipadx + 0 //ipady + ); + } +} Property changes on: pal-portal/modules/ant-installer/trunk/src/org/tp23/gui/GBCF.java ___________________________________________________________________ Name: svn:eol-style + native Added: pal-portal/modules/ant-installer/trunk/src/org/tp23/gui/widget/DefaultingDirectoryChooser.java =================================================================== --- pal-portal/modules/ant-installer/trunk/src/org/tp23/gui/widget/DefaultingDirectoryChooser.java (rev 0) +++ pal-portal/modules/ant-installer/trunk/src/org/tp23/gui/widget/DefaultingDirectoryChooser.java 2008-06-11 13:36:41 UTC (rev 975) @@ -0,0 +1,180 @@ +/* + * Copyright 2005 Paul Hinds + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +package org.tp23.gui.widget; + +import java.beans.PropertyChangeEvent; +import java.beans.PropertyChangeListener; +import java.io.File; + +import javax.swing.JFileChooser; +import javax.swing.filechooser.FileFilter; +import javax.swing.filechooser.FileSystemView; +/** + * A file chooser that makes a beter default if the default directory is not available. +* Basically the default looks for the suggested directory and if it does not find it moves back +* up the directories. If still nothing is found (for example it may get to My Computer +* which you can not add file to) the home directory is selected, as in the default file chooser. +* +* To use this class call new DefaultingDirectoryChooser(boolean) and immediately call +* setDefaultDirectory(File) to determine the default. If you don't it behaves like the default JFileChooser +* Also if you call setCurrentDirectory(File) it will behave like JFileChooser +* +* This chooser has two modes CREATE_MODE and EXISTING_MODE.

    +* +* In existing mode it is assumed the chooser is being used to identify an existing directory +* the default directory should exist if not the directory shown will be the next existing parent.

    +* +* In create mode it is +* assumed that the last directory in the default directory is to be created and may not +* exist yet. Therefor the default directory displayed is the parent (with suitable defaulting) +* and the text box will contain the name of the last directory. +* e.g. if default is C:\Program Files\MyApp C:\Program Files will be displayed and +* MyApp will be shown in the text box (even if it does not exist yet) If C:\Program Files does not exist +* C:\ will be shown as with existing mode. +* Choosing select can lead to the creation of the file. It will not be automatically +* created that is the responsibility of the client code.
    +* +* This class uses FileSystemView and will only display folders that return true to fsv.isFileSystem() +* +* This class also uses a bit of a hack by in CREATE_MODE it sets the selectables to files and directories +* although only shows the directories this way a non-existing Directory can be chosen. This is the only way I can +* get it to work on my Java version but I would not be supprised if it did not work on +* other versions of the Java API. It also means that setFileSelectionMode() should +* never be called by clients as it will break this hack. + * @author Paul Hinds + * @version 1.0 + */ +public class DefaultingDirectoryChooser extends JFileChooser{ + + public static final boolean CREATE_MODE = true; + public static final boolean EXISTING_MODE = false; + + /** + * Determines that the default includes a directory name that is requried + * e.g. C:\Program Files\MyApp where even if Program Files does not exist + * MyApp should be part of the default even if it does not exist. + */ + private boolean createMode = false; + private File selectedFile = null; + private String desiredName = null; + + public DefaultingDirectoryChooser(boolean createMode) { + this.createMode=createMode; + if(createMode){ + setFileSelectionMode(FILES_AND_DIRECTORIES); + removeChoosableFileFilter(getAcceptAllFileFilter()); + addChoosableFileFilter(new FileFilter(){ + public boolean accept(File f) { + if(f.exists() && f.isDirectory())return true; + if(!f.exists() && getFileSystemView().getParentDirectory(f).isDirectory())return true; + return false; + } + public String getDescription() { + return "Directories"; + } + }); + + addPropertyChangeListener(JFileChooser.DIRECTORY_CHANGED_PROPERTY, new PropertyChangeListener(){ + public void propertyChange(PropertyChangeEvent evt) { + File directory = (File)evt.getNewValue(); + DefaultingDirectoryChooser.this.setCurrentDirectory(new File(directory, "newfolder")); + setSelectedFile(new File(directory, desiredName)); + } + }); + } + else { + setFileSelectionMode(DIRECTORIES_ONLY); + } + } + + + /** + * Sets the default directory. + * @param dir the current directory to point to + * @todo Implement this javax.swing.JFileChooser method + */ + public void setDefaultDirectory(File dir) { + if(dir==null)return;// called by the default consructor + if(createMode){ + if(desiredName == null)desiredName = dir.getName(); + File selected = determineCreateDir(dir); + super.setCurrentDirectory(selected.getParentFile()); + setSelectedFile(selected); + }else{ + super.setCurrentDirectory(determineExistingDir(dir)); + } + } + + + + private File determineExistingDir(File defaultDir){ + if(defaultDir.exists())return defaultDir; + FileSystemView fsv = this.getFileSystemView(); + File validParent = getFSVParent(fsv,defaultDir); + if(validParent!=null) { + return validParent; + } + else { + return fsv.getHomeDirectory(); + } + } + /** + * Select a base path for the default even if it does not exist. The order of preference is as follows + * if the directory exists use it + * if the parent does not exist try finding the next parent + * if the next parent is a root directory e.g. / or C:\ use the users home directory + * @param defaultDir File + * @return File + */ + private File determineCreateDir(File defaultDir){ + if(defaultDir.exists())return defaultDir; + FileSystemView fsv = this.getFileSystemView(); + String dirName = defaultDir.getName(); + File validParent = getFSVParent(fsv,defaultDir); + if(validParent!=null){ + return new File(validParent, dirName); + } + else { + return new File(fsv.getHomeDirectory(), dirName); + } + } + /** + * Step back up trying to find a parent if none if found return null. + * null can be found if the path starts e:\ and e: does not exist + * @param fsv FileSystemView + * @param dir File + * @return File + */ + private File getFSVParent(FileSystemView fsv,File dir){ + File parent = dir.getParentFile(); + if(fsv.isRoot(parent) && !parent.exists()){ + return null; + } + if(!parent.exists() || !fsv.isFileSystem(parent)){ + parent = getFSVParent(fsv,parent); + } + return parent; + } + + public static void main(String[] args) { + DefaultingDirectoryChooser chooser = new DefaultingDirectoryChooser(CREATE_MODE); + chooser.setDefaultDirectory(new File("/usr/local/dibble/MyApp")); + + chooser.showDialog(null,"Select"); + System.out.println("Selected:"+chooser.getSelectedFile().getAbsolutePath()); + System.exit(0); + } +} Property changes on: pal-portal/modules/ant-installer/trunk/src/org/tp23/gui/widget/DefaultingDirectoryChooser.java ___________________________________________________________________ Name: svn:eol-style + native Added: pal-portal/modules/ant-installer/trunk/src/org/tp23/gui/widget/FollowingJTextArea.java =================================================================== --- pal-portal/modules/ant-installer/trunk/src/org/tp23/gui/widget/FollowingJTextArea.java (rev 0) +++ pal-portal/modules/ant-installer/trunk/src/org/tp23/gui/widget/FollowingJTextArea.java 2008-06-11 13:36:41 UTC (rev 975) @@ -0,0 +1,125 @@ +/* + * Copyright 2005 Paul Hinds + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +package org.tp23.gui.widget; + +import java.awt.event.ActionEvent; +import java.awt.event.ActionListener; +import java.awt.event.MouseAdapter; +import java.awt.event.MouseEvent; +import java.io.FileNotFoundException; +import java.io.FileWriter; +import java.io.IOException; + +import javax.swing.JMenuItem; +import javax.swing.JPopupMenu; +import javax.swing.JTextArea; + +public class FollowingJTextArea extends JTextArea{ + + private boolean follow = true; + + public FollowingJTextArea() { + jInit(); + } + + + private void jInit(){ + final JPopupMenu popUp = getPopupMenu(); + this.add(popUp); + this.addMouseListener(new MouseAdapter(){ + public void mouseClicked(MouseEvent e) { + if (e.getButton() == e.BUTTON3) { + popUp.show(FollowingJTextArea.this,e.getX(),e.getY()); + } + } + }); + } + + public boolean isFollow() { + return follow; + } + public void setFollow(boolean follow) { + this.follow = follow; + } + + private void scrollToEnd(){ + setCaretPosition(getDocument().getLength()); + } + private void toggleFollow(){ + setFollow(!isFollow()); + } + + /** + * Appends the given text to the end of the document. + * + * @param str the text to insert + * @todo Implement this javax.swing.JTextArea method + */ + public void append(String str) { + super.append(str); + if(follow)scrollToEnd(); + } + private JPopupMenu getPopupMenu() { + JPopupMenu contextMenu = new JPopupMenu("Options"); + JMenuItem saveMenu = new JMenuItem("Save Text"); + saveMenu.addActionListener(new ActionListener() { + public void actionPerformed(ActionEvent e) { + SelectFileAction action = new SelectFileAction("Save Output", null, null); + try { + action.actionPerformed(new ActionEvent(this, 0, "Save Output")); + if (action.selectedFile != null) { + FileWriter fos = new FileWriter(action.selectedFile); + fos.write(getText()); + fos.close(); + } + + } + catch (FileNotFoundException ex) { + System.err.println("FileNotFoundException"); + } + catch (IOException ex) { + System.err.println("IOException"); + } + } + }); + contextMenu.add(saveMenu); + + JMenuItem toggleFollowMenu = new JMenuItem("Toggle Follow"); + toggleFollowMenu.addActionListener(new ActionListener() { + public void actionPerformed(ActionEvent e) { + toggleFollow(); + } + }); + contextMenu.add(toggleFollowMenu); + + JMenuItem jumpToEndMenu = new JMenuItem("Jump To End"); + jumpToEndMenu.addActionListener(new ActionListener() { + public void actionPerformed(ActionEvent e) { + setCaretPosition(getDocument().getLength()); + } + }); + contextMenu.add(toggleFollowMenu); + + JMenuItem clearTextMenu = new JMenuItem("Clear Text"); + clearTextMenu.addActionListener(new ActionListener() { + public void actionPerformed(ActionEvent e) { + setText(""); + } + }); + contextMenu.add(clearTextMenu); + return contextMenu; + } +} Property changes on: pal-portal/modules/ant-installer/trunk/src/org/tp23/gui/widget/FollowingJTextArea.java ___________________________________________________________________ Name: svn:eol-style + native Added: pal-portal/modules/ant-installer/trunk/src/org/tp23/gui/widget/JTextAreaPrintStream.java =================================================================== --- pal-portal/modules/ant-installer/trunk/src/org/tp23/gui/widget/JTextAreaPrintStream.java (rev 0) +++ pal-portal/modules/ant-installer/trunk/src/org/tp23/gui/widget/JTextAreaPrintStream.java 2008-06-11 13:36:41 UTC (rev 975) @@ -0,0 +1,244 @@ +/* + * Copyright 2005 Paul Hinds + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +package org.tp23.gui.widget; + +import java.io.ByteArrayOutputStream; +import java.io.PrintStream; + +import javax.swing.JTextArea; + +/** + *

    This subclass of PrintStream is designed to be compatible with System.out and System.err but it provides +* its own functionality and does not borrow from PrintStream. All methods are overridden. The calls to each method +* behave as expected with the exception of flush() which appears to insert a new line for each call. flush() sends +* the current line to the JTextArea with a call to JTextArea.append(String) which adds a +* line in the buffer.

    + * @author Paul Hinds + * @version 1.0 + */ +public class JTextAreaPrintStream extends PrintStream{ + + private JTextArea textArea; + private StringBuffer line; + + public JTextAreaPrintStream(JTextArea textArea) { + super(new ByteArrayOutputStream(0));// wasted all methods are overridden + this.textArea = textArea; + line = new StringBuffer(); + } + + /** + * The stream can not be closed + */ + public void close(){ + } + + public synchronized void flush(){ + if(line.length()>0){ + textArea.append(line.toString()); + line = new StringBuffer(); + } + } + + public synchronized void write(byte[] b){ + line.append(new String(b)); + } + + public synchronized void write(byte[] b, int off, int len){ + line.append(new String(b,off,len)); + } + + + public synchronized void write(int c){ + line.append(c); + } + + public synchronized boolean checkError() { + return false; + } + + public synchronized void print(Object obj) { + line.append(obj); + } + + + public synchronized void print(String s) { + line.append(s); + } + + + public synchronized void print(boolean b) { + line.append(b); + } + + + public synchronized void print(char c) { + line.append(c); + } + + + public synchronized void print(char[] s) { + line.append(s); + } + + + public synchronized void print(double d) { + line.append(d); + } + + + public synchronized void print(float f) { + line.append(f); + } + + + public synchronized void print(int i) { + line.append(i); + } + + + public synchronized void print(long l) { + line.append(l); + } + + + public synchronized void println() { + line.append('\n'); + flush(); + } + + + public synchronized void println(Object x) { + if(line.length()>0){ + textArea.append(line.append(String.valueOf(x)).toString()); + textArea.append("\n"); + line = new StringBuffer(); + } + else { + textArea.append(String.valueOf(x)); + textArea.append("\n"); + } + } + + + public synchronized void println(String x) { + if(line.length()>0){ + textArea.append(line.append(x).toString()); + textArea.append("\n"); + line = new StringBuffer(); + } + else { + textArea.append(x); + textArea.append("\n"); + } + } + + public synchronized void println(boolean x) { + if(line.length()>0){ + textArea.append(line.append(String.valueOf(x)).toString()); + textArea.append("\n"); + line = new StringBuffer(); + } + else { + textArea.append(String.valueOf(x)); + textArea.append("\n"); + } + } + + + public synchronized void println(char x) { + if(line.length()>0){ + textArea.append(line.append(String.valueOf(x)).toString()); + textArea.append("\n"); + line = new StringBuffer(); + } + else { + textArea.append(String.valueOf(x)); + textArea.append("\n"); + } + } + + + public synchronized void println(char[] x) { + if(line.length()>0){ + textArea.append(line.append(String.valueOf(x)).toString()); + textArea.append("\n"); + line = new StringBuffer(); + } + else { + textArea.append(String.valueOf(x)); + textArea.append("\n"); + } + } + + + public synchronized void println(double x) { + if(line.length()>0){ + textArea.append(line.append(String.valueOf(x)).toString()); + textArea.append("\n"); + line = new StringBuffer(); + } + else { + textArea.append(String.valueOf(x)); + textArea.append("\n"); + } + } + + + public synchronized void println(float x) { + if(line.length()>0){ + textArea.append(line.append(String.valueOf(x)).toString()); + textArea.append("\n"); + line = new StringBuffer(); + } + else { + textArea.append(String.valueOf(x)); + textArea.append("\n"); + } + } + + + public synchronized void println(int x) { + if(line.length()>0){ + textArea.append(line.append(String.valueOf(x)).toString()); + textArea.append("\n"); + line = new StringBuffer(); + } + else { + textArea.append(String.valueOf(x)); + textArea.append("\n"); + } + } + + + public synchronized void println(long x) { + if(line.length()>0){ + textArea.append(line.append(String.valueOf(x)).toString()); + textArea.append("\n"); + line = new StringBuffer(); + } + else { + textArea.append(String.valueOf(x)); + textArea.append("\n"); + } + } + + + protected void setError() { + } + + +} Property changes on: pal-portal/modules/ant-installer/trunk/src/org/tp23/gui/widget/JTextAreaPrintStream.java ___________________________________________________________________ Name: svn:eol-style + native Added: pal-portal/modules/ant-installer/trunk/src/org/tp23/gui/widget/SelectFileAction.java =================================================================== --- pal-portal/modules/ant-installer/trunk/src/org/tp23/gui/widget/SelectFileAction.java (rev 0) +++ pal-portal/modules/ant-installer/trunk/src/org/tp23/gui/widget/SelectFileAction.java 2008-06-11 13:36:41 UTC (rev 975) @@ -0,0 +1,60 @@ +/* + * Copyright 2005 Paul Hinds + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +package org.tp23.gui.widget; + +import java.awt.event.ActionEvent; +import java.io.File; + +import javax.swing.AbstractAction; +import javax.swing.ImageIcon; +import javax.swing.JComponent; +import javax.swing.JFileChooser; + +public class SelectFileAction extends AbstractAction { + protected JComponent component = null; + protected File selectedFile = null; + protected String buttonText = null; + + public SelectFileAction(String text, ImageIcon icon, JComponent component) { + super(text, icon); + this.component = component; + } + public SelectFileAction(String text, ImageIcon icon, JComponent component,String buttonText) { + super(text, icon); + this.component = component; + } + public void actionPerformed(ActionEvent e) { + JFileChooser chooser = new JFileChooser(); + if(buttonText!=null)chooser.setApproveButtonText(buttonText); + if(selectedFile!=null && selectedFile.isFile()){ + if(selectedFile.exists())chooser.setSelectedFile(selectedFile); + else chooser.setCurrentDirectory(selectedFile.getParentFile()); + } + else if(selectedFile!=null && selectedFile.isDirectory()){ + chooser.setCurrentDirectory(selectedFile); + } + else if(selectedFile!=null && !selectedFile.exists()){ + chooser.setCurrentDirectory(selectedFile.getParentFile()); + } + + int returnVal = chooser.showDialog(component,e.getActionCommand()); + if(returnVal == JFileChooser.APPROVE_OPTION) { + selectedFile = chooser.getSelectedFile(); + } else { + selectedFile = null; + } + } +} Property changes on: pal-portal/modules/ant-installer/trunk/src/org/tp23/gui/widget/SelectFileAction.java ___________________________________________________________________ Name: svn:eol-style + native Added: pal-portal/modules/ant-installer/trunk/src/org/tp23/gui/widget/SystemOutJTextArea.java =================================================================== --- pal-portal/modules/ant-installer/trunk/src/org/tp23/gui/widget/SystemOutJTextArea.java (rev 0) +++ pal-portal/modules/ant-installer/trunk/src/org/tp23/gui/widget/SystemOutJTextArea.java 2008-06-11 13:36:41 UTC (rev 975) @@ -0,0 +1,75 @@ +/* + * Copyright 2005 Paul Hinds + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +package org.tp23.gui.widget; + +import java.awt.event.ActionEvent; +import java.awt.event.ActionListener; +import java.io.PrintStream; + +import javax.swing.JButton; +import javax.swing.JScrollPane; + +/** + * + *

    Title: A JTextArea that can be set to show System.out or System.err

    + *

    Description:

    + *

    Copyright: Copyright (c) 2004

    + *

    Company:

    + * @author Paul Hinds + * @version 1.0 + */ + +public class SystemOutJTextArea extends JScrollPane{ + + private JTextAreaPrintStream stream; + private FollowingJTextArea textArea = new FollowingJTextArea(); + + public SystemOutJTextArea() { + jInit(); + } + + private void jInit(){ + this.getViewport().setView(textArea); + textArea.setEditable(false); + JButton jumpButton = new JButton(""); + setVerticalScrollBarPolicy(VERTICAL_SCROLLBAR_ALWAYS); + setHorizontalScrollBarPolicy(HORIZONTAL_SCROLLBAR_ALWAYS); + setCorner(this.LOWER_RIGHT_CORNER,jumpButton); + jumpButton.addActionListener(new ActionListener(){ + public void actionPerformed(ActionEvent e) { + textArea.setCaretPosition(textArea.getDocument().getLength()); + } + }); + jumpButton.setToolTipText("Click to jump to the end"); + + + } + + public synchronized PrintStream getOut(){ + if(stream==null){ + stream = new JTextAreaPrintStream(textArea); + } + return stream; + } + public void setAsSystemErr(){ + System.setErr(getOut()); + } + public void setAsSystemOut(){ + System.setOut(getOut()); + } + + +} Property changes on: pal-portal/modules/ant-installer/trunk/src/org/tp23/gui/widget/SystemOutJTextArea.java ___________________________________________________________________ Name: svn:eol-style + native Added: pal-portal/modules/ant-installer/trunk/src/resources/AntInstaller.png =================================================================== (Binary files differ) Property changes on: pal-portal/modules/ant-installer/trunk/src/resources/AntInstaller.png ___________________________________________________________________ Name: svn:mime-type + image/png Added: pal-portal/modules/ant-installer/trunk/src/resources/LICENSE-ant-install.txt =================================================================== --- pal-portal/modules/ant-installer/trunk/src/resources/LICENSE-ant-install.txt (rev 0) +++ pal-portal/modules/ant-installer/trunk/src/resources/LICENSE-ant-install.txt 2008-06-11 13:36:41 UTC (rev 975) @@ -0,0 +1,202 @@ + + Apache License + Version 2.0, January 2004 + http://www.apache.org/licenses/ + + TERMS AND CONDITIONS FOR USE, REPRODUCTION, AND DISTRIBUTION + + 1. Definitions. + + "License" shall mean the terms and conditions for use, reproduction, + and distribution as defined by Sections 1 through 9 of this document. + + "Licensor" shall mean the copyright owner or entity authorized by + the copyright owner that is granting the License. + + "Legal Entity" shall mean the union of the acting entity and all + other entities that control, are controlled by, or are under common + control with that entity. For the purposes of this definition, + "control" means (i) the power, direct or indirect, to cause the + direction or management of such entity, whether by contract or + otherwise, or (ii) ownership of fifty percent (50%) or more of the + outstanding shares, or (iii) beneficial ownership of such entity. + + "You" (or "Your") shall mean an individual or Legal Entity + exercising permissions granted by this License. + + "Source" form shall mean the preferred form for making modifications, + including but not limited to software source code, documentation + source, and configuration files. + + "Object" form shall mean any form resulting from mechanical + transformation or translation of a Source form, including but + not limited to compiled object code, generated documentation, + and conversions to other media types. + + "Work" shall mean the work of authorship, whether in Source or + Object form, made available under the License, as indicated by a + copyright notice that is included in or attached to the work + (an example is provided in the Appendix below). + + "Derivative Works" shall mean any work, whether in Source or Object + form, that is based on (or derived from) the Work and for which the + editorial revisions, annotations, elaborations, or other modifications + represent, as a whole, an original work of authorship. For the purposes + of this License, Derivative Works shall not include works that remain + separable from, or merely link (or bind by name) to the interfaces of, + the Work and Derivative Works thereof. + + "Contribution" shall mean any work of authorship, including + the original version of the Work and any modifications or additions + to that Work or Derivative Works thereof, that is intentionally + submitted to Licensor for inclusion in the Work by the copyright owner + or by an individual or Legal Entity authorized to submit on behalf of + the copyright owner. For the purposes of this definition, "submitted" + means any form of electronic, verbal, or written communication sent + to the Licensor or its representatives, including but not limited to + communication on electronic mailing lists, source code control systems, + and issue tracking systems that are managed by, or on behalf of, the + Licensor for the purpose of discussing and improving the Work, but + excluding communication that is conspicuously marked or otherwise + designated in writing by the copyright owner as "Not a Contribution." + + "Contributor" shall mean Licensor and any individual or Legal Entity + on behalf of whom a Contribution has been received by Licensor and + subsequently incorporated within the Work. + + 2. Grant of Copyright License. Subject to the terms and conditions of + this License, each Contributor hereby grants to You a perpetual, + worldwide, non-exclusive, no-charge, royalty-free, irrevocable + copyright license to reproduce, prepare Derivative Works of, + publicly display, publicly perform, sublicense, and distribute the + Work and such Derivative Works in Source or Object form. + + 3. Grant of Patent License. Subject to the terms and conditions of + this License, each Contributor hereby grants to You a perpetual, + worldwide, non-exclusive, no-charge, royalty-free, irrevocable + (except as stated in this section) patent license to make, have made, + use, offer to sell, sell, import, and otherwise transfer the Work, + where such license applies only to those patent claims licensable + by such Contributor that are necessarily infringed by their + Contribution(s) alone or by combination of their Contribution(s) + with the Work to which such Contribution(s) was submitted. If You + institute patent litigation against any entity (including a + cross-claim or counterclaim in a lawsuit) alleging that the Work + or a Contribution incorporated within the Work constitutes direct + or contributory patent infringement, then any patent licenses + granted to You under this License for that Work shall terminate + as of the date such litigation is filed. + + 4. Redistribution. You may reproduce and distribute copies of the + Work or Derivative Works thereof in any medium, with or without + modifications, and in Source or Object form, provided that You + meet the following conditions: + + (a) You must give any other recipients of the Work or + Derivative Works a copy of this License; and + + (b) You must cause any modified files to carry prominent notices + stating that You changed the files; and + + (c) You must retain, in the Source form of any Derivative Works + that You distribute, all copyright, patent, trademark, and + attribution notices from the Source form of the Work, + excluding those notices that do not pertain to any part of + the Derivative Works; and + + (d) If the Work includes a "NOTICE" text file as part of its + distribution, then any Derivative Works that You distribute must + include a readable copy of the attribution notices contained + within such NOTICE file, excluding those notices that do not + pertain to any part of the Derivative Works, in at least one + of the following places: within a NOTICE text file distributed + as part of the Derivative Works; within the Source form or + documentation, if provided along with the Derivative Works; or, + within a display generated by the Derivative Works, if and + wherever such third-party notices normally appear. The contents + of the NOTICE file are for informational purposes only and + do not modify the License. You may add Your own attribution + notices within Derivative Works that You distribute, alongside + or as an addendum to the NOTICE text from the Work, provided + that such additional attribution notices cannot be construed + as modifying the License. + + You may add Your own copyright statement to Your modifications and + may provide additional or different license terms and conditions + for use, reproduction, or distribution of Your modifications, or + for any such Derivative Works as a whole, provided Your use, + reproduction, and distribution of the Work otherwise complies with + the conditions stated in this License. + + 5. Submission of Contributions. Unless You explicitly state otherwise, + any Contribution intentionally submitted for inclusion in the Work + by You to the Licensor shall be under the terms and conditions of + this License, without any additional terms or conditions. + Notwithstanding the above, nothing herein shall supersede or modify + the terms of any separate license agreement you may have executed + with Licensor regarding such Contributions. + + 6. Trademarks. This License does not grant permission to use the trade + names, trademarks, service marks, or product names of the Licensor, + except as required for reasonable and customary use in describing the + origin of the Work and reproducing the content of the NOTICE file. + + 7. Disclaimer of Warranty. Unless required by applicable law or + agreed to in writing, Licensor provides the Work (and each + Contributor provides its Contributions) on an "AS IS" BASIS, + WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or + implied, including, without limitation, any warranties or conditions + of TITLE, NON-INFRINGEMENT, MERCHANTABILITY, or FITNESS FOR A + PARTICULAR PURPOSE. You are solely responsible for determining the + appropriateness of using or redistributing the Work and assume any + risks associated with Your exercise of permissions under this License. + + 8. Limitation of Liability. In no event and under no legal theory, + whether in tort (including negligence), contract, or otherwise, + unless required by applicable law (such as deliberate and grossly + negligent acts) or agreed to in writing, shall any Contributor be + liable to You for damages, including any direct, indirect, special, + incidental, or consequential damages of any character arising as a + result of this License or out of the use or inability to use the + Work (including but not limited to damages for loss of goodwill, + work stoppage, computer failure or malfunction, or any and all + other commercial damages or losses), even if such Contributor + has been advised of the possibility of such damages. + + 9. Accepting Warranty or Additional Liability. While redistributing + the Work or Derivative Works thereof, You may choose to offer, + and charge a fee for, acceptance of support, warranty, indemnity, + or other liability obligations and/or rights consistent with this + License. However, in accepting such obligations, You may act only + on Your own behalf and on Your sole responsibility, not on behalf + of any other Contributor, and only if You agree to indemnify, + defend, and hold each Contributor harmless for any liability + incurred by, or claims asserted against, such Contributor by reason + of your accepting any such warranty or additional liability. + + END OF TERMS AND CONDITIONS + + APPENDIX: How to apply the Apache License to your work. + + To apply the Apache License to your work, attach the following + boilerplate notice, with the fields enclosed by brackets "[]" + replaced with your own identifying information. (Don't include + the brackets!) The text should be enclosed in the appropriate + comment syntax for the file format. We also recommend that a + file or class name and description of purpose be included on the + same "printed page" as the copyright notice for easier + identification within third-party archives. + + Copyright 2005 Paul Hinds + + Licensed under the Apache License, Version 2.0 (the "License"); + you may not use this file except in compliance with the License. + You may obtain a copy of the License at + + http://www.apache.org/licenses/LICENSE-2.0 + + Unless required by applicable law or agreed to in writing, software + distributed under the License is distributed on an "AS IS" BASIS, + WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + See the License for the specific language governing permissions and + limitations under the License. Property changes on: pal-portal/modules/ant-installer/trunk/src/resources/LICENSE-ant-install.txt ___________________________________________________________________ Name: svn:eol-style + native Added: pal-portal/modules/ant-installer/trunk/src/resources/antbar.png =================================================================== (Binary files differ) Property changes on: pal-portal/modules/ant-installer/trunk/src/resources/antbar.png ___________________________________________________________________ Name: svn:mime-type + image/png Added: pal-portal/modules/ant-installer/trunk/src/resources/banner23.png =================================================================== (Binary files differ) Property changes on: pal-portal/modules/ant-installer/trunk/src/resources/banner23.png ___________________________________________________________________ Name: svn:mime-type + image/png Added: pal-portal/modules/ant-installer/trunk/src/resources/extract-image.png =================================================================== (Binary files differ) Property changes on: pal-portal/modules/ant-installer/trunk/src/resources/extract-image.png ___________________________________________________________________ Name: svn:mime-type + image/png Added: pal-portal/modules/ant-installer/trunk/src/resources/gkmain_inv.png =================================================================== (Binary files differ) Property changes on: pal-portal/modules/ant-installer/trunk/src/resources/gkmain_inv.png ___________________________________________________________________ Name: svn:mime-type + image/png Added: pal-portal/modules/ant-installer/trunk/src/resources/gothbar.gif =================================================================== (Binary files differ) Property changes on: pal-portal/modules/ant-installer/trunk/src/resources/gothbar.gif ___________________________________________________________________ Name: svn:mime-type + application/octet-stream Added: pal-portal/modules/ant-installer/trunk/src/resources/greens.png =================================================================== (Binary files differ) Property changes on: pal-portal/modules/ant-installer/trunk/src/resources/greens.png ___________________________________________________________________ Name: svn:mime-type + image/png Added: pal-portal/modules/ant-installer/trunk/src/resources/icons/LICENSE =================================================================== --- pal-portal/modules/ant-installer/trunk/src/resources/icons/LICENSE (rev 0) +++ pal-portal/modules/ant-installer/trunk/src/resources/icons/LICENSE 2008-06-11 13:36:41 UTC (rev 975) @@ -0,0 +1,13 @@ +This copyright and license notice covers the images in this directory. +Note the license notice contains an add-on. + +KDE Crystal theme icons. +Copyright (C) 2002 and following years KDE Artists +This library is free software; you can redistribute it and/or modify it under +the terms of the GNU Lesser General Public License as published by the Free +Software Foundation, version 2.1 of the License. + +This library 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 for more details. You should have received a copy of the GNU Lesser General Public License along +with this library; if not, write to the Added: pal-portal/modules/ant-installer/trunk/src/resources/icons/back.png =================================================================== (Binary files differ) Property changes on: pal-portal/modules/ant-installer/trunk/src/resources/icons/back.png ___________________________________________________________________ Name: svn:mime-type + image/png Added: pal-portal/modules/ant-installer/trunk/src/resources/icons/cancel.png =================================================================== (Binary files differ) Property changes on: pal-portal/modules/ant-installer/trunk/src/resources/icons/cancel.png ___________________________________________________________________ Name: svn:mime-type + image/png Added: pal-portal/modules/ant-installer/trunk/src/resources/icons/finish.png =================================================================== (Binary files differ) Property changes on: pal-portal/modules/ant-installer/trunk/src/resources/icons/finish.png ___________________________________________________________________ Name: svn:mime-type + image/png Added: pal-portal/modules/ant-installer/trunk/src/resources/icons/next.png =================================================================== (Binary files differ) Property changes on: pal-portal/modules/ant-installer/trunk/src/resources/icons/next.png ___________________________________________________________________ Name: svn:mime-type + image/png Added: pal-portal/modules/ant-installer/trunk/src/resources/icons/ok.png =================================================================== (Binary files differ) Property changes on: pal-portal/modules/ant-installer/trunk/src/resources/icons/ok.png ___________________________________________________________________ Name: svn:mime-type + image/png Added: pal-portal/modules/ant-installer/trunk/src/resources/icons/showdetails.png =================================================================== (Binary files differ) Property changes on: pal-portal/modules/ant-installer/trunk/src/resources/icons/showdetails.png ___________________________________________________________________ Name: svn:mime-type + image/png Added: pal-portal/modules/ant-installer/trunk/src/resources/makewavesdawn.png =================================================================== (Binary files differ) Property changes on: pal-portal/modules/ant-installer/trunk/src/resources/makewavesdawn.png ___________________________________________________________________ Name: svn:mime-type + image/png Added: pal-portal/modules/ant-installer/trunk/src/resources/rockstiles.png =================================================================== (Binary files differ) Property changes on: pal-portal/modules/ant-installer/trunk/src/resources/rockstiles.png ___________________________________________________________________ Name: svn:mime-type + image/png Added: pal-portal/modules/ant-installer/trunk/src_ext/org/tp23/antinstaller/runtime/exe/ReleaseNotesFilter.java =================================================================== --- pal-portal/modules/ant-installer/trunk/src_ext/org/tp23/antinstaller/runtime/exe/ReleaseNotesFilter.java (rev 0) +++ pal-portal/modules/ant-installer/trunk/src_ext/org/tp23/antinstaller/runtime/exe/ReleaseNotesFilter.java 2008-06-11 13:36:41 UTC (rev 975) @@ -0,0 +1,102 @@ +/* + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +package org.tp23.antinstaller.runtime.exe; + +import java.io.BufferedReader; +import java.io.IOException; +import java.io.InputStream; +import java.io.InputStreamReader; +import java.util.ResourceBundle; + +import org.tp23.antinstaller.InstallException; +import org.tp23.antinstaller.InstallerContext; +import org.tp23.antinstaller.input.OutputField; +import org.tp23.antinstaller.renderer.text.Pager; +import org.tp23.antinstaller.runtime.Runner; +import org.tp23.antinstaller.runtime.SwingRunner; +import org.tp23.antinstaller.runtime.TextRunner; + + +/** + * A filter that launches a window with release notes if a property has been selected + * during the install. The notes are loaded from a resource on the classpath + * called /release-notes.txt + * @author Paul Hinds + * @version $Id: ReleaseNotesFilter.java,v 1.4 2007/01/04 22:57:18 teknopaul Exp $ + */ +public class ReleaseNotesFilter implements ExecuteFilter { + + private static final ResourceBundle res = ResourceBundle.getBundle("org.tp23.antinstaller.renderer.text.Res"); + private static final String nextChar = res.getString("nextChar"); + + /** + * The AntInstaller property that must be "true" for the release notes to show + */ + public static final String RELEASE_NOTES_PROPERTY = "show.release.notes"; + + public ReleaseNotesFilter() { + } + + public void exec(InstallerContext ctx) throws InstallException { + if(ctx.isInstallSucceded() ){ + String showReleaseNotes = ctx.getInstaller().getResultContainer().getProperty(RELEASE_NOTES_PROPERTY); + if(OutputField.isTrue(showReleaseNotes)){ + try { + InputStream is = ReleaseNotesFilter.class.getResourceAsStream("/release-notes.txt"); + BufferedReader br = new BufferedReader(new InputStreamReader(is)); + String line = null; + StringBuffer file = new StringBuffer(); + while((line = br.readLine())!=null){ + file.append(line).append('\n'); + } + br.close(); + Runner runner = ctx.getRunner(); + if(runner instanceof TextRunner){ + renderText(file.toString()); + + } + else{ // if(runner instanceof SwingRunner){ + //SwingRunner sRunner = (SwingRunner)runner; + ReleaseNotesFrame rFrame = new ReleaseNotesFrame("Readme"); + rFrame.init(file.toString()); + } + } + catch (IOException e) { + throw new InstallException("Could not render Release notes",e); + } + } + } + } + + private void renderText(String text) throws IOException{ + BufferedReader commandReader = new BufferedReader(new InputStreamReader(System.in)); + Pager pager = new Pager(text); + String command = null; + do { + if (!pager.next(System.out)) { + break; + } + System.out.println(); + System.out.println(getNextInstructions()); + command = commandReader.readLine(); + } + while (command.toUpperCase().startsWith(nextChar)); + pager.rest(System.out); + + } + private String getNextInstructions() { + return res.getString("large_select_next"); + } + +} Property changes on: pal-portal/modules/ant-installer/trunk/src_ext/org/tp23/antinstaller/runtime/exe/ReleaseNotesFilter.java ___________________________________________________________________ Name: svn:eol-style + native Added: pal-portal/modules/ant-installer/trunk/src_ext/org/tp23/antinstaller/runtime/exe/ReleaseNotesFrame.java =================================================================== --- pal-portal/modules/ant-installer/trunk/src_ext/org/tp23/antinstaller/runtime/exe/ReleaseNotesFrame.java (rev 0) +++ pal-portal/modules/ant-installer/trunk/src_ext/org/tp23/antinstaller/runtime/exe/ReleaseNotesFrame.java 2008-06-11 13:36:41 UTC (rev 975) @@ -0,0 +1,63 @@ +/* + * Copyright 2005 Paul Hinds + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +package org.tp23.antinstaller.runtime.exe; + +import java.awt.BorderLayout; +import java.awt.Dimension; +import java.awt.GraphicsConfiguration; +import java.awt.HeadlessException; + +import javax.swing.JEditorPane; +import javax.swing.JFrame; +import javax.swing.JScrollPane; + + +/** + * ReleaseNotes frame for displaying plain text + * @author Paul Hinds + * @version $Id: ReleaseNotesFrame.java,v 1.3 2006/12/21 00:03:23 teknopaul Exp $ + */ +public class ReleaseNotesFrame extends JFrame { + + private BorderLayout borderLayout1 = new BorderLayout(); + private JEditorPane contentsEditorPane = new JEditorPane(); + private JScrollPane hPanelScrollPane = new JScrollPane(); + + public ReleaseNotesFrame(String title) throws HeadlessException { + super(title); + } + + public void init(String text){ + contentsEditorPane.setMinimumSize(new Dimension(200, 200)); + contentsEditorPane.setPreferredSize(new Dimension(1000, Integer.MAX_VALUE)); + contentsEditorPane.setEditable(false); + contentsEditorPane.setContentType("text/plain"); + contentsEditorPane.setCaretPosition(0); + contentsEditorPane.setText(text); + this.getContentPane().setLayout(borderLayout1); + hPanelScrollPane.setMinimumSize(new Dimension(200, 200)); + hPanelScrollPane.setPreferredSize(new Dimension(Integer.MAX_VALUE, Integer.MAX_VALUE)); + this.getContentPane().add(hPanelScrollPane, BorderLayout.CENTER); + hPanelScrollPane.getViewport().add(contentsEditorPane); + hPanelScrollPane.setVerticalScrollBarPolicy(JScrollPane.VERTICAL_SCROLLBAR_ALWAYS); + this.setSize(new Dimension(500,500)); + hPanelScrollPane.setWheelScrollingEnabled(true); + this.setDefaultCloseOperation(JFrame.DISPOSE_ON_CLOSE); + this.show(); + + } + +} Property changes on: pal-portal/modules/ant-installer/trunk/src_ext/org/tp23/antinstaller/runtime/exe/ReleaseNotesFrame.java ___________________________________________________________________ Name: svn:eol-style + native Added: pal-portal/modules/ant-installer/trunk/src_ext/org/tp23/antinstaller/taskdefs/Installer.java =================================================================== --- pal-portal/modules/ant-installer/trunk/src_ext/org/tp23/antinstaller/taskdefs/Installer.java (rev 0) +++ pal-portal/modules/ant-installer/trunk/src_ext/org/tp23/antinstaller/taskdefs/Installer.java 2008-06-11 13:36:41 UTC (rev 975) @@ -0,0 +1,399 @@ +/* + * Copyright 2005 Paul Hinds + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + * + */ +package org.tp23.antinstaller.taskdefs; + +import java.io.File; +import java.io.FileInputStream; +import java.io.IOException; +import java.io.InputStream; + +import javax.xml.parsers.SAXParser; +import javax.xml.parsers.SAXParserFactory; + +import org.apache.tools.ant.BuildException; +import org.apache.tools.ant.Project; +import org.apache.tools.ant.taskdefs.Jar; +import org.apache.tools.ant.taskdefs.Manifest; +import org.apache.tools.ant.taskdefs.ManifestException; +import org.apache.tools.ant.types.FileSet; +import org.apache.tools.ant.types.ZipFileSet; +import org.apache.tools.zip.ZipOutputStream; +import org.tp23.antinstaller.renderer.swing.plaf.LookAndFeelFactory; +import org.tp23.antinstaller.runtime.ConfigurationLoader; +import org.xml.sax.InputSource; +import org.xml.sax.SAXException; +import org.xml.sax.SAXParseException; +import org.xml.sax.helpers.DefaultHandler; + +/** + * Creates a Installer archive. + * + * + * @ant.task category="packaging" + */ +public class Installer extends Jar { + + public static final String NON_EXTRACTOR = "NonExtractor"; + public static final String SELF_EXTRACTOR = "SelfExtractor"; + + /** The extract type to use NonExtractor or SelfExtractor */ + private String extractType; + + /** The AntInstall config file */ + private File installConfig; + + /** The Ant build.xml to be used*/ + private File buildFile; + + /** The location of ant-installer.jar and ant-installer-ext.jar and possibly jgoodies-edited-1_2_2.jar */ + private File antInstallLib; + + /** The location of xercesImpl.jar and xml-apis.jar + * This is not requried Xerces is optional and will increase the download size */ + private File xercesLib; + + /** The location of ant.jar and ant-launcher.jar */ + private File antLib; + + /** The AntInstaller Look And Feel to be used */ + private String laf; + + /** The icon set to use */ + private String icons; + + /** Stop the build if there is a known error in the config */ + protected boolean failOnError = false; + + /** perform the validation */ + protected boolean validateConfig = false; + + private boolean buildFileSet = false; + private boolean configFileSet = false; + /** Indicates that the build.xml and antinstall-config.xml have been added to the fileset already */ + private boolean startCheckDuplicates = false; + + /** constructor */ + public Installer() { + super(); + archiveType = "jar"; + emptyBehavior = "create"; + setEncoding("UTF8"); + } + + protected void cleanUp() { + super.cleanUp(); + } + + public void reset() { + super.reset(); + extractType = null; + installConfig = null; + buildFile = null; + } + + /** + * @param installConfig The installConfig to set. + */ + public void setInstallConfig(File installConfig) { + this.installConfig = installConfig; + if (!installConfig.exists()) { + throw new BuildException("AntInstall config: " + + installConfig + + " does not exist."); + } + // Create a ZipFileSet for this file, and pass it up. + ZipFileSet fs = new ZipFileSet(); + fs.setFile(installConfig); + fs.setFullpath("antinstall-config.xml"); + super.addFileset(fs); + if(this.buildFile != null) { + startCheckDuplicates = true; + } + } + /** + * @param buildFile The buildFile to set. + */ + public void setBuildFile(File buildFile) { + this.buildFile = buildFile; + if (!buildFile.exists()) { + throw new BuildException("AntInstall build file: " + + buildFile + + " does not exist."); + } + // Create a ZipFileSet for this file, and pass it up. + ZipFileSet fs = new ZipFileSet(); + fs.setFile(buildFile); + fs.setFullpath("build.xml"); + super.addFileset(fs); + if(this.installConfig != null) { + startCheckDuplicates = true; + } + } + /** + * @param icons The ocons pack to use for buttons. + */ + public void setIcons(String icons) { + this.icons = icons; + // Create a ZipFileSet for this file, and pass it up. + File iconJar = new File(antInstallLib, "ai-icons-" + icons + ".jar"); + if (!iconJar.exists()) { + throw new BuildException("Missing icons: " + + iconJar + + " does not exist."); + } + FileSet set = new FileSet(); + set.setFile(iconJar); + addZipGroupFileset(set); + + } + /** + * @param extractType The extractType to set. + */ + public void setExtractType(String extractType) { + this.extractType = extractType; + } + + public void setFailOnError(boolean fail) { + failOnError = fail; + } + + public void setValidateConfig(boolean validate) { + validateConfig = validate; + } + + /** + * The location of ant-installer.jar and possibly jgoodies-edited-1_2_2.jar + * @param antInstallLib The antInstallLib to set. + */ + public void setAntInstallLib(File antInstallLib) { + this.antInstallLib = antInstallLib; + FileSet set = new FileSet(); + set.setFile(new File(antInstallLib, "ant-installer.jar")); + addZipGroupFileset(set); + } + /** + * The location of ant.jar and ant-launcher.jar + * @param antLib The antLib to set. + */ + public void setAntLib(File antLib) { + this.antLib = antLib; + FileSet set = new FileSet(); + set.setFile(new File(antLib, "ant.jar")); + set.setFile(new File(antLib, "ant-launcher.jar")); + addZipGroupFileset(set); + } + /** + * @param xercesLib The xercesLib to set. + */ + public void setXercesLib(File xercesLib) { + this.xercesLib = xercesLib; + FileSet set = new FileSet(); + set.setFile(new File(xercesLib, "xercesImpl.jar")); + set.setFile(new File(xercesLib, "xml-apis.jar")); + addZipGroupFileset(set); + } + + /** + * Overrides the ZIP execute() method which creates filesets + */ + public void execute(){ + log(".-------------------------------."); + log("|-(o--~AntInstaller.sf.net~--o)-|"); + log("`-----------------by-Paul-Hinds-卒"); + + if(validateConfig) { + validateConfig(); + } else if(extractType.equals(SELF_EXTRACTOR)){ + // this reads the config just + // to extract the lookAndFeel attribute for the manifest at the moment + readConfig(); + } + if( LookAndFeelFactory.isDefault(getLaf()) ){ + FileSet set = new FileSet(); + set.setFile(new File(antInstallLib, "jgoodies-edited-1_2_2.jar")); + addZipGroupFileset(set); + } + + super.execute(); + } + + /** + * override of parent; validates configuration + * before initializing the output stream. The Manifest is set in the Jar superclass's + * method so Manifest modifications must be performed in this method + */ + protected void initZipOutputStream(ZipOutputStream zOut) + throws IOException, BuildException { + // If no buildFile file is specified, it's an error. + if (buildFile == null && !isInUpdateMode()) { + throw new BuildException("buildFile attribute is required", getLocation()); + } + // If no installConfig file is specified, it's an error. + if (installConfig == null && !isInUpdateMode()) { + throw new BuildException("installConfig attribute is required", getLocation()); + } + try{ + addConfiguredManifest(this.getManifest()); + } + catch(ManifestException me){ + throw new BuildException("Cant add AntInstaller Manifest", me, getLocation()); + } + super.initZipOutputStream(zOut); + } + + protected void zipFile(InputStream is, ZipOutputStream zOut, String vPath, + long lastModified, File fromArchive, int mode) + throws IOException { + + if(vPath.equalsIgnoreCase("antinstall-config.xml")) { + if(buildFileSet) { + log("Two antinstall-config.xml files in jar", Project.MSG_WARN); + } + buildFileSet = true; + } + if(vPath.equalsIgnoreCase("build.xml")) { + if(configFileSet) { + log("Two build.xml files in jar", Project.MSG_WARN); + } + configFileSet = true; + } + + super.zipFile(is, zOut, vPath, lastModified, fromArchive, mode); + } + + /** + * This method is only valid after readConfig() or validateConfig() have been run + * @return Returns the Look And Feel class. + */ + private String getLaf() { + if(laf == null){ + return LookAndFeelFactory.DEFAULT_LAF; + } + return laf; + } + + private Manifest getManifest() throws ManifestException{ + if(extractType.equalsIgnoreCase(NON_EXTRACTOR)){ + return getNonExtractorManifest(); + } + else if(extractType.equalsIgnoreCase(SELF_EXTRACTOR)){ + return getSelfExtractorManifest(); + } + else { + throw new BuildException("Invalid extractType: " + extractType); + } + } + + private Manifest getNonExtractorManifest() throws ManifestException{ + return getCustomManifest("org.tp23.antinstaller.selfextract.NonExtractor"); + } + private Manifest getSelfExtractorManifest() throws ManifestException{ + return getCustomManifest("org.tp23.antinstaller.selfextract.SelfExtractor"); + } + private Manifest getCustomManifest(String mainClass) throws ManifestException{ + log("Creating MANIFEST.mf"); + Manifest newManifest = new Manifest(); + Manifest.Section mainSection = newManifest.getMainSection(); + Manifest.Attribute attmc = new Manifest.Attribute(); + attmc.setName("Main-Class"); + attmc.setValue(mainClass); + mainSection.addAttributeAndCheck(attmc); + Manifest.Attribute attlaf = new Manifest.Attribute(); + attlaf.setName("Look-And-Feel"); + attlaf.setValue(getLaf()); + mainSection.addAttributeAndCheck(attlaf); + return newManifest; + + } + + protected void validateConfig(){ + + int ret = 1; + try { + log("validating config..."); + ConfigurationLoader configurationLoader = new ConfigurationLoader(); + configurationLoader.readConfig(installConfig.getParentFile(), installConfig.getName()); + ret = configurationLoader.validate(); + laf = configurationLoader.getInstaller().getLookAndFeel(); + if(ret != 0){ + err(); + } + } + catch (Exception ex) { + ex.printStackTrace(); + err(); + } + + try{ + log("parsing included build.xml..."); + InputSource xmlInp = new InputSource(new FileInputStream(buildFile)); + SAXParserFactory parserFactory = SAXParserFactory.newInstance(); + SAXParser parser = parserFactory.newSAXParser(); + parser.parse(xmlInp, new DefaultHandler(){ + public void error(SAXParseException e) throws SAXException{ + throw e; + } + public void fatalError(SAXParseException e) throws SAXException{ + throw e; + } + } ); + log("build.xml is well formed"); + } + catch (Exception ex) { + ex.printStackTrace(); + errNestedBuildXml(); + } + } + + protected void readConfig(){ + + try { + log("reading config..."); + ConfigurationLoader configurationLoader = new ConfigurationLoader(); + configurationLoader.readConfig(installConfig.getParentFile(), installConfig.getName()); + laf = configurationLoader.getInstaller().getLookAndFeel(); + } + catch (Exception ex) { + ex.printStackTrace(); + err(); + } + } + + /** + * error found on validation of the antinstall config + */ + private void err(){ + String errorMsg = "Error in config file:" + installConfig.getAbsolutePath(); + if (failOnError) { + throw new BuildException(errorMsg); + } else { + log(errorMsg, Project.MSG_ERR); + } + } + /** + * error found in the build.xml used by ant installer (not the one + * running this task) + */ + private void errNestedBuildXml(){ + String errorMsg = "Error in included build file:" + buildFile.getAbsolutePath(); + if (failOnError) { + throw new BuildException(errorMsg); + } else { + log(errorMsg, Project.MSG_ERR); + } + } +} Property changes on: pal-portal/modules/ant-installer/trunk/src_ext/org/tp23/antinstaller/taskdefs/Installer.java ___________________________________________________________________ Name: svn:eol-style + native Added: pal-portal/modules/ant-installer/trunk/src_ext/org/tp23/antinstaller/taskdefs/KdeIconTask.java =================================================================== --- pal-portal/modules/ant-installer/trunk/src_ext/org/tp23/antinstaller/taskdefs/KdeIconTask.java (rev 0) +++ pal-portal/modules/ant-installer/trunk/src_ext/org/tp23/antinstaller/taskdefs/KdeIconTask.java 2008-06-11 13:36:41 UTC (rev 975) @@ -0,0 +1,146 @@ +/* + * Copyright 2005 Paul Hinds + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +package org.tp23.antinstaller.taskdefs; + +import java.io.BufferedReader; +import java.io.File; +import java.io.IOException; +import java.io.InputStreamReader; +import java.io.PrintWriter; +import java.io.StringWriter; + +import org.apache.tools.ant.BuildException; +import org.apache.tools.ant.Task; +import org.tp23.antinstaller.selfextract.ResourceExtractor; +/** + * + * @author teknopaul + * + */ +public class KdeIconTask extends Task{ + + private String desktop; + private String icon; + private String installDir; + + public void execute() throws BuildException{ + if(desktop == null || icon == null || installDir == null){ + throw new BuildException("Missing attribute in KdeIconTask"); + } + + ResourceExtractor re = new ResourceExtractor(); + + File appsDir = null; + try { + appsDir = getAppsDir(); + } catch (Exception e) { + throw new BuildException("Can not determine KDE directory"); + } + if( appsDir != null && appsDir.exists() ) { + try { + String desktopFileName = desktop.substring( desktop.lastIndexOf('/') + 1 ); + log("creating: " + new File( appsDir, desktopFileName).getCanonicalPath()); + re.copyResource(desktop, new File( appsDir, desktopFileName), "@installDir@", installDir); + } catch (Exception e) { + StringWriter sw = new StringWriter(); + e.printStackTrace(new PrintWriter(sw)); + throw new BuildException(sw.getBuffer().toString()); + } + } + else{ + log("apps dir does not exist"); + } + File iconDir = null; + try { + iconDir = getIconDir(); + } catch (Exception e) { + throw new BuildException("Can not determine KDE directory"); + } + if(iconDir != null && iconDir.exists()){ + try { + String iconFileName = icon.substring( icon.lastIndexOf('/') + 1 ); + log("creating: " + new File( iconDir, iconFileName).getCanonicalPath()); + re.copyResourceBinary(icon, new File( iconDir, iconFileName )); + } catch (IOException e) { + throw new BuildException(e.getMessage()); + } + } + else{ + log("icon dir does not exist"); + } + try { + Process proc = Runtime.getRuntime().exec("kbuildsycoca"); + } catch (Exception e) { + log("error running kbuildsycoca: " + e.getMessage()); + } + + } + + private File getKdeDir(String pathdef, String extension) throws IOException, InterruptedException{ + String[] args = {"kde-config", "--path", pathdef}; + Process proc = Runtime.getRuntime().exec(args); + BufferedReader br = new BufferedReader( new InputStreamReader(proc.getInputStream())); + String appsDirs = br.readLine(); + int idx = -1; + if(appsDirs != null) { + idx = appsDirs.indexOf(':'); + } + br.close(); + + if(idx > -1 && idx < appsDirs.length() - 1){ + String privatedir = appsDirs.substring(0, idx - 1); + if(!privatedir.endsWith("/")){ + privatedir = privatedir + "/"; + } + return new File(privatedir + extension); + } + else{ + if(!appsDirs.endsWith("/")){ + appsDirs = appsDirs + "/"; + } + return new File(appsDirs + extension); + } + } + private File getAppsDir() throws IOException, InterruptedException{ + return getKdeDir("xdgdata-apps", ""); + } + private File getIconDir() throws IOException, InterruptedException{ + return getKdeDir("icon", "hicolor/48x48/apps"); + } + + + public String getDesktop() { + return desktop; + } + public void setDesktop(String desktop) { + this.desktop = desktop; + } + public String getIcon() { + return icon; + } + public void setIcon(String icon) { + this.icon = icon; + } + + public String getInstallDir() { + return installDir; + } + + public void setInstallDir(String installDir) { + this.installDir = installDir; + } + +} Property changes on: pal-portal/modules/ant-installer/trunk/src_ext/org/tp23/antinstaller/taskdefs/KdeIconTask.java ___________________________________________________________________ Name: svn:eol-style + native Added: pal-portal/modules/ant-installer/trunk/src_ext/org/tp23/antinstaller/taskdefs/ValidateConfig.java =================================================================== --- pal-portal/modules/ant-installer/trunk/src_ext/org/tp23/antinstaller/taskdefs/ValidateConfig.java (rev 0) +++ pal-portal/modules/ant-installer/trunk/src_ext/org/tp23/antinstaller/taskdefs/ValidateConfig.java 2008-06-11 13:36:41 UTC (rev 975) @@ -0,0 +1,26 @@ +/* + * Copyright 2005 Paul Hinds + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +package org.tp23.antinstaller.taskdefs; + +public class ValidateConfig extends Installer { + + public void execute(){ + log(".-------------------------------."); + log("|-(o--~AntInstaller.sf.net~--o)-|"); + log("`-----------------by-Paul-Hinds-卒"); + validateConfig(); + } +} Property changes on: pal-portal/modules/ant-installer/trunk/src_ext/org/tp23/antinstaller/taskdefs/ValidateConfig.java ___________________________________________________________________ Name: svn:eol-style + native Added: pal-portal/modules/ant-installer/trunk/src_ext/org/tp23/antinstaller/util/CreateLanguagePack.java =================================================================== --- pal-portal/modules/ant-installer/trunk/src_ext/org/tp23/antinstaller/util/CreateLanguagePack.java (rev 0) +++ pal-portal/modules/ant-installer/trunk/src_ext/org/tp23/antinstaller/util/CreateLanguagePack.java 2008-06-11 13:36:41 UTC (rev 975) @@ -0,0 +1,112 @@ +/* + * Copyright 2005 Paul Hinds + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +package org.tp23.antinstaller.util; + +import java.io.BufferedReader; +import java.io.File; +import java.io.IOException; +import java.io.InputStreamReader; + +import javax.swing.JDialog; +import javax.swing.JFileChooser; +import javax.swing.JFrame; +import javax.swing.JOptionPane; +import javax.swing.filechooser.FileFilter; + +import org.tp23.antinstaller.InstallException; +import org.tp23.antinstaller.Installer; +import org.tp23.antinstaller.InstallerContext; +import org.tp23.antinstaller.runtime.exe.LoadConfigFilter; + +public class CreateLanguagePack { + + + public static void main(String[] args) { + try { + BufferedReader br = new BufferedReader(new InputStreamReader(System.in)); + + System.out.println("Create LanguagePack for antinstall-config.xml in the current directory?"); + br.readLine(); + + System.out.println("Enter Locale to create e.g. es_EU"); + String locale = br.readLine().trim(); + + createLanguagePack(loadConfigFile(new File("."), "antinstall-config.xml" ), locale, new File(".")); + + System.out.println("done."); + } catch (IOException e) { + e.printStackTrace(); + } catch (InstallException e) { + e.printStackTrace(); + } + } + + public static File guiMain(JFrame root) { + try { + JFileChooser chooser = new JFileChooser(); + chooser.setDialogTitle("Select antinstall-config.xml file"); + chooser.setApproveButtonText("Select file"); + FileFilter ff = new FileFilter(){ + public boolean accept(File file){ + return file.getName().equals("antinstall-config.xml") || file.isDirectory(); + } + public String getDescription() { + return "antinstall-config.xml files"; + } + }; + chooser.setFileFilter(ff); + chooser.showOpenDialog(root); + File chosen = chooser.getSelectedFile(); + if(chosen != null){ + chooser = new JFileChooser(); + chooser.setDialogTitle("Select output directory"); + chooser.setApproveButtonText("Internationalise file"); + chooser.setFileSelectionMode(JFileChooser.DIRECTORIES_ONLY); + chooser.setCurrentDirectory(chosen.getParentFile()); + chooser.showOpenDialog(root); + File dir = chooser.getSelectedFile(); + if(dir != null){ + createLanguagePack(loadConfigFile(chosen.getParentFile(), chosen.getName()), null, dir); + if(! dir.getName().equals("resources")){ + JOptionPane.showMessageDialog(root, "When the resources files are added to the installer jar\n the parent directory must be /resources/"); + } + return new File(dir, "LanguagePack.properties"); + } + } + + } catch (IOException e) { + e.printStackTrace(); + } catch (InstallException e) { + e.printStackTrace(); + } + return null; + } + + private static Installer loadConfigFile(File rootDir, String configName) throws InstallException{ + InstallerContext ctx = new InstallerContext(); + ctx.setFileRoot(rootDir); + ctx.setInstallerConfigFile(configName); + LoadConfigFilter configLoader = new LoadConfigFilter(); + configLoader.exec(ctx); + Installer installer = ctx.getInstaller(); + return installer; + } + + private static void createLanguagePack(Installer installer, String locale, File outputDir) throws IOException{ + LangPackFileRenderer renderer = new LangPackFileRenderer(); + renderer.renderProperties(installer, outputDir, locale); + } +} Property changes on: pal-portal/modules/ant-installer/trunk/src_ext/org/tp23/antinstaller/util/CreateLanguagePack.java ___________________________________________________________________ Name: svn:eol-style + native Added: pal-portal/modules/ant-installer/trunk/src_ext/org/tp23/antinstaller/util/LangPackFileRenderer.java =================================================================== --- pal-portal/modules/ant-installer/trunk/src_ext/org/tp23/antinstaller/util/LangPackFileRenderer.java (rev 0) +++ pal-portal/modules/ant-installer/trunk/src_ext/org/tp23/antinstaller/util/LangPackFileRenderer.java 2008-06-11 13:36:41 UTC (rev 975) @@ -0,0 +1,227 @@ +/* + * Copyright 2005 Paul Hinds + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +package org.tp23.antinstaller.util; + +import java.io.BufferedWriter; +import java.io.File; +import java.io.FileWriter; +import java.io.IOException; +import java.util.Date; +import java.util.Iterator; +import java.util.List; + +import org.tp23.antinstaller.Installer; +import org.tp23.antinstaller.PropertiesFileRenderer; +import org.tp23.antinstaller.input.CommentOutput; +import org.tp23.antinstaller.input.InputField; +import org.tp23.antinstaller.input.LargeSelectInput; +import org.tp23.antinstaller.input.OutputField; +import org.tp23.antinstaller.input.SecretPropertyField; +import org.tp23.antinstaller.input.ConditionalField; +import org.tp23.antinstaller.input.SelectInput; +import org.tp23.antinstaller.input.TargetSelectInput; +import org.tp23.antinstaller.input.SelectInput.Option; +import org.tp23.antinstaller.page.Page; + +/** + *

    Outputs the text from Pages as a Java Properties file. The file produced is compatible + * with java.util.Properties.

    + *

    It can be used as a stub for creating language packs, the default text is included as a guide but can be deleted

    + * @author Paul Hinds + */ +public class LangPackFileRenderer{ + + private static String newLine = System.getProperty("line.separator"); + private static final char[] hexidecimals = { '0', '1', '2', '3', '4', '5', '6', '7', '8', '9', 'A', 'B', 'C', 'D', 'E', 'F' }; + + public LangPackFileRenderer() { + } + + public void renderProperties(Installer installer, File baseDir, String locale) throws IOException { + Page[] pages = installer.getPages(); + + StringBuffer propertiesData = new StringBuffer(); + propertiesData.append("### Ant Installer - language pack auto generated on "); + propertiesData.append(new Date().toString()); + propertiesData.append(newLine); + propertiesData.append(newLine); + + propertiesData.append("finishButtonText = " + installer.getFinishButtonText()); + propertiesData.append(newLine); + propertiesData.append(newLine); + + String property = null; + String value = null; + + for (int i = 0; i < pages.length; i++) { + OutputField[] fields = pages[i].getOutputField(); + + propertiesData.append(newLine); + propertiesData.append("## Text from Page:" + pages[i].getName()); + propertiesData.append(newLine); + property = "page." + pages[i].getName() + ".displayText"; + value = convert(pages[i].getDisplayText(), false); + propertiesData.append(property + " = " + value); + propertiesData.append(newLine); + + retrievePropertiesData( fields, propertiesData ); + + } + // create the stub + if(locale != null) { + File languagePackStub = new File(baseDir.getAbsolutePath(), "LanguagePack_" + locale + ".properties"); + FileWriter fos = new FileWriter(languagePackStub); + BufferedWriter writer = new BufferedWriter(fos); + writer.write(propertiesData.toString()); + writer.flush(); + fos.close(); + } + else { + // create the default + File languagePack = new File(baseDir.getAbsolutePath(), "LanguagePack.properties"); + FileWriter fos = new FileWriter(languagePack); + BufferedWriter writer = new BufferedWriter(fos); + writer.write(propertiesData.toString()); + writer.flush(); + fos.close(); + } + } + + private void retrievePropertiesData( OutputField[] fields, StringBuffer propertiesData ) { + String property = null; + String value = null; + String explProperty = null; + String explValue = null; + + for (int f = 0; f < fields.length; f++) { + + // use getName() for comments + if(fields[f] instanceof CommentOutput){ + property = fields[f].getName() + ".displayText"; + value = convert(fields[f].getDisplayText(), false); + propertiesData.append(property + " = " + value); + propertiesData.append(newLine); + + if (fields[f].getExplanatoryText() != null && fields[f].getExplanatoryText().trim().length() > 0) { + explProperty = fields[f].getName() + ".explanatoryText"; + explValue = convert(fields[f].getExplanatoryText(), false); + propertiesData.append(explProperty + " = " + explValue); + propertiesData.append(newLine); + } + } + // use getProperty for input types + else { + InputField iField = (InputField)fields[f]; + property = iField.getProperty() + ".displayText"; + value = convert(iField.getDisplayText(), false); + propertiesData.append(property + " = " + value); + propertiesData.append(newLine); + if (iField.getExplanatoryText() != null && iField.getExplanatoryText().trim().length() > 0) { + explProperty = iField.getProperty() + ".explanatoryText"; + explValue = convert(iField.getExplanatoryText(), false); + propertiesData.append(explProperty + " = " + explValue); + propertiesData.append(newLine); + } + if(iField instanceof SelectInput) { + SelectInput selectInput = (SelectInput)iField; + for (int o = 0; o < selectInput.getOptions().length; o++) { + SelectInput.Option option = selectInput.getOptions()[o]; + property = selectInput.getProperty() + "." + (o + 1) + ".displayText"; + value = convert(option.getText(), false); + propertiesData.append(property + " = " + value); + propertiesData.append(newLine); + } + } + if(fields[f] instanceof LargeSelectInput) { + LargeSelectInput selectInput = (LargeSelectInput)iField; + for (int o = 0; o < selectInput.getOptions().length; o++) { + LargeSelectInput.Option option = selectInput.getOptions()[o]; + property = selectInput.getProperty() + "." + (o + 1) + ".displayText"; + value = convert(option.getText(), false); + propertiesData.append(property + " = " + value); + propertiesData.append(newLine); + } + } + } + } + } + + private String convert(String input, boolean doSpaces) { + if (input == null) { + // this happens when a page is skipped in text mode + return ""; + } + int num = input.length(); + StringBuffer sb = new StringBuffer(num); + + for (int i = 0; i < num; i++) { + char c = input.charAt(i); + switch (c) { + case ' ': + if (i == 0 || doSpaces) { + sb.append('\\'); + } + sb.append(' '); + break; + case '\n': + sb.append("\\n"); + break; + case '\r': + sb.append("\\r"); + break; + case '\\': + sb.append("\\\\"); + break; + case '\t': + sb.append("\\t"); + break; + case '\f': + sb.append("\\f"); + break; + case '=': + sb.append("\\="); + break; + case ':': + sb.append("\\:"); + break; + case '#': + sb.append("\\#"); + break; + case '!': + sb.append("\\!"); + break; + + default: + if ( (c < 0x0020) || (c > 0x007e) ) { + sb.append("\\u") + .append(hex( (c >> 12) & 0xF)) + .append(hex( (c >> 8) & 0xF)) + .append(hex( (c >> 4) & 0xF)) + .append(hex(c & 0xF)); + } + else { + sb.append(c); + } + } + } + return sb.toString(); + } + + private char hex(int val) { + return hexidecimals[ (val & 0xF)]; + } + +} Property changes on: pal-portal/modules/ant-installer/trunk/src_ext/org/tp23/antinstaller/util/LangPackFileRenderer.java ___________________________________________________________________ Name: svn:eol-style + native Added: pal-portal/modules/ant-installer/trunk/templates/defaultproject/README.txt =================================================================== --- pal-portal/modules/ant-installer/trunk/templates/defaultproject/README.txt (rev 0) +++ pal-portal/modules/ant-installer/trunk/templates/defaultproject/README.txt 2008-06-11 13:36:41 UTC (rev 975) @@ -0,0 +1,115 @@ +---+ Default Project Template Builder + +This template is a method of getting up and running with +AntInstaller quickly. The template will help you create +an installer for a Java project. + + +---++ Output + + * create-installer.xml - An ant build script to package the installer + * build.xml - An Ant script used by the installer + * antinstall-config.xml - The definition of the installer +All of the above can be edited to suit your needs + * Optionally the script will run the create-installer.xml Ant script to make the Jar immediately + + +---++ Usage + +Read this README first +Change directory to the location of this README file +Set the ANT_INSTALL_HOME variable to the directory where you have installed AntInstaller. +Set JAVA_HOME +> export ANT_INSTALL_HOME=/usr/local/AntInstaller-beta0.7.2 +Start the runtemplate.sh script +> ./runtemplate.sh +Follow the instructions + +---++ Project Structure + +AntInstaller launches and asks you for your project information +Generally it is assumed that your projects follow this structure + +/projects_root/ + +/projects_root/project-name/ + +for example if you use eclipse and CVS this will be +/workspace/cvs-module-name/ + +By default the template selects the following subdirectories +which can be modified. +/projects_root/project-name/src/ - source code +/projects_root/project-name/bin/ - scripts (these get chmod u+x) in the installer +/projects_root/project-name/doc/ - documentation +/projects_root/project-name/lib/ - Jars +/projects_root/project-name/classes/ - err... classes? + +The template only lets you select one directory for each, dont worry +AntInstaller itself is infinately configurable. + + +First time you run the script you should let the template +create a new empty directory for creating installers +/usr/local/installers/ +From this directory subdirectories will be created for each project +/usr/local/installers/project-name/ + +---++ Configuring the installer + +This template is NOT designed to create you the final installer you will +deploy. If you have a very simple standard project it may suffice, +but it is expected that you will want to modify the XML files created +to customise the build. + +Following the documentation on the web you can modify the +antinstall-config.xml file to add extra pages and collect extra input +when the user installs your application. +http://antinstaller.sourceforge.net + +The build.xml file can be modified to customise the install proces +that is run by AntInstaller on the users machine. +You have the full power of Ant so you can easily + * move files around + * replace text + * Zip Unzip + * run scripts + * call Java + * run sub ant build.xml files + * call SQL files via JDBC + * fix line ending s + * and anything in the CoreTypes in Ant. + +The create-installer.xml file is an Ant script that creates the installer +by modifying this file you can add extra resources to the final Jar +such as images that you want in the installer or extra source directories. +By adding Ant optional Jars to the installer you can then access any +additional features of Ant during the install enabling you to + * Call SSH or Telnet commands + * SCP/ FTP files + * Send emails + * and anything in the OptionaTypes in Ant + + + +---++ Contributions + +This tool itself (obviously) uses AntInstaller. +You are free to modify the scripts to extend the features of the tool. +If you do I would encourage you to submit the changes back so +everyone can benefit from your enhancement. +It is a good example of using AntInstaller to acheive tasks other +than just installing apps. + + + + + + + + + + + + + Property changes on: pal-portal/modules/ant-installer/trunk/templates/defaultproject/README.txt ___________________________________________________________________ Name: svn:eol-style + native Added: pal-portal/modules/ant-installer/trunk/templates/defaultproject/antinstall-config-template.xml =================================================================== --- pal-portal/modules/ant-installer/trunk/templates/defaultproject/antinstall-config-template.xml (rev 0) +++ pal-portal/modules/ant-installer/trunk/templates/defaultproject/antinstall-config-template.xml 2008-06-11 13:36:41 UTC (rev 975) @@ -0,0 +1,71 @@ + + + + + + + + + + + + + + + + + + + + + + + + Property changes on: pal-portal/modules/ant-installer/trunk/templates/defaultproject/antinstall-config-template.xml ___________________________________________________________________ Name: svn:eol-style + native Added: pal-portal/modules/ant-installer/trunk/templates/defaultproject/antinstall-config.xml =================================================================== --- pal-portal/modules/ant-installer/trunk/templates/defaultproject/antinstall-config.xml (rev 0) +++ pal-portal/modules/ant-installer/trunk/templates/defaultproject/antinstall-config.xml 2008-06-11 13:36:41 UTC (rev 975) @@ -0,0 +1,177 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + Property changes on: pal-portal/modules/ant-installer/trunk/templates/defaultproject/antinstall-config.xml ___________________________________________________________________ Name: svn:eol-style + native Added: pal-portal/modules/ant-installer/trunk/templates/defaultproject/build-self-extractor-template.sh =================================================================== --- pal-portal/modules/ant-installer/trunk/templates/defaultproject/build-self-extractor-template.sh (rev 0) +++ pal-portal/modules/ant-installer/trunk/templates/defaultproject/build-self-extractor-template.sh 2008-06-11 13:36:41 UTC (rev 975) @@ -0,0 +1,25 @@ +#!/bin/sh +dir=`expr match "$0" '\(.*\)build-self-extractor.sh'` +# if it we did not call ./ change to the directory we called +if [ "$dir" != "./" ] ; then + if [ "$dir" != "" ] ; then + echo changing to $dir + cd "$dir" ; + fi +fi + + + +if [ "$JAVA_HOME" = "" ] ; then + echo set JAVA_HOME; + exit 1; +fi + +# Ant classpath +ANT_INSTALLER_HOME=@ANT_INSTALL_ROOT@ +CLASSPATH=$ANT_INSTALLER_HOME/antlib/ant.jar +CLASSPATH=$CLASSPATH:$ANT_INSTALLER_HOME/antlib/xml-apis.jar +CLASSPATH=$CLASSPATH:$ANT_INSTALLER_HOME/antlib/xercesImpl.jar +CLASSPATH=$CLASSPATH:$ANT_INSTALLER_HOME/antlib/ant-launcher.jar + +$JAVA_HOME/bin/java -cp $CLASSPATH org.apache.tools.ant.Main -buildfile ./create-installer.xml Property changes on: pal-portal/modules/ant-installer/trunk/templates/defaultproject/build-self-extractor-template.sh ___________________________________________________________________ Name: svn:eol-style + native Added: pal-portal/modules/ant-installer/trunk/templates/defaultproject/build-template.xml =================================================================== --- pal-portal/modules/ant-installer/trunk/templates/defaultproject/build-template.xml (rev 0) +++ pal-portal/modules/ant-installer/trunk/templates/defaultproject/build-template.xml 2008-06-11 13:36:41 UTC (rev 975) @@ -0,0 +1,80 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + Property changes on: pal-portal/modules/ant-installer/trunk/templates/defaultproject/build-template.xml ___________________________________________________________________ Name: svn:eol-style + native Added: pal-portal/modules/ant-installer/trunk/templates/defaultproject/build.xml =================================================================== --- pal-portal/modules/ant-installer/trunk/templates/defaultproject/build.xml (rev 0) +++ pal-portal/modules/ant-installer/trunk/templates/defaultproject/build.xml 2008-06-11 13:36:41 UTC (rev 975) @@ -0,0 +1,143 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + Property changes on: pal-portal/modules/ant-installer/trunk/templates/defaultproject/build.xml ___________________________________________________________________ Name: svn:eol-style + native Added: pal-portal/modules/ant-installer/trunk/templates/defaultproject/cp/resources/makewavesdawn.png =================================================================== (Binary files differ) Property changes on: pal-portal/modules/ant-installer/trunk/templates/defaultproject/cp/resources/makewavesdawn.png ___________________________________________________________________ Name: svn:mime-type + image/png Added: pal-portal/modules/ant-installer/trunk/templates/defaultproject/create-installer-template.xml =================================================================== --- pal-portal/modules/ant-installer/trunk/templates/defaultproject/create-installer-template.xml (rev 0) +++ pal-portal/modules/ant-installer/trunk/templates/defaultproject/create-installer-template.xml 2008-06-11 13:36:41 UTC (rev 975) @@ -0,0 +1,81 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + Property changes on: pal-portal/modules/ant-installer/trunk/templates/defaultproject/create-installer-template.xml ___________________________________________________________________ Name: svn:eol-style + native Added: pal-portal/modules/ant-installer/trunk/templates/defaultproject/runtemplate.cmd =================================================================== --- pal-portal/modules/ant-installer/trunk/templates/defaultproject/runtemplate.cmd (rev 0) +++ pal-portal/modules/ant-installer/trunk/templates/defaultproject/runtemplate.cmd 2008-06-11 13:36:41 UTC (rev 975) @@ -0,0 +1,56 @@ + @ echo off + +if "%JAVA_HOME%" == "" goto nojava +if "%ANT_INSTALL_HOME%" == "" goto trydot + +goto setclasspath + +:trydot +if EXIST ..\..\lib\ant-installer.jar set ANT_INSTALL_HOME=..\.. +if NOT EXIST ..\..\lib\ant-installer.jar goto noai +echo ANT_INSTALL_HOME = %ANT_INSTALL_HOME% + +:setclasspath +REM Ant classpath +set CLASSPATH=%ANT_INSTALL_HOME%\antlib\ant.jar;%ANT_INSTALL_HOME%\antlib\ant-launcher.jar + +REM Images classpath +set CLASSPATH=%CLASSPATH%;.\cp +set CLASSPATH=%CLASSPATH%;..\..\images\navicons\amaranth + +REM XML classpath +set CLASSPATH=%CLASSPATH%;%ANT_INSTALL_HOME%\lib\xercesImpl.jar;%ANT_INSTALL_HOME%\lib\xml-apis.jar + +REM AntInstaller classpath +set CLASSPATH=%CLASSPATH%;%ANT_INSTALL_HOME%\lib\ant-installer.jar +set CLASSPATH=%CLASSPATH%;%ANT_INSTALL_HOME%\lib\jgoodies-edited-1_2_2.jar + +if "%1" == "text" goto settext +if "%1" == "swing" goto setswing +goto setswing + +:settext +set COMMAND=%JAVA_HOME%\bin\java +set INTERFACE=text +goto install + +:setswing +set COMMAND=%JAVA_HOME%\bin\javaw +set INTERFACE=swing +goto install + +:install +start "Antinstaller" "%COMMAND%" -classpath "%CLASSPATH%" org.tp23.antinstaller.runtime.ExecInstall %INTERFACE% . +goto end + +:nojava +echo set JAVA_HOME +echo you must install java to install this application +goto end + +:noai +echo set ANT_INSTALL_HOME +echo you must install AntInstaller to install this application +goto end + +:end \ No newline at end of file Property changes on: pal-portal/modules/ant-installer/trunk/templates/defaultproject/runtemplate.cmd ___________________________________________________________________ Name: svn:eol-style + native Added: pal-portal/modules/ant-installer/trunk/templates/defaultproject/runtemplate.sh =================================================================== --- pal-portal/modules/ant-installer/trunk/templates/defaultproject/runtemplate.sh (rev 0) +++ pal-portal/modules/ant-installer/trunk/templates/defaultproject/runtemplate.sh 2008-06-11 13:36:41 UTC (rev 975) @@ -0,0 +1,39 @@ +#!/bin/sh + +dir=`expr match "$0" '\(.*\)runtemplate.sh'` +# if it we did not call ./ change to the directory we called +if [ "$dir" != "./" ] ; then + if [ "$dir" != "" ] ; then + echo changing to $dir + cd "$dir" ; + fi +fi + +if [ "$ANT_INSTALL_HOME" == "" ] ; then + export ANT_INSTALL_HOME=../.. +fi + +if [ ! -f $ANT_INSTALL_HOME/lib/ant-installer.jar ] ; then + echo "set ANT_INSTALL_HOME" + exit 1; +fi + +if [ "$JAVA_HOME" = "" ] ; then + echo set JAVA_HOME; + exit 1; +fi + + +CLASSPATH=$ANT_INSTALL_HOME/lib/xercesImpl.jar:$ANT_INSTALL_HOME/lib/xml-apis.jar:$ANT_INSTALL_HOME/lib/ant-installer.jar:$ANT_INSTALL_HOME/lib/ai-icons-eclipse.jar +CLASSPATH=$CLASSPATH:$ANT_INSTALL_HOME/antlib/ant.jar:$ANT_INSTALL_HOME/antlib/ant-launcher.jar +CLASSPATH=$CLASSPATH:$ANT_INSTALL_HOME/lib/jgoodies-edited-1_2_2.jar +CLASSPATH=$CLASSPATH:./cp +CLASSPATH=$CLASSPATH:../../images/navicons/amaranth + +COMMAND=$JAVA_HOME/bin/java +INTERFACE=swing +if [ "$1" = "text" ] ; then + INTERFACE=text; +fi + +$COMMAND -classpath $CLASSPATH org.tp23.antinstaller.runtime.ExecInstall $INTERFACE . Property changes on: pal-portal/modules/ant-installer/trunk/templates/defaultproject/runtemplate.sh ___________________________________________________________________ Name: svn:executable + * Name: svn:eol-style + native Added: pal-portal/modules/ant-installer/trunk/windows-icons/AntInstaller.ico =================================================================== (Binary files differ) Property changes on: pal-portal/modules/ant-installer/trunk/windows-icons/AntInstaller.ico ___________________________________________________________________ Name: svn:mime-type + image/x-icon Added: pal-portal/modules/ant-installer/trunk/windows-icons/installIcons-docs.cmd =================================================================== --- pal-portal/modules/ant-installer/trunk/windows-icons/installIcons-docs.cmd (rev 0) +++ pal-portal/modules/ant-installer/trunk/windows-icons/installIcons-docs.cmd 2008-06-11 13:36:41 UTC (rev 975) @@ -0,0 +1,3 @@ + @ echo off +REM this batch file exists so that the parameters of this line are NOT quoted +rundll32 setupapi,InstallHinfSection DefaultInstall 128 @installDir@\windows-icons\installIcons-docs.inf Property changes on: pal-portal/modules/ant-installer/trunk/windows-icons/installIcons-docs.cmd ___________________________________________________________________ Name: svn:eol-style + native Added: pal-portal/modules/ant-installer/trunk/windows-icons/installIcons-docs.inf =================================================================== --- pal-portal/modules/ant-installer/trunk/windows-icons/installIcons-docs.inf (rev 0) +++ pal-portal/modules/ant-installer/trunk/windows-icons/installIcons-docs.inf 2008-06-11 13:36:41 UTC (rev 975) @@ -0,0 +1,11 @@ +[version] +signature="$chicago$" + +[DefaultInstall] +UpdateInis=Addlink + +[AddLink] +setup.ini, progman.groups,, "group0=AntInstaller" +setup.ini, group0,, ""AntInstaller"" +setup.ini, group0,, """AntInstaller Docs"",""cmd /c """"@installDir@\web\index.html"""""", ""@installDir@\AntInstaller.ico"",0," +setup.ini, group0,, """AntInstaller Wizard"",""cmd /c """"@installDir@\wizard.cmd"""""", ""@installDir@\AntInstaller.ico"",0," Added: pal-portal/modules/ant-installer/trunk/wizard.cmd =================================================================== --- pal-portal/modules/ant-installer/trunk/wizard.cmd (rev 0) +++ pal-portal/modules/ant-installer/trunk/wizard.cmd 2008-06-11 13:36:41 UTC (rev 975) @@ -0,0 +1,19 @@ + @ echo off + +if "%JAVA_HOME%" == "" goto nojava + +set DIR=%~dp0 +cd %DIR% + +cd .\templates\defaultproject +call runtemplate.cmd %1 +cd ..\.. +goto end + +:nojava +echo set JAVA_HOME +echo you must install java use the wizard +pause +goto end + +:end \ No newline at end of file Property changes on: pal-portal/modules/ant-installer/trunk/wizard.cmd ___________________________________________________________________ Name: svn:eol-style + native Added: pal-portal/modules/ant-installer/trunk/wizard.sh =================================================================== --- pal-portal/modules/ant-installer/trunk/wizard.sh (rev 0) +++ pal-portal/modules/ant-installer/trunk/wizard.sh 2008-06-11 13:36:41 UTC (rev 975) @@ -0,0 +1,11 @@ +#!/bin/sh + +dir=`expr match "$0" '\(.*\)wizard.sh'` +# if it we did not call ./ change to the directory we called +if [ "$dir" != "./" ] ; then + if [ "$dir" != "" ] ; then + echo changing to $dir + cd "$dir" ; + fi +fi +./templates/defaultproject/runtemplate.sh $1 Property changes on: pal-portal/modules/ant-installer/trunk/wizard.sh ___________________________________________________________________ Name: svn:executable + * Name: svn:eol-style + native From svnnotify @ sourceforge.jp Wed Jun 11 22:42:33 2008 From: svnnotify @ sourceforge.jp (svnnotify @ sourceforge.jp) Date: Wed, 11 Jun 2008 22:42:33 +0900 Subject: [pal-cvs 3242] [976] applied patches. Message-ID: <1213191753.489516.19894.nullmailer@users.sourceforge.jp> Revision: 976 http://svn.sourceforge.jp/cgi-bin/viewcvs.cgi?root=pal&view=rev&rev=976 Author: shinsuke Date: 2008-06-11 22:42:33 +0900 (Wed, 11 Jun 2008) Log Message: ----------- applied patches. palportal has already used them. Modified Paths: -------------- pal-portal/modules/ant-installer/trunk/src/org/tp23/antinstaller/input/OutputField.java pal-portal/modules/ant-installer/trunk/src/org/tp23/antinstaller/renderer/Res.properties pal-portal/modules/ant-installer/trunk/src/org/tp23/antinstaller/runtime/exe/ExecuteRunnerFilter.java pal-portal/modules/ant-installer/trunk/src/org/tp23/antinstaller/runtime/exe/PropertyLoaderFilter.java -------------- next part -------------- Modified: pal-portal/modules/ant-installer/trunk/src/org/tp23/antinstaller/input/OutputField.java =================================================================== --- pal-portal/modules/ant-installer/trunk/src/org/tp23/antinstaller/input/OutputField.java 2008-06-11 13:36:41 UTC (rev 975) +++ pal-portal/modules/ant-installer/trunk/src/org/tp23/antinstaller/input/OutputField.java 2008-06-11 13:42:33 UTC (rev 976) @@ -65,7 +65,9 @@ public String getDisplayText() { if(langPack != null){ +try{ return langPack.getString(getName() + ".displayText"); +}catch(Exception e){} } return displayText; } Modified: pal-portal/modules/ant-installer/trunk/src/org/tp23/antinstaller/renderer/Res.properties =================================================================== --- pal-portal/modules/ant-installer/trunk/src/org/tp23/antinstaller/renderer/Res.properties 2008-06-11 13:36:41 UTC (rev 975) +++ pal-portal/modules/ant-installer/trunk/src/org/tp23/antinstaller/renderer/Res.properties 2008-06-11 13:42:33 UTC (rev 976) @@ -46,3 +46,4 @@ license.next.text=Accept license.cancel.text=Reject +installAborted=Install Aborted. Modified: pal-portal/modules/ant-installer/trunk/src/org/tp23/antinstaller/runtime/exe/ExecuteRunnerFilter.java =================================================================== --- pal-portal/modules/ant-installer/trunk/src/org/tp23/antinstaller/runtime/exe/ExecuteRunnerFilter.java 2008-06-11 13:36:41 UTC (rev 975) +++ pal-portal/modules/ant-installer/trunk/src/org/tp23/antinstaller/runtime/exe/ExecuteRunnerFilter.java 2008-06-11 13:42:33 UTC (rev 976) @@ -15,6 +15,8 @@ */ package org.tp23.antinstaller.runtime.exe; +import java.util.ResourceBundle; + import org.tp23.antinstaller.InstallException; import org.tp23.antinstaller.InstallerContext; @@ -26,6 +28,8 @@ */ public class ExecuteRunnerFilter implements ExecuteFilter { + private static final ResourceBundle res = ResourceBundle.getBundle("org.tp23.antinstaller.renderer.Res"); + /** * @see org.tp23.antinstaller.runtime.exe.ExecuteFilter#exec(org.tp23.antinstaller.InstallerContext) */ @@ -35,7 +39,7 @@ } boolean ok = ctx.getRunner().runInstaller(); if(!ok){ - throw new AbortException("Install Aborted"); + throw new AbortException(res.getString("installAborted")); } ctx.log("Install screens rendered"); } Modified: pal-portal/modules/ant-installer/trunk/src/org/tp23/antinstaller/runtime/exe/PropertyLoaderFilter.java =================================================================== --- pal-portal/modules/ant-installer/trunk/src/org/tp23/antinstaller/runtime/exe/PropertyLoaderFilter.java 2008-06-11 13:36:41 UTC (rev 975) +++ pal-portal/modules/ant-installer/trunk/src/org/tp23/antinstaller/runtime/exe/PropertyLoaderFilter.java 2008-06-11 13:42:33 UTC (rev 976) @@ -140,7 +140,7 @@ ctx.isAutoBuild() && PROMPT.equals(loadDefaults) ) { ctx.log( "Cant run -auto install without properties"); - throw new AbortException("Install Aborted: cant load ant.install.properties"); + throw new AbortException(res.getString("installAborted") + ": cant load ant.install.properties"); } if(load) { @@ -159,17 +159,17 @@ // let major versions pass but prompt for differences if( (! ctx.isAutoBuild()) && helper.majorVersionCompatible(configVersion , propertiesVersion) ){ if( ! ctx.getMessageRenderer().prompt(res.getString("propertiesVersionMismatch")) ){ - throw new AbortException("Install Aborted: existing configuration is not compatible, config version: " + configVersion); + throw new AbortException(res.getString("installAborted") + ": existing configuration is not compatible, config version: " + configVersion); } } else { - throw new AbortException("Install Aborted: existing configuration is not compatible, config version: " + configVersion); + throw new AbortException(res.getString("installAborted") + ": existing configuration is not compatible, config version: " + configVersion); } } } else { - throw new AbortException("Install Aborted: local ant.install.properties missing config version, must be equal or lower than: " + configVersion); + throw new AbortException(res.getString("installAborted") + ": local ant.install.properties missing config version, must be equal or lower than: " + configVersion); } // end version control From svnnotify @ sourceforge.jp Thu Jun 12 17:13:46 2008 From: svnnotify @ sourceforge.jp (svnnotify @ sourceforge.jp) Date: Thu, 12 Jun 2008 17:13:46 +0900 Subject: [pal-cvs 3243] [977] added ja file. Message-ID: <1213258426.320011.8873.nullmailer@users.sourceforge.jp> Revision: 977 http://svn.sourceforge.jp/cgi-bin/viewcvs.cgi?root=pal&view=rev&rev=977 Author: shinsuke Date: 2008-06-12 17:13:46 +0900 (Thu, 12 Jun 2008) Log Message: ----------- added ja file. Added Paths: ----------- pal-portal/modules/ant-installer/trunk/src/org/tp23/antinstaller/renderer/Res_ja.properties -------------- next part -------------- Added: pal-portal/modules/ant-installer/trunk/src/org/tp23/antinstaller/renderer/Res_ja.properties =================================================================== --- pal-portal/modules/ant-installer/trunk/src/org/tp23/antinstaller/renderer/Res_ja.properties (rev 0) +++ pal-portal/modules/ant-installer/trunk/src/org/tp23/antinstaller/renderer/Res_ja.properties 2008-06-12 08:13:46 UTC (rev 977) @@ -0,0 +1,50 @@ +#org.tp23.antinstaller.renderer.Res +#Wed Nov 10 01:06:42 CET 2004 + +dirNotExistCreate=\u30c7\u30a3\u30ec\u30af\u30c8\u30ea\u3092\u4f5c\u6210\u3057\u307e\u3059\u304b? +dirNotExist=\u30c7\u30a3\u30ec\u30af\u30c8\u30ea\u304c\u5b58\u5728\u3057\u307e\u305b\u3093\u3002 +fileNotExist=\u30d5\u30a1\u30a4\u30eb\u304c\u5b58\u5728\u3057\u307e\u305b\u3093\u3002 +dirNotCreated=\u30c7\u30a3\u30ec\u30af\u30c8\u30ea\u3092\u4f5c\u6210\u3067\u304d\u307e\u305b\u3093\u3067\u3057\u305f\u3002 +canNotCreateFile=\u30d5\u30a1\u30a4\u30eb\u3092\u4f5c\u6210\u3067\u304d\u307e\u305b\u3093\u3002 +appRootInvalid=\u3053\u306e\u30c7\u30a3\u30ec\u30af\u30c8\u30ea\u306f\u3001\u30a2\u30d7\u30ea\u30b1\u30fc\u30b7\u30e7\u30f3\u306e\u30eb\u30fc\u30c8\u306b\u3042\u308a\u307e\u305b\u3093\u3002 +selectFile=\u30d5\u30a1\u30a4\u30eb\u306e\u9078\u629e +selectFolder=\u30d5\u30a9\u30eb\u30c0\u306e\u9078\u629e +notValidSelection=\u9078\u629e\u304c\u6b63\u3057\u304f\u3042\u308a\u307e\u305b\u3093\u3002 +showDetails=\u8a73\u7d30\u306e\u8868\u793a + +#Default loading +promptLoadDefaults=\u30a4\u30f3\u30b9\u30c8\u30fc\u30eb\u8a2d\u5b9a\u304c\u898b\u3064\u304b\u308a\u307e\u3057\u305f\u3002\u65e2\u5b58\u306e\u8a2d\u5b9a\u3092\u8aad\u307f\u8fbc\u307f\u307e\u3059\u304b? +promptMissingDefaultPassword=\u30d1\u30b9\u30ef\u30fc\u30c9\u304c\u898b\u3064\u304b\u308a\u307e\u305b\u3093\u3002\u30bb\u30ad\u30e5\u30ea\u30c6\u30a3\u4e0a\u306e\u7406\u7531\u3067\u7701\u7565\u3055\u308c\u305f\u5834\u5408\u306f\u3001\u30c7\u30d5\u30a9\u30eb\u30c8\u5024\u304c\u8a2d\u5b9a\u3055\u308c\u307e\u3059\u3002 + +click=\u7d9a\u884c\u3059\u308b\u305f\u3081\u306b\u306f +toContinue=\u3092\u30af\u30ea\u30c3\u30af +failed=\u5931\u6557 +exit=\u7d42\u4e86 +complete=\u5b8c\u4e86 +finished=\u5b8c\u4e86\u3057\u307e\u3057\u305f\u3002 +extracting=\u5c55\u958b\u4e2d... +installFinished=\u30a4\u30f3\u30b9\u30c8\u30fc\u30eb\u5b8c\u4e86 +running=\u5b9f\u884c\u4e2d: + +backButton=\u623b\u308b +cancelButton=\u30ad\u30e3\u30f3\u30bb\u30eb +nextButton=\u6b21\u3078 + +output=\u51fa\u529b +errors=\u30a8\u30e9\u30fc +notCorrectFormat=\u30d5\u30a3\u30fc\u30eb\u30c9\u304c\u6b63\u3057\u3044\u30d5\u30a9\u30fc\u30de\u30c3\u30c8\u3067\u306f\u3042\u308a\u307e\u305b\u3093\u3002 +notCorrectPasswordFormat=\u30d1\u30b9\u30ef\u30fc\u30c9\u304c\u6b63\u3057\u3044\u30d5\u30a9\u30fc\u30de\u30c3\u30c8\u3067\u306f\u3042\u308a\u307e\u305b\u3093\u3002 +passwordsDoNotMatch=\u30d1\u30b9\u30ef\u30fc\u30c9\u304c\u4e00\u81f4\u3057\u307e\u305b\u3093\u3002 +installationFailed=\u30a4\u30f3\u30b9\u30c8\u30fc\u30eb\u5931\u6557 +propertiesVersionMismatch=\u524d\u30d0\u30fc\u30b8\u30e7\u30f3\u304b\u3089\u3044\u304f\u3064\u304b\u306e\u30aa\u30d7\u30b7\u30e7\u30f3\u304c\u3042\u308a\u307e\u305b\u3093\u3002\u624b\u52d5\u3067\u5165\u529b\u3057\u3066\u3001\u7d99\u7d9a\u3057\u307e\u3059\u304b? + +Finished=\u5b8c\u4e86\u3057\u307e\u3057\u305f\u3002 +Failed=\u5931\u6557\u3057\u307e\u3057\u305f\u3002\u30a8\u30e9\u30fc\u3092\u78ba\u8a8d\u3057\u3066\u304f\u3060\u3055\u3044\u3002 +ant.failure=Ant \u306e\u5b9f\u884c\u306b\u5931\u6557\u3057\u307e\u3057\u305f\u3002\u8a73\u7d30\u306f\u30a8\u30e9\u30fc\u30ed\u30b0\u3092\u78ba\u8a8d\u3057\u3066\u304f\u3060\u3055\u3044\u3002 + +#Text for license page buttons +license.next.text=\u540c\u610f\u3059\u308b +license.cancel.text=\u540c\u610f\u3057\u306a\u3044 + +installAborted=\u30a4\u30f3\u30b9\u30c8\u30fc\u30eb\u3092\u7d42\u4e86\u3057\u307e\u3057\u305f\u3002 + Property changes on: pal-portal/modules/ant-installer/trunk/src/org/tp23/antinstaller/renderer/Res_ja.properties ___________________________________________________________________ Name: svn:eol-style + native From svnnotify @ sourceforge.jp Thu Jun 12 18:21:33 2008 From: svnnotify @ sourceforge.jp (svnnotify @ sourceforge.jp) Date: Thu, 12 Jun 2008 18:21:33 +0900 Subject: [pal-cvs 3244] [978] supported license file encoded by utf-8. Message-ID: <1213262493.047951.474.nullmailer@users.sourceforge.jp> Revision: 978 http://svn.sourceforge.jp/cgi-bin/viewcvs.cgi?root=pal&view=rev&rev=978 Author: shinsuke Date: 2008-06-12 18:21:32 +0900 (Thu, 12 Jun 2008) Log Message: ----------- supported license file encoded by utf-8. Modified Paths: -------------- pal-portal/modules/ant-installer/trunk/lib/ant-installer-ext.jar pal-portal/modules/ant-installer/trunk/lib/ant-installer.jar pal-portal/modules/ant-installer/trunk/src/org/tp23/antinstaller/renderer/swing/LicensePageRenderer.java pal-portal/modules/ant-installer/trunk/src/org/tp23/antinstaller/renderer/text/LicensePageRenderer.java -------------- next part -------------- Modified: pal-portal/modules/ant-installer/trunk/lib/ant-installer-ext.jar =================================================================== (Binary files differ) Modified: pal-portal/modules/ant-installer/trunk/lib/ant-installer.jar =================================================================== (Binary files differ) Modified: pal-portal/modules/ant-installer/trunk/src/org/tp23/antinstaller/renderer/swing/LicensePageRenderer.java =================================================================== --- pal-portal/modules/ant-installer/trunk/src/org/tp23/antinstaller/renderer/swing/LicensePageRenderer.java 2008-06-12 08:13:46 UTC (rev 977) +++ pal-portal/modules/ant-installer/trunk/src/org/tp23/antinstaller/renderer/swing/LicensePageRenderer.java 2008-06-12 09:21:32 UTC (rev 978) @@ -60,7 +60,7 @@ if (licensein == null) { throw new ConfigurationException("License resource '" + resource + "' is missing from installer"); } - BufferedReader reader = new BufferedReader(new InputStreamReader(licensein)); + BufferedReader reader = new BufferedReader(new InputStreamReader(licensein, "UTF-8")); StringBuffer sb = new StringBuffer(); String line; while((line = reader.readLine()) != null){ Modified: pal-portal/modules/ant-installer/trunk/src/org/tp23/antinstaller/renderer/text/LicensePageRenderer.java =================================================================== --- pal-portal/modules/ant-installer/trunk/src/org/tp23/antinstaller/renderer/text/LicensePageRenderer.java 2008-06-12 08:13:46 UTC (rev 977) +++ pal-portal/modules/ant-installer/trunk/src/org/tp23/antinstaller/renderer/text/LicensePageRenderer.java 2008-06-12 09:21:32 UTC (rev 978) @@ -62,7 +62,7 @@ if (licensein == null) { throw new ConfigurationException("License resource '" + resource + "' is missing from installer"); } - BufferedReader reader = new BufferedReader(new InputStreamReader(licensein)); + BufferedReader reader = new BufferedReader(new InputStreamReader(licensein, "UTF-8")); printHeader(page); String lineread = null; StringBuffer sb = new StringBuffer(); From svnnotify @ sourceforge.jp Thu Jun 12 18:22:06 2008 From: svnnotify @ sourceforge.jp (svnnotify @ sourceforge.jp) Date: Thu, 12 Jun 2008 18:22:06 +0900 Subject: [pal-cvs 3245] [979] supported license file encoded by utf-8. Message-ID: <1213262526.260492.1562.nullmailer@users.sourceforge.jp> Revision: 979 http://svn.sourceforge.jp/cgi-bin/viewcvs.cgi?root=pal&view=rev&rev=979 Author: shinsuke Date: 2008-06-12 18:22:06 +0900 (Thu, 12 Jun 2008) Log Message: ----------- supported license file encoded by utf-8. Modified Paths: -------------- pal-portal/branches/pal-portal-1.x/installer/etc/ant-installer/lib/ant-installer.jar -------------- next part -------------- Modified: pal-portal/branches/pal-portal-1.x/installer/etc/ant-installer/lib/ant-installer.jar =================================================================== (Binary files differ) From svnnotify @ sourceforge.jp Fri Jun 13 15:38:07 2008 From: svnnotify @ sourceforge.jp (svnnotify @ sourceforge.jp) Date: Fri, 13 Jun 2008 15:38:07 +0900 Subject: [pal-cvs 3246] [980] replaced with FolderSecurityConstraint. Message-ID: <1213339087.559821.21723.nullmailer@users.sourceforge.jp> Revision: 980 http://svn.sourceforge.jp/cgi-bin/viewcvs.cgi?root=pal&view=rev&rev=980 Author: shinsuke Date: 2008-06-13 15:38:06 +0900 (Fri, 13 Jun 2008) Log Message: ----------- replaced with FolderSecurityConstraint. Modified Paths: -------------- pal-admin/trunk/src/main/java/jp/sf/pal/admin/service/UserRegistrationService.java -------------- next part -------------- Modified: pal-admin/trunk/src/main/java/jp/sf/pal/admin/service/UserRegistrationService.java =================================================================== --- pal-admin/trunk/src/main/java/jp/sf/pal/admin/service/UserRegistrationService.java 2008-06-12 09:22:06 UTC (rev 979) +++ pal-admin/trunk/src/main/java/jp/sf/pal/admin/service/UserRegistrationService.java 2008-06-13 06:38:06 UTC (rev 980) @@ -201,7 +201,7 @@ // set security constraint String userhome = Folder.USER_FOLDER + page.getUserName(); PageManager pageManager = PortalComponentUtil.getPageManager(); - SecurityConstraint sc = pageManager.newPageSecurityConstraint(); + SecurityConstraint sc = pageManager.newFolderSecurityConstraint(); sc.setUsers(PALAdminUtil.parseCSVList(page.getUserName())); List permissions = new ArrayList(); permissions.add(JetspeedActions.VIEW); From svnnotify @ sourceforge.jp Fri Jun 13 15:42:35 2008 From: svnnotify @ sourceforge.jp (svnnotify @ sourceforge.jp) Date: Fri, 13 Jun 2008 15:42:35 +0900 Subject: [pal-cvs 3247] [981] replaced with FolderSecurityConstraint. Message-ID: <1213339355.933582.6784.nullmailer@users.sourceforge.jp> Revision: 981 http://svn.sourceforge.jp/cgi-bin/viewcvs.cgi?root=pal&view=rev&rev=981 Author: shinsuke Date: 2008-06-13 15:42:35 +0900 (Fri, 13 Jun 2008) Log Message: ----------- replaced with FolderSecurityConstraint. Modified Paths: -------------- pal-admin/tags/pal-admin-1.1/src/main/java/jp/sf/pal/admin/service/UserRegistrationService.java -------------- next part -------------- Modified: pal-admin/tags/pal-admin-1.1/src/main/java/jp/sf/pal/admin/service/UserRegistrationService.java =================================================================== --- pal-admin/tags/pal-admin-1.1/src/main/java/jp/sf/pal/admin/service/UserRegistrationService.java 2008-06-13 06:38:06 UTC (rev 980) +++ pal-admin/tags/pal-admin-1.1/src/main/java/jp/sf/pal/admin/service/UserRegistrationService.java 2008-06-13 06:42:35 UTC (rev 981) @@ -201,7 +201,7 @@ // set security constraint String userhome = Folder.USER_FOLDER + page.getUserName(); PageManager pageManager = PortalComponentUtil.getPageManager(); - SecurityConstraint sc = pageManager.newPageSecurityConstraint(); + SecurityConstraint sc = pageManager.newFolderSecurityConstraint(); sc.setUsers(PALAdminUtil.parseCSVList(page.getUserName())); List permissions = new ArrayList(); permissions.add(JetspeedActions.VIEW); From svnnotify @ sourceforge.jp Fri Jun 13 17:56:04 2008 From: svnnotify @ sourceforge.jp (svnnotify @ sourceforge.jp) Date: Fri, 13 Jun 2008 17:56:04 +0900 Subject: [pal-cvs 3248] [982] derby does not support a comparison of long varchar. Message-ID: <1213347364.227507.18981.nullmailer@users.sourceforge.jp> Revision: 982 http://svn.sourceforge.jp/cgi-bin/viewcvs.cgi?root=pal&view=rev&rev=982 Author: shinsuke Date: 2008-06-13 17:56:04 +0900 (Fri, 13 Jun 2008) Log Message: ----------- derby does not support a comparison of long varchar. Modified Paths: -------------- pal-portal/branches/pal-portal-1.x/portal/jetspeed-2/components/portal/src/java/org/apache/jetspeed/administration/PortalAdministrationImpl.java -------------- next part -------------- Modified: pal-portal/branches/pal-portal-1.x/portal/jetspeed-2/components/portal/src/java/org/apache/jetspeed/administration/PortalAdministrationImpl.java =================================================================== --- pal-portal/branches/pal-portal-1.x/portal/jetspeed-2/components/portal/src/java/org/apache/jetspeed/administration/PortalAdministrationImpl.java 2008-06-13 06:42:35 UTC (rev 981) +++ pal-portal/branches/pal-portal-1.x/portal/jetspeed-2/components/portal/src/java/org/apache/jetspeed/administration/PortalAdministrationImpl.java 2008-06-13 08:56:04 UTC (rev 982) @@ -459,11 +459,23 @@ private static final String USER_NOT_FOUND_FROM_EMAIL = "User not found for Email address: "; + private static final String COULD_NOT_EXECUTE_LOOKUP_PROCESS = "Could not execute a lookup process: "; + public User lookupUserFromEmail(String email) throws AdministrationEmailException { - Collection result = preferences.lookupPreference("userinfo", - "user.business-info.online.email", email); + Collection result = null; + try + { + result = preferences.lookupPreference("userinfo", + "user.business-info.online.email", email); + } + catch (Exception e) + { + // Derby does not support a comparison of LONG VARCHAR. + throw new AdministrationEmailException( + COULD_NOT_EXECUTE_LOOKUP_PROCESS + email, e); + } if (result.size() == 0) { throw new AdministrationEmailException( USER_NOT_FOUND_FROM_EMAIL + email); } Iterator nodes = result.iterator(); From svnnotify @ sourceforge.jp Fri Jun 13 21:54:48 2008 From: svnnotify @ sourceforge.jp (svnnotify @ sourceforge.jp) Date: Fri, 13 Jun 2008 21:54:48 +0900 Subject: [pal-cvs 3249] [983] version 1.0.5 Message-ID: <1213361688.101692.21990.nullmailer@users.sourceforge.jp> Revision: 983 http://svn.sourceforge.jp/cgi-bin/viewcvs.cgi?root=pal&view=rev&rev=983 Author: shinsuke Date: 2008-06-13 21:54:47 +0900 (Fri, 13 Jun 2008) Log Message: ----------- version 1.0.5 Added Paths: ----------- pal-portal/tags/pal-portal-1.0.5/ -------------- next part -------------- Copied: pal-portal/tags/pal-portal-1.0.5 (from rev 982, pal-portal/branches/pal-portal-1.x) From svnnotify @ sourceforge.jp Sat Jun 14 07:58:21 2008 From: svnnotify @ sourceforge.jp (svnnotify @ sourceforge.jp) Date: Sat, 14 Jun 2008 07:58:21 +0900 Subject: [pal-cvs 3250] [984] replaced with varchar. Message-ID: <1213397901.050256.31245.nullmailer@users.sourceforge.jp> Revision: 984 http://svn.sourceforge.jp/cgi-bin/viewcvs.cgi?root=pal&view=rev&rev=984 Author: shinsuke Date: 2008-06-14 07:58:20 +0900 (Sat, 14 Jun 2008) Log Message: ----------- replaced with varchar. Modified Paths: -------------- pal-portal/branches/pal-portal-1.x/portal/jetspeed-2/etc/sql/derby/schema/prefs-schema.sql -------------- next part -------------- Modified: pal-portal/branches/pal-portal-1.x/portal/jetspeed-2/etc/sql/derby/schema/prefs-schema.sql =================================================================== --- pal-portal/branches/pal-portal-1.x/portal/jetspeed-2/etc/sql/derby/schema/prefs-schema.sql 2008-06-13 12:54:47 UTC (rev 983) +++ pal-portal/branches/pal-portal-1.x/portal/jetspeed-2/etc/sql/derby/schema/prefs-schema.sql 2008-06-13 22:58:20 UTC (rev 984) @@ -43,7 +43,7 @@ PROPERTY_VALUE_ID INTEGER NOT NULL, NODE_ID INTEGER, PROPERTY_NAME VARCHAR(100), - PROPERTY_VALUE LONG VARCHAR, + PROPERTY_VALUE VARCHAR(32672), CREATION_DATE TIMESTAMP, MODIFIED_DATE TIMESTAMP, PRIMARY KEY(PROPERTY_VALUE_ID), From svnnotify @ sourceforge.jp Sat Jun 14 08:07:27 2008 From: svnnotify @ sourceforge.jp (svnnotify @ sourceforge.jp) Date: Sat, 14 Jun 2008 08:07:27 +0900 Subject: [pal-cvs 3251] [985] replaced with varchar. Message-ID: <1213398447.675976.4615.nullmailer@users.sourceforge.jp> Revision: 985 http://svn.sourceforge.jp/cgi-bin/viewcvs.cgi?root=pal&view=rev&rev=985 Author: shinsuke Date: 2008-06-14 08:07:27 +0900 (Sat, 14 Jun 2008) Log Message: ----------- replaced with varchar. Modified Paths: -------------- pal-portal/tags/pal-portal-1.0.5/portal/jetspeed-2/etc/sql/derby/schema/prefs-schema.sql -------------- next part -------------- Modified: pal-portal/tags/pal-portal-1.0.5/portal/jetspeed-2/etc/sql/derby/schema/prefs-schema.sql =================================================================== --- pal-portal/tags/pal-portal-1.0.5/portal/jetspeed-2/etc/sql/derby/schema/prefs-schema.sql 2008-06-13 22:58:20 UTC (rev 984) +++ pal-portal/tags/pal-portal-1.0.5/portal/jetspeed-2/etc/sql/derby/schema/prefs-schema.sql 2008-06-13 23:07:27 UTC (rev 985) @@ -43,7 +43,7 @@ PROPERTY_VALUE_ID INTEGER NOT NULL, NODE_ID INTEGER, PROPERTY_NAME VARCHAR(100), - PROPERTY_VALUE LONG VARCHAR, + PROPERTY_VALUE VARCHAR(32672), CREATION_DATE TIMESTAMP, MODIFIED_DATE TIMESTAMP, PRIMARY KEY(PROPERTY_VALUE_ID), From svnnotify @ sourceforge.jp Sun Jun 15 07:34:51 2008 From: svnnotify @ sourceforge.jp (svnnotify @ sourceforge.jp) Date: Sun, 15 Jun 2008 07:34:51 +0900 Subject: [pal-cvs 3252] [986] normalized path. Message-ID: <1213482891.338808.28577.nullmailer@users.sourceforge.jp> Revision: 986 http://svn.sourceforge.jp/cgi-bin/viewcvs.cgi?root=pal&view=rev&rev=986 Author: shinsuke Date: 2008-06-15 07:34:51 +0900 (Sun, 15 Jun 2008) Log Message: ----------- normalized path. Modified Paths: -------------- pal-portal/branches/pal-portal-1.x/portal/jetspeed-2/components/page-manager/src/java/org/apache/jetspeed/page/document/impl/NodeImpl.java -------------- next part -------------- Modified: pal-portal/branches/pal-portal-1.x/portal/jetspeed-2/components/page-manager/src/java/org/apache/jetspeed/page/document/impl/NodeImpl.java =================================================================== --- pal-portal/branches/pal-portal-1.x/portal/jetspeed-2/components/page-manager/src/java/org/apache/jetspeed/page/document/impl/NodeImpl.java 2008-06-13 23:07:27 UTC (rev 985) +++ pal-portal/branches/pal-portal-1.x/portal/jetspeed-2/components/page-manager/src/java/org/apache/jetspeed/page/document/impl/NodeImpl.java 2008-06-14 22:34:51 UTC (rev 986) @@ -98,7 +98,8 @@ { path = path.substring(0, path.length() - 1); } - return path; + // normalized path + return path.replaceAll("/+", "/"); } /** From svnnotify @ sourceforge.jp Sun Jun 15 07:41:36 2008 From: svnnotify @ sourceforge.jp (svnnotify @ sourceforge.jp) Date: Sun, 15 Jun 2008 07:41:36 +0900 Subject: [pal-cvs 3253] [987] normalized path. Message-ID: <1213483296.513712.946.nullmailer@users.sourceforge.jp> Revision: 987 http://svn.sourceforge.jp/cgi-bin/viewcvs.cgi?root=pal&view=rev&rev=987 Author: shinsuke Date: 2008-06-15 07:41:36 +0900 (Sun, 15 Jun 2008) Log Message: ----------- normalized path. Modified Paths: -------------- pal-portal/tags/pal-portal-1.0.5/portal/jetspeed-2/components/page-manager/src/java/org/apache/jetspeed/page/document/impl/NodeImpl.java -------------- next part -------------- Modified: pal-portal/tags/pal-portal-1.0.5/portal/jetspeed-2/components/page-manager/src/java/org/apache/jetspeed/page/document/impl/NodeImpl.java =================================================================== --- pal-portal/tags/pal-portal-1.0.5/portal/jetspeed-2/components/page-manager/src/java/org/apache/jetspeed/page/document/impl/NodeImpl.java 2008-06-14 22:34:51 UTC (rev 986) +++ pal-portal/tags/pal-portal-1.0.5/portal/jetspeed-2/components/page-manager/src/java/org/apache/jetspeed/page/document/impl/NodeImpl.java 2008-06-14 22:41:36 UTC (rev 987) @@ -98,7 +98,8 @@ { path = path.substring(0, path.length() - 1); } - return path; + // normalized path + return path.replaceAll("/+", "/"); } /** From svnnotify @ sourceforge.jp Mon Jun 16 07:37:56 2008 From: svnnotify @ sourceforge.jp (svnnotify @ sourceforge.jp) Date: Mon, 16 Jun 2008 07:37:56 +0900 Subject: [pal-cvs 3254] [988] version 1.0.6-dev Message-ID: <1213569476.433314.9778.nullmailer@users.sourceforge.jp> Revision: 988 http://svn.sourceforge.jp/cgi-bin/viewcvs.cgi?root=pal&view=rev&rev=988 Author: shinsuke Date: 2008-06-16 07:37:55 +0900 (Mon, 16 Jun 2008) Log Message: ----------- version 1.0.6-dev Modified Paths: -------------- pal-portal/branches/pal-portal-1.x/build.properties -------------- next part -------------- Modified: pal-portal/branches/pal-portal-1.x/build.properties =================================================================== --- pal-portal/branches/pal-portal-1.x/build.properties 2008-06-14 22:41:36 UTC (rev 987) +++ pal-portal/branches/pal-portal-1.x/build.properties 2008-06-15 22:37:55 UTC (rev 988) @@ -4,7 +4,7 @@ container.name=PAL Portal container.separator=/ container.version.major=1 -container.version.minor=0.5 +container.version.minor=0.6-dev container.info.file=commons/src/java/org/apache/jetspeed/container/resources/ContainerInfo.properties override.prop.file=src/webapp/WEB-INF/conf/override.properties portlets.home=${basedir}/portlets From svnnotify @ sourceforge.jp Tue Jun 17 22:05:32 2008 From: svnnotify @ sourceforge.jp (svnnotify @ sourceforge.jp) Date: Tue, 17 Jun 2008 22:05:32 +0900 Subject: [pal-cvs 3255] [989] removed unused jar. Message-ID: <1213707932.485780.17020.nullmailer@users.sourceforge.jp> Revision: 989 http://svn.sourceforge.jp/cgi-bin/viewcvs.cgi?root=pal&view=rev&rev=989 Author: shinsuke Date: 2008-06-17 22:05:32 +0900 (Tue, 17 Jun 2008) Log Message: ----------- removed unused jar. Modified Paths: -------------- pal-portal/branches/pal-portal-1.x/portal/jetspeed-2/.classpath -------------- next part -------------- Modified: pal-portal/branches/pal-portal-1.x/portal/jetspeed-2/.classpath =================================================================== --- pal-portal/branches/pal-portal-1.x/portal/jetspeed-2/.classpath 2008-06-15 22:37:55 UTC (rev 988) +++ pal-portal/branches/pal-portal-1.x/portal/jetspeed-2/.classpath 2008-06-17 13:05:32 UTC (rev 989) @@ -47,7 +47,7 @@ - + @@ -59,7 +59,7 @@ - + @@ -87,23 +87,13 @@ - - - - - - - - - - From svnnotify @ sourceforge.jp Wed Jun 18 14:39:49 2008 From: svnnotify @ sourceforge.jp (svnnotify @ sourceforge.jp) Date: Wed, 18 Jun 2008 14:39:49 +0900 Subject: [pal-cvs 3256] [990] fix login page for firefox3 Message-ID: <1213767589.504858.1110.nullmailer@users.sourceforge.jp> Revision: 990 http://svn.sourceforge.jp/cgi-bin/viewcvs.cgi?root=pal&view=rev&rev=990 Author: sone Date: 2008-06-18 14:39:49 +0900 (Wed, 18 Jun 2008) Log Message: ----------- fix login page for firefox3 Modified Paths: -------------- pal-portal/branches/pal-portal-1.x/portal/jetspeed-2/src/webapp/css/login.css -------------- next part -------------- Modified: pal-portal/branches/pal-portal-1.x/portal/jetspeed-2/src/webapp/css/login.css =================================================================== --- pal-portal/branches/pal-portal-1.x/portal/jetspeed-2/src/webapp/css/login.css 2008-06-17 13:05:32 UTC (rev 989) +++ pal-portal/branches/pal-portal-1.x/portal/jetspeed-2/src/webapp/css/login.css 2008-06-18 05:39:49 UTC (rev 990) @@ -28,7 +28,7 @@ } form { margin:0px; - padding:5px; + padding:0px; text-align:left; } .data { From svnnotify @ sourceforge.jp Fri Jun 20 05:58:42 2008 From: svnnotify @ sourceforge.jp (svnnotify @ sourceforge.jp) Date: Fri, 20 Jun 2008 05:58:42 +0900 Subject: [pal-cvs 3257] [991] removed portal.build.dir in clean target. Message-ID: <1213909122.265500.2642.nullmailer@users.sourceforge.jp> Revision: 991 http://svn.sourceforge.jp/cgi-bin/viewcvs.cgi?root=pal&view=rev&rev=991 Author: shinsuke Date: 2008-06-20 05:58:41 +0900 (Fri, 20 Jun 2008) Log Message: ----------- removed portal.build.dir in clean target. Modified Paths: -------------- pal-portal/branches/pal-portal-1.x/portal/build.xml -------------- next part -------------- Modified: pal-portal/branches/pal-portal-1.x/portal/build.xml =================================================================== --- pal-portal/branches/pal-portal-1.x/portal/build.xml 2008-06-18 05:39:49 UTC (rev 990) +++ pal-portal/branches/pal-portal-1.x/portal/build.xml 2008-06-19 20:58:41 UTC (rev 991) @@ -42,6 +42,7 @@ > + From svnnotify @ sourceforge.jp Fri Jun 20 07:24:31 2008 From: svnnotify @ sourceforge.jp (svnnotify @ sourceforge.jp) Date: Fri, 20 Jun 2008 07:24:31 +0900 Subject: [pal-cvs 3258] [992] added a logging mechanism. Message-ID: <1213914271.389611.12069.nullmailer@users.sourceforge.jp> Revision: 992 http://svn.sourceforge.jp/cgi-bin/viewcvs.cgi?root=pal&view=rev&rev=992 Author: shinsuke Date: 2008-06-20 07:24:31 +0900 (Fri, 20 Jun 2008) Log Message: ----------- added a logging mechanism. Added Paths: ----------- pal-portal/branches/pal-portal-1.x/portal/jetspeed-2/commons/src/java/jp/ pal-portal/branches/pal-portal-1.x/portal/jetspeed-2/commons/src/java/jp/sf/ pal-portal/branches/pal-portal-1.x/portal/jetspeed-2/commons/src/java/jp/sf/pal/ pal-portal/branches/pal-portal-1.x/portal/jetspeed-2/commons/src/java/jp/sf/pal/portal/ pal-portal/branches/pal-portal-1.x/portal/jetspeed-2/commons/src/java/jp/sf/pal/portal/logging/ pal-portal/branches/pal-portal-1.x/portal/jetspeed-2/commons/src/java/jp/sf/pal/portal/logging/Log.java pal-portal/branches/pal-portal-1.x/portal/jetspeed-2/commons/src/java/jp/sf/pal/portal/logging/LogFactory.java pal-portal/branches/pal-portal-1.x/portal/jetspeed-2/commons/src/java/jp/sf/pal/portal/logging/resources/ pal-portal/branches/pal-portal-1.x/portal/jetspeed-2/commons/src/java/jp/sf/pal/portal/logging/resources/Messages.properties -------------- next part -------------- Added: pal-portal/branches/pal-portal-1.x/portal/jetspeed-2/commons/src/java/jp/sf/pal/portal/logging/Log.java =================================================================== --- pal-portal/branches/pal-portal-1.x/portal/jetspeed-2/commons/src/java/jp/sf/pal/portal/logging/Log.java (rev 0) +++ pal-portal/branches/pal-portal-1.x/portal/jetspeed-2/commons/src/java/jp/sf/pal/portal/logging/Log.java 2008-06-19 22:24:31 UTC (rev 992) @@ -0,0 +1,220 @@ +package jp.sf.pal.portal.logging; + +import java.io.Serializable; +import java.text.MessageFormat; +import java.util.ResourceBundle; + +public class Log implements org.apache.commons.logging.Log, Serializable +{ + + private static final long serialVersionUID = -3677150409771058584L; + + private org.apache.commons.logging.Log log; + + private ResourceBundle resourceBundle; + + public Log(org.apache.commons.logging.Log log, ResourceBundle resourceBundle) + { + this.log = log; + this.resourceBundle = resourceBundle; + } + + public String getString(String messageCode) + { + return getString(messageCode, null); + } + + public String getString(String messageCode, Object[] args) + { + String message = null; + try + { + message = resourceBundle.getString(messageCode); + } + catch (Exception e) + { + log.error(messageCode, e); + return messageCode; + } + // remove log level + message = message.substring(1); + if (args != null) + { + message = MessageFormat.format(message, args); + } + return message; + } + + public void log(Throwable throwable) + { + error(throwable.getMessage(), throwable); + } + + public void log(String messageCode) + { + log(messageCode, null, null); + } + + public void log(String messageCode, Object[] args) + { + log(messageCode, args, null); + } + + public void log(String messageCode, Throwable throwable) + { + log(messageCode, null, throwable); + } + + public void log(String messageCode, Object[] args, Throwable throwable) + { + String message = null; + try + { + message = resourceBundle.getString(messageCode); + } + catch (Exception e) + { + log.error(messageCode, e); + return; + } + char messageType = message.charAt(0); + if (isEnabledFor(messageType)) + { + // remove log level + message = message.substring(1); + if (args != null) + { + message = MessageFormat.format(message, args); + } + switch (messageType) + { + case 'D': + log.debug(message, throwable); + break; + case 'I': + log.info(message, throwable); + break; + case 'W': + log.warn(message, throwable); + break; + case 'E': + log.error(message, throwable); + break; + case 'F': + log.fatal(message, throwable); + break; + default: + throw new IllegalArgumentException(String.valueOf(messageType)); + } + } + } + + private boolean isEnabledFor(final char messageType) + { + switch (messageType) + { + case 'D': + return log.isDebugEnabled(); + case 'I': + return log.isInfoEnabled(); + case 'W': + return log.isWarnEnabled(); + case 'E': + return log.isErrorEnabled(); + case 'F': + return log.isFatalEnabled(); + default: + throw new IllegalArgumentException(String.valueOf(messageType)); + } + } + + public void debug(Object arg0, Throwable arg1) + { + log.debug(arg0, arg1); + } + + public void debug(Object arg0) + { + log.debug(arg0); + } + + public void error(Object arg0, Throwable arg1) + { + log.error(arg0, arg1); + } + + public void error(Object arg0) + { + log.error(arg0); + } + + public void fatal(Object arg0, Throwable arg1) + { + log.fatal(arg0, arg1); + } + + public void fatal(Object arg0) + { + log.fatal(arg0); + } + + public void info(Object arg0, Throwable arg1) + { + log.info(arg0, arg1); + } + + public void info(Object arg0) + { + log.info(arg0); + } + + public boolean isDebugEnabled() + { + return log.isDebugEnabled(); + } + + public boolean isErrorEnabled() + { + return log.isErrorEnabled(); + } + + public boolean isFatalEnabled() + { + return log.isFatalEnabled(); + } + + public boolean isInfoEnabled() + { + return log.isInfoEnabled(); + } + + public boolean isTraceEnabled() + { + return log.isTraceEnabled(); + } + + public boolean isWarnEnabled() + { + return log.isWarnEnabled(); + } + + public void trace(Object arg0, Throwable arg1) + { + log.trace(arg0, arg1); + } + + public void trace(Object arg0) + { + log.trace(arg0); + } + + public void warn(Object arg0, Throwable arg1) + { + log.warn(arg0, arg1); + } + + public void warn(Object arg0) + { + log.warn(arg0); + } +} Property changes on: pal-portal/branches/pal-portal-1.x/portal/jetspeed-2/commons/src/java/jp/sf/pal/portal/logging/Log.java ___________________________________________________________________ Name: svn:eol-style + native Added: pal-portal/branches/pal-portal-1.x/portal/jetspeed-2/commons/src/java/jp/sf/pal/portal/logging/LogFactory.java =================================================================== --- pal-portal/branches/pal-portal-1.x/portal/jetspeed-2/commons/src/java/jp/sf/pal/portal/logging/LogFactory.java (rev 0) +++ pal-portal/branches/pal-portal-1.x/portal/jetspeed-2/commons/src/java/jp/sf/pal/portal/logging/LogFactory.java 2008-06-19 22:24:31 UTC (rev 992) @@ -0,0 +1,46 @@ +package jp.sf.pal.portal.logging; + +import java.util.ResourceBundle; + +import org.apache.commons.logging.LogConfigurationException; + +public class LogFactory +{ + + protected static ResourceBundle resourceBundle = ResourceBundle + .getBundle("jp.sf.pal.portal.logging.resources.Messages"); + + public static org.apache.commons.logging.LogFactory getFactory() + throws LogConfigurationException + { + return org.apache.commons.logging.LogFactory.getFactory(); + } + + public static Log getLog(Class clazz) + { + return new Log(org.apache.commons.logging.LogFactory.getLog(clazz), + resourceBundle); + } + + public static Log getLog(String name) + { + return new Log(org.apache.commons.logging.LogFactory.getLog(name), + resourceBundle); + } + + public static void release(ClassLoader classLoader) + { + org.apache.commons.logging.LogFactory.release(classLoader); + } + + public static void releaseAll() + { + org.apache.commons.logging.LogFactory.releaseAll(); + } + + public static String objectId(Object o) + { + return org.apache.commons.logging.LogFactory.objectId(o); + } + +} Property changes on: pal-portal/branches/pal-portal-1.x/portal/jetspeed-2/commons/src/java/jp/sf/pal/portal/logging/LogFactory.java ___________________________________________________________________ Name: svn:eol-style + native Added: pal-portal/branches/pal-portal-1.x/portal/jetspeed-2/commons/src/java/jp/sf/pal/portal/logging/resources/Messages.properties =================================================================== --- pal-portal/branches/pal-portal-1.x/portal/jetspeed-2/commons/src/java/jp/sf/pal/portal/logging/resources/Messages.properties (rev 0) +++ pal-portal/branches/pal-portal-1.x/portal/jetspeed-2/commons/src/java/jp/sf/pal/portal/logging/resources/Messages.properties 2008-06-19 22:24:31 UTC (rev 992) @@ -0,0 +1,80 @@ +# The format is XXYYYYY. XX(2 degits) is the number of a component. +# YYYYY(5 degits) is the number of a log message in the component. +# 01: commons +# 02: layout-portlets +# 03: components/capability +# 04: components/cm +# 05: components/deploy-tool +# 06: components/file-cache +# 07: components/header-resource +# 08: components/id-generator +# 09: components/jetspeed +0900001=I[0900001] Starting Jetspeed Engine ({0}) at {1} +0900002=E[0900002] Jetspeed Initialization exception +0900003=I[0900003] Finished starting Jetspeed Engine ({0}) at {1}. Elapsed time: {2} seconds. +0900004=W[0900004] No ContainerService defined for {0} +0900005=I[0900005] Double initialization of Jetspeed was attempted! +0900006=F[0900006] Jetspeed: init() failed. +0900007=I[0900007] Jetspeed Initialization complete, Ready to service requests. +0900008=F[0900008] Fatal error encountered while processing portal request. +0900009=F[0900009] Jetspeed: shutdown() failed. +0900010=I[0900010] Done shutting down. +0900011=I[0900011] Jetspeed Starting Initialization... +0900012=I[0900012] Double initialization of Jetspeed was attempted. +0900013=I[0900013] JetspeedServlet identifying web application root... +0900014=I[0900014] JetspeedServlet identifed web application root as {0} +0900015=I[0900015] JetspeedServlet attempting to create the portlet engine... +0900016=I[0900016] JetspeedServlet attempting to start the Jetspeed Portal Engine... +0900017=I[0900017] JetspeedServlet has successfuly started the Jetspeed Portal Engine... +0900018=F[0900018] Jetspeed: init() failed. +0900019=I[0900019] Jetspeed Initialization complete, Ready to service requests. +0900020=D[0900020] usernameKey={0}, passwordKey={1}, skipPasswordCheck={2} +0900021=D[0900021] Authentication failure: username={0} +0900022=D[0900022] path={0}, domain={1}, maxAge={2}, secure={3}, transferredInfo={4} +0900023=W[0900023] Could not get the user info: {0} +0900024=E[0900024] Could not create UserManager. +0900025=E[0900025] Could not create RoleManager. +0900026=E[0900026] Could not create GroupManager. +0900027=E[0900027] Could not create Profiler. +0900028=E[0900028] Could not create a user. +0900029=E[0900029] Could not create a user. +0900030=E[0900030] Could not remove a user. +0900031=E[0900031] Could not update a user. +0900032=E[0900032] Could not remove a user. +0900033=E[0900033] Registration Error: Failed to rollback user {0}. +0900034=E[0900034] Registration Error: Failed to create user folders for {0}, {1}. +0900035=E[0900035] Registration Error: Failed to create registered user {0}. +0900036=E[0900036] Sorry, but we were unable access the requested portlet. Check the following exception. +0900037=I[0900037] Aggregating {0}. Parallel: {1}, Sequential: {2} +0900038=D[0900038] Rendering portlet fragment: [[name, {0}], [id, {1}]] +0900039=E[0900039] Worker exception +0900040=E[0900040] Exception during synchronizing all portlet rendering jobs. +0900041=E[0900041] Exception during synchronizing all portlet rendering jobs. +0900042=D[0900042] [CommonjWorkMonitorImpl] workAccepted: {0} +0900043=D[0900043] [CommonjWorkMonitorImpl] workRejected: {0} +0900044=D[0900044] [CommonjWorkMonitorImpl] workStarted: {0} +0900045=D[0900045] [CommonjWorkMonitorImpl] workCompleted: {0} +0900046=E[0900046] Exceptiong during job timeout monitoring. +0900047=E[0900047] Exception during job monitoring. +0900048=I[0900048] Portlet Rendering job to be interrupted by timeout ({0}ms): {1} +0900049=E[0900049] Exceptiong during job killing. + +# 10: components/locator +# 11: components/page-manager +# 12: components/portal +# 13: components/portal-site +# 14: components/portlet-factory +# 15: components/prefs +# 16: components/profiler +# 17: components/rdbms +# 18: components/registry +# 19: components/rewriter +# 20: components/search +# 21: components/security +# 22: components/security-schema +# 23: components/serializer +# 24: components/sso +# 25: components/statistics +# 26: components/web-content +# 27: components/webapp-logging + Property changes on: pal-portal/branches/pal-portal-1.x/portal/jetspeed-2/commons/src/java/jp/sf/pal/portal/logging/resources/Messages.properties ___________________________________________________________________ Name: svn:eol-style + native From svnnotify @ sourceforge.jp Fri Jun 20 07:26:05 2008 From: svnnotify @ sourceforge.jp (svnnotify @ sourceforge.jp) Date: Fri, 20 Jun 2008 07:26:05 +0900 Subject: [pal-cvs 3259] [993] replaced a logging. Message-ID: <1213914365.655020.13307.nullmailer@users.sourceforge.jp> Revision: 993 http://svn.sourceforge.jp/cgi-bin/viewcvs.cgi?root=pal&view=rev&rev=993 Author: shinsuke Date: 2008-06-20 07:26:05 +0900 (Fri, 20 Jun 2008) Log Message: ----------- replaced a logging. Modified Paths: -------------- pal-portal/branches/pal-portal-1.x/portal/jetspeed-2/components/portal/src/java/jp/sf/pal/portal/filter/AbstractAuthFilter.java pal-portal/branches/pal-portal-1.x/portal/jetspeed-2/components/portal/src/java/jp/sf/pal/portal/filter/CookieTransferFilter.java pal-portal/branches/pal-portal-1.x/portal/jetspeed-2/components/portal/src/java/jp/sf/pal/portal/servlet/UserManagerServlet.java pal-portal/branches/pal-portal-1.x/portal/jetspeed-2/components/portal/src/java/org/apache/jetspeed/administration/PortalAdministrationImpl.java pal-portal/branches/pal-portal-1.x/portal/jetspeed-2/components/portal/src/java/org/apache/jetspeed/aggregator/impl/AsyncPageAggregatorImpl.java pal-portal/branches/pal-portal-1.x/portal/jetspeed-2/components/portal/src/java/org/apache/jetspeed/aggregator/impl/CommonjWorkerMonitorImpl.java pal-portal/branches/pal-portal-1.x/portal/jetspeed-2/components/portal/src/java/org/apache/jetspeed/engine/JetspeedEngine.java pal-portal/branches/pal-portal-1.x/portal/jetspeed-2/components/portal/src/java/org/apache/jetspeed/engine/JetspeedServlet.java -------------- next part -------------- Modified: pal-portal/branches/pal-portal-1.x/portal/jetspeed-2/components/portal/src/java/jp/sf/pal/portal/filter/AbstractAuthFilter.java =================================================================== --- pal-portal/branches/pal-portal-1.x/portal/jetspeed-2/components/portal/src/java/jp/sf/pal/portal/filter/AbstractAuthFilter.java 2008-06-19 22:24:31 UTC (rev 992) +++ pal-portal/branches/pal-portal-1.x/portal/jetspeed-2/components/portal/src/java/jp/sf/pal/portal/filter/AbstractAuthFilter.java 2008-06-19 22:26:05 UTC (rev 993) @@ -31,8 +31,9 @@ import javax.servlet.http.HttpServletRequest; import javax.servlet.http.HttpSession; -import org.apache.commons.logging.Log; -import org.apache.commons.logging.LogFactory; +import jp.sf.pal.portal.logging.Log; +import jp.sf.pal.portal.logging.LogFactory; + import org.apache.jetspeed.Jetspeed; import org.apache.jetspeed.PortalReservedParameters; import org.apache.jetspeed.administration.PortalAuthenticationConfiguration; @@ -88,9 +89,9 @@ // debug if (log.isDebugEnabled()) { - log.debug("usernameKey=" + usernameKey); - log.debug("passwordKey=" + passwordKey); - log.debug("skipPasswordCheck=" + skipPasswordCheck); + Object[] args = new Object[] + {usernameKey, passwordKey, Boolean.toString(skipPasswordCheck)}; + log.log("0900020", args); } } @@ -184,8 +185,9 @@ // debug if (log.isDebugEnabled()) { - log.debug("Authentication failure: username=" - + username); + Object[] args = new Object[] + {username}; + log.log("0900021", args); } } } Modified: pal-portal/branches/pal-portal-1.x/portal/jetspeed-2/components/portal/src/java/jp/sf/pal/portal/filter/CookieTransferFilter.java =================================================================== --- pal-portal/branches/pal-portal-1.x/portal/jetspeed-2/components/portal/src/java/jp/sf/pal/portal/filter/CookieTransferFilter.java 2008-06-19 22:24:31 UTC (rev 992) +++ pal-portal/branches/pal-portal-1.x/portal/jetspeed-2/components/portal/src/java/jp/sf/pal/portal/filter/CookieTransferFilter.java 2008-06-19 22:26:05 UTC (rev 993) @@ -18,8 +18,9 @@ import javax.servlet.http.HttpServletResponse; import javax.servlet.http.HttpSession; -import org.apache.commons.logging.Log; -import org.apache.commons.logging.LogFactory; +import jp.sf.pal.portal.logging.Log; +import jp.sf.pal.portal.logging.LogFactory; + import org.apache.jetspeed.Jetspeed; import org.apache.jetspeed.security.SecurityException; import org.apache.jetspeed.security.User; @@ -102,11 +103,10 @@ // debug if (log.isDebugEnabled()) { - log.debug("path=" + path); - log.debug("domain=" + domain); - log.debug("maxAge=" + maxAge); - log.debug("secure=" + secure); - log.debug("transferredInfo=" + transferredInfo); + Object[] args = new Object[] + {path, domain, Integer.toString(maxAge), Boolean.toString(secure), + transferredInfo}; + log.log("0900022", args); } } @@ -169,9 +169,9 @@ } catch (SecurityException e) { - log.warn( - "Could not get the user info: " + username, - e); + Object[] args = new Object[] + {username}; + log.log("0900023", args); } } Modified: pal-portal/branches/pal-portal-1.x/portal/jetspeed-2/components/portal/src/java/jp/sf/pal/portal/servlet/UserManagerServlet.java =================================================================== --- pal-portal/branches/pal-portal-1.x/portal/jetspeed-2/components/portal/src/java/jp/sf/pal/portal/servlet/UserManagerServlet.java 2008-06-19 22:24:31 UTC (rev 992) +++ pal-portal/branches/pal-portal-1.x/portal/jetspeed-2/components/portal/src/java/jp/sf/pal/portal/servlet/UserManagerServlet.java 2008-06-19 22:26:05 UTC (rev 993) @@ -12,8 +12,9 @@ import javax.servlet.http.HttpServletRequest; import javax.servlet.http.HttpServletResponse; -import org.apache.commons.logging.Log; -import org.apache.commons.logging.LogFactory; +import jp.sf.pal.portal.logging.Log; +import jp.sf.pal.portal.logging.LogFactory; + import org.apache.jetspeed.Jetspeed; import org.apache.jetspeed.profiler.Profiler; import org.apache.jetspeed.security.GroupManager; @@ -101,16 +102,16 @@ .getComponent("org.apache.jetspeed.security.UserManager"); if (userManager == null) { - log.error("Could not create UserManager."); - throw new ServletException("Could not create UserManager."); + log.log("0900024"); // REPLACED + throw new ServletException(log.getString("0900024")); } // RoleManager roleManager = (RoleManager) Jetspeed.getComponentManager() .getComponent("org.apache.jetspeed.security.RoleManager"); if (roleManager == null) { - log.error("Could not create RoleManager."); - throw new ServletException("Could not create RoleManager."); + log.log("0900025"); // REPLACED + throw new ServletException(log.getString("0900025")); } // GroupManager @@ -118,8 +119,8 @@ .getComponent("org.apache.jetspeed.security.GroupManager"); if (groupManager == null) { - log.error("Could not create GroupManager."); - throw new ServletException("Could not create GroupManager."); + log.log("0900026"); // REPLACED + throw new ServletException(log.getString("0900026")); } // Profiler @@ -127,8 +128,8 @@ "org.apache.jetspeed.profiler.Profiler"); if (profiler == null) { - log.error("Could not create Profiler."); - throw new ServletException("Could not create Profiler."); + log.log("0900027"); // REPLACED + throw new ServletException(log.getString("0900027")); } // excludedUsernames @@ -309,7 +310,7 @@ setResponseHeader(resp); printResult(printWriter, SERVER_ERROR_STATUS, "Could not create a user: " + e.getMessage(), null); - log.error("Could not create a user: " + e.getMessage(), e); + log.log("0900028", e); // REPLACED return; } @@ -352,14 +353,14 @@ setResponseHeader(resp); printResult(printWriter, SERVER_ERROR_STATUS, "Could not create a user: " + e.getMessage(), null); - log.error("Could not create a user: " + e.getMessage(), e); + log.log("0900029", e); // REPLACED try { userManager.removeUser(username); } catch (SecurityException e1) { - log.error("Could not remove a user: " + e1.getMessage(), e1); + log.log("0900030", e1); // REPLACED } return; } @@ -426,7 +427,7 @@ setResponseHeader(resp); printResult(printWriter, SERVER_ERROR_STATUS, "Could not update a user: " + e.getMessage(), null); - log.error("Could not update a user: " + e.getMessage(), e); + log.log("0900031", e); return; } @@ -475,7 +476,7 @@ setResponseHeader(resp); printResult(printWriter, SERVER_ERROR_STATUS, "Could not remove a user: " + e.getMessage(), null); - log.error("Could not remove a user: " + e.getMessage(), e); + log.log("0900032", e); // REPLACED return; } } Modified: pal-portal/branches/pal-portal-1.x/portal/jetspeed-2/components/portal/src/java/org/apache/jetspeed/administration/PortalAdministrationImpl.java =================================================================== --- pal-portal/branches/pal-portal-1.x/portal/jetspeed-2/components/portal/src/java/org/apache/jetspeed/administration/PortalAdministrationImpl.java 2008-06-19 22:24:31 UTC (rev 992) +++ pal-portal/branches/pal-portal-1.x/portal/jetspeed-2/components/portal/src/java/org/apache/jetspeed/administration/PortalAdministrationImpl.java 2008-06-19 22:26:05 UTC (rev 993) @@ -31,9 +31,10 @@ import javax.portlet.PortletRequest; import javax.portlet.PortletResponse; +import jp.sf.pal.portal.logging.Log; +import jp.sf.pal.portal.logging.LogFactory; + import org.apache.commons.configuration.Configuration; -import org.apache.commons.logging.Log; -import org.apache.commons.logging.LogFactory; import org.apache.jetspeed.Jetspeed; import org.apache.jetspeed.PortalReservedParameters; import org.apache.jetspeed.exception.JetspeedException; @@ -346,20 +347,30 @@ } catch (Exception e) { - log.error("Registration Error: Failed to rollback user " - + userName); + // log.error("Registration Error: Failed to rollback user " + // + userName); + Object[] args = new Object[] + {userName}; + log.log("0900033", args); // REPLACED } - log - .error("Registration Error: Failed to create user folders for " - + userName + ", " + pe.toString()); + // log + // .error("Registration Error: Failed to create user folders for + // " + // + userName + ", " + pe.toString()); + Object[] args = new Object[] + {userName, pe.toString()}; + log.log("0900034", args); // REPLACED throw pe; } } catch (Exception e) { - log.error("Registration Error: Failed to create registered user " - + userName + ", " + e.toString()); + // log.error("Registration Error: Failed to create registered user " + // + userName + ", " + e.toString()); + Object[] args = new Object[] + {userName}; + log.log("0900035", args); // REPLACED throw new RegistrationException(e); } } Modified: pal-portal/branches/pal-portal-1.x/portal/jetspeed-2/components/portal/src/java/org/apache/jetspeed/aggregator/impl/AsyncPageAggregatorImpl.java =================================================================== --- pal-portal/branches/pal-portal-1.x/portal/jetspeed-2/components/portal/src/java/org/apache/jetspeed/aggregator/impl/AsyncPageAggregatorImpl.java 2008-06-19 22:24:31 UTC (rev 992) +++ pal-portal/branches/pal-portal-1.x/portal/jetspeed-2/components/portal/src/java/org/apache/jetspeed/aggregator/impl/AsyncPageAggregatorImpl.java 2008-06-19 22:26:05 UTC (rev 993) @@ -21,8 +21,9 @@ import java.util.Iterator; import java.util.List; -import org.apache.commons.logging.Log; -import org.apache.commons.logging.LogFactory; +import jp.sf.pal.portal.logging.Log; +import jp.sf.pal.portal.logging.LogFactory; + import org.apache.jetspeed.PortalReservedParameters; import org.apache.jetspeed.aggregator.CurrentWorkerContext; import org.apache.jetspeed.aggregator.FailedToRenderFragmentException; @@ -136,7 +137,8 @@ } catch (Exception e) { - log.error(e.getMessage(), e); + // log.error(e.getMessage(), e); + log.log("0900036", e); // REPLACED maxedContentFragment .overrideRenderedContent("Sorry, but we were unable access the requested portlet. Send the following message to your portal admin: " + e.getMessage()); @@ -212,8 +214,12 @@ if (log.isInfoEnabled()) { - log.info("Aggregating " + page.getPath() + ". Parallel: " - + parallelJobCount + ", Sequential: " + sequentialJobCount); + // log.info("Aggregating " + page.getPath() + ". Parallel: " + // + parallelJobCount + ", Sequential: " + sequentialJobCount); + Object[] args = new Object[] + {page.getPath(), Integer.toString(parallelJobCount), + Integer.toString(sequentialJobCount)}; + log.log("0900037", args); // REPLACED } CurrentWorkerContext.setParallelRenderingMode(parallelJobCount > 0); @@ -253,8 +259,11 @@ .getEffectiveDefaultDecorator(ContentFragment.PORTLET); if (log.isDebugEnabled()) { - log.debug("Rendering portlet fragment: [[name, " + f.getName() - + "], [id, " + f.getId() + "]]"); + // log.debug("Rendering portlet fragment: [[name, " + f.getName() + // + "], [id, " + f.getId() + "]]"); + Object[] args = new Object[] + {f.getName(), f.getId()}; + log.log("0900038", args); // REPLACED } renderer.renderNow(f, context); Modified: pal-portal/branches/pal-portal-1.x/portal/jetspeed-2/components/portal/src/java/org/apache/jetspeed/aggregator/impl/CommonjWorkerMonitorImpl.java =================================================================== --- pal-portal/branches/pal-portal-1.x/portal/jetspeed-2/components/portal/src/java/org/apache/jetspeed/aggregator/impl/CommonjWorkerMonitorImpl.java 2008-06-19 22:24:31 UTC (rev 992) +++ pal-portal/branches/pal-portal-1.x/portal/jetspeed-2/components/portal/src/java/org/apache/jetspeed/aggregator/impl/CommonjWorkerMonitorImpl.java 2008-06-19 22:26:05 UTC (rev 993) @@ -28,8 +28,9 @@ import java.util.List; import java.util.Map; -import org.apache.commons.logging.Log; -import org.apache.commons.logging.LogFactory; +import jp.sf.pal.portal.logging.Log; +import jp.sf.pal.portal.logging.LogFactory; + import org.apache.jetspeed.aggregator.PortletContent; import org.apache.jetspeed.aggregator.RenderingJob; import org.apache.jetspeed.aggregator.Worker; @@ -145,7 +146,8 @@ } catch (Throwable t) { - log.error("Worker exception", t); + // log.error("Worker exception", t); + log.log("0900039", t); // REPLACED } } @@ -183,10 +185,11 @@ } catch (Exception e) { - log - .error( - "Exception during synchronizing all portlet rendering jobs.", - e); + // log + // .error( + // "Exception during synchronizing all portlet rendering jobs.", + // e); + log.log("0900040", e); // REPLACED } } else @@ -214,10 +217,11 @@ } catch (Exception e) { - log - .error( - "Exception during synchronizing all portlet rendering jobs.", - e); + // log + // .error( + // "Exception during synchronizing all portlet rendering jobs.", + // e); + log.log("0900041", e); // REPLACED } } } @@ -242,15 +246,27 @@ public void workAccepted(WorkEvent we) { WorkItem workItem = we.getWorkItem(); + // if (log.isDebugEnabled()) + // log.debug("[CommonjWorkMonitorImpl] workAccepted: " + workItem); if (log.isDebugEnabled()) - log.debug("[CommonjWorkMonitorImpl] workAccepted: " + workItem); + { + Object[] args = new Object[] + {workItem}; + log.log("0900042", args); // REPLACED + } } public void workRejected(WorkEvent we) { WorkItem workItem = we.getWorkItem(); + // if (log.isDebugEnabled()) + // log.debug("[CommonjWorkMonitorImpl] workRejected: " + workItem); if (log.isDebugEnabled()) - log.debug("[CommonjWorkMonitorImpl] workRejected: " + workItem); + { + Object[] args = new Object[] + {workItem}; + log.log("0900043", args); // REPLACED + } if (this.jobWorksMonitorEnabled) { @@ -261,15 +277,27 @@ public void workStarted(WorkEvent we) { WorkItem workItem = we.getWorkItem(); + // if (log.isDebugEnabled()) + // log.debug("[CommonjWorkMonitorImpl] workStarted: " + workItem); if (log.isDebugEnabled()) - log.debug("[CommonjWorkMonitorImpl] workStarted: " + workItem); + { + Object[] args = new Object[] + {workItem}; + log.log("0900044", args); // REPLACED + } } public void workCompleted(WorkEvent we) { WorkItem workItem = we.getWorkItem(); + // if (log.isDebugEnabled()) + // log.debug("[CommonjWorkMonitorImpl] workCompleted: " + workItem); if (log.isDebugEnabled()) - log.debug("[CommonjWorkMonitorImpl] workCompleted: " + workItem); + { + Object[] args = new Object[] + {workItem}; + log.log("0900045", args); // REPLACED + } if (this.jobWorksMonitorEnabled) { @@ -411,7 +439,8 @@ } catch (Exception e) { - log.error("Exceptiong during job timeout monitoring.", e); + // log.error("Exceptiong during job timeout monitoring.", e); + log.log("0900046", e); // REPLACED } } @@ -489,7 +518,8 @@ } catch (Exception e) { - log.error("Exception during job monitoring.", e); + // log.error("Exception during job monitoring.", e); + log.log("0900047", e); // REPLACED } try @@ -512,13 +542,21 @@ try { - if (log.isWarnEnabled()) + // if (log.isWarnEnabled()) + // { + // PortletWindow window = job.getWindow(); + // ObjectID windowId = (null != window ? window.getId() : null); + // log + // .warn("Portlet Rendering job to be interrupted by timeout (" + // + job.getTimeout() + "ms): " + windowId); + // } + if (log.isInfoEnabled()) { PortletWindow window = job.getWindow(); ObjectID windowId = (null != window ? window.getId() : null); - log - .warn("Portlet Rendering job to be interrupted by timeout (" - + job.getTimeout() + "ms): " + windowId); + Object[] args = new Object[] + {Long.toString(job.getTimeout()), windowId}; + log.log("0900048", args); // REPLACED } PortletContent content = job.getPortletContent(); @@ -539,7 +577,8 @@ } catch (Exception e) { - log.error("Exceptiong during job killing.", e); + // log.error("Exceptiong during job killing.", e); + log.log("0900049", e); // REPLACED } finally { Modified: pal-portal/branches/pal-portal-1.x/portal/jetspeed-2/components/portal/src/java/org/apache/jetspeed/engine/JetspeedEngine.java =================================================================== --- pal-portal/branches/pal-portal-1.x/portal/jetspeed-2/components/portal/src/java/org/apache/jetspeed/engine/JetspeedEngine.java 2008-06-19 22:24:31 UTC (rev 992) +++ pal-portal/branches/pal-portal-1.x/portal/jetspeed-2/components/portal/src/java/org/apache/jetspeed/engine/JetspeedEngine.java 2008-06-19 22:26:05 UTC (rev 993) @@ -22,9 +22,10 @@ import javax.servlet.ServletConfig; +import jp.sf.pal.portal.logging.Log; +import jp.sf.pal.portal.logging.LogFactory; + import org.apache.commons.configuration.Configuration; -import org.apache.commons.logging.Log; -import org.apache.commons.logging.LogFactory; import org.apache.jetspeed.JetspeedPortalContext; import org.apache.jetspeed.PortalContext; import org.apache.jetspeed.PortalReservedParameters; @@ -122,9 +123,14 @@ Date startTime = new Date(); try { - log.info("Starting Jetspeed Engine (" + getClass().getName() - + ") at " + format.format(startTime)); - + // log.info("Starting Jetspeed Engine (" + getClass().getName() + // + ") at " + format.format(startTime)); + if (log.isInfoEnabled()) + { + Object[] args = new Object[] + {getClass().getName(), format.format(startTime)}; + log.log("0900001", args); // REPLACED + } // patch up OJB ClassLoader ploader2 = this.getClass().getClassLoader(); // ClassLoader ploader2 = @@ -158,17 +164,28 @@ } catch (Throwable e) { - e.printStackTrace(); - log.error(e.toString()); + // e.printStackTrace(); + // log.error(e.toString()); + log.log("0900002", e); // REPLACED throw new JetspeedException("Jetspeed Initialization exception!", e); } finally { - Date endTime = new Date(); - long elapsedTime = (endTime.getTime() - startTime.getTime()) / 1000; - log.info("Finished starting Jetspeed Engine (" - + getClass().getName() + ") at " + format.format(endTime) - + ". Elapsed time: " + elapsedTime + " seconds."); + // Date endTime = new Date(); + // long elapsedTime = (endTime.getTime() - startTime.getTime()) / + // 1000; + // log.info("Finished starting Jetspeed Engine (" + // + getClass().getName() + ") at " + format.format(endTime) + // + ". Elapsed time: " + elapsedTime + " seconds."); + if (log.isInfoEnabled()) + { + Date endTime = new Date(); + long elapsedTime = (endTime.getTime() - startTime.getTime()) / 1000; + Object[] args = new Object[] + {getClass().getName(), format.format(endTime), + Long.toString(elapsedTime)}; + log.log("0900003", args); // REPLACED + } } } @@ -349,7 +366,10 @@ } catch (NoSuchBeanDefinitionException e) { - log.warn("No ContainerService defined for " + service.getName()); + // log.warn("No ContainerService defined for " + service.getName()); + Object[] args = new Object[] + {service.getName()}; + log.log("0900004", args, e); // REPLACED return null; } } Modified: pal-portal/branches/pal-portal-1.x/portal/jetspeed-2/components/portal/src/java/org/apache/jetspeed/engine/JetspeedServlet.java =================================================================== --- pal-portal/branches/pal-portal-1.x/portal/jetspeed-2/components/portal/src/java/org/apache/jetspeed/engine/JetspeedServlet.java 2008-06-19 22:24:31 UTC (rev 992) +++ pal-portal/branches/pal-portal-1.x/portal/jetspeed-2/components/portal/src/java/org/apache/jetspeed/engine/JetspeedServlet.java 2008-06-19 22:26:05 UTC (rev 993) @@ -29,11 +29,11 @@ import javax.servlet.http.HttpSessionEvent; import javax.servlet.http.HttpSessionListener; +import jp.sf.pal.portal.logging.Log; +import jp.sf.pal.portal.logging.LogFactory; + import org.apache.commons.configuration.Configuration; import org.apache.commons.configuration.PropertiesConfiguration; -import org.apache.commons.lang.exception.ExceptionUtils; -import org.apache.commons.logging.Log; -import org.apache.commons.logging.LogFactory; import org.apache.jetspeed.Jetspeed; import org.apache.jetspeed.PortalReservedParameters; import org.apache.jetspeed.cache.ContentCacheKeyGenerator; @@ -96,7 +96,8 @@ // ------------------------------------------------------------------- // I N I T I A L I Z A T I O N // ------------------------------------------------------------------- - private static final String INIT_START_MSG = "Jetspeed Starting Initialization..."; + // private static final String INIT_START_MSG = "Jetspeed Starting + // Initialization..."; private static final String INIT_DONE_MSG = "Jetspeed Initialization complete, Ready to service requests."; @@ -113,15 +114,26 @@ console = LogFactory.getLog(CONSOLE_LOGGER); } - console.info(INIT_START_MSG); - + // console.info(INIT_START_MSG); + if (console.isInfoEnabled()) + { + console.log("0900011"); // REPLACED + } super.init(config); if (!firstInit) { - log.info("Double initialization of Jetspeed was attempted!"); - console - .info("Double initialization of Jetspeed was attempted!"); + // log.info("Double initialization of Jetspeed was attempted!"); + if (log.isInfoEnabled()) + { + log.log("0900005");// REPLACED + } + // console + // .info("Double initialization of Jetspeed was attempted!"); + if (console.isInfoEnabled()) + { + console.log("0900012"); // REPLACED + } return; } // executing init will trigger some static initializers, so we have @@ -141,13 +153,22 @@ context, config, APPLICATION_ROOT_KEY, APPLICATION_ROOT_DEFAULT); - console - .info("JetspeedServlet identifying web application root..."); + // console + // .info("JetspeedServlet identifying web application root..."); + if (console.isInfoEnabled()) + { + console.log("0900013"); + } webappRoot = config.getServletContext().getRealPath("/"); - console - .info("JetspeedServlet identifed web application root as " - + webappRoot); - + // console + // .info("JetspeedServlet identifed web application root as " + // + webappRoot); + if (console.isInfoEnabled()) + { + Object[] args = new Object[] + {webappRoot}; + console.log("0900014", args); // REPLACED + } if (applicationRoot == null || applicationRoot.equals(WEB_CONTEXT)) { @@ -160,19 +181,33 @@ properties.setProperty(APPLICATION_ROOT_KEY, applicationRoot); properties.setProperty(WEBAPP_ROOT_KEY, webappRoot); - console - .info("JetspeedServlet attempting to create the portlet engine..."); - + // console + // .info("JetspeedServlet attempting to create the portlet + // engine..."); + if (console.isInfoEnabled()) + { + console.log("0900015"); // REPLACED + } engine = new JetspeedEngine(properties, applicationRoot, config, initializeComponentManager(config, applicationRoot, properties)); - console - .info("JetspeedServlet attempting to start the Jetspeed Portal Engine..."); + // console + // .info("JetspeedServlet attempting to start the Jetspeed + // Portal Engine..."); + if (console.isInfoEnabled()) + { + console.log("0900016"); // REPLACED + } Jetspeed.setEngine(engine); engine.start(); - console - .info("JetspeedServlet has successfuly started the Jetspeed Portal Engine...."); + // console + // .info("JetspeedServlet has successfuly started the Jetspeed + // Portal Engine...."); + if (console.isInfoEnabled()) + { + console.log("0900017"); // REPLACED + } contextComponent = (RequestContextComponent) Jetspeed .getComponentManager().getComponent( RequestContextComponent.class); @@ -182,12 +217,22 @@ // save the exception to complain loudly later :-) final String msg = "Jetspeed: init() failed: "; initFailure = e; - log.fatal(msg, e); - console.fatal(msg, e); + // log.fatal(msg, e); + log.log("0900006", e); // REPLACED + // console.fatal(msg, e); + console.log("0900018", e); // REPLACED } - console.info(INIT_DONE_MSG); - log.info(INIT_DONE_MSG); + // console.info(INIT_DONE_MSG); + if (console.isInfoEnabled()) + { + console.log("0900019");// REPLACED + } + // log.info(INIT_DONE_MSG); + if (log.isInfoEnabled()) + { + log.log("0900007"); // REPLACED + } } } @@ -270,10 +315,13 @@ } catch (JetspeedException e) { - final String msg = "Fatal error encountered while processing portal request: " - + e.toString(); - log.fatal(msg, e); - throw new ServletException(msg, e); + // final String msg = "Fatal error encountered while processing + // portal request: " + // + e.toString(); + // log.fatal(msg, e); + // throw new ServletException(msg, e); + log.fatal("0900008", e); // REPLACED + throw new ServletException(log.getString("0900008"), e); } } @@ -311,14 +359,20 @@ } catch (JetspeedException e) { - log.fatal("Jetspeed: shutdown() failed: ", e); - System.err.println(ExceptionUtils.getStackTrace(e)); + // log.fatal("Jetspeed: shutdown() failed: ", e); + log.log("0900009", e); + // TODO needed? + // System.err.println(ExceptionUtils.getStackTrace(e)); } // Allow turbine to be started back up again. firstInit = true; - log.info("Done shutting down!"); + // log.info("Done shutting down!"); + if (log.isInfoEnabled()) + { + log.log("0900010"); + } } /** From svnnotify @ sourceforge.jp Wed Jun 25 14:12:59 2008 From: svnnotify @ sourceforge.jp (svnnotify @ sourceforge.jp) Date: Wed, 25 Jun 2008 14:12:59 +0900 Subject: [pal-cvs 3260] [994] apply patch ' Optional portlet session caching of layout view templates' Message-ID: <1214370779.081636.13402.nullmailer@users.sourceforge.jp> Revision: 994 http://svn.sourceforge.jp/cgi-bin/viewcvs.cgi?root=pal&view=rev&rev=994 Author: sone Date: 2008-06-25 14:12:58 +0900 (Wed, 25 Jun 2008) Log Message: ----------- apply patch 'Optional portlet session caching of layout view templates' Modified Paths: -------------- pal-portal/branches/pal-portal-1.x/portal/jetspeed-2/layout-portlets/src/java/org/apache/jetspeed/portlets/layout/LayoutPortlet.java pal-portal/branches/pal-portal-1.x/portal/jetspeed-2/layout-portlets/src/webapp/WEB-INF/jetspeed-portlet.xml pal-portal/branches/pal-portal-1.x/portal/jetspeed-2/src/webapp/WEB-INF/conf/jetspeed.properties -------------- next part -------------- Modified: pal-portal/branches/pal-portal-1.x/portal/jetspeed-2/layout-portlets/src/java/org/apache/jetspeed/portlets/layout/LayoutPortlet.java =================================================================== --- pal-portal/branches/pal-portal-1.x/portal/jetspeed-2/layout-portlets/src/java/org/apache/jetspeed/portlets/layout/LayoutPortlet.java 2008-06-19 22:26:05 UTC (rev 993) +++ pal-portal/branches/pal-portal-1.x/portal/jetspeed-2/layout-portlets/src/java/org/apache/jetspeed/portlets/layout/LayoutPortlet.java 2008-06-25 05:12:58 UTC (rev 994) @@ -38,6 +38,7 @@ import org.apache.jetspeed.CommonPortletServices; import org.apache.jetspeed.JetspeedActions; import org.apache.jetspeed.PortalReservedParameters; +import org.apache.jetspeed.administration.PortalConfiguration; import org.apache.jetspeed.capabilities.CapabilityMap; import org.apache.jetspeed.components.portletentity.PortletEntityAccessComponent; import org.apache.jetspeed.components.portletregistry.PortletRegistry; @@ -93,6 +94,8 @@ protected TemplateLocator decorationLocator; + protected boolean storeViewPageInSession; + private Map layoutTemplatesCache = new HashMap(); public static final String DEFAULT_TEMPLATE_EXT = ".vm"; @@ -131,6 +134,14 @@ if (null == windowAccess) { throw new PortletException( "Failed to find the Window Access on portlet initialization"); } + PortalConfiguration portalConfiguration = (PortalConfiguration) getPortletContext() + .getAttribute(CommonPortletServices.CPS_PORTAL_CONFIGURATION); + if (null == portalConfiguration) { throw new PortletException( + "Failed to find the Portal Configuration on portlet initialization"); } + + storeViewPageInSession = portalConfiguration.getBoolean( + "layout.page.storeViewPageInSession", true); + templateLocator = (TemplateLocator) getPortletContext().getAttribute( "TemplateLocator"); decorationLocator = (TemplateLocator) getPortletContext().getAttribute( @@ -152,8 +163,8 @@ try { - String helpPage = (String) request.getPortletSession() - .getAttribute(PortalReservedParameters.PAGE_LAYOUT_HELP); + String helpPage = getCachedLayoutViewPage(request, + PortalReservedParameters.PAGE_LAYOUT_HELP); if (helpPage == null) { PortletPreferences prefs = request.getPreferences(); @@ -163,7 +174,7 @@ helpPage = this.getInitParameter(PARAM_HELP_PAGE); if (helpPage == null) helpPage = "columns"; } - request.getPortletSession().setAttribute( + cacheLayoutViewPage(request, PortalReservedParameters.PAGE_LAYOUT_HELP, helpPage); } @@ -243,7 +254,7 @@ JetspeedPowerTool jpt = getJetspeedPowerTool(request); if (maximized) { - viewPage = (String) request.getPortletSession().getAttribute( + viewPage = getCachedLayoutViewPage(request, PortalReservedParameters.PAGE_LAYOUT_MAX); if (viewPage == null) { @@ -254,13 +265,13 @@ viewPage = this.getInitParameter(PARAM_MAX_PAGE); if (viewPage == null) viewPage = "maximized"; } - request.getPortletSession().setAttribute( + cacheLayoutViewPage(request, PortalReservedParameters.PAGE_LAYOUT_MAX, viewPage); } } else if (solo) { - viewPage = (String) request.getPortletSession().getAttribute( + viewPage = getCachedLayoutViewPage(request, PortalReservedParameters.PAGE_LAYOUT_SOLO); if (viewPage == null) { @@ -274,15 +285,13 @@ viewPage = "solo"; } } - request.getPortletSession() - .setAttribute( - PortalReservedParameters.PAGE_LAYOUT_SOLO, - viewPage); + cacheLayoutViewPage(request, + PortalReservedParameters.PAGE_LAYOUT_SOLO, viewPage); } } else { - viewPage = (String) request.getPortletSession().getAttribute( + viewPage = getCachedLayoutViewPage(request, PortalReservedParameters.PAGE_LAYOUT_VIEW); if (viewPage == null) { @@ -293,10 +302,9 @@ viewPage = this.getInitParameter(PARAM_VIEW_PAGE); if (viewPage == null) viewPage = "columns"; } - request.getPortletSession() - .setAttribute( - PortalReservedParameters.PAGE_LAYOUT_VIEW, - viewPage); + + cacheLayoutViewPage(request, + PortalReservedParameters.PAGE_LAYOUT_VIEW, viewPage); } } @@ -804,6 +812,49 @@ return props; } + /** + * Retrieve the cached layout view page location. This method provides an + * easy way to turn on/off caching of layout view page locations. By + * default, view page locations are stored in the portlet session. Set the + * Jetspeed property layout.page.storeViewPageInSession to + * true / false to turn on / off caching. + * + * @param request + * portlet request + * @param viewPageType + * the view page type, see the + * PortalReservedParameters.PAGE_LAYOUT_* parameters. + * @return the cached view page location + */ + protected String getCachedLayoutViewPage(RenderRequest request, + String viewPageType) + { + return storeViewPageInSession ? (String) request.getPortletSession() + .getAttribute(viewPageType) : null; + } + + /** + * Cache a layout view page location. By default, the value is stored in the + * portlet session. + * + * @param request + * portlet request + * @param viewPageType + * the type of the view page (e.g. help, maximized view, solo, + * etc.). See the PortalReservedParameters.PAGE_LAYOUT_* + * parameters. + * @param page + * the view page to cache + */ + protected void cacheLayoutViewPage(RenderRequest request, + String viewPageType, String page) + { + if (storeViewPageInSession) + { + request.getPortletSession().setAttribute(viewPageType, page); + } + } + class CachedTemplate { Modified: pal-portal/branches/pal-portal-1.x/portal/jetspeed-2/layout-portlets/src/webapp/WEB-INF/jetspeed-portlet.xml =================================================================== --- pal-portal/branches/pal-portal-1.x/portal/jetspeed-2/layout-portlets/src/webapp/WEB-INF/jetspeed-portlet.xml 2008-06-19 22:26:05 UTC (rev 993) +++ pal-portal/branches/pal-portal-1.x/portal/jetspeed-2/layout-portlets/src/webapp/WEB-INF/jetspeed-portlet.xml 2008-06-25 05:12:58 UTC (rev 994) @@ -43,6 +43,7 @@ + Modified: pal-portal/branches/pal-portal-1.x/portal/jetspeed-2/src/webapp/WEB-INF/conf/jetspeed.properties =================================================================== --- pal-portal/branches/pal-portal-1.x/portal/jetspeed-2/src/webapp/WEB-INF/conf/jetspeed.properties 2008-06-19 22:26:05 UTC (rev 993) +++ pal-portal/branches/pal-portal-1.x/portal/jetspeed-2/src/webapp/WEB-INF/conf/jetspeed.properties 2008-06-25 05:12:58 UTC (rev 994) @@ -193,6 +193,8 @@ #------------------------------------------------------------------------- # the default page layout if none is specified layout.page.default = jetspeed-layouts::VelocityTwoColumns +# optimization for looking up LayoutPortlet Page template, default == true +layout.page.storeViewPageInSession = true #------------------------------------------------------------------------- # D E C O R A T O R S From svnnotify @ sourceforge.jp Wed Jun 25 15:33:34 2008 From: svnnotify @ sourceforge.jp (svnnotify @ sourceforge.jp) Date: Wed, 25 Jun 2008 15:33:34 +0900 Subject: [pal-cvs 3261] [995] apply patch 'r669899: Fix incorrect setting of the target contextName of portlet apps when hot deploying from the deploy folder ' Message-ID: <1214375614.140101.7939.nullmailer@users.sourceforge.jp> Revision: 995 http://svn.sourceforge.jp/cgi-bin/viewcvs.cgi?root=pal&view=rev&rev=995 Author: sone Date: 2008-06-25 15:33:34 +0900 (Wed, 25 Jun 2008) Log Message: ----------- apply patch 'r669899: Fix incorrect setting of the target contextName of portlet apps when hot deploying from the deploy folder' Modified Paths: -------------- pal-portal/branches/pal-portal-1.x/portal/jetspeed-2/components/deploy-tool/src/java/org/apache/jetspeed/tools/deploy/JetspeedDeploy.java pal-portal/branches/pal-portal-1.x/portal/jetspeed-2/components/deploy-tool/src/java/org/apache/jetspeed/tools/deploy/JetspeedDeployFactory.java pal-portal/branches/pal-portal-1.x/portal/jetspeed-2/components/portal/src/java/org/apache/jetspeed/deployment/impl/DeployPortletAppEventListener.java pal-portal/branches/pal-portal-1.x/portal/jetspeed-2/jetspeed-api/src/java/org/apache/jetspeed/tools/deploy/DeployFactory.java -------------- next part -------------- Modified: pal-portal/branches/pal-portal-1.x/portal/jetspeed-2/components/deploy-tool/src/java/org/apache/jetspeed/tools/deploy/JetspeedDeploy.java =================================================================== --- pal-portal/branches/pal-portal-1.x/portal/jetspeed-2/components/deploy-tool/src/java/org/apache/jetspeed/tools/deploy/JetspeedDeploy.java 2008-06-25 05:12:58 UTC (rev 994) +++ pal-portal/branches/pal-portal-1.x/portal/jetspeed-2/components/deploy-tool/src/java/org/apache/jetspeed/tools/deploy/JetspeedDeploy.java 2008-06-25 06:33:34 UTC (rev 995) @@ -47,7 +47,7 @@ public static void main(String[] args) throws Exception { - if (args.length < 2) + if (args.length < 3) { printUsage(); System.exit(1); @@ -56,14 +56,14 @@ boolean stripLoggers = false; String version = null; - for (int i = 0; i < args.length - 2; i++) + for (int i = 0; i < args.length - 3; i++) { String option = args[i]; if (option.equals("-s")) { stripLoggers = true; } - else if (option.equals("-v") && i < args.length - 3) + else if (option.equals("-v") && i < args.length - 4) { version = args[i + 1]; i++; @@ -77,14 +77,14 @@ } } - new JetspeedDeploy(args[args.length - 2], args[args.length - 1], - stripLoggers, version); + new JetspeedDeploy(args[args.length - 3], args[args.length - 2], + args[args.length - 1], stripLoggers, version); } private static void printUsage() { System.out - .println("Usage: java -jar jetspeed-deploy-tools-.jar [options] INPUT OUTPUT"); + .println("Usage: java -jar jetspeed-deploy-tools-.jar [options] INPUT OUTPUT CONTEXT"); System.out.println("Options:"); System.out .println(" -s: stripLoggers - remove commons-logging[version].jar and/or log4j[version].jar from war"); @@ -99,14 +99,16 @@ private final byte[] buffer = new byte[4096]; public JetspeedDeploy(String inputName, String outputName, - boolean stripLoggers) throws Exception + String contextName, boolean stripLoggers) throws Exception { - this(inputName, outputName, stripLoggers, null); + this(inputName, outputName, contextName, stripLoggers, null); } public JetspeedDeploy(String inputName, String outputName, - boolean stripLoggers, String forcedVersion) throws Exception + String contextName, boolean stripLoggers, String forcedVersion) + throws Exception { + File tempFile = null; JarFile jin = null; JarOutputStream jout = null; @@ -115,7 +117,7 @@ try { - String portletApplicationName = getPortletApplicationName(outputName); + String portletApplicationName = contextName; tempFile = File.createTempFile(portletApplicationName, ""); tempFile.deleteOnExit(); @@ -355,26 +357,4 @@ } } } - - protected String getPortletApplicationName(String path) - { - File file = new File(path); - String name = file.getName(); - String portletApplicationName = name; - - int index = name.lastIndexOf("-infused.war"); - if (index > -1) - { - portletApplicationName = name.substring(0, index); - } - else - { - index = name.lastIndexOf("."); - if (index > -1) - { - portletApplicationName = name.substring(0, index); - } - } - return portletApplicationName; - } } \ No newline at end of file Modified: pal-portal/branches/pal-portal-1.x/portal/jetspeed-2/components/deploy-tool/src/java/org/apache/jetspeed/tools/deploy/JetspeedDeployFactory.java =================================================================== --- pal-portal/branches/pal-portal-1.x/portal/jetspeed-2/components/deploy-tool/src/java/org/apache/jetspeed/tools/deploy/JetspeedDeployFactory.java 2008-06-25 05:12:58 UTC (rev 994) +++ pal-portal/branches/pal-portal-1.x/portal/jetspeed-2/components/deploy-tool/src/java/org/apache/jetspeed/tools/deploy/JetspeedDeployFactory.java 2008-06-25 06:33:34 UTC (rev 995) @@ -25,11 +25,23 @@ public class JetspeedDeployFactory implements DeployFactory { + public JetspeedDeployFactory() + { + } + /** - * JetspeedDeployFactory + * getInstance + * + * @param inputWarPath + * @param outputWarPath + * @param stripLoggers + * @return JetspeedDeploy instance */ - public JetspeedDeployFactory() + public Deploy getInstance(String inputWarPath, String outputWarPath, + String contextName, boolean stripLoggers) throws Exception { + return new JetspeedDeploy(inputWarPath, outputWarPath, contextName, + stripLoggers); } /** @@ -38,11 +50,14 @@ * @param inputWarPath * @param outputWarPath * @param stripLoggers + * @param forcedVersion * @return JetspeedDeploy instance */ public Deploy getInstance(String inputWarPath, String outputWarPath, - boolean stripLoggers) throws Exception + String contextName, boolean stripLoggers, String forcedVersion) + throws Exception { - return new JetspeedDeploy(inputWarPath, outputWarPath, stripLoggers); + return new JetspeedDeploy(inputWarPath, outputWarPath, contextName, + stripLoggers, forcedVersion); } } Modified: pal-portal/branches/pal-portal-1.x/portal/jetspeed-2/components/portal/src/java/org/apache/jetspeed/deployment/impl/DeployPortletAppEventListener.java =================================================================== --- pal-portal/branches/pal-portal-1.x/portal/jetspeed-2/components/portal/src/java/org/apache/jetspeed/deployment/impl/DeployPortletAppEventListener.java 2008-06-25 05:12:58 UTC (rev 994) +++ pal-portal/branches/pal-portal-1.x/portal/jetspeed-2/components/portal/src/java/org/apache/jetspeed/deployment/impl/DeployPortletAppEventListener.java 2008-06-25 06:33:34 UTC (rev 995) @@ -244,9 +244,12 @@ { try { - File toFile = new File(webAppDir, event.getName()); + String fileName = event.getName(); + File toFile = new File(webAppDir, fileName); + String contextName = fileName.substring(0, fileName.length() - 4); // strip + // ".war" new JetspeedDeploy(event.getPath(), toFile.getAbsolutePath(), - stripLoggers); + contextName, stripLoggers); event.setStatus(DeploymentStatus.STATUS_OKAY); } catch (Exception e) Modified: pal-portal/branches/pal-portal-1.x/portal/jetspeed-2/jetspeed-api/src/java/org/apache/jetspeed/tools/deploy/DeployFactory.java =================================================================== --- pal-portal/branches/pal-portal-1.x/portal/jetspeed-2/jetspeed-api/src/java/org/apache/jetspeed/tools/deploy/DeployFactory.java 2008-06-25 05:12:58 UTC (rev 994) +++ pal-portal/branches/pal-portal-1.x/portal/jetspeed-2/jetspeed-api/src/java/org/apache/jetspeed/tools/deploy/DeployFactory.java 2008-06-25 06:33:34 UTC (rev 995) @@ -22,6 +22,7 @@ * @author Randy Watler * @version $Id: DeployFactory.java 516881 2007-03-11 10:34:21Z ate $ */ + public interface DeployFactory { @@ -34,5 +35,18 @@ * @return Deploy instance */ public Deploy getInstance(String inputWarPath, String outputWarPath, - boolean stripLoggers) throws Exception; + String contextName, boolean stripLoggers) throws Exception; + + /** + * getInstance + * + * @param inputWarPath + * @param outputWarPath + * @param stripLoggers + * @param forcedVersion + * @return Deploy instance + */ + public Deploy getInstance(String inputWarPath, String outputWarPath, + String contextName, boolean stripLoggers, String forcedVersion) + throws Exception; } From svnnotify @ sourceforge.jp Wed Jun 25 16:20:28 2008 From: svnnotify @ sourceforge.jp (svnnotify @ sourceforge.jp) Date: Wed, 25 Jun 2008 16:20:28 +0900 Subject: [pal-cvs 3262] [996] java 6 support Message-ID: <1214378428.132281.11106.nullmailer@users.sourceforge.jp> Revision: 996 http://svn.sourceforge.jp/cgi-bin/viewcvs.cgi?root=pal&view=rev&rev=996 Author: sone Date: 2008-06-25 16:20:27 +0900 (Wed, 25 Jun 2008) Log Message: ----------- java 6 support Modified Paths: -------------- pal-portal/branches/pal-portal-1.x/portal/jetspeed-2/components/rdbms/src/java/org/apache/jetspeed/components/rdbms/ojb/ConnectionRepositoryEntry.java pal-portal/branches/pal-portal-1.x/portal/jetspeed-2/project.properties -------------- next part -------------- Modified: pal-portal/branches/pal-portal-1.x/portal/jetspeed-2/components/rdbms/src/java/org/apache/jetspeed/components/rdbms/ojb/ConnectionRepositoryEntry.java =================================================================== --- pal-portal/branches/pal-portal-1.x/portal/jetspeed-2/components/rdbms/src/java/org/apache/jetspeed/components/rdbms/ojb/ConnectionRepositoryEntry.java 2008-06-25 06:33:34 UTC (rev 995) +++ pal-portal/branches/pal-portal-1.x/portal/jetspeed-2/components/rdbms/src/java/org/apache/jetspeed/components/rdbms/ojb/ConnectionRepositoryEntry.java 2008-06-25 07:20:27 UTC (rev 996) @@ -469,7 +469,17 @@ { this.jcd = jcd; } - + public boolean isWrapperFor(Class iface) throws SQLException + { + return false; + // #ifdef JDBC4 return getConnection().isWrapperFor(iface); + } + + T unwrap(Class iface) throws SQLException + { + throw new SQLException("PoolingDataSource is not a wrapper."); + // #ifdef JDBC4 return getConnection().unwrap(iface); + } /* * (non-Javadoc) * Modified: pal-portal/branches/pal-portal-1.x/portal/jetspeed-2/project.properties =================================================================== --- pal-portal/branches/pal-portal-1.x/portal/jetspeed-2/project.properties 2008-06-25 06:33:34 UTC (rev 995) +++ pal-portal/branches/pal-portal-1.x/portal/jetspeed-2/project.properties 2008-06-25 07:20:27 UTC (rev 996) @@ -64,8 +64,8 @@ maven.xdoc.version = ${pom.currentVersion} # Maven Compilation Setting -maven.compile.source=1.4 -maven.compile.target=1.4 +maven.compile.source=1.5 +maven.compile.target=1.5 maven.compile.deprecation=on # Whether to skip tests. From svnnotify @ sourceforge.jp Wed Jun 25 17:18:35 2008 From: svnnotify @ sourceforge.jp (svnnotify @ sourceforge.jp) Date: Wed, 25 Jun 2008 17:18:35 +0900 Subject: [pal-cvs 3263] [997] apply patch 'r656971: Part fix for JS2-812: Better support for MSSQL .' Message-ID: <1214381915.372991.24944.nullmailer@users.sourceforge.jp> Revision: 997 http://svn.sourceforge.jp/cgi-bin/viewcvs.cgi?root=pal&view=rev&rev=997 Author: sone Date: 2008-06-25 17:18:35 +0900 (Wed, 25 Jun 2008) Log Message: ----------- apply patch 'r656971: Part fix for JS2-812: Better support for MSSQL.' Modified Paths: -------------- pal-portal/branches/pal-portal-1.x/portal/jetspeed-2/etc/sql/mssql/schema/drop-triggers.sql Added Paths: ----------- pal-portal/branches/pal-portal-1.x/portal/jetspeed-2/etc/sql/mssql/schema/prefs-schema.sql pal-portal/branches/pal-portal-1.x/portal/jetspeed-2/etc/sql/mssql/schema/tg_prefs_node.sql -------------- next part -------------- Modified: pal-portal/branches/pal-portal-1.x/portal/jetspeed-2/etc/sql/mssql/schema/drop-triggers.sql =================================================================== --- pal-portal/branches/pal-portal-1.x/portal/jetspeed-2/etc/sql/mssql/schema/drop-triggers.sql 2008-06-25 07:20:27 UTC (rev 996) +++ pal-portal/branches/pal-portal-1.x/portal/jetspeed-2/etc/sql/mssql/schema/drop-triggers.sql 2008-06-25 08:18:35 UTC (rev 997) @@ -9,6 +9,9 @@ IF EXISTS (SELECT 1 FROM sysobjects WHERE type ='TR' AND name='trig_fragment') DROP TRIGGER trig_fragment; + +IF EXISTS (SELECT 1 FROM sysobjects WHERE type ='TR' AND name='trig_prefs_node') + DROP TRIGGER trig_prefs_node; IF EXISTS (SELECT 1 FROM sysobjects WHERE type ='TR' AND name='trig_security_principal') DROP TRIGGER trig_security_principal; Added: pal-portal/branches/pal-portal-1.x/portal/jetspeed-2/etc/sql/mssql/schema/prefs-schema.sql =================================================================== --- pal-portal/branches/pal-portal-1.x/portal/jetspeed-2/etc/sql/mssql/schema/prefs-schema.sql (rev 0) +++ pal-portal/branches/pal-portal-1.x/portal/jetspeed-2/etc/sql/mssql/schema/prefs-schema.sql 2008-06-25 08:18:35 UTC (rev 997) @@ -0,0 +1,128 @@ + +/* ---------------------------------------------------------------------- */ +/* PREFS_NODE */ +/* ---------------------------------------------------------------------- */ + +IF EXISTS (SELECT 1 FROM sysobjects WHERE type ='RI' AND name='FK_PREFS_NODE_1') + ALTER TABLE PREFS_NODE DROP CONSTRAINT FK_PREFS_NODE_1; +IF EXISTS (SELECT 1 FROM sysobjects WHERE type = 'U' AND name = 'PREFS_NODE') +BEGIN + DECLARE @reftable_1 nvarchar(60), @constraintname_1 nvarchar(60) + DECLARE refcursor CURSOR FOR + select reftables.name tablename, cons.name constraintname + from sysobjects tables, + sysobjects reftables, + sysobjects cons, + sysreferences ref + where tables.id = ref.rkeyid + and cons.id = ref.constid + and reftables.id = ref.fkeyid + and tables.name = 'PREFS_NODE' + OPEN refcursor + FETCH NEXT from refcursor into @reftable_1, @constraintname_1 + while @@FETCH_STATUS = 0 + BEGIN + exec ('alter table '+ @ reftable_1+' drop constraint '+ @ constraintname_1) + FETCH NEXT from refcursor into @reftable_1, @constraintname_1 + END + CLOSE refcursor + DEALLOCATE refcursor + DROP TABLE PREFS_NODE +END +; + +CREATE TABLE PREFS_NODE +( + NODE_ID INT NOT NULL, + PARENT_NODE_ID INT NULL, + NODE_NAME VARCHAR (100) NULL, + NODE_TYPE SMALLINT NULL, + FULL_PATH VARCHAR (254) NULL, + CREATION_DATE DATETIME NULL, + MODIFIED_DATE DATETIME NULL, + + CONSTRAINT PREFS_NODE_PK PRIMARY KEY(NODE_ID)); + +CREATE INDEX IX_PREFS_NODE_1 ON PREFS_NODE (PARENT_NODE_ID); +CREATE INDEX IX_PREFS_NODE_2 ON PREFS_NODE (FULL_PATH); + + + + +/* ---------------------------------------------------------------------- */ +/* PREFS_PROPERTY_VALUE */ +/* ---------------------------------------------------------------------- */ + +IF EXISTS (SELECT 1 FROM sysobjects WHERE type ='RI' AND name='PREFS_PROPERTY_VALUE_FK_1') + ALTER TABLE PREFS_PROPERTY_VALUE DROP CONSTRAINT PREFS_PROPERTY_VALUE_FK_1; +IF EXISTS (SELECT 1 FROM sysobjects WHERE type = 'U' AND name = 'PREFS_PROPERTY_VALUE') +BEGIN + DECLARE @reftable_2 nvarchar(60), @constraintname_2 nvarchar(60) + DECLARE refcursor CURSOR FOR + select reftables.name tablename, cons.name constraintname + from sysobjects tables, + sysobjects reftables, + sysobjects cons, + sysreferences ref + where tables.id = ref.rkeyid + and cons.id = ref.constid + and reftables.id = ref.fkeyid + and tables.name = 'PREFS_PROPERTY_VALUE' + OPEN refcursor + FETCH NEXT from refcursor into @reftable_2, @constraintname_2 + while @@FETCH_STATUS = 0 + BEGIN + exec ('alter table '+ @ reftable_2+' drop constraint '+ @ constraintname_2) + FETCH NEXT from refcursor into @reftable_2, @constraintname_2 + END + CLOSE refcursor + DEALLOCATE refcursor + DROP TABLE PREFS_PROPERTY_VALUE +END +; + +CREATE TABLE PREFS_PROPERTY_VALUE +( + PROPERTY_VALUE_ID INT NOT NULL, + NODE_ID INT NULL, + PROPERTY_NAME VARCHAR (100) NULL, + PROPERTY_VALUE VARCHAR (254) NULL, + CREATION_DATE DATETIME NULL, + MODIFIED_DATE DATETIME NULL, + + CONSTRAINT PREFS_PROPERTY_VALUE_PK PRIMARY KEY(PROPERTY_VALUE_ID)); + +CREATE INDEX IX_FKPPV_1 ON PREFS_PROPERTY_VALUE (NODE_ID); + + + + +/* ---------------------------------------------------------------------- */ +/* PREFS_PROPERTY_VALUE */ +/* ---------------------------------------------------------------------- */ + +BEGIN +ALTER TABLE PREFS_NODE + ADD CONSTRAINT FK_PREFS_NODE_1 FOREIGN KEY (PARENT_NODE_ID) + REFERENCES PREFS_NODE (NODE_ID) + ON DELETE NO ACTION ON UPDATE NO ACTION +END +; + + + + +/* ---------------------------------------------------------------------- */ +/* PREFS_NODE */ +/* ---------------------------------------------------------------------- */ + +BEGIN +ALTER TABLE PREFS_PROPERTY_VALUE + ADD CONSTRAINT PREFS_PROPERTY_VALUE_FK_1 FOREIGN KEY (NODE_ID) + REFERENCES PREFS_NODE (NODE_ID) + ON DELETE CASCADE +END +; + + + Added: pal-portal/branches/pal-portal-1.x/portal/jetspeed-2/etc/sql/mssql/schema/tg_prefs_node.sql =================================================================== --- pal-portal/branches/pal-portal-1.x/portal/jetspeed-2/etc/sql/mssql/schema/tg_prefs_node.sql (rev 0) +++ pal-portal/branches/pal-portal-1.x/portal/jetspeed-2/etc/sql/mssql/schema/tg_prefs_node.sql 2008-06-25 08:18:35 UTC (rev 997) @@ -0,0 +1,19 @@ +CREATE TRIGGER trig_prefs_node +ON prefs_node +INSTEAD OF DELETE +AS +WITH cte AS +( SELECT node_id, parent_node_id + FROM DELETED + UNION ALL + SELECT c.node_id, c.parent_node_id + FROM prefs_node AS c + INNER JOIN cte AS p + ON c.parent_node_id = p.node_id +) +DELETE a +FROM prefs_node AS a +INNER JOIN cte AS b +ON a.node_id = b.node_id +OPTION (MAXRECURSION 0) +; From svnnotify @ sourceforge.jp Wed Jun 25 17:56:07 2008 From: svnnotify @ sourceforge.jp (svnnotify @ sourceforge.jp) Date: Wed, 25 Jun 2008 17:56:07 +0900 Subject: [pal-cvs 3264] [998] fix login.css for firefox3 (on linux) Message-ID: <1214384167.773413.20540.nullmailer@users.sourceforge.jp> Revision: 998 http://svn.sourceforge.jp/cgi-bin/viewcvs.cgi?root=pal&view=rev&rev=998 Author: sone Date: 2008-06-25 17:56:07 +0900 (Wed, 25 Jun 2008) Log Message: ----------- fix login.css for firefox3 (on linux) Modified Paths: -------------- pal-portal/branches/pal-portal-1.x/portal/jetspeed-2/src/webapp/css/login.css -------------- next part -------------- Modified: pal-portal/branches/pal-portal-1.x/portal/jetspeed-2/src/webapp/css/login.css =================================================================== --- pal-portal/branches/pal-portal-1.x/portal/jetspeed-2/src/webapp/css/login.css 2008-06-25 08:18:35 UTC (rev 997) +++ pal-portal/branches/pal-portal-1.x/portal/jetspeed-2/src/webapp/css/login.css 2008-06-25 08:56:07 UTC (rev 998) @@ -52,6 +52,7 @@ .input input { font-family: Arial, Helvetica, sans-serif; font-size: 11px; + width: 200px; } .action { padding:0px; From svnnotify @ sourceforge.jp Sun Jun 29 05:16:53 2008 From: svnnotify @ sourceforge.jp (svnnotify @ sourceforge.jp) Date: Sun, 29 Jun 2008 05:16:53 +0900 Subject: [pal-cvs 3265] [999] changed compiler to 1.5 Message-ID: <1214684213.483514.12007.nullmailer@users.sourceforge.jp> Revision: 999 http://svn.sourceforge.jp/cgi-bin/viewcvs.cgi?root=pal&view=rev&rev=999 Author: shinsuke Date: 2008-06-29 05:16:53 +0900 (Sun, 29 Jun 2008) Log Message: ----------- changed compiler to 1.5 Modified Paths: -------------- pal-portal/branches/pal-portal-1.x/portal/jetspeed-2/.settings/org.eclipse.jdt.core.prefs -------------- next part -------------- Modified: pal-portal/branches/pal-portal-1.x/portal/jetspeed-2/.settings/org.eclipse.jdt.core.prefs =================================================================== --- pal-portal/branches/pal-portal-1.x/portal/jetspeed-2/.settings/org.eclipse.jdt.core.prefs 2008-06-25 08:56:07 UTC (rev 998) +++ pal-portal/branches/pal-portal-1.x/portal/jetspeed-2/.settings/org.eclipse.jdt.core.prefs 2008-06-28 20:16:53 UTC (rev 999) @@ -1,15 +1,15 @@ -#Fri May 16 09:54:06 JST 2008 +#Sat Jun 28 06:53:00 JST 2008 eclipse.preferences.version=1 org.eclipse.jdt.core.compiler.codegen.inlineJsrBytecode=enabled -org.eclipse.jdt.core.compiler.codegen.targetPlatform=1.4 +org.eclipse.jdt.core.compiler.codegen.targetPlatform=1.5 org.eclipse.jdt.core.compiler.codegen.unusedLocal=preserve -org.eclipse.jdt.core.compiler.compliance=1.4 +org.eclipse.jdt.core.compiler.compliance=1.5 org.eclipse.jdt.core.compiler.debug.lineNumber=generate org.eclipse.jdt.core.compiler.debug.localVariable=generate org.eclipse.jdt.core.compiler.debug.sourceFile=generate org.eclipse.jdt.core.compiler.problem.assertIdentifier=error -org.eclipse.jdt.core.compiler.problem.enumIdentifier=warning -org.eclipse.jdt.core.compiler.source=1.4 +org.eclipse.jdt.core.compiler.problem.enumIdentifier=error +org.eclipse.jdt.core.compiler.source=1.5 org.eclipse.jdt.core.formatter.align_type_members_on_columns=false org.eclipse.jdt.core.formatter.alignment_for_arguments_in_allocation_expression=16 org.eclipse.jdt.core.formatter.alignment_for_arguments_in_enum_constant=16 From svnnotify @ sourceforge.jp Mon Jun 30 11:28:36 2008 From: svnnotify @ sourceforge.jp (svnnotify @ sourceforge.jp) Date: Mon, 30 Jun 2008 11:28:36 +0900 Subject: [pal-cvs 3266] [1000] created announcement portlet. Message-ID: <1214792916.848684.9029.nullmailer@users.sourceforge.jp> Revision: 1000 http://svn.sourceforge.jp/cgi-bin/viewcvs.cgi?root=pal&view=rev&rev=1000 Author: shinsuke Date: 2008-06-30 11:28:36 +0900 (Mon, 30 Jun 2008) Log Message: ----------- created announcement portlet. Added Paths: ----------- announcement/ -------------- next part -------------- From svnnotify @ sourceforge.jp Mon Jun 30 11:28:47 2008 From: svnnotify @ sourceforge.jp (svnnotify @ sourceforge.jp) Date: Mon, 30 Jun 2008 11:28:47 +0900 Subject: [pal-cvs 3267] [1001] created trunk. Message-ID: <1214792927.291602.9110.nullmailer@users.sourceforge.jp> Revision: 1001 http://svn.sourceforge.jp/cgi-bin/viewcvs.cgi?root=pal&view=rev&rev=1001 Author: shinsuke Date: 2008-06-30 11:28:47 +0900 (Mon, 30 Jun 2008) Log Message: ----------- created trunk. Added Paths: ----------- announcement/trunk/ -------------- next part -------------- From svnnotify @ sourceforge.jp Mon Jun 30 11:54:28 2008 From: svnnotify @ sourceforge.jp (svnnotify @ sourceforge.jp) Date: Mon, 30 Jun 2008 11:54:28 +0900 Subject: [pal-cvs 3268] [1002] initial commit. Message-ID: <1214794468.377280.30735.nullmailer@users.sourceforge.jp> Revision: 1002 http://svn.sourceforge.jp/cgi-bin/viewcvs.cgi?root=pal&view=rev&rev=1002 Author: shinsuke Date: 2008-06-30 11:54:27 +0900 (Mon, 30 Jun 2008) Log Message: ----------- initial commit. Added Paths: ----------- announcement/trunk/.classpath announcement/trunk/.project announcement/trunk/.settings/ announcement/trunk/.settings/org.eclipse.jdt.core.prefs announcement/trunk/.settings/org.eclipse.jdt.ui.prefs announcement/trunk/.settings/org.seasar.dolteng.eclipse.prefs announcement/trunk/dbflute/ announcement/trunk/dbflute/_project.bat announcement/trunk/dbflute/_project.sh announcement/trunk/dbflute/build-announcement.properties announcement/trunk/dbflute/dfprop/ announcement/trunk/dbflute/dfprop/databaseInfoMap.dfprop announcement/trunk/dbflute/doc.bat announcement/trunk/dbflute/doc.sh announcement/trunk/dbflute/generate.bat announcement/trunk/dbflute/generate.sh announcement/trunk/dbflute/jdbc.bat announcement/trunk/dbflute/jdbc.sh announcement/trunk/dbflute/log/ announcement/trunk/dbflute/log/readme.txt announcement/trunk/dbflute/output/ announcement/trunk/dbflute/output/doc/ announcement/trunk/dbflute/output/doc/readme.txt announcement/trunk/dbflute/outside-sql-test.bat announcement/trunk/dbflute/outside-sql-test.sh announcement/trunk/dbflute/playsql/ announcement/trunk/dbflute/playsql/replace-schema.sql announcement/trunk/dbflute/replace-schema.bat announcement/trunk/dbflute/replace-schema.sh announcement/trunk/dbflute/schema/ announcement/trunk/dbflute/schema/readme.txt announcement/trunk/dbflute/sql2entity.bat announcement/trunk/dbflute/sql2entity.sh announcement/trunk/mydbflute/ announcement/trunk/mydbflute/readme.txt announcement/trunk/pom.xml announcement/trunk/src/ announcement/trunk/src/main/ announcement/trunk/src/main/config/ announcement/trunk/src/main/config/clay/ announcement/trunk/src/main/config/clay/announcement.clay announcement/trunk/src/main/config/sql/ announcement/trunk/src/main/config/sql/mysql/ announcement/trunk/src/main/config/sql/mysql/announcement.sql announcement/trunk/src/main/java/ announcement/trunk/src/main/java/jp/ announcement/trunk/src/main/java/jp/sf/ announcement/trunk/src/main/java/jp/sf/pal/ announcement/trunk/src/main/java/jp/sf/pal/announcement/ announcement/trunk/src/main/java/jp/sf/pal/announcement/AnnouncementConstraints.java announcement/trunk/src/main/java/jp/sf/pal/announcement/db/ announcement/trunk/src/main/java/jp/sf/pal/announcement/db/allcommon/ announcement/trunk/src/main/java/jp/sf/pal/announcement/db/allcommon/AccessContext.java announcement/trunk/src/main/java/jp/sf/pal/announcement/db/allcommon/BFinder.java announcement/trunk/src/main/java/jp/sf/pal/announcement/db/allcommon/BehaviorSelector.java announcement/trunk/src/main/java/jp/sf/pal/announcement/db/allcommon/CacheAbstractSelector.java announcement/trunk/src/main/java/jp/sf/pal/announcement/db/allcommon/CacheBehaviorSelector.java announcement/trunk/src/main/java/jp/sf/pal/announcement/db/allcommon/CacheDaoSelector.java announcement/trunk/src/main/java/jp/sf/pal/announcement/db/allcommon/DBFluteConfig.java announcement/trunk/src/main/java/jp/sf/pal/announcement/db/allcommon/DaoReadable.java announcement/trunk/src/main/java/jp/sf/pal/announcement/db/allcommon/DaoSelector.java announcement/trunk/src/main/java/jp/sf/pal/announcement/db/allcommon/DaoWritable.java announcement/trunk/src/main/java/jp/sf/pal/announcement/db/allcommon/Entity.java announcement/trunk/src/main/java/jp/sf/pal/announcement/db/allcommon/EntityDefinedCommonColumn.java announcement/trunk/src/main/java/jp/sf/pal/announcement/db/allcommon/GenMetaData.java announcement/trunk/src/main/java/jp/sf/pal/announcement/db/allcommon/InternalMapContext.java announcement/trunk/src/main/java/jp/sf/pal/announcement/db/allcommon/QLog.java announcement/trunk/src/main/java/jp/sf/pal/announcement/db/allcommon/XLog.java announcement/trunk/src/main/java/jp/sf/pal/announcement/db/allcommon/annotation/ announcement/trunk/src/main/java/jp/sf/pal/announcement/db/allcommon/annotation/OutsideSql.java announcement/trunk/src/main/java/jp/sf/pal/announcement/db/allcommon/bhv/ announcement/trunk/src/main/java/jp/sf/pal/announcement/db/allcommon/bhv/AbstractBehaviorReadable.java announcement/trunk/src/main/java/jp/sf/pal/announcement/db/allcommon/bhv/AbstractBehaviorWritable.java announcement/trunk/src/main/java/jp/sf/pal/announcement/db/allcommon/bhv/BehaviorReadable.java announcement/trunk/src/main/java/jp/sf/pal/announcement/db/allcommon/bhv/BehaviorWritable.java announcement/trunk/src/main/java/jp/sf/pal/announcement/db/allcommon/bhv/batch/ announcement/trunk/src/main/java/jp/sf/pal/announcement/db/allcommon/bhv/batch/TokenFileOutputOption.java announcement/trunk/src/main/java/jp/sf/pal/announcement/db/allcommon/bhv/batch/TokenFileOutputResult.java announcement/trunk/src/main/java/jp/sf/pal/announcement/db/allcommon/bhv/batch/TokenFileReflectionFailure.java announcement/trunk/src/main/java/jp/sf/pal/announcement/db/allcommon/bhv/batch/TokenFileReflectionOption.java announcement/trunk/src/main/java/jp/sf/pal/announcement/db/allcommon/bhv/batch/TokenFileReflectionResult.java announcement/trunk/src/main/java/jp/sf/pal/announcement/db/allcommon/bhv/load/ announcement/trunk/src/main/java/jp/sf/pal/announcement/db/allcommon/bhv/load/LoadRefererOption.java announcement/trunk/src/main/java/jp/sf/pal/announcement/db/allcommon/bhv/load/LoadReferrerOption.java announcement/trunk/src/main/java/jp/sf/pal/announcement/db/allcommon/bhv/setup/ announcement/trunk/src/main/java/jp/sf/pal/announcement/db/allcommon/bhv/setup/ConditionBeanSetupper.java announcement/trunk/src/main/java/jp/sf/pal/announcement/db/allcommon/bhv/setup/EntityListSetupper.java announcement/trunk/src/main/java/jp/sf/pal/announcement/db/allcommon/bhv/setup/ValueLabelBox.java announcement/trunk/src/main/java/jp/sf/pal/announcement/db/allcommon/bhv/setup/ValueLabelSetupper.java announcement/trunk/src/main/java/jp/sf/pal/announcement/db/allcommon/cbean/ announcement/trunk/src/main/java/jp/sf/pal/announcement/db/allcommon/cbean/AbstractConditionBean.java announcement/trunk/src/main/java/jp/sf/pal/announcement/db/allcommon/cbean/AbstractConditionQuery.java announcement/trunk/src/main/java/jp/sf/pal/announcement/db/allcommon/cbean/ConditionBean.java announcement/trunk/src/main/java/jp/sf/pal/announcement/db/allcommon/cbean/ConditionBeanContext.java announcement/trunk/src/main/java/jp/sf/pal/announcement/db/allcommon/cbean/ConditionQuery.java announcement/trunk/src/main/java/jp/sf/pal/announcement/db/allcommon/cbean/FetchNarrowingBean.java announcement/trunk/src/main/java/jp/sf/pal/announcement/db/allcommon/cbean/FetchNarrowingBeanContext.java announcement/trunk/src/main/java/jp/sf/pal/announcement/db/allcommon/cbean/ListResultBean.java announcement/trunk/src/main/java/jp/sf/pal/announcement/db/allcommon/cbean/MapParameterBean.java announcement/trunk/src/main/java/jp/sf/pal/announcement/db/allcommon/cbean/OrderByBean.java announcement/trunk/src/main/java/jp/sf/pal/announcement/db/allcommon/cbean/PagingBean.java announcement/trunk/src/main/java/jp/sf/pal/announcement/db/allcommon/cbean/PagingHandler.java announcement/trunk/src/main/java/jp/sf/pal/announcement/db/allcommon/cbean/PagingInvoker.java announcement/trunk/src/main/java/jp/sf/pal/announcement/db/allcommon/cbean/PagingResultBean.java announcement/trunk/src/main/java/jp/sf/pal/announcement/db/allcommon/cbean/ResultBeanBuilder.java announcement/trunk/src/main/java/jp/sf/pal/announcement/db/allcommon/cbean/SelectResource.java announcement/trunk/src/main/java/jp/sf/pal/announcement/db/allcommon/cbean/SimpleOrderByBean.java announcement/trunk/src/main/java/jp/sf/pal/announcement/db/allcommon/cbean/SimplePagingBean.java announcement/trunk/src/main/java/jp/sf/pal/announcement/db/allcommon/cbean/ckey/ announcement/trunk/src/main/java/jp/sf/pal/announcement/db/allcommon/cbean/ckey/ConditionKey.java announcement/trunk/src/main/java/jp/sf/pal/announcement/db/allcommon/cbean/ckey/ConditionKeyEqual.java announcement/trunk/src/main/java/jp/sf/pal/announcement/db/allcommon/cbean/ckey/ConditionKeyGreaterEqual.java announcement/trunk/src/main/java/jp/sf/pal/announcement/db/allcommon/cbean/ckey/ConditionKeyGreaterThan.java announcement/trunk/src/main/java/jp/sf/pal/announcement/db/allcommon/cbean/ckey/ConditionKeyInScope.java announcement/trunk/src/main/java/jp/sf/pal/announcement/db/allcommon/cbean/ckey/ConditionKeyIsNotNull.java announcement/trunk/src/main/java/jp/sf/pal/announcement/db/allcommon/cbean/ckey/ConditionKeyIsNull.java announcement/trunk/src/main/java/jp/sf/pal/announcement/db/allcommon/cbean/ckey/ConditionKeyLessEqual.java announcement/trunk/src/main/java/jp/sf/pal/announcement/db/allcommon/cbean/ckey/ConditionKeyLessThan.java announcement/trunk/src/main/java/jp/sf/pal/announcement/db/allcommon/cbean/ckey/ConditionKeyLikeSearch.java announcement/trunk/src/main/java/jp/sf/pal/announcement/db/allcommon/cbean/ckey/ConditionKeyNotEqual.java announcement/trunk/src/main/java/jp/sf/pal/announcement/db/allcommon/cbean/ckey/ConditionKeyNotInScope.java announcement/trunk/src/main/java/jp/sf/pal/announcement/db/allcommon/cbean/ckey/ConditionKeyPrefixSearch.java announcement/trunk/src/main/java/jp/sf/pal/announcement/db/allcommon/cbean/coption/ announcement/trunk/src/main/java/jp/sf/pal/announcement/db/allcommon/cbean/coption/ConditionOption.java announcement/trunk/src/main/java/jp/sf/pal/announcement/db/allcommon/cbean/coption/DateFromToOption.java announcement/trunk/src/main/java/jp/sf/pal/announcement/db/allcommon/cbean/coption/FromToOption.java announcement/trunk/src/main/java/jp/sf/pal/announcement/db/allcommon/cbean/coption/InScopeOption.java announcement/trunk/src/main/java/jp/sf/pal/announcement/db/allcommon/cbean/coption/LikeSearchOption.java announcement/trunk/src/main/java/jp/sf/pal/announcement/db/allcommon/cbean/coption/SimpleStringOption.java announcement/trunk/src/main/java/jp/sf/pal/announcement/db/allcommon/cbean/coption/parts/ announcement/trunk/src/main/java/jp/sf/pal/announcement/db/allcommon/cbean/coption/parts/SplitOptionParts.java announcement/trunk/src/main/java/jp/sf/pal/announcement/db/allcommon/cbean/coption/parts/ToSingleByteOptionParts.java announcement/trunk/src/main/java/jp/sf/pal/announcement/db/allcommon/cbean/coption/parts/ToUpperLowerCaseOptionParts.java announcement/trunk/src/main/java/jp/sf/pal/announcement/db/allcommon/cbean/coption/parts/local/ announcement/trunk/src/main/java/jp/sf/pal/announcement/db/allcommon/cbean/coption/parts/local/JapaneseOptionPartsAgent.java announcement/trunk/src/main/java/jp/sf/pal/announcement/db/allcommon/cbean/cvalue/ announcement/trunk/src/main/java/jp/sf/pal/announcement/db/allcommon/cbean/cvalue/ConditionValue.java announcement/trunk/src/main/java/jp/sf/pal/announcement/db/allcommon/cbean/grouping/ announcement/trunk/src/main/java/jp/sf/pal/announcement/db/allcommon/cbean/grouping/GroupingOption.java announcement/trunk/src/main/java/jp/sf/pal/announcement/db/allcommon/cbean/grouping/GroupingRowEndDeterminer.java announcement/trunk/src/main/java/jp/sf/pal/announcement/db/allcommon/cbean/grouping/GroupingRowResource.java announcement/trunk/src/main/java/jp/sf/pal/announcement/db/allcommon/cbean/grouping/GroupingRowSetupper.java announcement/trunk/src/main/java/jp/sf/pal/announcement/db/allcommon/cbean/mapping/ announcement/trunk/src/main/java/jp/sf/pal/announcement/db/allcommon/cbean/mapping/EntityDtoMapper.java announcement/trunk/src/main/java/jp/sf/pal/announcement/db/allcommon/cbean/outsidesql/ announcement/trunk/src/main/java/jp/sf/pal/announcement/db/allcommon/cbean/outsidesql/OutsideSqlContext.java announcement/trunk/src/main/java/jp/sf/pal/announcement/db/allcommon/cbean/outsidesql/OutsideSqlDao.java announcement/trunk/src/main/java/jp/sf/pal/announcement/db/allcommon/cbean/outsidesql/OutsideSqlOption.java announcement/trunk/src/main/java/jp/sf/pal/announcement/db/allcommon/cbean/outsidesql/executor/ announcement/trunk/src/main/java/jp/sf/pal/announcement/db/allcommon/cbean/outsidesql/executor/OutsideSqlBasicExecutor.java announcement/trunk/src/main/java/jp/sf/pal/announcement/db/allcommon/cbean/outsidesql/executor/OutsideSqlCursorExecutor.java announcement/trunk/src/main/java/jp/sf/pal/announcement/db/allcommon/cbean/outsidesql/executor/OutsideSqlEntityExecutor.java announcement/trunk/src/main/java/jp/sf/pal/announcement/db/allcommon/cbean/outsidesql/executor/OutsideSqlPagingExecutor.java announcement/trunk/src/main/java/jp/sf/pal/announcement/db/allcommon/cbean/pagenavi/ announcement/trunk/src/main/java/jp/sf/pal/announcement/db/allcommon/cbean/pagenavi/PageNumberLink.java announcement/trunk/src/main/java/jp/sf/pal/announcement/db/allcommon/cbean/pagenavi/PageNumberLinkSetupper.java announcement/trunk/src/main/java/jp/sf/pal/announcement/db/allcommon/cbean/pagenavi/group/ announcement/trunk/src/main/java/jp/sf/pal/announcement/db/allcommon/cbean/pagenavi/group/PageGroupBean.java announcement/trunk/src/main/java/jp/sf/pal/announcement/db/allcommon/cbean/pagenavi/group/PageGroupOption.java announcement/trunk/src/main/java/jp/sf/pal/announcement/db/allcommon/cbean/pagenavi/range/ announcement/trunk/src/main/java/jp/sf/pal/announcement/db/allcommon/cbean/pagenavi/range/PageRangeBean.java announcement/trunk/src/main/java/jp/sf/pal/announcement/db/allcommon/cbean/pagenavi/range/PageRangeOption.java announcement/trunk/src/main/java/jp/sf/pal/announcement/db/allcommon/cbean/sqlclause/ announcement/trunk/src/main/java/jp/sf/pal/announcement/db/allcommon/cbean/sqlclause/AbstractSqlClause.java announcement/trunk/src/main/java/jp/sf/pal/announcement/db/allcommon/cbean/sqlclause/OrderByClause.java announcement/trunk/src/main/java/jp/sf/pal/announcement/db/allcommon/cbean/sqlclause/OrderByElement.java announcement/trunk/src/main/java/jp/sf/pal/announcement/db/allcommon/cbean/sqlclause/SqlClause.java announcement/trunk/src/main/java/jp/sf/pal/announcement/db/allcommon/cbean/sqlclause/SqlClauseDb2.java announcement/trunk/src/main/java/jp/sf/pal/announcement/db/allcommon/cbean/sqlclause/SqlClauseDefault.java announcement/trunk/src/main/java/jp/sf/pal/announcement/db/allcommon/cbean/sqlclause/SqlClauseDerby.java announcement/trunk/src/main/java/jp/sf/pal/announcement/db/allcommon/cbean/sqlclause/SqlClauseFirebird.java announcement/trunk/src/main/java/jp/sf/pal/announcement/db/allcommon/cbean/sqlclause/SqlClauseH2.java announcement/trunk/src/main/java/jp/sf/pal/announcement/db/allcommon/cbean/sqlclause/SqlClauseInterbase.java announcement/trunk/src/main/java/jp/sf/pal/announcement/db/allcommon/cbean/sqlclause/SqlClauseMySql.java announcement/trunk/src/main/java/jp/sf/pal/announcement/db/allcommon/cbean/sqlclause/SqlClauseOracle.java announcement/trunk/src/main/java/jp/sf/pal/announcement/db/allcommon/cbean/sqlclause/SqlClausePostgreSql.java announcement/trunk/src/main/java/jp/sf/pal/announcement/db/allcommon/cbean/sqlclause/SqlClauseSqlServer.java announcement/trunk/src/main/java/jp/sf/pal/announcement/db/allcommon/cbean/sqlclause/WhereClauseSimpleFilter.java announcement/trunk/src/main/java/jp/sf/pal/announcement/db/allcommon/dbmeta/ announcement/trunk/src/main/java/jp/sf/pal/announcement/db/allcommon/dbmeta/AbstractDBMeta.java announcement/trunk/src/main/java/jp/sf/pal/announcement/db/allcommon/dbmeta/DBMeta.java announcement/trunk/src/main/java/jp/sf/pal/announcement/db/allcommon/dbmeta/DBMetaInstanceHandler.java announcement/trunk/src/main/java/jp/sf/pal/announcement/db/allcommon/dbmeta/hierarchy/ announcement/trunk/src/main/java/jp/sf/pal/announcement/db/allcommon/dbmeta/hierarchy/HierarchyArranger.java announcement/trunk/src/main/java/jp/sf/pal/announcement/db/allcommon/dbmeta/hierarchy/HierarchyBasicRequest.java announcement/trunk/src/main/java/jp/sf/pal/announcement/db/allcommon/dbmeta/hierarchy/HierarchyRequest.java announcement/trunk/src/main/java/jp/sf/pal/announcement/db/allcommon/dbmeta/hierarchy/HierarchyRequestElement.java announcement/trunk/src/main/java/jp/sf/pal/announcement/db/allcommon/dbmeta/hierarchy/HierarchySourceColumn.java announcement/trunk/src/main/java/jp/sf/pal/announcement/db/allcommon/dbmeta/hierarchy/HierarchySourceIterator.java announcement/trunk/src/main/java/jp/sf/pal/announcement/db/allcommon/dbmeta/hierarchy/HierarchySourceRow.java announcement/trunk/src/main/java/jp/sf/pal/announcement/db/allcommon/dbmeta/hierarchy/basic/ announcement/trunk/src/main/java/jp/sf/pal/announcement/db/allcommon/dbmeta/hierarchy/basic/HierarchySourceEntityColumn.java announcement/trunk/src/main/java/jp/sf/pal/announcement/db/allcommon/dbmeta/hierarchy/basic/HierarchySourceEntityListIterator.java announcement/trunk/src/main/java/jp/sf/pal/announcement/db/allcommon/dbmeta/hierarchy/basic/HierarchySourceEntityRow.java announcement/trunk/src/main/java/jp/sf/pal/announcement/db/allcommon/dbmeta/hierarchy/basic/HierarchySourceListIterator.java announcement/trunk/src/main/java/jp/sf/pal/announcement/db/allcommon/dbmeta/hierarchy/basic/HierarchySourceRowSetupper.java announcement/trunk/src/main/java/jp/sf/pal/announcement/db/allcommon/dbmeta/info/ announcement/trunk/src/main/java/jp/sf/pal/announcement/db/allcommon/dbmeta/info/ColumnInfo.java announcement/trunk/src/main/java/jp/sf/pal/announcement/db/allcommon/dbmeta/info/ForeignInfo.java announcement/trunk/src/main/java/jp/sf/pal/announcement/db/allcommon/dbmeta/info/ReferrerInfo.java announcement/trunk/src/main/java/jp/sf/pal/announcement/db/allcommon/dbmeta/info/RelationInfo.java announcement/trunk/src/main/java/jp/sf/pal/announcement/db/allcommon/dbmeta/info/UniqueInfo.java announcement/trunk/src/main/java/jp/sf/pal/announcement/db/allcommon/exception/ announcement/trunk/src/main/java/jp/sf/pal/announcement/db/allcommon/exception/BindVariableCommentNotFoundPropertyException.java announcement/trunk/src/main/java/jp/sf/pal/announcement/db/allcommon/exception/BindVariableParameterNullValueException.java announcement/trunk/src/main/java/jp/sf/pal/announcement/db/allcommon/exception/DangerousResultSizeException.java announcement/trunk/src/main/java/jp/sf/pal/announcement/db/allcommon/exception/EmbeddedValueCommentNotFoundPropertyException.java announcement/trunk/src/main/java/jp/sf/pal/announcement/db/allcommon/exception/EmbeddedValueParameterNullValueException.java announcement/trunk/src/main/java/jp/sf/pal/announcement/db/allcommon/exception/EndCommentNotFoundException.java announcement/trunk/src/main/java/jp/sf/pal/announcement/db/allcommon/exception/EntityAlreadyDeletedException.java announcement/trunk/src/main/java/jp/sf/pal/announcement/db/allcommon/exception/EntityAlreadyUpdatedException.java announcement/trunk/src/main/java/jp/sf/pal/announcement/db/allcommon/exception/EntityDuplicatedException.java announcement/trunk/src/main/java/jp/sf/pal/announcement/db/allcommon/exception/IfCommentConditionNotFoundException.java announcement/trunk/src/main/java/jp/sf/pal/announcement/db/allcommon/exception/IfCommentNotBooleanResultException.java announcement/trunk/src/main/java/jp/sf/pal/announcement/db/allcommon/exception/IfCommentWrongExpressionException.java announcement/trunk/src/main/java/jp/sf/pal/announcement/db/allcommon/exception/OutsideSqlNotFoundException.java announcement/trunk/src/main/java/jp/sf/pal/announcement/db/allcommon/exception/RecordHasAlreadyBeenDeletedException.java announcement/trunk/src/main/java/jp/sf/pal/announcement/db/allcommon/exception/RecordHasOverlappedException.java announcement/trunk/src/main/java/jp/sf/pal/announcement/db/allcommon/exception/RequiredOptionNotFoundException.java announcement/trunk/src/main/java/jp/sf/pal/announcement/db/allcommon/helper/ announcement/trunk/src/main/java/jp/sf/pal/announcement/db/allcommon/helper/MapListString.java announcement/trunk/src/main/java/jp/sf/pal/announcement/db/allcommon/helper/MapListStringImpl.java announcement/trunk/src/main/java/jp/sf/pal/announcement/db/allcommon/helper/MapStringBuilder.java announcement/trunk/src/main/java/jp/sf/pal/announcement/db/allcommon/helper/MapStringBuilderImpl.java announcement/trunk/src/main/java/jp/sf/pal/announcement/db/allcommon/helper/character/ announcement/trunk/src/main/java/jp/sf/pal/announcement/db/allcommon/helper/character/GeneralCharacter.java announcement/trunk/src/main/java/jp/sf/pal/announcement/db/allcommon/helper/character/JapaneseCharacter.java announcement/trunk/src/main/java/jp/sf/pal/announcement/db/allcommon/helper/character/impl/ announcement/trunk/src/main/java/jp/sf/pal/announcement/db/allcommon/helper/character/impl/GeneralCharacterImpl.java announcement/trunk/src/main/java/jp/sf/pal/announcement/db/allcommon/helper/character/impl/JapaneseCharacterImpl.java announcement/trunk/src/main/java/jp/sf/pal/announcement/db/allcommon/helper/collection/ announcement/trunk/src/main/java/jp/sf/pal/announcement/db/allcommon/helper/collection/order/ announcement/trunk/src/main/java/jp/sf/pal/announcement/db/allcommon/helper/collection/order/AccordingToOrder.java announcement/trunk/src/main/java/jp/sf/pal/announcement/db/allcommon/helper/collection/order/AccordingToOrderIdExtractor.java announcement/trunk/src/main/java/jp/sf/pal/announcement/db/allcommon/helper/collection/order/AccordingToOrderOption.java announcement/trunk/src/main/java/jp/sf/pal/announcement/db/allcommon/helper/collection/order/impl/ announcement/trunk/src/main/java/jp/sf/pal/announcement/db/allcommon/helper/collection/order/impl/AccordingToOrderImpl.java announcement/trunk/src/main/java/jp/sf/pal/announcement/db/allcommon/helper/token/ announcement/trunk/src/main/java/jp/sf/pal/announcement/db/allcommon/helper/token/file/ announcement/trunk/src/main/java/jp/sf/pal/announcement/db/allcommon/helper/token/file/FileMakingCallback.java announcement/trunk/src/main/java/jp/sf/pal/announcement/db/allcommon/helper/token/file/FileMakingHeaderInfo.java announcement/trunk/src/main/java/jp/sf/pal/announcement/db/allcommon/helper/token/file/FileMakingOption.java announcement/trunk/src/main/java/jp/sf/pal/announcement/db/allcommon/helper/token/file/FileMakingRowResource.java announcement/trunk/src/main/java/jp/sf/pal/announcement/db/allcommon/helper/token/file/FileMakingSimpleFacade.java announcement/trunk/src/main/java/jp/sf/pal/announcement/db/allcommon/helper/token/file/FileToken.java announcement/trunk/src/main/java/jp/sf/pal/announcement/db/allcommon/helper/token/file/FileTokenizingCallback.java announcement/trunk/src/main/java/jp/sf/pal/announcement/db/allcommon/helper/token/file/FileTokenizingHeaderInfo.java announcement/trunk/src/main/java/jp/sf/pal/announcement/db/allcommon/helper/token/file/FileTokenizingOption.java announcement/trunk/src/main/java/jp/sf/pal/announcement/db/allcommon/helper/token/file/FileTokenizingRowResource.java announcement/trunk/src/main/java/jp/sf/pal/announcement/db/allcommon/helper/token/file/impl/ announcement/trunk/src/main/java/jp/sf/pal/announcement/db/allcommon/helper/token/file/impl/FileMakingSimpleFacadeImpl.java announcement/trunk/src/main/java/jp/sf/pal/announcement/db/allcommon/helper/token/file/impl/FileTokenImpl.java announcement/trunk/src/main/java/jp/sf/pal/announcement/db/allcommon/helper/token/line/ announcement/trunk/src/main/java/jp/sf/pal/announcement/db/allcommon/helper/token/line/LineMakingOption.java announcement/trunk/src/main/java/jp/sf/pal/announcement/db/allcommon/helper/token/line/LineToken.java announcement/trunk/src/main/java/jp/sf/pal/announcement/db/allcommon/helper/token/line/LineTokenizingOption.java announcement/trunk/src/main/java/jp/sf/pal/announcement/db/allcommon/helper/token/line/impl/ announcement/trunk/src/main/java/jp/sf/pal/announcement/db/allcommon/helper/token/line/impl/LineTokenImpl.java announcement/trunk/src/main/java/jp/sf/pal/announcement/db/allcommon/jdbc/ announcement/trunk/src/main/java/jp/sf/pal/announcement/db/allcommon/jdbc/CursorHandler.java announcement/trunk/src/main/java/jp/sf/pal/announcement/db/allcommon/jdbc/LatestSqlProvider.java announcement/trunk/src/main/java/jp/sf/pal/announcement/db/allcommon/jdbc/StatementConfig.java announcement/trunk/src/main/java/jp/sf/pal/announcement/db/allcommon/s2dao/ announcement/trunk/src/main/java/jp/sf/pal/announcement/db/allcommon/s2dao/FetchNarrowingResultSetFactory.java announcement/trunk/src/main/java/jp/sf/pal/announcement/db/allcommon/s2dao/FetchNarrowingResultSetWrapper.java announcement/trunk/src/main/java/jp/sf/pal/announcement/db/allcommon/s2dao/S2BeanMetaDataFactoryImpl.java announcement/trunk/src/main/java/jp/sf/pal/announcement/db/allcommon/s2dao/S2DaoInterceptor.java announcement/trunk/src/main/java/jp/sf/pal/announcement/db/allcommon/s2dao/S2DaoLatestSqlProvider.java announcement/trunk/src/main/java/jp/sf/pal/announcement/db/allcommon/s2dao/S2DaoMetaDataExtension.java announcement/trunk/src/main/java/jp/sf/pal/announcement/db/allcommon/s2dao/S2DaoMetaDataFactoryImpl.java announcement/trunk/src/main/java/jp/sf/pal/announcement/db/allcommon/s2dao/S2DaoPropertyTypeFactoryBuilderExtension.java announcement/trunk/src/main/java/jp/sf/pal/announcement/db/allcommon/s2dao/S2DaoSelectDynamicCommand.java announcement/trunk/src/main/java/jp/sf/pal/announcement/db/allcommon/s2dao/internal/ announcement/trunk/src/main/java/jp/sf/pal/announcement/db/allcommon/s2dao/internal/rshandler/ announcement/trunk/src/main/java/jp/sf/pal/announcement/db/allcommon/s2dao/internal/rshandler/InternalBeanArrayMetaDataResultSetHandler.java announcement/trunk/src/main/java/jp/sf/pal/announcement/db/allcommon/s2dao/internal/rshandler/InternalBeanListMetaDataResultSetHandler.java announcement/trunk/src/main/java/jp/sf/pal/announcement/db/allcommon/s2dao/internal/sqlcommand/ announcement/trunk/src/main/java/jp/sf/pal/announcement/db/allcommon/s2dao/internal/sqlcommand/InternalAbstractAutoStaticCommand.java announcement/trunk/src/main/java/jp/sf/pal/announcement/db/allcommon/s2dao/internal/sqlcommand/InternalAbstractBatchAutoStaticCommand.java announcement/trunk/src/main/java/jp/sf/pal/announcement/db/allcommon/s2dao/internal/sqlcommand/InternalAbstractDynamicCommand.java announcement/trunk/src/main/java/jp/sf/pal/announcement/db/allcommon/s2dao/internal/sqlcommand/InternalAbstractSqlCommand.java announcement/trunk/src/main/java/jp/sf/pal/announcement/db/allcommon/s2dao/internal/sqlcommand/InternalAbstractStaticCommand.java announcement/trunk/src/main/java/jp/sf/pal/announcement/db/allcommon/s2dao/internal/sqlcommand/InternalDeleteAutoStaticCommand.java announcement/trunk/src/main/java/jp/sf/pal/announcement/db/allcommon/s2dao/internal/sqlcommand/InternalDeleteBatchAutoStaticCommand.java announcement/trunk/src/main/java/jp/sf/pal/announcement/db/allcommon/s2dao/internal/sqlcommand/InternalDeleteQueryAutoDynamicCommand.java announcement/trunk/src/main/java/jp/sf/pal/announcement/db/allcommon/s2dao/internal/sqlcommand/InternalInsertAutoDynamicCommand.java announcement/trunk/src/main/java/jp/sf/pal/announcement/db/allcommon/s2dao/internal/sqlcommand/InternalInsertBatchAutoStaticCommand.java announcement/trunk/src/main/java/jp/sf/pal/announcement/db/allcommon/s2dao/internal/sqlcommand/InternalUpdateAutoDynamicCommand.java announcement/trunk/src/main/java/jp/sf/pal/announcement/db/allcommon/s2dao/internal/sqlcommand/InternalUpdateBatchAutoStaticCommand.java announcement/trunk/src/main/java/jp/sf/pal/announcement/db/allcommon/s2dao/internal/sqlcommand/InternalUpdateDynamicCommand.java announcement/trunk/src/main/java/jp/sf/pal/announcement/db/allcommon/s2dao/internal/sqlcommand/InternalUpdateModifiedOnlyCommand.java announcement/trunk/src/main/java/jp/sf/pal/announcement/db/allcommon/s2dao/internal/sqlhandler/ announcement/trunk/src/main/java/jp/sf/pal/announcement/db/allcommon/s2dao/internal/sqlhandler/InternalAbstractAutoHandler.java announcement/trunk/src/main/java/jp/sf/pal/announcement/db/allcommon/s2dao/internal/sqlhandler/InternalAbstractBatchAutoHandler.java announcement/trunk/src/main/java/jp/sf/pal/announcement/db/allcommon/s2dao/internal/sqlhandler/InternalBasicHandler.java announcement/trunk/src/main/java/jp/sf/pal/announcement/db/allcommon/s2dao/internal/sqlhandler/InternalBasicSelectHandler.java announcement/trunk/src/main/java/jp/sf/pal/announcement/db/allcommon/s2dao/internal/sqlhandler/InternalBasicUpdateHandler.java announcement/trunk/src/main/java/jp/sf/pal/announcement/db/allcommon/s2dao/internal/sqlhandler/InternalCommandContextHandler.java announcement/trunk/src/main/java/jp/sf/pal/announcement/db/allcommon/s2dao/internal/sqlhandler/InternalDeleteAutoHandler.java announcement/trunk/src/main/java/jp/sf/pal/announcement/db/allcommon/s2dao/internal/sqlhandler/InternalDeleteBatchAutoHandler.java announcement/trunk/src/main/java/jp/sf/pal/announcement/db/allcommon/s2dao/internal/sqlhandler/InternalInsertAutoHandler.java announcement/trunk/src/main/java/jp/sf/pal/announcement/db/allcommon/s2dao/internal/sqlhandler/InternalInsertBatchAutoHandler.java announcement/trunk/src/main/java/jp/sf/pal/announcement/db/allcommon/s2dao/internal/sqlhandler/InternalUpdateAutoHandler.java announcement/trunk/src/main/java/jp/sf/pal/announcement/db/allcommon/s2dao/internal/sqlhandler/InternalUpdateBatchAutoHandler.java announcement/trunk/src/main/java/jp/sf/pal/announcement/db/allcommon/s2dao/internal/sqllog/ announcement/trunk/src/main/java/jp/sf/pal/announcement/db/allcommon/s2dao/internal/sqllog/InternalSqlLog.java announcement/trunk/src/main/java/jp/sf/pal/announcement/db/allcommon/s2dao/internal/sqllog/InternalSqlLogRegistry.java announcement/trunk/src/main/java/jp/sf/pal/announcement/db/allcommon/s2dao/internal/sqlparser/ announcement/trunk/src/main/java/jp/sf/pal/announcement/db/allcommon/s2dao/internal/sqlparser/InternalCommandContextCreator.java announcement/trunk/src/main/java/jp/sf/pal/announcement/db/allcommon/s2dao/internal/sqlparser/InternalSqlParser.java announcement/trunk/src/main/java/jp/sf/pal/announcement/db/allcommon/s2dao/internal/sqlparser/InternalSqlTokenizer.java announcement/trunk/src/main/java/jp/sf/pal/announcement/db/allcommon/s2dao/internal/util/ announcement/trunk/src/main/java/jp/sf/pal/announcement/db/allcommon/s2dao/internal/util/InternalBindVariableUtil.java announcement/trunk/src/main/java/jp/sf/pal/announcement/db/allcommon/util/ announcement/trunk/src/main/java/jp/sf/pal/announcement/db/allcommon/util/SimpleAssertUtil.java announcement/trunk/src/main/java/jp/sf/pal/announcement/db/allcommon/util/SimpleStringUtil.java announcement/trunk/src/main/java/jp/sf/pal/announcement/db/allcommon/util/SimpleSystemUtil.java announcement/trunk/src/main/java/jp/sf/pal/announcement/db/allcommon/util/TraceViewUtil.java announcement/trunk/src/main/java/jp/sf/pal/announcement/db/allcommon/util/ValueLabelUtil.java announcement/trunk/src/main/java/jp/sf/pal/announcement/db/bsbhv/ announcement/trunk/src/main/java/jp/sf/pal/announcement/db/bsbhv/BsAnnouncementBhv.java announcement/trunk/src/main/java/jp/sf/pal/announcement/db/bsbhv/BsAnnouncementBodyBhv.java announcement/trunk/src/main/java/jp/sf/pal/announcement/db/bsdao/ announcement/trunk/src/main/java/jp/sf/pal/announcement/db/bsdao/BsAnnouncementBodyDao.java announcement/trunk/src/main/java/jp/sf/pal/announcement/db/bsdao/BsAnnouncementDao.java announcement/trunk/src/main/java/jp/sf/pal/announcement/db/bsentity/ announcement/trunk/src/main/java/jp/sf/pal/announcement/db/bsentity/BsAnnouncement.java announcement/trunk/src/main/java/jp/sf/pal/announcement/db/bsentity/BsAnnouncementBody.java announcement/trunk/src/main/java/jp/sf/pal/announcement/db/bsentity/dbmeta/ announcement/trunk/src/main/java/jp/sf/pal/announcement/db/bsentity/dbmeta/AnnouncementBodyDbm.java announcement/trunk/src/main/java/jp/sf/pal/announcement/db/bsentity/dbmeta/AnnouncementDbm.java announcement/trunk/src/main/java/jp/sf/pal/announcement/db/cbean/ announcement/trunk/src/main/java/jp/sf/pal/announcement/db/cbean/AnnouncementBodyCB.java announcement/trunk/src/main/java/jp/sf/pal/announcement/db/cbean/AnnouncementCB.java announcement/trunk/src/main/java/jp/sf/pal/announcement/db/cbean/bs/ announcement/trunk/src/main/java/jp/sf/pal/announcement/db/cbean/bs/BsAnnouncementBodyCB.java announcement/trunk/src/main/java/jp/sf/pal/announcement/db/cbean/bs/BsAnnouncementCB.java announcement/trunk/src/main/java/jp/sf/pal/announcement/db/cbean/cq/ announcement/trunk/src/main/java/jp/sf/pal/announcement/db/cbean/cq/AnnouncementBodyCQ.java announcement/trunk/src/main/java/jp/sf/pal/announcement/db/cbean/cq/AnnouncementCQ.java announcement/trunk/src/main/java/jp/sf/pal/announcement/db/cbean/cq/bs/ announcement/trunk/src/main/java/jp/sf/pal/announcement/db/cbean/cq/bs/AbstractBsAnnouncementBodyCQ.java announcement/trunk/src/main/java/jp/sf/pal/announcement/db/cbean/cq/bs/AbstractBsAnnouncementCQ.java announcement/trunk/src/main/java/jp/sf/pal/announcement/db/cbean/cq/bs/BsAnnouncementBodyCQ.java announcement/trunk/src/main/java/jp/sf/pal/announcement/db/cbean/cq/bs/BsAnnouncementCQ.java announcement/trunk/src/main/java/jp/sf/pal/announcement/db/cbean/cq/ciq/ announcement/trunk/src/main/java/jp/sf/pal/announcement/db/cbean/cq/ciq/AnnouncementBodyCIQ.java announcement/trunk/src/main/java/jp/sf/pal/announcement/db/cbean/cq/ciq/AnnouncementCIQ.java announcement/trunk/src/main/java/jp/sf/pal/announcement/db/cbean/nss/ announcement/trunk/src/main/java/jp/sf/pal/announcement/db/cbean/nss/AnnouncementBodyNss.java announcement/trunk/src/main/java/jp/sf/pal/announcement/db/cbean/nss/AnnouncementNss.java announcement/trunk/src/main/java/jp/sf/pal/announcement/db/exbhv/ announcement/trunk/src/main/java/jp/sf/pal/announcement/db/exbhv/AnnouncementBhv.java announcement/trunk/src/main/java/jp/sf/pal/announcement/db/exbhv/AnnouncementBodyBhv.java announcement/trunk/src/main/java/jp/sf/pal/announcement/db/exdao/ announcement/trunk/src/main/java/jp/sf/pal/announcement/db/exdao/AnnouncementBodyDao.java announcement/trunk/src/main/java/jp/sf/pal/announcement/db/exdao/AnnouncementDao.java announcement/trunk/src/main/java/jp/sf/pal/announcement/db/exentity/ announcement/trunk/src/main/java/jp/sf/pal/announcement/db/exentity/Announcement.java announcement/trunk/src/main/java/jp/sf/pal/announcement/db/exentity/AnnouncementBody.java announcement/trunk/src/main/java/jp/sf/pal/announcement/dxo/ announcement/trunk/src/main/java/jp/sf/pal/announcement/dxo/AnnouncementDxo.java announcement/trunk/src/main/java/jp/sf/pal/announcement/filter/ announcement/trunk/src/main/java/jp/sf/pal/announcement/filter/AnnouncementFilter.java announcement/trunk/src/main/java/jp/sf/pal/announcement/service/ announcement/trunk/src/main/java/jp/sf/pal/announcement/service/AnnouncementService.java announcement/trunk/src/main/java/jp/sf/pal/announcement/web/ announcement/trunk/src/main/java/jp/sf/pal/announcement/web/edit/ announcement/trunk/src/main/java/jp/sf/pal/announcement/web/edit/EditContentPage.java announcement/trunk/src/main/java/jp/sf/pal/announcement/web/view/ announcement/trunk/src/main/java/jp/sf/pal/announcement/web/view/DisplayContentPage.java announcement/trunk/src/main/resources/ announcement/trunk/src/main/resources/AMMessages.properties announcement/trunk/src/main/resources/app.dicon announcement/trunk/src/main/resources/appMessages.properties announcement/trunk/src/main/resources/appMessages_ja.properties announcement/trunk/src/main/resources/app_aop.dicon announcement/trunk/src/main/resources/convention.dicon announcement/trunk/src/main/resources/creator.dicon announcement/trunk/src/main/resources/customizer.dicon announcement/trunk/src/main/resources/dbflute.dicon announcement/trunk/src/main/resources/env.txt announcement/trunk/src/main/resources/env_ut.txt announcement/trunk/src/main/resources/jdbc.dicon announcement/trunk/src/main/resources/jp/ announcement/trunk/src/main/resources/jp/sf/ announcement/trunk/src/main/resources/jp/sf/pal/ announcement/trunk/src/main/resources/jp/sf/pal/announcement/ announcement/trunk/src/main/resources/jp/sf/pal/announcement/web/ announcement/trunk/src/main/resources/jp/sf/pal/announcement/web/edit/ announcement/trunk/src/main/resources/jp/sf/pal/announcement/web/edit/label.properties announcement/trunk/src/main/resources/jp/sf/pal/announcement/web/edit/label_ja.properties announcement/trunk/src/main/resources/s2container.dicon announcement/trunk/src/main/resources/teedaCustomize.dicon announcement/trunk/src/main/resources/teedaErrorPage.dicon announcement/trunk/src/main/webapp/ announcement/trunk/src/main/webapp/WEB-INF/ announcement/trunk/src/main/webapp/WEB-INF/faces-config.xml announcement/trunk/src/main/webapp/WEB-INF/portlet.xml announcement/trunk/src/main/webapp/WEB-INF/web.xml announcement/trunk/src/main/webapp/fckeditor/ announcement/trunk/src/main/webapp/fckeditor/editor/ announcement/trunk/src/main/webapp/fckeditor/editor/_source/ announcement/trunk/src/main/webapp/fckeditor/editor/_source/classes/ announcement/trunk/src/main/webapp/fckeditor/editor/_source/classes/fckcontextmenu.js announcement/trunk/src/main/webapp/fckeditor/editor/_source/classes/fckdataprocessor.js announcement/trunk/src/main/webapp/fckeditor/editor/_source/classes/fckdocumentfragment_gecko.js announcement/trunk/src/main/webapp/fckeditor/editor/_source/classes/fckdocumentfragment_ie.js announcement/trunk/src/main/webapp/fckeditor/editor/_source/classes/fckdomrange.js announcement/trunk/src/main/webapp/fckeditor/editor/_source/classes/fckdomrange_gecko.js announcement/trunk/src/main/webapp/fckeditor/editor/_source/classes/fckdomrange_ie.js announcement/trunk/src/main/webapp/fckeditor/editor/_source/classes/fckdomrangeiterator.js announcement/trunk/src/main/webapp/fckeditor/editor/_source/classes/fckeditingarea.js announcement/trunk/src/main/webapp/fckeditor/editor/_source/classes/fckelementpath.js announcement/trunk/src/main/webapp/fckeditor/editor/_source/classes/fckenterkey.js announcement/trunk/src/main/webapp/fckeditor/editor/_source/classes/fckevents.js announcement/trunk/src/main/webapp/fckeditor/editor/_source/classes/fckhtmliterator.js announcement/trunk/src/main/webapp/fckeditor/editor/_source/classes/fckicon.js announcement/trunk/src/main/webapp/fckeditor/editor/_source/classes/fckiecleanup.js announcement/trunk/src/main/webapp/fckeditor/editor/_source/classes/fckimagepreloader.js announcement/trunk/src/main/webapp/fckeditor/editor/_source/classes/fckkeystrokehandler.js announcement/trunk/src/main/webapp/fckeditor/editor/_source/classes/fckmenublock.js announcement/trunk/src/main/webapp/fckeditor/editor/_source/classes/fckmenublockpanel.js announcement/trunk/src/main/webapp/fckeditor/editor/_source/classes/fckmenuitem.js announcement/trunk/src/main/webapp/fckeditor/editor/_source/classes/fckpanel.js announcement/trunk/src/main/webapp/fckeditor/editor/_source/classes/fckplugin.js announcement/trunk/src/main/webapp/fckeditor/editor/_source/classes/fckspecialcombo.js announcement/trunk/src/main/webapp/fckeditor/editor/_source/classes/fckstyle.js announcement/trunk/src/main/webapp/fckeditor/editor/_source/classes/fcktoolbar.js announcement/trunk/src/main/webapp/fckeditor/editor/_source/classes/fcktoolbarbreak_gecko.js announcement/trunk/src/main/webapp/fckeditor/editor/_source/classes/fcktoolbarbreak_ie.js announcement/trunk/src/main/webapp/fckeditor/editor/_source/classes/fcktoolbarbutton.js announcement/trunk/src/main/webapp/fckeditor/editor/_source/classes/fcktoolbarbuttonui.js announcement/trunk/src/main/webapp/fckeditor/editor/_source/classes/fcktoolbarfontformatcombo.js announcement/trunk/src/main/webapp/fckeditor/editor/_source/classes/fcktoolbarfontscombo.js announcement/trunk/src/main/webapp/fckeditor/editor/_source/classes/fcktoolbarfontsizecombo.js announcement/trunk/src/main/webapp/fckeditor/editor/_source/classes/fcktoolbarpanelbutton.js announcement/trunk/src/main/webapp/fckeditor/editor/_source/classes/fcktoolbarspecialcombo.js announcement/trunk/src/main/webapp/fckeditor/editor/_source/classes/fcktoolbarstylecombo.js announcement/trunk/src/main/webapp/fckeditor/editor/_source/classes/fckw3crange.js announcement/trunk/src/main/webapp/fckeditor/editor/_source/classes/fckxml.js announcement/trunk/src/main/webapp/fckeditor/editor/_source/classes/fckxml_gecko.js announcement/trunk/src/main/webapp/fckeditor/editor/_source/classes/fckxml_ie.js announcement/trunk/src/main/webapp/fckeditor/editor/_source/commandclasses/ announcement/trunk/src/main/webapp/fckeditor/editor/_source/commandclasses/fck_othercommands.js announcement/trunk/src/main/webapp/fckeditor/editor/_source/commandclasses/fckblockquotecommand.js announcement/trunk/src/main/webapp/fckeditor/editor/_source/commandclasses/fckcorestylecommand.js announcement/trunk/src/main/webapp/fckeditor/editor/_source/commandclasses/fckfitwindow.js announcement/trunk/src/main/webapp/fckeditor/editor/_source/commandclasses/fckindentcommands.js announcement/trunk/src/main/webapp/fckeditor/editor/_source/commandclasses/fckjustifycommands.js announcement/trunk/src/main/webapp/fckeditor/editor/_source/commandclasses/fcklistcommands.js announcement/trunk/src/main/webapp/fckeditor/editor/_source/commandclasses/fcknamedcommand.js announcement/trunk/src/main/webapp/fckeditor/editor/_source/commandclasses/fckpasteplaintextcommand.js announcement/trunk/src/main/webapp/fckeditor/editor/_source/commandclasses/fckpastewordcommand.js announcement/trunk/src/main/webapp/fckeditor/editor/_source/commandclasses/fckremoveformatcommand.js announcement/trunk/src/main/webapp/fckeditor/editor/_source/commandclasses/fckshowblocks.js announcement/trunk/src/main/webapp/fckeditor/editor/_source/commandclasses/fckspellcheckcommand_gecko.js announcement/trunk/src/main/webapp/fckeditor/editor/_source/commandclasses/fckspellcheckcommand_ie.js announcement/trunk/src/main/webapp/fckeditor/editor/_source/commandclasses/fckstylecommand.js announcement/trunk/src/main/webapp/fckeditor/editor/_source/commandclasses/fcktablecommand.js announcement/trunk/src/main/webapp/fckeditor/editor/_source/commandclasses/fcktextcolorcommand.js announcement/trunk/src/main/webapp/fckeditor/editor/_source/fckconstants.js announcement/trunk/src/main/webapp/fckeditor/editor/_source/fckeditorapi.js announcement/trunk/src/main/webapp/fckeditor/editor/_source/fckjscoreextensions.js announcement/trunk/src/main/webapp/fckeditor/editor/_source/fckscriptloader.js announcement/trunk/src/main/webapp/fckeditor/editor/_source/internals/ announcement/trunk/src/main/webapp/fckeditor/editor/_source/internals/fck.js announcement/trunk/src/main/webapp/fckeditor/editor/_source/internals/fck_contextmenu.js announcement/trunk/src/main/webapp/fckeditor/editor/_source/internals/fck_gecko.js announcement/trunk/src/main/webapp/fckeditor/editor/_source/internals/fck_ie.js announcement/trunk/src/main/webapp/fckeditor/editor/_source/internals/fckbrowserinfo.js announcement/trunk/src/main/webapp/fckeditor/editor/_source/internals/fckcodeformatter.js announcement/trunk/src/main/webapp/fckeditor/editor/_source/internals/fckcommands.js announcement/trunk/src/main/webapp/fckeditor/editor/_source/internals/fckconfig.js announcement/trunk/src/main/webapp/fckeditor/editor/_source/internals/fckdebug.js announcement/trunk/src/main/webapp/fckeditor/editor/_source/internals/fckdebug_empty.js announcement/trunk/src/main/webapp/fckeditor/editor/_source/internals/fckdialog.js announcement/trunk/src/main/webapp/fckeditor/editor/_source/internals/fckdocumentprocessor.js announcement/trunk/src/main/webapp/fckeditor/editor/_source/internals/fckdomtools.js announcement/trunk/src/main/webapp/fckeditor/editor/_source/internals/fcklanguagemanager.js announcement/trunk/src/main/webapp/fckeditor/editor/_source/internals/fcklisthandler.js announcement/trunk/src/main/webapp/fckeditor/editor/_source/internals/fcklistslib.js announcement/trunk/src/main/webapp/fckeditor/editor/_source/internals/fckplugins.js announcement/trunk/src/main/webapp/fckeditor/editor/_source/internals/fckregexlib.js announcement/trunk/src/main/webapp/fckeditor/editor/_source/internals/fckselection.js announcement/trunk/src/main/webapp/fckeditor/editor/_source/internals/fckselection_gecko.js announcement/trunk/src/main/webapp/fckeditor/editor/_source/internals/fckselection_ie.js announcement/trunk/src/main/webapp/fckeditor/editor/_source/internals/fckstyles.js announcement/trunk/src/main/webapp/fckeditor/editor/_source/internals/fcktablehandler.js announcement/trunk/src/main/webapp/fckeditor/editor/_source/internals/fcktablehandler_gecko.js announcement/trunk/src/main/webapp/fckeditor/editor/_source/internals/fcktablehandler_ie.js announcement/trunk/src/main/webapp/fckeditor/editor/_source/internals/fcktoolbaritems.js announcement/trunk/src/main/webapp/fckeditor/editor/_source/internals/fcktoolbarset.js announcement/trunk/src/main/webapp/fckeditor/editor/_source/internals/fcktools.js announcement/trunk/src/main/webapp/fckeditor/editor/_source/internals/fcktools_gecko.js announcement/trunk/src/main/webapp/fckeditor/editor/_source/internals/fcktools_ie.js announcement/trunk/src/main/webapp/fckeditor/editor/_source/internals/fckundo.js announcement/trunk/src/main/webapp/fckeditor/editor/_source/internals/fckurlparams.js announcement/trunk/src/main/webapp/fckeditor/editor/_source/internals/fckxhtml.js announcement/trunk/src/main/webapp/fckeditor/editor/_source/internals/fckxhtml_gecko.js announcement/trunk/src/main/webapp/fckeditor/editor/_source/internals/fckxhtml_ie.js announcement/trunk/src/main/webapp/fckeditor/editor/_source/internals/fckxhtmlentities.js announcement/trunk/src/main/webapp/fckeditor/editor/css/ announcement/trunk/src/main/webapp/fckeditor/editor/css/behaviors/ announcement/trunk/src/main/webapp/fckeditor/editor/css/behaviors/disablehandles.htc announcement/trunk/src/main/webapp/fckeditor/editor/css/behaviors/showtableborders.htc announcement/trunk/src/main/webapp/fckeditor/editor/css/fck_editorarea.css announcement/trunk/src/main/webapp/fckeditor/editor/css/fck_internal.css announcement/trunk/src/main/webapp/fckeditor/editor/css/fck_showtableborders_gecko.css announcement/trunk/src/main/webapp/fckeditor/editor/css/images/ announcement/trunk/src/main/webapp/fckeditor/editor/css/images/block_address.png announcement/trunk/src/main/webapp/fckeditor/editor/css/images/block_blockquote.png announcement/trunk/src/main/webapp/fckeditor/editor/css/images/block_div.png announcement/trunk/src/main/webapp/fckeditor/editor/css/images/block_h1.png announcement/trunk/src/main/webapp/fckeditor/editor/css/images/block_h2.png announcement/trunk/src/main/webapp/fckeditor/editor/css/images/block_h3.png announcement/trunk/src/main/webapp/fckeditor/editor/css/images/block_h4.png announcement/trunk/src/main/webapp/fckeditor/editor/css/images/block_h5.png announcement/trunk/src/main/webapp/fckeditor/editor/css/images/block_h6.png announcement/trunk/src/main/webapp/fckeditor/editor/css/images/block_p.png announcement/trunk/src/main/webapp/fckeditor/editor/css/images/block_pre.png announcement/trunk/src/main/webapp/fckeditor/editor/css/images/fck_anchor.gif announcement/trunk/src/main/webapp/fckeditor/editor/css/images/fck_flashlogo.gif announcement/trunk/src/main/webapp/fckeditor/editor/css/images/fck_hiddenfield.gif announcement/trunk/src/main/webapp/fckeditor/editor/css/images/fck_pagebreak.gif announcement/trunk/src/main/webapp/fckeditor/editor/css/images/fck_plugin.gif announcement/trunk/src/main/webapp/fckeditor/editor/dialog/ announcement/trunk/src/main/webapp/fckeditor/editor/dialog/common/ announcement/trunk/src/main/webapp/fckeditor/editor/dialog/common/fck_dialog_common.css announcement/trunk/src/main/webapp/fckeditor/editor/dialog/common/fck_dialog_common.js announcement/trunk/src/main/webapp/fckeditor/editor/dialog/common/images/ announcement/trunk/src/main/webapp/fckeditor/editor/dialog/common/images/locked.gif announcement/trunk/src/main/webapp/fckeditor/editor/dialog/common/images/reset.gif announcement/trunk/src/main/webapp/fckeditor/editor/dialog/common/images/unlocked.gif announcement/trunk/src/main/webapp/fckeditor/editor/dialog/fck_about/ announcement/trunk/src/main/webapp/fckeditor/editor/dialog/fck_about/logo_fckeditor.gif announcement/trunk/src/main/webapp/fckeditor/editor/dialog/fck_about/logo_fredck.gif announcement/trunk/src/main/webapp/fckeditor/editor/dialog/fck_about/sponsors/ announcement/trunk/src/main/webapp/fckeditor/editor/dialog/fck_about/sponsors/spellchecker_net.gif announcement/trunk/src/main/webapp/fckeditor/editor/dialog/fck_about.html announcement/trunk/src/main/webapp/fckeditor/editor/dialog/fck_anchor.html announcement/trunk/src/main/webapp/fckeditor/editor/dialog/fck_button.html announcement/trunk/src/main/webapp/fckeditor/editor/dialog/fck_checkbox.html announcement/trunk/src/main/webapp/fckeditor/editor/dialog/fck_colorselector.html announcement/trunk/src/main/webapp/fckeditor/editor/dialog/fck_docprops/ announcement/trunk/src/main/webapp/fckeditor/editor/dialog/fck_docprops/fck_document_preview.html announcement/trunk/src/main/webapp/fckeditor/editor/dialog/fck_docprops.html announcement/trunk/src/main/webapp/fckeditor/editor/dialog/fck_flash/ announcement/trunk/src/main/webapp/fckeditor/editor/dialog/fck_flash/fck_flash.js announcement/trunk/src/main/webapp/fckeditor/editor/dialog/fck_flash/fck_flash_preview.html announcement/trunk/src/main/webapp/fckeditor/editor/dialog/fck_flash.html announcement/trunk/src/main/webapp/fckeditor/editor/dialog/fck_form.html announcement/trunk/src/main/webapp/fckeditor/editor/dialog/fck_hiddenfield.html announcement/trunk/src/main/webapp/fckeditor/editor/dialog/fck_image/ announcement/trunk/src/main/webapp/fckeditor/editor/dialog/fck_image/fck_image.js announcement/trunk/src/main/webapp/fckeditor/editor/dialog/fck_image/fck_image_preview.html announcement/trunk/src/main/webapp/fckeditor/editor/dialog/fck_image.html announcement/trunk/src/main/webapp/fckeditor/editor/dialog/fck_link/ announcement/trunk/src/main/webapp/fckeditor/editor/dialog/fck_link/fck_link.js announcement/trunk/src/main/webapp/fckeditor/editor/dialog/fck_link.html announcement/trunk/src/main/webapp/fckeditor/editor/dialog/fck_listprop.html announcement/trunk/src/main/webapp/fckeditor/editor/dialog/fck_paste.html announcement/trunk/src/main/webapp/fckeditor/editor/dialog/fck_radiobutton.html announcement/trunk/src/main/webapp/fckeditor/editor/dialog/fck_replace.html announcement/trunk/src/main/webapp/fckeditor/editor/dialog/fck_select/ announcement/trunk/src/main/webapp/fckeditor/editor/dialog/fck_select/fck_select.js announcement/trunk/src/main/webapp/fckeditor/editor/dialog/fck_select.html announcement/trunk/src/main/webapp/fckeditor/editor/dialog/fck_smiley.html announcement/trunk/src/main/webapp/fckeditor/editor/dialog/fck_source.html announcement/trunk/src/main/webapp/fckeditor/editor/dialog/fck_specialchar.html announcement/trunk/src/main/webapp/fckeditor/editor/dialog/fck_spellerpages/ announcement/trunk/src/main/webapp/fckeditor/editor/dialog/fck_spellerpages/spellerpages/ announcement/trunk/src/main/webapp/fckeditor/editor/dialog/fck_spellerpages/spellerpages/blank.html announcement/trunk/src/main/webapp/fckeditor/editor/dialog/fck_spellerpages/spellerpages/controlWindow.js announcement/trunk/src/main/webapp/fckeditor/editor/dialog/fck_spellerpages/spellerpages/controls.html announcement/trunk/src/main/webapp/fckeditor/editor/dialog/fck_spellerpages/spellerpages/server-scripts/ announcement/trunk/src/main/webapp/fckeditor/editor/dialog/fck_spellerpages/spellerpages/server-scripts/spellchecker.cfm announcement/trunk/src/main/webapp/fckeditor/editor/dialog/fck_spellerpages/spellerpages/server-scripts/spellchecker.php announcement/trunk/src/main/webapp/fckeditor/editor/dialog/fck_spellerpages/spellerpages/server-scripts/spellchecker.pl announcement/trunk/src/main/webapp/fckeditor/editor/dialog/fck_spellerpages/spellerpages/spellChecker.js announcement/trunk/src/main/webapp/fckeditor/editor/dialog/fck_spellerpages/spellerpages/spellchecker.html announcement/trunk/src/main/webapp/fckeditor/editor/dialog/fck_spellerpages/spellerpages/spellerStyle.css announcement/trunk/src/main/webapp/fckeditor/editor/dialog/fck_spellerpages/spellerpages/wordWindow.js announcement/trunk/src/main/webapp/fckeditor/editor/dialog/fck_spellerpages.html announcement/trunk/src/main/webapp/fckeditor/editor/dialog/fck_table.html announcement/trunk/src/main/webapp/fckeditor/editor/dialog/fck_tablecell.html announcement/trunk/src/main/webapp/fckeditor/editor/dialog/fck_template/ announcement/trunk/src/main/webapp/fckeditor/editor/dialog/fck_template/images/ announcement/trunk/src/main/webapp/fckeditor/editor/dialog/fck_template/images/template1.gif announcement/trunk/src/main/webapp/fckeditor/editor/dialog/fck_template/images/template2.gif announcement/trunk/src/main/webapp/fckeditor/editor/dialog/fck_template/images/template3.gif announcement/trunk/src/main/webapp/fckeditor/editor/dialog/fck_template.html announcement/trunk/src/main/webapp/fckeditor/editor/dialog/fck_textarea.html announcement/trunk/src/main/webapp/fckeditor/editor/dialog/fck_textfield.html announcement/trunk/src/main/webapp/fckeditor/editor/dtd/ announcement/trunk/src/main/webapp/fckeditor/editor/dtd/fck_dtd_test.html announcement/trunk/src/main/webapp/fckeditor/editor/dtd/fck_xhtml10strict.js announcement/trunk/src/main/webapp/fckeditor/editor/dtd/fck_xhtml10transitional.js announcement/trunk/src/main/webapp/fckeditor/editor/fckdebug.html announcement/trunk/src/main/webapp/fckeditor/editor/fckdialog.html announcement/trunk/src/main/webapp/fckeditor/editor/fckeditor.html announcement/trunk/src/main/webapp/fckeditor/editor/fckeditor.original.html announcement/trunk/src/main/webapp/fckeditor/editor/filemanager/ announcement/trunk/src/main/webapp/fckeditor/editor/filemanager/browser/ announcement/trunk/src/main/webapp/fckeditor/editor/filemanager/browser/default/ announcement/trunk/src/main/webapp/fckeditor/editor/filemanager/browser/default/browser.css announcement/trunk/src/main/webapp/fckeditor/editor/filemanager/browser/default/browser.html announcement/trunk/src/main/webapp/fckeditor/editor/filemanager/browser/default/frmactualfolder.html announcement/trunk/src/main/webapp/fckeditor/editor/filemanager/browser/default/frmcreatefolder.html announcement/trunk/src/main/webapp/fckeditor/editor/filemanager/browser/default/frmfolders.html announcement/trunk/src/main/webapp/fckeditor/editor/filemanager/browser/default/frmresourceslist.html announcement/trunk/src/main/webapp/fckeditor/editor/filemanager/browser/default/frmresourcetype.html announcement/trunk/src/main/webapp/fckeditor/editor/filemanager/browser/default/frmupload.html announcement/trunk/src/main/webapp/fckeditor/editor/filemanager/browser/default/images/ announcement/trunk/src/main/webapp/fckeditor/editor/filemanager/browser/default/images/ButtonArrow.gif announcement/trunk/src/main/webapp/fckeditor/editor/filemanager/browser/default/images/Folder.gif announcement/trunk/src/main/webapp/fckeditor/editor/filemanager/browser/default/images/Folder32.gif announcement/trunk/src/main/webapp/fckeditor/editor/filemanager/browser/default/images/FolderOpened.gif announcement/trunk/src/main/webapp/fckeditor/editor/filemanager/browser/default/images/FolderOpened32.gif announcement/trunk/src/main/webapp/fckeditor/editor/filemanager/browser/default/images/FolderUp.gif announcement/trunk/src/main/webapp/fckeditor/editor/filemanager/browser/default/images/icons/ announcement/trunk/src/main/webapp/fckeditor/editor/filemanager/browser/default/images/icons/32/ announcement/trunk/src/main/webapp/fckeditor/editor/filemanager/browser/default/images/icons/32/ai.gif announcement/trunk/src/main/webapp/fckeditor/editor/filemanager/browser/default/images/icons/32/avi.gif announcement/trunk/src/main/webapp/fckeditor/editor/filemanager/browser/default/images/icons/32/bmp.gif announcement/trunk/src/main/webapp/fckeditor/editor/filemanager/browser/default/images/icons/32/cs.gif announcement/trunk/src/main/webapp/fckeditor/editor/filemanager/browser/default/images/icons/32/default.icon.gif announcement/trunk/src/main/webapp/fckeditor/editor/filemanager/browser/default/images/icons/32/dll.gif announcement/trunk/src/main/webapp/fckeditor/editor/filemanager/browser/default/images/icons/32/doc.gif announcement/trunk/src/main/webapp/fckeditor/editor/filemanager/browser/default/images/icons/32/exe.gif announcement/trunk/src/main/webapp/fckeditor/editor/filemanager/browser/default/images/icons/32/fla.gif announcement/trunk/src/main/webapp/fckeditor/editor/filemanager/browser/default/images/icons/32/gif.gif announcement/trunk/src/main/webapp/fckeditor/editor/filemanager/browser/default/images/icons/32/htm.gif announcement/trunk/src/main/webapp/fckeditor/editor/filemanager/browser/default/images/icons/32/html.gif announcement/trunk/src/main/webapp/fckeditor/editor/filemanager/browser/default/images/icons/32/jpg.gif announcement/trunk/src/main/webapp/fckeditor/editor/filemanager/browser/default/images/icons/32/js.gif announcement/trunk/src/main/webapp/fckeditor/editor/filemanager/browser/default/images/icons/32/mdb.gif announcement/trunk/src/main/webapp/fckeditor/editor/filemanager/browser/default/images/icons/32/mp3.gif announcement/trunk/src/main/webapp/fckeditor/editor/filemanager/browser/default/images/icons/32/pdf.gif announcement/trunk/src/main/webapp/fckeditor/editor/filemanager/browser/default/images/icons/32/png.gif announcement/trunk/src/main/webapp/fckeditor/editor/filemanager/browser/default/images/icons/32/ppt.gif announcement/trunk/src/main/webapp/fckeditor/editor/filemanager/browser/default/images/icons/32/rdp.gif announcement/trunk/src/main/webapp/fckeditor/editor/filemanager/browser/default/images/icons/32/swf.gif announcement/trunk/src/main/webapp/fckeditor/editor/filemanager/browser/default/images/icons/32/swt.gif announcement/trunk/src/main/webapp/fckeditor/editor/filemanager/browser/default/images/icons/32/txt.gif announcement/trunk/src/main/webapp/fckeditor/editor/filemanager/browser/default/images/icons/32/vsd.gif announcement/trunk/src/main/webapp/fckeditor/editor/filemanager/browser/default/images/icons/32/xls.gif announcement/trunk/src/main/webapp/fckeditor/editor/filemanager/browser/default/images/icons/32/xml.gif announcement/trunk/src/main/webapp/fckeditor/editor/filemanager/browser/default/images/icons/32/zip.gif announcement/trunk/src/main/webapp/fckeditor/editor/filemanager/browser/default/images/icons/ai.gif announcement/trunk/src/main/webapp/fckeditor/editor/filemanager/browser/default/images/icons/avi.gif announcement/trunk/src/main/webapp/fckeditor/editor/filemanager/browser/default/images/icons/bmp.gif announcement/trunk/src/main/webapp/fckeditor/editor/filemanager/browser/default/images/icons/cs.gif announcement/trunk/src/main/webapp/fckeditor/editor/filemanager/browser/default/images/icons/default.icon.gif announcement/trunk/src/main/webapp/fckeditor/editor/filemanager/browser/default/images/icons/dll.gif announcement/trunk/src/main/webapp/fckeditor/editor/filemanager/browser/default/images/icons/doc.gif announcement/trunk/src/main/webapp/fckeditor/editor/filemanager/browser/default/images/icons/exe.gif announcement/trunk/src/main/webapp/fckeditor/editor/filemanager/browser/default/images/icons/fla.gif announcement/trunk/src/main/webapp/fckeditor/editor/filemanager/browser/default/images/icons/gif.gif announcement/trunk/src/main/webapp/fckeditor/editor/filemanager/browser/default/images/icons/htm.gif announcement/trunk/src/main/webapp/fckeditor/editor/filemanager/browser/default/images/icons/html.gif announcement/trunk/src/main/webapp/fckeditor/editor/filemanager/browser/default/images/icons/jpg.gif announcement/trunk/src/main/webapp/fckeditor/editor/filemanager/browser/default/images/icons/js.gif announcement/trunk/src/main/webapp/fckeditor/editor/filemanager/browser/default/images/icons/mdb.gif announcement/trunk/src/main/webapp/fckeditor/editor/filemanager/browser/default/images/icons/mp3.gif announcement/trunk/src/main/webapp/fckeditor/editor/filemanager/browser/default/images/icons/pdf.gif announcement/trunk/src/main/webapp/fckeditor/editor/filemanager/browser/default/images/icons/png.gif announcement/trunk/src/main/webapp/fckeditor/editor/filemanager/browser/default/images/icons/ppt.gif announcement/trunk/src/main/webapp/fckeditor/editor/filemanager/browser/default/images/icons/rdp.gif announcement/trunk/src/main/webapp/fckeditor/editor/filemanager/browser/default/images/icons/swf.gif announcement/trunk/src/main/webapp/fckeditor/editor/filemanager/browser/default/images/icons/swt.gif announcement/trunk/src/main/webapp/fckeditor/editor/filemanager/browser/default/images/icons/txt.gif announcement/trunk/src/main/webapp/fckeditor/editor/filemanager/browser/default/images/icons/vsd.gif announcement/trunk/src/main/webapp/fckeditor/editor/filemanager/browser/default/images/icons/xls.gif announcement/trunk/src/main/webapp/fckeditor/editor/filemanager/browser/default/images/icons/xml.gif announcement/trunk/src/main/webapp/fckeditor/editor/filemanager/browser/default/images/icons/zip.gif announcement/trunk/src/main/webapp/fckeditor/editor/filemanager/browser/default/images/spacer.gif announcement/trunk/src/main/webapp/fckeditor/editor/filemanager/browser/default/js/ announcement/trunk/src/main/webapp/fckeditor/editor/filemanager/browser/default/js/common.js announcement/trunk/src/main/webapp/fckeditor/editor/filemanager/browser/default/js/fckxml.js announcement/trunk/src/main/webapp/fckeditor/editor/filemanager/connectors/ announcement/trunk/src/main/webapp/fckeditor/editor/filemanager/connectors/asp/ announcement/trunk/src/main/webapp/fckeditor/editor/filemanager/connectors/asp/basexml.asp announcement/trunk/src/main/webapp/fckeditor/editor/filemanager/connectors/asp/class_upload.asp announcement/trunk/src/main/webapp/fckeditor/editor/filemanager/connectors/asp/commands.asp announcement/trunk/src/main/webapp/fckeditor/editor/filemanager/connectors/asp/config.asp announcement/trunk/src/main/webapp/fckeditor/editor/filemanager/connectors/asp/connector.asp announcement/trunk/src/main/webapp/fckeditor/editor/filemanager/connectors/asp/io.asp announcement/trunk/src/main/webapp/fckeditor/editor/filemanager/connectors/asp/upload.asp announcement/trunk/src/main/webapp/fckeditor/editor/filemanager/connectors/asp/util.asp announcement/trunk/src/main/webapp/fckeditor/editor/filemanager/connectors/aspx/ announcement/trunk/src/main/webapp/fckeditor/editor/filemanager/connectors/aspx/config.ascx announcement/trunk/src/main/webapp/fckeditor/editor/filemanager/connectors/aspx/connector.aspx announcement/trunk/src/main/webapp/fckeditor/editor/filemanager/connectors/aspx/upload.aspx announcement/trunk/src/main/webapp/fckeditor/editor/filemanager/connectors/cfm/ announcement/trunk/src/main/webapp/fckeditor/editor/filemanager/connectors/cfm/ImageObject.cfc announcement/trunk/src/main/webapp/fckeditor/editor/filemanager/connectors/cfm/cf5_connector.cfm announcement/trunk/src/main/webapp/fckeditor/editor/filemanager/connectors/cfm/cf5_upload.cfm announcement/trunk/src/main/webapp/fckeditor/editor/filemanager/connectors/cfm/cf_basexml.cfm announcement/trunk/src/main/webapp/fckeditor/editor/filemanager/connectors/cfm/cf_commands.cfm announcement/trunk/src/main/webapp/fckeditor/editor/filemanager/connectors/cfm/cf_connector.cfm announcement/trunk/src/main/webapp/fckeditor/editor/filemanager/connectors/cfm/cf_io.cfm announcement/trunk/src/main/webapp/fckeditor/editor/filemanager/connectors/cfm/cf_upload.cfm announcement/trunk/src/main/webapp/fckeditor/editor/filemanager/connectors/cfm/cf_util.cfm announcement/trunk/src/main/webapp/fckeditor/editor/filemanager/connectors/cfm/config.cfm announcement/trunk/src/main/webapp/fckeditor/editor/filemanager/connectors/cfm/connector.cfm announcement/trunk/src/main/webapp/fckeditor/editor/filemanager/connectors/cfm/image.cfc announcement/trunk/src/main/webapp/fckeditor/editor/filemanager/connectors/cfm/upload.cfm announcement/trunk/src/main/webapp/fckeditor/editor/filemanager/connectors/lasso/ announcement/trunk/src/main/webapp/fckeditor/editor/filemanager/connectors/lasso/config.lasso announcement/trunk/src/main/webapp/fckeditor/editor/filemanager/connectors/lasso/connector.lasso announcement/trunk/src/main/webapp/fckeditor/editor/filemanager/connectors/lasso/upload.lasso announcement/trunk/src/main/webapp/fckeditor/editor/filemanager/connectors/perl/ announcement/trunk/src/main/webapp/fckeditor/editor/filemanager/connectors/perl/basexml.pl announcement/trunk/src/main/webapp/fckeditor/editor/filemanager/connectors/perl/commands.pl announcement/trunk/src/main/webapp/fckeditor/editor/filemanager/connectors/perl/connector.cgi announcement/trunk/src/main/webapp/fckeditor/editor/filemanager/connectors/perl/io.pl announcement/trunk/src/main/webapp/fckeditor/editor/filemanager/connectors/perl/upload.cgi announcement/trunk/src/main/webapp/fckeditor/editor/filemanager/connectors/perl/upload_fck.pl announcement/trunk/src/main/webapp/fckeditor/editor/filemanager/connectors/perl/util.pl announcement/trunk/src/main/webapp/fckeditor/editor/filemanager/connectors/php/ announcement/trunk/src/main/webapp/fckeditor/editor/filemanager/connectors/php/basexml.php announcement/trunk/src/main/webapp/fckeditor/editor/filemanager/connectors/php/commands.php announcement/trunk/src/main/webapp/fckeditor/editor/filemanager/connectors/php/config.php announcement/trunk/src/main/webapp/fckeditor/editor/filemanager/connectors/php/connector.php announcement/trunk/src/main/webapp/fckeditor/editor/filemanager/connectors/php/io.php announcement/trunk/src/main/webapp/fckeditor/editor/filemanager/connectors/php/phpcompat.php announcement/trunk/src/main/webapp/fckeditor/editor/filemanager/connectors/php/upload.php announcement/trunk/src/main/webapp/fckeditor/editor/filemanager/connectors/php/util.php announcement/trunk/src/main/webapp/fckeditor/editor/filemanager/connectors/py/ announcement/trunk/src/main/webapp/fckeditor/editor/filemanager/connectors/py/config.py announcement/trunk/src/main/webapp/fckeditor/editor/filemanager/connectors/py/connector.py announcement/trunk/src/main/webapp/fckeditor/editor/filemanager/connectors/py/fckcommands.py announcement/trunk/src/main/webapp/fckeditor/editor/filemanager/connectors/py/fckconnector.py announcement/trunk/src/main/webapp/fckeditor/editor/filemanager/connectors/py/fckoutput.py announcement/trunk/src/main/webapp/fckeditor/editor/filemanager/connectors/py/fckutil.py announcement/trunk/src/main/webapp/fckeditor/editor/filemanager/connectors/py/htaccess.txt announcement/trunk/src/main/webapp/fckeditor/editor/filemanager/connectors/py/upload.py announcement/trunk/src/main/webapp/fckeditor/editor/filemanager/connectors/py/wsgi.py announcement/trunk/src/main/webapp/fckeditor/editor/filemanager/connectors/py/zope.py announcement/trunk/src/main/webapp/fckeditor/editor/filemanager/connectors/test.html announcement/trunk/src/main/webapp/fckeditor/editor/filemanager/connectors/uploadtest.html announcement/trunk/src/main/webapp/fckeditor/editor/images/ announcement/trunk/src/main/webapp/fckeditor/editor/images/anchor.gif announcement/trunk/src/main/webapp/fckeditor/editor/images/arrow_ltr.gif announcement/trunk/src/main/webapp/fckeditor/editor/images/arrow_rtl.gif announcement/trunk/src/main/webapp/fckeditor/editor/images/smiley/ announcement/trunk/src/main/webapp/fckeditor/editor/images/smiley/msn/ announcement/trunk/src/main/webapp/fckeditor/editor/images/smiley/msn/angel_smile.gif announcement/trunk/src/main/webapp/fckeditor/editor/images/smiley/msn/angry_smile.gif announcement/trunk/src/main/webapp/fckeditor/editor/images/smiley/msn/broken_heart.gif announcement/trunk/src/main/webapp/fckeditor/editor/images/smiley/msn/cake.gif announcement/trunk/src/main/webapp/fckeditor/editor/images/smiley/msn/confused_smile.gif announcement/trunk/src/main/webapp/fckeditor/editor/images/smiley/msn/cry_smile.gif announcement/trunk/src/main/webapp/fckeditor/editor/images/smiley/msn/devil_smile.gif announcement/trunk/src/main/webapp/fckeditor/editor/images/smiley/msn/embaressed_smile.gif announcement/trunk/src/main/webapp/fckeditor/editor/images/smiley/msn/envelope.gif announcement/trunk/src/main/webapp/fckeditor/editor/images/smiley/msn/heart.gif announcement/trunk/src/main/webapp/fckeditor/editor/images/smiley/msn/kiss.gif announcement/trunk/src/main/webapp/fckeditor/editor/images/smiley/msn/lightbulb.gif announcement/trunk/src/main/webapp/fckeditor/editor/images/smiley/msn/omg_smile.gif announcement/trunk/src/main/webapp/fckeditor/editor/images/smiley/msn/regular_smile.gif announcement/trunk/src/main/webapp/fckeditor/editor/images/smiley/msn/sad_smile.gif announcement/trunk/src/main/webapp/fckeditor/editor/images/smiley/msn/shades_smile.gif announcement/trunk/src/main/webapp/fckeditor/editor/images/smiley/msn/teeth_smile.gif announcement/trunk/src/main/webapp/fckeditor/editor/images/smiley/msn/thumbs_down.gif announcement/trunk/src/main/webapp/fckeditor/editor/images/smiley/msn/thumbs_up.gif announcement/trunk/src/main/webapp/fckeditor/editor/images/smiley/msn/tounge_smile.gif announcement/trunk/src/main/webapp/fckeditor/editor/images/smiley/msn/whatchutalkingabout_smile.gif announcement/trunk/src/main/webapp/fckeditor/editor/images/smiley/msn/wink_smile.gif announcement/trunk/src/main/webapp/fckeditor/editor/images/spacer.gif announcement/trunk/src/main/webapp/fckeditor/editor/js/ announcement/trunk/src/main/webapp/fckeditor/editor/js/fckadobeair.js announcement/trunk/src/main/webapp/fckeditor/editor/js/fckeditorcode_gecko.js announcement/trunk/src/main/webapp/fckeditor/editor/js/fckeditorcode_ie.js announcement/trunk/src/main/webapp/fckeditor/editor/lang/ announcement/trunk/src/main/webapp/fckeditor/editor/lang/_translationstatus.txt announcement/trunk/src/main/webapp/fckeditor/editor/lang/af.js announcement/trunk/src/main/webapp/fckeditor/editor/lang/ar.js announcement/trunk/src/main/webapp/fckeditor/editor/lang/bg.js announcement/trunk/src/main/webapp/fckeditor/editor/lang/bn.js announcement/trunk/src/main/webapp/fckeditor/editor/lang/bs.js announcement/trunk/src/main/webapp/fckeditor/editor/lang/ca.js announcement/trunk/src/main/webapp/fckeditor/editor/lang/cs.js announcement/trunk/src/main/webapp/fckeditor/editor/lang/da.js announcement/trunk/src/main/webapp/fckeditor/editor/lang/de.js announcement/trunk/src/main/webapp/fckeditor/editor/lang/el.js announcement/trunk/src/main/webapp/fckeditor/editor/lang/en-au.js announcement/trunk/src/main/webapp/fckeditor/editor/lang/en-ca.js announcement/trunk/src/main/webapp/fckeditor/editor/lang/en-uk.js announcement/trunk/src/main/webapp/fckeditor/editor/lang/en.js announcement/trunk/src/main/webapp/fckeditor/editor/lang/eo.js announcement/trunk/src/main/webapp/fckeditor/editor/lang/es.js announcement/trunk/src/main/webapp/fckeditor/editor/lang/et.js announcement/trunk/src/main/webapp/fckeditor/editor/lang/eu.js announcement/trunk/src/main/webapp/fckeditor/editor/lang/fa.js announcement/trunk/src/main/webapp/fckeditor/editor/lang/fi.js announcement/trunk/src/main/webapp/fckeditor/editor/lang/fo.js announcement/trunk/src/main/webapp/fckeditor/editor/lang/fr-ca.js announcement/trunk/src/main/webapp/fckeditor/editor/lang/fr.js announcement/trunk/src/main/webapp/fckeditor/editor/lang/gl.js announcement/trunk/src/main/webapp/fckeditor/editor/lang/gu.js announcement/trunk/src/main/webapp/fckeditor/editor/lang/he.js announcement/trunk/src/main/webapp/fckeditor/editor/lang/hi.js announcement/trunk/src/main/webapp/fckeditor/editor/lang/hr.js announcement/trunk/src/main/webapp/fckeditor/editor/lang/hu.js announcement/trunk/src/main/webapp/fckeditor/editor/lang/it.js announcement/trunk/src/main/webapp/fckeditor/editor/lang/ja.js announcement/trunk/src/main/webapp/fckeditor/editor/lang/km.js announcement/trunk/src/main/webapp/fckeditor/editor/lang/ko.js announcement/trunk/src/main/webapp/fckeditor/editor/lang/lt.js announcement/trunk/src/main/webapp/fckeditor/editor/lang/lv.js announcement/trunk/src/main/webapp/fckeditor/editor/lang/mn.js announcement/trunk/src/main/webapp/fckeditor/editor/lang/ms.js announcement/trunk/src/main/webapp/fckeditor/editor/lang/nb.js announcement/trunk/src/main/webapp/fckeditor/editor/lang/nl.js announcement/trunk/src/main/webapp/fckeditor/editor/lang/no.js announcement/trunk/src/main/webapp/fckeditor/editor/lang/pl.js announcement/trunk/src/main/webapp/fckeditor/editor/lang/pt-br.js announcement/trunk/src/main/webapp/fckeditor/editor/lang/pt.js announcement/trunk/src/main/webapp/fckeditor/editor/lang/ro.js announcement/trunk/src/main/webapp/fckeditor/editor/lang/ru.js announcement/trunk/src/main/webapp/fckeditor/editor/lang/sk.js announcement/trunk/src/main/webapp/fckeditor/editor/lang/sl.js announcement/trunk/src/main/webapp/fckeditor/editor/lang/sr-latn.js announcement/trunk/src/main/webapp/fckeditor/editor/lang/sr.js announcement/trunk/src/main/webapp/fckeditor/editor/lang/sv.js announcement/trunk/src/main/webapp/fckeditor/editor/lang/th.js announcement/trunk/src/main/webapp/fckeditor/editor/lang/tr.js announcement/trunk/src/main/webapp/fckeditor/editor/lang/uk.js announcement/trunk/src/main/webapp/fckeditor/editor/lang/vi.js announcement/trunk/src/main/webapp/fckeditor/editor/lang/zh-cn.js announcement/trunk/src/main/webapp/fckeditor/editor/lang/zh.js announcement/trunk/src/main/webapp/fckeditor/editor/plugins/ announcement/trunk/src/main/webapp/fckeditor/editor/plugins/autogrow/ announcement/trunk/src/main/webapp/fckeditor/editor/plugins/autogrow/fckplugin.js announcement/trunk/src/main/webapp/fckeditor/editor/plugins/bbcode/ announcement/trunk/src/main/webapp/fckeditor/editor/plugins/bbcode/_sample/ announcement/trunk/src/main/webapp/fckeditor/editor/plugins/bbcode/_sample/sample.config.js announcement/trunk/src/main/webapp/fckeditor/editor/plugins/bbcode/_sample/sample.html announcement/trunk/src/main/webapp/fckeditor/editor/plugins/bbcode/fckplugin.js announcement/trunk/src/main/webapp/fckeditor/editor/plugins/dragresizetable/ announcement/trunk/src/main/webapp/fckeditor/editor/plugins/dragresizetable/fckplugin.js announcement/trunk/src/main/webapp/fckeditor/editor/plugins/placeholder/ announcement/trunk/src/main/webapp/fckeditor/editor/plugins/placeholder/fck_placeholder.html announcement/trunk/src/main/webapp/fckeditor/editor/plugins/placeholder/fckplugin.js announcement/trunk/src/main/webapp/fckeditor/editor/plugins/placeholder/lang/ announcement/trunk/src/main/webapp/fckeditor/editor/plugins/placeholder/lang/de.js announcement/trunk/src/main/webapp/fckeditor/editor/plugins/placeholder/lang/en.js announcement/trunk/src/main/webapp/fckeditor/editor/plugins/placeholder/lang/es.js announcement/trunk/src/main/webapp/fckeditor/editor/plugins/placeholder/lang/fr.js announcement/trunk/src/main/webapp/fckeditor/editor/plugins/placeholder/lang/it.js announcement/trunk/src/main/webapp/fckeditor/editor/plugins/placeholder/lang/pl.js announcement/trunk/src/main/webapp/fckeditor/editor/plugins/placeholder/placeholder.gif announcement/trunk/src/main/webapp/fckeditor/editor/plugins/simplecommands/ announcement/trunk/src/main/webapp/fckeditor/editor/plugins/simplecommands/fckplugin.js announcement/trunk/src/main/webapp/fckeditor/editor/plugins/tablecommands/ announcement/trunk/src/main/webapp/fckeditor/editor/plugins/tablecommands/fckplugin.js announcement/trunk/src/main/webapp/fckeditor/editor/skins/ announcement/trunk/src/main/webapp/fckeditor/editor/skins/_fckviewstrips.html announcement/trunk/src/main/webapp/fckeditor/editor/skins/default/ announcement/trunk/src/main/webapp/fckeditor/editor/skins/default/fck_dialog.css announcement/trunk/src/main/webapp/fckeditor/editor/skins/default/fck_dialog_ie6.js announcement/trunk/src/main/webapp/fckeditor/editor/skins/default/fck_editor.css announcement/trunk/src/main/webapp/fckeditor/editor/skins/default/fck_strip.gif announcement/trunk/src/main/webapp/fckeditor/editor/skins/default/images/ announcement/trunk/src/main/webapp/fckeditor/editor/skins/default/images/dialog.sides.gif announcement/trunk/src/main/webapp/fckeditor/editor/skins/default/images/dialog.sides.png announcement/trunk/src/main/webapp/fckeditor/editor/skins/default/images/dialog.sides.rtl.png announcement/trunk/src/main/webapp/fckeditor/editor/skins/default/images/sprites.gif announcement/trunk/src/main/webapp/fckeditor/editor/skins/default/images/sprites.png announcement/trunk/src/main/webapp/fckeditor/editor/skins/default/images/toolbar.arrowright.gif announcement/trunk/src/main/webapp/fckeditor/editor/skins/default/images/toolbar.buttonarrow.gif announcement/trunk/src/main/webapp/fckeditor/editor/skins/default/images/toolbar.collapse.gif announcement/trunk/src/main/webapp/fckeditor/editor/skins/default/images/toolbar.end.gif announcement/trunk/src/main/webapp/fckeditor/editor/skins/default/images/toolbar.expand.gif announcement/trunk/src/main/webapp/fckeditor/editor/skins/default/images/toolbar.separator.gif announcement/trunk/src/main/webapp/fckeditor/editor/skins/default/images/toolbar.start.gif announcement/trunk/src/main/webapp/fckeditor/editor/skins/office2003/ announcement/trunk/src/main/webapp/fckeditor/editor/skins/office2003/fck_dialog.css announcement/trunk/src/main/webapp/fckeditor/editor/skins/office2003/fck_dialog_ie6.js announcement/trunk/src/main/webapp/fckeditor/editor/skins/office2003/fck_editor.css announcement/trunk/src/main/webapp/fckeditor/editor/skins/office2003/fck_strip.gif announcement/trunk/src/main/webapp/fckeditor/editor/skins/office2003/images/ announcement/trunk/src/main/webapp/fckeditor/editor/skins/office2003/images/dialog.sides.gif announcement/trunk/src/main/webapp/fckeditor/editor/skins/office2003/images/dialog.sides.png announcement/trunk/src/main/webapp/fckeditor/editor/skins/office2003/images/dialog.sides.rtl.png announcement/trunk/src/main/webapp/fckeditor/editor/skins/office2003/images/sprites.gif announcement/trunk/src/main/webapp/fckeditor/editor/skins/office2003/images/sprites.png announcement/trunk/src/main/webapp/fckeditor/editor/skins/office2003/images/toolbar.arrowright.gif announcement/trunk/src/main/webapp/fckeditor/editor/skins/office2003/images/toolbar.bg.gif announcement/trunk/src/main/webapp/fckeditor/editor/skins/office2003/images/toolbar.buttonarrow.gif announcement/trunk/src/main/webapp/fckeditor/editor/skins/office2003/images/toolbar.collapse.gif announcement/trunk/src/main/webapp/fckeditor/editor/skins/office2003/images/toolbar.end.gif announcement/trunk/src/main/webapp/fckeditor/editor/skins/office2003/images/toolbar.expand.gif announcement/trunk/src/main/webapp/fckeditor/editor/skins/office2003/images/toolbar.separator.gif announcement/trunk/src/main/webapp/fckeditor/editor/skins/office2003/images/toolbar.start.gif announcement/trunk/src/main/webapp/fckeditor/editor/skins/silver/ announcement/trunk/src/main/webapp/fckeditor/editor/skins/silver/fck_dialog.css announcement/trunk/src/main/webapp/fckeditor/editor/skins/silver/fck_dialog_ie6.js announcement/trunk/src/main/webapp/fckeditor/editor/skins/silver/fck_editor.css announcement/trunk/src/main/webapp/fckeditor/editor/skins/silver/fck_strip.gif announcement/trunk/src/main/webapp/fckeditor/editor/skins/silver/images/ announcement/trunk/src/main/webapp/fckeditor/editor/skins/silver/images/dialog.sides.gif announcement/trunk/src/main/webapp/fckeditor/editor/skins/silver/images/dialog.sides.png announcement/trunk/src/main/webapp/fckeditor/editor/skins/silver/images/dialog.sides.rtl.png announcement/trunk/src/main/webapp/fckeditor/editor/skins/silver/images/sprites.gif announcement/trunk/src/main/webapp/fckeditor/editor/skins/silver/images/sprites.png announcement/trunk/src/main/webapp/fckeditor/editor/skins/silver/images/toolbar.arrowright.gif announcement/trunk/src/main/webapp/fckeditor/editor/skins/silver/images/toolbar.buttonarrow.gif announcement/trunk/src/main/webapp/fckeditor/editor/skins/silver/images/toolbar.buttonbg.gif announcement/trunk/src/main/webapp/fckeditor/editor/skins/silver/images/toolbar.collapse.gif announcement/trunk/src/main/webapp/fckeditor/editor/skins/silver/images/toolbar.end.gif announcement/trunk/src/main/webapp/fckeditor/editor/skins/silver/images/toolbar.expand.gif announcement/trunk/src/main/webapp/fckeditor/editor/skins/silver/images/toolbar.separator.gif announcement/trunk/src/main/webapp/fckeditor/editor/skins/silver/images/toolbar.start.gif announcement/trunk/src/main/webapp/fckeditor/fckconfig.js announcement/trunk/src/main/webapp/fckeditor/fckeditor.afp announcement/trunk/src/main/webapp/fckeditor/fckeditor.asp announcement/trunk/src/main/webapp/fckeditor/fckeditor.cfc announcement/trunk/src/main/webapp/fckeditor/fckeditor.cfm announcement/trunk/src/main/webapp/fckeditor/fckeditor.js announcement/trunk/src/main/webapp/fckeditor/fckeditor.lasso announcement/trunk/src/main/webapp/fckeditor/fckeditor.php announcement/trunk/src/main/webapp/fckeditor/fckeditor.pl announcement/trunk/src/main/webapp/fckeditor/fckeditor.py announcement/trunk/src/main/webapp/fckeditor/fckeditor_php4.php announcement/trunk/src/main/webapp/fckeditor/fckeditor_php5.php announcement/trunk/src/main/webapp/fckeditor/fckpackager.xml announcement/trunk/src/main/webapp/fckeditor/fckstyles.xml announcement/trunk/src/main/webapp/fckeditor/fcktemplates.xml announcement/trunk/src/main/webapp/fckeditor/fckutils.cfm announcement/trunk/src/main/webapp/fckeditor/license.txt announcement/trunk/src/main/webapp/fckeditor/myconfig.js announcement/trunk/src/main/webapp/view/ announcement/trunk/src/main/webapp/view/edit/ announcement/trunk/src/main/webapp/view/edit/editContent.html announcement/trunk/src/main/webapp/view/error/ announcement/trunk/src/main/webapp/view/error/error.html announcement/trunk/src/main/webapp/view/view/ announcement/trunk/src/main/webapp/view/view/displayContent.html -------------- next part -------------- Added: announcement/trunk/.classpath =================================================================== --- announcement/trunk/.classpath (rev 0) +++ announcement/trunk/.classpath 2008-06-30 02:54:27 UTC (rev 1002) @@ -0,0 +1,43 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + \ No newline at end of file Property changes on: announcement/trunk/.classpath ___________________________________________________________________ Name: svn:eol-style + native Added: announcement/trunk/.project =================================================================== --- announcement/trunk/.project (rev 0) +++ announcement/trunk/.project 2008-06-30 02:54:27 UTC (rev 1002) @@ -0,0 +1,15 @@ + + announcement + + + + + org.eclipse.jdt.core.javabuilder + + + + + org.eclipse.jdt.core.javanature + org.seasar.dolteng.eclipse.nature + + \ No newline at end of file Property changes on: announcement/trunk/.project ___________________________________________________________________ Name: svn:eol-style + native Added: announcement/trunk/.settings/org.eclipse.jdt.core.prefs =================================================================== --- announcement/trunk/.settings/org.eclipse.jdt.core.prefs (rev 0) +++ announcement/trunk/.settings/org.eclipse.jdt.core.prefs 2008-06-30 02:54:27 UTC (rev 1002) @@ -0,0 +1,259 @@ +#Fri Aug 10 22:15:11 JST 2007 +org.eclipse.jdt.core.formatter.brace_position_for_enum_constant=end_of_line +org.eclipse.jdt.core.formatter.insert_space_before_opening_paren_in_method_invocation=do not insert +org.eclipse.jdt.core.formatter.format_guardian_clause_on_one_line=false +org.eclipse.jdt.core.formatter.comment.indent_root_tags=true +org.eclipse.jdt.core.formatter.number_of_blank_lines_at_beginning_of_method_body=0 +org.eclipse.jdt.core.formatter.insert_space_before_opening_paren_in_synchronized=insert +org.eclipse.jdt.core.formatter.insert_space_before_closing_paren_in_switch=do not insert +org.eclipse.jdt.core.formatter.insert_space_after_comma_in_for_inits=insert +org.eclipse.jdt.core.formatter.insert_space_after_opening_paren_in_method_invocation=do not insert +org.eclipse.jdt.core.compiler.compliance=1.5 +org.eclipse.jdt.core.formatter.insert_space_before_opening_brace_in_annotation_type_declaration=insert +org.eclipse.jdt.core.formatter.insert_space_after_opening_brace_in_array_initializer=insert +org.eclipse.jdt.core.formatter.insert_new_line_before_catch_in_try_statement=do not insert +org.eclipse.jdt.core.formatter.insert_space_before_closing_bracket_in_array_allocation_expression=do not insert +org.eclipse.jdt.core.formatter.insert_space_between_brackets_in_array_type_reference=do not insert +org.eclipse.jdt.core.formatter.brace_position_for_switch=end_of_line +org.eclipse.jdt.core.formatter.insert_space_after_closing_angle_bracket_in_type_parameters=insert +org.eclipse.jdt.core.formatter.insert_space_before_postfix_operator=do not insert +org.eclipse.jdt.core.formatter.insert_space_before_opening_brace_in_enum_constant=insert +org.eclipse.jdt.core.formatter.insert_new_line_at_end_of_file_if_missing=do not insert +org.eclipse.jdt.core.formatter.insert_space_before_opening_paren_in_catch=insert +org.eclipse.jdt.core.formatter.insert_space_before_closing_paren_in_method_declaration=do not insert +org.eclipse.jdt.core.formatter.brace_position_for_enum_declaration=end_of_line +org.eclipse.jdt.core.formatter.alignment_for_arguments_in_allocation_expression=16 +org.eclipse.jdt.core.formatter.continuation_indentation_for_array_initializer=2 +org.eclipse.jdt.core.formatter.insert_space_after_comma_in_constructor_declaration_throws=insert +org.eclipse.jdt.core.formatter.blank_lines_before_method=1 +org.eclipse.jdt.core.formatter.insert_space_before_opening_brace_in_anonymous_type_declaration=insert +org.eclipse.jdt.core.formatter.insert_space_after_assignment_operator=insert +org.eclipse.jdt.core.formatter.indent_body_declarations_compare_to_annotation_declaration_header=true +org.eclipse.jdt.core.formatter.insert_space_before_opening_paren_in_method_declaration=do not insert +org.eclipse.jdt.core.formatter.insert_space_before_opening_brace_in_array_initializer=insert +org.eclipse.jdt.core.formatter.insert_space_before_opening_paren_in_annotation_type_member_declaration=do not insert +org.eclipse.jdt.core.formatter.comment.format_html=true +org.eclipse.jdt.core.formatter.insert_space_before_comma_in_explicitconstructorcall_arguments=do not insert +org.eclipse.jdt.core.formatter.insert_space_before_closing_angle_bracket_in_parameterized_type_reference=do not insert +org.eclipse.jdt.core.formatter.insert_space_before_closing_paren_in_annotation=do not insert +org.eclipse.jdt.core.formatter.number_of_empty_lines_to_preserve=1 +org.eclipse.jdt.core.formatter.insert_space_after_comma_in_enum_declarations=insert +org.eclipse.jdt.core.formatter.comment.insert_new_line_before_root_tags=insert +org.eclipse.jdt.core.compiler.codegen.targetPlatform=1.5 +org.eclipse.jdt.core.formatter.insert_new_line_before_while_in_do_statement=do not insert +org.eclipse.jdt.core.formatter.insert_space_before_comma_in_type_parameters=do not insert +org.eclipse.jdt.core.formatter.insert_space_after_opening_paren_in_enum_constant=do not insert +org.eclipse.jdt.core.formatter.alignment_for_selector_in_method_invocation=16 +org.eclipse.jdt.core.formatter.insert_space_after_at_in_annotation_type_declaration=do not insert +org.eclipse.jdt.core.formatter.insert_space_before_question_in_conditional=insert +org.eclipse.jdt.core.formatter.alignment_for_enum_constants=0 +org.eclipse.jdt.core.formatter.tabulation.size=4 +org.eclipse.jdt.core.formatter.insert_space_before_opening_brace_in_type_declaration=insert +org.eclipse.jdt.core.formatter.insert_new_line_in_empty_enum_constant=insert +org.eclipse.jdt.core.formatter.never_indent_line_comments_on_first_column=false +org.eclipse.jdt.core.formatter.insert_space_after_opening_paren_in_catch=do not insert +org.eclipse.jdt.core.formatter.comment.insert_new_line_for_parameter=insert +org.eclipse.jdt.core.formatter.insert_space_between_empty_parens_in_method_invocation=do not insert +org.eclipse.jdt.core.formatter.insert_space_before_parenthesized_expression_in_throw=insert +org.eclipse.jdt.core.formatter.indent_statements_compare_to_body=true +org.eclipse.jdt.core.formatter.insert_space_before_colon_in_conditional=insert +org.eclipse.jdt.core.formatter.comment.indent_parameter_description=true +org.eclipse.jdt.core.formatter.insert_space_before_opening_brace_in_method_declaration=insert +org.eclipse.jdt.core.formatter.keep_then_statement_on_same_line=false +org.eclipse.jdt.core.formatter.tabulation.char=space +org.eclipse.jdt.core.formatter.insert_space_between_empty_brackets_in_array_allocation_expression=do not insert +org.eclipse.jdt.core.formatter.insert_space_before_closing_paren_in_for=do not insert +org.eclipse.jdt.core.formatter.insert_space_before_closing_paren_in_synchronized=do not insert +org.eclipse.jdt.core.formatter.insert_space_after_comma_in_array_initializer=insert +org.eclipse.jdt.core.formatter.insert_space_after_colon_in_labeled_statement=insert +org.eclipse.jdt.core.formatter.insert_space_before_opening_paren_in_constructor_declaration=do not insert +org.eclipse.jdt.core.formatter.insert_space_before_closing_angle_bracket_in_type_arguments=do not insert +org.eclipse.jdt.core.formatter.insert_space_after_opening_paren_in_if=do not insert +org.eclipse.jdt.core.formatter.insert_space_after_opening_bracket_in_array_reference=do not insert +org.eclipse.jdt.core.formatter.insert_space_after_comma_in_for_increments=insert +org.eclipse.jdt.core.formatter.alignment_for_parameters_in_method_declaration=16 +org.eclipse.jdt.core.formatter.insert_space_after_opening_paren_in_switch=do not insert +org.eclipse.jdt.core.formatter.use_tabs_only_for_leading_indentations=false +org.eclipse.jdt.core.formatter.insert_space_before_comma_in_enum_constant_arguments=do not insert +org.eclipse.jdt.core.formatter.alignment_for_superinterfaces_in_type_declaration=16 +org.eclipse.jdt.core.formatter.blank_lines_between_import_groups=1 +org.eclipse.jdt.core.formatter.insert_space_before_at_in_annotation_type_declaration=insert +org.eclipse.jdt.core.formatter.insert_space_before_unary_operator=do not insert +org.eclipse.jdt.core.formatter.brace_position_for_block_in_case=end_of_line +org.eclipse.jdt.core.formatter.insert_space_after_comma_in_constructor_declaration_parameters=insert +org.eclipse.jdt.core.formatter.brace_position_for_block=end_of_line +org.eclipse.jdt.core.formatter.insert_space_before_opening_bracket_in_array_reference=do not insert +org.eclipse.jdt.core.formatter.insert_space_before_comma_in_type_arguments=do not insert +org.eclipse.jdt.core.formatter.insert_space_before_and_in_type_parameter=insert +org.eclipse.jdt.core.formatter.insert_space_before_comma_in_multiple_field_declarations=do not insert +org.eclipse.jdt.core.formatter.insert_space_before_assignment_operator=insert +org.eclipse.jdt.core.formatter.insert_space_after_ellipsis=insert +org.eclipse.jdt.core.formatter.insert_space_after_opening_angle_bracket_in_type_parameters=do not insert +org.eclipse.jdt.core.formatter.insert_space_after_comma_in_superinterfaces=insert +org.eclipse.jdt.core.formatter.insert_space_before_colon_in_default=do not insert +org.eclipse.jdt.core.formatter.blank_lines_before_imports=1 +org.eclipse.jdt.core.formatter.insert_space_after_colon_in_conditional=insert +org.eclipse.jdt.core.formatter.insert_space_before_semicolon_in_for=do not insert +org.eclipse.jdt.core.formatter.indent_switchstatements_compare_to_cases=true +org.eclipse.jdt.core.formatter.insert_space_after_opening_angle_bracket_in_type_arguments=do not insert +org.eclipse.jdt.core.formatter.insert_space_after_comma_in_allocation_expression=insert +org.eclipse.jdt.core.formatter.alignment_for_compact_if=16 +org.eclipse.jdt.core.formatter.insert_space_after_and_in_type_parameter=insert +org.eclipse.jdt.core.formatter.insert_space_before_opening_paren_in_if=insert +org.eclipse.jdt.core.formatter.insert_space_between_empty_braces_in_array_initializer=do not insert +org.eclipse.jdt.core.formatter.blank_lines_before_member_type=1 +org.eclipse.jdt.core.formatter.insert_space_before_question_in_wildcard=do not insert +org.eclipse.jdt.core.formatter.insert_space_before_colon_in_for=insert +org.eclipse.jdt.core.formatter.insert_space_after_postfix_operator=do not insert +org.eclipse.jdt.core.formatter.insert_space_after_comma_in_method_invocation_arguments=insert +org.eclipse.jdt.core.formatter.never_indent_block_comments_on_first_column=false +org.eclipse.jdt.core.formatter.insert_space_before_ellipsis=do not insert +org.eclipse.jdt.core.formatter.insert_space_before_comma_in_multiple_local_declarations=do not insert +org.eclipse.jdt.core.formatter.brace_position_for_array_initializer=end_of_line +org.eclipse.jdt.core.formatter.indent_body_declarations_compare_to_enum_constant_header=true +org.eclipse.jdt.core.formatter.indent_body_declarations_compare_to_type_header=true +org.eclipse.jdt.core.formatter.insert_space_before_closing_angle_bracket_in_type_parameters=do not insert +org.eclipse.jdt.core.formatter.blank_lines_before_field=1 +org.eclipse.jdt.core.formatter.insert_new_line_in_empty_type_declaration=insert +org.eclipse.jdt.core.formatter.indent_statements_compare_to_block=true +org.eclipse.jdt.core.formatter.insert_space_before_comma_in_method_declaration_parameters=do not insert +org.eclipse.jdt.core.formatter.insert_space_after_colon_in_case=insert +org.eclipse.jdt.core.formatter.keep_empty_array_initializer_on_one_line=false +org.eclipse.jdt.core.formatter.insert_space_before_binary_operator=insert +org.eclipse.jdt.core.formatter.comment.format_block_comments=false +org.eclipse.jdt.core.formatter.insert_space_after_comma_in_annotation=insert +org.eclipse.jdt.core.formatter.insert_space_after_closing_brace_in_block=insert +org.eclipse.jdt.core.formatter.comment.clear_blank_lines_in_block_comment=false +org.eclipse.jdt.core.formatter.put_empty_statement_on_new_line=true +org.eclipse.jdt.core.formatter.brace_position_for_method_declaration=end_of_line +org.eclipse.jdt.core.formatter.insert_space_before_prefix_operator=do not insert +org.eclipse.jdt.core.formatter.insert_space_before_comma_in_superinterfaces=do not insert +org.eclipse.jdt.core.formatter.insert_space_after_comma_in_enum_constant_arguments=insert +org.eclipse.jdt.core.formatter.insert_space_after_opening_paren_in_parenthesized_expression=do not insert +org.eclipse.jdt.core.formatter.comment.clear_blank_lines_in_javadoc_comment=false +org.eclipse.jdt.core.formatter.blank_lines_before_first_class_body_declaration=0 +org.eclipse.jdt.core.formatter.lineSplit=80 +org.eclipse.jdt.core.formatter.insert_space_between_empty_parens_in_enum_constant=do not insert +org.eclipse.jdt.core.formatter.insert_space_after_question_in_conditional=insert +org.eclipse.jdt.core.formatter.insert_space_before_closing_paren_in_if=do not insert +org.eclipse.jdt.core.formatter.insert_space_after_question_in_wildcard=do not insert +org.eclipse.jdt.core.formatter.insert_space_after_comma_in_explicitconstructorcall_arguments=insert +org.eclipse.jdt.core.formatter.insert_space_before_opening_paren_in_enum_constant=do not insert +org.eclipse.jdt.core.formatter.blank_lines_after_imports=1 +org.eclipse.jdt.core.formatter.insert_space_after_opening_paren_in_synchronized=do not insert +org.eclipse.jdt.core.formatter.insert_space_before_opening_brace_in_block=insert +org.eclipse.jdt.core.formatter.insert_new_line_before_else_in_if_statement=do not insert +org.eclipse.jdt.core.formatter.insert_new_line_after_annotation=insert +org.eclipse.jdt.core.formatter.alignment_for_throws_clause_in_method_declaration=16 +org.eclipse.jdt.core.formatter.insert_space_before_closing_paren_in_cast=do not insert +org.eclipse.jdt.core.formatter.insert_space_before_comma_in_constructor_declaration_throws=do not insert +org.eclipse.jdt.core.formatter.insert_space_before_closing_paren_in_method_invocation=do not insert +org.eclipse.jdt.core.formatter.alignment_for_arguments_in_explicit_constructor_call=16 +org.eclipse.jdt.core.formatter.insert_space_before_opening_brace_in_enum_declaration=insert +org.eclipse.jdt.core.formatter.insert_space_before_closing_brace_in_array_initializer=insert +org.eclipse.jdt.core.formatter.alignment_for_arguments_in_qualified_allocation_expression=16 +org.eclipse.jdt.core.formatter.insert_space_between_empty_parens_in_constructor_declaration=do not insert +org.eclipse.jdt.core.formatter.insert_space_after_semicolon_in_for=insert +org.eclipse.jdt.core.formatter.insert_space_before_opening_bracket_in_array_allocation_expression=do not insert +org.eclipse.jdt.core.formatter.blank_lines_before_package=0 +org.eclipse.jdt.core.formatter.insert_space_after_comma_in_type_arguments=insert +org.eclipse.jdt.core.formatter.wrap_before_binary_operator=true +org.eclipse.jdt.core.formatter.insert_space_before_opening_angle_bracket_in_type_parameters=do not insert +org.eclipse.jdt.core.formatter.brace_position_for_type_declaration=end_of_line +org.eclipse.jdt.core.formatter.insert_space_after_closing_paren_in_cast=insert +org.eclipse.jdt.core.formatter.brace_position_for_anonymous_type_declaration=end_of_line +org.eclipse.jdt.core.formatter.insert_space_before_closing_paren_in_while=do not insert +org.eclipse.jdt.core.formatter.insert_new_line_in_empty_method_body=insert +org.eclipse.jdt.core.formatter.keep_else_statement_on_same_line=false +org.eclipse.jdt.core.formatter.align_type_members_on_columns=false +org.eclipse.jdt.core.formatter.insert_space_after_opening_bracket_in_array_allocation_expression=do not insert +org.eclipse.jdt.core.formatter.blank_lines_between_type_declarations=1 +org.eclipse.jdt.core.formatter.insert_new_line_after_opening_brace_in_array_initializer=do not insert +org.eclipse.jdt.core.formatter.insert_space_after_binary_operator=insert +org.eclipse.jdt.core.formatter.insert_space_between_empty_parens_in_annotation_type_member_declaration=do not insert +org.eclipse.jdt.core.formatter.insert_new_line_before_closing_brace_in_array_initializer=do not insert +org.eclipse.jdt.core.formatter.insert_space_before_comma_in_constructor_declaration_parameters=do not insert +org.eclipse.jdt.core.formatter.insert_space_before_opening_angle_bracket_in_parameterized_type_reference=do not insert +org.eclipse.jdt.core.formatter.insert_space_after_prefix_operator=do not insert +org.eclipse.jdt.core.formatter.insert_space_before_comma_in_annotation=do not insert +org.eclipse.jdt.core.formatter.brace_position_for_constructor_declaration=end_of_line +org.eclipse.jdt.core.formatter.insert_space_before_comma_in_parameterized_type_reference=do not insert +org.eclipse.jdt.core.formatter.insert_space_before_closing_paren_in_parenthesized_expression=do not insert +org.eclipse.jdt.core.formatter.indent_switchstatements_compare_to_switch=false +org.eclipse.jdt.core.formatter.insert_space_after_opening_paren_in_cast=do not insert +org.eclipse.jdt.core.formatter.insert_space_before_opening_paren_in_for=insert +org.eclipse.jdt.core.formatter.insert_space_before_opening_bracket_in_array_type_reference=do not insert +org.eclipse.jdt.core.formatter.comment.format_header=false +org.eclipse.jdt.core.formatter.insert_new_line_in_empty_block=insert +org.eclipse.jdt.core.formatter.insert_space_after_opening_angle_bracket_in_parameterized_type_reference=do not insert +eclipse.preferences.version=1 +org.eclipse.jdt.core.formatter.insert_space_before_comma_in_method_invocation_arguments=do not insert +org.eclipse.jdt.core.formatter.insert_space_before_opening_angle_bracket_in_type_arguments=do not insert +org.eclipse.jdt.core.formatter.insert_space_before_comma_in_allocation_expression=do not insert +org.eclipse.jdt.core.formatter.insert_space_before_colon_in_assert=insert +org.eclipse.jdt.core.formatter.alignment_for_superclass_in_type_declaration=16 +org.eclipse.jdt.core.formatter.insert_new_line_in_empty_anonymous_type_declaration=insert +org.eclipse.jdt.core.formatter.alignment_for_superinterfaces_in_enum_declaration=16 +org.eclipse.jdt.core.formatter.insert_space_between_empty_parens_in_method_declaration=do not insert +org.eclipse.jdt.core.formatter.insert_space_before_comma_in_enum_declarations=do not insert +org.eclipse.jdt.core.formatter.insert_space_after_at_in_annotation=do not insert +org.eclipse.jdt.core.formatter.alignment_for_conditional_expression=80 +org.eclipse.jdt.core.formatter.blank_lines_before_new_chunk=1 +org.eclipse.jdt.core.formatter.brace_position_for_annotation_type_declaration=end_of_line +org.eclipse.jdt.core.formatter.insert_space_before_opening_paren_in_annotation=do not insert +org.eclipse.jdt.core.formatter.insert_space_before_closing_bracket_in_array_reference=do not insert +org.eclipse.jdt.core.formatter.alignment_for_multiple_fields=16 +org.eclipse.jdt.core.formatter.insert_space_before_comma_in_for_inits=do not insert +org.eclipse.jdt.core.formatter.alignment_for_arguments_in_method_invocation=16 +org.eclipse.jdt.core.formatter.alignment_for_expressions_in_array_initializer=16 +org.eclipse.jdt.core.formatter.insert_space_after_closing_angle_bracket_in_type_arguments=insert +org.eclipse.jdt.core.formatter.insert_space_after_opening_paren_in_constructor_declaration=do not insert +org.eclipse.jdt.core.formatter.keep_imple_if_on_one_line=false +org.eclipse.jdt.core.formatter.insert_space_before_parenthesized_expression_in_return=insert +org.eclipse.jdt.core.formatter.comment.format_javadoc_comments=false +org.eclipse.jdt.core.formatter.insert_space_before_opening_paren_in_while=insert +org.eclipse.jdt.core.formatter.insert_space_after_comma_in_parameterized_type_reference=insert +org.eclipse.jdt.core.formatter.alignment_for_arguments_in_enum_constant=16 +org.eclipse.jdt.core.formatter.indentation.size=4 +org.eclipse.jdt.core.formatter.alignment_for_assignment=0 +org.eclipse.jdt.core.formatter.insert_space_after_comma_in_method_declaration_parameters=insert +org.eclipse.jdt.core.formatter.blank_lines_after_package=1 +org.eclipse.jdt.core.formatter.insert_space_after_comma_in_method_declaration_throws=insert +org.eclipse.jdt.core.formatter.insert_space_before_colon_in_case=do not insert +org.eclipse.jdt.core.formatter.insert_space_before_colon_in_labeled_statement=do not insert +org.eclipse.jdt.core.formatter.insert_space_after_comma_in_multiple_field_declarations=insert +org.eclipse.jdt.core.formatter.insert_space_after_comma_in_type_parameters=insert +org.eclipse.jdt.core.formatter.insert_space_before_opening_brace_in_switch=insert +org.eclipse.jdt.core.formatter.insert_space_before_closing_paren_in_enum_constant=do not insert +org.eclipse.jdt.core.formatter.insert_new_line_in_empty_annotation_declaration=insert +org.eclipse.jdt.core.formatter.insert_space_before_closing_paren_in_catch=do not insert +org.eclipse.jdt.core.formatter.indent_empty_lines=false +org.eclipse.jdt.core.formatter.insert_space_before_opening_paren_in_parenthesized_expression=do not insert +org.eclipse.jdt.core.formatter.comment.format_line_comments=false +org.eclipse.jdt.core.formatter.insert_space_before_semicolon=do not insert +org.eclipse.jdt.core.formatter.alignment_for_parameters_in_constructor_declaration=16 +org.eclipse.jdt.core.formatter.alignment_for_binary_expression=16 +org.eclipse.jdt.core.formatter.insert_new_line_in_empty_enum_declaration=insert +org.eclipse.jdt.core.formatter.alignment_for_throws_clause_in_constructor_declaration=16 +org.eclipse.jdt.core.formatter.insert_new_line_before_finally_in_try_statement=do not insert +org.eclipse.jdt.core.formatter.insert_space_before_opening_brace_in_constructor_declaration=insert +org.eclipse.jdt.core.formatter.indent_breaks_compare_to_cases=true +org.eclipse.jdt.core.formatter.compact_else_if=true +org.eclipse.jdt.core.formatter.insert_space_after_opening_paren_in_for=do not insert +org.eclipse.jdt.core.formatter.insert_space_after_opening_paren_in_while=do not insert +org.eclipse.jdt.core.formatter.insert_space_before_comma_in_method_declaration_throws=do not insert +org.eclipse.jdt.core.formatter.insert_space_before_comma_in_for_increments=do not insert +org.eclipse.jdt.core.formatter.insert_space_after_opening_paren_in_method_declaration=do not insert +org.eclipse.jdt.core.formatter.insert_space_before_closing_paren_in_constructor_declaration=do not insert +org.eclipse.jdt.core.formatter.insert_space_before_opening_paren_in_switch=insert +org.eclipse.jdt.core.formatter.insert_space_before_comma_in_array_initializer=do not insert +org.eclipse.jdt.core.formatter.insert_space_after_colon_in_for=insert +org.eclipse.jdt.core.formatter.insert_space_after_opening_paren_in_annotation=do not insert +org.eclipse.jdt.core.compiler.source=1.5 +org.eclipse.jdt.core.formatter.comment.format_source_code=true +org.eclipse.jdt.core.formatter.comment.line_length=80 +org.eclipse.jdt.core.formatter.insert_space_after_unary_operator=do not insert +org.eclipse.jdt.core.formatter.indent_body_declarations_compare_to_enum_declaration_header=true +org.eclipse.jdt.core.formatter.insert_space_after_comma_in_multiple_local_declarations=insert +org.eclipse.jdt.core.formatter.continuation_indentation=2 +org.eclipse.jdt.core.formatter.insert_space_after_colon_in_assert=insert Added: announcement/trunk/.settings/org.eclipse.jdt.ui.prefs =================================================================== --- announcement/trunk/.settings/org.eclipse.jdt.ui.prefs (rev 0) +++ announcement/trunk/.settings/org.eclipse.jdt.ui.prefs 2008-06-30 02:54:27 UTC (rev 1002) @@ -0,0 +1,5 @@ +#Fri Aug 03 14:46:18 JST 2007 +eclipse.preferences.version=1 +formatter_profile=_Seasar +formatter_settings_version=11 +org.eclipse.jdt.ui.text.custom_code_templates= Added: announcement/trunk/.settings/org.seasar.dolteng.eclipse.prefs =================================================================== --- announcement/trunk/.settings/org.seasar.dolteng.eclipse.prefs (rev 0) +++ announcement/trunk/.settings/org.seasar.dolteng.eclipse.prefs 2008-06-30 02:54:27 UTC (rev 1002) @@ -0,0 +1,12 @@ +#Mon May 26 09:54:10 JST 2008 +DaoType=S2Dao +DefaultDaoPackage=jp.sf.pal.announcement.dao +DefaultDtoPackage=jp.sf.pal.announcement.dto +DefaultEntityPackage=jp.sf.pal.announcement.entity +DefaultResourcePath=/announcement/src/main/resources +DefaultRootPackage=jp.sf.pal.announcement +DefaultSrcPath=/announcement/src/main/java +DefaultWebPackage=jp.sf.pal.announcement.web +ServletPath=/announcement +WebContentsRoot=src/main/webapp/ +eclipse.preferences.version=1 Added: announcement/trunk/dbflute/_project.bat =================================================================== --- announcement/trunk/dbflute/_project.bat (rev 0) +++ announcement/trunk/dbflute/_project.bat 2008-06-30 02:54:27 UTC (rev 1002) @@ -0,0 +1,5 @@ + @ echo off + +set MY_PROJECT_NAME=announcement + +set DBFLUTE_HOME=..\mydbflute\dbflute-0.7.0 Property changes on: announcement/trunk/dbflute/_project.bat ___________________________________________________________________ Name: svn:eol-style + native Added: announcement/trunk/dbflute/_project.sh =================================================================== --- announcement/trunk/dbflute/_project.sh (rev 0) +++ announcement/trunk/dbflute/_project.sh 2008-06-30 02:54:27 UTC (rev 1002) @@ -0,0 +1,5 @@ +#!/bin/sh + +export MY_PROJECT_NAME=announcement + +export DBFLUTE_HOME=../mydbflute/dbflute-0.7.0 Property changes on: announcement/trunk/dbflute/_project.sh ___________________________________________________________________ Name: svn:executable + * Name: svn:eol-style + native Added: announcement/trunk/dbflute/build-announcement.properties =================================================================== --- announcement/trunk/dbflute/build-announcement.properties (rev 0) +++ announcement/trunk/dbflute/build-announcement.properties 2008-06-30 02:54:27 UTC (rev 1002) @@ -0,0 +1,162 @@ +# ======================================================================================= +# for All +# ======= + +# ------------------------------------------------------------------- +# P R O J E C T +# ------------------------------------------------------------------- +# @FirstProperty +# @Required +torque.project = announcement + +# ------------------------------------------------------------------- +# T A R G E T D A T A B A S E +# ------------------------------------------------------------------- +# This is the target database, only considered when generating +# the SQL for your Torque project. Your possible choices are: +# +# axion, cloudscape, db2, db2400, hypersonic, interbase, mssql, +# mysql, oracle, postgresql, sapdb, sybase, firebird, derby, h2 +# ------------------------------------------------------------------- +# @FirstProperty +# @Required +torque.database = mysql + +# ------------------------------------------------------------------- +# T A R G E T L A N G U A G E +# ------------------------------------------------------------------- +# (Default 'java') +# The target language. Your possible choices are: +# java, csharp +# ------------------------------------------------------------------- +# @FirstProperty +#torque.targetLanguage = java + + + +# ======================================================================================= +# for OM task +# =========== + +# _/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/ +# Basic +# _/_/_/_/ +# /--------------------------------------------------------------------------- +# [Output Directory] +# java.dir: (Default '../src/main/java') +# The base output directory. +# +# If this value is '../src/main/java' and your project stype is under maven, +# you don't need to set up this property! +# +# {project} +# | +# |-dbflute_ldb +# | |-build-ldb.properties +# | |-... +# | +# |-src/main/java // *Here! +# |-src/main/resources +# |-... +# +# +# @FirstProperty +#torque.java.dir = ../src/main/java +# ----------------/ + +# _/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/ +# Package +# _/_/ +# /--------------------------------------------------------------------------- +# [EntityDao Package] +# packageBase: (Default '') +# The base directory of package. +# +# *If this property is specified and other package properties is not specified, +# Then The packages of generated class are as follows: +# +# ex) packageBase = org.seasar.dbflute.example.dbflute.ldb +# baseCommonPackage --> org.seasar.dbflute.example.dbflute.ldb.allcommon +# baseBehaviorPackage --> org.seasar.dbflute.example.dbflute.ldb.bsbhv +# baseDaoPackage --> org.seasar.dbflute.example.dbflute.ldb.bsdao +# baseEntityPackage --> org.seasar.dbflute.example.dbflute.ldb.bsentity +# conditionBeanPackage --> org.seasar.dbflute.example.dbflute.ldb.cbean +# extendedBehaviorPackage --> org.seasar.dbflute.example.dbflute.ldb.exbhv +# extendedDaoPackage --> org.seasar.dbflute.example.dbflute.ldb.exdao +# extendedEntityPackage --> org.seasar.dbflute.example.dbflute.ldb.exentity +# +# *If this property is not specified, you should specify the other package properties. +# +# +# baseCommonPackage: (Default Java:'allcommon' C#:'allcommon') +# baseBehaviorPackage: (Default Java:'bsbhv' C#:'bsbhv') +# baseDaoPackage: (Default Java:'bsdao' C#:'bsdao') +# baseEntityPackage: (Default Java:'bsentity' C#:'bsentity') +# conditionBeanPackage: (Default Java:'cbean' C#:'cbean') +# extendedBehaviorPackage: (Default Java:'exbhv' C#:'exbhv') +# extendedDaoPackage: (Default Java:'exdao' C#:'exdao') +# extendedEntityPackage: (Default Java:'exentity' C#:'exentity') +# +# @FirstProperty +torque.packageBase = jp.sf.pal.announcement.db +# ----------------/ + +# _/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/ +# S2Dao Adjustment +# _/_/_/_/_/_/ +# /--------------------------------------------------------------------------- +# [S2Dao Version] +# s2daoVersion: (Default [The latest version]) +# +# @JavaOnly +torque.s2daoVersion = 1.0.47 +# ----------------/ + + + +# ======================================================================================= +# for JDBC task +# ============= + +# - - - - - - - - - - - - - - - - - - - - - - - - - - - - - +# [Database Informaition] +# +# * * * * * * * * * * * * * * * * * * * * * * * * * +# You shuold use './dfprop/databaseInfoMap.dfprop' +# Look the file! +# * * * * * * * * * * * * * * * * * * * * * * * * * +# - - - - - - - - - - - - - - - - - - - - - - - - - - - - - + +# _/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/ +# Adavance +# _/_/ + +# /--------------------------------------------------------------------------- +# [Sequence] +# sequenceDefinitionMap: (Default 'map:{}') +# The method 'XxxDao#selectNextVal()' is generated for its table primary key. +# +# ex) public String selectNextVal_SQL = "select gen_id(BOOK_BOOK_ID_INC, 1) from RDB$DATABASE"; +# public java.math.BigDecimal selectNextVal(); +# // This example is for the database of Firebird +# +# sequenceReturnType: (Default 'java.math.BigDecimal') +# The return type of The method 'XxxDao#selectNextVal()'. +# + +# +# *Apache Derby does not support Sequence-Object. +# But I want to test this property. +# +#torque.sequenceDefinitionMap = map:{ \ +# prodcts = PRODUCTS_PRODUCTS_ID_INC \ +# } + +#torque.sequenceReturnType = java.lang.Integer +# [Additional ForeignKey] +torque.additionalForeignKeyMap = map:{ \ + FK_ANNOUNCEMENT_BODY = map:{ localTableName = ANNOUNCEMENT_BODY; localColumnName = ID; foreignTableName = ANNOUNCEMENT; foreignColumnName = ID } \ +} + + + Property changes on: announcement/trunk/dbflute/build-announcement.properties ___________________________________________________________________ Name: svn:eol-style + native Added: announcement/trunk/dbflute/dfprop/databaseInfoMap.dfprop =================================================================== --- announcement/trunk/dbflute/dfprop/databaseInfoMap.dfprop (rev 0) +++ announcement/trunk/dbflute/dfprop/databaseInfoMap.dfprop 2008-06-30 02:54:27 UTC (rev 1002) @@ -0,0 +1,18 @@ +# /--------------------------------------------------------------------------- +# [Database Information] +# databaseInfoMap: +# driver -- The class name of JDBC-Driver. +# url -- The url for connecting database. +# schema -- The schema name. +# user -- The database user name. +# password -- The database password. +# +# @FirstProperty +map:{ + ; driver = com.mysql.jdbc.Driver + ; url = jdbc:mysql://localhost/announcement?useUnicode=true&characterEncoding=UTF-8 + ; schema = announcement + ; user = amuser + ; password = am123 +} +# ----------------/ Added: announcement/trunk/dbflute/doc.bat =================================================================== --- announcement/trunk/dbflute/doc.bat (rev 0) +++ announcement/trunk/dbflute/doc.bat 2008-06-30 02:54:27 UTC (rev 1002) @@ -0,0 +1,19 @@ + @ echo off + +%~d0 +cd %~p0 +call _project.bat + +rem /nnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnn +rem Specify the file path to be used as build-properties. +rem nnnnnnnnnn/ +set MY_PROPERTIES_PATH=build-%MY_PROJECT_NAME%.properties + +rem /nnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnn +rem Execute {Document}. +rem nnnnnnnnnn/ +call %DBFLUTE_HOME%\etc\cmd\_df-doc.cmd %MY_PROPERTIES_PATH% + +pause + + Property changes on: announcement/trunk/dbflute/doc.bat ___________________________________________________________________ Name: svn:eol-style + native Added: announcement/trunk/dbflute/doc.sh =================================================================== --- announcement/trunk/dbflute/doc.sh (rev 0) +++ announcement/trunk/dbflute/doc.sh 2008-06-30 02:54:27 UTC (rev 1002) @@ -0,0 +1,14 @@ +#!/bin/sh + +. _project.sh + +echo "/nnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnn" +echo "Specify the file path to be used as build-properties." +echo "nnnnnnnnnn/" +export MY_PROPERTIES_PATH=build-${MY_PROJECT_NAME}.properties + +echo "/nnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnn" +echo "Execute {Document}." +echo "nnnnnnnnnn/" +sh $DBFLUTE_HOME/etc/cmd/_df-doc.sh $MY_PROPERTIES_PATH + Property changes on: announcement/trunk/dbflute/doc.sh ___________________________________________________________________ Name: svn:executable + * Name: svn:eol-style + native Added: announcement/trunk/dbflute/generate.bat =================================================================== --- announcement/trunk/dbflute/generate.bat (rev 0) +++ announcement/trunk/dbflute/generate.bat 2008-06-30 02:54:27 UTC (rev 1002) @@ -0,0 +1,19 @@ + @ echo off + +%~d0 +cd %~p0 +call _project.bat + +rem /nnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnn +rem Specify the file path to be used as build-properties. +rem nnnnnnnnnn/ +set MY_PROPERTIES_PATH=build-%MY_PROJECT_NAME%.properties + +rem /nnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnn +rem Execute {Generate}. +rem nnnnnnnnnn/ +call %DBFLUTE_HOME%\etc\cmd\_df-generate.cmd %MY_PROPERTIES_PATH% + +pause + + Property changes on: announcement/trunk/dbflute/generate.bat ___________________________________________________________________ Name: svn:eol-style + native Added: announcement/trunk/dbflute/generate.sh =================================================================== --- announcement/trunk/dbflute/generate.sh (rev 0) +++ announcement/trunk/dbflute/generate.sh 2008-06-30 02:54:27 UTC (rev 1002) @@ -0,0 +1,16 @@ +#!/bin/sh + +. _project.sh + +echo "/nnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnn" +echo "Specify the file path to be used as build-properties." +echo "nnnnnnnnnn/" +export MY_PROPERTIES_PATH=build-${MY_PROJECT_NAME}.properties + +echo "/nnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnn" +echo "Execute {Generate}." +echo "nnnnnnnnnn/" +sh $DBFLUTE_HOME/etc/cmd/_df-generate.sh $MY_PROPERTIES_PATH + + + Property changes on: announcement/trunk/dbflute/generate.sh ___________________________________________________________________ Name: svn:executable + * Name: svn:eol-style + native Added: announcement/trunk/dbflute/jdbc.bat =================================================================== --- announcement/trunk/dbflute/jdbc.bat (rev 0) +++ announcement/trunk/dbflute/jdbc.bat 2008-06-30 02:54:27 UTC (rev 1002) @@ -0,0 +1,19 @@ + @ echo off + +%~d0 +cd %~p0 +call _project.bat + +rem /nnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnn +rem Specify the file path to be used as build-properties. +rem nnnnnnnnnn/ +set MY_PROPERTIES_PATH=build-%MY_PROJECT_NAME%.properties + +rem /nnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnn +rem Execute {JDBC and Document}. +rem nnnnnnnnnn/ +call %DBFLUTE_HOME%\etc\cmd\_df-jdbc.cmd %MY_PROPERTIES_PATH% + +pause + + Property changes on: announcement/trunk/dbflute/jdbc.bat ___________________________________________________________________ Name: svn:eol-style + native Added: announcement/trunk/dbflute/jdbc.sh =================================================================== --- announcement/trunk/dbflute/jdbc.sh (rev 0) +++ announcement/trunk/dbflute/jdbc.sh 2008-06-30 02:54:27 UTC (rev 1002) @@ -0,0 +1,15 @@ +#!/bin/sh + +. _project.sh + +echo "/nnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnn" +echo "Specify the file path to be used as build-properties." +echo "nnnnnnnnnn/" +export MY_PROPERTIES_PATH="build-${MY_PROJECT_NAME}.properties" + +echo "/nnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnn" +echo "Execute {JDBC and Document}." +echo "nnnnnnnnnn/" +sh ${DBFLUTE_HOME}/etc/cmd/_df-jdbc.sh ${MY_PROPERTIES_PATH} + + Property changes on: announcement/trunk/dbflute/jdbc.sh ___________________________________________________________________ Name: svn:executable + * Name: svn:eol-style + native Added: announcement/trunk/dbflute/log/readme.txt =================================================================== --- announcement/trunk/dbflute/log/readme.txt (rev 0) +++ announcement/trunk/dbflute/log/readme.txt 2008-06-30 02:54:27 UTC (rev 1002) @@ -0,0 +1 @@ +Directory for LogFile Property changes on: announcement/trunk/dbflute/log/readme.txt ___________________________________________________________________ Name: svn:eol-style + native Added: announcement/trunk/dbflute/output/doc/readme.txt =================================================================== --- announcement/trunk/dbflute/output/doc/readme.txt (rev 0) +++ announcement/trunk/dbflute/output/doc/readme.txt 2008-06-30 02:54:27 UTC (rev 1002) @@ -0,0 +1 @@ +Directory for Document Property changes on: announcement/trunk/dbflute/output/doc/readme.txt ___________________________________________________________________ Name: svn:eol-style + native Added: announcement/trunk/dbflute/outside-sql-test.bat =================================================================== --- announcement/trunk/dbflute/outside-sql-test.bat (rev 0) +++ announcement/trunk/dbflute/outside-sql-test.bat 2008-06-30 02:54:27 UTC (rev 1002) @@ -0,0 +1,19 @@ + @ echo off + +%~d0 +cd %~p0 +call _project.bat + +rem /nnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnn +rem Specify the file path to be used as build-properties. +rem nnnnnnnnnn/ +set MY_PROPERTIES_PATH=build-%MY_PROJECT_NAME%.properties + +rem /nnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnn +rem Execute {Outsite-Sql-Test}. +rem nnnnnnnnnn/ +call %DBFLUTE_HOME%\etc\cmd\_df-outside-sql-test.cmd %MY_PROPERTIES_PATH% + +pause + + Property changes on: announcement/trunk/dbflute/outside-sql-test.bat ___________________________________________________________________ Name: svn:eol-style + native Added: announcement/trunk/dbflute/outside-sql-test.sh =================================================================== --- announcement/trunk/dbflute/outside-sql-test.sh (rev 0) +++ announcement/trunk/dbflute/outside-sql-test.sh 2008-06-30 02:54:27 UTC (rev 1002) @@ -0,0 +1,15 @@ +#!/bin/sh + +. _project.sh + +echo "/nnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnn" +echo "Specify the file path to be used as build-properties." +echo "nnnnnnnnnn/" +export MY_PROPERTIES_PATH=build-${MY_PROJECT_NAME}.properties + +echo "/nnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnn" +echo "Execute {Outsite-Sql-Test}." +echo "nnnnnnnnnn/" +sh $DBFLUTE_HOME/etc/cmd/_df-outside-sql-test.sh $MY_PROPERTIES_PATH + + Property changes on: announcement/trunk/dbflute/outside-sql-test.sh ___________________________________________________________________ Name: svn:executable + * Name: svn:eol-style + native Added: announcement/trunk/dbflute/playsql/replace-schema.sql =================================================================== --- announcement/trunk/dbflute/playsql/replace-schema.sql (rev 0) +++ announcement/trunk/dbflute/playsql/replace-schema.sql 2008-06-30 02:54:27 UTC (rev 1002) @@ -0,0 +1,418 @@ +ALTER TABLE BLACK_ACTION DROP CONSTRAINT FK_BLACK_ACTION_BLACK_LIST +; + +ALTER TABLE BLACK_ACTION DROP CONSTRAINT FK_BLACK_ACTION_LOOKUP +; + +ALTER TABLE BLACK_LIST DROP CONSTRAINT FK_BLACK_LIST_LB_USER +; + +ALTER TABLE BOOK DROP CONSTRAINT FK_BOOK_AUTHOR +; + +ALTER TABLE BOOK DROP CONSTRAINT FK_BOOK_PUBLISHER +; + +ALTER TABLE BOOK DROP CONSTRAINT FK_BOOK_GENRE +; + +ALTER TABLE COLLECTION DROP CONSTRAINT FK_COLLECTION_BOOK +; + +ALTER TABLE COLLECTION DROP CONSTRAINT FK_COLLECTION_LIBRARY +; + +ALTER TABLE COLLECTION_STATUS DROP CONSTRAINT FK_COLLECTION_STATUS_COLLECTION +; + +ALTER TABLE COLLECTION_STATUS DROP CONSTRAINT FK_COLLECTION_STATUS_LOOKUP +; + +ALTER TABLE GENRE DROP CONSTRAINT FK_GENRE_GENRE +; + +ALTER TABLE LB_USER DROP CONSTRAINT FK_LB_USER_LIBRARY +; + +ALTER TABLE LENDING DROP CONSTRAINT FK_LENDING_LIBRARY +; + +ALTER TABLE LENDING DROP CONSTRAINT FK_LENDING_LB_USER +; + +ALTER TABLE LENDING_COLLECTION DROP CONSTRAINT FK_LENDING_COLLECTION_LENDING +; + +ALTER TABLE LENDING_COLLECTION DROP CONSTRAINT FK_LENDING_COLLECTION_COL +; + +ALTER TABLE NEXT_LIBRARY DROP CONSTRAINT FK_NEXT_LIBRARY_LIBRARY_ID +; + +ALTER TABLE NEXT_LIBRARY DROP CONSTRAINT FK_NEXT_LIBRARY_NEXT_LIBRARY_ID +; + + +DROP TABLE AUTHOR +; +DROP TABLE BLACK_ACTION +; +DROP TABLE BLACK_ACTION_LOOKUP +; +DROP TABLE BLACK_LIST +; +DROP TABLE BOOK +; +DROP TABLE COLLECTION +; +DROP TABLE COLLECTION_STATUS +; +DROP TABLE COLLECTION_STATUS_LOOKUP +; +DROP TABLE GARBAGE +; +DROP TABLE GENRE +; +DROP TABLE LB_USER +; +DROP TABLE LENDING +; +DROP TABLE LENDING_COLLECTION +; +DROP TABLE LIBRARY +; +DROP TABLE NEXT_LIBRARY +; +DROP TABLE PUBLISHER +; + +CREATE TABLE AUTHOR ( + AUTHOR_ID integer NOT NULL GENERATED BY DEFAULT AS IDENTITY (START WITH 1, INCREMENT BY 1), + AUTHOR_NAME varchar(80) NOT NULL, + R_TIME timestamp DEFAULT CURRENT_TIMESTAMP NOT NULL, + U_TIME timestamp DEFAULT CURRENT_TIMESTAMP NOT NULL, + R_STAFF varchar(50) DEFAULT 'DefaultStaff' NOT NULL, + U_STAFF varchar(50) DEFAULT 'DefaultStaff' NOT NULL +) +; + +CREATE TABLE BLACK_ACTION ( + BLACK_ACTION_ID integer NOT NULL GENERATED BY DEFAULT AS IDENTITY (START WITH 1, INCREMENT BY 1), + BLACK_LIST_ID integer NOT NULL, + BLACK_ACTION_CODE char(3) NOT NULL, + BLACK_LEVEL smallint NOT NULL, + EVIDENCE_PHOTOGRAPH blob, + R_TIME timestamp DEFAULT CURRENT_TIMESTAMP NOT NULL, + U_TIME timestamp DEFAULT CURRENT_TIMESTAMP NOT NULL, + R_STAFF varchar(50) DEFAULT 'DefaultStaff' NOT NULL, + U_STAFF varchar(50) DEFAULT 'DefaultStaff' NOT NULL +) +; + +CREATE TABLE BLACK_ACTION_LOOKUP ( + BLACK_ACTION_CODE char(3) NOT NULL, + BLACK_ACTION_NAME varchar(80) NOT NULL, + R_TIME timestamp DEFAULT CURRENT_TIMESTAMP NOT NULL, + U_TIME timestamp DEFAULT CURRENT_TIMESTAMP NOT NULL, + R_STAFF varchar(50) DEFAULT 'DefaultStaff' NOT NULL, + U_STAFF varchar(50) DEFAULT 'DefaultStaff' NOT NULL +) +; + +CREATE TABLE BLACK_LIST ( + BLACK_LIST_ID integer NOT NULL GENERATED BY DEFAULT AS IDENTITY (START WITH 1, INCREMENT BY 1), + LB_USER_ID integer NOT NULL, + BLACK_RANK char(3) NOT NULL, + R_TIME timestamp DEFAULT CURRENT_TIMESTAMP NOT NULL, + U_TIME timestamp DEFAULT CURRENT_TIMESTAMP NOT NULL, + R_STAFF varchar(50) DEFAULT 'DefaultStaff' NOT NULL, + U_STAFF varchar(50) DEFAULT 'DefaultStaff' NOT NULL +) +; + +CREATE TABLE BOOK ( + BOOK_ID integer NOT NULL GENERATED BY DEFAULT AS IDENTITY (START WITH 1, INCREMENT BY 1), + ISBN_NO varchar(20) NOT NULL, + BOOK_NAME varchar(80) NOT NULL, + AUTHOR_ID integer NOT NULL, + PUBLISHER_ID integer NOT NULL, + MAX_LENDING_DATE_COUNT smallint NOT NULL, + GENRE_CODE varchar(12), + OPENING_PART clob, + R_TIME timestamp DEFAULT CURRENT_TIMESTAMP NOT NULL, + U_TIME timestamp DEFAULT CURRENT_TIMESTAMP NOT NULL, + R_STAFF varchar(50) DEFAULT 'DefaultStaff' NOT NULL, + U_STAFF varchar(50) DEFAULT 'DefaultStaff' NOT NULL +) +; + +CREATE TABLE COLLECTION ( + COLLECTION_ID integer NOT NULL, + LIBRARY_ID smallint NOT NULL, + BOOK_ID integer NOT NULL, + ARRIVAL_DATE timestamp NOT NULL, + R_TIME timestamp DEFAULT CURRENT_TIMESTAMP NOT NULL, + U_TIME timestamp DEFAULT CURRENT_TIMESTAMP NOT NULL, + R_STAFF varchar(50) DEFAULT 'DefaultStaff' NOT NULL, + U_STAFF varchar(50) DEFAULT 'DefaultStaff' NOT NULL +) +; + +CREATE TABLE COLLECTION_STATUS ( + COLLECTION_ID integer NOT NULL, + COLLECTION_STATUS_CODE char(3) NOT NULL, + R_TIME timestamp DEFAULT CURRENT_TIMESTAMP NOT NULL, + U_TIME timestamp DEFAULT CURRENT_TIMESTAMP NOT NULL, + R_STAFF varchar(50) DEFAULT 'DefaultStaff' NOT NULL, + U_STAFF varchar(50) DEFAULT 'DefaultStaff' NOT NULL +) +; + +CREATE TABLE COLLECTION_STATUS_LOOKUP ( + COLLECTION_STATUS_CODE char(3) NOT NULL, + COLLECTION_STATUS_NAME varchar(80) NOT NULL, + R_TIME timestamp DEFAULT CURRENT_TIMESTAMP NOT NULL, + U_TIME timestamp DEFAULT CURRENT_TIMESTAMP NOT NULL, + R_STAFF varchar(50) DEFAULT 'DefaultStaff' NOT NULL, + U_STAFF varchar(50) DEFAULT 'DefaultStaff' NOT NULL +) +; + +CREATE TABLE GARBAGE ( + GARBAGE_MEMO varchar(50), + GARBAGE_TIME timestamp +) +; + +CREATE TABLE GENRE ( + GENRE_CODE varchar(12) NOT NULL, + GENRE_NAME varchar(80) NOT NULL, + PARENT_GENRE_CODE varchar(12), + R_TIME timestamp DEFAULT CURRENT_TIMESTAMP NOT NULL, + U_TIME timestamp DEFAULT CURRENT_TIMESTAMP NOT NULL, + R_STAFF varchar(50) DEFAULT 'DefaultStaff' NOT NULL, + U_STAFF varchar(50) DEFAULT 'DefaultStaff' NOT NULL +) +; + +CREATE TABLE LB_USER ( + LB_USER_ID integer NOT NULL GENERATED BY DEFAULT AS IDENTITY (START WITH 1, INCREMENT BY 1), + LB_USER_NAME varchar(80) NOT NULL, + LIBRARY_ID smallint NOT NULL, + USER_PASSWORD varchar(50) NOT NULL, + R_TIME timestamp DEFAULT CURRENT_TIMESTAMP NOT NULL, + U_TIME timestamp DEFAULT CURRENT_TIMESTAMP NOT NULL, + R_STAFF varchar(50) DEFAULT 'DefaultStaff' NOT NULL, + U_STAFF varchar(50) DEFAULT 'DefaultStaff' NOT NULL +) +; + +CREATE TABLE LENDING ( + LENDING_ID integer NOT NULL GENERATED BY DEFAULT AS IDENTITY (START WITH 1, INCREMENT BY 1), + LIBRARY_ID smallint NOT NULL, + LB_USER_ID integer NOT NULL, + LENDING_DATE timestamp NOT NULL, + R_TIME timestamp DEFAULT CURRENT_TIMESTAMP NOT NULL, + U_TIME timestamp DEFAULT CURRENT_TIMESTAMP NOT NULL, + R_STAFF varchar(50) DEFAULT 'DefaultStaff' NOT NULL, + U_STAFF varchar(50) DEFAULT 'DefaultStaff' NOT NULL +) +; + +CREATE TABLE LENDING_COLLECTION ( + LENDING_ID integer NOT NULL, + COLLECTION_ID integer NOT NULL, + RETURN_LIMIT_DATE timestamp NOT NULL, + R_TIME timestamp DEFAULT CURRENT_TIMESTAMP NOT NULL, + U_TIME timestamp DEFAULT CURRENT_TIMESTAMP NOT NULL, + R_STAFF varchar(50) DEFAULT 'DefaultStaff' NOT NULL, + U_STAFF varchar(50) DEFAULT 'DefaultStaff' NOT NULL +) +; + +CREATE TABLE LIBRARY ( + LIBRARY_ID smallint NOT NULL GENERATED BY DEFAULT AS IDENTITY (START WITH 1, INCREMENT BY 1), + LIBRARY_NAME varchar(80) NOT NULL, + R_TIME timestamp DEFAULT CURRENT_TIMESTAMP NOT NULL, + U_TIME timestamp DEFAULT CURRENT_TIMESTAMP NOT NULL, + R_STAFF varchar(50) DEFAULT 'DefaultStaff' NOT NULL, + U_STAFF varchar(50) DEFAULT 'DefaultStaff' NOT NULL +) +; + +CREATE TABLE NEXT_LIBRARY ( + LIBRARY_ID smallint NOT NULL, + NEXT_LIBRARY_ID smallint NOT NULL, + DISTANCE_KM integer NOT NULL, + R_TIME timestamp DEFAULT CURRENT_TIMESTAMP NOT NULL, + U_TIME timestamp DEFAULT CURRENT_TIMESTAMP NOT NULL, + R_STAFF varchar(50) DEFAULT 'DefaultStaff' NOT NULL, + U_STAFF varchar(50) DEFAULT 'DefaultStaff' NOT NULL +) +; + +CREATE TABLE PUBLISHER ( + PUBLISHER_ID integer NOT NULL GENERATED BY DEFAULT AS IDENTITY (START WITH 1, INCREMENT BY 1), + PUBLISHER_NAME varchar(80) NOT NULL, + R_TIME timestamp DEFAULT CURRENT_TIMESTAMP NOT NULL, + U_TIME timestamp DEFAULT CURRENT_TIMESTAMP NOT NULL, + R_STAFF varchar(50) DEFAULT 'DefaultStaff' NOT NULL, + U_STAFF varchar(50) DEFAULT 'DefaultStaff' NOT NULL +) +; + + +ALTER TABLE AUTHOR ADD CONSTRAINT PK_AUTHOR + PRIMARY KEY (AUTHOR_ID) +; + +ALTER TABLE BLACK_ACTION ADD CONSTRAINT PK_BLACK_ACTION + PRIMARY KEY (BLACK_ACTION_ID) +; + +ALTER TABLE BLACK_ACTION_LOOKUP ADD CONSTRAINT PK_BLACK_ACTION_LOOKUP + PRIMARY KEY (BLACK_ACTION_CODE) +; + +ALTER TABLE BLACK_LIST ADD CONSTRAINT PK_BLACK_LIST + PRIMARY KEY (BLACK_LIST_ID) +; + +ALTER TABLE BOOK ADD CONSTRAINT PK_BOOK + PRIMARY KEY (BOOK_ID) +; + +ALTER TABLE COLLECTION ADD CONSTRAINT PK_COLLECTION + PRIMARY KEY (COLLECTION_ID) +; + +ALTER TABLE COLLECTION_STATUS ADD CONSTRAINT PK_COLLECTION_STATUS + PRIMARY KEY (COLLECTION_ID) +; + +ALTER TABLE COLLECTION_STATUS_LOOKUP ADD CONSTRAINT PK_COLLECTION_STATUS_LOOKUP + PRIMARY KEY (COLLECTION_STATUS_CODE) +; + +ALTER TABLE GENRE ADD CONSTRAINT PK_GENRE + PRIMARY KEY (GENRE_CODE) +; + +ALTER TABLE LB_USER ADD CONSTRAINT PK_LB_USER + PRIMARY KEY (LB_USER_ID) +; + +ALTER TABLE LENDING ADD CONSTRAINT PK_LENDING + PRIMARY KEY (LENDING_ID) +; + +ALTER TABLE LENDING_COLLECTION ADD CONSTRAINT PK_LENDING_COLLECTION + PRIMARY KEY (LENDING_ID, COLLECTION_ID) +; + +ALTER TABLE LIBRARY ADD CONSTRAINT PK_LIBRARY + PRIMARY KEY (LIBRARY_ID) +; + +ALTER TABLE NEXT_LIBRARY ADD CONSTRAINT PK_NEXT_LIBRARY + PRIMARY KEY (LIBRARY_ID, NEXT_LIBRARY_ID) +; + +ALTER TABLE PUBLISHER ADD CONSTRAINT PK_PUBLISHER + PRIMARY KEY (PUBLISHER_ID) +; + + +ALTER TABLE BOOK + ADD CONSTRAINT UQ_BOOK_ISBN_NO UNIQUE (ISBN_NO) +; + +ALTER TABLE COLLECTION + ADD CONSTRAINT UQ_COLLECTION_Primary UNIQUE (LIBRARY_ID, BOOK_ID) +; + +ALTER TABLE LENDING + ADD CONSTRAINT UQ_LENDING_Primary UNIQUE (LIBRARY_ID, LB_USER_ID) +; + +ALTER TABLE BLACK_LIST + ADD CONSTRAINT UQ_BLACK_LIST_LB_USER_ID UNIQUE (LB_USER_ID) +; + +ALTER TABLE LIBRARY + ADD CONSTRAINT UQ_LIBRARY_LIBRARY_NAME UNIQUE (LIBRARY_NAME) +; + + + +ALTER TABLE BLACK_ACTION ADD CONSTRAINT FK_BLACK_ACTION_BLACK_LIST + FOREIGN KEY (BLACK_LIST_ID) REFERENCES BLACK_LIST (BLACK_LIST_ID) +; + +ALTER TABLE BLACK_ACTION ADD CONSTRAINT FK_BLACK_ACTION_LOOKUP + FOREIGN KEY (BLACK_ACTION_CODE) REFERENCES BLACK_ACTION_LOOKUP (BLACK_ACTION_CODE) +; + +ALTER TABLE BLACK_LIST ADD CONSTRAINT FK_BLACK_LIST_LB_USER + FOREIGN KEY (LB_USER_ID) REFERENCES LB_USER (LB_USER_ID) +; + +ALTER TABLE BOOK ADD CONSTRAINT FK_BOOK_AUTHOR + FOREIGN KEY (AUTHOR_ID) REFERENCES AUTHOR (AUTHOR_ID) +; + +ALTER TABLE BOOK ADD CONSTRAINT FK_BOOK_PUBLISHER + FOREIGN KEY (PUBLISHER_ID) REFERENCES PUBLISHER (PUBLISHER_ID) +; + +ALTER TABLE BOOK ADD CONSTRAINT FK_BOOK_GENRE + FOREIGN KEY (GENRE_CODE) REFERENCES GENRE (GENRE_CODE) +; + +ALTER TABLE COLLECTION ADD CONSTRAINT FK_COLLECTION_BOOK + FOREIGN KEY (BOOK_ID) REFERENCES BOOK (BOOK_ID) +; + +ALTER TABLE COLLECTION ADD CONSTRAINT FK_COLLECTION_LIBRARY + FOREIGN KEY (LIBRARY_ID) REFERENCES LIBRARY (LIBRARY_ID) +; + +ALTER TABLE COLLECTION_STATUS ADD CONSTRAINT FK_COLLECTION_STATUS_COLLECTION + FOREIGN KEY (COLLECTION_ID) REFERENCES COLLECTION (COLLECTION_ID) +; + +ALTER TABLE COLLECTION_STATUS ADD CONSTRAINT FK_COLLECTION_STATUS_LOOKUP + FOREIGN KEY (COLLECTION_STATUS_CODE) REFERENCES COLLECTION_STATUS_LOOKUP (COLLECTION_STATUS_CODE) +; + +ALTER TABLE GENRE ADD CONSTRAINT FK_GENRE_GENRE + FOREIGN KEY (PARENT_GENRE_CODE) REFERENCES GENRE (GENRE_CODE) +; + +ALTER TABLE LB_USER ADD CONSTRAINT FK_LB_USER_LIBRARY + FOREIGN KEY (LIBRARY_ID) REFERENCES LIBRARY (LIBRARY_ID) +; + +ALTER TABLE LENDING ADD CONSTRAINT FK_LENDING_LIBRARY + FOREIGN KEY (LIBRARY_ID) REFERENCES LIBRARY (LIBRARY_ID) +; + +ALTER TABLE LENDING ADD CONSTRAINT FK_LENDING_LB_USER + FOREIGN KEY (LB_USER_ID) REFERENCES LB_USER (LB_USER_ID) +; + +ALTER TABLE LENDING_COLLECTION ADD CONSTRAINT FK_LENDING_COLLECTION_LENDING + FOREIGN KEY (LENDING_ID) REFERENCES LENDING (LENDING_ID) +; + +ALTER TABLE LENDING_COLLECTION ADD CONSTRAINT FK_LENDING_COLLECTION_COL + FOREIGN KEY (COLLECTION_ID) REFERENCES COLLECTION (COLLECTION_ID) +; + +ALTER TABLE NEXT_LIBRARY ADD CONSTRAINT FK_NEXT_LIBRARY_LIBRARY_ID + FOREIGN KEY (LIBRARY_ID) REFERENCES LIBRARY (LIBRARY_ID) +; + +ALTER TABLE NEXT_LIBRARY ADD CONSTRAINT FK_NEXT_LIBRARY_NEXT_LIBRARY_ID + FOREIGN KEY (NEXT_LIBRARY_ID) REFERENCES LIBRARY (LIBRARY_ID) +; Added: announcement/trunk/dbflute/replace-schema.bat =================================================================== --- announcement/trunk/dbflute/replace-schema.bat (rev 0) +++ announcement/trunk/dbflute/replace-schema.bat 2008-06-30 02:54:27 UTC (rev 1002) @@ -0,0 +1,19 @@ + @ echo off + +%~d0 +cd %~p0 +call _project.bat + +rem /nnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnn +rem Specify the file path to be used as build-properties. +rem nnnnnnnnnn/ +set MY_PROPERTIES_PATH=build-%MY_PROJECT_NAME%.properties + +rem /nnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnn +rem Execute {Replace-Schema}. +rem nnnnnnnnnn/ +call %DBFLUTE_HOME%\etc\cmd\_df-replace-schema.cmd %MY_PROPERTIES_PATH% + +pause + + Property changes on: announcement/trunk/dbflute/replace-schema.bat ___________________________________________________________________ Name: svn:eol-style + native Added: announcement/trunk/dbflute/replace-schema.sh =================================================================== --- announcement/trunk/dbflute/replace-schema.sh (rev 0) +++ announcement/trunk/dbflute/replace-schema.sh 2008-06-30 02:54:27 UTC (rev 1002) @@ -0,0 +1,15 @@ +#!/bin/sh + +. _project.sh + +echo "/nnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnn" +echo "Specify the file path to be used as build-properties." +echo "nnnnnnnnnn/" +export MY_PROPERTIES_PATH=build-${MY_PROJECT_NAME}.properties + +echo "/nnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnn" +echo "Execute {Replace-Schema}." +echo "nnnnnnnnnn/" +sh $DBFLUTE_HOME/etc/cmd/_df-replace-schema.sh $MY_PROPERTIES_PATH + + Property changes on: announcement/trunk/dbflute/replace-schema.sh ___________________________________________________________________ Name: svn:executable + * Name: svn:eol-style + native Added: announcement/trunk/dbflute/schema/readme.txt =================================================================== --- announcement/trunk/dbflute/schema/readme.txt (rev 0) +++ announcement/trunk/dbflute/schema/readme.txt 2008-06-30 02:54:27 UTC (rev 1002) @@ -0,0 +1 @@ +Directory for SchemaFile Property changes on: announcement/trunk/dbflute/schema/readme.txt ___________________________________________________________________ Name: svn:eol-style + native Added: announcement/trunk/dbflute/sql2entity.bat =================================================================== --- announcement/trunk/dbflute/sql2entity.bat (rev 0) +++ announcement/trunk/dbflute/sql2entity.bat 2008-06-30 02:54:27 UTC (rev 1002) @@ -0,0 +1,19 @@ + @ echo off + +%~d0 +cd %~p0 +call _project.bat + +rem /nnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnn +rem Specify the file path to be used as build-properties. +rem nnnnnnnnnn/ +set MY_PROPERTIES_PATH=build-%MY_PROJECT_NAME%.properties + +rem /nnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnn +rem Execute {Invoke Sql Directory}. +rem nnnnnnnnnn/ +call %DBFLUTE_HOME%\etc\cmd\_df-sql2entity.cmd %MY_PROPERTIES_PATH% + +pause + + Property changes on: announcement/trunk/dbflute/sql2entity.bat ___________________________________________________________________ Name: svn:eol-style + native Added: announcement/trunk/dbflute/sql2entity.sh =================================================================== --- announcement/trunk/dbflute/sql2entity.sh (rev 0) +++ announcement/trunk/dbflute/sql2entity.sh 2008-06-30 02:54:27 UTC (rev 1002) @@ -0,0 +1,15 @@ +#!/bin/sh + +. _project.sh + +echo "/nnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnn" +echo "Specify the file path to be used as build-properties." +echo "nnnnnnnnnn/" +export MY_PROPERTIES_PATH=build-${MY_PROJECT_NAME}.properties + +echo "/nnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnn" +echo "Execute {Invoke Sql Directory}." +echo "nnnnnnnnnn/" +sh $DBFLUTE_HOME/etc/cmd/_df-sql2entity.sh $MY_PROPERTIES_PATH + + Property changes on: announcement/trunk/dbflute/sql2entity.sh ___________________________________________________________________ Name: svn:executable + * Name: svn:eol-style + native Added: announcement/trunk/mydbflute/readme.txt =================================================================== --- announcement/trunk/mydbflute/readme.txt (rev 0) +++ announcement/trunk/mydbflute/readme.txt 2008-06-30 02:54:27 UTC (rev 1002) @@ -0,0 +1,3 @@ +$ mkdir dbflute-0.7.0 +$ cd dbflute-0.7.0 +$ unzip /dbflute-0.7.0.zip Property changes on: announcement/trunk/mydbflute/readme.txt ___________________________________________________________________ Name: svn:eol-style + native Added: announcement/trunk/pom.xml =================================================================== --- announcement/trunk/pom.xml (rev 0) +++ announcement/trunk/pom.xml 2008-06-30 02:54:27 UTC (rev 1002) @@ -0,0 +1,252 @@ + + + 4.0.0 + jp.sf.pal + announcement + 1.0-SNAPSHOT + war + Announcement Portlet + + http://pal.sourceforge.jp/ + + announcement + validate + + + + maven-compiler-plugin + + 1.5 + 1.5 + UTF-8 + + + + maven-surefire-plugin + 2.3 + + + maven-deploy-plugin + + true + + + + org.codehaus.mojo + cobertura-maven-plugin + 2.0-SNAPSHOT + + + + clean + + + + + + + + + maven-source-plugin + + + source-jar + package + + jar + + + + + + + + + maven.marevol.com + Maven2 Repository on marevol.com + http://maven2.marevol.com/ + + + maven.seasar.org + The Seasar Foundation Maven2 Repository + http://maven.seasar.org/maven2 + + + + + mysql + mysql-connector-java + 5.0.4 + + + junit + junit + 4.4 + compile + + + junit-addons + junit-addons + 1.4 + compile + + + + javax.servlet + servlet-api + 2.3 + provided + + + portlet-api + portlet-api + 1.0 + provided + + + org.apache.geronimo.specs + geronimo-jsp_2.0_spec + 1.0 + provided + + + org.apache.geronimo.specs + geronimo-servlet_2.4_spec + 1.0 + provided + + + org.apache.geronimo.specs + geronimo-jta_1.1_spec + 1.0 + + + org.apache.geronimo.specs + geronimo-ejb_3.0_spec + 1.0 + + + org.apache.geronimo.specs + geronimo-jpa_3.0_spec + 1.0 + provided + + + org.seasar.container + s2-framework + 2.4.25 + + + org.seasar.container + s2-extension + 2.4.25 + + + log4j + log4j + + + + + org.seasar.container + s2-tiger + 2.4.25 + + + org.easymock + easymock + + + + + org.seasar.teeda + teeda-extension + 1.0.13-sp2-20080605 + + + org.seasar.teeda + teeda-tiger + 1.0.13 + + + org.seasar.portlet + s2-portlet + 1.0.7 + + + org.seasar.dao + s2-dao + 1.0.48 + + + org.seasar.dao + s2-dao-tiger + 1.0.48 + + + org.apache.portals.bridges + portals-bridges-portletfilter + 1.0.3 + + + logkit + logkit + + + avalon-framework + avalon-framework + + + javax.servlet + servlet-api + + + log4j + log4j + + + + + jp.sf.pal + faces-response-filter + 0.2 + + + jp.sf.pal + portlet-output-optimizer + 0.2 + + + jp.sf.pal + common-utils + 0.3 + + + log4j + log4j + 1.2.9 + + + xerces + xercesImpl + 2.6.2 + + + xerces + xmlParserAPIs + 2.6.2 + + + commons-lang + commons-lang + 2.4 + + + Property changes on: announcement/trunk/pom.xml ___________________________________________________________________ Name: svn:eol-style + native Added: announcement/trunk/src/main/config/clay/announcement.clay =================================================================== --- announcement/trunk/src/main/config/clay/announcement.clay (rev 0) +++ announcement/trunk/src/main/config/clay/announcement.clay 2008-06-30 02:54:27 UTC (rev 1002) @@ -0,0 +1,133 @@ + + + + + + + + + +
    + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
    + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
    + + + + + Added: announcement/trunk/src/main/config/sql/mysql/announcement.sql =================================================================== --- announcement/trunk/src/main/config/sql/mysql/announcement.sql (rev 0) +++ announcement/trunk/src/main/config/sql/mysql/announcement.sql 2008-06-30 02:54:27 UTC (rev 1002) @@ -0,0 +1,29 @@ +DROP TABLE IF EXISTS ANNOUNCEMENT_BODY; +DROP TABLE IF EXISTS ANNOUNCEMENT; + +CREATE TABLE ANNOUNCEMENT ( + ID INTEGER NOT NULL AUTO_INCREMENT + , SCOPE VARCHAR(20) NOT NULL + , ROLE VARCHAR(100) + , START_DATE DATETIME + , END_DATE DATETIME + , TITLE VARCHAR(100) NOT NULL + , SORT_ORDER INTEGER NOT NULL + , TIMESTAMP TIMESTAMP NOT NULL + , PRIMARY KEY (ID) +); + +CREATE TABLE ANNOUNCEMENT_BODY ( + ID INTEGER NOT NULL + , CONTENT TEXT NOT NULL + , PRIMARY KEY (ID) +); + +ALTER TABLE ANNOUNCEMENT_BODY + ADD CONSTRAINT FK_ANNOUNCEMENT_BODY + FOREIGN KEY (ID) + REFERENCES ANNOUNCEMENT (ID) + ON DELETE CASCADE; + +alter table ANNOUNCEMENT Type=InnoDB; + Added: announcement/trunk/src/main/java/jp/sf/pal/announcement/AnnouncementConstraints.java =================================================================== --- announcement/trunk/src/main/java/jp/sf/pal/announcement/AnnouncementConstraints.java (rev 0) +++ announcement/trunk/src/main/java/jp/sf/pal/announcement/AnnouncementConstraints.java 2008-06-30 02:54:27 UTC (rev 1002) @@ -0,0 +1,13 @@ +package jp.sf.pal.announcement; + +public class AnnouncementConstraints { + + public static final String DEFAULT_SCOPE = "DEFAULT"; + + public static final String SCOPE_KEY = "scope"; + + public static final long MIN_DATE = 0; + + public static final long MAX_DATE = 92464556400000L;// 4900/02/01? + +} Property changes on: announcement/trunk/src/main/java/jp/sf/pal/announcement/AnnouncementConstraints.java ___________________________________________________________________ Name: svn:eol-style + native Added: announcement/trunk/src/main/java/jp/sf/pal/announcement/db/allcommon/AccessContext.java =================================================================== --- announcement/trunk/src/main/java/jp/sf/pal/announcement/db/allcommon/AccessContext.java (rev 0) +++ announcement/trunk/src/main/java/jp/sf/pal/announcement/db/allcommon/AccessContext.java 2008-06-30 02:54:27 UTC (rev 1002) @@ -0,0 +1,267 @@ +package jp.sf.pal.announcement.db.allcommon; + +/** + * Access-Context. + *

    + * This access-context on the thread should be initialized at the beginning of access. + * The access is various. Web-Access, Batch-Access, JUnit-Access and so on... + *

    + * @author DBFlute(AutoGenerator) + */ +public class AccessContext { + + // =================================================================================== + // Thread Local + // ============ + /** The thread-local for this. */ + private static final ThreadLocal threadLocal = new ThreadLocal(); + + /** + * Get access-context on thread. + * @return Access-context. (Nullable) + */ + public static AccessContext getAccessContextOnThread() { + return (AccessContext) threadLocal.get(); + } + + /** + * Set access-context on thread. + * @param accessContext Access-context. (NotNull) + */ + public static void setAccessContextOnThread(AccessContext accessContext) { + if (accessContext == null) { + String msg = "The argument[accessContext] must not be null."; + throw new IllegalArgumentException(msg); + } + threadLocal.set(accessContext); + } + + /** + * Is existing access-context on thread? + * @return Determination. + */ + public static boolean isExistAccessContextOnThread() { + return (threadLocal.get() != null); + } + + /** + * Clear access-context on thread. + */ + public static void clearAccessContextOnThread() { + threadLocal.set(null); + } + + // =================================================================================== + // Access Information + // ================== + /** + * Get access user on thread. + *

    + * If it can't get access user from access-context, + * returns 'Anonymous' as default value! + *

    + * @return Access user. (NotNull) + */ + public static String getAccessUserOnThread() { + if (isExistAccessContextOnThread()) { + final AccessContext userContextOnThread = getAccessContextOnThread(); + final String accessUser = userContextOnThread.getAccessUser(); + if (accessUser != null) { + return accessUser; + } + } + return "Anonymous";// as Default + } + + /** + * Get access process on thread. + *

    + * If it can't get access process from access-context, + * returns 'Anonymous' as default value! + *

    + * @return Access process. (NotNull) + */ + public static String getAccessProcessOnThread() { + if (isExistAccessContextOnThread()) { + final AccessContext userContextOnThread = getAccessContextOnThread(); + final String accessProcess = userContextOnThread.getAccessProcess(); + if (accessProcess != null) { + return accessProcess; + } + } + return "Anonymous";// as Default + } + + /** + * Get access module on thread. + *

    + * If it can't get access module from access-context, + * returns 'Anonymous' as default value! + *

    + * @return Access module. (NotNull) + */ + public static String getAccessModuleOnThread() { + if (isExistAccessContextOnThread()) { + final AccessContext userContextOnThread = getAccessContextOnThread(); + final String accessModule = userContextOnThread.getAccessModule(); + if (accessModule != null) { + return accessModule; + } + } + return "Anonymous";// as Default + } + + /** + * Get access date on thread. + *

    + * If it can't get access date from access-context, + * returns application current time as default value! + *

    + * @return Access date. (NotNull) + */ + public static java.util.Date getAccessDateOnThread() { + if (isExistAccessContextOnThread()) { + final AccessContext userContextOnThread = getAccessContextOnThread(); + final java.util.Date accessDate = userContextOnThread + .getAccessDate(); + if (accessDate != null) { + return accessDate; + } + if (userContextOnThread.getAccessDateProvider() != null) { + return userContextOnThread.getAccessDateProvider() + .getAccessDate(); + } + } + return new java.util.Date();// as Default + } + + /** + * Get access timestamp on thread. + *

    + * If it can't get access timestamp from access-context, + * returns application current time as default value! + *

    + * @return Access timestamp. (NotNull) + */ + public static java.sql.Timestamp getAccessTimestampOnThread() { + if (isExistAccessContextOnThread()) { + final AccessContext userContextOnThread = getAccessContextOnThread(); + final java.sql.Timestamp accessTimestamp = userContextOnThread + .getAccessTimestamp(); + if (accessTimestamp != null) { + return accessTimestamp; + } + if (userContextOnThread.getAccessTimestampProvider() != null) { + return userContextOnThread.getAccessTimestampProvider() + .getAccessTimestamp(); + } + } + return new java.sql.Timestamp(System.currentTimeMillis());// as Default + } + + // =================================================================================== + // Attribute + // ========= + protected String accessUser; + + protected String accessProcess; + + protected String accessModule; + + protected java.util.Date accessDate; + + protected AccessDateProvider accessDateProvider; + + protected java.sql.Timestamp accessTimestamp; + + protected AccessTimestampProvider accessTimestampProvider; + + // =================================================================================== + // Accessor + // ======== + public String getAccessUser() { + return accessUser; + } + + public void setAccessUser(String accessUser) { + this.accessUser = accessUser; + } + + public String getAccessProcess() { + return accessProcess; + } + + public void setAccessProcess(String accessProcess) { + this.accessProcess = accessProcess; + } + + public String getAccessModule() { + return accessModule; + } + + public void setAccessModule(String accessModule) { + this.accessModule = accessModule; + } + + public java.util.Date getAccessDate() { + return accessDate; + } + + public void setAccessDate(java.util.Date accessDate) { + this.accessDate = accessDate; + } + + public AccessDateProvider getAccessDateProvider() { + return accessDateProvider; + } + + public void setAccessDateProvider(AccessDateProvider accessDateProvider) { + this.accessDateProvider = accessDateProvider; + } + + public java.sql.Timestamp getAccessTimestamp() { + return accessTimestamp; + } + + public void setAccessTimestamp(java.sql.Timestamp accessTimestamp) { + this.accessTimestamp = accessTimestamp; + } + + public AccessTimestampProvider getAccessTimestampProvider() { + return accessTimestampProvider; + } + + public void setAccessTimestampProvider( + AccessTimestampProvider accessTimestampProvider) { + this.accessTimestampProvider = accessTimestampProvider; + } + + // =================================================================================== + // Provider Interface + // ================== + /** + * The provider interface of access date. + */ + public static interface AccessDateProvider { + + /** + * Get access date. + * + * @return Access date. (NotNull) + */ + public java.util.Date getAccessDate(); + } + + /** + * The provider interface of access date. + */ + public static interface AccessTimestampProvider { + + /** + * Get access timestamp. + * + * @return Access timestamp. (NotNull) + */ + public java.sql.Timestamp getAccessTimestamp(); + } +} Property changes on: announcement/trunk/src/main/java/jp/sf/pal/announcement/db/allcommon/AccessContext.java ___________________________________________________________________ Name: svn:eol-style + native Added: announcement/trunk/src/main/java/jp/sf/pal/announcement/db/allcommon/BFinder.java =================================================================== --- announcement/trunk/src/main/java/jp/sf/pal/announcement/db/allcommon/BFinder.java (rev 0) +++ announcement/trunk/src/main/java/jp/sf/pal/announcement/db/allcommon/BFinder.java 2008-06-30 02:54:27 UTC (rev 1002) @@ -0,0 +1,102 @@ +package jp.sf.pal.announcement.db.allcommon; + +import jp.sf.pal.announcement.db.allcommon.bhv.BehaviorReadable; + +/** + * The entry of DBFlute. + * @author DBFlute(AutoGenerator) + */ + @ SuppressWarnings("unchecked") +public class BFinder { + + // =================================================================================== + // Definition + // ========== + protected static String _dbfluteDiconName = "dbflute.dicon"; + + // =================================================================================== + // Constructor + // =========== + private BFinder() { + } + + // =================================================================================== + // Finder + // ====== + public static BEHAVIOR_TYPE find( + Class behaviorType) { + assertObjectNotNull("behaviorType", behaviorType); + if (!org.seasar.framework.container.factory.SingletonS2ContainerFactory + .hasContainer()) { + synchronized (BFinder.class) { + if (!org.seasar.framework.container.factory.SingletonS2ContainerFactory + .hasContainer()) { + final String configFile = _dbfluteDiconName; + if (org.seasar.framework.util.ResourceUtil + .isExist(configFile)) { + org.seasar.framework.container.factory.SingletonS2ContainerFactory + .setConfigPath(configFile); + org.seasar.framework.container.factory.SingletonS2ContainerFactory + .init(); + } else { + String msg = "S2Container is not initialized! Confirm your initializer and your dicon files."; + throw new IllegalStateException(msg); + } + } + } + } + final org.seasar.framework.container.S2Container container = org.seasar.framework.container.factory.SingletonS2ContainerFactory + .getContainer(); + final BEHAVIOR_TYPE behavior = (BEHAVIOR_TYPE) container + .getComponent(behaviorType); + return behavior; + } + + // =================================================================================== + // Accessor + // ======== + public static void setDBFluteDiconName(String dbfluteDiconName) { + _dbfluteDiconName = dbfluteDiconName; + } + + // =================================================================================== + // General Helper + // ============== + /** + * Assert that the object is not null. + * @param variableName Variable name. (NotNull) + * @param value Value. (NotNull) + * @exception IllegalArgumentException + */ + protected static void assertObjectNotNull(String variableName, Object value) { + if (variableName == null) { + String msg = "The value should not be null: variableName=" + + variableName + " value=" + value; + throw new IllegalArgumentException(msg); + } + if (value == null) { + String msg = "The value should not be null: variableName=" + + variableName; + throw new IllegalArgumentException(msg); + } + } + + // ---------------------------------------------------------------- + // Assert String + // ------------- + /** + * Assert that the entity is not null and not trimmed empty. + * @param variableName Variable name. (NotNull) + * @param value Value. (NotNull) + */ + protected void assertStringNotNullAndNotTrimmedEmpty(String variableName, + String value) { + assertObjectNotNull("variableName", variableName); + assertObjectNotNull("value", value); + if (value.trim().length() == 0) { + String msg = "The value should not be empty: variableName=" + + variableName + " value=" + value; + throw new IllegalArgumentException(msg); + } + } +} Property changes on: announcement/trunk/src/main/java/jp/sf/pal/announcement/db/allcommon/BFinder.java ___________________________________________________________________ Name: svn:eol-style + native Added: announcement/trunk/src/main/java/jp/sf/pal/announcement/db/allcommon/BehaviorSelector.java =================================================================== --- announcement/trunk/src/main/java/jp/sf/pal/announcement/db/allcommon/BehaviorSelector.java (rev 0) +++ announcement/trunk/src/main/java/jp/sf/pal/announcement/db/allcommon/BehaviorSelector.java 2008-06-30 02:54:27 UTC (rev 1002) @@ -0,0 +1,32 @@ +package jp.sf.pal.announcement.db.allcommon; + +import jp.sf.pal.announcement.db.allcommon.bhv.BehaviorReadable; + +/** + * The interface of behavior-selector. + * @author DBFlute(AutoGenerator) + */ +public interface BehaviorSelector { + + /** + * Initialize condition-bean meta data.
    + * If you call this, Hot Deploy of OutsideSql becomes Cool! + */ + public void initializeConditionBeanMetaData(); + + /** + * Select behavior. + * @param The type of behavior. + * @param behaviorType Behavior type. (NotNull) + * @return Behavior. (NotNull) + */ + public BEHAVIOR_TYPE select( + Class behaviorType); + + /** + * Select behavior-readable. + * @param tableFlexibleName Table flexible-name. (NotNull) + * @return Behavior-readable. (NotNull) + */ + public BehaviorReadable byName(String tableFlexibleName); +} Property changes on: announcement/trunk/src/main/java/jp/sf/pal/announcement/db/allcommon/BehaviorSelector.java ___________________________________________________________________ Name: svn:eol-style + native Added: announcement/trunk/src/main/java/jp/sf/pal/announcement/db/allcommon/CacheAbstractSelector.java =================================================================== --- announcement/trunk/src/main/java/jp/sf/pal/announcement/db/allcommon/CacheAbstractSelector.java (rev 0) +++ announcement/trunk/src/main/java/jp/sf/pal/announcement/db/allcommon/CacheAbstractSelector.java 2008-06-30 02:54:27 UTC (rev 1002) @@ -0,0 +1,91 @@ +package jp.sf.pal.announcement.db.allcommon; + +import org.seasar.framework.container.S2Container; + +/** + * The abstract class of cache-selector. + * @author DBFlute(AutoGenerator) + */ + @ SuppressWarnings("unchecked") +public abstract class CacheAbstractSelector { + + // =================================================================================== + // Attribute + // ========= + /** The container of Seasar. */ + protected S2Container _container; + + // =================================================================================== + // Component + // ========= + public COMPONENT getComponent(Class componentType) { + assertObjectNotNull("componentType", componentType); + assertObjectNotNull("_container", _container); + return (COMPONENT) _container.getComponent(componentType); + } + + // =================================================================================== + // Destroy + // ======= + public void destroy() { + _container = null; + } + + // =================================================================================== + // Helper + // ====== + protected String initUncap(String str) { + return str.substring(0, 1).toLowerCase() + str.substring(1); + } + + // =================================================================================== + // Assert + // ====== + // ----------------------------------------------------- + // Assert Object + // ------------- + /** + * Assert that the object is not null. + * @param variableName Variable name. (NotNull) + * @param value Value. (NotNull) + * @exception IllegalArgumentException + */ + protected void assertObjectNotNull(String variableName, Object value) { + if (variableName == null) { + String msg = "The value should not be null: variableName=" + + variableName + " value=" + value; + throw new IllegalArgumentException(msg); + } + if (value == null) { + String msg = "The value should not be null: variableName=" + + variableName; + throw new IllegalArgumentException(msg); + } + } + + // ----------------------------------------------------- + // Assert String + // ------------- + /** + * Assert that the entity is not null and not trimmed empty. + * @param variableName Variable name. (NotNull) + * @param value Value. (NotNull) + */ + protected void assertStringNotNullAndNotTrimmedEmpty(String variableName, + String value) { + assertObjectNotNull("variableName", variableName); + assertObjectNotNull("value", value); + if (value.trim().length() == 0) { + String msg = "The value should not be empty: variableName=" + + variableName + " value=" + value; + throw new IllegalArgumentException(msg); + } + } + + // =================================================================================== + // Accessor + // ======== + public void setContainer(S2Container container) { + this._container = container; + } +} Property changes on: announcement/trunk/src/main/java/jp/sf/pal/announcement/db/allcommon/CacheAbstractSelector.java ___________________________________________________________________ Name: svn:eol-style + native Added: announcement/trunk/src/main/java/jp/sf/pal/announcement/db/allcommon/CacheBehaviorSelector.java =================================================================== --- announcement/trunk/src/main/java/jp/sf/pal/announcement/db/allcommon/CacheBehaviorSelector.java (rev 0) +++ announcement/trunk/src/main/java/jp/sf/pal/announcement/db/allcommon/CacheBehaviorSelector.java 2008-06-30 02:54:27 UTC (rev 1002) @@ -0,0 +1,119 @@ +package jp.sf.pal.announcement.db.allcommon; + +import java.util.Collection; +import java.util.Map; + +import jp.sf.pal.announcement.db.allcommon.bhv.BehaviorReadable; +import jp.sf.pal.announcement.db.allcommon.dbmeta.DBMeta; +import jp.sf.pal.announcement.db.allcommon.dbmeta.DBMetaInstanceHandler; +import jp.sf.pal.announcement.db.allcommon.util.TraceViewUtil; + +/** + * The implementation of behavior-selector. + * @author DBFlute(AutoGenerator) + */ + @ SuppressWarnings("unchecked") +public class CacheBehaviorSelector extends CacheAbstractSelector implements + BehaviorSelector { + + // =================================================================================== + // Definition + // ========== + /** Log-instance. */ + private static final org.apache.commons.logging.Log _log = org.apache.commons.logging.LogFactory + .getLog(CacheBehaviorSelector.class); + + // =================================================================================== + // Attribute + // ========= + /** The cache of behavior. (It's the generic hell!) */ + protected java.util.Map, BehaviorReadable> _behaviorCache = new java.util.LinkedHashMap, BehaviorReadable>(); + + // =================================================================================== + // Initialize + // ========== + /** + * Initialize condition-bean meta data.
    + * If you call this, Hot Deploy of OutsideSql becomes Cool! + */ + public void initializeConditionBeanMetaData() { + final Map dbmetaMap = DBMetaInstanceHandler + .getDBMetaMap(); + final Collection dbmetas = dbmetaMap.values(); + long before = 0; + if (_log.isDebugEnabled()) { + before = System.currentTimeMillis(); + _log + .debug("/= = = = = = = = = = = = = = = = = initializeConditionBeanMetaData()"); + } + for (DBMeta dbmeta : dbmetas) { + BehaviorReadable bhv = byName(dbmeta.getTableDbName()); + final DaoReadable dao = bhv.getDaoReadable(); + if (_log.isDebugEnabled()) { + _log.debug("[" + dbmeta.getTableDbName() + "]"); + } + dao.initializeDaoMetaData("selectList"); + } + if (_log.isDebugEnabled()) { + long after = System.currentTimeMillis(); + _log.debug("= = = = = = = = = =/ [" + + TraceViewUtil.convertToPerformanceView(after - before) + + "]"); + } + } + + // =================================================================================== + // Selector + // ======== + /** + * Select behavior. + * @param The type of behavior. + * @param behaviorType Behavior type. (NotNull) + * @return Behavior. (NotNull) + */ + public BEHAVIOR_TYPE select( + Class behaviorType) { + if (_behaviorCache.containsKey(behaviorType)) { + return (BEHAVIOR_TYPE) _behaviorCache.get(behaviorType); + } + final BEHAVIOR_TYPE bhv = (BEHAVIOR_TYPE) getComponent(behaviorType); + _behaviorCache.put(behaviorType, bhv); + return bhv; + } + + /** + * Select behavior-readable by name. + * @param tableFlexibleName Table flexible-name. (NotNull) + * @return Behavior-readable. (NotNull) + */ + public BehaviorReadable byName(String tableFlexibleName) { + assertStringNotNullAndNotTrimmedEmpty("tableFlexibleName", + tableFlexibleName); + final DBMeta dbmeta = DBMetaInstanceHandler + .findDBMeta(tableFlexibleName); + return select(getBehaviorType(dbmeta)); + } + + /** + * Get behavior-type by dbmeta. + * @param dbmeta Dbmeta. (NotNull) + * @return Behavior-type. (NotNull) + */ + protected Class getBehaviorType(DBMeta dbmeta) { + final String behaviorTypeName = dbmeta.getBehaviorTypeName(); + if (behaviorTypeName == null) { + String msg = "The dbmeta.getBehaviorTypeName() should not return null: dbmeta=" + + dbmeta; + throw new IllegalStateException(msg); + } + final Class behaviorType; + try { + behaviorType = (Class) Class + .forName(behaviorTypeName); + } catch (ClassNotFoundException e) { + throw new RuntimeException("The class does not exist: " + + behaviorTypeName, e); + } + return behaviorType; + } +} Property changes on: announcement/trunk/src/main/java/jp/sf/pal/announcement/db/allcommon/CacheBehaviorSelector.java ___________________________________________________________________ Name: svn:eol-style + native Added: announcement/trunk/src/main/java/jp/sf/pal/announcement/db/allcommon/CacheDaoSelector.java =================================================================== --- announcement/trunk/src/main/java/jp/sf/pal/announcement/db/allcommon/CacheDaoSelector.java (rev 0) +++ announcement/trunk/src/main/java/jp/sf/pal/announcement/db/allcommon/CacheDaoSelector.java 2008-06-30 02:54:27 UTC (rev 1002) @@ -0,0 +1,64 @@ +package jp.sf.pal.announcement.db.allcommon; + +import jp.sf.pal.announcement.db.allcommon.dbmeta.DBMeta; +import jp.sf.pal.announcement.db.allcommon.dbmeta.DBMetaInstanceHandler; + +/** + * The implementation of dao-selector. + *
    + * Long long ago this object have cache of dao and bhv.
    + * But the cache cause wrong performance when this is initialized.
    + * So now this object don't have cache.
    + * 
    + * @author DBFlute(AutoGenerator) + */ + @ SuppressWarnings("unchecked") +public class CacheDaoSelector extends CacheAbstractSelector implements + DaoSelector { + + // =================================================================================== + // Selector + // ======== + /** + * Select dao. + * + * @param The type of behavior. + * @param daoType Dao type. (NotNull) + * @return Dao. (NotNull) + */ + public DAO_TYPE select( + Class daoType) { + return (DAO_TYPE) getComponent(daoType); + } + + /** + * Select dao-readable by name. + * + * @param tableFlexibleName Table flexible name. (NotNull) + * @return Dao-readable. (NotNull) + */ + public DaoReadable byName(String tableFlexibleName) { + assertStringNotNullAndNotTrimmedEmpty("tableFlexibleName", + tableFlexibleName); + final DBMeta dbmeta = DBMetaInstanceHandler + .findDBMeta(tableFlexibleName); + return select(getDaoType(dbmeta)); + } + + protected Class getDaoType(DBMeta dbmeta) { + final String daoTypeName = dbmeta.getDaoTypeName(); + if (daoTypeName == null) { + String msg = "The dbmeta.getDaoTypeName() should not return null: dbmeta=" + + dbmeta; + throw new IllegalStateException(msg); + } + final Class daoType; + try { + daoType = (Class) Class.forName(daoTypeName); + } catch (ClassNotFoundException e) { + throw new RuntimeException("The class does not exist: " + + daoTypeName, e); + } + return daoType; + } +} Property changes on: announcement/trunk/src/main/java/jp/sf/pal/announcement/db/allcommon/CacheDaoSelector.java ___________________________________________________________________ Name: svn:eol-style + native Added: announcement/trunk/src/main/java/jp/sf/pal/announcement/db/allcommon/DBFluteConfig.java =================================================================== --- announcement/trunk/src/main/java/jp/sf/pal/announcement/db/allcommon/DBFluteConfig.java (rev 0) +++ announcement/trunk/src/main/java/jp/sf/pal/announcement/db/allcommon/DBFluteConfig.java 2008-06-30 02:54:27 UTC (rev 1002) @@ -0,0 +1,170 @@ +package jp.sf.pal.announcement.db.allcommon; + +import jp.sf.pal.announcement.db.allcommon.jdbc.StatementConfig; + +/** + * The sigleton class that has generate-meta-data(GenMetaData). + * @author DBFlute(AutoGenerator) + */ +public class DBFluteConfig { + + // =================================================================================== + // Definition + // ========== + /** Log instance. */ + private static final org.apache.commons.logging.Log _log = org.apache.commons.logging.LogFactory + .getLog(DBFluteConfig.class); + + /** Singleton instance. */ + private static final DBFluteConfig _instance = new DBFluteConfig(); + + // =================================================================================== + // Attribute + // ========= + protected StatementConfig _defaultStatementConfig; + + protected boolean _conditionBeanFormatSql = true; + + protected boolean _queryLogLevelInfo; + + protected boolean _executeStatusLogLevelInfo; + + protected boolean _internalDebug; + + protected boolean _locked = true; + + // =================================================================================== + // Constructor + // =========== + /** + * Constructor. + */ + private DBFluteConfig() { + } + + // =================================================================================== + // Singleton + // ========= + /** + * Get instance. + * @return Singleton instance. (NotNull) + */ + public static DBFluteConfig getInstance() { + return _instance; + } + + // =================================================================================== + // Default Statement Config + // ======================== + public StatementConfig getDefaultStatementConfig() { + return _defaultStatementConfig; + } + + public void setDefaultStatementConfig(StatementConfig defaultStatementConfig) { + assertNotLocked(); + if (_log.isInfoEnabled()) { + _log.info("...Setting defaultStatementConfig: " + + defaultStatementConfig); + } + _defaultStatementConfig = defaultStatementConfig; + } + + // =================================================================================== + // ConditionBean Format Sql + // ======================== + public boolean isConditionBeanFormatSql() { + return _conditionBeanFormatSql; + } + + public void setConditionBeanFormatSql(boolean conditionBeanFormatSql) { + assertNotLocked(); + if (_log.isInfoEnabled()) { + _log.info("...Setting conditionBeanFormatSql: " + + conditionBeanFormatSql); + } + _conditionBeanFormatSql = conditionBeanFormatSql; + } + + // =================================================================================== + // Query Log Level Info + // ==================== + public boolean isQueryLogLevelInfo() { + return _queryLogLevelInfo; + } + + public void setQueryLogLevelInfo(boolean queryLogLevelInfo) { + assertNotLocked(); + if (_log.isInfoEnabled()) { + _log.info("...Setting queryLogLevelInfo: " + queryLogLevelInfo); + } + _queryLogLevelInfo = queryLogLevelInfo; + } + + // =================================================================================== + // Execute Status Log Level Info + // ============================= + public boolean isExecuteStatusLogLevelInfo() { + return _executeStatusLogLevelInfo; + } + + public void setExecuteStatusLogLevelInfo(boolean executeStatusLogLevelInfo) { + assertNotLocked(); + if (_log.isInfoEnabled()) { + _log.info("...Setting executeStatusLogLevelInfo: " + + executeStatusLogLevelInfo); + } + _executeStatusLogLevelInfo = executeStatusLogLevelInfo; + } + + // =================================================================================== + // Internal Debug + // ============== + public boolean isInternalDebug() { + return _internalDebug; + } + + public void setInternalDebug(boolean internalDebug) { + assertNotLocked(); + if (_log.isInfoEnabled()) { + _log.info("...Setting internalDebug: " + internalDebug); + } + _internalDebug = internalDebug; + } + + // =================================================================================== + // Config Lock + // =========== + public boolean isLocked() { + return _locked; + } + + public void lock() { + if (_log.isInfoEnabled()) { + _log.info("...Locking the config of dbflute!"); + } + _locked = true; + } + + public void unlock() { + if (_log.isInfoEnabled()) { + _log.info("...Unlocking the config of dbflute!"); + } + _locked = false; + } + + protected void assertNotLocked() { + if (!isLocked()) { + return; + } + String msg = "The config of dbflute is locked! Don't access at this timing!"; + throw new IllegalStateException(msg); + } + + // =================================================================================== + // Config Clear + // ============ + public void clear() { + _defaultStatementConfig = null; + _internalDebug = false; + } +} \ No newline at end of file Property changes on: announcement/trunk/src/main/java/jp/sf/pal/announcement/db/allcommon/DBFluteConfig.java ___________________________________________________________________ Name: svn:eol-style + native Added: announcement/trunk/src/main/java/jp/sf/pal/announcement/db/allcommon/DaoReadable.java =================================================================== --- announcement/trunk/src/main/java/jp/sf/pal/announcement/db/allcommon/DaoReadable.java (rev 0) +++ announcement/trunk/src/main/java/jp/sf/pal/announcement/db/allcommon/DaoReadable.java 2008-06-30 02:54:27 UTC (rev 1002) @@ -0,0 +1,9 @@ +package jp.sf.pal.announcement.db.allcommon; + +/** + * The interface of dao-readable. + * @author DBFlute(AutoGenerator) + */ +public interface DaoReadable { + public void initializeDaoMetaData(String methodName);// Very Internal Method! +} Property changes on: announcement/trunk/src/main/java/jp/sf/pal/announcement/db/allcommon/DaoReadable.java ___________________________________________________________________ Name: svn:eol-style + native Added: announcement/trunk/src/main/java/jp/sf/pal/announcement/db/allcommon/DaoSelector.java =================================================================== --- announcement/trunk/src/main/java/jp/sf/pal/announcement/db/allcommon/DaoSelector.java (rev 0) +++ announcement/trunk/src/main/java/jp/sf/pal/announcement/db/allcommon/DaoSelector.java 2008-06-30 02:54:27 UTC (rev 1002) @@ -0,0 +1,24 @@ +package jp.sf.pal.announcement.db.allcommon; + +/** + * The interface of dao-selector. + * @author DBFlute(AutoGenerator) + */ +public interface DaoSelector { + + /** + * Select dao. + * @param The type of behavior. + * @param daoType Dao type. (NotNull) + * @return Dao. (NotNull) + */ + public DAO_TYPE select( + Class daoType); + + /** + * Select dao-readable by name. + * @param tableFlexibleName Table flexible name. (NotNull) + * @return Dao-readable. (NotNull) + */ + public DaoReadable byName(String tableFlexibleName); +} Property changes on: announcement/trunk/src/main/java/jp/sf/pal/announcement/db/allcommon/DaoSelector.java ___________________________________________________________________ Name: svn:eol-style + native Added: announcement/trunk/src/main/java/jp/sf/pal/announcement/db/allcommon/DaoWritable.java =================================================================== --- announcement/trunk/src/main/java/jp/sf/pal/announcement/db/allcommon/DaoWritable.java (rev 0) +++ announcement/trunk/src/main/java/jp/sf/pal/announcement/db/allcommon/DaoWritable.java 2008-06-30 02:54:27 UTC (rev 1002) @@ -0,0 +1,59 @@ +package jp.sf.pal.announcement.db.allcommon; + +import java.util.List; + +/** + * The interface of dao-writable. + * @author DBFlute(AutoGenerator) + */ +public interface DaoWritable extends DaoReadable { + + /** + * Insert one entity that the type is entity-interface. + * @param entity Entity that the type is entity-interface. (NotNull) + * @return Inserted count. + */ + public int create(Entity entity); + + /** + * Update one entity that the type is entity-interface. + * @param entity Entity that the type is entity-interface. (NotNull) + * @return Updated count. + */ + public int modify(Entity entity); + + /** + * Update one entity that the type is entity-interface. (modified only) + * @param entity Entity that the type is entity-interface. (NotNull) + * @return Updated count. + */ + public int modifyModifiedOnly(Entity entity); + + /** + * Delete one entity that the type is entity-interface. + * @param entity Entity that the type is entity-interface. (NotNull) + * @return Deleted count. + */ + public int remove(Entity entity); + + /** + * Insert several entities that the type is entity-interface. + * @param entityList Entity-list that the type is entity-interface. (NotNull) + * @return The array of inserted count. + */ + public int[] createList(List entityList); + + /** + * Update several entities that the type is entity-interface. + * @param entityList Entity-list that the type is entity-interface. (NotNull) + * @return The array of updated count. + */ + public int[] modifyList(List entityList); + + /** + * Delete several entities that the type is entity-interface. + * @param entityList Entity-list that the type is entity-interface. (NotNull) + * @return The array of deleted count. + */ + public int[] removeList(List entityList); +} Property changes on: announcement/trunk/src/main/java/jp/sf/pal/announcement/db/allcommon/DaoWritable.java ___________________________________________________________________ Name: svn:eol-style + native Added: announcement/trunk/src/main/java/jp/sf/pal/announcement/db/allcommon/Entity.java =================================================================== --- announcement/trunk/src/main/java/jp/sf/pal/announcement/db/allcommon/Entity.java (rev 0) +++ announcement/trunk/src/main/java/jp/sf/pal/announcement/db/allcommon/Entity.java 2008-06-30 02:54:27 UTC (rev 1002) @@ -0,0 +1,112 @@ +package jp.sf.pal.announcement.db.allcommon; + +import java.util.LinkedHashSet; +import java.util.Set; + +import jp.sf.pal.announcement.db.allcommon.dbmeta.DBMeta; + +/** + * The interface of entity. + * @author DBFlute(AutoGenerator) + */ +public interface Entity { + + // =================================================================================== + // DBMeta + // ====== + /** + * Get the instance of target dbmeta. + * @return DBMeta. (NotNull) + */ + public DBMeta getDBMeta(); + + // =================================================================================== + // Table Name + // ========== + /** + * Get table DB name. + * @return Table DB name. (NotNull) + */ + public String getTableDbName(); + + /** + * Get table property name. + * @return Table property name. (NotNull) + */ + public String getTablePropertyName(); + + // =================================================================================== + // Determination + // ============= + /** + * Has the value of primary-key? + * @return Determination. + */ + public boolean hasPrimaryKeyValue(); + + // =================================================================================== + // Modified Properties + // =================== + /** + * Get modified property names. (JavaBeansRule) + * @return Modified property names. (NotNull) + */ + public Set getModifiedPropertyNames(); + + /** + * Clear modified property names. + */ + public void clearModifiedPropertyNames(); + + /** + * Entity modified properties. + */ + public static class EntityModifiedProperties implements + java.io.Serializable { + + /** Serial version UID. (Default) */ + private static final long serialVersionUID = 1L; + + /** Set of properties. */ + protected Set _propertiesSet = new LinkedHashSet(); + + /** + * Add property name. (JavaBeansRule) + * @param propertyName Property name. (Nullable) + */ + public void addPropertyName(String propertyName) { + _propertiesSet.add(propertyName); + } + + /** + * Get the set of properties. + * @return The set of properties. (NotNull) + */ + public Set getPropertyNames() { + return _propertiesSet; + } + + /** + * Is empty? + * @return Determination. + */ + public boolean isEmpty() { + return _propertiesSet.isEmpty(); + } + + /** + * Clear the set of properties. + */ + public void clear() { + _propertiesSet.clear(); + } + + /** + * Remove property name from the set. (JavaBeansRule) + * @param propertyName Property name. (Nullable) + */ + public void remove(String propertyName) { + _propertiesSet.remove(propertyName); + } + } +} Property changes on: announcement/trunk/src/main/java/jp/sf/pal/announcement/db/allcommon/Entity.java ___________________________________________________________________ Name: svn:eol-style + native Added: announcement/trunk/src/main/java/jp/sf/pal/announcement/db/allcommon/EntityDefinedCommonColumn.java =================================================================== --- announcement/trunk/src/main/java/jp/sf/pal/announcement/db/allcommon/EntityDefinedCommonColumn.java (rev 0) +++ announcement/trunk/src/main/java/jp/sf/pal/announcement/db/allcommon/EntityDefinedCommonColumn.java 2008-06-30 02:54:27 UTC (rev 1002) @@ -0,0 +1,19 @@ +package jp.sf.pal.announcement.db.allcommon; + +/** + * The interface of entity defined common column. + * @author DBFlute(AutoGenerator) + */ +public interface EntityDefinedCommonColumn extends Entity { + + /** + * Disable common column auto set up. + */ + public void disableCommonColumnAutoSetup(); + + /** + * Can the entity set up common column by auto? + * @return Determination. + */ + public boolean canCommonColumnAutoSetup(); +} Property changes on: announcement/trunk/src/main/java/jp/sf/pal/announcement/db/allcommon/EntityDefinedCommonColumn.java ___________________________________________________________________ Name: svn:eol-style + native Added: announcement/trunk/src/main/java/jp/sf/pal/announcement/db/allcommon/GenMetaData.java =================================================================== --- announcement/trunk/src/main/java/jp/sf/pal/announcement/db/allcommon/GenMetaData.java (rev 0) +++ announcement/trunk/src/main/java/jp/sf/pal/announcement/db/allcommon/GenMetaData.java 2008-06-30 02:54:27 UTC (rev 1002) @@ -0,0 +1,252 @@ +package jp.sf.pal.announcement.db.allcommon; + +/** + * The sigleton class that has generate-meta-data(GenMetaData). + * + * @author DBFlute(AutoGenerator) + */ +public class GenMetaData { + + /** Singleton instance. */ + private static final GenMetaData _instance = new GenMetaData(); + + /** + * Constructor. + */ + private GenMetaData() { + } + + /** + * Get instance. + * + * @return Singleton instance. + */ + public static GenMetaData getInstance() { + return _instance; + } + + // =================================================================================== + // Basic + // ===== + /** + * Get the property-value of targetLanguage. + * + * @return The property-value. + */ + public String getTargetLanguage() { + return "java"; + } + + /** + * Get the property-value of templateFileExtension. + * + * @return The property-value. + */ + public String getTemplateFileExtension() { + return "vm"; + } + + /** + * Get the property-value of classFileExtension. + * + * @return The property-value. + */ + public String getClassFileExtension() { + return "java"; + } + + /** + * Get the property-value of templateFileEncoding. + * + * @return The property-value. + */ + public String getTemplateEncoding() { + return "UTF-8"; + } + + /** + * Get the property-value of classAuthor. + * + * @return The property-value. + */ + public String getClassAuthor() { + return "DBFlute(AutoGenerator)"; + } + + // =================================================================================== + // Naming + // ====== + /** + * Is java name of table same as db name? Answer is false! + * + * @return The property-value. + */ + public boolean isJavaNameOfTableSameAsDbName() { + return false; + } + + /** + * Is java name of column same as db name? Answer is false! + * + * @return The property-value. + */ + public boolean isJavaNameOfColumnSameAsDbName() { + return false; + } + + // =================================================================================== + // Prefix + // ====== + /** + * Get the property-value of projectPrefix. + * + * @return The property-value. + */ + public String getProjectPrefix() { + return ""; + } + + /** + * Get the property-value of basePrefix. + * + * @return The property-value. + */ + public String getBasePrefix() { + return "Bs"; + } + + // =================================================================================== + // Package + // ======= + /** + * Get the property-value of baseCommonPackage. + * + * @return The property-value. + */ + public String getBaseCommonPackage() { + return "jp.sf.pal.announcement.db.allcommon"; + } + + /** + * Get the property-value of baseBehaviorPackage. + * + * @return The property-value. + */ + public String getBaseBehaviorPackage() { + return "jp.sf.pal.announcement.db.bsbhv"; + } + + /** + * Get the property-value of baseDaoPackage. + * + * @return The property-value. + */ + public String getBaseDaoPackage() { + return "jp.sf.pal.announcement.db.bsdao"; + } + + /** + * Get the property-value of baseEntityPackage. + * + * @return The property-value. + */ + public String getBaseEntityPackage() { + return "jp.sf.pal.announcement.db.bsentity"; + } + + /** + * Get the property-value of conditionBeanPackage. + * + * @return The property-value. + */ + public String getConditionBeanPackage() { + return "jp.sf.pal.announcement.db.cbean"; + } + + /** + * Get the property-value of extendedDaoPackage. + * + * @return The property-value. + */ + public String getExtendedDaoPackage() { + return "jp.sf.pal.announcement.db.exdao"; + } + + /** + * Get the property-value of extendedBehaviorPackage. + * + * @return The property-value. + */ + public String getExtendedBehaviorPackage() { + return "jp.sf.pal.announcement.db.exbhv"; + } + + /** + * Get the property-value of extendedEntityPackage. + * + * @return The property-value. + */ + public String getExtendedEntityPackage() { + return "jp.sf.pal.announcement.db.exentity"; + } + + // =================================================================================== + // Optimistic Lock + // =============== + /** + * Get the property-value of updateDateFieldName. + * + * @return The property-value. + */ + public String getUpdateDateFieldName() { + return ""; + } + + /** + * Get the property-value of versionNoFieldName. + * + * @return The property-value. + */ + public String getVersionNoFieldName() { + return ""; + } + + // =================================================================================== + // Extract + // ======= + /** + * Get the value of 'extractAcceptStartBrace'. + * + * @return The property-value. (NotNull) + */ + public String getExtractAcceptStartBrace() { + return "@{"; + } + + /** + * Get the value of 'extractAcceptEndBrace'. + * + * @return The property-value. (NotNull) + */ + public String getExtractAcceptEndBrace() { + return "@}"; + } + + /** + * Get the value of 'extractAcceptDelimiter'. + * + * @return The property-value. (NotNull) + */ + public String getExtractAcceptDelimiter() { + return "@;"; + } + + /** + * Get the value of 'extractAcceptEqual'. + * + * @return The property-value. (NotNull) + */ + public String getExtractAcceptEqual() { + return "@="; + } +} Property changes on: announcement/trunk/src/main/java/jp/sf/pal/announcement/db/allcommon/GenMetaData.java ___________________________________________________________________ Name: svn:eol-style + native Added: announcement/trunk/src/main/java/jp/sf/pal/announcement/db/allcommon/InternalMapContext.java =================================================================== --- announcement/trunk/src/main/java/jp/sf/pal/announcement/db/allcommon/InternalMapContext.java (rev 0) +++ announcement/trunk/src/main/java/jp/sf/pal/announcement/db/allcommon/InternalMapContext.java 2008-06-30 02:54:27 UTC (rev 1002) @@ -0,0 +1,62 @@ +package jp.sf.pal.announcement.db.allcommon; + +import java.util.HashMap; +import java.util.Map; + +/** + * The context of internal map. + * + * @author DBFlute(AutoGenerator) + */ +public class InternalMapContext { + + // =================================================================================== + // Thread Local + // ============ + /** The thread-local for this. */ + private static final ThreadLocal> threadLocal = new ThreadLocal>(); + + protected static void initialize() { + if (threadLocal.get() != null) { + return; + } + threadLocal.set(new HashMap()); + } + + /** + * Get the value of the object by the key. + * + * @return The value of the object. (Nullable) + */ + public static Object getObject(String key) { + initialize(); + return threadLocal.get().get(key); + } + + /** + * Set the value of the object. + * + * @param key The key of the object. (NotNull) + * @param value The value of the object. (Nullable) + */ + public static void setObject(String key, Object value) { + initialize(); + threadLocal.get().put(key, value); + } + + /** + * Is existing internal-map-context on thread? + * + * @return Determination. + */ + public static boolean isExistInternalMapContextOnThread() { + return (threadLocal.get() != null); + } + + /** + * Clear internal-map-context on thread. + */ + public static void clearInternalMapContextOnThread() { + threadLocal.set(null); + } +} Property changes on: announcement/trunk/src/main/java/jp/sf/pal/announcement/db/allcommon/InternalMapContext.java ___________________________________________________________________ Name: svn:eol-style + native Added: announcement/trunk/src/main/java/jp/sf/pal/announcement/db/allcommon/QLog.java =================================================================== --- announcement/trunk/src/main/java/jp/sf/pal/announcement/db/allcommon/QLog.java (rev 0) +++ announcement/trunk/src/main/java/jp/sf/pal/announcement/db/allcommon/QLog.java 2008-06-30 02:54:27 UTC (rev 1002) @@ -0,0 +1,37 @@ +package jp.sf.pal.announcement.db.allcommon; + +/** + * @author DBFlute(AutoGenerator) + */ +public class QLog { + + // =================================================================================== + // Definition + // ========== + /** Log instance. */ + private static final org.apache.commons.logging.Log _log = org.apache.commons.logging.LogFactory + .getLog(QLog.class); + + // =================================================================================== + // Logging + // ======= + public static void log(String sql) {// Very Internal + if (isQueryLogLevelInfo()) { + _log.info(sql); + } else { + _log.debug(sql); + } + } + + public static boolean isLogEnabled() { + if (isQueryLogLevelInfo()) { + return _log.isInfoEnabled(); + } else { + return _log.isDebugEnabled(); + } + } + + protected static boolean isQueryLogLevelInfo() { + return DBFluteConfig.getInstance().isQueryLogLevelInfo(); + } +} Property changes on: announcement/trunk/src/main/java/jp/sf/pal/announcement/db/allcommon/QLog.java ___________________________________________________________________ Name: svn:eol-style + native Added: announcement/trunk/src/main/java/jp/sf/pal/announcement/db/allcommon/XLog.java =================================================================== --- announcement/trunk/src/main/java/jp/sf/pal/announcement/db/allcommon/XLog.java (rev 0) +++ announcement/trunk/src/main/java/jp/sf/pal/announcement/db/allcommon/XLog.java 2008-06-30 02:54:27 UTC (rev 1002) @@ -0,0 +1,37 @@ +package jp.sf.pal.announcement.db.allcommon; + +/** + * @author DBFlute(AutoGenerator) + */ +public class XLog { + + // =================================================================================== + // Definition + // ========== + /** Log instance. */ + private static final org.apache.commons.logging.Log _log = org.apache.commons.logging.LogFactory + .getLog(XLog.class); + + // =================================================================================== + // Logging + // ======= + public static void log(String msg) {// Very Internal + if (isExecuteStatusLogLevelInfo()) { + _log.info(msg); + } else { + _log.debug(msg); + } + } + + public static boolean isLogEnabled() {// Very Internal + if (isExecuteStatusLogLevelInfo()) { + return _log.isInfoEnabled(); + } else { + return _log.isDebugEnabled(); + } + } + + protected static boolean isExecuteStatusLogLevelInfo() { + return DBFluteConfig.getInstance().isExecuteStatusLogLevelInfo(); + } +} Property changes on: announcement/trunk/src/main/java/jp/sf/pal/announcement/db/allcommon/XLog.java ___________________________________________________________________ Name: svn:eol-style + native Added: announcement/trunk/src/main/java/jp/sf/pal/announcement/db/allcommon/annotation/OutsideSql.java =================================================================== --- announcement/trunk/src/main/java/jp/sf/pal/announcement/db/allcommon/annotation/OutsideSql.java (rev 0) +++ announcement/trunk/src/main/java/jp/sf/pal/announcement/db/allcommon/annotation/OutsideSql.java 2008-06-30 02:54:27 UTC (rev 1002) @@ -0,0 +1,18 @@ +package jp.sf.pal.announcement.db.allcommon.annotation; + +import java.lang.annotation.ElementType; +import java.lang.annotation.Inherited; +import java.lang.annotation.Retention; +import java.lang.annotation.RetentionPolicy; +import java.lang.annotation.Target; + + @ Inherited + @ Retention(RetentionPolicy.RUNTIME) + @ Target(ElementType.METHOD) +public @interface OutsideSql { + boolean dynamicBinding() default false; + + boolean offsetByCursor() default false; + + boolean limitByCursor() default false; +} Property changes on: announcement/trunk/src/main/java/jp/sf/pal/announcement/db/allcommon/annotation/OutsideSql.java ___________________________________________________________________ Name: svn:eol-style + native Added: announcement/trunk/src/main/java/jp/sf/pal/announcement/db/allcommon/bhv/AbstractBehaviorReadable.java =================================================================== --- announcement/trunk/src/main/java/jp/sf/pal/announcement/db/allcommon/bhv/AbstractBehaviorReadable.java (rev 0) +++ announcement/trunk/src/main/java/jp/sf/pal/announcement/db/allcommon/bhv/AbstractBehaviorReadable.java 2008-06-30 02:54:27 UTC (rev 1002) @@ -0,0 +1,1071 @@ +package jp.sf.pal.announcement.db.allcommon.bhv; + +import java.util.ArrayList; +import java.util.HashMap; +import java.util.List; +import java.util.Map; + +import jp.sf.pal.announcement.db.allcommon.BehaviorSelector; +import jp.sf.pal.announcement.db.allcommon.DaoSelector; +import jp.sf.pal.announcement.db.allcommon.Entity; +import jp.sf.pal.announcement.db.allcommon.bhv.batch.TokenFileOutputOption; +import jp.sf.pal.announcement.db.allcommon.bhv.batch.TokenFileOutputResult; +import jp.sf.pal.announcement.db.allcommon.bhv.setup.ValueLabelBox; +import jp.sf.pal.announcement.db.allcommon.bhv.setup.ValueLabelSetupper; +import jp.sf.pal.announcement.db.allcommon.cbean.ConditionBean; +import jp.sf.pal.announcement.db.allcommon.cbean.ConditionBeanContext; +import jp.sf.pal.announcement.db.allcommon.cbean.ListResultBean; +import jp.sf.pal.announcement.db.allcommon.cbean.PagingBean; +import jp.sf.pal.announcement.db.allcommon.cbean.PagingHandler; +import jp.sf.pal.announcement.db.allcommon.cbean.PagingInvoker; +import jp.sf.pal.announcement.db.allcommon.cbean.PagingResultBean; +import jp.sf.pal.announcement.db.allcommon.cbean.outsidesql.OutsideSqlDao; +import jp.sf.pal.announcement.db.allcommon.cbean.outsidesql.executor.OutsideSqlBasicExecutor; +import jp.sf.pal.announcement.db.allcommon.dbmeta.info.ColumnInfo; +import jp.sf.pal.announcement.db.allcommon.helper.token.file.FileMakingHeaderInfo; +import jp.sf.pal.announcement.db.allcommon.helper.token.file.FileMakingOption; +import jp.sf.pal.announcement.db.allcommon.helper.token.file.FileMakingSimpleFacade; +import jp.sf.pal.announcement.db.allcommon.helper.token.file.impl.FileMakingSimpleFacadeImpl; + +/** + * The abstract class of behavior-readable. + * + * @author DBFlute(AutoGenerator) + */ + @ SuppressWarnings("unchecked") +public abstract class AbstractBehaviorReadable implements BehaviorReadable { + + // =================================================================================== + // Attribute + // ========= + /** Behavior-selector instance. It's basically referred at loadReferrer. (Required for loadReferrer) */ + protected BehaviorSelector _behaviorSelector; + + /** Dao-selector instance. It's basically referred at loadReferrer. (Required for OutsideSql) */ + protected DaoSelector _daoSelector; + + // ===================================================================================== + // Basic Get All + // ============= + /** + * Get count all. + * + * @return Count all. + */ + public int getCountAll() { + return callGetCountAll(); + } + + // ===================================================================================== + // Basic Read Count + // ================ + /** + * The implementation. + * + * @param cb Condition-bean. This condition-bean should not be set up about fetch-scope. (NotNull) + * @return Read count. (NotNull) + */ + public int readCount(ConditionBean cb) { + assertConditionBeanNotNull(cb); + return callReadCount(cb); + } + + // ===================================================================================== + // Basic Read Entity + // ================= + /** + * The implementation. + * + * @param cb Condition-bean. (NotNull) + * @return Read entity. (Nullalble) + * @exception jp.sf.pal.announcement.db.allcommon.exception.EntityDuplicatedException When the entity has been duplicated. + */ + public Entity readEntity(ConditionBean cb) { + assertConditionBeanNotNull(cb); + final java.util.List ls = readList(cb); + if (ls.isEmpty()) { + return null; + } + assertEntitySelectedAsOne(ls, cb); + return (Entity) ls.get(0); + } + + /** + * The implementation. + * + * @param cb Condition-bean. (NotNull) + * @return Read entity. (NotNull) + * @exception jp.sf.pal.announcement.db.allcommon.exception.EntityAlreadyDeletedException When the entity has already been deleted. + * @exception jp.sf.pal.announcement.db.allcommon.exception.EntityDuplicatedException When the entity has been duplicated. + */ + public Entity readEntityWithDeletedCheck(ConditionBean cb) { + assertConditionBeanNotNull(cb); + final java.util.List ls = readList(cb); + assertEntityNotDeleted(ls, cb); + assertEntitySelectedAsOne(ls, cb); + return (Entity) ls.get(0); + } + + // ===================================================================================== + // Basic Read Entity Internal Helper + // ================================= + protected ENTITY_TYPE helpSelectEntityInternally( + CB_TYPE cb, + InternalSelectEntityCallback callback) { + assertConditionBeanNotNull(cb); + cb.checkSafetyResult(1); + java.util.List ls = null; + try { + ls = callback.callbackSelectList(cb); + } catch (jp.sf.pal.announcement.db.allcommon.exception.DangerousResultSizeException e) { + throwEntityDuplicatedException("{Over safetyMaxResultSize '1'}", + cb, e); + } + if (ls.isEmpty()) { + return null; + } + assertEntitySelectedAsOne(ls, cb); + return (ENTITY_TYPE) ls.get(0); + } + + protected static interface InternalSelectEntityCallback { + public java.util.List callbackSelectList(CB_TYPE cb); + } + + protected ENTITY_TYPE helpSelectEntityWithDeletedCheckInternally( + CB_TYPE cb, + InternalSelectEntityWithDeletedCheckCallback callback) { + assertConditionBeanNotNull(cb); + cb.checkSafetyResult(1); + java.util.List ls = null; + try { + ls = callback.callbackSelectList(cb); + } catch (jp.sf.pal.announcement.db.allcommon.exception.DangerousResultSizeException e) { + throwEntityDuplicatedException("{Over safetyMaxResultSize '1'}", + cb, e); + } + assertEntityNotDeleted(ls, cb); + assertEntitySelectedAsOne(ls, cb); + return (ENTITY_TYPE) ls.get(0); + } + + protected static interface InternalSelectEntityWithDeletedCheckCallback { + public java.util.List callbackSelectList(CB_TYPE cb); + } + + // ===================================================================================== + // Basic Read List + // =============== + /** + * The implementation. + * + * @param cb Condition-bean. + * @return List-result-bean. If the select result is zero, it returns empty list. (NotNull) + */ + public ListResultBean readList(ConditionBean cb) { + assertConditionBeanNotNull(cb); + return new jp.sf.pal.announcement.db.allcommon.cbean.ResultBeanBuilder( + getTableDbName()).buildListResultBean(cb, callReadList(cb)); + } + + /** + * The implementation. + * + * @param cb Condition-bean. (NotNull) + * @return Read page. (NotNull) + */ + public PagingResultBean readPage(final ConditionBean cb) { + assertConditionBeanNotNull(cb); + final PagingInvoker invoker = new PagingInvoker( + getTableDbName()); + final PagingHandler handler = new PagingHandler() { + public PagingBean getPagingBean() { + return cb; + } + + public int count() { + return readCount(cb); + } + + public List paging() { + return readList(cb); + } + }; + return invoker.invokePaging(handler); + } + + /** + * Assert that record has not been deleted. + * + * @param entity Selected entity. + * @param searchKey4log Search-key for Logging. + * @exception jp.sf.pal.announcement.db.allcommon.exception.EntityAlreadyDeletedException + * @deprecated Please use assertEntityNotDeleted(). + */ + protected void assertRecordHasNotBeenDeleted( + jp.sf.pal.announcement.db.allcommon.Entity entity, + Object searchKey4Log) { + assertEntityNotDeleted(entity, searchKey4Log); + } + + /** + * Assert that record has not been deleted. + * + * @param ls Selected list. + * @param searchKey4Log Search-key for Logging. + * @exception jp.sf.pal.announcement.db.allcommon.exception.EntityAlreadyDeletedException + * @deprecated Please use assertEntityNotDeleted(). + */ + protected void assertRecordHasNotBeenDeleted(java.util.List ls, + Object searchKey4Log) { + assertEntityNotDeleted(ls, searchKey4Log); + } + + /** + * Assert that the entity is not deleted. + * + * @param entity Selected entity. (Nullable) + * @param searchKey4log Search-key for Logging. + * @exception jp.sf.pal.announcement.db.allcommon.exception.EntityAlreadyDeletedException When the entity has already been deleted. + */ + protected void assertEntityNotDeleted( + jp.sf.pal.announcement.db.allcommon.Entity entity, + Object searchKey4Log) { + if (entity == null) { + throwEntityAlreadyDeletedException(searchKey4Log); + } + } + + /** + * Assert that the entity is not deleted. + * + * @param ls Selected list. (Nullable) + * @param searchKey4Log Search-key for Logging. (NotNull) + * @exception jp.sf.pal.announcement.db.allcommon.exception.EntityAlreadyDeletedException + */ + protected void assertEntityNotDeleted(java.util.List ls, + Object searchKey4Log) { + if (ls == null || ls.isEmpty()) { + throwEntityAlreadyDeletedException(searchKey4Log); + } + } + + /** + * @param ls Selected list. + * @param searchKey4Log Search-key for Logging. + * @exception jp.sf.pal.announcement.db.allcommon.exception.EntityAlreadyDeletedException + * @exception jp.sf.pal.announcement.db.allcommon.exception.EntityDuplicatedException + * @deprecated Please use assertEntitySelectedAsOne. + */ + protected void assertRecordHasBeenSelectedAsOne(java.util.List ls, + Object searchKey4Log) { + assertEntitySelectedAsOne(ls, searchKey4Log); + } + + /** + * Assert that the entity is selected as one. + * + * @param ls Selected list. (NotNull) + * @param searchKey4Log Search-key for Logging. (NotNull) + * @exception jp.sf.pal.announcement.db.allcommon.exception.EntityAlreadyDeletedException + * @exception jp.sf.pal.announcement.db.allcommon.exception.EntityDuplicatedException + */ + protected void assertEntitySelectedAsOne(java.util.List ls, + Object searchKey4Log) { + if (ls == null || ls.isEmpty()) { + throwEntityAlreadyDeletedException(searchKey4Log); + } + if (ls.size() > 1) { + throwEntityDuplicatedException(ls.size() + "", searchKey4Log, null); + } + } + + private void throwEntityAlreadyDeletedException(Object searchKey4Log) { + ConditionBeanContext.throwEntityAlreadyDeletedException(searchKey4Log); + } + + private void throwEntityDuplicatedException(String resultCountString, + Object searchKey4Log, Throwable cause) { + ConditionBeanContext.throwEntityDuplicatedException(resultCountString, + searchKey4Log, cause); + } + + // =================================================================================== + // Various Select + // ============== + public OutsideSqlBasicExecutor outsideSql() { + assertDaoSelectorNotNull("outsideSql"); + final OutsideSqlDao outsideSqlDao = _daoSelector + .select(OutsideSqlDao.class); + return new OutsideSqlBasicExecutor(outsideSqlDao, getTableDbName()); + } + + private void assertDaoSelectorNotNull(String methodName) { + if (_daoSelector == null) { + String msg = "Look! Read the message below." + getLineSeparator(); + msg = msg + + "/* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * *" + + getLineSeparator(); + msg = msg + + "Not found the selector of dao as behavior's attributed!" + + getLineSeparator(); + msg = msg + getLineSeparator(); + msg = msg + "[Advice]" + getLineSeparator(); + msg = msg + + "Please confirm the definition of the selector at your 'dbflute.dicon'." + + getLineSeparator(); + msg = msg + "It is precondition that '" + methodName + + "()' needs the selector instance." + getLineSeparator(); + msg = msg + getLineSeparator(); + msg = msg + "[Your Behavior's Attributes]" + getLineSeparator(); + msg = msg + " _behaviorSelector : " + _behaviorSelector + + getLineSeparator(); + msg = msg + " _daoSelector : " + _daoSelector + + getLineSeparator(); + msg = msg + "* * * * * * * * * */" + getLineSeparator(); + throw new IllegalStateException(msg); + } + } + + /** + * Create value-label list. + * @param The type of entity. + * @param cb Condition-bean. (NotNull) + * @param valueLabelSetupper Value-label-setupper. (NotNull) + * @return Value-label list. (NotNull) + */ + public List> createValueLabelList( + List entityList, + ValueLabelSetupper valueLabelSetupper) { + final List> valueLabelList = new ArrayList>(); + final ValueLabelBox box = new ValueLabelBox(); + for (ENTITY entity : entityList) { + final Map valueLabel = new HashMap(); + valueLabelSetupper.setup(box, entity); + valueLabel.put("value", box.getValue()); + valueLabel.put("label", box.getLabel()); + valueLabelList.add(valueLabel); + } + return valueLabelList; + } + + // =================================================================================== + // Sequence + // ======== + /** + * The implementation. + * + * @return The value of sequence. (NotNull) + */ + public java.math.BigDecimal readNextVal() { + try { + final java.lang.reflect.Method method = getClass().getMethod( + "selectNextVal", new Class[] {}); + Object sequenceObject = method.invoke(this, new Object[] {}); + if (sequenceObject instanceof java.math.BigDecimal) { + return (java.math.BigDecimal) sequenceObject; + } + return (java.math.BigDecimal) helpConvertingSequenceObject( + java.math.BigDecimal.class, sequenceObject); + } catch (NoSuchMethodException e) { + throw new RuntimeException("The table does not have sequence: " + + getTableDbName(), e); + } catch (Exception e) { + throw new RuntimeException( + "The selectNextVal() of the table threw the exception: " + + getTableDbName(), e); + } + } + + protected Object helpConvertingSequenceObject(Class resultClass, + Object sequenceObject) { + try { + final java.lang.reflect.Constructor constructor = resultClass + .getConstructor(new Class[] { String.class }); + return constructor.newInstance(new Object[] { sequenceObject + .toString() }); + } catch (NoSuchMethodException e) { + } catch (Exception e) { + throw new RuntimeException( + "The readNextVal() of the table threw the exception: " + + getTableDbName(), e); + } + try { + final java.lang.reflect.Method method = resultClass.getMethod( + "valueOf", new Class[] { long.class }); + return method.invoke(null, new Object[] { Long + .valueOf(sequenceObject.toString()) }); + } catch (NoSuchMethodException e) { + } catch (Exception e) { + throw new RuntimeException( + "The readNextVal() of the table threw the exception: " + + getTableDbName(), e); + } + String msg = "Cannot convert sequenceObject to resultClass:"; + msg = msg + " resultClass=" + resultClass + " sequenceObjectType=" + + sequenceObject.getClass(); + throw new IllegalStateException(msg); + } + + // =================================================================================== + // Load Referrer Internal Helper + // ============================= + /** + * @param The type of base entity. + * @param The type of primary key. + * @param The type of referrer condition-bean. + * @param The type of referrer entity. + * @param localEntityList The list of local entity. (NotNull) + * @param loadReferrerOption The option of loadReferrer. (NotNull) + * @param callback The internal call-back of loadReferrer. (NotNull) + */ + protected void helpLoadRefererInternally( + java.util.List localEntityList, + jp.sf.pal.announcement.db.allcommon.bhv.load.LoadRefererOption loadReferrerOption, + InternalLoadRefererCallback callback) { + doHelpLoadReferrerInternally(localEntityList, loadReferrerOption, + callback); + }// Cannot deprecated because someone who overrides this method exists. + + /** + * Help load referrer internally.
    + * About internal policy, the value of primary key(and others too) is treated as CaseInsensitive. + * + * @param The type of base entity. + * @param The type of primary key. + * @param The type of referrer condition-bean. + * @param The type of referrer entity. + * @param localEntityList The list of local entity. (NotNull) + * @param loadReferrerOption The option of loadReferrer. (NotNull) + * @param callback The internal call-back of loadReferrer. (NotNull) + */ + protected void helpLoadReferrerInternally( + java.util.List localEntityList, + jp.sf.pal.announcement.db.allcommon.bhv.load.LoadReferrerOption loadReferrerOption, + final InternalLoadReferrerCallback callback) { + final InternalLoadRefererCallback compatibleCallback = new InternalLoadRefererCallback() { + public PK_TYPE callbackBase_getPrimaryKeyValue( + LOCAL_ENTITY_TYPE entity) { + return callback.callbackBase_getPrimaryKeyValue(entity); + } + + public void callbackBase_setReferrerList(LOCAL_ENTITY_TYPE entity, + List referrerList) { + callback.callbackBase_setReferrerList(entity, referrerList); + } + + public PK_TYPE callbackReferrer_getForeignKeyValue( + REFERRER_ENTITY_TYPE entity) { + return callback.callbackReferrer_getForeignKeyValue(entity); + } + + public REFERRER_CB_TYPE callbackReferrer_newMyConditionBean() { + return callback.callbackReferrer_newMyConditionBean(); + } + + public void callbackReferrer_queryAddOrderByForeignKeyAsc( + REFERRER_CB_TYPE cb) { + callback.callbackReferrer_queryAddOrderByForeignKeyAsc(cb); + } + + public void callbackReferrer_queryForeignKeyInScope( + REFERRER_CB_TYPE cb, List pkList) { + callback.callbackReferrer_queryForeignKeyInScope(cb, pkList); + } + + public List callbackReferrer_selectList( + REFERRER_CB_TYPE cb) { + return callback.callbackReferrer_selectList(cb); + } + + public void callbackReferrer_setForeignEntity( + REFERRER_ENTITY_TYPE referrerEntity, + LOCAL_ENTITY_TYPE localEntity) { + callback.callbackReferrer_setForeignEntity(referrerEntity, + localEntity); + } + }; + helpLoadRefererInternally( + localEntityList, + new jp.sf.pal.announcement.db.allcommon.bhv.load.LoadRefererOption( + loadReferrerOption), compatibleCallback); + } + + /** + * Help load referrer internally.
    + * About internal policy, the value of primary key(and others too) is treated as CaseInsensitive. + * + * @param The type of base entity. + * @param The type of primary key. + * @param The type of referrer condition-bean. + * @param The type of referrer entity. + * @param localEntityList The list of local entity. (NotNull) + * @param loadReferrerOption The option of loadReferrer. (NotNull) + * @param callback The internal call-back of loadReferrer. (NotNull) + */ + protected void doHelpLoadReferrerInternally( + java.util.List localEntityList, + jp.sf.pal.announcement.db.allcommon.bhv.load.LoadReferrerOption loadReferrerOption, + InternalLoadReferrerCallback callback) { + + // - - - - - - - - - - - + // Assert pre-condition + // - - - - - - - - - - - + assertBehaviorSelectorNotNull("loadReferrer"); + assertObjectNotNull("localEntityList", localEntityList); + assertObjectNotNull("loadReferrerOption", loadReferrerOption); + if (localEntityList.isEmpty()) { + return; + } + + // - - - - - - - - - - - - - - + // Prepare temporary container + // - - - - - - - - - - - - - - + final java.util.Map pkBaseEntityMap = new java.util.LinkedHashMap(); + final java.util.List pkList = new java.util.ArrayList(); + for (LOCAL_ENTITY_TYPE localEntity : localEntityList) { + final PK_TYPE primaryKeyValue = callback + .callbackBase_getPrimaryKeyValue(localEntity); + pkList.add(callback.callbackBase_getPrimaryKeyValue(localEntity)); + pkBaseEntityMap.put(toLowerCasePrimaryKeyIfString(primaryKeyValue), + localEntity); + } + + // - - - - - - - - - - - - - - - - + // Prepare referrer condition bean + // - - - - - - - - - - - - - - - - + final REFERRER_CB_TYPE cb; + if (loadReferrerOption.getReferrerConditionBean() != null) { + cb = loadReferrerOption.getReferrerConditionBean(); + } else { + cb = callback.callbackReferrer_newMyConditionBean(); + } + + // - - - - - - - - - - - - - - + // Select the list of referrer + // - - - - - - - - - - - - - - + callback.callbackReferrer_queryForeignKeyInScope(cb, pkList); + loadReferrerOption + .delegateKeyConditionExchangingFirstWhereClauseForLastOne(cb); + if (!loadReferrerOption.isStopOrderByKey()) { + callback.callbackReferrer_queryAddOrderByForeignKeyAsc(cb); + cb.getSqlComponentOfOrderByClause() + .exchangeFirstOrderByElementForLastOne(); + } + loadReferrerOption.delegateConditionBeanSettingUp(cb); + final java.util.List referrerList = callback + .callbackReferrer_selectList(cb); + loadReferrerOption.delegateEntitySettingUp(referrerList); + + // - - - - - - - - - - - - - - - - - - - - - - - - + // Create the map of {primary key / referrer list} + // - - - - - - - - - - - - - - - - - - - - - - - - + final java.util.Map> pkReffererListMap = new java.util.LinkedHashMap>(); + for (REFERRER_ENTITY_TYPE referrerEntity : referrerList) { + final PK_TYPE referrerListKey; + { + final PK_TYPE foreignKeyValue = callback + .callbackReferrer_getForeignKeyValue(referrerEntity); + referrerListKey = toLowerCasePrimaryKeyIfString(foreignKeyValue); + } + if (!pkReffererListMap.containsKey(referrerListKey)) { + pkReffererListMap.put(referrerListKey, + new java.util.ArrayList()); + } + (pkReffererListMap.get(referrerListKey)).add(referrerEntity); + + // for Reverse Reference. + final LOCAL_ENTITY_TYPE localEntity = pkBaseEntityMap + .get(referrerListKey); + callback.callbackReferrer_setForeignEntity(referrerEntity, + localEntity); + } + + // - - - - - - - - - - - - - - - - - - + // Relate referrer list to base entity + // - - - - - - - - - - - - - - - - - - + for (LOCAL_ENTITY_TYPE localEntity : localEntityList) { + final PK_TYPE referrerListKey; + { + final PK_TYPE primaryKey = callback + .callbackBase_getPrimaryKeyValue(localEntity); + referrerListKey = toLowerCasePrimaryKeyIfString(primaryKey); + } + if (pkReffererListMap.containsKey(referrerListKey)) { + callback.callbackBase_setReferrerList(localEntity, + pkReffererListMap.get(referrerListKey)); + } else { + callback.callbackBase_setReferrerList(localEntity, + new java.util.ArrayList()); + } + } + } + + /** + * To lower case for primary key if the value is string. + * + * @param The type of primary key. + * @param value The value of primary key. (Nullable) + * @return The value of primary key. (Nullable) + */ + protected PK_TYPE toLowerCasePrimaryKeyIfString(PK_TYPE value) { + return (PK_TYPE) toLowerCaseIfString(value); + } + + /** + * @param The type of base entity. + * @param The type of primary key. + * @param The type of referrer condition-bean. + * @param The type of referrer entity. + */ + protected static interface InternalLoadRefererCallback + extends + InternalLoadReferrerCallback { + } + + /** + * @param The type of base entity. + * @param The type of primary key. + * @param The type of referrer conditionBean. + * @param The type of referrer entity. + */ + protected static interface InternalLoadReferrerCallback { + // For Base + public PK_TYPE callbackBase_getPrimaryKeyValue(LOCAL_ENTITY_TYPE entity); + + public void callbackBase_setReferrerList(LOCAL_ENTITY_TYPE entity, + java.util.List referrerList); + + // For Referrer + public REFERRER_CB_TYPE callbackReferrer_newMyConditionBean(); + + public void callbackReferrer_queryForeignKeyInScope( + REFERRER_CB_TYPE cb, java.util.List pkList); + + public void callbackReferrer_queryAddOrderByForeignKeyAsc( + REFERRER_CB_TYPE cb); + + public java.util.List callbackReferrer_selectList( + REFERRER_CB_TYPE cb); + + public PK_TYPE callbackReferrer_getForeignKeyValue( + REFERRER_ENTITY_TYPE entity); + + public void callbackReferrer_setForeignEntity( + REFERRER_ENTITY_TYPE referrerEntity, + LOCAL_ENTITY_TYPE localEntity); + } + + private void assertBehaviorSelectorNotNull(String methodName) { + if (_behaviorSelector == null) { + String msg = "Look! Read the message below." + getLineSeparator(); + msg = msg + + "/* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * *" + + getLineSeparator(); + msg = msg + + "Not found the selector of behavior as behavior's attributed!" + + getLineSeparator(); + msg = msg + getLineSeparator(); + msg = msg + "[Advice]" + getLineSeparator(); + msg = msg + + "Please confirm the definition of the selector at your 'dbflute.dicon'." + + getLineSeparator(); + msg = msg + "It is precondition that '" + methodName + + "()' needs the selector instance." + getLineSeparator(); + msg = msg + getLineSeparator(); + msg = msg + "[Your Behavior's Attributes]" + getLineSeparator(); + msg = msg + " _behaviorSelector : " + _behaviorSelector + + getLineSeparator(); + msg = msg + " _daoSelector : " + _daoSelector + + getLineSeparator(); + msg = msg + "* * * * * * * * * */" + getLineSeparator(); + throw new IllegalStateException(msg); + } + } + + // =================================================================================== + // Pullout Internal Helper + // ======================= + protected java.util.List helpPulloutInternally( + java.util.List localEntityList, + InternalPulloutCallback callback) { + assertObjectNotNull("localEntityList", localEntityList); + final java.util.Set foreignSet = new java.util.LinkedHashSet(); + for (LOCAL_ENTITY_TYPE entity : localEntityList) { + final FOREIGN_ENTITY_TYPE foreignEntity = callback + .callbackGetForeignEntity(entity); + if (foreignEntity == null || foreignSet.contains(foreignEntity)) { + continue; + } + foreignSet.add(foreignEntity); + } + return new java.util.ArrayList(foreignSet); + } + + protected static interface InternalPulloutCallback { + public FOREIGN_ENTITY_TYPE callbackGetForeignEntity( + LOCAL_ENTITY_TYPE entity); + } + + // =================================================================================== + // Token File + // ========== + public TokenFileOutputExecutor tokenFileOutput() + throws java.io.FileNotFoundException, java.io.IOException { + return new TokenFileOutputExecutor(); + } + + public class TokenFileOutputExecutor { + + /** + * Output token-file from this table records. + * + * @param cb Condition-bean. (NotNull) + * @param filename Name of the file. (NotNull and NotEmpty) + * @param tokenFileOutputOption token-file-output-option. (NotNull and Required{delimiter and encoding}) + * @return Token-file-output-result. (NotNull) + * @throws java.io.FileNotFoundException + * @throws java.io.IOException + */ + public TokenFileOutputResult outputTokenFile(ConditionBean cb, + String filename, TokenFileOutputOption tokenFileOutputOption) + throws java.io.FileNotFoundException, java.io.IOException { + assertConditionBeanNotNull(cb); + assertStringNotNullAndNotTrimmedEmpty("filename", filename); + assertObjectNotNull("tokenFileOutputOption", tokenFileOutputOption); + + final java.util.List ls = readList(cb); + java.util.List> rowList = new java.util.ArrayList>(); + for (java.util.Iterator ite = ls.iterator(); ite.hasNext();) { + final Entity entity = (Entity) ite.next(); + final java.util.List valueList = getDBMeta() + .convertToColumnStringValueList(entity); + rowList.add(valueList); + } + final FileMakingSimpleFacade fileMakingSimpleFacade = new FileMakingSimpleFacadeImpl(); + final FileMakingOption fileMakingOption = tokenFileOutputOption + .getFileMakingOption(); + final FileMakingHeaderInfo fileMakingHeaderInfo = new FileMakingHeaderInfo(); + final java.util.List columnDbNameList = new java.util.ArrayList(); + for (final java.util.Iterator ite = getDBMeta().getColumnInfoList() + .iterator(); ite.hasNext();) { + final ColumnInfo columnInfo = (ColumnInfo) ite.next(); + columnDbNameList.add(columnInfo.getColumnDbName()); + } + fileMakingHeaderInfo.setColumnNameList(columnDbNameList); + fileMakingOption.setFileMakingHeaderInfo(fileMakingHeaderInfo); + fileMakingSimpleFacade.makeFromRowList(filename, rowList, + fileMakingOption); + final TokenFileOutputResult tokeFileOutputResult = new TokenFileOutputResult(); + tokeFileOutputResult.setSelectedList(ls); + return tokeFileOutputResult; + } + } + + // =================================================================================== + // Delegate Method + // =============== + /** + * The implementation. + * + * @return All count. + */ + protected int callGetCountAll() { + final java.lang.reflect.Method mtd = getMethod(getDaoReadable() + .getClass(), "getCountAll", new Class[] {}); + final Object result = invoke(mtd, getDaoReadable(), new Object[] {}); + return ((Integer) result).intValue(); + } + + /** + * The implementation. + * + * @return All list. (NotNull) + */ + protected java.util.List callGetListAll() { + final java.lang.reflect.Method mtd = getMethod(getDaoReadable() + .getClass(), "getListAll", new Class[] {}); + final Object result = invoke(mtd, getDaoReadable(), new Object[] {}); + return (java.util.List) result; + } + + /** + * The implementation. + * + * @param cb Condition-bean that the type is condition-bean-interface. (NotNull) + * @return Read count. (NotNull) + */ + protected int callReadCount(ConditionBean cb) { + assertConditionBeanNotNull(cb); + final Class[] types = new Class[] { cb.getClass() }; + final java.lang.reflect.Method mtd = getMethod(getDaoReadable() + .getClass(), "selectCount", types); + final Object result = invoke(mtd, getDaoReadable(), new Object[] { cb }); + return ((Integer) result).intValue(); + } + + /** + * The implementation. + * + * @param cb Condition-bean that the type is condition-bean-interface. (NotNull) + * @return Read entity. If the select result is zero, it returns null. (Nullable) + */ + protected Entity callReadEntity(ConditionBean cb) { + assertConditionBeanNotNull(cb); + final Class[] types = new Class[] { cb.getClass() }; + final java.lang.reflect.Method mtd = getMethod(getDaoReadable() + .getClass(), "selectEntity", types); + final Object result = invoke(mtd, getDaoReadable(), new Object[] { cb }); + return (Entity) result; + } + + /** + * The implementation. + * + * @param cb Condition-bean that the type is condition-bean-interface. (NotNull) + * @return Read list. If the select result is zero, it returns empty list. (NotNull) + */ + protected java.util.List callReadList(ConditionBean cb) { + assertConditionBeanNotNull(cb); + final Class[] types = new Class[] { cb.getClass() }; + final java.lang.reflect.Method mtd = getMethod(getDaoReadable() + .getClass(), "selectList", types); + final Object result = invoke(mtd, getDaoReadable(), new Object[] { cb }); + return (java.util.List) result; + } + + private java.lang.reflect.Method getMethod(Class clazz, String methodName, + Class[] argTypes) { + try { + return clazz.getMethod(methodName, argTypes); + } catch (NoSuchMethodException ex) { + String msg = "class=" + clazz + " method=" + methodName + "-" + + java.util.Arrays.asList(argTypes); + throw new RuntimeException(msg, ex); + } + } + + private Object invoke(java.lang.reflect.Method method, Object target, + Object[] args) { + try { + return method.invoke(target, args); + } catch (java.lang.reflect.InvocationTargetException ex) { + Throwable t = ex.getCause(); + if (t instanceof RuntimeException) { + throw (RuntimeException) t; + } + if (t instanceof Error) { + throw (Error) t; + } + String msg = "target=" + target + " method=" + method + "-" + + java.util.Arrays.asList(args); + throw new RuntimeException(msg, ex); + } catch (IllegalAccessException ex) { + String msg = "target=" + target + " method=" + method + "-" + + java.util.Arrays.asList(args); + throw new RuntimeException(msg, ex); + } + } + + // =================================================================================== + // Optimistic Lock Info + // ==================== + protected abstract boolean hasVersionNoValue(Entity entity); + + protected abstract boolean hasUpdateDateValue(Entity entity); + + // =================================================================================== + // Helper + // ====== + /** + * To lower case if the type is String. + * + * @param obj Object. (Nullable) + * @return Lower object. (Nullable) + */ + protected Object toLowerCaseIfString(Object obj) { + if (obj != null && obj instanceof String) { + return ((String) obj).toLowerCase(); + } + return obj; + } + + /** + * Get the value of line separator. + * + * @return The value of line separator. (NotNull) + */ + protected String getLineSeparator() { + return System.getProperty("line.separator"); + } + + protected ENTITY_TYPE helpDowncastInternally( + Entity entity, Class clazz) { + assertObjectNotNull("entity", entity); + assertObjectNotNull("clazz", clazz); + try { + return (ENTITY_TYPE) entity; + } catch (ClassCastException e) { + String msg = "The entity should be " + clazz.getSimpleName() + + " but it was: " + entity.getClass(); + throw new RuntimeException(msg, e); + } + } + + // ---------------------------------------------------------------- + // Assert Object + // ------------- + /** + * Assert that the object is not null. + * + * @param variableName Variable name. (NotNull) + * @param value Value. (NotNull) + * @exception IllegalArgumentException + */ + protected void assertObjectNotNull(String variableName, Object value) { + if (variableName == null) { + String msg = "The value should not be null: variableName=" + + variableName + " value=" + value; + throw new IllegalArgumentException(msg); + } + if (value == null) { + String msg = "The value should not be null: variableName=" + + variableName; + throw new IllegalArgumentException(msg); + } + } + + /** + * Assert that the entity is not null. + * + * @param entity Entity. (NotNull) + */ + protected void assertEntityNotNull(Entity entity) { + assertObjectNotNull("entity", entity); + } + + /** + * Assert that the condition-bean is not null. + * + * @param cb Condition-bean. (NotNull) + */ + protected void assertConditionBeanNotNull( + jp.sf.pal.announcement.db.allcommon.cbean.ConditionBean cb) { + assertObjectNotNull("cb", cb); + } + + /** + * Assert that the entity has primary-key value. + * + * @param entity Entity. (NotNull) + */ + protected void assertEntityNotNullAndHasPrimaryKeyValue(Entity entity) { + assertEntityNotNull(entity); + if (!entity.hasPrimaryKeyValue()) { + String msg = "The entity must should primary-key: entity=" + entity; + throw new IllegalArgumentException(msg + entity); + } + } + + // ---------------------------------------------------------------- + // Assert String + // ------------- + /** + * Assert that the entity is not null and not trimmed empty. + * + * @param variableName Variable name. (NotNull) + * @param value Value. (NotNull) + */ + protected void assertStringNotNullAndNotTrimmedEmpty(String variableName, + String value) { + assertObjectNotNull("variableName", variableName); + assertObjectNotNull(variableName, value); + if (value.trim().length() == 0) { + String msg = "The value should not be empty: variableName=" + + variableName + " value=" + value; + throw new IllegalArgumentException(msg); + } + } + + // ---------------------------------------------------------------- + // Assert List + // ----------- + /** + * Assert that the list is empty. + * + * @param ls List. (NotNull) + */ + protected void assertListNotNullAndEmpty(java.util.List ls) { + assertObjectNotNull("ls", ls); + if (!ls.isEmpty()) { + String msg = "The list should be empty: ls=" + ls.toString(); + throw new IllegalArgumentException(msg); + } + } + + /** + * Assert that the list is not empty. + * + * @param ls List. (NotNull) + */ + protected void assertListNotNullAndNotEmpty(java.util.List ls) { + assertObjectNotNull("ls", ls); + if (ls.isEmpty()) { + String msg = "The list should not be empty: ls=" + ls.toString(); + throw new IllegalArgumentException(msg); + } + } + + /** + * Assert that the list having only one. + * + * @param ls List. (NotNull) + */ + protected void assertListNotNullAndHasOnlyOne(java.util.List ls) { + assertObjectNotNull("ls", ls); + if (ls.size() != 1) { + String msg = "The list should contain only one object: ls=" + + ls.toString(); + throw new IllegalArgumentException(msg); + } + } + + // =================================================================================== + // Accessor + // ======== + /** + * Get the selector of behavior. + * + * @return The select of behavior. (Nullable: But normally NotNull) + */ + protected BehaviorSelector getBehaviorSelector() { + return _behaviorSelector; + } + + /** + * Set the selector of behavior. + * + * @param behaviorSelector The selector of behavior. (NotNull) + */ + public void setBehaviorSelector(BehaviorSelector behaviorSelector) { + this._behaviorSelector = behaviorSelector; + } + + /** + * Get the selector of dao. + * + * @return The select of behavior. (Nullable: But normally NotNull) + */ + protected DaoSelector getDaoSelector() { + return _daoSelector; + } + + /** + * Set the selector of dao. + * + * @param daoSelector The selector of dao. (NotNull) + */ + public void setDaoSelector(DaoSelector daoSelector) { + _daoSelector = daoSelector; + } +} Property changes on: announcement/trunk/src/main/java/jp/sf/pal/announcement/db/allcommon/bhv/AbstractBehaviorReadable.java ___________________________________________________________________ Name: svn:eol-style + native Added: announcement/trunk/src/main/java/jp/sf/pal/announcement/db/allcommon/bhv/AbstractBehaviorWritable.java =================================================================== --- announcement/trunk/src/main/java/jp/sf/pal/announcement/db/allcommon/bhv/AbstractBehaviorWritable.java (rev 0) +++ announcement/trunk/src/main/java/jp/sf/pal/announcement/db/allcommon/bhv/AbstractBehaviorWritable.java 2008-06-30 02:54:27 UTC (rev 1002) @@ -0,0 +1,904 @@ +package jp.sf.pal.announcement.db.allcommon.bhv; + +import java.util.ArrayList; +import java.util.Iterator; +import java.util.List; + +import jp.sf.pal.announcement.db.allcommon.Entity; +import jp.sf.pal.announcement.db.allcommon.bhv.batch.TokenFileReflectionFailure; +import jp.sf.pal.announcement.db.allcommon.bhv.batch.TokenFileReflectionOption; +import jp.sf.pal.announcement.db.allcommon.bhv.batch.TokenFileReflectionResult; +import jp.sf.pal.announcement.db.allcommon.cbean.ConditionBean; +import jp.sf.pal.announcement.db.allcommon.dbmeta.DBMeta; +import jp.sf.pal.announcement.db.allcommon.helper.MapStringBuilder; +import jp.sf.pal.announcement.db.allcommon.helper.MapStringBuilderImpl; +import jp.sf.pal.announcement.db.allcommon.helper.token.file.FileToken; +import jp.sf.pal.announcement.db.allcommon.helper.token.file.FileTokenizingCallback; +import jp.sf.pal.announcement.db.allcommon.helper.token.file.FileTokenizingHeaderInfo; +import jp.sf.pal.announcement.db.allcommon.helper.token.file.FileTokenizingOption; +import jp.sf.pal.announcement.db.allcommon.helper.token.file.FileTokenizingRowResource; +import jp.sf.pal.announcement.db.allcommon.helper.token.file.impl.FileTokenImpl; + +/** + * The abstract class of behavior-writable. + * @author DBFlute(AutoGenerator) + */ +public abstract class AbstractBehaviorWritable extends AbstractBehaviorReadable + implements BehaviorWritable { + + // =================================================================================== + // Basic Entity Update + // =================== + // ----------------------------------------------------- + // Create + // ------ + /** + * Create. + * @param entity Entity. (NotNull) + */ + public void create(Entity entity) { + doCreate(entity); + } + + protected abstract void doCreate(Entity entity); + + // ----------------------------------------------------- + // Modify + // ------ + /** + * Modify. + * @param entity Entity. (NotNull) + * @exception jp.sf.pal.announcement.db.allcommon.exception.EntityAlreadyUpdatedException When the entity has already been updated. + * @exception jp.sf.pal.announcement.db.allcommon.exception.EntityAlreadyDeletedException When the entity has already been deleted. + * @exception jp.sf.pal.announcement.db.allcommon.exception.EntityDuplicatedException When the entity has been duplicated. + */ + public void modify(Entity entity) { + doModify(entity); + } + + protected abstract void doModify(Entity entity); + + /** + * Modify non strict. + * @param entity Entity. (NotNull) + * @exception jp.sf.pal.announcement.db.allcommon.exception.EntityAlreadyDeletedException When the entity has already been deleted. + * @exception jp.sf.pal.announcement.db.allcommon.exception.EntityDuplicatedException When the entity has been duplicated. + */ + public void modifyNonstrict(Entity entity) { + doModifyNonstrict(entity); + } + + protected abstract void doModifyNonstrict(Entity entity); + + // ----------------------------------------------------- + // Create or Modify + // ---------------- + /** + * The implementation. + * @param entity Entity. This must contain primary-key value at least(Except use identity). (NotNull) + * @exception jp.sf.pal.announcement.db.allcommon.exception.EntityAlreadyUpdatedException When the entity has already been updated. + * @exception jp.sf.pal.announcement.db.allcommon.exception.EntityAlreadyDeletedException When the entity has already been deleted. + * @exception jp.sf.pal.announcement.db.allcommon.exception.EntityDuplicatedException When the entity has been duplicated. + */ + public void createOrModify(jp.sf.pal.announcement.db.allcommon.Entity entity) { + assertEntityNotNull(entity); + doCreateOrUpdate(entity); + } + + protected abstract void doCreateOrUpdate(Entity entity); + + /** + * The implementation. + * @param entity Entity. This must contain primary-key value at least(Except use identity). (NotNull) + * @exception jp.sf.pal.announcement.db.allcommon.exception.EntityAlreadyDeletedException When the entity has already been deleted. + * @exception jp.sf.pal.announcement.db.allcommon.exception.EntityDuplicatedException When the entity has been duplicated. + */ + public void createOrModifyNonstrict( + jp.sf.pal.announcement.db.allcommon.Entity entity) { + assertEntityNotNull(entity); + doCreateOrUpdateNonstrict(entity); + } + + protected abstract void doCreateOrUpdateNonstrict(Entity entity); + + // ----------------------------------------------------- + // Remove + // ------ + /** + * Remove. + * @param entity Entity. (NotNull) + * @exception jp.sf.pal.announcement.db.allcommon.exception.EntityAlreadyUpdatedException When the entity has already been updated. + * @exception jp.sf.pal.announcement.db.allcommon.exception.EntityAlreadyDeletedException When the entity has already been deleted. + * @exception jp.sf.pal.announcement.db.allcommon.exception.EntityDuplicatedException When the entity has been duplicated. + */ + public void remove(jp.sf.pal.announcement.db.allcommon.Entity entity) { + assertEntityNotNull(entity); + callRemove(entity); + } + + protected abstract void doRemove(Entity entity); + + // =================================================================================== + // Basic Entity Update Internal Helper + // =================================== + // ----------------------------------------------------- + // Update + // ------ + protected void helpUpdateInternally( + ENTITY_TYPE entity, InternalUpdateCallback callback) { + assertEntityNotNull(entity); + assertEntityHasVersionNoValue(entity); + assertEntityHasUpdateDateValue(entity); + final int updatedCount = callback.callbackDelegateUpdate(entity); + if (updatedCount == 0) { + String msg = "The entity was Not Found! it has already been deleted: entity=" + + entity; + throw new jp.sf.pal.announcement.db.allcommon.exception.EntityAlreadyDeletedException( + msg); + } else if (updatedCount > 1) { + String msg = "The entity was Too Many! it has been duplicated. It should be the only one! But the updatedCount=" + + updatedCount; + msg = msg + ": entity=" + entity; + throw new jp.sf.pal.announcement.db.allcommon.exception.EntityDuplicatedException( + msg); + } + } + + protected static interface InternalUpdateCallback { + public int callbackDelegateUpdate(ENTITY_TYPE entity); + } + + protected void helpUpdateNonstrictInternally( + ENTITY_TYPE entity, + InternalUpdateNonstrictCallback callback) { + assertEntityNotNull(entity); + final int updatedCount = callback + .callbackDelegateUpdateNonstrict(entity); + if (updatedCount == 0) { + String msg = "The entity was Not Found! it has already been deleted: entity=" + + entity; + throw new jp.sf.pal.announcement.db.allcommon.exception.EntityAlreadyDeletedException( + msg); + } else if (updatedCount > 1) { + String msg = "The entity was Too Many! it has been duplicated. It should be the only one! But the updatedCount=" + + updatedCount; + msg = msg + ": entity=" + entity; + } + } + + protected static interface InternalUpdateNonstrictCallback { + public int callbackDelegateUpdateNonstrict(ENTITY_TYPE entity); + } + + // ----------------------------------------------------- + // InsertOrUpdate + // -------------- + protected void helpInsertOrUpdateInternally( + ENTITY_TYPE entity, + InternalInsertOrUpdateCallback callback) { + assertEntityNotNull(entity); + if (!entity.hasPrimaryKeyValue()) { + callback.callbackInsert(entity); + } else { + RuntimeException exception = null; + try { + callback.callbackUpdate(entity); + } catch (jp.sf.pal.announcement.db.allcommon.exception.EntityAlreadyUpdatedException e) { + if (e.getRows() == 0) { + exception = e; + } + } catch (jp.sf.pal.announcement.db.allcommon.exception.EntityAlreadyDeletedException e) { + exception = e; + } catch (IllegalStateException e) { + exception = e; + } + if (exception != null) { + final CB_TYPE cb = callback.callbackNewMyConditionBean(); + cb.acceptPrimaryKeyMapString(getDBMeta() + .extractPrimaryKeyMapString(entity)); + if (callback.callbackSelectCount(cb) == 0) { + callback.callbackInsert(entity); + } else { + throw exception; + } + } + } + } + + protected static interface InternalInsertOrUpdateCallback { + public void callbackInsert(ENTITY_TYPE entity); + + public void callbackUpdate(ENTITY_TYPE entity); + + public CB_TYPE callbackNewMyConditionBean(); + + public int callbackSelectCount(CB_TYPE cb); + } + + protected void helpInsertOrUpdateInternally( + ENTITY_TYPE entity, + InternalInsertOrUpdateNonstrictCallback callback) { + assertEntityNotNull(entity); + if (!entity.hasPrimaryKeyValue()) { + callback.callbackInsert(entity); + } else { + try { + callback.callbackUpdateNonstrict(entity); + } catch (jp.sf.pal.announcement.db.allcommon.exception.EntityAlreadyUpdatedException e) { + callback.callbackInsert(entity); + } catch (jp.sf.pal.announcement.db.allcommon.exception.EntityAlreadyDeletedException e) { + callback.callbackInsert(entity); + } + } + } + + protected static interface InternalInsertOrUpdateNonstrictCallback { + public void callbackInsert(ENTITY_TYPE entity); + + public void callbackUpdateNonstrict(ENTITY_TYPE entity); + } + + // ----------------------------------------------------- + // Delete + // ------ + protected void helpDeleteInternally( + ENTITY_TYPE entity, InternalDeleteCallback callback) { + assertEntityNotNull(entity); + assertEntityHasVersionNoValue(entity); + assertEntityHasUpdateDateValue(entity); + final int deletedCount = callback.callbackDelegateDelete(entity); + if (deletedCount == 0) { + String msg = "The entity was Not Found! The entity has already been deleted: entity=" + + entity; + throw new jp.sf.pal.announcement.db.allcommon.exception.EntityAlreadyDeletedException( + msg); + } else if (deletedCount > 1) { + String msg = "The deleted entity was duplicated. It should be the only one! But the deletedCount=" + + deletedCount; + msg = msg + ": entity=" + entity; + } + } + + protected static interface InternalDeleteCallback { + public int callbackDelegateDelete(ENTITY_TYPE entity); + } + + protected void helpDeleteNonstrictInternally( + ENTITY_TYPE entity, + InternalDeleteNonstrictCallback callback) { + assertEntityNotNull(entity); + final int deletedCount = callback + .callbackDelegateDeleteNonstrict(entity); + if (deletedCount == 0) { + String msg = "The entity was Not Found! The entity has already been deleted: entity=" + + entity; + throw new jp.sf.pal.announcement.db.allcommon.exception.EntityAlreadyDeletedException( + msg); + } else if (deletedCount > 1) { + String msg = "The deleted entity was duplicated. It should be the only one! But the deletedCount=" + + deletedCount; + msg = msg + ": entity=" + entity; + } + } + + protected static interface InternalDeleteNonstrictCallback { + public int callbackDelegateDeleteNonstrict(ENTITY_TYPE entity); + } + + protected void helpDeleteNonstrictIgnoreDeletedInternally( + ENTITY_TYPE entity, + InternalDeleteNonstrictIgnoreDeletedCallback callback) { + assertEntityNotNull(entity); + final int deletedCount = callback + .callbackDelegateDeleteNonstrict(entity); + if (deletedCount == 0) { + return; + } else if (deletedCount > 1) { + String msg = "The deleted entity was duplicated. It should be the only one! But the deletedCount=" + + deletedCount; + msg = msg + ": entity=" + entity; + } + } + + protected static interface InternalDeleteNonstrictIgnoreDeletedCallback { + public int callbackDelegateDeleteNonstrict(ENTITY_TYPE entity); + } + + // =================================================================================== + // Basic Lump Update + // ================= + /** + * Lump create the list. + * @param entityList Entity list. (NotNull and NotEmpty) + * @return The array of created count. + */ + public int[] lumpCreate(java.util.List entityList) { + assertListNotNullAndNotEmpty(entityList); + return callCreateList(entityList); + } + + /** + * Lump Modify the list. + * @param entityList Entity list. (NotNull and NotEmpty) + * @return Modified count. + * @exception jp.sf.pal.announcement.db.allcommon.exception.EntityAlreadyUpdatedException If s2dao's version is over 1.0.47 (contains 1.0.47). + */ + public int[] lumpModify(java.util.List entityList) { + assertListNotNullAndNotEmpty(entityList); + return callModifyList(entityList); + } + + /** + * Lump remove the list. + * @param entityList Entity list. (NotNull and NotEmpty) + * @return Removed count. + * @exception jp.sf.pal.announcement.db.allcommon.exception.EntityAlreadyUpdatedException If s2dao's version is over 1.0.47 (contains 1.0.47). + */ + public int[] lumpRemove(java.util.List entityList) { + assertListNotNullAndNotEmpty(entityList); + return callRemoveList(entityList); + } + + /** + * Inject sequence to primary key if it needs. + * @param entity Entity. (NotNull) + */ + protected void injectSequenceToPrimaryKeyIfNeeds(Entity entity) { + final DBMeta dbmeta = entity.getDBMeta(); + if (!dbmeta.hasSequence() || dbmeta.hasTwoOrMorePrimaryKeys() + || entity.hasPrimaryKeyValue()) { + return; + } + final java.math.BigDecimal sequenceValue = readNextVal(); + final String columnDbName = dbmeta.getPrimaryUniqueInfo() + .getFirstColumn().getColumnDbName(); + final java.util.Map map = new java.util.HashMap(); + map.put(columnDbName, sequenceValue.toString()); + dbmeta.acceptPrimaryKeyMap(entity, map); + } + + // ===================================================================================== + // Token File + // ========== + public TokenFileReflectionExecutor tokenFileReflection() { + return new TokenFileReflectionExecutor(); + } + + public class TokenFileReflectionExecutor { + + /** + * Reflect(insert or update) token-file to this table. + * @param filename Name of the file. (NotNull and NotEmpty) + * @param tokenFileReflectionOption token-file-reflection-option. (NotNull and Required{delimiter and encoding}) + * @return Token-file-reflection-result. (NotNull) + * @throws java.io.FileNotFoundException + * @throws java.io.IOException + */ + public TokenFileReflectionResult reflectTokenFile(String filename, + TokenFileReflectionOption tokenFileReflectionOption) + throws java.io.FileNotFoundException, java.io.IOException { + assertStringNotNullAndNotTrimmedEmpty("filename", filename); + assertFileTokenReflectionOption(tokenFileReflectionOption); + + final TokenFileReflectionResult result = buildTokenFileReflectionResult(); + final FileTokenizingCallback fileTokenizingCallback = buildFileTokenReflectionFileTokenizingCallback( + tokenFileReflectionOption, result); + final FileTokenizingOption fileTokenizingOption = buildFileTokenReflectionFileTokenizingOption(tokenFileReflectionOption); + final FileToken fileToken = new FileTokenImpl(); + fileToken.tokenize(filename, fileTokenizingCallback, + fileTokenizingOption); + return result; + } + + /** + * Reflect(insert or update) token-file to this table. + * @param inputStream Input stream. (NotNull and NotClosed) + * @param tokenFileReflectionOption token-file-reflection-option. (NotNull and Required{delimiter and encoding}) + * @return Token-file-reflection-result. (NotNull) + * @throws java.io.FileNotFoundException + * @throws java.io.IOException + */ + public TokenFileReflectionResult reflectTokenFile( + java.io.InputStream inputStream, + TokenFileReflectionOption tokenFileReflectionOption) + throws java.io.FileNotFoundException, java.io.IOException { + assertObjectNotNull("inputStream", inputStream); + assertFileTokenReflectionOption(tokenFileReflectionOption); + + final TokenFileReflectionResult result = buildTokenFileReflectionResult(); + final FileTokenizingCallback fileTokenizingCallback = buildFileTokenReflectionFileTokenizingCallback( + tokenFileReflectionOption, result); + final FileTokenizingOption fileTokenizingOption = buildFileTokenReflectionFileTokenizingOption(tokenFileReflectionOption); + final FileToken fileToken = new FileTokenImpl(); + fileToken.tokenize(inputStream, fileTokenizingCallback, + fileTokenizingOption); + return result; + } + + protected void assertFileTokenReflectionOption( + TokenFileReflectionOption tokenFileReflectionOption) { + assertObjectNotNull("tokenFileReflectionOption", + tokenFileReflectionOption); + + final String encoding = tokenFileReflectionOption.getEncoding(); + final String delimiter = tokenFileReflectionOption.getDelimiter(); + assertStringNotNullAndNotTrimmedEmpty("encoding", encoding); + assertObjectNotNull("delimiter", delimiter); + } + + protected TokenFileReflectionResult buildTokenFileReflectionResult() { + final TokenFileReflectionResult result = new TokenFileReflectionResult(); + final java.util.List failureList = new java.util.ArrayList(); + result.setFailureList(failureList); + return result; + } + + protected FileTokenizingCallback buildFileTokenReflectionFileTokenizingCallback( + TokenFileReflectionOption tokenFileReflectionOption, + final TokenFileReflectionResult result) + throws java.io.FileNotFoundException, java.io.IOException { + assertObjectNotNull("tokenFileReflectionOption", + tokenFileReflectionOption); + + final String encoding = tokenFileReflectionOption.getEncoding(); + final String delimiter = tokenFileReflectionOption.getDelimiter(); + final boolean interruptIfError = tokenFileReflectionOption + .isInterruptIfError(); + assertStringNotNullAndNotTrimmedEmpty("encoding", encoding); + assertObjectNotNull("delimiter", delimiter); + final java.util.List failureList = result + .getFailureList(); + assertObjectNotNull("failureList", failureList); + + final FileTokenizingCallback fileTokenizingCallback = new FileTokenizingCallback() { + public void handleRowResource( + FileTokenizingRowResource fileTokenizingRowResource) { + final FileTokenizingHeaderInfo fileTokenizingHeaderInfo = fileTokenizingRowResource + .getFileTokenizingHeaderInfo(); + final java.util.List columnNameList = fileTokenizingHeaderInfo + .getColumnNameList(); + final java.util.List valueList = fileTokenizingRowResource + .getValueList(); + + // Set up columnNameList of result object. + if (result.getColumnNameList() == null) { + result.setColumnNameList(columnNameList); + } + + Entity entity = null; + try { + // Create entity by the list of value composed of String. + entity = createEntityByStringValueList(columnNameList, + valueList); + + // Create or modify as non-strict. + doCreateOrUpdateNonstrict(entity); + + // Increment successCount of result object. + result.incrementSuccessCount(); + } catch (RuntimeException e) { + if (interruptIfError) { + throw e; + } + final TokenFileReflectionFailure failure = new TokenFileReflectionFailure(); + failure.setColumnNameList(columnNameList); + failure.setValueList(valueList); + failure.setRowString(fileTokenizingRowResource + .getRowString()); + failure.setRowNumber(fileTokenizingRowResource + .getRowNumber()); + failure.setLineNumber(fileTokenizingRowResource + .getLineNumber()); + if (entity != null) { + failure.setEntity(entity); + } + failure.setException(e); + failureList.add(failure); + } + } + }; + return fileTokenizingCallback; + } + + protected Entity createEntityByStringValueList( + java.util.List columnNameList, + java.util.List valueList) { + final MapStringBuilder builder = new MapStringBuilderImpl(); + builder.setMsMapMark(MAP_STRING_MAP_MARK); + builder.setMsStartBrace(MAP_STRING_START_BRACE); + builder.setMsEndBrace(MAP_STRING_END_BRACE); + builder.setMsDelimiter(MAP_STRING_DELIMITER); + builder.setMsEqual(MAP_STRING_EQUAL); + builder.setColumnNameList(columnNameList); + final String mapString = builder.buildFromList(valueList); + + final Entity entity = getDBMeta().newEntity(); + getDBMeta().acceptColumnValueMapString(entity, mapString); + return entity; + } + + protected FileTokenizingOption buildFileTokenReflectionFileTokenizingOption( + TokenFileReflectionOption tokenFileReflectionOption) + throws java.io.FileNotFoundException, java.io.IOException { + assertObjectNotNull("tokenFileReflectionOption", + tokenFileReflectionOption); + + final String encoding = tokenFileReflectionOption.getEncoding(); + final String delimiter = tokenFileReflectionOption.getDelimiter(); + assertStringNotNullAndNotTrimmedEmpty("encoding", encoding); + assertObjectNotNull("delimiter", delimiter); + + final FileTokenizingOption fileTokenizingOption = new FileTokenizingOption(); + fileTokenizingOption.setEncoding(encoding); + fileTokenizingOption.setDelimiter(delimiter); + if (tokenFileReflectionOption.isHandleEmptyAsNull()) { + fileTokenizingOption.handleEmptyAsNull(); + } + return fileTokenizingOption; + } + } + + // ===================================================================================== + // Delegate Method + // =============== + // ----------------------------------------------------- + // Insert + // ------ + /** + * The implementation. + * @param entity Entity that the type is entity interface. (NotNull) + * @return Inserted count. + */ + protected int callCreate(Entity entity) { + if (!processBeforeInsert(entity)) { + return 1;/*as Normal End*/ + } + return getDaoWritable().create(entity); + } + + /** + * Process before insert. + * @param entity Entity that the type is entity interface. (NotNull) + * @return Execution Determination. (true: execute / false: non) + */ + protected boolean processBeforeInsert(Entity entity) { + if (!determineExecuteInsert(entity)) { + return false; + } + assertEntityNotNull(entity);// If this table use identity, the entity does not have primary-key. + frameworkFilterEntityOfInsert(entity); + filterEntityOfInsert(entity); + assertEntityOfInsert(entity); + return true; + } + + // ----------------------------------------------------- + // Update + // ------ + /** + * The implementation. + * {modified only} + * @param entity Entity that the type is entity interface. (NotNull) + * @return Updated count. + */ + protected int callModify(Entity entity) { + if (!processBeforeUpdate(entity)) { + return 1;/*as Normal End*/ + } + return getDaoWritable().modifyModifiedOnly(entity); + } + + /** + * Process before update. + * @param entity Entity that the type is entity interface. (NotNull) + * @return Execution Determination. (true: execute / false: non) + */ + protected boolean processBeforeUpdate(Entity entity) { + if (!determineExecuteUpdate(entity)) { + return false; + } + assertEntityNotNullAndHasPrimaryKeyValue(entity); + frameworkFilterEntityOfUpdate(entity); + filterEntityOfUpdate(entity); + assertEntityOfUpdate(entity); + return true; + } + + // ----------------------------------------------------- + // Delete + // ------ + /** + * The implementation. + * @param entity Entity that the type is entity interface. (NotNull) + * @return Deleted count. + */ + protected int callRemove(Entity entity) { + if (!processBeforeDelete(entity)) { + return 1;/*as Normal End*/ + } + return getDaoWritable().remove(entity); + } + + /** + * Process before delete. + * @param entity Entity that the type is entity interface. (NotNull) + * @return Execution Determination. (true: execute / false: non) + */ + protected boolean processBeforeDelete(Entity entity) { + if (!determineExecuteDelete(entity)) { + return false; + } + assertEntityNotNullAndHasPrimaryKeyValue(entity); + frameworkFilterEntityOfDelete(entity); + filterEntityOfDelete(entity); + assertEntityOfDelete(entity); + return true; + } + + // ----------------------------------------------------- + // Pre-Process Insert + // ------------------ + /** + * Determine execution of insert. + * @param entity Entity. (NotNull) + * @return Execution Determination. (true: execute / false: non) + */ + protected boolean determineExecuteInsert(Entity entity) { + return true; + } + + /** + * {Framework Method} Filter the entity of insert. + * @param targetEntity Target entity that the type is entity interface. (NotNull) + */ + protected void frameworkFilterEntityOfInsert(Entity targetEntity) { + injectSequenceToPrimaryKeyIfNeeds(targetEntity); + setupCommonColumnOfInsertIfNeeds(targetEntity); + } + + /** + * Set up common columns of insert if it needs. + * @param targetEntity Target entity that the type is entity interface. (NotNull) + */ + protected void setupCommonColumnOfInsertIfNeeds(Entity targetEntity) { + } + + /** + * Filter the entity of insert. + * @param targetEntity Target entity that the type is entity interface. (NotNull) + */ + protected void filterEntityOfInsert(Entity targetEntity) { + } + + /** + * Assert the entity of insert. + * @param entity Entity that the type is entity interface. (NotNull) + */ + protected void assertEntityOfInsert(Entity entity) { + } + + // ----------------------------------------------------- + // Pre-Process Update + // ------------------ + /** + * Determine execution of update. + * @param entity Entity. (NotNull) + * @return Execution Determination. (true: execute / false: non) + */ + protected boolean determineExecuteUpdate(Entity entity) { + return true; + } + + /** + * {Framework Method} Filter the entity of update. + * @param targetEntity Target entity that the type is entity interface. (NotNull) + */ + protected void frameworkFilterEntityOfUpdate(Entity targetEntity) { + setupCommonColumnOfUpdateIfNeeds(targetEntity); + } + + /** + * Set up common columns of update if it needs. + * @param targetEntity Target entity that the type is entity interface. (NotNull) + */ + protected void setupCommonColumnOfUpdateIfNeeds(Entity targetEntity) { + } + + /** + * Filter the entity of update. + * @param targetEntity Target entity that the type is entity interface. (NotNull) + */ + protected void filterEntityOfUpdate(Entity targetEntity) { + } + + /** + * Assert the entity of update. + * @param entity Entity that the type is entity interface. (NotNull) + */ + protected void assertEntityOfUpdate(Entity entity) { + } + + // ----------------------------------------------------- + // Pre-Process Delete + // ------------------ + /** + * Determine execution of delete. + * @param entity Entity. (NotNull) + * @return Execution Determination. (true: execute / false: non) + */ + protected boolean determineExecuteDelete(Entity entity) { + return true; + } + + /** + * {Framework Method} Filter the entity of delete. + * @param targetEntity Target entity that the type is entity interface. (NotNull) + */ + protected void frameworkFilterEntityOfDelete(Entity targetEntity) { + setupCommonColumnOfDeleteIfNeeds(targetEntity); + } + + /** + * Set up common columns of delete if it needs. + * @param targetEntity Target entity that the type is entity interface. (NotNull) + */ + protected void setupCommonColumnOfDeleteIfNeeds(Entity targetEntity) { + } + + /** + * Filter the entity of delete. + * @param targetEntity Target entity that the type is entity interface. (NotNull) + */ + protected void filterEntityOfDelete(Entity targetEntity) { + } + + /** + * Assert the entity of delete. + * @param entity Entity that the type is entity interface. (NotNull) + */ + protected void assertEntityOfDelete(Entity entity) { + } + + /** + * The implementation. + * @param entityList Entity list that the type is entity interface. (NotNull) + * @return Inserted count. + */ + public int[] callCreateList(java.util.List entityList) { + assertObjectNotNull("entityList", entityList); + helpFilterBeforeInsertInternally(entityList); + return getDaoWritable().createList(entityList); + } + + /** + * The implementation. + * @param entityList Entity list that the type is entity interface. (NotNull) + * @return Updated count. + */ + public int[] callModifyList(java.util.List entityList) { + assertObjectNotNull("entityList", entityList); + helpFilterBeforeUpdateInternally(entityList); + return getDaoWritable().modifyList(entityList); + } + + /** + * The implementation. + * @param entityList Entity list that the type is entity interface. (NotNull) + * @return Deleted count. + */ + public int[] callRemoveList(java.util.List entityList) { + assertObjectNotNull("entityList", entityList); + helpFilterBeforeDeleteInternally(entityList); + return getDaoWritable().removeList(entityList); + } + + protected void assertEntityHasVersionNoValue(Entity entity) { + if (!getDBMeta().hasVersionNo()) { + return; + } + if (hasVersionNoValue(entity)) { + return; + } + String msg = "Look! Read the message below." + getLineSeparator(); + msg = msg + + "/* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * *" + + getLineSeparator(); + msg = msg + "The value of 'version no' on the entity was Not Found!" + + getLineSeparator() + getLineSeparator(); + msg = msg + "[Advice]" + getLineSeparator(); + msg = msg + + "Please confirm the existence of the value of 'version no' on the entity." + + getLineSeparator(); + msg = msg + + "You called the method in which the check for optimistic lock is indispensable. " + + getLineSeparator(); + msg = msg + "So 'version no' is required on the entity. " + + getLineSeparator(); + msg = msg + + "In addition, please confirm the necessity of optimistic lock. It might possibly be unnecessary." + + getLineSeparator() + getLineSeparator(); + msg = msg + "[Entity]" + getLineSeparator(); + msg = msg + "entity to string = " + entity + getLineSeparator(); + msg = msg + "entity to map = " + + entity.getDBMeta().convertToColumnValueMap(entity) + + getLineSeparator(); + msg = msg + "* * * * * * * * * */" + getLineSeparator(); + throw new IllegalStateException(msg); + } + + protected void assertEntityHasUpdateDateValue(Entity entity) { + if (!getDBMeta().hasUpdateDate()) { + return; + } + if (hasUpdateDateValue(entity)) { + return; + } + String msg = "Look! Read the message below." + getLineSeparator(); + msg = msg + + "/* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * *" + + getLineSeparator(); + msg = msg + "The value of 'update date' on the entity was Not Found!" + + getLineSeparator() + getLineSeparator(); + msg = msg + "[Advice]" + getLineSeparator(); + msg = msg + + "Please confirm the existence of the value of 'update date' on the entity." + + getLineSeparator(); + msg = msg + + "You called the method in which the check for optimistic lock is indispensable. " + + getLineSeparator(); + msg = msg + "So 'update date' is required on the entity. " + + getLineSeparator(); + msg = msg + + "In addition, please confirm the necessity of optimistic lock. It might possibly be unnecessary." + + getLineSeparator() + getLineSeparator(); + msg = msg + "[Entity]" + getLineSeparator(); + msg = msg + "entity to string = " + entity + getLineSeparator(); + msg = msg + "entity to map = " + + entity.getDBMeta().convertToColumnValueMap(entity) + + getLineSeparator(); + msg = msg + "* * * * * * * * * */" + getLineSeparator(); + throw new IllegalStateException(msg); + } + + // =================================================================================== + // Delegate Method Internal Helper + // =============================== + protected List helpFilterBeforeInsertInternally( + List entityList) { + final List filteredList = new ArrayList(); + for (final Iterator ite = entityList.iterator(); ite.hasNext();) { + final ENTITY entity = ite.next(); + if (!processBeforeInsert(entity)) { + continue; + } + filteredList.add(entity); + } + return filteredList; + } + + protected List helpFilterBeforeUpdateInternally( + List entityList) { + final List filteredList = new ArrayList(); + for (final Iterator ite = entityList.iterator(); ite.hasNext();) { + final ENTITY entity = ite.next(); + if (!processBeforeUpdate(entity)) { + continue; + } + filteredList.add(entity); + } + return filteredList; + } + + protected List helpFilterBeforeDeleteInternally( + List entityList) { + final List filteredList = new ArrayList(); + for (final Iterator ite = entityList.iterator(); ite.hasNext();) { + final ENTITY entity = ite.next(); + if (!processBeforeDelete(entity)) { + continue; + } + filteredList.add(entity); + } + return filteredList; + } +} Property changes on: announcement/trunk/src/main/java/jp/sf/pal/announcement/db/allcommon/bhv/AbstractBehaviorWritable.java ___________________________________________________________________ Name: svn:eol-style + native Added: announcement/trunk/src/main/java/jp/sf/pal/announcement/db/allcommon/bhv/BehaviorReadable.java =================================================================== --- announcement/trunk/src/main/java/jp/sf/pal/announcement/db/allcommon/bhv/BehaviorReadable.java (rev 0) +++ announcement/trunk/src/main/java/jp/sf/pal/announcement/db/allcommon/bhv/BehaviorReadable.java 2008-06-30 02:54:27 UTC (rev 1002) @@ -0,0 +1,221 @@ +package jp.sf.pal.announcement.db.allcommon.bhv; + +import jp.sf.pal.announcement.db.allcommon.DaoReadable; +import jp.sf.pal.announcement.db.allcommon.Entity; +import jp.sf.pal.announcement.db.allcommon.cbean.ConditionBean; +import jp.sf.pal.announcement.db.allcommon.cbean.ListResultBean; +import jp.sf.pal.announcement.db.allcommon.cbean.PagingBean; +import jp.sf.pal.announcement.db.allcommon.cbean.PagingHandler; +import jp.sf.pal.announcement.db.allcommon.cbean.PagingInvoker; +import jp.sf.pal.announcement.db.allcommon.cbean.PagingResultBean; +import jp.sf.pal.announcement.db.allcommon.dbmeta.DBMeta; + +/** + * The interface of behavior-readable. + * + * @author DBFlute(AutoGenerator) + */ +public interface BehaviorReadable { + + // =================================================================================== + // Definition + // ========== + /** Map-string map-mark. */ + public static final String MAP_STRING_MAP_MARK = "map:"; + + /** Map-string list-mark. */ + public static final String MAP_STRING_LIST_MARK = "list:"; + + /** Map-string start-brace. */ + public static final String MAP_STRING_START_BRACE = "@{"; + + /** Map-string end-brace. */ + public static final String MAP_STRING_END_BRACE = "@}"; + + /** Map-string delimiter. */ + public static final String MAP_STRING_DELIMITER = "@;"; + + /** Map-string equal. */ + public static final String MAP_STRING_EQUAL = "@="; + + // =================================================================================== + // Table name + // ========== + /** + * Get table db-name. + * + * @return Table db-name. (NotNull) + */ + public String getTableDbName(); + + // =================================================================================== + // DBMeta + // ====== + /** + * Get dbmeta. + * + * @return DBMeta. (NotNull) + */ + public DBMeta getDBMeta(); + + // =================================================================================== + // Dao Accessor + // ============ + /** + * Get dao-readable. + * + * @return Dao-readable. (NotNull) + */ + public DaoReadable getDaoReadable(); + + // =================================================================================== + // New Instance + // ============ + /** + * New entity. + * + * @return Entity. (NotNull) + */ + public Entity newEntity(); + + /** + * New condition-bean. + * + * @return Condition-bean. (NotNull) + */ + public ConditionBean newConditionBean(); + + // =================================================================================== + // Basic Get All + // ============= + /** + * Get count all. + * + * @return Count all. + */ + public int getCountAll(); + + // =================================================================================== + // Basic Read Count + // ================ + /** + * Read count by condition-bean. + *
    +     * If the argument 'condition-bean' is effective about fetch-scope,
    +     * this method invoke select count ignoring the fetch-scope.
    +     * 
    + * @param cb Condition-bean. This condition-bean should not be set up about fetch-scope. (NotNull) + * @return Read count. (NotNull) + */ + public int readCount(ConditionBean cb); + + // =================================================================================== + // Basic Read Entity + // ================= + /** + * Read entity by condition-bean. + * + * @param cb Condition-bean. (NotNull) + * @return Read entity. (Nullalble) + * @exception jp.sf.pal.announcement.db.allcommon.exception.EntityDuplicatedException When the entity has been duplicated. + */ + public Entity readEntity(ConditionBean cb); + + /** + * Read simple entity by condition-bean with deleted check. + * + * @param cb Condition-bean. (NotNull) + * @return Read entity. (NotNull) + * @exception jp.sf.pal.announcement.db.allcommon.exception.EntityAlreadyDeletedException When the entity has already been deleted. + * @exception jp.sf.pal.announcement.db.allcommon.exception.EntityDuplicatedException When the entity has been duplicated. + */ + public Entity readEntityWithDeletedCheck(ConditionBean cb); + + // =================================================================================== + // Basic Read List + // =============== + /** + * Read list as result-bean. + * + * @param cb Condition-bean. (NotNull) + * @return List-result-bean. If the select result is zero, it returns empty list. (NotNull) + */ + public ListResultBean readList(ConditionBean cb); + + /** + * Read page as result-bean. + * + * @param cb Condition-bean. (NotNull) + * @return Read page. (NotNull) + */ + public PagingResultBean readPage(final ConditionBean cb); + + // =================================================================================== + // Sequence + // ======== + /** + * The implementation. + * + * @return The value of sequence. (NotNull) + */ + public java.math.BigDecimal readNextVal(); + + // =================================================================================== + // Static Class + // ============ + /** + * The interface of select-page callback. + * + * @param The generic template for 'selectedList'. + */ + public static interface SelectPageCallback { + public PagingBean getPagingBean(); + + public int selectCountIgnoreFetchScope(); + + public java.util.List selectListWithFetchScope(); + } + + public static class ResultBeanBuilder extends + jp.sf.pal.announcement.db.allcommon.cbean.ResultBeanBuilder { + public ResultBeanBuilder(BehaviorReadable bhv) { + super(bhv.getTableDbName()); + } + } + + public static interface SelectPageInvoker { + public PagingResultBean invokeSelectPage( + SelectPageCallback callback); + } + + public static class SelectPageSimpleInvoker implements + SelectPageInvoker { + protected BehaviorReadable _bhv; + + public SelectPageSimpleInvoker(BehaviorReadable bhv) { + _bhv = bhv; + } + + public PagingResultBean invokeSelectPage( + final SelectPageCallback callback) { + final PagingHandler handler = new PagingHandler() { + public PagingBean getPagingBean() { + return callback.getPagingBean(); + } + + public int count() { + return callback.selectCountIgnoreFetchScope(); + } + + public java.util.List paging() { + return callback.selectListWithFetchScope(); + } + }; + return new PagingInvoker(_bhv.getTableDbName()) + .invokePaging(handler); + } + } + + public static interface SimpleCBSetupper { + } +} Property changes on: announcement/trunk/src/main/java/jp/sf/pal/announcement/db/allcommon/bhv/BehaviorReadable.java ___________________________________________________________________ Name: svn:eol-style + native Added: announcement/trunk/src/main/java/jp/sf/pal/announcement/db/allcommon/bhv/BehaviorWritable.java =================================================================== --- announcement/trunk/src/main/java/jp/sf/pal/announcement/db/allcommon/bhv/BehaviorWritable.java (rev 0) +++ announcement/trunk/src/main/java/jp/sf/pal/announcement/db/allcommon/bhv/BehaviorWritable.java 2008-06-30 02:54:27 UTC (rev 1002) @@ -0,0 +1,113 @@ +package jp.sf.pal.announcement.db.allcommon.bhv; + +import jp.sf.pal.announcement.db.allcommon.DaoWritable; +import jp.sf.pal.announcement.db.allcommon.Entity; + +/** + * The interface of behavior-writable. + * + * @author DBFlute(AutoGenerator) + */ +public interface BehaviorWritable extends BehaviorReadable { + + /** + * Get dao-writable. + * + * @return Dao-writable. (NotNull) + */ + public DaoWritable getDaoWritable(); + + // ===================================================================================== + // Basic Entity Update + // =================== + /** + * Create. + * + * @param entity Entity. (NotNull) + */ + public void create(jp.sf.pal.announcement.db.allcommon.Entity entity); + + /** + * Modify. + * + * @param entity Entity. (NotNull) + * @exception jp.sf.pal.announcement.db.allcommon.exception.EntityAlreadyUpdatedException When the entity has already been updated. + * @exception jp.sf.pal.announcement.db.allcommon.exception.EntityAlreadyDeletedException When the entity has already been deleted. + * @exception jp.sf.pal.announcement.db.allcommon.exception.EntityDuplicatedException When the entity has been duplicated. + */ + public void modify(jp.sf.pal.announcement.db.allcommon.Entity entity); + + /** + * Modify non-strict. + * + * @param entity Entity. (NotNull) + * @exception jp.sf.pal.announcement.db.allcommon.exception.EntityAlreadyDeletedException When the entity has already been deleted. + * @exception jp.sf.pal.announcement.db.allcommon.exception.EntityDuplicatedException When the entity has been duplicated. + */ + public void modifyNonstrict(Entity entity); + + /** + * Create or modify.
    + * {modify: modified only}
    + * This method is faster than createOrModifyAfterSelect(). + * + * @param entity Entity. This must contain primary-key value at least(Except use identity). (NotNull) + * @exception jp.sf.pal.announcement.db.allcommon.exception.EntityAlreadyUpdatedException When the entity has already been updated. + * @exception jp.sf.pal.announcement.db.allcommon.exception.EntityAlreadyDeletedException When the entity has already been deleted. + * @exception jp.sf.pal.announcement.db.allcommon.exception.EntityDuplicatedException When the entity has been duplicated. + */ + public void createOrModify(jp.sf.pal.announcement.db.allcommon.Entity entity); + + /** + * Create or modify non-strict.
    + * {modify: modified only}
    + * This method is faster than createOrModifyAfterSelect(). + * + * @param entity Entity. This must contain primary-key value at least(Except use identity). (NotNull) + * @exception jp.sf.pal.announcement.db.allcommon.exception.EntityAlreadyDeletedException When the entity has already been deleted. + * @exception jp.sf.pal.announcement.db.allcommon.exception.EntityDuplicatedException When the entity has been duplicated. + */ + public void createOrModifyNonstrict( + jp.sf.pal.announcement.db.allcommon.Entity entity); + + /** + * Remove. + * + * @param entity Entity. (NotNull) + * @exception jp.sf.pal.announcement.db.allcommon.exception.EntityAlreadyUpdatedException When the entity has already been updated. + * @exception jp.sf.pal.announcement.db.allcommon.exception.EntityAlreadyDeletedException When the entity has already been deleted. + * @exception jp.sf.pal.announcement.db.allcommon.exception.EntityDuplicatedException When the entity has been duplicated. + */ + public void remove(jp.sf.pal.announcement.db.allcommon.Entity entity); + + // ===================================================================================== + // Basic Batch Update + // ================== + /** + * Lump create the list. + * + * @param entityList Entity-list. (NotNull and NotEmpty) + * @return The array of created count. + */ + public int[] lumpCreate(java.util.List entityList); + + /** + * Lump Modify the list. + * + * @param entityList Entity-list. (NotNull and NotEmpty) + * @return Modified count. + * @exception jp.sf.pal.announcement.db.allcommon.exception.EntityAlreadyUpdatedException When the entity has already been updated. And Only when s2dao's version is over 1.0.47 (contains 1.0.47). + * @exception jp.sf.pal.announcement.db.allcommon.exception.EntityDuplicatedException When the entity has been duplicated. + */ + public int[] lumpModify(java.util.List entityList); + + /** + * Lump remove the list. + * + * @param entityList Entity-list. (NotNull and NotEmpty) + * @return Removed count. + * @exception jp.sf.pal.announcement.db.allcommon.exception.EntityAlreadyUpdatedException When the entity has already been updated. And Only when s2dao's version is over 1.0.47 (contains 1.0.47). + * @exception jp.sf.pal.announcement.db.allcommon.exception.EntityDuplicatedException When the entity has been duplicated. + */ + public int[] lumpRemove(java.util.List entityList); +} Property changes on: announcement/trunk/src/main/java/jp/sf/pal/announcement/db/allcommon/bhv/BehaviorWritable.java ___________________________________________________________________ Name: svn:eol-style + native Added: announcement/trunk/src/main/java/jp/sf/pal/announcement/db/allcommon/bhv/batch/TokenFileOutputOption.java =================================================================== --- announcement/trunk/src/main/java/jp/sf/pal/announcement/db/allcommon/bhv/batch/TokenFileOutputOption.java (rev 0) +++ announcement/trunk/src/main/java/jp/sf/pal/announcement/db/allcommon/bhv/batch/TokenFileOutputOption.java 2008-06-30 02:54:27 UTC (rev 1002) @@ -0,0 +1,87 @@ +package jp.sf.pal.announcement.db.allcommon.bhv.batch; + +import jp.sf.pal.announcement.db.allcommon.helper.token.file.FileMakingOption; + +/** + * @author DBFlute(AutoGenerator) + */ +public class TokenFileOutputOption { + + // ===================================================================================== + // Attribute + // ========= + protected FileMakingOption _fileMakingOption = new FileMakingOption(); + + // ===================================================================================== + // Easy-to-Use + // =========== + public TokenFileOutputOption delimitateByComma() { + _fileMakingOption.delimitateByComma(); + return this; + } + + public TokenFileOutputOption delimitateByTab() { + _fileMakingOption.delimitateByTab(); + return this; + } + + public TokenFileOutputOption encodeAsUTF8() { + _fileMakingOption.encodeAsUTF8(); + return this; + } + + public TokenFileOutputOption encodeAsWindows31J() { + _fileMakingOption.encodeAsWindows31J(); + return this; + } + + public TokenFileOutputOption separateCrLf() { + _fileMakingOption.separateCrLf(); + return this; + } + + public TokenFileOutputOption separateLf() { + _fileMakingOption.separateLf(); + return this; + } + + public TokenFileOutputOption goodByeDoubleQuotation() { + _fileMakingOption.goodByeDoubleQuotation(); + return this; + } + + // ===================================================================================== + // Accessor + // ======== + public String getEncoding() { + return _fileMakingOption.getEncoding(); + } + + public void setEncoding(String encoding) { + _fileMakingOption.setDelimiter(encoding); + } + + public String getDelimiter() { + return _fileMakingOption.getDelimiter(); + } + + public void setDelimiter(String delimiter) { + _fileMakingOption.setDelimiter(delimiter); + } + + public String getLineSeparator() { + return _fileMakingOption.getLineSeparator(); + } + + public void setLineSeparator(String lineSeparator) { + _fileMakingOption.setLineSeparator(lineSeparator); + } + + public boolean isGoodByeDoubleQuotation() { + return _fileMakingOption.isGoodByeDoubleQuotation(); + } + + public FileMakingOption getFileMakingOption() { + return _fileMakingOption; + } +} Property changes on: announcement/trunk/src/main/java/jp/sf/pal/announcement/db/allcommon/bhv/batch/TokenFileOutputOption.java ___________________________________________________________________ Name: svn:eol-style + native Added: announcement/trunk/src/main/java/jp/sf/pal/announcement/db/allcommon/bhv/batch/TokenFileOutputResult.java =================================================================== --- announcement/trunk/src/main/java/jp/sf/pal/announcement/db/allcommon/bhv/batch/TokenFileOutputResult.java (rev 0) +++ announcement/trunk/src/main/java/jp/sf/pal/announcement/db/allcommon/bhv/batch/TokenFileOutputResult.java 2008-06-30 02:54:27 UTC (rev 1002) @@ -0,0 +1,25 @@ +package jp.sf.pal.announcement.db.allcommon.bhv.batch; + +import jp.sf.pal.announcement.db.allcommon.Entity; + +/** + * @author DBFlute(AutoGenerator) + */ +public class TokenFileOutputResult { + + // ===================================================================================== + // Attribute + // ========= + protected java.util.List _selectedList; + + // ===================================================================================== + // Accessor + // ======== + public java.util.List getSelectedList() { + return _selectedList; + } + + public void setSelectedList(java.util.List selectedList) { + _selectedList = selectedList; + } +} Property changes on: announcement/trunk/src/main/java/jp/sf/pal/announcement/db/allcommon/bhv/batch/TokenFileOutputResult.java ___________________________________________________________________ Name: svn:eol-style + native Added: announcement/trunk/src/main/java/jp/sf/pal/announcement/db/allcommon/bhv/batch/TokenFileReflectionFailure.java =================================================================== --- announcement/trunk/src/main/java/jp/sf/pal/announcement/db/allcommon/bhv/batch/TokenFileReflectionFailure.java (rev 0) +++ announcement/trunk/src/main/java/jp/sf/pal/announcement/db/allcommon/bhv/batch/TokenFileReflectionFailure.java 2008-06-30 02:54:27 UTC (rev 1002) @@ -0,0 +1,87 @@ +package jp.sf.pal.announcement.db.allcommon.bhv.batch; + +import jp.sf.pal.announcement.db.allcommon.Entity; + +/** + * @author DBFlute(AutoGenerator) + */ +public class TokenFileReflectionFailure { + + // ===================================================================================== + // Attribute + // ========= + protected java.util.List _columnNameList; + + protected java.util.List _valueList; + + protected String rowString; + + /** The row number. */ + protected int _rowNumber; + + /** The line number. */ + protected int _lineNumber; + + protected Entity _entity; + + protected Exception _exception; + + // ===================================================================================== + // Accessor + // ======== + public java.util.List getColumnNameList() { + return _columnNameList; + } + + public void setColumnNameList(java.util.List columnNameList) { + this._columnNameList = columnNameList; + } + + public java.util.List getValueList() { + return _valueList; + } + + public void setValueList(java.util.List valueList) { + this._valueList = valueList; + } + + public String getRowString() { + return rowString; + } + + public void setRowString(String rowString) { + this.rowString = rowString; + } + + public int getRowNumber() { + return _rowNumber; + } + + public void setRowNumber(int rowNumber) { + _rowNumber = rowNumber; + } + + public int getLineNumber() { + return _lineNumber; + } + + public void setLineNumber(int lineNumber) { + _lineNumber = lineNumber; + } + + public Entity getEntity() { + return _entity; + } + + public void setEntity(Entity value) { + _entity = value; + } + + public Exception getException() { + return _exception; + } + + public void setException(Exception value) { + _exception = value; + } +} Property changes on: announcement/trunk/src/main/java/jp/sf/pal/announcement/db/allcommon/bhv/batch/TokenFileReflectionFailure.java ___________________________________________________________________ Name: svn:eol-style + native Added: announcement/trunk/src/main/java/jp/sf/pal/announcement/db/allcommon/bhv/batch/TokenFileReflectionOption.java =================================================================== --- announcement/trunk/src/main/java/jp/sf/pal/announcement/db/allcommon/bhv/batch/TokenFileReflectionOption.java (rev 0) +++ announcement/trunk/src/main/java/jp/sf/pal/announcement/db/allcommon/bhv/batch/TokenFileReflectionOption.java 2008-06-30 02:54:27 UTC (rev 1002) @@ -0,0 +1,76 @@ +package jp.sf.pal.announcement.db.allcommon.bhv.batch; + +import jp.sf.pal.announcement.db.allcommon.helper.token.file.FileTokenizingOption; + +/** + * @author DBFlute(AutoGenerator) + */ +public class TokenFileReflectionOption { + + // ===================================================================================== + // Attribute + // ========= + protected boolean _interruptIfError; + + protected FileTokenizingOption _fileTokenizingOption = new FileTokenizingOption(); + + // ===================================================================================== + // Easy-to-Use + // =========== + public TokenFileReflectionOption delimitateByComma() { + _fileTokenizingOption.delimitateByComma(); + return this; + } + + public TokenFileReflectionOption delimitateByTab() { + _fileTokenizingOption.delimitateByTab(); + return this; + } + + public TokenFileReflectionOption encodeAsUTF8() { + _fileTokenizingOption.encodeAsUTF8(); + return this; + } + + public TokenFileReflectionOption encodeAsWindows31J() { + _fileTokenizingOption.encodeAsWindows31J(); + return this; + } + + public TokenFileReflectionOption handleEmptyAsNull() { + _fileTokenizingOption.handleEmptyAsNull(); + return this; + } + + public TokenFileReflectionOption interruptIfError() { + _interruptIfError = true; + return this; + } + + // ===================================================================================== + // Accessor + // ======== + public String getDelimiter() { + return _fileTokenizingOption.getDelimiter(); + } + + public void setDelimiter(String delimiter) { + _fileTokenizingOption.setDelimiter(delimiter); + } + + public String getEncoding() { + return _fileTokenizingOption.getEncoding(); + } + + public void setEncoding(String encoding) { + _fileTokenizingOption.setDelimiter(encoding); + } + + public boolean isHandleEmptyAsNull() { + return _fileTokenizingOption.isHandleEmptyAsNull(); + } + + public boolean isInterruptIfError() { + return _interruptIfError; + } +} Property changes on: announcement/trunk/src/main/java/jp/sf/pal/announcement/db/allcommon/bhv/batch/TokenFileReflectionOption.java ___________________________________________________________________ Name: svn:eol-style + native Added: announcement/trunk/src/main/java/jp/sf/pal/announcement/db/allcommon/bhv/batch/TokenFileReflectionResult.java =================================================================== --- announcement/trunk/src/main/java/jp/sf/pal/announcement/db/allcommon/bhv/batch/TokenFileReflectionResult.java (rev 0) +++ announcement/trunk/src/main/java/jp/sf/pal/announcement/db/allcommon/bhv/batch/TokenFileReflectionResult.java 2008-06-30 02:54:27 UTC (rev 1002) @@ -0,0 +1,51 @@ +package jp.sf.pal.announcement.db.allcommon.bhv.batch; + +/** + * @author DBFlute(AutoGenerator) + */ +public class TokenFileReflectionResult { + + // ===================================================================================== + // Attribute + // ========= + protected java.util.List _columnNameList; + + protected int _successCount; + + protected java.util.List _failureList; + + // ===================================================================================== + // Easy-to-Use + // =========== + public void incrementSuccessCount() { + ++_successCount; + } + + // ===================================================================================== + // Accessor + // ======== + public java.util.List getColumnNameList() { + return _columnNameList; + } + + public void setColumnNameList(java.util.List columnNameList) { + this._columnNameList = columnNameList; + } + + public int getSuccessCount() { + return _successCount; + } + + public void setSuccessCount(int successCount) { + _successCount = successCount; + } + + public java.util.List getFailureList() { + return _failureList; + } + + public void setFailureList( + java.util.List failureList) { + this._failureList = failureList; + } +} Property changes on: announcement/trunk/src/main/java/jp/sf/pal/announcement/db/allcommon/bhv/batch/TokenFileReflectionResult.java ___________________________________________________________________ Name: svn:eol-style + native Added: announcement/trunk/src/main/java/jp/sf/pal/announcement/db/allcommon/bhv/load/LoadRefererOption.java =================================================================== --- announcement/trunk/src/main/java/jp/sf/pal/announcement/db/allcommon/bhv/load/LoadRefererOption.java (rev 0) +++ announcement/trunk/src/main/java/jp/sf/pal/announcement/db/allcommon/bhv/load/LoadRefererOption.java 2008-06-30 02:54:27 UTC (rev 1002) @@ -0,0 +1,74 @@ +package jp.sf.pal.announcement.db.allcommon.bhv.load; + +import jp.sf.pal.announcement.db.allcommon.Entity; +import jp.sf.pal.announcement.db.allcommon.bhv.setup.ConditionBeanSetupper; +import jp.sf.pal.announcement.db.allcommon.bhv.setup.EntityListSetupper; +import jp.sf.pal.announcement.db.allcommon.cbean.ConditionBean; + +/** + * The class of load referrer option. + * + * @param The type of referrer condition-bean. + * @param The type of referrer entity. + * @author DBFlute(AutoGenerator) + */ +public class LoadRefererOption + extends LoadReferrerOption { + + // =================================================================================== + // Constructor + // =========== + public LoadRefererOption() { + } + + public LoadRefererOption( + ConditionBeanSetupper conditionBeanSetupper) { + super(conditionBeanSetupper); + } + + public LoadRefererOption( + ConditionBeanSetupper conditionBeanSetupper, + EntityListSetupper entityListSetupper) { + super(conditionBeanSetupper, entityListSetupper); + } + + public LoadRefererOption( + LoadReferrerOption option) { + super(option); + } + + // =================================================================================== + // Accessor + // ======== + /** + * @return The condition-bean of referrer. + * @deprecated Sorry! This methid have typo! Please use getRefererConditionBean(). + */ + public REFERRER_CONDITION_BEAN getReffererConditionBean() { + return super.getReferrerConditionBean(); + } + + /** + * @param referrerConditionBean The condition-bean of referrer. + * @deprecated Sorry! This methid have typo! Please use setReferrerConditionBean(). + */ + public void setReffererConditionBean( + REFERRER_CONDITION_BEAN referrerConditionBean) { + super.setReferrerConditionBean(referrerConditionBean); + } + + /** + * @return The condition-bean of referrer. + */ + public REFERRER_CONDITION_BEAN getRefererConditionBean() { + return super.getReferrerConditionBean(); + } + + /** + * @param referrerConditionBean The condition-bean of referrer. + */ + public void setRefererConditionBean( + REFERRER_CONDITION_BEAN referrerConditionBean) { + super.setReferrerConditionBean(referrerConditionBean); + } +} Property changes on: announcement/trunk/src/main/java/jp/sf/pal/announcement/db/allcommon/bhv/load/LoadRefererOption.java ___________________________________________________________________ Name: svn:eol-style + native Added: announcement/trunk/src/main/java/jp/sf/pal/announcement/db/allcommon/bhv/load/LoadReferrerOption.java =================================================================== --- announcement/trunk/src/main/java/jp/sf/pal/announcement/db/allcommon/bhv/load/LoadReferrerOption.java (rev 0) +++ announcement/trunk/src/main/java/jp/sf/pal/announcement/db/allcommon/bhv/load/LoadReferrerOption.java 2008-06-30 02:54:27 UTC (rev 1002) @@ -0,0 +1,139 @@ +package jp.sf.pal.announcement.db.allcommon.bhv.load; + +import jp.sf.pal.announcement.db.allcommon.Entity; +import jp.sf.pal.announcement.db.allcommon.bhv.setup.ConditionBeanSetupper; +import jp.sf.pal.announcement.db.allcommon.bhv.setup.EntityListSetupper; +import jp.sf.pal.announcement.db.allcommon.cbean.ConditionBean; + +/** + * The class of load referrer option. + * + * @param The type of referrer condition-bean. + * @param The type of referrer entity. + * @author DBFlute(AutoGenerator) + */ +public class LoadReferrerOption { + + // =================================================================================== + // Attribute + // ========= + protected ConditionBeanSetupper _conditionBeanSetupper; + + protected EntityListSetupper _entityListSetupper; + + protected REFERRER_CONDITION_BEAN _referrerConditionBean; + + protected boolean _toLastKeyCondtion; + + protected boolean _stopOrderByKey; + + // =================================================================================== + // Constructor + // =========== + public LoadReferrerOption() { + } + + public LoadReferrerOption( + ConditionBeanSetupper conditionBeanSetupper) { + this._conditionBeanSetupper = conditionBeanSetupper; + } + + public LoadReferrerOption( + ConditionBeanSetupper conditionBeanSetupper, + EntityListSetupper entityListSetupper) { + this._conditionBeanSetupper = conditionBeanSetupper; + this._entityListSetupper = entityListSetupper; + } + + public LoadReferrerOption( + LoadReferrerOption option) { + this._conditionBeanSetupper = option._conditionBeanSetupper; + this._entityListSetupper = option._entityListSetupper; + this._referrerConditionBean = option._referrerConditionBean; + this._toLastKeyCondtion = option._toLastKeyCondtion; + this._stopOrderByKey = option._stopOrderByKey; + } + + // =================================================================================== + // Easy-to-Use + // =========== + /** + * Specify that the key condition is added as last condition.
    + * This method is valid only after you use reffererConditionBean and add your original condition to it.
    + * + * @return this. (NotNull) + */ + public LoadReferrerOption toLastKeyCondtion() { + _toLastKeyCondtion = true; + return this; + } + + /** + * Specify that it stops adding order-by of the key.
    + * This method is valid only after you use reffererConditionBean and add your original order-by to it.
    + * + * @return this. (NotNull) + */ + public LoadReferrerOption stopOrderByKey() { + _stopOrderByKey = true; + return this; + } + + public void delegateKeyConditionExchangingFirstWhereClauseForLastOne( + REFERRER_CONDITION_BEAN cb) {// Internal + if (!_toLastKeyCondtion) { + cb.getSqlClause().exchangeFirstWhereClauseForLastOne(); + } + } + + public void delegateConditionBeanSettingUp(REFERRER_CONDITION_BEAN cb) {// Internal + if (_conditionBeanSetupper != null) { + _conditionBeanSetupper.setup(cb); + } + } + + public void delegateEntitySettingUp( + java.util.List entityList) {// Internal + if (_entityListSetupper != null) { + _entityListSetupper.setup(entityList); + } + } + + // =================================================================================== + // Accessor + // ======== + public ConditionBeanSetupper getConditionBeanSetupper() { + return _conditionBeanSetupper; + } + + public void setConditionBeanSetupper( + ConditionBeanSetupper conditionBeanSetupper) { + this._conditionBeanSetupper = conditionBeanSetupper; + } + + public EntityListSetupper getEntityListSetupper() { + return _entityListSetupper; + } + + public void setEntityListSetupper( + EntityListSetupper entityListSetupper) { + this._entityListSetupper = entityListSetupper; + } + + public REFERRER_CONDITION_BEAN getReferrerConditionBean() { + return _referrerConditionBean; + } + + public void setReferrerConditionBean( + REFERRER_CONDITION_BEAN referrerConditionBean) { + this._referrerConditionBean = referrerConditionBean; + } + + public boolean isToLastKeyCondtion() { + return _toLastKeyCondtion; + } + + public boolean isStopOrderByKey() { + return _stopOrderByKey; + } +} Property changes on: announcement/trunk/src/main/java/jp/sf/pal/announcement/db/allcommon/bhv/load/LoadReferrerOption.java ___________________________________________________________________ Name: svn:eol-style + native Added: announcement/trunk/src/main/java/jp/sf/pal/announcement/db/allcommon/bhv/setup/ConditionBeanSetupper.java =================================================================== --- announcement/trunk/src/main/java/jp/sf/pal/announcement/db/allcommon/bhv/setup/ConditionBeanSetupper.java (rev 0) +++ announcement/trunk/src/main/java/jp/sf/pal/announcement/db/allcommon/bhv/setup/ConditionBeanSetupper.java 2008-06-30 02:54:27 UTC (rev 1002) @@ -0,0 +1,19 @@ +package jp.sf.pal.announcement.db.allcommon.bhv.setup; + +import jp.sf.pal.announcement.db.allcommon.cbean.ConditionBean; + +/** + * The interface of condition-bean setupper. + * + * @param The type of condition-bean. + * @author DBFlute(AutoGenerator) + */ +public interface ConditionBeanSetupper { + + /** + * Set up condition. + * + * @param cb Condition-bean. (NotNull) + */ + public void setup(CONDITION_BEAN cb); +} Property changes on: announcement/trunk/src/main/java/jp/sf/pal/announcement/db/allcommon/bhv/setup/ConditionBeanSetupper.java ___________________________________________________________________ Name: svn:eol-style + native Added: announcement/trunk/src/main/java/jp/sf/pal/announcement/db/allcommon/bhv/setup/EntityListSetupper.java =================================================================== --- announcement/trunk/src/main/java/jp/sf/pal/announcement/db/allcommon/bhv/setup/EntityListSetupper.java (rev 0) +++ announcement/trunk/src/main/java/jp/sf/pal/announcement/db/allcommon/bhv/setup/EntityListSetupper.java 2008-06-30 02:54:27 UTC (rev 1002) @@ -0,0 +1,19 @@ +package jp.sf.pal.announcement.db.allcommon.bhv.setup; + +import jp.sf.pal.announcement.db.allcommon.Entity; + +/** + * The interface of entity list setupper. + * + * @param The type of entity. + * @author DBFlute(AutoGenerator) + */ +public interface EntityListSetupper { + + /** + * Set up entity list. + * + * @param entityList Entity list. (NotNull) + */ + public void setup(java.util.List entityList); +} Property changes on: announcement/trunk/src/main/java/jp/sf/pal/announcement/db/allcommon/bhv/setup/EntityListSetupper.java ___________________________________________________________________ Name: svn:eol-style + native Added: announcement/trunk/src/main/java/jp/sf/pal/announcement/db/allcommon/bhv/setup/ValueLabelBox.java =================================================================== --- announcement/trunk/src/main/java/jp/sf/pal/announcement/db/allcommon/bhv/setup/ValueLabelBox.java (rev 0) +++ announcement/trunk/src/main/java/jp/sf/pal/announcement/db/allcommon/bhv/setup/ValueLabelBox.java 2008-06-30 02:54:27 UTC (rev 1002) @@ -0,0 +1,25 @@ +package jp.sf.pal.announcement.db.allcommon.bhv.setup; + +/** + * The class of Value-Label Box. + * @author DBFlute(AutoGenerator) + */ +public class ValueLabelBox { + + protected Object _value; + + protected String _label; + + public void setValueLabel(Object value, String label) { + this._value = value; + this._label = label; + } + + public Object getValue() { + return _value; + } + + public String getLabel() { + return _label; + } +} Property changes on: announcement/trunk/src/main/java/jp/sf/pal/announcement/db/allcommon/bhv/setup/ValueLabelBox.java ___________________________________________________________________ Name: svn:eol-style + native Added: announcement/trunk/src/main/java/jp/sf/pal/announcement/db/allcommon/bhv/setup/ValueLabelSetupper.java =================================================================== --- announcement/trunk/src/main/java/jp/sf/pal/announcement/db/allcommon/bhv/setup/ValueLabelSetupper.java (rev 0) +++ announcement/trunk/src/main/java/jp/sf/pal/announcement/db/allcommon/bhv/setup/ValueLabelSetupper.java 2008-06-30 02:54:27 UTC (rev 1002) @@ -0,0 +1,18 @@ +package jp.sf.pal.announcement.db.allcommon.bhv.setup; + +import jp.sf.pal.announcement.db.allcommon.Entity; + +/** + * The interface of Value-Label Setupper. + * @param The type of entity. + * @author DBFlute(AutoGenerator) + */ +public interface ValueLabelSetupper { + + /** + * Set up value-label. + * @param box Value-label box. (NotNull) + * @param entity Entity. (NotNull) + */ + public void setup(ValueLabelBox box, ENTITY entity); +} Property changes on: announcement/trunk/src/main/java/jp/sf/pal/announcement/db/allcommon/bhv/setup/ValueLabelSetupper.java ___________________________________________________________________ Name: svn:eol-style + native Added: announcement/trunk/src/main/java/jp/sf/pal/announcement/db/allcommon/cbean/AbstractConditionBean.java =================================================================== --- announcement/trunk/src/main/java/jp/sf/pal/announcement/db/allcommon/cbean/AbstractConditionBean.java (rev 0) +++ announcement/trunk/src/main/java/jp/sf/pal/announcement/db/allcommon/cbean/AbstractConditionBean.java 2008-06-30 02:54:27 UTC (rev 1002) @@ -0,0 +1,626 @@ +package jp.sf.pal.announcement.db.allcommon.cbean; + +import jp.sf.pal.announcement.db.allcommon.cbean.sqlclause.OrderByClause; +import jp.sf.pal.announcement.db.allcommon.cbean.sqlclause.SqlClause; +import jp.sf.pal.announcement.db.allcommon.cbean.sqlclause.WhereClauseSimpleFilter; +import jp.sf.pal.announcement.db.allcommon.helper.MapListString; +import jp.sf.pal.announcement.db.allcommon.helper.MapListStringImpl; +import jp.sf.pal.announcement.db.allcommon.jdbc.StatementConfig; +import jp.sf.pal.announcement.db.allcommon.util.SimpleSystemUtil; + +/** + * The condition-bean as abstract. + * + * @author DBFlute(AutoGenerator) + */ +public abstract class AbstractConditionBean implements ConditionBean { + + // =================================================================================== + // Attribute + // ========= + /** SQL clause instance. */ + protected final SqlClause _sqlClause; + { + _sqlClause = ConditionBeanContext.createSqlClause(this); + } + + /** Safety max result size. */ + protected int _safetyMaxResultSize; + + /** The config of statement. (Nullable) */ + protected StatementConfig _statementConfig; + + // =================================================================================== + // SqlClause + // ========= + /** + * The implementation. + * + * @return Sql clause. (NotNull) + */ + public SqlClause getSqlClause() { + return _sqlClause; + } + + // =================================================================================== + // Where Clause Filter + // =================== + public void addWhereClauseSimpleFilter( + WhereClauseSimpleFilter whereClauseSimpleFilter) { + this._sqlClause.addWhereClauseSimpleFilter(whereClauseSimpleFilter); + } + + // =================================================================================== + // ConditionQuery + // ============== + /** + * Get condition query as interface. At the future, change public to protected. + * + * @return Instance of query as interface. (NotNull) + */ + abstract public ConditionQuery getConditionQueryAsInterface(); + + /** + * The implementation. + * + * @return The conditionQuery of the local table as interface. (NotNull) + */ + public ConditionQuery localCQ() { + return getConditionQueryAsInterface(); + } + + // =================================================================================== + // Accept PrimaryKey + // ================= + /** + * The implementation. + * + * @param primaryKeyMapString Primary-key map. (NotNull and NotEmpty) + */ + public void acceptPrimaryKeyMapString(String primaryKeyMapString) { + if (primaryKeyMapString == null) { + String msg = "The argument[primaryKeyMapString] must not be null."; + throw new IllegalArgumentException(msg); + } + final String prefix = MAP_STRING_MAP_MARK + MAP_STRING_START_BRACE; + final String suffix = MAP_STRING_END_BRACE; + if (!primaryKeyMapString.trim().startsWith(prefix)) { + primaryKeyMapString = prefix + primaryKeyMapString; + } + if (!primaryKeyMapString.trim().endsWith(suffix)) { + primaryKeyMapString = primaryKeyMapString + suffix; + } + MapListString mapListString = new MapListStringImpl(); + mapListString.setMapMark(MAP_STRING_MAP_MARK); + mapListString.setListMark(MAP_STRING_LIST_MARK); + mapListString.setDelimiter(MAP_STRING_DELIMITER); + mapListString.setStartBrace(MAP_STRING_START_BRACE); + mapListString.setEndBrace(MAP_STRING_END_BRACE); + mapListString.setEqual(MAP_STRING_EQUAL); + acceptPrimaryKeyMap(mapListString.generateMap(primaryKeyMapString)); + } + + protected void checkTypeString(Object value, String propertyName, + String typeName) { + if (value == null) { + throw new IllegalArgumentException("The value should not be null: " + + propertyName); + } + if (!(value instanceof String)) { + String msg = "The value of " + propertyName + " should be " + + typeName + " or String: "; + msg = msg + "valueType=" + value.getClass() + " value=" + value; + throw new IllegalArgumentException(msg); + } + } + + protected long parseDateStringAsMillis(Object value, String propertyName, + String typeName) { + checkTypeString(value, propertyName, typeName); + try { + final String valueString = (String) value; + if (valueString.indexOf("-") >= 0 + && valueString.indexOf("-") != valueString.lastIndexOf("-")) { + return java.sql.Timestamp.valueOf(valueString).getTime(); + } else { + return getParseDateFormat().parse((String) value).getTime(); + } + } catch (java.text.ParseException e) { + String msg = "The value of " + propertyName + " should be " + + typeName + ". but: " + value; + throw new RuntimeException(msg + " threw the exception: value=[" + + value + "]", e); + } catch (RuntimeException e) { + String msg = "The value of " + propertyName + " should be " + + typeName + ". but: " + value; + throw new RuntimeException(msg + " threw the exception: value=[" + + value + "]", e); + } + } + + private java.text.DateFormat getParseDateFormat() { + return java.text.DateFormat.getDateTimeInstance(); + } + + // =================================================================================== + // Implementation of PagingBean + // ============================ + // ----------------------------------------------------- + // Paging Determination + // -------------------- + // * * * * * * * * + // For SQL Comment + // * * * * * * * * + /** + * The implementation. + * @return Determination. + */ + public boolean isPaging() { + String msg = "This method is unsupported on ConditionBean!"; + throw new UnsupportedOperationException(msg); + } + + /** + * The implementation. + * @param paging Determination. + */ + public void xsetPaging(boolean paging) { + String msg = "This method is unsupported on ConditionBean!"; + throw new UnsupportedOperationException(msg); + } + + // ----------------------------------------------------- + // Fetch Setting + // ------------- + /** + * The implementation. + * @param fetchSize Fetch-size. (NotMinus & NotZero) + * @return this. (NotNUll) + */ + public PagingBean fetchFirst(int fetchSize) { + getSqlClause().fetchFirst(fetchSize); + return this; + } + + /** + * The implementation. + * @param fetchStartIndex Fetch-start-index. 0 origin. (NotMinus) + * @param fetchSize Fetch-size. (NotMinus & NotZero) + * @return this. (NotNUll) + */ + public PagingBean fetchScope(int fetchStartIndex, int fetchSize) { + getSqlClause().fetchScope(fetchStartIndex, fetchSize); + return this; + } + + /** + * The implementation. + * @param fetchPageNumber Fetch-page-number. 1 origin. (NotMinus & NotZero: If minus or zero, set one.) + * @return this. (NotNull) + */ + public PagingBean fetchPage(int fetchPageNumber) { + getSqlClause().fetchPage(fetchPageNumber); + return this; + } + + // ----------------------------------------------------- + // Fetch Property + // -------------- + /** + * The implementation. + * @return Fetch-start-index. + */ + public int getFetchStartIndex() { + return getSqlClause().getFetchStartIndex(); + } + + /** + * The implementation. + * @return Fetch-size. + */ + public int getFetchSize() { + return getSqlClause().getFetchSize(); + } + + /** + * The implementation. + * @return Fetch-page-number. + */ + public int getFetchPageNumber() { + return getSqlClause().getFetchPageNumber(); + } + + /** + * The implementation. + * @return Page start index. 0 origin. (NotMinus) + */ + public int getPageStartIndex() { + return getSqlClause().getPageStartIndex(); + } + + /** + * The implementation. + * @return Page end index. 0 origin. (NotMinus) + */ + public int getPageEndIndex() { + return getSqlClause().getPageEndIndex(); + } + + /** + * Is fetch scope effective? + * @return Determiantion. + */ + public boolean isFetchScopeEffective() { + return getSqlClause().isFetchScopeEffective(); + } + + // ----------------------------------------------------- + // Hint Property + // ------------- + /** + * Get select-hint. {select [select-hint] * from table...} + * @return select-hint. (NotNull) + */ + public String getSelectHint() { + return getSqlClause().getSelectHint(); + } + + /** + * Get from-base-table-hint. {select * from table [from-base-table-hint] where ...} + * @return from-base-table-hint. (NotNull) + */ + public String getFromBaseTableHint() { + return getSqlClause().getFromBaseTableHint(); + } + + /** + * Get from-hint. {select * from table left outer join ... on ... [from-hint] where ...} + * @return from-hint. (NotNull) + */ + public String getFromHint() { + return getSqlClause().getFromHint(); + } + + /** + * Get where clause. + * @return Where clause. (NotNull) + */ + public String getWhereClause() { + return getSqlClause().getWhereClause(); + } + + /** + * Get sql-suffix. {select * from table where ... order by ... [sql-suffix]} + * @return Sql-suffix. (NotNull) + */ + public String getSqlSuffix() { + return getSqlClause().getSqlSuffix(); + } + + // =================================================================================== + // Implementation of FetchNarrowingBean + // ==================================== + /** + * The implementation. + * @return Fetch start index. + */ + public int getFetchNarrowingSkipStartIndex() { + return getSqlClause().getFetchNarrowingSkipStartIndex(); + } + + /** + * The implementation. + * @return Fetch size. + */ + public int getFetchNarrowingLoopCount() { + return getSqlClause().getFetchNarrowingLoopCount(); + } + + /** + * The implementation. + * @return Determination. + */ + public boolean isFetchNarrowingSkipStartIndexEffective() { + return !getSqlClause().isFetchStartIndexSupported(); + } + + /** + * The implementation. + * @return Determination. + */ + public boolean isFetchNarrowingLoopCountEffective() { + return !getSqlClause().isFetchSizeSupported(); + } + + /** + * The implementation. + * @return Determiantion. + */ + public boolean isFetchNarrowingEffective() { + return getSqlClause().isFetchNarrowingEffective(); + } + + /** + * Ignore fetch narrowing. Only checking safety result size is valid. {INTERNAL METHOD} + */ + public void ignoreFetchNarrowing() { + String msg = "This method is unsupported on ConditionBean!"; + throw new UnsupportedOperationException(msg); + } + + /** + * Restore ignored fetch narrowing. {INTERNAL METHOD} + */ + public void restoreIgnoredFetchNarrowing() { + // Do nothing! + } + + /** + * Get safety max result size. + * @return Safety max result size. + */ + public int getSafetyMaxResultSize() { + return _safetyMaxResultSize; + } + + /** + * Check safety result. + * @param safetyMaxResultSize Safety max result size. (If zero or minus, ignore checking) + */ + public void checkSafetyResult(int safetyMaxResultSize) { + this._safetyMaxResultSize = safetyMaxResultSize; + } + + // =================================================================================== + // Implementation of OrderByBean + // ============================= + /** + * The implementation. + * @return Sql component of order-by clause. (NotNull) + */ + public OrderByClause getSqlComponentOfOrderByClause() { + return getSqlClause().getSqlComponentOfOrderByClause(); + } + + /** + * The implementation. + * @return Order-by clause. (NotNull) + */ + public String getOrderByClause() { + return _sqlClause.getOrderByClause(); + } + + /** + * The implementation. + * @return this. (NotNull) + */ + public OrderByBean clearOrderBy() { + getSqlClause().clearOrderBy(); + return this; + } + + /** + * The implementation. + * @return this. (NotNull) + */ + public OrderByBean ignoreOrderBy() { + getSqlClause().ignoreOrderBy(); + return this; + } + + /** + * The implementation. + * @return this. (NotNull) + */ + public OrderByBean makeOrderByEffective() { + getSqlClause().makeOrderByEffective(); + return this; + } + + // =================================================================================== + // Limit Select + // ============ + /** Is limit-select PK only? */ + protected boolean _isLimitSelectPKOnly; + + /** + * Is limit-select PK only? + * @return Determination. + */ + public boolean isLimitSelect_PKOnly() { + return _isLimitSelectPKOnly; + } + + /** + * Limit select PK only. + * @return this. (NotNull) + */ + public ConditionBean limitSelect_PKOnly() { + _isLimitSelectPKOnly = true; + return this; + } + + /** + * Limit select off. + * @return this. (NotNull) + */ + public ConditionBean limitSelect_Off() { + _isLimitSelectPKOnly = false; + return this; + } + + // =================================================================================== + // Lock Setting + // ============ + /** + * The implementation. + * @return this. (NotNull) + */ + public ConditionBean lockForUpdate() { + getSqlClause().lockForUpdate(); + return this; + } + + // =================================================================================== + // Select Count + // ============ + /** + * Set up various things for select-count-ignore-fetch-scope. {Internal} + * This method is for INTERNAL. Don't invoke this! + * @return this. (NotNull) + */ + public ConditionBean xsetupSelectCountIgnoreFetchScope() { + _isSelectCountIgnoreFetchScope = true; + + // If the query uses union query, it needs included-select-column. + if (!hasUnionQueryOrUnionAllQuery()) { + getSqlClause().ignoreIncludedSelectColumn(); + } + + getSqlClause().ignoreOrderBy(); + getSqlClause().ignoreFetchScope(); + return this; + } + + /** + * Do after-care for select-count-ignore-fetch-scope. {Internal} + * This method is for INTERNAL. Don't invoke this! + * @return this. (NotNull) + */ + public ConditionBean xafterCareSelectCountIgnoreFetchScope() { + _isSelectCountIgnoreFetchScope = false; + + // If the query uses union query, it needs included-select-column. + if (!hasUnionQueryOrUnionAllQuery()) { + getSqlClause().makeIncludedSelectColumnEffective(); + } + + getSqlClause().makeOrderByEffective(); + getSqlClause().makeFetchScopeEffective(); + return this; + } + + /** Is set up various things for select-count-ignore-fetch-scope? */ + protected boolean _isSelectCountIgnoreFetchScope; + + /** + * Is set up various things for select-count-ignore-fetch-scope? + * This method is for INTERNAL. Don't invoke this! + * @return Determination. + */ + public boolean isSelectCountIgnoreFetchScope() { + return _isSelectCountIgnoreFetchScope; + } + + // ===================================================================================== + // Statement Config + // ================ + /** + * @param statementConfig The config of statement. (Nullable) + */ + public void configure(StatementConfig statementConfig) { + _statementConfig = statementConfig; + } + + /** + * @return The config of statement. (Nullable) + */ + public StatementConfig getStatementConfig() { + return _statementConfig; + } + + // =================================================================================== + // Format SQL + // ========== + public void formatSql() { + getSqlClause().makeFormatClauseEffective(); + } + + public boolean isFormatSql() { + return getSqlClause().isFormatClauseEffective(); + } + + // =================================================================================== + // Assert Helper + // ============= + protected void assertSetupSelectBeforeUnion(String methodName) { + if (hasUnionQueryOrUnionAllQuery()) { + throwSetupSelectAfterUnionException( + this.getClass().getSimpleName(), methodName); + } + } + + protected void throwSetupSelectAfterUnionException(String className, + String methodName) { + String msg = "Look! Read the message below." + getLineSeparator(); + msg = msg + + "/* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * *" + + getLineSeparator(); + msg = msg + "You should NOT call " + methodName + + " after calling union()!" + getLineSeparator(); + msg = msg + getLineSeparator(); + msg = msg + "[Advice]" + getLineSeparator(); + msg = msg + methodName + " should be called before calling union()." + + getLineSeparator(); + msg = msg + " For example:" + getLineSeparator(); + msg = msg + " /- - - - - - - - - - - - - - - - - - - - " + + getLineSeparator(); + msg = msg + " " + className + " cb = new " + className + "();" + + getLineSeparator(); + msg = msg + " cb." + methodName + "; // You shuold call here!" + + getLineSeparator(); + msg = msg + " cb.query().setXxx...;" + getLineSeparator(); + msg = msg + " {" + getLineSeparator(); + msg = msg + " " + className + " unionCB = new " + className + + "();" + getLineSeparator(); + msg = msg + " unionCB.query().setXxx;" + getLineSeparator(); + msg = msg + " cb.union(unionCB);" + getLineSeparator(); + msg = msg + " }" + getLineSeparator(); + msg = msg + + " // You should not call setupSelect after calling union()!" + + getLineSeparator(); + msg = msg + " // cb." + methodName + ";" + getLineSeparator(); + msg = msg + " - - - - - - - - - -/" + getLineSeparator(); + msg = msg + getLineSeparator(); + msg = msg + "[SetupSelect Method]" + getLineSeparator() + methodName + + getLineSeparator(); + msg = msg + getLineSeparator(); + msg = msg + "[ConditionBean SQL]" + getLineSeparator() + toDisplaySql() + + getLineSeparator(); + msg = msg + "* * * * * * * * * */" + getLineSeparator(); + throw new IllegalStateException(msg); + } + + // =================================================================================== + // General Helper + // ============== + protected String getLineSeparator() { + return SimpleSystemUtil.getLineSeparator(); + } + + // =================================================================================== + // Display SQL + // =========== + /** + * Convert this conditionBean to SQL for display. + * @return SQL for display. (NotNull and NotEmpty) + */ + public String toDisplaySql() { + return ConditionBeanContext.convertConditionBean2DisplaySql(this); + } + + // =================================================================================== + // Basic Override + // ============== + /** + * The override. + * @return SQL for display. (NotNull) + */ + public String toString() { + try { + return toDisplaySql(); + } catch (RuntimeException e) { + return getSqlClause().getClause(); + } + } +} Property changes on: announcement/trunk/src/main/java/jp/sf/pal/announcement/db/allcommon/cbean/AbstractConditionBean.java ___________________________________________________________________ Name: svn:eol-style + native Added: announcement/trunk/src/main/java/jp/sf/pal/announcement/db/allcommon/cbean/AbstractConditionQuery.java =================================================================== --- announcement/trunk/src/main/java/jp/sf/pal/announcement/db/allcommon/cbean/AbstractConditionQuery.java (rev 0) +++ announcement/trunk/src/main/java/jp/sf/pal/announcement/db/allcommon/cbean/AbstractConditionQuery.java 2008-06-30 02:54:27 UTC (rev 1002) @@ -0,0 +1,1152 @@ +package jp.sf.pal.announcement.db.allcommon.cbean; + +import java.util.ArrayList; +import java.util.Collection; +import java.util.Iterator; +import java.util.LinkedHashMap; +import java.util.List; +import java.util.Map; + +import jp.sf.pal.announcement.db.allcommon.cbean.ckey.ConditionKey; +import jp.sf.pal.announcement.db.allcommon.cbean.coption.ConditionOption; +import jp.sf.pal.announcement.db.allcommon.cbean.coption.FromToOption; +import jp.sf.pal.announcement.db.allcommon.cbean.coption.InScopeOption; +import jp.sf.pal.announcement.db.allcommon.cbean.coption.LikeSearchOption; +import jp.sf.pal.announcement.db.allcommon.cbean.cvalue.ConditionValue; +import jp.sf.pal.announcement.db.allcommon.cbean.sqlclause.SqlClause; +import jp.sf.pal.announcement.db.allcommon.dbmeta.DBMeta; +import jp.sf.pal.announcement.db.allcommon.dbmeta.DBMetaInstanceHandler; +import jp.sf.pal.announcement.db.allcommon.exception.RequiredOptionNotFoundException; +import jp.sf.pal.announcement.db.allcommon.util.SimpleStringUtil; +import jp.sf.pal.announcement.db.allcommon.util.SimpleSystemUtil; + +/** + * The abstract class of condition-query. + * @author DBFlute(AutoGenerator) + */ +public abstract class AbstractConditionQuery implements ConditionQuery { + + // =================================================================================== + // Attribute + // ========= + /** Condition value for DUMMY. */ + protected static final ConditionValue DUMMY_CONDITION_VALUE = new ConditionValue(); + + /** Object for DUMMY. */ + protected static final Object DUMMY_OBJECT = new Object(); + + /** The property of condition-query. */ + protected static final String CQ_PROPERTY = "conditionQuery"; + + /** SQL clause. */ + protected final SqlClause _sqlClause; + + /** My alias name. */ + protected final String _aliasName; + + /** The level of nest. */ + protected final int _nestLevel; + + /** The level of subQuery. */ + protected int _subQueryLevel; + + // ----------------------------------------------------- + // Foreign Info + // ------------ + /** The property name of foreign. */ + protected String _foreignPropertyName; + + /** The path of relation. */ + protected String _relationPath; + + /** The query of child. */ + protected final ConditionQuery _childQuery; + + // ----------------------------------------------------- + // Inline + // ------ + /** Is it the inline for on-clause. (Property for Inline Only) */ + protected boolean _onClauseInline; + + // =================================================================================== + // Constructor + // =========== + /** + * Constructor. + * @param childQuery Child query. (Nullable: If null, this is base instance.) + * @param sqlClause SQL clause instance. (NotNull) + * @param aliasName My alias name. (NotNull) + * @param nestLevel Nest level. + */ + public AbstractConditionQuery(ConditionQuery childQuery, + SqlClause sqlClause, String aliasName, int nestLevel) { + _childQuery = childQuery; + _sqlClause = sqlClause; + _aliasName = aliasName; + _nestLevel = nestLevel; + } + + // =================================================================================== + // Important Accessor + // ================== + /** + * Get child query. + * @return Child query. (Nullable) + */ + public ConditionQuery getChildQuery() { + return _childQuery; + } + + /** + * Get sql clause. + * @return Sql clause. (NotNull) + */ + public SqlClause getSqlClause() { + return _sqlClause; + } + + /** + * Get alias name. + * @return Alias name. (NotNull) + */ + public String getAliasName() { + return _aliasName; + } + + /** + * Get nest level. + * @return Nest level. + */ + public int getNestLevel() { + return _nestLevel; + } + + /** + * Get next nest level. + * @return Next nest level. + */ + public int getNextNestLevel() { + return _nestLevel + 1; + } + + /** + * Is base query? + * @param query Condition query. (NotNull) + * @return Determination. + */ + public boolean isBaseQuery(ConditionQuery query) { + return (query.getChildQuery() == null); + } + + /** + * Get the level of subQuery. + * @return The level of subQuery. + */ + public int getSubQueryLevel() { + return _subQueryLevel; + } + + // ----------------------------------------------------- + // Real Name + // --------- + /** + * Get real alias name(that has nest level mark). + * @return Real alias name. + */ + public String getRealAliasName() { + return getAliasName(); + } + + /** + * Get real column name(with real alias name). + * @param columnName Column name without alias name. This should not contain comma. (NotNull) + * @return Real column name. + */ + public String getRealColumnName(String columnName) { + assertColumnName(columnName); + return buildRealColumnName(getRealAliasName(), columnName); + } + + /** + * Build real column name. + * @param aliasName Alias name. (NotNull) + * @param columnName Column name. (NotNull) + * @return Real column name. (NotNull) + */ + protected String buildRealColumnName(String aliasName, String columnName) { + return aliasName + "." + columnName; + } + + // ----------------------------------------------------- + // Foreign Info + // ------------ + public String getForeignPropertyName() { + return _foreignPropertyName; + } + + public void xsetForeignPropertyName(String foreignPropertyName) { + this._foreignPropertyName = foreignPropertyName; + } + + public String getRelationPath() { + return _relationPath; + } + + public void xsetRelationPath(String relationPath) { + this._relationPath = relationPath; + } + + // ----------------------------------------------------- + // Inline + // ------ + public void xsetOnClauseInline(boolean onClauseInline) { + _onClauseInline = onClauseInline; + } + + // =================================================================================== + // Location + // ======== + /** + * Get location. + * @param columnPropertyName Column property name. + * @param key Condition key. + * @return Next nest level. + */ + protected String getLocation(String columnPropertyName, ConditionKey key) { + return getLocationBase(columnPropertyName) + "." + + key.getConditionKey(); + } + + protected String getLocationBase() { + final StringBuffer sb = new StringBuffer(); + ConditionQuery query = this; + while (true) { + if (query.isBaseQuery(query)) { + sb.insert(0, CQ_PROPERTY + "."); + break; + } else { + final String foreignPropertyName = query + .getForeignPropertyName(); + if (foreignPropertyName == null) { + String msg = "The foreignPropertyName of the query should not be null:"; + msg = msg + " query=" + query; + throw new IllegalStateException(msg); + } + sb.insert(0, CQ_PROPERTY + initCap(foreignPropertyName) + "."); + } + query = query.getChildQuery(); + } + return sb.toString(); + } + + protected String getLocationBase(String columnPropertyName) { + return getLocationBase() + columnPropertyName; + } + + // =================================================================================== + // Union Query + // =========== + /** The map of union query. */ + protected Map _unionQueryMap; + + /** + * Get the map of union query. + * + * @return The map of union query. (NotNull) + */ + public Map getUnionQueryMap() {// for Internal + if (_unionQueryMap == null) { + _unionQueryMap = new LinkedHashMap(); + } + return _unionQueryMap; + } + + /** + * Set union query. {Internal} + *
    +     * Add union query to condition bean.
    +     * 
    + * @param unionQuery Union query. (NotNull) + */ + public void xsetUnionQuery(ConditionQuery unionQuery) { + xsetupUnion(unionQuery, false, getUnionQueryMap()); + } + + /** The map of union all query. */ + protected Map _unionAllQueryMap; + + /** + * Get the map of union all query. + * + * @return The map of union all query. (NotNull) + */ + public Map getUnionAllQueryMap() {// for Internal + if (_unionAllQueryMap == null) { + _unionAllQueryMap = new LinkedHashMap(); + } + return _unionAllQueryMap; + } + + /** + * Set union all query. {Internal} + *
    +     * Add union all query to condition bean.
    +     * 
    + * @param unionAllQuery Union all query. (NotNull) + */ + public void xsetUnionAllQuery(ConditionQuery unionAllQuery) { + xsetupUnion(unionAllQuery, true, getUnionAllQueryMap()); + } + + protected void xsetupUnion(ConditionQuery unionQuery, boolean unionAll, + Map unionQueryMap) { + if (unionQuery == null) { + String msg = "The argument[unionQuery] should not be null."; + throw new IllegalArgumentException(msg); + } + reflectRelationOnUnionQuery(this, unionQuery);// Reflect Relation! + getSqlClause().copyIncludedSelectColumn(unionQuery.getSqlClause());// Reflect IncludedSelectColumn! + if (getSqlClause().isFormatClauseEffective()) { + unionQuery.getSqlClause().makeFormatClauseEffective();// Reflect FormatClause! + } + final String key = (unionAll ? "unionAllQuery" : "unionQuery") + + unionQueryMap.size(); + unionQueryMap.put(key, unionQuery); + registerUnionQuery(unionQuery, unionAll, (unionAll ? "unionAllQueryMap" + : "unionQueryMap") + + "." + key); + } + + /** + * Reflect relation on union query. + * + * @param baseQueryAsSuper Base query as super. (NotNull) + * @param unionQueryAsSuper Union query as super. (NotNull) + */ + abstract protected void reflectRelationOnUnionQuery( + ConditionQuery baseQueryAsSuper, ConditionQuery unionQueryAsSuper); + + /** + * Has union query or union all query? + * + * @return Determination. + */ + public boolean hasUnionQueryOrUnionAllQuery() { + return (_unionQueryMap != null && !_unionQueryMap.isEmpty()) + || (_unionAllQueryMap != null && !_unionAllQueryMap.isEmpty()); + } + + /** + * Get the list of union query. + * + * @return The list of union query. (NotNull) + */ + public List getUnionQueryList() { + if (_unionQueryMap == null) { + return new ArrayList(); + } + return new ArrayList(_unionQueryMap.values()); + } + + /** + * Get the list of union all query. + * + * @return The list of union all query. (NotNull) + */ + public List getUnionAllQueryList() { + if (_unionAllQueryMap == null) { + return new ArrayList(); + } + return new ArrayList(_unionAllQueryMap.values()); + } + + // =================================================================================== + // Register + // ======== + // ----------------------------------------------------- + // Include-As-Mine + // --------------- + /** + * Register included-select-column. + * + * @param aliasName Alias name. This should not contain comma. (NotNull) + * @param realColumnName Real column name. This should not contain comma. (NotNull) + */ + protected void registerIncludedSelectColumn(String aliasName, + String realColumnName) { + assertAliasName(aliasName); + assertColumnName(realColumnName); + getSqlClause().registerIncludedSelectColumn(aliasName, realColumnName); + } + + // ----------------------------------------------------- + // Query + // ----- + protected void registerQuery(ConditionKey key, Object value, + ConditionValue cvalue, String colName, String capPropName, + String uncapPropName) { + if (key.isValidRegistration(cvalue, value, key.getConditionKey() + + " of " + getRealAliasName() + "." + colName)) { + setupConditionValueAndRegisterWhereClause(key, value, cvalue, + colName, capPropName, uncapPropName); + } + } + + protected void registerQuery(ConditionKey key, Object value, + ConditionValue cvalue, String colName, String capPropName, + String uncapPropName, ConditionOption option) { + if (key.isValidRegistration(cvalue, value, key.getConditionKey() + + " of " + getRealAliasName() + "." + colName)) { + setupConditionValueAndRegisterWhereClause(key, value, cvalue, + colName, capPropName, uncapPropName, option); + } + } + + // ----------------------------------------------------- + // FromTo Query + // ------------ + protected void registerFromToQuery(java.util.Date fromDate, + java.util.Date toDate, ConditionValue cvalue, String colName, + String capPropName, String uncapPropName, FromToOption option) { + { + final java.util.Date filteredFromDate = option + .filterFromDate(fromDate); + final ConditionKey fromKey = option.getFromDateConditionKey(); + if (fromKey.isValidRegistration(cvalue, filteredFromDate, fromKey + .getConditionKey() + + " of " + getRealAliasName() + "." + uncapPropName)) { + setupConditionValueAndRegisterWhereClause(fromKey, + filteredFromDate, cvalue, colName, capPropName, + uncapPropName); + } + } + { + final java.util.Date filteredToDate = option.filterToDate(toDate); + final ConditionKey toKey = option.getToDateConditionKey(); + if (toKey.isValidRegistration(cvalue, filteredToDate, toKey + .getConditionKey() + + " of " + getRealAliasName() + "." + uncapPropName)) { + setupConditionValueAndRegisterWhereClause(toKey, + filteredToDate, cvalue, colName, capPropName, + uncapPropName); + } + } + } + + // ----------------------------------------------------- + // LikeSearch Query + // ---------------- + protected void registerLikeSearchQuery(ConditionKey key, String value, + ConditionValue cvalue, String colName, String capPropName, + String uncapPropName, LikeSearchOption option) { + final String validationMsg = key.getConditionKey() + " of " + + getRealAliasName() + "." + colName; + if (!key.isValidRegistration(cvalue, value, validationMsg)) { + return; + } + if (option == null) { + throwLikeSearchOptionNotFoundException(capPropName, value); + return;// Unreachable! + } + if (value == null || !option.isSplit()) { + // As Normal Condition. + setupConditionValueAndRegisterWhereClause(key, value, cvalue, + colName, capPropName, uncapPropName, option); + return; + } + // - - - - - - - - - + // Use splitByXxx(). + // - - - - - - - - - + final String[] strArray = option.generateSplitValueArray(value); + if (!option.isAsOrSplit()) { + // As 'and' Condition + for (int i = 0; i < strArray.length; i++) { + final String currentValue = strArray[i]; + setupConditionValueAndRegisterWhereClause(key, currentValue, + cvalue, colName, capPropName, uncapPropName, option); + + // Callback for LikeAsOr! + final List callbackList = option + .getLikeAsOrCallbackList(); + if (!callbackList.isEmpty()) { + getSqlClause().makeAdditionalConditionAsOrEffective(); + for (Iterator ite = callbackList + .iterator(); ite.hasNext();) { + final LikeSearchOption.LikeAsOrCallback likeAsOrCallback = (LikeSearchOption.LikeAsOrCallback) ite + .next(); + final String additionalTargetPropertyName = likeAsOrCallback + .getAdditionalTargetPropertyName(); + final String filteredValue = likeAsOrCallback + .filterValue(currentValue); + final LikeSearchOption optionDeepCopy = (LikeSearchOption) option + .createDeepCopy(); + optionDeepCopy.clearLikeAsOrCallback(); + final LikeSearchOption filteredOption = likeAsOrCallback + .filterOption(optionDeepCopy); + invokeSetterLikeSearch(additionalTargetPropertyName, + filteredValue, filteredOption); + } + getSqlClause().ignoreAdditionalConditionAsOr(); + } + } + } else { + // As 'or' Condition + for (int i = 0; i < strArray.length; i++) { + final String currentValue = strArray[i]; + if (i == 0) { + setupConditionValueAndRegisterWhereClause(key, + currentValue, cvalue, colName, capPropName, + uncapPropName, option); + } else { + getSqlClause().makeAdditionalConditionAsOrEffective(); + invokeSetterLikeSearch(uncapPropName, currentValue, option); + } + } + + // @jflute -- Callback for LikeAsOr! + // final List callbackList = option.getLikeAsOrCallbackList(); + // ... + + getSqlClause().ignoreAdditionalConditionAsOr(); + } + } + + protected void throwLikeSearchOptionNotFoundException(String capPropName, + String value) { + String msg = "Look! Read the message below." + getLineSeparator(); + msg = msg + + "/* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * *" + + getLineSeparator(); + msg = msg + "The likeSearchOption was Not Found! (Should not be null!)" + + getLineSeparator(); + msg = msg + getLineSeparator(); + msg = msg + "[Advice]" + getLineSeparator(); + msg = msg + "Please confirm your method call:" + getLineSeparator(); + final String beanName = getClass().getSimpleName(); + final String methodName = "set" + capPropName + "_LikeSearch('" + value + + "', likeSearchOption);"; + msg = msg + " " + beanName + "." + methodName + getLineSeparator(); + msg = msg + "* * * * * * * * * */" + getLineSeparator(); + throw new RequiredOptionNotFoundException(msg); + } + + protected void invokeSetterLikeSearch(String columnFlexibleName, + Object value, LikeSearchOption option) { + if (value == null) { + return; + } + final DBMeta dbmeta = DBMetaInstanceHandler + .findDBMeta(getTableDbName()); + final String columnCapPropName = initCap(dbmeta + .findPropertyName(columnFlexibleName)); + String methodName = "set" + columnCapPropName + "_" + + "likeSearch".substring(0, 1).toUpperCase() + + "likeSearch".substring(1); + java.lang.reflect.Method method = null; + try { + method = this.getClass().getMethod(methodName, + new Class[] { value.getClass(), LikeSearchOption.class }); + } catch (NoSuchMethodException e) { + String msg = "The columnFlexibleName is not existing in this table: columnFlexibleName=" + + columnFlexibleName; + msg = msg + " tableName=" + getTableDbName() + " methodName=" + + methodName; + throw new RuntimeException(msg, e); + } + try { + method.invoke(this, new Object[] { value, option }); + } catch (IllegalAccessException e) { + throw new RuntimeException(e); + } catch (java.lang.reflect.InvocationTargetException e) { + throw new RuntimeException(e.getCause()); + } + } + + // ----------------------------------------------------- + // InScope Query + // ------------- + protected void registerInScopeQuery(ConditionKey key, String value, + ConditionValue cvalue, String colName, String capPropName, + String uncapPropName, InScopeOption option) { + if (key.isValidRegistration(cvalue, value, key.getConditionKey() + + " of " + getRealAliasName() + "." + colName)) { + if (value != null && option.isSplit()) { + final String[] strArray = option.generateSplitValueArray(value); + final List realValueList = new ArrayList(); + for (int i = 0; i < strArray.length; i++) { + final String currentValue = strArray[i]; + realValueList.add(currentValue); + } + setupConditionValueAndRegisterWhereClause(key, realValueList, + cvalue, colName, capPropName, uncapPropName, option); + } else { + setupConditionValueAndRegisterWhereClause(key, value, cvalue, + colName, capPropName, uncapPropName, option); + } + } + } + + // ----------------------------------------------------- + // Inline Query + // ------------ + protected void registerInlineQuery(ConditionKey key, Object value, + ConditionValue cvalue, String colName, String capPropName, + String uncapPropName) { + if (key.isValidRegistration(cvalue, value, key.getConditionKey() + + " of " + getRealAliasName() + "." + colName)) { + key.setupConditionValue(cvalue, value, getLocation(uncapPropName, + key));// If Java, it is necessary to use uncapPropName! + if (isBaseQuery(this)) { + getSqlClause().registerBaseTableInlineWhereClause(colName, key, + cvalue); + } else { + getSqlClause().registerOuterJoinInlineWhereClause( + getRealAliasName(), colName, key, cvalue, + _onClauseInline); + } + } + } + + protected void registerInlineQuery(ConditionKey key, Object value, + ConditionValue cvalue, String colName, String capPropName, + String uncapPropName, ConditionOption option) { + if (key.isValidRegistration(cvalue, value, key.getConditionKey() + + " of " + getRealAliasName() + "." + colName)) { + key.setupConditionValue(cvalue, value, getLocation(uncapPropName, + key), option);// If Java, it is necessary to use uncapPropName! + if (isBaseQuery(this)) { + getSqlClause().registerBaseTableInlineWhereClause(colName, key, + cvalue, option); + } else { + getSqlClause().registerOuterJoinInlineWhereClause( + getRealAliasName(), colName, key, cvalue, option, + _onClauseInline); + } + } + } + + // ----------------------------------------------------- + // InScopeSubQuery + // --------------- + protected void registerInScopeSubQuery(ConditionQuery subQuery, + String columnName, String relatedColumnName, String propertyName) { + final String realColumnName = getInScopeSubQueryRealColumnName(columnName); + final String subQueryClause = getInScopeSubQuerySql(subQuery, + relatedColumnName, propertyName); + registerWhereClause(realColumnName + " in (" + subQueryClause + ")"); + } + + protected String getInScopeSubQueryRealColumnName(String columnName) { + return getRealColumnName(columnName); + } + + protected String getInScopeSubQuerySql(ConditionQuery subQuery, + String relatedColumnName, String propertyName) { + final String selectClause = "select " + + getSqlClause().getLocalTableAliasName() + "." + + relatedColumnName; + String fromWhereClause = subQuery.getSqlClause() + .getClauseFromWhereWithUnionTemplate(); + fromWhereClause = replaceString(fromWhereClause, ".conditionQuery.", + "." + getLocationBase(propertyName) + ".");// Very Important! + + // Replace template marks. These are very important! + fromWhereClause = replaceString(fromWhereClause, getSqlClause() + .getUnionSelectClauseMark(), selectClause); + fromWhereClause = replaceString(fromWhereClause, getSqlClause() + .getUnionWhereClauseMark(), ""); + fromWhereClause = replaceString(fromWhereClause, getSqlClause() + .getUnionWhereFirstConditionMark(), ""); + + return selectClause + " " + fromWhereClause; + } + + // ----------------------------------------------------- + // ExistsSubQuery + // -------------- + protected void registerExistsSubQuery(ConditionQuery subQuery, + String columnName, String relatedColumnName, String propertyName) { + final String realColumnName = getExistsSubQueryRealColumnName(columnName); + final String subQueryClause = getExistsSubQuerySql(subQuery, + realColumnName, relatedColumnName, propertyName); + registerWhereClause("exists (" + subQueryClause + ")"); + } + + protected String getExistsSubQueryRealColumnName(String columnName) { + return getRealColumnName(columnName); + } + + // - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - + // *Unsupport ExistsSubQuery as inline because it's so dangerous. + // - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - + + protected String getExistsSubQuerySql(ConditionQuery subQuery, + String realColumnName, String relatedColumnName, String propertyName) { + final int subQueryLevel = subQuery.getSubQueryLevel(); + if (_subQueryLevel <= subQueryLevel) { + _subQueryLevel = subQueryLevel + 1; + } + final String tableAliasName = "dfsublocal_" + subQueryLevel; + final String selectClause = "select " + tableAliasName + "." + + relatedColumnName; + String fromWhereClause = subQuery.getSqlClause() + .getClauseFromWhereWithWhereUnionTemplate(); + fromWhereClause = replaceString(fromWhereClause, "dflocal", + tableAliasName);// Very Important! + fromWhereClause = replaceString(fromWhereClause, ".conditionQuery.", + "." + getLocationBase(propertyName) + ".");// Very Important! + + final String joinCondition = tableAliasName + "." + relatedColumnName + + " = " + realColumnName; + + // Replace template marks. These are very important! + fromWhereClause = replaceString(fromWhereClause, getSqlClause() + .getWhereClauseMark(), "where " + joinCondition); + fromWhereClause = replaceString(fromWhereClause, getSqlClause() + .getWhereFirstConditionMark(), joinCondition + " and "); + fromWhereClause = replaceString(fromWhereClause, getSqlClause() + .getUnionSelectClauseMark(), selectClause); + fromWhereClause = replaceString(fromWhereClause, getSqlClause() + .getUnionWhereClauseMark(), "where " + joinCondition); + fromWhereClause = replaceString(fromWhereClause, getSqlClause() + .getUnionWhereFirstConditionMark(), joinCondition + " and "); + + return selectClause + " " + fromWhereClause; + } + + // ----------------------------------------------------- + // Where Clause + // ------------ + protected void setupConditionValueAndRegisterWhereClause(ConditionKey key, + Object value, ConditionValue cvalue, String colName, + String capPropName, String uncapPropName) { + key.setupConditionValue(cvalue, value, getLocation(uncapPropName, key));// If Java, it is necessary to use uncapPropName! + getSqlClause().registerWhereClause(getRealColumnName(colName), key, + cvalue); + } + + protected void setupConditionValueAndRegisterWhereClause(ConditionKey key, + Object value, ConditionValue cvalue, String colName, + String capPropName, String uncapPropName, ConditionOption option) { + key.setupConditionValue(cvalue, value, getLocation(uncapPropName, key), + option);// If Java, it is necessary to use uncapPropName! + getSqlClause().registerWhereClause(getRealColumnName(colName), key, + cvalue, option); + } + + protected void registerWhereClause(String whereClause) { + getSqlClause().registerWhereClause(whereClause); + } + + protected void registerInlineWhereClause(String whereClause) { + if (isBaseQuery(this)) { + getSqlClause().registerBaseTableInlineWhereClause(whereClause); + } else { + getSqlClause().registerOuterJoinInlineWhereClause( + getRealAliasName(), whereClause, _onClauseInline); + } + } + + // ----------------------------------------------------- + // Union Query + // ----------- + public void registerUnionQuery(ConditionQuery unionQuery, boolean unionAll, + String unionQueryPropertyName) { + final String unionQueryClause = getUnionQuerySql(unionQuery, + unionQueryPropertyName); + + // At the future, building SQL will be moved to sqlClause. + getSqlClause().registerUnionQuery(unionQueryClause, unionAll); + } + + protected String getUnionQuerySql(ConditionQuery unionQuery, + String unionQueryPropertyName) { + final String fromClause = unionQuery.getSqlClause().getFromClause(); + final String whereClause = unionQuery.getSqlClause().getWhereClause(); + final String unionQueryClause; + if (whereClause.trim().length() <= 0) { + unionQueryClause = fromClause + " " + + getSqlClause().getUnionWhereClauseMark(); + } else { + final int whereIndex = whereClause.indexOf("where "); + if (whereIndex < 0) { + String msg = "The whereClause should have 'where' string: " + + whereClause; + throw new IllegalStateException(msg); + } + final int clauseIndex = whereIndex + "where ".length(); + final String mark = getSqlClause() + .getUnionWhereFirstConditionMark(); + unionQueryClause = fromClause + " " + + whereClause.substring(0, clauseIndex) + mark + + whereClause.substring(clauseIndex); + } + final String oldStr = ".conditionQuery."; + final String newStr = ".conditionQuery." + unionQueryPropertyName + "."; + return replaceString(unionQueryClause, oldStr, newStr);// Very Important! + } + + // ----------------------------------------------------- + // OrderBy + // ------- + public void withNullsFirst() {// is User Public! + getSqlClause().addNullsFirstToPreviousOrderBy(); + } + + public void withNullsLast() {// is User Public! + getSqlClause().addNullsLastToPreviousOrderBy(); + } + + protected void registerOrderBy(String columnName, boolean ascOrDesc) { + getSqlClause().registerOrderBy(getRealColumnName(columnName), null, + ascOrDesc); + } + + // =================================================================================== + // Name Resolver + // ============= + /** + * Resolve join alias name. + * @param relationPath Relation path. (NotNull) + * @param nestLevel Nest level. + * @return Resolved join alias name. (NotNull) + */ + protected String resolveJoinAliasName(String relationPath, int nestLevel) { + return getSqlClause().resolveJoinAliasName(relationPath, nestLevel); + } + + protected String resolveNestLevelExpression(String name) { + return getSqlClause().resolveNestLevelExpression(name, getNestLevel()); + } + + protected String resolveNextRelationPath(String tableName, + String relationPropertyName) { + final int relationNo = getSqlClause().resolveRelationNo(tableName, + relationPropertyName); + String nextRelationPath = "_" + relationNo; + if (_relationPath != null) { + nextRelationPath = _relationPath + nextRelationPath; + } + return nextRelationPath; + } + + // =================================================================================== + // Fixed Condition + // =============== + protected String prepareFixedCondition(String fixedCondition, + String localAliasName, String foreignAliasName) { + fixedCondition = replaceString(fixedCondition, "$$alias$$", + foreignAliasName); + fixedCondition = replaceString(fixedCondition, "$$foreignAlias$$", + foreignAliasName); + fixedCondition = replaceString(fixedCondition, "$$localAlias$$", + localAliasName); + return fixedCondition; + } + + // =================================================================================== + // Invoke + // ====== + /** + * The implementation. + * + * @param columnFlexibleName The flexible name of the column. (NotNull and NotEmpty) + * @return The conditionValue. (NotNull) + */ + public ConditionValue invokeValue(String columnFlexibleName) { + final DBMeta dbmeta = DBMetaInstanceHandler + .findDBMeta(getTableDbName()); + final String columnCapPropName = initCap(dbmeta + .findPropertyName(columnFlexibleName)); + String methodName = "get" + columnCapPropName; + java.lang.reflect.Method method = null; + try { + method = this.getClass().getMethod(methodName, new Class[] {}); + } catch (NoSuchMethodException e) { + String msg = "The columnFlexibleName is not existing in this table: columnFlexibleName=" + + columnFlexibleName; + msg = msg + " tableName=" + getTableDbName() + " methodName=" + + methodName; + throw new RuntimeException(msg, e); + } + try { + final Object result = method.invoke(this, new Object[] {}); + return (ConditionValue) result; + } catch (IllegalAccessException e) { + throw new RuntimeException(e); + } catch (java.lang.reflect.InvocationTargetException e) { + throw new RuntimeException(e.getCause()); + } + } + + /** + * Invoke setting query. + * + * @param columnFlexibleName The flexible name of the column. (NotNull and NotEmpty) + * @param conditionKeyName The name of the conditionKey. (NotNull) + * @param value The value of the condition. (NotNull) + */ + public void invokeQuery(String columnFlexibleName, String conditionKeyName, + Object value) { + if (value == null) { + return; + } + final DBMeta dbmeta = DBMetaInstanceHandler + .findDBMeta(getTableDbName()); + final String columnCapPropName = initCap(dbmeta + .findPropertyName(columnFlexibleName)); + String methodName = "set" + columnCapPropName + "_" + + conditionKeyName.substring(0, 1).toUpperCase() + + conditionKeyName.substring(1); + java.lang.reflect.Method method = null; + try { + method = this.getClass().getMethod(methodName, + new Class[] { value.getClass() }); + } catch (NoSuchMethodException e) { + String msg = "The columnFlexibleName is not existing in this table: columnFlexibleName=" + + columnFlexibleName; + msg = msg + " tableName=" + getTableDbName() + " methodName=" + + methodName; + throw new RuntimeException(msg, e); + } + try { + method.invoke(this, new Object[] { value }); + } catch (IllegalAccessException e) { + throw new RuntimeException(e); + } catch (java.lang.reflect.InvocationTargetException e) { + throw new RuntimeException(e.getCause()); + } + } + + /** + * The implementation. + * + * @param columnFlexibleName The flexible name of a column. (NotNull and NotEmpty) + * @param isAsc Is it ascend? + */ + public void invokeOrderBy(String columnFlexibleName, boolean isAsc) { + String ascDesc = null; + if (isAsc) { + ascDesc = "Asc"; + } else { + ascDesc = "Desc"; + } + final DBMeta dbmeta = DBMetaInstanceHandler + .findDBMeta(getTableDbName()); + final String columnCapPropName = initCap(dbmeta + .findPropertyName(columnFlexibleName)); + final String methodName = "addOrderBy_" + columnCapPropName + "_" + + ascDesc; + + java.lang.reflect.Method method = null; + try { + method = this.getClass().getMethod(methodName, new Class[] {}); + } catch (NoSuchMethodException e) { + String msg = "The columnFlexibleName is not existing in this table: columnFlexibleName=" + + columnFlexibleName; + msg = msg + " tableName=" + getTableDbName() + " methodName=" + + methodName; + throw new RuntimeException(msg, e); + } + try { + method.invoke(this, new Object[] {}); + } catch (IllegalAccessException e) { + throw new RuntimeException(e); + } catch (java.lang.reflect.InvocationTargetException e) { + throw new RuntimeException(e.getCause()); + } + } + + /** + * The implementation. + * + * @param foreignPropertyName The property name of foreign. (NotNull and NotEmpty) + * @return The conditionQuery of foreign as interface. (NotNull) + */ + public ConditionQuery invokeForeignCQ(String foreignPropertyName) { + final String methodName = "query" + + foreignPropertyName.substring(0, 1).toUpperCase() + + foreignPropertyName.substring(1); + java.lang.reflect.Method method = null; + try { + method = this.getClass().getMethod(methodName, new Class[] {}); + } catch (NoSuchMethodException e) { + String msg = "The foreignPropertyName is not existing in this table: foreignPropertyName=" + + foreignPropertyName; + msg = msg + " tableName=" + getTableDbName() + " methodName=" + + methodName; + throw new RuntimeException(msg, e); + } + try { + return (ConditionQuery) method.invoke(this, new Object[] {}); + } catch (IllegalAccessException e) { + throw new RuntimeException(e); + } catch (java.lang.reflect.InvocationTargetException e) { + throw new RuntimeException(e.getCause()); + } + } + + // =================================================================================== + // Assist Helper + // ============= + /** + * @param value Query-value-string. (Nullable) + * @return Filtered value. (Nullable) + */ + protected String filterRemoveEmptyString(String value) { + return ((value != null && !"".equals(value)) ? value : null); + } + + /** + * @param col Target collection. (Nullable) + * @param The type of property. + * @return List. (Nullable: If the argument is null, returns null.) + */ + protected List convertToList( + Collection col) { + if (col == null) { + return null; + } + if (col instanceof List) { + return filterRemoveNullOrEmptyValueFromList((List) col); + } + return filterRemoveNullOrEmptyValueFromList(new ArrayList( + col)); + } + + private List filterRemoveNullOrEmptyValueFromList( + List ls) { + if (ls == null) { + return null; + } + List newList = new ArrayList(); + for (Iterator ite = ls.iterator(); ite.hasNext();) { + final PROPERTY_TYPE element = ite.next(); + if (element == null) { + continue; + } + if (element instanceof String) { + if (((String) element).length() == 0) { + continue; + } + } + newList.add(element); + } + return newList; + } + + // =================================================================================== + // General Helper + // ============== + protected final String replaceString(String text, String fromText, + String toText) { + return SimpleStringUtil.replace(text, fromText, toText); + } + + protected String initCap(String str) { + return SimpleStringUtil.initCap(str); + } + + protected String getLineSeparator() { + return SimpleSystemUtil.getLineSeparator(); + } + + // ----------------------------------------------------- + // Assert Object + // ------------- + /** + * Assert that the object is not null. + * + * @param variableName Variable name. (NotNull) + * @param value Value. (NotNull) + * @exception IllegalArgumentException + */ + protected void assertObjectNotNull(String variableName, Object value) { + if (variableName == null) { + String msg = "The value should not be null: variableName=" + + variableName + " value=" + value; + throw new IllegalArgumentException(msg); + } + if (value == null) { + String msg = "The value should not be null: variableName=" + + variableName; + throw new IllegalArgumentException(msg); + } + } + + /** + * Assert that the column-name is not null and is not empty and does not contain comma. + * + * @param columnName Column-name. (NotNull) + * @exception IllegalArgumentException + */ + protected void assertColumnName(String columnName) { + if (columnName == null) { + String msg = "The columnName should not be null."; + throw new IllegalArgumentException(msg); + } + if (columnName.trim().length() == 0) { + String msg = "The columnName should not be empty-string."; + throw new IllegalArgumentException(msg); + } + if (columnName.indexOf(",") >= 0) { + String msg = "The columnName should not contain comma ',': " + + columnName; + throw new IllegalArgumentException(msg); + } + } + + /** + * Assert that the alias-name is not null and is not empty and does not contain comma. + * + * @param aliasName Alias-name. (NotNull) + * @exception IllegalArgumentException + */ + protected void assertAliasName(String aliasName) { + if (aliasName == null) { + String msg = "The aliasName should not be null."; + throw new IllegalArgumentException(msg); + } + if (aliasName.trim().length() == 0) { + String msg = "The aliasName should not be empty-string."; + throw new IllegalArgumentException(msg); + } + if (aliasName.indexOf(",") >= 0) { + String msg = "The aliasName should not contain comma ',': " + + aliasName; + throw new IllegalArgumentException(msg); + } + } + + // ----------------------------------------------------- + // Assert String + // ------------- + /** + * Assert that the entity is not null and not trimmed empty. + * + * @param variableName Variable name. (NotNull) + * @param value Value. (NotNull) + */ + protected void assertStringNotNullAndNotTrimmedEmpty(String variableName, + String value) { + assertObjectNotNull("variableName", variableName); + assertObjectNotNull("value", value); + if (value.trim().length() == 0) { + String msg = "The value should not be empty: variableName=" + + variableName + " value=" + value; + throw new IllegalArgumentException(msg); + } + } + + // =================================================================================== + // Basic Override + // ============== + @Override + public String toString() { + return getClass().getSimpleName() + ":{aliasName=" + _aliasName + + ", nestLevel=" + _nestLevel + ", subQueryLevel=" + + _subQueryLevel + ", foreignPropertyName=" + + _foreignPropertyName + ", relationPath=" + _relationPath + + ", onClauseInline=" + _onClauseInline + "}"; + } +} Property changes on: announcement/trunk/src/main/java/jp/sf/pal/announcement/db/allcommon/cbean/AbstractConditionQuery.java ___________________________________________________________________ Name: svn:eol-style + native Added: announcement/trunk/src/main/java/jp/sf/pal/announcement/db/allcommon/cbean/ConditionBean.java =================================================================== --- announcement/trunk/src/main/java/jp/sf/pal/announcement/db/allcommon/cbean/ConditionBean.java (rev 0) +++ announcement/trunk/src/main/java/jp/sf/pal/announcement/db/allcommon/cbean/ConditionBean.java 2008-06-30 02:54:27 UTC (rev 1002) @@ -0,0 +1,200 @@ +package jp.sf.pal.announcement.db.allcommon.cbean; + +import jp.sf.pal.announcement.db.allcommon.cbean.sqlclause.SqlClause; +import jp.sf.pal.announcement.db.allcommon.jdbc.StatementConfig; + +/** + * The interface of condition-bean. + * @author DBFlute(AutoGenerator) + */ +public interface ConditionBean extends PagingBean { + + // ===================================================================================== + // Definition + // ========== + /** Map-string map-mark. */ + public static final String MAP_STRING_MAP_MARK = "map:"; + + /** Map-string list-mark. */ + public static final String MAP_STRING_LIST_MARK = "list:"; + + /** Map-string start-brace. */ + public static final String MAP_STRING_START_BRACE = "@{"; + + /** Map-string end-brace. */ + public static final String MAP_STRING_END_BRACE = "@}"; + + /** Map-string delimiter. */ + public static final String MAP_STRING_DELIMITER = "@;"; + + /** Map-string equal. */ + public static final String MAP_STRING_EQUAL = "@="; + + // =================================================================================== + // Table Name + // ========== + /** + * Get table DB-name. + * @return Table DB-name. (NotNull) + */ + public String getTableDbName(); + + /** + * Get table SQL-name. + * @return Table SQL-name. (NotNull) + */ + public String getTableSqlName(); + + // =================================================================================== + // SqlClause + // ========= + /** + * Get SQL-clause instance. + * + * @return SQL-clause. (NotNull) + */ + public SqlClause getSqlClause(); + + // =================================================================================== + // PrimaryKey Map + // ============== + /** + * Accept primary-key map-string. + * @param primaryKeyMap Primary-key map. (NotNull and NotEmpty) + */ + public void acceptPrimaryKeyMap( + java.util.Map primaryKeyMap); + + /** + * Accept primary-key map-string. Delimiter is at-mark and semicolon. + * @param primaryKeyMapString Primary-key map. (NotNull and NotEmpty) + */ + public void acceptPrimaryKeyMapString(String primaryKeyMapString); + + // =================================================================================== + // OrderBy Setting + // =============== + /** + * Add order-by PrimaryKey asc. {order by primaryKey1 asc, primaryKey2 asc...} + * @return this. (NotNull) + */ + public ConditionBean addOrderBy_PK_Asc(); + + /** + * Add order-by PrimaryKey desc. {order by primaryKey1 desc, primaryKey2 desc...} + * @return this. (NotNull) + */ + public ConditionBean addOrderBy_PK_Desc(); + + // =================================================================================== + // Query + // ===== + /** + * Get condition-query as interface. + * @return Instance of query as interface. (NotNull) + * @deprecated + */ + public ConditionQuery getConditionQueryAsInterface(); + + /** + * Get the conditionQuery of the local table as interface. + * @return The conditionQuery of the local table as interface. (NotNull) + */ + public ConditionQuery localCQ(); + + // =================================================================================== + // Union Query + // =========== + /** + * Has union query or union all query? + * @return Determination. + */ + public boolean hasUnionQueryOrUnionAllQuery(); + + // =================================================================================== + // Limit Select + // ============ + /** + * Limit select PK only. + * @return this. (NotNull) + */ + public ConditionBean limitSelect_PKOnly(); + + /** + * Limit select off. + * @return this. (NotNull) + */ + public ConditionBean limitSelect_Off(); + + /** + * Is limit-select PK only? + * @return Determination. + */ + public boolean isLimitSelect_PKOnly(); + + // ===================================================================================== + // Lock Setting + // ============ + /** + * Lock for update. + *

    + * If you invoke this, your SQL lock target records for update. + * It depends whether this method supports this on the database type. + *

    + * @return this. (NotNull) + */ + public ConditionBean lockForUpdate(); + + // ===================================================================================== + // Select Count + // ============ + /** + * Set up various things for select-count-ignore-fetch-scope. {Internal} + * This method is for INTERNAL. Don't invoke this! + * @return this. (NotNull) + */ + public ConditionBean xsetupSelectCountIgnoreFetchScope(); + + /** + * Do after-care for select-count-ignore-fetch-scope. {Internal} + * This method is for INTERNAL. Don't invoke this! + * @return this. (NotNull) + */ + public ConditionBean xafterCareSelectCountIgnoreFetchScope(); + + /** + * Is set up various things for select-count-ignore-fetch-scope? {Internal} + * This method is for INTERNAL. Don't invoke this! + * @return Determination. + */ + public boolean isSelectCountIgnoreFetchScope(); + + // ===================================================================================== + // Statement Config + // ================ + /** + * @param statementConfig The config of statement. (Nullable) + */ + public void configure(StatementConfig statementConfig); + + /** + * @return The config of statement. (Nullable) + */ + public StatementConfig getStatementConfig(); + + // =================================================================================== + // Format SQL + // ========== + public void formatSql(); + + public boolean isFormatSql(); + + // =================================================================================== + // Display SQL + // =========== + /** + * Convert this conditionBean to SQL for display. + * @return SQL for display. (NotNull and NotEmpty) + */ + public String toDisplaySql(); +} Property changes on: announcement/trunk/src/main/java/jp/sf/pal/announcement/db/allcommon/cbean/ConditionBean.java ___________________________________________________________________ Name: svn:eol-style + native Added: announcement/trunk/src/main/java/jp/sf/pal/announcement/db/allcommon/cbean/ConditionBeanContext.java =================================================================== --- announcement/trunk/src/main/java/jp/sf/pal/announcement/db/allcommon/cbean/ConditionBeanContext.java (rev 0) +++ announcement/trunk/src/main/java/jp/sf/pal/announcement/db/allcommon/cbean/ConditionBeanContext.java 2008-06-30 02:54:27 UTC (rev 1002) @@ -0,0 +1,395 @@ +package jp.sf.pal.announcement.db.allcommon.cbean; + +import java.util.Collections; +import java.util.LinkedHashMap; +import java.util.Map; + +import jp.sf.pal.announcement.db.allcommon.DBFluteConfig; +import jp.sf.pal.announcement.db.allcommon.cbean.sqlclause.SqlClause; +import jp.sf.pal.announcement.db.allcommon.cbean.sqlclause.SqlClauseDb2; +import jp.sf.pal.announcement.db.allcommon.cbean.sqlclause.SqlClauseDerby; +import jp.sf.pal.announcement.db.allcommon.cbean.sqlclause.SqlClauseFirebird; +import jp.sf.pal.announcement.db.allcommon.cbean.sqlclause.SqlClauseH2; +import jp.sf.pal.announcement.db.allcommon.cbean.sqlclause.SqlClauseMySql; +import jp.sf.pal.announcement.db.allcommon.cbean.sqlclause.SqlClauseOracle; +import jp.sf.pal.announcement.db.allcommon.cbean.sqlclause.SqlClausePostgreSql; +import jp.sf.pal.announcement.db.allcommon.cbean.sqlclause.SqlClauseSqlServer; +import jp.sf.pal.announcement.db.allcommon.s2dao.internal.sqlparser.InternalSqlParser; + +import org.apache.commons.logging.Log; +import org.apache.commons.logging.LogFactory; + +/** + * Condition-Bean context. + * @author DBFlute(AutoGenerator) + */ +public class ConditionBeanContext { + + /** Log instance. */ + private static final Log _log = LogFactory + .getLog(ConditionBeanContext.class); + + // =================================================================================== + // Thread Local + // ============ + /** The thread-local for this. */ + private static final ThreadLocal _threadLocal = new ThreadLocal(); + + /** + * Get condition-bean on thread. + * @return Condition-bean context. (Nullable) + */ + public static ConditionBean getConditionBeanOnThread() { + return (ConditionBean) _threadLocal.get(); + } + + /** + * Set condition-bean on thread. + * @param cb Condition-bean. (NotNull) + */ + public static void setConditionBeanOnThread(ConditionBean cb) { + if (cb == null) { + String msg = "The argument[cb] must not be null."; + throw new IllegalArgumentException(msg); + } + _threadLocal.set(cb); + } + + /** + * Is existing condition-bean on thread? + * @return Determination. + */ + public static boolean isExistConditionBeanOnThread() { + return (_threadLocal.get() != null); + } + + /** + * Clear condition-bean on thread. + */ + public static void clearConditionBeanOnThread() { + _threadLocal.set(null); + } + + // =================================================================================== + // Initialize against the ClassLoader Headache + // =========================================== + @SuppressWarnings("unused") + public static void initialize() { + boolean debugEnabled = _log.isDebugEnabled(); + // Against the ClassLoader Headache! + final StringBuilder sb = new StringBuilder(); + { + final Class clazz = jp.sf.pal.announcement.db.allcommon.cbean.SimplePagingBean.class; + if (debugEnabled) { + sb.append( + " ...Loading class of " + clazz.getName() + " by " + + clazz.getClassLoader().getClass()).append( + getLineSeparator()); + } + } + { + Class clazz = jp.sf.pal.announcement.db.allcommon.cbean.coption.FromToOption.class; + clazz = jp.sf.pal.announcement.db.allcommon.cbean.coption.LikeSearchOption.class; + clazz = jp.sf.pal.announcement.db.allcommon.cbean.coption.InScopeOption.class; + clazz = jp.sf.pal.announcement.db.allcommon.cbean.grouping.GroupingOption.class; + clazz = jp.sf.pal.announcement.db.allcommon.cbean.grouping.GroupingRowEndDeterminer.class; + clazz = jp.sf.pal.announcement.db.allcommon.cbean.grouping.GroupingRowResource.class; + clazz = jp.sf.pal.announcement.db.allcommon.cbean.grouping.GroupingRowSetupper.class; + clazz = jp.sf.pal.announcement.db.allcommon.cbean.pagenavi.PageNumberLink.class; + clazz = jp.sf.pal.announcement.db.allcommon.cbean.pagenavi.PageNumberLinkSetupper.class; + clazz = jp.sf.pal.announcement.db.allcommon.jdbc.CursorHandler.class; + if (debugEnabled) { + sb.append(" ...Loading class of ...and so on"); + } + } + if (debugEnabled) { + _log.debug("{Initialize against the ClassLoader Headache}" + + getLineSeparator() + sb); + } + } + + // =================================================================================== + // Type Determination + // ================== + /** + * Is the argument condition-bean? + * @param dtoInstance DTO instance. + * @return Determination. + */ + public static boolean isTheArgumentConditionBean(final Object dtoInstance) { + if (dtoInstance instanceof ConditionBean) { + return true; + } else { + return false; + } + } + + /** + * Is the type condition-bean? + * @param dtoClass DtoClass. + * @return Determination. + */ + public static boolean isTheTypeConditionBean(final Class dtoClass) { + if (ConditionBean.class.isAssignableFrom(dtoClass)) { + return true; + } else { + return false; + } + } + + // =================================================================================== + // Product Name + // ============ + public static final String DB_NAME_DERBY = "derby"; + + public static final String DB_NAME_H2 = "h2"; + + public static final String DB_NAME_ORACLE = "oracle"; + + public static final String DB_NAME_MYSQL = "mysql"; + + public static final String DB_NAME_POSTGRESQL = "postgresql"; + + public static final String DB_NAME_FIREBIRD = "firebird"; + + public static final String DB_NAME_MSSQL = "mssql"; + + public static final String DB_NAME_SYBASE = "sybase"; + + public static final String DB_NAME_DB2 = "db2"; + + protected static final Map _driverHintDatabaseProductNameMap; + static { + final Map tmpMap = Collections + .synchronizedMap(new LinkedHashMap()); + tmpMap.put("org.apache.derby", DB_NAME_DERBY); + tmpMap.put("org.h2", DB_NAME_H2); + tmpMap.put("oracle", DB_NAME_ORACLE); + tmpMap.put("mysql", DB_NAME_MYSQL); + tmpMap.put("postgresql", DB_NAME_POSTGRESQL); + tmpMap.put("firebird", DB_NAME_FIREBIRD); + tmpMap.put("sqlserver", DB_NAME_MSSQL); + tmpMap.put("sybase", DB_NAME_SYBASE); + tmpMap.put("db2", DB_NAME_DB2); + _driverHintDatabaseProductNameMap = java.util.Collections + .unmodifiableMap(tmpMap); + } + + public static boolean setupDatabaseProductNameByDriverClassName( + String driverClassName) { + final java.util.Set keySet = _driverHintDatabaseProductNameMap + .keySet(); + for (final java.util.Iterator ite = keySet.iterator(); ite + .hasNext();) { + final String driverHint = (String) ite.next(); + if (driverClassName.indexOf(driverHint) >= 0) { + final String databaseProductName = (String) _driverHintDatabaseProductNameMap + .get(driverHint); + setDatabaseProductName(databaseProductName); + return true; + } + } + return false; + } + + /** The database product name. */ + private static String _databaseProductName; + + /** + * Get database product name. + * @return Database product name. + */ + public static String getDatabaseProductName() { + return _databaseProductName; + } + + /** + * Set database product name. + * @param name Database product name. (NotNull) + */ + public static void setDatabaseProductName(String name) { + if (_databaseProductName != null) { + String msg = "Already set up: current=" + _databaseProductName + + " your=" + name; + throw new IllegalStateException(msg); + } + _databaseProductName = name; + } + + // =================================================================================== + // SqlClause Creator + // ================= + /** + * Create SQL-clause. {for condition-bean} + * @param cb Condition-bean. (NotNull) + * @return SQL-clause. (NotNull) + */ + public static SqlClause createSqlClause(ConditionBean cb) { + final String tableSqlName = cb.getTableSqlName(); + final SqlClause sqlClause = createSqlClause(tableSqlName); + if (DBFluteConfig.getInstance().isConditionBeanFormatSql()) { + sqlClause.makeFormatClauseEffective(); + } + return sqlClause; + } + + /** + * Create SQL-clause. {for SimplePagingBean} + * @param tableDbName The DB name of table. (NotNull) + * @return SQL-clause. (NotNull) + */ + public static SqlClause createSqlClause(String tableDbName) { + final String databaseProductName = getDatabaseProductName(); + if (databaseProductName == null) { + return new SqlClauseMySql(tableDbName); + } + final String name = databaseProductName.toLowerCase(); + if (name.equalsIgnoreCase(DB_NAME_DERBY)) { + return new SqlClauseDerby(tableDbName); + } else if (name.equalsIgnoreCase(DB_NAME_H2)) { + return new SqlClauseH2(tableDbName); + } else if (name.equalsIgnoreCase(DB_NAME_ORACLE)) { + return new SqlClauseOracle(tableDbName); + } else if (name.equalsIgnoreCase(DB_NAME_FIREBIRD)) { + return new SqlClauseFirebird(tableDbName); + } else if (name.equalsIgnoreCase(DB_NAME_MYSQL)) { + return new SqlClauseMySql(tableDbName); + } else if (name.equalsIgnoreCase(DB_NAME_POSTGRESQL)) { + return new SqlClausePostgreSql(tableDbName); + } else if (name.equalsIgnoreCase(DB_NAME_MSSQL)) { + return new SqlClauseSqlServer(tableDbName); + } else if (name.equalsIgnoreCase(DB_NAME_DB2)) { + return new SqlClauseDb2(tableDbName); + } else { + return new SqlClauseMySql(tableDbName); + } + } + + // =================================================================================== + // Exception Handling + // ================== + public static void throwEntityAlreadyDeletedException(Object searchKey4Log) { + String msg = "Look! Read the message below." + getLineSeparator(); + msg = msg + + "/* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * *" + + getLineSeparator(); + msg = msg + "The entity was Not Found! it has already been deleted!" + + getLineSeparator(); + msg = msg + getLineSeparator(); + msg = msg + "[Advice]" + getLineSeparator(); + msg = msg + + "Please confirm the existence of your target record on your database." + + getLineSeparator(); + msg = msg + + "Does the target record really created before this operation?" + + getLineSeparator(); + msg = msg + "Has the target record been deleted by other thread?" + + getLineSeparator(); + msg = msg + + "It is precondition that the record exists on your database." + + getLineSeparator(); + msg = msg + getLineSeparator(); + if (searchKey4Log != null && searchKey4Log instanceof ConditionBean) { + final ConditionBean cb = (ConditionBean) searchKey4Log; + final String dispalySql; + if (cb.isFormatSql()) { + dispalySql = cb.toDisplaySql(); + } else { + dispalySql = filterDisplaySql(cb.toDisplaySql(), cb + .getTableSqlName()); + } + msg = msg + "[Executed SQL for Display]" + getLineSeparator() + + dispalySql + getLineSeparator(); + } else { + msg = msg + "[Search Condition]" + getLineSeparator() + + searchKey4Log + getLineSeparator(); + } + msg = msg + "* * * * * * * * * */"; + throw new jp.sf.pal.announcement.db.allcommon.exception.EntityAlreadyDeletedException( + msg); + } + + public static void throwEntityDuplicatedException(String resultCountString, + Object searchKey4Log, Throwable cause) { + String msg = "Look! Read the message below." + getLineSeparator(); + msg = msg + + "/* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * *" + + getLineSeparator(); + msg = msg + + "The entity was Too Many! it has been duplicated. It should be the only one! But the resultCount=" + + resultCountString + getLineSeparator(); + msg = msg + getLineSeparator(); + msg = msg + "[Advice]" + getLineSeparator(); + msg = msg + + "Please confirm your search condition. Does it really select the only one?" + + getLineSeparator(); + msg = msg + + "Please confirm your database. Does it really exist the only one?" + + getLineSeparator(); + msg = msg + getLineSeparator(); + if (searchKey4Log != null && searchKey4Log instanceof ConditionBean) { + final ConditionBean cb = (ConditionBean) searchKey4Log; + final String dispalySql; + if (cb.isFormatSql()) { + dispalySql = cb.toDisplaySql(); + } else { + dispalySql = filterDisplaySql(cb.toDisplaySql(), cb + .getTableSqlName()); + } + msg = msg + "[Executed SQL for Display]" + getLineSeparator() + + dispalySql + getLineSeparator(); + } else { + msg = msg + "[Search Condition]" + getLineSeparator() + + searchKey4Log + getLineSeparator(); + } + msg = msg + "* * * * * * * * * */"; + if (cause != null) { + throw new jp.sf.pal.announcement.db.allcommon.exception.EntityDuplicatedException( + msg, cause); + } else { + throw new jp.sf.pal.announcement.db.allcommon.exception.EntityDuplicatedException( + msg); + } + } + + protected static String filterDisplaySql(String displaySql, + String tableDbName) { + if (displaySql == null || displaySql.trim().length() == 0) { + return null; + } + if (displaySql.indexOf(getLineSeparator()) >= 0) { + return displaySql; + } + int basePointIndex = displaySql.indexOf(" from " + tableDbName); + if (basePointIndex < 0) { + return displaySql; + } + return displaySql.substring(0, basePointIndex) + getLineSeparator() + + " " + displaySql.substring(basePointIndex); + } + + // =================================================================================== + // Display SQL + // =========== + public static String convertConditionBean2DisplaySql(ConditionBean cb) { + final String twoWaySql; + if (cb.isLimitSelect_PKOnly()) { + twoWaySql = cb.getSqlClause().getClausePKOnly(); + } else { + twoWaySql = cb.getSqlClause().getClause(); + } + return InternalSqlParser.convertTwoWaySql2DisplaySql(twoWaySql, cb); + } + + // =================================================================================== + // Helper + // ====== + /** + * Get the value of line separator. + * + * @return The value of line separator. (NotNull) + */ + protected static String getLineSeparator() { + return System.getProperty("line.separator"); + } +} Property changes on: announcement/trunk/src/main/java/jp/sf/pal/announcement/db/allcommon/cbean/ConditionBeanContext.java ___________________________________________________________________ Name: svn:eol-style + native Added: announcement/trunk/src/main/java/jp/sf/pal/announcement/db/allcommon/cbean/ConditionQuery.java =================================================================== --- announcement/trunk/src/main/java/jp/sf/pal/announcement/db/allcommon/cbean/ConditionQuery.java (rev 0) +++ announcement/trunk/src/main/java/jp/sf/pal/announcement/db/allcommon/cbean/ConditionQuery.java 2008-06-30 02:54:27 UTC (rev 1002) @@ -0,0 +1,122 @@ +package jp.sf.pal.announcement.db.allcommon.cbean; + +import jp.sf.pal.announcement.db.allcommon.cbean.cvalue.ConditionValue; +import jp.sf.pal.announcement.db.allcommon.cbean.sqlclause.SqlClause; + +/** + * The condition-query as interface. + * @author DBFlute(AutoGenerator) + */ + @ SuppressWarnings("unchecked") +public interface ConditionQuery { + + // =================================================================================== + // Important Accessor + // ================== + /** + * Get table DB-name. + * @return Table DB-name. (NotNull) + */ + public String getTableDbName(); + + /** + * Get table SQL-name. + * @return Table SQL-name. (NotNull) + */ + public String getTableSqlName(); + + /** + * Get real alias name(that has nest level mark). + * @return Real alias name. (NotNull) + */ + public String getRealAliasName(); + + /** + * Get real column name(with real alias name). + * @param columnName Column name without alias name. (NotNull) + * @return Real column name. (NotNull) + */ + public String getRealColumnName(String columnName); + + /** + * Get child query. + * @return Child query. (Nullable) + */ + public ConditionQuery getChildQuery(); + + /** + * Get sql clause. + * @return Sql clause. (NotNull) + */ + public SqlClause getSqlClause(); + + /** + * Get alias name. + * @return Alias name. (NotNull) + */ + public String getAliasName(); + + /** + * Get nest level. + * @return Nest level. + */ + public int getNestLevel(); + + /** + * Get next nest level. + * @return Next nest level. + */ + public int getNextNestLevel(); + + /** + * Is base query? + * @param query Condition query. (NotNull) + * @return Determination. + */ + public boolean isBaseQuery(ConditionQuery query); + + /** + * Get the level of subQuery. + * @return The level of subQuery. + */ + public int getSubQueryLevel(); + + /** + * Get the property name of foreign relation. + * @return The property name of foreign relation. (NotNull) + */ + public String getForeignPropertyName(); + + // =================================================================================== + // Invoke + // ====== + /** + * Invoke getting value. + * @param columnFlexibleName The flexible name of the column. (NotNull and NotEmpty) + * @return The conditionValue. (NotNull) + */ + public ConditionValue invokeValue(String columnFlexibleName); + + /** + * Invoke setting query. + * @param columnFlexibleName The flexible name of the column. (NotNull and NotEmpty) + * @param conditionKeyName The name of the conditionKey. (NotNull) + * @param value The value of the condition. (NotNull) + */ + public void invokeQuery(String columnFlexibleName, String conditionKeyName, + Object value); + + /** + * Invoke adding orderBy. + * @param columnFlexibleName The flexible name of the column. (NotNull and NotEmpty) + * @param isAsc Is it ascend? + */ + public void invokeOrderBy(String columnFlexibleName, boolean isAsc); + + /** + * Invoke getting foreign conditionQuery. + * @param foreignPropertyName The property name of the foreign relation. (NotNull and NotEmpty) + * @return The conditionQuery of the foreign relation as interface. (NotNull) + */ + public ConditionQuery invokeForeignCQ(String foreignPropertyName); +} Property changes on: announcement/trunk/src/main/java/jp/sf/pal/announcement/db/allcommon/cbean/ConditionQuery.java ___________________________________________________________________ Name: svn:eol-style + native Added: announcement/trunk/src/main/java/jp/sf/pal/announcement/db/allcommon/cbean/FetchNarrowingBean.java =================================================================== --- announcement/trunk/src/main/java/jp/sf/pal/announcement/db/allcommon/cbean/FetchNarrowingBean.java (rev 0) +++ announcement/trunk/src/main/java/jp/sf/pal/announcement/db/allcommon/cbean/FetchNarrowingBean.java 2008-06-30 02:54:27 UTC (rev 1002) @@ -0,0 +1,61 @@ +package jp.sf.pal.announcement.db.allcommon.cbean; + +/** + * The bean of fetch narrowing. + * + * @author DBFlute(AutoGenerator) + */ +public interface FetchNarrowingBean { + + /** + * Get fetch start index. + * + * @return Fetch start index. + */ + public int getFetchNarrowingSkipStartIndex(); + + /** + * Get fetch size. + * + * @return Fetch size. + */ + public int getFetchNarrowingLoopCount(); + + /** + * Is fetch start index supported? + * + * @return Determination. + */ + public boolean isFetchNarrowingSkipStartIndexEffective(); + + /** + * Is fetch size supported? + * + * @return Determination. + */ + public boolean isFetchNarrowingLoopCountEffective(); + + /** + * Is fetch-narrowing effective? + * + * @return Determination. + */ + public boolean isFetchNarrowingEffective(); + + /** + * Ignore fetch narrowing. Only checking safety result size is valid. {INTERNAL METHOD} + */ + public void ignoreFetchNarrowing(); + + /** + * Restore ignored fetch narrowing. {INTERNAL METHOD} + */ + public void restoreIgnoredFetchNarrowing(); + + /** + * Get safety max result size. + * + * @return Safety max result size. + */ + public int getSafetyMaxResultSize(); +} Property changes on: announcement/trunk/src/main/java/jp/sf/pal/announcement/db/allcommon/cbean/FetchNarrowingBean.java ___________________________________________________________________ Name: svn:eol-style + native Added: announcement/trunk/src/main/java/jp/sf/pal/announcement/db/allcommon/cbean/FetchNarrowingBeanContext.java =================================================================== --- announcement/trunk/src/main/java/jp/sf/pal/announcement/db/allcommon/cbean/FetchNarrowingBeanContext.java (rev 0) +++ announcement/trunk/src/main/java/jp/sf/pal/announcement/db/allcommon/cbean/FetchNarrowingBeanContext.java 2008-06-30 02:54:27 UTC (rev 1002) @@ -0,0 +1,79 @@ +package jp.sf.pal.announcement.db.allcommon.cbean; + +/** + * Fetch-Narrowing-Bean context. (referring to s2pager) + * + * @author DBFlute(AutoGenerator) + */ +public class FetchNarrowingBeanContext { + + /** The thread-local for this. */ + private static ThreadLocal _threadLocal = new ThreadLocal(); + + /** + * Get fetch-narrowing-bean on thread. + * + * @return Condition-bean context. (Nullable) + */ + public static FetchNarrowingBean getFetchNarrowingBeanOnThread() { + return (FetchNarrowingBean) _threadLocal.get(); + } + + /** + * Set fetch-narrowing-bean on thread. + * + * @param cb Condition-bean. (NotNull) + */ + public static void setFetchNarrowingBeanOnThread(FetchNarrowingBean cb) { + if (cb == null) { + String msg = "The argument[cb] must not be null."; + throw new IllegalArgumentException(msg); + } + _threadLocal.set(cb); + } + + /** + * Is existing fetch-narrowing-bean on thread? + * + * @return Determination. + */ + public static boolean isExistFetchNarrowingBeanOnThread() { + return (_threadLocal.get() != null); + } + + /** + * Clear fetch-narrowing-bean on thread. + */ + public static void clearFetchNarrowingBeanOnThread() { + _threadLocal.set(null); + } + + /** + * Is the argument fetch-narrowing-bean? + * + * @param dtoInstance Dto instance. + * @return Determination. + */ + public static boolean isTheArgumentFetchNarrowingBean( + final Object dtoInstance) { + if (dtoInstance instanceof FetchNarrowingBean) { + return true; + } else { + return false; + } + } + + /** + * Is the type fetch-narrowing-bean? + * + * @param dtoClass DtoClass. + * @return Determination. + */ + public static boolean isTheTypeFetchNarrowingBean(final Class dtoClass) { + if (FetchNarrowingBean.class.isAssignableFrom(dtoClass)) { + return true; + } else { + return false; + } + } +} Property changes on: announcement/trunk/src/main/java/jp/sf/pal/announcement/db/allcommon/cbean/FetchNarrowingBeanContext.java ___________________________________________________________________ Name: svn:eol-style + native Added: announcement/trunk/src/main/java/jp/sf/pal/announcement/db/allcommon/cbean/ListResultBean.java =================================================================== --- announcement/trunk/src/main/java/jp/sf/pal/announcement/db/allcommon/cbean/ListResultBean.java (rev 0) +++ announcement/trunk/src/main/java/jp/sf/pal/announcement/db/allcommon/cbean/ListResultBean.java 2008-06-30 02:54:27 UTC (rev 1002) @@ -0,0 +1,346 @@ +package jp.sf.pal.announcement.db.allcommon.cbean; + +import java.util.ArrayList; +import java.util.List; + +import jp.sf.pal.announcement.db.allcommon.cbean.grouping.GroupingOption; +import jp.sf.pal.announcement.db.allcommon.cbean.grouping.GroupingRowEndDeterminer; +import jp.sf.pal.announcement.db.allcommon.cbean.grouping.GroupingRowResource; +import jp.sf.pal.announcement.db.allcommon.cbean.grouping.GroupingRowSetupper; +import jp.sf.pal.announcement.db.allcommon.cbean.mapping.EntityDtoMapper; +import jp.sf.pal.announcement.db.allcommon.cbean.sqlclause.OrderByClause; + +/** + * The list-result-bean for ListResultBean. + * @param The type of entity for the element of selected list. + * @author DBFlute(AutoGenerator) + */ +public class ListResultBean implements List, + java.io.Serializable { + + // =================================================================================== + // Definition + // ========== + /** Serial version UID. (Default) */ + private static final long serialVersionUID = 1L; + + // =================================================================================== + // Attribute + // ========= + /** The value of table db-name. */ + protected String _tableDbName; + + /** The value of all record count. */ + protected int _allRecordCount; + + /** Selected list. */ + protected List _selectedList = new java.util.ArrayList(); + + /** Order-by clause. */ + protected OrderByClause _orderByClause = new OrderByClause(); + + // =================================================================================== + // Constructor + // =========== + /** + * Constructor. + */ + public ListResultBean() { + } + + // =================================================================================== + // Grouping + // ======== + public List groupingList( + GroupingRowSetupper groupingRowSetupper, + GroupingOption groupingOption) { + final List groupingList = new ArrayList(); + GroupingRowEndDeterminer rowEndDeterminer = groupingOption + .getGroupingRowEndDeterminer(); + if (rowEndDeterminer == null) { + rowEndDeterminer = new GroupingRowEndDeterminer() { + public boolean determine(int columnIndex, int columnCount, + GroupingRowResource rowResource, + ENTITY nextEntity) { + return columnIndex == (columnCount - 1); + } + };// as Default + } + GroupingRowResource rowResource = new GroupingRowResource(); + int columnCount = groupingOption.getColumnCount(); + int columnIndex = 0; + int rowIndex = 0; + for (ENTITY entity : _selectedList) { + // Set up row resource. + rowResource.addGroupingRowList(entity); + + if (_selectedList.size() == (rowIndex + 1)) {// Last Loop! + // Callback! + final ROW groupingRowObject = groupingRowSetupper + .setup(rowResource); + + // Register! + groupingList.add(groupingRowObject); + break; + } + + ENTITY nextElement = null; + if (_selectedList.size() > (rowIndex + 1)) { + nextElement = _selectedList.get(rowIndex); + } + + // Do at row end. + if (rowEndDeterminer.determine(columnIndex, columnCount, + rowResource, nextElement)) { + // Callback! + final ROW groupingRowObject = groupingRowSetupper + .setup(rowResource); + + // Register! + groupingList.add(groupingRowObject); + + // Initialize! + rowResource = new GroupingRowResource(); + columnIndex = 0; + ++rowIndex; + continue; + } + ++columnIndex; + ++rowIndex; + } + return groupingList; + } + + // =================================================================================== + // Mapping + // ======= + public ListResultBean mappingList( + EntityDtoMapper entityDtoMapper) { + final ListResultBean mappingList = new ListResultBean(); + for (ENTITY entity : _selectedList) { + mappingList.add(entityDtoMapper.map(entity)); + } + mappingList.setTableDbName(getTableDbName()); + mappingList.setAllRecordCount(getAllRecordCount()); + mappingList.setOrderByClause(getOrderByClause()); + return mappingList; + } + + // =================================================================================== + // Determination + // ============= + /** + * Has this result selected? + * @return Determination. + */ + public boolean isSelectedResult() { + return _tableDbName != null; + } + + // =================================================================================== + // Basic Override + // ============== + /** + * @return Hash-code from primary-keys. + */ + public int hashCode() { + if (_selectedList == null) { + return super.hashCode(); + } + return _selectedList.hashCode(); + } + + /** + * @param other Other entity. (Nullable) + * @return Comparing result. If other is null, returns false. + */ + public boolean equals(Object other) { + if (_selectedList == null) { + return false; + } + if (other == null) { + return false; + } + if (!(other instanceof List)) { + return false; + } + return _selectedList.equals(other); + } + + /** + * @return The view string of all attribute values. (NotNull) + */ + @Override + public String toString() { + final StringBuilder sb = new StringBuilder(); + + sb.append(" tableDbName=").append(_tableDbName); + sb.append(" allRecordCount=").append(_allRecordCount); + sb.append(" selectedList.size()=").append(_selectedList.size()); + sb.append(" orderByClause=").append(_orderByClause); + + return sb.toString(); + } + + // =================================================================================== + // List Elements + // ============= + public boolean add(ENTITY o) { + return _selectedList.add(o); + } + + public boolean addAll(java.util.Collection c) { + return _selectedList.addAll(c); + } + + public void clear() { + _selectedList.clear(); + } + + public boolean contains(Object o) { + return _selectedList.contains(o); + } + + public boolean containsAll(java.util.Collection c) { + return _selectedList.containsAll(c); + } + + public boolean isEmpty() { + return _selectedList.isEmpty(); + } + + public java.util.Iterator iterator() { + return _selectedList.iterator(); + } + + public boolean remove(Object o) { + return _selectedList.remove(o); + } + + public boolean removeAll(java.util.Collection c) { + return _selectedList.removeAll(c); + } + + public boolean retainAll(java.util.Collection c) { + return _selectedList.retainAll(c); + } + + public int size() { + return _selectedList.size(); + } + + public Object[] toArray() { + return _selectedList.toArray(); + } + + public TYPE[] toArray(TYPE[] a) { + return _selectedList.toArray(a); + } + + public void add(int index, ENTITY element) { + _selectedList.add(index, element); + } + + public boolean addAll(int index, java.util.Collection c) { + return _selectedList.addAll(index, c); + } + + public ENTITY get(int index) { + return _selectedList.get(index); + } + + public int indexOf(Object o) { + return _selectedList.indexOf(o); + } + + public int lastIndexOf(Object o) { + return _selectedList.lastIndexOf(o); + } + + public java.util.ListIterator listIterator() { + return _selectedList.listIterator(); + } + + public java.util.ListIterator listIterator(int index) { + return _selectedList.listIterator(index); + } + + public ENTITY remove(int index) { + return _selectedList.remove(index); + } + + public ENTITY set(int index, ENTITY element) { + return _selectedList.set(index, element); + } + + public java.util.List subList(int fromIndex, int toIndex) { + return _selectedList.subList(fromIndex, toIndex); + } + + // =================================================================================== + // Accessor + // ======== + /** + * Get the value of tableDbName. + * @return The value of tableDbName. (Nullable: If it's null, it means 'Not Selected Yet'.) + */ + public String getTableDbName() { + return _tableDbName; + } + + /** + * Set the value of tableDbName. + * @param tableDbName The value of tableDbName. (NotNull) + */ + public void setTableDbName(String tableDbName) { + _tableDbName = tableDbName; + } + + /** + * Get the value of allRecordCount. + * @return The value of allRecordCount. + */ + public int getAllRecordCount() { + return _allRecordCount; + } + + /** + * Set the value of allRecordCount. + * @param allRecordCount The value of allRecordCount. + */ + public void setAllRecordCount(int allRecordCount) { + _allRecordCount = allRecordCount; + } + + /** + * Get the value of selectedList. + * @return Selected list. (Nullable: If it's null, it means 'Not Selected Yet'.) + */ + public List getSelectedList() { + return _selectedList; + } + + /** + * Set the value of selectedList. + * @param selectedList Selected list. (NotNull) + */ + public void setSelectedList(List selectedList) { + _selectedList = selectedList; + } + + /** + * Get the value of orderByClause. + * @return The value of orderByClause. (Nullable: If it's null, it means 'Not Selected Yet'.) + */ + public OrderByClause getOrderByClause() { + return _orderByClause; + } + + /** + * Set the value of orderByClause. + * @param orderByClause The value of orderByClause. (NotNull) + */ + public void setOrderByClause(OrderByClause orderByClause) { + _orderByClause = orderByClause; + } +} Property changes on: announcement/trunk/src/main/java/jp/sf/pal/announcement/db/allcommon/cbean/ListResultBean.java ___________________________________________________________________ Name: svn:eol-style + native Added: announcement/trunk/src/main/java/jp/sf/pal/announcement/db/allcommon/cbean/MapParameterBean.java =================================================================== --- announcement/trunk/src/main/java/jp/sf/pal/announcement/db/allcommon/cbean/MapParameterBean.java (rev 0) +++ announcement/trunk/src/main/java/jp/sf/pal/announcement/db/allcommon/cbean/MapParameterBean.java 2008-06-30 02:54:27 UTC (rev 1002) @@ -0,0 +1,16 @@ +package jp.sf.pal.announcement.db.allcommon.cbean; + +import java.util.Map; + +/** + * The bean of map parameter. + * @author DBFlute(AutoGenerator) + */ +public interface MapParameterBean { + + /** + * Get the map of parameter. + * @return The map of parameter. (Nullable) + */ + public Map getParameterMap(); +} Property changes on: announcement/trunk/src/main/java/jp/sf/pal/announcement/db/allcommon/cbean/MapParameterBean.java ___________________________________________________________________ Name: svn:eol-style + native Added: announcement/trunk/src/main/java/jp/sf/pal/announcement/db/allcommon/cbean/OrderByBean.java =================================================================== --- announcement/trunk/src/main/java/jp/sf/pal/announcement/db/allcommon/cbean/OrderByBean.java (rev 0) +++ announcement/trunk/src/main/java/jp/sf/pal/announcement/db/allcommon/cbean/OrderByBean.java 2008-06-30 02:54:27 UTC (rev 1002) @@ -0,0 +1,46 @@ +package jp.sf.pal.announcement.db.allcommon.cbean; + +import jp.sf.pal.announcement.db.allcommon.cbean.sqlclause.OrderByClause; + +/** + * The order-by-bean as interface. + * + * @author DBFlute(AutoGenerator) + */ +public interface OrderByBean extends SelectResource { + + /** + * Get sql component of order-by clause. + * + * @return Sql component of order-by clause. (NotNull) + */ + public OrderByClause getSqlComponentOfOrderByClause(); + + /** + * Get order-by clause. + * + * @return Order-by clause. (NotNull) + */ + public String getOrderByClause(); + + /** + * Clear order-by. + * + * @return this. (NotNull) + */ + public OrderByBean clearOrderBy(); + + /** + * Ignore order-by. + * + * @return this. (NotNull) + */ + public OrderByBean ignoreOrderBy(); + + /** + * Make order-by effective. + * + * @return this. (NotNull) + */ + public OrderByBean makeOrderByEffective(); +} Property changes on: announcement/trunk/src/main/java/jp/sf/pal/announcement/db/allcommon/cbean/OrderByBean.java ___________________________________________________________________ Name: svn:eol-style + native Added: announcement/trunk/src/main/java/jp/sf/pal/announcement/db/allcommon/cbean/PagingBean.java =================================================================== --- announcement/trunk/src/main/java/jp/sf/pal/announcement/db/allcommon/cbean/PagingBean.java (rev 0) +++ announcement/trunk/src/main/java/jp/sf/pal/announcement/db/allcommon/cbean/PagingBean.java 2008-06-30 02:54:27 UTC (rev 1002) @@ -0,0 +1,134 @@ +package jp.sf.pal.announcement.db.allcommon.cbean; + +/** + * The bean of paging. + * + * @author DBFlute(AutoGenerator) + */ +public interface PagingBean extends FetchNarrowingBean, OrderByBean { + + // =================================================================================== + // Paging Determination + // ==================== + // * * * * * * * * + // For SQL Comment + // * * * * * * * * + /** + * Is the execution for paging(NOT count)? + * + * @return Determination. + */ + public boolean isPaging(); + + /** + * Set whether the execution for paging(NOT count). {INTERNAL METHOD} + * + * @param paging Determination. + */ + public void xsetPaging(boolean paging); + + // =================================================================================== + // Fetch Setting + // ============= + /** + * Fetch first.
    + * If you invoke this, your SQL returns [fetch-size] records from first.
    + * + * @param fetchSize The size of fetch. (NotMinus & NotZero) + * @return this. (NotNull) + */ + public PagingBean fetchFirst(int fetchSize); + + /** + * Fetch scope.
    + * If you invoke this, your SQL returns [fetch-size] records from [fetch-start-index].
    + * + * @param fetchStartIndex The start index of fetch. 0 origin. (NotMinus) + * @param fetchSize The size of fetch. (NotMinus & NotZero) + * @return this. (NotNull) + */ + public PagingBean fetchScope(int fetchStartIndex, int fetchSize); + + /** + * Fetch page.
    + * When you invoke this, it is normally necessary to invoke 'fetchFirst()' or 'fetchScope()' ahead of that.
    + * But you also can use default-fetch-size without invoking 'fetchFirst()' or 'fetchScope()'.
    + * If you invoke this, your SQL returns [fetch-size] records from [fetch-start-index] calculated by [fetch-page-number].
    + * + * @param fetchPageNumber The page number of fetch. 1 origin. (NotMinus & NotZero: If minus or zero, set one.) + * @return this. (NotNull) + */ + public PagingBean fetchPage(int fetchPageNumber); + + // =================================================================================== + // Fetch Property + // ============== + /** + * Get fetch-start-index. + * + * @return Fetch-start-index. + */ + public int getFetchStartIndex(); + + /** + * Get fetch-size. + * + * @return Fetch-size. + */ + public int getFetchSize(); + + /** + * Get fetch-page-number. + * + * @return Fetch-page-number. + */ + public int getFetchPageNumber(); + + /** + * Get page start index. + * + * @return Page start index. 0 origin. (NotMinus) + */ + public int getPageStartIndex(); + + /** + * Get page end index. + * + * @return Page end index. 0 origin. (NotMinus) + */ + public int getPageEndIndex(); + + /** + * Is fetch scope effective? + * + * @return Determination. + */ + public boolean isFetchScopeEffective(); + + // =================================================================================== + // Hint Property + // ============= + // * * * * * * * * + // For SQL Comment + // * * * * * * * * + /** + * Get select-hint. {select [select-hint] * from table...} + * + * @return Select-hint. (NotNull) + */ + public String getSelectHint(); + + /** + * Get from-hint. {select * from table [from-hint] where ...} + * + * @return From-hint. (NotNull) + */ + public String getFromHint(); + + /** + * Get sql-suffix. {select * from table where ... order by ... [sql-suffix]} + * + * @return Sql-suffix. (NotNull) + */ + public String getSqlSuffix(); +} Property changes on: announcement/trunk/src/main/java/jp/sf/pal/announcement/db/allcommon/cbean/PagingBean.java ___________________________________________________________________ Name: svn:eol-style + native Added: announcement/trunk/src/main/java/jp/sf/pal/announcement/db/allcommon/cbean/PagingHandler.java =================================================================== --- announcement/trunk/src/main/java/jp/sf/pal/announcement/db/allcommon/cbean/PagingHandler.java (rev 0) +++ announcement/trunk/src/main/java/jp/sf/pal/announcement/db/allcommon/cbean/PagingHandler.java 2008-06-30 02:54:27 UTC (rev 1002) @@ -0,0 +1,31 @@ +package jp.sf.pal.announcement.db.allcommon.cbean; + +/** + * The handler of paging. + * + * @param The type of entity. + * @author DBFlute(AutoGenerator) + */ +public interface PagingHandler { + + /** + * Get the bean of paging. + * + * @return The bean of paging. (NotNull) + */ + public PagingBean getPagingBean(); + + /** + * Execute SQL for count. + * + * @return The count of execution. + */ + public int count(); + + /** + * Execute SQL for paging. + * + * @return The list of entity. (NotNull) + */ + public java.util.List paging(); +} Property changes on: announcement/trunk/src/main/java/jp/sf/pal/announcement/db/allcommon/cbean/PagingHandler.java ___________________________________________________________________ Name: svn:eol-style + native Added: announcement/trunk/src/main/java/jp/sf/pal/announcement/db/allcommon/cbean/PagingInvoker.java =================================================================== --- announcement/trunk/src/main/java/jp/sf/pal/announcement/db/allcommon/cbean/PagingInvoker.java (rev 0) +++ announcement/trunk/src/main/java/jp/sf/pal/announcement/db/allcommon/cbean/PagingInvoker.java 2008-06-30 02:54:27 UTC (rev 1002) @@ -0,0 +1,91 @@ +package jp.sf.pal.announcement.db.allcommon.cbean; + +/** + * The invoker of paging. + * + * @author DBFlute(AutoGenerator) + */ +public class PagingInvoker { + + // =================================================================================== + // Attribute + // ========= + protected String _tableDbName; + + // =================================================================================== + // Constructor + // =========== + public PagingInvoker(String tableDbName) { + _tableDbName = tableDbName; + } + + // =================================================================================== + // Invoke + // ====== + /** + * Invoke select-page by handler. + * + * @param handler The handler of paging. (NotNull) + * @return The result bean of paging. (NotNull) + */ + public PagingResultBean invokePaging(PagingHandler handler) { + assertObjectNotNull("handler", handler); + final PagingBean pagingBean = handler.getPagingBean(); + assertObjectNotNull("handler.getPagingBean()", pagingBean); + if (!pagingBean.isFetchScopeEffective()) { + String msg = "The paging bean is not effective about fetch-scope!"; + msg = msg + + " When you select page, you should set up fetch-scope of paging bean(Should invoke fetchFirst() and fetchPage()!)."; + msg = msg + " The paging bean is: " + pagingBean; + throw new IllegalStateException(msg); + } + final int allRecordCount = handler.count(); + final java.util.List selectedList = handler.paging(); + final PagingResultBean rb = new ResultBeanBuilder( + _tableDbName).buildPagingResultBean(pagingBean, allRecordCount, + selectedList); + if (isNecessaryToReadPageAgain(rb)) { + pagingBean.fetchPage(rb.getAllPageCount()); + final int reAllRecordCount = handler.count(); + final java.util.List reSelectedList = handler.paging(); + return new ResultBeanBuilder(_tableDbName) + .buildPagingResultBean(pagingBean, reAllRecordCount, + reSelectedList); + } else { + return rb; + } + } + + /** + * Is it necessary to read page again? + * + * @param rb The result bean of paging. (NotNull) + * @return Determination. + */ + protected boolean isNecessaryToReadPageAgain(PagingResultBean rb) { + return rb.getAllRecordCount() > 0 && rb.getSelectedList().isEmpty(); + } + + // =================================================================================== + // Helper + // ====== + /** + * Assert that the object is not null. + * + * @param variableName Variable name. (NotNull) + * @param value Value. (NotNull) + * @exception IllegalArgumentException + */ + protected void assertObjectNotNull(String variableName, Object value) { + if (variableName == null) { + String msg = "The value should not be null: variableName=" + + variableName + " value=" + value; + throw new IllegalArgumentException(msg); + } + if (value == null) { + String msg = "The value should not be null: variableName=" + + variableName; + throw new IllegalArgumentException(msg); + } + } +} Property changes on: announcement/trunk/src/main/java/jp/sf/pal/announcement/db/allcommon/cbean/PagingInvoker.java ___________________________________________________________________ Name: svn:eol-style + native Added: announcement/trunk/src/main/java/jp/sf/pal/announcement/db/allcommon/cbean/PagingResultBean.java =================================================================== --- announcement/trunk/src/main/java/jp/sf/pal/announcement/db/allcommon/cbean/PagingResultBean.java (rev 0) +++ announcement/trunk/src/main/java/jp/sf/pal/announcement/db/allcommon/cbean/PagingResultBean.java 2008-06-30 02:54:27 UTC (rev 1002) @@ -0,0 +1,338 @@ +package jp.sf.pal.announcement.db.allcommon.cbean; + +import jp.sf.pal.announcement.db.allcommon.cbean.mapping.EntityDtoMapper; +import jp.sf.pal.announcement.db.allcommon.cbean.pagenavi.group.PageGroupBean; +import jp.sf.pal.announcement.db.allcommon.cbean.pagenavi.group.PageGroupOption; +import jp.sf.pal.announcement.db.allcommon.cbean.pagenavi.range.PageRangeBean; +import jp.sf.pal.announcement.db.allcommon.cbean.pagenavi.range.PageRangeOption; + +/** + * The paging-result-bean for specified entity. + * @param The type of entity for the element of selected list. + * @author DBFlute(AutoGenerator) + */ +public class PagingResultBean extends ListResultBean { + + // =================================================================================== + // Definition + // ========== + /** Serial version UID. (Default) */ + private static final long serialVersionUID = 1L; + + // =================================================================================== + // Attribute + // ========= + // ----------------------------------------------------- + // Page Basic Info + // --------------- + /** The value of current page number. */ + protected int _pageSize; + + /** The value of current page number. */ + protected int _currentPageNumber; + + // ----------------------------------------------------- + // Page Group + // ---------- + /** The value of page-group bean. */ + protected PageGroupBean _pageGroupBean; + + /** The value of page-group option. */ + protected PageGroupOption _pageGroupOption; + + // ----------------------------------------------------- + // Page Range + // ---------- + /** The value of page-range bean. */ + protected PageRangeBean _pageRangeBean; + + /** The value of page-range option. */ + protected PageRangeOption _pageRangeOption; + + // =================================================================================== + // Constructor + // =========== + /** + * Constructor. + */ + public PagingResultBean() { + } + + // =================================================================================== + // Calculated Property + // =================== + /** + * Get the value of allPageCount that is calculated. + * @return The value of allPageCount. + */ + public int getAllPageCount() { + return calculateAllPageCount(_allRecordCount, _pageSize); + } + + /** + * Get the value of currentStartRecordNumber that is calculated. + * @return The value of currentStartRecordNumber. + */ + public int getCurrentStartRecordNumber() { + return calculateCurrentStartRecordNumber(_currentPageNumber, _pageSize); + } + + /** + * Get the value of currentEndRecordNumber that is calculated. + * @return The value of currentEndRecordNumber. + */ + public int getCurrentEndRecordNumber() { + return calculateCurrentEndRecordNumber(_currentPageNumber, _pageSize); + } + + // =================================================================================== + // Page Group/Range + // ================ + // ----------------------------------------------------- + // Page Group + // ---------- + /** + * Get the value of pageGroupSize. + * @return The value of pageGroupSize. + */ + public int getPageGroupSize() { + return _pageGroupOption != null ? _pageGroupOption.getPageGroupSize() + : 0; + } + + /** + * Set the value of pageGroupSize. + * @param pageGroupSize The value of pageGroupSize. + */ + public void setPageGroupSize(int pageGroupSize) { + final PageGroupOption option = new PageGroupOption(); + option.setPageGroupSize(pageGroupSize); + setPageGroupOption(option); + } + + /** + * Set the value of pageGroupOption. + * @param pageGroupOption The value of pageGroupOption. (Nullable) + */ + public void setPageGroupOption(PageGroupOption pageGroupOption) { + _pageGroupOption = pageGroupOption; + } + + /** + * Get the value of pageGroupBean. + * @return The value of pageGroupBean. (NotNull) + */ + public PageGroupBean pageGroup() { + assertPageGroupValid(); + if (_pageGroupBean == null) { + _pageGroupBean = new PageGroupBean(); + } + _pageGroupBean.setPageGroupOption(_pageGroupOption); + _pageGroupBean.setCurrentPageNumber(getCurrentPageNumber()); + _pageGroupBean.setAllPageCount(getAllPageCount()); + return _pageGroupBean; + } + + protected void assertPageGroupValid() { + if (_pageGroupOption == null) { + String msg = "The pageGroupOption should not be null. Please invoke setPageGroupOption()."; + throw new IllegalStateException(msg); + } + if (_pageGroupOption.getPageGroupSize() == 0) { + String msg = "The pageGroupSize should be greater than 1. But the value is zero."; + msg = msg + " pageGroupSize=" + _pageGroupOption.getPageGroupSize(); + throw new IllegalStateException(msg); + } + if (_pageGroupOption.getPageGroupSize() == 1) { + String msg = "The pageGroupSize should be greater than 1. But the value is one."; + msg = msg + " pageGroupSize=" + _pageGroupOption.getPageGroupSize(); + throw new IllegalStateException(msg); + } + } + + // ----------------------------------------------------- + // Page Range + // ---------- + /** + * Get the value of pageRangeSize. + * @return The value of pageRangeSize. + */ + public int getPageRangeSize() { + return _pageRangeOption != null ? _pageRangeOption.getPageRangeSize() + : 0; + } + + /** + * Set the value of pageRangeSize. + * @param pageRangeSize The value of pageRangeSize. + */ + public void setPageRangeSize(int pageRangeSize) { + final PageRangeOption option = new PageRangeOption(); + option.setPageRangeSize(pageRangeSize); + setPageRangeOption(option); + } + + /** + * Set the value of pageRangeOption. + * @param pageRangeOption The value of pageRangeOption. (Nullable) + */ + public void setPageRangeOption(PageRangeOption pageRangeOption) { + this._pageRangeOption = pageRangeOption; + } + + /** + * Get the value of pageRangeBean. + * @return The value of pageRangeBean. (NotNull) + */ + public PageRangeBean pageRange() { + assertPageRangeValid(); + if (_pageRangeBean == null) { + _pageRangeBean = new PageRangeBean(); + } + _pageRangeBean.setPageRangeOption(_pageRangeOption); + _pageRangeBean.setCurrentPageNumber(getCurrentPageNumber()); + _pageRangeBean.setAllPageCount(getAllPageCount()); + return _pageRangeBean; + } + + protected void assertPageRangeValid() { + if (_pageRangeOption == null) { + String msg = "The pageRangeOption should not be null. Please invoke setPageRangeOption()."; + throw new IllegalStateException(msg); + } + final int pageRangeSize = _pageRangeOption.getPageRangeSize(); + if (pageRangeSize == 0) { + String msg = "The pageRangeSize should be greater than 1. But the value is zero."; + throw new IllegalStateException(msg); + } + } + + // =================================================================================== + // Determination + // ============= + /** + * Is existing previous page? + * Using values are currentPageNumber. + * @return Determination. + */ + public boolean isExistPrePage() { + return (_allRecordCount > 0 && _currentPageNumber > 1); + } + + /** + * Is existing next page? + * Using values are currentPageNumber and allPageCount. + * @return Determination. + */ + public boolean isExistNextPage() { + return (_allRecordCount > 0 && _currentPageNumber < getAllPageCount()); + } + + // =================================================================================== + // Mapping + // ======= + public PagingResultBean mappingList( + EntityDtoMapper entityDtoMapper) { + final ListResultBean ls = super.mappingList(entityDtoMapper); + final PagingResultBean mappingList = new PagingResultBean(); + mappingList.setSelectedList(ls.getSelectedList()); + mappingList.setTableDbName(getTableDbName()); + mappingList.setAllRecordCount(getAllRecordCount()); + mappingList.setOrderByClause(getOrderByClause()); + mappingList.setPageSize(getPageSize()); + mappingList.setCurrentPageNumber(getCurrentPageNumber()); + mappingList.setPageRangeOption(_pageRangeOption); + mappingList.setPageGroupOption(_pageGroupOption); + return mappingList; + } + + // =================================================================================== + // Calculate(Internal) + // =================== + /** + * Calculate all page count. + * @param allRecordCount All record count. + * @param pageSize Fetch-size. + * @return All page count. + */ + protected int calculateAllPageCount(int allRecordCount, int pageSize) { + if (allRecordCount == 0) { + return 1; + } + int pageCountBase = (allRecordCount / pageSize); + if (allRecordCount % pageSize > 0) { + pageCountBase++; + } + return pageCountBase; + } + + protected int calculateCurrentStartRecordNumber(int currentPageNumber, + int pageSize) { + return ((currentPageNumber - 1) * pageSize) + 1; + } + + protected int calculateCurrentEndRecordNumber(int currentPageNumber, + int pageSize) { + return calculateCurrentStartRecordNumber(currentPageNumber, pageSize) + + _selectedList.size() - 1; + } + + // =================================================================================== + // Basic Override + // ============== + /** + * @return The view string of all attribute values. (NotNull) + */ + @Override + public String toString() { + final StringBuilder sb = new StringBuilder(); + + sb.append(getCurrentPageNumber()).append("/").append(getAllPageCount()); + sb.append(" of ").append(getAllRecordCount()); + sb.append(" listSize=").append( + getSelectedList() != null ? new Integer(getSelectedList() + .size()) : null); + sb.append(" pageSize=").append(getPageSize()); + sb.append(" page:{").append(isExistPrePage()).append("/").append( + isExistNextPage()).append("}"); + sb.append(" groupSize=").append(getPageGroupSize()); + sb.append(" rangeSize=").append(getPageRangeSize()); + + return sb.toString(); + } + + // =================================================================================== + // Accessor + // ======== + /** + * Get the value of pageSize. + * @return The value of pageSize. + */ + public int getPageSize() { + return _pageSize; + } + + /** + * Set the value of pageSize. + * @param pageSize The value of pageSize. + */ + public void setPageSize(int pageSize) { + _pageSize = pageSize; + } + + /** + * Get the value of currentPageNumber. + * @return The value of currentPageNumber. + */ + public int getCurrentPageNumber() { + return _currentPageNumber; + } + + /** + * Set the value of currentPageNumber. + * @param currentPageNumber The value of currentPageNumber. + */ + public void setCurrentPageNumber(int currentPageNumber) { + _currentPageNumber = currentPageNumber; + } +} Property changes on: announcement/trunk/src/main/java/jp/sf/pal/announcement/db/allcommon/cbean/PagingResultBean.java ___________________________________________________________________ Name: svn:eol-style + native Added: announcement/trunk/src/main/java/jp/sf/pal/announcement/db/allcommon/cbean/ResultBeanBuilder.java =================================================================== --- announcement/trunk/src/main/java/jp/sf/pal/announcement/db/allcommon/cbean/ResultBeanBuilder.java (rev 0) +++ announcement/trunk/src/main/java/jp/sf/pal/announcement/db/allcommon/cbean/ResultBeanBuilder.java 2008-06-30 02:54:27 UTC (rev 1002) @@ -0,0 +1,64 @@ +package jp.sf.pal.announcement.db.allcommon.cbean; + +import java.util.List; + +/** + * The list-result-bean for ${myClassName}. + * + * @param The type of entity. + * @author DBFlute(AutoGenerator) + */ +public class ResultBeanBuilder { + + // =================================================================================== + // Attribute + // ========= + protected String _tableDbName; + + // =================================================================================== + // Constructor + // =========== + public ResultBeanBuilder(String tableDbName) { + _tableDbName = tableDbName; + } + + // =================================================================================== + // Builder + // ======= + /** + * Build the result bean of list. + * + * @param ob The bean of orderBy. (NotNull) + * @param selectedList Selected list. (NotNull) + * @return The result bean of list. (NotNull) + */ + public ListResultBean buildListResultBean(ConditionBean ob, + List selectedList) { + ListResultBean rb = new ListResultBean(); + rb.setTableDbName(_tableDbName); + rb.setAllRecordCount(selectedList.size()); + rb.setSelectedList(selectedList); + rb.setOrderByClause(ob.getSqlComponentOfOrderByClause()); + return rb; + } + + /** + * Build the result bean of paging. + * + * @param pb The bean of paging. (NotNull) + * @param allRecordCount All record count. + * @param selectedList The list of selected entity. (NotNull) + * @return The result bean of paging. (NotNull) + */ + public PagingResultBean buildPagingResultBean(PagingBean pb, + int allRecordCount, List selectedList) { + PagingResultBean rb = new PagingResultBean(); + rb.setTableDbName(_tableDbName); + rb.setAllRecordCount(allRecordCount); + rb.setSelectedList(selectedList); + rb.setOrderByClause(pb.getSqlComponentOfOrderByClause()); + rb.setPageSize(pb.getFetchSize()); + rb.setCurrentPageNumber(pb.getFetchPageNumber()); + return rb; + } +} Property changes on: announcement/trunk/src/main/java/jp/sf/pal/announcement/db/allcommon/cbean/ResultBeanBuilder.java ___________________________________________________________________ Name: svn:eol-style + native Added: announcement/trunk/src/main/java/jp/sf/pal/announcement/db/allcommon/cbean/SelectResource.java =================================================================== --- announcement/trunk/src/main/java/jp/sf/pal/announcement/db/allcommon/cbean/SelectResource.java (rev 0) +++ announcement/trunk/src/main/java/jp/sf/pal/announcement/db/allcommon/cbean/SelectResource.java 2008-06-30 02:54:27 UTC (rev 1002) @@ -0,0 +1,16 @@ +package jp.sf.pal.announcement.db.allcommon.cbean; + +/** + * The select-resource as marker-interface. + * + * @author DBFlute(AutoGenerator) + */ +public interface SelectResource { + + /** + * Check safety result. + * + * @param safetyMaxResultSize Safety max result size. (If zero or minus, ignore checking) + */ + public void checkSafetyResult(int safetyMaxResultSize); +} Property changes on: announcement/trunk/src/main/java/jp/sf/pal/announcement/db/allcommon/cbean/SelectResource.java ___________________________________________________________________ Name: svn:eol-style + native Added: announcement/trunk/src/main/java/jp/sf/pal/announcement/db/allcommon/cbean/SimpleOrderByBean.java =================================================================== --- announcement/trunk/src/main/java/jp/sf/pal/announcement/db/allcommon/cbean/SimpleOrderByBean.java (rev 0) +++ announcement/trunk/src/main/java/jp/sf/pal/announcement/db/allcommon/cbean/SimpleOrderByBean.java 2008-06-30 02:54:27 UTC (rev 1002) @@ -0,0 +1,155 @@ +package jp.sf.pal.announcement.db.allcommon.cbean; + +import jp.sf.pal.announcement.db.allcommon.cbean.sqlclause.OrderByClause; +import jp.sf.pal.announcement.db.allcommon.cbean.sqlclause.SqlClause; + +/** + * @deprecated + */ +public class SimpleOrderByBean implements OrderByBean { + + // =================================================================================== + // Attribute + // ========= + /** SQL clause instance. */ + protected final SqlClause _sqlClause; + { + _sqlClause = ConditionBeanContext.createSqlClause("Dummy"); + } + + // =================================================================================== + // Constructor + // =========== + /** + * Constructor. + */ + public SimpleOrderByBean() { + } + + // =================================================================================== + // SqlClause + // ========= + /** + * Get sql-clause. + * + * @return Sql clause. (NotNull) + */ + protected SqlClause getSqlClause() { + return _sqlClause; + } + + // =================================================================================== + // Select Resource + // =============== + /** + * Check safety result. + * + * @param safetyMaxResultSize Safety max result size. (If zero or minus, ignore checking) + */ + public void checkSafetyResult(int safetyMaxResultSize) { + throw new UnsupportedOperationException(); + } + + // =================================================================================== + // OrderBy + // ======= + /** + * The implementation. + * + * @return Sql component of order-by clause. (NotNull) + */ + public OrderByClause getSqlComponentOfOrderByClause() { + return getSqlClause().getSqlComponentOfOrderByClause(); + } + + /** + * The implementation. + * + * @return Order-by clause. (NotNull) + */ + public String getOrderByClause() { + return getSqlClause().getOrderByClause(); + } + + /** + * The implementation. + * + * @return this. (NotNull) + */ + public OrderByBean clearOrderBy() { + getSqlClause().clearOrderBy(); + return this; + } + + /** + * The implementation. + * + * @return this. (NotNull) + */ + public OrderByBean ignoreOrderBy() { + getSqlClause().ignoreOrderBy(); + return this; + } + + /** + * The implementation. + * + * @return this. (NotNull) + */ + public OrderByBean makeOrderByEffective() { + getSqlClause().makeOrderByEffective(); + return this; + } + + /** + * Register order-by-asc. + * + * @param orderByProperty Order-by-property. 'aliasName.columnName/aliasName.columnName/...' (NotNull) + * @return this. (NotNull) + * @deprecated + */ + public OrderByBean registerOrderByAsc(String orderByProperty) { + getSqlClause().registerOrderBy(orderByProperty, orderByProperty, true); + return this; + } + + /** + * Register order-by-desc. + * + * @param orderByProperty Order-by-property. 'aliasName.columnName/aliasName.columnName/...' (NotNull) + * @return this. (NotNull) + * @deprecated + */ + public OrderByBean registerOrderByDesc(String orderByProperty) { + getSqlClause().registerOrderBy(orderByProperty, orderByProperty, false); + return this; + } + + /** + * Reverse order-by or Override order-by asc. + * + * @param orderByProperty Order-by-property. 'aliasName.columnName/aliasName.columnName/...' (NotNull) + * @return this. (NotNull) + * @deprecated + */ + public OrderByBean reverseOrderBy_Or_OverrideOrderByAsc( + String orderByProperty) { + getSqlClause().reverseOrderBy_Or_OverrideOrderBy(orderByProperty, + orderByProperty, true); + return this; + } + + /** + * Reverse order-by or Override order-by desc. + * + * @param orderByProperty Order-by-property. 'aliasName.columnName/aliasName.columnName/...' (NotNull) + * @return this. (NotNull) + * @deprecated + */ + public OrderByBean reverseOrderBy_Or_OverrideOrderByDesc( + String orderByProperty) { + getSqlClause().reverseOrderBy_Or_OverrideOrderBy(orderByProperty, + orderByProperty, false); + return this; + } +} Property changes on: announcement/trunk/src/main/java/jp/sf/pal/announcement/db/allcommon/cbean/SimpleOrderByBean.java ___________________________________________________________________ Name: svn:eol-style + native Added: announcement/trunk/src/main/java/jp/sf/pal/announcement/db/allcommon/cbean/SimplePagingBean.java =================================================================== --- announcement/trunk/src/main/java/jp/sf/pal/announcement/db/allcommon/cbean/SimplePagingBean.java (rev 0) +++ announcement/trunk/src/main/java/jp/sf/pal/announcement/db/allcommon/cbean/SimplePagingBean.java 2008-06-30 02:54:27 UTC (rev 1002) @@ -0,0 +1,386 @@ +package jp.sf.pal.announcement.db.allcommon.cbean; + +import java.util.LinkedHashMap; +import java.util.Map; + +import jp.sf.pal.announcement.db.allcommon.cbean.sqlclause.OrderByClause; +import jp.sf.pal.announcement.db.allcommon.cbean.sqlclause.SqlClause; + +/** + * The simple pagingBean. + * + * @author DBFlute(AutoGenerator) + */ +public class SimplePagingBean implements PagingBean, MapParameterBean { + + // =================================================================================== + // Attribute + // ========= + /** SQL clause instance. */ + protected final SqlClause _sqlClause; + { + _sqlClause = ConditionBeanContext.createSqlClause("Dummy"); + } + + /** The map of parameter. (Nullable) */ + protected Map _parameterMap; + + /** Safety max result size. */ + protected int _safetyMaxResultSize; + + /** Is the execution for paging(NOT count)? */ + protected boolean _paging = true; + + /** Is fetch narrowing valid? */ + protected boolean _fetchNarrowing = true; + + /** The map for parameter. */ + protected Map _map; + + // =================================================================================== + // Implementation of PagingBean + // ============================ + // ----------------------------------------------------- + // Paging Determination + // -------------------- + // * * * * * * * * + // For SQL Comment + // * * * * * * * * + /** + * The implementation. + * + * @return Determination. + */ + public boolean isPaging() { + return _paging; + } + + /** + * The implementation. {INTERNAL METHOD: Don't Invoke This!} + * + * @param paging Determination. + */ + public void xsetPaging(boolean paging) { + if (paging) { + getSqlClause().makeFetchScopeEffective(); + } else { + getSqlClause().ignoreFetchScope(); + } + this._paging = paging; + } + + // ----------------------------------------------------- + // Fetch Setting + // ------------- + /** + * Fetch first. + *
    +     * If you invoke this, your SQL returns [fetch-size] records from first.
    +     * 
    + * @param fetchSize Fetch-size. (NotMinus & NotZero) + * @return this. (NotNull) + */ + public PagingBean fetchFirst(int fetchSize) { + getSqlClause().fetchFirst(fetchSize); + return this; + } + + /** + * Fetch scope. + *
    +     * If you invoke this, your SQL returns [fetch-size] records from [fetch-start-index].
    +     * 
    + * @param fetchStartIndex Fetch-start-index. 0 origin. (NotMinus) + * @param fetchSize Fetch-size. (NotMinus & NotZero) + * @return this. (NotNull) + */ + public PagingBean fetchScope(int fetchStartIndex, int fetchSize) { + getSqlClause().fetchScope(fetchStartIndex, fetchSize); + return this; + } + + /** + * Fetch page. + *
    +     * When you invoke this, it is normally necessary to invoke 'fetchFirst()' or 'fetchScope()' ahead of that.
    +     *  But you also can use default-fetch-size without invoking 'fetchFirst()' or 'fetchScope()'.
    +     *  If you invoke this, your SQL returns [fetch-size] records from [fetch-start-index] calculated by [fetch-page-number].
    +     * 
    + * @param fetchPageNumber Fetch-page-number. 1 origin. (NotMinus & NotZero: If minus or zero, set one.) + * @return this. (NotNull) + */ + public PagingBean fetchPage(int fetchPageNumber) { + getSqlClause().fetchPage(fetchPageNumber); + return this; + } + + // ----------------------------------------------------- + // Fetch Property + // -------------- + /** + * The implementation. + * + * @return Fetch-start-index. + */ + public int getFetchStartIndex() { + return getSqlClause().getFetchStartIndex(); + } + + /** + * The implementation. + * + * @return Fetch-size. + */ + public int getFetchSize() { + return getSqlClause().getFetchSize(); + } + + /** + * The implementation. + * + * @return Fetch-page-number. + */ + public int getFetchPageNumber() { + return getSqlClause().getFetchPageNumber(); + } + + /** + * The implementation. + * + * @return Page start index. 0 origin. (NotMinus) + */ + public int getPageStartIndex() { + return getSqlClause().getPageStartIndex(); + } + + /** + * The implementation. + * + * @return Page end index. 0 origin. (NotMinus) + */ + public int getPageEndIndex() { + return getSqlClause().getPageEndIndex(); + } + + /** + * Is fetch scope effective? + * + * @return Determination. + */ + public boolean isFetchScopeEffective() { + return getSqlClause().isFetchScopeEffective(); + } + + // ----------------------------------------------------- + // Hint Property + // ------------- + /** + * Get select-hint. {select [select-hint] * from table...} + * + * @return Select-hint. (NotNull) + */ + public String getSelectHint() { + return getSqlClause().getSelectHint(); + } + + /** + * Get from-base-table-hint. {select * from table [from-base-table-hint] where ...} + * + * @return from-base-table-hint. (NotNull) + */ + public String getFromBaseTableHint() { + return getSqlClause().getFromBaseTableHint(); + } + + /** + * Get from-hint. {select * from table [from-hint] where ...} + * + * @return From-hint. (NotNull) + */ + public String getFromHint() { + return getSqlClause().getFromHint(); + } + + /** + * Get sql-suffix. {select * from table where ... order by ... [sql-suffix]} + * + * @return Sql-suffix. (NotNull) + */ + public String getSqlSuffix() { + return getSqlClause().getSqlSuffix(); + } + + // =================================================================================== + // Implementation of FetchNarrowingBean + // ==================================== + /** + * Get fetch-narrowing start-index. + * + * @return Fetch-narrowing start-index. + */ + public int getFetchNarrowingSkipStartIndex() { + return getSqlClause().getFetchNarrowingSkipStartIndex(); + } + + /** + * Get fetch-narrowing size. + * + * @return Fetch-narrowing size. + */ + public int getFetchNarrowingLoopCount() { + return getSqlClause().getFetchNarrowingLoopCount(); + } + + /** + * Is fetch start index supported? + * + * @return Determination. + */ + public boolean isFetchNarrowingSkipStartIndexEffective() { + return !getSqlClause().isFetchStartIndexSupported(); + } + + /** + * Is fetch size supported? + * + * @return Determination. + */ + public boolean isFetchNarrowingLoopCountEffective() { + return !getSqlClause().isFetchSizeSupported(); + } + + /** + * Is fetch-narrowing effective? + * + * @return Determination. + */ + public boolean isFetchNarrowingEffective() { + return _fetchNarrowing && getSqlClause().isFetchNarrowingEffective(); + } + + /** + * Ignore fetch narrowing. Only checking safety result size is valid. {INTERNAL METHOD} + */ + public void ignoreFetchNarrowing() { + _fetchNarrowing = false; + } + + /** + * Restore ignored fetch narrowing. {INTERNAL METHOD} + */ + public void restoreIgnoredFetchNarrowing() { + _fetchNarrowing = true; + } + + /** + * Get safety max result size. + * + * @return Safety max result size. + */ + public int getSafetyMaxResultSize() { + return _safetyMaxResultSize; + } + + // =================================================================================== + // Implementation of OrderByBean + // ============================= + /** + * The implementation. + * + * @return Sql component of order-by clause. (NotNull) + */ + public OrderByClause getSqlComponentOfOrderByClause() { + return getSqlClause().getSqlComponentOfOrderByClause(); + } + + /** + * The implementation. + * + * @return Order-by clause. (NotNull) + */ + public String getOrderByClause() { + return getSqlClause().getOrderByClause(); + } + + /** + * The implementation. + * + * @return this. (NotNull) + */ + public OrderByBean clearOrderBy() { + getSqlClause().clearOrderBy(); + return this; + } + + /** + * The implementation. + * + * @return this. (NotNull) + */ + public OrderByBean ignoreOrderBy() { + getSqlClause().ignoreOrderBy(); + return this; + } + + /** + * The implementation. + * + * @return this. (NotNull) + */ + public OrderByBean makeOrderByEffective() { + getSqlClause().makeOrderByEffective(); + return this; + } + + // =================================================================================== + // Implementation of SelectResource + // ================================ + /** + * Check safety result. + * + * @param safetyMaxResultSize Safety max result size. (If zero or minus, ignore checking) + */ + public void checkSafetyResult(int safetyMaxResultSize) { + this._safetyMaxResultSize = safetyMaxResultSize; + } + + // =================================================================================== + // Implementation of MapParameterBean + // ================================== + /** + * Get the map of parameter. + * + * @return The map of parameter. (Nullable) + */ + public Map getParameterMap() { + return _parameterMap; + } + + /** + * Add the parameter to the map. + * + * @param key The key of parameter. (NotNull) + * @param value The value of parameter. (Nullable) + */ + public void addParameter(String key, Object value) { + if (_parameterMap == null) { + _parameterMap = new LinkedHashMap(); + } + _parameterMap.put(key, value); + } + + // =================================================================================== + // Accessor + // ======== + // ----------------------------------------------------- + // SqlClause + // --------- + /** + * Get sqlClause. + * + * @return SqlClause. (NotNull) + */ + protected SqlClause getSqlClause() { + return _sqlClause; + } +} Property changes on: announcement/trunk/src/main/java/jp/sf/pal/announcement/db/allcommon/cbean/SimplePagingBean.java ___________________________________________________________________ Name: svn:eol-style + native Added: announcement/trunk/src/main/java/jp/sf/pal/announcement/db/allcommon/cbean/ckey/ConditionKey.java =================================================================== --- announcement/trunk/src/main/java/jp/sf/pal/announcement/db/allcommon/cbean/ckey/ConditionKey.java (rev 0) +++ announcement/trunk/src/main/java/jp/sf/pal/announcement/db/allcommon/cbean/ckey/ConditionKey.java 2008-06-30 02:54:27 UTC (rev 1002) @@ -0,0 +1,308 @@ +package jp.sf.pal.announcement.db.allcommon.cbean.ckey; + +import java.util.List; + +import jp.sf.pal.announcement.db.allcommon.cbean.coption.ConditionOption; +import jp.sf.pal.announcement.db.allcommon.cbean.cvalue.ConditionValue; + +/** + * The abstract class of condition-key. + * + * @author DBFlute(AutoGenerator) + */ +public abstract class ConditionKey { + + /** Mark of replaced value. */ + public static final String MARK_OF_REPLACED_VALUE = "ReplacedValue"; + + /** The condition key of equal. */ + public static final ConditionKey CK_EQUAL = new ConditionKeyEqual(); + + /** The condition key of notEqual. */ + public static final ConditionKey CK_NOT_EQUAL = new ConditionKeyNotEqual(); + + /** The condition key of greaterThan. */ + public static final ConditionKey CK_GREATER_THAN = new ConditionKeyGreaterThan(); + + /** The condition key of lessrThan. */ + public static final ConditionKey CK_LESS_THAN = new ConditionKeyLessThan(); + + /** The condition key of greaterEqual. */ + public static final ConditionKey CK_GREATER_EQUAL = new ConditionKeyGreaterEqual(); + + /** The condition key of lessEqual. */ + public static final ConditionKey CK_LESS_EQUAL = new ConditionKeyLessEqual(); + + /** The condition key of prefixSearch. */ + public static final ConditionKey CK_PREFIX_SEARCH = new ConditionKeyPrefixSearch(); + + /** The condition key of likeSearch. */ + public static final ConditionKey CK_LIKE_SEARCH = new ConditionKeyLikeSearch(); + + /** The condition key of inScope. */ + public static final ConditionKey CK_IN_SCOPE = new ConditionKeyInScope(); + + /** The condition key of notInScope. */ + public static final ConditionKey CK_NOT_IN_SCOPE = new ConditionKeyNotInScope(); + + /** The condition key of isNull. */ + public static final ConditionKey CK_IS_NULL = new ConditionKeyIsNull(); + + /** The condition key of isNotNull. */ + public static final ConditionKey CK_IS_NOT_NULL = new ConditionKeyIsNotNull(); + + /** Dummy-object for IsNull and IsNotNull and so on... */ + protected static final Object DUMMY_OBJECT = new Object(); + + /** Condition-key. */ + protected String _conditionKey; + + /** Operand. */ + protected String _operand; + + /** + * Get condition-key. + * + * @return Condition-key. + */ + public String getConditionKey() { + return _conditionKey; + } + + /** + * Get operand. + * + * @return Operand. + */ + public String getOperand() { + return _operand; + } + + /** + * Is valid registration? + * + * @param conditionValue Condition value. (NotNull) + * @param value Value. (NotNull) + * @param callerName Caller name. (NotNull) + * @return Determination. + */ + abstract public boolean isValidRegistration(ConditionValue conditionValue, + Object value, String callerName); + + /** + * Add where clause. + * + * @param conditionList Condition list. (NotNull) + * @param columnName Column name. (NotNull) + * @param value Condition value. (NotNull) + * @return this. + */ + public ConditionKey addWhereClause(java.util.List conditionList, + String columnName, ConditionValue value) { + if (value == null) { + String msg = "Argument[value] must not be null:"; + throw new IllegalArgumentException(msg + " value=" + value + + " this.toString()=" + toString()); + } + doAddWhereClause(conditionList, columnName, value); + return this; + } + + /** + * Add where clause. + * + * @param conditionList Condition list. (NotNull) + * @param columnName Column name. (NotNull) + * @param value Condition value. (NotNull) + * @param option Condition option. (NotNull) + * @return this. + */ + public ConditionKey addWhereClause(java.util.List conditionList, + String columnName, ConditionValue value, ConditionOption option) { + if (value == null) { + String msg = "Argument[value] must not be null:"; + throw new IllegalArgumentException(msg + " value=" + value + + " this.toString()=" + toString()); + } + doAddWhereClause(conditionList, columnName, value, option); + return this; + } + + /** + * Do add where clause. + * + * @param conditionList Condition list. (NotNull) + * @param columnName Column name. (NotNull) + * @param value Condition value. (NotNull) + */ + abstract protected void doAddWhereClause(List conditionList, + String columnName, ConditionValue value); + + /** + * Do add where clause. + * + * @param conditionList Condition list. (NotNull) + * @param columnName Column name. (NotNull) + * @param value Condition value. (NotNull) + * @param option Condition option. (NotNull) + */ + abstract protected void doAddWhereClause(List conditionList, + String columnName, ConditionValue value, ConditionOption option); + + /** + * Setup condition value. + * + * @param conditionValue Condition value. (NotNull) + * @param value Value. (Nullable) + * @param location Location. (Nullable) + * @return Condition value. (The same as argument[conditionValue]) (NotNull) + */ + public ConditionValue setupConditionValue(ConditionValue conditionValue, + Object value, String location) { + if (conditionValue == null) { + String msg = "Argument[conditionValue] must not be null:"; + throw new IllegalArgumentException(msg + " value=" + value + + " this.toString()=" + toString()); + } + doSetupConditionValue(conditionValue, value, location); + return conditionValue; + } + + /** + * Setup condition value. + * + * @param conditionValue Condition value. (NotNull) + * @param value Value. (Nullable) + * @param location Location. (Nullable) + * @param option Condition option. (NotNull) + * @return Condition value. (The same as argument[conditionValue]) (NotNull) + */ + public ConditionValue setupConditionValue(ConditionValue conditionValue, + Object value, String location, ConditionOption option) { + if (conditionValue == null) { + String msg = "Argument[conditionValue] must not be null:"; + throw new IllegalArgumentException(msg + " value=" + value + + " this.toString()=" + toString()); + } + doSetupConditionValue(conditionValue, value, location, option); + return conditionValue; + } + + /** + * Do setup condition value. + * + * @param conditionValue Condition value. (NotNull) + * @param value Value. (NotNull) + * @param location Location. (NotNull) + */ + abstract protected void doSetupConditionValue( + ConditionValue conditionValue, Object value, String location); + + /** + * Do setup condition value. + * + * @param conditionValue Condition value. (NotNull) + * @param value Value. (NotNull) + * @param location Location. (NotNull) + * @param option Condition option. (NotNull) + */ + abstract protected void doSetupConditionValue( + ConditionValue conditionValue, Object value, String location, + ConditionOption option); + + /** + * Build bind clause. (for s2dao) + * + * @param columnName Column name. (NotNull) + * @param location Location. (NotNull) + * @return Bind clause. (NotNull) + */ + protected String buildBindClause(String columnName, String location) { + return columnName + " " + getOperand() + " " + "/*dto." + location + + "*/null"; + } + + /** + * Build bind clause. (for s2dao) + * + * @param columnName Column name. (NotNull) + * @param location Location. (NotNull) + * @param additionalOption Additional option. (NotNull) + * @return Bind clause. (NotNull) + */ + protected String buildBindClauseWithRearOption(String columnName, + String location, String rearOption) { + return columnName + " " + getOperand() + " " + "/*dto." + location + + "*/null" + rearOption; + } + + /** + * Build bind clause. (for s2dao) + * + * @param columnName Column name. (NotNull) + * @param location Location. (NotNull) + * @param dummyValue Dummy value. (NotNull) + * @return Bind clause. (NotNull) + */ + protected String buildBindClause(String columnName, String location, + String dummyValue) { + return columnName + " " + getOperand() + " " + "/*dto." + location + + "*/" + dummyValue; + } + + /** + * Build clause without value. + * + * @param columnName Column name. (NotNull) + * @return Clause without value. (NotNull) + */ + protected String buildClauseWithoutValue(String columnName) { + return columnName + " " + getOperand(); + } + + /** + * Get wild-card. + * + * @return Wild-card. + */ + protected String getWildCard() { + return "%"; + } + + /** + * The override. + * Returns hash-code of this condition-key string. + * + * @return HashCode. + */ + public int hashCode() { + return getConditionKey().hashCode(); + } + + /** + * The override. + * If the condition-key of the other is same as this one, returns true. + * + * @param other Other entity. (Nullable) + * @return Comparing result. If other is null, returns false. + */ + public boolean equals(Object other) { + if (other instanceof ConditionKey) { + if (this.getConditionKey().equals( + ((ConditionKey) other).getConditionKey())) { + return true; + } + } + return false; + } + + /** + * The override. + * + * @return View-string of condition key information. + */ + public String toString() { + return "ConditionKey: " + getConditionKey() + " " + getOperand() + + " wild-card=[" + getWildCard() + "]"; + } +} Property changes on: announcement/trunk/src/main/java/jp/sf/pal/announcement/db/allcommon/cbean/ckey/ConditionKey.java ___________________________________________________________________ Name: svn:eol-style + native Added: announcement/trunk/src/main/java/jp/sf/pal/announcement/db/allcommon/cbean/ckey/ConditionKeyEqual.java =================================================================== --- announcement/trunk/src/main/java/jp/sf/pal/announcement/db/allcommon/cbean/ckey/ConditionKeyEqual.java (rev 0) +++ announcement/trunk/src/main/java/jp/sf/pal/announcement/db/allcommon/cbean/ckey/ConditionKeyEqual.java 2008-06-30 02:54:27 UTC (rev 1002) @@ -0,0 +1,108 @@ +package jp.sf.pal.announcement.db.allcommon.cbean.ckey; + +import jp.sf.pal.announcement.db.allcommon.cbean.coption.ConditionOption; +import jp.sf.pal.announcement.db.allcommon.cbean.cvalue.ConditionValue; + +import org.apache.commons.logging.Log; +import org.apache.commons.logging.LogFactory; + +/** + * The condition-key of equal. + * + * @author DBFlute(AutoGenerator) + */ +public class ConditionKeyEqual extends ConditionKey { + + /** Log-instance. */ + private static final Log _log = LogFactory.getLog(ConditionKeyEqual.class); + + /** + * Constructor. + */ + protected ConditionKeyEqual() { + _conditionKey = "equal"; + _operand = "="; + } + + /** + * Is valid registration? + * + * @param conditionValue Condition value. (NotNull) + * @param value Value. (NotNull) + * @param callerName Caller name. (NotNull) + * @return Determination. + */ + public boolean isValidRegistration(ConditionValue conditionValue, + Object value, String callerName) { + if (value == null) { + return false; + } + if (conditionValue.hasEqual()) { + if (conditionValue.equalEqual(value)) { + _log.warn("The value has already registered at " + callerName + + ": value=" + value); + return false; + } else { + conditionValue.overrideEqual(value); + return false; + } + } + return true; + } + + /** + * This method implements super#doAddWhereClause(). + * + * @param conditionList Condition list. (NotNull) + * @param columnName Column name. (NotNull) + * @param value Condition value. (NotNull) + */ + protected void doAddWhereClause(java.util.List conditionList, + String columnName, ConditionValue value) { + if (value.getEqual() == null) { + return; + } + conditionList + .add(buildBindClause(columnName, value.getEqualLocation())); + } + + /** + * This method implements super#doAddWhereClause(). + * + * @param conditionList Condition list. (NotNull) + * @param columnName Column name. (NotNull) + * @param value Condition value. (NotNull) + * @param option Condition option. (NotNull) + */ + protected void doAddWhereClause(java.util.List conditionList, + String columnName, ConditionValue value, ConditionOption option) { + throw new UnsupportedOperationException( + "doAddWhereClause with condition-option is unsupported!!!"); + } + + /** + * This method implements super#doSetupConditionValue(). + * + * @param conditionValue Condition value. (NotNull) + * @param value Value. (NotNull) + * @param location Location. (NotNull) + */ + protected void doSetupConditionValue(ConditionValue conditionValue, + Object value, String location) { + conditionValue.setEqual(value).setEqualLocation(location); + } + + /** + * This method implements super#doSetupConditionValue(). + * + * @param conditionValue Condition value. (NotNull) + * @param value Value. (NotNull) + * @param location Location. (NotNull) + * @param option Condition option. (NotNull) + */ + protected void doSetupConditionValue(ConditionValue conditionValue, + Object value, String location, ConditionOption option) { + throw new UnsupportedOperationException( + "doSetupConditionValue with condition-option is unsupported!!!"); + } +} Property changes on: announcement/trunk/src/main/java/jp/sf/pal/announcement/db/allcommon/cbean/ckey/ConditionKeyEqual.java ___________________________________________________________________ Name: svn:eol-style + native Added: announcement/trunk/src/main/java/jp/sf/pal/announcement/db/allcommon/cbean/ckey/ConditionKeyGreaterEqual.java =================================================================== --- announcement/trunk/src/main/java/jp/sf/pal/announcement/db/allcommon/cbean/ckey/ConditionKeyGreaterEqual.java (rev 0) +++ announcement/trunk/src/main/java/jp/sf/pal/announcement/db/allcommon/cbean/ckey/ConditionKeyGreaterEqual.java 2008-06-30 02:54:27 UTC (rev 1002) @@ -0,0 +1,109 @@ +package jp.sf.pal.announcement.db.allcommon.cbean.ckey; + +import jp.sf.pal.announcement.db.allcommon.cbean.coption.ConditionOption; +import jp.sf.pal.announcement.db.allcommon.cbean.cvalue.ConditionValue; + +import org.apache.commons.logging.Log; +import org.apache.commons.logging.LogFactory; + +/** + * The condition-key of greaterEqual. + * + * @author DBFlute(AutoGenerator) + */ +public class ConditionKeyGreaterEqual extends ConditionKey { + + /** Log-instance. */ + private static final Log _log = LogFactory + .getLog(ConditionKeyGreaterEqual.class); + + /** + * Constructor. + */ + protected ConditionKeyGreaterEqual() { + _conditionKey = "greaterEqual"; + _operand = ">="; + } + + /** + * Is valid registration? + * + * @param conditionValue Condition value. (NotNull) + * @param value Value. (NotNull) + * @param callerName Caller name. (NotNull) + * @return Determination. + */ + public boolean isValidRegistration(ConditionValue conditionValue, + Object value, String callerName) { + if (value == null) { + return false; + } + if (conditionValue.hasGreaterEqual()) { + if (conditionValue.equalGreaterEqual(value)) { + _log.warn("The value has already registered at " + callerName + + ": value=" + value); + return false; + } else { + conditionValue.overrideGreaterEqual(value); + return false; + } + } + return true; + } + + /** + * This method implements super#doAddWhereClause(). + * + * @param conditionList Condition list. (NotNull) + * @param columnName Column name. (NotNull) + * @param value Condition value. (NotNull) + */ + protected void doAddWhereClause(java.util.List conditionList, + String columnName, ConditionValue value) { + if (value.getGreaterEqual() == null) { + return; + } + conditionList.add(buildBindClause(columnName, value + .getGreaterEqualLocation())); + } + + /** + * This method implements super#doAddWhereClause(). + * + * @param conditionList Condition list. (NotNull) + * @param columnName Column name. (NotNull) + * @param value Condition value. (NotNull) + * @param option Condition option. (NotNull) + */ + protected void doAddWhereClause(java.util.List conditionList, + String columnName, ConditionValue value, ConditionOption option) { + throw new UnsupportedOperationException( + "doAddWhereClause that has ConditionOption is unsupported!!!"); + } + + /** + * This method implements super#doSetupConditionValue(). + * + * @param conditionValue Condition value. (NotNull) + * @param value Value. (NotNull) + * @param location Location. (NotNull) + */ + protected void doSetupConditionValue(ConditionValue conditionValue, + Object value, String location) { + conditionValue.setGreaterEqual(value).setGreaterEqualLocation(location); + } + + /** + * This method implements super#doSetupConditionValue(). + * + * @param conditionValue Condition value. (NotNull) + * @param value Value. (NotNull) + * @param location Location. (NotNull) + * @param option Condition option. (NotNull) + */ + protected void doSetupConditionValue(ConditionValue conditionValue, + Object value, String location, ConditionOption option) { + throw new UnsupportedOperationException( + "doSetupConditionValue with condition-option is unsupported!!!"); + } +} Property changes on: announcement/trunk/src/main/java/jp/sf/pal/announcement/db/allcommon/cbean/ckey/ConditionKeyGreaterEqual.java ___________________________________________________________________ Name: svn:eol-style + native Added: announcement/trunk/src/main/java/jp/sf/pal/announcement/db/allcommon/cbean/ckey/ConditionKeyGreaterThan.java =================================================================== --- announcement/trunk/src/main/java/jp/sf/pal/announcement/db/allcommon/cbean/ckey/ConditionKeyGreaterThan.java (rev 0) +++ announcement/trunk/src/main/java/jp/sf/pal/announcement/db/allcommon/cbean/ckey/ConditionKeyGreaterThan.java 2008-06-30 02:54:27 UTC (rev 1002) @@ -0,0 +1,109 @@ +package jp.sf.pal.announcement.db.allcommon.cbean.ckey; + +import jp.sf.pal.announcement.db.allcommon.cbean.coption.ConditionOption; +import jp.sf.pal.announcement.db.allcommon.cbean.cvalue.ConditionValue; + +import org.apache.commons.logging.Log; +import org.apache.commons.logging.LogFactory; + +/** + * The condition-key of greaterThan. + * + * @author DBFlute(AutoGenerator) + */ +public class ConditionKeyGreaterThan extends ConditionKey { + + /** Log-instance. */ + private static final Log _log = LogFactory + .getLog(ConditionKeyGreaterThan.class); + + /** + * Constructor. + */ + protected ConditionKeyGreaterThan() { + _conditionKey = "greaterThan"; + _operand = ">"; + } + + /** + * Is valid registration? + * + * @param conditionValue Condition value. (NotNull) + * @param value Value. (NotNull) + * @param callerName Caller name. (NotNull) + * @return Determination. + */ + public boolean isValidRegistration(ConditionValue conditionValue, + Object value, String callerName) { + if (value == null) { + return false; + } + if (conditionValue.hasGreaterThan()) { + if (conditionValue.equalGreaterThan(value)) { + _log.warn("The value has already registered at " + callerName + + ": value=" + value); + return false; + } else { + conditionValue.overrideGreaterThan(value); + return false; + } + } + return true; + } + + /** + * This method implements super#doAddWhereClause(). + * + * @param conditionList Condition list. (NotNull) + * @param columnName Column name. (NotNull) + * @param value Condition value. (NotNull) + */ + protected void doAddWhereClause(java.util.List conditionList, + String columnName, ConditionValue value) { + if (value.getGreaterThan() == null) { + return; + } + conditionList.add(buildBindClause(columnName, value + .getGreaterThanLocation())); + } + + /** + * This method implements super#doAddWhereClause(). + * + * @param conditionList Condition list. (NotNull) + * @param columnName Column name. (NotNull) + * @param value Condition value. (NotNull) + * @param option Condition option. (NotNull) + */ + protected void doAddWhereClause(java.util.List conditionList, + String columnName, ConditionValue value, ConditionOption option) { + throw new UnsupportedOperationException( + "doAddWhereClause that has ConditionOption is unsupported!!!"); + } + + /** + * This method implements super#doSetupConditionValue(). + * + * @param conditionValue Condition value. (NotNull) + * @param value Value. (NotNull) + * @param location Location. (NotNull) + */ + protected void doSetupConditionValue(ConditionValue conditionValue, + Object value, String location) { + conditionValue.setGreaterThan(value).setGreaterThanLocation(location); + } + + /** + * This method implements super#doSetupConditionValue(). + * + * @param conditionValue Condition value. (NotNull) + * @param value Value. (NotNull) + * @param location Location. (NotNull) + * @param option Condition option. (NotNull) + */ + protected void doSetupConditionValue(ConditionValue conditionValue, + Object value, String location, ConditionOption option) { + throw new UnsupportedOperationException( + "doSetupConditionValue with condition-option is unsupported!!!"); + } +} Property changes on: announcement/trunk/src/main/java/jp/sf/pal/announcement/db/allcommon/cbean/ckey/ConditionKeyGreaterThan.java ___________________________________________________________________ Name: svn:eol-style + native Added: announcement/trunk/src/main/java/jp/sf/pal/announcement/db/allcommon/cbean/ckey/ConditionKeyInScope.java =================================================================== --- announcement/trunk/src/main/java/jp/sf/pal/announcement/db/allcommon/cbean/ckey/ConditionKeyInScope.java (rev 0) +++ announcement/trunk/src/main/java/jp/sf/pal/announcement/db/allcommon/cbean/ckey/ConditionKeyInScope.java 2008-06-30 02:54:27 UTC (rev 1002) @@ -0,0 +1,121 @@ +package jp.sf.pal.announcement.db.allcommon.cbean.ckey; + +import jp.sf.pal.announcement.db.allcommon.cbean.coption.ConditionOption; +import jp.sf.pal.announcement.db.allcommon.cbean.coption.InScopeOption; +import jp.sf.pal.announcement.db.allcommon.cbean.cvalue.ConditionValue; + +import org.apache.commons.logging.Log; +import org.apache.commons.logging.LogFactory; + +/** + * The condition-key of inScope. + * @author DBFlute(AutoGenerator) + */ +public class ConditionKeyInScope extends ConditionKey { + + /** Log-instance. */ + private static final Log _log = LogFactory + .getLog(ConditionKeyInScope.class); + + /** + * Constructor. + */ + protected ConditionKeyInScope() { + _conditionKey = "inScope"; + _operand = "in"; + } + + /** + * Is valid registration? + * @param conditionValue Condition value. (NotNull) + * @param value Value. (NotNull) + * @param callerName Caller name. (NotNull) + * @return Determination. + */ + public boolean isValidRegistration(ConditionValue conditionValue, + Object value, String callerName) { + if (value == null) { + return false; + } + if (value instanceof java.util.List + && ((java.util.List) value).isEmpty()) { + return false; + } + if (value instanceof java.util.List) { + if (conditionValue.hasInScope()) { + if (conditionValue.equalInScope(((java.util.List) value))) { + _log.warn("The value has already registered at " + + callerName + ": value=" + value); + return false; + } else { + conditionValue.overrideInScope(((java.util.List) value)); + return false; + } + } + } + return true; + } + + /** + * This method implements super#doAddWhereClause(). + * @param conditionList Condition list. (NotNull) + * @param columnName Column name. (NotNull) + * @param value Condition value. (NotNull) + */ + protected void doAddWhereClause(java.util.List conditionList, + String columnName, ConditionValue value) { + if (value.getInScope() == null) { + return; + } + conditionList.add(buildBindClause(columnName, value + .getInScopeLocation(), "('a1', 'a2')")); + } + + /** + * This method implements super#doAddWhereClause(). + * @param conditionList Condition list. (NotNull) + * @param columnName Column name. (NotNull) + * @param value Condition value. (NotNull) + * @param option Condition option. (NotNull) + */ + protected void doAddWhereClause(java.util.List conditionList, + String columnName, ConditionValue value, ConditionOption option) { + if (option == null) { + String msg = "The argument[option] should not be null: columnName=" + + columnName + " value=" + value; + throw new IllegalArgumentException(msg); + } + if (!(option instanceof InScopeOption)) { + String msg = "The argument[option] should be InScopeOption: columnName=" + + columnName + " value=" + value; + throw new IllegalArgumentException(msg); + } + conditionList.add(buildBindClause(columnName, value + .getInScopeLocation(), "('a1', 'a2')")); + } + + /** + * This method implements super#doSetupConditionValue(). + * @param conditionValue Condition value. (NotNull) + * @param value Value. (NotNull) + * @param location Location. (NotNull) + */ + protected void doSetupConditionValue(ConditionValue conditionValue, + Object value, String location) { + conditionValue.setInScope((java.util.List) value).setInScopeLocation( + location); + } + + /** + * This method implements super#doSetupConditionValue(). + * @param conditionValue Condition value. (NotNull) + * @param value Value. (NotNull) + * @param location Location. (NotNull) + * @param option Condition option. (NotNull) + */ + protected void doSetupConditionValue(ConditionValue conditionValue, + Object value, String location, ConditionOption option) { + conditionValue.setInScope((java.util.List) value, + (InScopeOption) option).setInScopeLocation(location); + } +} Property changes on: announcement/trunk/src/main/java/jp/sf/pal/announcement/db/allcommon/cbean/ckey/ConditionKeyInScope.java ___________________________________________________________________ Name: svn:eol-style + native Added: announcement/trunk/src/main/java/jp/sf/pal/announcement/db/allcommon/cbean/ckey/ConditionKeyIsNotNull.java =================================================================== --- announcement/trunk/src/main/java/jp/sf/pal/announcement/db/allcommon/cbean/ckey/ConditionKeyIsNotNull.java (rev 0) +++ announcement/trunk/src/main/java/jp/sf/pal/announcement/db/allcommon/cbean/ckey/ConditionKeyIsNotNull.java 2008-06-30 02:54:27 UTC (rev 1002) @@ -0,0 +1,100 @@ +package jp.sf.pal.announcement.db.allcommon.cbean.ckey; + +import jp.sf.pal.announcement.db.allcommon.cbean.coption.ConditionOption; +import jp.sf.pal.announcement.db.allcommon.cbean.cvalue.ConditionValue; + +import org.apache.commons.logging.Log; +import org.apache.commons.logging.LogFactory; + +/** + * The condition-key of isNotNull. + * + * @author DBFlute(AutoGenerator) + */ +public class ConditionKeyIsNotNull extends ConditionKey { + + /** Log-instance. */ + private static final Log _log = LogFactory + .getLog(ConditionKeyIsNotNull.class); + + /** + * Constructor. + */ + protected ConditionKeyIsNotNull() { + _conditionKey = "isNotNull"; + _operand = "is not null"; + } + + /** + * Is valid registration? + * + * @param conditionValue Condition value. (NotNull) + * @param value Value. (NotNull) + * @param callerName Caller name. (NotNull) + * @return Determination. + */ + public boolean isValidRegistration(ConditionValue conditionValue, + Object value, String callerName) { + if (conditionValue.hasIsNotNull()) { + _log.warn("The value has already registered at " + callerName); + return false; + } + return true; + } + + /** + * This method implements super#doAddWhereClause(). + * + * @param conditionList Condition list. (NotNull) + * @param columnName Column name. (NotNull) + * @param value Condition value. (NotNull) + */ + protected void doAddWhereClause(java.util.List conditionList, + String columnName, ConditionValue value) { + if (value.getIsNotNull() == null) { + return; + } + conditionList.add(buildClauseWithoutValue(columnName)); + } + + /** + * This method implements super#doAddWhereClause(). + * + * @param conditionList Condition list. (NotNull) + * @param columnName Column name. (NotNull) + * @param value Condition value. (NotNull) + * @param option Condition option. (NotNull) + */ + protected void doAddWhereClause(java.util.List conditionList, + String columnName, ConditionValue value, ConditionOption option) { + throw new UnsupportedOperationException( + "doAddWhereClause that has ConditionOption is unsupported!!!"); + } + + /** + * This method implements super#doSetupConditionValue(). + * + * @param conditionValue Condition value. (NotNull) + * @param value Value. (NotNull) + * @param location Location. (NotNull) + */ + protected void doSetupConditionValue(ConditionValue conditionValue, + Object value, String location) { + conditionValue.setIsNotNull(DUMMY_OBJECT) + .setIsNotNullLocation(location); + } + + /** + * This method implements super#doSetupConditionValue(). + * + * @param conditionValue Condition value. (NotNull) + * @param value Value. (NotNull) + * @param location Location. (NotNull) + * @param option Condition option. (NotNull) + */ + protected void doSetupConditionValue(ConditionValue conditionValue, + Object value, String location, ConditionOption option) { + throw new UnsupportedOperationException( + "doSetupConditionValue with condition-option is unsupported!!!"); + } +} Property changes on: announcement/trunk/src/main/java/jp/sf/pal/announcement/db/allcommon/cbean/ckey/ConditionKeyIsNotNull.java ___________________________________________________________________ Name: svn:eol-style + native Added: announcement/trunk/src/main/java/jp/sf/pal/announcement/db/allcommon/cbean/ckey/ConditionKeyIsNull.java =================================================================== --- announcement/trunk/src/main/java/jp/sf/pal/announcement/db/allcommon/cbean/ckey/ConditionKeyIsNull.java (rev 0) +++ announcement/trunk/src/main/java/jp/sf/pal/announcement/db/allcommon/cbean/ckey/ConditionKeyIsNull.java 2008-06-30 02:54:27 UTC (rev 1002) @@ -0,0 +1,98 @@ +package jp.sf.pal.announcement.db.allcommon.cbean.ckey; + +import jp.sf.pal.announcement.db.allcommon.cbean.coption.ConditionOption; +import jp.sf.pal.announcement.db.allcommon.cbean.cvalue.ConditionValue; + +import org.apache.commons.logging.Log; +import org.apache.commons.logging.LogFactory; + +/** + * The condition-key of isNull. + * + * @author DBFlute(AutoGenerator) + */ +public class ConditionKeyIsNull extends ConditionKey { + + /** Log-instance. */ + private static final Log _log = LogFactory.getLog(ConditionKeyIsNull.class); + + /** + * Constructor. + */ + protected ConditionKeyIsNull() { + _conditionKey = "isNull"; + _operand = "is null"; + } + + /** + * Is valid registration? + * + * @param conditionValue Condition value. (NotNull) + * @param value Value. (NotNull) + * @param callerName Caller name. (NotNull) + * @return Determination. + */ + public boolean isValidRegistration(ConditionValue conditionValue, + Object value, String callerName) { + if (conditionValue.hasIsNull()) { + _log.warn("The value has already registered at " + callerName); + return false; + } + return true; + } + + /** + * This method implements super#doAddWhereClause(). + * + * @param conditionList Condition list. (NotNull) + * @param columnName Column name. (NotNull) + * @param value Condition value. (NotNull) + */ + protected void doAddWhereClause(java.util.List conditionList, + String columnName, ConditionValue value) { + if (value.getIsNull() == null) { + return; + } + conditionList.add(buildClauseWithoutValue(columnName)); + } + + /** + * This method implements super#doAddWhereClause(). + * + * @param conditionList Condition list. (NotNull) + * @param columnName Column name. (NotNull) + * @param value Condition value. (NotNull) + * @param option Condition option. (NotNull) + */ + protected void doAddWhereClause(java.util.List conditionList, + String columnName, ConditionValue value, ConditionOption option) { + throw new UnsupportedOperationException( + "doAddWhereClause that has ConditionOption is unsupported!!!"); + } + + /** + * This method implements super#doSetupConditionValue(). + * + * @param conditionValue Condition value. (NotNull) + * @param value Value. (NotNull) + * @param location Location. (NotNull) + */ + protected void doSetupConditionValue(ConditionValue conditionValue, + Object value, String location) { + conditionValue.setIsNull(DUMMY_OBJECT).setIsNullLocation(location); + } + + /** + * This method implements super#doSetupConditionValue(). + * + * @param conditionValue Condition value. (NotNull) + * @param value Value. (NotNull) + * @param location Location. (NotNull) + * @param option Condition option. (NotNull) + */ + protected void doSetupConditionValue(ConditionValue conditionValue, + Object value, String location, ConditionOption option) { + throw new UnsupportedOperationException( + "doSetupConditionValue with condition-option is unsupported!!!"); + } +} Property changes on: announcement/trunk/src/main/java/jp/sf/pal/announcement/db/allcommon/cbean/ckey/ConditionKeyIsNull.java ___________________________________________________________________ Name: svn:eol-style + native Added: announcement/trunk/src/main/java/jp/sf/pal/announcement/db/allcommon/cbean/ckey/ConditionKeyLessEqual.java =================================================================== --- announcement/trunk/src/main/java/jp/sf/pal/announcement/db/allcommon/cbean/ckey/ConditionKeyLessEqual.java (rev 0) +++ announcement/trunk/src/main/java/jp/sf/pal/announcement/db/allcommon/cbean/ckey/ConditionKeyLessEqual.java 2008-06-30 02:54:27 UTC (rev 1002) @@ -0,0 +1,109 @@ +package jp.sf.pal.announcement.db.allcommon.cbean.ckey; + +import jp.sf.pal.announcement.db.allcommon.cbean.coption.ConditionOption; +import jp.sf.pal.announcement.db.allcommon.cbean.cvalue.ConditionValue; + +import org.apache.commons.logging.Log; +import org.apache.commons.logging.LogFactory; + +/** + * The condition-key of lessEqual. + * + * @author DBFlute(AutoGenerator) + */ +public class ConditionKeyLessEqual extends ConditionKey { + + /** Log-instance. */ + private static final Log _log = LogFactory + .getLog(ConditionKeyLessEqual.class); + + /** + * Constructor. + */ + protected ConditionKeyLessEqual() { + _conditionKey = "lessEqual"; + _operand = "<="; + } + + /** + * Is valid registration? + * + * @param conditionValue Condition value. (NotNull) + * @param value Value. (NotNull) + * @param callerName Caller name. (NotNull) + * @return Determination. + */ + public boolean isValidRegistration(ConditionValue conditionValue, + Object value, String callerName) { + if (value == null) { + return false; + } + if (conditionValue.hasLessEqual()) { + if (conditionValue.equalLessEqual(value)) { + _log.warn("The value has already registered at " + callerName + + ": value=" + value); + return false; + } else { + conditionValue.overrideLessEqual(value); + return false; + } + } + return true; + } + + /** + * This method implements super#doAddWhereClause(). + * + * @param conditionList Condition list. (NotNull) + * @param columnName Column name. (NotNull) + * @param value Condition value. (NotNull) + */ + protected void doAddWhereClause(java.util.List conditionList, + String columnName, ConditionValue value) { + if (value.getLessEqual() == null) { + return; + } + conditionList.add(buildBindClause(columnName, value + .getLessEqualLocation())); + } + + /** + * This method implements super#doAddWhereClause(). + * + * @param conditionList Condition list. (NotNull) + * @param columnName Column name. (NotNull) + * @param value Condition value. (NotNull) + * @param option Condition option. (NotNull) + */ + protected void doAddWhereClause(java.util.List conditionList, + String columnName, ConditionValue value, ConditionOption option) { + throw new UnsupportedOperationException( + "doAddWhereClause that has ConditionOption is unsupported!!!"); + } + + /** + * This method implements super#doSetupConditionValue(). + * + * @param conditionValue Condition value. (NotNull) + * @param value Value. (NotNull) + * @param location Location. (NotNull) + */ + protected void doSetupConditionValue(ConditionValue conditionValue, + Object value, String location) { + conditionValue.setLessEqual(value).setLessEqualLocation(location); + } + + /** + * This method implements super#doSetupConditionValue(). + * + * @param conditionValue Condition value. (NotNull) + * @param value Value. (NotNull) + * @param location Location. (NotNull) + * @param option Condition option. (NotNull) + */ + protected void doSetupConditionValue(ConditionValue conditionValue, + Object value, String location, ConditionOption option) { + throw new UnsupportedOperationException( + "doSetupConditionValue with condition-option is unsupported!!!"); + } +} Property changes on: announcement/trunk/src/main/java/jp/sf/pal/announcement/db/allcommon/cbean/ckey/ConditionKeyLessEqual.java ___________________________________________________________________ Name: svn:eol-style + native Added: announcement/trunk/src/main/java/jp/sf/pal/announcement/db/allcommon/cbean/ckey/ConditionKeyLessThan.java =================================================================== --- announcement/trunk/src/main/java/jp/sf/pal/announcement/db/allcommon/cbean/ckey/ConditionKeyLessThan.java (rev 0) +++ announcement/trunk/src/main/java/jp/sf/pal/announcement/db/allcommon/cbean/ckey/ConditionKeyLessThan.java 2008-06-30 02:54:27 UTC (rev 1002) @@ -0,0 +1,109 @@ +package jp.sf.pal.announcement.db.allcommon.cbean.ckey; + +import jp.sf.pal.announcement.db.allcommon.cbean.coption.ConditionOption; +import jp.sf.pal.announcement.db.allcommon.cbean.cvalue.ConditionValue; + +import org.apache.commons.logging.Log; +import org.apache.commons.logging.LogFactory; + +/** + * The condition-key of lessThan. + * + * @author DBFlute(AutoGenerator) + */ +public class ConditionKeyLessThan extends ConditionKey { + + /** Log-instance. */ + private static final Log _log = LogFactory + .getLog(ConditionKeyLessThan.class); + + /** + * Constructor. + */ + protected ConditionKeyLessThan() { + _conditionKey = "lessThan"; + _operand = "<"; + } + + /** + * Is valid registration? + * + * @param conditionValue Condition value. (NotNull) + * @param value Value. (NotNull) + * @param callerName Caller name. (NotNull) + * @return Determination. + */ + public boolean isValidRegistration(ConditionValue conditionValue, + Object value, String callerName) { + if (value == null) { + return false; + } + if (conditionValue.hasLessThan()) { + if (conditionValue.equalLessThan(value)) { + _log.warn("The value has already registered at " + callerName + + ": value=" + value); + return false; + } else { + conditionValue.overrideLessThan(value); + return false; + } + } + return true; + } + + /** + * This method implements super#doAddWhereClause(). + * + * @param conditionList Condition list. (NotNull) + * @param columnName Column name. (NotNull) + * @param value Condition value. (NotNull) + */ + protected void doAddWhereClause(java.util.List conditionList, + String columnName, ConditionValue value) { + if (value.getLessThan() == null) { + return; + } + conditionList.add(buildBindClause(columnName, value + .getLessThanLocation())); + } + + /** + * This method implements super#doAddWhereClause(). + * + * @param conditionList Condition list. (NotNull) + * @param columnName Column name. (NotNull) + * @param value Condition value. (NotNull) + * @param option Condition option. (NotNull) + */ + protected void doAddWhereClause(java.util.List conditionList, + String columnName, ConditionValue value, ConditionOption option) { + throw new UnsupportedOperationException( + "doAddWhereClause that has ConditionOption is unsupported!!!"); + } + + /** + * This method implements super#doSetupConditionValue(). + * + * @param conditionValue Condition value. (NotNull) + * @param value Value. (NotNull) + * @param location Location. (NotNull) + */ + protected void doSetupConditionValue(ConditionValue conditionValue, + Object value, String location) { + conditionValue.setLessThan(value).setLessThanLocation(location); + } + + /** + * This method implements super#doSetupConditionValue(). + * + * @param conditionValue Condition value. (NotNull) + * @param value Value. (NotNull) + * @param location Location. (NotNull) + * @param option Condition option. (NotNull) + */ + protected void doSetupConditionValue(ConditionValue conditionValue, + Object value, String location, ConditionOption option) { + throw new UnsupportedOperationException( + "doSetupConditionValue with condition-option is unsupported!!!"); + } +} Property changes on: announcement/trunk/src/main/java/jp/sf/pal/announcement/db/allcommon/cbean/ckey/ConditionKeyLessThan.java ___________________________________________________________________ Name: svn:eol-style + native Added: announcement/trunk/src/main/java/jp/sf/pal/announcement/db/allcommon/cbean/ckey/ConditionKeyLikeSearch.java =================================================================== --- announcement/trunk/src/main/java/jp/sf/pal/announcement/db/allcommon/cbean/ckey/ConditionKeyLikeSearch.java (rev 0) +++ announcement/trunk/src/main/java/jp/sf/pal/announcement/db/allcommon/cbean/ckey/ConditionKeyLikeSearch.java 2008-06-30 02:54:27 UTC (rev 1002) @@ -0,0 +1,102 @@ +package jp.sf.pal.announcement.db.allcommon.cbean.ckey; + +import jp.sf.pal.announcement.db.allcommon.cbean.coption.ConditionOption; +import jp.sf.pal.announcement.db.allcommon.cbean.coption.LikeSearchOption; +import jp.sf.pal.announcement.db.allcommon.cbean.cvalue.ConditionValue; + +/** + * The condition-key of likeSearch. + * + * @author DBFlute(AutoGenerator) + */ +public class ConditionKeyLikeSearch extends ConditionKey { + + /** + * Constructor. + */ + protected ConditionKeyLikeSearch() { + _conditionKey = "likeSearch"; + _operand = "like"; + } + + /** + * Is valid registration? + * + * @param conditionValue Condition value. (NotNull) + * @param value Value. (NotNull) + * @param callerName Caller name. (NotNull) + * @return Determination. + */ + public boolean isValidRegistration(ConditionValue conditionValue, + Object value, String callerName) { + if (value == null) { + return false; + } + return true; + } + + /** + * This method implements super#doAddWhereClause(). + * + * @param conditionList Condition list. (NotNull) + * @param columnName Column name. (NotNull) + * @param value Condition value. (NotNull) + */ + protected void doAddWhereClause(java.util.List conditionList, + String columnName, ConditionValue value) { + throw new UnsupportedOperationException( + "doAddWhereClause without condition-option is unsupported!!!"); + } + + /** + * This method implements super#doAddWhereClause(). + * + * @param conditionList Condition list. (NotNull) + * @param columnName Column name. (NotNull) + * @param value Condition value. (NotNull) + * @param option Condition option. (NotNull) + */ + protected void doAddWhereClause(java.util.List conditionList, + String columnName, ConditionValue value, ConditionOption option) { + if (option == null) { + String msg = "The argument[option] should not be null: columnName=" + + columnName + " value=" + value; + throw new IllegalArgumentException(msg); + } + if (!(option instanceof LikeSearchOption)) { + String msg = "The argument[option] should be LikeSearchOption: columnName=" + + columnName + " value=" + value; + throw new IllegalArgumentException(msg); + } + final LikeSearchOption myOption = (LikeSearchOption) option; + conditionList.add(buildBindClauseWithRearOption(columnName, value + .getLikeSearchLocation(), myOption.getRearOption())); + } + + /** + * This method implements super#doSetupConditionValue(). + * + * @param conditionValue Condition value. (NotNull) + * @param value Value. (NotNull) + * @param location Location. (NotNull) + */ + protected void doSetupConditionValue(ConditionValue conditionValue, + Object value, String location) { + throw new UnsupportedOperationException( + "doSetupConditionValue without condition-option is unsupported!!!"); + } + + /** + * This method implements super#doSetupConditionValue(). + * + * @param conditionValue Condition value. (NotNull) + * @param value Value. (NotNull) + * @param location Location. (NotNull) + * @param option Condition option. (NotNull) + */ + protected void doSetupConditionValue(ConditionValue conditionValue, + Object value, String location, ConditionOption option) { + conditionValue.setLikeSearch((String) value, (LikeSearchOption) option) + .setLikeSearchLocation(location); + } +} Property changes on: announcement/trunk/src/main/java/jp/sf/pal/announcement/db/allcommon/cbean/ckey/ConditionKeyLikeSearch.java ___________________________________________________________________ Name: svn:eol-style + native Added: announcement/trunk/src/main/java/jp/sf/pal/announcement/db/allcommon/cbean/ckey/ConditionKeyNotEqual.java =================================================================== --- announcement/trunk/src/main/java/jp/sf/pal/announcement/db/allcommon/cbean/ckey/ConditionKeyNotEqual.java (rev 0) +++ announcement/trunk/src/main/java/jp/sf/pal/announcement/db/allcommon/cbean/ckey/ConditionKeyNotEqual.java 2008-06-30 02:54:27 UTC (rev 1002) @@ -0,0 +1,109 @@ +package jp.sf.pal.announcement.db.allcommon.cbean.ckey; + +import jp.sf.pal.announcement.db.allcommon.cbean.coption.ConditionOption; +import jp.sf.pal.announcement.db.allcommon.cbean.cvalue.ConditionValue; + +import org.apache.commons.logging.Log; +import org.apache.commons.logging.LogFactory; + +/** + * The condition-key of notEqual. + * + * @author DBFlute(AutoGenerator) + */ +public class ConditionKeyNotEqual extends ConditionKey { + + /** Log-instance. */ + private static final Log _log = LogFactory + .getLog(ConditionKeyNotEqual.class); + + /** + * Constructor. + */ + protected ConditionKeyNotEqual() { + _conditionKey = "notEqual"; + _operand = "!="; + } + + /** + * Is valid registration? + * + * @param conditionValue Condition value. (NotNull) + * @param value Value. (NotNull) + * @param callerName Caller name. (NotNull) + * @return Determination. + */ + public boolean isValidRegistration(ConditionValue conditionValue, + Object value, String callerName) { + if (value == null) { + return false; + } + if (conditionValue.hasNotEqual()) { + if (conditionValue.equalNotEqual(value)) { + _log.warn("The value has already registered at " + callerName + + ": value=" + value); + return false; + } else { + conditionValue.overrideNotEqual(value); + return false; + } + } + return true; + } + + /** + * This method implements super#doAddWhereClause(). + * + * @param conditionList Condition list. (NotNull) + * @param columnName Column name. (NotNull) + * @param value Condition value. (NotNull) + */ + protected void doAddWhereClause(java.util.List conditionList, + String columnName, ConditionValue value) { + if (value.getNotEqual() == null) { + return; + } + conditionList.add(buildBindClause(columnName, value + .getNotEqualLocation())); + } + + /** + * This method implements super#doAddWhereClause(). + * + * @param conditionList Condition list. (NotNull) + * @param columnName Column name. (NotNull) + * @param value Condition value. (NotNull) + * @param option Condition option. (NotNull) + */ + protected void doAddWhereClause(java.util.List conditionList, + String columnName, ConditionValue value, ConditionOption option) { + throw new UnsupportedOperationException( + "doAddWhereClause with condition-option is unsupported!!!"); + } + + /** + * This method implements super#doSetupConditionValue(). + * + * @param conditionValue Condition value. (NotNull) + * @param value Value. (NotNull) + * @param location Location. (NotNull) + */ + protected void doSetupConditionValue(ConditionValue conditionValue, + Object value, String location) { + conditionValue.setNotEqual(value).setNotEqualLocation(location); + } + + /** + * This method implements super#doSetupConditionValue(). + * + * @param conditionValue Condition value. (NotNull) + * @param value Value. (NotNull) + * @param location Location. (NotNull) + * @param option Condition option. (NotNull) + */ + protected void doSetupConditionValue(ConditionValue conditionValue, + Object value, String location, ConditionOption option) { + throw new UnsupportedOperationException( + "doSetupConditionValue with condition-option is unsupported!!!"); + } +} Property changes on: announcement/trunk/src/main/java/jp/sf/pal/announcement/db/allcommon/cbean/ckey/ConditionKeyNotEqual.java ___________________________________________________________________ Name: svn:eol-style + native Added: announcement/trunk/src/main/java/jp/sf/pal/announcement/db/allcommon/cbean/ckey/ConditionKeyNotInScope.java =================================================================== --- announcement/trunk/src/main/java/jp/sf/pal/announcement/db/allcommon/cbean/ckey/ConditionKeyNotInScope.java (rev 0) +++ announcement/trunk/src/main/java/jp/sf/pal/announcement/db/allcommon/cbean/ckey/ConditionKeyNotInScope.java 2008-06-30 02:54:27 UTC (rev 1002) @@ -0,0 +1,111 @@ +package jp.sf.pal.announcement.db.allcommon.cbean.ckey; + +import jp.sf.pal.announcement.db.allcommon.cbean.coption.ConditionOption; +import jp.sf.pal.announcement.db.allcommon.cbean.cvalue.ConditionValue; + +import org.apache.commons.logging.Log; +import org.apache.commons.logging.LogFactory; + +/** + * The condition-key of notInScope. + * @author DBFlute(AutoGenerator) + */ +public class ConditionKeyNotInScope extends ConditionKey { + + /** Log-instance. */ + private static final Log _log = LogFactory + .getLog(ConditionKeyNotInScope.class); + + /** + * Constructor. + */ + protected ConditionKeyNotInScope() { + _conditionKey = "notInScope"; + _operand = "not in"; + } + + /** + * Is valid registration? + * @param conditionValue Condition value. (NotNull) + * @param value Value. (NotNull) + * @param callerName Caller name. (NotNull) + * @return Determination. + */ + public boolean isValidRegistration(ConditionValue conditionValue, + Object value, String callerName) { + if (value == null) { + return false; + } + if (value instanceof java.util.List + && ((java.util.List) value).isEmpty()) { + return false; + } + if (value instanceof java.util.List) { + if (conditionValue.hasNotInScope()) { + if (conditionValue.equalNotInScope(((java.util.List) value))) { + _log.warn("The value has already registered at " + + callerName + ": value=" + value); + return false; + } else { + conditionValue.overrideNotInScope(((java.util.List) value)); + return false; + } + } + } + return true; + } + + /** + * This method implements super#doAddWhereClause(). + * + * @param conditionList Condition list. (NotNull) + * @param columnName Column name. (NotNull) + * @param value Condition value. (NotNull) + */ + protected void doAddWhereClause(java.util.List conditionList, + String columnName, ConditionValue value) { + if (value.getNotInScope() == null) { + return; + } + conditionList.add(buildBindClause(columnName, value + .getNotInScopeLocation(), "('a1', 'a2')")); + } + + /** + * This method implements super#doAddWhereClause(). + * @param conditionList Condition list. (NotNull) + * @param columnName Column name. (NotNull) + * @param value Condition value. (NotNull) + * @param option Condition option. (NotNull) + */ + protected void doAddWhereClause(java.util.List conditionList, + String columnName, ConditionValue value, ConditionOption option) { + throw new UnsupportedOperationException( + "doAddWhereClause that has ConditionOption is unsupported!!!"); + } + + /** + * This method implements super#doSetupConditionValue(). + * @param conditionValue Condition value. (NotNull) + * @param value Value. (NotNull) + * @param location Location. (NotNull) + */ + protected void doSetupConditionValue(ConditionValue conditionValue, + Object value, String location) { + conditionValue.setNotInScope((java.util.List) value) + .setNotInScopeLocation(location); + } + + /** + * This method implements super#doSetupConditionValue(). + * @param conditionValue Condition value. (NotNull) + * @param value Value. (NotNull) + * @param location Location. (NotNull) + * @param option Condition option. (NotNull) + */ + protected void doSetupConditionValue(ConditionValue conditionValue, + Object value, String location, ConditionOption option) { + throw new UnsupportedOperationException( + "doSetupConditionValue with condition-option is unsupported!!!"); + } +} Property changes on: announcement/trunk/src/main/java/jp/sf/pal/announcement/db/allcommon/cbean/ckey/ConditionKeyNotInScope.java ___________________________________________________________________ Name: svn:eol-style + native Added: announcement/trunk/src/main/java/jp/sf/pal/announcement/db/allcommon/cbean/ckey/ConditionKeyPrefixSearch.java =================================================================== --- announcement/trunk/src/main/java/jp/sf/pal/announcement/db/allcommon/cbean/ckey/ConditionKeyPrefixSearch.java (rev 0) +++ announcement/trunk/src/main/java/jp/sf/pal/announcement/db/allcommon/cbean/ckey/ConditionKeyPrefixSearch.java 2008-06-30 02:54:27 UTC (rev 1002) @@ -0,0 +1,111 @@ +package jp.sf.pal.announcement.db.allcommon.cbean.ckey; + +import jp.sf.pal.announcement.db.allcommon.cbean.coption.ConditionOption; +import jp.sf.pal.announcement.db.allcommon.cbean.cvalue.ConditionValue; + +import org.apache.commons.logging.Log; +import org.apache.commons.logging.LogFactory; + +/** + * The condition-key of prefixSearch. + * + * @author DBFlute(AutoGenerator) + */ +public class ConditionKeyPrefixSearch extends ConditionKey { + + /** Log-instance. */ + private static final Log _log = LogFactory + .getLog(ConditionKeyPrefixSearch.class); + + /** + * Constructor. + */ + protected ConditionKeyPrefixSearch() { + _conditionKey = "prefixSearch"; + _operand = "like"; + } + + /** + * Is valid registration? + * + * @param conditionValue Condition value. (NotNull) + * @param value Value. (NotNull) + * @param callerName Caller name. (NotNull) + * @return Determination. + */ + public boolean isValidRegistration(ConditionValue conditionValue, + Object value, String callerName) { + if (value == null) { + return false; + } + if (conditionValue.hasPrefixSearch()) { + if (conditionValue.equalPrefixSearch(value + getWildCard())) { + _log.warn("The value has already registered at " + callerName + + ": value=" + value); + return false; + } else { + conditionValue.overridePrefixSearch(value); + return false; + } + } + return true; + } + + /** + * This method implements super#doAddWhereClause(). + * + * @param conditionList Condition list. (NotNull) + * @param columnName Column name. (NotNull) + * @param value Condition value. (NotNull) + */ + protected void doAddWhereClause(java.util.List conditionList, + String columnName, ConditionValue value) { + if (value.getPrefixSearch() == null) { + return; + } + conditionList.add(buildBindClause(columnName, value + .getPrefixSearchLocation())); + } + + /** + * This method implements super#doAddWhereClause(). + * + * @param conditionList Condition list. (NotNull) + * @param columnName Column name. (NotNull) + * @param value Condition value. (NotNull) + * @param option Condition option. (NotNull) + */ + protected void doAddWhereClause(java.util.List conditionList, + String columnName, ConditionValue value, ConditionOption option) { + throw new UnsupportedOperationException( + "doAddWhereClause that has ConditionOption is unsupported!!!"); + } + + /** + * This method implements super#doSetupConditionValue(). + * + * @param conditionValue Condition value. (NotNull) + * @param value Value. (NotNull) + * @param location Location. (NotNull) + */ + protected void doSetupConditionValue(ConditionValue conditionValue, + Object value, String location) { + conditionValue.setPrefixSearch( + (value != null ? value + getWildCard() : null)) + .setPrefixSearchLocation(location); + } + + /** + * This method implements super#doSetupConditionValue(). + * + * @param conditionValue Condition value. (NotNull) + * @param value Value. (NotNull) + * @param location Location. (NotNull) + * @param option Condition option. (NotNull) + */ + protected void doSetupConditionValue(ConditionValue conditionValue, + Object value, String location, ConditionOption option) { + throw new UnsupportedOperationException( + "doSetupConditionValue with condition-option is unsupported!!!"); + } +} Property changes on: announcement/trunk/src/main/java/jp/sf/pal/announcement/db/allcommon/cbean/ckey/ConditionKeyPrefixSearch.java ___________________________________________________________________ Name: svn:eol-style + native Added: announcement/trunk/src/main/java/jp/sf/pal/announcement/db/allcommon/cbean/coption/ConditionOption.java =================================================================== --- announcement/trunk/src/main/java/jp/sf/pal/announcement/db/allcommon/cbean/coption/ConditionOption.java (rev 0) +++ announcement/trunk/src/main/java/jp/sf/pal/announcement/db/allcommon/cbean/coption/ConditionOption.java 2008-06-30 02:54:27 UTC (rev 1002) @@ -0,0 +1,10 @@ +package jp.sf.pal.announcement.db.allcommon.cbean.coption; + +/** + * The interface of condition-option. + * + * @author DBFlute(AutoGenerator) + */ +public interface ConditionOption { + public String getRearOption(); +} Property changes on: announcement/trunk/src/main/java/jp/sf/pal/announcement/db/allcommon/cbean/coption/ConditionOption.java ___________________________________________________________________ Name: svn:eol-style + native Added: announcement/trunk/src/main/java/jp/sf/pal/announcement/db/allcommon/cbean/coption/DateFromToOption.java =================================================================== --- announcement/trunk/src/main/java/jp/sf/pal/announcement/db/allcommon/cbean/coption/DateFromToOption.java (rev 0) +++ announcement/trunk/src/main/java/jp/sf/pal/announcement/db/allcommon/cbean/coption/DateFromToOption.java 2008-06-30 02:54:27 UTC (rev 1002) @@ -0,0 +1,24 @@ +package jp.sf.pal.announcement.db.allcommon.cbean.coption; + +/** + * The option of date-from-to. + *
    + * ex) fromDate:{2007/04/10 08:24:53} toDate:{2007/04/16 14:36:29}
    + *
    + *   - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - 
    + *   new DateFromToOption(); 
    + *     --> column >= '2007/04/10 00:00:00' and column < '2007/04/17 00:00:00'
    + *   - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - 
    + * 
    + * 
    + * @author DBFlute(AutoGenerator) + */ +public class DateFromToOption extends FromToOption { + + // =================================================================================== + // Constructor + // =========== + public DateFromToOption() { + compareAsDate(); + } +} Property changes on: announcement/trunk/src/main/java/jp/sf/pal/announcement/db/allcommon/cbean/coption/DateFromToOption.java ___________________________________________________________________ Name: svn:eol-style + native Added: announcement/trunk/src/main/java/jp/sf/pal/announcement/db/allcommon/cbean/coption/FromToOption.java =================================================================== --- announcement/trunk/src/main/java/jp/sf/pal/announcement/db/allcommon/cbean/coption/FromToOption.java (rev 0) +++ announcement/trunk/src/main/java/jp/sf/pal/announcement/db/allcommon/cbean/coption/FromToOption.java 2008-06-30 02:54:27 UTC (rev 1002) @@ -0,0 +1,147 @@ +package jp.sf.pal.announcement.db.allcommon.cbean.coption; + +/** + * The option of from-to. + *
    + * ex) fromDate:{2007/04/10 08:24:53} toDate:{2007/04/16 14:36:29}
    + *
    + *   - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - 
    + *   new FromToOption().compareAsDate(); 
    + *     --> column >= '2007/04/10 00:00:00' and column < '2007/04/17 00:00:00'
    + *   - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - 
    + *
    + *   new FromToOption(); 
    + *     --> column >= '2007/04/10 08:24:53' and column <= '2007/04/16 14:36:29'
    + *
    + *   new FromToOption().greaterThan(); 
    + *     --> column > '2007/04/10 08:24:53' and column <= '2007/04/16 14:36:29'
    + *
    + *   new FromToOption().lessThan(); 
    + *     --> column >= '2007/04/10 08:24:53' and column < '2007/04/16 14:36:29'
    + *
    + *   new FromToOption().greaterThan().lessThan(); 
    + *     --> column > '2007/04/10 08:24:53' and column < '2007/04/16 14:36:29'
    + * 
    + * 
    + * @author DBFlute(AutoGenerator) + */ +public class FromToOption implements ConditionOption { + + // =================================================================================== + // Attribute + // ========= + protected boolean _fromDateGreaterThan; + + protected boolean _toDateLessThan; + + protected boolean _compareAsDate; + + // =================================================================================== + // Interface Implementation + // ======================== + public String getRearOption() { + String msg = "Thie option does not use getRearOption()!"; + throw new UnsupportedOperationException(msg); + } + + // =================================================================================== + // Main + // ==== + public FromToOption greaterThan() { + _fromDateGreaterThan = true; + return this; + } + + public FromToOption lessThan() { + _toDateLessThan = true; + return this; + } + + /** + * Compare as date. + *
    +     * ex) fromDate:{2007/04/10 08:24:53} toDate:{2007/04/16 14:36:29}
    +     *
    +     *   new FromToOption().compareAsDate();
    +     *     --> column >= '2007/04/10 00:00:00' and column < '2007/04/17 00:00:00'
    +     * 
    +     * This method ignore greaterThan() and lessThan().
    +     * 
    + * @return this. (NotNull) + */ + public FromToOption compareAsDate() { + _compareAsDate = true; + return this; + } + + // =================================================================================== + // Internal Main + // ============= + public java.util.Date filterFromDate(java.util.Date fromDate) { + if (fromDate == null) { + return null; + } + if (_compareAsDate) { + final java.util.Calendar cal = java.util.Calendar.getInstance(); + cal.setTimeInMillis(fromDate.getTime()); + clearCalendarHourMinuteSecondMilli(cal); + final java.util.Date cloneDate = (java.util.Date) fromDate.clone(); + cloneDate.setTime(cal.getTimeInMillis()); + return cloneDate; + } + return fromDate; + } + + public java.util.Date filterToDate(java.util.Date toDate) { + if (toDate == null) { + return null; + } + if (_compareAsDate) { + final java.util.Calendar cal = java.util.Calendar.getInstance(); + cal.setTimeInMillis(toDate.getTime()); + clearCalendarHourMinuteSecondMilli(cal); + addCalendarNextDay(cal);// Key Point! + final java.util.Date cloneDate = (java.util.Date) toDate.clone(); + cloneDate.setTime(cal.getTimeInMillis()); + return cloneDate; + } + return toDate; + } + + public jp.sf.pal.announcement.db.allcommon.cbean.ckey.ConditionKey getFromDateConditionKey() { + if (_compareAsDate) { + return jp.sf.pal.announcement.db.allcommon.cbean.ckey.ConditionKey.CK_GREATER_EQUAL; + } + if (_fromDateGreaterThan) { + return jp.sf.pal.announcement.db.allcommon.cbean.ckey.ConditionKey.CK_GREATER_THAN;// Default! + } else { + return jp.sf.pal.announcement.db.allcommon.cbean.ckey.ConditionKey.CK_GREATER_EQUAL;// Default! + } + } + + public jp.sf.pal.announcement.db.allcommon.cbean.ckey.ConditionKey getToDateConditionKey() { + if (_compareAsDate) { + return jp.sf.pal.announcement.db.allcommon.cbean.ckey.ConditionKey.CK_LESS_THAN; + } + if (_toDateLessThan) { + return jp.sf.pal.announcement.db.allcommon.cbean.ckey.ConditionKey.CK_LESS_THAN;// Default! + } else { + return jp.sf.pal.announcement.db.allcommon.cbean.ckey.ConditionKey.CK_LESS_EQUAL;// Default! + } + } + + // =================================================================================== + // Calendar Helper + // =============== + protected void addCalendarNextDay(java.util.Calendar cal) { + cal.add(java.util.Calendar.DAY_OF_MONTH, 1); + } + + protected void clearCalendarHourMinuteSecondMilli(java.util.Calendar cal) { + cal.clear(java.util.Calendar.MILLISECOND); + cal.clear(java.util.Calendar.SECOND); + cal.clear(java.util.Calendar.MINUTE); + cal.set(java.util.Calendar.HOUR_OF_DAY, cal + .getActualMinimum(java.util.Calendar.HOUR_OF_DAY)); + } +} Property changes on: announcement/trunk/src/main/java/jp/sf/pal/announcement/db/allcommon/cbean/coption/FromToOption.java ___________________________________________________________________ Name: svn:eol-style + native Added: announcement/trunk/src/main/java/jp/sf/pal/announcement/db/allcommon/cbean/coption/InScopeOption.java =================================================================== --- announcement/trunk/src/main/java/jp/sf/pal/announcement/db/allcommon/cbean/coption/InScopeOption.java (rev 0) +++ announcement/trunk/src/main/java/jp/sf/pal/announcement/db/allcommon/cbean/coption/InScopeOption.java 2008-06-30 02:54:27 UTC (rev 1002) @@ -0,0 +1,87 @@ +package jp.sf.pal.announcement.db.allcommon.cbean.coption; + +import jp.sf.pal.announcement.db.allcommon.cbean.coption.parts.local.JapaneseOptionPartsAgent; + +/** + * The class of in-scope-option. + * + * @author DBFlute(AutoGenerator) + */ +public class InScopeOption extends SimpleStringOption { + + // ===================================================================================== + // Split + // ===== + public InScopeOption splitBySpace() { + return (InScopeOption) doSplitBySpace(); + } + + public InScopeOption splitBySpace(int splitLimitCount) { + return (InScopeOption) doSplitBySpace(splitLimitCount); + } + + public InScopeOption splitBySpaceContainsDoubleByte() { + return (InScopeOption) doSplitBySpaceContainsDoubleByte(); + } + + public InScopeOption splitBySpaceContainsDoubleByte(int splitLimitCount) { + return (InScopeOption) doSplitBySpaceContainsDoubleByte(splitLimitCount); + } + + public InScopeOption splitByPipeLine() { + return (InScopeOption) doSplitByPipeLine(); + } + + public InScopeOption splitByPipeLine(int splitLimitCount) { + return (InScopeOption) doSplitByPipeLine(splitLimitCount); + } + + // ===================================================================================== + // To Upper/Lower Case + // =================== + public InScopeOption toUpperCase() { + return (InScopeOption) doToUpperCase(); + } + + public InScopeOption toLowerCase() { + return (InScopeOption) doToLowerCase(); + } + + // ===================================================================================== + // To Single Byte + // ============== + public InScopeOption toSingleByteSpace() { + return (InScopeOption) doToSingleByteSpace(); + } + + public InScopeOption toSingleByteAlphabetNumber() { + return (InScopeOption) doToSingleByteAlphabetNumber(); + } + + public InScopeOption toSingleByteAlphabetNumberMark() { + return (InScopeOption) doToSingleByteAlphabetNumberMark(); + } + + // ===================================================================================== + // To Double Byte + // ============== + + // ===================================================================================== + // Japanese + // ======== + public JapaneseOptionPartsAgent localJapanese() { + return doLocalJapanese(); + } + + // ===================================================================================== + // Real Value + // ========== + public java.util.List generateRealValueList(java.util.List valueList) { + final java.util.List resultList = new java.util.ArrayList(); + for (final java.util.Iterator ite = valueList.iterator(); ite.hasNext();) { + final String value = (String) ite.next(); + resultList.add(generateRealValue(value)); + } + return resultList; + } +} Property changes on: announcement/trunk/src/main/java/jp/sf/pal/announcement/db/allcommon/cbean/coption/InScopeOption.java ___________________________________________________________________ Name: svn:eol-style + native Added: announcement/trunk/src/main/java/jp/sf/pal/announcement/db/allcommon/cbean/coption/LikeSearchOption.java =================================================================== --- announcement/trunk/src/main/java/jp/sf/pal/announcement/db/allcommon/cbean/coption/LikeSearchOption.java (rev 0) +++ announcement/trunk/src/main/java/jp/sf/pal/announcement/db/allcommon/cbean/coption/LikeSearchOption.java 2008-06-30 02:54:27 UTC (rev 1002) @@ -0,0 +1,250 @@ +package jp.sf.pal.announcement.db.allcommon.cbean.coption; + +import java.util.ArrayList; +import java.util.Iterator; +import java.util.List; + +import jp.sf.pal.announcement.db.allcommon.cbean.coption.parts.local.JapaneseOptionPartsAgent; + +/** + * The class of like-search-option. + * @author DBFlute(AutoGenerator) + */ +public class LikeSearchOption extends SimpleStringOption { + + // =================================================================================== + // Definition + // ========== + protected static final String LIKE_PREFIX = "prefix"; + + protected static final String LIKE_SUFFIX = "suffix"; + + protected static final String LIKE_CONTAIN = "contain"; + + // =================================================================================== + // Attribute + // ========= + protected String _like; + + protected String _escape; + + protected boolean _asOrSplit; + + protected List _likeAsOrCallbackList; + + // =================================================================================== + // Rear Option + // =========== + public String getRearOption() { + if (_escape == null || _escape.trim().length() == 0) { + return ""; + } + return " escape '" + _escape + "'"; + } + + // =================================================================================== + // AsOr + // ==== + public static interface LikeAsOrCallback { + public String getAdditionalTargetPropertyName(); + + public String filterValue(String currentValue); + + public LikeSearchOption filterOption( + LikeSearchOption optionDeepCopyWithoutCallback); + } + + public static abstract class DefaultLikeAsOrCallback implements + LikeAsOrCallback { + public String filterValue(String currentValue) { + return currentValue; + } + + public LikeSearchOption filterOption( + LikeSearchOption optionDeepCopyWithoutCallback) { + return optionDeepCopyWithoutCallback; + } + } + + public boolean hasLikeAsOrCallback() { + return _likeAsOrCallbackList != null + && !_likeAsOrCallbackList.isEmpty(); + } + + public List getLikeAsOrCallbackList() { + if (_likeAsOrCallbackList == null) { + _likeAsOrCallbackList = new ArrayList(); + } + return _likeAsOrCallbackList; + } + + public void addLikeAsOrCallback(LikeAsOrCallback likeAsOrCallback) { + getLikeAsOrCallbackList().add(likeAsOrCallback); + } + + public void clearLikeAsOrCallback() { + getLikeAsOrCallbackList().clear(); + } + + // =================================================================================== + // Like + // ==== + public LikeSearchOption likePrefix() { + _like = LIKE_PREFIX; + return this; + } + + public LikeSearchOption likeSuffix() { + _like = LIKE_SUFFIX; + return this; + } + + public LikeSearchOption likeContain() { + _like = LIKE_CONTAIN; + return this; + } + + // =================================================================================== + // Escape + // ====== + public LikeSearchOption escapeByPipeLine() { + _escape = "|"; + return this; + } + + public LikeSearchOption escapeByAtMark() { + _escape = "@"; + return this; + } + + public LikeSearchOption escapeBySlash() { + _escape = "/"; + return this; + } + + public LikeSearchOption escapeByBackSlash() { + _escape = "\\"; + return this; + } + + // =================================================================================== + // Split + // ===== + public LikeSearchOption splitBySpace() { + return (LikeSearchOption) doSplitBySpace(); + } + + public LikeSearchOption splitBySpace(int splitLimitCount) { + return (LikeSearchOption) doSplitBySpace(splitLimitCount); + } + + public LikeSearchOption splitBySpaceContainsDoubleByte() { + return (LikeSearchOption) doSplitBySpaceContainsDoubleByte(); + } + + public LikeSearchOption splitBySpaceContainsDoubleByte(int splitLimitCount) { + return (LikeSearchOption) doSplitBySpaceContainsDoubleByte(splitLimitCount); + } + + public LikeSearchOption splitByPipeLine() { + return (LikeSearchOption) doSplitByPipeLine(); + } + + public LikeSearchOption splitByPipeLine(int splitLimitCount) { + return (LikeSearchOption) doSplitByPipeLine(splitLimitCount); + } + + public LikeSearchOption asOrSplit() { + _asOrSplit = true; + return this; + } + + public boolean isAsOrSplit() { + return _asOrSplit; + } + + // =================================================================================== + // To Upper/Lower Case + // =================== + public LikeSearchOption toUpperCase() { + return (LikeSearchOption) doToUpperCase(); + } + + public LikeSearchOption toLowerCase() { + return (LikeSearchOption) doToLowerCase(); + } + + // =================================================================================== + // To Single Byte + // ============== + public LikeSearchOption toSingleByteSpace() { + return (LikeSearchOption) doToSingleByteSpace(); + } + + public LikeSearchOption toSingleByteAlphabetNumber() { + return (LikeSearchOption) doToSingleByteAlphabetNumber(); + } + + public LikeSearchOption toSingleByteAlphabetNumberMark() { + return (LikeSearchOption) doToSingleByteAlphabetNumberMark(); + } + + // =================================================================================== + // To Double Byte + // ============== + + // =================================================================================== + // Japanese + // ======== + public JapaneseOptionPartsAgent localJapanese() { + return doLocalJapanese(); + } + + // =================================================================================== + // Real Value + // ========== + public String generateRealValue(String value) { + value = super.generateRealValue(value); + + // Escape + if (_escape != null && _escape.trim().length() != 0) { + String tmp = replace(value, _escape, _escape + _escape); + tmp = replace(tmp, "%", _escape + "%"); + tmp = replace(tmp, "_", _escape + "_"); + value = tmp; + } + final String wildCard = "%"; + if (_like == null || _like.trim().length() == 0) { + return value; + } else if (_like.equals(LIKE_PREFIX)) { + return value + wildCard; + } else if (_like.equals(LIKE_SUFFIX)) { + return wildCard + value; + } else if (_like.equals(LIKE_CONTAIN)) { + return wildCard + value + wildCard; + } else { + String msg = "The like was wrong string: " + _like; + throw new IllegalStateException(msg); + } + } + + // =================================================================================== + // DeepCopy + // ======== + public Object createDeepCopy() { + final LikeSearchOption deepCopy = (LikeSearchOption) super + .createDeepCopy(); + deepCopy._like = _like; + deepCopy._escape = _escape; + if (hasLikeAsOrCallback()) { + for (Iterator ite = _likeAsOrCallbackList.iterator(); ite.hasNext();) { + deepCopy.addLikeAsOrCallback((LikeAsOrCallback) ite.next()); + } + } + return deepCopy; + } + + protected SimpleStringOption newDeepCopyInstance() { + return new LikeSearchOption(); + } +} Property changes on: announcement/trunk/src/main/java/jp/sf/pal/announcement/db/allcommon/cbean/coption/LikeSearchOption.java ___________________________________________________________________ Name: svn:eol-style + native Added: announcement/trunk/src/main/java/jp/sf/pal/announcement/db/allcommon/cbean/coption/SimpleStringOption.java =================================================================== --- announcement/trunk/src/main/java/jp/sf/pal/announcement/db/allcommon/cbean/coption/SimpleStringOption.java (rev 0) +++ announcement/trunk/src/main/java/jp/sf/pal/announcement/db/allcommon/cbean/coption/SimpleStringOption.java 2008-06-30 02:54:27 UTC (rev 1002) @@ -0,0 +1,183 @@ +package jp.sf.pal.announcement.db.allcommon.cbean.coption; + +import jp.sf.pal.announcement.db.allcommon.cbean.coption.parts.SplitOptionParts; +import jp.sf.pal.announcement.db.allcommon.cbean.coption.parts.ToSingleByteOptionParts; +import jp.sf.pal.announcement.db.allcommon.cbean.coption.parts.ToUpperLowerCaseOptionParts; +import jp.sf.pal.announcement.db.allcommon.cbean.coption.parts.local.JapaneseOptionPartsAgent; +import jp.sf.pal.announcement.db.allcommon.util.SimpleStringUtil; + +/** + * The class of simple-string-option. + * + * @author DBFlute(AutoGenerator) + */ +public class SimpleStringOption implements ConditionOption { + + protected SplitOptionParts _splitOptionParts; + + protected ToUpperLowerCaseOptionParts _toUpperLowerCaseOptionParts; + + protected ToSingleByteOptionParts _toSingleByteCaseOptionParts; + + protected JapaneseOptionPartsAgent _japaneseOptionPartsAgent; + + // ===================================================================================== + // Rear Option + // =========== + public String getRearOption() { + return ""; + } + + // ===================================================================================== + // Split + // ===== + protected SimpleStringOption doSplitBySpace() { + getSplitOptionParts().splitBySpace(); + return this; + } + + protected SimpleStringOption doSplitBySpace(int splitLimitCount) { + getSplitOptionParts().splitBySpace(splitLimitCount); + return this; + } + + protected SimpleStringOption doSplitBySpaceContainsDoubleByte() { + getSplitOptionParts().splitBySpaceContainsDoubleByte(); + return this; + } + + protected SimpleStringOption doSplitBySpaceContainsDoubleByte( + int splitLimitCount) { + getSplitOptionParts().splitBySpaceContainsDoubleByte(splitLimitCount); + return this; + } + + protected SimpleStringOption doSplitByPipeLine() { + getSplitOptionParts().splitByPipeLine(); + return this; + } + + protected SimpleStringOption doSplitByPipeLine(int splitLimitCount) { + getSplitOptionParts().splitByPipeLine(splitLimitCount); + return this; + } + + protected SplitOptionParts getSplitOptionParts() { + if (_splitOptionParts == null) { + _splitOptionParts = new SplitOptionParts(); + } + return _splitOptionParts; + } + + public boolean isSplit() { + return getSplitOptionParts().isSplit(); + } + + public String[] generateSplitValueArray(String value) { + return getSplitOptionParts().generateSplitValueArray(value); + } + + // ===================================================================================== + // To Upper/Lower Case + // =================== + protected SimpleStringOption doToUpperCase() { + getToUpperLowerCaseOptionParts().toUpperCase(); + return this; + } + + protected SimpleStringOption doToLowerCase() { + getToUpperLowerCaseOptionParts().toLowerCase(); + return this; + } + + protected ToUpperLowerCaseOptionParts getToUpperLowerCaseOptionParts() { + if (_toUpperLowerCaseOptionParts == null) { + _toUpperLowerCaseOptionParts = new ToUpperLowerCaseOptionParts(); + } + return _toUpperLowerCaseOptionParts; + } + + // ===================================================================================== + // To Single Byte + // ============== + protected SimpleStringOption doToSingleByteSpace() { + getToSingleByteOptionParts().toSingleByteSpace(); + return this; + } + + protected SimpleStringOption doToSingleByteAlphabetNumber() { + getToSingleByteOptionParts().toSingleByteAlphabetNumber(); + return this; + } + + protected SimpleStringOption doToSingleByteAlphabetNumberMark() { + getToSingleByteOptionParts().toSingleByteAlphabetNumberMark(); + return this; + } + + protected ToSingleByteOptionParts getToSingleByteOptionParts() { + if (_toSingleByteCaseOptionParts == null) { + _toSingleByteCaseOptionParts = new ToSingleByteOptionParts(); + } + return _toSingleByteCaseOptionParts; + } + + // ===================================================================================== + // To Double Byte + // ============== + + // ===================================================================================== + // Japanese + // ======== + protected JapaneseOptionPartsAgent doLocalJapanese() { + return getJapaneseOptionPartsAgent(); + } + + protected JapaneseOptionPartsAgent getJapaneseOptionPartsAgent() { + if (_japaneseOptionPartsAgent == null) { + _japaneseOptionPartsAgent = new JapaneseOptionPartsAgent(); + } + return _japaneseOptionPartsAgent; + } + + // ===================================================================================== + // Real Value + // ========== + public String generateRealValue(String value) { + value = getToUpperLowerCaseOptionParts().generateRealValue(value); + value = getToSingleByteOptionParts().generateRealValue(value); + value = getJapaneseOptionPartsAgent().generateRealValue(value); + return value; + } + + // ===================================================================================== + // General Helper + // ============== + protected String replace(String text, String fromText, String toText) { + return SimpleStringUtil.replace(text, fromText, toText); + } + + // ===================================================================================== + // DeepCopy + // ======== + public Object createDeepCopy() { + final SimpleStringOption deepCopy = newDeepCopyInstance(); + deepCopy._splitOptionParts = _splitOptionParts != null ? (SplitOptionParts) _splitOptionParts + .createDeepCopy() + : null; + deepCopy._toUpperLowerCaseOptionParts = _toUpperLowerCaseOptionParts != null ? (ToUpperLowerCaseOptionParts) _toUpperLowerCaseOptionParts + .createDeepCopy() + : null; + deepCopy._toSingleByteCaseOptionParts = _toSingleByteCaseOptionParts != null ? (ToSingleByteOptionParts) _toSingleByteCaseOptionParts + .createDeepCopy() + : null; + deepCopy._japaneseOptionPartsAgent = _japaneseOptionPartsAgent != null ? (JapaneseOptionPartsAgent) _japaneseOptionPartsAgent + .createDeepCopy() + : null; + return deepCopy; + } + + protected SimpleStringOption newDeepCopyInstance() { + return new SimpleStringOption(); + } +} Property changes on: announcement/trunk/src/main/java/jp/sf/pal/announcement/db/allcommon/cbean/coption/SimpleStringOption.java ___________________________________________________________________ Name: svn:eol-style + native Added: announcement/trunk/src/main/java/jp/sf/pal/announcement/db/allcommon/cbean/coption/parts/SplitOptionParts.java =================================================================== --- announcement/trunk/src/main/java/jp/sf/pal/announcement/db/allcommon/cbean/coption/parts/SplitOptionParts.java (rev 0) +++ announcement/trunk/src/main/java/jp/sf/pal/announcement/db/allcommon/cbean/coption/parts/SplitOptionParts.java 2008-06-30 02:54:27 UTC (rev 1002) @@ -0,0 +1,156 @@ +package jp.sf.pal.announcement.db.allcommon.cbean.coption.parts; + +/** + * The interface of condition-option. + * + * @author DBFlute(AutoGenerator) + */ +public class SplitOptionParts { + + // ===================================================================================== + // Attribute + // ========= + protected String _split; + + protected String _splitContainedDelimiter; + + protected int _splitLimitCount; + + // ===================================================================================== + // Main + // ==== + public boolean isSplit() { + return _split != null; + } + + public void splitBySpace() { + _split = " "; + } + + public void splitBySpace(int splitLimitCount) { + _split = " "; + _splitLimitCount = splitLimitCount; + } + + public void splitBySpaceContainsDoubleByte() { + _split = " "; + _splitContainedDelimiter = "\u3000"; + } + + public void splitBySpaceContainsDoubleByte(int splitLimitCount) { + _split = " "; + _splitContainedDelimiter = "\u3000"; + _splitLimitCount = splitLimitCount; + } + + public void splitByPipeLine() { + _split = "|"; + } + + public void splitByPipeLine(int splitLimitCount) { + _split = "|"; + _splitLimitCount = splitLimitCount; + } + + // ===================================================================================== + // Real Value + // ========== + public String[] generateSplitValueArray(String value) { + if (value == null || value.trim().length() == 0) { + String msg = "The argument[value] should not be null of empty: " + + value; + throw new IllegalArgumentException(msg); + } + value = repalceContainedDelimiterToRealDelimiter(value); + final java.util.StringTokenizer st = new java.util.StringTokenizer( + value, _split); + final String[] tokenizedValues = new String[st.countTokens()]; + int count = 0; + while (st.hasMoreTokens()) { + tokenizedValues[count] = st.nextToken(); + count++; + } + final String[] values = removeInvalidValue(tokenizedValues); + if (_splitLimitCount > 0 && values.length > _splitLimitCount) { + final String[] realValues = new String[_splitLimitCount]; + for (int i = 0; i < values.length; i++) { + if (i == _splitLimitCount) { + break; + } + realValues[i] = values[i]; + } + return realValues; + } else { + return values; + } + + } + + protected String repalceContainedDelimiterToRealDelimiter(String value) { + if (value == null || value.trim().length() == 0) { + return value; + } + if (_splitContainedDelimiter == null) { + return value; + } + if (_split == null) { + return value; + } + return replace(value, _splitContainedDelimiter, _split); + } + + protected String[] removeInvalidValue(String[] values) { + final java.util.List ls = new java.util.ArrayList(); + for (int i = 0; i < values.length; i++) { + final String value = values[i]; + if (value == null || value.equals("")) {// Don't trim!!! + continue; + } + ls.add(value); + } + final String[] resultArray = new String[ls.size()]; + for (int i = 0; i < ls.size(); i++) { + resultArray[i] = (String) ls.get(i); + } + return resultArray; + } + + // ===================================================================================== + // Helper + // ====== + protected final String replace(String text, String fromText, String toText) { + + if (text == null || fromText == null || toText == null) { + return null; + } + StringBuffer buf = new StringBuffer(100); + int pos = 0; + int pos2 = 0; + while (true) { + pos = text.indexOf(fromText, pos2); + if (pos == 0) { + buf.append(toText); + pos2 = fromText.length(); + } else if (pos > 0) { + buf.append(text.substring(pos2, pos)); + buf.append(toText); + pos2 = pos + fromText.length(); + } else { + buf.append(text.substring(pos2)); + break; + } + } + return buf.toString(); + } + + // ===================================================================================== + // DeepCopy + // ======== + public Object createDeepCopy() { + final SplitOptionParts deepCopy = new SplitOptionParts(); + deepCopy._split = _split; + deepCopy._splitContainedDelimiter = _splitContainedDelimiter; + deepCopy._splitLimitCount = _splitLimitCount; + return deepCopy; + } +} Property changes on: announcement/trunk/src/main/java/jp/sf/pal/announcement/db/allcommon/cbean/coption/parts/SplitOptionParts.java ___________________________________________________________________ Name: svn:eol-style + native Added: announcement/trunk/src/main/java/jp/sf/pal/announcement/db/allcommon/cbean/coption/parts/ToSingleByteOptionParts.java =================================================================== --- announcement/trunk/src/main/java/jp/sf/pal/announcement/db/allcommon/cbean/coption/parts/ToSingleByteOptionParts.java (rev 0) +++ announcement/trunk/src/main/java/jp/sf/pal/announcement/db/allcommon/cbean/coption/parts/ToSingleByteOptionParts.java 2008-06-30 02:54:27 UTC (rev 1002) @@ -0,0 +1,84 @@ +package jp.sf.pal.announcement.db.allcommon.cbean.coption.parts; + +import jp.sf.pal.announcement.db.allcommon.helper.character.GeneralCharacter; +import jp.sf.pal.announcement.db.allcommon.helper.character.impl.GeneralCharacterImpl; + +/** + * The interface of condition-option. + * + * @author DBFlute(AutoGenerator) + */ +public class ToSingleByteOptionParts { + + // ===================================================================================== + // Attribute + // ========= + protected boolean _toSingleByteSpace; + + protected boolean _toSingleByteAlphabetNumber; + + protected boolean _toSingleByteAlphabetNumberMark; + + private GeneralCharacter _generalCharacter; + + // ===================================================================================== + // Main + // ==== + public boolean isToSingleByteSpace() { + return _toSingleByteSpace; + } + + public void toSingleByteSpace() { + _toSingleByteSpace = true; + } + + public void toSingleByteAlphabetNumber() { + _toSingleByteAlphabetNumber = true; + } + + public void toSingleByteAlphabetNumberMark() { + _toSingleByteAlphabetNumberMark = true; + } + + // ===================================================================================== + // Real Value + // ========== + public String generateRealValue(String value) { + if (value == null || value.trim().length() == 0) { + String msg = "The argument[value] should not be null."; + throw new IllegalArgumentException(msg); + } + + // To Single Byte + if (_toSingleByteSpace) { + value = (value != null ? value.replaceAll("\u3000", " ") : value); + } + if (_toSingleByteAlphabetNumberMark) { + value = getGeneralCharacter().toSingleByteAlphabetNumberMark(value); + } else if (_toSingleByteAlphabetNumber) { + value = getGeneralCharacter().toSingleByteAlphabetNumber(value); + } + return value; + } + + // ===================================================================================== + // Helper + // ====== + protected GeneralCharacter getGeneralCharacter() { + if (_generalCharacter == null) { + _generalCharacter = new GeneralCharacterImpl(); + } + return _generalCharacter; + } + + // ===================================================================================== + // DeepCopy + // ======== + public Object createDeepCopy() { + final ToSingleByteOptionParts deepCopy = new ToSingleByteOptionParts(); + deepCopy._toSingleByteSpace = _toSingleByteSpace; + deepCopy._toSingleByteAlphabetNumber = _toSingleByteAlphabetNumber; + deepCopy._toSingleByteAlphabetNumberMark = _toSingleByteAlphabetNumberMark; + return deepCopy; + } +} Property changes on: announcement/trunk/src/main/java/jp/sf/pal/announcement/db/allcommon/cbean/coption/parts/ToSingleByteOptionParts.java ___________________________________________________________________ Name: svn:eol-style + native Added: announcement/trunk/src/main/java/jp/sf/pal/announcement/db/allcommon/cbean/coption/parts/ToUpperLowerCaseOptionParts.java =================================================================== --- announcement/trunk/src/main/java/jp/sf/pal/announcement/db/allcommon/cbean/coption/parts/ToUpperLowerCaseOptionParts.java (rev 0) +++ announcement/trunk/src/main/java/jp/sf/pal/announcement/db/allcommon/cbean/coption/parts/ToUpperLowerCaseOptionParts.java 2008-06-30 02:54:27 UTC (rev 1002) @@ -0,0 +1,58 @@ +package jp.sf.pal.announcement.db.allcommon.cbean.coption.parts; + +/** + * The class of condition-option-parts about toUpperCase/toLowerCase. + * + * @author DBFlute(AutoGenerator) + */ +public class ToUpperLowerCaseOptionParts { + + // ===================================================================================== + // Attribute + // ========= + protected boolean _toUpperCase; + + protected boolean _toLowerCase; + + // ===================================================================================== + // Main + // ==== + public void toUpperCase() { + _toUpperCase = true; + _toLowerCase = false; + } + + public void toLowerCase() { + _toUpperCase = false; + _toLowerCase = true; + } + + // ===================================================================================== + // Real Value + // ========== + public String generateRealValue(String value) { + if (value == null || value.trim().length() == 0) { + String msg = "The argument[value] should not be null."; + throw new IllegalArgumentException(msg); + } + + // To Upper/Lower Case + if (_toUpperCase) { + value = (value != null ? value.toUpperCase() : value); + } + if (_toLowerCase) { + value = (value != null ? value.toLowerCase() : value); + } + return value; + } + + // ===================================================================================== + // DeepCopy + // ======== + public Object createDeepCopy() { + final ToUpperLowerCaseOptionParts deepCopy = new ToUpperLowerCaseOptionParts(); + deepCopy._toUpperCase = _toUpperCase; + deepCopy._toLowerCase = _toLowerCase; + return deepCopy; + } +} Property changes on: announcement/trunk/src/main/java/jp/sf/pal/announcement/db/allcommon/cbean/coption/parts/ToUpperLowerCaseOptionParts.java ___________________________________________________________________ Name: svn:eol-style + native Added: announcement/trunk/src/main/java/jp/sf/pal/announcement/db/allcommon/cbean/coption/parts/local/JapaneseOptionPartsAgent.java =================================================================== --- announcement/trunk/src/main/java/jp/sf/pal/announcement/db/allcommon/cbean/coption/parts/local/JapaneseOptionPartsAgent.java (rev 0) +++ announcement/trunk/src/main/java/jp/sf/pal/announcement/db/allcommon/cbean/coption/parts/local/JapaneseOptionPartsAgent.java 2008-06-30 02:54:27 UTC (rev 1002) @@ -0,0 +1,83 @@ +package jp.sf.pal.announcement.db.allcommon.cbean.coption.parts.local; + +import jp.sf.pal.announcement.db.allcommon.helper.character.JapaneseCharacter; +import jp.sf.pal.announcement.db.allcommon.helper.character.impl.JapaneseCharacterImpl; + +/** + * The class of condition-option-parts-agent. + * + * @author DBFlute(AutoGenerator) + */ +public class JapaneseOptionPartsAgent { + + // ===================================================================================== + // Attribute + // ========= + protected boolean _toDoubleByteKatakana; + + protected boolean _removeLastLongVowel; + + private JapaneseCharacter _japaneseCharacter; + + // ===================================================================================== + // Main + // ==== + public boolean isToDoubleByteKatakana() { + return _toDoubleByteKatakana; + } + + public void toDoubleByteKatakana() { + _toDoubleByteKatakana = true; + } + + public boolean isRemoveLastLongVowel() { + return _removeLastLongVowel; + } + + public void removeLastLongVowel() { + _removeLastLongVowel = true; + } + + // ===================================================================================== + // Real Value + // ========== + public String generateRealValue(String value) { + if (value == null || value.trim().length() == 0) { + String msg = "The argument[value] should not be null."; + throw new IllegalArgumentException(msg); + } + + // To Double Byte + if (_toDoubleByteKatakana) { + value = getJapaneseCharacter().toDoubleByteKatakana(value); + } + + // Remove + if (_removeLastLongVowel) { + if (value != null && value.endsWith("\u30fc")) { + value = value.substring(0, value.length() - "\u30fc".length()); + } + } + return value; + } + + // ===================================================================================== + // Helper + // ====== + protected JapaneseCharacter getJapaneseCharacter() { + if (_japaneseCharacter == null) { + _japaneseCharacter = new JapaneseCharacterImpl(); + } + return _japaneseCharacter; + } + + // ===================================================================================== + // DeepCopy + // ======== + public Object createDeepCopy() { + final JapaneseOptionPartsAgent deepCopy = new JapaneseOptionPartsAgent(); + deepCopy._toDoubleByteKatakana = _toDoubleByteKatakana; + deepCopy._removeLastLongVowel = _removeLastLongVowel; + return deepCopy; + } +} Property changes on: announcement/trunk/src/main/java/jp/sf/pal/announcement/db/allcommon/cbean/coption/parts/local/JapaneseOptionPartsAgent.java ___________________________________________________________________ Name: svn:eol-style + native Added: announcement/trunk/src/main/java/jp/sf/pal/announcement/db/allcommon/cbean/cvalue/ConditionValue.java =================================================================== --- announcement/trunk/src/main/java/jp/sf/pal/announcement/db/allcommon/cbean/cvalue/ConditionValue.java (rev 0) +++ announcement/trunk/src/main/java/jp/sf/pal/announcement/db/allcommon/cbean/cvalue/ConditionValue.java 2008-06-30 02:54:27 UTC (rev 1002) @@ -0,0 +1,1201 @@ +package jp.sf.pal.announcement.db.allcommon.cbean.cvalue; + +import java.util.List; + +import jp.sf.pal.announcement.db.allcommon.cbean.coption.InScopeOption; +import jp.sf.pal.announcement.db.allcommon.cbean.coption.LikeSearchOption; + +/** + * Condition value. + * + * @author DBFlute(AutoGenerator) + */ +public class ConditionValue { + + // =================================================================================== + // Equal + // ===== + /** Value of equal. */ + protected Object _equalValue; + + /** + * Get the value of equal. + * + * @return The value of equal. (Nullable) + */ + public Object getEqual() { + return filterValue(_equalValue); + } + + /** + * Set the value of equal. + * + * @param value The value of equal. (Nullable) + * @return this. (NotNull) + */ + public ConditionValue setEqual(Object value) { + _equalValue = value; + return this; + } + + /** + * Does it has the value of equal? + * + * @return Determination. (NotNull) + */ + public boolean hasEqual() { + return _equalValue != null; + } + + /** + * Does the value equal the value of equal? + * + * @param value The value of equal. (Nullable) + * @return Determination. (NotNull) + */ + public boolean equalEqual(Object value) { + return hasEqual() ? _equalValue.equals(value) : value == null; + } + + /** + * Override the value of equal. + * + * @param value The value of equal. (Nullable) + * @return this. (NotNull) + */ + public ConditionValue overrideEqual(Object value) { + _equalValue = value; + return this; + } + + /** Location of equal. */ + protected String _equalLocation; + + /** + * Get the location of equal. + * + * @return The location of equal. (Nullable) + */ + public String getEqualLocation() { + return _equalLocation; + } + + /** + * Set the location of equal. + * + * @param location The location of equal. (Nullable) + * @return this. (NotNull) + */ + public ConditionValue setEqualLocation(String location) { + _equalLocation = location; + return this; + } + + // =================================================================================== + // Not Equal + // ========= + /** Value of notEqual. */ + protected Object _notEqualValue; + + /** + * Get the value of notEqual. + * + * @return The value of notEqual. (Nullable) + */ + public Object getNotEqual() { + return filterValue(_notEqualValue); + } + + /** + * Set the value of notEqual. + * + * @param value The value of notEqual. (Nullable) + * @return this. (NotNull) + */ + public ConditionValue setNotEqual(Object value) { + _notEqualValue = value; + return this; + } + + /** + * Does it has the value of notEqual? + * + * @return Determination. (NotNull) + */ + public boolean hasNotEqual() { + return _notEqualValue != null; + } + + /** + * Does the value equal the value of notEqual? + * + * @param value The value of notEqual. (Nullable) + * @return Determination. (NotNull) + */ + public boolean equalNotEqual(Object value) { + return hasNotEqual() ? _notEqualValue.equals(value) : value == null; + } + + /** + * Override the value of notEqual. + * + * @param value The value of notEqual. (Nullable) + * @return this. (NotNull) + */ + public ConditionValue overrideNotEqual(Object value) { + _notEqualValue = value; + return this; + } + + /** Location of notEqual. */ + protected String _notEqualLocation; + + /** + * Get the location of notEqual. + * + * @return The location of notEqual. (Nullable) + */ + public String getNotEqualLocation() { + return _notEqualLocation; + } + + /** + * Set the location of notEqual. + * + * @param location The location of notEqual. (Nullable) + * @return this. (NotNull) + */ + public ConditionValue setNotEqualLocation(String location) { + _notEqualLocation = location; + return this; + } + + // =================================================================================== + // Greater Than + // ============ + /** Value of greaterThan. */ + protected Object _greaterThanValue; + + /** + * Get the value of greaterThan. + * + * @return The value of greaterThan. (Nullable) + */ + public Object getGreaterThan() { + return filterValue(_greaterThanValue); + } + + /** + * Set the value of greaterThan. + * + * @param value The value of greaterThan. (Nullable) + * @return this. (NotNull) + */ + public ConditionValue setGreaterThan(Object value) { + _greaterThanValue = value; + return this; + } + + /** + * Does it has the value of greaterThan? + * + * @return Determination. (NotNull) + */ + public boolean hasGreaterThan() { + return _greaterThanValue != null; + } + + /** + * Does the value equal the value of greaterThan? + * + * @param value The value of greaterThan. (Nullable) + * @return Determination. (NotNull) + */ + public boolean equalGreaterThan(Object value) { + return hasGreaterThan() ? _greaterThanValue.equals(value) + : value == null; + } + + /** + * Override the value of greaterThan. + * + * @param value The value of greaterThan. (Nullable) + * @return this. (NotNull) + */ + public ConditionValue overrideGreaterThan(Object value) { + _greaterThanValue = value; + return this; + } + + /** Location of GreaterThan. */ + protected String _greaterThanLocation; + + /** + * Get the location of greaterThan. + * + * @return The location of greaterThan. (Nullable) + */ + public String getGreaterThanLocation() { + return _greaterThanLocation; + } + + /** + * Set the location of greaterThan. + * + * @param location The location of greaterThan. (Nullable) + * @return this. (NotNull) + */ + public ConditionValue setGreaterThanLocation(String location) { + _greaterThanLocation = location; + return this; + } + + // =================================================================================== + // Less Than + // ========= + /** Value of lessThan. */ + protected Object _lessThanValue; + + /** + * Get the value of lessThan. + * + * @return The value of lessThan. (Nullable) + */ + public Object getLessThan() { + return filterValue(_lessThanValue); + } + + /** + * Set the value of lessThan. + * + * @param value The value of lessThan. (Nullable) + * @return this. (NotNull) + */ + public ConditionValue setLessThan(Object value) { + _lessThanValue = value; + return this; + } + + /** + * Does it has the value of lessThan? + * + * @return Determination. (NotNull) + */ + public boolean hasLessThan() { + return _lessThanValue != null; + } + + /** + * Does the value equal the value of lessThan? + * + * @param value The value of lessThan. (Nullable) + * @return Determination. (NotNull) + */ + public boolean equalLessThan(Object value) { + return hasLessThan() ? _lessThanValue.equals(value) : value == null; + } + + /** + * Override the value of lessThan. + * + * @param value The value of lessThan. (Nullable) + * @return this. (NotNull) + */ + public ConditionValue overrideLessThan(Object value) { + _lessThanValue = value; + return this; + } + + /** Location of lessThan. */ + protected String _lessThanLocation; + + /** + * Get the location of lessThan. + * + * @return The location of lessThan. (Nullable) + */ + public String getLessThanLocation() { + return _lessThanLocation; + } + + /** + * Set the location of lessThan. + * + * @param location The location of lessThan. (Nullable) + * @return this. (NotNull) + */ + public ConditionValue setLessThanLocation(String location) { + _lessThanLocation = location; + return this; + } + + // =================================================================================== + // Greater Equal + // ============= + /** Value of greaterEqual. */ + protected Object _greaterEqualValue; + + /** + * Get the value of greaterEqual. + * + * @return The value of greaterEqual. (Nullable) + */ + public Object getGreaterEqual() { + return filterValue(_greaterEqualValue); + } + + /** + * Set the value of greaterEqual. + * + * @param value The value of greaterEqual. (Nullable) + * @return this. (NotNull) + */ + public ConditionValue setGreaterEqual(Object value) { + _greaterEqualValue = value; + return this; + } + + /** + * Does it has the value of greaterEqual? + * + * @return Determination. (NotNull) + */ + public boolean hasGreaterEqual() { + return _greaterEqualValue != null; + } + + /** + * Does the value equal the value of greaterEqual? + * + * @param value The value of greaterEqual. (Nullable) + * @return Determination. (NotNull) + */ + public boolean equalGreaterEqual(Object value) { + return hasGreaterEqual() ? _greaterEqualValue.equals(value) + : value == null; + } + + /** + * Override the value of greaterEqual. + * + * @param value The value of greaterEqual. (Nullable) + * @return this. (NotNull) + */ + public ConditionValue overrideGreaterEqual(Object value) { + _greaterEqualValue = value; + return this; + } + + /** Location of greaterEqual. */ + protected String _greaterEqualLocation; + + /** + * Get the location of greaterEqual. + * + * @return The location of greaterEqual. (Nullable) + */ + public String getGreaterEqualLocation() { + return _greaterEqualLocation; + } + + /** + * Set the location of greaterEqual. + * + * @param location The location of greaterEqual. (Nullable) + * @return this. (NotNull) + */ + public ConditionValue setGreaterEqualLocation(String location) { + _greaterEqualLocation = location; + return this; + } + + // =================================================================================== + // Less Equal + // ========== + /** Value of lessEqual. */ + protected Object _lessEqualValue; + + /** + * Get the value of lessEqual. + * + * @return The value of lessEqual. (Nullable) + */ + public Object getLessEqual() { + return filterValue(_lessEqualValue); + } + + /** + * Set the value of lessEqual. + * + * @param value The value of lessEqual. (Nullable) + * @return this. (NotNull) + */ + public ConditionValue setLessEqual(Object value) { + _lessEqualValue = value; + return this; + } + + /** + * Does it has the value of lessEqual? + * + * @return Determination. (NotNull) + */ + public boolean hasLessEqual() { + return _lessEqualValue != null; + } + + /** + * Does the value equal the value of lessEqual? + * + * @param value The value of lessEqual. (Nullable) + * @return Determination. (NotNull) + */ + public boolean equalLessEqual(Object value) { + return hasLessEqual() ? _lessEqualValue.equals(value) : value == null; + } + + /** + * Override the value of lessEqual. + * + * @param value The value of lessEqual. (Nullable) + * @return this. (NotNull) + */ + public ConditionValue overrideLessEqual(Object value) { + _lessEqualValue = value; + return this; + } + + /** Location of lessEqual. */ + protected String _lessEqualLocation; + + /** + * Get the location of lessEqual. + * + * @return The location of lessEqual. (Nullable) + */ + public String getLessEqualLocation() { + return _lessEqualLocation; + } + + /** + * Set the location of lessEqual. + * + * @param location The location of lessEqual. (Nullable) + * @return this. (NotNull) + */ + public ConditionValue setLessEqualLocation(String location) { + _lessEqualLocation = location; + return this; + } + + // =================================================================================== + // Prefix Search + // ============= + /** Value of prefixSearch. */ + protected Object _prefixSearch; + + /** + * Get the value of prefixSearch. + * + * @return The value of prefixSearch. (Nullable) + */ + public Object getPrefixSearch() { + return filterValue(_prefixSearch); + } + + /** + * Set the value of prefixSearch. + * + * @param value The value of prefixSearch. (Nullable) + * @return this. (NotNull) + */ + public ConditionValue setPrefixSearch(Object value) { + _prefixSearch = value; + return this; + } + + /** + * Does it has the value of prefixSearch? + * + * @return Determination. (NotNull) + */ + public boolean hasPrefixSearch() { + return _prefixSearch != null; + } + + /** + * Does the value equal the value of prefixSearch? + * + * @param value The value of prefixSearch. (Nullable) + * @return Determination. (NotNull) + */ + public boolean equalPrefixSearch(Object value) { + return hasPrefixSearch() ? _prefixSearch.equals(value) : value == null; + } + + /** + * Override the value of prefixSearch. + * + * @param value The value of prefixSearch. (Nullable) + * @return this. (NotNull) + */ + public ConditionValue overridePrefixSearch(Object value) { + _prefixSearch = value; + return this; + } + + /** Location of prefixSearch. */ + protected String _prefixSearchLocation; + + /** + * Get the location of prefixSearch. + * + * @return The location of prefixSearch. (Nullable) + */ + public String getPrefixSearchLocation() { + return _prefixSearchLocation; + } + + /** + * Set the location of prefixSearch. + * + * @param location The location of prefixSearch. (Nullable) + * @return this. (NotNull) + */ + public ConditionValue setPrefixSearchLocation(String location) { + _prefixSearchLocation = location; + return this; + } + + // =================================================================================== + // Like Search + // =========== + /** Value of likeSearch. */ + protected java.util.List _likeSearch; + + /** Value of likeSearch for spare. */ + protected java.util.List _likeSearch4Spare; + + /** + * Get the value of likeSearch. + * + * @return The value of likeSearch. (Nullable) + */ + public String getLikeSearch() { + if (_likeSearch == null) { + return null; + } + if (_likeSearch.isEmpty() && !_likeSearch4Spare.isEmpty()) { + for (int index = 0; index < _likeSearch4Spare.size(); index++) { + _likeSearch.add(_likeSearch4Spare.get(index)); + } + } + final LikeSearchValue likeSearchValue = (LikeSearchValue) _likeSearch + .remove(0); + return (String) filterValue(likeSearchValue.generateRealValue()); + } + + /** + * Set the value of likeSearch. + * + * @param value The value of likeSearch. (Nullable) + * @param option The option of likeSearch. (Nullable) + * @return this. (NotNull) + */ + public ConditionValue setLikeSearch(String value, LikeSearchOption option) { + if (_likeSearch == null) { + _likeSearch = new java.util.ArrayList(); + _likeSearch4Spare = new java.util.ArrayList(); + } + if (_likeSearch.isEmpty() && !_likeSearch4Spare.isEmpty()) { + for (int index = 0; index < _likeSearch4Spare.size(); index++) { + _likeSearch.add(_likeSearch4Spare.get(index)); + } + } + final LikeSearchValue likeSearchValue = new LikeSearchValue(value, + option); + _likeSearch.add(likeSearchValue); + _likeSearch4Spare.add(likeSearchValue); + return this; + } + + /** Location of likeSearch. */ + protected String _likeSearchLocation; + + /** + * Get the location of likeSearch. + * + * @return The location of likeSearch. (Nullable) + */ + public String getLikeSearchLocation() { + return _likeSearchLocation; + } + + /** + * Set the location of likeSearch. + * + * @param location The location of likeSearch. (Nullable) + * @return this. (NotNull) + */ + public ConditionValue setLikeSearchLocation(String location) { + _likeSearchLocation = location; + return this; + } + + protected static class LikeSearchValue { + protected String _value; + + protected LikeSearchOption _option; + + public LikeSearchValue(String value, LikeSearchOption option) { + _value = value; + _option = option; + } + + public String getValue() { + return _value; + } + + public LikeSearchOption getOption() { + return _option; + } + + public String generateRealValue() { + if (_option == null) { + return _value; + } + return _option.generateRealValue(_value); + } + } + + // =================================================================================== + // In Scope + // ======== + /** Value of inScope. */ + protected List _inScope; + + protected InScopeOption _inScopeOption; + + /** + * Get the value of inScope. + * + * @return The value of inScope. (Nullable) + */ + public List getInScope() { + if (_inScopeOption != null) { + return filterValue(_inScopeOption.generateRealValueList(_inScope)); + } + return filterValue(_inScope); + } + + /** + * Set the value of inScope. + * + * @param value The value of inScope. (Nullable) + * @return this. (NotNull) + */ + public ConditionValue setInScope(List value) { + _inScope = value; + return this; + } + + public ConditionValue setInScope(List value, InScopeOption option) { + _inScope = value; + _inScopeOption = option; + return this; + } + + /** + * Does it has the value of inScope? + * + * @return Determination. (NotNull) + */ + public boolean hasInScope() { + return _inScope != null; + } + + /** + * Does the value equal the value of inScope? + * + * @param value The value of inScope. (Nullable) + * @return Determination. (NotNull) + */ + public boolean equalInScope(List value) { + return hasInScope() ? _inScope.equals(value) : value == null; + } + + /** + * Override the value of inScope. + * + * @param value The value of inScope. (Nullable) + * @return this. (NotNull) + */ + public ConditionValue overrideInScope(List value) { + _inScope = value; + return this; + } + + /** Location of InScope. */ + protected String _inScopeLocation; + + /** + * Get the location of inScope. + * + * @return The location of inScope. (Nullable) + */ + public String getInScopeLocation() { + return _inScopeLocation; + } + + /** + * Set the location of inScope. + * + * @param location The location of inScope. (Nullable) + * @return this. (NotNull) + */ + public ConditionValue setInScopeLocation(String location) { + _inScopeLocation = location; + return this; + } + + // =================================================================================== + // Not In Scope + // ============ + /** Value of notInScope. */ + protected List _notInScope; + + /** + * Get the value of notInScope. + * + * @return The value of notInScope. (Nullable) + */ + public List getNotInScope() { + return filterValue(_notInScope); + } + + /** + * Set the value of notInScope. + * + * @param value The value of notInScope. (Nullable) + * @return this. (NotNull) + */ + public ConditionValue setNotInScope(List value) { + _notInScope = value; + return this; + } + + /** + * Does it has the value of inNotScope? + * + * @return Determination. (NotNull) + */ + public boolean hasNotInScope() { + return _notInScope != null; + } + + /** + * Does the value equal the value of inNotScope? + * + * @param value The value of inNotScope. (Nullable) + * @return Determination. (NotNull) + */ + public boolean equalNotInScope(List value) { + return hasNotInScope() ? _notInScope.equals(value) : value == null; + } + + /** + * Override the value of inNotScope. + * + * @param value The value of inNotScope. (Nullable) + * @return this. (NotNull) + */ + public ConditionValue overrideNotInScope(List value) { + _notInScope = value; + return this; + } + + /** Location of notInScope. */ + protected String _notInScopeLocation; + + /** + * Get the location of notInScope. + * + * @return The location of notInScope. (Nullable) + */ + public String getNotInScopeLocation() { + return _notInScopeLocation; + } + + /** + * Set the location of notInScope. + * + * @param location The location of notInScope. (Nullable) + * @return this. (NotNull) + */ + public ConditionValue setNotInScopeLocation(String location) { + _notInScopeLocation = location; + return this; + } + + // =================================================================================== + // Is Null + // ======= + /** Value of isNull. */ + protected Object _isNullValue; + + /** + * Get the value of isNull. + * + * @return The value of isNull. (Nullable) + */ + public Object getIsNull() { + return _isNullValue; + } + + /** + * Set the value of isNull. + * + * @param value The value of isNull. (Nullable) + * @return this. (NotNull) + */ + public ConditionValue setIsNull(Object value) { + _isNullValue = value; + return this; + } + + /** + * Does it has the value of isNull? + * + * @return Determination. (NotNull) + */ + public boolean hasIsNull() { + return _isNullValue != null; + } + + /** Location of isNull. */ + protected String _isNullLocation; + + /** + * Get the location of isNull. + * + * @return The location of isNull. (Nullable) + */ + public String getIsNullLocation() { + return _isNullLocation; + } + + /** + * Set the location of isNull. + * + * @param location The location of isNull. (Nullable) + * @return this. (NotNull) + */ + public ConditionValue setIsNullLocation(String location) { + _isNullLocation = location; + return this; + } + + // =================================================================================== + // Is Not Null + // =========== + /** Value of isNotNull. */ + protected Object _isNotNullValue; + + /** + * Get the value of isNotNull. + * + * @return The value of isNotNull. (Nullable) + */ + public Object getIsNotNull() { + return _isNotNullValue; + } + + /** + * Set the value of isNotNull. + * + * @param value The value of isNotNull. (Nullable) + * @return this. (NotNull) + */ + public ConditionValue setIsNotNull(Object value) { + _isNotNullValue = value; + return this; + } + + /** + * Does it has the value of isNotNull? + * + * @return Determination. (NotNull) + */ + public boolean hasIsNotNull() { + return _isNotNullValue != null; + } + + /** Location of isNotNull. */ + protected String _isNotNullLocation; + + /** + * Get the location of isNotNull. + * + * @return The location of isNotNull. (Nullable) + */ + public String getIsNotNullLocation() { + return _isNotNullLocation; + } + + /** + * Set the location of isNotNull. + * + * @param location The location of isNotNull. (Nullable) + * @return this. (NotNull) + */ + public ConditionValue setIsNotNullLocation(String location) { + _isNotNullLocation = location; + return this; + } + + // ===================================================================================== + // Filter + // ====== + /** + * Filter value. + * If the value is instance of java.util.Date or java.util.Calendar, returns value as java.sql.Date. + * + * @param value Value. (Nullable) + * @return Filtered value. (Nullable) + */ + protected Object filterValue(Object value) { + if (value == null) { + return value; + } + if (value instanceof java.sql.Timestamp) { + return value; + } + if (value instanceof java.util.Date + || value instanceof java.util.Calendar) { + return SqlDateConversionUtil.toDate(value); + } else { + return value; + } + } + + /** + * Filter value. + * If the value is instance of java.util.Date or java.util.Calendar, returns value as java.sql.Date. + * + * @param valueList Value-list. (Nullable) + * @return Filtered value-list. (Nullable) + */ + protected java.util.List filterValue(java.util.List valueList) { + if (valueList == null || valueList.isEmpty()) { + return valueList; + } + final List resultList = new java.util.ArrayList(); + for (final java.util.Iterator ite = valueList.iterator(); ite.hasNext();) { + Object value = ite.next(); + resultList.add(filterValue(value)); + } + return resultList; + } + + protected static class SqlDateConversionUtil { + + private SqlDateConversionUtil() { + } + + public static java.sql.Date toDate(Object o) { + return toDate(o, null); + } + + public static java.sql.Date toDate(Object o, String pattern) { + if (o instanceof java.sql.Date) { + return (java.sql.Date) o; + } + java.util.Date date = DateConversionUtil.toDate(o, pattern); + if (date != null) { + return new java.sql.Date(date.getTime()); + } + return null; + } + } + + protected static class DateConversionUtil { + + private DateConversionUtil() { + } + + public static java.util.Date toDate(Object o) { + return toDate(o, null); + } + + public static java.util.Date toDate(Object o, String pattern) { + if (o == null) { + return null; + } else if (o instanceof String) { + return toDate((String) o, pattern); + } else if (o instanceof java.util.Date) { + return (java.util.Date) o; + } else if (o instanceof java.util.Calendar) { + return ((java.util.Calendar) o).getTime(); + } else { + return toDate(o.toString(), pattern); + } + } + + public static java.util.Date toDate(String s, String pattern) { + return toDate(s, pattern, java.util.Locale.getDefault()); + } + + public static java.util.Date toDate(String s, String pattern, + java.util.Locale locale) { + java.text.SimpleDateFormat sdf = getDateFormat(s, pattern, locale); + try { + return sdf.parse(s); + } catch (java.text.ParseException ex) { + throw new RuntimeException(ex); + } + } + + public static java.text.SimpleDateFormat getDateFormat(String s, + String pattern, java.util.Locale locale) { + if (pattern != null) { + return new java.text.SimpleDateFormat(pattern); + } + return getDateFormat(s, locale); + } + + public static java.text.SimpleDateFormat getDateFormat(String s, + java.util.Locale locale) { + String pattern = getPattern(locale); + String shortPattern = removeDelimiter(pattern); + String delimitor = findDelimiter(s); + if (delimitor == null) { + if (s.length() == shortPattern.length()) { + return new java.text.SimpleDateFormat(shortPattern); + } + if (s.length() == shortPattern.length() + 2) { + return new java.text.SimpleDateFormat(InternalStringUtil + .replace(shortPattern, "yy", "yyyy")); + } + } else { + String[] array = InternalStringUtil.split(s, delimitor); + for (int i = 0; i < array.length; ++i) { + if (array[i].length() == 4) { + pattern = InternalStringUtil.replace(pattern, "yy", + "yyyy"); + break; + } + } + return new java.text.SimpleDateFormat(pattern); + } + return new java.text.SimpleDateFormat(); + } + + public static java.text.SimpleDateFormat getDateFormat( + java.util.Locale locale) { + return new java.text.SimpleDateFormat(getPattern(locale)); + } + + public static java.text.SimpleDateFormat getY4DateFormat( + java.util.Locale locale) { + return new java.text.SimpleDateFormat(getY4Pattern(locale)); + } + + public static String getY4Pattern(java.util.Locale locale) { + String pattern = getPattern(locale); + if (pattern.indexOf("yyyy") < 0) { + pattern = InternalStringUtil.replace(pattern, "yy", "yyyy"); + } + return pattern; + } + + public static String getPattern(java.util.Locale locale) { + java.text.SimpleDateFormat df = (java.text.SimpleDateFormat) java.text.DateFormat + .getDateInstance(java.text.DateFormat.SHORT, locale); + String pattern = df.toPattern(); + int index = pattern.indexOf(' '); + if (index > 0) { + pattern = pattern.substring(0, index); + } + if (pattern.indexOf("MM") < 0) { + pattern = InternalStringUtil.replace(pattern, "M", "MM"); + } + if (pattern.indexOf("dd") < 0) { + pattern = InternalStringUtil.replace(pattern, "d", "dd"); + } + return pattern; + } + + public static String findDelimiter(String value) { + for (int i = 0; i < value.length(); ++i) { + char c = value.charAt(i); + if (Character.isDigit(c)) { + continue; + } + return Character.toString(c); + } + return null; + } + + public static String removeDelimiter(String pattern) { + StringBuffer buf = new StringBuffer(); + for (int i = 0; i < pattern.length(); ++i) { + char c = pattern.charAt(i); + if (c == 'y' || c == 'M' || c == 'd') { + buf.append(c); + } + } + return buf.toString(); + } + } + + protected static class InternalStringUtil { + + public static final String[] EMPTY_STRINGS = new String[0]; + + private InternalStringUtil() { + } + + public static final boolean isEmpty(String text) { + return text == null || text.length() == 0; + } + + public static final String replace(String text, String fromText, + String toText) { + + if (text == null || fromText == null || toText == null) { + return null; + } + StringBuffer buf = new StringBuffer(100); + int pos = 0; + int pos2 = 0; + while (true) { + pos = text.indexOf(fromText, pos2); + if (pos == 0) { + buf.append(toText); + pos2 = fromText.length(); + } else if (pos > 0) { + buf.append(text.substring(pos2, pos)); + buf.append(toText); + pos2 = pos + fromText.length(); + } else { + buf.append(text.substring(pos2)); + break; + } + } + return buf.toString(); + } + + public static String[] split(String str, String delim) { + if (str == null) { + return EMPTY_STRINGS; + } + java.util.List list = new java.util.ArrayList(); + java.util.StringTokenizer st = new java.util.StringTokenizer(str, + delim); + while (st.hasMoreElements()) { + list.add(st.nextToken()); + } + return (String[]) list.toArray(new String[list.size()]); + } + } +} Property changes on: announcement/trunk/src/main/java/jp/sf/pal/announcement/db/allcommon/cbean/cvalue/ConditionValue.java ___________________________________________________________________ Name: svn:eol-style + native Added: announcement/trunk/src/main/java/jp/sf/pal/announcement/db/allcommon/cbean/grouping/GroupingOption.java =================================================================== --- announcement/trunk/src/main/java/jp/sf/pal/announcement/db/allcommon/cbean/grouping/GroupingOption.java (rev 0) +++ announcement/trunk/src/main/java/jp/sf/pal/announcement/db/allcommon/cbean/grouping/GroupingOption.java 2008-06-30 02:54:27 UTC (rev 1002) @@ -0,0 +1,44 @@ +package jp.sf.pal.announcement.db.allcommon.cbean.grouping; + +/** + * The class of option for grouping making. + * + * @param The type of entity. + * @author DBFlute(AutoGenerator) + */ +public class GroupingOption { + + // ===================================================================================== + // Attribute + // ========= + protected int _columnCount; + + protected GroupingRowEndDeterminer _groupingRowEndDeterminer; + + // ===================================================================================== + // Constructor + // =========== + public GroupingOption(int columnCount) { + _columnCount = columnCount; + } + + // ===================================================================================== + // Easy-to-Use + // =========== + + // ===================================================================================== + // Accessor + // ======== + public int getColumnCount() { + return this._columnCount; + } + + public GroupingRowEndDeterminer getGroupingRowEndDeterminer() { + return this._groupingRowEndDeterminer; + } + + public void setGroupingRowEndDeterminer( + GroupingRowEndDeterminer groupingRowEndDeterminer) { + this._groupingRowEndDeterminer = groupingRowEndDeterminer; + } +} Property changes on: announcement/trunk/src/main/java/jp/sf/pal/announcement/db/allcommon/cbean/grouping/GroupingOption.java ___________________________________________________________________ Name: svn:eol-style + native Added: announcement/trunk/src/main/java/jp/sf/pal/announcement/db/allcommon/cbean/grouping/GroupingRowEndDeterminer.java =================================================================== --- announcement/trunk/src/main/java/jp/sf/pal/announcement/db/allcommon/cbean/grouping/GroupingRowEndDeterminer.java (rev 0) +++ announcement/trunk/src/main/java/jp/sf/pal/announcement/db/allcommon/cbean/grouping/GroupingRowEndDeterminer.java 2008-06-30 02:54:27 UTC (rev 1002) @@ -0,0 +1,13 @@ +package jp.sf.pal.announcement.db.allcommon.cbean.grouping; + +/** + * The interface of grouping switch point determiner. + * + * @param The type of entity. + * @author DBFlute(AutoGenerator) + */ +public interface GroupingRowEndDeterminer { + + public boolean determine(int columnIndex, int columnCount, + GroupingRowResource rowResource, ENTITY nextEntity); +} Property changes on: announcement/trunk/src/main/java/jp/sf/pal/announcement/db/allcommon/cbean/grouping/GroupingRowEndDeterminer.java ___________________________________________________________________ Name: svn:eol-style + native Added: announcement/trunk/src/main/java/jp/sf/pal/announcement/db/allcommon/cbean/grouping/GroupingRowResource.java =================================================================== --- announcement/trunk/src/main/java/jp/sf/pal/announcement/db/allcommon/cbean/grouping/GroupingRowResource.java (rev 0) +++ announcement/trunk/src/main/java/jp/sf/pal/announcement/db/allcommon/cbean/grouping/GroupingRowResource.java 2008-06-30 02:54:27 UTC (rev 1002) @@ -0,0 +1,30 @@ +package jp.sf.pal.announcement.db.allcommon.cbean.grouping; + +/** + * The class of row resource for grouping making. + * + * @param The type of entity. + * @author DBFlute(AutoGenerator) + */ +public class GroupingRowResource { + + // ===================================================================================== + // Attribute + // ========= + protected java.util.List _groupingRowList = new java.util.ArrayList(); + + // ===================================================================================== + // Easy-to-Use + // =========== + + // ===================================================================================== + // Accessor + // ======== + public java.util.List getGroupingRowList() { + return this._groupingRowList; + } + + public void addGroupingRowList(ENTITY groupingRow) { + this._groupingRowList.add(groupingRow); + } +} Property changes on: announcement/trunk/src/main/java/jp/sf/pal/announcement/db/allcommon/cbean/grouping/GroupingRowResource.java ___________________________________________________________________ Name: svn:eol-style + native Added: announcement/trunk/src/main/java/jp/sf/pal/announcement/db/allcommon/cbean/grouping/GroupingRowSetupper.java =================================================================== --- announcement/trunk/src/main/java/jp/sf/pal/announcement/db/allcommon/cbean/grouping/GroupingRowSetupper.java (rev 0) +++ announcement/trunk/src/main/java/jp/sf/pal/announcement/db/allcommon/cbean/grouping/GroupingRowSetupper.java 2008-06-30 02:54:27 UTC (rev 1002) @@ -0,0 +1,19 @@ +package jp.sf.pal.announcement.db.allcommon.cbean.grouping; + +/** + * The interface of grouping row setupper. + * + * @param The type of row. + * @param The type of entity. + * @author DBFlute(AutoGenerator) + */ +public interface GroupingRowSetupper { + + /** + * Set up grouping row object. + * + * @param groupingRowResource Grouping row resource. (NotNull) + * @return Grouping row object. (NotNull) + */ + public ROW setup(GroupingRowResource groupingRowResource); +} Property changes on: announcement/trunk/src/main/java/jp/sf/pal/announcement/db/allcommon/cbean/grouping/GroupingRowSetupper.java ___________________________________________________________________ Name: svn:eol-style + native Added: announcement/trunk/src/main/java/jp/sf/pal/announcement/db/allcommon/cbean/mapping/EntityDtoMapper.java =================================================================== --- announcement/trunk/src/main/java/jp/sf/pal/announcement/db/allcommon/cbean/mapping/EntityDtoMapper.java (rev 0) +++ announcement/trunk/src/main/java/jp/sf/pal/announcement/db/allcommon/cbean/mapping/EntityDtoMapper.java 2008-06-30 02:54:27 UTC (rev 1002) @@ -0,0 +1,17 @@ +package jp.sf.pal.announcement.db.allcommon.cbean.mapping; + +/** + * The mapper of entity-to-dto. + * @param The type of entity. + * @param The type of dto. + * @author DBFlute(AutoGenerator) + */ +public interface EntityDtoMapper { + + /** + * Map entity to data transfer object. + * @param entity Entity. (NotNull) + * @return Data transfer object. (NotNull) + */ + public DTO map(ENTITY entity); +} Property changes on: announcement/trunk/src/main/java/jp/sf/pal/announcement/db/allcommon/cbean/mapping/EntityDtoMapper.java ___________________________________________________________________ Name: svn:eol-style + native Added: announcement/trunk/src/main/java/jp/sf/pal/announcement/db/allcommon/cbean/outsidesql/OutsideSqlContext.java =================================================================== --- announcement/trunk/src/main/java/jp/sf/pal/announcement/db/allcommon/cbean/outsidesql/OutsideSqlContext.java (rev 0) +++ announcement/trunk/src/main/java/jp/sf/pal/announcement/db/allcommon/cbean/outsidesql/OutsideSqlContext.java 2008-06-30 02:54:27 UTC (rev 1002) @@ -0,0 +1,328 @@ +package jp.sf.pal.announcement.db.allcommon.cbean.outsidesql; + +import jp.sf.pal.announcement.db.allcommon.jdbc.StatementConfig; +import jp.sf.pal.announcement.db.allcommon.util.SimpleStringUtil; +import jp.sf.pal.announcement.db.allcommon.util.SimpleSystemUtil; + +import org.apache.commons.logging.Log; +import org.apache.commons.logging.LogFactory; +import org.seasar.framework.util.InputStreamReaderUtil; +import org.seasar.framework.util.ReaderUtil; +import org.seasar.framework.util.ResourceUtil; + +/** + * The context of outside-sql. + * @author DBFlute(AutoGenerator) + */ +public class OutsideSqlContext { + + /** Log-instance. */ + private static final Log _log = LogFactory.getLog(OutsideSqlContext.class); + + // =================================================================================== + // Thread Local + // ============ + /** The thread-local for this. */ + private static final ThreadLocal _threadLocal = new ThreadLocal(); + + /** + * Get outside-sql context on thread. + * + * @return Outside-sql context. (Nullable) + */ + public static OutsideSqlContext getOutsideSqlContextOnThread() { + return (OutsideSqlContext) _threadLocal.get(); + } + + /** + * Set outside-sql context on thread. + * + * @param outsideSqlContext Outside-sql context. (NotNull) + */ + public static void setOutsideSqlContextOnThread( + OutsideSqlContext outsideSqlContext) { + if (outsideSqlContext == null) { + String msg = "The argument[outsideSqlContext] must not be null."; + throw new IllegalArgumentException(msg); + } + _threadLocal.set(outsideSqlContext); + } + + /** + * Is existing outside-sql context on thread? + * + * @return Determination. + */ + public static boolean isExistOutsideSqlContextOnThread() { + return (_threadLocal.get() != null); + } + + /** + * Clear outside-sql context on thread. + */ + public static void clearOutsideSqlContextOnThread() { + _threadLocal.set(null); + } + + // =================================================================================== + // Unique Key + // ========== + public static String generateSpecifiedOutsideSqlUniqueKey( + String methodName, String path, Object pmb, + OutsideSqlOption option, Object resultTypeSpecification) { + final String pmbKey = (pmb != null ? pmb.getClass().getName() : "null"); + final String resultKey = (resultTypeSpecification != null ? ":" + + resultTypeSpecification : "null"); + return methodName + "():" + path + ":" + pmbKey + ":" + + option.generateUniqueKey() + resultKey; + } + + // =================================================================================== + // Exception Handling + // ================== + public static void throwOutsideSqlNotFoundException(String path) { + String msg = "Look! Read the message below." + getLineSeparator(); + msg = msg + + "/* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * *" + + getLineSeparator(); + msg = msg + "The outsideSql was Not Found!" + getLineSeparator(); + msg = msg + getLineSeparator(); + msg = msg + "[Advice]" + getLineSeparator(); + msg = msg + + "Please confirm the existence of your target file of outsideSql on your classpath." + + getLineSeparator(); + msg = msg + + "And please confirm the file name and the file path STRICTLY!" + + getLineSeparator(); + msg = msg + getLineSeparator(); + msg = msg + "[Specified OutsideSql Path]" + getLineSeparator() + path + + getLineSeparator(); + msg = msg + "* * * * * * * * * */" + getLineSeparator(); + throw new jp.sf.pal.announcement.db.allcommon.exception.OutsideSqlNotFoundException( + msg); + } + + // =================================================================================== + // Attribute + // ========= + // ----------------------------------------------------- + // Common of OutsideSql + // -------------------- + protected boolean _dynamicBinding; + + protected boolean _offsetByCursorForcedly; + + protected boolean _limitByCursorForcedly; + + // ----------------------------------------------------- + // Specified OutsideSql + // -------------------- + /** The path of outside-sql. (The mark of Specified-OutsideSql) */ + protected String _outsideSqlPath; + + protected Object _parameterBean; + + protected Object _resultTypeSpecification; + + protected String _methodName; + + /** The config of statement. (Nullable) */ + protected StatementConfig _statementConfig; + + // =================================================================================== + // Read SQL + // ======== + public String readFilteredOutsideSql(String sqlFileEncoding, + String dbmsSuffix) { + final String sql = readOutsideSql(sqlFileEncoding, dbmsSuffix); + return replaceOutsideSqlBindCharacterOnLineComment(sql); + } + + protected String replaceOutsideSqlBindCharacterOnLineComment(String sql) { + final String bindCharacter = "?"; + if (sql.indexOf(bindCharacter) < 0) { + return sql; + } + final String lineSeparator = "\n"; + if (sql.indexOf(lineSeparator) < 0) { + return sql; + } + final String lineCommentMark = "--"; + if (sql.indexOf(lineCommentMark) < 0) { + return sql; + } + final StringBuilder sb = new StringBuilder(); + final String[] lines = sql.split(lineSeparator); + for (String line : lines) { + final int lineCommentIndex = line.indexOf("--"); + if (lineCommentIndex < 0) { + sb.append(line).append(lineSeparator); + continue; + } + final String lineComment = line.substring(lineCommentIndex); + if (lineComment.contains("ELSE") + || !lineComment.contains(bindCharacter)) { + sb.append(line).append(lineSeparator); + continue; + } + + if (_log.isDebugEnabled()) { + _log.debug("...Replacing bind character on line comment: " + + lineComment); + } + final String filteredLineComment = replaceString(lineComment, + bindCharacter, "Q"); + sb.append(line.substring(0, lineCommentIndex)).append( + filteredLineComment).append(lineSeparator); + } + return sb.toString(); + } + + /** + * Read outside-sql path. Required attribute is 'outsideSqlPath'. + * @param sqlFileEncoding The encoding of SQL file. (NotNull) + * @param dbmsSuffix The suffix of DBMS. (NotNull) + * @return The text of SQL. (NotNull) + * @exception jp.sf.pal.announcement.db.allcommon.exception.OutsideSqlNotFoundException When the SQL is not found. + */ + public String readOutsideSql(String sqlFileEncoding, String dbmsSuffix) { + final String standardPath = _outsideSqlPath; + final String dbmsPath = buildDbmsPath(standardPath, dbmsSuffix); + String sql; + if (isExistResource(dbmsPath)) { + sql = readText(dbmsPath, sqlFileEncoding); + } else if (isExistResource(standardPath)) { + sql = readText(standardPath, sqlFileEncoding); + } else { + throwOutsideSqlNotFoundException(standardPath); + return null; // Non Reachable. + } + return removeInitialUnicodeBomIfNeeds(sqlFileEncoding, sql); + } + + protected String buildDbmsPath(String standardPath, String dbmsSuffix) { + final String dbmsPath; + final int lastIndexOfDot = standardPath.lastIndexOf("."); + if (lastIndexOfDot >= 0 + && !standardPath.substring(lastIndexOfDot).contains("/")) { + final String base = standardPath.substring(0, lastIndexOfDot); + dbmsPath = base + dbmsSuffix + + standardPath.substring(lastIndexOfDot); + } else { + dbmsPath = standardPath + dbmsSuffix; + } + return dbmsPath; + } + + protected String removeInitialUnicodeBomIfNeeds(String sqlFileEncoding, + String sql) { + if ("UTF-8".equalsIgnoreCase(sqlFileEncoding) && sql.length() > 0 + && sql.charAt(0) == '\uFEFF') { + sql = sql.substring(1); + } + return sql; + } + + // =================================================================================== + // Determination + // ============= + public boolean isSpecifiedOutsideSql() { + return _outsideSqlPath != null; + } + + // =================================================================================== + // General Helper + // ============== + protected boolean isExistResource(String path) { + return ResourceUtil.isExist(path); + } + + protected String readText(final String path, String sqlFileEncoding) { + final java.io.InputStream is = ResourceUtil.getResourceAsStream(path); + final java.io.Reader reader = InputStreamReaderUtil.create(is, + sqlFileEncoding); + return ReaderUtil.readText(reader); + } + + protected static String replaceString(String text, String fromText, + String toText) { + return SimpleStringUtil.replace(text, fromText, toText); + } + + protected static String getLineSeparator() { + return SimpleSystemUtil.getLineSeparator(); + } + + // =================================================================================== + // Accessor + // ======== + // ----------------------------------------------------- + // Common of OutsideSql + // -------------------- + public boolean isDynamicBinding() { + return _dynamicBinding; + } + + public void setDynamicBinding(boolean dynamicBinding) { + this._dynamicBinding = dynamicBinding; + } + + public boolean isOffsetByCursorForcedly() { + return _offsetByCursorForcedly; + } + + public void setOffsetByCursorForcedly(boolean offsetByCursorForcedly) { + this._offsetByCursorForcedly = offsetByCursorForcedly; + } + + public boolean isLimitByCursorForcedly() { + return _limitByCursorForcedly; + } + + public void setLimitByCursorForcedly(boolean limitByCursorForcedly) { + this._limitByCursorForcedly = limitByCursorForcedly; + } + + // ----------------------------------------------------- + // Specified OutsideSql + // -------------------- + public String getOutsideSqlPath() { + return _outsideSqlPath; + } + + public void setOutsideSqlPath(String outsideSqlPath) { + this._outsideSqlPath = outsideSqlPath; + } + + public Object getParameterBean() { + return _parameterBean; + } + + public void setParameterBean(Object parameterBean) { + this._parameterBean = parameterBean; + } + + public Object getResultTypeSpecification() { + return _resultTypeSpecification; + } + + public void setResultTypeSpecification(Object resultTypeSpecification) { + this._resultTypeSpecification = resultTypeSpecification; + } + + public String getMethodName() { + return _methodName; + } + + public void setMethodName(String methodName) { + this._methodName = methodName; + } + + public StatementConfig getStatementConfig() { + return _statementConfig; + } + + public void setStatementConfig(StatementConfig statementConfig) { + this._statementConfig = statementConfig; + } +} Property changes on: announcement/trunk/src/main/java/jp/sf/pal/announcement/db/allcommon/cbean/outsidesql/OutsideSqlContext.java ___________________________________________________________________ Name: svn:eol-style + native Added: announcement/trunk/src/main/java/jp/sf/pal/announcement/db/allcommon/cbean/outsidesql/OutsideSqlDao.java =================================================================== --- announcement/trunk/src/main/java/jp/sf/pal/announcement/db/allcommon/cbean/outsidesql/OutsideSqlDao.java (rev 0) +++ announcement/trunk/src/main/java/jp/sf/pal/announcement/db/allcommon/cbean/outsidesql/OutsideSqlDao.java 2008-06-30 02:54:27 UTC (rev 1002) @@ -0,0 +1,29 @@ +package jp.sf.pal.announcement.db.allcommon.cbean.outsidesql; + +import java.util.List; + +import jp.sf.pal.announcement.db.allcommon.DaoReadable; +import jp.sf.pal.announcement.db.allcommon.jdbc.CursorHandler; + +/** + * The dao of outside-sql. + * @author DBFlute(AutoGenerator) + */ +public interface OutsideSqlDao extends DaoReadable { + + // =================================================================================== + // Select + // ====== + List selectList(String path, Object pmb, + OutsideSqlOption option, Class entityType); + + Object selectCursor(String path, Object pmb, + OutsideSqlOption option, CursorHandler handler); + + // =================================================================================== + // Execute + // ======= + int execute(String path, Object pmb, OutsideSqlOption option); + + // int[] batchExecute(String path, List pmb, OutsideSqlOption option); +} Property changes on: announcement/trunk/src/main/java/jp/sf/pal/announcement/db/allcommon/cbean/outsidesql/OutsideSqlDao.java ___________________________________________________________________ Name: svn:eol-style + native Added: announcement/trunk/src/main/java/jp/sf/pal/announcement/db/allcommon/cbean/outsidesql/OutsideSqlOption.java =================================================================== --- announcement/trunk/src/main/java/jp/sf/pal/announcement/db/allcommon/cbean/outsidesql/OutsideSqlOption.java (rev 0) +++ announcement/trunk/src/main/java/jp/sf/pal/announcement/db/allcommon/cbean/outsidesql/OutsideSqlOption.java 2008-06-30 02:54:27 UTC (rev 1002) @@ -0,0 +1,86 @@ +package jp.sf.pal.announcement.db.allcommon.cbean.outsidesql; + +import jp.sf.pal.announcement.db.allcommon.jdbc.StatementConfig; + +/** + * The option of outside-sql. + * + * @author DBFlute(AutoGenerator) + */ +public class OutsideSqlOption { + + // =================================================================================== + // Attribute + // ========= + protected String _pagingRequestType = "non"; + + protected boolean _dynamicBinding; + + /** The config of statement. (Nullable) */ + protected StatementConfig _statementConfig; + + // =================================================================================== + // Easy-to-Use + // =========== + public void autoPaging() { + _pagingRequestType = "auto"; + } + + public void manualPaging() { + _pagingRequestType = "manual"; + } + + public void dynamicBinding() { + _dynamicBinding = true; + } + + // =================================================================================== + // Unique Key + // ========== + public String generateUniqueKey() { + return "{" + _pagingRequestType + "/" + _dynamicBinding + "}"; + } + + // =================================================================================== + // Copy + // ==== + public OutsideSqlOption copyOptionWithoutPaging() { + final OutsideSqlOption copyOption = new OutsideSqlOption(); + if (isDynamicBinding()) { + copyOption.dynamicBinding(); + } + return copyOption; + } + + // =================================================================================== + // Basic Override + // ============== + @Override + public String toString() { + return "{paging=" + _pagingRequestType + ", dynamic=" + _dynamicBinding + + "}"; + } + + // =================================================================================== + // Accessor + // ======== + public boolean isAutoPaging() { + return "auto".equals(_pagingRequestType); + } + + public boolean isManualPaging() { + return "manual".equals(_pagingRequestType); + } + + public boolean isDynamicBinding() { + return _dynamicBinding; + } + + public StatementConfig getStatementConfig() { + return _statementConfig; + } + + public void setStatementConfig(StatementConfig statementConfig) { + this._statementConfig = statementConfig; + } +} Property changes on: announcement/trunk/src/main/java/jp/sf/pal/announcement/db/allcommon/cbean/outsidesql/OutsideSqlOption.java ___________________________________________________________________ Name: svn:eol-style + native Added: announcement/trunk/src/main/java/jp/sf/pal/announcement/db/allcommon/cbean/outsidesql/executor/OutsideSqlBasicExecutor.java =================================================================== --- announcement/trunk/src/main/java/jp/sf/pal/announcement/db/allcommon/cbean/outsidesql/executor/OutsideSqlBasicExecutor.java (rev 0) +++ announcement/trunk/src/main/java/jp/sf/pal/announcement/db/allcommon/cbean/outsidesql/executor/OutsideSqlBasicExecutor.java 2008-06-30 02:54:27 UTC (rev 1002) @@ -0,0 +1,201 @@ +package jp.sf.pal.announcement.db.allcommon.cbean.outsidesql.executor; + +import java.util.List; + +import jp.sf.pal.announcement.db.allcommon.cbean.outsidesql.OutsideSqlDao; +import jp.sf.pal.announcement.db.allcommon.cbean.outsidesql.OutsideSqlOption; +import jp.sf.pal.announcement.db.allcommon.jdbc.StatementConfig; + +/** + * The executor of outside-sql.
    + *
    + * {Basic}
    + *   o selectList()
    + * 
    + * {Entity}
    + *   o entityHandling().selectEntity()
    + *   o entityHandling().selectEntityWithDeletedCheck()
    + * 
    + * {Cursor}
    + *   o cursorHandling().selectCursor()
    + * 
    + * {Paging}
    + *   o autoPaging().selectList()
    + *   o autoPaging().selectPage()
    + *   o manualPaging().selectList()
    + *   o manualPaging().selectPage()
    + * 
    + * {Option -- Dynamic}
    + *   o dynamicBinding().selectList()
    + * 
    + * 
    + * + * @author DBFlute(AutoGenerator) + */ +public class OutsideSqlBasicExecutor { + + // =================================================================================== + // Attribute + // ========= + /** The dao of outsideSql. (NotNull) */ + protected final OutsideSqlDao _outsideSqlDao; + + /** Table db name. (NotNull) */ + protected final String _tableDbName; + + /** Is it dynamic binding? */ + protected boolean _dynamicBinding; + + /** The config of statement. (Nullable) */ + protected StatementConfig _statementConfig; + + // =================================================================================== + // Constructor + // =========== + public OutsideSqlBasicExecutor(OutsideSqlDao outsideSqlDao, + String tableDbName) { + this._outsideSqlDao = outsideSqlDao; + this._tableDbName = tableDbName; + } + + // =================================================================================== + // Select + // ====== + /** + * Select list. + * + * @param The type of entity for element. + * @param path The path of SQL file. (NotNull) + * @param pmb The parameter-bean. Allowed types are Bean object and Map object. (Nullable) + * @param entityType The element type of entity. (NotNull) + * @return The list of selected entity. (NotNull) + * @exception jp.sf.pal.announcement.db.allcommon.exception.OutsideSqlNotFoundException When the sql is not found. + */ + public List selectList(String path, Object pmb, + Class entityType) { + return _outsideSqlDao.selectList(path, pmb, createOutsideSqlOption(), + entityType); + } + + // =================================================================================== + // Execute + // ======= + /** + * Execute. {Insert/Update/Delete/Etc...} + * + * @param path The path of SQL file. (NotNull) + * @param pmb The parameter-bean. Allowed types are Bean object and Map object. (Nullable) + * @return The count of execution. + * @exception jp.sf.pal.announcement.db.allcommon.exception.OutsideSqlNotFoundException When the sql is not found. + */ + public int execute(String path, Object pmb) { + return _outsideSqlDao.execute(path, pmb, createOutsideSqlOption()); + } + + // Implements at the future! + // public int batchExecute(String path, Object pmb) { + // throw new UnsupportedOperationException("Sorry! The method of batchExecute() has not been implemented yet."); + // // return _outsideSqlDao.batchExecute(path, pmb, createOutsideSqlOption()); + // } + + // =================================================================================== + // Option + // ====== + /** + * Specify cursor handling.
    + *
    +     * # ex) Your Program
    +     * #
    +     * # executor.cursorHandling().selectCursor(path, pmb, handler);
    +     * #
    +     * 
    + * @return The cursor executor of outside-sql. (NotNull) + */ + public OutsideSqlCursorExecutor cursorHandling() { + return new OutsideSqlCursorExecutor(_outsideSqlDao, + createOutsideSqlOption()); + } + + /** + * Specify entity handling.
    + *
    +     * # ex) Your Program
    +     * #
    +     * # executor.entityHandling().selectEntityWithDeletedCheck(path, pmb, Xxx.class);
    +     * #
    +     * 
    + * @return The cursor executor of outside-sql. (NotNull) + */ + public OutsideSqlEntityExecutor entityHandling() { + return new OutsideSqlEntityExecutor(_outsideSqlDao, + createOutsideSqlOption()); + } + + /** + * Option of autoPaging.
    + * If you invoke this, you don't need to write paging condition on your SQL.
    + *
    +     * # ex) Your SQL {MySQL}
    +     * #
    +     * # select member.MEMBER_ID, member...
    +     * #   from Member member
    +     * #  where ...
    +     * #  order by ...
    +     * # -- limit 40, 20        *Here is unnecessary!
    +     * #
    +     * 
    + * + * @return The executor of paging that the paging mode is auto. (NotNull) + */ + public OutsideSqlPagingExecutor autoPaging() { + final OutsideSqlOption option = createOutsideSqlOption(); + option.autoPaging(); + return new OutsideSqlPagingExecutor(_outsideSqlDao, option, + _tableDbName); + } + + /** + * Option of manualPaging.
    + * If you invoke this, you need to write paging condition on your SQL.
    + *
    +     * # ex) Your SQL {MySQL}
    +     * #
    +     * # select member.MEMBER_ID, member...
    +     * #   from Member member
    +     * #  where ...
    +     * #  order by ...
    +     * #  limit 40, 20        *Here is necessary!
    +     * #
    +     * 
    + * + * @return The executor of paging that the paging mode is manual. (NotNull) + */ + public OutsideSqlPagingExecutor manualPaging() { + final OutsideSqlOption option = createOutsideSqlOption(); + option.manualPaging(); + return new OutsideSqlPagingExecutor(_outsideSqlDao, option, + _tableDbName); + } + + public OutsideSqlBasicExecutor configure(StatementConfig statementConfig) { + _statementConfig = statementConfig; + return this; + } + + public OutsideSqlBasicExecutor dynamicBinding() { + _dynamicBinding = true; + return this; + } + + // ----------------------------------------------------- + // Helper + // ------ + protected OutsideSqlOption createOutsideSqlOption() { + final OutsideSqlOption option = new OutsideSqlOption(); + option.setStatementConfig(_statementConfig); + if (_dynamicBinding) { + option.dynamicBinding(); + } + return option; + } +} Property changes on: announcement/trunk/src/main/java/jp/sf/pal/announcement/db/allcommon/cbean/outsidesql/executor/OutsideSqlBasicExecutor.java ___________________________________________________________________ Name: svn:eol-style + native Added: announcement/trunk/src/main/java/jp/sf/pal/announcement/db/allcommon/cbean/outsidesql/executor/OutsideSqlCursorExecutor.java =================================================================== --- announcement/trunk/src/main/java/jp/sf/pal/announcement/db/allcommon/cbean/outsidesql/executor/OutsideSqlCursorExecutor.java (rev 0) +++ announcement/trunk/src/main/java/jp/sf/pal/announcement/db/allcommon/cbean/outsidesql/executor/OutsideSqlCursorExecutor.java 2008-06-30 02:54:27 UTC (rev 1002) @@ -0,0 +1,54 @@ +package jp.sf.pal.announcement.db.allcommon.cbean.outsidesql.executor; + +import jp.sf.pal.announcement.db.allcommon.cbean.outsidesql.OutsideSqlDao; +import jp.sf.pal.announcement.db.allcommon.cbean.outsidesql.OutsideSqlOption; +import jp.sf.pal.announcement.db.allcommon.jdbc.CursorHandler; +import jp.sf.pal.announcement.db.allcommon.jdbc.StatementConfig; + +/** + * The cursor executor of outside-sql. + * + * @param The type of parameter-bean. + * @author DBFlute(AutoGenerator) + */ +public class OutsideSqlCursorExecutor { + + // =================================================================================== + // Attribute + // ========= + protected final OutsideSqlDao _outsideSqlDao; + + protected final OutsideSqlOption _outsideSqlOption; + + // =================================================================================== + // Constructor + // =========== + public OutsideSqlCursorExecutor(OutsideSqlDao outsideSqlDao, + OutsideSqlOption outsideSqlOption) { + this._outsideSqlDao = outsideSqlDao; + this._outsideSqlOption = outsideSqlOption; + } + + // =================================================================================== + // Select + // ====== + public Object selectCursor(String path, PARAMETER_BEAN pmb, + CursorHandler handler) { + return _outsideSqlDao.selectCursor(path, pmb, _outsideSqlOption, + handler); + } + + // =================================================================================== + // Option + // ====== + public OutsideSqlCursorExecutor configure( + StatementConfig statementConfig) { + _outsideSqlOption.setStatementConfig(statementConfig); + return this; + } + + public OutsideSqlCursorExecutor dynamicBinding() { + _outsideSqlOption.dynamicBinding(); + return this; + } +} Property changes on: announcement/trunk/src/main/java/jp/sf/pal/announcement/db/allcommon/cbean/outsidesql/executor/OutsideSqlCursorExecutor.java ___________________________________________________________________ Name: svn:eol-style + native Added: announcement/trunk/src/main/java/jp/sf/pal/announcement/db/allcommon/cbean/outsidesql/executor/OutsideSqlEntityExecutor.java =================================================================== --- announcement/trunk/src/main/java/jp/sf/pal/announcement/db/allcommon/cbean/outsidesql/executor/OutsideSqlEntityExecutor.java (rev 0) +++ announcement/trunk/src/main/java/jp/sf/pal/announcement/db/allcommon/cbean/outsidesql/executor/OutsideSqlEntityExecutor.java 2008-06-30 02:54:27 UTC (rev 1002) @@ -0,0 +1,118 @@ +package jp.sf.pal.announcement.db.allcommon.cbean.outsidesql.executor; + +import java.util.List; + +import jp.sf.pal.announcement.db.allcommon.cbean.ConditionBeanContext; +import jp.sf.pal.announcement.db.allcommon.cbean.outsidesql.OutsideSqlDao; +import jp.sf.pal.announcement.db.allcommon.cbean.outsidesql.OutsideSqlOption; +import jp.sf.pal.announcement.db.allcommon.jdbc.StatementConfig; + +/** + * The cursor executor of outside-sql. + * + * @param The type of parameter-bean. + * @author DBFlute(AutoGenerator) + */ +public class OutsideSqlEntityExecutor { + + // =================================================================================== + // Attribute + // ========= + protected final OutsideSqlDao _outsideSqlDao; + + protected final OutsideSqlOption _outsideSqlOption; + + // =================================================================================== + // Constructor + // =========== + public OutsideSqlEntityExecutor(OutsideSqlDao outsideSqlDao, + OutsideSqlOption outsideSqlOption) { + this._outsideSqlDao = outsideSqlDao; + this._outsideSqlOption = outsideSqlOption; + } + + // =================================================================================== + // Select + // ====== + /** + * Select entity. + * + * @param The type of entity. + * @param path The path of SQL file. (NotNull) + * @param pmb The parameter-bean. Allowed types are Bean object and Map object. (Nullable) + * @param entityType The type of entity. (NotNull) + * @return The selected entity. (Nullable) + * @exception jp.sf.pal.announcement.db.allcommon.exception.OutsideSqlNotFoundException When the sql is not found. + * @exception jp.sf.pal.announcement.db.allcommon.exception.EntityDuplicatedException + */ + public ENTITY selectEntity(String path, PARAMETER_BEAN pmb, + Class entityType) { + final List ls = _outsideSqlDao.selectList(path, pmb, + _outsideSqlOption, entityType); + if (ls.isEmpty()) { + return null; + } + if (ls.size() > 1) { + String searchKey4Log = "The path of outside-sql is " + path + + ". And the parameter bean is " + pmb; + throwEntityDuplicatedException(ls.size() + "", searchKey4Log, null); + } + return ls.get(0); + } + + /** + * Select entity with deleted check. + * + * @param The type of entity. + * @param path The path of SQL file. (NotNull) + * @param pmb The parameter-bean. Allowed types are Bean object and Map object. (Nullable) + * @param entityType The type of entity. (NotNull) + * @return The selected entity. (Nullable) + * @exception jp.sf.pal.announcement.db.allcommon.exception.OutsideSqlNotFoundException When the sql is not found. + * @exception jp.sf.pal.announcement.db.allcommon.exception.EntityAlreadyDeletedException When the entity has already been deleted(not found). + * @exception jp.sf.pal.announcement.db.allcommon.exception.EntityDuplicatedException When the entity is duplicated. + */ + public ENTITY selectEntityWithDeletedCheck(String path, + PARAMETER_BEAN pmb, Class entityType) { + final List ls = _outsideSqlDao.selectList(path, pmb, + _outsideSqlOption, entityType); + if (ls == null || ls.isEmpty()) { + String searchKey4Log = "The path of outside-sql is " + path + + ". And the parameter bean is " + pmb; + throwEntityAlreadyDeletedException(searchKey4Log); + } + if (ls.size() > 1) { + String searchKey4Log = "The path of outside-sql is " + path + + ". And the parameter bean is " + pmb; + throwEntityDuplicatedException(ls.size() + "", searchKey4Log, null); + } + return ls.get(0); + } + + // ----------------------------------------------------- + // Helper + // ------ + protected void throwEntityAlreadyDeletedException(Object searchKey4Log) { + ConditionBeanContext.throwEntityAlreadyDeletedException(searchKey4Log); + } + + protected void throwEntityDuplicatedException(String resultCountString, + Object searchKey4Log, Throwable cause) { + ConditionBeanContext.throwEntityDuplicatedException(resultCountString, + searchKey4Log, cause); + } + + // =================================================================================== + // Option + // ====== + public OutsideSqlEntityExecutor configure( + StatementConfig statementConfig) { + _outsideSqlOption.setStatementConfig(statementConfig); + return this; + } + + public OutsideSqlEntityExecutor dynamicBinding() { + _outsideSqlOption.dynamicBinding(); + return this; + } +} Property changes on: announcement/trunk/src/main/java/jp/sf/pal/announcement/db/allcommon/cbean/outsidesql/executor/OutsideSqlEntityExecutor.java ___________________________________________________________________ Name: svn:eol-style + native Added: announcement/trunk/src/main/java/jp/sf/pal/announcement/db/allcommon/cbean/outsidesql/executor/OutsideSqlPagingExecutor.java =================================================================== --- announcement/trunk/src/main/java/jp/sf/pal/announcement/db/allcommon/cbean/outsidesql/executor/OutsideSqlPagingExecutor.java (rev 0) +++ announcement/trunk/src/main/java/jp/sf/pal/announcement/db/allcommon/cbean/outsidesql/executor/OutsideSqlPagingExecutor.java 2008-06-30 02:54:27 UTC (rev 1002) @@ -0,0 +1,152 @@ +package jp.sf.pal.announcement.db.allcommon.cbean.outsidesql.executor; + +import java.util.List; + +import jp.sf.pal.announcement.db.allcommon.cbean.PagingBean; +import jp.sf.pal.announcement.db.allcommon.cbean.PagingHandler; +import jp.sf.pal.announcement.db.allcommon.cbean.PagingInvoker; +import jp.sf.pal.announcement.db.allcommon.cbean.PagingResultBean; +import jp.sf.pal.announcement.db.allcommon.cbean.outsidesql.OutsideSqlDao; +import jp.sf.pal.announcement.db.allcommon.cbean.outsidesql.OutsideSqlOption; +import jp.sf.pal.announcement.db.allcommon.jdbc.StatementConfig; + +/** + * The paging executor of outsideSql. + * + * @author DBFlute(AutoGenerator) + */ +public class OutsideSqlPagingExecutor { + + // =================================================================================== + // Attribute + // ========= + /** The DAO of outsideSql. (NotNull) */ + protected final OutsideSqlDao _outsideSqlDao; + + /** The option of outsideSql. (NotNull) */ + protected final OutsideSqlOption _outsideSqlOption; + + /** The DB name of table. (NotNull) */ + protected final String _tableDbName; + + // =================================================================================== + // Constructor + // =========== + public OutsideSqlPagingExecutor(OutsideSqlDao outsideSqlDao, + OutsideSqlOption outsideSqlOption, String tableDbName) { + this._outsideSqlDao = outsideSqlDao; + this._outsideSqlOption = outsideSqlOption; + this._tableDbName = tableDbName; + } + + // =================================================================================== + // Select + // ====== + public List selectList(String path, PagingBean pmb, + Class entityType) { + return _outsideSqlDao.selectList(path, pmb, _outsideSqlOption, + entityType); + } + + /** + * Select page. + *

    + * The SQL should have Count and Paging.
    + * You can realize by pagingBean's isPaging() method on your 'SQL Comment'. For example, 'IF Comment'.
    + * It returns false when it executes Count. And it returns true when it executes Paging.
    + *

    +     * - - - - - - - - - - - - - - - - - - - - - - -
    +     * ex) Your Correct SQL {MySQL and manualPaging}
    +     * - - - - - - - - - - - - - - - - - - - - - - -
    +     * # /[*]IF pmb.isPaging()[*]/
    +     * # select member.MEMBER_ID
    +     * #      , member.MEMBER_NAME
    +     * #      , memberStatus.MEMBER_STATUS_NAME
    +     * # -- ELSE select count(*)
    +     * # /[*]END[*]/
    +     * #   from MEMBER member
    +     * #     /[*]IF pmb.isPaging()[*]/
    +     * #     left outer join MEMBER_STATUS memberStatus
    +     * #       on member.MEMBER_STATUS_CODE = memberStatus.MEMBER_STATUS_CODE
    +     * #     /[*]END[*]/
    +     * #  /[*]BEGIN[*]/where
    +     * #    /[*]IF pmb.memberId != null[*]/member.MEMBER_ID = /[*]pmb.memberId[*]/'123'/[*]END[*]/
    +     * #    /[*]IF pmb.memberName != null[*]/and member.MEMBER_NAME like /[*]pmb.memberName[*]/'Billy' || '%'/[*]END[*]/
    +     * #  /[*]END[*]/
    +     * #  /[*]IF pmb.isPaging()[*]/
    +     * #  order by member.UPDATE_DATETIME desc
    +     * #  /[*]END[*]/
    +     * #  /[*]IF pmb.isPaging()[*]/
    +     * #  limit /[*]$pmb.pageStartIndex[*]/80, /[*]$pmb.fetchSize[*]/20
    +     * #  /[*]END[*]/
    +     * # 
    +     * o [*] is easy escape to Java Doc Comment.
    +     * o If it's autoPaging, the line of 'limit 80, 20' is unnecessary!
    +     * 
    +     * - - - - - - - - - - - - - - - - - - - - - - - - -
    +     * ex) Wrong SQL {part 1}
    +     *     -- Line comment before ELSE comment --
    +     * - - - - - - - - - - - - - - - - - - - - - - - - -
    +     * # /[*]IF pmb.isPaging()[*]/
    +     * # select member.MEMBER_ID
    +     * #      , member.MEMBER_NAME -- The name of member...    *NG
    +     * #      -- The status name of member...                  *NG
    +     * #      , memberStatus.MEMBER_STATUS_NAME
    +     * # -- ELSE select count(*)
    +     * # /[*]END[*]/
    +     * # ...
    +     * o It's S2Dao's restriction...Sorry
    +     * 
    + * + * @param The type of entity. + * @param path The path of SQL that executes count and paging. (NotNull) + * @param pagingPath The path of paging SQL. (NotNull) + * @param pmb The bean of paging parameter. (NotNull) + * @param entityType The type of result entity. (NotNull) + * @return The result bean of paging. (NotNull) + */ + public PagingResultBean selectPage(final String path, + final PagingBean pmb, final Class entityType) { + final OutsideSqlOption countOption = _outsideSqlOption + .copyOptionWithoutPaging(); + final OutsideSqlEntityExecutor countExecutor = new OutsideSqlEntityExecutor( + _outsideSqlDao, countOption); + final PagingHandler handler = new PagingHandler() { + public PagingBean getPagingBean() { + return pmb; + } + + public int count() { + pmb.xsetPaging(false); + return countExecutor.selectEntityWithDeletedCheck(path, pmb, + Integer.class); + } + + public java.util.List paging() { + pmb.xsetPaging(true); + return selectList(path, pmb, entityType); + } + }; + final PagingInvoker invoker = new PagingInvoker( + _tableDbName); + return invoker.invokePaging(handler); + } + + // =================================================================================== + // Option + // ====== + public OutsideSqlCursorExecutor cursorHandling() { + return new OutsideSqlCursorExecutor(_outsideSqlDao, + _outsideSqlOption); + } + + public OutsideSqlPagingExecutor configure(StatementConfig statementConfig) { + _outsideSqlOption.setStatementConfig(statementConfig); + return this; + } + + public OutsideSqlPagingExecutor dynamicBinding() { + _outsideSqlOption.dynamicBinding(); + return this; + } +} Property changes on: announcement/trunk/src/main/java/jp/sf/pal/announcement/db/allcommon/cbean/outsidesql/executor/OutsideSqlPagingExecutor.java ___________________________________________________________________ Name: svn:eol-style + native Added: announcement/trunk/src/main/java/jp/sf/pal/announcement/db/allcommon/cbean/pagenavi/PageNumberLink.java =================================================================== --- announcement/trunk/src/main/java/jp/sf/pal/announcement/db/allcommon/cbean/pagenavi/PageNumberLink.java (rev 0) +++ announcement/trunk/src/main/java/jp/sf/pal/announcement/db/allcommon/cbean/pagenavi/PageNumberLink.java 2008-06-30 02:54:27 UTC (rev 1002) @@ -0,0 +1,84 @@ +package jp.sf.pal.announcement.db.allcommon.cbean.pagenavi; + +/** + * The class of page number link. + * @author DBFlute(AutoGenerator) + */ +public class PageNumberLink implements java.io.Serializable { + + // =================================================================================== + // Definition + // ========== + /** Serial version UID. (Default) */ + private static final long serialVersionUID = 1L; + + // =================================================================================== + // Attribute + // ========= + protected int _pageNumberElement; + + protected boolean _current; + + protected String _pageNumberLinkHref; + + // =================================================================================== + // Constructor + // =========== + public PageNumberLink() { + } + + // =================================================================================== + // Initializer + // =========== + public PageNumberLink initialize(int pageNumberElement, boolean current, + String pageNumberLinkHref) { + setPageNumberElement(pageNumberElement); + setCurrent(current); + setPageNumberLinkHref(pageNumberLinkHref); + return this; + } + + // =================================================================================== + // Basic Override + // ============== + /** + * @return The view string of all attribute values. (NotNull) + */ + @Override + public String toString() { + final StringBuffer sb = new StringBuffer(); + + sb.append(" pageNumberElement=").append(_pageNumberElement); + sb.append(" pageNumberLinkHref=").append(_pageNumberLinkHref); + sb.append(" current=").append(_current); + + return sb.toString(); + } + + // =================================================================================== + // Accessor + // ======== + public int getPageNumberElement() { + return _pageNumberElement; + } + + public void setPageNumberElement(int pageNumberElement) { + this._pageNumberElement = pageNumberElement; + } + + public boolean isCurrent() { + return _current; + } + + public void setCurrent(boolean current) { + this._current = current; + } + + public String getPageNumberLinkHref() { + return _pageNumberLinkHref; + } + + public void setPageNumberLinkHref(String pageNumberLinkHref) { + this._pageNumberLinkHref = pageNumberLinkHref; + } +} Property changes on: announcement/trunk/src/main/java/jp/sf/pal/announcement/db/allcommon/cbean/pagenavi/PageNumberLink.java ___________________________________________________________________ Name: svn:eol-style + native Added: announcement/trunk/src/main/java/jp/sf/pal/announcement/db/allcommon/cbean/pagenavi/PageNumberLinkSetupper.java =================================================================== --- announcement/trunk/src/main/java/jp/sf/pal/announcement/db/allcommon/cbean/pagenavi/PageNumberLinkSetupper.java (rev 0) +++ announcement/trunk/src/main/java/jp/sf/pal/announcement/db/allcommon/cbean/pagenavi/PageNumberLinkSetupper.java 2008-06-30 02:54:27 UTC (rev 1002) @@ -0,0 +1,17 @@ +package jp.sf.pal.announcement.db.allcommon.cbean.pagenavi; + +/** + * The setupper of page number link. + * @param The type of link. + * @author DBFlute(AutoGenerator) + */ +public interface PageNumberLinkSetupper { + + /** + * Set up page number link. + * @param pageNumberElement Page number element. + * @param current Is current page? + * @return Page number link. (NotNull) + */ + public LINK setup(int pageNumberElement, boolean current); +} Property changes on: announcement/trunk/src/main/java/jp/sf/pal/announcement/db/allcommon/cbean/pagenavi/PageNumberLinkSetupper.java ___________________________________________________________________ Name: svn:eol-style + native Added: announcement/trunk/src/main/java/jp/sf/pal/announcement/db/allcommon/cbean/pagenavi/group/PageGroupBean.java =================================================================== --- announcement/trunk/src/main/java/jp/sf/pal/announcement/db/allcommon/cbean/pagenavi/group/PageGroupBean.java (rev 0) +++ announcement/trunk/src/main/java/jp/sf/pal/announcement/db/allcommon/cbean/pagenavi/group/PageGroupBean.java 2008-06-30 02:54:27 UTC (rev 1002) @@ -0,0 +1,203 @@ +package jp.sf.pal.announcement.db.allcommon.cbean.pagenavi.group; + +import java.util.ArrayList; +import java.util.Iterator; +import java.util.List; + +import jp.sf.pal.announcement.db.allcommon.cbean.pagenavi.PageNumberLink; +import jp.sf.pal.announcement.db.allcommon.cbean.pagenavi.PageNumberLinkSetupper; + +/** + * The bean of page group. + * @author DBFlute(AutoGenerator) + */ +public class PageGroupBean implements java.io.Serializable { + + // =================================================================================== + // Definition + // ========== + /** Serial version UID. (Default) */ + private static final long serialVersionUID = 1L; + + // =================================================================================== + // Attribute + // ========= + protected int _currentPageNumber; + + protected int _allPageCount; + + protected PageGroupOption _pageGroupOption; + + // =================================================================================== + // Main + // ==== + /** + * Build the list of page number link. + * @param The type of link. + * @param pageNumberLinkSetupper Page number link setupper. (NotNull and Required LINK) + * @return The list of Page number link. (NotNull) + */ + public List buildPageNumberLinkList( + PageNumberLinkSetupper pageNumberLinkSetupper) { + final List pageNumberList = createPageNumberList(); + final List pageNumberLinkList = new ArrayList(); + for (Integer pageNumber : pageNumberList) { + pageNumberLinkList.add(pageNumberLinkSetupper.setup(pageNumber, + pageNumber.equals(_currentPageNumber))); + } + return pageNumberLinkList; + } + + /** + * Calculate start page number. + * @return Start page number. + */ + public int calculateStartPageNumber() { + assertPageGroupValid(); + final int pageGroupSize = _pageGroupOption.getPageGroupSize(); + final int currentPageNumber = _currentPageNumber; + + int currentPageGroupNumber = (currentPageNumber / pageGroupSize); + if ((currentPageNumber % pageGroupSize) == 0) { + currentPageGroupNumber--; + } + final int currentPageGroupStartPageNumber = (pageGroupSize * currentPageGroupNumber) + 1; + if (!(currentPageNumber >= currentPageGroupStartPageNumber)) { + String msg = "currentPageNumber should be greater equal currentPageGroupStartPageNumber. But:"; + msg = msg + " currentPageNumber=" + currentPageNumber; + msg = msg + " currentPageGroupStartPageNumber=" + + currentPageGroupStartPageNumber; + throw new IllegalStateException(msg); + } + return currentPageGroupStartPageNumber; + } + + /** + * Create the list of page number. + * @return The list of page number. (NotNull) + */ + public List createPageNumberList() { + assertPageGroupValid(); + final int pageGroupSize = _pageGroupOption.getPageGroupSize(); + final int allPageCount = _allPageCount; + final int currentPageGroupStartPageNumber = calculateStartPageNumber(); + if (!(currentPageGroupStartPageNumber > 0)) { + String msg = "currentPageGroupStartPageNumber should be greater than 0. {> 0} But:"; + msg = msg + " currentPageGroupStartPageNumber=" + + currentPageGroupStartPageNumber; + throw new IllegalStateException(msg); + } + final int nextPageGroupStartPageNumber = currentPageGroupStartPageNumber + + pageGroupSize; + + final List resultList = new ArrayList(); + for (int i = currentPageGroupStartPageNumber; i < nextPageGroupStartPageNumber + && i <= allPageCount; i++) { + resultList.add(new Integer(i)); + } + return resultList; + } + + /** + * Create the array of page number. + * @return The array of page number. (NotNUll) + */ + public int[] createPageNumberArray() { + assertPageGroupValid(); + return convertListToIntArray(createPageNumberList()); + } + + /** + * Is existing previous page-group? + * Using values are currentPageNumber and pageGroupSize. + * + * @return Determination. + */ + public boolean isExistPrePageGroup() { + assertPageGroupValid(); + return (_currentPageNumber > _pageGroupOption.getPageGroupSize()); + } + + /** + * Is existing next page-group? + * Using values are currentPageNumber and pageGroupSize and allPageCount. + * + * @return Determination. + */ + public boolean isExistNextPageGroup() { + assertPageGroupValid(); + int currentPageGroupStartPageNumber = calculateStartPageNumber(); + if (!(currentPageGroupStartPageNumber > 0)) { + String msg = "currentPageGroupStartPageNumber should be greater than 0. {> 0} But:"; + msg = msg + " currentPageGroupStartPageNumber=" + + currentPageGroupStartPageNumber; + throw new IllegalStateException(msg); + } + int nextPageGroupStartPageNumber = currentPageGroupStartPageNumber + + _pageGroupOption.getPageGroupSize(); + return (nextPageGroupStartPageNumber <= _allPageCount); + } + + // =================================================================================== + // Assist Helper + // ============= + protected int[] convertListToIntArray(List ls) { + final int[] resultArray = new int[ls.size()]; + int arrayIndex = 0; + for (Iterator ite = ls.iterator(); ite.hasNext();) { + final Integer tmpPageNumber = (Integer) ite.next(); + resultArray[arrayIndex] = tmpPageNumber.intValue(); + arrayIndex++; + } + return resultArray; + } + + protected void assertPageGroupValid() { + if (_pageGroupOption == null) { + String msg = "The pageGroupOption should not be null. Please invoke setPageGroupOption()."; + throw new IllegalStateException(msg); + } + if (_pageGroupOption.getPageGroupSize() == 0) { + String msg = "The pageGroupSize should be greater than 1. But the value is zero."; + msg = msg + " pageGroupSize=" + _pageGroupOption.getPageGroupSize(); + throw new IllegalStateException(msg); + } + if (_pageGroupOption.getPageGroupSize() == 1) { + String msg = "The pageGroupSize should be greater than 1. But the value is one."; + msg = msg + " pageGroupSize=" + _pageGroupOption.getPageGroupSize(); + throw new IllegalStateException(msg); + } + } + + // =================================================================================== + // Basic Override + // ============== + /** + * @return The view string of all attribute values. (NotNull) + */ + @Override + public String toString() { + final StringBuilder sb = new StringBuilder(); + + sb.append(" currentPageNumber=").append(_currentPageNumber); + sb.append(" allPageCount=").append(_allPageCount); + sb.append(" pageGroupOption=").append(_pageGroupOption); + + return sb.toString(); + } + + // =================================================================================== + // Accessor + // ======== + public void setCurrentPageNumber(int currentPageNumber) { + this._currentPageNumber = currentPageNumber; + } + + public void setAllPageCount(int allPageCount) { + this._allPageCount = allPageCount; + } + + public void setPageGroupOption(PageGroupOption pageGroupOption) { + this._pageGroupOption = pageGroupOption; + } +} Property changes on: announcement/trunk/src/main/java/jp/sf/pal/announcement/db/allcommon/cbean/pagenavi/group/PageGroupBean.java ___________________________________________________________________ Name: svn:eol-style + native Added: announcement/trunk/src/main/java/jp/sf/pal/announcement/db/allcommon/cbean/pagenavi/group/PageGroupOption.java =================================================================== --- announcement/trunk/src/main/java/jp/sf/pal/announcement/db/allcommon/cbean/pagenavi/group/PageGroupOption.java (rev 0) +++ announcement/trunk/src/main/java/jp/sf/pal/announcement/db/allcommon/cbean/pagenavi/group/PageGroupOption.java 2008-06-30 02:54:27 UTC (rev 1002) @@ -0,0 +1,45 @@ +package jp.sf.pal.announcement.db.allcommon.cbean.pagenavi.group; + +/** + * The option of page group. + * @author DBFlute(AutoGenerator) + */ +public class PageGroupOption implements java.io.Serializable { + + // =================================================================================== + // Definition + // ========== + /** Serial version UID. (Default) */ + private static final long serialVersionUID = 1L; + + // =================================================================================== + // Attribute + // ========= + protected int _pageGroupSize; + + // =================================================================================== + // Basic Override + // ============== + /** + * @return The view string of all attribute values. (NotNull) + */ + @Override + public String toString() { + final StringBuilder sb = new StringBuilder(); + + sb.append(" pageGroupSize=").append(_pageGroupSize); + + return sb.toString(); + } + + // =================================================================================== + // Accessor + // ======== + public int getPageGroupSize() { + return _pageGroupSize; + } + + public void setPageGroupSize(int pageGroupSize) { + this._pageGroupSize = pageGroupSize; + } +} Property changes on: announcement/trunk/src/main/java/jp/sf/pal/announcement/db/allcommon/cbean/pagenavi/group/PageGroupOption.java ___________________________________________________________________ Name: svn:eol-style + native Added: announcement/trunk/src/main/java/jp/sf/pal/announcement/db/allcommon/cbean/pagenavi/range/PageRangeBean.java =================================================================== --- announcement/trunk/src/main/java/jp/sf/pal/announcement/db/allcommon/cbean/pagenavi/range/PageRangeBean.java (rev 0) +++ announcement/trunk/src/main/java/jp/sf/pal/announcement/db/allcommon/cbean/pagenavi/range/PageRangeBean.java 2008-06-30 02:54:27 UTC (rev 1002) @@ -0,0 +1,189 @@ +package jp.sf.pal.announcement.db.allcommon.cbean.pagenavi.range; + +import java.util.ArrayList; +import java.util.Iterator; +import java.util.List; + +import jp.sf.pal.announcement.db.allcommon.cbean.pagenavi.PageNumberLink; +import jp.sf.pal.announcement.db.allcommon.cbean.pagenavi.PageNumberLinkSetupper; + +/** + * The bean of page range. + * @author DBFlute(AutoGenerator) + */ +public class PageRangeBean implements java.io.Serializable { + + // =================================================================================== + // Definition + // ========== + /** Serial version UID. (Default) */ + private static final long serialVersionUID = 1L; + + // =================================================================================== + // Attribute + // ========= + protected int _currentPageNumber; + + protected int _allPageCount; + + protected PageRangeOption _pageRangeOption; + + // =================================================================================== + // Main + // ==== + /** + * Build the list of page number link. + * @param The type of link. + * @param pageNumberLinkSetupper Page number link setupper. (NotNull and Required LINK) + * @return The list of Page number link. (NotNull) + */ + public List buildPageNumberLinkList( + PageNumberLinkSetupper pageNumberLinkSetupper) { + final List pageNumberList = createPageNumberList(); + final List pageNumberLinkList = new ArrayList(); + for (Integer pageNumber : pageNumberList) { + pageNumberLinkList.add(pageNumberLinkSetupper.setup(pageNumber, + pageNumber.equals(_currentPageNumber))); + } + return pageNumberLinkList; + } + + /** + * Create the list of page number. + * @return The list of page number. (NotNull) + */ + public List createPageNumberList() { + assertPageRangeValid(); + final int pageRangeSize = _pageRangeOption.getPageRangeSize(); + final int allPageCount = _allPageCount; + final int currentPageNumber = _currentPageNumber; + + final List resultList = new ArrayList(); + for (int i = currentPageNumber - pageRangeSize; i < currentPageNumber; i++) { + if (i < 1) { + continue; + } + resultList.add(new Integer(i)); + } + + resultList.add(new Integer(currentPageNumber)); + + final int endPageNumber = (currentPageNumber + pageRangeSize); + for (int i = currentPageNumber + 1; i <= endPageNumber + && i <= allPageCount; i++) { + resultList.add(new Integer(i)); + } + + final boolean fillLimit = _pageRangeOption.isFillLimit(); + final int limitSize = (pageRangeSize * 2) + 1; + if (fillLimit && !resultList.isEmpty() && resultList.size() < limitSize) { + final Integer firstElements = (Integer) resultList.get(0); + final Integer lastElements = (Integer) resultList.get(resultList + .size() - 1); + if (firstElements.intValue() > 1) { + for (int i = firstElements.intValue() - 1; resultList.size() < limitSize + && i > 0; i--) { + resultList.add(0, new Integer(i)); + } + } + for (int i = lastElements.intValue() + 1; resultList.size() < limitSize + && i <= allPageCount; i++) { + resultList.add(new Integer(i)); + } + } + return resultList; + } + + /** + * Get the array of page number. + * @return The array of page number. (NotNull) + */ + public int[] createPageNumberArray() { + assertPageRangeValid(); + return convertListToIntArray(createPageNumberList()); + } + + /** + * Is existing previous page range? + * @return Determination. + */ + public boolean isExistPrePageRange() { + assertPageRangeValid(); + final int[] array = createPageNumberArray(); + if (array.length == 0) { + return false; + } + return array[0] > 1; + } + + /** + * Is existing next page range? + * @return Determination. + */ + public boolean isExistNextPageRange() { + assertPageRangeValid(); + final int[] array = createPageNumberArray(); + if (array.length == 0) { + return false; + } + return array[array.length - 1] < _allPageCount; + } + + // =================================================================================== + // Assist Helper + // ============= + protected int[] convertListToIntArray(List ls) { + final int[] resultArray = new int[ls.size()]; + int arrayIndex = 0; + for (Iterator ite = ls.iterator(); ite.hasNext();) { + final Integer tmpPageNumber = (Integer) ite.next(); + resultArray[arrayIndex] = tmpPageNumber.intValue(); + arrayIndex++; + } + return resultArray; + } + + protected void assertPageRangeValid() { + if (_pageRangeOption == null) { + String msg = "The pageRangeOption should not be null. Please invoke setPageRangeOption()."; + throw new IllegalStateException(msg); + } + final int pageRangeSize = _pageRangeOption.getPageRangeSize(); + if (pageRangeSize == 0) { + String msg = "The pageRangeSize should be greater than 1. But the value is zero."; + throw new IllegalStateException(msg); + } + } + + // =================================================================================== + // Accessor + // ======== + public void setCurrentPageNumber(int currentPageNumber) { + this._currentPageNumber = currentPageNumber; + } + + public void setAllPageCount(int allPageCount) { + this._allPageCount = allPageCount; + } + + public void setPageRangeOption(PageRangeOption pageRangeOption) { + this._pageRangeOption = pageRangeOption; + } + + // =================================================================================== + // Basic Override + // ============== + /** + * @return The view string of all attribute values. (NotNull) + */ + @Override + public String toString() { + final StringBuilder sb = new StringBuilder(); + + sb.append(" currentPageNumber=").append(_currentPageNumber); + sb.append(" allPageCount=").append(_allPageCount); + sb.append(" pageRangeOption=").append(_pageRangeOption); + + return sb.toString(); + } +} Property changes on: announcement/trunk/src/main/java/jp/sf/pal/announcement/db/allcommon/cbean/pagenavi/range/PageRangeBean.java ___________________________________________________________________ Name: svn:eol-style + native Added: announcement/trunk/src/main/java/jp/sf/pal/announcement/db/allcommon/cbean/pagenavi/range/PageRangeOption.java =================================================================== --- announcement/trunk/src/main/java/jp/sf/pal/announcement/db/allcommon/cbean/pagenavi/range/PageRangeOption.java (rev 0) +++ announcement/trunk/src/main/java/jp/sf/pal/announcement/db/allcommon/cbean/pagenavi/range/PageRangeOption.java 2008-06-30 02:54:27 UTC (rev 1002) @@ -0,0 +1,56 @@ +package jp.sf.pal.announcement.db.allcommon.cbean.pagenavi.range; + +/** + * The option of page range. + * @author DBFlute(AutoGenerator) + */ +public class PageRangeOption implements java.io.Serializable { + + // =================================================================================== + // Definition + // ========== + /** Serial version UID. (Default) */ + private static final long serialVersionUID = 1L; + + // =================================================================================== + // Attribute + // ========= + protected int _pageRangeSize; + + protected boolean _fillLimit; + + // =================================================================================== + // Basic Override + // ============== + /** + * @return The view string of all attribute values. (NotNull) + */ + @Override + public String toString() { + final StringBuilder sb = new StringBuilder(); + + sb.append(" pageRangeSize=").append(_pageRangeSize); + sb.append(" fillLimit=").append(_fillLimit); + + return sb.toString(); + } + + // =================================================================================== + // Accessor + // ======== + public int getPageRangeSize() { + return _pageRangeSize; + } + + public void setPageRangeSize(int pageRangeSize) { + this._pageRangeSize = pageRangeSize; + } + + public boolean isFillLimit() { + return _fillLimit; + } + + public void setFillLimit(boolean fillLimit) { + this._fillLimit = fillLimit; + } +} Property changes on: announcement/trunk/src/main/java/jp/sf/pal/announcement/db/allcommon/cbean/pagenavi/range/PageRangeOption.java ___________________________________________________________________ Name: svn:eol-style + native Added: announcement/trunk/src/main/java/jp/sf/pal/announcement/db/allcommon/cbean/sqlclause/AbstractSqlClause.java =================================================================== --- announcement/trunk/src/main/java/jp/sf/pal/announcement/db/allcommon/cbean/sqlclause/AbstractSqlClause.java (rev 0) +++ announcement/trunk/src/main/java/jp/sf/pal/announcement/db/allcommon/cbean/sqlclause/AbstractSqlClause.java 2008-06-30 02:54:27 UTC (rev 1002) @@ -0,0 +1,1343 @@ +package jp.sf.pal.announcement.db.allcommon.cbean.sqlclause; + +import java.util.ArrayList; +import java.util.Collection; +import java.util.HashMap; +import java.util.Iterator; +import java.util.LinkedHashMap; +import java.util.List; +import java.util.Map; +import java.util.Set; +import java.util.StringTokenizer; + +import jp.sf.pal.announcement.db.allcommon.cbean.ckey.ConditionKey; +import jp.sf.pal.announcement.db.allcommon.cbean.coption.ConditionOption; +import jp.sf.pal.announcement.db.allcommon.cbean.cvalue.ConditionValue; +import jp.sf.pal.announcement.db.allcommon.dbmeta.DBMeta; +import jp.sf.pal.announcement.db.allcommon.dbmeta.DBMetaInstanceHandler; +import jp.sf.pal.announcement.db.allcommon.dbmeta.info.ColumnInfo; +import jp.sf.pal.announcement.db.allcommon.dbmeta.info.ForeignInfo; +import jp.sf.pal.announcement.db.allcommon.dbmeta.info.UniqueInfo; +import jp.sf.pal.announcement.db.allcommon.util.SimpleAssertUtil; +import jp.sf.pal.announcement.db.allcommon.util.SimpleStringUtil; +import jp.sf.pal.announcement.db.allcommon.util.SimpleSystemUtil; + +/** + * The abstract class of SqlClause. + * + * @author DBFlute(AutoGenerator) + */ + @ SuppressWarnings("unchecked") +public abstract class AbstractSqlClause implements SqlClause { + + // =================================================================================== + // Definition + // ========== + protected static final String SELECT_HINT = "/*$dto.selectHint*/"; + + // =================================================================================== + // Attribute + // ========= + // ----------------------------------------------------- + // Basic + // ----- + /** Target table name. */ + protected final String _tableName; + + // ----------------------------------------------------- + // Clause Resource + // --------------- + /** Selected select column map. map:{tableAliasName : map:{columnName : selectColumnInfo}}*/ + protected Map> _selectedSelectColumnMap = new LinkedHashMap>(); + + /** Included select column map. */ + protected Map _includedSelectColumnMap = new LinkedHashMap(); + + /** The map of real column and alias of select clause. map:{realColumnName : aliasName} */ + protected Map _selectClauseRealColumnAliasMap = new HashMap();// Without linked! + + /** Outer join map. */ + protected Map _outerJoinMap = new LinkedHashMap(); + + /** Where list. */ + protected List _whereList = new ArrayList(); + + /** Inline where list for BaseTable. */ + protected List _baseTableInlineWhereList = new ArrayList(); + + /** Order-by clause. */ + protected final OrderByClause _orderByClause = new OrderByClause(); + + /** Union clause list. */ + protected List _unionQueryInfoList = new ArrayList(); + + /** Is included-select-column effective? Default value is false. */ + protected boolean _isIncludedSelectColumnEffective = false; + + /** Is order-by effective? Default value is false. */ + protected boolean _isOrderByEffective = false; + + // ----------------------------------------------------- + // Fetch Property + // -------------- + /** Fetch start index. (for fetchXxx()) */ + protected int _fetchStartIndex = 0; + + /** Fetch size. (for fetchXxx()) */ + protected int _fetchSize = 0; + + /** Fetch page number. (for fetchXxx()) This value should be plus. */ + protected int _fetchPageNumber = 1; + + /** Is fetch-narrowing effective? Default value is false. */ + protected boolean _isFetchScopeEffective = false; + + // ----------------------------------------------------- + // AdditionalConditionAsOr + // ----------------------- + /** Is additional condition as or effective?*/ + protected boolean _isAdditionalConditionAsOrEffective = false; + + // ----------------------------------------------------- + // WhereClauseSimpleFilter + // ----------------------- + /** The filter for where clause. */ + protected List _whereClauseSimpleFilterList; + + // ----------------------------------------------------- + // Selected Foreign Info + // --------------------- + /** The information of selected foreign table. */ + protected Map _selectedForeignInfo; + + // ----------------------------------------------------- + // Optional Info + // ------------- + protected boolean _formatClause; + + // =================================================================================== + // Constructor + // =========== + public AbstractSqlClause(String tableName) { + if (tableName == null) { + String msg = "Argument[tableName] must not be null."; + throw new IllegalArgumentException(msg); + } + _tableName = tableName; + } + + // =================================================================================== + // Clause + // ====== + public String getClause() { + final StringBuilder sb = new StringBuilder(512); + sb.append(getSelectClause()); + sb.append(" "); + sb.append(buildClauseWithoutMainSelect(false)); + return sb.toString(); + } + + public String getClausePKOnly() { + final StringBuilder sb = new StringBuilder(512); + sb.append(getSelectClausePKOnly()); + sb.append(" "); + sb.append(buildClauseWithoutMainSelect(true)); + return sb.toString(); + } + + protected String buildClauseWithoutMainSelect(boolean pkonly) { + final StringBuilder sb = new StringBuilder(512); + sb.append(getFromClause()); + sb.append(getFromHint()); + sb.append(" "); + sb.append(getWhereClause()); + String unionClause = buildUnionClause(pkonly ? getSelectClausePKOnly() + : getSelectClause()); + + // Delete template mark! (At the future this will be unnecessary.) + unionClause = replaceString(unionClause, getUnionWhereClauseMark(), "");// Required! + unionClause = replaceString(unionClause, + getUnionWhereFirstConditionMark(), "");// Required! + + sb.append(unionClause); + if (_isOrderByEffective && !_orderByClause.isEmpty()) { + sb.append(" "); + sb.append(getOrderByClause()); + } + sb.append(" "); + sb.append(getSqlSuffix()); + return sb.toString(); + } + + public String getClauseFromWhereWithUnionTemplate() { + return buildClauseFromWhereAsTemplate(false); + } + + public String getClauseFromWhereWithWhereUnionTemplate() { + return buildClauseFromWhereAsTemplate(true); + } + + protected String buildClauseFromWhereAsTemplate(boolean template) { + final StringBuilder sb = new StringBuilder(512); + sb.append(getFromClause()); + sb.append(getFromHint()); + sb.append(" "); + sb.append(buildWhereClause(template)); + sb.append(buildUnionClause(getUnionSelectClauseMark())); + return sb.toString(); + } + + protected String buildUnionClause(String selectClause) { + final StringBuilder sb = new StringBuilder(); + for (final Iterator ite = _unionQueryInfoList + .iterator(); ite.hasNext();) { + final UnionQueryInfo unionQueryInfo = (UnionQueryInfo) ite.next(); + final String unionQueryClause = unionQueryInfo + .getUnionQueryClause(); + final boolean unionAll = unionQueryInfo.isUnionAll(); + if (isFormatClauseEffective()) { + sb.append(getLineSeparator()); + } + sb.append(unionAll ? " union all " : " union "); + if (isFormatClauseEffective()) { + sb.append(getLineSeparator()); + } + sb.append(selectClause).append(" ").append(unionQueryClause); + } + return sb.toString(); + } + + // =================================================================================== + // Clause Parts + // ============ + public String getSelectClause() { + final StringBuilder sb = new StringBuilder(); + final DBMeta dbmeta = DBMetaInstanceHandler.findDBMeta(_tableName); + final List columnInfoList = dbmeta.getColumnInfoList(); + for (ColumnInfo columnInfo : columnInfoList) { + final String columnName = columnInfo.getColumnDbName(); + if (sb.length() > 0) { + sb.append(", "); + } else { + sb.append("select").append(SELECT_HINT).append(" "); + } + final String realColumnName = getLocalTableAliasName() + "." + + columnName; + sb.append(realColumnName).append(" as ").append(columnName); + _selectClauseRealColumnAliasMap.put(realColumnName, columnName); + } + final Set tableAliasNameSet = _selectedSelectColumnMap.keySet(); + for (String tableAliasName : tableAliasNameSet) { + final Map map = _selectedSelectColumnMap + .get(tableAliasName); + final Collection selectColumnInfoList = map + .values(); + for (SelectedSelectColumnInfo selectColumnInfo : selectColumnInfoList) { + final String realColumnName = selectColumnInfo + .buildRealColumnName(); + sb.append(", ").append(realColumnName).append(" as ").append( + selectColumnInfo.getColumnAliasName()); + _selectClauseRealColumnAliasMap.put(realColumnName, + selectColumnInfo.getColumnAliasName()); + } + } + if (_isIncludedSelectColumnEffective + && !_includedSelectColumnMap.isEmpty()) { + sb.append(getIncludedSelectColumnClause()); + } + return sb.toString(); + } + + public String getSelectClausePKOnly() { + final StringBuilder sb = new StringBuilder(); + final DBMeta dbmeta = DBMetaInstanceHandler.findDBMeta(_tableName); + final UniqueInfo uniqueInfo = dbmeta.getPrimaryUniqueInfo(); + final List columnInfoList = uniqueInfo + .getUniqueColumnList(); + for (ColumnInfo columnInfo : columnInfoList) { + final String columnName = columnInfo.getColumnDbName(); + if (sb.length() > 0) { + sb.append(", "); + } else { + sb.append("select").append(SELECT_HINT).append(" "); + } + final String realColumnName = getLocalTableAliasName() + "." + + columnName; + sb.append(realColumnName).append(" as ").append(columnName); + _selectClauseRealColumnAliasMap.put(realColumnName, columnName); + } + if (_isIncludedSelectColumnEffective + && !_includedSelectColumnMap.isEmpty()) { + sb.append(getIncludedSelectColumnClause()); + } + return sb.toString(); + } + + public String getSelectHint() { + return createSelectHint(); + } + + public String getIncludedSelectColumnClause() { + final StringBuilder sb = new StringBuilder(); + int count = 0; + for (final Iterator ite = _includedSelectColumnMap.keySet() + .iterator(); ite.hasNext(); count++) { + final String aliasName = ite.next(); + final String realColumnName = (String) _includedSelectColumnMap + .get(aliasName); + sb.append(", ").append(realColumnName).append(" as ").append( + aliasName); + _selectClauseRealColumnAliasMap.put(realColumnName, aliasName); + } + return sb.toString(); + } + + public String getFromClause() { + final StringBuilder sb = new StringBuilder(); + if (isFormatClauseEffective()) { + sb.append(getLineSeparator()).append(" "); + } + sb.append("from "); + if (_baseTableInlineWhereList.isEmpty()) { + sb.append(_tableName).append(" dflocal"); + } else { + sb.append( + getInlineViewClause(_tableName, _baseTableInlineWhereList)) + .append(" dflocal"); + } + sb.append(getFromBaseTableHint()); + sb.append(getLeftOuterJoinClause()); + return sb.toString(); + } + + protected String getLeftOuterJoinClause() { + final StringBuilder sb = new StringBuilder(); + for (final Iterator ite = _outerJoinMap.keySet().iterator(); ite + .hasNext();) { + final String aliasName = ite.next(); + final LeftOuterJoinInfo joinInfo = (LeftOuterJoinInfo) _outerJoinMap + .get(aliasName); + final String joinTableName = joinInfo.getJoinTableName(); + final List inlineWhereClauseList = joinInfo + .getInlineWhereClauseList(); + final List additionalOnClauseList = joinInfo + .getAdditionalOnClauseList(); + final Map joinOnMap = joinInfo.getJoinOnMap(); + assertJoinOnMapNotEmpty(joinOnMap, aliasName); + + if (isFormatClauseEffective()) { + sb.append(getLineSeparator()).append(" "); + } + sb.append(" left outer join "); + if (inlineWhereClauseList.isEmpty()) { + sb.append(joinTableName); + } else { + sb.append(getInlineViewClause(joinTableName, + inlineWhereClauseList)); + } + sb.append(" ").append(aliasName).append(" on "); + int count = 0; + final Set localColumnNameSet = joinOnMap.keySet(); + for (String localColumnName : localColumnNameSet) { + final String foreignColumnName = (String) joinOnMap + .get(localColumnName); + if (count > 0) { + sb.append(" and "); + } + if (localColumnName.equals("$$fixedCondition$$")) { + sb.append(foreignColumnName); + } else { + sb.append(localColumnName).append(" = ").append( + foreignColumnName); + } + ++count; + } + for (String additionalOnClause : additionalOnClauseList) { + sb.append(" and ").append(additionalOnClause); + } + } + return sb.toString(); + } + + protected String getInlineViewClause(String joinTableName, + List inlineWhereClauseList) { + final StringBuilder sb = new StringBuilder(); + sb.append("(select * from ").append(joinTableName).append(" where "); + int count = 0; + for (final Iterator ite = inlineWhereClauseList.iterator(); ite + .hasNext();) { + String clauseElement = ite.next(); + clauseElement = filterWhereClauseSimply(clauseElement); + if (count > 0) { + sb.append(" and "); + } + sb.append(clauseElement); + ++count; + } + sb.append(")"); + return sb.toString(); + } + + public String getFromBaseTableHint() { + return createFromBaseTableHint(); + } + + public String getFromHint() { + return createFromHint(); + } + + public String getWhereClause() { + return buildWhereClause(false); + } + + protected String buildWhereClause(boolean template) { + final StringBuilder sb = new StringBuilder(); + int count = 0; + for (final Iterator ite = _whereList.iterator(); ite.hasNext(); count++) { + String clauseElement = (String) ite.next(); + clauseElement = filterWhereClauseSimply(clauseElement); + if (count == 0) { + if (isFormatClauseEffective()) { + sb.append(getLineSeparator()).append(" "); + } + sb.append("where ").append( + template ? getWhereFirstConditionMark() : "").append( + clauseElement); + } else { + if (isFormatClauseEffective()) { + sb.append(getLineSeparator()).append(" "); + } + sb.append(" and ").append(clauseElement); + } + } + if (template && sb.length() == 0) { + sb.append(getWhereClauseMark()); + } + return sb.toString(); + } + + public String getOrderByClause() { + final String orderByClause; + if (!_unionQueryInfoList.isEmpty()) { + if (_selectClauseRealColumnAliasMap == null + || _selectClauseRealColumnAliasMap.isEmpty()) { + String msg = "The selectClauseColumnAliasMap should not be null or empty when union query exists: " + + toString(); + throw new IllegalStateException(msg); + } + orderByClause = _orderByClause + .getOrderByClause(_selectClauseRealColumnAliasMap); + } else { + orderByClause = _orderByClause.getOrderByClause(); + } + if (isFormatClauseEffective() && orderByClause != null + && orderByClause.trim().length() > 0) { + return getLineSeparator() + " " + orderByClause; + } else { + return orderByClause; + } + } + + public String getSqlSuffix() { + final String sqlSuffix = createSqlSuffix(); + if (isFormatClauseEffective() && sqlSuffix != null + && sqlSuffix.trim().length() > 0) { + return getLineSeparator() + sqlSuffix; + } else { + return sqlSuffix; + } + } + + // =================================================================================== + // Copy Parts + // ========== + public void copyIncludedSelectColumn(SqlClause sqlClause) { + final Set keySet = _includedSelectColumnMap.keySet(); + for (final Iterator ite = keySet.iterator(); ite.hasNext();) { + final String aliasName = ite.next(); + final String realColumnName = (String) _includedSelectColumnMap + .get(aliasName); + sqlClause.registerIncludedSelectColumn(aliasName, realColumnName); + } + } + + // =================================================================================== + // SelectedSelectColumn + // ==================== + /** + * Register selected select column. + * + * @param foreignTableAliasName The alias name of foreign table. (NotNull) + * @param localTableName The table name of local. (NotNull) + * @param foreignPropertyName The property name of foreign table. (NotNull) + * @param localRelationPath The path of local relation. (Nullable) + */ + public void registerSelectedSelectColumn(String foreignTableAliasName, + String localTableName, String foreignPropertyName, + String localRelationPath) { + _selectedSelectColumnMap + .put(foreignTableAliasName, createSelectedSelectColumnInfo( + foreignTableAliasName, localTableName, + foreignPropertyName, localRelationPath)); + } + + protected Map createSelectedSelectColumnInfo( + String foreignTableAliasName, String localTableName, + String foreignPropertyName, String localRelationPath) { + final DBMeta dbmeta = DBMetaInstanceHandler.findDBMeta(localTableName); + final ForeignInfo foreignInfo = dbmeta + .findForeignInfo(foreignPropertyName); + final int relationNo = foreignInfo.getRelationNo(); + String nextRelationPath = "_" + relationNo; + if (localRelationPath != null) { + nextRelationPath = localRelationPath + nextRelationPath; + } + final Map resultMap = new LinkedHashMap(); + final DBMeta foreignDBMeta = foreignInfo.getForeignDBMeta(); + final List columnInfoList = foreignDBMeta + .getColumnInfoList(); + for (ColumnInfo columnInfo : columnInfoList) { + final String columnDbName = columnInfo.getColumnDbName(); + final SelectedSelectColumnInfo selectColumnInfo = new SelectedSelectColumnInfo(); + selectColumnInfo.setTableAliasName(foreignTableAliasName); + selectColumnInfo.setColumnName(columnDbName); + selectColumnInfo + .setColumnAliasName(columnDbName + nextRelationPath); + resultMap.put(columnDbName, selectColumnInfo); + } + return resultMap; + } + + public static class SelectedSelectColumnInfo { + protected String tableAliasName; + + protected String columnName; + + protected String columnAliasName; + + public String buildRealColumnName() { + if (tableAliasName != null) { + return tableAliasName + "." + columnName; + } else { + return columnName; + } + } + + public String getTableAliasName() { + return tableAliasName; + } + + public void setTableAliasName(String tableAliasName) { + this.tableAliasName = tableAliasName; + } + + public String getColumnName() { + return columnName; + } + + public void setColumnName(String columnName) { + this.columnName = columnName; + } + + public String getColumnAliasName() { + return columnAliasName; + } + + public void setColumnAliasName(String columnAliasName) { + this.columnAliasName = columnAliasName; + } + } + + // =================================================================================== + // IncludedSelectColumn + // ==================== + public void ignoreIncludedSelectColumn() { + _isIncludedSelectColumnEffective = false; + } + + public void makeIncludedSelectColumnEffective() { + if (!_includedSelectColumnMap.isEmpty()) { + _isIncludedSelectColumnEffective = true; + } + } + + public void registerIncludedSelectColumn(String aliasName, + String realColumnName) { + _isIncludedSelectColumnEffective = true; + _includedSelectColumnMap.put(aliasName, realColumnName); + } + + // =================================================================================== + // OuterJoin + // ========= + public void registerOuterJoin(String joinTableName, String aliasName, + Map joinOnMap) { + assertAlreadyOuterJoin(aliasName); + assertJoinOnMapNotEmpty(joinOnMap, aliasName); + final LeftOuterJoinInfo joinInfo = new LeftOuterJoinInfo(); + joinInfo.setAliasName(aliasName); + joinInfo.setJoinTableName(joinTableName); + joinInfo.setJoinOnMap(joinOnMap); + _outerJoinMap.put(aliasName, joinInfo); + } + + protected static class LeftOuterJoinInfo { + protected String _aliasName; + + protected String _joinTableName; + + protected List _inlineWhereClauseList = new ArrayList(); + + protected List _additionalOnClauseList = new ArrayList(); + + protected Map _joinOnMap; + + protected boolean _onClauseInline; + + public String getAliasName() { + return _aliasName; + } + + public void setAliasName(String value) { + _aliasName = value; + } + + public String getJoinTableName() { + return _joinTableName; + } + + public void setJoinTableName(String value) { + _joinTableName = value; + } + + public List getInlineWhereClauseList() { + return _inlineWhereClauseList; + } + + public void addInlineWhereClause(String value) { + _inlineWhereClauseList.add(value); + } + + public List getAdditionalOnClauseList() { + return _additionalOnClauseList; + } + + public void addAdditionalOnClause(String value) { + _additionalOnClauseList.add(value); + } + + public Map getJoinOnMap() { + return _joinOnMap; + } + + public void setJoinOnMap(Map value) { + _joinOnMap = value; + } + + public boolean isOnClauseInline() { + return _onClauseInline; + } + + public void setOnClauseInline(boolean value) { + _onClauseInline = value; + } + } + + protected void assertAlreadyOuterJoin(String aliasName) { + if (_outerJoinMap.containsKey(aliasName)) { + String msg = "The alias name have already registered in outer join: " + + aliasName; + throw new IllegalStateException(msg); + } + } + + protected void assertJoinOnMapNotEmpty(Map joinOnMap, + String aliasName) { + if (joinOnMap.isEmpty()) { + String msg = "The joinOnMap should not be empty: aliasName=" + + aliasName; + throw new IllegalStateException(msg); + } + } + + // =================================================================================== + // Where + // ===== + public void registerWhereClause(String columnFullName, ConditionKey key, + ConditionValue value) { + assertStringNotNullAndNotTrimmedEmpty("columnFullName", columnFullName); + key.addWhereClause(_whereList, columnFullName, value); + arrangeWhereListAdditionalConditionAsOr(_whereList); + } + + public void registerWhereClause(String columnFullName, ConditionKey key, + ConditionValue value, ConditionOption option) { + assertStringNotNullAndNotTrimmedEmpty("columnFullName", columnFullName); + assertObjectNotNull("option of " + columnFullName, option); + key.addWhereClause(_whereList, columnFullName, value, option); + arrangeWhereListAdditionalConditionAsOr(_whereList); + } + + public void registerWhereClause(String clause) { + assertStringNotNullAndNotTrimmedEmpty("clause", clause); + _whereList.add(clause); + arrangeWhereListAdditionalConditionAsOr(_whereList); + } + + public void exchangeFirstWhereClauseForLastOne() { + if (_whereList.size() > 1) { + final String first = (String) _whereList.get(0); + final String last = (String) _whereList.get(_whereList.size() - 1); + _whereList.set(0, last); + _whereList.set(_whereList.size() - 1, first); + } + } + + // =================================================================================== + // InlineWhere + // =========== + public void registerBaseTableInlineWhereClause(String columnName, + ConditionKey key, ConditionValue value) { + assertStringNotNullAndNotTrimmedEmpty("columnName", columnName); + key.addWhereClause(_baseTableInlineWhereList, columnName, value); + arrangeWhereListAdditionalConditionAsOr(_baseTableInlineWhereList); + } + + public void registerBaseTableInlineWhereClause(String columnName, + ConditionKey key, ConditionValue value, ConditionOption option) { + assertStringNotNullAndNotTrimmedEmpty("columnName", columnName); + assertObjectNotNull("option of " + columnName, option); + key + .addWhereClause(_baseTableInlineWhereList, columnName, value, + option); + arrangeWhereListAdditionalConditionAsOr(_baseTableInlineWhereList); + } + + public void registerBaseTableInlineWhereClause(String value) { + _baseTableInlineWhereList.add(value); + } + + public void registerOuterJoinInlineWhereClause(String aliasName, + String columnName, ConditionKey key, ConditionValue value, + boolean onClauseInline) { + assertNotYetOuterJoin(aliasName); + assertStringNotNullAndNotTrimmedEmpty("columnName", columnName); + final LeftOuterJoinInfo joinInfo = (LeftOuterJoinInfo) _outerJoinMap + .get(aliasName); + if (onClauseInline) { + key.addWhereClause(joinInfo.getAdditionalOnClauseList(), aliasName + + "." + columnName, value); + } else { + key.addWhereClause(joinInfo.getInlineWhereClauseList(), columnName, + value); + } + arrangeWhereListAdditionalConditionAsOr(joinInfo + .getInlineWhereClauseList()); + } + + public void registerOuterJoinInlineWhereClause(String aliasName, + String columnName, ConditionKey key, ConditionValue value, + ConditionOption option, boolean onClauseInline) { + assertNotYetOuterJoin(aliasName); + assertStringNotNullAndNotTrimmedEmpty("columnName", columnName); + final LeftOuterJoinInfo joinInfo = (LeftOuterJoinInfo) _outerJoinMap + .get(aliasName); + if (onClauseInline) { + key.addWhereClause(joinInfo.getAdditionalOnClauseList(), aliasName + + "." + columnName, value, option); + arrangeWhereListAdditionalConditionAsOr(joinInfo + .getAdditionalOnClauseList()); + } else { + key.addWhereClause(joinInfo.getInlineWhereClauseList(), columnName, + value, option); + arrangeWhereListAdditionalConditionAsOr(joinInfo + .getInlineWhereClauseList()); + } + } + + public void registerOuterJoinInlineWhereClause(String aliasName, + String value, boolean onClauseInline) { + assertNotYetOuterJoin(aliasName); + final LeftOuterJoinInfo joinInfo = (LeftOuterJoinInfo) _outerJoinMap + .get(aliasName); + if (onClauseInline) { + joinInfo.addAdditionalOnClause(value); + arrangeWhereListAdditionalConditionAsOr(joinInfo + .getAdditionalOnClauseList()); + } else { + joinInfo.addInlineWhereClause(value); + arrangeWhereListAdditionalConditionAsOr(joinInfo + .getInlineWhereClauseList()); + } + } + + protected void assertNotYetOuterJoin(String aliasName) { + if (!_outerJoinMap.containsKey(aliasName)) { + String msg = "The alias name have not registered in outer join yet: " + + aliasName; + throw new IllegalStateException(msg); + } + } + + // =================================================================================== + // AdditionalConditionAsOr + // ======================= + public void makeAdditionalConditionAsOrEffective() { + _isAdditionalConditionAsOrEffective = true; + } + + public void ignoreAdditionalConditionAsOr() { + _isAdditionalConditionAsOrEffective = false; + } + + protected void arrangeWhereListAdditionalConditionAsOr( + List whereList) { + if (_isAdditionalConditionAsOrEffective) { + if (whereList.size() < 2) { + String msg = "The whereList should have two more elements when the isAdditionalConditionAsOrEffective is true: " + + toString(); + throw new IllegalStateException(msg); + } + final String lastWhereClause = (String) whereList.remove(whereList + .size() - 1); + final String preWhereClause = (String) whereList.remove(whereList + .size() - 1); + if (preWhereClause.startsWith("(") && preWhereClause.endsWith(")")) { + final String plainClause = preWhereClause.substring("(" + .length(), preWhereClause.length() - ")".length()); + whereList.add("(" + plainClause + " or " + lastWhereClause + + ")"); + } else { + whereList.add("(" + preWhereClause + " or " + lastWhereClause + + ")"); + } + } + } + + // =================================================================================== + // OrderBy + // ======= + public OrderByClause getSqlComponentOfOrderByClause() { + return _orderByClause; + } + + public SqlClause clearOrderBy() { + _isOrderByEffective = false; + _orderByClause.clear(); + return this; + } + + public SqlClause ignoreOrderBy() { + _isOrderByEffective = false; + return this; + } + + public SqlClause makeOrderByEffective() { + if (!_orderByClause.isEmpty()) { + _isOrderByEffective = true; + } + return this; + } + + public void reverseOrderBy_Or_OverrideOrderBy(String orderByProperty, + String registeredOrderByProperty, boolean ascOrDesc) { + _isOrderByEffective = true; + if (!_orderByClause.isSameOrderByColumn(orderByProperty)) { + clearOrderBy(); + registerOrderBy(orderByProperty, registeredOrderByProperty, + ascOrDesc); + } else { + _orderByClause.reverseAll(); + } + } + + public void registerOrderBy(String orderByProperty, + String registeredOrderByProperty, boolean ascOrDesc) { + try { + _isOrderByEffective = true; + final List orderByList = new ArrayList(); + { + final StringTokenizer st = new StringTokenizer(orderByProperty, + "/"); + while (st.hasMoreElements()) { + orderByList.add(st.nextToken()); + } + } + + if (registeredOrderByProperty == null + || registeredOrderByProperty.trim().length() == 0) { + registeredOrderByProperty = orderByProperty; + } + + final List registeredOrderByList = new ArrayList(); + { + final StringTokenizer st = new StringTokenizer( + registeredOrderByProperty, "/"); + while (st.hasMoreElements()) { + registeredOrderByList.add(st.nextToken()); + } + } + + int count = 0; + for (final Iterator ite = orderByList.iterator(); ite + .hasNext();) { + String orderBy = ite.next(); + String registeredOrderBy = (String) registeredOrderByList + .get(count); + + _isOrderByEffective = true; + String aliasName = null; + String columnName = null; + String registeredAliasName = null; + String registeredColumnName = null; + + if (orderBy.indexOf(".") < 0) { + columnName = orderBy; + } else { + aliasName = orderBy.substring(0, orderBy.lastIndexOf(".")); + columnName = orderBy + .substring(orderBy.lastIndexOf(".") + 1); + } + + if (registeredOrderBy.indexOf(".") < 0) { + registeredColumnName = registeredOrderBy; + } else { + registeredAliasName = registeredOrderBy.substring(0, + registeredOrderBy.lastIndexOf(".")); + registeredColumnName = registeredOrderBy + .substring(registeredOrderBy.lastIndexOf(".") + 1); + } + + OrderByElement element = new OrderByElement(); + element.setAliasName(aliasName); + element.setColumnName(columnName); + element.setRegisteredAliasName(registeredAliasName); + element.setRegisteredColumnName(registeredColumnName); + if (ascOrDesc) { + element.setupAsc(); + } else { + element.setupDesc(); + } + _orderByClause.addOrderByElement(element); + + count++; + } + } catch (RuntimeException e) { + String msg = "registerOrderBy() threw the exception: orderByProperty=" + + orderByProperty; + msg = msg + " registeredColumnFullName=" + + registeredOrderByProperty; + msg = msg + " ascOrDesc=" + ascOrDesc; + msg = msg + " sqlClause=" + this.toString(); + throw new RuntimeException(msg, e); + } + } + + public void addNullsFirstToPreviousOrderBy() { + _orderByClause + .addNullsFirstToPreviousOrderByElement(createOrderByNullsSetupper()); + } + + public void addNullsLastToPreviousOrderBy() { + _orderByClause + .addNullsLastToPreviousOrderByElement(createOrderByNullsSetupper()); + } + + protected OrderByClause.OrderByNullsSetupper createOrderByNullsSetupper() {// As Default + return new OrderByClause.OrderByNullsSetupper() { + public String setup(String columnName, String orderByElementClause, + boolean nullsFirst) { + return orderByElementClause + " nulls " + + (nullsFirst ? "first" : "last"); + } + }; + } + + protected OrderByClause.OrderByNullsSetupper createOrderByNullsSetupperByCaseWhen() {// Helper For Nulls Unsupported Database + return new OrderByClause.OrderByNullsSetupper() { + public String setup(String columnName, String orderByElementClause, + boolean nullsFirst) { + final String thenNumber = nullsFirst ? "1" : "0"; + final String elseNumber = nullsFirst ? "0" : "1"; + final String caseWhen = "case when " + columnName + + " is not null then " + thenNumber + " else " + + elseNumber + " end asc"; + return caseWhen + ", " + orderByElementClause; + } + }; + } + + // =================================================================================== + // UnionQuery + // ========== + public void registerUnionQuery(String unionQueryClause, boolean unionAll) { + assertStringNotNullAndNotTrimmedEmpty("unionQueryClause", + unionQueryClause); + final UnionQueryInfo unionQueryInfo = new UnionQueryInfo(); + unionQueryInfo.setUnionQueryClause(unionQueryClause); + unionQueryInfo.setUnionAll(unionAll); + _unionQueryInfoList.add(unionQueryInfo); + } + + protected static class UnionQueryInfo { + protected String _unionQueryClause; + + protected boolean _unionAll; + + public String getUnionQueryClause() { + return _unionQueryClause; + } + + public void setUnionQueryClause(String unionQueryClause) { + _unionQueryClause = unionQueryClause; + } + + public boolean isUnionAll() { + return _unionAll; + } + + public void setUnionAll(boolean unionAll) { + _unionAll = unionAll; + } + } + + // =================================================================================== + // FetchScope + // ========== + /** + * @param fetchSize Fetch-size. (NotMinus & NotZero) + * @return this. (NotNull) + */ + public SqlClause fetchFirst(int fetchSize) { + _isFetchScopeEffective = true; + if (fetchSize <= 0) { + String msg = "Argument[fetchSize] should be plus: " + fetchSize; + throw new IllegalArgumentException(msg); + } + _fetchStartIndex = 0; + _fetchSize = fetchSize; + _fetchPageNumber = 1; + doClearFetchPageClause(); + doFetchFirst(); + return this; + } + + /** + * @param fetchStartIndex Fetch-start-index. 0 origin. (NotMinus) + * @param fetchSize Fetch size. (NotMinus) + * @return this. (NotNull) + */ + public SqlClause fetchScope(int fetchStartIndex, int fetchSize) { + _isFetchScopeEffective = true; + if (fetchStartIndex < 0) { + String msg = "Argument[fetchStartIndex] must be plus or zero: " + + fetchStartIndex; + throw new IllegalArgumentException(msg); + } + if (fetchSize <= 0) { + String msg = "Argument[fetchSize] should be plus: " + fetchSize; + throw new IllegalArgumentException(msg); + } + _fetchStartIndex = fetchStartIndex; + _fetchSize = fetchSize; + return fetchPage(1); + } + + /** + * @param fetchPageNumber Page-number. 1 origin. (NotMinus & NotZero: If minus or zero, set one.) + * @return this. (NotNull) + */ + public SqlClause fetchPage(int fetchPageNumber) { + _isFetchScopeEffective = true; + if (fetchPageNumber <= 0) { + fetchPageNumber = 1; + } + if (_fetchSize <= 0) { + String msg = "Look! Read the message below." + getLineSeparator(); + msg = msg + + "/* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * *" + + getLineSeparator(); + msg = msg + "Fetch size should not be minus or zero!" + + getLineSeparator(); + msg = msg + getLineSeparator(); + msg = msg + "[Advice]" + getLineSeparator(); + msg = msg + + "When you invoke this method, it is necessary to invoke 'fetchFirst()' or 'fetchScope()' ahead of that. " + + getLineSeparator(); + msg = msg + + "Please confirm your program. Does it really invoke 'fetchPage()' with 'fetchFirst()' or 'fetchScope()'?" + + getLineSeparator(); + msg = msg + " For example:" + getLineSeparator(); + msg = msg + " before (x):" + getLineSeparator(); + msg = msg + " XxxCB cb = new XxxCB();" + getLineSeparator(); + msg = msg + " cb.fetchPage(3);" + getLineSeparator(); + msg = msg + " after (o):" + getLineSeparator(); + msg = msg + " XxxCB cb = new XxxCB();" + getLineSeparator(); + msg = msg + " cb.fetchFirst(20); // The size of page" + + getLineSeparator(); + msg = msg + " cb.fetchPage(3); // The number of target page" + + getLineSeparator(); + msg = msg + getLineSeparator(); + msg = msg + "[Actual Parameter Value]" + getLineSeparator(); + msg = msg + "fetchSize=" + _fetchSize + getLineSeparator(); + msg = msg + "fetchPageNumber=" + fetchPageNumber + + getLineSeparator(); + msg = msg + "* * * * * * * * * */" + getLineSeparator(); + throw new IllegalStateException(msg); + } + _fetchPageNumber = fetchPageNumber; + if (_fetchPageNumber == 1 && _fetchStartIndex == 0) { + return fetchFirst(_fetchSize); + } + doClearFetchPageClause(); + doFetchPage(); + return this; + } + + abstract protected void doFetchFirst(); + + abstract protected void doFetchPage(); + + abstract protected void doClearFetchPageClause(); + + public int getFetchStartIndex() { + return _fetchStartIndex; + } + + public int getFetchSize() { + return _fetchSize; + } + + public int getFetchPageNumber() { + return _fetchPageNumber; + } + + /** + * @return Page start index. 0 origin. (NotMinus) + */ + public int getPageStartIndex() { + if (_fetchPageNumber <= 0) { + String msg = "_fetchPageNumber must be plus: " + _fetchPageNumber; + throw new IllegalStateException(msg); + } + return _fetchStartIndex + (_fetchSize * (_fetchPageNumber - 1)); + } + + /** + * @return Page end index. 0 origin. (NotMinus) + */ + public int getPageEndIndex() { + if (_fetchPageNumber <= 0) { + String msg = "_fetchPageNumber must be plus: " + _fetchPageNumber; + throw new IllegalStateException(msg); + } + return _fetchStartIndex + (_fetchSize * _fetchPageNumber); + } + + public boolean isFetchScopeEffective() { + return _isFetchScopeEffective; + } + + public SqlClause ignoreFetchScope() { + _isFetchScopeEffective = false; + doClearFetchPageClause(); + return this; + } + + public SqlClause makeFetchScopeEffective() { + if (getFetchSize() > 0 && getFetchPageNumber() > 0) { + fetchPage(getFetchPageNumber()); + } + return this; + } + + public boolean isFetchStartIndexSupported() { + return true; // Default + } + + public boolean isFetchSizeSupported() { + return true; // Default + } + + abstract protected String createSelectHint(); + + abstract protected String createFromBaseTableHint(); + + abstract protected String createFromHint(); + + abstract protected String createSqlSuffix(); + + // =================================================================================== + // Fetch Narrowing + // =============== + /** + * The implementation. + * + * @return Fetch-narrowing start-index. + */ + public int getFetchNarrowingSkipStartIndex() { + return getPageStartIndex(); + } + + /** + * The implementation. + * + * @return Fetch-narrowing size. + */ + public int getFetchNarrowingLoopCount() { + return getFetchSize(); + } + + /** + * The implementation. + * + * @return Determiantion. + */ + public boolean isFetchNarrowingEffective() { + return _isFetchScopeEffective; + } + + // =================================================================================== + // Resolver + // ======== + public String resolveJoinAliasName(String relationPath, int cqNestNo) { + return resolveNestLevelExpression("dfrelation" + relationPath, cqNestNo); + } + + public String resolveNestLevelExpression(String name, int cqNestNo) { + // if (cqNestNo > 1) { + // return name + "_n" + cqNestNo; + // } else { + // return name; + // } + return name; + } + + public int resolveRelationNo(String localTableName, + String foreignPropertyName) { + final DBMeta dbmeta = DBMetaInstanceHandler.findDBMeta(localTableName); + final ForeignInfo foreignInfo = dbmeta + .findForeignInfo(foreignPropertyName); + return foreignInfo.getRelationNo(); + } + + // =================================================================================== + // Table Alias Info + // ================ + public String getLocalTableAliasName() { + return "dflocal"; + } + + public String getForeignTableAliasPrefix() { + return "dfrelation"; + } + + // =================================================================================== + // Template Mark + // ============= + public String getWhereClauseMark() { + return "#df:whereClause#"; + } + + public String getWhereFirstConditionMark() { + return "#df:whereFirstCondition#"; + } + + public String getUnionSelectClauseMark() { + return "#df:unionSelectClause#"; + } + + public String getUnionWhereClauseMark() { + return "#df:unionWhereClause#"; + } + + public String getUnionWhereFirstConditionMark() { + return "#df:unionWhereFirstCondition#"; + } + + // ===================================================================================== + // Where Clause Simple Filter + // ========================== + public void addWhereClauseSimpleFilter( + WhereClauseSimpleFilter whereClauseSimpleFilter) { + if (_whereClauseSimpleFilterList == null) { + _whereClauseSimpleFilterList = new ArrayList(); + } + _whereClauseSimpleFilterList.add(whereClauseSimpleFilter); + } + + protected String filterWhereClauseSimply(String clauseElement) { + if (_whereClauseSimpleFilterList == null + || _whereClauseSimpleFilterList.isEmpty()) { + return clauseElement; + } + for (final Iterator ite = _whereClauseSimpleFilterList + .iterator(); ite.hasNext();) { + final WhereClauseSimpleFilter filter = ite.next(); + if (filter == null) { + String msg = "The list of filter should not have null: _whereClauseSimpleFilterList=" + + _whereClauseSimpleFilterList; + throw new IllegalStateException(msg); + } + clauseElement = filter.filterClauseElement(clauseElement); + } + return clauseElement; + } + + // ===================================================================================== + // Selected Foreign Info + // ===================== + public boolean hasSelectedForeignInfo(String relationPath) { + if (_selectedForeignInfo == null) { + return false; + } + return _selectedForeignInfo.containsKey(relationPath); + } + + public void registerSelectedForeignInfo(String relationPath, + String foreignPropertyName) { + if (_selectedForeignInfo == null) { + _selectedForeignInfo = new HashMap(); + } + _selectedForeignInfo.put(relationPath, foreignPropertyName); + } + + // =================================================================================== + // Format Clause + // ============= + public boolean isFormatClauseEffective() { + return _formatClause; + } + + public void makeFormatClauseEffective() { + _formatClause = true; + } + + // =================================================================================== + // Helper + // ====== + protected final String replaceString(String text, String fromText, + String toText) { + return SimpleStringUtil.replace(text, fromText, toText); + } + + protected String getLineSeparator() { + return SimpleSystemUtil.getLineSeparator(); + } + + // ----------------------------------------------------- + // Assert Object + // ------------- + protected void assertObjectNotNull(String variableName, Object value) { + SimpleAssertUtil.assertObjectNotNull(variableName, value); + } + + // ----------------------------------------------------- + // Assert String + // ------------- + protected void assertStringNotNullAndNotTrimmedEmpty(String variableName, + String value) { + SimpleAssertUtil.assertStringNotNullAndNotTrimmedEmpty(variableName, + value); + } +} Property changes on: announcement/trunk/src/main/java/jp/sf/pal/announcement/db/allcommon/cbean/sqlclause/AbstractSqlClause.java ___________________________________________________________________ Name: svn:eol-style + native Added: announcement/trunk/src/main/java/jp/sf/pal/announcement/db/allcommon/cbean/sqlclause/OrderByClause.java =================================================================== --- announcement/trunk/src/main/java/jp/sf/pal/announcement/db/allcommon/cbean/sqlclause/OrderByClause.java (rev 0) +++ announcement/trunk/src/main/java/jp/sf/pal/announcement/db/allcommon/cbean/sqlclause/OrderByClause.java 2008-06-30 02:54:27 UTC (rev 1002) @@ -0,0 +1,265 @@ +package jp.sf.pal.announcement.db.allcommon.cbean.sqlclause; + +import java.util.ArrayList; +import java.util.Iterator; +import java.util.List; +import java.util.Map; +import java.util.StringTokenizer; + +/** + * @author DBFlute(AutoGenerator) + */ +public class OrderByClause implements java.io.Serializable { + + /** Serial version UID. (Default) */ + private static final long serialVersionUID = 1L; + + // ===================================================================================== + // Attribute + // ========= + protected List _orderByList = new ArrayList(); + + // ===================================================================================== + // Constructor + // =========== + /** + * Constructor. + */ + public OrderByClause() { + } + + // ===================================================================================== + // Behavior + // ======== + /** + * Add order-by element. + * @param orderByElement Order-by element. (NotNull) + */ + public void addOrderByElement(OrderByElement orderByElement) { + _orderByList.add(orderByElement); + } + + /** + * Insert first order-by element . + * @param orderByElement Order-by element. (NotNull) + */ + public void insertFirstOrderByElement(OrderByElement orderByElement) { + _orderByList.add(0, orderByElement); + } + + public void reverseAll() { + for (Iterator ite = _orderByList.iterator(); ite + .hasNext();) { + ite.next().reverse(); + } + } + + public void exchangeFirstOrderByElementForLastOne() { + if (_orderByList.size() > 1) { + final OrderByElement first = _orderByList.get(0); + final OrderByElement last = _orderByList + .get(_orderByList.size() - 1); + _orderByList.set(0, last); + _orderByList.set(_orderByList.size() - 1, first); + } + } + + public void addNullsFirstToPreviousOrderByElement( + OrderByNullsSetupper filter) { + if (_orderByList.isEmpty()) { + return; + } + final OrderByElement last = _orderByList.get(_orderByList.size() - 1); + last.setOrderByNullsSetupper(filter, true); + } + + public void addNullsLastToPreviousOrderByElement(OrderByNullsSetupper filter) { + if (_orderByList.isEmpty()) { + return; + } + final OrderByElement last = _orderByList.get(_orderByList.size() - 1); + last.setOrderByNullsSetupper(filter, false); + } + + public static interface OrderByNullsSetupper { + public String setup(String columnName, String orderByElementClause, + boolean nullsFirst); + } + + public List getOrderByList() { + return _orderByList; + } + + public String getOrderByClause() { + return getOrderByClause(null); + } + + public String getOrderByClause( + Map selectClauseRealColumnAliasMap) { + if (_orderByList.isEmpty()) { + return ""; + } + final StringBuffer sb = new StringBuffer(); + final String delimiter = ", "; + for (final Iterator ite = _orderByList.iterator(); ite + .hasNext();) { + final OrderByElement element = ite.next(); + sb.append(delimiter); + if (selectClauseRealColumnAliasMap != null) { + sb.append(element + .getElementClause(selectClauseRealColumnAliasMap)); + } else { + sb.append(element.getElementClause()); + } + } + sb.delete(0, delimiter.length()).insert(0, "order by "); + return sb.toString(); + } + + public boolean isSameOrderByColumn(String orderByProperty) { + final List orderByList = new ArrayList(); + { + final StringTokenizer st = new StringTokenizer(orderByProperty, "/"); + while (st.hasMoreElements()) { + orderByList.add(st.nextToken()); + } + } + if (_orderByList.size() != orderByList.size()) { + return false; + } + int count = 0; + for (final Iterator ite = orderByList.iterator(); ite.hasNext();) { + final String columnFullName = ite.next(); + final OrderByElement element = (OrderByElement) _orderByList + .get(count); + if (!element.getColumnFullName().equals(columnFullName)) { + return false; + } + count++; + } + return true; + } + + // ===================================================================================== + // First Element + // ============= + public boolean isFirstElementAsc() { + if (isEmpty()) { + String msg = "This order-by clause is empty: " + toString(); + throw new IllegalStateException(msg); + } + final OrderByElement element = (OrderByElement) _orderByList.get(0); + return element.isAsc(); + } + + public boolean isFirstElementDesc() { + return !isFirstElementAsc(); + } + + public boolean isSameAsFirstElementAliasName(String expectedAliasName) { + if (isEmpty()) { + String msg = "This order-by clause is empty: " + toString(); + throw new RuntimeException(msg); + } + OrderByElement element = (OrderByElement) _orderByList.get(0); + String actualAliasName = element.getAliasName(); + if (actualAliasName != null && expectedAliasName != null) { + return actualAliasName.equalsIgnoreCase(expectedAliasName); + } else { + return false; + } + } + + /** + * @param expectedColumnName Expected column-name. (Nullable) + * @return Determination. + */ + public boolean isSameAsFirstElementColumnName(String expectedColumnName) { + if (isEmpty()) { + String msg = "This order-by clause is empty: " + toString(); + throw new RuntimeException(msg); + } + OrderByElement element = (OrderByElement) _orderByList.get(0); + String actualColumnName = element.getColumnName(); + if (actualColumnName != null && expectedColumnName != null) { + return actualColumnName.equalsIgnoreCase(expectedColumnName); + } else { + return false; + } + } + + /** + * @param expectedAliasName Expected alias-name. (Nullable) + * @return Determination. + */ + public boolean isSameAsFirstElementRegisteredAliasName( + String expectedAliasName) { + if (isEmpty()) { + String msg = "This order-by clause is empty: " + toString(); + throw new RuntimeException(msg); + } + OrderByElement element = (OrderByElement) _orderByList.get(0); + String actualAliasName = element.getRegisteredAliasName(); + if (actualAliasName != null && expectedAliasName != null) { + return actualAliasName.equalsIgnoreCase(expectedAliasName); + } else { + return false; + } + } + + /** + * @param expectedColumnName Expected column-name. (Nullable) + * @return Determination. + */ + public boolean isSameAsFirstElementRegisteredColumnName( + String expectedColumnName) { + if (isEmpty()) { + String msg = "This order-by clause is empty: " + toString(); + throw new RuntimeException(msg); + } + OrderByElement element = (OrderByElement) _orderByList.get(0); + String actualColumnName = element.getRegisteredColumnName(); + if (actualColumnName != null && expectedColumnName != null) { + return actualColumnName.equalsIgnoreCase(expectedColumnName); + } else { + return false; + } + } + + // ===================================================================================== + // Delegate of List + // ================ + /** + * Is empty? + * @return Determination. + */ + public boolean isEmpty() { + return _orderByList.isEmpty(); + } + + /** + * Get iterator of order-by list. + * @return Determination. + */ + public java.util.Iterator iterator() { + return _orderByList.iterator(); + } + + /** + * Clear order-by list. + */ + public void clear() { + _orderByList.clear(); + } + + // ===================================================================================== + // Basic-Override Method + // ===================== + /** + * This method overrides the method that is declared at super. + * @return View-string of all-columns value. + */ + public String toString() { + return _orderByList.toString(); + } +} Property changes on: announcement/trunk/src/main/java/jp/sf/pal/announcement/db/allcommon/cbean/sqlclause/OrderByClause.java ___________________________________________________________________ Name: svn:eol-style + native Added: announcement/trunk/src/main/java/jp/sf/pal/announcement/db/allcommon/cbean/sqlclause/OrderByElement.java =================================================================== --- announcement/trunk/src/main/java/jp/sf/pal/announcement/db/allcommon/cbean/sqlclause/OrderByElement.java (rev 0) +++ announcement/trunk/src/main/java/jp/sf/pal/announcement/db/allcommon/cbean/sqlclause/OrderByElement.java 2008-06-30 02:54:27 UTC (rev 1002) @@ -0,0 +1,263 @@ +package jp.sf.pal.announcement.db.allcommon.cbean.sqlclause; + +import java.util.Map; + +import jp.sf.pal.announcement.db.allcommon.util.SimpleSystemUtil; + +/** + * @author DBFlute(AutoGenerator) + */ +public class OrderByElement implements java.io.Serializable { + + /** Serial version UID. (Default) */ + private static final long serialVersionUID = 1L; + + // ===================================================================================== + // Attribute + // ========= + /** The value of alias name. */ + protected String _aliasName; + + /** The value of column name. */ + protected String _columnName; + + /** The value of registered alias name. */ + protected String _registeredAliasName; + + /** The value of registered column name. */ + protected String _registeredColumnName; + + /** The value of ascDesc. */ + protected String _ascDesc = "asc"; + + /** The setupper of order-by nulls. */ + protected OrderByClause.OrderByNullsSetupper _orderByNullsSetupper; + + /** Is nulls ordered first? */ + protected boolean _nullsFirst; + + // ===================================================================================== + // Accessor + // ======== + public String getAliasName() { + return _aliasName; + } + + public String getColumnName() { + return _columnName; + } + + public String getRegisteredAliasName() { + return _registeredAliasName; + } + + public String getRegisteredColumnName() { + return _registeredColumnName; + } + + public String getAscDesc() { + return _ascDesc; + } + + public void setAliasName(String value) { + _aliasName = value; + } + + public void setColumnName(String value) { + _columnName = value; + } + + public void setRegisteredAliasName(String value) { + _registeredAliasName = value; + } + + public void setRegisteredColumnName(String value) { + _registeredColumnName = value; + } + + public void setAscDesc(String value) { + _ascDesc = value; + } + + public void setOrderByNullsSetupper( + OrderByClause.OrderByNullsSetupper value, boolean nullsFirst) { + _orderByNullsSetupper = value; + _nullsFirst = nullsFirst; + } + + // ===================================================================================== + // Behavior + // ======== + public void setupAsc() { + _ascDesc = "asc"; + } + + public void setupDesc() { + _ascDesc = "desc"; + } + + public void reverse() { + if (_ascDesc == null) { + String msg = "The attribute[ascDesc] should not be null."; + throw new IllegalStateException(msg); + } + if (_ascDesc.equals("asc")) { + _ascDesc = "desc"; + } else if (_ascDesc.equals("desc")) { + _ascDesc = "asc"; + } else { + String msg = "The attribute[ascDesc] should be asc or desc: but ascDesc=" + + _ascDesc; + throw new IllegalStateException(msg); + } + } + + public boolean isAsc() { + if (_ascDesc == null) { + String msg = "The attribute[ascDesc] should not be null."; + throw new IllegalStateException(msg); + } + if (_ascDesc.equals("asc")) { + return true; + } else if (_ascDesc.equals("desc")) { + return false; + } else { + String msg = "The attribute[ascDesc] should be asc or desc: but ascDesc=" + + _ascDesc; + throw new IllegalStateException(msg); + } + } + + public String getColumnFullName() { + final StringBuilder sb = new StringBuilder(); + if (_aliasName != null) { + sb.append(_aliasName).append("."); + } + if (_columnName == null) { + String msg = "The attribute[columnName] should not be null."; + throw new IllegalStateException(msg); + } + sb.append(_columnName); + return sb.toString(); + } + + public String getElementClause() { + if (_ascDesc == null) { + String msg = "The attribute[ascDesc] should not be null."; + throw new IllegalStateException(msg); + } + final StringBuilder sb = new StringBuilder(); + sb.append(getColumnFullName()).append(" ").append(_ascDesc); + if (_orderByNullsSetupper != null) { + return _orderByNullsSetupper.setup(getColumnFullName(), sb + .toString(), _nullsFirst); + } else { + return sb.toString(); + } + } + + public String getElementClause( + Map selectClauseRealColumnAliasMap) { + if (selectClauseRealColumnAliasMap == null) { + String msg = "The argument[selectClauseRealColumnAliasMap] should not be null."; + throw new IllegalArgumentException(msg); + } + if (_ascDesc == null) { + String msg = "The attribute[ascDesc] should not be null."; + throw new IllegalStateException(msg); + } + final StringBuilder sb = new StringBuilder(); + final String columnAlias = selectClauseRealColumnAliasMap + .get(getColumnFullName()); + if (columnAlias == null || columnAlias.trim().length() == 0) { + throwOrderByColumnNotFoundException(getColumnFullName(), + selectClauseRealColumnAliasMap); + } + sb.append(columnAlias).append(" ").append(_ascDesc); + if (_orderByNullsSetupper != null) { + return _orderByNullsSetupper.setup(columnAlias, sb.toString(), + _nullsFirst); + } else { + return sb.toString(); + } + } + + protected void throwOrderByColumnNotFoundException(String columnName, + Map selectClauseRealColumnAliasMap) { + String msg = "Look! Read the message below." + getLineSeparator(); + msg = msg + + "/* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * *" + + getLineSeparator(); + msg = msg + "The column for order-by was Not Found in select-clause!" + + getLineSeparator(); + msg = msg + getLineSeparator(); + msg = msg + "[Advice]" + getLineSeparator(); + msg = msg + + "If you use 'union()' or 'unionAll()', Check your condition-bean!" + + getLineSeparator(); + msg = msg + "Order-by for union can use only columns on select-clause." + + getLineSeparator(); + msg = msg + + "So the rule when using union is little difference from the one when NOT using." + + getLineSeparator(); + msg = msg + " For example:" + getLineSeparator(); + msg = msg + " [before (x)]" + getLineSeparator(); + msg = msg + " AaaCB cb = new AaaCB();" + getLineSeparator(); + msg = msg + " cb.query().setXxx...();" + getLineSeparator(); + msg = msg + " {" + getLineSeparator(); + msg = msg + " AaaCB unionCB = new AaaCB();" + getLineSeparator(); + msg = msg + " unionCB.query().setXxx...();" + getLineSeparator(); + msg = msg + " cb.union(unionCB.query());" + getLineSeparator(); + msg = msg + " }" + getLineSeparator(); + msg = msg + + " cb.query().queryBbb().addOrderBy_BbbName_Asc();// *NG!" + + getLineSeparator(); + msg = msg + " " + getLineSeparator(); + msg = msg + " [after (o)]" + getLineSeparator(); + msg = msg + " AaaCB cb = new AaaCB();" + getLineSeparator(); + msg = msg + " cb.setupSelect_Bbb();// *Point!" + getLineSeparator(); + msg = msg + " cb.query().setXxx...();" + getLineSeparator(); + msg = msg + " {" + getLineSeparator(); + msg = msg + " AaaCB unionCB = new AaaCB();" + getLineSeparator(); + msg = msg + " unionCB.query().setXxx...();" + getLineSeparator(); + msg = msg + " cb.union(unionCB.query());" + getLineSeparator(); + msg = msg + " }" + getLineSeparator(); + msg = msg + + " cb.query().queryBbb().addOrderBy_BbbName_Asc();// *OK!" + + getLineSeparator(); + msg = msg + " " + getLineSeparator(); + msg = msg + + "Or else if you DON'T use 'union()' or 'unionAll()', This is the Framework Exception!" + + getLineSeparator(); + msg = msg + getLineSeparator(); + msg = msg + "[Target Column]" + getLineSeparator(); + msg = msg + columnName + getLineSeparator(); + msg = msg + getLineSeparator(); + msg = msg + "[Internal Object]" + getLineSeparator(); + msg = msg + "selectClauseRealColumnAliasMap=" + + selectClauseRealColumnAliasMap + getLineSeparator(); + msg = msg + "* * * * * * * * * */" + getLineSeparator(); + throw new IllegalStateException(msg); + } + + protected String getLineSeparator() { + return SimpleSystemUtil.getLineSeparator(); + } + + // ===================================================================================== + // Basic Override + // ============== + /** + * This method overrides the method that is declared at super. + * @return View-string of all-columns value. + */ + public String toString() { + final StringBuilder sb = new StringBuilder(); + sb.append("[OrderByElement] aliasName=").append(_aliasName); + sb.append(" columnName=").append(_columnName); + sb.append(" registeredAliasName=").append(_registeredAliasName); + sb.append(" registeredColumnName=").append(_registeredColumnName); + sb.append(" ascDesc=").append(_ascDesc); + return sb.toString(); + } +} Property changes on: announcement/trunk/src/main/java/jp/sf/pal/announcement/db/allcommon/cbean/sqlclause/OrderByElement.java ___________________________________________________________________ Name: svn:eol-style + native Added: announcement/trunk/src/main/java/jp/sf/pal/announcement/db/allcommon/cbean/sqlclause/SqlClause.java =================================================================== --- announcement/trunk/src/main/java/jp/sf/pal/announcement/db/allcommon/cbean/sqlclause/SqlClause.java (rev 0) +++ announcement/trunk/src/main/java/jp/sf/pal/announcement/db/allcommon/cbean/sqlclause/SqlClause.java 2008-06-30 02:54:27 UTC (rev 1002) @@ -0,0 +1,475 @@ +package jp.sf.pal.announcement.db.allcommon.cbean.sqlclause; + +import java.util.Map; + +import jp.sf.pal.announcement.db.allcommon.cbean.ckey.ConditionKey; +import jp.sf.pal.announcement.db.allcommon.cbean.coption.ConditionOption; +import jp.sf.pal.announcement.db.allcommon.cbean.cvalue.ConditionValue; + +/** + * The interface of SQL-clause. + * + * @author DBFlute(AutoGenerator) + */ +public interface SqlClause { + + // ===================================================================================== + // Clause + // ====== + /** + * Get the clause of all parts. + *
    +     * # select [base-table-columns], [join-table-columns]
    +     * #   from [base-table] left outer join [join-table] [join-alias] on [join-condition]
    +     * #  where [base-table].[column] = [value] and [join-alias].[column] is null
    +     * #  order by [base-table].[column] asc, [join-alias].[column] desc
    +     * #  for update
    +     * 
    + * @return The clause of all parts. (NotNull) + */ + public String getClause(); + + /** + * Get clause of all parts as PK-only. + *
    +     * # select [base-table-columns], [join-table-columns]
    +     * #   from [base-table] left outer join [join-table] [join-alias] on [join-condition]
    +     * #  where [base-table].[column] = [value] and [join-alias].[column] is null
    +     * #  order by [base-table].[column] asc, [join-alias].[column] desc
    +     * #  for update
    +     * 
    + * @return The clause of all parts as PK-Only. (NotNull) + */ + public String getClausePKOnly(); + + /** + * Get from-where clause without select and orderBy and sqlSuffix. + * For subQuery and selectCount. + *

    + * You should handle UnionSelectClauseMark and UnionWhereClauseMark and UnionWhereFirstConditionMark in clause. + *

    + * @return The 'from-where' clause(contains union) without 'select' and 'orderBy' and 'sqlSuffix'. (NotNull) + */ + public String getClauseFromWhereWithUnionTemplate(); + + /** + * Get from-where clause without select and orderBy and sqlSuffix as template. + * For subQuery and selectCount. + *

    + * You should handle UnionSelectClauseMark and UnionWhereClauseMark and UnionWhereFirstConditionMark + * and WhereClauseMark and WhereFirstConditionMark in clause. + *

    + * @return The 'from-where' clause(contains union) without 'select' and 'orderBy' and 'sqlSuffix'. (NotNull) + */ + public String getClauseFromWhereWithWhereUnionTemplate(); + + // ===================================================================================== + // Clause Parts + // ============ + /** + * Get the clause of 'select'. This is an internal method. + * @return The clause of select. {[select ...] from table...} (NotNull) + */ + public String getSelectClause(); + + /** + * Get The clause of 'select' as PK-only. This is an internal method. + * @return The clause of select PK-only. {[select ...] from table...} (NotNull) + */ + public String getSelectClausePKOnly(); + + /** + * Get the hint of 'select'. This is an internal method. + * @return The hint of 'select'. {select [select-hint] * from table...} (NotNull) + */ + public String getSelectHint(); + + /** + * Get the clause of included-select-column. This is an internal method. + * @return The clause of included-select-column. {select ... , [included-select-column clause] from table...} (NotNull) + */ + public String getIncludedSelectColumnClause(); + + /** + * Get the clause of 'from'. This is an internal method. + * @return The clause of 'from'. (NotNull) + */ + public String getFromClause(); + + /** + * Get the clause of from-base-table. This is an internal method. + * @return The hint of from-base-table. {select * from table [from-base-table-hint] where ...} (NotNull) + */ + public String getFromBaseTableHint(); + + /** + * Get the hint of 'from'. This is an internal method. + * @return The hint of 'from'. {select * from table left outer join ... on ... [from-hint] where ...} (NotNull) + */ + public String getFromHint(); + + /** + * Get the clause of 'where'. This is an internal method. + * @return The clause of 'where'. (NotNull) + */ + public String getWhereClause(); + + /** + * Get the clause of 'order-by'. This is an internal method. + * @return The clause of 'order-by'. (NotNull) + */ + public String getOrderByClause(); + + /** + * Get the suffix of SQL. This is an internal method. + * @return The suffix of SQL. {select * from table where ... order by ... [sql-suffix]} (NotNull) + */ + public String getSqlSuffix(); + + // =================================================================================== + // Copy Parts + // ========== + /** + * Copy included-select-column. + * @param sqlClause SQL-clause. (NotNull) + */ + public void copyIncludedSelectColumn(SqlClause sqlClause); + + // =================================================================================== + // SelectedSelectColumn + // ==================== + /** + * Register selected-select-column. + * @param foreignTableAliasName The alias name of foreign table. (NotNull) + * @param localTableName The table name of local. (NotNull) + * @param foreignPropertyName The property name of foreign table. (NotNull) + * @param localRelationPath The path of local relation. (Nullable) + */ + public void registerSelectedSelectColumn(String foreignTableAliasName, + String localTableName, String foreignPropertyName, + String localRelationPath); + + // =================================================================================== + // IncludedSelectColumn + // ==================== + /** + * Ignore included-select-column. + */ + public void ignoreIncludedSelectColumn(); + + /** + * Make included-select-column effective. + */ + public void makeIncludedSelectColumnEffective(); + + /** + * Register included-select-column. + * @param aliasName The alias name of the included-select-column. (NotNull) + * @param realColumnName The real column name of the included-select-column. (NotNull) + */ + public void registerIncludedSelectColumn(String aliasName, + String realColumnName); + + // =================================================================================== + // OuterJoin + // ========= + /** + * Register outer-join. + * @param joinTableName The name of join table. {left outer join [joinTableName]} (NotNull) + * @param aliasName The alias name of join table. {left outer join joinTableName [aliasName]} (NotNull and Unique per invoking method) + * @param joinOnMap Map that has conditions of on-clause. (NotNull) + */ + public void registerOuterJoin(String joinTableName, String aliasName, + Map joinOnMap); + + // =================================================================================== + // Where + // ===== + /** + * Register 'where' clause. + * @param columnFullName The full name of column. {[table-name].[column-name]}. (NotNull) + * @param key Condition-key. (NotNull) + * @param value Condition-value. (NotNull) + */ + public void registerWhereClause(String columnFullName, ConditionKey key, + ConditionValue value); + + /** + * Register 'where' clause. + * @param columnFullName The full name of column. {[table-name].[column-name]}. (NotNull) + * @param key Condition-key. (NotNull) + * @param value Condition-value. (NotNull) + * @param option Condition-option. (NotNull) + */ + public void registerWhereClause(String columnFullName, ConditionKey key, + ConditionValue value, ConditionOption option); + + /** + * Register 'where' clause. + * @param clause The clause of 'where'. (NotNull) + */ + public void registerWhereClause(String clause); + + /** + * Exchange first The clause of 'where' for last one. + */ + public void exchangeFirstWhereClauseForLastOne(); + + // =================================================================================== + // InlineWhere + // =========== + public void registerBaseTableInlineWhereClause(String columnName, + ConditionKey key, ConditionValue value); + + public void registerBaseTableInlineWhereClause(String columnName, + ConditionKey key, ConditionValue value, ConditionOption option); + + public void registerBaseTableInlineWhereClause(String value); + + public void registerOuterJoinInlineWhereClause(String aliasName, + String columnName, ConditionKey key, ConditionValue value, + boolean onClauseInline); + + public void registerOuterJoinInlineWhereClause(String aliasName, + String columnName, ConditionKey key, ConditionValue value, + ConditionOption option, boolean onClauseInline); + + public void registerOuterJoinInlineWhereClause(String aliasName, + String value, boolean onClauseInline); + + // =================================================================================== + // AdditionalConditionAsOr + // ======================= + public void makeAdditionalConditionAsOrEffective(); + + public void ignoreAdditionalConditionAsOr(); + + // =================================================================================== + // OrderBy + // ======= + public OrderByClause getSqlComponentOfOrderByClause(); + + public SqlClause clearOrderBy(); + + public SqlClause ignoreOrderBy(); + + public SqlClause makeOrderByEffective(); + + /** + * @param orderByProperty Order-by-property. 'aliasName.columnName/aliasName.columnName/...' (NotNull) + * @param registeredOrderByProperty Registered-order-by-property. ([table-name].[column-name]) (Nullable) + * @param ascOrDesc Is it ascend or descend? + */ + public void registerOrderBy(String orderByProperty, + String registeredOrderByProperty, boolean ascOrDesc); + + /** + * @param orderByProperty Order-by-property. 'aliasName.columnName/aliasName.columnName/...' (NotNull) + * @param registeredOrderByProperty Registered-order-by-property. ([table-name].[column-name]) (Nullable) + * @param ascOrDesc Is it ascend or descend? + */ + public void reverseOrderBy_Or_OverrideOrderBy(String orderByProperty, + String registeredOrderByProperty, boolean ascOrDesc); + + public void addNullsFirstToPreviousOrderBy(); + + public void addNullsLastToPreviousOrderBy(); + + // =================================================================================== + // Union + // ===== + public void registerUnionQuery(String unionClause, boolean unionAll); + + // =================================================================================== + // FetchScope + // ========== + /** + * Fetch first. + * @param fetchSize Fetch-size. (NotMinus) + * @return this. (NotNull) + */ + public SqlClause fetchFirst(int fetchSize); + + /** + * Fetch scope. + * @param fetchStartIndex Fetch-start-index. 0 origin. (NotMinus) + * @param fetchSize Fetch-size. (NotMinus) + * @return this. (NotNull) + */ + public SqlClause fetchScope(int fetchStartIndex, int fetchSize); + + /** + * Fetch page. + *

    + * When you invoke this, it is normally necessary to invoke 'fetchFirst()' or 'fetchScope()' ahead of that. + * But you also can use default-fetch-size without invoking 'fetchFirst()' or 'fetchScope()'. + * If you invoke this, your SQL returns [fetch-size] records from [fetch-start-index] calculated by [fetch-page-number]. + *

    + * @param fetchPageNumber Fetch-page-number. 1 origin. (NotMinus & NotZero: If minus or zero, set one.) + * @return this. (NotNull) + */ + public SqlClause fetchPage(int fetchPageNumber); + + /** + * Get fetch start index. + * @return Fetch start index. + */ + public int getFetchStartIndex(); + + /** + * Get fetch size. + * @return Fetch size. + */ + public int getFetchSize(); + + /** + * Get fetch page number. + * @return Fetch page number. + */ + public int getFetchPageNumber(); + + /** + * Get page start index. + * @return Page start index. 0 origin. (NotMinus) + */ + public int getPageStartIndex(); + + /** + * Get page end index. + * @return Page end index. 0 origin. (NotMinus) + */ + public int getPageEndIndex(); + + /** + * Is fetch scope effective? + * @return Determiantion. + */ + public boolean isFetchScopeEffective(); + + /** + * Ignore fetch-scope. + * @return this. (NotNull) + */ + public SqlClause ignoreFetchScope(); + + /** + * Make fetch-scope effective. + * @return this. (NotNull) + */ + public SqlClause makeFetchScopeEffective(); + + /** + * Is fetch start index supported? + * @return Determination. + */ + public boolean isFetchStartIndexSupported(); + + /** + * Is fetch size supported? + * @return Determination. + */ + public boolean isFetchSizeSupported(); + + // =================================================================================== + // Fetch Narrowing + // =============== + /** + * Is fetch-narrowing effective? + * @return Determiantion. + */ + public boolean isFetchNarrowingEffective(); + + /** + * Get fetch-narrowing skip-start-index. + * @return Skip-start-index. + */ + public int getFetchNarrowingSkipStartIndex(); + + /** + * Get fetch-narrowing loop-count. + * @return Loop-count. + */ + public int getFetchNarrowingLoopCount(); + + // =================================================================================== + // Lock + // ==== + /** + * Lock for update. + *

    + * If you invoke this, your SQL lock target records for update. + * It depends whether this method supports this on the database type. + *

    + * @return this. (NotNull) + */ + public SqlClause lockForUpdate(); + + // =================================================================================== + // Resolver + // ======== + /** + * Resolve join alias name. + * @param relationPath Relation path. (NotNull) + * @param cqNestNo The nest no of condition query. + * @return Resolved join alias name. (NotNull) + */ + public String resolveJoinAliasName(String relationPath, int cqNestNo); + + /** + * Resolve nest level expression. + * @param name Name. (NotNull) + * @param cqNestNo The nest no of condition query. + * @return Resolved name about nest level. (NotNull) + */ + public String resolveNestLevelExpression(String name, int cqNestNo); + + /** + * Resolve relation no. + * @param baseTableName The table name of base. (NotNull) + * @param foreignPropertyName The property name of foreign. (NotNull) + * @return Resolved relation no. + */ + public int resolveRelationNo(String baseTableName, + String foreignPropertyName); + + // =================================================================================== + // Table Alias Info + // ================ + public String getLocalTableAliasName(); + + public String getForeignTableAliasPrefix(); + + // =================================================================================== + // Template Mark + // ============= + public String getWhereClauseMark(); + + public String getWhereFirstConditionMark(); + + public String getUnionSelectClauseMark(); + + public String getUnionWhereClauseMark(); + + public String getUnionWhereFirstConditionMark(); + + // ===================================================================================== + // Where Clause Simple Filter + // ========================== + public void addWhereClauseSimpleFilter( + WhereClauseSimpleFilter whereClauseSimpleFilter); + + // ===================================================================================== + // Selected Foreign Info + // ===================== + public boolean hasSelectedForeignInfo(String relationPath); + + public void registerSelectedForeignInfo(String relationPath, + String foreignPropertyName); + + // =================================================================================== + // Format Clause + // ============= + public boolean isFormatClauseEffective(); + + public void makeFormatClauseEffective(); +} Property changes on: announcement/trunk/src/main/java/jp/sf/pal/announcement/db/allcommon/cbean/sqlclause/SqlClause.java ___________________________________________________________________ Name: svn:eol-style + native Added: announcement/trunk/src/main/java/jp/sf/pal/announcement/db/allcommon/cbean/sqlclause/SqlClauseDb2.java =================================================================== --- announcement/trunk/src/main/java/jp/sf/pal/announcement/db/allcommon/cbean/sqlclause/SqlClauseDb2.java (rev 0) +++ announcement/trunk/src/main/java/jp/sf/pal/announcement/db/allcommon/cbean/sqlclause/SqlClauseDb2.java 2008-06-30 02:54:27 UTC (rev 1002) @@ -0,0 +1,126 @@ +package jp.sf.pal.announcement.db.allcommon.cbean.sqlclause; + +/** + * SqlClause for DB2. + * @author DBFlute(AutoGenerator) + */ +public class SqlClauseDb2 extends AbstractSqlClause { + + // =================================================================================== + // Attribute + // ========= + /** String of fetch-first as sql-suffix. */ + protected String _fetchFirstSqlSuffix = ""; + + /** String of lock as from-hint. */ + protected String _lockSqlSuffix = ""; + + // =================================================================================== + // Constructor + // =========== + /** + * Constructor. + * @param tableName Table name. (NotNull) + **/ + public SqlClauseDb2(String tableName) { + super(tableName); + } + + // =================================================================================== + // OrderBy Override + // ================ + @Override + protected OrderByClause.OrderByNullsSetupper createOrderByNullsSetupper() { + return createOrderByNullsSetupperByCaseWhen(); + } + + // =================================================================================== + // FetchScope Override + // =================== + /** + * The implementation. + */ + protected void doFetchFirst() { + if (isFetchSizeSupported()) { + _fetchFirstSqlSuffix = " fetch first " + getFetchSize() + + " rows only"; + } + } + + /** + * The implementation. {Unsupported!} + */ + protected void doFetchPage() { + if (isFetchSizeSupported()) { + if (isFetchStartIndexSupported()) { + _fetchFirstSqlSuffix = " fetch first " + getFetchSize() + + " rows only"; + } else { + _fetchFirstSqlSuffix = " fetch first " + getPageEndIndex() + + " rows only"; + } + } + } + + /** + * The implementation. {Unsupported!} + */ + protected void doClearFetchPageClause() { + _fetchFirstSqlSuffix = ""; + } + + /** + * The override. + * + * @return Determination. + */ + public boolean isFetchStartIndexSupported() { + return false; + } + + /** + * The implementation. + * + * @return this. (NotNull) + */ + public SqlClause lockForUpdate() { + _lockSqlSuffix = " for update with RS"; + return this; + } + + /** + * The implementation. + * + * @return Select-hint. (NotNull) + */ + protected String createSelectHint() { + return ""; + } + + /** + * The implementation. + * + * @return From-base-table-hint. {select * from table [from-base-table-hint] where ...} (NotNull) + */ + protected String createFromBaseTableHint() { + return ""; + } + + /** + * The implementation. + * + * @return From-hint. (NotNull) + */ + protected String createFromHint() { + return ""; + } + + /** + * The implementation. + * + * @return Sql-suffix. (NotNull) + */ + protected String createSqlSuffix() { + return _fetchFirstSqlSuffix + _lockSqlSuffix; + } +} Property changes on: announcement/trunk/src/main/java/jp/sf/pal/announcement/db/allcommon/cbean/sqlclause/SqlClauseDb2.java ___________________________________________________________________ Name: svn:eol-style + native Added: announcement/trunk/src/main/java/jp/sf/pal/announcement/db/allcommon/cbean/sqlclause/SqlClauseDefault.java =================================================================== --- announcement/trunk/src/main/java/jp/sf/pal/announcement/db/allcommon/cbean/sqlclause/SqlClauseDefault.java (rev 0) +++ announcement/trunk/src/main/java/jp/sf/pal/announcement/db/allcommon/cbean/sqlclause/SqlClauseDefault.java 2008-06-30 02:54:27 UTC (rev 1002) @@ -0,0 +1,109 @@ +package jp.sf.pal.announcement.db.allcommon.cbean.sqlclause; + +/** + * SqlClause for Default. + * @author DBFlute(AutoGenerator) + */ +public class SqlClauseDefault extends AbstractSqlClause { + + // =================================================================================== + // Constructor + // =========== + /** + * @param tableName Table name. (NotNull) + **/ + public SqlClauseDefault(String tableName) { + super(tableName); + } + + // =================================================================================== + // OrderBy Override + // ================ + @Override + protected OrderByClause.OrderByNullsSetupper createOrderByNullsSetupper() { + return createOrderByNullsSetupperByCaseWhen(); + } + + /** + * The implementation. + */ + protected void doFetchFirst() { + } + + /** + * The implementation. + */ + protected void doFetchPage() { + } + + /** + * The implementation. + */ + protected void doClearFetchPageClause() { + } + + /** + * The override. + * + * @return Determination. + */ + public boolean isFetchStartIndexSupported() { + return false; // Default + } + + /** + * The override. + * + * @return Determination. + */ + public boolean isFetchSizeSupported() { + return false; // Default + } + + /** + * The implementation. + * + * @return this. (NotNull) + */ + public SqlClause lockForUpdate() { + String msg = "LockForUpdate-SQL is unsupported in the database. Sorry...: " + + toString(); + throw new UnsupportedOperationException(msg); + } + + /** + * The implementation. + * + * @return Select-hint. (NotNull) + */ + protected String createSelectHint() { + return ""; + } + + /** + * The implementation. + * + * @return From-base-table-hint. {select * from table [from-base-table-hint] where ...} (NotNull) + */ + protected String createFromBaseTableHint() { + return ""; + } + + /** + * The implementation. + * + * @return From-hint. (NotNull) + */ + protected String createFromHint() { + return ""; + } + + /** + * The implementation. + * + * @return Sql-suffix. (NotNull) + */ + protected String createSqlSuffix() { + return ""; + } +} Property changes on: announcement/trunk/src/main/java/jp/sf/pal/announcement/db/allcommon/cbean/sqlclause/SqlClauseDefault.java ___________________________________________________________________ Name: svn:eol-style + native Added: announcement/trunk/src/main/java/jp/sf/pal/announcement/db/allcommon/cbean/sqlclause/SqlClauseDerby.java =================================================================== --- announcement/trunk/src/main/java/jp/sf/pal/announcement/db/allcommon/cbean/sqlclause/SqlClauseDerby.java (rev 0) +++ announcement/trunk/src/main/java/jp/sf/pal/announcement/db/allcommon/cbean/sqlclause/SqlClauseDerby.java 2008-06-30 02:54:27 UTC (rev 1002) @@ -0,0 +1,119 @@ +package jp.sf.pal.announcement.db.allcommon.cbean.sqlclause; + +/** + * SqlClause for Default. + * + * @author DBFlute(AutoGenerator) + */ +public class SqlClauseDerby extends AbstractSqlClause { + + // =================================================================================== + // Attribute + // ========= + /** String of lock as sql-suffix. */ + protected String _lockSqlSuffix = ""; + + // =================================================================================== + // Constructor + // =========== + /** + * Constructor. + * @param tableName Table name. (NotNull) + **/ + public SqlClauseDerby(String tableName) { + super(tableName); + } + + // =================================================================================== + // OrderBy Override + // ================ + @Override + protected OrderByClause.OrderByNullsSetupper createOrderByNullsSetupper() { + return createOrderByNullsSetupperByCaseWhen(); + } + + // =================================================================================== + // FetchScope Override + // =================== + /** + * The implementation. + */ + protected void doFetchFirst() { + } + + /** + * The implementation. + */ + protected void doFetchPage() { + } + + /** + * The implementation. + */ + protected void doClearFetchPageClause() { + } + + /** + * The override. + * + * @return Determination. + */ + public boolean isFetchStartIndexSupported() { + return false; // Default + } + + /** + * The override. + * + * @return Determination. + */ + public boolean isFetchSizeSupported() { + return false; // Default + } + + /** + * The implementation. + * + * @return this. (NotNull) + */ + public SqlClause lockForUpdate() { + _lockSqlSuffix = " for update"; + return this; + } + + /** + * The implementation. + * + * @return Select-hint. (NotNull) + */ + protected String createSelectHint() { + return ""; + } + + /** + * The implementation. + * + * @return From-base-table-hint. {select * from table [from-base-table-hint] where ...} (NotNull) + */ + protected String createFromBaseTableHint() { + return ""; + } + + /** + * The implementation. + * + * @return From-hint. (NotNull) + */ + protected String createFromHint() { + return ""; + } + + /** + * The implementation. + * + * @return Sql-suffix. (NotNull) + */ + protected String createSqlSuffix() { + return _lockSqlSuffix; + } +} Property changes on: announcement/trunk/src/main/java/jp/sf/pal/announcement/db/allcommon/cbean/sqlclause/SqlClauseDerby.java ___________________________________________________________________ Name: svn:eol-style + native Added: announcement/trunk/src/main/java/jp/sf/pal/announcement/db/allcommon/cbean/sqlclause/SqlClauseFirebird.java =================================================================== --- announcement/trunk/src/main/java/jp/sf/pal/announcement/db/allcommon/cbean/sqlclause/SqlClauseFirebird.java (rev 0) +++ announcement/trunk/src/main/java/jp/sf/pal/announcement/db/allcommon/cbean/sqlclause/SqlClauseFirebird.java 2008-06-30 02:54:27 UTC (rev 1002) @@ -0,0 +1,102 @@ +package jp.sf.pal.announcement.db.allcommon.cbean.sqlclause; + +/** + * SqlClause for Firebird. + * + * @author DBFlute(AutoGenerator) + */ +public class SqlClauseFirebird extends AbstractSqlClause { + + /** String of fetch-scope as select-hint. */ + protected String _fetchScopeSelectHint = ""; + + /** String of lock as sql-suffix. */ + protected String _lockSqlSuffix = ""; + + /** + * Constructor. + * + * @param tableName Table name. (NotNull) + **/ + public SqlClauseFirebird(String tableName) { + super(tableName); + } + + /** + * The implementation. + */ + protected void doFetchFirst() { + if (isFetchSizeSupported()) { + _fetchScopeSelectHint = " first " + getFetchSize(); + } + } + + /** + * The implementation. + */ + protected void doFetchPage() { + if (isFetchStartIndexSupported() && isFetchSizeSupported()) { + _fetchScopeSelectHint = " first " + getFetchSize() + " skip " + + getPageStartIndex(); + } + if (isFetchStartIndexSupported() && !isFetchSizeSupported()) { + _fetchScopeSelectHint = " skip " + getPageStartIndex(); + } + if (!isFetchStartIndexSupported() && isFetchSizeSupported()) { + _fetchScopeSelectHint = " first " + getPageEndIndex(); + } + } + + /** + * The implementation. + */ + protected void doClearFetchPageClause() { + _fetchScopeSelectHint = ""; + } + + /** + * The implementation. + * + * @return this. (NotNull) + */ + public SqlClause lockForUpdate() { + _lockSqlSuffix = " for update with lock"; + return this; + } + + /** + * The implementation. + * + * @return Select-hint. (NotNull) + */ + protected String createSelectHint() { + return _fetchScopeSelectHint; + } + + /** + * The implementation. + * + * @return From-base-table-hint. {select * from table [from-base-table-hint] where ...} (NotNull) + */ + protected String createFromBaseTableHint() { + return ""; + } + + /** + * The implementation. + * + * @return From-hint. (NotNull) + */ + protected String createFromHint() { + return ""; + } + + /** + * The implementation. + * + * @return Sql-suffix. (NotNull) + */ + protected String createSqlSuffix() { + return _lockSqlSuffix; + } +} Property changes on: announcement/trunk/src/main/java/jp/sf/pal/announcement/db/allcommon/cbean/sqlclause/SqlClauseFirebird.java ___________________________________________________________________ Name: svn:eol-style + native Added: announcement/trunk/src/main/java/jp/sf/pal/announcement/db/allcommon/cbean/sqlclause/SqlClauseH2.java =================================================================== --- announcement/trunk/src/main/java/jp/sf/pal/announcement/db/allcommon/cbean/sqlclause/SqlClauseH2.java (rev 0) +++ announcement/trunk/src/main/java/jp/sf/pal/announcement/db/allcommon/cbean/sqlclause/SqlClauseH2.java 2008-06-30 02:54:27 UTC (rev 1002) @@ -0,0 +1,92 @@ +package jp.sf.pal.announcement.db.allcommon.cbean.sqlclause; + +/** + * SqlClause for H2. + * + * @author DBFlute(AutoGenerator) + */ +public class SqlClauseH2 extends AbstractSqlClause { + + /** String of fetch-scope as sql-suffix. */ + protected String _fetchScopeSqlSuffix = ""; + + /** String of lock as sql-suffix. */ + protected String _lockSqlSuffix = ""; + + /** + * Constructor. + *

    + * @param tableName Table name. (NotNull) + **/ + public SqlClauseH2(String tableName) { + super(tableName); + } + + /** + * The implementation. + */ + protected void doFetchFirst() { + doFetchPage(); + } + + /** + * The implementation. + */ + protected void doFetchPage() { + _fetchScopeSqlSuffix = " limit " + getFetchSize() + " offset " + + getPageStartIndex(); + } + + /** + * The implementation. + */ + protected void doClearFetchPageClause() { + _fetchScopeSqlSuffix = ""; + } + + /** + * The implementation. + * + * @return this. (NotNull) + */ + public SqlClause lockForUpdate() { + _lockSqlSuffix = " for update"; + return this; + } + + /** + * The implementation. + * + * @return Select-hint. (NotNull) + */ + protected String createSelectHint() { + return ""; + } + + /** + * The implementation. + * + * @return From-base-table-hint. {select * from table [from-base-table-hint] where ...} (NotNull) + */ + protected String createFromBaseTableHint() { + return ""; + } + + /** + * The implementation. + * + * @return From-hint. (NotNull) + */ + protected String createFromHint() { + return ""; + } + + /** + * The implementation. + * + * @return Sql-suffix. (NotNull) + */ + protected String createSqlSuffix() { + return _fetchScopeSqlSuffix + _lockSqlSuffix; + } +} Property changes on: announcement/trunk/src/main/java/jp/sf/pal/announcement/db/allcommon/cbean/sqlclause/SqlClauseH2.java ___________________________________________________________________ Name: svn:eol-style + native Added: announcement/trunk/src/main/java/jp/sf/pal/announcement/db/allcommon/cbean/sqlclause/SqlClauseInterbase.java =================================================================== --- announcement/trunk/src/main/java/jp/sf/pal/announcement/db/allcommon/cbean/sqlclause/SqlClauseInterbase.java (rev 0) +++ announcement/trunk/src/main/java/jp/sf/pal/announcement/db/allcommon/cbean/sqlclause/SqlClauseInterbase.java 2008-06-30 02:54:27 UTC (rev 1002) @@ -0,0 +1,107 @@ +package jp.sf.pal.announcement.db.allcommon.cbean.sqlclause; + +/** + * SqlClause for Interbase. + * + * @author DBFlute(AutoGenerator) + */ +public class SqlClauseInterbase extends AbstractSqlClause { + + // =================================================================================== + // Attribute + // ========= + /** String of fetch-scope as select-hint. */ + protected String _fetchScopeSelectHint = ""; + + /** String of lock as sql-suffix. */ + protected String _lockSqlSuffix = ""; + + // =================================================================================== + // Constructor + // =========== + /** + * Constructor. + * @param tableName Table name. (NotNull) + **/ + public SqlClauseInterbase(String tableName) { + super(tableName); + } + + /** + * The implementation. + */ + protected void doFetchFirst() { + if (isFetchSizeSupported()) { + _fetchScopeSelectHint = " first " + getFetchSize(); + } + } + + /** + * The implementation. + */ + protected void doFetchPage() { + if (isFetchStartIndexSupported() && isFetchSizeSupported()) { + _fetchScopeSelectHint = " first " + getFetchSize() + " skip " + + getPageStartIndex(); + } + if (isFetchStartIndexSupported() && !isFetchSizeSupported()) { + _fetchScopeSelectHint = " skip " + getPageStartIndex(); + } + if (!isFetchStartIndexSupported() && isFetchSizeSupported()) { + _fetchScopeSelectHint = " first " + getPageEndIndex(); + } + } + + /** + * The implementation. + */ + protected void doClearFetchPageClause() { + _fetchScopeSelectHint = ""; + } + + /** + * The implementation. + * + * @return this. (NotNull) + */ + public SqlClause lockForUpdate() { + _lockSqlSuffix = " for update with lock"; + return this; + } + + /** + * The implementation. + * + * @return Select-hint. (NotNull) + */ + protected String createSelectHint() { + return _fetchScopeSelectHint; + } + + /** + * The implementation. + * + * @return From-base-table-hint. {select * from table [from-base-table-hint] where ...} (NotNull) + */ + protected String createFromBaseTableHint() { + return ""; + } + + /** + * The implementation. + * + * @return From-hint. (NotNull) + */ + protected String createFromHint() { + return ""; + } + + /** + * The implementation. + * + * @return Sql-suffix. (NotNull) + */ + protected String createSqlSuffix() { + return _lockSqlSuffix; + } +} Property changes on: announcement/trunk/src/main/java/jp/sf/pal/announcement/db/allcommon/cbean/sqlclause/SqlClauseInterbase.java ___________________________________________________________________ Name: svn:eol-style + native Added: announcement/trunk/src/main/java/jp/sf/pal/announcement/db/allcommon/cbean/sqlclause/SqlClauseMySql.java =================================================================== --- announcement/trunk/src/main/java/jp/sf/pal/announcement/db/allcommon/cbean/sqlclause/SqlClauseMySql.java (rev 0) +++ announcement/trunk/src/main/java/jp/sf/pal/announcement/db/allcommon/cbean/sqlclause/SqlClauseMySql.java 2008-06-30 02:54:27 UTC (rev 1002) @@ -0,0 +1,107 @@ +package jp.sf.pal.announcement.db.allcommon.cbean.sqlclause; + +/** + * SqlClause for MySQL. + * @author DBFlute(AutoGenerator) + */ +public class SqlClauseMySql extends AbstractSqlClause { + + // =================================================================================== + // Attribute + // ========= + /** String of fetch-scope as sql-suffix. */ + protected String _fetchScopeSqlSuffix = ""; + + /** String of lock as sql-suffix. */ + protected String _lockSqlSuffix = ""; + + // =================================================================================== + // Constructor + // =========== + /** + * Constructor. + * @param tableName Table name. (NotNull) + **/ + public SqlClauseMySql(String tableName) { + super(tableName); + } + + // =================================================================================== + // OrderBy Override + // ================ + @Override + protected OrderByClause.OrderByNullsSetupper createOrderByNullsSetupper() { + return createOrderByNullsSetupperByCaseWhen(); + } + + // =================================================================================== + // FetchScope Override + // =================== + /** + * The implementation. + */ + protected void doFetchFirst() { + doFetchPage(); + } + + /** + * The implementation. + */ + protected void doFetchPage() { + _fetchScopeSqlSuffix = " limit " + getPageStartIndex() + ", " + + getFetchSize(); + } + + /** + * The implementation. + */ + protected void doClearFetchPageClause() { + _fetchScopeSqlSuffix = ""; + } + + /** + * The implementation. + * + * @return this. (NotNull) + */ + public SqlClause lockForUpdate() { + _lockSqlSuffix = " for update"; + return this; + } + + /** + * The implementation. + * + * @return Select-hint. (NotNull) + */ + protected String createSelectHint() { + return ""; + } + + /** + * The implementation. + * + * @return From-base-table-hint. {select * from table [from-base-table-hint] where ...} (NotNull) + */ + protected String createFromBaseTableHint() { + return ""; + } + + /** + * The implementation. + * + * @return From-hint. (NotNull) + */ + protected String createFromHint() { + return ""; + } + + /** + * The implementation. + * + * @return Sql-suffix. (NotNull) + */ + protected String createSqlSuffix() { + return _fetchScopeSqlSuffix + _lockSqlSuffix; + } +} Property changes on: announcement/trunk/src/main/java/jp/sf/pal/announcement/db/allcommon/cbean/sqlclause/SqlClauseMySql.java ___________________________________________________________________ Name: svn:eol-style + native Added: announcement/trunk/src/main/java/jp/sf/pal/announcement/db/allcommon/cbean/sqlclause/SqlClauseOracle.java =================================================================== --- announcement/trunk/src/main/java/jp/sf/pal/announcement/db/allcommon/cbean/sqlclause/SqlClauseOracle.java (rev 0) +++ announcement/trunk/src/main/java/jp/sf/pal/announcement/db/allcommon/cbean/sqlclause/SqlClauseOracle.java 2008-06-30 02:54:27 UTC (rev 1002) @@ -0,0 +1,157 @@ +package jp.sf.pal.announcement.db.allcommon.cbean.sqlclause; + +import jp.sf.pal.announcement.db.allcommon.dbmeta.DBMeta; +import jp.sf.pal.announcement.db.allcommon.dbmeta.DBMetaInstanceHandler; +import jp.sf.pal.announcement.db.allcommon.dbmeta.info.ColumnInfo; + +/** + * SqlClause for Oracle. + * @author DBFlute(AutoGenerator) + */ +public class SqlClauseOracle extends AbstractSqlClause { + + // =================================================================================== + // Attribute + // ========= + /** String of fetch-scope as select-hint. */ + protected String _fetchScopeSelectHint = ""; + + /** String of fetch-scope as sql-suffix. */ + protected String _fetchScopeSqlSuffix = ""; + + /** String of lock as sql-suffix. */ + protected String _lockSqlSuffix = ""; + + // =================================================================================== + // Constructor + // =========== + /** + * Constructor. + * @param tableName Table name. (NotNull) + **/ + public SqlClauseOracle(String tableName) { + super(tableName); + } + + // =================================================================================== + // Database Original Override + // ========================== + @Override + protected String buildUnionClause(String selectClause) { + + // - - - - - - - - - - - - - - - - - - - - - - - - - - - - + // Remove select-hint comment from select clause of union + // for fetch-scope with union(). + // - - - - - - - - - - - - - - - - - - - - - - - - - - - - + + selectClause = replaceString(selectClause, SELECT_HINT, ""); + return super.buildUnionClause(selectClause); + } + + // =================================================================================== + // FetchScope Override + // =================== + /** + * The implementation. + */ + protected void doFetchFirst() { + doFetchPage(); + } + + /** + * The implementation. + */ + protected void doFetchPage() { + if (!isFetchStartIndexSupported() && !isFetchSizeSupported()) { + return; + } + final String ln; + if (isFormatClauseEffective()) { + ln = getLineSeparator(); + } else { + ln = ""; + } + _fetchScopeSelectHint = " * from (select base.*, rownum as rn from (" + + ln + "select"; + _fetchScopeSqlSuffix = ""; + if (isFetchStartIndexSupported()) { + _fetchScopeSqlSuffix = ") base )" + ln + " where rn > " + + getPageStartIndex(); + } + if (isFetchSizeSupported()) { + if (isFetchStartIndexSupported()) { + _fetchScopeSqlSuffix = _fetchScopeSqlSuffix + " and rn <= " + + getPageEndIndex(); + } else { + _fetchScopeSqlSuffix = ") base )" + ln + " where rn <= " + + getPageEndIndex(); + } + } + } + + /** + * The implementation. + */ + protected void doClearFetchPageClause() { + _fetchScopeSelectHint = ""; + _fetchScopeSqlSuffix = ""; + } + + // =================================================================================== + // Lock Override + // ============= + /** + * The implementation. + * @return this. (NotNull) + */ + public SqlClause lockForUpdate() { + final DBMeta dbmeta = DBMetaInstanceHandler.findDBMeta(_tableName); + if (dbmeta.hasPrimaryKey()) { + final String primaryKeyColumnName = dbmeta.getPrimaryUniqueInfo() + .getFirstColumn().getColumnDbName(); + _lockSqlSuffix = " for update of " + getLocalTableAliasName() + "." + + primaryKeyColumnName; + } else { + final String randomColumnName = ((ColumnInfo) dbmeta + .getColumnInfoList().get(0)).getColumnDbName(); + _lockSqlSuffix = " for update of " + getLocalTableAliasName() + "." + + randomColumnName; + } + return this; + } + + // =================================================================================== + // Hint Override + // ============= + /** + * The implementation. + * @return Select-hint. (NotNull) + */ + protected String createSelectHint() { + return _fetchScopeSelectHint; + } + + /** + * The implementation. + * @return From-base-table-hint. {select * from table [from-base-table-hint] where ...} (NotNull) + */ + protected String createFromBaseTableHint() { + return ""; + } + + /** + * The implementation. + * @return From-hint. (NotNull) + */ + protected String createFromHint() { + return ""; + } + + /** + * The implementation. + * @return Sql-suffix. (NotNull) + */ + protected String createSqlSuffix() { + return _fetchScopeSqlSuffix + _lockSqlSuffix; + } +} Property changes on: announcement/trunk/src/main/java/jp/sf/pal/announcement/db/allcommon/cbean/sqlclause/SqlClauseOracle.java ___________________________________________________________________ Name: svn:eol-style + native Added: announcement/trunk/src/main/java/jp/sf/pal/announcement/db/allcommon/cbean/sqlclause/SqlClausePostgreSql.java =================================================================== --- announcement/trunk/src/main/java/jp/sf/pal/announcement/db/allcommon/cbean/sqlclause/SqlClausePostgreSql.java (rev 0) +++ announcement/trunk/src/main/java/jp/sf/pal/announcement/db/allcommon/cbean/sqlclause/SqlClausePostgreSql.java 2008-06-30 02:54:27 UTC (rev 1002) @@ -0,0 +1,92 @@ +package jp.sf.pal.announcement.db.allcommon.cbean.sqlclause; + +/** + * SqlClause for PostreSQL. + * + * @author DBFlute(AutoGenerator) + */ +public class SqlClausePostgreSql extends AbstractSqlClause { + + /** String of fetch-scope as sql-suffix. */ + protected String _fetchScopeSqlSuffix = ""; + + /** String of lock as sql-suffix. */ + protected String _lockSqlSuffix = ""; + + /** + * Constructor. + * + * @param tableName Table name. (NotNull) + **/ + public SqlClausePostgreSql(String tableName) { + super(tableName); + } + + /** + * The implementation. + */ + protected void doFetchFirst() { + doFetchPage(); + } + + /** + * The implementation. + */ + protected void doFetchPage() { + _fetchScopeSqlSuffix = " offset " + getPageStartIndex() + " limit " + + getFetchSize(); + } + + /** + * The implementation. + */ + protected void doClearFetchPageClause() { + _fetchScopeSqlSuffix = ""; + } + + /** + * The implementation. + * + * @return this. (NotNull) + */ + public SqlClause lockForUpdate() { + _lockSqlSuffix = " for update"; + return this; + } + + /** + * The implementation. + * + * @return Select-hint. (NotNull) + */ + protected String createSelectHint() { + return ""; + } + + /** + * The implementation. + * + * @return From-base-table-hint. {select * from table [from-base-table-hint] where ...} (NotNull) + */ + protected String createFromBaseTableHint() { + return ""; + } + + /** + * The implementation. + * + * @return From-hint. (NotNull) + */ + protected String createFromHint() { + return ""; + } + + /** + * The implementation. + * + * @return Sql-suffix. (NotNull) + */ + protected String createSqlSuffix() { + return _fetchScopeSqlSuffix + _lockSqlSuffix; + } +} Property changes on: announcement/trunk/src/main/java/jp/sf/pal/announcement/db/allcommon/cbean/sqlclause/SqlClausePostgreSql.java ___________________________________________________________________ Name: svn:eol-style + native Added: announcement/trunk/src/main/java/jp/sf/pal/announcement/db/allcommon/cbean/sqlclause/SqlClauseSqlServer.java =================================================================== --- announcement/trunk/src/main/java/jp/sf/pal/announcement/db/allcommon/cbean/sqlclause/SqlClauseSqlServer.java (rev 0) +++ announcement/trunk/src/main/java/jp/sf/pal/announcement/db/allcommon/cbean/sqlclause/SqlClauseSqlServer.java 2008-06-30 02:54:27 UTC (rev 1002) @@ -0,0 +1,125 @@ +package jp.sf.pal.announcement.db.allcommon.cbean.sqlclause; + +/** + * SqlClause for MSSQL. + * @author DBFlute(AutoGenerator) + */ +public class SqlClauseSqlServer extends AbstractSqlClause { + + // =================================================================================== + // Attribute + // ========= + /** String of fetch-first as select-hint. */ + protected String _fetchFirstSelectHint = ""; + + /** String of lock as from-hint. */ + protected String _lockFromHint = ""; + + // =================================================================================== + // Constructor + // =========== + /** + * Constructor. + * @param tableName Table name. (NotNull) + **/ + public SqlClauseSqlServer(String tableName) { + super(tableName); + } + + // =================================================================================== + // OrderBy Override + // ================ + @Override + protected OrderByClause.OrderByNullsSetupper createOrderByNullsSetupper() { + return createOrderByNullsSetupperByCaseWhen(); + } + + // =================================================================================== + // FetchScope Override + // =================== + /** + * The implementation. + */ + protected void doFetchFirst() { + if (isFetchSizeSupported()) { + _fetchFirstSelectHint = " top " + getFetchSize(); + } + } + + /** + * The implementation. + */ + protected void doFetchPage() { + if (isFetchSizeSupported()) { + if (isFetchStartIndexSupported()) { + _fetchFirstSelectHint = " top " + getFetchSize(); + } else { + _fetchFirstSelectHint = " top " + getPageEndIndex(); + } + } + } + + /** + * The implementation. + */ + protected void doClearFetchPageClause() { + _fetchFirstSelectHint = ""; + } + + /** + * @return Determination. + */ + public boolean isFetchStartIndexSupported() { + return false; + } + + // =================================================================================== + // Lock Override + // ============= + /** + * The implementation. {Implement} + * @return this. (NotNull) + */ + public SqlClause lockForUpdate() { + _lockFromHint = " with (updlock)"; + return this; + } + + // =================================================================================== + // Hint Override + // ============= + /** + * The implementation. + * @return Select-hint. (NotNull) + */ + protected String createSelectHint() { + return _fetchFirstSelectHint; + } + + /** + * The implementation. + * + * @return From-base-table-hint. {select * from table [from-base-table-hint] where ...} (NotNull) + */ + protected String createFromBaseTableHint() { + return _lockFromHint; + } + + /** + * The implementation. + * + * @return From-hint. (NotNull) + */ + protected String createFromHint() { + return ""; + } + + /** + * The implementation. + * + * @return Sql-suffix. (NotNull) + */ + protected String createSqlSuffix() { + return ""; + } +} Property changes on: announcement/trunk/src/main/java/jp/sf/pal/announcement/db/allcommon/cbean/sqlclause/SqlClauseSqlServer.java ___________________________________________________________________ Name: svn:eol-style + native Added: announcement/trunk/src/main/java/jp/sf/pal/announcement/db/allcommon/cbean/sqlclause/WhereClauseSimpleFilter.java =================================================================== --- announcement/trunk/src/main/java/jp/sf/pal/announcement/db/allcommon/cbean/sqlclause/WhereClauseSimpleFilter.java (rev 0) +++ announcement/trunk/src/main/java/jp/sf/pal/announcement/db/allcommon/cbean/sqlclause/WhereClauseSimpleFilter.java 2008-06-30 02:54:27 UTC (rev 1002) @@ -0,0 +1,144 @@ +package jp.sf.pal.announcement.db.allcommon.cbean.sqlclause; + +import jp.sf.pal.announcement.db.allcommon.dbmeta.info.ColumnInfo; + +/** + * The interface of simple filter for where clause. + * + * @author DBFlute(AutoGenerator) + */ +public interface WhereClauseSimpleFilter { + + public static final String BIND_COMMENT_BEGIN_PART = "/*dto"; + + public static final String BIND_COMMENT_END_PART = "*/null"; + + public static final String EMBEDDED_COMMENT_BEGIN_PART = "/*$dto"; + + public static final String EMBEDDED_COMMENT_END_PART = "*/null"; + + public static final String EMBEDDED_COMMENT_QUOTED_BEGIN_PART = "'/*$dto"; + + public static final String EMBEDDED_COMMENT_QUOTED_END_PART = "*/'dummy''"; + + /** + * Filter clause element. + * + * @param clauseElement Clause element of where. (NotNull and NotEmpty) + * @return Filtered where clause. (NotNull and NotEmpty) + */ + public String filterClauseElement(String clauseElement); + + /** + * The simple filter for where clause to embedded.
    + * *Attension -- Target column is not perfect. This class determines by column name only! + * So when the column name of base table is same as the column name of join table, both are target! + * + * @author DBFlute(AutoGenerator) + */ + public static class WhereClauseToEmbeddedSimpleFilter implements + WhereClauseSimpleFilter { + + protected java.util.Set _filterTargetColumnInfoSet; + + public WhereClauseToEmbeddedSimpleFilter( + ColumnInfo filterTargetColumnInfo) { + this._filterTargetColumnInfoSet = new java.util.HashSet(); + this._filterTargetColumnInfoSet.add(filterTargetColumnInfo); + } + + public WhereClauseToEmbeddedSimpleFilter( + java.util.Set filterTargetColumnInfoSet) { + this._filterTargetColumnInfoSet = filterTargetColumnInfoSet; + } + + /** + * Filter clause element. + * + * @param clauseElement Clause element of where. (NotNull and NotEmpty) + * @return Filtered where clause. (NotNull and NotEmpty) + */ + public String filterClauseElement(String clauseElement) { + if (_filterTargetColumnInfoSet == null + || _filterTargetColumnInfoSet.isEmpty()) { + return toEmbedded(clauseElement); + } + for (final java.util.Iterator ite = _filterTargetColumnInfoSet + .iterator(); ite.hasNext();) { + final ColumnInfo columnInfo = (ColumnInfo) ite.next(); + if (isTargetClause(clauseElement, columnInfo.getColumnDbName())) { + return toEmbedded(clauseElement); + } + } + return clauseElement; + } + + protected boolean isTargetClause(String clauseElement, + final String columnDbName) { + return clauseElement.indexOf("." + columnDbName + " ") >= 0; + } + + protected String toEmbedded(String clauseElement) { + clauseElement = replace(clauseElement, BIND_COMMENT_BEGIN_PART, + EMBEDDED_COMMENT_BEGIN_PART); + clauseElement = replace(clauseElement, BIND_COMMENT_END_PART, + EMBEDDED_COMMENT_END_PART); + return clauseElement; + } + + protected final String replace(String text, String fromText, + String toText) { + + if (text == null || fromText == null || toText == null) { + return null; + } + StringBuffer buf = new StringBuffer(100); + int pos = 0; + int pos2 = 0; + while (true) { + pos = text.indexOf(fromText, pos2); + if (pos == 0) { + buf.append(toText); + pos2 = fromText.length(); + } else if (pos > 0) { + buf.append(text.substring(pos2, pos)); + buf.append(toText); + pos2 = pos + fromText.length(); + } else { + buf.append(text.substring(pos2)); + break; + } + } + return buf.toString(); + } + } + + /** + * The simple filter for where clause to embedded and quoted.
    + * *Attension -- Target column is not perfect. This class determines by column name only! + * So when the column name of base table is same as the column name of join table, both are target! + * + * @author DBFlute(AutoGenerator) + */ + public static class WhereClauseToEmbeddedQuotedSimpleFilter extends + WhereClauseToEmbeddedSimpleFilter { + + public WhereClauseToEmbeddedQuotedSimpleFilter( + ColumnInfo filterTargetColumnInfo) { + super(filterTargetColumnInfo); + } + + public WhereClauseToEmbeddedQuotedSimpleFilter( + java.util.Set filterTargetColumnInfoSet) { + super(filterTargetColumnInfoSet); + } + + protected String toEmbedded(String clauseElement) { + clauseElement = replace(clauseElement, BIND_COMMENT_BEGIN_PART, + EMBEDDED_COMMENT_QUOTED_BEGIN_PART); + clauseElement = replace(clauseElement, BIND_COMMENT_END_PART, + EMBEDDED_COMMENT_QUOTED_END_PART); + return clauseElement; + } + } +} Property changes on: announcement/trunk/src/main/java/jp/sf/pal/announcement/db/allcommon/cbean/sqlclause/WhereClauseSimpleFilter.java ___________________________________________________________________ Name: svn:eol-style + native Added: announcement/trunk/src/main/java/jp/sf/pal/announcement/db/allcommon/dbmeta/AbstractDBMeta.java =================================================================== --- announcement/trunk/src/main/java/jp/sf/pal/announcement/db/allcommon/dbmeta/AbstractDBMeta.java (rev 0) +++ announcement/trunk/src/main/java/jp/sf/pal/announcement/db/allcommon/dbmeta/AbstractDBMeta.java 2008-06-30 02:54:27 UTC (rev 1002) @@ -0,0 +1,883 @@ +package jp.sf.pal.announcement.db.allcommon.dbmeta; + +import java.util.ArrayList; +import java.util.Iterator; +import java.util.List; +import java.util.Map; + +import jp.sf.pal.announcement.db.allcommon.Entity; +import jp.sf.pal.announcement.db.allcommon.dbmeta.info.ColumnInfo; +import jp.sf.pal.announcement.db.allcommon.dbmeta.info.ForeignInfo; +import jp.sf.pal.announcement.db.allcommon.dbmeta.info.ReferrerInfo; +import jp.sf.pal.announcement.db.allcommon.dbmeta.info.RelationInfo; +import jp.sf.pal.announcement.db.allcommon.helper.MapListString; +import jp.sf.pal.announcement.db.allcommon.helper.MapListStringImpl; +import jp.sf.pal.announcement.db.allcommon.helper.MapStringBuilder; +import jp.sf.pal.announcement.db.allcommon.helper.MapStringBuilderImpl; +import jp.sf.pal.announcement.db.allcommon.util.SimpleAssertUtil; +import jp.sf.pal.announcement.db.allcommon.util.SimpleStringUtil; + +/** + * The abstract class of dbmeta. + * + * @author DBFlute(AutoGenerator) + */ + @ SuppressWarnings("unchecked") +public abstract class AbstractDBMeta implements DBMeta { + + // ===================================================================================== + // Name Handling + // ============= + /** + * The implementation. + * + * @param flexibleName Flexible-name(IgnoreCase). (NotNull and NotEmpty) + * @return Determination. + */ + public boolean hasFlexibleName(String flexibleName) { + final String key = flexibleName.toLowerCase(); + if (getDbNamePropertyNameKeyToLowerMap().containsKey(key)) { + return true; + } + if (getPropertyNameDbNameKeyToLowerMap().containsKey(key)) { + return true; + } + return false; + } + + /** + * The implementation. + * + * @param flexibleName Flexible-name(IgnoreCase). (NotNull and NotEmpty) + * @return DB name. (NotNull and NotEmpty) + */ + public String findDbName(String flexibleName) { + final String key = flexibleName.toLowerCase(); + if (getPropertyNameDbNameKeyToLowerMap().containsKey(key)) { + return (String) getPropertyNameDbNameKeyToLowerMap().get(key); + } + if (getDbNamePropertyNameKeyToLowerMap().containsKey(key)) { + final String dbNameKeyToLower = ((String) getDbNamePropertyNameKeyToLowerMap() + .get(key)).toLowerCase(); + if (getPropertyNameDbNameKeyToLowerMap().containsKey( + dbNameKeyToLower)) { + return (String) getPropertyNameDbNameKeyToLowerMap().get( + dbNameKeyToLower); + } + } + String msg = "Not found object by the flexible name: flexibleName=" + + flexibleName; + throw new IllegalStateException(msg); + } + + /** + * The implementation. + * + * @param flexibleName Flexible-name(IgnoreCase). (NotNull and NotEmpty) + * @return DB name. (NotNull and NotEmpty) + */ + public String findPropertyName(String flexibleName) { + final String key = flexibleName.toLowerCase(); + if (getDbNamePropertyNameKeyToLowerMap().containsKey(key)) { + return (String) getDbNamePropertyNameKeyToLowerMap().get(key); + } + if (getPropertyNameDbNameKeyToLowerMap().containsKey(key)) { + final String dbNameToLower = ((String) getPropertyNameDbNameKeyToLowerMap() + .get(key)).toLowerCase(); + if (getDbNamePropertyNameKeyToLowerMap().containsKey(dbNameToLower)) { + return (String) getDbNamePropertyNameKeyToLowerMap().get( + dbNameToLower); + } + } + String msg = "Not found object by the flexible name: flexibleName=" + + flexibleName; + throw new IllegalStateException(msg); + } + + // =================================================================================== + // Column Info + // =========== + /** + * The implementation. + * + * @param columnFlexibleName The flexible name of the column. (NotNull) + * @return Determination. + */ + public boolean hasColumn(String columnFlexibleName) { + if (!hasFlexibleName(columnFlexibleName)) { + return false; + } + final String propertyName = findPropertyName(columnFlexibleName); + return hasMethod("column" + initCap(propertyName)); + } + + /** + * The implementation. + * + * @param columnFlexibleName The flexible name of the column. (NotNull and NotEmpty) + * @return The information of the column. (NotNull) + */ + public ColumnInfo findColumnInfo(String columnFlexibleName) { + assertStringNotNullAndNotTrimmedEmpty("columnFlexibleName", + columnFlexibleName); + if (!hasColumn(columnFlexibleName)) { + String msg = "Not found column by columnFlexibleName: " + + columnFlexibleName; + msg = msg + " tableName=" + getTableDbName(); + throw new IllegalArgumentException(msg); + } + final String propertyName = findPropertyName(columnFlexibleName); + final String methodName = "column" + initCap(propertyName); + java.lang.reflect.Method method = null; + try { + method = this.getClass().getMethod(methodName, new Class[] {}); + } catch (NoSuchMethodException e) { + String msg = "Not found column by columnFlexibleName: " + + columnFlexibleName; + msg = msg + " tableName=" + getTableDbName() + " methodName=" + + methodName; + throw new RuntimeException(msg, e); + } + try { + return (ColumnInfo) method.invoke(this, new Object[] {}); + } catch (IllegalAccessException e) { + throw new RuntimeException(e); + } catch (java.lang.reflect.InvocationTargetException e) { + throw new RuntimeException(e.getCause()); + } + } + + // =================================================================================== + // Relation Info + // ============= + /** + * The implementation. + * + * @param relationPropertyName Relation property name. (Both OK - InitCap or not). (NotNull) + * @return The information of relation. (NotNull) + */ + public RelationInfo findRelationInfo(String relationPropertyName) { + assertStringNotNullAndNotTrimmedEmpty("relationPropertyName", + relationPropertyName); + return hasForeign(relationPropertyName) ? (RelationInfo) findForeignInfo(relationPropertyName) + : (RelationInfo) findReferrerInfo(relationPropertyName); + } + + // ----------------------------------------------------- + // Foreign Element + // --------------- + /** + * The implementation. + * + * @param foreignPropertyName The property name of foreign. (Both OK - InitCap or not). (NotNull) + * @return Determination. (NotNull) + */ + public boolean hasForeign(String foreignPropertyName) { + assertStringNotNullAndNotTrimmedEmpty("foreignPropertyName", + foreignPropertyName); + final String methodName = buildRelationInfoGetterMethodNameInitCap( + "foreign", foreignPropertyName); + return hasMethod(methodName); + } + + /** + * The implementation. + * + * @param foreignPropertyName The property name of foreign. (Both OK - InitCap or not). (NotNull) + * @return Foreign DBMeta. (NotNull) + */ + public DBMeta findForeignDBMeta(String foreignPropertyName) { + return findForeignInfo(foreignPropertyName).getForeignDBMeta(); + } + + /** + * Get foreign information. + * + * @param foreignPropertyName The property name of foreign. (Both OK - InitCap or not). (NotNull) + * @return Foreign information. (NotNull) + */ + public jp.sf.pal.announcement.db.allcommon.dbmeta.info.ForeignInfo findForeignInfo( + String foreignPropertyName) { + assertStringNotNullAndNotTrimmedEmpty("foreignPropertyName", + foreignPropertyName); + final String methodName = buildRelationInfoGetterMethodNameInitCap( + "foreign", foreignPropertyName); + java.lang.reflect.Method method = null; + try { + method = this.getClass().getMethod(methodName, new Class[] {}); + } catch (NoSuchMethodException e) { + String msg = "Not found foreign by foreignPropertyName: foreignPropertyName=" + + foreignPropertyName; + msg = msg + " tableName=" + getTableDbName() + " methodName=" + + methodName; + throw new RuntimeException(msg, e); + } + try { + return (ForeignInfo) method.invoke(this, new Object[] {}); + } catch (IllegalAccessException e) { + throw new RuntimeException(e); + } catch (java.lang.reflect.InvocationTargetException e) { + throw new RuntimeException(e.getCause()); + } + } + + // ----------------------------------------------------- + // Referrer Element + // ---------------- + + /** + * The implementation. + * + * @param referrerPropertyName The property name of referrer. (Both OK - InitCap or not). (NotNull) + * @return Determination. (NotNull) + */ + public boolean hasReferrer(String referrerPropertyName) { + assertStringNotNullAndNotTrimmedEmpty("referrerPropertyName", + referrerPropertyName); + final String methodName = buildRelationInfoGetterMethodNameInitCap( + "referrer", referrerPropertyName); + return hasMethod(methodName); + } + + /** + * The implementation. + * + * @param referrerPropertyName The property name of referrer. (Both OK - InitCap or not). (NotNull) + * @return Referrer DBMeta. (NotNull) + */ + public DBMeta findReferrerDBMeta(String referrerPropertyName) { + assertStringNotNullAndNotTrimmedEmpty("referrerPropertyName", + referrerPropertyName); + return findReferrerInfo(referrerPropertyName).getReferrerDBMeta(); + } + + /** + * The implementation. + * + * @param referrerPropertyName The property name of referrer. (Both OK - InitCap or not). (NotNull) + * @return Referrer information. (NotNull) + */ + public ReferrerInfo findReferrerInfo(String referrerPropertyName) { + assertStringNotNullAndNotTrimmedEmpty("referrerPropertyName", + referrerPropertyName); + final String methodName = buildRelationInfoGetterMethodNameInitCap( + "referrer", referrerPropertyName); + java.lang.reflect.Method method = null; + try { + method = this.getClass().getMethod(methodName, new Class[] {}); + } catch (NoSuchMethodException e) { + String msg = "Not found referrer by referrerPropertyName: referrerPropertyName=" + + referrerPropertyName; + msg = msg + " tableName=" + getTableDbName() + " methodName=" + + methodName; + throw new RuntimeException(msg, e); + } + try { + return (ReferrerInfo) method.invoke(this, new Object[] {}); + } catch (IllegalAccessException e) { + throw new RuntimeException(e); + } catch (java.lang.reflect.InvocationTargetException e) { + throw new RuntimeException(e.getCause()); + } + } + + protected String buildRelationInfoGetterMethodNameInitCap( + String targetName, String relationPropertyName) { + return targetName + relationPropertyName.substring(0, 1).toUpperCase() + + relationPropertyName.substring(1); + } + + // ----------------------------------------------------- + // Relation Trace + // -------------- + /** + * Relation trace. + */ + protected static abstract class AbstractRelationTrace implements + RelationTrace { + + /** The list of relation. */ + protected List _relationList; + + /** The list of relation trace. */ + protected List _relationTraceList; + + /** The list of relation info as trace. */ + protected List _traceRelationInfoList; + + /** The column info as trace. */ + protected ColumnInfo _traceColumnInfo; + + /** The handler of fixed relation trace. */ + protected RelationTraceFixHandler _relationTraceFixHandler; + + /** + * Constructor for first step. + * + * @param relationTraceFixHandler The handler of fixed relation trace. (Nullable) + */ + public AbstractRelationTrace( + RelationTraceFixHandler relationTraceFixHandler) { + this(new ArrayList(), + new ArrayList()); + this._relationTraceFixHandler = relationTraceFixHandler; + } + + /** + * Constructor for relation step. + * + * @param relationList The list of relation. (NotNull) + * @param relationTraceList The list of relation trace. (NotNull) + */ + public AbstractRelationTrace(List relationList, + List relationTraceList) { + this._relationList = relationList; + this._relationTraceList = relationTraceList; + this._relationTraceList.add(this); + } + + /** + * The implementation. + * + * @return The trace of relation as the list of relation info. (NotNull) + */ + public List getTraceRelation() { + return _traceRelationInfoList; + } + + /** + * The implementation. + * + * @return The trace of column as column info. (Nullable) + */ + public ColumnInfo getTraceColumn() { + return _traceColumnInfo; + } + + /** + * Fix trace. + * + * @param traceRelationInfoList The trace of relation as the list of relation info. (NotNull) + * @param traceColumnInfo The trace of column as column info. (Nullable) + * @return Relation trace(result). (NotNull) + */ + protected RelationTrace fixTrace( + List traceRelationInfoList, + ColumnInfo traceColumnInfo) { + final AbstractRelationTrace localRelationTrace = (AbstractRelationTrace) _relationTraceList + .get(0); + localRelationTrace.setTraceRelation(traceRelationInfoList); + localRelationTrace.setTraceColumn(traceColumnInfo); + localRelationTrace.recycle(); + localRelationTrace.handleFixedRelationTrace(); + return localRelationTrace; + } + + protected void setTraceRelation(List traceRelationInfoList) { + this._traceRelationInfoList = traceRelationInfoList; + } + + protected void setTraceColumn(ColumnInfo traceColumn) { + this._traceColumnInfo = traceColumn; + } + + /** + * The implementation. + */ + protected void recycle() { + this._relationList = new ArrayList(); + this._relationTraceList = new ArrayList(); + this._relationTraceList.add(this); + } + + protected void handleFixedRelationTrace() { + if (_relationTraceFixHandler != null) { + _relationTraceFixHandler.handleFixedTrace(this); + } + } + } + + // =================================================================================== + // JDBC Support + // ============ + /** + * The implementation. + * + * @param conn Connection. (NotNull) + * @param entity Entity. (NotNull) + * @return Prepared insert clause. (NotNull and NotEmpty) + */ + public int insertEntity(java.sql.Connection conn, Entity entity) { + return insertEntity(conn, entity, new PreparedInsertClauseOption()); + } + + /** + * The implementation. + * + * @param conn Connection. (NotNull) + * @param entity Entity. (NotNull) + * @param preparedInsertClauseOption Prepared insert clause option. (NotNull) + * @return Prepared insert clause. (NotNull and NotEmpty) + */ + public int insertEntity(java.sql.Connection conn, Entity entity, + PreparedInsertClauseOption preparedInsertClauseOption) { + checkDowncast(entity); + final String sql = getPreparedInsertClause(preparedInsertClauseOption); + java.sql.PreparedStatement ps = null; + try { + ps = conn.prepareStatement(sql); + final List valueList = convertToColumnValueList(entity); + int settingIndex = 1; + for (final Iterator ite = valueList.iterator(); ite + .hasNext();) { + Object value = ite.next(); + if (value == null) { + ps.setNull(settingIndex, java.sql.Types.VARCHAR);// Giving a clear-cut attitude! + } else { + ps.setObject(settingIndex, value); + } + ++settingIndex; + } + return ps.executeUpdate(); + } catch (java.sql.SQLException e) { + String msg = "The sql threw the exception: sql=" + sql; + throw new RuntimeException(msg, e); + } finally { + if (ps != null) { + try { + ps.close(); + } catch (java.sql.SQLException ignored) { + } + } + } + } + + // =================================================================================== + // Map String + // ========== + /** + * The implementation. + * + * @return Map list string that is prepared. (NotNull) + */ + public MapListString createMapListString() { + return MapStringUtil.createMapListString(); + } + + /** + * The implementation. + * + * @return Map string builder that is prepared. (NotNull) + */ + public MapStringBuilder createMapStringBuilder() { + final List columnDbNameList = new ArrayList(); + for (final Iterator ite = getColumnInfoList().iterator(); ite + .hasNext();) { + final ColumnInfo columnInfo = (ColumnInfo) ite.next(); + columnDbNameList.add(columnInfo.getColumnDbName()); + } + return MapStringUtil.createMapStringBuilder(columnDbNameList); + } + + // =================================================================================== + // Entity Property Setup + // ===================== + // It's very INTERNAL! + protected void registerEntityPropertySetupper( + String columnName, + String propertyName, + EntityPropertySetupper setupper, + Map> entityPropertySetupperMap) { + entityPropertySetupperMap.put(columnName, setupper); + entityPropertySetupperMap.put(propertyName, setupper); + entityPropertySetupperMap.put(columnName.toLowerCase(), setupper); + entityPropertySetupperMap.put(propertyName.toLowerCase(), setupper); + } + + // =================================================================================== + // Util Class + // ========== + /** + * This class is for Internal. Don't use this! + */ + protected static class MapStringUtil { + public static void acceptPrimaryKeyMapString( + String primaryKeyMapString, Entity entity) { + if (primaryKeyMapString == null) { + String msg = "The argument[primaryKeyMapString] should not be null."; + throw new IllegalArgumentException(msg); + } + final String prefix = MAP_STRING_MAP_MARK + MAP_STRING_START_BRACE; + final String suffix = MAP_STRING_END_BRACE; + if (!primaryKeyMapString.trim().startsWith(prefix)) { + primaryKeyMapString = prefix + primaryKeyMapString; + } + if (!primaryKeyMapString.trim().endsWith(suffix)) { + primaryKeyMapString = primaryKeyMapString + suffix; + } + MapListString mapListString = createMapListString(); + entity.getDBMeta().acceptPrimaryKeyMap(entity, + mapListString.generateMap(primaryKeyMapString)); + } + + public static void acceptColumnValueMapString( + String columnValueMapString, Entity entity) { + if (columnValueMapString == null) { + String msg = "The argument[columnValueMapString] should not be null."; + throw new IllegalArgumentException(msg); + } + final String prefix = MAP_STRING_MAP_MARK + MAP_STRING_START_BRACE; + final String suffix = MAP_STRING_END_BRACE; + if (!columnValueMapString.trim().startsWith(prefix)) { + columnValueMapString = prefix + columnValueMapString; + } + if (!columnValueMapString.trim().endsWith(suffix)) { + columnValueMapString = columnValueMapString + suffix; + } + MapListString mapListString = createMapListString(); + entity.getDBMeta().acceptColumnValueMap(entity, + mapListString.generateMap(columnValueMapString)); + } + + public static String extractPrimaryKeyMapString(Entity entity) { + final String startBrace = MAP_STRING_START_BRACE; + final String endBrace = MAP_STRING_END_BRACE; + final String delimiter = MAP_STRING_DELIMITER; + final String equal = MAP_STRING_EQUAL; + return entity.getDBMeta().extractPrimaryKeyMapString(entity, + startBrace, endBrace, delimiter, equal); + } + + public static String extractColumnValueMapString(Entity entity) { + final String startBrace = MAP_STRING_START_BRACE; + final String endBrace = MAP_STRING_END_BRACE; + final String delimiter = MAP_STRING_DELIMITER; + final String equal = MAP_STRING_EQUAL; + return entity.getDBMeta().extractColumnValueMapString(entity, + startBrace, endBrace, delimiter, equal); + } + + public static void checkTypeString(Object value, String propertyName, + String typeName) { + if (value == null) { + throw new IllegalArgumentException( + "The value should not be null: " + propertyName); + } + if (!(value instanceof String)) { + String msg = "The value of " + propertyName + " should be " + + typeName + " or String: "; + msg = msg + "valueType=" + value.getClass() + " value=" + value; + throw new IllegalArgumentException(msg); + } + } + + public static long parseDateStringAsMillis(Object value, + String propertyName, String typeName) { + checkTypeString(value, propertyName, typeName); + try { + final String valueString = filterTimestampValue(((String) value) + .trim()); + return java.sql.Timestamp.valueOf(valueString).getTime(); + } catch (RuntimeException e) { + String msg = "The value of " + propertyName + " should be " + + typeName + ". but: " + value; + throw new RuntimeException(msg + + " threw the exception: value=[" + value + "]", e); + } + } + + public static String filterTimestampValue(String value) { + value = value.trim(); + if (value.indexOf("/") == 4 && value.lastIndexOf("/") == 7) { + value = value.replaceAll("/", "-"); + } + if (value.indexOf("-") == 4 && value.lastIndexOf("-") == 7) { + if (value.length() == "2007-07-09".length()) { + value = value + " 00:00:00"; + } + } + return value; + } + + public static String formatDate(java.util.Date value) { + return getFormatDateFormat().format(value); + } + + public static String formatTimestamp(java.sql.Timestamp value) { + return getFormatDateFormat().format(value); + } + + public static java.text.DateFormat getParseDateFormat() { + return java.text.DateFormat.getDateInstance(); + } + + public static java.text.DateFormat getFormatDateFormat() { + return new java.text.SimpleDateFormat("yyyy-MM-dd HH:mm:ss.SSS"); + } + + public static MapListString createMapListString() { + final MapListString mapListString = new MapListStringImpl(); + mapListString.setMapMark(MAP_STRING_MAP_MARK); + mapListString.setListMark(MAP_STRING_LIST_MARK); + mapListString.setStartBrace(MAP_STRING_START_BRACE); + mapListString.setEndBrace(MAP_STRING_END_BRACE); + mapListString.setEqual(MAP_STRING_EQUAL); + mapListString.setDelimiter(MAP_STRING_DELIMITER); + return mapListString; + } + + public static MapStringBuilder createMapStringBuilder( + List columnNameList) { + MapStringBuilder mapStringBuilder = new MapStringBuilderImpl(); + mapStringBuilder.setMsMapMark(MAP_STRING_MAP_MARK); + mapStringBuilder.setMsStartBrace(MAP_STRING_START_BRACE); + mapStringBuilder.setMsEndBrace(MAP_STRING_END_BRACE); + mapStringBuilder.setMsEqual(MAP_STRING_EQUAL); + mapStringBuilder.setMsDelimiter(MAP_STRING_DELIMITER); + mapStringBuilder.setColumnNameList(columnNameList); + return mapStringBuilder; + } + } + + /** + * This class is for Internal. Don't use this! + */ + protected static class MapAssertUtil { + public static void assertPrimaryKeyMapNotNullAndNotEmpty( + java.util.Map primaryKeyMap) { + if (primaryKeyMap == null) { + String msg = "The argument[primaryKeyMap] should not be null."; + throw new IllegalArgumentException(msg); + } + if (primaryKeyMap.isEmpty()) { + String msg = "The argument[primaryKeyMap] should not be empty."; + throw new IllegalArgumentException(msg); + } + } + + public static void assertColumnExistingInPrimaryKeyMap( + java.util.Map primaryKeyMap, + String columnName) { + if (!primaryKeyMap.containsKey(columnName)) { + String msg = "The primaryKeyMap must have the value of " + + columnName; + throw new IllegalStateException(msg + ": primaryKeyMap --> " + + primaryKeyMap); + } + } + + public static void assertColumnValueMapNotNullAndNotEmpty( + java.util.Map columnValueMap) { + if (columnValueMap == null) { + String msg = "The argument[columnValueMap] should not be null."; + throw new IllegalArgumentException(msg); + } + if (columnValueMap.isEmpty()) { + String msg = "The argument[columnValueMap] should not be empty."; + throw new IllegalArgumentException(msg); + } + } + } + + /** + * This class is for Internal. Don't use this! + */ + protected static class MapStringValueAnalyzer { + protected java.util.Map _valueMap; + + protected java.util.Set _modifiedPropertyNames; + + protected String _columnName; + + protected String _uncapPropName; + + protected String _propertyName; + + public MapStringValueAnalyzer( + java.util.Map valueMap, + java.util.Set modifiedPropertyNames) { + this._valueMap = valueMap; + this._modifiedPropertyNames = modifiedPropertyNames; + } + + public boolean init(String columnName, String uncapPropName, + String propertyName) { + this._columnName = columnName; + this._uncapPropName = uncapPropName; + this._propertyName = propertyName; + return _valueMap.containsKey(_columnName); + } + + public COLUMN_TYPE analyzeString( + Class javaType) { + final Object obj = _valueMap.get(_columnName); + if (obj == null) { + _modifiedPropertyNames.remove(_propertyName); + return null; + } + helpCheckingTypeString(obj, _uncapPropName, javaType.getName()); + return (COLUMN_TYPE) obj; + } + + public COLUMN_TYPE analyzeNumber( + Class javaType) { + final Object obj = _valueMap.get(_columnName); + if (obj == null) { + _modifiedPropertyNames.remove(_propertyName); + return null; + } + if (javaType.isAssignableFrom(obj.getClass())) { + return (COLUMN_TYPE) obj; + } + return (COLUMN_TYPE) newInstanceByConstructor(javaType, + String.class, obj.toString()); + } + + public COLUMN_TYPE analyzeDate(Class javaType) { + final Object obj = _valueMap.get(_columnName); + if (obj == null) { + _modifiedPropertyNames.remove(_propertyName); + return null; + } + if (javaType.isAssignableFrom(obj.getClass())) { + return (COLUMN_TYPE) obj; + } + return (COLUMN_TYPE) newInstanceByConstructor(javaType, long.class, + helpParsingDateString(obj, _uncapPropName, javaType + .getName())); + } + + public COLUMN_TYPE analyzeOther( + Class javaType) { + final Object obj = _valueMap.get(_columnName); + if (obj == null) { + _modifiedPropertyNames.remove(_propertyName); + return null; + } + return (COLUMN_TYPE) obj; + } + + private void helpCheckingTypeString(Object value, String uncapPropName, + String typeName) { + MapStringUtil.checkTypeString(value, uncapPropName, typeName); + } + + private long helpParsingDateString(Object value, String uncapPropName, + String typeName) { + return MapStringUtil.parseDateStringAsMillis(value, uncapPropName, + typeName); + } + + protected Object newInstanceByConstructor(Class targetType, + Class argType, Object arg) { + java.lang.reflect.Constructor constructor; + try { + constructor = targetType + .getConstructor(new Class[] { argType }); + } catch (SecurityException e) { + String msg = "targetType=" + targetType + " argType=" + argType + + " arg=" + arg; + throw new RuntimeException(msg, e); + } catch (NoSuchMethodException e) { + String msg = "targetType=" + targetType + " argType=" + argType + + " arg=" + arg; + throw new RuntimeException(msg, e); + } + try { + return constructor.newInstance(new Object[] { arg }); + } catch (IllegalArgumentException e) { + String msg = "targetType=" + targetType + " argType=" + argType + + " arg=" + arg; + throw new RuntimeException(msg, e); + } catch (InstantiationException e) { + String msg = "targetType=" + targetType + " argType=" + argType + + " arg=" + arg; + throw new RuntimeException(msg, e); + } catch (IllegalAccessException e) { + String msg = "targetType=" + targetType + " argType=" + argType + + " arg=" + arg; + throw new RuntimeException(msg, e); + } catch (java.lang.reflect.InvocationTargetException e) { + String msg = "targetType=" + targetType + " argType=" + argType + + " arg=" + arg; + throw new RuntimeException(msg, e); + } + } + } + + // =================================================================================== + // Assist Helper + // ============= + abstract protected void checkDowncast(Entity entity); + + protected String helpGettingColumnStringValue(Object value) { + if (value instanceof java.sql.Timestamp) { + return (value != null ? helpFormatingTimestamp((java.sql.Timestamp) value) + : ""); + } else if (value instanceof java.util.Date) { + return (value != null ? helpFormatingDate((java.util.Date) value) + : ""); + } else { + return (value != null ? value.toString() : ""); + } + } + + protected String helpFormatingDate(java.util.Date date) { + return MapStringUtil.formatDate(date); + } + + protected String helpFormatingTimestamp(java.sql.Timestamp timestamp) { + return MapStringUtil.formatTimestamp(timestamp); + } + + // =================================================================================== + // General Helper + // ============== + // ----------------------------------------------------- + // Reflection Handling + // ------------------- + protected boolean hasMethod(String methodName) { + assertStringNotNullAndNotTrimmedEmpty("methodName", methodName); + try { + this.getClass().getMethod(methodName, new Class[] {}); + return true; + } catch (NoSuchMethodException ignored) { + return false; + } + } + + // ----------------------------------------------------- + // String Handling + // --------------- + protected String initCap(String str) { + return SimpleStringUtil.initCap(str); + } + + // ----------------------------------------------------- + // Assert Object + // ------------- + /** + * Assert that the argument is not null. + * + * @param variableName Variable name. (NotNull) + * @param arg Argument. (NotNull) + */ + protected void assertObjectNotNull(String variableName, Object value) { + SimpleAssertUtil.assertObjectNotNull(variableName, value); + } + + // ----------------------------------------------------- + // Assert String + // ------------- + /** + * Assert that the string is not null and not trimmed empty. + * + * @param variableName Variable name. (NotNull) + * @param value Value. (NotNull) + */ + protected void assertStringNotNullAndNotTrimmedEmpty(String variableName, + String value) { + SimpleAssertUtil.assertStringNotNullAndNotTrimmedEmpty(variableName, + value); + } +} Property changes on: announcement/trunk/src/main/java/jp/sf/pal/announcement/db/allcommon/dbmeta/AbstractDBMeta.java ___________________________________________________________________ Name: svn:eol-style + native Added: announcement/trunk/src/main/java/jp/sf/pal/announcement/db/allcommon/dbmeta/DBMeta.java =================================================================== --- announcement/trunk/src/main/java/jp/sf/pal/announcement/db/allcommon/dbmeta/DBMeta.java (rev 0) +++ announcement/trunk/src/main/java/jp/sf/pal/announcement/db/allcommon/dbmeta/DBMeta.java 2008-06-30 02:54:27 UTC (rev 1002) @@ -0,0 +1,626 @@ +package jp.sf.pal.announcement.db.allcommon.dbmeta; + +import java.sql.Connection; +import java.util.List; +import java.util.Map; + +import jp.sf.pal.announcement.db.allcommon.Entity; +import jp.sf.pal.announcement.db.allcommon.dbmeta.info.ColumnInfo; +import jp.sf.pal.announcement.db.allcommon.dbmeta.info.ForeignInfo; +import jp.sf.pal.announcement.db.allcommon.dbmeta.info.ReferrerInfo; +import jp.sf.pal.announcement.db.allcommon.dbmeta.info.RelationInfo; +import jp.sf.pal.announcement.db.allcommon.dbmeta.info.UniqueInfo; +import jp.sf.pal.announcement.db.allcommon.helper.MapListString; +import jp.sf.pal.announcement.db.allcommon.helper.MapStringBuilder; + +/** + * The interface of dbmeta. + * + * @author DBFlute(AutoGenerator) + */ + @ SuppressWarnings("unchecked") +public interface DBMeta { + + // =================================================================================== + // Definition + // ========== + /** Map-string map-mark. */ + public static final String MAP_STRING_MAP_MARK = "map:"; + + /** Map-string list-mark. */ + public static final String MAP_STRING_LIST_MARK = "list:"; + + /** Map-string start-brace. */ + public static final String MAP_STRING_START_BRACE = "@{"; + + /** Map-string end-brace. */ + public static final String MAP_STRING_END_BRACE = "@}"; + + /** Map-string delimiter. */ + public static final String MAP_STRING_DELIMITER = "@;"; + + /** Map-string equal. */ + public static final String MAP_STRING_EQUAL = "@="; + + // =================================================================================== + // Table Name + // ========== + /** + * Get table db-name. + * + * @return Table db-name. (NotNull) + */ + public String getTableDbName(); + + /** + * Get table prop-name(JavaBeansRule). + * + * @return Table property-name(JavaBeansRule). (NotNull) + */ + public String getTablePropertyName(); + + // =================================================================================== + // Name Handling + // ============= + /** + * Has object of flexible name? {Target objects are TABLE and COLUMN} + * + * @param flexibleName The flexible name. (NotNull and NotEmpty) + * @return Determination. + */ + public boolean hasFlexibleName(String flexibleName); + + /** + * Find db name by flexible name. {Target objects are TABLE and COLUMN} + * + * @param flexibleName The flexible name. (NotNull and NotEmpty) + * @return Db name. (NotNull and NotEmpty) + */ + public String findDbName(String flexibleName); + + /** + * Find property name(JavaBeansRule) by flexible name. {Target objects are TABLE and COLUMN} + * + * @param flexibleName The flexible name. (NotNull and NotEmpty) + * @return Db name. (NotNull and NotEmpty) + */ + public String findPropertyName(String flexibleName); + + // =================================================================================== + // Name Map + // ======== + /** + * Get the key-to-lower map of DB name(lower) and property name. + * + * @return The key-to-lower map of DB name(lower) and property name. (NotNull) + */ + public Map getDbNamePropertyNameKeyToLowerMap(); + + /** + * Get the key-to-lower map of property name(lower) and db name. + * + * @return The key-to-lower map of property name(lower) and db name. (NotNull) + */ + public Map getPropertyNameDbNameKeyToLowerMap(); + + // =================================================================================== + // Type Name + // ========= + /** + * Get the type-name of entity. + * + * @return The type-name of entity. (NotNull) + */ + public String getEntityTypeName(); + + /** + * Get the type-name of condition-bean. + * + * @return The type-name of condition-bean. (Nullable: If the condition-bean does not exist) + */ + public String getConditionBeanTypeName(); + + /** + * Get the type-name of dao. + * + * @return The type-name of dao. (Nullable: If the dao does not exist) + */ + public String getDaoTypeName(); + + /** + * Get the type-name of behavior. + * + * @return The type-name of behavior. (Nullable: If the behavior does not exist) + */ + public String getBehaviorTypeName(); + + // =================================================================================== + // Object Type + // =========== + /** + * Get the type of entity. + * + * @return The type of entity. (NotNull) + */ + public Class getEntityType(); + + // =================================================================================== + // Object Instance + // =============== + /** + * New the instance of entity. + * + * @return The instance of entity. (NotNull) + */ + public Entity newEntity(); + + // =================================================================================== + // Column Info + // =========== + /** + * The implementation. + * + * @return The list of DB name of column. (NotNull and NotEmpty) + */ + public List getColumnInfoList(); + + /** + * Has column? + * + * @param columnFlexibleName The flexible name of the column. (NotNull) + * @return Determination. + */ + public boolean hasColumn(String columnFlexibleName); + + /** + * Find the information of the column by the flexible name of the column. + *
    +     * If the table name is 'BOOK_ID', you can find the dbmeta by ...(as follows)
    +     *     'BOOK_ID', 'BOok_iD', 'book_id'
    +     *     , 'BookId', 'bookid', 'bOoKiD'
    +     * 
    + * @param columnFlexibleName The flexible name of the column. (NotNull) + * @return The information of the column. (NotNull) + */ + public ColumnInfo findColumnInfo(String columnFlexibleName); + + // =================================================================================== + // Unique Info + // =========== + /** + * Get primary unique info. + * + * @return Primary unique info. (NotNull) + */ + public UniqueInfo getPrimaryUniqueInfo(); + + /** + * Has primary-key? + * + * @return Determination. + */ + public boolean hasPrimaryKey(); + + /** + * Has two or more primary-keys? + * + * @return Determination. + */ + public boolean hasTwoOrMorePrimaryKeys(); + + // =================================================================================== + // Relation Info + // ============= + // ----------------------------------------------------- + // Relation Element + // ---------------- + /** + * Find relation info. + * + * @param relationPropertyName Relation property name. (Both OK - InitCap or not). (NotNull) + * @return Relation info. (NotNull) + */ + public RelationInfo findRelationInfo(String relationPropertyName); + + // ----------------------------------------------------- + // Foreign Element + // --------------- + /** + * Has foreign? + * + * @param foreignPropName Foreign property name. (Both OK - InitCap or not). (NotNull) + * @return Determination. (NotNull) + */ + public boolean hasForeign(String foreignPropName); + + /** + * Find foreign dbmeta. + * + * @param foreignPropName Foreign property name. (Both OK - InitCap or not). (NotNull) + * @return Foreign DBMeta. (NotNull) + */ + public DBMeta findForeignDBMeta(String foreignPropName); + + /** + * Find foreign info. + * + * @param foreignPropName Foreign property name. (Both OK - InitCap or not). (NotNull) + * @return Foreign info. (NotNull) + */ + public ForeignInfo findForeignInfo(String foreignPropName); + + // ----------------------------------------------------- + // Referrer Element + // ---------------- + + /** + * Has referrer? + * + * @param referrerPropertyName The property name of referrer. (Both OK - InitCap or not). (NotNull) + * @return Determination. (NotNull) + */ + public boolean hasReferrer(String referrerPropertyName); + + /** + * Find referrer dbmeta. + * + * @param referrerPropertyName The property name of referrer. (Both OK - InitCap or not). (NotNull) + * @return Referrer DBMeta. (NotNull) + */ + public DBMeta findReferrerDBMeta(String referrerPropertyName); + + /** + * Find referrer information. + * + * @param referrerPropertyName The property name of referrer. (Both OK - InitCap or not). (NotNull) + * @return Referrer information. (NotNull) + */ + public ReferrerInfo findReferrerInfo(String referrerPropertyName); + + // ----------------------------------------------------- + // Relation Trace + // -------------- + /** + * Relation trace. + */ + public static interface RelationTrace { + + /** + * Get the trace of relation. + * + * @return The trace of relation as the list of relation info. (NotNull) + */ + public List getTraceRelation(); + + /** + * Get the trace of column. + * + * @return The trace of column as column info. (Nullable) + */ + public ColumnInfo getTraceColumn(); + } + + public static interface RelationTraceFixHandler { + public void handleFixedTrace(RelationTrace relationTrace); + } + + // =================================================================================== + // Sequence Info + // ============= + /** + * Has sequence? + * + * @return Determination. + */ + public boolean hasSequence(); + + // =================================================================================== + // Optimistic Lock Info + // ==================== + /** + * Has version no? + * + * @return Determination. + */ + public boolean hasVersionNo(); + + /** + * Has update date? + * + * @return Determination. + */ + public boolean hasUpdateDate(); + + // =================================================================================== + // Common Column Info + // ================== + /** + * Has common column? + * + * @return Determination. + */ + public boolean hasCommonColumn(); + + // =================================================================================== + // Entity Handling + // =============== + // ----------------------------------------------------- + // Accept + // ------ + /** + * Accept primary-key map. + * + * The column that column-value map-string doesn't have the value of is reflected as null. + * The column that column-value map-string doesn't have the key of is NOT updated nothing. + * + * @param entity Target entity. (NotNull) + * @param primaryKeyMap Primary-key map. (NotNull and NotEmpty) + */ + public void acceptPrimaryKeyMap(Entity entity, + Map primaryKeyMap); + + /** + * Accept primary-key map-string. + * + * The column that column-value map-string doesn't have the value of is reflected as null. + * The column that column-value map-string doesn't have the key of is NOT updated nothing. + * + * @param entity Target entity. (NotNull) + * @param primaryKeyMapString Primary-key map-string. (NotNull) + */ + public void acceptPrimaryKeyMapString(Entity entity, + String primaryKeyMapString); + + /** + * Accept column-value map. + * + * The column that column-value map-string doesn't have the value of is reflected as null. + * The column that column-value map-string doesn't have the key of is NOT updated nothing. + * + * @param entity Target entity. (NotNull) + * @param columnValueMap Column-value map. (NotNull and NotEmpty) + */ + public void acceptColumnValueMap(Entity entity, + Map columnValueMap); + + /** + * Accept column-value map-string. + * + * The column that column-value map-string doesn't have the value of is reflected as null. + * The column that column-value map-string doesn't have the key of is NOT updated nothing. + * + * @param entity Target entity. (NotNull) + * @param columnValueMapString Column-value map-string. (NotNull) + */ + public void acceptColumnValueMapString(Entity entity, + String columnValueMapString); + + // ----------------------------------------------------- + // Extract + // ------- + /** + * Extract primary-key map-string. Delimiter is at-mark and semicolon. + *

    + *

    +     * ex) Uses that this method have.
    +     *   final String primaryKeyMapString = LdBookDbm.extractPrimaryKeyMapString(entity);
    +     *   final LdBook entity = dao.selectEntity(new LdBookCB().acceptPrimaryKeyMapString(primaryKeyMapString));
    +     *   ... // as primary key for condition.
    +     * 
    + * + * @param entity Target entity. (NotNull) + * @return Primary-key map-string. (NotNull) + */ + public String extractPrimaryKeyMapString(Entity entity); + + /** + * Extract primary-key map-string. + * + * @param entity Target entity. (NotNull) + * @param startBrace Start-brace. (NotNull) + * @param endBrace End-brace. (NotNull) + * @param delimiter Delimiter. (NotNull) + * @param equal Equal. (NotNull) + * @return Primary-key map-string. (NotNull) + */ + public String extractPrimaryKeyMapString(Entity entity, String startBrace, + String endBrace, String delimiter, String equal); + + /** + * Extract column-value map-string. Delimiter is at-mark and semicolon. + * + * @param entity Target entity. (NotNull) + * @return Column-value map-string. (NotNull) + */ + public String extractColumnValueMapString(Entity entity); + + /** + * Extract column-value map-string. + * + * @param entity Target entity. (NotNull) + * @param startBrace Start-brace. (NotNull) + * @param endBrace End-brace. (NotNull) + * @param delimiter Delimiter. (NotNull) + * @param equal Equal. (NotNull) + * @return Column-value map-string. (NotNull) + */ + public String extractColumnValueMapString(Entity entity, String startBrace, + String endBrace, String delimiter, String equal); + + /** + * Extract common-column-value map-string. + * + * @param entity Target entity. (NotNull) + * @return Common-column-value map-string. (NotNull) + */ + public String extractCommonColumnValueMapString(Entity entity); + + /** + * Extract common-column-value map-string. + * + * @param entity Target entity. (NotNull) + * @param startBrace Start-brace. (NotNull) + * @param endBrace End-brace. (NotNull) + * @param delimiter Delimiter. (NotNull) + * @param equal Equal. (NotNull) + * @return Common-column-value map-string. (NotNull) + */ + public String extractCommonColumnValueMapString(Entity entity, + String startBrace, String endBrace, String delimiter, String equal); + + // ----------------------------------------------------- + // Convert + // ------- + /** + * Convert entity to column value as list. + * + * @param entity Target entity. (NotNull) + * @return The list of column value. (NotNull) + */ + public List convertToColumnValueList(Entity entity); + + /** + * Convert entity to column value as map. + * + * @param entity Target entity. (NotNull) + * @return The map of column value. (NotNull) + */ + public Map convertToColumnValueMap(Entity entity); + + /** + * Convert entity to column string-value as list. + * + * @param entity Target entity. (NotNull) + * @return The list of column string-value. (NotNull) + */ + public List convertToColumnStringValueList(Entity entity); + + /** + * Convert entity to column string-value as map. + * + * @param entity Target entity. (NotNull) + * @return The map of column string-value. (NotNull) + */ + public Map convertToColumnStringValueMap(Entity entity); + + // =================================================================================== + // JDBC Support + // ============ + /** + * Insert entity using specified connection. + * + * @param conn Connection. (NotNull) + * @param entity Entity. (NotNull) + * @return Prepared insert clause. (NotNull and NotEmpty) + */ + public int insertEntity(Connection conn, Entity entity); + + /** + * Insert entity using specified connection. + * + * @param conn Connection. (NotNull) + * @param entity Entity. (NotNull) + * @param preparedInsertClauseOption Prepared insert clause option. (NotNull) + * @return Prepared insert clause. (NotNull and NotEmpty) + */ + public int insertEntity(Connection conn, Entity entity, + PreparedInsertClauseOption preparedInsertClauseOption); + + /** + * Get prepared insert clause. + * + * @return Prepared insert clause. (NotNull and NotEmpty) + */ + public String getPreparedInsertClause(); + + /** + * Get prepared insert clause. + * + * @param preparedInsertClauseOption Prepared insert clause option. (NotNull) + * @return Prepared insert clause. (NotNull and NotEmpty) + */ + public String getPreparedInsertClause( + PreparedInsertClauseOption preparedInsertClauseOption); + + /** + * The option of prepared insert clause. + */ + public static class PreparedInsertClauseOption { + + /** Table prefix. */ + protected String _tablePrefix; + + /** + * Get table prefix. + * + * @return Table prefix. (Nullable) + */ + public String getTablePrefix() { + return this._tablePrefix; + } + + /** + * Set table prefix. + * + * @param tablePrefix Table prefix. (Nullable) + */ + public void setTablePrefix(String tablePrefix) { + this._tablePrefix = tablePrefix; + } + } + + // =================================================================================== + // Map String + // ========== + /** + * Create map list string that is prepared. (for INTERNAL) + * + * @return Map list string that is prepared. (NotNull) + */ + public MapListString createMapListString(); + + /** + * Create map string builder that is prepared. (for INTERNAL) + * + * @return Map string builder that is prepared. (NotNull) + */ + public MapStringBuilder createMapStringBuilder(); + + // =================================================================================== + // Entity Property Setup + // ===================== + // It's very INTERNAL! + + /** + * Has the setupper of entity property by the name of property?
    + * Comparing is so flexible. {Ignore cases and underscore} + * + * @param propertyName The name of the property. (NotNull) + * @return Determination. + */ + public boolean hasEntityPropertySetupper(String propertyName); + + /** + * Set up entity property. (for INTERNAL) + * + * @param propertyName The name of the property. (NotNull) + * @param entity The entity for the property. (NotNull) + * @param value The value of the property. (Nullable) + */ + public void setupEntityProperty(String propertyName, Object entity, + Object value); + + /** + * The setupper of entity property.
    + * This class is for Internal. Don't use this! + * @param The type of entity. + */ + public interface EntityPropertySetupper { + + /** + * @param entity Entity. (NotNull) + * @param value Value. (Nullable) + */ + void setup(ENTITY_TYPE entity, Object value); + } +} Property changes on: announcement/trunk/src/main/java/jp/sf/pal/announcement/db/allcommon/dbmeta/DBMeta.java ___________________________________________________________________ Name: svn:eol-style + native Added: announcement/trunk/src/main/java/jp/sf/pal/announcement/db/allcommon/dbmeta/DBMetaInstanceHandler.java =================================================================== --- announcement/trunk/src/main/java/jp/sf/pal/announcement/db/allcommon/dbmeta/DBMetaInstanceHandler.java (rev 0) +++ announcement/trunk/src/main/java/jp/sf/pal/announcement/db/allcommon/dbmeta/DBMetaInstanceHandler.java 2008-06-30 02:54:27 UTC (rev 1002) @@ -0,0 +1,160 @@ +package jp.sf.pal.announcement.db.allcommon.dbmeta; + +import java.util.Collections; +import java.util.LinkedHashMap; +import java.util.Map; + +import jp.sf.pal.announcement.db.allcommon.util.SimpleAssertUtil; + +/** + * DBMeta instance handler. + * + * @author DBFlute(AutoGenerator) + */ + @ SuppressWarnings("unchecked") +public class DBMetaInstanceHandler { + + // =================================================================================== + // Definition + // ========== + /** The key-to-lower map of DB-name and property-name for table. */ + protected static final Map _tableDbNamePropertyNameKeyToLowerMap; + static { + Map tmpMap = new LinkedHashMap(); + + tmpMap.put("ANNOUNCEMENT".toLowerCase(), "announcement"); + tmpMap.put("ANNOUNCEMENT_BODY".toLowerCase(), "announcementBody"); + + _tableDbNamePropertyNameKeyToLowerMap = Collections + .unmodifiableMap(tmpMap); + } + + /** The key-to-lower map of property-name and DB-name for table. */ + protected static final Map _tablePropertyNameDbNameKeyToLowerMap; + static { + Map tmpMap = new LinkedHashMap(); + + tmpMap.put("announcement".toLowerCase(), "ANNOUNCEMENT"); + tmpMap.put("announcementBody".toLowerCase(), "ANNOUNCEMENT_BODY"); + + _tablePropertyNameDbNameKeyToLowerMap = Collections + .unmodifiableMap(tmpMap); + } + + /** Table db-name instance map. */ + protected static final Map _tableDbNameInstanceMap; + static { + Map tmpMap = new LinkedHashMap(); + + tmpMap + .put( + "ANNOUNCEMENT", + getDBMeta("jp.sf.pal.announcement.db.bsentity.dbmeta.AnnouncementDbm")); + tmpMap + .put( + "ANNOUNCEMENT_BODY", + getDBMeta("jp.sf.pal.announcement.db.bsentity.dbmeta.AnnouncementBodyDbm")); + + _tableDbNameInstanceMap = Collections.unmodifiableMap(tmpMap); + } + + protected static DBMeta getDBMeta(String className) { + try { + Class clazz = Class.forName(className); + java.lang.reflect.Method methoz = clazz.getMethod("getInstance", + (Class[]) null); + Object result = methoz.invoke(null, (Object[]) null); + return (DBMeta) result; + } catch (Exception e) { + throw new RuntimeException(e); + } + } + + /** + * @return The map that contains instances of dbmeta. (NotNull & NotEmpty) + */ + public static Map getDBMetaMap() { + return _tableDbNameInstanceMap; + } + + // =================================================================================== + // Main Method + // =========== + /** + * Find dbmeta by table flexible-name. + *
    +     * If the table name is 'ORDER_DETAIL', you can find the dbmeta by ...(as follows)
    +     *     'ORDER_DETAIL', 'ORDer_DeTAiL', 'order_detail'
    +     *     , 'OrderDetail', 'orderdetail', 'oRderDetaIl'
    +     * 
    + * @param tableFlexibleName Table flexible-name. (NotNull) + * @return Instance. (NotNull) + */ + public static DBMeta findDBMeta(String tableFlexibleName) { + assertStringNotNullAndNotTrimmedEmpty("tableFlexibleName", + tableFlexibleName); + if (_tableDbNameInstanceMap.containsKey(tableFlexibleName)) { + return byTableDbName(tableFlexibleName); + } + String toLowerKey = tableFlexibleName.toLowerCase(); + if (_tableDbNamePropertyNameKeyToLowerMap.containsKey(toLowerKey)) { + String propertyName = (String) _tableDbNamePropertyNameKeyToLowerMap + .get(toLowerKey); + String dbName = (String) _tablePropertyNameDbNameKeyToLowerMap + .get(propertyName.toLowerCase()); + return byTableDbName(dbName); + } + if (_tablePropertyNameDbNameKeyToLowerMap.containsKey(toLowerKey)) { + String dbName = (String) _tablePropertyNameDbNameKeyToLowerMap + .get(toLowerKey); + return byTableDbName(dbName); + } + final int dotLastIndex = tableFlexibleName.lastIndexOf("."); + if (dotLastIndex >= 0) { + try { + return findDBMeta(tableFlexibleName.substring(dotLastIndex + 1)); + } catch (IllegalStateException e) { + // Nothing + } + } + String msg = "The instance map returned null by the key: key=" + + tableFlexibleName + " instanceMap=" + _tableDbNameInstanceMap; + throw new IllegalStateException(msg); + } + + /** + * Get instance by table db-name. + * + * @param tableDbName Table db-name. (NotNull) + * @return Instance. (NotNull) + */ + protected static DBMeta byTableDbName(String tableDbName) { + assertStringNotNullAndNotTrimmedEmpty("tableDbName", tableDbName); + DBMeta instance = (DBMeta) _tableDbNameInstanceMap.get(tableDbName); + if (instance == null) { + String msg = "The instance map returned null by the key: key=" + + tableDbName + " instanceMap=" + _tableDbNameInstanceMap; + throw new IllegalStateException(msg); + } + return instance; + } + + // =================================================================================== + // General Helper + // ============== + // ----------------------------------------------------- + // Assert Object + // ------------- + protected static void assertObjectNotNull(String variableName, Object value) { + SimpleAssertUtil.assertObjectNotNull(variableName, value); + } + + // ----------------------------------------------------- + // Assert String + // ------------- + protected static void assertStringNotNullAndNotTrimmedEmpty( + String variableName, String value) { + SimpleAssertUtil.assertStringNotNullAndNotTrimmedEmpty(variableName, + value); + } +} Property changes on: announcement/trunk/src/main/java/jp/sf/pal/announcement/db/allcommon/dbmeta/DBMetaInstanceHandler.java ___________________________________________________________________ Name: svn:eol-style + native Added: announcement/trunk/src/main/java/jp/sf/pal/announcement/db/allcommon/dbmeta/hierarchy/HierarchyArranger.java =================================================================== --- announcement/trunk/src/main/java/jp/sf/pal/announcement/db/allcommon/dbmeta/hierarchy/HierarchyArranger.java (rev 0) +++ announcement/trunk/src/main/java/jp/sf/pal/announcement/db/allcommon/dbmeta/hierarchy/HierarchyArranger.java 2008-06-30 02:54:27 UTC (rev 1002) @@ -0,0 +1,874 @@ +package jp.sf.pal.announcement.db.allcommon.dbmeta.hierarchy; + +import java.lang.reflect.Method; +import java.util.ArrayList; +import java.util.HashMap; +import java.util.List; +import java.util.Map; +import java.util.Set; + +import jp.sf.pal.announcement.db.allcommon.Entity; +import jp.sf.pal.announcement.db.allcommon.dbmeta.DBMeta; +import jp.sf.pal.announcement.db.allcommon.dbmeta.info.ColumnInfo; +import jp.sf.pal.announcement.db.allcommon.dbmeta.info.ForeignInfo; +import jp.sf.pal.announcement.db.allcommon.dbmeta.info.ReferrerInfo; +import jp.sf.pal.announcement.db.allcommon.dbmeta.info.RelationInfo; + +/** + * The arranger of hierarchy. + *
    + * ex) LIBRARY Hierarchy
    + * 
    + * LIBRARY
    + *  |1
    + *  |--* NEXT_LIBRARY (Referrer)
    + *  |       |*
    + *  |       |--1 LIBRARY (Foreign)
    + *  |
    + *  |--* COLLECTION (Referrer)
    + *  |       |1 
    + *  |       |--1 COLLECTION_STATUS (Referrer)
    + *  |       |       |*
    + *  |       |       |--1 COLLECTION_STATUS_LOOKUP (Foreign)
    + *  |       |
    + *  |       |--1 BOOK (Foreign)
    + *  |       |     |*
    + *  |       |     |--1 AUTHOR (Foreign)
    + *  |       |     |--1 PUBLISER (Foreign)
    + *  |       |     |--1 GENRE (Foreign)
    + *  |       |           |*
    + *  |       |           |--1 GENRE (Foreign)
    + *  |       |
    + *  |       |--* LENDING_COLLECTION (Referrer)
    + *  |       |
    + *  |
    + *  |--* LIBRARY_USER (Referrer)
    + *         |*  |1
    + *         |   |--* LENDING (Referrer)
    + *         |         |1
    + *         |         |--* LENDING_COLLECTION (Referrer)
    + *         |
    + *         |--1 LB_USER (Foreign)
    + *                 |1
    + *                 |--* BLACK_LIST (Referrer)
    + *                         |1
    + *                         |--* BLACK_ACTION (Referrer)
    + *                                 |*
    + *                                 |--1 BLACK_ACTION_LOOKUP (Foreign)
    + *          
    + *          
    + * ex) The SQL of LIBRARY Hierarchy as FLAT
    + * 
    + * select library.LIBRARY_ID as LIBRARY_ID
    + *      , library.LIBRARY_NAME as LIBRARY_NAME
    + *      , library.R_USER as R_USER
    + *      , library.R_TIMESTAMP as R_TIMESTAMP
    + *      , nextBase.LIBRARY_ID as BASE_LIBRARY_ID
    + *      , nextBase.NEXT_LIBRARY_ID as NEXT_LIBRARY_ID
    + *      , nextBaseNextLibrary.LIBRARY_ID as NEXT_LIBRARY_NEXT_LIBRARY_ID
    + *      , nextBaseNextLibrary.LIBRARY_NAME as NEXT_LIBRARY_NEXT_LIBRARY_NAME
    + *      , collection.COLLECTION_ID as COLLECTION_ID
    + *      , collection.ARRIVAL_DATE as COLLECTION_ARRIVAL_DATE
    + *      , collectionStatus.COLLECTION_ID as COLLECTION_STATUS_ID
    + *      , collectionStatus.COLLECTION_STATUS_CODE as COLLECTION_STATUS_CODE
    + *      , collectionStatusLookup.COLLECTION_STATUS_CODE as COLLECTION_STATUS_CODE
    + *      , collectionStatusLookup.COLLECTION_STATUS_NAME as COLLECTION_STATUS_NAME
    + *      , book.BOOK_ID as COLLECTION_BOOK_ID
    + *      , book.BOOK_NAME as COLLECTION_BOOK_NAME
    + *      , author.AUTHOR_ID as COLLECTION_BOOK_AUTHOR_ID
    + *      , author.AUTHOR_NAME as COLLECTION_BOOK_AUTHOR_NAME
    + *      , libraryUser.LIBRARY_ID as LIBRARY_USER_LIBRARY_ID 
    + *      , libraryUser.LB_USER_ID as LIBRARY_USER_LB_USER_ID
    + *      , lending.LIBRARY_ID as LENDING_LIBRARY_ID
    + *      , lending.LB_USER_ID as LENDING_LB_USER_ID
    + *      , lending.LENDING_DATE as LENDING_DATE
    + *      , lending.U_USER as LENDING_U_USER
    + *      , lending.U_MODULE as LENDING_U_MODULE
    + *      , lbUser.LB_USER_ID as LB_USER_ID
    + *      , lbUser.LB_USER_NAME as LB_USER_NAME
    + *   from LIBRARY library
    + *     left outer join NEXT_LIBRARY nextBase on library.LIBRARY_ID = nextBase.LIBRARY_ID
    + *       left outer join LIBRARY nextBaseNextLibrary on nextBase.NEXT_LIBRARY_ID = nextBaseNextLibrary.LIBRARY_ID
    + *     left outer join COLLECTION collection on library.LIBRARY_ID = collection.LIBRARY_ID
    + *       left outer join COLLECTION_STATUS collectionStatus on collection.COLLECTION_ID = collectionStatus.COLLECTION_ID
    + *         left outer join COLLECTION_STATUS_LOOKUP collectionStatusLookup on collectionStatus.COLLECTION_STATUS_CODE = collectionStatusLookup.COLLECTION_STATUS_CODE
    + *       left outer join BOOK book on collection.BOOK_ID = book.BOOK_ID
    + *         left outer join AUTHOR author on book.AUTHOR_ID = author.AUTHOR_ID
    + *     left outer join LIBRARY_USER libraryUser on library.LIBRARY_ID = libraryUser.LIBRARY_ID
    + *       left outer join LENDING lending on libraryUser.LIBRARY_ID = lending.LIBRARY_ID and libraryUser.LB_USER_ID = lending.LB_USER_ID
    + *       left outer join LB_USER lbUser on libraryUser.LB_USER_ID = lbUser.LB_USER_ID
    + * 
    + * 
    + * ex) Invoking Hierarchy Arranger
    + * 
    + * private List<Library> makeLibraryList() {
    + *     final HierarchyRequest<Library> request = createHierarchyRequest(createFlatLibraryList());
    + *     return new HierarchyArranger<Library>().arrangeHierarchy(request);
    + * }
    + * 
    + * 
    + * ex) Creating Hierarchy Request
    + * 
    + * private HierarchyRequest<Library> createHierarchsyRequest(java.util.List>HierarchyFlatLibrary> flatLibraryList) {
    + * 
    + *     // Define dbmeta.
    + *     final HierarchyFlatLibraryDbm sourceDbm = HierarchyFlatLibraryDbm.getInstance();
    + *
    + *     // Define hierarychy request as library.
    + *     final HierarchyRequest<Library> request = new HierarchyRequest<Library>(Library.class);
    + * 
    + *     // Register the list of source iterator. (by calling creator for flat library list)
    + *     request.registerSourceList(flatLibraryList);
    + *
    + *     // Create relation trace.
    + *     final LibraryRelationTrace trace = LibraryDbm.getInstance().createRelationTrace(null);
    + *     
    + *     // Register column [libraryId]
    + *     request.mapping(sourceDbm.columnLibraryId(), trace.columnLibraryId());
    + *
    + *     // Register column [libraryName]
    + *     request.mapping(sourceDbm.columnLibraryName(), trace.columnLibraryName());
    + *
    + *     // Register column [RUser]
    + *     request.mapping(sourceDbm.columnRUser(), trace.columnRUser());
    + *
    + *     // Register column [RTimestamp]
    + *     request.mapping(sourceDbm.columnRTimestamp(), trace.columnRTimestamp());
    + *
    + *     // Register column [baseLibraryId]
    + *     request.mapping(sourceDbm.columnBaseLibraryId(), trace.referrerNextLibraryByBaseIdList().columnLibraryId());
    + *
    + *     // Register column [nextLibraryId]
    + *     request.mapping(sourceDbm.columnNextLibraryId(), trace.referrerNextLibraryByBaseIdList().columnNextLibraryId());
    + *
    + *     // Register column [nextLibraryNextLibraryId]
    + *     request.mapping(sourceDbm.columnNextLibraryNextLibraryId(), trace.referrerNextLibraryByBaseIdList().foreignLibraryByNextId().columnLibraryId());
    + *
    + *     // Register column [nextLibraryNextLibraryName]
    + *     request.mapping(sourceDbm.columnNextLibraryNextLibraryName(), trace.referrerNextLibraryByBaseIdList().foreignLibraryByNextId().columnLibraryName());
    + *
    + *     // Register column [collectionId]
    + *     request.mapping(sourceDbm.columnCollectionId(), trace.referrerCollectionList().columnCollectionId());
    + *
    + *     // Register column [arrivalDate]
    + *     request.mapping(sourceDbm.columnCollectionArrivalDate(), trace.referrerCollectionList().columnArrivalDate());
    + *
    + *     // Register column [collectionStatusId]
    + *     request.mapping(sourceDbm.columnCollectionStatusId(), trace.referrerCollectionList().foreignCollectionStatusAsOne().columnCollectionId());
    + *
    + *     // Register column [collectionStatusCode]
    + *     request.mapping(sourceDbm.columnCollectionStatusCode(), trace.referrerCollectionList().foreignCollectionStatusAsOne().foreignCollectionStatusLookup().columnCollectionStatusCode());
    + *
    + *     // Register column [collectionStatusName]
    + *     request.mapping(sourceDbm.columnCollectionStatusName(), trace.referrerCollectionList().foreignCollectionStatusAsOne().foreignCollectionStatusLookup().columnCollectionStatusName());
    + *
    + *     // Register column [collectionBookId]
    + *     request.mapping(sourceDbm.columnCollectionBookId(), trace.referrerCollectionList().foreignBook().columnBookId());
    + *
    + *     // Register column [collectionBookName]
    + *     request.mapping(sourceDbm.columnCollectionBookName(), trace.referrerCollectionList().foreignBook().columnBookName());
    + *
    + *     // Register column [collectionBookAuthorId]
    + *     request.mapping(sourceDbm.columnCollectionBookAuthorId(), trace.referrerCollectionList().foreignBook().foreignAuthor().columnAuthorId());
    + *
    + *     // Register column [collectionBookAuthorName]
    + *     request.mapping(sourceDbm.columnCollectionBookAuthorName(), trace.referrerCollectionList().foreignBook().foreignAuthor().columnAuthorName());
    + *
    + *     // Register column [libraryUserLibraryId]
    + *     request.mapping(sourceDbm.columnLibraryUserLibraryId(), trace.referrerLibraryUserList().columnLibraryId());
    + *
    + *     // Register column [libraryUserLbUserId]
    + *     request.mapping(sourceDbm.columnLibraryUserLbUserId(), trace.referrerLibraryUserList().columnLbUserId());
    + *
    + *     // Register column [lendingLibraryId]
    + *     request.mapping(sourceDbm.columnLendingLibraryId(), trace.referrerLibraryUserList().referrerLendingList().columnLibraryId());
    + *
    + *     // Register column [lendingLbUserId]
    + *     request.mapping(sourceDbm.columnLendingLbUserId(), trace.referrerLibraryUserList().referrerLendingList().columnLbUserId());
    + *
    + *     // Register column [lendingDate]
    + *     request.mapping(sourceDbm.columnLendingDate(), trace.referrerLibraryUserList().referrerLendingList().columnLendingDate());
    + *
    + *     // Register column [lendingUUser]
    + *     request.mapping(sourceDbm.columnLendingUUser(), trace.referrerLibraryUserList().referrerLendingList().columnUUser());
    + *
    + *     // Register column [lendingUModule]
    + *     request.mapping(sourceDbm.columnLendingUModule(), trace.referrerLibraryUserList().referrerLendingList().columnUModule());
    + *
    + *     // Register column [lbUserId]
    + *     request.mapping(sourceDbm.columnLbUserId(), trace.referrerLibraryUserList().foreignLbUser().columnLbUserId());
    + *
    + *     // Register column [lbUserName]
    + *     request.mapping(sourceDbm.columnLbUserName(), trace.referrerLibraryUserList().foreignLbUser().columnLbUserName());
    + *
    + *     return request;
    + * }
    + * 
    + * private java.util.List>HierarchyFlatLibrary> createFlatLibraryList() {
    + *     (...select and get list)
    + *     return flatLibraryList;
    + * }
    + * 
    + * 
    + * === Relation Trace Tips ===
    + * 
    + *   RelationTrace.f + [Code Assist] -- go to Foreign
    + *   RelationTrace.r + [Code Assist] -- go to Referrer
    + *   RelationTrace.c + [Code Assist] -- end relation by Column
    + *
    + * 
    + * 
    + * @author DBFlute(AutoGenerator)
    + * @param  The type of local entity extends Entity
    + */
    + @ SuppressWarnings("unchecked")
    +public class HierarchyArranger {
    +
    +    // ===================================================================================
    +    //                                                                                Main
    +    //                                                                                ====
    +    /**
    +     * Arrange hierarchy.
    +     * 
    +     * @param request Hierarchy request. (NotNull)
    +     * @return The list of local entity. (NotNull)
    +     */
    +    public List arrangeHierarchy(
    +            HierarchyRequest request) {
    +        final List localTableList = new ArrayList();
    +        final Map alreadyRegisteredEntityMap = new HashMap();
    +
    +        // ============
    +        // Record Loop!
    +        // ============
    +        final HierarchySourceIterator sourceIterator = request
    +                .getSourceIterator();
    +        while (sourceIterator.hasNext()) {
    +            final HierarchySourceRow sourceRow = sourceIterator.next();
    +            final TopInfo topInfo = new TopInfo();
    +            topInfo.setHierarchyRequest(request);
    +            topInfo.setSourceRow(sourceRow);
    +            topInfo.setAlreadyRegisteredEntityMap(alreadyRegisteredEntityMap);
    +
    +            final Map primaryKeyMap = extractTopPrimaryKeyMapFromSource(topInfo);
    +            final String alreadyRegisteredKey = buildTopAlreadyRegisteredKey(primaryKeyMap);
    +            if (alreadyRegisteredEntityMap.containsKey(alreadyRegisteredKey)) {
    +                final Entity localEntity = alreadyRegisteredEntityMap
    +                        .get(alreadyRegisteredKey);
    +                topInfo.setLocalEntity(localEntity);
    +            } else {
    +                // Make local entity and register it to the result list.
    +                final LOCAL_ENTITY localEntity = newLocalEntity(request
    +                        .getDestinationDBMeta());
    +                topInfo.setLocalEntity(localEntity);
    +                localTableList.add(localEntity);
    +                alreadyRegisteredEntityMap.put(alreadyRegisteredKey,
    +                        localEntity);
    +            }
    +
    +            // ============
    +            // Column Loop!
    +            // ============
    +            doColumnLoop(topInfo);
    +        }
    +
    +        // Clear modified properties.
    +        final java.util.Set alreadyRegisteredEntityKeySet = alreadyRegisteredEntityMap
    +                .keySet();
    +        for (String key : alreadyRegisteredEntityKeySet) {
    +            final Entity currentRegisteredEntity = alreadyRegisteredEntityMap
    +                    .get(key);
    +            currentRegisteredEntity.clearModifiedPropertyNames();
    +        }
    +
    +        return localTableList;
    +    }
    +
    +    /**
    +     * Build top already-registered key.
    +     * 
    +     * @param primaryKeyMap The map of primary key. (NotNull)
    +     * @return Top already-registered key. (NotNull)
    +     */
    +    protected String buildTopAlreadyRegisteredKey(
    +            Map primaryKeyMap) {
    +        return HierarchyRequestElement.TOP_KEY + ":" + primaryKeyMap;
    +    }
    +
    +    /**
    +     * Do column loop.
    +     * 
    +     * @param topInfo The information object of top that has generics of the type of local entity. (NotNull)
    +     */
    +    protected void doColumnLoop(TopInfo topInfo) {
    +        final HierarchyRequest request = topInfo
    +                .getHierarchyRequest();
    +        final Entity localEntity = topInfo.getLocalEntity();
    +        final List requestElementList = request
    +                .getRequestElementList();
    +
    +        // ============
    +        // Column Loop!
    +        // ============
    +        for (HierarchyRequestElement requestElement : requestElementList) {
    +            final List relationPropertyNameList = requestElement
    +                    .getRelationPropertyNameList();
    +
    +            // If the column belongs to local entity, inject the value to entity and continue loop.
    +            if (relationPropertyNameList == null
    +                    || relationPropertyNameList.isEmpty()) {
    +                final HierarchySourceColumn sourceColumn = requestElement
    +                        .getSourceColumnInfo();
    +                final HierarchySourceRow sourceRow = topInfo.getSourceRow();
    +                final Object sourceColumnValue = extractColumnValueFromSource(
    +                        sourceRow, sourceColumn);
    +                final ColumnInfo destinationColumnInfo = requestElement
    +                        .getDestinationColumnInfo();
    +                injectColumnValueToDestinationIfNotNull(localEntity,
    +                        destinationColumnInfo, sourceColumnValue);
    +                continue;
    +            }
    +
    +            // ==============
    +            // Relation Loop!
    +            // ==============
    +            doRelationLoop(topInfo, requestElement, relationPropertyNameList);
    +        }
    +    }
    +
    +    /**
    +     * Do relation loop.
    +     * 
    +     * @param topInfo The information object of top that has generics of local entity. (NotNull)
    +     * @param requestElement The element of request. This is relation loop resource. (NotNull)
    +     * @param relationPropNameList The list of relation property name that has generics of string. (NotNull)
    +     */
    +    protected void doRelationLoop(TopInfo topInfo,
    +            HierarchyRequestElement requestElement,
    +            java.util.List relationPropNameList) {
    +        final HierarchyRequest request = topInfo
    +                .getHierarchyRequest();
    +        final Map alreadyRegisteredEntityMap = topInfo
    +                .getAlreadyRegisteredEntityMap();
    +
    +        // Temporary variables for local
    +        Entity localEntity = topInfo.getLocalEntity();// as Default
    +        DBMeta localDBMeta = request.getDestinationDBMeta();// as Default
    +        String localRelationPath = HierarchyRequestElement.TOP_KEY;// as Default
    +
    +        // ==============
    +        // Relation Loop!
    +        // ==============
    +        final StringBuilder relationPropKeyStringBuilder = new StringBuilder();
    +        int relationLoopCount = 0;
    +        for (String relationPropName : relationPropNameList) {
    +            if (relationPropKeyStringBuilder.length() > 0) {
    +                relationPropKeyStringBuilder.append("_");
    +            }
    +            relationPropKeyStringBuilder.append(relationPropName);
    +            final String targetRelationPath = relationPropKeyStringBuilder
    +                    .toString();
    +            final RelationInfo relationInfo = localDBMeta
    +                    .findRelationInfo(relationPropName);
    +
    +            final Map targetPrimaryKeyMap;
    +            final String alreadyRegisteredEntityKey;
    +            if (!relationInfo.isReferrer()) {
    +                // =======
    +                // Foreign
    +                // =======
    +                final ForeignInfo foreignInfo = localDBMeta
    +                        .findForeignInfo(relationPropName);
    +                final String foreignPropName = foreignInfo
    +                        .getForeignPropertyName();
    +
    +                // - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
    +                // If the value of primary key does not exist, break this relation path!
    +                // - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
    +                if (isNotExistPrimaryKey(topInfo, targetRelationPath)) {
    +                    break;
    +                }
    +
    +                targetPrimaryKeyMap = extractPrimaryKeyMapFromSource(topInfo,
    +                        targetRelationPath);
    +                alreadyRegisteredEntityKey = targetRelationPath + ":"
    +                        + targetPrimaryKeyMap.toString();
    +                if (!alreadyRegisteredEntityMap
    +                        .containsKey(alreadyRegisteredEntityKey)) {
    +                    // - - - - - - - - - - - - - - - - - - - - - - -
    +                    // Initialize the foreign entity and inject it.
    +                    // - - - - - - - - - - - - - - - - - - - - - - -
    +                    final Entity foreignEntity = foreignInfo.getForeignDBMeta()
    +                            .newEntity();
    +                    injectForeignEntity(localEntity, foreignPropName,
    +                            foreignEntity);
    +
    +                    // - - - - - - - - - - - - - - - - - -
    +                    // Initialize primary key of foreign.
    +                    // - - - - - - - - - - - - - - - - - -
    +                    injectForeignPrimaryKey(foreignEntity, targetPrimaryKeyMap);
    +
    +                    // - - - - - - - - - - - - - - - - - -
    +                    // Initialize foreign key of local.
    +                    // - - - - - - - - - - - - - - - - - -
    +                    injectLocalForeignKey(topInfo, localEntity, foreignInfo,
    +                            targetRelationPath);
    +
    +                    // - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
    +                    // Put foreign entity to the map of already-registered-entity.
    +                    // - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
    +                    alreadyRegisteredEntityMap.put(alreadyRegisteredEntityKey
    +                            .toString(), foreignEntity);
    +                } else {
    +                    // - - - - - - - - - - - - - -
    +                    // Inject the foreign entity.
    +                    // - - - - - - - - - - - - - -
    +                    final Entity foreignEntity = alreadyRegisteredEntityMap
    +                            .get(alreadyRegisteredEntityKey);
    +                    injectForeignEntity(localEntity, foreignPropName,
    +                            foreignEntity);
    +                }
    +            } else {
    +                // =======
    +                // Referrer
    +                // =======
    +                final ReferrerInfo referrerInfo = localDBMeta
    +                        .findReferrerInfo(relationPropName);
    +
    +                // - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
    +                // Extract referrer list from current local entity and initialize it if needs.
    +                // - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
    +                List referrerList = extractReferrerList(localEntity,
    +                        referrerInfo);
    +                if (referrerList == null) {
    +                    String msg = "The referrer list should not be null: localEntity="
    +                            + localEntity + " referrerInfo=" + referrerInfo;
    +                    throw new IllegalStateException(msg);
    +                }
    +
    +                // - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
    +                // If the value of primary key does not exist, break this relation path!
    +                // - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
    +                if (isNotExistPrimaryKey(topInfo, targetRelationPath)) {
    +                    break;
    +                }
    +
    +                targetPrimaryKeyMap = extractPrimaryKeyMapFromSource(topInfo,
    +                        targetRelationPath);
    +                alreadyRegisteredEntityKey = targetRelationPath + ":"
    +                        + targetPrimaryKeyMap.toString();
    +                if (!alreadyRegisteredEntityMap
    +                        .containsKey(alreadyRegisteredEntityKey)) {
    +                    // - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
    +                    // Initialize referrer entity and register it to the list of referrer with primary key value.
    +                    // - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
    +                    final Entity referrerEntity = relationInfo
    +                            .getTargetDBMeta().newEntity();
    +                    referrerList.add(referrerEntity);
    +
    +                    // - - - - - - - - - - - - - - - - - -
    +                    // Initialize primary key of referrer.
    +                    // - - - - - - - - - - - - - - - - - -
    +                    injectReferrerPrimaryKey(referrerEntity,
    +                            targetPrimaryKeyMap);
    +
    +                    // - - - - - - - - - - - - - - - - - -
    +                    // Initialize foreign key of referrer.
    +                    // - - - - - - - - - - - - - - - - - -
    +                    injectReferrerForeignKey(topInfo, referrerEntity,
    +                            referrerInfo, localRelationPath);
    +
    +                    // - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
    +                    // Put referrer entity to the map of already-registered-entity.
    +                    // - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
    +                    alreadyRegisteredEntityMap.put(alreadyRegisteredEntityKey
    +                            .toString(), referrerEntity);
    +                }
    +            }
    +
    +            // - - - - - - - - - - - - - - - - - -
    +            // Set next value to current element.
    +            // - - - - - - - - - - - - - - - - - -
    +            localEntity = alreadyRegisteredEntityMap
    +                    .get(alreadyRegisteredEntityKey);
    +            localDBMeta = localEntity.getDBMeta();
    +            localRelationPath = targetRelationPath;
    +
    +            if (relationLoopCount == (relationPropNameList.size() - 1)) {// The last loop!
    +                // - - - - - - - - - - - -  
    +                // Here is the last loop!
    +                // - - - - - - - - - - - - 
    +                doLastLoopInjection(topInfo, requestElement, localEntity,
    +                        targetPrimaryKeyMap);
    +            }
    +            ++relationLoopCount;
    +        }
    +    }
    +
    +    /**
    +     * Is not existing primary key at the relation path?.
    +     * 
    +     * @param topInfo The information object of top that has generics of local entity. (NotNull)
    +     * @param relationPath The path of relation. (NotNull)
    +     * @return Determination.
    +     */
    +    protected boolean isNotExistPrimaryKey(TopInfo topInfo,
    +            String relationPath) {
    +        final Map primaryKeyMap = extractPrimaryKeyMapFromSource(
    +                topInfo, relationPath);
    +        final Set keySet = primaryKeyMap.keySet();
    +        for (String key : keySet) {
    +            final Object value = primaryKeyMap.get(key);
    +            if (value == null) {
    +                return true;
    +            }
    +        }
    +        return false;
    +    }
    +
    +    /**
    +     * Do last loop injection.
    +     * 
    +     * @param topInfo The information object of top that has generics of local entity. (NotNull)
    +     * @param requestElement The element of request. This is relation loop resource. (NotNull)
    +     * @param localEntity The interface of local entity. (NotNull)
    +     * @param primaryKeyMap The map of primary key. (NotNull)
    +     */
    +    protected void doLastLoopInjection(TopInfo topInfo,
    +            HierarchyRequestElement requestElement, Entity localEntity,
    +            Map primaryKeyMap) {
    +        final ColumnInfo destinationColumnInfo = requestElement
    +                .getDestinationColumnInfo();
    +        if (!primaryKeyMap.containsKey(destinationColumnInfo.getColumnDbName())) {// The column is primary key!
    +            final HierarchySourceRow sourceRow = topInfo.getSourceRow();
    +            final HierarchySourceColumn sourceColumnInfo = requestElement
    +                    .getSourceColumnInfo();
    +            final Object sourceColumnValue = extractColumnValueFromSource(
    +                    sourceRow, sourceColumnInfo);
    +            if (sourceColumnValue != null) {
    +                injectColumnValueToDestinationIfNotNull(localEntity,
    +                        destinationColumnInfo, sourceColumnValue);
    +            }
    +        }
    +    }
    +
    +    // ===================================================================================
    +    //                                                                       Extract Logic
    +    //                                                                       =============
    +    protected Map extractTopPrimaryKeyMapFromSource(
    +            TopInfo topInfo) {
    +        return extractPrimaryKeyMapFromSource(topInfo,
    +                HierarchyRequestElement.TOP_KEY);
    +    }
    +
    +    protected Map extractPrimaryKeyMapFromSource(
    +            TopInfo topInfo, String relationPath) {
    +        final HierarchyRequest request = topInfo
    +                .getHierarchyRequest();
    +        final HierarchySourceRow sourceRow = topInfo.getSourceRow();
    +        final java.util.List primaryKeyElement = request
    +                .findPrimaryKeyElement(relationPath);
    +        final java.util.Map primaryKeyMap = new java.util.LinkedHashMap();
    +        for (HierarchyRequestElement element : primaryKeyElement) {
    +            final HierarchySourceColumn sourcePrimaryKey = element
    +                    .getSourceColumnInfo();
    +            final Object sourcePrimaryKeyValue = extractColumnValueFromSource(
    +                    sourceRow, sourcePrimaryKey);
    +            primaryKeyMap.put(element.getDestinationColumnInfo()
    +                    .getColumnDbName(), sourcePrimaryKeyValue);
    +        }
    +        return primaryKeyMap;
    +    }
    +
    +    protected Object extractColumnValueFromSource(HierarchySourceRow sourceRow,
    +            HierarchySourceColumn sourceColumn) {
    +        return sourceRow.extractColumnValue(sourceColumn);
    +    }
    +
    +    @SuppressWarnings("unchecked")
    +    protected java.util.List extractReferrerList(Entity entity,
    +            ReferrerInfo referrerInfo) {
    +        return (java.util.List) invoke(referrerInfo.findGetter(),
    +                entity, new Object[] {});
    +    }
    +
    +    // ===================================================================================
    +    //                                                                        Inject Logic
    +    //                                                                        ============
    +    /**
    +     * @param entity Entity. (NotNull)
    +     * @param columnInfo Column info. (NotNull)
    +     * @param columnValue Column value. (NotNull)
    +     */
    +    protected void injectColumnValueToDestinationIfNotNull(Entity entity,
    +            ColumnInfo columnInfo, final Object columnValue) {
    +        if (columnValue != null) {
    +            injectColumnValueToDestination(entity,
    +                    columnInfo.getColumnDbName(), columnValue);
    +        }
    +    }
    +
    +    protected void injectColumnValueToDestination(Entity entity,
    +            String columnDbName, final Object columnValue) {
    +        if (columnValue == null) {
    +            String msg = "The argument[columnValue] should not be null: ";
    +            msg = msg + " table=" + entity.getTableDbName() + " column="
    +                    + columnDbName;
    +            throw new IllegalStateException(msg);
    +        }
    +        invoke(entity.getDBMeta().findColumnInfo(columnDbName).findSetter(),
    +                entity, new Object[] { columnValue });
    +    }
    +
    +    protected void injectColumnValueMapToDestination(Entity entity,
    +            final Map columnValueMap) {
    +        final Set columnNameSet = columnValueMap.keySet();
    +        for (String columnName : columnNameSet) {
    +            final Object columnValue = columnValueMap.get(columnName);
    +            injectColumnValueToDestination(entity, columnName, columnValue);
    +        }
    +    }
    +
    +    protected void injectForeignEntity(Entity entity, String foreignPropName,
    +            Entity foreignEntity) {
    +        final String capPropReferrerName = initCap(foreignPropName);
    +        final Method method = findMethod(entity.getClass(), "set"
    +                + capPropReferrerName, new Class[] { foreignEntity.getDBMeta()
    +                .getEntityType() });
    +        invoke(method, entity, new Object[] { foreignEntity });
    +    }
    +
    +    protected void injectReferrerList(Entity entity, ReferrerInfo referrerInfo,
    +            java.util.List referrerList) {
    +        invoke(referrerInfo.findSetter(), entity, new Object[] { referrerList });
    +    }
    +
    +    protected void injectForeignPrimaryKey(Entity foreignEntity,
    +            Map foreigPrimaryKeyMap) {
    +        injectColumnValueMapToDestination(foreignEntity, foreigPrimaryKeyMap);
    +    }
    +
    +    protected void injectReferrerPrimaryKey(Entity referrerEntity,
    +            Map referrerPrimaryKeyMap) {
    +        injectColumnValueMapToDestination(referrerEntity, referrerPrimaryKeyMap);
    +    }
    +
    +    protected void injectLocalForeignKey(TopInfo topInfo,
    +            Entity localEntity, ForeignInfo foreignInfo,
    +            String foreignRelationPath) {
    +        final HierarchyRequest request = topInfo
    +                .getHierarchyRequest();
    +        final Map foreignPrimaryKeyMap = extractPrimaryKeyMapFromSource(
    +                topInfo, foreignRelationPath);
    +        final List primaryKeyElementList = request
    +                .findPrimaryKeyElement(foreignRelationPath);
    +        final Map localForeignKeyMap = new HashMap();
    +        for (HierarchyRequestElement foreignElement : primaryKeyElementList) {
    +            final String foreignPrimaryKeyColumnName = foreignElement
    +                    .getDestinationColumnInfo().getColumnDbName();
    +            final ColumnInfo localForeignKeyInfo = foreignInfo
    +                    .findLocalByForeign(foreignPrimaryKeyColumnName);
    +            final Object localForeignKeyValue = foreignPrimaryKeyMap
    +                    .get(foreignPrimaryKeyColumnName);
    +            localForeignKeyMap.put(localForeignKeyInfo.getColumnDbName(),
    +                    localForeignKeyValue);
    +        }
    +        injectColumnValueMapToDestination(localEntity, localForeignKeyMap);
    +    }
    +
    +    protected void injectReferrerForeignKey(TopInfo topInfo,
    +            Entity referrerEntity, ReferrerInfo referrerInfo,
    +            String localRelationPath) {
    +        final HierarchyRequest request = topInfo
    +                .getHierarchyRequest();
    +        final Map localPrimaryKeyMap = extractPrimaryKeyMapFromSource(
    +                topInfo, localRelationPath);
    +        final List primaryKeyElementList = request
    +                .findPrimaryKeyElement(localRelationPath);
    +        final Map referrerForeignKeyMap = new HashMap();
    +        for (HierarchyRequestElement localElement : primaryKeyElementList) {
    +            final String localPrimaryKeyName = localElement
    +                    .getDestinationColumnInfo().getColumnDbName();
    +            final ColumnInfo referrerForeignKeyInfo = referrerInfo
    +                    .findReferrerByLocal(localPrimaryKeyName);
    +            final Object referrerForeignKeyValue = localPrimaryKeyMap
    +                    .get(localPrimaryKeyName);
    +            referrerForeignKeyMap.put(referrerForeignKeyInfo.getColumnDbName(),
    +                    referrerForeignKeyValue);
    +        }
    +        injectColumnValueMapToDestination(referrerEntity, referrerForeignKeyMap);
    +    }
    +
    +    // ===================================================================================
    +    //                                                                         Other Logic
    +    //                                                                         ===========
    +    @SuppressWarnings("unchecked")
    +    protected LOCAL_ENTITY newLocalEntity(final DBMeta destinationDBMeta) {
    +        final LOCAL_ENTITY localEntity;
    +        try {
    +            localEntity = (LOCAL_ENTITY) destinationDBMeta.getEntityType()
    +                    .newInstance();
    +        } catch (InstantiationException e) {
    +            throw new IllegalStateException(e);
    +        } catch (IllegalAccessException e) {
    +            throw new IllegalStateException(e);
    +        }
    +        return localEntity;
    +    }
    +
    +    // ===================================================================================
    +    //                                                                              Helper
    +    //                                                                              ======
    +    protected String initCap(final String name) {
    +        final String capPropReferrerName = name.substring(0, 1).toUpperCase()
    +                + name.substring(1);
    +        return capPropReferrerName;
    +    }
    +
    +    private java.lang.reflect.Method findMethod(Class clazz, String methodName,
    +            Class[] argTypes) {
    +        try {
    +            return clazz.getMethod(methodName, argTypes);
    +        } catch (NoSuchMethodException ex) {
    +            String msg = "class=" + clazz + " method=" + methodName + "-"
    +                    + java.util.Arrays.asList(argTypes);
    +            throw new RuntimeException(msg, ex);
    +        }
    +    }
    +
    +    private Object invoke(java.lang.reflect.Method method, Object target,
    +            Object[] args) {
    +        try {
    +            return method.invoke(target, args);
    +        } catch (RuntimeException e) {
    +            final String lineSeparator = System.getProperty("line.separator");
    +            final Class[] parameterTypes = method.getParameterTypes();
    +            String msg = "Invoking method threw the exception:" + lineSeparator;
    +            msg = msg
    +                    + "/* * * * * * * * * * * * * * * * * * * * * * * * * * * *"
    +                    + lineSeparator;
    +            msg = msg + "[" + method.getDeclaringClass().getSimpleName() + "."
    +                    + method.getName() + "()]" + lineSeparator;
    +            msg = msg + " methodArgTypes     = {"
    +                    + createTypeViewFromTypeArray(parameterTypes) + "}"
    +                    + lineSeparator;
    +            msg = msg + " specifiedArgValues = {"
    +                    + createValueViewFromValueArray(args) + "}" + lineSeparator;
    +            msg = msg + " specifiedArgTypes  = {"
    +                    + createTypeViewFromValueArray(args) + "}" + lineSeparator;
    +            if (parameterTypes.length > 0 && args.length > 0 && args[0] != null
    +                    && !parameterTypes[0].equals(args[0].getClass())) {
    +                msg = msg + " " + lineSeparator;
    +                final String compareString = "{" + parameterTypes[0] + " -- "
    +                        + args[0].getClass() + "}";
    +                msg = msg + " *Warning! The argType is ummatched: "
    +                        + compareString + lineSeparator;
    +            }
    +            msg = msg + "* * * * * * * * * */" + lineSeparator;
    +            throw new RuntimeException(msg, e);
    +        } catch (java.lang.reflect.InvocationTargetException ex) {
    +            Throwable t = ex.getCause();
    +            if (t instanceof RuntimeException) {
    +                throw (RuntimeException) t;
    +            }
    +            if (t instanceof Error) {
    +                throw (Error) t;
    +            }
    +            String msg = "target=" + target + " method=" + method + "-"
    +                    + java.util.Arrays.asList(args);
    +            throw new RuntimeException(msg, ex);
    +        } catch (IllegalAccessException ex) {
    +            String msg = "target=" + target + " method=" + method + "-"
    +                    + java.util.Arrays.asList(args);
    +            throw new RuntimeException(msg, ex);
    +        }
    +    }
    +
    +    private String createValueViewFromValueArray(Object[] array) {
    +        final StringBuffer sb = new StringBuffer();
    +        for (int i = 0; i < array.length; i++) {
    +            final Object value = array[i];
    +            if (sb.length() == 0) {
    +                sb.append(value);
    +            } else {
    +                sb.append(", ").append(value);
    +            }
    +        }
    +        return sb.toString();
    +    }
    +
    +    private String createTypeViewFromValueArray(Object[] array) {
    +        final StringBuffer sb = new StringBuffer();
    +        for (int i = 0; i < array.length; i++) {
    +            final Object value = array[i];
    +            final String typeName = value != null ? value.getClass()
    +                    .getSimpleName() : "null";
    +            if (sb.length() == 0) {
    +                sb.append(typeName);
    +            } else {
    +                sb.append(", ").append(typeName);
    +            }
    +        }
    +        return sb.toString();
    +    }
    +
    +    private String createTypeViewFromTypeArray(Class[] array) {
    +        final StringBuffer sb = new StringBuffer();
    +        for (int i = 0; i < array.length; i++) {
    +            final Class type = array[i];
    +            if (sb.length() == 0) {
    +                sb.append(type.getSimpleName());
    +            } else {
    +                sb.append(", ").append(type.getSimpleName());
    +            }
    +        }
    +        return sb.toString();
    +    }
    +
    +    // ===================================================================================
    +    //                                                                          Info Class
    +    //                                                                          ==========
    +    protected static class TopInfo {
    +        private HierarchyRequest hierarchyRequest;
    +
    +        private HierarchySourceRow sourceRow;
    +
    +        private Entity localEntity;
    +
    +        private Map alreadyRegisteredEntityMap;
    +
    +        public HierarchySourceRow getSourceRow() {
    +            return sourceRow;
    +        }
    +
    +        public void setSourceRow(HierarchySourceRow sourceRow) {
    +            this.sourceRow = sourceRow;
    +        }
    +
    +        public Entity getLocalEntity() {
    +            return localEntity;
    +        }
    +
    +        public void setLocalEntity(Entity localEntity) {
    +            this.localEntity = localEntity;
    +        }
    +
    +        public Map getAlreadyRegisteredEntityMap() {
    +            return alreadyRegisteredEntityMap;
    +        }
    +
    +        public void setAlreadyRegisteredEntityMap(
    +                Map alreadyRegisteredEntityMap) {
    +            this.alreadyRegisteredEntityMap = alreadyRegisteredEntityMap;
    +        }
    +
    +        public HierarchyRequest getHierarchyRequest() {
    +            return hierarchyRequest;
    +        }
    +
    +        public void setHierarchyRequest(
    +                HierarchyRequest hierarchyRequest) {
    +            this.hierarchyRequest = hierarchyRequest;
    +        }
    +    }
    +}
    
    
    Property changes on: announcement/trunk/src/main/java/jp/sf/pal/announcement/db/allcommon/dbmeta/hierarchy/HierarchyArranger.java
    ___________________________________________________________________
    Name: svn:eol-style
       + native
    
    Added: announcement/trunk/src/main/java/jp/sf/pal/announcement/db/allcommon/dbmeta/hierarchy/HierarchyBasicRequest.java
    ===================================================================
    --- announcement/trunk/src/main/java/jp/sf/pal/announcement/db/allcommon/dbmeta/hierarchy/HierarchyBasicRequest.java	                        (rev 0)
    +++ announcement/trunk/src/main/java/jp/sf/pal/announcement/db/allcommon/dbmeta/hierarchy/HierarchyBasicRequest.java	2008-06-30 02:54:27 UTC (rev 1002)
    @@ -0,0 +1,91 @@
    +package jp.sf.pal.announcement.db.allcommon.dbmeta.hierarchy;
    +
    +import jp.sf.pal.announcement.db.allcommon.Entity;
    +import jp.sf.pal.announcement.db.allcommon.dbmeta.DBMeta;
    +import jp.sf.pal.announcement.db.allcommon.dbmeta.info.ColumnInfo;
    +
    +/**
    + * The basic request of hierarchy.
    + * 
    + * @author DBFlute(AutoGenerator)
    + * @param  The type of local entity.
    + * @param  The type of local relation trace.
    + */
    + @ SuppressWarnings("unchecked")
    +public class HierarchyBasicRequest
    +        extends HierarchyRequest {
    +
    +    // ===================================================================================
    +    //                                                                           Attribute
    +    //                                                                           =========
    +    protected ColumnInfo _currentSourceColumnInfo;
    +
    +    // ===================================================================================
    +    //                                                                         Constructor
    +    //                                                                         ===========
    +    /**
    +     * Constructor.
    +     * 
    +     * @param localEntityType The type of local entity. (NotNull)
    +     */
    +    public HierarchyBasicRequest(Class localEntityType) {
    +        super(localEntityType);
    +    }
    +
    +    // ===================================================================================
    +    //                                                                         Easy-to-Use
    +    //                                                                         ===========
    +    // -----------------------------------------------------
    +    //                                                public
    +    //                                                ------
    +    /**
    +     * Set up source.
    +     * 
    +     * @param sourceColumnInfo The column info of source. (NotNull)
    +     * @return Destination relation trace. (NotNull)
    +     */
    +    public DestinationRelationTrace src(
    +            ColumnInfo sourceColumnInfo) {
    +        this._currentSourceColumnInfo = sourceColumnInfo;
    +        final HierarchyBasicRequest outer = this;
    +        return new DestinationRelationTrace() {
    +            public LOCAL_RELATION_TRACE dst() {
    +                return outer.dst();
    +            }
    +        };
    +    }
    +
    +    /**
    +     * Set up destination.
    +     * 
    +     * @return Local relation trace. (NotNull)
    +     */
    +    public LOCAL_RELATION_TRACE dst() {
    +        final DBMeta.RelationTraceFixHandler handler = new DBMeta.RelationTraceFixHandler() {
    +            public void handleFixedTrace(DBMeta.RelationTrace relationTrace) {
    +                mapping(_currentSourceColumnInfo, relationTrace);
    +            }
    +        };
    +        final Object target = destinationDBMeta;
    +        java.lang.reflect.Method method = null;
    +        try {
    +            method = target.getClass().getMethod("createRelationTrace",
    +                    new Class[] { DBMeta.RelationTraceFixHandler.class });
    +        } catch (NoSuchMethodException e) {
    +            String msg = "Not found method: method=createRelationTrace(DBMeta.RelationTraceFixHandler)";
    +            throw new IllegalStateException(msg, e);
    +        }
    +        try {
    +            return (LOCAL_RELATION_TRACE) method.invoke(target,
    +                    new Object[] { handler });
    +        } catch (IllegalAccessException e) {
    +            throw new IllegalStateException(e);
    +        } catch (java.lang.reflect.InvocationTargetException e) {
    +            throw new IllegalStateException(e.getCause());
    +        }
    +    }
    +
    +    public static interface DestinationRelationTrace {
    +        public LOCAL_RELATION_TRACE dst();
    +    }
    +}
    
    
    Property changes on: announcement/trunk/src/main/java/jp/sf/pal/announcement/db/allcommon/dbmeta/hierarchy/HierarchyBasicRequest.java
    ___________________________________________________________________
    Name: svn:eol-style
       + native
    
    Added: announcement/trunk/src/main/java/jp/sf/pal/announcement/db/allcommon/dbmeta/hierarchy/HierarchyRequest.java
    ===================================================================
    --- announcement/trunk/src/main/java/jp/sf/pal/announcement/db/allcommon/dbmeta/hierarchy/HierarchyRequest.java	                        (rev 0)
    +++ announcement/trunk/src/main/java/jp/sf/pal/announcement/db/allcommon/dbmeta/hierarchy/HierarchyRequest.java	2008-06-30 02:54:27 UTC (rev 1002)
    @@ -0,0 +1,343 @@
    +package jp.sf.pal.announcement.db.allcommon.dbmeta.hierarchy;
    +
    +import java.util.ArrayList;
    +import java.util.List;
    +
    +import jp.sf.pal.announcement.db.allcommon.Entity;
    +import jp.sf.pal.announcement.db.allcommon.dbmeta.DBMeta;
    +import jp.sf.pal.announcement.db.allcommon.dbmeta.hierarchy.basic.HierarchySourceEntityColumn;
    +import jp.sf.pal.announcement.db.allcommon.dbmeta.hierarchy.basic.HierarchySourceEntityListIterator;
    +import jp.sf.pal.announcement.db.allcommon.dbmeta.info.ColumnInfo;
    +import jp.sf.pal.announcement.db.allcommon.dbmeta.info.RelationInfo;
    +
    +/**
    + * The request of hierarchy.
    + * 
    + * @author DBFlute(AutoGenerator)
    + * @param  The type of local entity.
    + */
    + @ SuppressWarnings("unchecked")
    +public class HierarchyRequest {
    +
    +    // ===================================================================================
    +    //                                                                           Attribute
    +    //                                                                           =========
    +    /** The dbmeta of desination. */
    +    protected DBMeta destinationDBMeta;
    +
    +    /** The iterator of hierarychy source. */
    +    protected HierarchySourceIterator sourceIterator;
    +
    +    /** The list of request element. */
    +    protected List requestElementList = new ArrayList();
    +
    +    /** The set of already registered source column info for check. */
    +    protected java.util.Set alreadyRegisteredSourceColumnInfoSet4Check = new java.util.HashSet();
    +
    +    /** First source column info for check. */
    +    protected ColumnInfo firstSourceColumnInfo4Check;
    +
    +    // ===================================================================================
    +    //                                                                         Constructor
    +    //                                                                         ===========
    +    /**
    +     * Constructor.
    +     * 
    +     * @param localEntityType The type of local entity. (NotNull)
    +     */
    +    public HierarchyRequest(Class localEntityType) {
    +        LOCAL_ENTITY localEntity;
    +        try {
    +            localEntity = localEntityType.newInstance();
    +        } catch (InstantiationException e) {
    +            String msg = "localEntityType.newInstance() threw the InstantiationException:";
    +            msg = msg + " localEntityType=" + localEntityType;
    +            throw new IllegalStateException(msg, e);
    +        } catch (IllegalAccessException e) {
    +            String msg = "localEntityType.newInstance() threw the IllegalAccessException:";
    +            msg = msg + " localEntityType=" + localEntityType;
    +            throw new IllegalStateException(msg, e);
    +        }
    +        destinationDBMeta = localEntity.getDBMeta();
    +    }
    +
    +    // ===================================================================================
    +    //                                                                         Easy-to-Use
    +    //                                                                         ===========
    +    // -----------------------------------------------------
    +    //                                                public
    +    //                                                ------
    +    /**
    +     * Register the list of source. 
    + * This method uses the default source iterator. + * + * @param sourceList The list of source. (NotNull) + * @param The type of source. (NotNull) + */ + public void registerSourceList(java.util.List sourceList) { + sourceIterator = createDefaultSourceIterator(sourceList); + } + + /** + * Set up mapping between the source column and the destination relation. + * + * @param sourceColumn The column of source. (NotNull) + * @param relationTrace The relation trace of destination. (NotNull) + */ + public void mapping(HierarchySourceColumn sourceColumn, + DBMeta.RelationTrace relationTrace) { + setupElement(sourceColumn, relationTrace.getTraceColumn()); + addRelationToLastElement(relationTrace.getTraceRelation()); + } + + /** + * Set up mapping between the source column and the destination relation. + * + * @param sourceColumnInfo The column info of source. (NotNull) + * @param relationTrace The relation trace of destination. (NotNull) + */ + public void mapping(ColumnInfo sourceColumnInfo, + DBMeta.RelationTrace relationTrace) { + setupElement(sourceColumnInfo, relationTrace.getTraceColumn()); + addRelationToLastElement(relationTrace.getTraceRelation()); + } + + // ----------------------------------------------------- + // internal + // ------- + /** + * Set up element. + * + * @param sourceColumn The column of source. (NotNull) + * @param destinationColumnInfo The column info of destination. (NotNull) + */ + protected void setupElement(HierarchySourceColumn sourceColumn, + ColumnInfo destinationColumnInfo) { + assertSameLocalDestinationDBMeta(destinationColumnInfo); + final HierarchyRequestElement element = new HierarchyRequestElement(); + requestElementList.add(element); + element.mapping(sourceColumn, destinationColumnInfo); + element.setDestinationDBMeta(destinationColumnInfo.getDBMeta()); + } + + /** + * Set up element.
    + * This method uses the default source column. + * + * @param sourceColumnInfo The column info of source. (NotNull) + * @param destinationColumnInfo The column info of destination. (NotNull) + */ + protected void setupElement(ColumnInfo sourceColumnInfo, + ColumnInfo destinationColumnInfo) { + if (alreadyRegisteredSourceColumnInfoSet4Check + .contains(sourceColumnInfo)) { + String msg = "The wrong sourceColumnInfo!" + getLineSeparator(); + msg = msg + + "/* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * *" + + getLineSeparator(); + msg = msg + "The source column has already been registered:" + + getLineSeparator(); + msg = msg + "- - - - -" + getLineSeparator(); + msg = msg + " sourceColumnInfo=" + sourceColumnInfo + + getLineSeparator(); + msg = msg + " registeredColumnInfo=" + + alreadyRegisteredSourceColumnInfoSet4Check + + getLineSeparator(); + msg = msg + "* * * * * * * * * */" + getLineSeparator(); + throw new IllegalStateException(msg); + } + alreadyRegisteredSourceColumnInfoSet4Check.add(sourceColumnInfo); + assertSameSourceDBMeta(sourceColumnInfo); + assertSameLocalDestinationDBMeta(destinationColumnInfo); + final HierarchyRequestElement element = new HierarchyRequestElement(); + requestElementList.add(element); + final HierarchySourceColumn sourceColumn = createDefaultSourceColumn(sourceColumnInfo); + element.mapping(sourceColumn, destinationColumnInfo); + element.setDestinationDBMeta(destinationColumnInfo.getDBMeta()); + } + + /** + * Make relatetion by the list of relation info. + * + * @param relationInfoList The list of relation info. (NotNull) + */ + protected void addRelationToLastElement(List relationInfoList) { + if (requestElementList.isEmpty()) { + String msg = "You shuold invoke mapping() before invoking relation()!"; + throw new IllegalStateException(msg); + } + for (RelationInfo relationInfo : relationInfoList) { + final int lastIndex = requestElementList.size() - 1; + final HierarchyRequestElement element = (HierarchyRequestElement) requestElementList + .get(lastIndex); + element.relation(relationInfo); + } + } + + /** + * Assert same source dbmeta. + * + * @param sourceColumnInfo The column info of source. (NotNull) + */ + protected void assertSameSourceDBMeta(ColumnInfo sourceColumnInfo) { + if (firstSourceColumnInfo4Check == null) { + firstSourceColumnInfo4Check = sourceColumnInfo; + return; + } + final DBMeta expectedDBMeta = firstSourceColumnInfo4Check.getDBMeta(); + final DBMeta actualDBMeta = sourceColumnInfo.getDBMeta(); + if (!expectedDBMeta.equals(actualDBMeta)) { + String msg = "The wrong sourceColumnInfo!" + getLineSeparator(); + msg = msg + + "/* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * *" + + getLineSeparator(); + msg = msg + "The dbmeta of sourceColumnInfo is difference from"; + msg = msg + " the one of Your First Source Column Info:" + + getLineSeparator(); + msg = msg + "- - - - -" + getLineSeparator(); + msg = msg + "sourceColumnInfo=" + sourceColumnInfo + + getLineSeparator(); + msg = msg + "firstSourceColumnInfo4Check=" + + firstSourceColumnInfo4Check + getLineSeparator(); + msg = msg + "* * * * * * * * * */" + getLineSeparator(); + throw new IllegalStateException(msg); + } + } + + /** + * Assert same source dbmeta. + * + * @param sourceColumnInfo The column info of source. (NotNull) + */ + protected void assertSameLocalDestinationDBMeta( + ColumnInfo destinationColumnInfo) { + if (!requestElementList.isEmpty()) { + final HierarchyRequestElement currentElement = currentElement(); + final List relationInfoList = currentElement + .getRelationInfoList(); + if (relationInfoList.isEmpty()) { + final DBMeta actualDBMeta = currentElement() + .getDestinationDBMeta(); + final DBMeta expectedDBMeta = destinationDBMeta; + if (!expectedDBMeta.equals(actualDBMeta)) { + String msg = "The wrong destinationColumnInfo!" + + getLineSeparator(); + msg = msg + + "/* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * *" + + getLineSeparator(); + msg = msg + + "The dbmeta of destinationColumnInfo is difference from"; + msg = msg + " the one of Your Local Entity:" + + getLineSeparator(); + msg = msg + "- - - - -" + getLineSeparator(); + msg = msg + "destinationColumnInfo=" + + currentElement.getDestinationColumnInfo() + + getLineSeparator(); + msg = msg + "localEntity=" + + destinationDBMeta.getEntityTypeName() + + getLineSeparator(); + msg = msg + "* * * * * * * * * */" + getLineSeparator(); + throw new IllegalStateException(msg); + } + } + } + } + + /** + * @param sourceList The list of source. (NotNull) + * @param The type of source. (NotNull) + * @return Default source iterator. (NotNull) + */ + protected HierarchySourceIterator createDefaultSourceIterator( + java.util.List sourceList) { + return new HierarchySourceEntityListIterator(sourceList); + } + + /** + * @param sourceColumnInfo The column info of source. (NotNull) + * @return Default source column. (NotNull) + */ + protected HierarchySourceColumn createDefaultSourceColumn( + ColumnInfo sourceColumnInfo) { + return new HierarchySourceEntityColumn(sourceColumnInfo); + } + + /** + * Get current element. + * + * @return Current element. (NotNull) + */ + protected HierarchyRequestElement currentElement() { + final int lastIndex = requestElementList.size() - 1; + return (HierarchyRequestElement) requestElementList.get(lastIndex); + } + + // ----------------------------------------------------- + // Internal + // -------- + /** + * @param relationPropertyKey Relation Property key. (NotNull) + * @return The list of request element. (NotNull) + */ + public List findPrimaryKeyElement( + String relationPropertyKey) { + final List resultList = new ArrayList(); + for (HierarchyRequestElement element : requestElementList) { + if (!relationPropertyKey.equals(element.getRelationPropertyKey())) { + continue; + } + final ColumnInfo destinationColumnInfo = element + .getDestinationColumnInfo(); + if (!destinationColumnInfo.isPrimary()) { + continue; + } + resultList.add(element); + } + if (resultList.isEmpty()) { + String msg = "Not found primary key element by relationPropertyKey in requestElementList: "; + msg = msg + " relationPropertyKey=" + relationPropertyKey + + " requestElementList=" + requestElementList; + throw new IllegalStateException(msg); + } + return resultList; + } + + // =================================================================================== + // Accessor + // ======== + public DBMeta getDestinationDBMeta() { + return destinationDBMeta; + } + + public void setDestinationDBMeta(DBMeta destinationDBMeta) { + this.destinationDBMeta = destinationDBMeta; + } + + public List getRequestElementList() { + return requestElementList; + } + + public void addRequestElementList(HierarchyRequestElement element) { + this.requestElementList.add(element); + } + + public HierarchySourceIterator getSourceIterator() { + return sourceIterator; + } + + public void setSourceIterator(HierarchySourceIterator sourceIterator) { + this.sourceIterator = sourceIterator; + } + + // =================================================================================== + // Helper + // ====== + /** + * Get the value of line separator. + * + * @return The value of line separator. (NotNull) + */ + protected String getLineSeparator() { + return System.getProperty("line.separator"); + } +} Property changes on: announcement/trunk/src/main/java/jp/sf/pal/announcement/db/allcommon/dbmeta/hierarchy/HierarchyRequest.java ___________________________________________________________________ Name: svn:eol-style + native Added: announcement/trunk/src/main/java/jp/sf/pal/announcement/db/allcommon/dbmeta/hierarchy/HierarchyRequestElement.java =================================================================== --- announcement/trunk/src/main/java/jp/sf/pal/announcement/db/allcommon/dbmeta/hierarchy/HierarchyRequestElement.java (rev 0) +++ announcement/trunk/src/main/java/jp/sf/pal/announcement/db/allcommon/dbmeta/hierarchy/HierarchyRequestElement.java 2008-06-30 02:54:27 UTC (rev 1002) @@ -0,0 +1,128 @@ +package jp.sf.pal.announcement.db.allcommon.dbmeta.hierarchy; + +import java.util.List; + +import jp.sf.pal.announcement.db.allcommon.dbmeta.DBMeta; +import jp.sf.pal.announcement.db.allcommon.dbmeta.info.ColumnInfo; +import jp.sf.pal.announcement.db.allcommon.dbmeta.info.RelationInfo; + +/** + * @author DBFlute(AutoGenerator) + */ + @ SuppressWarnings("unchecked") +public class HierarchyRequestElement { + + // =================================================================================== + // Definition + // ========== + /** Top key. */ + public static final String TOP_KEY = "$top$"; + + // =================================================================================== + // Attribute + // ========= + /** The column of source. */ + protected HierarchySourceColumn sourceColumn; + + /** The dbmeta of destination. */ + protected DBMeta destinationDBMeta; + + /** The column info of destination. */ + protected ColumnInfo destinationColumnInfo; + + /** The list of relation info. */ + protected java.util.List relationInfoList = new java.util.ArrayList(); + + /** the list of relation property name. */ + protected java.util.List relationPropertyNameList = new java.util.ArrayList(); + + /** Relation property key. Default value is TOP_KEY. */ + protected String relationPropertyKey = TOP_KEY; + + // =================================================================================== + // Easy-to-Use + // =========== + // ----------------------------------------------------- + // Internal + // -------- + /** + * Make mapping between the source column and the destination one. + * + * @param sourceColumn The column of source. (NotNull) + * @param destinationColumnInfo The column info of destination. (NotNull) + */ + public void mapping(HierarchySourceColumn sourceColumn, + ColumnInfo destinationColumnInfo) { + this.sourceColumn = sourceColumn; + this.destinationColumnInfo = destinationColumnInfo; + } + + /** + * Make relatetion by relation info. + * + * @param relationInfo Relation info. (NotNull) + */ + public void relation(RelationInfo relationInfo) { + addRelationInfoList(relationInfo); + } + + protected void addRelationInfoList(RelationInfo relationInfo) { + relationInfoList.add(relationInfo); + addRelationPropertyNameList(relationInfo.getRelationPropertyName()); + } + + protected void addRelationPropertyNameList(String relationPropertyName) { + relationPropertyNameList.add(relationPropertyName); + setupRelationPropertyKey(); + } + + protected void setupRelationPropertyKey() { + final StringBuilder sb = new StringBuilder(); + for (String relationPropertyName : relationPropertyNameList) { + if (sb.length() > 0) { + sb.append("_"); + } + sb.append(relationPropertyName); + } + this.relationPropertyKey = sb.toString(); + } + + // =================================================================================== + // Accessor + // ======== + public HierarchySourceColumn getSourceColumnInfo() { + return sourceColumn; + } + + public void setSourceColumnInfo(HierarchySourceColumn sourceColumn) { + this.sourceColumn = sourceColumn; + } + + public void setDestinationDBMeta(DBMeta destinationDBMeta) { + this.destinationDBMeta = destinationDBMeta; + } + + public DBMeta getDestinationDBMeta() { + return destinationDBMeta; + } + + public ColumnInfo getDestinationColumnInfo() { + return destinationColumnInfo; + } + + public java.util.List getRelationInfoList() { + return relationInfoList; + } + + public List getRelationPropertyNameList() { + return relationPropertyNameList; + } + + public String getRelationPropertyKey() { + return relationPropertyKey; + } + + public String toString() { + return sourceColumn + "," + destinationColumnInfo; + } +} Property changes on: announcement/trunk/src/main/java/jp/sf/pal/announcement/db/allcommon/dbmeta/hierarchy/HierarchyRequestElement.java ___________________________________________________________________ Name: svn:eol-style + native Added: announcement/trunk/src/main/java/jp/sf/pal/announcement/db/allcommon/dbmeta/hierarchy/HierarchySourceColumn.java =================================================================== --- announcement/trunk/src/main/java/jp/sf/pal/announcement/db/allcommon/dbmeta/hierarchy/HierarchySourceColumn.java (rev 0) +++ announcement/trunk/src/main/java/jp/sf/pal/announcement/db/allcommon/dbmeta/hierarchy/HierarchySourceColumn.java 2008-06-30 02:54:27 UTC (rev 1002) @@ -0,0 +1,10 @@ +package jp.sf.pal.announcement.db.allcommon.dbmeta.hierarchy; + +/** + * @author DBFlute(AutoGenerator) + */ + @ SuppressWarnings("unchecked") +public interface HierarchySourceColumn { + + public String getColumnName(); +} \ No newline at end of file Property changes on: announcement/trunk/src/main/java/jp/sf/pal/announcement/db/allcommon/dbmeta/hierarchy/HierarchySourceColumn.java ___________________________________________________________________ Name: svn:eol-style + native Added: announcement/trunk/src/main/java/jp/sf/pal/announcement/db/allcommon/dbmeta/hierarchy/HierarchySourceIterator.java =================================================================== --- announcement/trunk/src/main/java/jp/sf/pal/announcement/db/allcommon/dbmeta/hierarchy/HierarchySourceIterator.java (rev 0) +++ announcement/trunk/src/main/java/jp/sf/pal/announcement/db/allcommon/dbmeta/hierarchy/HierarchySourceIterator.java 2008-06-30 02:54:27 UTC (rev 1002) @@ -0,0 +1,14 @@ +package jp.sf.pal.announcement.db.allcommon.dbmeta.hierarchy; + +/** + * @author DBFlute(AutoGenerator) + */ + @ SuppressWarnings("unchecked") +public interface HierarchySourceIterator { + + public boolean hasNext(); + + public HierarchySourceRow next(); + + public HierarchySourceRow current(); +} \ No newline at end of file Property changes on: announcement/trunk/src/main/java/jp/sf/pal/announcement/db/allcommon/dbmeta/hierarchy/HierarchySourceIterator.java ___________________________________________________________________ Name: svn:eol-style + native Added: announcement/trunk/src/main/java/jp/sf/pal/announcement/db/allcommon/dbmeta/hierarchy/HierarchySourceRow.java =================================================================== --- announcement/trunk/src/main/java/jp/sf/pal/announcement/db/allcommon/dbmeta/hierarchy/HierarchySourceRow.java (rev 0) +++ announcement/trunk/src/main/java/jp/sf/pal/announcement/db/allcommon/dbmeta/hierarchy/HierarchySourceRow.java 2008-06-30 02:54:27 UTC (rev 1002) @@ -0,0 +1,10 @@ +package jp.sf.pal.announcement.db.allcommon.dbmeta.hierarchy; + +/** + * @author DBFlute(AutoGenerator) + */ + @ SuppressWarnings("unchecked") +public interface HierarchySourceRow { + + public Object extractColumnValue(HierarchySourceColumn columnInfo); +} \ No newline at end of file Property changes on: announcement/trunk/src/main/java/jp/sf/pal/announcement/db/allcommon/dbmeta/hierarchy/HierarchySourceRow.java ___________________________________________________________________ Name: svn:eol-style + native Added: announcement/trunk/src/main/java/jp/sf/pal/announcement/db/allcommon/dbmeta/hierarchy/basic/HierarchySourceEntityColumn.java =================================================================== --- announcement/trunk/src/main/java/jp/sf/pal/announcement/db/allcommon/dbmeta/hierarchy/basic/HierarchySourceEntityColumn.java (rev 0) +++ announcement/trunk/src/main/java/jp/sf/pal/announcement/db/allcommon/dbmeta/hierarchy/basic/HierarchySourceEntityColumn.java 2008-06-30 02:54:27 UTC (rev 1002) @@ -0,0 +1,24 @@ +package jp.sf.pal.announcement.db.allcommon.dbmeta.hierarchy.basic; + +import jp.sf.pal.announcement.db.allcommon.dbmeta.hierarchy.HierarchySourceColumn; +import jp.sf.pal.announcement.db.allcommon.dbmeta.info.ColumnInfo; + +/** + * @author DBFlute(AutoGenerator) + */ +public class HierarchySourceEntityColumn implements HierarchySourceColumn { + + protected ColumnInfo columnInfo; + + public HierarchySourceEntityColumn(ColumnInfo columnInfo) { + this.columnInfo = columnInfo; + } + + public String getColumnName() { + return columnInfo.getColumnDbName(); + } + + public java.lang.reflect.Method findGetter() { + return columnInfo.findGetter(); + } +} \ No newline at end of file Property changes on: announcement/trunk/src/main/java/jp/sf/pal/announcement/db/allcommon/dbmeta/hierarchy/basic/HierarchySourceEntityColumn.java ___________________________________________________________________ Name: svn:eol-style + native Added: announcement/trunk/src/main/java/jp/sf/pal/announcement/db/allcommon/dbmeta/hierarchy/basic/HierarchySourceEntityListIterator.java =================================================================== --- announcement/trunk/src/main/java/jp/sf/pal/announcement/db/allcommon/dbmeta/hierarchy/basic/HierarchySourceEntityListIterator.java (rev 0) +++ announcement/trunk/src/main/java/jp/sf/pal/announcement/db/allcommon/dbmeta/hierarchy/basic/HierarchySourceEntityListIterator.java 2008-06-30 02:54:27 UTC (rev 1002) @@ -0,0 +1,24 @@ +package jp.sf.pal.announcement.db.allcommon.dbmeta.hierarchy.basic; + +/** + * @author DBFlute(AutoGenerator) + * @param The type of source. + */ +public class HierarchySourceEntityListIterator extends + HierarchySourceListIterator { + + /** + * Constructor. + * + * @param sourceRowList The list of source row. (NotNull) + */ + public HierarchySourceEntityListIterator( + java.util.List sourceRowList) { + super(sourceRowList, new HierarchySourceRowSetupper() { + public jp.sf.pal.announcement.db.allcommon.dbmeta.hierarchy.HierarchySourceRow setup( + SOURCE_ROW source) { + return new HierarchySourceEntityRow(source); + } + }); + } +} \ No newline at end of file Property changes on: announcement/trunk/src/main/java/jp/sf/pal/announcement/db/allcommon/dbmeta/hierarchy/basic/HierarchySourceEntityListIterator.java ___________________________________________________________________ Name: svn:eol-style + native Added: announcement/trunk/src/main/java/jp/sf/pal/announcement/db/allcommon/dbmeta/hierarchy/basic/HierarchySourceEntityRow.java =================================================================== --- announcement/trunk/src/main/java/jp/sf/pal/announcement/db/allcommon/dbmeta/hierarchy/basic/HierarchySourceEntityRow.java (rev 0) +++ announcement/trunk/src/main/java/jp/sf/pal/announcement/db/allcommon/dbmeta/hierarchy/basic/HierarchySourceEntityRow.java 2008-06-30 02:54:27 UTC (rev 1002) @@ -0,0 +1,48 @@ +package jp.sf.pal.announcement.db.allcommon.dbmeta.hierarchy.basic; + +/** + * @author DBFlute(AutoGenerator) + */ +public class HierarchySourceEntityRow implements + jp.sf.pal.announcement.db.allcommon.dbmeta.hierarchy.HierarchySourceRow { + + protected Object sourceBean; + + public HierarchySourceEntityRow(Object sourceBean) { + this.sourceBean = sourceBean; + } + + public Object extractColumnValue( + jp.sf.pal.announcement.db.allcommon.dbmeta.hierarchy.HierarchySourceColumn columnInfo) { + if (!(columnInfo instanceof HierarchySourceEntityColumn)) { + String msg = "The column info should be HierarchySourceEntityColumn! but: " + + columnInfo; + throw new IllegalStateException(msg); + } + final HierarchySourceEntityColumn sourceEntityColumn = (HierarchySourceEntityColumn) columnInfo; + return invoke(sourceEntityColumn.findGetter(), sourceBean, + new Object[] {}); + } + + private Object invoke(java.lang.reflect.Method method, Object target, + Object[] args) { + try { + return method.invoke(target, args); + } catch (java.lang.reflect.InvocationTargetException ex) { + Throwable t = ex.getCause(); + if (t instanceof RuntimeException) { + throw (RuntimeException) t; + } + if (t instanceof Error) { + throw (Error) t; + } + String msg = "target=" + target + " method=" + method + "-" + + java.util.Arrays.asList(args); + throw new RuntimeException(msg, ex); + } catch (IllegalAccessException ex) { + String msg = "target=" + target + " method=" + method + "-" + + java.util.Arrays.asList(args); + throw new RuntimeException(msg, ex); + } + } +} \ No newline at end of file Property changes on: announcement/trunk/src/main/java/jp/sf/pal/announcement/db/allcommon/dbmeta/hierarchy/basic/HierarchySourceEntityRow.java ___________________________________________________________________ Name: svn:eol-style + native Added: announcement/trunk/src/main/java/jp/sf/pal/announcement/db/allcommon/dbmeta/hierarchy/basic/HierarchySourceListIterator.java =================================================================== --- announcement/trunk/src/main/java/jp/sf/pal/announcement/db/allcommon/dbmeta/hierarchy/basic/HierarchySourceListIterator.java (rev 0) +++ announcement/trunk/src/main/java/jp/sf/pal/announcement/db/allcommon/dbmeta/hierarchy/basic/HierarchySourceListIterator.java 2008-06-30 02:54:27 UTC (rev 1002) @@ -0,0 +1,40 @@ +package jp.sf.pal.announcement.db.allcommon.dbmeta.hierarchy.basic; + +/** + * @author DBFlute(AutoGenerator) + * @param The type of source. + */ +public class HierarchySourceListIterator + implements + jp.sf.pal.announcement.db.allcommon.dbmeta.hierarchy.HierarchySourceIterator { + + protected java.util.List sourceRowList; + + protected HierarchySourceRowSetupper sourceRowSetupper; + + protected java.util.Iterator sourceBeanListIterator; + + protected jp.sf.pal.announcement.db.allcommon.dbmeta.hierarchy.HierarchySourceRow currentSourceEntity; + + public HierarchySourceListIterator( + java.util.List sourceRowList, + HierarchySourceRowSetupper sourceRowSetupper) { + this.sourceRowList = sourceRowList; + this.sourceRowSetupper = sourceRowSetupper; + this.sourceBeanListIterator = sourceRowList.iterator(); + } + + public boolean hasNext() { + return this.sourceBeanListIterator.hasNext(); + } + + public jp.sf.pal.announcement.db.allcommon.dbmeta.hierarchy.HierarchySourceRow next() { + this.currentSourceEntity = this.sourceRowSetupper + .setup(this.sourceBeanListIterator.next()); + return this.currentSourceEntity; + } + + public jp.sf.pal.announcement.db.allcommon.dbmeta.hierarchy.HierarchySourceRow current() { + return this.currentSourceEntity; + } +} \ No newline at end of file Property changes on: announcement/trunk/src/main/java/jp/sf/pal/announcement/db/allcommon/dbmeta/hierarchy/basic/HierarchySourceListIterator.java ___________________________________________________________________ Name: svn:eol-style + native Added: announcement/trunk/src/main/java/jp/sf/pal/announcement/db/allcommon/dbmeta/hierarchy/basic/HierarchySourceRowSetupper.java =================================================================== --- announcement/trunk/src/main/java/jp/sf/pal/announcement/db/allcommon/dbmeta/hierarchy/basic/HierarchySourceRowSetupper.java (rev 0) +++ announcement/trunk/src/main/java/jp/sf/pal/announcement/db/allcommon/dbmeta/hierarchy/basic/HierarchySourceRowSetupper.java 2008-06-30 02:54:27 UTC (rev 1002) @@ -0,0 +1,11 @@ +package jp.sf.pal.announcement.db.allcommon.dbmeta.hierarchy.basic; + +/** + * @author DBFlute(AutoGenerator) + * @param The type of source. + */ +public interface HierarchySourceRowSetupper { + + public jp.sf.pal.announcement.db.allcommon.dbmeta.hierarchy.HierarchySourceRow setup( + SOURCE_ROW source); +} \ No newline at end of file Property changes on: announcement/trunk/src/main/java/jp/sf/pal/announcement/db/allcommon/dbmeta/hierarchy/basic/HierarchySourceRowSetupper.java ___________________________________________________________________ Name: svn:eol-style + native Added: announcement/trunk/src/main/java/jp/sf/pal/announcement/db/allcommon/dbmeta/info/ColumnInfo.java =================================================================== --- announcement/trunk/src/main/java/jp/sf/pal/announcement/db/allcommon/dbmeta/info/ColumnInfo.java (rev 0) +++ announcement/trunk/src/main/java/jp/sf/pal/announcement/db/allcommon/dbmeta/info/ColumnInfo.java 2008-06-30 02:54:27 UTC (rev 1002) @@ -0,0 +1,183 @@ +package jp.sf.pal.announcement.db.allcommon.dbmeta.info; + +import jp.sf.pal.announcement.db.allcommon.dbmeta.DBMeta; + +/** + * The information of column. + * + * @author DBFlute(AutoGenerator) + */ + @ SuppressWarnings("unchecked") +public class ColumnInfo { + + // =================================================================================== + // Attribute + // ========= + protected DBMeta dbmeta; + + protected String columnDbName; + + protected String propertyName; + + protected Class propertyType; + + protected boolean primary; + + protected Integer columnSize; + + protected Integer columnDecimalDigits; + + // =================================================================================== + // Constructor + // =========== + public ColumnInfo(DBMeta dbmeta, String columnDbName) { + this(dbmeta, columnDbName, null, null, false, null, null); + } + + public ColumnInfo(DBMeta dbmeta, String columnDbName, String propertyName, + Class propertyType, boolean primary, Integer columnSize) { + this(dbmeta, columnDbName, propertyName, propertyType, primary, + columnSize, null); + } + + public ColumnInfo(DBMeta dbmeta, String columnDbName, String propertyName, + Class propertyType, boolean primary, Integer columnSize, + Integer columnDecimalDigits) { + this.dbmeta = dbmeta; + this.columnDbName = columnDbName; + this.propertyName = propertyName; + this.propertyType = propertyType; + this.primary = primary; + this.columnSize = columnSize; + this.columnDecimalDigits = columnDecimalDigits; + } + + // =================================================================================== + // Builder + // ======= + public String buildInitCapPropertyName() { + return initCap(this.propertyName); + } + + // =================================================================================== + // Finder + // ====== + public java.lang.reflect.Method findSetter() { + return findMethod(dbmeta.getEntityType(), "set" + + buildInitCapPropertyName(), + new Class[] { this.propertyType }); + } + + public java.lang.reflect.Method findGetter() { + return findMethod(dbmeta.getEntityType(), "get" + + buildInitCapPropertyName(), new Class[] {}); + } + + // =================================================================================== + // Internal Helper + // =============== + protected String initCap(final String name) { + return name.substring(0, 1).toUpperCase() + name.substring(1); + } + + protected java.lang.reflect.Method findMethod(Class clazz, + String methodName, Class[] argTypes) { + try { + return clazz.getMethod(methodName, argTypes); + } catch (NoSuchMethodException ex) { + String msg = "class=" + clazz + " method=" + methodName + "-" + + java.util.Arrays.asList(argTypes); + throw new RuntimeException(msg, ex); + } + } + + // =================================================================================== + // Basic Override + // ============== + public int hashCode() { + return dbmeta.hashCode() + columnDbName.hashCode(); + } + + public boolean equals(Object obj) { + if (!(obj instanceof ColumnInfo)) { + return false; + } + final ColumnInfo target = (ColumnInfo) obj; + if (this.dbmeta == null || target.getDBMeta() == null) { + return false; + } + if (!this.dbmeta.equals(target.getDBMeta())) { + return false; + } + if (this.columnDbName == null || target.getColumnDbName() == null) { + return false; + } + if (!this.columnDbName.equals(target.getColumnDbName())) { + return false; + } + return true; + } + + public String toString() { + return dbmeta.getTableDbName() + "." + columnDbName; + } + + // =================================================================================== + // Accessor + // ======== + public DBMeta getDBMeta() { + return dbmeta; + } + + public void setDBMeta(DBMeta dbmeta) { + this.dbmeta = dbmeta; + } + + public String getColumnDbName() { + return this.columnDbName; + } + + public void setColumnDbName(String columnDbName) { + this.columnDbName = columnDbName; + } + + public String getPropertyName() { + return this.propertyName; + } + + public void setPropertyName(String propertyName) { + this.propertyName = propertyName; + } + + public Class getPropertyType() { + return this.propertyType; + } + + public void setPropertyType(Class propertyType) { + this.propertyType = propertyType; + } + + public boolean isPrimary() { + return this.primary; + } + + public void setPrimary(boolean primary) { + this.primary = primary; + } + + public Integer getColumnSize() { + return this.columnSize; + } + + public void setColumnSize(Integer columnSize) { + this.columnSize = columnSize; + } + + public Integer getColumnDecimalDigits() { + return this.columnDecimalDigits; + } + + public void setColumnDecimalDigits(Integer columnDecimalDigits) { + this.columnDecimalDigits = columnDecimalDigits; + } +} Property changes on: announcement/trunk/src/main/java/jp/sf/pal/announcement/db/allcommon/dbmeta/info/ColumnInfo.java ___________________________________________________________________ Name: svn:eol-style + native Added: announcement/trunk/src/main/java/jp/sf/pal/announcement/db/allcommon/dbmeta/info/ForeignInfo.java =================================================================== --- announcement/trunk/src/main/java/jp/sf/pal/announcement/db/allcommon/dbmeta/info/ForeignInfo.java (rev 0) +++ announcement/trunk/src/main/java/jp/sf/pal/announcement/db/allcommon/dbmeta/info/ForeignInfo.java 2008-06-30 02:54:27 UTC (rev 1002) @@ -0,0 +1,168 @@ +package jp.sf.pal.announcement.db.allcommon.dbmeta.info; + +import jp.sf.pal.announcement.db.allcommon.dbmeta.DBMeta; + +/** + * The class of foreign information. + * + * @author DBFlute(AutoGenerator) + */ + @ SuppressWarnings("unchecked") +public class ForeignInfo implements RelationInfo { + + // =================================================================================== + // Attribute + // ========= + protected String foreignPropertyName; + + protected DBMeta localDBMeta; + + protected DBMeta foreignDBMeta; + + protected java.util.Map localForeignColumnInfoMap; + + protected java.util.Map foreignLocalColumnInfoMap; + + protected int relationNo; + + protected boolean oneToOne; + + // =================================================================================== + // Finder + // ====== + public ColumnInfo findLocalByForeign(String foreignColumnDbName) { + final ColumnInfo keyColumnInfo = new ColumnInfo(foreignDBMeta, + foreignColumnDbName); + final ColumnInfo resultColumnInfo = (ColumnInfo) foreignLocalColumnInfoMap + .get(keyColumnInfo); + if (resultColumnInfo == null) { + String msg = "Not found by foreignColumnDbName in foreignLocalColumnInfoMap:"; + msg = msg + " foreignColumnDbName=" + foreignColumnDbName + + " foreignLocalColumnInfoMap=" + foreignLocalColumnInfoMap; + throw new IllegalArgumentException(msg); + } + return resultColumnInfo; + } + + // =================================================================================== + // Builder + // ======= + public String buildInitCapPropertyName() { + return initCap(this.foreignPropertyName); + } + + // =================================================================================== + // Finder + // ====== + public java.lang.reflect.Method findSetter() { + return findMethod(localDBMeta.getEntityType(), "set" + + buildInitCapPropertyName(), + new Class[] { java.util.List.class }); + } + + public java.lang.reflect.Method findGetter() { + return findMethod(localDBMeta.getEntityType(), "get" + + buildInitCapPropertyName(), new Class[] {}); + } + + // =================================================================================== + // Implement + // ========= + public String getRelationPropertyName() { + return getForeignPropertyName(); + } + + public DBMeta getTargetDBMeta() { + return getForeignDBMeta(); + } + + public java.util.Map getLocalTargetColumnInfoMap() { + return getLocalForeignColumnInfoMap(); + } + + public boolean isReferrer() { + return false; + } + + // =================================================================================== + // Accessor + // ======== + public String getForeignPropertyName() { + return foreignPropertyName; + } + + public void setForeignPropertyName(String foreignPropertyName) { + this.foreignPropertyName = foreignPropertyName; + } + + public DBMeta getLocalDBMeta() { + return localDBMeta; + } + + public void setLocalDBMeta(DBMeta localDBMeta) { + this.localDBMeta = localDBMeta; + } + + public DBMeta getForeignDBMeta() { + return foreignDBMeta; + } + + public void setForeignDBMeta(DBMeta foreignDBMeta) { + this.foreignDBMeta = foreignDBMeta; + } + + public java.util.Map getLocalForeignColumnInfoMap() { + return localForeignColumnInfoMap; + } + + public void setLocalForeignColumnInfoMap( + java.util.Map localForeignColumnInfoMap) { + this.localForeignColumnInfoMap = localForeignColumnInfoMap; + final java.util.Set keySet = localForeignColumnInfoMap.keySet(); + foreignLocalColumnInfoMap = new java.util.LinkedHashMap(); + for (final java.util.Iterator ite = keySet.iterator(); ite.hasNext();) { + final ColumnInfo key = (ColumnInfo) ite.next(); + final ColumnInfo value = (ColumnInfo) localForeignColumnInfoMap + .get(key); + foreignLocalColumnInfoMap.put(value, key); + } + } + + public java.util.Map getForeignLocalColumnInfoMap() { + return foreignLocalColumnInfoMap; + } + + public int getRelationNo() { + return relationNo; + } + + public void setRelationNo(int relationNo) { + this.relationNo = relationNo; + } + + public boolean isOneToOne() { + return oneToOne; + } + + public void setOneToOne(boolean oneToOne) { + this.oneToOne = oneToOne; + } + + // =================================================================================== + // General Helper + // ============== + protected java.lang.reflect.Method findMethod(Class clazz, + String methodName, Class[] argTypes) { + try { + return clazz.getMethod(methodName, argTypes); + } catch (NoSuchMethodException ex) { + String msg = "class=" + clazz + " method=" + methodName + "-" + + java.util.Arrays.asList(argTypes); + throw new RuntimeException(msg, ex); + } + } + + protected String initCap(final String name) { + return name.substring(0, 1).toUpperCase() + name.substring(1); + } +} Property changes on: announcement/trunk/src/main/java/jp/sf/pal/announcement/db/allcommon/dbmeta/info/ForeignInfo.java ___________________________________________________________________ Name: svn:eol-style + native Added: announcement/trunk/src/main/java/jp/sf/pal/announcement/db/allcommon/dbmeta/info/ReferrerInfo.java =================================================================== --- announcement/trunk/src/main/java/jp/sf/pal/announcement/db/allcommon/dbmeta/info/ReferrerInfo.java (rev 0) +++ announcement/trunk/src/main/java/jp/sf/pal/announcement/db/allcommon/dbmeta/info/ReferrerInfo.java 2008-06-30 02:54:27 UTC (rev 1002) @@ -0,0 +1,174 @@ +package jp.sf.pal.announcement.db.allcommon.dbmeta.info; + +import jp.sf.pal.announcement.db.allcommon.dbmeta.DBMeta; + +/** + * The class of referrer information. + * + * @author DBFlute(AutoGenerator) + */ + @ SuppressWarnings("unchecked") +public class ReferrerInfo implements RelationInfo { + + // =================================================================================== + // Attribute + // ========= + protected String referrerPropertyName; + + protected DBMeta localDBMeta; + + protected DBMeta referrerDBMeta; + + protected java.util.Map localReferrerColumnInfoMap; + + protected java.util.Map referrerLocalColumnInfoMap; + + protected boolean oneToOne; + + // =================================================================================== + // Finder + // ====== + public ColumnInfo findLocalByReferrer(String referrerColumnDbName) { + final ColumnInfo keyColumnInfo = new ColumnInfo(referrerDBMeta, + referrerColumnDbName); + final ColumnInfo resultColumnInfo = (ColumnInfo) referrerLocalColumnInfoMap + .get(keyColumnInfo); + if (resultColumnInfo == null) { + String msg = "Not found by referrerColumnDbName in referrerLocalColumnInfoMap:"; + msg = msg + " referrerColumnDbName=" + referrerColumnDbName + + " referrerLocalColumnInfoMap=" + + referrerLocalColumnInfoMap; + throw new IllegalArgumentException(msg); + } + return resultColumnInfo; + } + + public ColumnInfo findReferrerByLocal(String localColumnDbName) { + final ColumnInfo keyColumnInfo = new ColumnInfo(localDBMeta, + localColumnDbName); + final ColumnInfo resultColumnInfo = (ColumnInfo) localReferrerColumnInfoMap + .get(keyColumnInfo); + if (resultColumnInfo == null) { + String msg = "Not found by localColumnDbName in localReferrerColumnInfoMap:"; + msg = msg + " localColumnDbName=" + localColumnDbName + + " localReferrerColumnInfoMap=" + + localReferrerColumnInfoMap; + throw new IllegalArgumentException(msg); + } + return resultColumnInfo; + } + + // =================================================================================== + // Builder + // ======= + public String buildInitCapPropertyName() { + return initCap(this.referrerPropertyName); + } + + // =================================================================================== + // Finder + // ====== + public java.lang.reflect.Method findSetter() { + return findMethod(localDBMeta.getEntityType(), "set" + + buildInitCapPropertyName(), + new Class[] { java.util.List.class }); + } + + public java.lang.reflect.Method findGetter() { + return findMethod(localDBMeta.getEntityType(), "get" + + buildInitCapPropertyName(), new Class[] {}); + } + + // =================================================================================== + // Implement + // ========= + public String getRelationPropertyName() { + return getReferrerPropertyName(); + } + + public DBMeta getTargetDBMeta() { + return getReferrerDBMeta(); + } + + public java.util.Map getLocalTargetColumnInfoMap() { + return getLocalReferrerColumnInfoMap(); + } + + public boolean isReferrer() { + return true; + } + + // =================================================================================== + // Accessor + // ======== + public String getReferrerPropertyName() { + return referrerPropertyName; + } + + public void setReferrerPropertyName(String referrerPropertyName) { + this.referrerPropertyName = referrerPropertyName; + } + + public DBMeta getLocalDBMeta() { + return localDBMeta; + } + + public void setLocalDBMeta(DBMeta localDBMeta) { + this.localDBMeta = localDBMeta; + } + + public DBMeta getReferrerDBMeta() { + return referrerDBMeta; + } + + public void setReferrerDBMeta(DBMeta referrerDBMeta) { + this.referrerDBMeta = referrerDBMeta; + } + + public java.util.Map getLocalReferrerColumnInfoMap() { + return localReferrerColumnInfoMap; + } + + public void setLocalReferrerColumnInfoMap( + java.util.Map localReferrerColumnInfoMap) { + this.localReferrerColumnInfoMap = localReferrerColumnInfoMap; + final java.util.Set keySet = localReferrerColumnInfoMap.keySet(); + referrerLocalColumnInfoMap = new java.util.LinkedHashMap(); + for (final java.util.Iterator ite = keySet.iterator(); ite.hasNext();) { + final ColumnInfo key = (ColumnInfo) ite.next(); + final ColumnInfo value = (ColumnInfo) localReferrerColumnInfoMap + .get(key); + referrerLocalColumnInfoMap.put(value, key); + } + } + + public java.util.Map getReferrerLocalColumnInfoMap() { + return referrerLocalColumnInfoMap; + } + + public boolean isOneToOne() { + return oneToOne; + } + + public void setOneToOne(boolean oneToOne) { + this.oneToOne = oneToOne; + } + + // =================================================================================== + // Internal Helper + // =============== + protected String initCap(final String name) { + return name.substring(0, 1).toUpperCase() + name.substring(1); + } + + protected java.lang.reflect.Method findMethod(Class clazz, + String methodName, Class[] argTypes) { + try { + return clazz.getMethod(methodName, argTypes); + } catch (NoSuchMethodException ex) { + String msg = "class=" + clazz + " method=" + methodName + "-" + + java.util.Arrays.asList(argTypes); + throw new RuntimeException(msg, ex); + } + } +} Property changes on: announcement/trunk/src/main/java/jp/sf/pal/announcement/db/allcommon/dbmeta/info/ReferrerInfo.java ___________________________________________________________________ Name: svn:eol-style + native Added: announcement/trunk/src/main/java/jp/sf/pal/announcement/db/allcommon/dbmeta/info/RelationInfo.java =================================================================== --- announcement/trunk/src/main/java/jp/sf/pal/announcement/db/allcommon/dbmeta/info/RelationInfo.java (rev 0) +++ announcement/trunk/src/main/java/jp/sf/pal/announcement/db/allcommon/dbmeta/info/RelationInfo.java 2008-06-30 02:54:27 UTC (rev 1002) @@ -0,0 +1,24 @@ +package jp.sf.pal.announcement.db.allcommon.dbmeta.info; + +import jp.sf.pal.announcement.db.allcommon.dbmeta.DBMeta; + +/** + * The class of referer information. + * + * @author DBFlute(AutoGenerator) + */ + @ SuppressWarnings("unchecked") +public interface RelationInfo { + + public String getRelationPropertyName(); + + public DBMeta getLocalDBMeta(); + + public DBMeta getTargetDBMeta(); + + public java.util.Map getLocalTargetColumnInfoMap(); + + public boolean isOneToOne(); + + public boolean isReferrer(); +} Property changes on: announcement/trunk/src/main/java/jp/sf/pal/announcement/db/allcommon/dbmeta/info/RelationInfo.java ___________________________________________________________________ Name: svn:eol-style + native Added: announcement/trunk/src/main/java/jp/sf/pal/announcement/db/allcommon/dbmeta/info/UniqueInfo.java =================================================================== --- announcement/trunk/src/main/java/jp/sf/pal/announcement/db/allcommon/dbmeta/info/UniqueInfo.java (rev 0) +++ announcement/trunk/src/main/java/jp/sf/pal/announcement/db/allcommon/dbmeta/info/UniqueInfo.java 2008-06-30 02:54:27 UTC (rev 1002) @@ -0,0 +1,74 @@ +package jp.sf.pal.announcement.db.allcommon.dbmeta.info; + +import jp.sf.pal.announcement.db.allcommon.dbmeta.DBMeta; + +/** + * The class of unique info. + * + * @author DBFlute(AutoGenerator) + */ + @ SuppressWarnings("unchecked") +public class UniqueInfo { + + // =================================================================================== + // Attribute + // ========= + protected DBMeta dbmeta; + + protected java.util.List uniqueColumnList = new java.util.ArrayList(); + + protected boolean primary; + + // =================================================================================== + // Easy-to-Use + // =========== + public boolean containsColumn(String columnName) { + for (final java.util.Iterator ite = uniqueColumnList.iterator(); ite + .hasNext();) { + final ColumnInfo columnInfo = (ColumnInfo) ite.next(); + if (columnInfo.getColumnDbName().equals(columnName)) { + return true; + } + } + return false; + } + + public boolean containsColumn(ColumnInfo column) { + return containsColumn(column.getColumnDbName()); + } + + // =================================================================================== + // Accessor + // ======== + public DBMeta getDBMeta() { + return dbmeta; + } + + public void setDBMeta(DBMeta dbmeta) { + this.dbmeta = dbmeta; + } + + public java.util.List getUniqueColumnList() { + return uniqueColumnList; + } + + public void addUniqueColumnList(ColumnInfo uniqueColumn) { + this.uniqueColumnList.add(uniqueColumn); + } + + public ColumnInfo getFirstColumn() { + return (ColumnInfo) this.uniqueColumnList.get(0); + } + + public boolean isTwoOrMore() { + return this.uniqueColumnList.size() > 1; + } + + public boolean isPrimary() { + return this.primary; + } + + public void setPrimary(boolean primary) { + this.primary = primary; + } +} Property changes on: announcement/trunk/src/main/java/jp/sf/pal/announcement/db/allcommon/dbmeta/info/UniqueInfo.java ___________________________________________________________________ Name: svn:eol-style + native Added: announcement/trunk/src/main/java/jp/sf/pal/announcement/db/allcommon/exception/BindVariableCommentNotFoundPropertyException.java =================================================================== --- announcement/trunk/src/main/java/jp/sf/pal/announcement/db/allcommon/exception/BindVariableCommentNotFoundPropertyException.java (rev 0) +++ announcement/trunk/src/main/java/jp/sf/pal/announcement/db/allcommon/exception/BindVariableCommentNotFoundPropertyException.java 2008-06-30 02:54:27 UTC (rev 1002) @@ -0,0 +1,30 @@ +package jp.sf.pal.announcement.db.allcommon.exception; + +/** + * The exception of when the property on bind variable comment is not found about outsideSql. + * @author DBFlute(AutoGenerator) + */ +public class BindVariableCommentNotFoundPropertyException extends + RuntimeException { + + /** Serial version UID. (Default) */ + private static final long serialVersionUID = 1L; + + /** + * Constructor. + * @param msg Exception message. (NotNull) + */ + public BindVariableCommentNotFoundPropertyException(String msg) { + super(msg); + } + + /** + * Constructor. + * @param msg Exception message. (NotNull) + * @param cause Throwable. + */ + public BindVariableCommentNotFoundPropertyException(String msg, + Throwable cause) { + super(msg, cause); + } +} Property changes on: announcement/trunk/src/main/java/jp/sf/pal/announcement/db/allcommon/exception/BindVariableCommentNotFoundPropertyException.java ___________________________________________________________________ Name: svn:eol-style + native Added: announcement/trunk/src/main/java/jp/sf/pal/announcement/db/allcommon/exception/BindVariableParameterNullValueException.java =================================================================== --- announcement/trunk/src/main/java/jp/sf/pal/announcement/db/allcommon/exception/BindVariableParameterNullValueException.java (rev 0) +++ announcement/trunk/src/main/java/jp/sf/pal/announcement/db/allcommon/exception/BindVariableParameterNullValueException.java 2008-06-30 02:54:27 UTC (rev 1002) @@ -0,0 +1,19 @@ +package jp.sf.pal.announcement.db.allcommon.exception; + +/** + * The exception of when the value of bind variable is null about outsideSql. + * @author DBFlute(AutoGenerator) + */ +public class BindVariableParameterNullValueException extends RuntimeException { + + /** Serial version UID. (Default) */ + private static final long serialVersionUID = 1L; + + /** + * Constructor. + * @param msg Exception message. (NotNull) + */ + public BindVariableParameterNullValueException(String msg) { + super(msg); + } +} Property changes on: announcement/trunk/src/main/java/jp/sf/pal/announcement/db/allcommon/exception/BindVariableParameterNullValueException.java ___________________________________________________________________ Name: svn:eol-style + native Added: announcement/trunk/src/main/java/jp/sf/pal/announcement/db/allcommon/exception/DangerousResultSizeException.java =================================================================== --- announcement/trunk/src/main/java/jp/sf/pal/announcement/db/allcommon/exception/DangerousResultSizeException.java (rev 0) +++ announcement/trunk/src/main/java/jp/sf/pal/announcement/db/allcommon/exception/DangerousResultSizeException.java 2008-06-30 02:54:27 UTC (rev 1002) @@ -0,0 +1,36 @@ +package jp.sf.pal.announcement.db.allcommon.exception; + +/** + * The exception of when the result size is dangerous. + * + * @author DBFlute(AutoGenerator) + */ +public class DangerousResultSizeException extends RuntimeException { + + /** Serial version UID. (Default) */ + private static final long serialVersionUID = 1L; + + /** Safety max result size. */ + protected int _safetyMaxResultSize; + + /** + * Constructor. + * + * @param msg Exception message. + * @param safetyMaxResultSize Safety max result size. + * @param selectedCount Selected count. + */ + public DangerousResultSizeException(String msg, int safetyMaxResultSize) { + super(msg); + this._safetyMaxResultSize = safetyMaxResultSize; + } + + /** + * Get safety max result size. + * + * @return Safety max result size. + */ + public int getSafetyMaxResultSize() { + return _safetyMaxResultSize; + } +} Property changes on: announcement/trunk/src/main/java/jp/sf/pal/announcement/db/allcommon/exception/DangerousResultSizeException.java ___________________________________________________________________ Name: svn:eol-style + native Added: announcement/trunk/src/main/java/jp/sf/pal/announcement/db/allcommon/exception/EmbeddedValueCommentNotFoundPropertyException.java =================================================================== --- announcement/trunk/src/main/java/jp/sf/pal/announcement/db/allcommon/exception/EmbeddedValueCommentNotFoundPropertyException.java (rev 0) +++ announcement/trunk/src/main/java/jp/sf/pal/announcement/db/allcommon/exception/EmbeddedValueCommentNotFoundPropertyException.java 2008-06-30 02:54:27 UTC (rev 1002) @@ -0,0 +1,30 @@ +package jp.sf.pal.announcement.db.allcommon.exception; + +/** + * The exception of when the property on embedded value comment is not found about outsideSql. + * @author DBFlute(AutoGenerator) + */ +public class EmbeddedValueCommentNotFoundPropertyException extends + RuntimeException { + + /** Serial version UID. (Default) */ + private static final long serialVersionUID = 1L; + + /** + * Constructor. + * @param msg Exception message. (NotNull) + */ + public EmbeddedValueCommentNotFoundPropertyException(String msg) { + super(msg); + } + + /** + * Constructor. + * @param msg Exception message. (NotNull) + * @param cause Throwable. + */ + public EmbeddedValueCommentNotFoundPropertyException(String msg, + Throwable cause) { + super(msg, cause); + } +} Property changes on: announcement/trunk/src/main/java/jp/sf/pal/announcement/db/allcommon/exception/EmbeddedValueCommentNotFoundPropertyException.java ___________________________________________________________________ Name: svn:eol-style + native Added: announcement/trunk/src/main/java/jp/sf/pal/announcement/db/allcommon/exception/EmbeddedValueParameterNullValueException.java =================================================================== --- announcement/trunk/src/main/java/jp/sf/pal/announcement/db/allcommon/exception/EmbeddedValueParameterNullValueException.java (rev 0) +++ announcement/trunk/src/main/java/jp/sf/pal/announcement/db/allcommon/exception/EmbeddedValueParameterNullValueException.java 2008-06-30 02:54:27 UTC (rev 1002) @@ -0,0 +1,19 @@ +package jp.sf.pal.announcement.db.allcommon.exception; + +/** + * The exception of when the value of embedded value is null about outsideSql. + * @author DBFlute(AutoGenerator) + */ +public class EmbeddedValueParameterNullValueException extends RuntimeException { + + /** Serial version UID. (Default) */ + private static final long serialVersionUID = 1L; + + /** + * Constructor. + * @param msg Exception message. (NotNull) + */ + public EmbeddedValueParameterNullValueException(String msg) { + super(msg); + } +} Property changes on: announcement/trunk/src/main/java/jp/sf/pal/announcement/db/allcommon/exception/EmbeddedValueParameterNullValueException.java ___________________________________________________________________ Name: svn:eol-style + native Added: announcement/trunk/src/main/java/jp/sf/pal/announcement/db/allcommon/exception/EndCommentNotFoundException.java =================================================================== --- announcement/trunk/src/main/java/jp/sf/pal/announcement/db/allcommon/exception/EndCommentNotFoundException.java (rev 0) +++ announcement/trunk/src/main/java/jp/sf/pal/announcement/db/allcommon/exception/EndCommentNotFoundException.java 2008-06-30 02:54:27 UTC (rev 1002) @@ -0,0 +1,19 @@ +package jp.sf.pal.announcement.db.allcommon.exception; + +/** + * The exception of when the end comment is not found about outsideSql. + * @author DBFlute(AutoGenerator) + */ +public class EndCommentNotFoundException extends RuntimeException { + + /** Serial version UID. (Default) */ + private static final long serialVersionUID = 1L; + + /** + * Constructor. + * @param msg Exception message. (NotNull) + */ + public EndCommentNotFoundException(String msg) { + super(msg); + } +} Property changes on: announcement/trunk/src/main/java/jp/sf/pal/announcement/db/allcommon/exception/EndCommentNotFoundException.java ___________________________________________________________________ Name: svn:eol-style + native Added: announcement/trunk/src/main/java/jp/sf/pal/announcement/db/allcommon/exception/EntityAlreadyDeletedException.java =================================================================== --- announcement/trunk/src/main/java/jp/sf/pal/announcement/db/allcommon/exception/EntityAlreadyDeletedException.java (rev 0) +++ announcement/trunk/src/main/java/jp/sf/pal/announcement/db/allcommon/exception/EntityAlreadyDeletedException.java 2008-06-30 02:54:27 UTC (rev 1002) @@ -0,0 +1,22 @@ +package jp.sf.pal.announcement.db.allcommon.exception; + +/** + * The exception of when the entity has already been deleted by other thread. + * + * @author DBFlute(AutoGenerator) + */ +public class EntityAlreadyDeletedException extends + RecordHasAlreadyBeenDeletedException { + + /** Serial version UID. (Default) */ + private static final long serialVersionUID = 1L; + + /** + * Constructor. + * + * @param msg Exception message. + */ + public EntityAlreadyDeletedException(String msg) { + super(msg); + } +} Property changes on: announcement/trunk/src/main/java/jp/sf/pal/announcement/db/allcommon/exception/EntityAlreadyDeletedException.java ___________________________________________________________________ Name: svn:eol-style + native Added: announcement/trunk/src/main/java/jp/sf/pal/announcement/db/allcommon/exception/EntityAlreadyUpdatedException.java =================================================================== --- announcement/trunk/src/main/java/jp/sf/pal/announcement/db/allcommon/exception/EntityAlreadyUpdatedException.java (rev 0) +++ announcement/trunk/src/main/java/jp/sf/pal/announcement/db/allcommon/exception/EntityAlreadyUpdatedException.java 2008-06-30 02:54:27 UTC (rev 1002) @@ -0,0 +1,33 @@ +package jp.sf.pal.announcement.db.allcommon.exception; + +/** + * The exception of when the entity has already been updated by other thread. + * + * @author DBFlute(AutoGenerator) + */ +public class EntityAlreadyUpdatedException extends + org.seasar.dao.NotSingleRowUpdatedRuntimeException { + + /** Serial version UID. (Default) */ + private static final long serialVersionUID = 1L; + + /** + * Constructor. + * + * @param bean Bean. (NotNull) + * @param rows Rows. + */ + public EntityAlreadyUpdatedException(Object bean, int rows) { + super(bean, rows); + } + + /** + * Constructor. + * + * @param e NotSingleRowUpdatedRuntimeException. (NotNull) + */ + public EntityAlreadyUpdatedException( + org.seasar.dao.NotSingleRowUpdatedRuntimeException e) { + super(e.getBean(), e.getRows()); + } +} Property changes on: announcement/trunk/src/main/java/jp/sf/pal/announcement/db/allcommon/exception/EntityAlreadyUpdatedException.java ___________________________________________________________________ Name: svn:eol-style + native Added: announcement/trunk/src/main/java/jp/sf/pal/announcement/db/allcommon/exception/EntityDuplicatedException.java =================================================================== --- announcement/trunk/src/main/java/jp/sf/pal/announcement/db/allcommon/exception/EntityDuplicatedException.java (rev 0) +++ announcement/trunk/src/main/java/jp/sf/pal/announcement/db/allcommon/exception/EntityDuplicatedException.java 2008-06-30 02:54:27 UTC (rev 1002) @@ -0,0 +1,31 @@ +package jp.sf.pal.announcement.db.allcommon.exception; + +/** + * The exception of when the entity has been duplicated. + * + * @author DBFlute(AutoGenerator) + */ +public class EntityDuplicatedException extends RecordHasOverlappedException { + + /** Serial version UID. (Default) */ + private static final long serialVersionUID = 1L; + + /** + * Constructor. + * + * @param msg Exception message. + */ + public EntityDuplicatedException(String msg) { + super(msg); + } + + /** + * Constructor. + * + * @param msg Exception message. + * @param cause Throwable. + */ + public EntityDuplicatedException(String msg, Throwable cause) { + super(msg, cause); + } +} Property changes on: announcement/trunk/src/main/java/jp/sf/pal/announcement/db/allcommon/exception/EntityDuplicatedException.java ___________________________________________________________________ Name: svn:eol-style + native Added: announcement/trunk/src/main/java/jp/sf/pal/announcement/db/allcommon/exception/IfCommentConditionNotFoundException.java =================================================================== --- announcement/trunk/src/main/java/jp/sf/pal/announcement/db/allcommon/exception/IfCommentConditionNotFoundException.java (rev 0) +++ announcement/trunk/src/main/java/jp/sf/pal/announcement/db/allcommon/exception/IfCommentConditionNotFoundException.java 2008-06-30 02:54:27 UTC (rev 1002) @@ -0,0 +1,20 @@ +package jp.sf.pal.announcement.db.allcommon.exception; + +/** + * The exception of when the condition of IF comment is not found about outsideSql. + * @author DBFlute(AutoGenerator) + */ +public class IfCommentConditionNotFoundException extends + IfCommentWrongExpressionException { + + /** Serial version UID. (Default) */ + private static final long serialVersionUID = 1L; + + /** + * Constructor. + * @param msg Exception message. (NotNull) + */ + public IfCommentConditionNotFoundException(String msg) { + super(msg); + } +} Property changes on: announcement/trunk/src/main/java/jp/sf/pal/announcement/db/allcommon/exception/IfCommentConditionNotFoundException.java ___________________________________________________________________ Name: svn:eol-style + native Added: announcement/trunk/src/main/java/jp/sf/pal/announcement/db/allcommon/exception/IfCommentNotBooleanResultException.java =================================================================== --- announcement/trunk/src/main/java/jp/sf/pal/announcement/db/allcommon/exception/IfCommentNotBooleanResultException.java (rev 0) +++ announcement/trunk/src/main/java/jp/sf/pal/announcement/db/allcommon/exception/IfCommentNotBooleanResultException.java 2008-06-30 02:54:27 UTC (rev 1002) @@ -0,0 +1,32 @@ +package jp.sf.pal.announcement.db.allcommon.exception; + +/** + * The exception of when the result of IF comment is not boolean about outsideSql. + * + * @author DBFlute(AutoGenerator) + */ +public class IfCommentNotBooleanResultException extends + IfCommentWrongExpressionException { + + /** Serial version UID. (Default) */ + private static final long serialVersionUID = 1L; + + /** + * Constructor. + * + * @param msg Exception message. (NotNull) + */ + public IfCommentNotBooleanResultException(String msg) { + super(msg); + } + + /** + * Constructor. + * + * @param msg Exception message. (NotNull) + * @param cause Throwable. + */ + public IfCommentNotBooleanResultException(String msg, Throwable cause) { + super(msg, cause); + } +} Property changes on: announcement/trunk/src/main/java/jp/sf/pal/announcement/db/allcommon/exception/IfCommentNotBooleanResultException.java ___________________________________________________________________ Name: svn:eol-style + native Added: announcement/trunk/src/main/java/jp/sf/pal/announcement/db/allcommon/exception/IfCommentWrongExpressionException.java =================================================================== --- announcement/trunk/src/main/java/jp/sf/pal/announcement/db/allcommon/exception/IfCommentWrongExpressionException.java (rev 0) +++ announcement/trunk/src/main/java/jp/sf/pal/announcement/db/allcommon/exception/IfCommentWrongExpressionException.java 2008-06-30 02:54:27 UTC (rev 1002) @@ -0,0 +1,28 @@ +package jp.sf.pal.announcement.db.allcommon.exception; + +/** + * The exception of when the IF comment has a wrong expression about outsideSql. + * @author DBFlute(AutoGenerator) + */ +public class IfCommentWrongExpressionException extends RuntimeException { + + /** Serial version UID. (Default) */ + private static final long serialVersionUID = 1L; + + /** + * Constructor. + * @param msg Exception message. (NotNull) + */ + public IfCommentWrongExpressionException(String msg) { + super(msg); + } + + /** + * Constructor. + * @param msg Exception message. (NotNull) + * @param cause Throwable. + */ + public IfCommentWrongExpressionException(String msg, Throwable cause) { + super(msg, cause); + } +} Property changes on: announcement/trunk/src/main/java/jp/sf/pal/announcement/db/allcommon/exception/IfCommentWrongExpressionException.java ___________________________________________________________________ Name: svn:eol-style + native Added: announcement/trunk/src/main/java/jp/sf/pal/announcement/db/allcommon/exception/OutsideSqlNotFoundException.java =================================================================== --- announcement/trunk/src/main/java/jp/sf/pal/announcement/db/allcommon/exception/OutsideSqlNotFoundException.java (rev 0) +++ announcement/trunk/src/main/java/jp/sf/pal/announcement/db/allcommon/exception/OutsideSqlNotFoundException.java 2008-06-30 02:54:27 UTC (rev 1002) @@ -0,0 +1,31 @@ +package jp.sf.pal.announcement.db.allcommon.exception; + +/** + * The exception of when the outside-sql is not found. + * + * @author DBFlute(AutoGenerator) + */ +public class OutsideSqlNotFoundException extends RuntimeException { + + /** Serial version UID. (Default) */ + private static final long serialVersionUID = 1L; + + /** + * Constructor. + * + * @param msg Exception message. + */ + public OutsideSqlNotFoundException(String msg) { + super(msg); + } + + /** + * Constructor. + * + * @param msg Exception message. + * @param cause Throwable. + */ + public OutsideSqlNotFoundException(String msg, Throwable cause) { + super(msg, cause); + } +} Property changes on: announcement/trunk/src/main/java/jp/sf/pal/announcement/db/allcommon/exception/OutsideSqlNotFoundException.java ___________________________________________________________________ Name: svn:eol-style + native Added: announcement/trunk/src/main/java/jp/sf/pal/announcement/db/allcommon/exception/RecordHasAlreadyBeenDeletedException.java =================================================================== --- announcement/trunk/src/main/java/jp/sf/pal/announcement/db/allcommon/exception/RecordHasAlreadyBeenDeletedException.java (rev 0) +++ announcement/trunk/src/main/java/jp/sf/pal/announcement/db/allcommon/exception/RecordHasAlreadyBeenDeletedException.java 2008-06-30 02:54:27 UTC (rev 1002) @@ -0,0 +1,22 @@ +package jp.sf.pal.announcement.db.allcommon.exception; + +/** + * The exception when the record has already been deleted (by other thread).
    + * This class is old. + * + * @author DBFlute(AutoGenerator) + */ +public class RecordHasAlreadyBeenDeletedException extends RuntimeException { + + /** Serial version UID. (Default) */ + private static final long serialVersionUID = 1L; + + /** + * Constructor. + * + * @param msg Exception message. + */ + public RecordHasAlreadyBeenDeletedException(String msg) { + super(msg); + } +} Property changes on: announcement/trunk/src/main/java/jp/sf/pal/announcement/db/allcommon/exception/RecordHasAlreadyBeenDeletedException.java ___________________________________________________________________ Name: svn:eol-style + native Added: announcement/trunk/src/main/java/jp/sf/pal/announcement/db/allcommon/exception/RecordHasOverlappedException.java =================================================================== --- announcement/trunk/src/main/java/jp/sf/pal/announcement/db/allcommon/exception/RecordHasOverlappedException.java (rev 0) +++ announcement/trunk/src/main/java/jp/sf/pal/announcement/db/allcommon/exception/RecordHasOverlappedException.java 2008-06-30 02:54:27 UTC (rev 1002) @@ -0,0 +1,32 @@ +package jp.sf.pal.announcement.db.allcommon.exception; + +/** + * The exception when the record has overlapped. + * This class is old. + * + * @author DBFlute(AutoGenerator) + */ +public class RecordHasOverlappedException extends RuntimeException { + + /** Serial version UID. (Default) */ + private static final long serialVersionUID = 1L; + + /** + * Constructor. + * + * @param msg Exception message. + */ + public RecordHasOverlappedException(String msg) { + super(msg); + } + + /** + * Constructor. + * + * @param msg Exception message. + * @param cause Throwable. + */ + public RecordHasOverlappedException(String msg, Throwable cause) { + super(msg, cause); + } +} Property changes on: announcement/trunk/src/main/java/jp/sf/pal/announcement/db/allcommon/exception/RecordHasOverlappedException.java ___________________________________________________________________ Name: svn:eol-style + native Added: announcement/trunk/src/main/java/jp/sf/pal/announcement/db/allcommon/exception/RequiredOptionNotFoundException.java =================================================================== --- announcement/trunk/src/main/java/jp/sf/pal/announcement/db/allcommon/exception/RequiredOptionNotFoundException.java (rev 0) +++ announcement/trunk/src/main/java/jp/sf/pal/announcement/db/allcommon/exception/RequiredOptionNotFoundException.java 2008-06-30 02:54:27 UTC (rev 1002) @@ -0,0 +1,31 @@ +package jp.sf.pal.announcement.db.allcommon.exception; + +/** + * The exception of when the required option is not found. + * + * @author DBFlute(AutoGenerator) + */ +public class RequiredOptionNotFoundException extends RuntimeException { + + /** Serial version UID. (Default) */ + private static final long serialVersionUID = 1L; + + /** + * Constructor. + * + * @param msg Exception message. + */ + public RequiredOptionNotFoundException(String msg) { + super(msg); + } + + /** + * Constructor. + * + * @param msg Exception message. + * @param cause Throwable. + */ + public RequiredOptionNotFoundException(String msg, Throwable cause) { + super(msg, cause); + } +} Property changes on: announcement/trunk/src/main/java/jp/sf/pal/announcement/db/allcommon/exception/RequiredOptionNotFoundException.java ___________________________________________________________________ Name: svn:eol-style + native Added: announcement/trunk/src/main/java/jp/sf/pal/announcement/db/allcommon/helper/MapListString.java =================================================================== --- announcement/trunk/src/main/java/jp/sf/pal/announcement/db/allcommon/helper/MapListString.java (rev 0) +++ announcement/trunk/src/main/java/jp/sf/pal/announcement/db/allcommon/helper/MapListString.java 2008-06-30 02:54:27 UTC (rev 1002) @@ -0,0 +1,102 @@ +package jp.sf.pal.announcement.db.allcommon.helper; + +import java.util.List; +import java.util.Map; + +/** + * MapList-String. + *

    + *

    + * # Interface that offers generation of map and list from the following character strings (map list string). 
    + * # 
    + * #   ex) map:{key1=value1,key2=list:{value21,value22,value23},key3=map:{key31=value31}}
    + * #   ex) list:{key1=value1,key2=list:{value21,value22,value23},key3=map:{key31=value31}}
    + * # 
    + * 
    + * + * @author DBFlute(AutoGenerator) + */ +public interface MapListString { + + /** Default of map-mark. */ + public static final String DEFAULT_MAP_MARK = "map:"; + + /** Default of list-mark. */ + public static final String DEFAULT_LIST_MARK = "list:"; + + /** Default of start-brace. */ + public static final String DEFAULT_START_BRACE = "{"; + + /** Default of end-brace. */ + public static final String DEFAULT_END_BRACE = "}"; + + /** Default of delimter. */ + public static final String DEFAULT_DELIMITER = ";"; + + /** Default of equal. */ + public static final String DEFAULT_EQUAL = "="; + + // ========================================================================================== + // Setter + // ====== + /** + * Set map-mark. + * + * @param mapMark Map-mark. (NotNull) + */ + public void setMapMark(String mapMark); + + /** + * Set list-mark. + * + * @param listMark List-mark. (NotNull) + */ + public void setListMark(String listMark); + + /** + * Set start brace. + * + * @param startBrace Start brace. (NotNull) + */ + public void setStartBrace(String startBrace); + + /** + * Set end brace. + * + * @param endBrace End brace. (NotNull) + */ + public void setEndBrace(String endBrace); + + /** + * Set delimiter. + * + * @param delimiter Delimiter. (NotNull) + */ + public void setDelimiter(String delimiter); + + /** + * Set equal. + * + * @param equal Equal. (NotNull) + */ + public void setEqual(String equal); + + // ========================================================================================== + // Generate + // ======== + /** + * Generate map from map-string. + * + * @param mapString Map-string (NotNull) + * @return Generated map. (NotNull) + */ + public Map generateMap(String mapString); + + /** + * Generate map from list-string. {Implement} + * + * @param listString List-string (NotNull) + * @return Generated list. (NotNull) + */ + public List generateList(String listString); +} \ No newline at end of file Property changes on: announcement/trunk/src/main/java/jp/sf/pal/announcement/db/allcommon/helper/MapListString.java ___________________________________________________________________ Name: svn:eol-style + native Added: announcement/trunk/src/main/java/jp/sf/pal/announcement/db/allcommon/helper/MapListStringImpl.java =================================================================== --- announcement/trunk/src/main/java/jp/sf/pal/announcement/db/allcommon/helper/MapListStringImpl.java (rev 0) +++ announcement/trunk/src/main/java/jp/sf/pal/announcement/db/allcommon/helper/MapListStringImpl.java 2008-06-30 02:54:27 UTC (rev 1002) @@ -0,0 +1,1054 @@ +package jp.sf.pal.announcement.db.allcommon.helper; + +import java.util.ArrayList; +import java.util.LinkedHashMap; +import java.util.List; +import java.util.Map; + +/** + * The implementation of MapList-String. + * + * @author DBFlute(AutoGenerator) + */ +public class MapListStringImpl implements MapListString { + + /** Line separator. */ + public static final String NEW_LINE = System.getProperty("line.separator"); + + /** Map-mark. */ + protected String _mapMark; + + /** List-mark. */ + protected String _listMark; + + /** Start-brace. */ + protected String _startBrace; + + /** End-brace. */ + protected String _endBrace; + + /** Delimiter. */ + protected String _delimiter; + + /** Equal. */ + protected String _equal; + + /** Top string. */ + protected String _topString; + + /** Remainder string. */ + protected String _remainderString; + + /** + * Constructor. + */ + public MapListStringImpl() { + _mapMark = DEFAULT_MAP_MARK; + _listMark = DEFAULT_LIST_MARK; + _startBrace = DEFAULT_START_BRACE; + _endBrace = DEFAULT_END_BRACE; + _delimiter = DEFAULT_DELIMITER; + _equal = DEFAULT_EQUAL; + } + + // ========================================================================================== + // Setter + // ====== + /** + * Set map-mark. + * + * @param mapMark Map mark. (NotNull) + */ + public void setMapMark(String mapMark) { + _mapMark = mapMark; + } + + /** + * Set list-mark. + * + * @param listMark List mark. (NotNull) + */ + public void setListMark(String listMark) { + _listMark = listMark; + } + + /** + * Set start-brace. + * + * @param startBrace Start-brace. (NotNull) + */ + public synchronized void setStartBrace(String startBrace) { + _startBrace = startBrace; + } + + /** + * Set end-brace. + * + * @param endBrace End-brace. (NotNull) + */ + public synchronized void setEndBrace(String endBrace) { + _endBrace = endBrace; + } + + /** + * Set delimiter. + * + * @param delimiter Delimiter. (NotNull) + */ + public synchronized void setDelimiter(String delimiter) { + _delimiter = delimiter; + } + + /** + * Set equal. + * + * @param equal Equal. (NotNull) + */ + public void setEqual(String equal) { + _equal = equal; + } + + // **************************************************************************************************** + // Main Method + // *********** + + // ========================================================================================== + // Generate + // ======== + /** + * Generate map from map-string. {Implement} + * + * @param mapString Map-string (NotNull) + * @return Generated map. (NotNull) + */ + public synchronized Map generateMap(String mapString) { + assertMapString(mapString); + + _topString = mapString; + _remainderString = mapString; + + removeBothSideSpaceAndTabAndNewLine(); + removePrefixMapMarkAndStartBrace(); + + final Map generatedMap = newStringObjectMap(); + parseRemainderMapString(generatedMap); + if (!"".equals(_remainderString)) { + String msg = "Final remainderString must be empty string:"; + msg = msg + getNewLineAndIndent() + " # remainderString --> " + + _remainderString; + msg = msg + getNewLineAndIndent() + " # mapString --> " + mapString; + msg = msg + getNewLineAndIndent() + " # generatedMap --> " + + generatedMap; + throw new IllegalStateException(msg); + } + return generatedMap; + } + + /** + * Generate map from list-string. {Implement} + * + * @param listString List-string (NotNull) + * @return Generated list. (NotNull) + */ + public synchronized List generateList(String listString) { + assertListString(listString); + + _topString = listString; + _remainderString = listString; + + removeBothSideSpaceAndTabAndNewLine(); + removePrefixListMarkAndStartBrace(); + + final List generatedList = newObjectList(); + parseRemainderListString(generatedList); + if (!"".equals(_remainderString)) { + String msg = "Final remainderString must be empty string:"; + msg = msg + getNewLineAndIndent() + " # remainderString --> " + + _remainderString; + msg = msg + getNewLineAndIndent() + " # listString --> " + + listString; + msg = msg + getNewLineAndIndent() + " # generatedList --> " + + generatedList; + throw new IllegalStateException(msg); + } + return generatedList; + } + + // ========================================================================================== + // Parse + // ===== + /** + * Parse remainder map string. + * + * @param currentMap current map. + */ + protected void parseRemainderMapString(final Map currentMap) { + while (true) { + if (initializeAtLoopBeginning()) { + return; + } + + // *** Now, _remainderString should starts with the key of the map. *** + + final int equalIndex = _remainderString.indexOf(_equal); + assertEqualIndex(_remainderString, equalIndex, _topString, + currentMap); + final String mapKey = _remainderString.substring(0, equalIndex) + .trim(); + removePrefixTargetIndexPlus(equalIndex, _equal.length()); + removeBothSideSpaceAndTabAndNewLine(); + + // *** Now, _remainderString should starts with the value of the map. *** + + if (isStartsWithMapPrefix(_remainderString)) { + removePrefixMapMarkAndStartBrace(); + parseRemainderMapString(setupNestMap(currentMap, mapKey)); + if (closingAfterParseNestMapList()) { + return; + } + continue; + } + + if (isStartsWithListPrefix(_remainderString)) { + removePrefixListMarkAndStartBrace(); + parseRemainderListString(setupNestList(currentMap, mapKey)); + if (closingAfterParseNestMapList()) { + return; + } + continue; + } + + final int delimiterIndex = _remainderString.indexOf(_delimiter); + final int endBraceIndex = _remainderString.indexOf(_endBrace); + assertEndBracekIndex(_remainderString, endBraceIndex, _topString, + currentMap); + + // If delimiter exists and delimiter is closer than end brace, + // Everything from the head of the present remainder string to the delimiter becomes map value. + // ex) value1,key2=value2} + if (delimiterIndex >= 0 && delimiterIndex < endBraceIndex) { + final String mapValue = _remainderString.substring(0, + delimiterIndex); + currentMap.put(mapKey, filterMapListValue(mapValue)); + + // Because the map element continues since the delimiter, skip the delimiter and continue the loop. + removePrefixTargetIndexPlus(delimiterIndex, _delimiter.length()); + continue; + } + + // Everything from the head of the present remainder string to the delimiter becomes map value. + // ex) value1}, key2=value2} + final String mapValue = _remainderString + .substring(0, endBraceIndex); + currentMap.put(mapKey, filterMapListValue(mapValue)); + + // Analyzing map is over. So closing and return. + closingByEndBraceIndex(endBraceIndex); + return; + } + } + + /** + * Parse remainder list string. + * + * @param currentList current list. + */ + protected void parseRemainderListString(final List currentList) { + while (true) { + if (initializeAtLoopBeginning()) { + return; + } + + // *** Now, _remainderString should starts with the value of the list. *** + + if (isStartsWithMapPrefix(_remainderString)) { + removePrefixMapMarkAndStartBrace(); + parseRemainderMapString(setupNestMap(currentList)); + if (closingAfterParseNestMapList()) { + return; + } + continue; + } + + if (isStartsWithListPrefix(_remainderString)) { + removePrefixListMarkAndStartBrace(); + parseRemainderListString(setupNestList(currentList)); + if (closingAfterParseNestMapList()) { + return; + } + continue; + } + + final int delimiterIndex = _remainderString.indexOf(_delimiter); + final int endBraceIndex = _remainderString.indexOf(_endBrace); + assertEndBraceIndex(_remainderString, endBraceIndex, _topString, + currentList); + + // If delimiter exists and delimiter is closer than end brace, + // Everything from the head of the present remainder string to the delimiter becomes list value. + // ex) value1,value2,value3} + if (delimiterIndex >= 0 && delimiterIndex < endBraceIndex) { + final String listValue = _remainderString.substring(0, + delimiterIndex); + currentList.add(filterMapListValue(listValue)); + + // Because the list element continues since the delimiter, skip the delimiter and continue the loop. + removePrefixTargetIndexPlus(delimiterIndex, _delimiter.length()); + continue; + } + + // Everything from the head of the present remainder string to the delimiter becomes list value. + // ex) value1}, value2, } + final String listValue = _remainderString.substring(0, + endBraceIndex); + currentList.add(filterMapListValue(listValue)); + + // Analyzing list is over. So closing and return. + closingByEndBraceIndex(endBraceIndex); + return; + } + } + + /** + * Initialize at loop beginning. + * + * @return Is return? + */ + protected boolean initializeAtLoopBeginning() { + // Remove prefix delimiter. (Result string is always trimmed.) + removePrefixAllDelimiter(); + + // If the remainder string is empty-string, Analyzing is over! + if (_remainderString.equals("")) { + return true; + } + + // If the remainder string starts with end-brace, Analyzing current map is over! + // And then remove the end-brace. + if (isStartsWithEndBrace(_remainderString)) { + removePrefixEndBrace(); + return true; + } + return false; + } + + /** + * Close after parse nest map list. + * + * @return Is return? + */ + protected boolean closingAfterParseNestMapList() { + // If the remainder string starts with end-brace, remove it and return true. + if (isStartsWithEndBrace(_remainderString)) { + removePrefixEndBrace(); + return true; + } + return false; + } + + /** + * Close by end-brace index. + * + * @param endBraceIndex End-brace index. + */ + protected void closingByEndBraceIndex(int endBraceIndex) { + // Remove the value that was finished analyzing and end-brace. + _remainderString = _remainderString.substring(endBraceIndex); + removePrefixEndBrace(); + } + + // **************************************************************************************************** + // StateFul Method + // *************** + + // ========================================================================================== + // Remove + // ====== + /** + * Remove prefix map-mark and start-brace. + */ + protected void removePrefixMapMarkAndStartBrace() { + removePrefix(_mapMark + _startBrace); + } + + /** + * Remove prefix list-mark and start-brace. + */ + protected void removePrefixListMarkAndStartBrace() { + removePrefix(_listMark + _startBrace); + } + + /** + * Remove prefix delimiter. + */ + protected void removePrefixDelimiter() { + removePrefix(_delimiter); + } + + /** + * Remove prefix end-brace. + */ + protected void removePrefixEndBrace() { + removePrefix(_endBrace); + } + + /** + * Remove prefix. + * + * @param prefixString Prefix string. (NotNull) + */ + protected void removePrefix(String prefixString) { + if (_remainderString == null) { + String msg = "Argument[remainderString] must not be null: " + + _remainderString; + throw new IllegalArgumentException(msg); + } + if (prefixString == null) { + String msg = "Argument[prefixString] must not be null: " + + prefixString; + throw new IllegalArgumentException(msg); + } + + removeBothSideSpaceAndTabAndNewLine(); + + if (_remainderString.length() < prefixString.length()) { + String msg = "Argument[remainderString] length must be larger than Argument[prefixString] length:"; + msg = msg + getNewLineAndIndent() + " # remainderString --> " + + _remainderString; + msg = msg + getNewLineAndIndent() + " # prefixString=" + + prefixString; + throw new IllegalArgumentException(msg); + } + if (!_remainderString.startsWith(prefixString)) { + String msg = "Argument[remainderString] must start with Argument[prefixString:]"; + msg = msg + getNewLineAndIndent() + " # remainderString --> " + + _remainderString; + msg = msg + getNewLineAndIndent() + " # prefixString --> " + + prefixString; + throw new IllegalArgumentException(msg); + } + + _remainderString = _remainderString.substring(prefixString.length()); + removeBothSideSpaceAndTabAndNewLine(); + } + + /** + * Remove prefix and delimiter. + */ + protected void removePrefixAllDelimiter() { + removeBothSideSpaceAndTabAndNewLine(); + + while (true) { + if (!isStartsWithDelimiter(_remainderString)) { + break; + } + + if (isStartsWithDelimiter(_remainderString)) { + removePrefixDelimiter(); + removeBothSideSpaceAndTabAndNewLine(); + } + } + } + + /** + * Remove both side space and tab and new-line. + */ + protected void removeBothSideSpaceAndTabAndNewLine() { + _remainderString = _remainderString.trim(); + } + + /** + * Remove prefix (target index plus one). + * + * @param index Index. + * @param plusCount Plus count. + */ + protected void removePrefixTargetIndexPlus(int index, int plusCount) { + _remainderString = _remainderString.substring(index + plusCount); + } + + // **************************************************************************************************** + // StateLess Method + // **************** + + // ========================================================================================== + // Assert + // ====== + /** + * Assert map-string. + * + * @param mapString Map-string. (NotNull) + */ + protected void assertMapString(String mapString) { + if (mapString == null) { + String msg = "Argument[mapString] must not be null: "; + throw new IllegalArgumentException(msg + "mapString=" + mapString); + } + mapString = mapString.trim(); + if (!isStartsWithMapPrefix(mapString)) { + String msg = "Argument[mapString] must start with '" + _mapMark + + _startBrace + "': "; + throw new IllegalArgumentException(msg + "mapString=" + mapString); + } + if (!isEndsWithEndBrace(mapString)) { + String msg = "Argument[mapString] must end with '" + _endBrace + + "': "; + throw new IllegalArgumentException(msg + "mapString=" + mapString); + } + + final int startBraceCount = getDelimiterCount(mapString, _startBrace); + final int endBraceCount = getDelimiterCount(mapString, _endBrace); + if (startBraceCount != endBraceCount) { + String msg = "It is necessary to have braces of the same number on start and end:"; + msg = msg + getNewLineAndIndent() + " # mapString --> " + mapString; + msg = msg + getNewLineAndIndent() + " # startBraceCount --> " + + startBraceCount; + msg = msg + getNewLineAndIndent() + " # endBraceCount --> " + + endBraceCount; + throw new IllegalArgumentException(msg); + } + } + + /** + * Assert list-string. + * + * @param listString List-string. (NotNull) + */ + protected void assertListString(String listString) { + if (listString == null) { + String msg = "Argument[listString] must not be null: "; + throw new IllegalArgumentException(msg + "listString=" + listString); + } + listString = listString.trim(); + if (!isStartsWithListPrefix(listString)) { + String msg = "Argument[listString] must start with '" + _mapMark + + "': "; + throw new IllegalArgumentException(msg + "listString=" + listString); + } + if (!isEndsWithEndBrace(listString)) { + String msg = "Argument[listString] must end with '" + _endBrace + + "': "; + throw new IllegalArgumentException(msg + "listString=" + listString); + } + + final int startBraceCount = getDelimiterCount(listString, _startBrace); + final int endBraceCount = getDelimiterCount(listString, _endBrace); + if (startBraceCount != endBraceCount) { + String msg = "It is necessary to have braces of the same number on start and end:"; + msg = msg + getNewLineAndIndent() + " # listString --> " + + listString; + msg = msg + getNewLineAndIndent() + " # startBraceCount --> " + + startBraceCount; + msg = msg + getNewLineAndIndent() + " # endBraceCount --> " + + endBraceCount; + throw new IllegalArgumentException(msg); + } + } + + /** + * Assert equal-index. + * + * @param remainderMapString Remainder map-string. (NotNull) + * @param equalIndex Equal-index. + * @param mapString4Log Map-string for log. (NotNull) + * @param currentMap4Log Current-map for log. (NotNull) + */ + protected void assertEqualIndex(String remainderMapString, int equalIndex, + String mapString4Log, Map currentMap4Log) { + if (remainderMapString == null) { + String msg = "Argument[remainderMapString] must not be null:"; + msg = msg + getNewLineAndIndent() + " # remainderMapString --> " + + remainderMapString; + msg = msg + getNewLineAndIndent() + " # equalIndex --> " + + equalIndex; + msg = msg + getNewLineAndIndent() + " # mapString4Log --> " + + mapString4Log; + msg = msg + getNewLineAndIndent() + " # currentMap4Log --> " + + currentMap4Log; + msg = msg + getNewLineAndIndent() + " # _startBrace --> " + + _startBrace; + msg = msg + getNewLineAndIndent() + " # _endBrace --> " + _endBrace; + msg = msg + getNewLineAndIndent() + " # _delimiter --> " + + _delimiter; + msg = msg + getNewLineAndIndent() + " # _equal --> " + _equal; + throw new IllegalArgumentException(msg); + } + + if (equalIndex < 0) { + String msg = "Argument[equalIndex] must be plus or zero:"; + msg = msg + getNewLineAndIndent() + " # remainderMapString --> " + + remainderMapString; + msg = msg + getNewLineAndIndent() + " # equalIndex --> " + + equalIndex; + msg = msg + getNewLineAndIndent() + " # mapString4Log --> " + + mapString4Log; + msg = msg + getNewLineAndIndent() + " # currentMap4Log --> " + + currentMap4Log; + msg = msg + getNewLineAndIndent() + " # _startBrace --> " + + _startBrace; + msg = msg + getNewLineAndIndent() + " # _endBrace --> " + _endBrace; + msg = msg + getNewLineAndIndent() + " # _delimiter --> " + + _delimiter; + msg = msg + getNewLineAndIndent() + " # _equal --> " + _equal; + throw new IllegalArgumentException(msg); + } + + if (remainderMapString.length() < equalIndex) { + String msg = "Argument[remainderMapString] length must be larger than equalIndex value:"; + msg = msg + getNewLineAndIndent() + " # remainderMapString --> " + + remainderMapString; + msg = msg + getNewLineAndIndent() + " # equalIndex --> " + + equalIndex; + msg = msg + getNewLineAndIndent() + " # mapString4Log --> " + + mapString4Log; + msg = msg + getNewLineAndIndent() + " # currentMap4Log --> " + + currentMap4Log; + msg = msg + getNewLineAndIndent() + " # _startBrace --> " + + _startBrace; + msg = msg + getNewLineAndIndent() + " # _endBrace --> " + _endBrace; + msg = msg + getNewLineAndIndent() + " # _delimiter --> " + + _delimiter; + msg = msg + getNewLineAndIndent() + " # _equal --> " + _equal; + throw new IllegalArgumentException(msg); + } + + final String expectedAsEndMark = remainderMapString.substring( + equalIndex, equalIndex + _equal.length()); + if (!expectedAsEndMark.equals(_equal)) { + String msg = "Argument[remainderMapString] must have '" + _equal + + "' at Argument[equalIndex]:"; + msg = msg + getNewLineAndIndent() + " # remainderMapString --> " + + remainderMapString; + msg = msg + getNewLineAndIndent() + " # equalIndex --> " + + equalIndex; + msg = msg + getNewLineAndIndent() + " # expectedAsEndMark --> " + + expectedAsEndMark; + msg = msg + getNewLineAndIndent() + " # mapString --> " + + mapString4Log; + msg = msg + getNewLineAndIndent() + " # currentMap --> " + + currentMap4Log; + msg = msg + getNewLineAndIndent() + " # _startBrace --> " + + _startBrace; + msg = msg + getNewLineAndIndent() + " # _endBrace --> " + _endBrace; + msg = msg + getNewLineAndIndent() + " # _delimiter --> " + + _delimiter; + msg = msg + getNewLineAndIndent() + " # _equal --> " + _equal; + throw new IllegalArgumentException(msg); + } + } + + /** + * Assert end-brace-index. + * + * @param remainderMapString Remainder map-string. (NotNull) + * @param endBraceIndex End-brace-index. + * @param mapString4Log Map-string for log. (NotNull) + * @param currentMap4Log Current-map for log. (NotNull) + */ + protected void assertEndBracekIndex(String remainderMapString, + int endBraceIndex, String mapString4Log, + Map currentMap4Log) { + if (remainderMapString == null) { + String msg = "Argument[remainderMapString] must not be null:"; + msg = msg + getNewLineAndIndent() + " # remainderMapString --> " + + remainderMapString; + msg = msg + getNewLineAndIndent() + " # endBraceIndex --> " + + endBraceIndex; + msg = msg + getNewLineAndIndent() + " # mapString --> " + + mapString4Log; + msg = msg + getNewLineAndIndent() + " # currentMap --> " + + currentMap4Log; + msg = msg + getNewLineAndIndent() + " # _startBrace --> " + + _startBrace; + msg = msg + getNewLineAndIndent() + " # _endBrace --> " + _endBrace; + msg = msg + getNewLineAndIndent() + " # _delimiter --> " + + _delimiter; + msg = msg + getNewLineAndIndent() + " # _equal --> " + _equal; + throw new IllegalArgumentException(msg); + } + + if (endBraceIndex < 0) { + String msg = "Argument[endMarkIndex] must be plus or zero:"; + msg = msg + getNewLineAndIndent() + " # remainderMapString --> " + + remainderMapString; + msg = msg + getNewLineAndIndent() + " # endBraceIndex --> " + + endBraceIndex; + msg = msg + getNewLineAndIndent() + " # mapString --> =" + + mapString4Log; + msg = msg + getNewLineAndIndent() + " # currentMap --> " + + currentMap4Log; + msg = msg + getNewLineAndIndent() + " # _startBrace --> " + + _startBrace; + msg = msg + getNewLineAndIndent() + " # _endBrace --> " + _endBrace; + msg = msg + getNewLineAndIndent() + " # _delimiter --> " + + _delimiter; + msg = msg + getNewLineAndIndent() + " # _equal --> " + _equal; + throw new IllegalArgumentException(msg); + } + + if (remainderMapString.length() < endBraceIndex) { + String msg = "Argument[remainderMapString] length must be larger than endMarkIndex value:"; + msg = msg + getNewLineAndIndent() + " # remainderMapString --> " + + remainderMapString; + msg = msg + getNewLineAndIndent() + " # endBraceIndex --> " + + endBraceIndex; + msg = msg + getNewLineAndIndent() + " # mapString --> " + + mapString4Log; + msg = msg + getNewLineAndIndent() + " # currentMap --> " + + currentMap4Log; + msg = msg + getNewLineAndIndent() + " # _startBrace --> " + + _startBrace; + msg = msg + getNewLineAndIndent() + " # _endBrace --> " + _endBrace; + msg = msg + getNewLineAndIndent() + " # _delimiter --> " + + _delimiter; + msg = msg + getNewLineAndIndent() + " # _equal --> " + _equal; + throw new IllegalArgumentException(msg); + } + + final String expectedAsEndMark = remainderMapString.substring( + endBraceIndex, endBraceIndex + _endBrace.length()); + if (!expectedAsEndMark.equals(_endBrace)) { + String msg = "Argument[remainderMapString] must have '" + _endBrace + + "' at Argument[endBraceIndex]:"; + msg = msg + getNewLineAndIndent() + " # remainderMapString --> " + + remainderMapString; + msg = msg + getNewLineAndIndent() + " # endBraceIndex --> " + + endBraceIndex; + msg = msg + getNewLineAndIndent() + " # expectedAsEndMark --> " + + expectedAsEndMark; + msg = msg + getNewLineAndIndent() + " # mapString --> " + + mapString4Log; + msg = msg + getNewLineAndIndent() + " # currentMap --> " + + currentMap4Log; + msg = msg + getNewLineAndIndent() + " # _startBrace --> " + + _startBrace; + msg = msg + getNewLineAndIndent() + " # _endBrace --> " + _endBrace; + msg = msg + getNewLineAndIndent() + " # _delimiter --> " + + _delimiter; + msg = msg + getNewLineAndIndent() + " # _equal --> " + _equal; + throw new IllegalArgumentException(msg); + } + } + + /** + * Assert end-brace-index. + * @param remainderListString Remainder list-string. (NotNull) + * @param endBraceIndex End-brace-index. + * @param listString4Log List-string for log. (NotNull) + * @param currentList4Log Current-list for log. (NotNull) + */ + protected void assertEndBraceIndex(String remainderListString, + int endBraceIndex, String listString4Log, List currentList4Log) { + if (remainderListString == null) { + String msg = "Argument[remainderListString] must not be null:"; + msg = msg + getNewLineAndIndent() + " # remainderListString --> " + + remainderListString; + msg = msg + getNewLineAndIndent() + " # endBraceIndex --> " + + endBraceIndex; + msg = msg + getNewLineAndIndent() + " # listString --> " + + listString4Log; + msg = msg + getNewLineAndIndent() + " # currentList --> " + + currentList4Log; + msg = msg + getNewLineAndIndent() + " # _startBrace --> " + + _startBrace; + msg = msg + getNewLineAndIndent() + " # _endBrace --> " + _endBrace; + msg = msg + getNewLineAndIndent() + " # _delimiter --> " + + _delimiter; + msg = msg + getNewLineAndIndent() + " # _equal --> " + _equal; + throw new IllegalArgumentException(msg); + } + + if (endBraceIndex < 0) { + String msg = "Argument[endMarkIndex] must be plus or zero:"; + msg = msg + getNewLineAndIndent() + " # remainderListString --> " + + remainderListString; + msg = msg + getNewLineAndIndent() + " # endBraceIndex --> " + + endBraceIndex; + msg = msg + getNewLineAndIndent() + " # listString --> " + + listString4Log; + msg = msg + getNewLineAndIndent() + " # currentList --> " + + currentList4Log; + msg = msg + getNewLineAndIndent() + " # _startBrace --> " + + _startBrace; + msg = msg + getNewLineAndIndent() + " # _endBrace --> " + _endBrace; + msg = msg + getNewLineAndIndent() + " # _delimiter --> " + + _delimiter; + msg = msg + getNewLineAndIndent() + " # _equal --> " + _equal; + throw new IllegalArgumentException(msg); + } + + if (remainderListString.length() < endBraceIndex) { + String msg = "Argument[remainderListString] length must be larger than endMarkIndex value:"; + msg = msg + getNewLineAndIndent() + " # remainderListString --> " + + remainderListString; + msg = msg + getNewLineAndIndent() + " # endBraceIndex --> " + + endBraceIndex; + msg = msg + getNewLineAndIndent() + " # listString --> " + + listString4Log; + msg = msg + getNewLineAndIndent() + " # currentList --> " + + currentList4Log; + msg = msg + getNewLineAndIndent() + " # _startBrace --> " + + _startBrace; + msg = msg + getNewLineAndIndent() + " # _endBrace --> " + _endBrace; + msg = msg + getNewLineAndIndent() + " # _delimiter --> " + + _delimiter; + msg = msg + getNewLineAndIndent() + " # _equal --> " + _equal; + throw new IllegalArgumentException(msg); + } + + final String expectedAsEndBrace = remainderListString.substring( + endBraceIndex, endBraceIndex + _endBrace.length()); + if (!expectedAsEndBrace.equals(_endBrace)) { + String msg = "Argument[remainderListString] must have '" + + _endBrace + "' at Argument[endBraceIndex]:"; + msg = msg + getNewLineAndIndent() + " # remainderListString --> " + + remainderListString; + msg = msg + getNewLineAndIndent() + " # endBraceIndex --> " + + endBraceIndex; + msg = msg + getNewLineAndIndent() + " # expectedAsEndBrace --> " + + expectedAsEndBrace; + msg = msg + getNewLineAndIndent() + " # listString --> " + + listString4Log; + msg = msg + getNewLineAndIndent() + " # currentList --> " + + currentList4Log; + msg = msg + getNewLineAndIndent() + " # _startBrace --> " + + _startBrace; + msg = msg + getNewLineAndIndent() + " # _endBrace --> " + _endBrace; + msg = msg + getNewLineAndIndent() + " # _delimiter --> " + + _delimiter; + msg = msg + getNewLineAndIndent() + " # _equal --> " + _equal; + throw new IllegalArgumentException(msg); + } + } + + // ========================================================================================== + // Filter + // ====== + /** + * Filter map or list value. + *

    + *

    +     * # The value is trimmed.
    +     * # If the value is null, this returns null.
    +     * # If the value is 'null', this returns null.
    +     * # If the trimmed value is empty string, this returns null.
    +     * 
    + * @param value value. (Nullable) + * @return Filtered value. (Nullable) + */ + protected String filterMapListValue(String value) { + if (value == null) { + return null; + } + value = value.trim(); + return (("".equals(value) || "null".equals(value)) ? null : value); + } + + // ========================================================================================== + // Judgement + // ========= + /** + * Does it start with map-prefix? + * + * @param targetString Target-string. (NotNull) + * @return Determination. + */ + protected boolean isStartsWithMapPrefix(String targetString) { + if (targetString == null) { + String msg = "Argument[targetString] must not be null: " + + targetString; + throw new IllegalArgumentException(msg); + } + targetString = targetString.trim(); + if (targetString.startsWith(_mapMark + _startBrace)) { + return true; + } else { + return false; + } + } + + /** + * Does it start with list-prefix? + * + * @param targetString Target-string. (NotNull) + * @return Determination. + */ + protected boolean isStartsWithListPrefix(String targetString) { + if (targetString == null) { + String msg = "Argument[targetString] must not be null: " + + targetString; + throw new IllegalArgumentException(msg); + } + targetString = targetString.trim(); + if (targetString.startsWith(_listMark + _startBrace)) { + return true; + } else { + return false; + } + } + + /** + * Does it start with delimiter? + * + * @param targetString Target-string. (NotNull) + * @return Determination. + */ + protected boolean isStartsWithDelimiter(String targetString) { + if (targetString == null) { + String msg = "Argument[targetString] must not be null: " + + targetString; + throw new IllegalArgumentException(msg); + } + targetString = targetString.trim(); + if (targetString.startsWith(_delimiter)) { + return true; + } else { + return false; + } + } + + /** + * Does it start with end-brace? + * + * @param targetString Target-string. (NotNull) + * @return Determination. + */ + protected boolean isStartsWithEndBrace(String targetString) { + if (targetString == null) { + String msg = "Argument[targetString] must not be null: " + + targetString; + throw new IllegalArgumentException(msg); + } + targetString = targetString.trim(); + if (targetString.startsWith(_endBrace)) { + return true; + } else { + return false; + } + } + + /** + * Does it end with end-brace? + * + * @param targetString Target-string. (NotNull) + * @return Determination. + */ + protected boolean isEndsWithEndBrace(String targetString) { + if (targetString == null) { + String msg = "Argument[targetString] must not be null: " + + targetString; + throw new IllegalArgumentException(msg); + } + targetString = targetString.trim(); + if (targetString.endsWith(_endBrace)) { + return true; + } else { + return false; + } + } + + // ========================================================================================== + // Other + // ===== + /** + * Setup nest map. + * + * @param currentMap Current-map. (NotNull) + * @param mapKey Map-key. (NotNull) + * @return Nest map. (NotNull) + */ + protected Map setupNestMap(Map currentMap, + String mapKey) { + final Map nestMap = newStringObjectMap(); + currentMap.put(mapKey, nestMap); + return nestMap; + } + + /** + * Setup nest map. + * + * @param currentList Current-list. (NotNull) + * @return Nest map. (NotNull) + */ + protected Map setupNestMap(List currentList) { + final Map nestMap = newStringObjectMap(); + currentList.add(nestMap); + return nestMap; + } + + /** + * Setup nest list. + * + * @param currentMap Current-map. (NotNull) + * @param mapKey Map-key. (NotNull) + * @return Nest list. (NotNull) + */ + protected List setupNestList(Map currentMap, + String mapKey) { + final List nestList = newObjectList(); + currentMap.put(mapKey, nestList); + return nestList; + } + + /** + * Setup nest list. + * + * @param currentList Current-list. (NotNull) + * @return Nest list. (NotNull) + */ + protected List setupNestList(List currentList) { + final List nestList = newObjectList(); + currentList.add(nestList); + return nestList; + } + + /** + * New string-object-map. + * + * @return String-object-map. (NotNull) + */ + protected Map newStringObjectMap() { + return new LinkedHashMap(); + } + + /** + * New object-list. + * + * @return String-object-list. (NotNull) + */ + protected List newObjectList() { + return new ArrayList(); + } + + /** + * Get new-line and indent. + * + * @return New-line and indent. (NotNull) + */ + protected String getNewLineAndIndent() { + return NEW_LINE + " "; + } + + /** + * Get count that target string exist in the base string. + * + * @param targetString Target string. + * @param delimiter Delimiter + * @return Delimiter count that _remainderString contains. + */ + protected int getDelimiterCount(String targetString, String delimiter) { + int result = 0; + for (int i = 0;;) { + if (targetString.indexOf(delimiter, i) != -1) { + result++; + i = targetString.indexOf(delimiter, i) + 1; + } else { + break; + } + } + if (result == 0) { + result = -1; + } + return result; + } +} \ No newline at end of file Property changes on: announcement/trunk/src/main/java/jp/sf/pal/announcement/db/allcommon/helper/MapListStringImpl.java ___________________________________________________________________ Name: svn:eol-style + native Added: announcement/trunk/src/main/java/jp/sf/pal/announcement/db/allcommon/helper/MapStringBuilder.java =================================================================== --- announcement/trunk/src/main/java/jp/sf/pal/announcement/db/allcommon/helper/MapStringBuilder.java (rev 0) +++ announcement/trunk/src/main/java/jp/sf/pal/announcement/db/allcommon/helper/MapStringBuilder.java 2008-06-30 02:54:27 UTC (rev 1002) @@ -0,0 +1,72 @@ +package jp.sf.pal.announcement.db.allcommon.helper; + +/** + * The interface of map-string-builder. + * + * @author DBFlute(AutoGenerator) + */ +public interface MapStringBuilder { + + // ===================================================================================== + // Setter + // ====== + public void setColumnNames(String[] columnNames); + + public void setColumnNameList(java.util.List columnNameList); + + public void setMsMapMark(String value); + + public void setMsStartBrace(String value); + + public void setMsEndBrace(String value); + + public void setMsDelimiter(String value); + + public void setMsEqual(String value); + + // ===================================================================================== + // Main + // ==== + public String buildByDelimiter(String values, String delimiter); + + public String buildFromList(java.util.List valueList); + + // ===================================================================================== + // Exception Static Class + // ====================== + public static class DifferentDelimiterCountException extends + RuntimeException { + + /** Serial version UID. (Default) */ + private static final long serialVersionUID = 1L; + + // ===================================================================================== + // Attribute + // ========= + protected java.util.List _columnNameList; + + protected java.util.List _valueList; + + // ===================================================================================== + // Constructor + // =========== + public DifferentDelimiterCountException(String msg, + java.util.List columnNameList, + java.util.List valueList) { + super(msg); + _columnNameList = columnNameList; + _valueList = valueList; + } + + // ===================================================================================== + // Accessor + // ======== + public java.util.List getColumnNameList() { + return _columnNameList; + } + + public java.util.List getValueList() { + return _valueList; + } + } +} Property changes on: announcement/trunk/src/main/java/jp/sf/pal/announcement/db/allcommon/helper/MapStringBuilder.java ___________________________________________________________________ Name: svn:eol-style + native Added: announcement/trunk/src/main/java/jp/sf/pal/announcement/db/allcommon/helper/MapStringBuilderImpl.java =================================================================== --- announcement/trunk/src/main/java/jp/sf/pal/announcement/db/allcommon/helper/MapStringBuilderImpl.java (rev 0) +++ announcement/trunk/src/main/java/jp/sf/pal/announcement/db/allcommon/helper/MapStringBuilderImpl.java 2008-06-30 02:54:27 UTC (rev 1002) @@ -0,0 +1,183 @@ +package jp.sf.pal.announcement.db.allcommon.helper; + +import jp.sf.pal.announcement.db.allcommon.helper.token.line.LineToken; +import jp.sf.pal.announcement.db.allcommon.helper.token.line.LineTokenizingOption; +import jp.sf.pal.announcement.db.allcommon.helper.token.line.impl.LineTokenImpl; + +/** + * The implementation of map-string-builder. + * + * @author DBFlute(AutoGenerator) + */ +public class MapStringBuilderImpl implements MapStringBuilder { + + protected java.util.List _columnNameList; + + protected String _msMapMark; + + protected String _msStartBrace; + + protected String _msEndBrace; + + protected String _msDelimiter; + + protected String _msEqual; + + protected boolean _trimDoubleQuotation; + + public void setColumnNames(String[] columnNames) { + _columnNameList = java.util.Arrays.asList(columnNames); + } + + public void setColumnNameList(java.util.List columnNameList) { + _columnNameList = columnNameList; + } + + public void setMsMapMark(String value) { + _msMapMark = value; + } + + public void setMsStartBrace(String value) { + _msStartBrace = value; + } + + public void setMsEndBrace(String value) { + _msEndBrace = value; + } + + public void setMsDelimiter(String value) { + _msDelimiter = value; + } + + public void setMsEqual(String value) { + _msEqual = value; + } + + public void trimDoubleQuotation() { + _trimDoubleQuotation = true; + } + + public String buildByDelimiter(String values, String delimiter) { + if (values == null) { + String msg = "The argument[values] should not be null."; + throw new IllegalArgumentException(msg); + } + if (delimiter == null) { + String msg = "The argument[delimiter] should not be null."; + throw new IllegalArgumentException(msg); + } + assertStringComponent(); + + final java.util.List valueList = tokenize(values, delimiter); + assertColumnValueList(_columnNameList, valueList); + + final StringBuffer sb = new StringBuffer(); + sb.append(_msMapMark).append(_msStartBrace); + for (int i = 0; i < _columnNameList.size(); i++) { + sb.append(_columnNameList.get(i)).append(_msEqual).append( + valueList.get(i)).append(_msDelimiter); + } + + sb.delete(sb.length() - _msDelimiter.length(), sb.length()); + sb.append(_msEndBrace); + return sb.toString(); + } + + public String buildFromList(java.util.List valueList) { + if (valueList == null) { + String msg = "The argument[valueList] should not be null."; + throw new IllegalArgumentException(msg); + } + assertStringComponent(); + assertColumnValueList(_columnNameList, valueList); + + final StringBuffer sb = new StringBuffer(); + sb.append(_msMapMark).append(_msStartBrace); + for (int i = 0; i < _columnNameList.size(); i++) { + sb.append(_columnNameList.get(i)).append(_msEqual).append( + valueList.get(i)).append(_msDelimiter); + } + + sb.delete(sb.length() - _msDelimiter.length(), sb.length()); + sb.append(_msEndBrace); + return sb.toString(); + } + + protected java.util.List tokenize(String value, String delimiter) { + final LineToken lineToken = new LineTokenImpl(); + final LineTokenizingOption lineTokenizingOption = new LineTokenizingOption(); + lineTokenizingOption.setDelimiter(delimiter); + if (_trimDoubleQuotation) { + lineTokenizingOption.trimDoubleQuotation(); + } + return lineToken.tokenize(value, lineTokenizingOption); + } + + protected void assertStringComponent() { + if (_columnNameList == null) { + String msg = "The columnNameList should not be null."; + throw new IllegalStateException(msg); + } + if (_columnNameList.isEmpty()) { + String msg = "The columnNameList should not be empty."; + throw new IllegalStateException(msg); + } + if (_msMapMark == null) { + String msg = "The msMapMark should not be null."; + throw new IllegalStateException(msg); + } + if (_msStartBrace == null) { + String msg = "The msStartBrace should not be null."; + throw new IllegalStateException(msg); + } + if (_msEndBrace == null) { + String msg = "The msEndBrace should not be null."; + throw new IllegalStateException(msg); + } + if (_msDelimiter == null) { + String msg = "The msDelimiter should not be null."; + throw new IllegalStateException(msg); + } + if (_msEqual == null) { + String msg = "The msEqual should not be null."; + throw new IllegalStateException(msg); + } + } + + protected void assertColumnValueList(java.util.List columnNameList, + java.util.List valueList) { + if (columnNameList.size() != valueList.size()) { + String msg = "The length of columnNameList and valueList are difference. (" + + columnNameList.size() + ", " + valueList.size() + ")"; + msg = msg + " columnNameList=" + columnNameList; + msg = msg + " valueList=" + valueList; + throw new DifferentDelimiterCountException(msg, columnNameList, + valueList); + } + } + + protected static final String replace(String text, String fromText, + String toText) { + if (text == null || fromText == null || toText == null) { + return null; + } + final StringBuffer buf = new StringBuffer(100); + int pos = 0; + int pos2 = 0; + while (true) { + pos = text.indexOf(fromText, pos2); + if (pos == 0) { + buf.append(toText); + pos2 = fromText.length(); + } else if (pos > 0) { + buf.append(text.substring(pos2, pos)); + buf.append(toText); + pos2 = pos + fromText.length(); + } else { + buf.append(text.substring(pos2)); + break; + } + } + return buf.toString(); + } +} Property changes on: announcement/trunk/src/main/java/jp/sf/pal/announcement/db/allcommon/helper/MapStringBuilderImpl.java ___________________________________________________________________ Name: svn:eol-style + native Added: announcement/trunk/src/main/java/jp/sf/pal/announcement/db/allcommon/helper/character/GeneralCharacter.java =================================================================== --- announcement/trunk/src/main/java/jp/sf/pal/announcement/db/allcommon/helper/character/GeneralCharacter.java (rev 0) +++ announcement/trunk/src/main/java/jp/sf/pal/announcement/db/allcommon/helper/character/GeneralCharacter.java 2008-06-30 02:54:27 UTC (rev 1002) @@ -0,0 +1,17 @@ +package jp.sf.pal.announcement.db.allcommon.helper.character; + +/** + * The interface of general character. + * + * @author DBFlute(AutoGenerator) + */ +public interface GeneralCharacter { + + public String toSingleByteAlphabet(String s); + + public String toSingleByteNumber(String s); + + public String toSingleByteAlphabetNumber(String target); + + public String toSingleByteAlphabetNumberMark(String target); +} Property changes on: announcement/trunk/src/main/java/jp/sf/pal/announcement/db/allcommon/helper/character/GeneralCharacter.java ___________________________________________________________________ Name: svn:eol-style + native Added: announcement/trunk/src/main/java/jp/sf/pal/announcement/db/allcommon/helper/character/JapaneseCharacter.java =================================================================== --- announcement/trunk/src/main/java/jp/sf/pal/announcement/db/allcommon/helper/character/JapaneseCharacter.java (rev 0) +++ announcement/trunk/src/main/java/jp/sf/pal/announcement/db/allcommon/helper/character/JapaneseCharacter.java 2008-06-30 02:54:27 UTC (rev 1002) @@ -0,0 +1,11 @@ +package jp.sf.pal.announcement.db.allcommon.helper.character; + +/** + * The interface of Japanese character. + * + * @author DBFlute(AutoGenerator) + */ +public interface JapaneseCharacter { + + public String toDoubleByteKatakana(String target); +} Property changes on: announcement/trunk/src/main/java/jp/sf/pal/announcement/db/allcommon/helper/character/JapaneseCharacter.java ___________________________________________________________________ Name: svn:eol-style + native Added: announcement/trunk/src/main/java/jp/sf/pal/announcement/db/allcommon/helper/character/impl/GeneralCharacterImpl.java =================================================================== --- announcement/trunk/src/main/java/jp/sf/pal/announcement/db/allcommon/helper/character/impl/GeneralCharacterImpl.java (rev 0) +++ announcement/trunk/src/main/java/jp/sf/pal/announcement/db/allcommon/helper/character/impl/GeneralCharacterImpl.java 2008-06-30 02:54:27 UTC (rev 1002) @@ -0,0 +1,102 @@ +package jp.sf.pal.announcement.db.allcommon.helper.character.impl; + +import jp.sf.pal.announcement.db.allcommon.helper.character.GeneralCharacter; + +/** + * The implementation of general character. + * + * @author DBFlute(AutoGenerator) + */ +public class GeneralCharacterImpl implements GeneralCharacter { + + public String toSingleByteAlphabet(String target) { + if (target == null || target.trim().length() == 0) { + return target; + } + final StringBuffer sb = new StringBuffer(); + for (int i = 0; i < target.length(); i++) { + final char currentChar = target.charAt(i); + + if (currentChar >= 0xff21 && currentChar <= 0xff3a) { + sb.append(toSingleByteCharacter(currentChar)); + } else if (currentChar >= 0xff41 && currentChar <= 0xff5a) { + sb.append(toSingleByteCharacter(currentChar)); + } else { + sb.append(currentChar); + } + } + return sb.toString(); + } + + public String toSingleByteNumber(String target) { + if (target == null || target.trim().length() == 0) { + return target; + } + final StringBuffer sb = new StringBuffer(); + for (int i = 0; i < target.length(); i++) { + final char currentChar = target.charAt(i); + if (currentChar >= 0xff10 && currentChar <= 0xff19) { + sb.append(toSingleByteCharacter(currentChar)); + } else { + sb.append(currentChar); + } + } + return sb.toString(); + } + + public String toSingleByteAlphabetNumber(String target) { + if (target == null || target.trim().length() == 0) { + return target; + } + final StringBuffer sb = new StringBuffer(); + for (int i = 0; i < target.length(); i++) { + final char currentChar = target.charAt(i); + + if (currentChar >= 0xff10 && currentChar <= 0xff19) { + sb.append(toSingleByteCharacter(currentChar)); + } else if (currentChar >= 0xff21 && currentChar <= 0xff3a) { + sb.append(toSingleByteCharacter(currentChar)); + } else if (currentChar >= 0xff41 && currentChar <= 0xff5a) { + sb.append(toSingleByteCharacter(currentChar)); + } else { + sb.append(currentChar); + } + } + return sb.toString(); + } + + public String toSingleByteAlphabetNumberMark(String target) { + if (target == null || target.trim().length() == 0) { + return target; + } + final StringBuffer sb = new StringBuffer(target.length()); + for (int i = 0; i < target.length(); i++) { + final char currentChar = target.charAt(i); + if (currentChar >= 0xff01 && currentChar <= 0xff5e) { + sb.append(toSingleByteCharacter(currentChar)); + + // TODO: @jflute - I will append mark... + } else if (currentChar == '\u2019' || currentChar == '\u2018' + || currentChar == '\u2032') { + sb.append('\''); + } else if (currentChar == '\u201d' || currentChar == '\u201c' + || currentChar == '\u2033') { + sb.append('\"'); + } else if (currentChar == '\uffe5') { + sb.append('\\'); + } else if (currentChar == '\u2010') { + sb.append('-'); + } else if (currentChar == '\uff5e') { + sb.append('~'); + + } else { + sb.append(currentChar); + } + } + return sb.toString(); + } + + protected char toSingleByteCharacter(final char currentChar) { + return (char) (currentChar - 0xfee0); + } +} Property changes on: announcement/trunk/src/main/java/jp/sf/pal/announcement/db/allcommon/helper/character/impl/GeneralCharacterImpl.java ___________________________________________________________________ Name: svn:eol-style + native Added: announcement/trunk/src/main/java/jp/sf/pal/announcement/db/allcommon/helper/character/impl/JapaneseCharacterImpl.java =================================================================== --- announcement/trunk/src/main/java/jp/sf/pal/announcement/db/allcommon/helper/character/impl/JapaneseCharacterImpl.java (rev 0) +++ announcement/trunk/src/main/java/jp/sf/pal/announcement/db/allcommon/helper/character/impl/JapaneseCharacterImpl.java 2008-06-30 02:54:27 UTC (rev 1002) @@ -0,0 +1,90 @@ +package jp.sf.pal.announcement.db.allcommon.helper.character.impl; + +import jp.sf.pal.announcement.db.allcommon.helper.character.JapaneseCharacter; + +/** + * The implementation of Japanese character. + * + * @author DBFlute(AutoGenerator) + */ +public class JapaneseCharacterImpl implements JapaneseCharacter { + + // Double-byte Katakana + protected static final String TABLE_ZENKANA = "\u3002\u300c\u300d\u3001\u30fb\u30f2\u30a1\u30a3\u30a5" + + "\u30a7\u30a9\u30e3\u30e5\u30e7\u30c3\u30fc\u30a2\u30a4" + + "\u30a6\u30a8\u30aa\u30ab\u30ad\u30af\u30b1\u30b3\u30b5" + + "\u30b7\u30b9\u30bb\u30bd\u30bf\u30c1\u30c4\u30c6\u30c8" + + "\u30ca\u30cb\u30cc\u30cd\u30ce\u30cf\u30d2\u30d5\u30d8" + + "\u30db\u30de\u30df\u30e0\u30e1\u30e2\u30e4\u30e6\u30e8" + + "\u30e9\u30ea\u30eb\u30ec\u30ed\u30ef\u30f3\u309b\u309c"; + + // (uff71 - uff9d) + protected static final String DEF_DOUBLE_BYTE_VOICED_SOUND_NORMAL_KATAKANA = "\u30a2\u30a4\u30f4\u30a8\u30aa" + + "\u30ac\u30ae\u30b0\u30b2\u30b4" + + "\u30b6\u30b8\u30ba\u30bc\u30be" + + "\u30c0\u30c2\u30c5\u30c7\u30c9" + + "\u30ca\u30cb\u30cc\u30cd\u30ce" + + "\u30d0\u30d3\u30d6\u30d9\u30dc" + + "\u30de\u30df\u30e0\u30e1\u30e2" + + "\u30e4\u30e6\u30e8" + + "\u30e9\u30ea\u30eb\u30ec\u30ed" + "\u30ef\u30f3"; + + // (uff66 - uff6f) + protected static final String DEF_DOUBLE_BYTE_VOICED_SOUND_SPECIAL_KATAKANA = "\u30fa\u30a1\u30a3\u30a5\u30a7\u30a9\u30e3\u30e5\u30e7"; + + // (u30cf - u30dd) + protected static final String DEF_DOUBLE_BYTE_SEMI_VOICED_SOUND_KATAKANA = "\u30d1\u30d4\u30d7\u30da\u30dd"; + + public String toDoubleByteKatakana(String target) { + if (target == null || target.trim().length() == 0) { + return target; + } + + final StringBuffer sb = new StringBuffer(); + for (int i = 0; i < target.length(); i++) { + final char currentChar = target.charAt(i); + final char nextChar; + if (i < target.length() - 1) { + nextChar = target.charAt(i + 1); + } else { + nextChar = ' '; + } + + if (isVoicedSoundKatakana(currentChar, nextChar)) { + if (currentChar >= 0xff66 && currentChar <= 0xff6f) {// Voiced sound special Katakana + sb.append(DEF_DOUBLE_BYTE_VOICED_SOUND_SPECIAL_KATAKANA + .charAt(currentChar - 0xff66)); + i++; + } else if (currentChar >= 0xff71 && currentChar <= 0xff9d) {// Voiced sound normal Katakana + sb.append(DEF_DOUBLE_BYTE_VOICED_SOUND_NORMAL_KATAKANA + .charAt(currentChar - 0xff71)); + i++; + } + + } else if (isSemiVoicedSoundKatakana(currentChar, nextChar)) { + sb.append(DEF_DOUBLE_BYTE_SEMI_VOICED_SOUND_KATAKANA + .charAt(currentChar - 0xff8a)); + i++; + } else if (currentChar != 0xff9e && currentChar != 0xff9f) { + if (currentChar >= 0xff61 && currentChar <= 0xff9f) { + sb.append(TABLE_ZENKANA.charAt(currentChar - 0xff61)); + } else { + sb.append(currentChar); + } + } + } + return sb.toString(); + } + + protected boolean isVoicedSoundKatakana(final char currentChar, + final char nextChar) { + return ((currentChar >= 0xff66 && currentChar <= 0xff6f) || (currentChar >= 0xff71 && (currentChar <= 0xff9d))) + && (nextChar == 0xff9e); + } + + protected boolean isSemiVoicedSoundKatakana(final char currentChar, + final char nextChar) { + return (currentChar >= 0xff8a && currentChar <= 0xff8e) + && (nextChar == 0xff9f); + } +} Property changes on: announcement/trunk/src/main/java/jp/sf/pal/announcement/db/allcommon/helper/character/impl/JapaneseCharacterImpl.java ___________________________________________________________________ Name: svn:eol-style + native Added: announcement/trunk/src/main/java/jp/sf/pal/announcement/db/allcommon/helper/collection/order/AccordingToOrder.java =================================================================== --- announcement/trunk/src/main/java/jp/sf/pal/announcement/db/allcommon/helper/collection/order/AccordingToOrder.java (rev 0) +++ announcement/trunk/src/main/java/jp/sf/pal/announcement/db/allcommon/helper/collection/order/AccordingToOrder.java 2008-06-30 02:54:27 UTC (rev 1002) @@ -0,0 +1,20 @@ +package jp.sf.pal.announcement.db.allcommon.helper.collection.order; + +import java.util.List; + +/** + * @author DBFlute(AutoGenerator) + */ +public interface AccordingToOrder { + + /** + * Order the unordered list. + * + * @param option The option of according-to-order. (NotNull) + * @param unorderedList The unordered list. (NotNull) + * @param The type of element. + * @param The type of ID. + */ + void order(List unorderedList, + AccordingToOrderOption option); +} Property changes on: announcement/trunk/src/main/java/jp/sf/pal/announcement/db/allcommon/helper/collection/order/AccordingToOrder.java ___________________________________________________________________ Name: svn:eol-style + native Added: announcement/trunk/src/main/java/jp/sf/pal/announcement/db/allcommon/helper/collection/order/AccordingToOrderIdExtractor.java =================================================================== --- announcement/trunk/src/main/java/jp/sf/pal/announcement/db/allcommon/helper/collection/order/AccordingToOrderIdExtractor.java (rev 0) +++ announcement/trunk/src/main/java/jp/sf/pal/announcement/db/allcommon/helper/collection/order/AccordingToOrderIdExtractor.java 2008-06-30 02:54:27 UTC (rev 1002) @@ -0,0 +1,17 @@ +package jp.sf.pal.announcement.db.allcommon.helper.collection.order; + +/** + * @author DBFlute(AutoGenerator) + * @param The type of element. + * @param The type of ID. + */ +public interface AccordingToOrderIdExtractor { + + /** + * Extract ID from the element instance. + * + * @param element Element instance. (NotNull) + * @return Extracted ID. (NotNull) + */ + ID_TYPE extractId(ELEMENT_TYPE element); +} Property changes on: announcement/trunk/src/main/java/jp/sf/pal/announcement/db/allcommon/helper/collection/order/AccordingToOrderIdExtractor.java ___________________________________________________________________ Name: svn:eol-style + native Added: announcement/trunk/src/main/java/jp/sf/pal/announcement/db/allcommon/helper/collection/order/AccordingToOrderOption.java =================================================================== --- announcement/trunk/src/main/java/jp/sf/pal/announcement/db/allcommon/helper/collection/order/AccordingToOrderOption.java (rev 0) +++ announcement/trunk/src/main/java/jp/sf/pal/announcement/db/allcommon/helper/collection/order/AccordingToOrderOption.java 2008-06-30 02:54:27 UTC (rev 1002) @@ -0,0 +1,47 @@ +package jp.sf.pal.announcement.db.allcommon.helper.collection.order; + +import java.util.List; + +/** + * @author DBFlute(AutoGenerator) + * @param The type of element. + * @param The type of ID. + */ +public class AccordingToOrderOption { + + // =================================================================================== + // Attribute + // ========= + protected List _orderedUniqueIdList; + + protected AccordingToOrderIdExtractor _idExtractor; + + // =================================================================================== + // Easy-to-Use + // =========== + public void setupOrderedResource(List orderedUniqueIdList, + AccordingToOrderIdExtractor idExtractor) { + setOrderedUniqueIdList(orderedUniqueIdList); + setIdExtractor(idExtractor); + } + + // =================================================================================== + // Accessor + // ======== + public List getOrderedUniqueIdList() { + return _orderedUniqueIdList; + } + + public void setOrderedUniqueIdList(List orderedUniqueIdList) { + this._orderedUniqueIdList = orderedUniqueIdList; + } + + public AccordingToOrderIdExtractor getIdExtractor() { + return _idExtractor; + } + + public void setIdExtractor( + AccordingToOrderIdExtractor idExtractor) { + _idExtractor = idExtractor; + } +} Property changes on: announcement/trunk/src/main/java/jp/sf/pal/announcement/db/allcommon/helper/collection/order/AccordingToOrderOption.java ___________________________________________________________________ Name: svn:eol-style + native Added: announcement/trunk/src/main/java/jp/sf/pal/announcement/db/allcommon/helper/collection/order/impl/AccordingToOrderImpl.java =================================================================== --- announcement/trunk/src/main/java/jp/sf/pal/announcement/db/allcommon/helper/collection/order/impl/AccordingToOrderImpl.java (rev 0) +++ announcement/trunk/src/main/java/jp/sf/pal/announcement/db/allcommon/helper/collection/order/impl/AccordingToOrderImpl.java 2008-06-30 02:54:27 UTC (rev 1002) @@ -0,0 +1,101 @@ +package jp.sf.pal.announcement.db.allcommon.helper.collection.order.impl; + +import java.util.Collections; +import java.util.Comparator; +import java.util.LinkedHashMap; +import java.util.List; +import java.util.Map; + +import jp.sf.pal.announcement.db.allcommon.helper.collection.order.AccordingToOrder; +import jp.sf.pal.announcement.db.allcommon.helper.collection.order.AccordingToOrderIdExtractor; +import jp.sf.pal.announcement.db.allcommon.helper.collection.order.AccordingToOrderOption; + +/** + * @author DBFlute(AutoGenerator) + */ +public class AccordingToOrderImpl implements AccordingToOrder { + + // =================================================================================== + // Main + // ==== + /** + * The implementation. + * + * @param unorderedList The unordered list. (NotNull) + * @param option The option of according-to-order. (NotNull) + * @param The type of element. + * @param The type of ID. + */ + public void order( + final List unorderedList, + final AccordingToOrderOption option) { + assertObjectNotNull("unorderedList", unorderedList); + if (unorderedList.isEmpty()) { + return; + } + assertObjectNotNull("option", option); + final List orderedUniqueIdList = option + .getOrderedUniqueIdList(); + assertObjectNotNull("option.getOrderedUniqueIdList()", + orderedUniqueIdList); + if (orderedUniqueIdList.isEmpty()) { + return; + } + final AccordingToOrderIdExtractor idExtractor = option + .getIdExtractor(); + assertObjectNotNull("option.getIdExtractor()", idExtractor); + + final Map idIndexMap = new LinkedHashMap(); + int index = 0; + for (ID_TYPE id : orderedUniqueIdList) { + if (idIndexMap.containsKey(id)) { + String msg = "The id was duplicated: id=" + id + + " orderedUniqueIdList=" + orderedUniqueIdList; + throw new IllegalStateException(msg); + } + idIndexMap.put(id, index); + ++index; + } + final Comparator comp = new Comparator() { + public int compare(ELEMENT_TYPE o1, ELEMENT_TYPE o2) { + final ID_TYPE id1 = idExtractor.extractId(o1); + final ID_TYPE id2 = idExtractor.extractId(o2); + assertObjectNotNull("id1 of " + o1, id1); + assertObjectNotNull("id2 of " + o2, id2); + final Integer index1 = idIndexMap.get(id1); + final Integer index2 = idIndexMap.get(id2); + if (index1 != null && index2 != null) { + return index1.compareTo(index2); + } + if (index1 == null && index2 == null) { + return 0; + } + return index1 == null ? 1 : -1; + } + }; + Collections.sort(unorderedList, comp); + } + + // =================================================================================== + // Assert Helper + // ============= + /** + * Assert that the object is not null. + * + * @param variableName Variable name. (NotNull) + * @param value Value. (NotNull) + * @exception IllegalArgumentException + */ + protected void assertObjectNotNull(String variableName, Object value) { + if (variableName == null) { + String msg = "The value should not be null: variableName=" + + variableName + " value=" + value; + throw new IllegalArgumentException(msg); + } + if (value == null) { + String msg = "The value should not be null: variableName=" + + variableName; + throw new IllegalArgumentException(msg); + } + } +} Property changes on: announcement/trunk/src/main/java/jp/sf/pal/announcement/db/allcommon/helper/collection/order/impl/AccordingToOrderImpl.java ___________________________________________________________________ Name: svn:eol-style + native Added: announcement/trunk/src/main/java/jp/sf/pal/announcement/db/allcommon/helper/token/file/FileMakingCallback.java =================================================================== --- announcement/trunk/src/main/java/jp/sf/pal/announcement/db/allcommon/helper/token/file/FileMakingCallback.java (rev 0) +++ announcement/trunk/src/main/java/jp/sf/pal/announcement/db/allcommon/helper/token/file/FileMakingCallback.java 2008-06-30 02:54:27 UTC (rev 1002) @@ -0,0 +1,17 @@ +package jp.sf.pal.announcement.db.allcommon.helper.token.file; + +/** + * @author DBFlute(AutoGenerator) + */ +public interface FileMakingCallback { + + /** + * Get file-making header information. + *
    +     * You should return your row resource for file-making.
    +     * It continues invoking until this method returns null.
    +     * 
    + * @return File-making header information. (Nullable) + */ + public FileMakingRowResource getRowResource(); +} Property changes on: announcement/trunk/src/main/java/jp/sf/pal/announcement/db/allcommon/helper/token/file/FileMakingCallback.java ___________________________________________________________________ Name: svn:eol-style + native Added: announcement/trunk/src/main/java/jp/sf/pal/announcement/db/allcommon/helper/token/file/FileMakingHeaderInfo.java =================================================================== --- announcement/trunk/src/main/java/jp/sf/pal/announcement/db/allcommon/helper/token/file/FileMakingHeaderInfo.java (rev 0) +++ announcement/trunk/src/main/java/jp/sf/pal/announcement/db/allcommon/helper/token/file/FileMakingHeaderInfo.java 2008-06-30 02:54:27 UTC (rev 1002) @@ -0,0 +1,23 @@ +package jp.sf.pal.announcement.db.allcommon.helper.token.file; + +import java.util.List; + +/** + * @author DBFlute(AutoGenerator) + */ +public class FileMakingHeaderInfo { + + protected List columnNameList = new java.util.ArrayList(); + + public List getColumnNameList() { + return columnNameList; + } + + public void setColumnNameList(List columnNameList) { + this.columnNameList = columnNameList; + } + + public boolean isEmpty() { + return this.columnNameList.isEmpty(); + } +} Property changes on: announcement/trunk/src/main/java/jp/sf/pal/announcement/db/allcommon/helper/token/file/FileMakingHeaderInfo.java ___________________________________________________________________ Name: svn:eol-style + native Added: announcement/trunk/src/main/java/jp/sf/pal/announcement/db/allcommon/helper/token/file/FileMakingOption.java =================================================================== --- announcement/trunk/src/main/java/jp/sf/pal/announcement/db/allcommon/helper/token/file/FileMakingOption.java (rev 0) +++ announcement/trunk/src/main/java/jp/sf/pal/announcement/db/allcommon/helper/token/file/FileMakingOption.java 2008-06-30 02:54:27 UTC (rev 1002) @@ -0,0 +1,104 @@ +package jp.sf.pal.announcement.db.allcommon.helper.token.file; + +/** + * @author DBFlute(AutoGenerator) + */ +public class FileMakingOption { + + // ===================================================================================== + // Attribute + // ========= + /** Encoding. (Required) */ + protected String _encoding; + + /** Delimiter. (Required) */ + protected String _delimiter; + + /** Line separator. (NotRequired) */ + protected String _lineSeparator; + + /** Good bye double quotation. (NotRequired) */ + protected boolean _goodByeDoubleQuotation; + + /** File-making header information. (NotRequired) */ + protected FileMakingHeaderInfo _fileMakingHeaderInfo; + + // ===================================================================================== + // Easy-to-Use + // =========== + public FileMakingOption delimitateByComma() { + _delimiter = ","; + return this; + } + + public FileMakingOption delimitateByTab() { + _delimiter = "\t"; + return this; + } + + public FileMakingOption encodeAsUTF8() { + _encoding = "UTF-8"; + return this; + } + + public FileMakingOption encodeAsWindows31J() { + _encoding = "Windows-31J"; + return this; + } + + public FileMakingOption separateCrLf() { + _lineSeparator = "\r\n"; + return this; + } + + public FileMakingOption separateLf() { + _lineSeparator = "\n"; + return this; + } + + public FileMakingOption goodByeDoubleQuotation() { + _goodByeDoubleQuotation = true; + return this; + } + + // ===================================================================================== + // Accessor + // ======== + public String getEncoding() { + return _encoding; + } + + public void setEncoding(String encoding) { + _encoding = encoding; + } + + public String getDelimiter() { + return _delimiter; + } + + public void setDelimiter(String delimiter) { + _delimiter = delimiter; + } + + public String getLineSeparator() { + return _lineSeparator; + } + + public void setLineSeparator(String lineSeparator) { + _lineSeparator = lineSeparator; + } + + public boolean isGoodByeDoubleQuotation() { + return _goodByeDoubleQuotation; + } + + public FileMakingHeaderInfo getFileMakingHeaderInfo() { + return _fileMakingHeaderInfo; + } + + public void setFileMakingHeaderInfo( + FileMakingHeaderInfo fileMakingHeaderInfo) { + _fileMakingHeaderInfo = fileMakingHeaderInfo; + } + +} \ No newline at end of file Property changes on: announcement/trunk/src/main/java/jp/sf/pal/announcement/db/allcommon/helper/token/file/FileMakingOption.java ___________________________________________________________________ Name: svn:eol-style + native Added: announcement/trunk/src/main/java/jp/sf/pal/announcement/db/allcommon/helper/token/file/FileMakingRowResource.java =================================================================== --- announcement/trunk/src/main/java/jp/sf/pal/announcement/db/allcommon/helper/token/file/FileMakingRowResource.java (rev 0) +++ announcement/trunk/src/main/java/jp/sf/pal/announcement/db/allcommon/helper/token/file/FileMakingRowResource.java 2008-06-30 02:54:27 UTC (rev 1002) @@ -0,0 +1,45 @@ +package jp.sf.pal.announcement.db.allcommon.helper.token.file; + +/** + * @author DBFlute(AutoGenerator) + */ +public class FileMakingRowResource { + + // ===================================================================================== + // Attribute + // ========= + protected java.util.List _valueList; + + protected java.util.LinkedHashMap _nameValueMap; + + // ===================================================================================== + // Accessor + // ======== + public java.util.List getValueList() { + return _valueList; + } + + /** + * Set the list of value. {Priority One} + * + * @param valueList The list of value. (NotNull and NotEmpty) + */ + public void setValueList(java.util.List valueList) { + this._valueList = valueList; + } + + public java.util.LinkedHashMap getNameValueMap() { + return _nameValueMap; + } + + /** + * Set the map of name and value. {Priority Two}
    + * If valueList is set, This nameValueMap is ignored. + * + * @param nameValueMap The map of name and value. (NotNull and NotEmpty) + */ + public void setNameValueMap( + java.util.LinkedHashMap nameValueMap) { + this._nameValueMap = nameValueMap; + } +} Property changes on: announcement/trunk/src/main/java/jp/sf/pal/announcement/db/allcommon/helper/token/file/FileMakingRowResource.java ___________________________________________________________________ Name: svn:eol-style + native Added: announcement/trunk/src/main/java/jp/sf/pal/announcement/db/allcommon/helper/token/file/FileMakingSimpleFacade.java =================================================================== --- announcement/trunk/src/main/java/jp/sf/pal/announcement/db/allcommon/helper/token/file/FileMakingSimpleFacade.java (rev 0) +++ announcement/trunk/src/main/java/jp/sf/pal/announcement/db/allcommon/helper/token/file/FileMakingSimpleFacade.java 2008-06-30 02:54:27 UTC (rev 1002) @@ -0,0 +1,35 @@ +package jp.sf.pal.announcement.db.allcommon.helper.token.file; + +/** + * @author DBFlute(AutoGenerator) + */ +public interface FileMakingSimpleFacade { + + /** + * Make token-file from row-list. + * + * @param filename Output target file name. (NotNull) + * @param rowList Row-list composed of value-list. (NotNull) + * @param fileMakingOption File-making option. (NotNull and Required{encoding and delimiter}) + * @throws java.io.FileNotFoundException + * @throws java.io.IOException + */ + public void makeFromRowList(final String filename, + final java.util.List> rowList, + final FileMakingOption fileMakingOption) + throws java.io.FileNotFoundException, java.io.IOException; + + /** + * Make bytes from row-list. + * + * @param rowList Row-list composed of value-list. (NotNull) + * @param fileMakingOption File-making option. (NotNull and Required{encoding and delimiter}) + * @return Result byte array. (NotNull) + * @throws java.io.FileNotFoundException + * @throws java.io.IOException + */ + public byte[] makeFromRowList( + final java.util.List> rowList, + final FileMakingOption fileMakingOption) + throws java.io.FileNotFoundException, java.io.IOException; +} Property changes on: announcement/trunk/src/main/java/jp/sf/pal/announcement/db/allcommon/helper/token/file/FileMakingSimpleFacade.java ___________________________________________________________________ Name: svn:eol-style + native Added: announcement/trunk/src/main/java/jp/sf/pal/announcement/db/allcommon/helper/token/file/FileToken.java =================================================================== --- announcement/trunk/src/main/java/jp/sf/pal/announcement/db/allcommon/helper/token/file/FileToken.java (rev 0) +++ announcement/trunk/src/main/java/jp/sf/pal/announcement/db/allcommon/helper/token/file/FileToken.java 2008-06-30 02:54:27 UTC (rev 1002) @@ -0,0 +1,70 @@ +package jp.sf.pal.announcement.db.allcommon.helper.token.file; + +/** + * File-Token. + * + * @author DBFlute(AutoGenerator) + */ +public interface FileToken { + + /** + * Tokenize token-file data of a specified file. + * + * @param filename Input target file name. (NotNull) + * @param fileTokenizingCallback File-tokenizing callback. (NotNull) + * @param fileTokenizingOption File-tokenizing option. (NotNull and Required{encoding and delimiter}) + * @throws java.io.FileNotFoundException + * @throws java.io.IOException + */ + public void tokenize(String filename, + FileTokenizingCallback fileTokenizingCallback, + FileTokenizingOption fileTokenizingOption) + throws java.io.FileNotFoundException, java.io.IOException; + + /** + * Tokenize token-file data of a specified file. + *
    +     * This method uses java.io.InputStreamReader and java.io.BufferedReader that wrap the argument[inputStream].
    +     * These objects are closed. (Invoking close() at finally)
    +     * 
    + * @param inputStream Input target stream. (NotNull) + * @param fileTokenizingCallback File-tokenizing callback. (NotNull) + * @param fileTokenizingOption File-tokenizing option. (NotNull and Required{encoding and delimiter}) + * @throws java.io.FileNotFoundException + * @throws java.io.IOException + */ + public void tokenize(java.io.InputStream inputStream, + FileTokenizingCallback fileTokenizingCallback, + FileTokenizingOption fileTokenizingOption) + throws java.io.FileNotFoundException, java.io.IOException; + + /** + * Make token-file from specified row resources. + * + * @param filename Output target file name. (NotNull) + * @param fileMakingCallback File-making callback. (NotNull) + * @param fileMakingOption File-making option. (NotNull and Required{encoding and delimiter}) + * @throws java.io.FileNotFoundException + * @throws java.io.IOException + */ + public void make(String filename, FileMakingCallback fileMakingCallback, + FileMakingOption fileMakingOption) + throws java.io.FileNotFoundException, java.io.IOException; + + /** + * Make token-file from specified row resources. + *
    +     * This method uses java.io.BufferedOutputStream and java.io.OutputStreamWriter that wrap the argument[outputStream].
    +     * These objects are closed. (Invoking close() at finally)
    +     * 
    + * @param outputStream Output target stream. (NotNull) + * @param fileMakingCallback File-making callback. (NotNull) + * @param fileMakingOption File-making option. (NotNull and Required{encoding and delimiter}) + * @throws java.io.FileNotFoundException + * @throws java.io.IOException + */ + public void make(java.io.OutputStream outputStream, + FileMakingCallback fileMakingCallback, + FileMakingOption fileMakingOption) + throws java.io.FileNotFoundException, java.io.IOException; +} \ No newline at end of file Property changes on: announcement/trunk/src/main/java/jp/sf/pal/announcement/db/allcommon/helper/token/file/FileToken.java ___________________________________________________________________ Name: svn:eol-style + native Added: announcement/trunk/src/main/java/jp/sf/pal/announcement/db/allcommon/helper/token/file/FileTokenizingCallback.java =================================================================== --- announcement/trunk/src/main/java/jp/sf/pal/announcement/db/allcommon/helper/token/file/FileTokenizingCallback.java (rev 0) +++ announcement/trunk/src/main/java/jp/sf/pal/announcement/db/allcommon/helper/token/file/FileTokenizingCallback.java 2008-06-30 02:54:27 UTC (rev 1002) @@ -0,0 +1,9 @@ +package jp.sf.pal.announcement.db.allcommon.helper.token.file; + +/** + * @author DBFlute(AutoGenerator) + */ +public interface FileTokenizingCallback { + public void handleRowResource( + FileTokenizingRowResource fileTokenizingRowResource); +} Property changes on: announcement/trunk/src/main/java/jp/sf/pal/announcement/db/allcommon/helper/token/file/FileTokenizingCallback.java ___________________________________________________________________ Name: svn:eol-style + native Added: announcement/trunk/src/main/java/jp/sf/pal/announcement/db/allcommon/helper/token/file/FileTokenizingHeaderInfo.java =================================================================== --- announcement/trunk/src/main/java/jp/sf/pal/announcement/db/allcommon/helper/token/file/FileTokenizingHeaderInfo.java (rev 0) +++ announcement/trunk/src/main/java/jp/sf/pal/announcement/db/allcommon/helper/token/file/FileTokenizingHeaderInfo.java 2008-06-30 02:54:27 UTC (rev 1002) @@ -0,0 +1,42 @@ +package jp.sf.pal.announcement.db.allcommon.helper.token.file; + +import java.util.List; + +/** + * @author DBFlute(AutoGenerator) + */ +public class FileTokenizingHeaderInfo { + + // ===================================================================================== + // Attribute + // ========= + protected List _columnNameList = new java.util.ArrayList(); + + // ===================================================================================== + // Easy-to-Use + // =========== + protected String _columnNameRowString; + + public boolean isEmpty() { + return this._columnNameList.isEmpty(); + } + + // ===================================================================================== + // Accessor + // ======== + public List getColumnNameList() { + return _columnNameList; + } + + public void setColumnNameList(List columnNameList) { + this._columnNameList = columnNameList; + } + + public String getColumnNameRowString() { + return _columnNameRowString; + } + + public void setColumnNameRowString(String columnNameRowString) { + _columnNameRowString = columnNameRowString; + } +} Property changes on: announcement/trunk/src/main/java/jp/sf/pal/announcement/db/allcommon/helper/token/file/FileTokenizingHeaderInfo.java ___________________________________________________________________ Name: svn:eol-style + native Added: announcement/trunk/src/main/java/jp/sf/pal/announcement/db/allcommon/helper/token/file/FileTokenizingOption.java =================================================================== --- announcement/trunk/src/main/java/jp/sf/pal/announcement/db/allcommon/helper/token/file/FileTokenizingOption.java (rev 0) +++ announcement/trunk/src/main/java/jp/sf/pal/announcement/db/allcommon/helper/token/file/FileTokenizingOption.java 2008-06-30 02:54:27 UTC (rev 1002) @@ -0,0 +1,78 @@ +package jp.sf.pal.announcement.db.allcommon.helper.token.file; + +/** + * @author DBFlute(AutoGenerator) + */ +public class FileTokenizingOption { + + // ===================================================================================== + // Attribute + // ========= + protected String _encoding; + + protected String _delimiter; + + protected boolean _beginFirstLine; + + protected boolean _handleEmptyAsNull; + + // ===================================================================================== + // Easy-to-Use + // =========== + public FileTokenizingOption delimitateByComma() { + _delimiter = ","; + return this; + } + + public FileTokenizingOption delimitateByTab() { + _delimiter = "\t"; + return this; + } + + public FileTokenizingOption encodeAsUTF8() { + _encoding = "UTF-8"; + return this; + } + + public FileTokenizingOption encodeAsWindows31J() { + _encoding = "Windows-31J"; + return this; + } + + public FileTokenizingOption beginFirstLine() { + _beginFirstLine = true; + return this; + } + + public FileTokenizingOption handleEmptyAsNull() { + _handleEmptyAsNull = true; + return this; + } + + // ===================================================================================== + // Accessor + // ======== + public String getDelimiter() { + return _delimiter; + } + + public void setDelimiter(String delimiter) { + _delimiter = delimiter; + } + + public String getEncoding() { + return _encoding; + } + + public void setEncoding(String encoding) { + _encoding = encoding; + } + + public boolean isBeginFirstLine() { + return _beginFirstLine; + } + + public boolean isHandleEmptyAsNull() { + return _handleEmptyAsNull; + } +} \ No newline at end of file Property changes on: announcement/trunk/src/main/java/jp/sf/pal/announcement/db/allcommon/helper/token/file/FileTokenizingOption.java ___________________________________________________________________ Name: svn:eol-style + native Added: announcement/trunk/src/main/java/jp/sf/pal/announcement/db/allcommon/helper/token/file/FileTokenizingRowResource.java =================================================================== --- announcement/trunk/src/main/java/jp/sf/pal/announcement/db/allcommon/helper/token/file/FileTokenizingRowResource.java (rev 0) +++ announcement/trunk/src/main/java/jp/sf/pal/announcement/db/allcommon/helper/token/file/FileTokenizingRowResource.java 2008-06-30 02:54:27 UTC (rev 1002) @@ -0,0 +1,66 @@ +package jp.sf.pal.announcement.db.allcommon.helper.token.file; + +/** + * @author DBFlute(AutoGenerator) + */ +public class FileTokenizingRowResource { + + // ===================================================================================== + // Attribute + // ========= + protected FileTokenizingHeaderInfo fileTokenizingHeaderInfo; + + protected java.util.List valueList; + + protected String rowString; + + /** The row number. */ + protected int _rowNumber; + + /** The line number. */ + protected int _lineNumber; + + // ===================================================================================== + // Accessor + // ======== + public FileTokenizingHeaderInfo getFileTokenizingHeaderInfo() { + return fileTokenizingHeaderInfo; + } + + public void setFirstLineInfo( + FileTokenizingHeaderInfo fileTokenizingHeaderInfo) { + this.fileTokenizingHeaderInfo = fileTokenizingHeaderInfo; + } + + public java.util.List getValueList() { + return valueList; + } + + public void setValueList(java.util.List valueList) { + this.valueList = valueList; + } + + public String getRowString() { + return rowString; + } + + public void setRowString(String rowString) { + this.rowString = rowString; + } + + public int getRowNumber() { + return _rowNumber; + } + + public void setRowNumber(int rowNumber) { + _rowNumber = rowNumber; + } + + public int getLineNumber() { + return _lineNumber; + } + + public void setLineNumber(int lineNumber) { + _lineNumber = lineNumber; + } +} Property changes on: announcement/trunk/src/main/java/jp/sf/pal/announcement/db/allcommon/helper/token/file/FileTokenizingRowResource.java ___________________________________________________________________ Name: svn:eol-style + native Added: announcement/trunk/src/main/java/jp/sf/pal/announcement/db/allcommon/helper/token/file/impl/FileMakingSimpleFacadeImpl.java =================================================================== --- announcement/trunk/src/main/java/jp/sf/pal/announcement/db/allcommon/helper/token/file/impl/FileMakingSimpleFacadeImpl.java (rev 0) +++ announcement/trunk/src/main/java/jp/sf/pal/announcement/db/allcommon/helper/token/file/impl/FileMakingSimpleFacadeImpl.java 2008-06-30 02:54:27 UTC (rev 1002) @@ -0,0 +1,83 @@ +package jp.sf.pal.announcement.db.allcommon.helper.token.file.impl; + +import jp.sf.pal.announcement.db.allcommon.helper.token.file.FileMakingCallback; +import jp.sf.pal.announcement.db.allcommon.helper.token.file.FileMakingOption; +import jp.sf.pal.announcement.db.allcommon.helper.token.file.FileMakingRowResource; +import jp.sf.pal.announcement.db.allcommon.helper.token.file.FileMakingSimpleFacade; +import jp.sf.pal.announcement.db.allcommon.helper.token.file.FileToken; + +/** + * @author DBFlute(AutoGenerator) + */ +public class FileMakingSimpleFacadeImpl implements FileMakingSimpleFacade { + + protected FileToken _fileToken = new FileTokenImpl(); + + public void setFileToken(FileToken fileToken) { + this._fileToken = fileToken; + } + + /** + * Make token-file from row-list. + * + * @param filename Output target file name. (NotNull) + * @param rowList Row-list composed of value-list. (NotNull) + * @param fileMakingOption File-making option. (NotNull and Required{encoding and delimiter}) + * @throws java.io.FileNotFoundException + * @throws java.io.IOException + */ + public void makeFromRowList(final String filename, + final java.util.List> rowList, + final FileMakingOption fileMakingOption) + throws java.io.FileNotFoundException, java.io.IOException { + final FileMakingCallback fileMakingCallback = new FileMakingCallback() { + protected int rowCount = 0; + + public FileMakingRowResource getRowResource() { + ++rowCount; + if (rowList.size() < rowCount) { + return null;// The End! + } + final java.util.List valueList = (java.util.List) rowList + .get(rowCount - 1); + final FileMakingRowResource fileMakingRowResource = new FileMakingRowResource(); + fileMakingRowResource.setValueList(valueList); + return fileMakingRowResource; + } + }; + _fileToken.make(filename, fileMakingCallback, fileMakingOption); + } + + /** + * Make bytes from row-list. + * + * @param rowList Row-list composed of value-list. (NotNull) + * @param fileMakingOption File-making option. (NotNull and Required{encoding and delimiter}) + * @return Result byte array. (NotNull) + * @throws java.io.FileNotFoundException + * @throws java.io.IOException + */ + public byte[] makeFromRowList( + final java.util.List> rowList, + final FileMakingOption fileMakingOption) + throws java.io.FileNotFoundException, java.io.IOException { + final FileMakingCallback fileMakingCallback = new FileMakingCallback() { + protected int rowCount = 0; + + public FileMakingRowResource getRowResource() { + ++rowCount; + if (rowList.size() < rowCount) { + return null;// The End! + } + final java.util.List valueList = (java.util.List) rowList + .get(rowCount - 1); + final FileMakingRowResource fileMakingRowResource = new FileMakingRowResource(); + fileMakingRowResource.setValueList(valueList); + return fileMakingRowResource; + } + }; + final java.io.ByteArrayOutputStream baos = new java.io.ByteArrayOutputStream(); + _fileToken.make(baos, fileMakingCallback, fileMakingOption); + return baos.toByteArray(); + } +} Property changes on: announcement/trunk/src/main/java/jp/sf/pal/announcement/db/allcommon/helper/token/file/impl/FileMakingSimpleFacadeImpl.java ___________________________________________________________________ Name: svn:eol-style + native Added: announcement/trunk/src/main/java/jp/sf/pal/announcement/db/allcommon/helper/token/file/impl/FileTokenImpl.java =================================================================== --- announcement/trunk/src/main/java/jp/sf/pal/announcement/db/allcommon/helper/token/file/impl/FileTokenImpl.java (rev 0) +++ announcement/trunk/src/main/java/jp/sf/pal/announcement/db/allcommon/helper/token/file/impl/FileTokenImpl.java 2008-06-30 02:54:27 UTC (rev 1002) @@ -0,0 +1,554 @@ +package jp.sf.pal.announcement.db.allcommon.helper.token.file.impl; + +import java.util.ArrayList; +import java.util.Iterator; +import java.util.List; + +import jp.sf.pal.announcement.db.allcommon.helper.token.file.FileMakingCallback; +import jp.sf.pal.announcement.db.allcommon.helper.token.file.FileMakingHeaderInfo; +import jp.sf.pal.announcement.db.allcommon.helper.token.file.FileMakingOption; +import jp.sf.pal.announcement.db.allcommon.helper.token.file.FileMakingRowResource; +import jp.sf.pal.announcement.db.allcommon.helper.token.file.FileToken; +import jp.sf.pal.announcement.db.allcommon.helper.token.file.FileTokenizingCallback; +import jp.sf.pal.announcement.db.allcommon.helper.token.file.FileTokenizingHeaderInfo; +import jp.sf.pal.announcement.db.allcommon.helper.token.file.FileTokenizingOption; +import jp.sf.pal.announcement.db.allcommon.helper.token.file.FileTokenizingRowResource; +import jp.sf.pal.announcement.db.allcommon.helper.token.line.LineMakingOption; +import jp.sf.pal.announcement.db.allcommon.helper.token.line.LineToken; +import jp.sf.pal.announcement.db.allcommon.helper.token.line.LineTokenizingOption; +import jp.sf.pal.announcement.db.allcommon.helper.token.line.impl.LineTokenImpl; + +/** + * @author DBFlute(AutoGenerator) + */ +public class FileTokenImpl implements FileToken { + + // ===================================================================================== + // Attribute + // ========= + /** Line-token for help. */ + protected final LineToken _lineToken = new LineTokenImpl(); + + // ===================================================================================== + // Main + // ==== + /** + * Tokenize token-file data of a specified file. + * + * @param filename File name. (NotNull) + * @param fileTokenizingCallback File-tokenizing callback. (NotNull) + * @param fileTokenizingOption File-tokenizing option. (NotNull and Required{encoding and delimiter}) + * @throws java.io.FileNotFoundException + * @throws java.io.IOException + */ + public void tokenize(String filename, + FileTokenizingCallback fileTokenizingCallback, + FileTokenizingOption fileTokenizingOption) + throws java.io.FileNotFoundException, java.io.IOException { + assertStringNotNullAndNotTrimmedEmpty("filename", filename); + + java.io.FileInputStream fis = null; + try { + fis = new java.io.FileInputStream(filename); + tokenize(fis, fileTokenizingCallback, fileTokenizingOption); + } catch (java.io.FileNotFoundException e) { + throw e; + } catch (java.io.IOException e) { + throw e; + } finally { + try { + if (fis != null) { + fis.close(); + } + } catch (java.io.IOException ignored) { + } + } + } + + /** + * Tokenize token-file data of a specified file. + *
    +     * This method uses java.io.InputStreamReader and java.io.BufferedReader that wrap the argument[inputStream].
    +     * These objects are closed. (Invoking close() at finally)
    +     * 
    + * @param inputStream Input target stream. (NotNull) + * @param fileTokenizingCallback File-tokenizing callback. (NotNull) + * @param fileTokenizingOption File-tokenizing option. (NotNull and Required{encoding and delimiter}) + * @throws java.io.FileNotFoundException + * @throws java.io.IOException + */ + public void tokenize(java.io.InputStream inputStream, + FileTokenizingCallback fileTokenizingCallback, + FileTokenizingOption fileTokenizingOption) + throws java.io.FileNotFoundException, java.io.IOException { + assertObjectNotNull("inputStream", inputStream); + assertObjectNotNull("fileTokenizingCallback", fileTokenizingCallback); + assertObjectNotNull("fileTokenizingOption", fileTokenizingOption); + final String delimiter = fileTokenizingOption.getDelimiter(); + final String encoding = fileTokenizingOption.getEncoding(); + assertStringNotNullAndNotTrimmedEmpty("encoding", encoding); + assertObjectNotNull("delimiter", delimiter); + + java.io.InputStreamReader ir = null; + java.io.BufferedReader br = null; + + String lineString = null; + String preContinueString = ""; + final List temporaryValueList = new ArrayList(); + final List filteredValueList = new ArrayList(); + + try { + ir = new java.io.InputStreamReader(inputStream, encoding); + br = new java.io.BufferedReader(ir); + + FileTokenizingHeaderInfo fileTokenizingHeaderInfo = null; + int count = -1; + int rowNumber = 1; + int lineNumber = 0; + while (true) { + ++count; + if ("".equals(preContinueString)) { + lineNumber = count + 1; + } + + lineString = br.readLine(); + if (lineString == null) { + break; + } + if (count == 0) { + if (fileTokenizingOption.isBeginFirstLine()) { + fileTokenizingHeaderInfo = new FileTokenizingHeaderInfo();// As empty + } else { + fileTokenizingHeaderInfo = analyzeHeaderInfo(delimiter, + lineString); + continue; + } + } + final String rowString; + if (preContinueString.equals("")) { + rowString = lineString; + } else { + final String lineSeparator = System + .getProperty("line.separator"); + rowString = preContinueString + lineSeparator + lineString; + } + final ValueLineInfo valueLineInfo = arrangeValueList(rowString, + delimiter); + final List ls = valueLineInfo.getValueList(); + if (valueLineInfo.isContinueNextLine()) { + preContinueString = (String) ls.remove(ls.size() - 1); + temporaryValueList.addAll(ls); + continue; + } + temporaryValueList.addAll(ls); + + try { + final FileTokenizingRowResource fileTokenizingRowResource = new FileTokenizingRowResource(); + fileTokenizingRowResource + .setFirstLineInfo(fileTokenizingHeaderInfo); + + if (fileTokenizingOption.isHandleEmptyAsNull()) { + for (final Iterator ite = temporaryValueList + .iterator(); ite.hasNext();) { + final String value = (String) ite.next(); + if ("".equals(value)) { + filteredValueList.add(null); + } else { + filteredValueList.add(value); + } + } + fileTokenizingRowResource + .setValueList(filteredValueList); + } else { + fileTokenizingRowResource + .setValueList(temporaryValueList); + } + + fileTokenizingRowResource.setRowString(rowString); + fileTokenizingRowResource.setRowNumber(rowNumber); + fileTokenizingRowResource.setLineNumber(lineNumber); + fileTokenizingCallback + .handleRowResource(fileTokenizingRowResource); + } finally { + ++rowNumber; + temporaryValueList.clear(); + filteredValueList.clear(); + preContinueString = ""; + } + } + } catch (java.io.FileNotFoundException e) { + throw e; + } catch (java.io.IOException e) { + throw e; + } finally { + try { + if (ir != null) { + ir.close(); + } + if (br != null) { + br.close(); + } + } catch (java.io.IOException ignored) { + } + } + } + + protected ValueLineInfo arrangeValueList(final String lineString, + String delimiter) { + final List valueList = new ArrayList(); + + // Don't use split! + // final String[] values = lineString.split(delimiter); + final LineTokenizingOption tokenizingOption = new LineTokenizingOption(); + tokenizingOption.setDelimiter(delimiter); + final List list = _lineToken.tokenize(lineString, + tokenizingOption); + final String[] values = (String[]) list + .toArray(new String[list.size()]); + for (int i = 0; i < values.length; i++) { + valueList.add(values[i]); + } + return arrangeValueList(valueList, delimiter); + } + + protected ValueLineInfo arrangeValueList(List valueList, + String delimiter) { + final ValueLineInfo valueLineInfo = new ValueLineInfo(); + final ArrayList resultList = new ArrayList(); + String preString = ""; + for (int i = 0; i < valueList.size(); i++) { + final String value = (String) valueList.get(i); + if (value == null) { + continue; + } + if (i == valueList.size() - 1) {// The last loop + if (preString.equals("")) { + if (isFrontQOnly(value)) { + valueLineInfo.setContinueNextLine(true); + resultList.add(value); + break; + } else if (isRearQOnly(value)) { + resultList.add(value); + break; + } else if (isNotBothQ(value)) { + resultList.add(value); + break; + } else { + resultList.add(removeDoubleQuotation(value)); + break; + } + } else { + if (isFrontQOnly(value)) { + valueLineInfo.setContinueNextLine(true); + resultList.add(connectPreString(preString, delimiter, + value)); + break; + } else if (isRearQOnly(value)) { + resultList.add(removeDoubleQuotation(connectPreString( + preString, delimiter, value))); + break; + } else if (isNotBothQ(value)) { + valueLineInfo.setContinueNextLine(true); + resultList.add(connectPreString(preString, delimiter, + value)); + break; + } else { + resultList.add(removeDoubleQuotation(connectPreString( + preString, delimiter, value))); + break; + } + } + } + + if (preString.equals("")) { + if (isFrontQOnly(value)) { + preString = value; + continue; + } else if (isRearQOnly(value)) { + preString = value; + continue; + } else if (isNotBothQ(value)) { + resultList.add(value); + } else { + resultList.add(removeDoubleQuotation(value)); + } + } else { + if (isFrontQOnly(value)) { + preString = connectPreString(preString, delimiter, value); + continue; + } else if (isRearQOnly(value)) { + resultList.add(removeDoubleQuotation(connectPreString( + preString, delimiter, value))); + } else if (isNotBothQ(value)) { + preString = connectPreString(preString, delimiter, value); + continue; + } else { + resultList.add(removeDoubleQuotation(connectPreString( + preString, delimiter, value))); + } + } + preString = ""; + } + valueLineInfo.setValueList(resultList); + return valueLineInfo; + } + + protected String connectPreString(String preString, String delimiter, + String value) { + if (preString.equals("")) { + return value; + } else { + return preString + delimiter + value; + } + } + + protected boolean isNotBothQ(final String value) { + return !value.startsWith("\"") && !value.endsWith("\""); + } + + protected boolean isRearQOnly(final String value) { + return !value.startsWith("\"") && value.endsWith("\""); + } + + protected boolean isFrontQOnly(final String value) { + return value.startsWith("\"") && !value.endsWith("\""); + } + + protected String removeDoubleQuotation(String value) { + if (!value.startsWith("\"") && !value.endsWith("\"")) { + return value; + } + if (value.startsWith("\"")) { + value = value.substring(1); + } + if (value.endsWith("\"")) { + value = value.substring(0, value.length() - 1); + } + return value; + } + + protected String removeRightDoubleQuotation(String value) { + if (value.endsWith("\"")) { + value = value.substring(0, value.length() - 1); + } + return value; + } + + protected FileTokenizingHeaderInfo analyzeHeaderInfo(String delimiter, + final String lineString) { + final java.util.List columnNameList = new ArrayList(); + final String[] values = lineString.split(delimiter); + for (int i = 0; i < values.length; i++) { + final String value = values[i].trim();// Trimming is Header Only!; + if (value.startsWith("\"") && value.endsWith("\"")) { + columnNameList.add(value.substring(1, value.length() - 1)); + } else { + columnNameList.add(value); + } + } + final FileTokenizingHeaderInfo fileTokenizingHeaderInfo = new FileTokenizingHeaderInfo(); + fileTokenizingHeaderInfo.setColumnNameList(columnNameList); + fileTokenizingHeaderInfo.setColumnNameRowString(lineString); + return fileTokenizingHeaderInfo; + } + + public static class ValueLineInfo { + protected java.util.List valueList; + + protected boolean continueNextLine; + + public java.util.List getValueList() { + return valueList; + } + + public void setValueList(List valueList) { + this.valueList = valueList; + } + + public boolean isContinueNextLine() { + return continueNextLine; + } + + public void setContinueNextLine(boolean continueNextLine) { + this.continueNextLine = continueNextLine; + } + } + + /** + * Make token-file from specified row resources. + * + * @param filename File name. (NotNull) + * @param fileMakingCallback File-making callback. (NotNull) + * @param fileMakingOption File-making option. (NotNull and Required{encoding and delimiter}) + * @throws java.io.FileNotFoundException + * @throws java.io.IOException + */ + public void make(String filename, FileMakingCallback fileMakingCallback, + FileMakingOption fileMakingOption) + throws java.io.FileNotFoundException, java.io.IOException { + assertStringNotNullAndNotTrimmedEmpty("filename", filename); + + java.io.FileOutputStream fos = null; + try { + fos = new java.io.FileOutputStream(filename); + make(fos, fileMakingCallback, fileMakingOption); + } catch (java.io.FileNotFoundException e) { + throw e; + } catch (java.io.IOException e) { + throw e; + } finally { + if (fos != null) { + fos.close(); + } + } + } + + /** + * Make token-file from specified row resources. + *
    +     * This method uses java.io.BufferedOutputStream and java.io.OutputStreamWriter that wrap the argument[outputStream].
    +     * These objects are closed. (Invoking close() at finally)
    +     * 
    + * @param outputStream Output target stream. (NotNull) + * @param fileMakingCallback File-making callback. (NotNull) + * @param fileMakingOption File-making option. (NotNull and Required{encoding and delimiter}) + * @throws java.io.FileNotFoundException + * @throws java.io.IOException + */ + public void make(java.io.OutputStream outputStream, + FileMakingCallback fileMakingCallback, + FileMakingOption fileMakingOption) + throws java.io.FileNotFoundException, java.io.IOException { + assertObjectNotNull("outputStream", outputStream); + assertObjectNotNull("fileMakingCallback", fileMakingCallback); + assertObjectNotNull("fileMakingOption", fileMakingOption); + final String encoding = fileMakingOption.getEncoding(); + final String delimiter = fileMakingOption.getDelimiter(); + assertStringNotNullAndNotTrimmedEmpty("encoding", encoding); + assertObjectNotNull("delimiter", delimiter); + final String lineSeparator; + if (fileMakingOption.getLineSeparator() != null + && !fileMakingOption.getLineSeparator().equals("")) { + lineSeparator = fileMakingOption.getLineSeparator(); + } else { + lineSeparator = System.getProperty("line.separator");// Default! + } + + java.io.BufferedOutputStream bos = null; + java.io.Writer writer = null; + try { + bos = new java.io.BufferedOutputStream(outputStream); + writer = new java.io.OutputStreamWriter(bos, encoding); + + boolean headerDone = false; + + // Make header. + final FileMakingHeaderInfo fileMakingHeaderInfo = fileMakingOption + .getFileMakingHeaderInfo(); + if (fileMakingHeaderInfo != null) { + final List columnNameList = fileMakingHeaderInfo + .getColumnNameList(); + if (columnNameList != null && !columnNameList.isEmpty()) { + final LineMakingOption lineMakingOption = new LineMakingOption(); + lineMakingOption.setDelimiter(delimiter); + lineMakingOption.trimSpace();// Trimming is Header Only! + final String columnHeaderString = _lineToken.make( + columnNameList, lineMakingOption); + writer.write(columnHeaderString + lineSeparator); + headerDone = true; + } + } + + // Make row. + FileMakingRowResource rowResource = null; + while (true) { + rowResource = fileMakingCallback.getRowResource(); + if (rowResource == null) { + break;// The End! + } + final java.util.List valueList; + if (rowResource.getValueList() != null) { + valueList = rowResource.getValueList(); + } else { + final java.util.LinkedHashMap nameValueMap = rowResource + .getNameValueMap(); + if (!headerDone) { + final java.util.List columnNameList = new java.util.ArrayList( + nameValueMap.keySet()); + final LineMakingOption lineMakingOption = new LineMakingOption(); + lineMakingOption.setDelimiter(delimiter); + lineMakingOption.trimSpace();// Trimming is Header Only! + final String columnHeaderString = _lineToken.make( + columnNameList, lineMakingOption); + writer.write(columnHeaderString + lineSeparator); + headerDone = true; + } + valueList = new ArrayList(nameValueMap.values()); + } + final LineMakingOption lineMakingOption = new LineMakingOption(); + lineMakingOption.setDelimiter(delimiter); + if (!fileMakingOption.isGoodByeDoubleQuotation()) { + lineMakingOption.quoteByDoubleQuotation(); + } + final String lineString = _lineToken.make(valueList, + lineMakingOption); + writer.write(lineString + lineSeparator); + } + writer.flush(); + } catch (java.io.FileNotFoundException e) { + throw e; + } catch (java.io.IOException e) { + throw e; + } finally { + if (bos != null) { + bos.close(); + } + if (writer != null) { + writer.close(); + } + } + } + + // ---------------------------------------------------------------- + // Assert Object + // ------------- + /** + * Assert that the object is not null. + * + * @param variableName Variable name. (NotNull) + * @param value Value. (NotNull) + * @exception IllegalArgumentException + */ + protected void assertObjectNotNull(String variableName, Object value) { + if (variableName == null) { + String msg = "The value should not be null: variableName=" + + variableName + " value=" + value; + throw new IllegalArgumentException(msg); + } + if (value == null) { + String msg = "The value should not be null: variableName=" + + variableName; + throw new IllegalArgumentException(msg); + } + } + + // ---------------------------------------------------------------- + // Assert String + // ------------- + /** + * Assert that the entity is not null and not trimmed empty. + * + * @param variableName Variable name. (NotNull) + * @param value Value. (NotNull) + */ + protected void assertStringNotNullAndNotTrimmedEmpty(String variableName, + String value) { + assertObjectNotNull("variableName", variableName); + assertObjectNotNull(variableName, value); + if (value.trim().length() == 0) { + String msg = "The value should not be empty: variableName=" + + variableName + " value=" + value; + throw new IllegalArgumentException(msg); + } + } +} \ No newline at end of file Property changes on: announcement/trunk/src/main/java/jp/sf/pal/announcement/db/allcommon/helper/token/file/impl/FileTokenImpl.java ___________________________________________________________________ Name: svn:eol-style + native Added: announcement/trunk/src/main/java/jp/sf/pal/announcement/db/allcommon/helper/token/line/LineMakingOption.java =================================================================== --- announcement/trunk/src/main/java/jp/sf/pal/announcement/db/allcommon/helper/token/line/LineMakingOption.java (rev 0) +++ announcement/trunk/src/main/java/jp/sf/pal/announcement/db/allcommon/helper/token/line/LineMakingOption.java 2008-06-30 02:54:27 UTC (rev 1002) @@ -0,0 +1,49 @@ +package jp.sf.pal.announcement.db.allcommon.helper.token.line; + +/** + * @author DBFlute(AutoGenerator) + */ +public class LineMakingOption { + + protected String _delimiter; + + protected boolean _quoteByDoubleQuotation; + + protected boolean _trimSpace; + + public LineMakingOption delimitateByComma() { + _delimiter = ","; + return this; + } + + public LineMakingOption delimitateByTab() { + _delimiter = "\t"; + return this; + } + + public String getDelimiter() { + return _delimiter; + } + + public void setDelimiter(String delimiter) { + _delimiter = delimiter; + } + + public LineMakingOption quoteByDoubleQuotation() { + _quoteByDoubleQuotation = true; + return this; + } + + public boolean isQuoteByDoubleQuotation() { + return _quoteByDoubleQuotation; + } + + public LineMakingOption trimSpace() { + _trimSpace = true; + return this; + } + + public boolean isTrimSpace() { + return _trimSpace; + } +} \ No newline at end of file Property changes on: announcement/trunk/src/main/java/jp/sf/pal/announcement/db/allcommon/helper/token/line/LineMakingOption.java ___________________________________________________________________ Name: svn:eol-style + native Added: announcement/trunk/src/main/java/jp/sf/pal/announcement/db/allcommon/helper/token/line/LineToken.java =================================================================== --- announcement/trunk/src/main/java/jp/sf/pal/announcement/db/allcommon/helper/token/line/LineToken.java (rev 0) +++ announcement/trunk/src/main/java/jp/sf/pal/announcement/db/allcommon/helper/token/line/LineToken.java 2008-06-30 02:54:27 UTC (rev 1002) @@ -0,0 +1,13 @@ +package jp.sf.pal.announcement.db.allcommon.helper.token.line; + +/** + * @author DBFlute(AutoGenerator) + */ +public interface LineToken { + + public java.util.List tokenize(String lineString, + LineTokenizingOption lineTokenizingOption); + + public String make(java.util.List valueList, + LineMakingOption lineMakingOption); +} \ No newline at end of file Property changes on: announcement/trunk/src/main/java/jp/sf/pal/announcement/db/allcommon/helper/token/line/LineToken.java ___________________________________________________________________ Name: svn:eol-style + native Added: announcement/trunk/src/main/java/jp/sf/pal/announcement/db/allcommon/helper/token/line/LineTokenizingOption.java =================================================================== --- announcement/trunk/src/main/java/jp/sf/pal/announcement/db/allcommon/helper/token/line/LineTokenizingOption.java (rev 0) +++ announcement/trunk/src/main/java/jp/sf/pal/announcement/db/allcommon/helper/token/line/LineTokenizingOption.java 2008-06-30 02:54:27 UTC (rev 1002) @@ -0,0 +1,58 @@ +package jp.sf.pal.announcement.db.allcommon.helper.token.line; + +/** + * @author DBFlute(AutoGenerator) + */ +public class LineTokenizingOption { + + // ===================================================================================== + // Attribute + // ========= + protected String _delimiter; + + protected boolean _trimDoubleQuotation; + + protected boolean _handleEmtpyAsNull; + + // ===================================================================================== + // Easy-to-Use + // =========== + public LineTokenizingOption delimitateByComma() { + _delimiter = ","; + return this; + } + + public LineTokenizingOption delimitateByTab() { + _delimiter = "\t"; + return this; + } + + public LineTokenizingOption trimDoubleQuotation() { + _trimDoubleQuotation = true; + return this; + } + + public LineTokenizingOption handleEmtpyAsNull() { + _handleEmtpyAsNull = true; + return this; + } + + // ===================================================================================== + // Accessor + // ======== + public String getDelimiter() { + return _delimiter; + } + + public void setDelimiter(String delimiter) { + _delimiter = delimiter; + } + + public boolean isTrimDoubleQuotation() { + return _trimDoubleQuotation; + } + + public boolean isHandleEmtpyAsNull() { + return _handleEmtpyAsNull; + } +} \ No newline at end of file Property changes on: announcement/trunk/src/main/java/jp/sf/pal/announcement/db/allcommon/helper/token/line/LineTokenizingOption.java ___________________________________________________________________ Name: svn:eol-style + native Added: announcement/trunk/src/main/java/jp/sf/pal/announcement/db/allcommon/helper/token/line/impl/LineTokenImpl.java =================================================================== --- announcement/trunk/src/main/java/jp/sf/pal/announcement/db/allcommon/helper/token/line/impl/LineTokenImpl.java (rev 0) +++ announcement/trunk/src/main/java/jp/sf/pal/announcement/db/allcommon/helper/token/line/impl/LineTokenImpl.java 2008-06-30 02:54:27 UTC (rev 1002) @@ -0,0 +1,130 @@ +package jp.sf.pal.announcement.db.allcommon.helper.token.line.impl; + +import java.util.ArrayList; +import java.util.Iterator; +import java.util.List; + +import jp.sf.pal.announcement.db.allcommon.helper.token.line.LineMakingOption; +import jp.sf.pal.announcement.db.allcommon.helper.token.line.LineToken; +import jp.sf.pal.announcement.db.allcommon.helper.token.line.LineTokenizingOption; + +/** + * @author DBFlute(AutoGenerator) + */ +public class LineTokenImpl implements LineToken { + + public List tokenize(String lineString, + LineTokenizingOption lineTokenizingOption) { + final String delimiter = lineTokenizingOption.getDelimiter(); + final List list = new ArrayList(); + int i = 0; + int j = lineString.indexOf(delimiter); + for (int h = 0; j >= 0; h++) { + final String pureValue = lineString.substring(i, j); + if (lineTokenizingOption.isTrimDoubleQuotation()) { + final String before = pureValue; + if (before.length() > 1 && before.startsWith("\"") + && before.endsWith("\"")) { + final String after = before.substring(1, + before.length() - 1); + list.add(filterHandlingEmptyAsNull(after, + lineTokenizingOption)); + } else { + list.add(filterHandlingEmptyAsNull(before, + lineTokenizingOption)); + } + } else { + list.add(filterHandlingEmptyAsNull(pureValue, + lineTokenizingOption)); + } + i = j + 1; + j = lineString.indexOf(delimiter, i); + } + list.add(filterHandlingEmptyAsNull(lineString.substring(i), + lineTokenizingOption)); + return list; + } + + protected String filterHandlingEmptyAsNull(String target, + LineTokenizingOption lineTokenizingOption) { + if (target == null) { + return null; + } + if (lineTokenizingOption.isHandleEmtpyAsNull() && "".equals(target)) { + return null; + } + return target; + } + + public String make(java.util.List valueList, + LineMakingOption lineMakingOption) { + assertObjectNotNull("valueList", valueList); + assertObjectNotNull("lineMakingOption", lineMakingOption); + final String delimiter = lineMakingOption.getDelimiter(); + assertObjectNotNull("lineMakingOption.getDelimiter()", delimiter); + return createLineString(valueList, delimiter, lineMakingOption + .isQuoteByDoubleQuotation(), lineMakingOption.isTrimSpace()); + } + + protected String createLineString(List valueList, String delimiter, + boolean quoteByDoubleQuotation, boolean trimSpace) { + final StringBuffer sb = new StringBuffer(); + for (final Iterator ite = valueList.iterator(); ite.hasNext();) { + String value = (String) ite.next(); + value = (value != null ? value : ""); + if (trimSpace) { + value = value.trim(); + } + if (quoteByDoubleQuotation) { + sb.append(delimiter).append("\"").append(value).append("\""); + } else { + sb.append(delimiter).append(value); + } + } + sb.delete(0, delimiter.length()); + return sb.toString(); + } + + // ---------------------------------------------------------------- + // Assert Object + // ------------- + /** + * Assert that the object is not null. + * + * @param variableName Variable name. (NotNull) + * @param value Value. (NotNull) + * @exception IllegalArgumentException + */ + protected void assertObjectNotNull(String variableName, Object value) { + if (variableName == null) { + String msg = "The value should not be null: variableName=" + + variableName + " value=" + value; + throw new IllegalArgumentException(msg); + } + if (value == null) { + String msg = "The value should not be null: variableName=" + + variableName; + throw new IllegalArgumentException(msg); + } + } + + // ---------------------------------------------------------------- + // Assert String + // ------------- + /** + * Assert that the entity is not null and not trimmed empty. + * + * @param variableName Variable name. (NotNull) + * @param value Value. (NotNull) + */ + protected void assertStringNotNullAndNotTrimmedEmpty(String variableName, + String value) { + assertObjectNotNull("variableName", variableName); + assertObjectNotNull(variableName, value); + if (value.trim().length() == 0) { + String msg = "The value should not be empty: variableName=" + + variableName + " value=" + value; + throw new IllegalArgumentException(msg); + } + } +} \ No newline at end of file Property changes on: announcement/trunk/src/main/java/jp/sf/pal/announcement/db/allcommon/helper/token/line/impl/LineTokenImpl.java ___________________________________________________________________ Name: svn:eol-style + native Added: announcement/trunk/src/main/java/jp/sf/pal/announcement/db/allcommon/jdbc/CursorHandler.java =================================================================== --- announcement/trunk/src/main/java/jp/sf/pal/announcement/db/allcommon/jdbc/CursorHandler.java (rev 0) +++ announcement/trunk/src/main/java/jp/sf/pal/announcement/db/allcommon/jdbc/CursorHandler.java 2008-06-30 02:54:27 UTC (rev 1002) @@ -0,0 +1,15 @@ +package jp.sf.pal.announcement.db.allcommon.jdbc; + +/** + * The interface of statement history witness. + * @author DBFlute(AutoGenerator) + */ +public interface CursorHandler { + + /** + * @param resultSet Result set. (NotNull) + * @return Result + * @throws java.sql.SQLException + */ + Object handle(java.sql.ResultSet resultSet) throws java.sql.SQLException; +} Property changes on: announcement/trunk/src/main/java/jp/sf/pal/announcement/db/allcommon/jdbc/CursorHandler.java ___________________________________________________________________ Name: svn:eol-style + native Added: announcement/trunk/src/main/java/jp/sf/pal/announcement/db/allcommon/jdbc/LatestSqlProvider.java =================================================================== --- announcement/trunk/src/main/java/jp/sf/pal/announcement/db/allcommon/jdbc/LatestSqlProvider.java (rev 0) +++ announcement/trunk/src/main/java/jp/sf/pal/announcement/db/allcommon/jdbc/LatestSqlProvider.java 2008-06-30 02:54:27 UTC (rev 1002) @@ -0,0 +1,19 @@ +package jp.sf.pal.announcement.db.allcommon.jdbc; + +/** + * The provider of latest SQL. + * @author DBFlute(AutoGenerator) + */ +public interface LatestSqlProvider { + + /** + * Get display SQL. + * @return Display SQL. (Nullable: If it was not found, returns null.) + */ + public String getDisplaySql(); + + /** + * Clear the cache of SQL. + */ + public void clearSqlCache(); +} Property changes on: announcement/trunk/src/main/java/jp/sf/pal/announcement/db/allcommon/jdbc/LatestSqlProvider.java ___________________________________________________________________ Name: svn:eol-style + native Added: announcement/trunk/src/main/java/jp/sf/pal/announcement/db/allcommon/jdbc/StatementConfig.java =================================================================== --- announcement/trunk/src/main/java/jp/sf/pal/announcement/db/allcommon/jdbc/StatementConfig.java (rev 0) +++ announcement/trunk/src/main/java/jp/sf/pal/announcement/db/allcommon/jdbc/StatementConfig.java 2008-06-30 02:54:27 UTC (rev 1002) @@ -0,0 +1,129 @@ +package jp.sf.pal.announcement.db.allcommon.jdbc; + +import java.sql.ResultSet; + +/** + * The config of statement. + * @author DBFlute(AutoGenerator) + */ +public class StatementConfig { + + // =================================================================================== + // Attribute + // ========= + // ----------------------------------------------------- + // ResultSet TYPE + // -------------- + protected Integer _resultSetType; + + // ----------------------------------------------------- + // Statement Option + // ---------------- + protected Integer _queryTimeout; + + protected Integer _fetchSize; + + protected Integer _maxRows; + + // =================================================================================== + // Setting Interface + // ================= + // ----------------------------------------------------- + // ResultSet TYPE + // -------------- + public StatementConfig typeForwardOnly() { + _resultSetType = ResultSet.TYPE_FORWARD_ONLY; + return this; + } + + public StatementConfig typeScrollInsensitive() { + _resultSetType = ResultSet.TYPE_SCROLL_INSENSITIVE; + return this; + } + + public StatementConfig typeScrollSensitive() { + _resultSetType = ResultSet.TYPE_SCROLL_SENSITIVE; + return this; + } + + // ----------------------------------------------------- + // Statement Option + // ---------------- + public StatementConfig queryTimeout(int queryTimeout) { + this._queryTimeout = queryTimeout; + return this; + } + + public StatementConfig fetchSize(int fetchSize) { + this._fetchSize = fetchSize; + return this; + } + + public StatementConfig maxRows(int maxRows) { + this._maxRows = maxRows; + return this; + } + + // =================================================================================== + // Determination + // ============= + // ----------------------------------------------------- + // ResultSet TYPE + // -------------- + public boolean hasResultSetType() { + return _resultSetType != null; + } + + // ----------------------------------------------------- + // Statement Option + // ---------------- + public boolean hasStatementOptions() { + return hasQueryTimeout() || hasFetchSize() || hasMaxRows(); + } + + public boolean hasQueryTimeout() { + return _queryTimeout != null; + } + + public boolean hasFetchSize() { + return _fetchSize != null; + } + + public boolean hasMaxRows() { + return _maxRows != null; + } + + // =================================================================================== + // Basic Override + // ============== + @Override + public String toString() { + return "{" + _resultSetType + ", " + _queryTimeout + ", " + _fetchSize + + ", " + _maxRows + "}"; + } + + // =================================================================================== + // Accessor + // ======== + // ----------------------------------------------------- + // ResultSet TYPE + // -------------- + public Integer getResultSetType() { + return _resultSetType; + } + + // ----------------------------------------------------- + // Statement Option + // ---------------- + public Integer getQueryTimeout() { + return _queryTimeout; + } + + public Integer getFetchSize() { + return _fetchSize; + } + + public Integer getMaxRows() { + return _maxRows; + } +} Property changes on: announcement/trunk/src/main/java/jp/sf/pal/announcement/db/allcommon/jdbc/StatementConfig.java ___________________________________________________________________ Name: svn:eol-style + native Added: announcement/trunk/src/main/java/jp/sf/pal/announcement/db/allcommon/s2dao/FetchNarrowingResultSetFactory.java =================================================================== --- announcement/trunk/src/main/java/jp/sf/pal/announcement/db/allcommon/s2dao/FetchNarrowingResultSetFactory.java (rev 0) +++ announcement/trunk/src/main/java/jp/sf/pal/announcement/db/allcommon/s2dao/FetchNarrowingResultSetFactory.java 2008-06-30 02:54:27 UTC (rev 1002) @@ -0,0 +1,100 @@ +package jp.sf.pal.announcement.db.allcommon.s2dao; + +import jp.sf.pal.announcement.db.allcommon.cbean.FetchNarrowingBean; +import jp.sf.pal.announcement.db.allcommon.cbean.FetchNarrowingBeanContext; +import jp.sf.pal.announcement.db.allcommon.cbean.outsidesql.OutsideSqlContext; + +import org.seasar.extension.jdbc.ResultSetFactory; +import org.seasar.framework.util.PreparedStatementUtil; + +/** + * Fetch page result set factory. + * + * @author DBFlute(AutoGenerator) + */ +public class FetchNarrowingResultSetFactory implements ResultSetFactory { + + // =================================================================================== + // Constructor + // =========== + /** + * Constructor. + */ + public FetchNarrowingResultSetFactory() { + } + + // =================================================================================== + // Main + // ==== + /** + * @param statement Statement. (NotNull) + * @return Result set for procedure executing of s2dao. (NotNull) + */ + public java.sql.ResultSet getResultSet(java.sql.Statement statement) { + // return org.seasar.framework.util.StatementUtil.getResultSet(statement); + return doGetResultSet(statement);// This behavior is same as StatementUtil.getResultSet(). + } + + protected java.sql.ResultSet doGetResultSet(java.sql.Statement statement) + throws org.seasar.framework.exception.SQLRuntimeException { + try { + return statement.getResultSet(); + } catch (java.sql.SQLException ex) { + throw new org.seasar.framework.exception.SQLRuntimeException(ex); + } + } + + /** + * Create result set. + * + * @param ps Prepared statement. (NotNull) + * @return Result set. (NotNull) + */ + public java.sql.ResultSet createResultSet(java.sql.PreparedStatement ps) { + final java.sql.ResultSet resultSet = PreparedStatementUtil + .executeQuery(ps); + + if (!FetchNarrowingBeanContext.isExistFetchNarrowingBeanOnThread()) { + return resultSet; + } + final FetchNarrowingBean cb = FetchNarrowingBeanContext + .getFetchNarrowingBeanOnThread(); + if (!isUseFetchNarrowingResultSetWrapper(cb)) { + return resultSet; + } + final FetchNarrowingResultSetWrapper wrapper; + if (OutsideSqlContext.isExistOutsideSqlContextOnThread()) { + final OutsideSqlContext outsideSqlContext = OutsideSqlContext + .getOutsideSqlContextOnThread(); + wrapper = new FetchNarrowingResultSetWrapper(resultSet, cb, + outsideSqlContext.isOffsetByCursorForcedly(), + outsideSqlContext.isLimitByCursorForcedly()); + } else { + wrapper = new FetchNarrowingResultSetWrapper(resultSet, cb, false, + false); + } + return wrapper; + } + + protected boolean isUseFetchNarrowingResultSetWrapper(FetchNarrowingBean cb) { + if (cb.getSafetyMaxResultSize() > 0) { + return true; + } + if (!cb.isFetchNarrowingEffective()) { + return false;// It is not necessary to control. + } + if (OutsideSqlContext.isExistOutsideSqlContextOnThread()) { + final OutsideSqlContext outsideSqlContext = OutsideSqlContext + .getOutsideSqlContextOnThread(); + if (outsideSqlContext.isOffsetByCursorForcedly() + || outsideSqlContext.isLimitByCursorForcedly()) { + return true; + } + } + if (cb.isFetchNarrowingSkipStartIndexEffective() + || cb.isFetchNarrowingLoopCountEffective()) { + return true; + } + return false; + } +} Property changes on: announcement/trunk/src/main/java/jp/sf/pal/announcement/db/allcommon/s2dao/FetchNarrowingResultSetFactory.java ___________________________________________________________________ Name: svn:eol-style + native Added: announcement/trunk/src/main/java/jp/sf/pal/announcement/db/allcommon/s2dao/FetchNarrowingResultSetWrapper.java =================================================================== --- announcement/trunk/src/main/java/jp/sf/pal/announcement/db/allcommon/s2dao/FetchNarrowingResultSetWrapper.java (rev 0) +++ announcement/trunk/src/main/java/jp/sf/pal/announcement/db/allcommon/s2dao/FetchNarrowingResultSetWrapper.java 2008-06-30 02:54:27 UTC (rev 1002) @@ -0,0 +1,235 @@ +package jp.sf.pal.announcement.db.allcommon.s2dao; + +import java.sql.ResultSet; +import java.sql.SQLException; + +import jp.sf.pal.announcement.db.allcommon.cbean.FetchNarrowingBean; + +import org.seasar.extension.jdbc.impl.ResultSetWrapper; +import org.seasar.framework.exception.SQLRuntimeException; + +/** + * The wrapper of fetch-narrowing result-set. + * @author DBFlute(AutoGenerator) + */ +public class FetchNarrowingResultSetWrapper extends ResultSetWrapper { + + // =================================================================================== + // Attribute + // ========= + /** The real result set. (NotNull) */ + protected ResultSet _resultSet; + + /** The bean of fetch narrowing. (NotNull) */ + protected FetchNarrowingBean _fetchNarrowingBean; + + /** The counter of fetch. */ + protected long _fetchCounter; + + /** the counter of request. */ + protected long _requestCounter; + + /** Does it offset by cursor forcedly? */ + protected boolean _offsetByCursorForcedly; + + /** Does it limit by cursor forcedly? */ + protected boolean _limitByCursorForcedly; + + /** Does it skip to cursor end? */ + protected boolean _skipToCursorEnd; + + // =================================================================================== + // Constructor + // =========== + /** + * Constructor. + * @param resultSet Original result set. (NotNull) + * @param fetchNarrowingBean FetchNarrowing-bean. (NotNull) + * @param offsetByCursorForcedly Offset by cursor forcedly. + * @param limitByCursorForcedly Limit by cursor forcedly. + */ + public FetchNarrowingResultSetWrapper(ResultSet resultSet, + FetchNarrowingBean fetchNarrowingBean, + boolean offsetByCursorForcedly, boolean limitByCursorForcedly) { + super(resultSet); + + _resultSet = resultSet; + _fetchNarrowingBean = fetchNarrowingBean; + _offsetByCursorForcedly = offsetByCursorForcedly; + _limitByCursorForcedly = limitByCursorForcedly; + + skip(); + } + + // =================================================================================== + // Skip + // ==== + /** + * Skip to start-index. + */ + protected void skip() { + if (!isAvailableSkipRecord()) { + return; + } + final int skipStartIndex = getFetchNarrowingSkipStartIndex(); + if (isCursorUsed()) { + try { + if (0 == skipStartIndex) { + _resultSet.beforeFirst(); + } else { + _resultSet.absolute(skipStartIndex); + } + _fetchCounter = _resultSet.getRow(); + } catch (SQLException e) { + throw new SQLRuntimeException(e); + } + } else { + try { + while (true) { + if (_resultSet.getRow() >= skipStartIndex) { + break; + } + if (!_resultSet.next()) { + _skipToCursorEnd = true;// [DBFLUTE-243] + break; + } + ++_fetchCounter; + } + } catch (SQLException e) { + throw new SQLRuntimeException(e); + } + } + } + + protected boolean isAvailableSkipRecord() { + if (!isFetchNarrowingEffective()) { + return false; + } + if (isOffsetByCursorForcedly()) { + return true; + } + if (isFetchNarrowingSkipStartIndexEffective()) { + return true; + } + return false; + } + + // =================================================================================== + // Next + // ==== + /** + * Next. + * @return Does the result set have next record? + * @throws SQLException + */ + public boolean next() throws SQLException { + final boolean hasNext = super.next(); + ++_requestCounter; + if (!isAvailableLimitLoopCount()) { + checkSafetyResult(hasNext); + return hasNext; + } + + if (hasNext + && _fetchCounter < getFetchNarrowingSkipStartIndex() + + getFetchNarrowingLoopCount()) { + ++_fetchCounter; + checkSafetyResult(true); + return true; + } else { + return false; + } + } + + protected boolean isAvailableLimitLoopCount() { + if (!isFetchNarrowingEffective()) { + return false; + } + if (isLimitByCursorForcedly()) { + return true; + } + if (isFetchNarrowingLoopCountEffective()) { + return true; + } + return false; + } + + protected void checkSafetyResult(boolean hasNext) { + if (hasNext && getSafetyMaxResultSize() > 0 + && _requestCounter > (getSafetyMaxResultSize() + 1)) { + String msg = "You have already been in Danger Zone!"; + msg = msg + + " Please confirm your query or data of table: safetyMaxResultSize=" + + getSafetyMaxResultSize(); + throw new jp.sf.pal.announcement.db.allcommon.exception.DangerousResultSizeException( + msg, getSafetyMaxResultSize()); + } + } + + // =================================================================================== + // Fetch Option + // ============ + protected boolean isFetchNarrowingEffective() { + return _fetchNarrowingBean.isFetchNarrowingEffective(); + } + + protected boolean isFetchNarrowingSkipStartIndexEffective() { + return _fetchNarrowingBean.isFetchNarrowingSkipStartIndexEffective(); + } + + protected boolean isFetchNarrowingLoopCountEffective() { + return _fetchNarrowingBean.isFetchNarrowingLoopCountEffective(); + } + + protected int getFetchNarrowingSkipStartIndex() { + return _fetchNarrowingBean.getFetchNarrowingSkipStartIndex(); + } + + protected int getFetchNarrowingLoopCount() { + return _fetchNarrowingBean.getFetchNarrowingLoopCount(); + } + + /** + * Get safety max result size. + * @return Safety max result size. + */ + public int getSafetyMaxResultSize() { + return _fetchNarrowingBean.getSafetyMaxResultSize(); + } + + /** + * Is cursor used? + * @return Determination. + */ + protected boolean isCursorUsed() { + return isCursorSupported(_resultSet); + } + + /** + * Is cursor supported? + * @param resultSet ResultSet + * @return Determation. + */ + public static boolean isCursorSupported(ResultSet resultSet) { + try { + return !(resultSet.getType() == ResultSet.TYPE_FORWARD_ONLY); + } catch (SQLException e) { + throw new SQLRuntimeException(e); + } + } + + // =================================================================================== + // Accessor + // ======== + public boolean isOffsetByCursorForcedly() { + return _offsetByCursorForcedly; + } + + public boolean isLimitByCursorForcedly() { + return _limitByCursorForcedly; + } + + public boolean isSkipToCursorEnd() { + return _skipToCursorEnd; + } +} Property changes on: announcement/trunk/src/main/java/jp/sf/pal/announcement/db/allcommon/s2dao/FetchNarrowingResultSetWrapper.java ___________________________________________________________________ Name: svn:eol-style + native Added: announcement/trunk/src/main/java/jp/sf/pal/announcement/db/allcommon/s2dao/S2BeanMetaDataFactoryImpl.java =================================================================== --- announcement/trunk/src/main/java/jp/sf/pal/announcement/db/allcommon/s2dao/S2BeanMetaDataFactoryImpl.java (rev 0) +++ announcement/trunk/src/main/java/jp/sf/pal/announcement/db/allcommon/s2dao/S2BeanMetaDataFactoryImpl.java 2008-06-30 02:54:27 UTC (rev 1002) @@ -0,0 +1,114 @@ +package jp.sf.pal.announcement.db.allcommon.s2dao; + +import java.sql.DatabaseMetaData; +import java.util.Collections; +import java.util.HashMap; +import java.util.Map; + +import jp.sf.pal.announcement.db.allcommon.Entity; + +import org.seasar.dao.BeanMetaData; +import org.seasar.dao.impl.BeanMetaDataFactoryImpl; +import org.seasar.dao.impl.BeanMetaDataImpl; + +/** + * BeanMetaDataFactoryImpl for DBFlute. + * @author DBFlute(AutoGenerator) + */ + @ SuppressWarnings("unchecked") +public class S2BeanMetaDataFactoryImpl extends BeanMetaDataFactoryImpl { + + protected Map, BeanMetaData> _metaMap = Collections + .synchronizedMap(new HashMap, BeanMetaData>()); + + @Override + public BeanMetaData createBeanMetaData(Class beanClass) { + final BeanMetaData cachedMeta = findCachedMeta(beanClass); + if (cachedMeta != null) { + return cachedMeta; + } else { + return super.createBeanMetaData(beanClass); + } + } + + @Override + public BeanMetaData createBeanMetaData(Class beanClass, + int relationNestLevel) { + final BeanMetaData cachedMeta = findCachedMeta(beanClass); + if (cachedMeta != null) { + return cachedMeta; + } else { + return super.createBeanMetaData(beanClass, relationNestLevel); + } + } + + @Override + public BeanMetaData createBeanMetaData(DatabaseMetaData dbMetaData, + Class beanClass, int relationNestLevel) { + final BeanMetaData cachedMeta = findOrCreateCachedMetaIfNeeds( + dbMetaData, beanClass, relationNestLevel); + if (cachedMeta != null) { + return cachedMeta; + } else { + return super.createBeanMetaData(dbMetaData, beanClass, + relationNestLevel); + } + } + + protected BeanMetaData findCachedMeta(Class beanClass) { + if (isDBFluteEntity(beanClass)) { + final BeanMetaData cachedMeta = getMetaFromCache(beanClass); + if (cachedMeta != null) { + return cachedMeta; + } + } + return null; + } + + protected BeanMetaData findOrCreateCachedMetaIfNeeds( + DatabaseMetaData dbMetaData, Class beanClass, int relationNestLevel) { + if (isDBFluteEntity(beanClass)) { + final BeanMetaData cachedMeta = getMetaFromCache(beanClass); + if (cachedMeta != null) { + return cachedMeta; + } else { + return super.createBeanMetaData(dbMetaData, beanClass, 0); + } + } + return null; + } + + @Override + protected BeanMetaDataImpl createBeanMetaDataImpl() { + return new BeanMetaDataImpl() { + @Override + public void initialize() { + final Class myBeanClass = getBeanClass(); + if (isDBFluteEntity(myBeanClass)) { + final BeanMetaData cachedMeta = getMetaFromCache(myBeanClass); + if (cachedMeta == null) { + _metaMap.put(myBeanClass, this); + } + } + super.initialize(); + } + }; + } + + protected boolean isDBFluteEntity(Class beanClass) { + return Entity.class.isAssignableFrom(beanClass); + } + + protected BeanMetaData getMetaFromCache(Class beanClass) { + return _metaMap.get(beanClass); + } + + /** + * Get the limit nest level of relation. + * @return The limit nest level of relation. + */ + @Override + protected int getLimitRelationNestLevel() { + return 2;// for Compatible to old version DBFlute + } +} \ No newline at end of file Property changes on: announcement/trunk/src/main/java/jp/sf/pal/announcement/db/allcommon/s2dao/S2BeanMetaDataFactoryImpl.java ___________________________________________________________________ Name: svn:eol-style + native Added: announcement/trunk/src/main/java/jp/sf/pal/announcement/db/allcommon/s2dao/S2DaoInterceptor.java =================================================================== --- announcement/trunk/src/main/java/jp/sf/pal/announcement/db/allcommon/s2dao/S2DaoInterceptor.java (rev 0) +++ announcement/trunk/src/main/java/jp/sf/pal/announcement/db/allcommon/s2dao/S2DaoInterceptor.java 2008-06-30 02:54:27 UTC (rev 1002) @@ -0,0 +1,962 @@ +package jp.sf.pal.announcement.db.allcommon.s2dao; + +import java.lang.reflect.Method; +import java.util.Arrays; +import java.util.List; + +import jp.sf.pal.announcement.db.allcommon.Entity; +import jp.sf.pal.announcement.db.allcommon.InternalMapContext; +import jp.sf.pal.announcement.db.allcommon.XLog; +import jp.sf.pal.announcement.db.allcommon.cbean.ConditionBean; +import jp.sf.pal.announcement.db.allcommon.cbean.ConditionBeanContext; +import jp.sf.pal.announcement.db.allcommon.cbean.FetchNarrowingBean; +import jp.sf.pal.announcement.db.allcommon.cbean.FetchNarrowingBeanContext; +import jp.sf.pal.announcement.db.allcommon.cbean.outsidesql.OutsideSqlContext; +import jp.sf.pal.announcement.db.allcommon.cbean.outsidesql.OutsideSqlDao; +import jp.sf.pal.announcement.db.allcommon.cbean.outsidesql.OutsideSqlOption; +import jp.sf.pal.announcement.db.allcommon.util.TraceViewUtil; + +import org.aopalliance.intercept.MethodInvocation; +import org.seasar.dao.DaoMetaData; +import org.seasar.dao.DaoMetaDataFactory; +import org.seasar.dao.SqlCommand; +import org.seasar.framework.beans.MethodNotFoundRuntimeException; + +/** + * The interceptor of S2Dao for DBFlute. + * @author DBFlute(AutoGenerator) + */ +public class S2DaoInterceptor extends + org.seasar.framework.aop.interceptors.AbstractInterceptor { + + // =================================================================================== + // Definition + // ========== + /** Serial version UID. (Default) */ + private static final long serialVersionUID = 1L; + + /** Log instance. */ + private static final org.apache.commons.logging.Log _log = org.apache.commons.logging.LogFactory + .getLog(S2DaoInterceptor.class); + + // =================================================================================== + // Attribute + // ========= + /** The factory of dao meta data. */ + private DaoMetaDataFactory daoMetaDataFactory_; + + // =================================================================================== + // Constructor + // =========== + /** + * Constructor. + * @param daoMetaDataFactory The factory of dao meta data. (NotNull) + */ + public S2DaoInterceptor(DaoMetaDataFactory daoMetaDataFactory) { + daoMetaDataFactory_ = daoMetaDataFactory; + } + + // =================================================================================== + // Execute Status Log + // ================== + protected void log(String msg) { + XLog.log(msg); + } + + protected boolean isLogEnabled() { + return XLog.isLogEnabled(); + } + + // =================================================================================== + // Invoke + // ====== + /** + * Invoke the method. + * @param invocation The method invocation. (NotNull) + * @return The result of the method. (Nullable) + * @throws Throwable + */ + public Object invoke(MethodInvocation invocation) throws Throwable { + clearThreadLocal(); + try { + return dispatchInvoking(invocation); + } finally { + clearThreadLocal(); + } + } + + /** + * Dispatch invoking the method. + * @param invocation The method invocation. (NotNull) + * @return The result of the method. (Nullable) + * @throws Throwable + */ + protected Object dispatchInvoking(MethodInvocation invocation) + throws Throwable { + final Method method = invocation.getMethod(); + if (!org.seasar.framework.util.MethodUtil.isAbstract(method)) { + return invocation.proceed(); + } + + if (method.getName().equals("initializeDaoMetaData")) { + initializeSqlCommand(invocation); + return null; + } + + if (isLogEnabled()) { + logInvocation(invocation); + } + + long before = 0; + if (isLogEnabled()) { + before = System.currentTimeMillis(); + } + + // - - - - - - - - - - - + // Preprocess outsideSql + // - - - - - - - - - - - + preprocessOutsideSql(invocation); + + // - - - - - - - - - + // Set up sqlCommand + // - - - - - - - - - + final SqlCommand cmd; + { + long beforeCmd = 0; + if (isLogEnabled()) { + beforeCmd = System.currentTimeMillis(); + } + cmd = findSqlCommand(invocation); + if (isLogEnabled()) { + final long afterCmd = System.currentTimeMillis(); + if (beforeCmd != afterCmd) { + logSqlCommand(invocation, cmd, beforeCmd, afterCmd); + } + } + } + + // - - - - - - - - - - - - - + // Preprocess conditionBean + // - - - - - - - - - - - - - + final ConditionBean cb = preprocessConditionBean(invocation, cmd); + + // - - - - - - - - - - + // Execute sqlCommand! + // - - - - - - - - - - + Object ret = null; + try { + ret = cmd.execute(invocation.getArguments()); + } catch (org.seasar.dao.NotSingleRowUpdatedRuntimeException notSingleRow) { + throw new jp.sf.pal.announcement.db.allcommon.exception.EntityAlreadyUpdatedException( + notSingleRow); + } catch (Exception e) { + if (isLogEnabled()) { + final Class targetType = getTargetClass(invocation); + final StringBuilder sb = new StringBuilder(); + sb.append( + targetType.getSimpleName() + " was interrupted by " + + e.getClass().getSimpleName()).append( + getLineSeparator()); + sb.append("[Interrupted Target]").append(getLineSeparator()); + sb.append(" dao = " + targetType.getSimpleName()).append( + getLineSeparator()); + sb.append(" method = " + invocation.getMethod()).append( + getLineSeparator()); + sb.append(" args = " + + TraceViewUtil + .convertObjectArrayToStringView(invocation + .getArguments())); + log(sb.toString()); + } + throw e; + } finally { + postprocessConditionBean(invocation, cb); + } + final Class retType = method.getReturnType(); + assertRetType(retType, ret); + + if (isLogEnabled()) { + final long after = System.currentTimeMillis(); + logReturn(invocation, retType, ret, before, after); + } + + // - - - - - - - - - - + // Convert and Return! + // - - - - - - - - - - + if (retType.isPrimitive()) { + return org.seasar.framework.util.NumberConversionUtil + .convertPrimitiveWrapper(retType, ret); + } else if (Number.class.isAssignableFrom(retType)) { + return org.seasar.framework.util.NumberConversionUtil + .convertNumber(retType, ret); + } else { + return ret; + } + } + + // =================================================================================== + // SqlCommand + // ========== + protected void initializeSqlCommand(MethodInvocation invocation) { + final Class targetType = getTargetClass(invocation); + final DaoMetaData dmd = daoMetaDataFactory_.getDaoMetaData(targetType); + if (OutsideSqlDao.class.isAssignableFrom(targetType)) { + return;// Do nothing! + } else { + final Object[] arguments = invocation.getArguments(); + if (arguments != null && arguments.length > 0 + && arguments[0] instanceof String) { + final String methodName = (String) arguments[0]; + try { + dmd.getSqlCommand(methodName); + } catch (MethodNotFoundRuntimeException ignored) { + // Do nothing! + if (isLogEnabled()) { + log("Not Found the method: " + methodName + " msg=" + + ignored.getMessage()); + } + } + return; + } else { + String msg = "The method should have one string argument as method name: " + + invocation; + throw new IllegalStateException(msg); + } + } + } + + protected SqlCommand findSqlCommand(MethodInvocation invocation) { + final SqlCommand cmd; + final Class targetType = getTargetClass(invocation); + final DaoMetaData dmd = daoMetaDataFactory_.getDaoMetaData(targetType); + if (OutsideSqlDao.class.isAssignableFrom(targetType)) { + cmd = dmd + .getSqlCommand(generateSpecifiedOutsideSqlUniqueKey(invocation)); + } else { + cmd = dmd.getSqlCommand(invocation.getMethod().getName()); + } + return cmd; + } + + protected String generateSpecifiedOutsideSqlUniqueKey( + MethodInvocation invocation) { + final Object[] args = invocation.getArguments(); + final String path = (String) args[0]; + final Object pmb = args[1]; + final OutsideSqlOption option = (OutsideSqlOption) args[2]; + Object resultTypeSpecification = null; + if (args.length > 3) { + resultTypeSpecification = args[3]; + } + return OutsideSqlContext.generateSpecifiedOutsideSqlUniqueKey( + invocation.getMethod().getName(), path, pmb, option, + resultTypeSpecification); + } + + // =================================================================================== + // Log Invocation + // ============== + protected void logInvocation(MethodInvocation invocation) { + final Method method = invocation.getMethod(); + final String invocationExpressionWithoutKakko = extractInvocationExpression(method) + + "." + method.getName(); + final String equalBorder = buildFitBorder("", "=", + invocationExpressionWithoutKakko, false); + final String invocationExpression = invocationExpressionWithoutKakko + + "()"; + + log("/=====================================================" + + equalBorder + "=="); + log(" " + + invocationExpression); + log(" " + + equalBorder + "=/"); + + logPath(); + + // Specified OutsideSql + if (OutsideSqlDao.class.isAssignableFrom(getTargetClass(invocation))) { + Object[] args = invocation.getArguments(); + if (args != null && args.length != 0 && args[0] instanceof String) { + log("OutsideSql: " + args[0]); + } + } + } + + protected void logPath() { + final StackTraceElement[] stackTrace = new Exception().getStackTrace(); + final InvokeNameExtractingResult behaviorResult = extractBehaviorInvokeName(stackTrace); + final int bhvNextIndex = behaviorResult.getNextStartIndex(); + final InvokeNameExtractingResult clientResult = extractClientInvokeName( + stackTrace, bhvNextIndex); + final int clientFirstIndex = clientResult.getFoundFirstIndex(); + final InvokeNameExtractingResult byPassResult = extractByPassInvokeName( + stackTrace, bhvNextIndex, clientFirstIndex - bhvNextIndex); + + final String clientInvokeName = clientResult.getInvokeName(); + final String byPassInvokeName = byPassResult.getInvokeName(); + final String behaviorInvokeName = behaviorResult.getInvokeName(); + if (clientInvokeName.trim().length() == 0 + && byPassInvokeName.trim().length() == 0 + && behaviorInvokeName.trim().length() == 0) { + return; + } + final String path = clientInvokeName + byPassInvokeName + + behaviorInvokeName + "..."; + // *I will delete this at the future. + // final String hyphenBorder = buildFitBorder("/", "-", path, true); + // log(hyphenBorder); + log(path); + // log("- - - - - - - - - -/"); + } + + protected String buildFitBorder(String prefix, String element, + String lengthTargetString, boolean space) { + final int length = space ? lengthTargetString.length() / 2 + : lengthTargetString.length(); + final StringBuffer sb = new StringBuffer(); + sb.append(prefix); + for (int i = 0; i < length; i++) { + sb.append(element); + if (space) { + sb.append(" "); + } + } + if (space) { + sb.append(element); + } + return sb.toString(); + } + + protected InvokeNameExtractingResult extractClientInvokeName( + StackTraceElement[] stackTrace, final int startIndex) { + final List suffixList = Arrays.asList(new String[] { "Page", + "Action" }); + final InvokeNameExtractingCallback callback = new InvokeNameExtractingCallback() { + public boolean isTargetElement(String className, String methodName) { + return isClassNameEndsWith(className, suffixList); + } + + public String filterSimpleClassName(String simpleClassName) { + return simpleClassName; + } + + public boolean isUseAdditionalInfo() { + return true; + } + + public int getStartIndex() { + return startIndex; + } + + public int getLoopSize() { + return 25; + } + }; + return extractInvokeName(callback, stackTrace); + } + + protected InvokeNameExtractingResult extractByPassInvokeName( + StackTraceElement[] stackTrace, final int startIndex, + final int loopSize) { + final List suffixList = Arrays.asList(new String[] { "Service", + "ServiceImpl", "Facade", "FacadeImpl" }); + final InvokeNameExtractingCallback callback = new InvokeNameExtractingCallback() { + public boolean isTargetElement(String className, String methodName) { + return isClassNameEndsWith(className, suffixList); + } + + public String filterSimpleClassName(String simpleClassName) { + return simpleClassName; + } + + public boolean isUseAdditionalInfo() { + return true; + } + + public int getStartIndex() { + return startIndex; + } + + public int getLoopSize() { + return loopSize >= 0 ? loopSize : 25; + } + }; + return extractInvokeName(callback, stackTrace); + } + + protected InvokeNameExtractingResult extractBehaviorInvokeName( + StackTraceElement[] stackTrace) { + final List suffixList = Arrays.asList(new String[] { "Bhv", + "Bhv$", "BehaviorReadable", "BehaviorWritable" }); + final InvokeNameExtractingCallback callback = new InvokeNameExtractingCallback() { + public boolean isTargetElement(String className, String methodName) { + return isClassNameEndsWith(className, suffixList); + } + + public String filterSimpleClassName(String simpleClassName) { + return removeBasePrefixFromSimpleClassName(simpleClassName); + } + + public boolean isUseAdditionalInfo() { + return false; + } + + public int getStartIndex() { + return 0; + } + + public int getLoopSize() { + return 25; + } + }; + return extractInvokeName(callback, stackTrace); + } + + protected boolean isClassNameEndsWith(String className, + List suffixList) { + for (String suffix : suffixList) { + if (className.endsWith(suffix)) { + return true; + } + } + return false; + } + + /** + * @param callback Callback. (NotNull) + * @param stackTrace Stack log. (NotNull) + * @return Invoke name. (NotNull: If not found, returns empty string.) + */ + protected InvokeNameExtractingResult extractInvokeName( + InvokeNameExtractingCallback callback, + StackTraceElement[] stackTrace) { + String targetSimpleClassName = null; + String targetMethodName = null; + int lineNumber = 0; + int foundIndex = -1;// The minus one means 'not found'. + int foundFirstIndex = -1;// The minus one means 'not found'. + boolean onTarget = false; + for (int i = callback.getStartIndex(); i < stackTrace.length; i++) { + final StackTraceElement element = stackTrace[i]; + if (i > callback.getStartIndex() + callback.getLoopSize()) { + break; + } + final String className = element.getClassName(); + if (className.startsWith("sun.") || className.startsWith("java.")) { + if (onTarget) { + break; + } + continue; + } + final String methodName = element.getMethodName(); + if (callback.isTargetElement(className, methodName)) { + if (methodName.equals("invoke")) { + continue; + } + targetSimpleClassName = className.substring(className + .lastIndexOf(".") + 1); + targetMethodName = methodName; + if (callback.isUseAdditionalInfo()) { + lineNumber = element.getLineNumber(); + } + foundIndex = i; + if (foundFirstIndex == -1) { + foundFirstIndex = i; + } + onTarget = true; + continue; + } + if (onTarget) { + break; + } + } + final InvokeNameExtractingResult result = new InvokeNameExtractingResult(); + if (targetSimpleClassName == null) { + result.setInvokeName(""); + return result; + } + if (lineNumber > 0) { + result.setInvokeName(callback + .filterSimpleClassName(targetSimpleClassName) + + "." + targetMethodName + "():" + lineNumber + " --> "); + } else { + result.setInvokeName(callback + .filterSimpleClassName(targetSimpleClassName) + + "." + targetMethodName + "() --> "); + } + result.setFoundIndex(foundIndex); + result.setFoundFirstIndex(foundFirstIndex); + return result; + } + + protected static interface InvokeNameExtractingCallback { + public boolean isTargetElement(String className, String methodName); + + public String filterSimpleClassName(String simpleClassName); + + public boolean isUseAdditionalInfo(); + + public int getStartIndex(); + + public int getLoopSize(); + } + + protected static class InvokeNameExtractingResult { + protected String _invokeName; + + protected int _foundIndex; + + protected int _foundFirstIndex; + + public int getNextStartIndex() { + return _foundIndex + 1; + } + + public String getInvokeName() { + return _invokeName; + } + + public void setInvokeName(String invokeName) { + this._invokeName = invokeName; + } + + public int getFoundIndex() { + return _foundIndex; + } + + public void setFoundIndex(int foundIndex) { + this._foundIndex = foundIndex; + } + + public int getFoundFirstIndex() { + return _foundFirstIndex; + } + + public void setFoundFirstIndex(int foundFirstIndex) { + this._foundFirstIndex = foundFirstIndex; + } + } + + protected String extractInvocationExpression(Method method) { + final Class declaringClass = method.getDeclaringClass(); + return buildEntityExpressionFromDaoName(declaringClass.getSimpleName()); + + // Commented out because of still thinking. + // final Field field; + // try { + // field = declaringClass.getField("INVOCATION_NAME"); + // final String invocationExpression = (String)field.get(null); + // return invocationExpression; + // } catch (Exception ignored) { + // return buildEntityExpressionFromDaoName(declaringClass.getName()); + // } + } + + protected String buildEntityExpressionFromDaoName(String daoName) { + // Commented out because of still thinking. + // if (daoName.endsWith("Dao")) { + // daoName = daoName.substring(0, daoName.length() - "Dao".length()); + // } + return removeBasePrefixFromSimpleClassName(daoName); + } + + protected String removeBasePrefixFromSimpleClassName(String simpleClassName) { + if (!simpleClassName.startsWith("Bs")) { + return simpleClassName; + } + final int prefixLength = "Bs".length(); + if (!Character.isUpperCase(simpleClassName.substring(prefixLength) + .charAt(0))) { + return simpleClassName; + } + if (simpleClassName.length() <= prefixLength) { + return simpleClassName; + } + return "" + simpleClassName.substring(prefixLength); + } + + // =================================================================================== + // Log SqlCommand + // ============== + protected void logSqlCommand( + org.aopalliance.intercept.MethodInvocation invocation, + org.seasar.dao.SqlCommand cmd, long beforeCmd, long afterCmd) { + log("SqlCommand Initialization Cost: [" + + TraceViewUtil.convertToPerformanceView(afterCmd - beforeCmd) + + "]"); + } + + protected void assertRetType(Class retType, Object ret) { + if (java.util.List.class.isAssignableFrom(retType)) { + if (ret != null && !(ret instanceof java.util.List)) { + String msg = "The retType is difference from actual return: "; + msg = msg + "retType=" + retType + " ret.getClass()=" + + ret.getClass() + " ref=" + ret; + throw new IllegalStateException(msg); + } + } else if (Entity.class.isAssignableFrom(retType)) { + if (ret != null && !(ret instanceof Entity)) { + String msg = "The retType is difference from actual return: "; + msg = msg + "retType=" + retType + " ret.getClass()=" + + ret.getClass() + " ref=" + ret; + throw new IllegalStateException(msg); + } + } + } + + // =================================================================================== + // Log Return + // ========== + protected void logReturn( + org.aopalliance.intercept.MethodInvocation invocation, + Class retType, Object ret, long before, long after) + throws Throwable { + try { + final String daoResultPrefix = "===========/ [" + + TraceViewUtil.convertToPerformanceView(after - before) + + " - "; + if (java.util.List.class.isAssignableFrom(retType)) { + if (ret == null) { + log(daoResultPrefix + "Selected list: null]"); + } else { + final java.util.List ls = (java.util.List) ret; + if (ls.isEmpty()) { + log(daoResultPrefix + "Selected list: 0]"); + } else if (ls.size() == 1 && ls.get(0) instanceof Number) { + log(daoResultPrefix + "Selected count: " + ls.get(0) + + "]"); + } else { + log(daoResultPrefix + "Selected list: " + ls.size() + + " first=" + ls.get(0) + "]"); + } + } + } else if (Entity.class.isAssignableFrom(retType)) { + if (ret == null) { + log(daoResultPrefix + "Selected entity: null" + "]"); + } else { + final Entity entity = (Entity) ret; + log(daoResultPrefix + "Selected entity: " + entity + "]"); + } + } else if (Entity.class.isAssignableFrom(retType)) { + if (ret == null) { + log(daoResultPrefix + "Selected entity: null" + "]"); + } else { + final Entity entity = (Entity) ret; + log(daoResultPrefix + "Selected entity: " + entity + "]"); + } + } else if (int[].class.isAssignableFrom(retType)) { + if (ret == null) { + log(daoResultPrefix + "Selected entity: null" + "]"); + } else { + final int[] resultArray = (int[]) ret; + if (resultArray.length == 0) { + log(daoResultPrefix + "All updated count: 0]"); + } else { + final StringBuilder sb = new StringBuilder(); + boolean resultExpressionScope = true; + int resultCount = 0; + int loopCount = 0; + for (int element : resultArray) { + resultCount = resultCount + element; + if (resultExpressionScope) { + if (loopCount <= 10) { + if (sb.length() == 0) { + sb.append(element); + } else { + sb.append(",").append(element); + } + } else { + sb.append(",").append("..."); + resultExpressionScope = false; + } + } + ++loopCount; + } + sb.insert(0, "{").append("}"); + log(daoResultPrefix + "All updated count: " + + resultCount + " result=" + sb + "]"); + } + } + } else { + if (isSelectCountIgnoreFetchScopeMethod(invocation)) { + log(daoResultPrefix + "Selected count: " + ret + "]"); + } else { + log(daoResultPrefix + "Result: " + ret + "]"); + } + } + log(" "); + } catch (Exception e) { + String msg = "Result object debug threw the exception: methodName="; + msg = msg + invocation.getMethod().getName() + " retType=" + + retType; + msg = msg + " ret=" + ret; + _log.warn(msg, e); + throw e; + } + } + + // =================================================================================== + // Pre Post Process + // ================ + // ----------------------------------------------------- + // OutsideSql + // ---------- + protected void preprocessOutsideSql(MethodInvocation invocation) { + final Class outsideSqlType = jp.sf.pal.announcement.db.allcommon.annotation.OutsideSql.class; + final jp.sf.pal.announcement.db.allcommon.annotation.OutsideSql outsideSql = invocation + .getMethod().getAnnotation(outsideSqlType); + + // Traditional OutsideSql + if (outsideSql != null + && (outsideSql.dynamicBinding() || outsideSql.offsetByCursor() + || outsideSql.offsetByCursor() || outsideSql + .limitByCursor())) { + final OutsideSqlContext outsideSqlContext = new OutsideSqlContext(); + outsideSqlContext.setDynamicBinding(outsideSql.dynamicBinding()); + outsideSqlContext.setOffsetByCursorForcedly(outsideSql + .offsetByCursor()); + outsideSqlContext.setLimitByCursorForcedly(outsideSql + .limitByCursor()); + OutsideSqlContext.setOutsideSqlContextOnThread(outsideSqlContext); + + // Set up fetchNarrowingBean. + final Object[] args = invocation.getArguments(); + if (args == null || args.length == 0) { + return; + } + if (FetchNarrowingBeanContext.isTheTypeFetchNarrowingBean(args[0] + .getClass())) { + FetchNarrowingBeanContext + .setFetchNarrowingBeanOnThread((FetchNarrowingBean) args[0]); + } + return; + } + + // Specified OutsideSql + if (OutsideSqlDao.class.isAssignableFrom(getTargetClass(invocation))) { + if (isOutsideSqlDaoMethodSelect(invocation)) { + setupOutsideSqlContextSelect(invocation); + } else { + setupOutsideSqlContextExecute(invocation); + } + return; + } + } + + // - - - - - - - - - - - - + // Select + // - - - + protected boolean isOutsideSqlDaoMethodSelect(MethodInvocation invocation) { + return invocation.getMethod().getName().startsWith("select"); + } + + protected void setupOutsideSqlContextSelect(MethodInvocation invocation) { + final Object[] args = invocation.getArguments(); + if (args.length != 4) { + String msg = "Internal Error! OutsideSqlDao.selectXxx() should have 4 arguements: args.length=" + + args.length; + throw new IllegalStateException(msg); + } + final String path = (String) args[0]; + final Object pmb = args[1]; + final OutsideSqlOption option = (OutsideSqlOption) args[2]; + final Object resultTypeSpecification = args[3]; + final OutsideSqlContext outsideSqlContext = new OutsideSqlContext(); + outsideSqlContext.setDynamicBinding(option.isDynamicBinding()); + outsideSqlContext.setOffsetByCursorForcedly(option.isAutoPaging()); + outsideSqlContext.setLimitByCursorForcedly(option.isAutoPaging()); + outsideSqlContext.setOutsideSqlPath(path); + outsideSqlContext.setParameterBean(pmb); + outsideSqlContext.setResultTypeSpecification(resultTypeSpecification); + outsideSqlContext.setMethodName(invocation.getMethod().getName()); + outsideSqlContext.setStatementConfig(option.getStatementConfig()); + OutsideSqlContext.setOutsideSqlContextOnThread(outsideSqlContext); + + // Set up fetchNarrowingBean. + setupOutsideSqlFetchNarrowingBean(pmb, option); + } + + // - - - - - - - - - - - - + // Execute + // - - - - + protected void setupOutsideSqlContextExecute(MethodInvocation invocation) { + final Object[] args = invocation.getArguments(); + if (args.length != 3) { + String msg = "Internal Error! OutsideSqlDao.execute() should have 3 arguements: args.length=" + + args.length; + throw new IllegalStateException(msg); + } + final String path = (String) args[0]; + final Object pmb = args[1]; + final OutsideSqlOption option = (OutsideSqlOption) args[2]; + final OutsideSqlContext outsideSqlContext = new OutsideSqlContext(); + outsideSqlContext.setDynamicBinding(option.isDynamicBinding()); + outsideSqlContext.setOffsetByCursorForcedly(option.isAutoPaging()); + outsideSqlContext.setLimitByCursorForcedly(option.isAutoPaging()); + outsideSqlContext.setOutsideSqlPath(path); + outsideSqlContext.setParameterBean(pmb); + outsideSqlContext.setMethodName(invocation.getMethod().getName()); + outsideSqlContext.setStatementConfig(option.getStatementConfig()); + OutsideSqlContext.setOutsideSqlContextOnThread(outsideSqlContext); + + // Set up fetchNarrowingBean. + setupOutsideSqlFetchNarrowingBean(pmb, option); + } + + // - - - - - - - - - - - - + // Common + // - - - + protected void setupOutsideSqlFetchNarrowingBean(Object pmb, + OutsideSqlOption option) { + if (pmb == null + || !FetchNarrowingBeanContext.isTheTypeFetchNarrowingBean(pmb + .getClass())) { + return; + } + final FetchNarrowingBean fetchNarrowingBean = (FetchNarrowingBean) pmb; + if (option.isManualPaging()) { + fetchNarrowingBean.ignoreFetchNarrowing(); + } + FetchNarrowingBeanContext + .setFetchNarrowingBeanOnThread(fetchNarrowingBean); + } + + // ----------------------------------------------------- + // ConditionBean + // ------------- + /** + * Pre-process conditionBean. + *

    + * If this method is condition bean select target, make dynamic SQL. + * Else nothing. + * @param invocation Method invocation. (NotNull) + * @param cmd SqlCommand. (NotNull) + * @return ConditionBean. (Nullable) + */ + protected ConditionBean preprocessConditionBean( + org.aopalliance.intercept.MethodInvocation invocation, + org.seasar.dao.SqlCommand cmd) { + final OutsideSqlContext outsideSqlContext = getOutsideSqlContext(); + if (outsideSqlContext != null) { + return null; // Because it has already finished setting up fetchNarrowingBean for outsideSql here. + } + final ConditionBean cb; + { + final Object[] args = invocation.getArguments(); + if (args == null || args.length == 0) { + return null; + } + final Object arg0 = args[0]; + if (arg0 == null) { + return null; + } + if (!ConditionBeanContext.isTheTypeConditionBean(arg0.getClass())) {// The argument is not condition-bean... + if (FetchNarrowingBeanContext.isTheTypeFetchNarrowingBean(arg0 + .getClass()) + && !isSelectCountIgnoreFetchScopeMethod(invocation)) { + // Fetch-narrowing-bean and Not select count! + FetchNarrowingBeanContext + .setFetchNarrowingBeanOnThread((FetchNarrowingBean) arg0); + } + return null; + } + cb = (ConditionBean) arg0; + } + + if (!(cmd instanceof S2DaoSelectDynamicCommand)) {// The argument is condition-bean, but this method use outer-sql-file... + FetchNarrowingBeanContext.setFetchNarrowingBeanOnThread(cb); + return null; + } + + if (isSelectCountIgnoreFetchScopeMethod(invocation)) { + cb.xsetupSelectCountIgnoreFetchScope(); + } else { + FetchNarrowingBeanContext.setFetchNarrowingBeanOnThread(cb); + } + + ConditionBeanContext.setConditionBeanOnThread(cb); + return cb; + } + + /** + * Post-process condition-bean. + * @param invocation Method invocation. (NotNull) + * @param cb Condition-bean. (Nullable) + */ + protected void postprocessConditionBean( + org.aopalliance.intercept.MethodInvocation invocation, + ConditionBean cb) { + if (cb == null) { + return; + } + if (isSelectCountIgnoreFetchScopeMethod(invocation)) { + cb.xafterCareSelectCountIgnoreFetchScope(); + } + } + + // ----------------------------------------------------- + // Clear Thread Local + // ------------------ + protected void clearThreadLocal() { + if (OutsideSqlContext.isExistOutsideSqlContextOnThread()) { + OutsideSqlContext.clearOutsideSqlContextOnThread(); + } + if (FetchNarrowingBeanContext.isExistFetchNarrowingBeanOnThread()) { + // - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - + // Because there is possible that fetch narrowing has been ignored for manualPaging of outsideSql. + // - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - + FetchNarrowingBeanContext.getFetchNarrowingBeanOnThread() + .restoreIgnoredFetchNarrowing(); + + FetchNarrowingBeanContext.clearFetchNarrowingBeanOnThread(); + } + if (ConditionBeanContext.isExistConditionBeanOnThread()) { + ConditionBeanContext.clearConditionBeanOnThread(); + } + if (InternalMapContext.isExistInternalMapContextOnThread()) { + InternalMapContext.clearInternalMapContextOnThread(); + } + } + + // =================================================================================== + // Context Helper + // ============== + protected OutsideSqlContext getOutsideSqlContext() { + if (!OutsideSqlContext.isExistOutsideSqlContextOnThread()) { + return null; + } + return OutsideSqlContext.getOutsideSqlContextOnThread(); + } + + protected boolean isSpecifiedOutsideSql() { + final OutsideSqlContext outsideSqlContext = getOutsideSqlContext(); + return outsideSqlContext != null + && outsideSqlContext.isSpecifiedOutsideSql(); + } + + // =================================================================================== + // Determination + // ============= + /** + * Is select count ignore-fetch-scope method? + * @param invocation Method invocation. (NotNull) + * @return Determination. + */ + protected boolean isSelectCountIgnoreFetchScopeMethod( + org.aopalliance.intercept.MethodInvocation invocation) { + final String name = invocation.getMethod().getName(); + return name.startsWith("readCount") || name.startsWith("selectCount"); + } + + // =================================================================================== + // General Helper + // ============== + /** + * Get the value of line separator. + * @return The value of line separator. (NotNull) + */ + protected String getLineSeparator() { + return System.getProperty("line.separator"); + } +} \ No newline at end of file Property changes on: announcement/trunk/src/main/java/jp/sf/pal/announcement/db/allcommon/s2dao/S2DaoInterceptor.java ___________________________________________________________________ Name: svn:eol-style + native Added: announcement/trunk/src/main/java/jp/sf/pal/announcement/db/allcommon/s2dao/S2DaoLatestSqlProvider.java =================================================================== --- announcement/trunk/src/main/java/jp/sf/pal/announcement/db/allcommon/s2dao/S2DaoLatestSqlProvider.java (rev 0) +++ announcement/trunk/src/main/java/jp/sf/pal/announcement/db/allcommon/s2dao/S2DaoLatestSqlProvider.java 2008-06-30 02:54:27 UTC (rev 1002) @@ -0,0 +1,33 @@ +package jp.sf.pal.announcement.db.allcommon.s2dao; + +import jp.sf.pal.announcement.db.allcommon.jdbc.LatestSqlProvider; +import jp.sf.pal.announcement.db.allcommon.s2dao.internal.sqllog.InternalSqlLogRegistry; + +/** + * The provider of latest SQL as S2Dao.
    + * This instance should be singleton.
    + * + * @author DBFlute(AutoGenerator) + */ +public class S2DaoLatestSqlProvider implements LatestSqlProvider { + + /** + * The implementation. + * + * @return Display SQL. (Nullable: If it was not found, returns null.) + */ + public String getDisplaySql() { + return getLastCompleteSql(); + } + + protected String getLastCompleteSql() { + try { + return InternalSqlLogRegistry.peekCompleteSql(); + } catch (RuntimeException ignored) { + return null; + } + } + + public void clearSqlCache() { + } +} Property changes on: announcement/trunk/src/main/java/jp/sf/pal/announcement/db/allcommon/s2dao/S2DaoLatestSqlProvider.java ___________________________________________________________________ Name: svn:eol-style + native Added: announcement/trunk/src/main/java/jp/sf/pal/announcement/db/allcommon/s2dao/S2DaoMetaDataExtension.java =================================================================== --- announcement/trunk/src/main/java/jp/sf/pal/announcement/db/allcommon/s2dao/S2DaoMetaDataExtension.java (rev 0) +++ announcement/trunk/src/main/java/jp/sf/pal/announcement/db/allcommon/s2dao/S2DaoMetaDataExtension.java 2008-06-30 02:54:27 UTC (rev 1002) @@ -0,0 +1,1563 @@ +package jp.sf.pal.announcement.db.allcommon.s2dao; + +import java.lang.reflect.Method; +import java.lang.reflect.ParameterizedType; +import java.lang.reflect.Type; +import java.sql.DatabaseMetaData; +import java.sql.PreparedStatement; +import java.sql.ResultSet; +import java.sql.SQLException; +import java.util.ArrayList; +import java.util.HashMap; +import java.util.Iterator; +import java.util.List; +import java.util.Map; +import java.util.Set; +import java.util.Stack; + +import jp.sf.pal.announcement.db.allcommon.Entity; +import jp.sf.pal.announcement.db.allcommon.InternalMapContext; +import jp.sf.pal.announcement.db.allcommon.annotation.OutsideSql; +import jp.sf.pal.announcement.db.allcommon.cbean.ConditionBean; +import jp.sf.pal.announcement.db.allcommon.cbean.ConditionBeanContext; +import jp.sf.pal.announcement.db.allcommon.cbean.outsidesql.OutsideSqlContext; +import jp.sf.pal.announcement.db.allcommon.dbmeta.DBMeta; +import jp.sf.pal.announcement.db.allcommon.jdbc.CursorHandler; +import jp.sf.pal.announcement.db.allcommon.jdbc.StatementConfig; +import jp.sf.pal.announcement.db.allcommon.s2dao.internal.rshandler.InternalBeanArrayMetaDataResultSetHandler; +import jp.sf.pal.announcement.db.allcommon.s2dao.internal.rshandler.InternalBeanListMetaDataResultSetHandler; +import jp.sf.pal.announcement.db.allcommon.s2dao.internal.sqlcommand.InternalDeleteAutoStaticCommand; +import jp.sf.pal.announcement.db.allcommon.s2dao.internal.sqlcommand.InternalDeleteBatchAutoStaticCommand; +import jp.sf.pal.announcement.db.allcommon.s2dao.internal.sqlcommand.InternalDeleteQueryAutoDynamicCommand; +import jp.sf.pal.announcement.db.allcommon.s2dao.internal.sqlcommand.InternalInsertAutoDynamicCommand; +import jp.sf.pal.announcement.db.allcommon.s2dao.internal.sqlcommand.InternalInsertBatchAutoStaticCommand; +import jp.sf.pal.announcement.db.allcommon.s2dao.internal.sqlcommand.InternalUpdateAutoDynamicCommand; +import jp.sf.pal.announcement.db.allcommon.s2dao.internal.sqlcommand.InternalUpdateBatchAutoStaticCommand; +import jp.sf.pal.announcement.db.allcommon.s2dao.internal.sqlcommand.InternalUpdateDynamicCommand; +import jp.sf.pal.announcement.db.allcommon.s2dao.internal.sqlcommand.InternalUpdateModifiedOnlyCommand; + +import org.seasar.dao.BeanAnnotationReader; +import org.seasar.dao.BeanEnhancer; +import org.seasar.dao.BeanMetaData; +import org.seasar.dao.BeanMetaDataFactory; +import org.seasar.dao.ColumnNaming; +import org.seasar.dao.Dbms; +import org.seasar.dao.PropertyTypeFactory; +import org.seasar.dao.PropertyTypeFactoryBuilder; +import org.seasar.dao.RelationPropertyType; +import org.seasar.dao.RelationPropertyTypeFactoryBuilder; +import org.seasar.dao.RelationRowCreator; +import org.seasar.dao.RowCreator; +import org.seasar.dao.SqlCommand; +import org.seasar.dao.TableNaming; +import org.seasar.dao.impl.BeanMetaDataImpl; +import org.seasar.dao.impl.DaoMetaDataImpl; +import org.seasar.dao.impl.PropertyTypeFactoryBuilderImpl; +import org.seasar.dao.impl.RelationRowCreationResource; +import org.seasar.dao.impl.SelectDynamicCommand; +import org.seasar.dao.impl.UpdateAutoStaticCommand; +import org.seasar.extension.jdbc.PropertyType; +import org.seasar.extension.jdbc.ResultSetFactory; +import org.seasar.extension.jdbc.ResultSetHandler; +import org.seasar.extension.jdbc.StatementFactory; +import org.seasar.extension.jdbc.ValueType; +import org.seasar.extension.jdbc.impl.ConfigurableStatementFactory; +import org.seasar.extension.jdbc.types.ValueTypes; +import org.seasar.framework.beans.MethodNotFoundRuntimeException; +import org.seasar.framework.beans.PropertyDesc; + +/** + * The extension of DaoMetaDataImpl for DBFlute. + * @author DBFlute(AutoGenerator) + */ + @ SuppressWarnings("unchecked") +public class S2DaoMetaDataExtension extends DaoMetaDataImpl { + + // =================================================================================== + // Definition + // ========== + /** Log instance. */ + private static final org.apache.commons.logging.Log _log = org.apache.commons.logging.LogFactory + .getLog(S2DaoMetaDataExtension.class); + + // =================================================================================== + // Attribute + // ========= + /** Bean enhancer. */ + protected BeanEnhancer beanEnhancer; + + /** The factory of annotation reader. */ + protected org.seasar.dao.AnnotationReaderFactory annotationReaderFactory; + + /** The naming of column. {After S2Dao-1.0.47} */ + protected ColumnNaming columnNaming; + + /** The builder of property type factory. {After S2Dao-1.0.47} */ + protected PropertyTypeFactoryBuilder propertyTypeFactoryBuilder; + + /** The builder of relation property type factory. {After S2Dao-1.0.47} */ + protected RelationPropertyTypeFactoryBuilder relationPropertyTypeFactoryBuilder; + + /** The builder of table naming. {After S2Dao-1.0.47} */ + protected TableNaming tableNaming; + + // ----------------------------------------------------- + // DBFlute Extension + // ----------------- + /** The config of dbflute. {Since DBFlute-0.6.2} */ + protected StatementConfig _defaultStatementConfig; + + /** The lock monitor of method initialization. */ + protected Object _methodInitializationLockMonitor = new Object(); + + /** The determination of internal debug. {Since DBFlute-0.6.2} */ + protected boolean _internalDebug; + + // =================================================================================== + // Constructor + // =========== + public S2DaoMetaDataExtension() { + } + + // =================================================================================== + // OutsideSql Check Override + // ========================= + protected void setupMethodByAuto(Method method) { + final OutsideSql outsideSql = method.getAnnotation(OutsideSql.class); + if (outsideSql != null) { + String msg = "This method '" + method.getName() + + "()' should use Outside Sql but the file was not found!"; + msg = msg + " Expected sql file name is '" + + method.getDeclaringClass().getSimpleName() + "_" + + method.getName() + ".sql'"; + throw new IllegalStateException(msg); + } + super.setupMethodByAuto(method); + } + + // =================================================================================== + // ResultSetHandler Override + // ========================= + @Override + protected ResultSetHandler createResultSetHandler(Method method) { + return this.resultSetHandlerFactory.getResultSetHandler( + daoAnnotationReader, beanMetaData, method); + } + + protected ResultSetHandler createResultSetHandler( + BeanMetaData specifiedBeanMetaData, Method method) { + return this.resultSetHandlerFactory.getResultSetHandler( + daoAnnotationReader, specifiedBeanMetaData, method); + } + + // =================================================================================== + // SqlCommand Setup Override + // ========================= + @Override + protected void setupSqlCommand() { + // Do nothing for lazy initializing! + } + + @Override + public SqlCommand getSqlCommand(String methodName) + throws MethodNotFoundRuntimeException { + SqlCommand cmd = (SqlCommand) sqlCommands.get(methodName); + if (cmd != null) { + return cmd; + } + synchronized (_methodInitializationLockMonitor) { + cmd = (SqlCommand) sqlCommands.get(methodName); + if (cmd != null) { + if (_log.isDebugEnabled()) { + _log + .debug("...Getting sqlCommand as cache because the previous thread have already initilized."); + } + return cmd; + } + if (_log.isDebugEnabled()) { + _log.debug("...Initializing sqlCommand."); + } + cmd = initializeSqlCommand(methodName); + } + return cmd; + } + + protected SqlCommand initializeSqlCommand(String methodName) + throws MethodNotFoundRuntimeException { + if (OutsideSqlContext.isExistOutsideSqlContextOnThread()) { + final OutsideSqlContext outsideSqlContext = OutsideSqlContext + .getOutsideSqlContextOnThread(); + if (outsideSqlContext != null + && outsideSqlContext.isSpecifiedOutsideSql()) { + return initializeSpecifiedOutsideSqlCommand(methodName, + outsideSqlContext); + } + } + final Method[] methods = daoBeanDesc.getMethods(methodName); + if (methods.length == 1 + && org.seasar.framework.util.MethodUtil.isAbstract(methods[0])) { + setupMethod(methods[0]); + } + final SqlCommand cmd = (SqlCommand) sqlCommands.get(methodName); + if (cmd != null) { + return cmd; + } + throw new MethodNotFoundRuntimeException(daoClass, methodName, null); + } + + protected SqlCommand initializeSpecifiedOutsideSqlCommand( + String sqlCommandKey, OutsideSqlContext outsideSqlContext) + throws MethodNotFoundRuntimeException { + final Method[] methods = daoBeanDesc.getMethods(outsideSqlContext + .getMethodName());// By real method name. + if (methods.length == 1 + && org.seasar.framework.util.MethodUtil.isAbstract(methods[0])) { + final Method method = methods[0]; + if (isOutsideSqlDaoMethodSelect(method)) { + setupSpecifiedOutsideSqlSelectCommand(sqlCommandKey, method, + outsideSqlContext); + } else { + setupSpecifiedOutsideSqlExecuteCommand(sqlCommandKey, method, + outsideSqlContext); + } + } + final SqlCommand cmd = (SqlCommand) sqlCommands.get(sqlCommandKey); + if (cmd != null) { + return cmd; + } + String msg = "Internal Error! The sql-command is not found:"; + msg = msg + " sqlCommandKey=" + sqlCommandKey; + msg = msg + " sqlCommands=" + sqlCommands; + throw new IllegalStateException(msg); + } + + protected boolean isOutsideSqlDaoMethodSelect(Method method) { + return method.getName().startsWith("select"); + } + + // =================================================================================== + // Customize SelectDynamicCommand Creation + // ======================================= + protected S2DaoSelectDynamicCommand createCustomizeSelectDynamicCommand( + org.seasar.extension.jdbc.ResultSetHandler handler) { + final ResultSetFactory customizeResultSetFactory = createCustomizeResultSetFactory(); + final StatementFactory customizeStatementFactory = createCustomizeStatememtFactory(); + return new S2DaoSelectDynamicCommand(dataSource, + customizeStatementFactory, handler, customizeResultSetFactory); + } + + protected ResultSetFactory createCustomizeResultSetFactory() { + return new jp.sf.pal.announcement.db.allcommon.s2dao.FetchNarrowingResultSetFactory(); + } + + protected StatementFactory createCustomizeStatememtFactory() { + return new StatementFactory() { + public PreparedStatement createPreparedStatement( + java.sql.Connection con, String sql) { + try { + final StatementConfig config = findStatementConfigOnThread(); + ; + final int resultSetType; + if (config != null && config.hasResultSetType()) { + resultSetType = config.getResultSetType(); + } else if (_defaultStatementConfig != null + && _defaultStatementConfig.hasResultSetType()) { + resultSetType = _defaultStatementConfig + .getResultSetType(); + } else { + resultSetType = java.sql.ResultSet.TYPE_SCROLL_INSENSITIVE; + } + final int resultSetConcurrency = java.sql.ResultSet.CONCUR_READ_ONLY; + if (_internalDebug) { + _log.debug("...Creating prepareStatement(sql, " + + resultSetType + ", " + resultSetConcurrency + + ")"); + } + final PreparedStatement ps = con.prepareStatement(sql, + resultSetType, resultSetConcurrency); + if (config != null && config.hasStatementOptions()) { + if (_internalDebug) { + _log + .debug("...Setting statement config as request:" + + config); + } + reflectStatementOptions(config, ps); + } else { + reflectDefaultOptionsToStatementIfNeeds(ps); + } + return ps; + } catch (java.sql.SQLException e) { + throw new org.seasar.framework.exception.SQLRuntimeException( + e); + } + } + + public java.sql.CallableStatement createCallableStatement( + java.sql.Connection con, String sql) { + return org.seasar.extension.jdbc.util.ConnectionUtil + .prepareCall(con, sql); + } + + protected StatementConfig findStatementConfigOnThread() { + final StatementConfig config; + if (ConditionBeanContext.isExistConditionBeanOnThread()) { + final ConditionBean cb = ConditionBeanContext + .getConditionBeanOnThread(); + config = cb.getStatementConfig(); + } else if (OutsideSqlContext.isExistOutsideSqlContextOnThread()) { + final OutsideSqlContext context = OutsideSqlContext + .getOutsideSqlContextOnThread(); + config = context.getStatementConfig(); + } else { + config = null; + } + return config; + } + + protected void reflectDefaultOptionsToStatementIfNeeds( + PreparedStatement ps) { + if (_defaultStatementConfig != null + && _defaultStatementConfig.hasStatementOptions()) { + if (_internalDebug) { + _log.debug("...Setting statement config as default:" + + _defaultStatementConfig); + } + reflectStatementOptions(_defaultStatementConfig, ps); + return; + } + if (!(statementFactory instanceof ConfigurableStatementFactory)) { + return; + } + final ConfigurableStatementFactory confSf = (ConfigurableStatementFactory) statementFactory; + final Class confSfType = ConfigurableStatementFactory.class; + final String confMethodName = "configurePreparedStatement"; + final Class[] confMethodParameterType = new Class[] { PreparedStatement.class }; + try { + final Method confMethod = confSfType.getDeclaredMethod( + confMethodName, confMethodParameterType); + confMethod.setAccessible(true);// Because the method is protected! + if (_internalDebug) { + _log.debug("...Invoking configurableStatementFactory." + + confMethodName + "(ps)"); + } + confMethod.invoke(confSf, new Object[] { ps }); + return; + } catch (Exception e) { + String msg = "The configuration of statement factory threw exception:"; + msg = msg + " class=" + confSfType + " method=" + + confMethodName + + " parameter=java.sql.PreparedStatement"; + throw new RuntimeException(msg, e); + } + } + + protected void reflectStatementOptions(StatementConfig config, + PreparedStatement ps) { + try { + if (config.hasQueryTimeout()) { + ps.setQueryTimeout(config.getQueryTimeout()); + } + if (config.hasFetchSize()) { + ps.setFetchSize(config.getFetchSize()); + } + if (config.hasMaxRows()) { + ps.setMaxRows(config.getMaxRows()); + } + } catch (SQLException e) { + throw new org.seasar.framework.exception.SQLRuntimeException( + e); + } + } + }; + } + + // =================================================================================== + // ConditionBean Override + // ====================== + @Override + protected void setupSelectMethodByAuto(final Method method) { + final ResultSetHandler handler = createResultSetHandler(method); + final String[] argNames = daoAnnotationReader.getArgNames(method); + final String query = daoAnnotationReader.getQuery(method); + final SqlCommand cmd; + if (query != null && !startsWithOrderBy(query)) { + cmd = setupInternalQuerySelectMethodByAuto(method, handler, + argNames, query); + } else { + cmd = setupInternalNonQuerySelectMethodByAuto(method, handler, + argNames, query); + } + putSqlCommand(method.getName(), cmd); + } + + protected SelectDynamicCommand setupInternalQuerySelectMethodByAuto( + final Method method, final ResultSetHandler handler, + final String[] argNames, final String query) { + final Class[] types = method.getParameterTypes(); + final SelectDynamicCommand cmd = createSelectDynamicCommand(handler, + query); + cmd.setArgNames(argNames); + cmd.setArgTypes(types); + return cmd; + } + + protected SqlCommand setupInternalNonQuerySelectMethodByAuto( + final Method method, final ResultSetHandler handler, + final String[] argNames, final String query) { + if (isAutoSelectSqlByDto(method, argNames)) { + return setupInternalNonQuerySelectMethodByDto(method, handler, + argNames, query); + } else { + return setupNonQuerySelectMethodByArgs(method, handler, argNames, + query); + } + } + + protected SqlCommand setupInternalNonQuerySelectMethodByDto(Method method, + ResultSetHandler handler, String[] argNames, String query) { + Class[] types = method.getParameterTypes(); + Class clazz = types[0]; + // /----------------------------------------------------- [MyExtension] + if (!ConditionBeanContext.isTheTypeConditionBean(clazz)) { + return super.setupNonQuerySelectMethodByDto(method, handler, + argNames, query); + } + argNames = new String[] { "dto" }; + final S2DaoSelectDynamicCommand cmd = createCustomizeSelectDynamicCommand(handler); + cmd.setArgNames(argNames); + cmd.setArgTypes(types); + // -----------/ + return cmd; + } + + // =================================================================================== + // Insert and Update and Delete By Auto Override + // ============================================= + // ----------------------------------------------------- + // Insert + // ------ + @Override + protected void setupInsertMethodByAuto(final Method method) { + checkAutoUpdateMethod(method); + final String[] propertyNames = getPersistentPropertyNames(method); + final SqlCommand command; + if (isUpdateSignatureForBean(method)) { + final InternalInsertAutoDynamicCommand cmd = new InternalInsertAutoDynamicCommand(); + cmd.setBeanMetaData(getBeanMetaData()); + cmd.setDataSource(dataSource); + + // It is unnecessary for DBFlute! + // cmd.setNotSingleRowUpdatedExceptionClass(getNotSingleRowUpdatedExceptionClass(method)); + + cmd.setPropertyNames(propertyNames); + cmd.setStatementFactory(statementFactory); + cmd.setCheckSingleRowUpdate(isCheckSingleRowUpdate(method)); + command = cmd; + } else { + boolean returningRows = false; + if (int[].class.isAssignableFrom(method.getReturnType())) { + returningRows = true; + } + final InternalInsertBatchAutoStaticCommand cmd = new InternalInsertBatchAutoStaticCommand( + dataSource, statementFactory, getBeanMetaData(), + propertyNames, returningRows); + command = cmd; + } + putSqlCommand(method.getName(), command); + } + + // ----------------------------------------------------- + // Update + // ------ + @Override + protected void setupUpdateMethodByAuto(final Method method) { + checkAutoUpdateMethod(method); + final String[] propertyNames = getPersistentPropertyNames(method); + SqlCommand cmd; + if (isUpdateSignatureForBean(method)) { + if (isUnlessNull(method.getName())) { + cmd = createInternalUpdateAutoDynamicCommand(method, + propertyNames); + } else if (isModifiedOnly(method.getName())) { + cmd = createInternalUpdateModifiedOnlyCommand(method, + propertyNames); + } else { + cmd = createInternalUpdateAutoStaticCommand(method, + propertyNames); + } + } else { + boolean returningRows = false; + if (int[].class.isAssignableFrom(method.getReturnType())) { + returningRows = true; + } + cmd = createInternalUpdateBatchAutoStaticCommand(method, + propertyNames, returningRows); + } + putSqlCommand(method.getName(), cmd); + } + + protected UpdateAutoStaticCommand createInternalUpdateAutoStaticCommand( + final Method method, final String[] propertyNames) { + final UpdateAutoStaticCommand cmd = new UpdateAutoStaticCommand( + dataSource, statementFactory, beanMetaData, propertyNames); + cmd.setCheckSingleRowUpdate(isCheckSingleRowUpdate(method)); + return cmd; + } + + protected InternalUpdateAutoDynamicCommand createInternalUpdateAutoDynamicCommand( + Method method, String[] propertyNames) { + final InternalUpdateAutoDynamicCommand cmd = newUpdateAutoDynamicCommand( + dataSource, statementFactory); + cmd.setBeanMetaData(createBeanMetaData4UpdateDeleteByAuto(method));// Extension Point! + cmd.setPropertyNames(propertyNames); + cmd.setCheckSingleRowUpdate(!isNonstrictMethod(method)); + + // It is unnecessary for DBFlute! + // cmd.setNotSingleRowUpdatedExceptionClass(getNotSingleRowUpdatedExceptionClass(method)); + + return cmd; + } + + protected InternalUpdateAutoDynamicCommand newUpdateAutoDynamicCommand( + javax.sql.DataSource ds, + org.seasar.extension.jdbc.StatementFactory sf) { + return new InternalUpdateAutoDynamicCommand(ds, sf); + } + + protected InternalUpdateModifiedOnlyCommand createInternalUpdateModifiedOnlyCommand( + final Method method, final String[] propertyNames) { + final InternalUpdateModifiedOnlyCommand cmd = newInternalUpdateModifiedOnlyCommand( + dataSource, statementFactory); + cmd.setBeanMetaData(createBeanMetaData4UpdateDeleteByAuto(method));// Extension Point! + cmd.setPropertyNames(propertyNames); + cmd.setCheckSingleRowUpdate(!isNonstrictMethod(method)); + + // It is unnecessary for DBFlute! + // cmd.setNotSingleRowUpdatedExceptionClass(getNotSingleRowUpdatedExceptionClass(method)); + + return cmd; + } + + protected InternalUpdateModifiedOnlyCommand newInternalUpdateModifiedOnlyCommand( + javax.sql.DataSource ds, + org.seasar.extension.jdbc.StatementFactory sf) { + return new InternalUpdateModifiedOnlyCommand(ds, sf); + } + + protected InternalUpdateBatchAutoStaticCommand createInternalUpdateBatchAutoStaticCommand( + final Method method, final String[] propertyNames, + boolean returningRows) { + return new InternalUpdateBatchAutoStaticCommand(dataSource, + statementFactory, + createBeanMetaData4UpdateDeleteByAuto(method), propertyNames, + returningRows) { + @Override + public Object execute(Object[] args) { + final Object result = super.execute(args); + handleBatchUpdateResultWithOptimisticLock(args, result, method); + return result; + } + }; + } + + protected void handleBatchUpdateResultWithOptimisticLock(Object[] args, + Object result, Method method) { + if (args.length == 0) { + return;// for Safety! + } + if (result instanceof int[]) { + final int[] updatedCountArray = (int[]) result; + int index = 0; + for (int updatedCount : updatedCountArray) { + if (updatedCount == 0) { + if (args.length <= index) { + return;// for Safety! + } + if (isNonstrictMethod(method)) { + throw new jp.sf.pal.announcement.db.allcommon.exception.EntityAlreadyDeletedException( + "The entity=" + args[index]); + } else { + throw new jp.sf.pal.announcement.db.allcommon.exception.EntityAlreadyUpdatedException( + args[index], updatedCount); + } + } + } + } + } + + // ----------------------------------------------------- + // Delete + // ------ + @Override + protected void setupDeleteMethodByAuto(final Method method) { + if (isFirstArgumentConditionBean(method)) { + final SqlCommand cmd = new InternalDeleteQueryAutoDynamicCommand( + dataSource, statementFactory); + putSqlCommand(method.getName(), cmd); + return; + } + checkAutoUpdateMethod(method); + final String[] propertyNames = getPersistentPropertyNames(method); + final SqlCommand cmd; + if (isUpdateSignatureForBean(method)) { + cmd = createInternalDeleteAutoStaticCommand(method, propertyNames); + } else { + boolean returningRows = false; + if (int[].class.isAssignableFrom(method.getReturnType())) { + returningRows = true; + } + cmd = createInternalDeleteBatchAutoStaticCommand(method, + propertyNames, returningRows); + } + putSqlCommand(method.getName(), cmd); + } + + protected InternalDeleteAutoStaticCommand createInternalDeleteAutoStaticCommand( + final Method method, final String[] propertyNames) { + final InternalDeleteAutoStaticCommand cmd = new InternalDeleteAutoStaticCommand( + dataSource, statementFactory, + createBeanMetaData4UpdateDeleteByAuto(method), propertyNames); + cmd.setCheckSingleRowUpdate(!isNonstrictMethod(method)); + return cmd; + } + + protected InternalDeleteBatchAutoStaticCommand createInternalDeleteBatchAutoStaticCommand( + final Method method, final String[] propertyNames, + boolean returningRows) { + return new InternalDeleteBatchAutoStaticCommand(dataSource, + statementFactory, + createBeanMetaData4UpdateDeleteByAuto(method), propertyNames, + returningRows) { + @Override + public Object execute(Object[] args) { + final Object result = super.execute(args); + handleBatchUpdateResultWithOptimisticLock(args, result, method); + return result; + } + }; + } + + // ----------------------------------------------------- + // Common Helper + // ------------- + protected BeanMetaData createBeanMetaData4UpdateDeleteByAuto(Method method) { + if (isNonstrictMethod(method)) { + return createNonConcurrencyBmdFactory().createBeanMetaData( + getBeanClass()); + } else { + return getBeanMetaData(); + } + } + + protected boolean isNonstrictMethod(Method method) { + return method.getName().contains("Nonstrict"); + } + + protected BeanMetaDataFactory createNonConcurrencyBmdFactory() { + final S2BeanMetaDataFactoryImpl nonConcurrencyBmdFactory = new S2BeanMetaDataFactoryImpl() { + protected BeanMetaDataImpl createBeanMetaDataImpl() { + return new BeanMetaDataImpl() { + public boolean hasVersionNoPropertyType() { + return false; + } + + public boolean hasTimestampPropertyType() { + return false; + } + }; + } + }; + nonConcurrencyBmdFactory + .setAnnotationReaderFactory(this.annotationReaderFactory); + nonConcurrencyBmdFactory + .setPropertyTypeFactoryBuilder(this.propertyTypeFactoryBuilder); + nonConcurrencyBmdFactory + .setRelationPropertyTypeFactoryBuilder(this.relationPropertyTypeFactoryBuilder); + nonConcurrencyBmdFactory.setTableNaming(this.tableNaming); + nonConcurrencyBmdFactory.setDataSource(this.dataSource); + nonConcurrencyBmdFactory + .setDaoNamingConvention(this.daoNamingConvention); + nonConcurrencyBmdFactory.setBeanEnhancer(this.beanEnhancer); + return nonConcurrencyBmdFactory; + } + + protected boolean isFirstArgumentConditionBean(final Method method) { + final Class[] parameterTypes = method.getParameterTypes(); + return parameterTypes.length > 0 + && ConditionBean.class.isAssignableFrom(parameterTypes[0]); + } + + // =================================================================================== + // OutsideSql Override + // =================== + // ----------------------------------------------------- + // Normal OutsideSql + // ----------------- + @Override + protected void setupSelectMethodByManual(Method method, String sql) { + final Class[] parameterTypes = method.getParameterTypes(); + final String[] argNames = this.daoAnnotationReader.getArgNames(method); + final Class[] argTypes; + if (parameterTypes != null + && parameterTypes.length > 0 + && CursorHandler.class + .isAssignableFrom(parameterTypes[parameterTypes.length - 1])) { + argTypes = new Class[parameterTypes.length - 1]; + for (int i = 0; i < parameterTypes.length - 1; i++) { + argTypes[i] = parameterTypes[i]; + } + } else { + argTypes = parameterTypes; + } + final BeanMetaData myBeanMetaData = getOutsideSqlBeanMetaData(method); + registerSqlCommand(method.getName(), method, sql, argNames, argTypes, + myBeanMetaData); + } + + protected BeanMetaData getOutsideSqlBeanMetaData(Method method) { + final Class beanClass4SelectMethodByManual = getOutsideSqlDefaultBeanClass(method); + if (beanClass4SelectMethodByManual.equals(getBeanClass())) { + return getBeanMetaData(); + } + return createOutsideSqlCustomizeBeanMetaDataFactory() + .createBeanMetaData(getOutsideSqlDefaultBeanClass(method)); + } + + // ----------------------------------------------------- + // Specified OutsideSql + // -------------------- + // - - - - - - - - - - - - + // Select + // - - - + protected void setupSpecifiedOutsideSqlSelectCommand(String sqlCommandKey, + Method method, OutsideSqlContext outsideSqlContext) { + // - - - - - - - - - - - - - - - - - - - - - - - + // The attribute of Specified-OutsideSqlContext. + // - - - - - - - - - - - - - - - - - - - - - - - + final String sql = outsideSqlContext.readFilteredOutsideSql( + getSqlFileEncoding(), dbms.getSuffix()); + final Object pmb = outsideSqlContext.getParameterBean(); + final Object resultTypeSpecification = outsideSqlContext + .getResultTypeSpecification(); + + // - - - - - - - - - - - - - - - + // The attribute of SqlCommand. + // - - - - - - - - - - - - - - - + final String[] argNames = (pmb != null ? new String[] { "pmb" } + : new String[] {}); + final Class[] argTypes = (pmb != null ? new Class[] { pmb + .getClass() } : new Class[] {}); + + // - - - - - - - - - - - - - - - - + // Create customized BeanMetaData. + // - - - - - - - - - - - - - - - - + final Class lastestArguementType = method.getParameterTypes()[method + .getParameterTypes().length - 1]; + final ResultSetHandler myResultSetHandler; + if (Class.class.isAssignableFrom(lastestArguementType)) { + // - - - - - - - - + // EntityHandling + // - - - - - - - - + final Class customizeEntityType = (Class) resultTypeSpecification; + final BeanMetaData myBeanMetaData = createSpecifiedOutsideSqlCustomizeBeanMetaData(customizeEntityType); + if (List.class.isAssignableFrom(method.getReturnType())) { + myResultSetHandler = createSpecifiedOutsideSqlCustomizeBeanListResultSetHandler( + myBeanMetaData, customizeEntityType); + } else { + throw new UnsupportedOperationException( + "The return type of method is unsupported: method.getReturnType()=" + + method.getReturnType()); + // myResultSetHandler = createSpecifiedOutsideSqlCustomizeBeanResultSetHandler(myBeanMetaData, customizeEntityType); + } + } else if (CursorHandler.class.isAssignableFrom(lastestArguementType)) { + // - - - - - - - - + // CursorHandling + // - - - - - - - - + final BeanMetaData myBeanMetaData = createSpecifiedOutsideSqlCursorBeanMetaData(method); + myResultSetHandler = createSpecifiedOutsideSqlCursorResultSetHandler(myBeanMetaData); + } else { + String msg = "The lastestArguementType is unsupported:"; + msg = msg + " lastestArguementType=" + lastestArguementType; + msg = msg + " method=" + method; + throw new IllegalStateException(msg); + } + + // - - - - - - - - - - - + // Register Sql-Command. + // - - - - - - - - - - - + registerSqlCommand(sqlCommandKey, method, sql, argNames, argTypes, + myResultSetHandler); + } + + protected BeanMetaData createSpecifiedOutsideSqlCustomizeBeanMetaData( + Class clazz) { + return createOutsideSqlCustomizeBeanMetaDataFactory() + .createBeanMetaData(clazz); + } + + // [Unsupported] + // The return type of method is unsupported! + // Because the method of outside-sql that selects one entity is unnecessary! + // + // /** + // * Create the handler of result set of specified outside-sql for customize bean. + // * + // * @param specifiedBeanMetaData Specified bean meta data. (NotNull) + // * @param customizeEntityType The type of customize entity. (NotNull) + // * @return The handler of result set. (NotNull) + // */ + // protected ResultSetHandler createSpecifiedOutsideSqlCustomizeBeanResultSetHandler(BeanMetaData specifiedBeanMetaData, Class customizeEntityType) { + // final ValueType valueType = ValueTypes.getValueType(customizeEntityType); + // if (valueType == null || !valueType.equals(ValueTypes.OBJECT)) { + // return new org.seasar.extension.jdbc.impl.ObjectResultSetHandler(); + // } + // return new org.seasar.dao.impl.BeanMetaDataResultSetHandler(specifiedBeanMetaData, new RowCreatorExtension(), new RelationRowCreatorExtension()); + // } + + /** + * Create the handler of result set of specified outside-sql for the list of customize bean. + * @param specifiedBeanMetaData Specified bean meta data. (NotNull) + * @param customizeEntityType The type of customize entity. (NotNull) + * @return The handler of result set. (NotNull) + */ + protected ResultSetHandler createSpecifiedOutsideSqlCustomizeBeanListResultSetHandler( + BeanMetaData specifiedBeanMetaData, Class customizeEntityType) { + final ValueType valueType = ValueTypes + .getValueType(customizeEntityType); + if (valueType == null || !valueType.equals(ValueTypes.OBJECT)) { + return new InternalObjectListResultSetHandler(valueType); + } + return new InternalBeanListMetaDataResultSetHandler( + specifiedBeanMetaData, new RowCreatorExtension(), + new RelationRowCreatorExtension()); + } + + protected class InternalObjectListResultSetHandler implements + ResultSetHandler { + private ValueType valueType; + + public InternalObjectListResultSetHandler(ValueType valueType) { + this.valueType = valueType; + } + + public Object handle(ResultSet rs) throws SQLException { + final List ret = new ArrayList(); + while (rs.next()) { + ret.add(valueType.getValue(rs, 1)); + } + return ret; + } + } + + protected BeanMetaData createSpecifiedOutsideSqlCursorBeanMetaData( + Method method) { + return createOutsideSqlCustomizeBeanMetaDataFactory() + .createBeanMetaData(getOutsideSqlDefaultBeanClass(method)); + } + + protected ResultSetHandler createSpecifiedOutsideSqlCursorResultSetHandler( + BeanMetaData specifiedBeanMetaData) { + return new org.seasar.extension.jdbc.impl.ObjectResultSetHandler();// This is dummy for cursor handling! + } + + // - - - - - - - - - - - - + // Execute + // - - - - + protected void setupSpecifiedOutsideSqlExecuteCommand(String sqlCommandKey, + Method method, OutsideSqlContext outsideSqlContext) { + // - - - - - - - - - - - - - - - - - - - - - - - + // The attribute of Specified-OutsideSqlContext. + // - - - - - - - - - - - - - - - - - - - - - - - + final String sql = outsideSqlContext.readFilteredOutsideSql( + getSqlFileEncoding(), dbms.getSuffix()); + final Object pmb = outsideSqlContext.getParameterBean(); + + // - - - - - - - - - - - - - - - + // The attribute of SqlCommand. + // - - - - - - - - - - - - - - - + final String[] argNames = (pmb != null ? new String[] { "pmb" } + : new String[] {}); + final Class[] argTypes = (pmb != null ? new Class[] { pmb + .getClass() } : new Class[] {}); + + final InternalUpdateDynamicCommand cmd = new InternalUpdateDynamicCommand( + dataSource, statementFactory) { + @Override + public Object execute(Object[] args) { + if (args.length != 3) { + String msg = "Internal Error! OutsideSqlDao.execute() should have 3 arguements: args.length=" + + args.length; + throw new IllegalStateException(msg); + } + Object arg = args[1]; + return super.execute(new Object[] { arg }); + } + }; + + // It is unnecessary for DBFlute! + // cmd.setNotSingleRowUpdatedExceptionClass(getNotSingleRowUpdatedExceptionClass(method)); + + registerSqlCommand(sqlCommandKey, method, sql, argNames, argTypes, cmd); + } + + // ----------------------------------------------------- + // Common of OutsideSql + // -------------------- + protected BeanMetaDataFactory createOutsideSqlCustomizeBeanMetaDataFactory() { + final S2BeanMetaDataFactoryImpl originalBmdFactory = new S2BeanMetaDataFactoryImpl() { + protected BeanMetaDataImpl createBeanMetaDataImpl() { + return newOutsideSqlCustomizeBeanMetaDataImpl(); + } + }; + originalBmdFactory + .setAnnotationReaderFactory(this.annotationReaderFactory); + originalBmdFactory + .setPropertyTypeFactoryBuilder(newOutsideSqlPropertyTypeFactoryBuilderImpl()); + originalBmdFactory + .setRelationPropertyTypeFactoryBuilder(this.relationPropertyTypeFactoryBuilder); + originalBmdFactory.setTableNaming(this.tableNaming); + originalBmdFactory.setDataSource(this.dataSource); + originalBmdFactory.setDaoNamingConvention(this.daoNamingConvention); + originalBmdFactory.setBeanEnhancer(this.beanEnhancer); + return originalBmdFactory; + } + + protected BeanMetaDataImpl newOutsideSqlCustomizeBeanMetaDataImpl() { + return new OutsideSqlCustomizeBeanMetaDataImpl(); + } + + protected static class OutsideSqlCustomizeBeanMetaDataImpl extends + BeanMetaDataImpl { + // Though nothing to override, it uses original class just in case. + } + + protected PropertyTypeFactoryBuilderImpl newOutsideSqlPropertyTypeFactoryBuilderImpl() { + final PropertyTypeFactoryBuilderImpl impl = new OutsideSqlPropertyTypeFactoryBuilderExtension(); + if (columnNaming == null) { + String msg = "Internal Error! The columnNaming should not be null! {Failed to Injection!}"; + throw new IllegalStateException(msg); + } + impl.setColumnNaming(columnNaming); + impl.setDaoNamingConvention(daoNamingConvention); + impl.setValueTypeFactory(valueTypeFactory); + return impl; + } + + protected static class OutsideSqlPropertyTypeFactoryBuilderExtension extends + PropertyTypeFactoryBuilderImpl { + @Override + public PropertyTypeFactory build(Class beanClass, + BeanAnnotationReader beanAnnotationReader, Dbms dbms, + DatabaseMetaData databaseMetaData) { + return new S2DaoPropertyTypeFactoryBuilderExtension.FastPropertyTypeFactoryExtension( + beanClass, beanAnnotationReader, valueTypeFactory, + columnNaming, daoNamingConvention, dbms); + } + } + + protected Class getOutsideSqlDefaultBeanClass(Method method) { + final Class retType = method.getReturnType(); + if (java.util.List.class.isAssignableFrom(retType)) { + final Class elementType = InternalMethodUtil + .getElementTypeOfListFromReturnMethod(method); + if (elementType != null) { + return elementType; + } else { + return getBeanClass(); + } + } else if (retType.isArray()) { + return retType.getComponentType(); + } else if (retType.isPrimitive() + || !ValueTypes.getValueType(retType).equals(ValueTypes.OBJECT)) { + return getBeanClass(); + } else { + return retType; + } + } + + protected void registerSqlCommand(String sqlCommandKey, Method method, + String sql, String[] argNames, Class[] argTypes, + BeanMetaData myBeanMetaData) { + registerSqlCommand(sqlCommandKey, method, sql, argNames, argTypes, + createResultSetHandler(myBeanMetaData, method)); + } + + protected void registerSqlCommand(String sqlCommandKey, Method method, + String sql, String[] argNames, Class[] argTypes, + ResultSetHandler myResultSetHandler) { + final S2DaoSelectDynamicCommand cmd = createCustomizeSelectDynamicCommand(myResultSetHandler); + registerSqlCommand(sqlCommandKey, method, sql, argNames, argTypes, cmd); + } + + protected void registerSqlCommand(String sqlCommandKey, Method method, + String sql, String[] argNames, Class[] argTypes, + S2DaoSelectDynamicCommand cmd) { + cmd.setSql(sql); + cmd.setArgNames(argNames); + cmd.setArgTypes(argTypes); + this.sqlCommands.put(sqlCommandKey, cmd); + } + + protected void registerSqlCommand(String sqlCommandKey, Method method, + String sql, String[] argNames, Class[] argTypes, + InternalUpdateDynamicCommand cmd) { + cmd.setSql(sql); + cmd.setArgNames(argNames); + cmd.setArgTypes(argTypes); + this.sqlCommands.put(sqlCommandKey, cmd); + } + + // =================================================================================== + // Common Handlnig + // =============== + @Override + protected void putSqlCommand(String methodName, SqlCommand cmd) { + sqlCommands.put(methodName, cmd); + } + + protected boolean isCheckSingleRowUpdate(Method method) { + return checkSingleRowUpdateForAll + & daoAnnotationReader.isCheckSingleRowUpdate(method); + } + + // =================================================================================== + // Vert Internal + // ============= + protected static class InternalMethodUtil { + public static Class getElementTypeOfListFromReturnMethod(Method method) { + return InternalReflectionUtil + .getElementTypeOfListFromReturnType(method); + } + } + + protected static class InternalReflectionUtil { + public static Class getElementTypeOfList(final Type parameterizedList) { + if (!(parameterizedList instanceof ParameterizedType)) { + return null; + } + + final ParameterizedType parameterizedType = ParameterizedType.class + .cast(parameterizedList); + final Type rawType = parameterizedType.getRawType(); + if (!(rawType instanceof Class)) { + return null; + } + + final Class rawClass = Class.class.cast(rawType); + if (!rawClass.isAssignableFrom(List.class)) { + return null; + } + + final Type[] actualTypeArgument = parameterizedType + .getActualTypeArguments(); + if (actualTypeArgument == null || actualTypeArgument.length != 1) { + return null; + } + if (!(actualTypeArgument[0] instanceof Class)) { + return null; + } + + return Class.class.cast(actualTypeArgument[0]); + } + + public static Class getElementTypeOfListFromParameterType( + final Method method, final int parameterPosition) { + final Type[] parameterTypes = method.getGenericParameterTypes(); + return getElementTypeOfList(parameterTypes[parameterPosition]); + } + + public static Class getElementTypeOfListFromReturnType( + final Method method) { + return getElementTypeOfList(method.getGenericReturnType()); + } + } + + // =================================================================================== + // ResultSetHandlerFactoryImpl Extension + // ===================================== + public static class ResultSetHandlerFactoryExtension extends + org.seasar.dao.impl.ResultSetHandlerFactoryImpl { + public ResultSetHandlerFactoryExtension() { + super(); + } + + @Override + protected RowCreator createRowCreator() {// [DAO-118] (2007/08/25) + return new RowCreatorExtension(); + } + + @Override + protected RelationRowCreator createRelationRowCreator() { + return new RelationRowCreatorExtension(); + } + + @Override + protected ResultSetHandler createBeanListMetaDataResultSetHandler( + BeanMetaData beanMetaData) { + return new InternalBeanListMetaDataResultSetHandler(beanMetaData, + createRowCreator(), createRelationRowCreator()); + } + + @Override + protected ResultSetHandler createBeanArrayMetaDataResultSetHandler( + BeanMetaData beanMetaData) { + return new InternalBeanArrayMetaDataResultSetHandler(beanMetaData, + createRowCreator(), createRelationRowCreator()); + } + } + + // =================================================================================== + // RowCreatorImpl Extension + // ======================== + protected static class RowCreatorExtension extends + org.seasar.dao.impl.RowCreatorImpl { + + /** The key of DBMeta cache. */ + protected static final String DBMETA_CACHE_KEY = "df:DBMetaCache"; + + @Override + public Object createRow(ResultSet rs, Map propertyCache, Class beanClass) + throws SQLException { + final Object row = newBean(beanClass); + final DBMeta dbmeta = findDBMeta(row); + final Set columnNameSet = propertyCache.keySet(); + String columnName = null; + PropertyType pt = null; + String propertyName = null; + try { + for (final Iterator ite = columnNameSet.iterator(); ite + .hasNext();) { + columnName = (String) ite.next(); + pt = (PropertyType) propertyCache.get(columnName); + propertyName = pt.getPropertyName(); + if (dbmeta != null + && dbmeta.hasEntityPropertySetupper(propertyName)) { + final ValueType valueType = pt.getValueType(); + final Object value = valueType.getValue(rs, columnName); + dbmeta.setupEntityProperty(propertyName, row, value); + } else { + registerValue(rs, row, pt, columnName); + } + } + } catch (SQLException e) { + if (_log.isWarnEnabled()) { + String msg = SQLException.class.getSimpleName() + + " occurred while ResultSet Handling:"; + _log.warn(msg + " target=" + beanClass.getSimpleName() + + "." + propertyName); + } + throw e; + } + return row; + } + + /** + * @param row The object of row. (NotNull) + * @return The interface of DBMeta. (Nullable: If it's null, it means NotFound.) + */ + protected DBMeta findDBMeta(Object row) { + return EntityPropertySetupperHandler.findCachedDBMeta(row); + } + } + + /** + * The handler of setupper of entity property. + */ + protected static class EntityPropertySetupperHandler { + + /** The key of DBMeta cache. */ + protected static final String DBMETA_CACHE_KEY = "df:DBMetaCache"; + + public static DBMeta findCachedDBMeta(Object row) { + if (!(row instanceof Entity)) { + return null; + } + final Entity entity = (Entity) row; + Map, DBMeta> dbmetaCache = (Map, DBMeta>) InternalMapContext + .getObject(DBMETA_CACHE_KEY); + if (dbmetaCache == null) { + dbmetaCache = new HashMap, DBMeta>(); + InternalMapContext.setObject(DBMETA_CACHE_KEY, dbmetaCache); + } + DBMeta dbmeta = dbmetaCache.get(entity.getClass()); + if (dbmeta != null) { + return dbmeta; + } + dbmeta = entity.getDBMeta(); + dbmetaCache.put(entity.getClass(), dbmeta); + return dbmeta; + } + } + + // =================================================================================== + // RelationRowCreatorImpl Extension + // ================================ + protected static class RelationRowCreatorExtension extends + org.seasar.dao.impl.RelationRowCreatorImpl { + + @Override + protected Object createRelationRow(RelationRowCreationResource res) + throws SQLException { + // - - - - - - - - - - - + // Recursive Call Point! + // - - - - - - - - - - - + if (!res.hasPropertyCacheElement()) { + return null; + } + setupRelationKeyValue(res); + setupRelationAllValue(res); + return res.getRow(); + } + + @Override + protected void setupRelationKeyValue(RelationRowCreationResource res) { + final RelationPropertyType rpt = res.getRelationPropertyType(); + final BeanMetaData bmd = rpt.getBeanMetaData(); + for (int i = 0; i < rpt.getKeySize(); ++i) { + final String columnName = rpt.getMyKey(i) + res.getBaseSuffix(); + + if (!res.containsColumnName(columnName)) { + continue; + } + if (!res.hasRowInstance()) { + res.setRow(newRelationRow(rpt)); + } + if (!res.containsRelKeyValueIfExists(columnName)) { + continue; + } + final Object value = res.extractRelKeyValue(columnName); + if (value == null) { + continue; + } + + final String yourKey = rpt.getYourKey(i); + final PropertyType pt = bmd + .getPropertyTypeByColumnName(yourKey); + final PropertyDesc pd = pt.getPropertyDesc(); + pd.setValue(res.getRow(), value); + continue; + } + } + + @Override + protected void setupRelationAllValue(RelationRowCreationResource res) + throws SQLException { + final Map propertyCacheElement = res.extractPropertyCacheElement(); + final Set columnNameCacheElementKeySet = propertyCacheElement + .keySet(); + for (final Iterator ite = columnNameCacheElementKeySet.iterator(); ite + .hasNext();) { + final String columnName = (String) ite.next(); + final PropertyType pt = (PropertyType) propertyCacheElement + .get(columnName); + res.setCurrentPropertyType(pt); + if (!isValidRelationPerPropertyLoop(res)) { + res.clearRowInstance(); + return; + } + setupRelationProperty(res); + } + if (!isValidRelationAfterPropertyLoop(res)) { + res.clearRowInstance(); + return; + } + res.clearValidValueCount(); + if (res.hasNextRelationProperty() + && (hasConditionBean(res) || res.hasNextRelationLevel())) { + setupNextRelationRow(res); + } + } + + @Override + protected void registerRelationValue(RelationRowCreationResource res, + String columnName) throws SQLException { + final PropertyType pt = res.getCurrentPropertyType(); + Object value = null; + if (res.containsRelKeyValueIfExists(columnName)) { + value = res.extractRelKeyValue(columnName); + } else { + final ValueType valueType = pt.getValueType(); + value = valueType.getValue(res.getResultSet(), columnName); + } + + if (value != null) { + res.incrementValidValueCount(); + final DBMeta dbmeta = findDBMeta(res.getRow()); + final String propertyName = pt.getPropertyName(); + if (dbmeta != null + && dbmeta.hasEntityPropertySetupper(propertyName)) { + dbmeta.setupEntityProperty(propertyName, res.getRow(), + value); + } else { + final PropertyDesc pd = pt.getPropertyDesc(); + pd.setValue(res.getRow(), value); + } + } + } + + /** + * @param row The object of row. (NotNull) + * @return The interface of DBMeta. (Nullable: If it's null, it means NotFound.) + */ + protected DBMeta findDBMeta(Object row) { + return EntityPropertySetupperHandler.findCachedDBMeta(row); + } + + @Override + protected void setupPropertyCache(RelationRowCreationResource res) + throws SQLException { + // - - - - - - - - - - - + // Recursive Call Point! + // - - - - - - - - - - - + res.initializePropertyCacheElement(); + + // Do only selected foreign property for performance if condition-bean exists. + if (hasConditionBean(res)) { + final ConditionBean cb = ConditionBeanContext + .getConditionBeanOnThread(); + if (!cb.getSqlClause().hasSelectedForeignInfo( + res.getRelationNoSuffix())) { + return; + } + } + + // Set up property cache about current beanMetaData. + final BeanMetaData nextBmd = res.getRelationBeanMetaData(); + for (int i = 0; i < nextBmd.getPropertyTypeSize(); ++i) { + final PropertyType pt = nextBmd.getPropertyType(i); + res.setCurrentPropertyType(pt); + if (!isTargetProperty(res)) { + continue; + } + setupPropertyCacheElement(res); + } + + // Set up next relation. + if (res.hasNextRelationProperty() + && (hasConditionBean(res) || res.hasNextRelationLevel())) { + res.backupRelationPropertyType(); + res.incrementCurrentRelationNestLevel(); + try { + setupNextPropertyCache(res, nextBmd); + } finally { + res.restoreRelationPropertyType(); + res.decrementCurrentRelationNestLevel(); + } + } + } + + @Override + protected boolean isTargetProperty( + org.seasar.dao.impl.RelationRowCreationResource res) + throws java.sql.SQLException { + final PropertyType pt = res.getCurrentPropertyType(); + if (!pt.getPropertyDesc().hasWriteMethod()) { + return false; + } + if (java.util.List.class.isAssignableFrom(pt.getPropertyDesc() + .getPropertyType())) { + return false; + } + return true; + } + + @Override + protected boolean isCreateDeadLink() { + return false; + } + + @Override + protected int getLimitRelationNestLevel() { + return 2;// for Compatible + } + + @Override + protected RelationRowCreationResource createResourceForRow( + ResultSet rs, RelationPropertyType rpt, Set columnNames, + Map relKeyValues, Map relationPropertyCache) + throws SQLException { + final RelationRowCreationResource res = new RelationRowCreationResourceExtension(); + res.setResultSet(rs); + res.setRelationPropertyType(rpt); + res.setColumnNames(columnNames); + res.setRelKeyValues(relKeyValues); + res.setRelationPropertyCache(relationPropertyCache); + res.setBaseSuffix("");// as Default + res.setRelationNoSuffix(buildRelationNoSuffix(rpt)); + res.setLimitRelationNestLevel(getLimitRelationNestLevel()); + res.setCurrentRelationNestLevel(1);// as Default + res.setCreateDeadLink(isCreateDeadLink()); + return res; + } + + @Override + protected RelationRowCreationResource createResourceForPropertyCache( + RelationPropertyType rpt, Set columnNames, + Map relationPropertyCache, String baseSuffix, + String relationNoSuffix, int limitRelationNestLevel) + throws SQLException { + final RelationRowCreationResource res = new RelationRowCreationResourceExtension(); + res.setRelationPropertyType(rpt); + res.setColumnNames(columnNames); + res.setRelationPropertyCache(relationPropertyCache); + res.setBaseSuffix(baseSuffix); + res.setRelationNoSuffix(relationNoSuffix); + res.setLimitRelationNestLevel(limitRelationNestLevel); + res.setCurrentRelationNestLevel(1);// as Default + return res; + } + + protected boolean isConditionBeanSelectedRelation( + RelationRowCreationResource res) { + if (hasConditionBean(res)) { + final ConditionBean cb = ConditionBeanContext + .getConditionBeanOnThread(); + if (cb.getSqlClause().hasSelectedForeignInfo( + res.getRelationNoSuffix())) { + return true; + } + } + return false; + } + + protected boolean hasConditionBean(RelationRowCreationResource res) { + return ConditionBeanContext.isExistConditionBeanOnThread(); + } + } + + protected static class RelationRowCreationResourceExtension extends + RelationRowCreationResource { + protected Stack backupRelationPropertyType = new Stack(); + + protected Stack backupBaseSuffix = new Stack(); + + protected Stack backupRelationSuffix = new Stack(); + + @Override + public void backupRelationPropertyType() { + backupRelationPropertyType.push(getRelationPropertyType()); + } + + @Override + public void restoreRelationPropertyType() { + setRelationPropertyType(backupRelationPropertyType.pop()); + } + + @Override + public void backupSuffixAndPrepare(String baseSuffix, + String additionalRelationNoSuffix) { + backupBaseSuffixExtension(); + backupRelationNoSuffixExtension(); + setBaseSuffix(baseSuffix); + addRelationNoSuffix(additionalRelationNoSuffix); + } + + @Override + public void restoreSuffix() { + restoreBaseSuffixExtension(); + restoreRelationNoSuffixExtension(); + } + + protected void backupBaseSuffixExtension() { + backupBaseSuffix.push(getBaseSuffix()); + } + + protected void restoreBaseSuffixExtension() { + setBaseSuffix(backupBaseSuffix.pop()); + } + + protected void backupRelationNoSuffixExtension() { + backupRelationSuffix.push(getRelationNoSuffix()); + } + + protected void restoreRelationNoSuffixExtension() { + setRelationNoSuffix(backupRelationSuffix.pop()); + } + } + + // =================================================================================== + // Accessor + // ======== + // ----------------------------------------------------- + // Sql File Encoding + // ----------------- + public String getSqlFileEncoding() { + return sqlFileEncoding; + } + + // ----------------------------------------------------- + // Bean Enhancer + // ------------- + public BeanEnhancer getBeanEnhancer() { + return beanEnhancer; + } + + public void setBeanEnhancer(final BeanEnhancer beanEnhancer) { + this.beanEnhancer = beanEnhancer; + } + + // ----------------------------------------------------- + // Annotation Reader Factory + // ------------------------- + public void setAnnotationReaderFactory( + org.seasar.dao.AnnotationReaderFactory annotationReaderFactory) { + this.annotationReaderFactory = annotationReaderFactory; + } + + // ----------------------------------------------------- + // Version After 1.0.47 + // -------------------- + public ColumnNaming getColumnNaming() { + return columnNaming; + } + + public void setColumnNaming(final ColumnNaming columnNaming) { + this.columnNaming = columnNaming; + } + + public PropertyTypeFactoryBuilder getPropertyTypeFactoryBuilder() { + return propertyTypeFactoryBuilder; + } + + public void setPropertyTypeFactoryBuilder( + final PropertyTypeFactoryBuilder propertyTypeFactoryBuilder) { + this.propertyTypeFactoryBuilder = propertyTypeFactoryBuilder; + } + + public RelationPropertyTypeFactoryBuilder getRelationPropertyTypeFactoryBuilder() { + return relationPropertyTypeFactoryBuilder; + } + + public void setRelationPropertyTypeFactoryBuilder( + final RelationPropertyTypeFactoryBuilder relationPropertyTypeFactoryBuilder) { + this.relationPropertyTypeFactoryBuilder = relationPropertyTypeFactoryBuilder; + } + + public TableNaming getTableNaming() { + return tableNaming; + } + + public void setTableNaming(final TableNaming tableNaming) { + this.tableNaming = tableNaming; + } + + // ----------------------------------------------------- + // DBFlute Extension + // ----------------- + public StatementConfig getDefaultStatementConfig() { + return _defaultStatementConfig; + } + + public void setDefaultStatementConfig( + final StatementConfig defaultStatementConfig) { + this._defaultStatementConfig = defaultStatementConfig; + } + + public boolean isInternalDebug() { + return _internalDebug; + } + + public void setInternalDebug(final boolean internalDebug) { + this._internalDebug = internalDebug; + } +} Property changes on: announcement/trunk/src/main/java/jp/sf/pal/announcement/db/allcommon/s2dao/S2DaoMetaDataExtension.java ___________________________________________________________________ Name: svn:eol-style + native Added: announcement/trunk/src/main/java/jp/sf/pal/announcement/db/allcommon/s2dao/S2DaoMetaDataFactoryImpl.java =================================================================== --- announcement/trunk/src/main/java/jp/sf/pal/announcement/db/allcommon/s2dao/S2DaoMetaDataFactoryImpl.java (rev 0) +++ announcement/trunk/src/main/java/jp/sf/pal/announcement/db/allcommon/s2dao/S2DaoMetaDataFactoryImpl.java 2008-06-30 02:54:27 UTC (rev 1002) @@ -0,0 +1,522 @@ +package jp.sf.pal.announcement.db.allcommon.s2dao; + +import java.util.HashMap; +import java.util.Map; + +import javax.sql.DataSource; + +import jp.sf.pal.announcement.db.allcommon.DBFluteConfig; +import jp.sf.pal.announcement.db.allcommon.cbean.ConditionBeanContext; +import jp.sf.pal.announcement.db.allcommon.s2dao.internal.sqllog.InternalSqlLogRegistry; + +import org.seasar.dao.AnnotationReaderFactory; +import org.seasar.dao.BeanEnhancer; +import org.seasar.dao.BeanMetaDataFactory; +import org.seasar.dao.ColumnNaming; +import org.seasar.dao.DaoAnnotationReader; +import org.seasar.dao.DaoMetaData; +import org.seasar.dao.DaoMetaDataFactory; +import org.seasar.dao.DaoNamingConvention; +import org.seasar.dao.DtoMetaDataFactory; +import org.seasar.dao.ProcedureMetaDataFactory; +import org.seasar.dao.PropertyTypeFactoryBuilder; +import org.seasar.dao.RelationPropertyTypeFactoryBuilder; +import org.seasar.dao.ResultSetHandlerFactory; +import org.seasar.dao.TableNaming; +import org.seasar.dao.ValueTypeFactory; +import org.seasar.dao.impl.DaoMetaDataImpl; +import org.seasar.dao.pager.PagingSqlRewriter; +import org.seasar.extension.jdbc.ResultSetFactory; +import org.seasar.extension.jdbc.StatementFactory; +import org.seasar.framework.beans.BeanDesc; +import org.seasar.framework.beans.factory.BeanDescFactory; +import org.seasar.framework.util.Disposable; +import org.seasar.framework.util.DisposableUtil; + +/** + * The implementation of DaoMetaDataFactory for DBFlute. + * @author DBFlute(AutoGenerator) + */ +public class S2DaoMetaDataFactoryImpl implements DaoMetaDataFactory, Disposable { + + // =================================================================================== + // Definition + // ========== + /** Log-instance. */ + private static final org.apache.commons.logging.Log _log = org.apache.commons.logging.LogFactory + .getLog(S2DaoMetaDataFactoryImpl.class); + + // ----------------------------------------------------- + // For Logging + // ----------- + /** The binding annotation for xaDataSource. {bindingType=may} */ + public static final String xaDataSource_BINDING = "bindingType=may"; + + // ----------------------------------------------------- + // Factory Basic + // ------------- + public static final String dataSource_BINDING = "bindingType=must"; + + public static final String statementFactory_BINDING = "bindingType=must"; + + public static final String resultSetFactory_BINDING = "bindingType=must"; + + public static final String annotationReaderFactory_BINDING = "bindingType=must"; + + public static final String valueTypeFactory_BINDING = "bindingType=must"; + + public static final String beanMetaDataFactory_BINDING = "bindingType=must"; + + public static final String daoNamingConvention_BINDING = "bindingType=must"; + + public static final String resultSetHandlerFactory_BINDING = "bindingType=must"; + + public static final String dtoMetaDataFactory_BINDING = "bindingType=must"; + + public static final String procedureMetaDataFactory_BINDING = "bindingType=must"; + + public static final String pagingSQLRewriter_BINDING = "bindingType=may"; + + // =================================================================================== + // Attribute + // ========= + // ----------------------------------------------------- + // Factory Basic + // ------------- + protected DataSource dataSource; + + protected StatementFactory statementFactory; + + protected ResultSetFactory resultSetFactory; + + protected AnnotationReaderFactory annotationReaderFactory; + + protected ValueTypeFactory valueTypeFactory; + + protected BeanMetaDataFactory beanMetaDataFactory; + + protected DaoNamingConvention daoNamingConvention; + + protected ResultSetHandlerFactory resultSetHandlerFactory; + + protected DtoMetaDataFactory dtoMetaDataFactory; + + protected ProcedureMetaDataFactory procedureMetaDataFactory; + + protected PagingSqlRewriter pagingSqlRewriter; + + protected Map daoMetaDataCache = new HashMap(); + + protected boolean initialized; + + protected boolean useDaoClassForLog; + + protected String sqlFileEncoding; + + protected BeanEnhancer beanEnhancer; + + // ----------------------------------------------------- + // Version After 1.0.47 + // -------------------- + /** The naming of column. {After S2Dao-1.0.47} */ + protected ColumnNaming columnNaming; + + /** The builder of property type factory. {After S2Dao-1.0.47} */ + protected PropertyTypeFactoryBuilder propertyTypeFactoryBuilder; + + /** The builder of relation property type factory. {After S2Dao-1.0.47} */ + protected RelationPropertyTypeFactoryBuilder relationPropertyTypeFactoryBuilder; + + /** The builder of table naming. {After S2Dao-1.0.47} */ + protected TableNaming tableNaming; + + // ----------------------------------------------------- + // DBFlute Extension + // ----------------- + /** The lock monitor of DAO meta data initialization. */ + protected Object _daoMetaDataInitializationLockMonitor = new Object(); + + // =================================================================================== + // Constructor + // =========== + public S2DaoMetaDataFactoryImpl(javax.sql.DataSource dataSource, + StatementFactory statementFactory, + ResultSetFactory resultSetFactory, + AnnotationReaderFactory annotationReaderFactory, + javax.sql.XADataSource xaDataSource) { + this.dataSource = dataSource; + this.statementFactory = statementFactory; + this.resultSetFactory = resultSetFactory; + this.annotationReaderFactory = annotationReaderFactory; + + _log + .info("/* * * * * * * * * * * * * * * * * * * * * * * * * * * * {DBFlute}"); + showInformation(dataSource, xaDataSource); + + // Stop the LinkageError! + ConditionBeanContext.initialize(); + + initializeDatabaseProductNameOfContext(xaDataSource); + + final StringBuilder sb = new StringBuilder(); + sb.append("{SqlLog Information}").append(getLineSeparator()); + sb.append(" [SqlLogRegistry]").append(getLineSeparator()); + final Object sqlLogRegistry = InternalSqlLogRegistry + .findContainerSqlLogRegistry(); + if (sqlLogRegistry != null) { + InternalSqlLogRegistry.closeRegistration(); + sb + .append( + " SqlLogRegistry(org.seasar.extension.jdbc) is close! It's default for DBFlute.") + .append(getLineSeparator()); + sb + .append(" If you want to use this, set SqlLogRegistry to SqlLogRegistryLocator at yourself."); + } else { + sb + .append(" SqlLogRegistry(org.seasar.extension.jdbc) was not found!"); + } + _log.info(sb); + + DBFluteConfig.getInstance().lock(); + _log.info("* * * * */"); + } + + protected void showInformation(javax.sql.DataSource dataSource, + javax.sql.XADataSource xaDataSource) { + final StringBuilder sb = new StringBuilder(); + if (xaDataSource != null + && xaDataSource instanceof org.seasar.extension.dbcp.impl.XADataSourceImpl) { + final org.seasar.extension.dbcp.impl.XADataSourceImpl xaDataSourceImpl = (org.seasar.extension.dbcp.impl.XADataSourceImpl) xaDataSource; + final String driverClassName = xaDataSourceImpl + .getDriverClassName(); + final String url = xaDataSourceImpl.getURL(); + final String user = xaDataSourceImpl.getUser(); + sb.append(" [XADataSource]:").append(getLineSeparator()); + sb.append(" driver = " + driverClassName).append( + getLineSeparator()); + sb.append(" url = " + url).append(getLineSeparator()); + sb.append(" user = " + user).append(getLineSeparator()); + } + final String statementFactoryExpression = statementFactory != null ? statementFactory + .getClass().getSimpleName() + : "null"; + final String resultSetFactoryExpression = resultSetFactory != null ? resultSetFactory + .getClass().getSimpleName() + : "null"; + sb.append(" [StatementFactory]:").append(getLineSeparator()); + sb.append( + " Injected statementFactory is " + + statementFactoryExpression + + ". But DBFlute uses original statementFactory.") + .append(getLineSeparator()); + sb + .append( + " If the injected statementFactory is ConfigurableStatementFactory, the config is inherited to the original statementFactory.") + .append(getLineSeparator()); + sb.append(" [ResultSetFactory]:").append(getLineSeparator()); + sb.append(" Injected resultSetFactory is " + + resultSetFactoryExpression + + ". But DBFlute uses original resultSetFactory."); + _log.info("{Injection Information}" + getLineSeparator() + sb); + } + + // ----------------------------------------------------- + // Database Product Name + // --------------------- + protected void initializeDatabaseProductNameOfContext( + javax.sql.XADataSource xaDataSource) { + if (getDatabaseProductNameFromContext() != null) { + return; + } + + // From JDBC Driver! + if (xaDataSource != null + && xaDataSource instanceof org.seasar.extension.dbcp.impl.XADataSourceImpl) { + final org.seasar.extension.dbcp.impl.XADataSourceImpl xaDataSourceImpl = (org.seasar.extension.dbcp.impl.XADataSourceImpl) xaDataSource; + final String driverClassName = xaDataSourceImpl + .getDriverClassName(); + if (driverClassName != null) { + if (setupDatabaseProductNameByDriverClassName(driverClassName)) { + _log + .info("...Initializing database product name from driverClassName: " + + getDatabaseProductNameFromContext()); + return; + } + } + } + + _log.info("...Initializing database product name as default: MySql"); + setDatabaseProductNameToContext("MySql"); + } + + protected String getDatabaseProductNameFromContext() { + return ConditionBeanContext.getDatabaseProductName(); + } + + protected void setDatabaseProductNameToContext(String name) { + ConditionBeanContext.setDatabaseProductName(name); + } + + protected boolean setupDatabaseProductNameByDriverClassName( + String driverClassName) { + return ConditionBeanContext + .setupDatabaseProductNameByDriverClassName(driverClassName); + } + + // =================================================================================== + // Implementation + // ============== + @SuppressWarnings("unchecked") + public DaoMetaData getDaoMetaData(final Class daoClass) { + if (!initialized) { + DisposableUtil.add(this); + initialized = true; + } + final String key = daoClass.getName(); + + // [A] + DaoMetaData dmd = getSynchronizedDaoMetaDataCache(key); + + // [B] + if (dmd != null) { + return dmd; + } + + // [C] + synchronized (_daoMetaDataInitializationLockMonitor) {// One Thread Only Entered + // [D] + dmd = getSynchronizedDaoMetaDataCache(key); + // [E] + if (dmd != null) { + // The second thread that stops at [C] can find + // because the first thread have already initialized. + if (_log.isDebugEnabled()) { + _log + .debug("...Getting daoMetaData as cache because the previous thread have already initilized."); + } + return dmd; + } + // [F] + if (_log.isDebugEnabled()) { + _log.debug("...Creating daoMetaData."); + } + final DaoMetaData dmdi = createDaoMetaData(daoClass); + putSynchronizedDaoMetaDataCache(key, dmdi); + } + // [G] + dmd = getSynchronizedDaoMetaDataCache(key); + if (dmd != null) { + return dmd; + } + String msg = "The cache should have data meta data here: key=" + key + + " cache=" + daoMetaDataCache; + throw new IllegalStateException(msg); + } + + @SuppressWarnings("unchecked") + protected void putSynchronizedDaoMetaDataCache(String key, DaoMetaData dmd) { + synchronized (daoMetaDataCache) { + daoMetaDataCache.put(key, dmd); + } + } + + protected DaoMetaData getSynchronizedDaoMetaDataCache(String key) { + DaoMetaData dmd = null; + synchronized (daoMetaDataCache) { + dmd = (DaoMetaData) daoMetaDataCache.get(key); + } + return dmd; + } + + // =================================================================================== + // DataMetaData Creation + // ===================== + protected DaoMetaData createDaoMetaData(final Class daoClass) { + final BeanDesc daoBeanDesc = BeanDescFactory.getBeanDesc(daoClass); + final DaoAnnotationReader daoAnnotationReader = annotationReaderFactory + .createDaoAnnotationReader(daoBeanDesc); + + final DaoMetaDataImpl daoMetaData = createDaoMetaDataExtension(); + daoMetaData.setDaoClass(daoClass); + daoMetaData.setDataSource(dataSource); + daoMetaData.setStatementFactory(statementFactory); + daoMetaData.setResultSetFactory(resultSetFactory); + daoMetaData.setValueTypeFactory(valueTypeFactory); + daoMetaData.setBeanMetaDataFactory(getBeanMetaDataFactory()); + daoMetaData.setDaoNamingConvention(getDaoNamingConvention()); + daoMetaData.setUseDaoClassForLog(useDaoClassForLog); + daoMetaData.setDaoAnnotationReader(daoAnnotationReader); + daoMetaData.setProcedureMetaDataFactory(procedureMetaDataFactory); + daoMetaData.setDtoMetaDataFactory(dtoMetaDataFactory); + daoMetaData.setResultSetHandlerFactory(resultSetHandlerFactory); + if (sqlFileEncoding != null) { + daoMetaData.setSqlFileEncoding(sqlFileEncoding); + } + if (pagingSqlRewriter != null) { + daoMetaData.setPagingSQLRewriter(pagingSqlRewriter); + } + daoMetaData.initialize(); + return daoMetaData; + } + + protected S2DaoMetaDataExtension createDaoMetaDataExtension() {// Override! + final S2DaoMetaDataExtension dmdExtension = newDaoMetaDataExtension(); + dmdExtension.setBeanEnhancer(beanEnhancer); + dmdExtension.setAnnotationReaderFactory(this.annotationReaderFactory); + dmdExtension.setColumnNaming(this.columnNaming); + dmdExtension + .setPropertyTypeFactoryBuilder(this.propertyTypeFactoryBuilder); + dmdExtension + .setRelationPropertyTypeFactoryBuilder(this.relationPropertyTypeFactoryBuilder); + dmdExtension.setTableNaming(tableNaming); + dmdExtension.setDefaultStatementConfig(DBFluteConfig.getInstance() + .getDefaultStatementConfig()); + dmdExtension.setInternalDebug(DBFluteConfig.getInstance() + .isInternalDebug()); + return dmdExtension; + } + + protected S2DaoMetaDataExtension newDaoMetaDataExtension() { + return new S2DaoMetaDataExtension(); + } + + // =================================================================================== + // Dispose + // ======= + public synchronized void dispose() { + daoMetaDataCache.clear(); + initialized = false; + } + + // =================================================================================== + // Helper + // ====== + /** + * Get the value of line separator. + * @return The value of line separator. (NotNull) + */ + protected static String getLineSeparator() { + return System.getProperty("line.separator"); + } + + // =================================================================================== + // Accessor + // ======== + // ----------------------------------------------------- + // Factory Basic + // ------------- + public void setValueTypeFactory(final ValueTypeFactory valueTypeFactory) { + this.valueTypeFactory = valueTypeFactory; + } + + protected BeanMetaDataFactory getBeanMetaDataFactory() { + return beanMetaDataFactory; + } + + public void setBeanMetaDataFactory( + final BeanMetaDataFactory beanMetaDataFactory) { + this.beanMetaDataFactory = beanMetaDataFactory; + } + + public DaoNamingConvention getDaoNamingConvention() { + return daoNamingConvention; + } + + public void setDaoNamingConvention( + final DaoNamingConvention daoNamingConvention) { + this.daoNamingConvention = daoNamingConvention; + } + + public void setAnnotationReaderFactory( + final AnnotationReaderFactory annotationReaderFactory) { + this.annotationReaderFactory = annotationReaderFactory; + } + + public void setDataSource(final DataSource dataSource) { + this.dataSource = dataSource; + } + + public void setResultSetFactory(final ResultSetFactory resultSetFactory) { + this.resultSetFactory = resultSetFactory; + } + + public void setStatementFactory(final StatementFactory statementFactory) { + this.statementFactory = statementFactory; + } + + public void setUseDaoClassForLog(final boolean userDaoClassForLog) { + useDaoClassForLog = userDaoClassForLog; + } + + public void setResultSetHandlerFactory( + final ResultSetHandlerFactory resultSetHandlerFactory) { + this.resultSetHandlerFactory = resultSetHandlerFactory; + } + + public void setDtoMetaDataFactory( + final DtoMetaDataFactory dtoMetaDataFactory) { + this.dtoMetaDataFactory = dtoMetaDataFactory; + } + + public void setProcedureMetaDataFactory( + ProcedureMetaDataFactory procedureMetaDataFactory) { + this.procedureMetaDataFactory = procedureMetaDataFactory; + } + + public void setPagingSQLRewriter(final PagingSqlRewriter pagingSqlRewriter) { + this.pagingSqlRewriter = pagingSqlRewriter; + } + + public String getSqlFileEncoding() { + return sqlFileEncoding; + } + + public void setSqlFileEncoding(final String encoding) { + sqlFileEncoding = encoding; + } + + public BeanEnhancer getBeanEnhancer() { + return beanEnhancer; + } + + public void setBeanEnhancer(final BeanEnhancer beanEnhancer) { + this.beanEnhancer = beanEnhancer; + } + + // ----------------------------------------------------- + // Version After 1.0.47 + // -------------------- + public ColumnNaming getColumnNaming() { + return columnNaming; + } + + public void setColumnNaming(final ColumnNaming columnNaming) { + this.columnNaming = columnNaming; + } + + public PropertyTypeFactoryBuilder getPropertyTypeFactoryBuilder() { + return propertyTypeFactoryBuilder; + } + + public void setPropertyTypeFactoryBuilder( + final PropertyTypeFactoryBuilder propertyTypeFactoryBuilder) { + this.propertyTypeFactoryBuilder = propertyTypeFactoryBuilder; + } + + public RelationPropertyTypeFactoryBuilder getRelationPropertyTypeFactoryBuilder() { + return relationPropertyTypeFactoryBuilder; + } + + public void setRelationPropertyTypeFactoryBuilder( + final RelationPropertyTypeFactoryBuilder relationPropertyTypeFactoryBuilder) { + this.relationPropertyTypeFactoryBuilder = relationPropertyTypeFactoryBuilder; + } + + public TableNaming getTableNaming() { + return tableNaming; + } + + public void setTableNaming(final TableNaming tableNaming) { + this.tableNaming = tableNaming; + } +} \ No newline at end of file Property changes on: announcement/trunk/src/main/java/jp/sf/pal/announcement/db/allcommon/s2dao/S2DaoMetaDataFactoryImpl.java ___________________________________________________________________ Name: svn:eol-style + native Added: announcement/trunk/src/main/java/jp/sf/pal/announcement/db/allcommon/s2dao/S2DaoPropertyTypeFactoryBuilderExtension.java =================================================================== --- announcement/trunk/src/main/java/jp/sf/pal/announcement/db/allcommon/s2dao/S2DaoPropertyTypeFactoryBuilderExtension.java (rev 0) +++ announcement/trunk/src/main/java/jp/sf/pal/announcement/db/allcommon/s2dao/S2DaoPropertyTypeFactoryBuilderExtension.java 2008-06-30 02:54:27 UTC (rev 1002) @@ -0,0 +1,136 @@ +package jp.sf.pal.announcement.db.allcommon.s2dao; + +import java.sql.DatabaseMetaData; +import java.util.ArrayList; +import java.util.List; + +import jp.sf.pal.announcement.db.allcommon.Entity; +import jp.sf.pal.announcement.db.allcommon.dbmeta.DBMeta; + +import org.seasar.dao.BeanAnnotationReader; +import org.seasar.dao.ColumnNaming; +import org.seasar.dao.DaoNamingConvention; +import org.seasar.dao.Dbms; +import org.seasar.dao.PropertyTypeFactory; +import org.seasar.dao.ValueTypeFactory; +import org.seasar.dao.impl.FastPropertyTypeFactory; +import org.seasar.dao.impl.FastPropertyTypeFactoryBuilder; +import org.seasar.extension.jdbc.PropertyType; +import org.seasar.framework.beans.BeanDesc; +import org.seasar.framework.beans.PropertyDesc; + +/** + * The factory builder of property type for S2Dao. {Since S2Dao-1.0.47}
    + * + * @author DBFlute(AutoGenerator) + */ + @ SuppressWarnings("unchecked") +public class S2DaoPropertyTypeFactoryBuilderExtension extends + FastPropertyTypeFactoryBuilder { + + @Override + public PropertyTypeFactory build(Class beanClass, + BeanAnnotationReader beanAnnotationReader) { + return new FastPropertyTypeFactoryExtension(beanClass, + beanAnnotationReader, valueTypeFactory, columnNaming); + } + + @Override + public PropertyTypeFactory build(Class beanClass, + BeanAnnotationReader beanAnnotationReader, Dbms dbms, + DatabaseMetaData databaseMetaData) { + return new FastPropertyTypeFactoryExtension(beanClass, + beanAnnotationReader, valueTypeFactory, columnNaming, + daoNamingConvention, dbms); + } + + protected static class FastPropertyTypeFactoryExtension extends + FastPropertyTypeFactory { + + protected DBMeta _dbmeta; + + public FastPropertyTypeFactoryExtension(Class beanClass, + BeanAnnotationReader beanAnnotationReader, + ValueTypeFactory valueTypeFactory, ColumnNaming columnNaming) { + super(beanClass, beanAnnotationReader, valueTypeFactory, + columnNaming); + if (isEntity()) { + _dbmeta = findDBMeta(); + } + } + + public FastPropertyTypeFactoryExtension(Class beanClass, + BeanAnnotationReader beanAnnotationReader, + ValueTypeFactory valueTypeFactory, ColumnNaming columnNaming, + DaoNamingConvention daoNamingConvention, Dbms dbms) { + super(beanClass, beanAnnotationReader, valueTypeFactory, + columnNaming, daoNamingConvention, dbms); + if (isEntity()) { + _dbmeta = findDBMeta(); + } + } + + protected boolean isEntity() { + return Entity.class.isAssignableFrom(beanClass); + } + + protected DBMeta findDBMeta() { + try { + final Entity entity = (Entity) beanClass.newInstance(); + return entity.getDBMeta(); + } catch (Exception e) { + String msg = "beanClass.newInstance() threw the exception: beanClass=" + + beanClass; + throw new RuntimeException(msg, e); + } + } + + @Override + protected boolean isPrimaryKey(PropertyDesc propertyDesc) { + if (isEntity() && _dbmeta.hasPrimaryKey() + && _dbmeta.hasColumn(propertyDesc.getPropertyName())) { + if (_dbmeta.findColumnInfo(propertyDesc.getPropertyName()) + .isPrimary()) { + return true; + } + } + return super.isPrimaryKey(propertyDesc); + } + + @Override + public PropertyType[] createBeanPropertyTypes(String tableName) { + final List list = new ArrayList(); + final BeanDesc beanDesc = getBeanDesc(); + for (int i = 0; i < beanDesc.getPropertyDescSize(); ++i) { + final PropertyDesc pd = beanDesc.getPropertyDesc(i); + + // Read-only property is unnecessary! {Extension of S2Dao} + if (!pd.hasWriteMethod()) { + continue; + } + + if (isRelation(pd)) { + continue; + } + final PropertyType pt = createPropertyType(pd); + pt.setPrimaryKey(isPrimaryKey(pd)); + pt.setPersistent(isPersistent(pt)); + list.add(pt); + } + return list.toArray(new PropertyType[list.size()]); + } + + @Override + protected boolean isPersistent(PropertyType propertyType) { + // - - - - - - - - - - - - - - - - - - - - - - - - - - - - + // The columns that has column annotation are persistent. + // - - - - - - - - - - - - - - - - - - - - - - - - - - - - + if (beanAnnotationReader.getColumnAnnotation(propertyType + .getPropertyDesc()) == null) { + return false; + } + + return super.isPersistent(propertyType); + } + } +} Property changes on: announcement/trunk/src/main/java/jp/sf/pal/announcement/db/allcommon/s2dao/S2DaoPropertyTypeFactoryBuilderExtension.java ___________________________________________________________________ Name: svn:eol-style + native Added: announcement/trunk/src/main/java/jp/sf/pal/announcement/db/allcommon/s2dao/S2DaoSelectDynamicCommand.java =================================================================== --- announcement/trunk/src/main/java/jp/sf/pal/announcement/db/allcommon/s2dao/S2DaoSelectDynamicCommand.java (rev 0) +++ announcement/trunk/src/main/java/jp/sf/pal/announcement/db/allcommon/s2dao/S2DaoSelectDynamicCommand.java 2008-06-30 02:54:27 UTC (rev 1002) @@ -0,0 +1,545 @@ +package jp.sf.pal.announcement.db.allcommon.s2dao; + +import java.util.ArrayList; +import java.util.List; + +import javax.sql.DataSource; + +import jp.sf.pal.announcement.db.allcommon.cbean.ConditionBean; +import jp.sf.pal.announcement.db.allcommon.cbean.ConditionBeanContext; +import jp.sf.pal.announcement.db.allcommon.cbean.outsidesql.OutsideSqlContext; +import jp.sf.pal.announcement.db.allcommon.s2dao.internal.sqlcommand.InternalAbstractDynamicCommand; +import jp.sf.pal.announcement.db.allcommon.s2dao.internal.sqlhandler.InternalBasicSelectHandler; + +import org.seasar.dao.CommandContext; +import org.seasar.extension.jdbc.ResultSetFactory; +import org.seasar.extension.jdbc.ResultSetHandler; +import org.seasar.extension.jdbc.StatementFactory; +import org.seasar.extension.jdbc.ValueType; +import org.seasar.extension.jdbc.types.ValueTypes; +import org.seasar.framework.beans.BeanDesc; +import org.seasar.framework.beans.PropertyDesc; +import org.seasar.framework.beans.factory.BeanDescFactory; +import org.seasar.framework.exception.SQLRuntimeException; + +/** + * SelectDynamicCommand for DBFlute. + * + * @author DBFlute(AutoGenerator) + */ + @ SuppressWarnings("unchecked") +public class S2DaoSelectDynamicCommand extends InternalAbstractDynamicCommand { + + // =================================================================================== + // Attribute + // ========= + /** The handler of resultSet. */ + protected ResultSetHandler resultSetHandler; + + /** The factory of resultSet. */ + protected ResultSetFactory resultSetFactory; + + // =================================================================================== + // Constructor + // =========== + /** + * Constructor. + * + * @param dataSource Data source. + * @param statementFactory The factory of statement. + * @param resultSetHandler The handler of resultSet. + * @param resultSetFactory The factory of resultSet. + */ + public S2DaoSelectDynamicCommand(DataSource dataSource, + StatementFactory statementFactory, + ResultSetHandler resultSetHandler, ResultSetFactory resultSetFactory) { + super(dataSource, statementFactory); + this.resultSetHandler = resultSetHandler; + this.resultSetFactory = resultSetFactory; + } + + // =================================================================================== + // Very Important Extension + // ======================== + // ----------------------------------------------------- + // SelectDynamicCommand Creation + // ----------------------------- + protected S2DaoSelectDynamicCommand createMySelectDynamicCommand() { + return new S2DaoSelectDynamicCommand(getDataSource(), + getStatementFactory(), resultSetHandler, resultSetFactory); + } + + // =================================================================================== + // Execute + // ======= + // ----------------------------------------------------- + // Top Execute + // ----------- + /** + * The override for extension. + * + * @param args The array of argument. (Nullable) + * @return Result. (Nullable) + */ + public Object execute(Object[] args) { + // - - - - - - - - - - - - + // This is top execution. + // - - - - - - - - - - - - + + if (!ConditionBeanContext.isExistConditionBeanOnThread()) { + // - - - - - - - - - - + // Execute outsideSql. + // - - - - - - - - - - + if (OutsideSqlContext.isExistOutsideSqlContextOnThread()) { + final OutsideSqlContext outsideSqlContext = OutsideSqlContext + .getOutsideSqlContextOnThread(); + if (outsideSqlContext.isDynamicBinding()) { + return executeOutsideSqlAsDynamic(args, outsideSqlContext); + } else { + return executeOutsideSqlAsStatic(args, outsideSqlContext); + } + } + + // - - - - - - - - - + // Execute default. + // - - - - - - - - - + return executeDefault(args); + } + + // - - - - - - - - - - - - + // Execute conditionBean. + // - - - - - - - - - - - - + final List bindVariableList = new ArrayList(4); + final List bindVariableTypeList = new ArrayList(4); + + final ConditionBean cb = ConditionBeanContext + .getConditionBeanOnThread(); + final String finalClause; + if (cb.hasUnionQueryOrUnionAllQuery()) { + final String realClause = setupRealClause(args, bindVariableList, + bindVariableTypeList); + if (cb.isSelectCountIgnoreFetchScope()) { + // If the query uses union and it selects count, the way of select-count is as follows. + finalClause = "select count(*) from (" + realClause + + ") dfmain"; + } else { + finalClause = realClause; + } + } else { + if (cb.isSelectCountIgnoreFetchScope()) { + finalClause = setupRealSelectCountClause(args, + bindVariableList, bindVariableTypeList); + } else { + finalClause = setupRealClause(args, bindVariableList, + bindVariableTypeList); + } + } + + final InternalBasicSelectHandler selectHandler = createBasicSelectHandler( + finalClause, this.resultSetHandler); + return selectHandler.execute(bindVariableList.toArray(), + toClassArray(bindVariableTypeList)); + } + + // ----------------------------------------------------- + // Default Execute + // --------------- + /** + * Execute default. + * + * @param args The array of argument. (Nullable) + * @return Result. (Nullable) + */ + protected Object executeDefault(Object args[]) { + // - - - - - - - - - - - - - - - - - + // Find specified resultSetHandler. + // - - - - - - - - - - - - - - - - - + final ResultSetHandler specifiedResultSetHandler = findSpecifiedResultSetHandler(args); + + // - - - - - - - - - + // Filter arguments. + // - - - - - - - - - + final Object[] filteredArgs = filterArgumentsForResultSetHandler(args); + + final org.seasar.dao.CommandContext ctx = apply(filteredArgs); + final InternalBasicSelectHandler selectHandler = createBasicSelectHandler( + ctx.getSql(), specifiedResultSetHandler); + return selectHandler.execute(ctx.getBindVariables(), ctx + .getBindVariableTypes()); + } + + // ----------------------------------------------------- + // OutsideSql Execute + // ------------------ + /** + * Execute outsideSql as static. + * + * @param args The array of argument. (Nullable) + * @param outsideSqlContext The context of outsideSql. (NotNull) + * @return Result. (Nullable) + */ + protected Object executeOutsideSqlAsStatic(Object[] args, + OutsideSqlContext outsideSqlContext) { + // - - - - - - - - - - - - - - - - - + // Find specified resultSetHandler. + // - - - - - - - - - - - - - - - - - + final ResultSetHandler specifiedResultSetHandler = findSpecifiedResultSetHandler(args); + + // - - - - - - - - - + // Filter arguments. + // - - - - - - - - - + final Object[] filteredArgs; + if (outsideSqlContext.isSpecifiedOutsideSql()) { + final Object parameterBean = outsideSqlContext.getParameterBean(); + filteredArgs = new Object[] { parameterBean }; + } else { + filteredArgs = filterArgumentsForResultSetHandler(args); + } + + final org.seasar.dao.CommandContext ctx = apply(filteredArgs); + final InternalBasicSelectHandler selectHandler = createBasicSelectHandler( + ctx.getSql(), specifiedResultSetHandler); + return selectHandler.execute(ctx.getBindVariables(), ctx + .getBindVariableTypes()); + } + + /** + * Execute outsideSql as Dynamic. + * + * @param args The array of argument. (Nullable) + * @param outsideSqlContext The context of outsideSql. (NotNull) + * @return Result. (Nullable) + */ + protected Object executeOutsideSqlAsDynamic(Object[] args, + OutsideSqlContext outsideSqlContext) { + final Object firstArg = args[0]; + final BeanDesc beanDesc = BeanDescFactory.getBeanDesc(firstArg + .getClass()); + String filteredSql = getSql(); + + // - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - + // Resolve embedded comment for parsing bind variable comment in embedded comment. + // - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - + for (int i = 0; i < beanDesc.getPropertyDescSize(); i++) { + final PropertyDesc propertyDesc = beanDesc.getPropertyDesc(i); + final Class propertyType = propertyDesc.getPropertyType(); + if (!propertyType.equals(String.class)) { + continue; + } + final String outsideSqlPiece = (String) propertyDesc + .getValue(firstArg); + if (outsideSqlPiece == null) { + continue; + } + final String embeddedComment = "/*$pmb." + + propertyDesc.getPropertyName() + "*/"; + filteredSql = InternalStringUtil.replace(filteredSql, + embeddedComment, outsideSqlPiece); + } + final S2DaoSelectDynamicCommand outsideSqlCommand = createMySelectDynamicCommand(); + outsideSqlCommand.setArgNames(getArgNames()); + outsideSqlCommand.setArgTypes(getArgTypes()); + outsideSqlCommand.setSql(filteredSql); + + // - - - - - - - - - - - - - - - - - + // Find specified resultSetHandler. + // - - - - - - - - - - - - - - - - - + final ResultSetHandler specifiedResultSetHandler = findSpecifiedResultSetHandler(args); + + // - - - - - - - - - + // Filter arguments. + // - - - - - - - - - + final Object[] filteredArgs; + if (outsideSqlContext.isSpecifiedOutsideSql()) { + final Object parameterBean = outsideSqlContext.getParameterBean(); + filteredArgs = new Object[] { parameterBean }; + } else { + filteredArgs = filterArgumentsForResultSetHandler(args); + } + + final org.seasar.dao.CommandContext ctx = outsideSqlCommand + .apply(filteredArgs); + final java.util.List bindVariableList = new java.util.ArrayList(); + final java.util.List bindVariableTypeList = new java.util.ArrayList(); + addBindVariableInfo(ctx, bindVariableList, bindVariableTypeList); + final InternalBasicSelectHandler selectHandler = createBasicSelectHandler( + ctx.getSql(), specifiedResultSetHandler); + return selectHandler.execute(bindVariableList.toArray(), + toClassArray(bindVariableTypeList)); + } + + protected Object[] filterArgumentsForResultSetHandler(Object[] args) { + if (args == null || args.length == 0) { + return args; + } + final Object[] filteredArgs; + if (args[args.length - 1] instanceof jp.sf.pal.announcement.db.allcommon.jdbc.CursorHandler) { + filteredArgs = new Object[args.length - 1]; + for (int i = 0; i < args.length - 1; i++) { + filteredArgs[i] = args[i]; + } + } else { + filteredArgs = args; + } + return filteredArgs; + } + + protected ResultSetHandler findSpecifiedResultSetHandler(Object[] args) { + if (args == null || args.length == 0) { + return this.resultSetHandler; + } + if (args[args.length - 1] instanceof jp.sf.pal.announcement.db.allcommon.jdbc.CursorHandler) { + final jp.sf.pal.announcement.db.allcommon.jdbc.CursorHandler cursorHandler = (jp.sf.pal.announcement.db.allcommon.jdbc.CursorHandler) args[args.length - 1]; + return new ResultSetHandler() { + public Object handle(java.sql.ResultSet rs) + throws java.sql.SQLException { + return cursorHandler.handle(rs); + } + }; + } + if (getArgTypes().length + 1 == args.length + && args[args.length - 1] == null) { + String msg = "System Level Exception!" + getLineSeparator(); + msg = msg + + "/* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * *" + + getLineSeparator(); + msg = msg + + "The size of arg types have not been same as the size of arg objects:"; + msg = msg + " argTypes=" + getArgTypes().length + " args=" + + args.length + getLineSeparator(); + msg = msg + + "If the arguments contain ResultSetHandler, the argument value should not be null!" + + getLineSeparator(); + for (int i = 0; i < args.length - 1; i++) { + msg = msg + " args[" + i + "] -- " + args[i] + + getLineSeparator(); + } + msg = msg + "* * * * * * * * * */" + getLineSeparator(); + throw new IllegalStateException(msg); + } + return this.resultSetHandler; + } + + // ----------------------------------------------------- + // Setup Clause + // ------------ + protected String setupRealClause(Object[] args, + List bindVariableList, List bindVariableTypeList) { + final ConditionBean cb = ConditionBeanContext + .getConditionBeanOnThread(); + final String realClause; + { + final S2DaoSelectDynamicCommand dynamicCommand = createMySelectDynamicCommand(); + dynamicCommand.setArgNames(getArgNames()); + dynamicCommand.setArgTypes(getArgTypes()); + if (cb.isLimitSelect_PKOnly()) { + dynamicCommand.setSql(cb.getSqlClause().getClausePKOnly()); + } else { + dynamicCommand.setSql(cb.getSqlClause().getClause()); + } + final CommandContext ctx = dynamicCommand.apply(args); + realClause = ctx.getSql(); + addBindVariableInfo(ctx, bindVariableList, bindVariableTypeList); + } + return realClause; + } + + protected String setupRealSelectCountClause(Object[] args, + List bindVariableList, List bindVariableTypeList) { + final ConditionBean cb = ConditionBeanContext + .getConditionBeanOnThread(); + final String realSelectCountClause; + { + final S2DaoSelectDynamicCommand selectCountCommand = createMySelectDynamicCommand(); + selectCountCommand.setArgNames(getArgNames()); + selectCountCommand.setArgTypes(getArgTypes()); + final String selectClause = "select count(*)"; + String fromWhereClause = cb.getSqlClause() + .getClauseFromWhereWithUnionTemplate(); + + // Replace template marks. These are very important! + fromWhereClause = replaceString(fromWhereClause, cb.getSqlClause() + .getUnionSelectClauseMark(), selectClause); + fromWhereClause = replaceString(fromWhereClause, cb.getSqlClause() + .getUnionWhereClauseMark(), ""); + fromWhereClause = replaceString(fromWhereClause, cb.getSqlClause() + .getUnionWhereFirstConditionMark(), ""); + + selectCountCommand.setSql(selectClause + " " + fromWhereClause); + + final CommandContext ctx = selectCountCommand.apply(args); + realSelectCountClause = ctx.getSql(); + addBindVariableInfo(ctx, bindVariableList, bindVariableTypeList); + } + return realSelectCountClause; + } + + protected InternalBasicSelectHandler createBasicSelectHandler( + String realSql, ResultSetHandler specifiedResultSetHandler) { + final InternalBasicSelectHandler selectHandler = newBasicSelectHandler( + realSql, specifiedResultSetHandler, getStatementFactory(), + resultSetFactory); + selectHandler.setFetchSize(-1); + return selectHandler; + } + + protected InternalBasicSelectHandler newBasicSelectHandler(String sql, + ResultSetHandler resultSetHandler, + StatementFactory statementFactory, ResultSetFactory resultSetFactory) { + return new InternalBasicSelectHandler(getDataSource(), sql, + resultSetHandler, statementFactory, resultSetFactory) { + @Override + protected void bindArgs(java.sql.PreparedStatement ps, + Object[] args, Class[] argTypes) { + if (args == null) { + return; + } + for (int i = 0; i < args.length; ++i) { + final ValueType valueType = findValueType(argTypes[i], + args[i]); + try { + valueType.bindValue(ps, i + 1, args[i]); + } catch (java.sql.SQLException ex) { + throw new SQLRuntimeException(ex); + } + } + } + + protected ValueType findValueType(Class argType, Object arg) { + ValueType valueType = ValueTypes.getValueType(arg); + if (valueType != null) { + return valueType; + } + valueType = ValueTypes.getValueType(argType); + if (valueType != null) { + return valueType; + } + String msg = "Unknown type:argType=" + argType + " args=" + arg; + throw new IllegalStateException(msg); + } + }; + } + + // ----------------------------------------------------- + // Setup Helper + // ------------ + protected Class[] toClassArray(List bindVariableTypeList) { + final Class[] bindVariableTypesArray = new Class[bindVariableTypeList + .size()]; + for (int i = 0; i < bindVariableTypeList.size(); i++) { + final Class bindVariableType = (Class) bindVariableTypeList.get(i); + bindVariableTypesArray[i] = bindVariableType; + } + return bindVariableTypesArray; + } + + protected void addBindVariableInfo(CommandContext ctx, + List bindVariableList, List bindVariableTypeList) { + final Object[] bindVariables = ctx.getBindVariables(); + addBindVariableList(bindVariableList, bindVariables); + final Class[] bindVariableTypes = ctx.getBindVariableTypes(); + addBindVariableTypeList(bindVariableTypeList, bindVariableTypes); + } + + protected void addBindVariableList(List bindVariableList, + Object[] bindVariables) { + for (int i = 0; i < bindVariables.length; i++) { + bindVariableList.add(bindVariables[i]); + } + } + + protected void addBindVariableTypeList(List bindVariableTypeList, + Class[] bindVariableTypes) { + for (int i = 0; i < bindVariableTypes.length; i++) { + bindVariableTypeList.add(bindVariableTypes[i]); + } + } + + // =================================================================================== + // Helper + // ====== + /** + * Get the value of line separator. + * + * @return The value of line separator. (NotNull) + */ + protected String getLineSeparator() { + return System.getProperty("line.separator"); + } + + protected final String replaceString(String text, String fromText, + String toText) { + if (text == null || fromText == null || toText == null) + return null; + StringBuffer buf = new StringBuffer(100); + int pos = 0; + int pos2 = 0; + do { + pos = text.indexOf(fromText, pos2); + if (pos == 0) { + buf.append(toText); + pos2 = fromText.length(); + } else if (pos > 0) { + buf.append(text.substring(pos2, pos)); + buf.append(toText); + pos2 = pos + fromText.length(); + } else { + buf.append(text.substring(pos2)); + return buf.toString(); + } + } while (true); + } + + // ----------------------------------------------------- + // StringUtil + // ---------- + protected static class InternalStringUtil { + + public static final String[] EMPTY_STRINGS = new String[0]; + + private InternalStringUtil() { + } + + public static final boolean isEmpty(String text) { + return text == null || text.length() == 0; + } + + public static final String replace(String text, String fromText, + String toText) { + if (text == null || fromText == null || toText == null) { + return null; + } + StringBuffer buf = new StringBuffer(100); + int pos = 0; + int pos2 = 0; + while (true) { + pos = text.indexOf(fromText, pos2); + if (pos == 0) { + buf.append(toText); + pos2 = fromText.length(); + } else if (pos > 0) { + buf.append(text.substring(pos2, pos)); + buf.append(toText); + pos2 = pos + fromText.length(); + } else { + buf.append(text.substring(pos2)); + break; + } + } + return buf.toString(); + } + + public static String[] split(String str, String delim) { + if (str == null) { + return EMPTY_STRINGS; + } + java.util.List list = new java.util.ArrayList(); + java.util.StringTokenizer st = new java.util.StringTokenizer(str, + delim); + while (st.hasMoreElements()) { + list.add(st.nextToken()); + } + return (String[]) list.toArray(new String[list.size()]); + } + } +} \ No newline at end of file Property changes on: announcement/trunk/src/main/java/jp/sf/pal/announcement/db/allcommon/s2dao/S2DaoSelectDynamicCommand.java ___________________________________________________________________ Name: svn:eol-style + native Added: announcement/trunk/src/main/java/jp/sf/pal/announcement/db/allcommon/s2dao/internal/rshandler/InternalBeanArrayMetaDataResultSetHandler.java =================================================================== --- announcement/trunk/src/main/java/jp/sf/pal/announcement/db/allcommon/s2dao/internal/rshandler/InternalBeanArrayMetaDataResultSetHandler.java (rev 0) +++ announcement/trunk/src/main/java/jp/sf/pal/announcement/db/allcommon/s2dao/internal/rshandler/InternalBeanArrayMetaDataResultSetHandler.java 2008-06-30 02:54:27 UTC (rev 1002) @@ -0,0 +1,40 @@ +package jp.sf.pal.announcement.db.allcommon.s2dao.internal.rshandler; + +import java.lang.reflect.Array; +import java.sql.ResultSet; +import java.sql.SQLException; +import java.util.List; + +import org.seasar.dao.BeanMetaData; +import org.seasar.dao.RelationRowCreator; +import org.seasar.dao.RowCreator; + +/** + * @author DBFlute(AutoGenerator) + */ + @ SuppressWarnings("unchecked") +public class InternalBeanArrayMetaDataResultSetHandler extends + InternalBeanListMetaDataResultSetHandler { + + // =================================================================================== + // Constructor + // =========== + /** + * @param beanMetaData Bean meta data. (NotNull) + * @param rowCreator Row creator. (NotNull) + * @param relationRowCreator Relation row creator. (NotNul) + */ + public InternalBeanArrayMetaDataResultSetHandler(BeanMetaData beanMetaData, + RowCreator rowCreator, RelationRowCreator relationRowCreator) { + super(beanMetaData, rowCreator, relationRowCreator); + } + + // =================================================================================== + // Handle + // ====== + public Object handle(ResultSet rs) throws SQLException { + List list = (List) super.handle(rs); + return list.toArray((Object[]) Array.newInstance(getBeanMetaData() + .getBeanClass(), list.size())); + } +} Property changes on: announcement/trunk/src/main/java/jp/sf/pal/announcement/db/allcommon/s2dao/internal/rshandler/InternalBeanArrayMetaDataResultSetHandler.java ___________________________________________________________________ Name: svn:eol-style + native Added: announcement/trunk/src/main/java/jp/sf/pal/announcement/db/allcommon/s2dao/internal/rshandler/InternalBeanListMetaDataResultSetHandler.java =================================================================== --- announcement/trunk/src/main/java/jp/sf/pal/announcement/db/allcommon/s2dao/internal/rshandler/InternalBeanListMetaDataResultSetHandler.java (rev 0) +++ announcement/trunk/src/main/java/jp/sf/pal/announcement/db/allcommon/s2dao/internal/rshandler/InternalBeanListMetaDataResultSetHandler.java 2008-06-30 02:54:27 UTC (rev 1002) @@ -0,0 +1,149 @@ +package jp.sf.pal.announcement.db.allcommon.s2dao.internal.rshandler; + +import java.sql.ResultSet; +import java.sql.SQLException; +import java.util.ArrayList; +import java.util.HashMap; +import java.util.List; +import java.util.Map; +import java.util.Set; + +import org.seasar.dao.BeanMetaData; +import org.seasar.dao.RelationPropertyType; +import org.seasar.dao.RelationRowCreator; +import org.seasar.dao.RowCreator; +import org.seasar.dao.impl.AbstractBeanMetaDataResultSetHandler; +import org.seasar.dao.impl.RelationKey; +import org.seasar.dao.impl.RelationRowCache; +import org.seasar.extension.jdbc.PropertyType; +import org.seasar.extension.jdbc.ValueType; +import org.seasar.framework.beans.PropertyDesc; + +/** + * @author DBFlute(AutoGenerator) + */ + @ SuppressWarnings("unchecked") +public class InternalBeanListMetaDataResultSetHandler extends + AbstractBeanMetaDataResultSetHandler { + + // =================================================================================== + // Constructor + // =========== + /** + * @param beanMetaData Bean meta data. (NotNull) + * @param rowCreator Row creator. (NotNull) + * @param relationRowCreator Relation row creator. (NotNul) + */ + public InternalBeanListMetaDataResultSetHandler(BeanMetaData beanMetaData, + RowCreator rowCreator, RelationRowCreator relationRowCreator) { + super(beanMetaData, rowCreator, relationRowCreator); + } + + // =================================================================================== + // Handle + // ====== + public Object handle(ResultSet rs) throws SQLException { + // Set + Set columnNames = null; + + // Map + Map propertyCache = null;// [DAO-118] (2007/08/26) + + // Map> + Map relationPropertyCache = null;// [DAO-118] (2007/08/25) + + final List list = new ArrayList(); + final int relSize = getBeanMetaData().getRelationPropertyTypeSize(); + final RelationRowCache relRowCache = new RelationRowCache(relSize); + + while (rs.next()) { + // Lazy initialization because if the result is zero, the cache is unused. + if (columnNames == null) { + columnNames = createColumnNames(rs.getMetaData()); + } + if (propertyCache == null) { + propertyCache = createPropertyCache(columnNames); + } + if (relationPropertyCache == null) { + relationPropertyCache = createRelationPropertyCache(columnNames); + } + + // Create row instance of base table by row property cache. + final Object row = createRow(rs, propertyCache); + + for (int i = 0; i < relSize; ++i) { + RelationPropertyType rpt = getBeanMetaData() + .getRelationPropertyType(i); + if (rpt == null) { + continue; + } + Object relationRow = null; + Map relKeyValues = new HashMap(); + // /- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - + // If it returns null at first record, may it be unnecessary after second records? + // - - - - - - - - - -/ + RelationKey relKey = createRelationKey(rs, rpt, columnNames, + relKeyValues); + if (relKey != null) { + relationRow = relRowCache.getRelationRow(i, relKey); + if (relationRow == null) { + relationRow = createRelationRow(rs, rpt, columnNames, + relKeyValues, relationPropertyCache); + relRowCache.addRelationRow(i, relKey, relationRow); + } + } + if (relationRow != null) { + PropertyDesc pd = rpt.getPropertyDesc(); + pd.setValue(row, relationRow); + postCreateRow(relationRow); + } + } + postCreateRow(row); + list.add(row); + } + return list; + } + + protected RelationKey createRelationKey(ResultSet rs, + RelationPropertyType rpt, Set columnNames, Map relKeyValues) + throws SQLException { + List keyList = new ArrayList(); + BeanMetaData bmd = rpt.getBeanMetaData(); + for (int i = 0; i < rpt.getKeySize(); ++i) { + /* + * PropertyType pt = bmd + * .getPropertyTypeByColumnName(rpt.getYourKey(i)); ValueType + * valueType = pt.getValueType(); String columnName = + * pt.getColumnName() + "_" + rpt.getRelationNo(); + */ + ValueType valueType = null; + String columnName = rpt.getMyKey(i); + if (columnNames.contains(columnName)) { + PropertyType pt = getBeanMetaData() + .getPropertyTypeByColumnName(columnName); + valueType = pt.getValueType(); + } else { + PropertyType pt = bmd.getPropertyTypeByColumnName(rpt + .getYourKey(i)); + columnName = pt.getColumnName() + "_" + rpt.getRelationNo(); + if (columnNames.contains(columnName)) { + valueType = pt.getValueType(); + } else { + return null; + } + } + Object value = valueType.getValue(rs, columnName); + if (value == null) { + return null; + } + relKeyValues.put(columnName, value); + keyList.add(value); + } + if (keyList.size() > 0) { + Object[] keys = keyList.toArray(); + return new RelationKey(keys); + } else { + return null; + } + } +} Property changes on: announcement/trunk/src/main/java/jp/sf/pal/announcement/db/allcommon/s2dao/internal/rshandler/InternalBeanListMetaDataResultSetHandler.java ___________________________________________________________________ Name: svn:eol-style + native Added: announcement/trunk/src/main/java/jp/sf/pal/announcement/db/allcommon/s2dao/internal/sqlcommand/InternalAbstractAutoStaticCommand.java =================================================================== --- announcement/trunk/src/main/java/jp/sf/pal/announcement/db/allcommon/s2dao/internal/sqlcommand/InternalAbstractAutoStaticCommand.java (rev 0) +++ announcement/trunk/src/main/java/jp/sf/pal/announcement/db/allcommon/s2dao/internal/sqlcommand/InternalAbstractAutoStaticCommand.java 2008-06-30 02:54:27 UTC (rev 1002) @@ -0,0 +1,209 @@ +package jp.sf.pal.announcement.db.allcommon.s2dao.internal.sqlcommand; + +import java.util.ArrayList; +import java.util.List; + +import javax.sql.DataSource; + +import jp.sf.pal.announcement.db.allcommon.s2dao.internal.sqlhandler.InternalAbstractAutoHandler; + +import org.seasar.dao.BeanMetaData; +import org.seasar.dao.IdentifierGenerator; +import org.seasar.dao.NotSingleRowUpdatedRuntimeException; +import org.seasar.dao.PrimaryKeyNotFoundRuntimeException; +import org.seasar.extension.jdbc.PropertyType; +import org.seasar.extension.jdbc.StatementFactory; +import org.seasar.framework.exception.SRuntimeException; + +/** + * @author DBFlute(AutoGenerator) + */ +public abstract class InternalAbstractAutoStaticCommand extends + InternalAbstractStaticCommand { + + // =================================================================================== + // Attribute + // ========= + private PropertyType[] propertyTypes; + + private boolean checkSingleRowUpdate = true; + + // =================================================================================== + // Constructor + // =========== + public InternalAbstractAutoStaticCommand(DataSource dataSource, + StatementFactory statementFactory, BeanMetaData beanMetaData, + String[] propertyNames) { + super(dataSource, statementFactory, beanMetaData); + setupPropertyTypes(propertyNames); + setupSql(); + } + + // =================================================================================== + // Execute + // ======= + public Object execute(Object[] args) { + InternalAbstractAutoHandler handler = createAutoHandler(); + handler.setSql(getSql()); + + // It is unnecessary for DBFlute! + // injectDaoClass(handler); + + int rows = handler.execute(args); + if (isCheckSingleRowUpdate() && rows != 1) { + throw createNotSingleRowUpdatedRuntimeException(args[0], rows); + } + return new Integer(rows); + } + + public boolean isCheckSingleRowUpdate() { + return checkSingleRowUpdate; + } + + public void setCheckSingleRowUpdate(boolean checkSingleRowUpdate) { + this.checkSingleRowUpdate = checkSingleRowUpdate; + } + + protected NotSingleRowUpdatedRuntimeException createNotSingleRowUpdatedRuntimeException( + Object bean, int rows) { + return new jp.sf.pal.announcement.db.allcommon.exception.EntityAlreadyUpdatedException( + bean, rows); + } + + protected PropertyType[] getPropertyTypes() { + return propertyTypes; + } + + protected void setPropertyTypes(PropertyType[] propertyTypes) { + this.propertyTypes = propertyTypes; + } + + protected abstract InternalAbstractAutoHandler createAutoHandler(); + + protected abstract void setupPropertyTypes(String[] propertyNames); + + protected void setupInsertPropertyTypes(String[] propertyNames) { + List types = new ArrayList(); + for (int i = 0; i < propertyNames.length; ++i) { + PropertyType pt = getBeanMetaData().getPropertyType( + propertyNames[i]); + if (isInsertTarget(pt)) { + types.add(pt); + } + } + propertyTypes = (PropertyType[]) types.toArray(new PropertyType[types + .size()]); + } + + protected boolean isInsertTarget(PropertyType propertyType) { + if (propertyType.isPrimaryKey()) { + String name = propertyType.getPropertyName(); + final IdentifierGenerator generator = getBeanMetaData() + .getIdentifierGenerator(name); + return generator.isSelfGenerate(); + } + return true; + } + + protected void setupUpdatePropertyTypes(String[] propertyNames) { + List types = new ArrayList(); + for (int i = 0; i < propertyNames.length; ++i) { + PropertyType pt = getBeanMetaData().getPropertyType( + propertyNames[i]); + if (pt.isPrimaryKey()) { + continue; + } + types.add(pt); + } + if (types.size() == 0) { + throw new SRuntimeException("EDAO0020"); + } + propertyTypes = (PropertyType[]) types.toArray(new PropertyType[types + .size()]); + } + + protected void setupDeletePropertyTypes(String[] propertyNames) { + } + + protected abstract void setupSql(); + + protected void setupInsertSql() { + BeanMetaData bmd = getBeanMetaData(); + StringBuffer buf = new StringBuffer(100); + buf.append("INSERT INTO "); + buf.append(bmd.getTableName()); + buf.append(" ("); + for (int i = 0; i < propertyTypes.length; ++i) { + PropertyType pt = propertyTypes[i]; + if (isInsertTarget(pt)) { + buf.append(pt.getColumnName()); + buf.append(", "); + } + } + buf.setLength(buf.length() - 2); + buf.append(") VALUES ("); + for (int i = 0; i < propertyTypes.length; ++i) { + PropertyType pt = propertyTypes[i]; + if (isInsertTarget(pt)) { + buf.append("?, "); + } + } + buf.setLength(buf.length() - 2); + buf.append(")"); + setSql(buf.toString()); + } + + protected void setupUpdateSql() { + checkPrimaryKey(); + StringBuffer buf = new StringBuffer(100); + buf.append("UPDATE "); + buf.append(getBeanMetaData().getTableName()); + buf.append(" SET "); + for (int i = 0; i < propertyTypes.length; ++i) { + PropertyType pt = propertyTypes[i]; + buf.append(pt.getColumnName()); + buf.append(" = ?, "); + } + buf.setLength(buf.length() - 2); + setupUpdateWhere(buf); + setSql(buf.toString()); + } + + protected void setupDeleteSql() { + checkPrimaryKey(); + StringBuffer buf = new StringBuffer(100); + buf.append("DELETE FROM "); + buf.append(getBeanMetaData().getTableName()); + setupUpdateWhere(buf); + setSql(buf.toString()); + } + + protected void checkPrimaryKey() { + BeanMetaData bmd = getBeanMetaData(); + if (bmd.getPrimaryKeySize() == 0) { + throw new PrimaryKeyNotFoundRuntimeException(bmd.getBeanClass()); + } + } + + protected void setupUpdateWhere(StringBuffer buf) { + BeanMetaData bmd = getBeanMetaData(); + buf.append(" WHERE "); + for (int i = 0; i < bmd.getPrimaryKeySize(); ++i) { + buf.append(bmd.getPrimaryKey(i)); + buf.append(" = ? AND "); + } + buf.setLength(buf.length() - 5); + if (bmd.hasVersionNoPropertyType()) { + PropertyType pt = bmd.getVersionNoPropertyType(); + buf.append(" AND "); + buf.append(pt.getColumnName()); + buf.append(" = ?"); + } + if (bmd.hasTimestampPropertyType()) { + PropertyType pt = bmd.getTimestampPropertyType(); + buf.append(" AND "); + buf.append(pt.getColumnName()); + buf.append(" = ?"); + } + } +} Property changes on: announcement/trunk/src/main/java/jp/sf/pal/announcement/db/allcommon/s2dao/internal/sqlcommand/InternalAbstractAutoStaticCommand.java ___________________________________________________________________ Name: svn:eol-style + native Added: announcement/trunk/src/main/java/jp/sf/pal/announcement/db/allcommon/s2dao/internal/sqlcommand/InternalAbstractBatchAutoStaticCommand.java =================================================================== --- announcement/trunk/src/main/java/jp/sf/pal/announcement/db/allcommon/s2dao/internal/sqlcommand/InternalAbstractBatchAutoStaticCommand.java (rev 0) +++ announcement/trunk/src/main/java/jp/sf/pal/announcement/db/allcommon/s2dao/internal/sqlcommand/InternalAbstractBatchAutoStaticCommand.java 2008-06-30 02:54:27 UTC (rev 1002) @@ -0,0 +1,50 @@ +package jp.sf.pal.announcement.db.allcommon.s2dao.internal.sqlcommand; + +import javax.sql.DataSource; + +import jp.sf.pal.announcement.db.allcommon.s2dao.internal.sqlhandler.InternalAbstractBatchAutoHandler; + +import org.seasar.dao.BeanMetaData; +import org.seasar.extension.jdbc.StatementFactory; + +/** + * @author DBFlute(AutoGenerator) + */ +public abstract class InternalAbstractBatchAutoStaticCommand extends + InternalAbstractAutoStaticCommand { + + // =================================================================================== + // Attribute + // ========= + protected final boolean returningRows; + + // =================================================================================== + // Constructor + // =========== + public InternalAbstractBatchAutoStaticCommand(DataSource dataSource, + StatementFactory statementFactory, BeanMetaData beanMetaData, + String[] propertyNames, boolean returningRows) { + super(dataSource, statementFactory, beanMetaData, propertyNames); + this.returningRows = returningRows; + } + + // =================================================================================== + // Execute + // ======= + public Object execute(Object[] args) { + final InternalAbstractBatchAutoHandler handler = createBatchAutoHandler(); + + // It is unnecessary! + // injectDaoClass(handler); + + handler.setSql(getSql()); + if (this.returningRows) { + return handler.executeBatch(args); + } else { + final int updatedRows = handler.execute(args); + return new Integer(updatedRows); + } + } + + protected abstract InternalAbstractBatchAutoHandler createBatchAutoHandler(); +} Property changes on: announcement/trunk/src/main/java/jp/sf/pal/announcement/db/allcommon/s2dao/internal/sqlcommand/InternalAbstractBatchAutoStaticCommand.java ___________________________________________________________________ Name: svn:eol-style + native Added: announcement/trunk/src/main/java/jp/sf/pal/announcement/db/allcommon/s2dao/internal/sqlcommand/InternalAbstractDynamicCommand.java =================================================================== --- announcement/trunk/src/main/java/jp/sf/pal/announcement/db/allcommon/s2dao/internal/sqlcommand/InternalAbstractDynamicCommand.java (rev 0) +++ announcement/trunk/src/main/java/jp/sf/pal/announcement/db/allcommon/s2dao/internal/sqlcommand/InternalAbstractDynamicCommand.java 2008-06-30 02:54:27 UTC (rev 1002) @@ -0,0 +1,79 @@ +package jp.sf.pal.announcement.db.allcommon.s2dao.internal.sqlcommand; + +import javax.sql.DataSource; + +import jp.sf.pal.announcement.db.allcommon.s2dao.internal.sqlparser.InternalCommandContextCreator; +import jp.sf.pal.announcement.db.allcommon.s2dao.internal.sqlparser.InternalSqlParser; + +import org.seasar.dao.CommandContext; +import org.seasar.dao.Node; +import org.seasar.extension.jdbc.StatementFactory; + +/** + * @author DBFlute(AutoGenerator) + */ +public abstract class InternalAbstractDynamicCommand extends + InternalAbstractSqlCommand { + + // =================================================================================== + // Attribute + // ========= + protected Node rootNode; + + protected String[] argNames = new String[0]; + + protected Class[] argTypes = new Class[0]; + + // =================================================================================== + // Constructor + // =========== + public InternalAbstractDynamicCommand(DataSource dataSource, + StatementFactory statementFactory) { + super(dataSource, statementFactory); + } + + // =================================================================================== + // Sql Handling + // ============ + public void setSql(String sql) { + super.setSql(sql); + this.rootNode = createInternalSqlParser(sql).parse(); + } + + protected InternalSqlParser createInternalSqlParser(String sql) { + return new InternalSqlParser(sql); + } + + public CommandContext apply(Object[] args) {// It is necessary to be public! + final CommandContext ctx = createCommandContext(args); + rootNode.accept(ctx); + return ctx; + } + + protected CommandContext createCommandContext(Object[] args) { + return createCommandContextCreator().createCommandContext(args); + } + + protected InternalCommandContextCreator createCommandContextCreator() { + return new InternalCommandContextCreator(argNames, argTypes); + } + + // =================================================================================== + // Accessor + // ======== + public String[] getArgNames() { + return argNames; + } + + public void setArgNames(String[] argNames) { + this.argNames = argNames; + } + + public Class[] getArgTypes() { + return argTypes; + } + + public void setArgTypes(Class[] argTypes) { + this.argTypes = argTypes; + } +} Property changes on: announcement/trunk/src/main/java/jp/sf/pal/announcement/db/allcommon/s2dao/internal/sqlcommand/InternalAbstractDynamicCommand.java ___________________________________________________________________ Name: svn:eol-style + native Added: announcement/trunk/src/main/java/jp/sf/pal/announcement/db/allcommon/s2dao/internal/sqlcommand/InternalAbstractSqlCommand.java =================================================================== --- announcement/trunk/src/main/java/jp/sf/pal/announcement/db/allcommon/s2dao/internal/sqlcommand/InternalAbstractSqlCommand.java (rev 0) +++ announcement/trunk/src/main/java/jp/sf/pal/announcement/db/allcommon/s2dao/internal/sqlcommand/InternalAbstractSqlCommand.java 2008-06-30 02:54:27 UTC (rev 1002) @@ -0,0 +1,49 @@ +package jp.sf.pal.announcement.db.allcommon.s2dao.internal.sqlcommand; + +import javax.sql.DataSource; + +import org.seasar.dao.SqlCommand; +import org.seasar.extension.jdbc.StatementFactory; + +/** + * @author DBFlute(AutoGenerator) + */ +public abstract class InternalAbstractSqlCommand implements SqlCommand { + + // =================================================================================== + // Attribute + // ========= + private DataSource dataSource; + + private StatementFactory statementFactory; + + private String sql; + + // =================================================================================== + // Constructor + // =========== + public InternalAbstractSqlCommand(DataSource dataSource, + StatementFactory statementFactory) { + this.dataSource = dataSource; + this.statementFactory = statementFactory; + } + + // =================================================================================== + // Accessor + // ======== + public DataSource getDataSource() { + return dataSource; + } + + public StatementFactory getStatementFactory() { + return statementFactory; + } + + public String getSql() { + return sql; + } + + public void setSql(String sql) { + this.sql = sql; + } +} Property changes on: announcement/trunk/src/main/java/jp/sf/pal/announcement/db/allcommon/s2dao/internal/sqlcommand/InternalAbstractSqlCommand.java ___________________________________________________________________ Name: svn:eol-style + native Added: announcement/trunk/src/main/java/jp/sf/pal/announcement/db/allcommon/s2dao/internal/sqlcommand/InternalAbstractStaticCommand.java =================================================================== --- announcement/trunk/src/main/java/jp/sf/pal/announcement/db/allcommon/s2dao/internal/sqlcommand/InternalAbstractStaticCommand.java (rev 0) +++ announcement/trunk/src/main/java/jp/sf/pal/announcement/db/allcommon/s2dao/internal/sqlcommand/InternalAbstractStaticCommand.java 2008-06-30 02:54:27 UTC (rev 1002) @@ -0,0 +1,34 @@ +package jp.sf.pal.announcement.db.allcommon.s2dao.internal.sqlcommand; + +import javax.sql.DataSource; + +import org.seasar.dao.BeanMetaData; +import org.seasar.extension.jdbc.StatementFactory; + +/** + * @author DBFlute(AutoGenerator) + */ +public abstract class InternalAbstractStaticCommand extends + InternalAbstractSqlCommand { + + // =================================================================================== + // Attribute + // ========= + private BeanMetaData beanMetaData; + + // =================================================================================== + // Constructor + // =========== + public InternalAbstractStaticCommand(DataSource dataSource, + StatementFactory statementFactory, BeanMetaData beanMetaData) { + super(dataSource, statementFactory); + this.beanMetaData = beanMetaData; + } + + // =================================================================================== + // Accessor + // ======== + public BeanMetaData getBeanMetaData() { + return beanMetaData; + } +} Property changes on: announcement/trunk/src/main/java/jp/sf/pal/announcement/db/allcommon/s2dao/internal/sqlcommand/InternalAbstractStaticCommand.java ___________________________________________________________________ Name: svn:eol-style + native Added: announcement/trunk/src/main/java/jp/sf/pal/announcement/db/allcommon/s2dao/internal/sqlcommand/InternalDeleteAutoStaticCommand.java =================================================================== --- announcement/trunk/src/main/java/jp/sf/pal/announcement/db/allcommon/s2dao/internal/sqlcommand/InternalDeleteAutoStaticCommand.java (rev 0) +++ announcement/trunk/src/main/java/jp/sf/pal/announcement/db/allcommon/s2dao/internal/sqlcommand/InternalDeleteAutoStaticCommand.java 2008-06-30 02:54:27 UTC (rev 1002) @@ -0,0 +1,44 @@ +package jp.sf.pal.announcement.db.allcommon.s2dao.internal.sqlcommand; + +import javax.sql.DataSource; + +import jp.sf.pal.announcement.db.allcommon.s2dao.internal.sqlhandler.InternalAbstractAutoHandler; +import jp.sf.pal.announcement.db.allcommon.s2dao.internal.sqlhandler.InternalDeleteAutoHandler; + +import org.seasar.dao.BeanMetaData; +import org.seasar.extension.jdbc.StatementFactory; + +/** + * @author DBFlute(AutoGenerator) + */ +public class InternalDeleteAutoStaticCommand extends + InternalAbstractAutoStaticCommand { + + // =================================================================================== + // Constructor + // =========== + public InternalDeleteAutoStaticCommand(DataSource dataSource, + StatementFactory statementFactory, BeanMetaData beanMetaData, + String[] propertyNames) { + super(dataSource, statementFactory, beanMetaData, propertyNames); + } + + // =================================================================================== + // Override + // ======== + @Override + protected InternalAbstractAutoHandler createAutoHandler() { + return new InternalDeleteAutoHandler(getDataSource(), + getStatementFactory(), getBeanMetaData(), getPropertyTypes()); + } + + @Override + protected void setupSql() { + setupDeleteSql(); + } + + @Override + protected void setupPropertyTypes(String[] propertyNames) { + setupDeletePropertyTypes(propertyNames); + } +} Property changes on: announcement/trunk/src/main/java/jp/sf/pal/announcement/db/allcommon/s2dao/internal/sqlcommand/InternalDeleteAutoStaticCommand.java ___________________________________________________________________ Name: svn:eol-style + native Added: announcement/trunk/src/main/java/jp/sf/pal/announcement/db/allcommon/s2dao/internal/sqlcommand/InternalDeleteBatchAutoStaticCommand.java =================================================================== --- announcement/trunk/src/main/java/jp/sf/pal/announcement/db/allcommon/s2dao/internal/sqlcommand/InternalDeleteBatchAutoStaticCommand.java (rev 0) +++ announcement/trunk/src/main/java/jp/sf/pal/announcement/db/allcommon/s2dao/internal/sqlcommand/InternalDeleteBatchAutoStaticCommand.java 2008-06-30 02:54:27 UTC (rev 1002) @@ -0,0 +1,51 @@ +package jp.sf.pal.announcement.db.allcommon.s2dao.internal.sqlcommand; + +import javax.sql.DataSource; + +import jp.sf.pal.announcement.db.allcommon.s2dao.internal.sqlhandler.InternalAbstractAutoHandler; +import jp.sf.pal.announcement.db.allcommon.s2dao.internal.sqlhandler.InternalAbstractBatchAutoHandler; +import jp.sf.pal.announcement.db.allcommon.s2dao.internal.sqlhandler.InternalDeleteBatchAutoHandler; + +import org.seasar.dao.BeanMetaData; +import org.seasar.extension.jdbc.StatementFactory; + +/** + * @author DBFlute(AutoGenerator) + */ +public class InternalDeleteBatchAutoStaticCommand extends + InternalAbstractBatchAutoStaticCommand { + + // =================================================================================== + // Constructor + // =========== + public InternalDeleteBatchAutoStaticCommand(DataSource dataSource, + StatementFactory statementFactory, BeanMetaData beanMetaData, + String[] propertyNames, boolean returningRows) { + super(dataSource, statementFactory, beanMetaData, propertyNames, + returningRows); + } + + // =================================================================================== + // Override + // ======== + @Override + protected InternalAbstractAutoHandler createAutoHandler() { + return createBatchAutoHandler(); + } + + @Override + protected InternalAbstractBatchAutoHandler createBatchAutoHandler() { + return new InternalDeleteBatchAutoHandler(getDataSource(), + getStatementFactory(), getBeanMetaData(), getPropertyTypes()); + } + + @Override + protected void setupSql() { + setupDeleteSql(); + } + + @Override + protected void setupPropertyTypes(String[] propertyNames) { + setupDeletePropertyTypes(propertyNames); + } +} Property changes on: announcement/trunk/src/main/java/jp/sf/pal/announcement/db/allcommon/s2dao/internal/sqlcommand/InternalDeleteBatchAutoStaticCommand.java ___________________________________________________________________ Name: svn:eol-style + native Added: announcement/trunk/src/main/java/jp/sf/pal/announcement/db/allcommon/s2dao/internal/sqlcommand/InternalDeleteQueryAutoDynamicCommand.java =================================================================== --- announcement/trunk/src/main/java/jp/sf/pal/announcement/db/allcommon/s2dao/internal/sqlcommand/InternalDeleteQueryAutoDynamicCommand.java (rev 0) +++ announcement/trunk/src/main/java/jp/sf/pal/announcement/db/allcommon/s2dao/internal/sqlcommand/InternalDeleteQueryAutoDynamicCommand.java 2008-06-30 02:54:27 UTC (rev 1002) @@ -0,0 +1,145 @@ +package jp.sf.pal.announcement.db.allcommon.s2dao.internal.sqlcommand; + +import javax.sql.DataSource; + +import jp.sf.pal.announcement.db.allcommon.cbean.ConditionBean; +import jp.sf.pal.announcement.db.allcommon.dbmeta.DBMeta; +import jp.sf.pal.announcement.db.allcommon.dbmeta.DBMetaInstanceHandler; +import jp.sf.pal.announcement.db.allcommon.s2dao.internal.sqlhandler.InternalCommandContextHandler; +import jp.sf.pal.announcement.db.allcommon.s2dao.internal.sqlparser.InternalCommandContextCreator; +import jp.sf.pal.announcement.db.allcommon.s2dao.internal.sqlparser.InternalSqlParser; + +import org.seasar.dao.CommandContext; +import org.seasar.dao.Node; +import org.seasar.dao.SqlCommand; +import org.seasar.extension.jdbc.StatementFactory; + +/** + * @author DBFlute(AutoGenerator) + */ +public class InternalDeleteQueryAutoDynamicCommand implements SqlCommand { + + // =================================================================================== + // Attribute + // ========= + protected DataSource dataSource; + + protected StatementFactory statementFactory; + + // =================================================================================== + // Constructor + // =========== + public InternalDeleteQueryAutoDynamicCommand(DataSource dataSource, + StatementFactory statementFactory) { + this.dataSource = dataSource; + this.statementFactory = statementFactory; + } + + // =================================================================================== + // Execute + // ======= + public Object execute(Object[] args) { + final ConditionBean cb = extractConditionBeanWithCheck(args); + final String[] argNames = new String[] { "dto" }; + final Class[] argTypes = new Class[] { cb.getClass() }; + final String twoWaySql = buildQueryDeleteTwoWaySql(cb); + final CommandContext context = createCommandContext(twoWaySql, + argNames, argTypes, args); + final InternalCommandContextHandler handler = createCommandContextHandler(context); + int rows = handler.execute(args); + return new Integer(rows); + } + + protected ConditionBean extractConditionBeanWithCheck(Object[] args) { + if (args == null || args.length == 0) { + String msg = "The arguments should have one argument! But:"; + msg = msg + " args=" + (args != null ? args.length : null); + throw new IllegalArgumentException(msg); + } + final Object fisrtArg = args[0]; + if (!(fisrtArg instanceof ConditionBean)) { + String msg = "The type of argument should be " + + ConditionBean.class + "! But:"; + msg = msg + " type=" + fisrtArg.getClass(); + throw new IllegalArgumentException(msg); + } + return (ConditionBean) fisrtArg; + } + + protected InternalCommandContextHandler createCommandContextHandler( + CommandContext context) { + return new InternalCommandContextHandler(dataSource, statementFactory, + context); + } + + protected String buildQueryDeleteTwoWaySql(ConditionBean cb) { + final String tableSqlName = cb.getTableSqlName(); + final String aliasName = cb.getSqlClause().getLocalTableAliasName(); + final DBMeta dbmeta = DBMetaInstanceHandler.findDBMeta(cb + .getTableDbName()); + if (dbmeta.hasTwoOrMorePrimaryKeys()) { + String msg = "The target table of queryDelete() should have only one primary key:"; + msg = msg + " primaryKeys=" + + dbmeta.getPrimaryUniqueInfo().getUniqueColumnList(); + throw new IllegalStateException(msg); + } + final String primaryKeyName = dbmeta.getPrimaryUniqueInfo() + .getFirstColumn().getColumnDbName(); + final String selectClause = "select " + aliasName + "." + + primaryKeyName; + String fromWhereClause = cb.getSqlClause() + .getClauseFromWhereWithUnionTemplate(); + + // Replace template marks. These are very important! + fromWhereClause = replaceString(fromWhereClause, cb.getSqlClause() + .getUnionSelectClauseMark(), selectClause); + fromWhereClause = replaceString(fromWhereClause, cb.getSqlClause() + .getUnionWhereClauseMark(), ""); + fromWhereClause = replaceString(fromWhereClause, cb.getSqlClause() + .getUnionWhereFirstConditionMark(), ""); + + final StringBuilder sb = new StringBuilder(); + sb.append("delete from ").append(tableSqlName); + sb.append(" where ").append(primaryKeyName); + sb.append(" in (").append(selectClause).append(" ").append( + fromWhereClause).append(")"); + return sb.toString(); + } + + protected CommandContext createCommandContext(String twoWaySql, + String[] argNames, Class[] argTypes, Object[] args) { + final CommandContext context; + { + final InternalSqlParser parser = new InternalSqlParser(twoWaySql); + final Node node = parser.parse(); + final InternalCommandContextCreator creator = new InternalCommandContextCreator( + argNames, argTypes); + context = creator.createCommandContext(args); + node.accept(context); + } + return context; + } + + protected final String replaceString(String text, String fromText, + String toText) { + if (text == null || fromText == null || toText == null) + return null; + StringBuffer buf = new StringBuffer(100); + int pos = 0; + int pos2 = 0; + do { + pos = text.indexOf(fromText, pos2); + if (pos == 0) { + buf.append(toText); + pos2 = fromText.length(); + } else if (pos > 0) { + buf.append(text.substring(pos2, pos)); + buf.append(toText); + pos2 = pos + fromText.length(); + } else { + buf.append(text.substring(pos2)); + return buf.toString(); + } + } while (true); + } +} Property changes on: announcement/trunk/src/main/java/jp/sf/pal/announcement/db/allcommon/s2dao/internal/sqlcommand/InternalDeleteQueryAutoDynamicCommand.java ___________________________________________________________________ Name: svn:eol-style + native Added: announcement/trunk/src/main/java/jp/sf/pal/announcement/db/allcommon/s2dao/internal/sqlcommand/InternalInsertAutoDynamicCommand.java =================================================================== --- announcement/trunk/src/main/java/jp/sf/pal/announcement/db/allcommon/s2dao/internal/sqlcommand/InternalInsertAutoDynamicCommand.java (rev 0) +++ announcement/trunk/src/main/java/jp/sf/pal/announcement/db/allcommon/s2dao/internal/sqlcommand/InternalInsertAutoDynamicCommand.java 2008-06-30 02:54:27 UTC (rev 1002) @@ -0,0 +1,167 @@ +package jp.sf.pal.announcement.db.allcommon.s2dao.internal.sqlcommand; + +import java.util.ArrayList; +import java.util.List; + +import javax.sql.DataSource; + +import jp.sf.pal.announcement.db.allcommon.s2dao.internal.sqlhandler.InternalInsertAutoHandler; + +import org.seasar.dao.BeanMetaData; +import org.seasar.dao.IdentifierGenerator; +import org.seasar.dao.NotSingleRowUpdatedRuntimeException; +import org.seasar.dao.SqlCommand; +import org.seasar.extension.jdbc.PropertyType; +import org.seasar.extension.jdbc.StatementFactory; +import org.seasar.framework.exception.SRuntimeException; + +/** + * @author DBFlute(AutoGenerator) + */ +public class InternalInsertAutoDynamicCommand implements SqlCommand { + + // =================================================================================== + // Constructor + // =========== + protected DataSource dataSource; + + protected StatementFactory statementFactory; + + protected BeanMetaData beanMetaData; + + protected String[] propertyNames; + + protected boolean checkSingleRowUpdate = true; + + // =================================================================================== + // Constructor + // =========== + public InternalInsertAutoDynamicCommand() { + } + + // =================================================================================== + // Execute + // ======= + public Object execute(Object[] args) { + final Object bean = args[0]; + final BeanMetaData bmd = getBeanMetaData(); + final PropertyType[] propertyTypes = createInsertPropertyTypes(bmd, + bean, getPropertyNames()); + final String sql = createInsertSql(bmd, propertyTypes); + final InternalInsertAutoHandler handler = new InternalInsertAutoHandler( + getDataSource(), getStatementFactory(), bmd, propertyTypes); + handler.setSql(sql); + final int rows = handler.execute(args); + if (isCheckSingleRowUpdate() && rows != 1) { + throw new NotSingleRowUpdatedRuntimeException(args[0], rows); + } + return new Integer(rows); + } + + protected String createInsertSql(BeanMetaData bmd, + PropertyType[] propertyTypes) { + StringBuffer buf = new StringBuffer(100); + buf.append("INSERT INTO "); + buf.append(bmd.getTableName()); + buf.append(" ("); + for (int i = 0; i < propertyTypes.length; ++i) { + PropertyType pt = propertyTypes[i]; + final String columnName = pt.getColumnName(); + if (i > 0) { + buf.append(", "); + } + buf.append(columnName); + } + buf.append(") VALUES ("); + for (int i = 0; i < propertyTypes.length; ++i) { + if (i > 0) { + buf.append(", "); + } + buf.append("?"); + } + buf.append(")"); + return buf.toString(); + } + + protected PropertyType[] createInsertPropertyTypes(BeanMetaData bmd, + Object bean, String[] propertyNames) { + + if (0 == propertyNames.length) { + throw new SRuntimeException("EDAO0024", new Object[] { bean + .getClass().getName() }); + } + List types = new ArrayList(); + final String timestampPropertyName = bmd.getTimestampPropertyName(); + final String versionNoPropertyName = bmd.getVersionNoPropertyName(); + + for (int i = 0; i < propertyNames.length; ++i) { + PropertyType pt = bmd.getPropertyType(propertyNames[i]); + if (pt.isPrimaryKey()) { + final IdentifierGenerator generator = bmd + .getIdentifierGenerator(pt.getPropertyName()); + if (!generator.isSelfGenerate()) { + continue; + } + } else { + if (pt.getPropertyDesc().getValue(bean) == null) { + final String propertyName = pt.getPropertyName(); + if (!propertyName.equalsIgnoreCase(timestampPropertyName) + && !propertyName + .equalsIgnoreCase(versionNoPropertyName)) { + continue; + } + } + } + types.add(pt); + } + if (types.isEmpty()) { + throw new SRuntimeException("EDAO0014"); + } + PropertyType[] propertyTypes = (PropertyType[]) types + .toArray(new PropertyType[types.size()]); + return propertyTypes; + } + + // =================================================================================== + // Accessor + // ======== + protected DataSource getDataSource() { + return dataSource; + } + + public void setDataSource(DataSource dataSource) { + this.dataSource = dataSource; + } + + protected StatementFactory getStatementFactory() { + return statementFactory; + } + + public void setStatementFactory(StatementFactory statementFactory) { + this.statementFactory = statementFactory; + } + + protected BeanMetaData getBeanMetaData() { + return beanMetaData; + } + + public void setBeanMetaData(BeanMetaData beanMetaData) { + this.beanMetaData = beanMetaData; + } + + protected String[] getPropertyNames() { + return propertyNames; + } + + public void setPropertyNames(String[] propertyNames) { + this.propertyNames = propertyNames; + } + + public boolean isCheckSingleRowUpdate() { + return checkSingleRowUpdate; + } + + public void setCheckSingleRowUpdate(boolean checkSingleRowUpdate) { + this.checkSingleRowUpdate = checkSingleRowUpdate; + } +} Property changes on: announcement/trunk/src/main/java/jp/sf/pal/announcement/db/allcommon/s2dao/internal/sqlcommand/InternalInsertAutoDynamicCommand.java ___________________________________________________________________ Name: svn:eol-style + native Added: announcement/trunk/src/main/java/jp/sf/pal/announcement/db/allcommon/s2dao/internal/sqlcommand/InternalInsertBatchAutoStaticCommand.java =================================================================== --- announcement/trunk/src/main/java/jp/sf/pal/announcement/db/allcommon/s2dao/internal/sqlcommand/InternalInsertBatchAutoStaticCommand.java (rev 0) +++ announcement/trunk/src/main/java/jp/sf/pal/announcement/db/allcommon/s2dao/internal/sqlcommand/InternalInsertBatchAutoStaticCommand.java 2008-06-30 02:54:27 UTC (rev 1002) @@ -0,0 +1,51 @@ +package jp.sf.pal.announcement.db.allcommon.s2dao.internal.sqlcommand; + +import javax.sql.DataSource; + +import jp.sf.pal.announcement.db.allcommon.s2dao.internal.sqlhandler.InternalAbstractAutoHandler; +import jp.sf.pal.announcement.db.allcommon.s2dao.internal.sqlhandler.InternalAbstractBatchAutoHandler; +import jp.sf.pal.announcement.db.allcommon.s2dao.internal.sqlhandler.InternalInsertBatchAutoHandler; + +import org.seasar.dao.BeanMetaData; +import org.seasar.extension.jdbc.StatementFactory; + +/** + * @author DBFlute(AutoGenerator) + */ +public class InternalInsertBatchAutoStaticCommand extends + InternalAbstractBatchAutoStaticCommand { + + // =================================================================================== + // Constructor + // =========== + public InternalInsertBatchAutoStaticCommand(DataSource dataSource, + StatementFactory statementFactory, BeanMetaData beanMetaData, + String[] propertyNames, boolean returningRows) { + super(dataSource, statementFactory, beanMetaData, propertyNames, + returningRows); + } + + // =================================================================================== + // Override + // ======== + @Override + protected InternalAbstractAutoHandler createAutoHandler() { + return createBatchAutoHandler(); + } + + @Override + protected InternalAbstractBatchAutoHandler createBatchAutoHandler() { + return new InternalInsertBatchAutoHandler(getDataSource(), + getStatementFactory(), getBeanMetaData(), getPropertyTypes()); + } + + @Override + protected void setupSql() { + setupInsertSql(); + } + + @Override + protected void setupPropertyTypes(String[] propertyNames) { + setupInsertPropertyTypes(propertyNames); + } +} Property changes on: announcement/trunk/src/main/java/jp/sf/pal/announcement/db/allcommon/s2dao/internal/sqlcommand/InternalInsertBatchAutoStaticCommand.java ___________________________________________________________________ Name: svn:eol-style + native Added: announcement/trunk/src/main/java/jp/sf/pal/announcement/db/allcommon/s2dao/internal/sqlcommand/InternalUpdateAutoDynamicCommand.java =================================================================== --- announcement/trunk/src/main/java/jp/sf/pal/announcement/db/allcommon/s2dao/internal/sqlcommand/InternalUpdateAutoDynamicCommand.java (rev 0) +++ announcement/trunk/src/main/java/jp/sf/pal/announcement/db/allcommon/s2dao/internal/sqlcommand/InternalUpdateAutoDynamicCommand.java 2008-06-30 02:54:27 UTC (rev 1002) @@ -0,0 +1,167 @@ +package jp.sf.pal.announcement.db.allcommon.s2dao.internal.sqlcommand; + +import java.util.ArrayList; +import java.util.List; + +import javax.sql.DataSource; + +import jp.sf.pal.announcement.db.allcommon.s2dao.internal.sqlhandler.InternalUpdateAutoHandler; + +import org.seasar.dao.BeanMetaData; +import org.seasar.dao.NoUpdatePropertyTypeRuntimeException; +import org.seasar.dao.NotSingleRowUpdatedRuntimeException; +import org.seasar.dao.impl.AbstractSqlCommand; +import org.seasar.extension.jdbc.PropertyType; +import org.seasar.extension.jdbc.StatementFactory; + +/** + * @author DBFlute(AutoGenerator) + */ +public class InternalUpdateAutoDynamicCommand extends AbstractSqlCommand { + + // =================================================================================== + // Attribute + // ========= + private BeanMetaData beanMetaData; + + private String[] propertyNames; + + private boolean checkSingleRowUpdate = true; + + // =================================================================================== + // Constructor + // =========== + public InternalUpdateAutoDynamicCommand(DataSource dataSource, + StatementFactory statementFactory) { + super(dataSource, statementFactory); + } + + // =================================================================================== + // Execute + // ======= + public Object execute(Object[] args) { + final Object bean = args[0]; + final BeanMetaData bmd = getBeanMetaData(); + final PropertyType[] propertyTypes = createUpdatePropertyTypes(bmd, + bean, getPropertyNames()); + + InternalUpdateAutoHandler handler = new InternalUpdateAutoHandler( + getDataSource(), getStatementFactory(), bmd, propertyTypes); + + // It is unnecessary! + // injectDaoClass(handler); + + handler.setSql(createUpdateSql(bmd, propertyTypes)); + int i = handler.execute(args); + if (isCheckSingleRowUpdate() && i < 1) { + throw createNotSingleRowUpdatedRuntimeException(args[0], i); + } + return new Integer(i); + } + + protected NotSingleRowUpdatedRuntimeException createNotSingleRowUpdatedRuntimeException( + Object bean, int rows) { + return new jp.sf.pal.announcement.db.allcommon.exception.EntityAlreadyUpdatedException( + bean, rows); + } + + protected PropertyType[] createUpdatePropertyTypes(BeanMetaData bmd, + Object bean, String[] propertyNames) { + List types = new ArrayList(); + final String timestampPropertyName = bmd.getTimestampPropertyName(); + final String versionNoPropertyName = bmd.getVersionNoPropertyName(); + for (int i = 0; i < propertyNames.length; ++i) { + PropertyType pt = bmd.getPropertyType(propertyNames[i]); + if (pt.isPrimaryKey() == false) { + String propertyName = pt.getPropertyName(); + if (propertyName.equalsIgnoreCase(timestampPropertyName) + || propertyName.equalsIgnoreCase(versionNoPropertyName) + || pt.getPropertyDesc().getValue(bean) != null) { + types.add(pt); + } + } + } + if (types.isEmpty()) { + throw new NoUpdatePropertyTypeRuntimeException(); + } + PropertyType[] propertyTypes = (PropertyType[]) types + .toArray(new PropertyType[types.size()]); + return propertyTypes; + } + + protected String createUpdateSql(BeanMetaData bmd, + PropertyType[] propertyTypes) { + StringBuffer buf = new StringBuffer(100); + buf.append("UPDATE "); + buf.append(bmd.getTableName()); + buf.append(" SET "); + for (int i = 0; i < propertyTypes.length; ++i) { + PropertyType pt = propertyTypes[i]; + final String columnName = pt.getColumnName(); + if (i > 0) { + buf.append(", "); + } + buf.append(columnName); + buf.append(" = ?"); + } + + buf.append(" WHERE "); + for (int i = 0; i < bmd.getPrimaryKeySize(); ++i) { + buf.append(bmd.getPrimaryKey(i)); + buf.append(" = ? AND "); + } + buf.setLength(buf.length() - 5); + if (bmd.hasVersionNoPropertyType()) { + PropertyType pt = bmd.getVersionNoPropertyType(); + buf.append(" AND "); + buf.append(pt.getColumnName()); + buf.append(" = ?"); + } + if (bmd.hasTimestampPropertyType()) { + PropertyType pt = bmd.getTimestampPropertyType(); + buf.append(" AND "); + buf.append(pt.getColumnName()); + buf.append(" = ?"); + } + + return buf.toString(); + } + + /** + * @return Returns the beanMetaData. + */ + public BeanMetaData getBeanMetaData() { + return beanMetaData; + } + + /** + * @param beanMetaData + * The beanMetaData to set. + */ + public void setBeanMetaData(BeanMetaData beanMetaData) { + this.beanMetaData = beanMetaData; + } + + /** + * @return Returns the propertyNames. + */ + public String[] getPropertyNames() { + return propertyNames; + } + + /** + * @param propertyNames + * The propertyNames to set. + */ + public void setPropertyNames(String[] propertyNames) { + this.propertyNames = propertyNames; + } + + public boolean isCheckSingleRowUpdate() { + return checkSingleRowUpdate; + } + + public void setCheckSingleRowUpdate(boolean resultCheck) { + this.checkSingleRowUpdate = resultCheck; + } +} Property changes on: announcement/trunk/src/main/java/jp/sf/pal/announcement/db/allcommon/s2dao/internal/sqlcommand/InternalUpdateAutoDynamicCommand.java ___________________________________________________________________ Name: svn:eol-style + native Added: announcement/trunk/src/main/java/jp/sf/pal/announcement/db/allcommon/s2dao/internal/sqlcommand/InternalUpdateBatchAutoStaticCommand.java =================================================================== --- announcement/trunk/src/main/java/jp/sf/pal/announcement/db/allcommon/s2dao/internal/sqlcommand/InternalUpdateBatchAutoStaticCommand.java (rev 0) +++ announcement/trunk/src/main/java/jp/sf/pal/announcement/db/allcommon/s2dao/internal/sqlcommand/InternalUpdateBatchAutoStaticCommand.java 2008-06-30 02:54:27 UTC (rev 1002) @@ -0,0 +1,51 @@ +package jp.sf.pal.announcement.db.allcommon.s2dao.internal.sqlcommand; + +import javax.sql.DataSource; + +import jp.sf.pal.announcement.db.allcommon.s2dao.internal.sqlhandler.InternalAbstractAutoHandler; +import jp.sf.pal.announcement.db.allcommon.s2dao.internal.sqlhandler.InternalAbstractBatchAutoHandler; +import jp.sf.pal.announcement.db.allcommon.s2dao.internal.sqlhandler.InternalUpdateBatchAutoHandler; + +import org.seasar.dao.BeanMetaData; +import org.seasar.extension.jdbc.StatementFactory; + +/** + * @author DBFlute(AutoGenerator) + */ +public class InternalUpdateBatchAutoStaticCommand extends + InternalAbstractBatchAutoStaticCommand { + + // =================================================================================== + // Constructor + // =========== + public InternalUpdateBatchAutoStaticCommand(DataSource dataSource, + StatementFactory statementFactory, BeanMetaData beanMetaData, + String[] propertyNames, boolean returningRows) { + super(dataSource, statementFactory, beanMetaData, propertyNames, + returningRows); + } + + // =================================================================================== + // Override + // ======== + @Override + protected InternalAbstractAutoHandler createAutoHandler() { + return createBatchAutoHandler(); + } + + @Override + protected InternalAbstractBatchAutoHandler createBatchAutoHandler() { + return new InternalUpdateBatchAutoHandler(getDataSource(), + getStatementFactory(), getBeanMetaData(), getPropertyTypes()); + } + + @Override + protected void setupSql() { + setupUpdateSql(); + } + + @Override + protected void setupPropertyTypes(String[] propertyNames) { + setupUpdatePropertyTypes(propertyNames); + } +} Property changes on: announcement/trunk/src/main/java/jp/sf/pal/announcement/db/allcommon/s2dao/internal/sqlcommand/InternalUpdateBatchAutoStaticCommand.java ___________________________________________________________________ Name: svn:eol-style + native Added: announcement/trunk/src/main/java/jp/sf/pal/announcement/db/allcommon/s2dao/internal/sqlcommand/InternalUpdateDynamicCommand.java =================================================================== --- announcement/trunk/src/main/java/jp/sf/pal/announcement/db/allcommon/s2dao/internal/sqlcommand/InternalUpdateDynamicCommand.java (rev 0) +++ announcement/trunk/src/main/java/jp/sf/pal/announcement/db/allcommon/s2dao/internal/sqlcommand/InternalUpdateDynamicCommand.java 2008-06-30 02:54:27 UTC (rev 1002) @@ -0,0 +1,34 @@ +package jp.sf.pal.announcement.db.allcommon.s2dao.internal.sqlcommand; + +import javax.sql.DataSource; + +import jp.sf.pal.announcement.db.allcommon.s2dao.internal.sqlhandler.InternalBasicUpdateHandler; + +import org.seasar.dao.CommandContext; +import org.seasar.extension.jdbc.StatementFactory; + +/** + * @author DBFlute(AutoGenerator) + */ +public class InternalUpdateDynamicCommand extends + InternalAbstractDynamicCommand { + + // =================================================================================== + // Constructor + // =========== + public InternalUpdateDynamicCommand(DataSource dataSource, + StatementFactory statementFactory) { + super(dataSource, statementFactory); + } + + // =================================================================================== + // Execute + // ======= + public Object execute(Object args[]) { + final CommandContext ctx = apply(args); + final InternalBasicUpdateHandler updateHandler = new InternalBasicUpdateHandler( + getDataSource(), ctx.getSql(), getStatementFactory()); + return new Integer(updateHandler.execute(ctx.getBindVariables(), ctx + .getBindVariableTypes())); + } +} Property changes on: announcement/trunk/src/main/java/jp/sf/pal/announcement/db/allcommon/s2dao/internal/sqlcommand/InternalUpdateDynamicCommand.java ___________________________________________________________________ Name: svn:eol-style + native Added: announcement/trunk/src/main/java/jp/sf/pal/announcement/db/allcommon/s2dao/internal/sqlcommand/InternalUpdateModifiedOnlyCommand.java =================================================================== --- announcement/trunk/src/main/java/jp/sf/pal/announcement/db/allcommon/s2dao/internal/sqlcommand/InternalUpdateModifiedOnlyCommand.java (rev 0) +++ announcement/trunk/src/main/java/jp/sf/pal/announcement/db/allcommon/s2dao/internal/sqlcommand/InternalUpdateModifiedOnlyCommand.java 2008-06-30 02:54:27 UTC (rev 1002) @@ -0,0 +1,123 @@ +package jp.sf.pal.announcement.db.allcommon.s2dao.internal.sqlcommand; + +import java.util.ArrayList; +import java.util.List; +import java.util.Set; + +import javax.sql.DataSource; + +import jp.sf.pal.announcement.db.allcommon.s2dao.internal.sqlhandler.InternalUpdateAutoHandler; + +import org.seasar.dao.BeanMetaData; +import org.seasar.dao.NotSingleRowUpdatedRuntimeException; +import org.seasar.extension.jdbc.PropertyType; +import org.seasar.extension.jdbc.StatementFactory; + +/** + * @author DBFlute(AutoGenerator) + */ +public class InternalUpdateModifiedOnlyCommand extends + InternalUpdateAutoDynamicCommand { + + // =================================================================================== + // Definition + // ========== + /** Log instance. */ + private static final org.apache.commons.logging.Log _log = org.apache.commons.logging.LogFactory + .getLog(InternalUpdateModifiedOnlyCommand.class); + + private static final Integer NO_UPDATE = new Integer(0); + + // =================================================================================== + // Constructor + // =========== + public InternalUpdateModifiedOnlyCommand(DataSource dataSource, + StatementFactory statementFactory) { + super(dataSource, statementFactory); + } + + // =================================================================================== + // Execute + // ======= + public Object execute(final Object[] args) { + final Object bean = args[0]; + final BeanMetaData bmd = getBeanMetaData(); + final PropertyType[] propertyTypes = createUpdatePropertyTypes(bmd, + bean, getPropertyNames()); + if (propertyTypes.length == 0) { + if (_log.isDebugEnabled()) { + final String s = createNoUpdateLogMessage(bean, bmd); + _log.debug(s); + } + return NO_UPDATE; + } + + final InternalUpdateAutoHandler handler = new InternalUpdateAutoHandler( + getDataSource(), getStatementFactory(), bmd, propertyTypes); + + // It is unnecessary! + // injectDaoClass(handler); + + handler.setSql(createUpdateSql(bmd, propertyTypes)); + final int i = handler.execute(args); + if (isCheckSingleRowUpdate() && i < 1) { + throw createNotSingleRowUpdatedRuntimeException(args[0], i); + } + return new Integer(i); + } + + protected NotSingleRowUpdatedRuntimeException createNotSingleRowUpdatedRuntimeException( + Object bean, int rows) { + return new jp.sf.pal.announcement.db.allcommon.exception.EntityAlreadyUpdatedException( + bean, rows); + } + + protected String createNoUpdateLogMessage(final Object bean, + final BeanMetaData bmd) { + final StringBuffer sb = new StringBuffer(); + sb.append("skip UPDATE: table="); + sb.append(bmd.getTableName()); + final int size = bmd.getPrimaryKeySize(); + for (int i = 0; i < size; i++) { + if (i == 0) { + sb.append(", key{"); + } else { + sb.append(", "); + } + final String keyName = bmd.getPrimaryKey(i); + sb.append(keyName); + sb.append("="); + sb.append(bmd.getPropertyTypeByColumnName(keyName) + .getPropertyDesc().getValue(bean)); + if (i == size - 1) { + sb.append("}"); + } + } + final String s = new String(sb); + return s; + } + + protected PropertyType[] createUpdatePropertyTypes(final BeanMetaData bmd, + final Object bean, final String[] propertyNames) { + + final Set modifiedPropertyNames = getBeanMetaData() + .getModifiedPropertyNames(bean); + final List types = new ArrayList(); + final String timestampPropertyName = bmd.getTimestampPropertyName(); + final String versionNoPropertyName = bmd.getVersionNoPropertyName(); + for (int i = 0; i < propertyNames.length; ++i) { + final PropertyType pt = bmd.getPropertyType(propertyNames[i]); + if (pt.isPrimaryKey() == false) { + final String propertyName = pt.getPropertyName(); + if (propertyName.equalsIgnoreCase(timestampPropertyName) + || propertyName.equalsIgnoreCase(versionNoPropertyName) + || modifiedPropertyNames.contains(propertyName)) { + types.add(pt); + } + } + } + final PropertyType[] propertyTypes = (PropertyType[]) types + .toArray(new PropertyType[types.size()]); + return propertyTypes; + } +} Property changes on: announcement/trunk/src/main/java/jp/sf/pal/announcement/db/allcommon/s2dao/internal/sqlcommand/InternalUpdateModifiedOnlyCommand.java ___________________________________________________________________ Name: svn:eol-style + native Added: announcement/trunk/src/main/java/jp/sf/pal/announcement/db/allcommon/s2dao/internal/sqlhandler/InternalAbstractAutoHandler.java =================================================================== --- announcement/trunk/src/main/java/jp/sf/pal/announcement/db/allcommon/s2dao/internal/sqlhandler/InternalAbstractAutoHandler.java (rev 0) +++ announcement/trunk/src/main/java/jp/sf/pal/announcement/db/allcommon/s2dao/internal/sqlhandler/InternalAbstractAutoHandler.java 2008-06-30 02:54:27 UTC (rev 1002) @@ -0,0 +1,261 @@ +package jp.sf.pal.announcement.db.allcommon.s2dao.internal.sqlhandler; + +import java.sql.Connection; +import java.sql.PreparedStatement; +import java.sql.SQLException; +import java.sql.Timestamp; +import java.util.ArrayList; +import java.util.Date; +import java.util.List; + +import javax.sql.DataSource; + +import org.seasar.dao.BeanMetaData; +import org.seasar.extension.jdbc.PropertyType; +import org.seasar.extension.jdbc.StatementFactory; +import org.seasar.extension.jdbc.ValueType; +import org.seasar.extension.jdbc.util.ConnectionUtil; +import org.seasar.framework.beans.PropertyDesc; +import org.seasar.framework.exception.SQLRuntimeException; +import org.seasar.framework.util.IntegerConversionUtil; +import org.seasar.framework.util.PreparedStatementUtil; +import org.seasar.framework.util.StatementUtil; + +/** + * @author DBFlute(AutoGenerator) + */ +public abstract class InternalAbstractAutoHandler extends InternalBasicHandler { + + // =================================================================================== + // Definition + // ========== + /** Log instance. */ + private static final org.apache.commons.logging.Log _log = org.apache.commons.logging.LogFactory + .getLog(InternalAbstractAutoHandler.class); + + // =================================================================================== + // Attribute + // ========= + private BeanMetaData beanMetaData; + + private Object[] bindVariables; + + private ValueType[] bindVariableValueTypes; + + private Timestamp timestamp; + + private Integer versionNo; + + private PropertyType[] propertyTypes; + + // =================================================================================== + // Constructor + // =========== + public InternalAbstractAutoHandler(DataSource dataSource, + StatementFactory statementFactory, BeanMetaData beanMetaData, + PropertyType[] propertyTypes) { + super(dataSource, statementFactory); + this.beanMetaData = beanMetaData; + this.propertyTypes = propertyTypes; + } + + public int execute(Object[] args) throws SQLRuntimeException { + Connection connection = getConnection(); + try { + return execute(connection, args[0]); + } finally { + ConnectionUtil.close(connection); + } + } + + public int execute(Object[] args, Class[] argTypes) + throws SQLRuntimeException { + return execute(args); + } + + protected int execute(Connection connection, Object bean) { + preUpdateBean(bean); + setupBindVariables(bean); + logSql(bindVariables, getArgTypes(bindVariables)); + PreparedStatement ps = prepareStatement(connection); + int ret = -1; + try { + bindArgs(ps, bindVariables, bindVariableValueTypes); + ret = PreparedStatementUtil.executeUpdate(ps); + } finally { + StatementUtil.close(ps); + } + postUpdateBean(bean); + return ret; + } + + protected void bindArgs(PreparedStatement ps, Object[] args, + ValueType[] valueTypes) { + if (args == null) { + return; + } + for (int i = 0; i < args.length; ++i) { + ValueType valueType = valueTypes[i]; + try { + valueType.bindValue(ps, i + 1, args[i]); + } catch (SQLException ex) { + throw new SQLRuntimeException(ex); + } + } + } + + protected void preUpdateBean(Object bean) { + } + + protected void postUpdateBean(Object bean) { + } + + protected abstract void setupBindVariables(Object bean); + + protected void setupInsertBindVariables(Object bean) { + List varList = new ArrayList(); + List varValueTypeList = new ArrayList(); + final BeanMetaData bmd = getBeanMetaData(); + final String timestampPropertyName = bmd.getTimestampPropertyName(); + final String versionNoPropertyName = bmd.getVersionNoPropertyName(); + for (int i = 0; i < propertyTypes.length; ++i) { + PropertyType pt = propertyTypes[i]; + if (pt.getPropertyName().equalsIgnoreCase(timestampPropertyName)) { + setTimestamp(new Timestamp(new Date().getTime())); + varList.add(getTimestamp()); + } else if (pt.getPropertyName().equals(versionNoPropertyName)) { + setVersionNo(new Integer(0)); + varList.add(getVersionNo()); + } else { + varList.add(pt.getPropertyDesc().getValue(bean)); + } + varValueTypeList.add(pt.getValueType()); + } + setBindVariables(varList.toArray()); + setBindVariableValueTypes((ValueType[]) varValueTypeList + .toArray(new ValueType[varValueTypeList.size()])); + } + + protected void setupUpdateBindVariables(Object bean) { + List varList = new ArrayList(); + List varValueTypeList = new ArrayList(); + final BeanMetaData bmd = getBeanMetaData(); + final String timestampPropertyName = bmd.getTimestampPropertyName(); + final String versionNoPropertyName = bmd.getVersionNoPropertyName(); + for (int i = 0; i < propertyTypes.length; ++i) { + PropertyType pt = propertyTypes[i]; + if (pt.getPropertyName().equalsIgnoreCase(timestampPropertyName)) { + setTimestamp(new Timestamp(new Date().getTime())); + varList.add(getTimestamp()); + } else if (pt.getPropertyName().equals(versionNoPropertyName)) { + Object value = pt.getPropertyDesc().getValue(bean); + int intValue = IntegerConversionUtil.toPrimitiveInt(value) + 1; + setVersionNo(new Integer(intValue)); + varList.add(getVersionNo()); + } else { + varList.add(pt.getPropertyDesc().getValue(bean)); + } + varValueTypeList.add(pt.getValueType()); + } + addAutoUpdateWhereBindVariables(varList, varValueTypeList, bean); + setBindVariables(varList.toArray()); + setBindVariableValueTypes((ValueType[]) varValueTypeList + .toArray(new ValueType[varValueTypeList.size()])); + } + + protected void setupDeleteBindVariables(Object bean) { + List varList = new ArrayList(); + List varValueTypeList = new ArrayList(); + addAutoUpdateWhereBindVariables(varList, varValueTypeList, bean); + setBindVariables(varList.toArray()); + setBindVariableValueTypes((ValueType[]) varValueTypeList + .toArray(new ValueType[varValueTypeList.size()])); + } + + protected void addAutoUpdateWhereBindVariables(List varList, + List varValueTypeList, Object bean) { + BeanMetaData bmd = getBeanMetaData(); + for (int i = 0; i < bmd.getPrimaryKeySize(); ++i) { + PropertyType pt = bmd.getPropertyTypeByColumnName(bmd + .getPrimaryKey(i)); + PropertyDesc pd = pt.getPropertyDesc(); + varList.add(pd.getValue(bean)); + varValueTypeList.add(pt.getValueType()); + } + if (bmd.hasVersionNoPropertyType()) { + PropertyType pt = bmd.getVersionNoPropertyType(); + PropertyDesc pd = pt.getPropertyDesc(); + varList.add(pd.getValue(bean)); + varValueTypeList.add(pt.getValueType()); + } + if (bmd.hasTimestampPropertyType()) { + PropertyType pt = bmd.getTimestampPropertyType(); + PropertyDesc pd = pt.getPropertyDesc(); + varList.add(pd.getValue(bean)); + varValueTypeList.add(pt.getValueType()); + } + } + + protected void updateTimestampIfNeed(Object bean) { + if (getTimestamp() != null) { + PropertyDesc pd = getBeanMetaData().getTimestampPropertyType() + .getPropertyDesc(); + pd.setValue(bean, getTimestamp()); + } + } + + protected void updateVersionNoIfNeed(Object bean) { + if (getVersionNo() != null) { + PropertyDesc pd = getBeanMetaData().getVersionNoPropertyType() + .getPropertyDesc(); + pd.setValue(bean, getVersionNo()); + } + } + + // =================================================================================== + // Accessor + // ======== + public BeanMetaData getBeanMetaData() { + return beanMetaData; + } + + protected Object[] getBindVariables() { + return bindVariables; + } + + protected void setBindVariables(Object[] bindVariables) { + this.bindVariables = bindVariables; + } + + protected ValueType[] getBindVariableValueTypes() { + return bindVariableValueTypes; + } + + protected void setBindVariableValueTypes(ValueType[] bindVariableValueTypes) { + this.bindVariableValueTypes = bindVariableValueTypes; + } + + protected Timestamp getTimestamp() { + return timestamp; + } + + protected void setTimestamp(Timestamp timestamp) { + this.timestamp = timestamp; + } + + protected Integer getVersionNo() { + return versionNo; + } + + protected void setVersionNo(Integer versionNo) { + this.versionNo = versionNo; + } + + protected PropertyType[] getPropertyTypes() { + return propertyTypes; + } + + protected void setPropertyTypes(PropertyType[] propertyTypes) { + this.propertyTypes = propertyTypes; + } +} Property changes on: announcement/trunk/src/main/java/jp/sf/pal/announcement/db/allcommon/s2dao/internal/sqlhandler/InternalAbstractAutoHandler.java ___________________________________________________________________ Name: svn:eol-style + native Added: announcement/trunk/src/main/java/jp/sf/pal/announcement/db/allcommon/s2dao/internal/sqlhandler/InternalAbstractBatchAutoHandler.java =================================================================== --- announcement/trunk/src/main/java/jp/sf/pal/announcement/db/allcommon/s2dao/internal/sqlhandler/InternalAbstractBatchAutoHandler.java (rev 0) +++ announcement/trunk/src/main/java/jp/sf/pal/announcement/db/allcommon/s2dao/internal/sqlhandler/InternalAbstractBatchAutoHandler.java 2008-06-30 02:54:27 UTC (rev 1002) @@ -0,0 +1,116 @@ +package jp.sf.pal.announcement.db.allcommon.s2dao.internal.sqlhandler; + +import java.sql.Connection; +import java.sql.PreparedStatement; +import java.util.Arrays; +import java.util.Iterator; +import java.util.List; + +import javax.sql.DataSource; + +import org.seasar.dao.BeanMetaData; +import org.seasar.extension.jdbc.PropertyType; +import org.seasar.extension.jdbc.StatementFactory; +import org.seasar.extension.jdbc.util.ConnectionUtil; +import org.seasar.framework.exception.SQLRuntimeException; +import org.seasar.framework.util.PreparedStatementUtil; +import org.seasar.framework.util.StatementUtil; + +/** + * @author DBFlute(AutoGenerator) + */ +public abstract class InternalAbstractBatchAutoHandler extends + InternalAbstractAutoHandler { + + // =================================================================================== + // Definition + // ========== + /** Log instance. */ + private static final org.apache.commons.logging.Log _log = org.apache.commons.logging.LogFactory + .getLog(InternalAbstractBatchAutoHandler.class); + + // =================================================================================== + // Constructor + // =========== + public InternalAbstractBatchAutoHandler(DataSource dataSource, + StatementFactory statementFactory, BeanMetaData beanMetaData, + PropertyType[] propertyTypes) { + + super(dataSource, statementFactory, beanMetaData, propertyTypes); + } + + // =================================================================================== + // Execute + // ======= + public int[] execute(List list, Class[] argTypes) + throws SQLRuntimeException { + return execute(list); + } + + public int[] execute(List list) throws SQLRuntimeException { + if (list == null) { + throw new IllegalArgumentException("list"); + } + if (list.isEmpty()) { + if (_log.isDebugEnabled()) { + _log.debug("Skip executeBatch() bacause of the empty list."); + } + return new int[0]; + } + Connection connection = getConnection(); + try { + PreparedStatement ps = prepareStatement(connection); + try { + for (Iterator iter = list.iterator(); iter.hasNext();) { + Object bean = (Object) iter.next(); + execute(ps, bean); + } + return PreparedStatementUtil.executeBatch(ps); + } finally { + StatementUtil.close(ps); + } + } finally { + ConnectionUtil.close(connection); + } + } + + public int execute(Object[] args) throws SQLRuntimeException { + List list = null; + if (args[0] instanceof Object[]) { + list = Arrays.asList((Object[]) args[0]); + } else if (args[0] instanceof List) { + list = (List) args[0]; + } + if (list == null) { + throw new IllegalArgumentException("args[0]"); + } + int[] ret = execute(list); + int updatedRow = 0; + for (int i = 0; i < ret.length; i++) { + if (ret[i] > 0) { + updatedRow += ret[i]; + } + } + return updatedRow; + } + + public int[] executeBatch(Object[] args) throws SQLRuntimeException { + List list = null; + if (args[0] instanceof Object[]) { + list = Arrays.asList((Object[]) args[0]); + } else if (args[0] instanceof List) { + list = (List) args[0]; + } + if (list == null) { + throw new IllegalArgumentException("args[0]"); + } + return execute(list); + } + + protected void execute(PreparedStatement ps, Object bean) { + setupBindVariables(bean); + logSql(getBindVariables(), getArgTypes(getBindVariables())); + bindArgs(ps, getBindVariables(), getBindVariableValueTypes()); + PreparedStatementUtil.addBatch(ps); + } +} Property changes on: announcement/trunk/src/main/java/jp/sf/pal/announcement/db/allcommon/s2dao/internal/sqlhandler/InternalAbstractBatchAutoHandler.java ___________________________________________________________________ Name: svn:eol-style + native Added: announcement/trunk/src/main/java/jp/sf/pal/announcement/db/allcommon/s2dao/internal/sqlhandler/InternalBasicHandler.java =================================================================== --- announcement/trunk/src/main/java/jp/sf/pal/announcement/db/allcommon/s2dao/internal/sqlhandler/InternalBasicHandler.java (rev 0) +++ announcement/trunk/src/main/java/jp/sf/pal/announcement/db/allcommon/s2dao/internal/sqlhandler/InternalBasicHandler.java 2008-06-30 02:54:27 UTC (rev 1002) @@ -0,0 +1,178 @@ +package jp.sf.pal.announcement.db.allcommon.s2dao.internal.sqlhandler; + +import java.sql.Connection; +import java.sql.PreparedStatement; +import java.sql.SQLException; + +import javax.sql.DataSource; + +import jp.sf.pal.announcement.db.allcommon.QLog; +import jp.sf.pal.announcement.db.allcommon.cbean.ConditionBeanContext; +import jp.sf.pal.announcement.db.allcommon.s2dao.internal.sqllog.InternalSqlLogRegistry; +import jp.sf.pal.announcement.db.allcommon.s2dao.internal.util.InternalBindVariableUtil; +import jp.sf.pal.announcement.db.allcommon.util.SimpleSystemUtil; + +import org.seasar.extension.jdbc.StatementFactory; +import org.seasar.extension.jdbc.ValueType; +import org.seasar.extension.jdbc.types.ValueTypes; +import org.seasar.extension.jdbc.util.DataSourceUtil; +import org.seasar.framework.exception.EmptyRuntimeException; +import org.seasar.framework.exception.SQLRuntimeException; + +/** + * @author DBFlute(AutoGenerator) + */ +public class InternalBasicHandler { + + // =================================================================================== + // Definition + // ========== + /** Log instance. */ + private static final org.apache.commons.logging.Log _log = org.apache.commons.logging.LogFactory + .getLog(InternalBasicHandler.class); + + // =================================================================================== + // Attribute + // ========= + private DataSource dataSource; + + private String sql; + + private StatementFactory statementFactory; + + // =================================================================================== + // Constructor + // =========== + public InternalBasicHandler(DataSource ds, StatementFactory statementFactory) { + setDataSource(ds); + setStatementFactory(statementFactory); + } + + public InternalBasicHandler(DataSource ds, String sql, + StatementFactory statementFactory) { + setDataSource(ds); + setSql(sql); + setStatementFactory(statementFactory); + } + + // =================================================================================== + // Basic Method for SubClass + // ========================= + protected void bindArgs(PreparedStatement ps, Object[] args, + Class[] argTypes) { + if (args == null) { + return; + } + for (int i = 0; i < args.length; ++i) { + ValueType valueType = getValueType(argTypes[i]); + try { + valueType.bindValue(ps, i + 1, args[i]); + } catch (SQLException ex) { + throw new SQLRuntimeException(ex); + } + } + } + + protected Class[] getArgTypes(Object[] args) { + if (args == null) { + return null; + } + Class[] argTypes = new Class[args.length]; + for (int i = 0; i < args.length; ++i) { + Object arg = args[i]; + if (arg != null) { + argTypes[i] = arg.getClass(); + } + } + return argTypes; + } + + protected String getCompleteSql(Object[] args) { + return InternalBindVariableUtil.getCompleteSql(sql, args); + } + + protected String getBindVariableText(Object bindVariable) { + return InternalBindVariableUtil.getBindVariableText(bindVariable); + } + + protected ValueType getValueType(Class clazz) { + return ValueTypes.getValueType(clazz); + } + + protected void logSql(Object[] args, Class[] argTypes) { + if (QLog.isLogEnabled() + || InternalSqlLogRegistry.existsSqlLogRegistry()) { + final String completeSql = getCompleteSql(args); + if (isConditionBeanFormatSqlEffective()) { + QLog.log(getLineSeparator() + completeSql); + } else { + QLog.log(completeSql); + } + if (InternalSqlLogRegistry.existsSqlLogRegistry()) { + final Object sqlLogRegistry = InternalSqlLogRegistry + .findContainerSqlLogRegistry(); + if (sqlLogRegistry != null) { + InternalSqlLogRegistry.push(getSql(), completeSql, args, + argTypes, sqlLogRegistry); + } + } + } + } + + protected boolean isConditionBeanFormatSqlEffective() { + if (ConditionBeanContext.isExistConditionBeanOnThread()) { + if (ConditionBeanContext.getConditionBeanOnThread().isFormatSql()) { + return true; + } + } + return false; + } + + // =================================================================================== + // General Helper + // ============== + protected String getLineSeparator() { + return SimpleSystemUtil.getLineSeparator(); + } + + // =================================================================================== + // Accessor + // ======== + public DataSource getDataSource() { + return dataSource; + } + + public void setDataSource(DataSource dataSource) { + this.dataSource = dataSource; + } + + public String getSql() { + return sql; + } + + public void setSql(String sql) { + this.sql = sql; + } + + public StatementFactory getStatementFactory() { + return statementFactory; + } + + public void setStatementFactory(StatementFactory statementFactory) { + this.statementFactory = statementFactory; + } + + protected Connection getConnection() { + if (dataSource == null) { + throw new EmptyRuntimeException("dataSource"); + } + return DataSourceUtil.getConnection(dataSource); + } + + protected PreparedStatement prepareStatement(Connection connection) { + if (sql == null) { + throw new EmptyRuntimeException("sql"); + } + return statementFactory.createPreparedStatement(connection, sql); + } +} Property changes on: announcement/trunk/src/main/java/jp/sf/pal/announcement/db/allcommon/s2dao/internal/sqlhandler/InternalBasicHandler.java ___________________________________________________________________ Name: svn:eol-style + native Added: announcement/trunk/src/main/java/jp/sf/pal/announcement/db/allcommon/s2dao/internal/sqlhandler/InternalBasicSelectHandler.java =================================================================== --- announcement/trunk/src/main/java/jp/sf/pal/announcement/db/allcommon/s2dao/internal/sqlhandler/InternalBasicSelectHandler.java (rev 0) +++ announcement/trunk/src/main/java/jp/sf/pal/announcement/db/allcommon/s2dao/internal/sqlhandler/InternalBasicSelectHandler.java 2008-06-30 02:54:27 UTC (rev 1002) @@ -0,0 +1,151 @@ +package jp.sf.pal.announcement.db.allcommon.s2dao.internal.sqlhandler; + +import java.sql.Connection; +import java.sql.DatabaseMetaData; +import java.sql.PreparedStatement; +import java.sql.ResultSet; +import java.sql.SQLException; + +import javax.sql.DataSource; + +import org.seasar.extension.jdbc.ResultSetFactory; +import org.seasar.extension.jdbc.ResultSetHandler; +import org.seasar.extension.jdbc.SelectHandler; +import org.seasar.extension.jdbc.StatementFactory; +import org.seasar.extension.jdbc.util.ConnectionUtil; +import org.seasar.framework.exception.EmptyRuntimeException; +import org.seasar.framework.exception.SQLRuntimeException; +import org.seasar.framework.util.ResultSetUtil; +import org.seasar.framework.util.StatementUtil; + +/** + * @author DBFlute(AutoGenerator) + */ +public class InternalBasicSelectHandler extends InternalBasicHandler implements + SelectHandler { + + // =================================================================================== + // Attribute + // ========= + private ResultSetFactory resultSetFactory; + + private ResultSetHandler resultSetHandler; + + private int fetchSize = 100; + + private int maxRows = -1; + + // =================================================================================== + // Constructor + // =========== + public InternalBasicSelectHandler(DataSource dataSource, String sql, + ResultSetHandler resultSetHandler, + StatementFactory statementFactory, ResultSetFactory resultSetFactory) { + super(dataSource, statementFactory); + setSql(sql); + setResultSetHandler(resultSetHandler); + setResultSetFactory(resultSetFactory); + } + + // =================================================================================== + // Execute + // ======= + public Object execute(Object[] args) throws SQLRuntimeException { + return execute(args, getArgTypes(args)); + } + + public Object execute(Object[] args, Class[] argTypes) + throws SQLRuntimeException { + Connection con = getConnection(); + try { + return execute(con, args, argTypes); + } finally { + ConnectionUtil.close(con); + } + } + + public Object execute(Connection connection, Object[] args, Class[] argTypes) + throws SQLRuntimeException { + logSql(args, argTypes); + PreparedStatement ps = null; + try { + ps = prepareStatement(connection); + bindArgs(ps, args, argTypes); + return execute(ps); + } catch (SQLException ex) { + throw new SQLRuntimeException(ex); + } finally { + StatementUtil.close(ps); + } + } + + protected Object[] setup(Connection con, Object[] args) { + return args; + } + + protected PreparedStatement prepareStatement(Connection connection) { + PreparedStatement ps = super.prepareStatement(connection); + if (fetchSize > -1) { + StatementUtil.setFetchSize(ps, fetchSize); + } + if (maxRows > -1) { + StatementUtil.setMaxRows(ps, maxRows); + } + return ps; + } + + protected Object execute(PreparedStatement ps) throws SQLException { + if (resultSetHandler == null) { + throw new EmptyRuntimeException("resultSetHandler"); + } + ResultSet resultSet = null; + try { + resultSet = createResultSet(ps); + return resultSetHandler.handle(resultSet); + } finally { + ResultSetUtil.close(resultSet); + } + } + + protected void setupDatabaseMetaData(DatabaseMetaData dbMetaData) { + } + + protected ResultSet createResultSet(PreparedStatement ps) { + return resultSetFactory.createResultSet(ps); + } + + // =================================================================================== + // Accessor + // ======== + public ResultSetFactory getResultSetFactory() { + return resultSetFactory; + } + + public void setResultSetFactory(ResultSetFactory resultSetFactory) { + this.resultSetFactory = resultSetFactory; + } + + public ResultSetHandler getResultSetHandler() { + return resultSetHandler; + } + + public void setResultSetHandler(ResultSetHandler resultSetHandler) { + this.resultSetHandler = resultSetHandler; + } + + public int getFetchSize() { + return fetchSize; + } + + public void setFetchSize(int fetchSize) { + this.fetchSize = fetchSize; + } + + public int getMaxRows() { + return maxRows; + } + + public void setMaxRows(int maxRows) { + this.maxRows = maxRows; + } +} Property changes on: announcement/trunk/src/main/java/jp/sf/pal/announcement/db/allcommon/s2dao/internal/sqlhandler/InternalBasicSelectHandler.java ___________________________________________________________________ Name: svn:eol-style + native Added: announcement/trunk/src/main/java/jp/sf/pal/announcement/db/allcommon/s2dao/internal/sqlhandler/InternalBasicUpdateHandler.java =================================================================== --- announcement/trunk/src/main/java/jp/sf/pal/announcement/db/allcommon/s2dao/internal/sqlhandler/InternalBasicUpdateHandler.java (rev 0) +++ announcement/trunk/src/main/java/jp/sf/pal/announcement/db/allcommon/s2dao/internal/sqlhandler/InternalBasicUpdateHandler.java 2008-06-30 02:54:27 UTC (rev 1002) @@ -0,0 +1,56 @@ +package jp.sf.pal.announcement.db.allcommon.s2dao.internal.sqlhandler; + +import java.sql.Connection; +import java.sql.PreparedStatement; + +import javax.sql.DataSource; + +import org.seasar.extension.jdbc.StatementFactory; +import org.seasar.extension.jdbc.UpdateHandler; +import org.seasar.extension.jdbc.util.ConnectionUtil; +import org.seasar.framework.exception.SQLRuntimeException; +import org.seasar.framework.util.PreparedStatementUtil; +import org.seasar.framework.util.StatementUtil; + +/** + * @author DBFlute(AutoGenerator) + */ +public class InternalBasicUpdateHandler extends InternalBasicHandler implements + UpdateHandler { + + // =================================================================================== + // Constructor + // =========== + public InternalBasicUpdateHandler(DataSource dataSource, String sql, + StatementFactory statementFactory) { + super(dataSource, sql, statementFactory); + } + + // =================================================================================== + // Execute + // ======= + public int execute(Object[] args) throws SQLRuntimeException { + return execute(args, getArgTypes(args)); + } + + public int execute(Object[] args, Class[] argTypes) + throws SQLRuntimeException { + Connection connection = getConnection(); + try { + return execute(connection, args, argTypes); + } finally { + ConnectionUtil.close(connection); + } + } + + public int execute(Connection connection, Object[] args, Class[] argTypes) { + logSql(args, argTypes); + PreparedStatement ps = prepareStatement(connection); + try { + bindArgs(ps, args, argTypes); + return PreparedStatementUtil.executeUpdate(ps); + } finally { + StatementUtil.close(ps); + } + } +} Property changes on: announcement/trunk/src/main/java/jp/sf/pal/announcement/db/allcommon/s2dao/internal/sqlhandler/InternalBasicUpdateHandler.java ___________________________________________________________________ Name: svn:eol-style + native Added: announcement/trunk/src/main/java/jp/sf/pal/announcement/db/allcommon/s2dao/internal/sqlhandler/InternalCommandContextHandler.java =================================================================== --- announcement/trunk/src/main/java/jp/sf/pal/announcement/db/allcommon/s2dao/internal/sqlhandler/InternalCommandContextHandler.java (rev 0) +++ announcement/trunk/src/main/java/jp/sf/pal/announcement/db/allcommon/s2dao/internal/sqlhandler/InternalCommandContextHandler.java 2008-06-30 02:54:27 UTC (rev 1002) @@ -0,0 +1,61 @@ +package jp.sf.pal.announcement.db.allcommon.s2dao.internal.sqlhandler; + +import java.sql.Connection; +import java.sql.PreparedStatement; + +import javax.sql.DataSource; + +import org.seasar.dao.CommandContext; +import org.seasar.extension.jdbc.StatementFactory; +import org.seasar.extension.jdbc.util.ConnectionUtil; +import org.seasar.framework.exception.SQLRuntimeException; +import org.seasar.framework.util.PreparedStatementUtil; +import org.seasar.framework.util.StatementUtil; + +/** + * @author DBFlute(AutoGenerator) + */ +public class InternalCommandContextHandler extends InternalBasicHandler { + + // =================================================================================== + // Attribute + // ========= + protected CommandContext commandContext; + + // =================================================================================== + // Constructor + // =========== + public InternalCommandContextHandler(DataSource dataSource, + StatementFactory statementFactory, CommandContext commandContext) { + super(dataSource, statementFactory); + this.commandContext = commandContext; + setSql(commandContext.getSql()); + } + + // =================================================================================== + // Execute + // ======= + public int execute(Object[] args) throws SQLRuntimeException { + final Connection connection = getConnection(); + try { + return execute(connection, commandContext); + } finally { + ConnectionUtil.close(connection); + } + } + + protected int execute(Connection connection, CommandContext context) { + logSql(context.getBindVariables(), getArgTypes(context + .getBindVariables())); + PreparedStatement ps = prepareStatement(connection); + int ret = -1; + try { + bindArgs(ps, context.getBindVariables(), context + .getBindVariableTypes()); + ret = PreparedStatementUtil.executeUpdate(ps); + } finally { + StatementUtil.close(ps); + } + return ret; + } +} Property changes on: announcement/trunk/src/main/java/jp/sf/pal/announcement/db/allcommon/s2dao/internal/sqlhandler/InternalCommandContextHandler.java ___________________________________________________________________ Name: svn:eol-style + native Added: announcement/trunk/src/main/java/jp/sf/pal/announcement/db/allcommon/s2dao/internal/sqlhandler/InternalDeleteAutoHandler.java =================================================================== --- announcement/trunk/src/main/java/jp/sf/pal/announcement/db/allcommon/s2dao/internal/sqlhandler/InternalDeleteAutoHandler.java (rev 0) +++ announcement/trunk/src/main/java/jp/sf/pal/announcement/db/allcommon/s2dao/internal/sqlhandler/InternalDeleteAutoHandler.java 2008-06-30 02:54:27 UTC (rev 1002) @@ -0,0 +1,30 @@ +package jp.sf.pal.announcement.db.allcommon.s2dao.internal.sqlhandler; + +import javax.sql.DataSource; + +import org.seasar.dao.BeanMetaData; +import org.seasar.extension.jdbc.PropertyType; +import org.seasar.extension.jdbc.StatementFactory; + +/** + * @author DBFlute(AutoGenerator) + */ +public class InternalDeleteAutoHandler extends InternalAbstractAutoHandler { + + // =================================================================================== + // Constructor + // =========== + public InternalDeleteAutoHandler(DataSource dataSource, + StatementFactory statementFactory, BeanMetaData beanMetaData, + PropertyType[] propertyTypes) { + super(dataSource, statementFactory, beanMetaData, propertyTypes); + } + + // =================================================================================== + // Override + // ======== + @Override + protected void setupBindVariables(Object bean) { + setupDeleteBindVariables(bean); + } +} \ No newline at end of file Property changes on: announcement/trunk/src/main/java/jp/sf/pal/announcement/db/allcommon/s2dao/internal/sqlhandler/InternalDeleteAutoHandler.java ___________________________________________________________________ Name: svn:eol-style + native Added: announcement/trunk/src/main/java/jp/sf/pal/announcement/db/allcommon/s2dao/internal/sqlhandler/InternalDeleteBatchAutoHandler.java =================================================================== --- announcement/trunk/src/main/java/jp/sf/pal/announcement/db/allcommon/s2dao/internal/sqlhandler/InternalDeleteBatchAutoHandler.java (rev 0) +++ announcement/trunk/src/main/java/jp/sf/pal/announcement/db/allcommon/s2dao/internal/sqlhandler/InternalDeleteBatchAutoHandler.java 2008-06-30 02:54:27 UTC (rev 1002) @@ -0,0 +1,32 @@ +package jp.sf.pal.announcement.db.allcommon.s2dao.internal.sqlhandler; + +import javax.sql.DataSource; + +import org.seasar.dao.BeanMetaData; +import org.seasar.extension.jdbc.PropertyType; +import org.seasar.extension.jdbc.StatementFactory; + +/** + * @author DBFlute(AutoGenerator) + */ +public class InternalDeleteBatchAutoHandler extends + InternalAbstractBatchAutoHandler { + + // =================================================================================== + // Constructor + // =========== + public InternalDeleteBatchAutoHandler(DataSource dataSource, + StatementFactory statementFactory, BeanMetaData beanMetaData, + PropertyType[] propertyTypes) { + + super(dataSource, statementFactory, beanMetaData, propertyTypes); + } + + // =================================================================================== + // Override + // ======== + @Override + protected void setupBindVariables(Object bean) { + setupDeleteBindVariables(bean); + } +} \ No newline at end of file Property changes on: announcement/trunk/src/main/java/jp/sf/pal/announcement/db/allcommon/s2dao/internal/sqlhandler/InternalDeleteBatchAutoHandler.java ___________________________________________________________________ Name: svn:eol-style + native Added: announcement/trunk/src/main/java/jp/sf/pal/announcement/db/allcommon/s2dao/internal/sqlhandler/InternalInsertAutoHandler.java =================================================================== --- announcement/trunk/src/main/java/jp/sf/pal/announcement/db/allcommon/s2dao/internal/sqlhandler/InternalInsertAutoHandler.java (rev 0) +++ announcement/trunk/src/main/java/jp/sf/pal/announcement/db/allcommon/s2dao/internal/sqlhandler/InternalInsertAutoHandler.java 2008-06-30 02:54:27 UTC (rev 1002) @@ -0,0 +1,55 @@ +package jp.sf.pal.announcement.db.allcommon.s2dao.internal.sqlhandler; + +import javax.sql.DataSource; + +import org.seasar.dao.BeanMetaData; +import org.seasar.dao.IdentifierGenerator; +import org.seasar.extension.jdbc.PropertyType; +import org.seasar.extension.jdbc.StatementFactory; + +/** + * @author DBFlute(AutoGenerator) + */ +public class InternalInsertAutoHandler extends InternalAbstractAutoHandler { + + // =================================================================================== + // Constructor + // =========== + public InternalInsertAutoHandler(DataSource dataSource, + StatementFactory statementFactory, BeanMetaData beanMetaData, + PropertyType[] propertyTypes) { + super(dataSource, statementFactory, beanMetaData, propertyTypes); + } + + // =================================================================================== + // Override + // ======== + @Override + protected void setupBindVariables(Object bean) { + setupInsertBindVariables(bean); + } + + @Override + protected void preUpdateBean(Object bean) { + BeanMetaData bmd = getBeanMetaData(); + for (int i = 0; i < bmd.getIdentifierGeneratorSize(); i++) { + IdentifierGenerator generator = bmd.getIdentifierGenerator(i); + if (generator.isSelfGenerate()) { + generator.setIdentifier(bean, getDataSource()); + } + } + } + + @Override + protected void postUpdateBean(Object bean) { + BeanMetaData bmd = getBeanMetaData(); + for (int i = 0; i < bmd.getIdentifierGeneratorSize(); i++) { + IdentifierGenerator generator = bmd.getIdentifierGenerator(i); + if (!generator.isSelfGenerate()) { + generator.setIdentifier(bean, getDataSource()); + } + } + updateVersionNoIfNeed(bean); + updateTimestampIfNeed(bean); + } +} Property changes on: announcement/trunk/src/main/java/jp/sf/pal/announcement/db/allcommon/s2dao/internal/sqlhandler/InternalInsertAutoHandler.java ___________________________________________________________________ Name: svn:eol-style + native Added: announcement/trunk/src/main/java/jp/sf/pal/announcement/db/allcommon/s2dao/internal/sqlhandler/InternalInsertBatchAutoHandler.java =================================================================== --- announcement/trunk/src/main/java/jp/sf/pal/announcement/db/allcommon/s2dao/internal/sqlhandler/InternalInsertBatchAutoHandler.java (rev 0) +++ announcement/trunk/src/main/java/jp/sf/pal/announcement/db/allcommon/s2dao/internal/sqlhandler/InternalInsertBatchAutoHandler.java 2008-06-30 02:54:27 UTC (rev 1002) @@ -0,0 +1,32 @@ +package jp.sf.pal.announcement.db.allcommon.s2dao.internal.sqlhandler; + +import javax.sql.DataSource; + +import org.seasar.dao.BeanMetaData; +import org.seasar.extension.jdbc.PropertyType; +import org.seasar.extension.jdbc.StatementFactory; + +/** + * @author DBFlute(AutoGenerator) + */ +public class InternalInsertBatchAutoHandler extends + InternalAbstractBatchAutoHandler { + + // =================================================================================== + // Constructor + // =========== + public InternalInsertBatchAutoHandler(DataSource dataSource, + StatementFactory statementFactory, BeanMetaData beanMetaData, + PropertyType[] propertyTypes) { + + super(dataSource, statementFactory, beanMetaData, propertyTypes); + } + + // =================================================================================== + // Override + // ======== + @Override + protected void setupBindVariables(Object bean) { + setupInsertBindVariables(bean); + } +} \ No newline at end of file Property changes on: announcement/trunk/src/main/java/jp/sf/pal/announcement/db/allcommon/s2dao/internal/sqlhandler/InternalInsertBatchAutoHandler.java ___________________________________________________________________ Name: svn:eol-style + native Added: announcement/trunk/src/main/java/jp/sf/pal/announcement/db/allcommon/s2dao/internal/sqlhandler/InternalUpdateAutoHandler.java =================================================================== --- announcement/trunk/src/main/java/jp/sf/pal/announcement/db/allcommon/s2dao/internal/sqlhandler/InternalUpdateAutoHandler.java (rev 0) +++ announcement/trunk/src/main/java/jp/sf/pal/announcement/db/allcommon/s2dao/internal/sqlhandler/InternalUpdateAutoHandler.java 2008-06-30 02:54:27 UTC (rev 1002) @@ -0,0 +1,36 @@ +package jp.sf.pal.announcement.db.allcommon.s2dao.internal.sqlhandler; + +import javax.sql.DataSource; + +import org.seasar.dao.BeanMetaData; +import org.seasar.extension.jdbc.PropertyType; +import org.seasar.extension.jdbc.StatementFactory; + +/** + * @author DBFlute(AutoGenerator) + */ +public class InternalUpdateAutoHandler extends InternalAbstractAutoHandler { + + // =================================================================================== + // Constructor + // =========== + public InternalUpdateAutoHandler(DataSource dataSource, + StatementFactory statementFactory, BeanMetaData beanMetaData, + PropertyType[] propertyTypes) { + super(dataSource, statementFactory, beanMetaData, propertyTypes); + } + + // =================================================================================== + // Override + // ======== + @Override + protected void setupBindVariables(Object bean) { + setupUpdateBindVariables(bean); + } + + @Override + protected void postUpdateBean(Object bean) { + updateVersionNoIfNeed(bean); + updateTimestampIfNeed(bean); + } +} Property changes on: announcement/trunk/src/main/java/jp/sf/pal/announcement/db/allcommon/s2dao/internal/sqlhandler/InternalUpdateAutoHandler.java ___________________________________________________________________ Name: svn:eol-style + native Added: announcement/trunk/src/main/java/jp/sf/pal/announcement/db/allcommon/s2dao/internal/sqlhandler/InternalUpdateBatchAutoHandler.java =================================================================== --- announcement/trunk/src/main/java/jp/sf/pal/announcement/db/allcommon/s2dao/internal/sqlhandler/InternalUpdateBatchAutoHandler.java (rev 0) +++ announcement/trunk/src/main/java/jp/sf/pal/announcement/db/allcommon/s2dao/internal/sqlhandler/InternalUpdateBatchAutoHandler.java 2008-06-30 02:54:27 UTC (rev 1002) @@ -0,0 +1,32 @@ +package jp.sf.pal.announcement.db.allcommon.s2dao.internal.sqlhandler; + +import javax.sql.DataSource; + +import org.seasar.dao.BeanMetaData; +import org.seasar.extension.jdbc.PropertyType; +import org.seasar.extension.jdbc.StatementFactory; + +/** + * @author DBFlute(AutoGenerator) + */ +public class InternalUpdateBatchAutoHandler extends + InternalAbstractBatchAutoHandler { + + // =================================================================================== + // Constructor + // =========== + public InternalUpdateBatchAutoHandler(DataSource dataSource, + StatementFactory statementFactory, BeanMetaData beanMetaData, + PropertyType[] propertyTypes) { + + super(dataSource, statementFactory, beanMetaData, propertyTypes); + } + + // =================================================================================== + // Override + // ======== + @Override + protected void setupBindVariables(Object bean) { + setupUpdateBindVariables(bean); + } +} \ No newline at end of file Property changes on: announcement/trunk/src/main/java/jp/sf/pal/announcement/db/allcommon/s2dao/internal/sqlhandler/InternalUpdateBatchAutoHandler.java ___________________________________________________________________ Name: svn:eol-style + native Added: announcement/trunk/src/main/java/jp/sf/pal/announcement/db/allcommon/s2dao/internal/sqllog/InternalSqlLog.java =================================================================== --- announcement/trunk/src/main/java/jp/sf/pal/announcement/db/allcommon/s2dao/internal/sqllog/InternalSqlLog.java (rev 0) +++ announcement/trunk/src/main/java/jp/sf/pal/announcement/db/allcommon/s2dao/internal/sqllog/InternalSqlLog.java 2008-06-30 02:54:27 UTC (rev 1002) @@ -0,0 +1,52 @@ +package jp.sf.pal.announcement.db.allcommon.s2dao.internal.sqllog; + +/** + * @author DBFlute(AutoGenerator) + */ +public class InternalSqlLog { + + // =================================================================================== + // Attribute + // ========= + private String rawSql; + + private String completeSql; + + private Object[] bindArgs; + + private Class[] bindArgTypes; + + // =================================================================================== + // Constructor + // =========== + public InternalSqlLog(String rawSql, String completeSql, Object[] bindArgs, + Class[] bindArgTypes) { + this.rawSql = rawSql; + this.completeSql = completeSql; + this.bindArgs = bindArgs; + this.bindArgTypes = bindArgTypes; + } + + // =================================================================================== + // Accessor + // ======== + public Object[] getBindArgs() { + return bindArgs; + } + + public Class[] getBindArgTypes() { + return bindArgTypes; + } + + public String getCompleteSql() { + return completeSql; + } + + public String getRawSql() { + return rawSql; + } + + public String toString() { + return rawSql; + } +} Property changes on: announcement/trunk/src/main/java/jp/sf/pal/announcement/db/allcommon/s2dao/internal/sqllog/InternalSqlLog.java ___________________________________________________________________ Name: svn:eol-style + native Added: announcement/trunk/src/main/java/jp/sf/pal/announcement/db/allcommon/s2dao/internal/sqllog/InternalSqlLogRegistry.java =================================================================== --- announcement/trunk/src/main/java/jp/sf/pal/announcement/db/allcommon/s2dao/internal/sqllog/InternalSqlLogRegistry.java (rev 0) +++ announcement/trunk/src/main/java/jp/sf/pal/announcement/db/allcommon/s2dao/internal/sqllog/InternalSqlLogRegistry.java 2008-06-30 02:54:27 UTC (rev 1002) @@ -0,0 +1,203 @@ +package jp.sf.pal.announcement.db.allcommon.s2dao.internal.sqllog; + +import java.lang.reflect.Constructor; +import java.lang.reflect.Method; + +/** + * @author DBFlute(AutoGenerator) + */ +public class InternalSqlLogRegistry { + + // =================================================================================== + // Definition + // ========== + /** Log instance. */ + private static final org.apache.commons.logging.Log _log = org.apache.commons.logging.LogFactory + .getLog(InternalSqlLogRegistry.class); + + // =================================================================================== + // Definition + // ========== + protected static final String NAME_SqlLogRegistryLocator = "org.seasar.extension.jdbc.SqlLogRegistryLocator"; + + protected static final String NAME_getInstance = "getInstance"; + + protected static final String NAME_setInstance = "setInstance"; + + protected static final String NAME_SqlLogRegistry = "org.seasar.extension.jdbc.SqlLogRegistry"; + + protected static final String NAME_SqlLog = "org.seasar.extension.jdbc.SqlLog"; + + protected static final String NAME_SqlLogImpl = "org.seasar.extension.jdbc.impl.SqlLogImpl"; + + protected static boolean STATUS_SqlLogExists = false; + static { + forNameContainerSqlLogRegistryLocator(); + } + + // =================================================================================== + // Public Entry + // ============ + public static boolean existsSqlLogRegistry() { + return STATUS_SqlLogExists; + } + + public static Object findContainerSqlLogRegistry() { + final Class sqlLogRegistryLocatorType = forNameContainerSqlLogRegistryLocator(); + if (sqlLogRegistryLocatorType == null) { + return null; + } + try { + final Method method = sqlLogRegistryLocatorType.getMethod( + NAME_getInstance, (Class[]) null); + return method.invoke(null, (Object[]) null); + } catch (Exception e) { + String msg = "InternalSqlLogRegistry.findContainerSqlLogRegistry() threw the exception:"; + msg = msg + " sqlLogRegistryLocatorType=" + + sqlLogRegistryLocatorType; + msg = msg + " NAME_getInstance=" + NAME_getInstance; + throw new IllegalStateException(msg, e); + } + } + + public static void closeRegistration() { + final Class sqlLogRegistryLocatorType = forNameContainerSqlLogRegistryLocator(); + if (sqlLogRegistryLocatorType == null) { + return; + } + final Class sqlLogRegistryType = forNameContainerSqlLogRegistry(); + if (sqlLogRegistryType == null) { + return; + } + try { + final Method method = sqlLogRegistryLocatorType.getMethod( + NAME_setInstance, new Class[] { sqlLogRegistryType }); + _log.info("...Closing the registration of sqlLog."); + method.invoke(null, new Object[] { null }); + } catch (Exception e) { + String msg = "InternalSqlLogRegistry.closeRegistration() threw the exception:"; + msg = msg + " sqlLogRegistryLocatorType=" + + sqlLogRegistryLocatorType; + msg = msg + " NAME_setInstance=" + NAME_setInstance; + throw new IllegalStateException(msg, e); + } + } + + public static void push(String rawSql, String completeSql, + Object[] bindArgs, Class[] bindArgTypes, Object sqlLogRegistry) { + if (sqlLogRegistry == null) { + throw new IllegalArgumentException( + "sqlLogRegistry should not be null!"); + } + final Object sqlLogImpl = createContainerSqlLogImpl(rawSql, + completeSql, bindArgs, bindArgTypes); + reflectSqlLogToContainerSqlLogRegistry(sqlLogImpl, sqlLogRegistry); + } + + public static String peekCompleteSql() { + final Object sqlLogRegistry = findContainerSqlLogRegistry(); + if (sqlLogRegistry == null) { + return null; + } + final Object sqlLog = findLastContainerSqlLog(sqlLogRegistry); + if (sqlLog == null) { + return null; + } + return extractCompleteSqlFromContainerSqlLog(sqlLog); + } + + // =================================================================================== + // Container Reflection + // ==================== + protected static Object createContainerSqlLogImpl(String rawSql, + String completeSql, Object[] bindArgs, Class[] bindArgTypes) { + try { + final Class sqlLogImplType = Class.forName(NAME_SqlLogImpl); + final Class[] argTypes = new Class[] { String.class, + String.class, Object[].class, Class[].class }; + final Constructor constructor = sqlLogImplType + .getConstructor(argTypes); + return constructor.newInstance(new Object[] { rawSql, completeSql, + bindArgs, bindArgTypes }); + } catch (Exception e) { + String msg = "InternalSqlLogRegistry.createContainerSqlLogImpl() threw the exception:"; + msg = msg + " completeSql=" + completeSql; + msg = msg + " NAME_SqlLogImpl=" + NAME_SqlLogImpl; + throw new IllegalStateException(msg, e); + } + } + + protected static void reflectSqlLogToContainerSqlLogRegistry(Object sqlLog, + Object sqlLogRegistry) { + if (sqlLog == null || sqlLogRegistry == null) { + return; + } + try { + final Class sqlLogRegistryType = sqlLogRegistry.getClass(); + final Class sqlLogType = Class.forName(NAME_SqlLog); + final Method method = sqlLogRegistryType.getMethod("add", + new Class[] { sqlLogType }); + method.invoke(sqlLogRegistry, new Object[] { sqlLog }); + } catch (Exception e) { + String msg = "InternalSqlLogRegistry.reflectToContainerSqlLogRegistry() threw the exception:"; + msg = msg + " sqlLog=" + sqlLog + " sqlLogRegistry=" + + sqlLogRegistry; + msg = msg + " NAME_SqlLog=" + NAME_SqlLog; + throw new IllegalStateException(msg, e); + } + } + + protected static Object findLastContainerSqlLog(Object sqlLogRegistry) { + if (sqlLogRegistry == null) { + return null; + } + try { + final Class sqlLogRegistryType = sqlLogRegistry.getClass(); + final Method method = sqlLogRegistryType.getMethod("getLast", + (Class[]) null); + return method.invoke(sqlLogRegistry, (Object[]) null); + } catch (Exception e) { + String msg = "InternalSqlLogRegistry.findLastContainerSqlLog() threw the exception:"; + msg = msg + " sqlLogRegistry=" + sqlLogRegistry; + throw new IllegalStateException(msg, e); + } + } + + protected static String extractCompleteSqlFromContainerSqlLog(Object sqlLog) { + if (sqlLog == null) { + return null; + } + try { + final Class sqlLogType = sqlLog.getClass(); + final Method method = sqlLogType.getMethod("getCompleteSql", + (Class[]) null); + return (String) method.invoke(sqlLog, (Object[]) null); + } catch (Exception e) { + String msg = "InternalSqlLogRegistry.extractCompleteSqlFromContainerSqlLog() threw the exception:"; + msg = msg + " sqlLog=" + sqlLog; + throw new IllegalStateException(msg, e); + } + } + + protected static Class forNameContainerSqlLogRegistryLocator() { + Class clazz = null; + try { + clazz = Class.forName(NAME_SqlLogRegistryLocator); + STATUS_SqlLogExists = true; + } catch (Exception ignored) { + STATUS_SqlLogExists = false; + return null; + } + return clazz; + } + + protected static Class forNameContainerSqlLogRegistry() { + Class clazz = null; + try { + clazz = Class.forName(NAME_SqlLogRegistry); + } catch (Exception ignored) { + return null; + } + return clazz; + } +} Property changes on: announcement/trunk/src/main/java/jp/sf/pal/announcement/db/allcommon/s2dao/internal/sqllog/InternalSqlLogRegistry.java ___________________________________________________________________ Name: svn:eol-style + native Added: announcement/trunk/src/main/java/jp/sf/pal/announcement/db/allcommon/s2dao/internal/sqlparser/InternalCommandContextCreator.java =================================================================== --- announcement/trunk/src/main/java/jp/sf/pal/announcement/db/allcommon/s2dao/internal/sqlparser/InternalCommandContextCreator.java (rev 0) +++ announcement/trunk/src/main/java/jp/sf/pal/announcement/db/allcommon/s2dao/internal/sqlparser/InternalCommandContextCreator.java 2008-06-30 02:54:27 UTC (rev 1002) @@ -0,0 +1,50 @@ +package jp.sf.pal.announcement.db.allcommon.s2dao.internal.sqlparser; + +import org.seasar.dao.CommandContext; +import org.seasar.dao.context.CommandContextImpl; + +/** + * @author DBFlute(AutoGenerator) + */ +public class InternalCommandContextCreator { + + // =================================================================================== + // Attribute + // ========= + protected String[] argNames; + + protected Class[] argTypes; + + // =================================================================================== + // Constructor + // =========== + public InternalCommandContextCreator(String[] argNames, Class[] argTypes) { + this.argNames = (argNames != null ? argNames : new String[0]); + this.argTypes = (argTypes != null ? argTypes : new Class[0]); + } + + // =================================================================================== + // Create + // ====== + public CommandContext createCommandContext(Object[] args) { + final CommandContext ctx = new CommandContextImpl(); + if (args != null) { + for (int i = 0; i < args.length; ++i) { + Class argType = null; + if (args[i] != null) { + if (i < argTypes.length) { + argType = argTypes[i]; + } else if (args[i] != null) { + argType = args[i].getClass(); + } + } + if (i < argNames.length) { + ctx.addArg(argNames[i], args[i], argType); + } else { + ctx.addArg("$" + (i + 1), args[i], argType); + } + } + } + return ctx; + } +} Property changes on: announcement/trunk/src/main/java/jp/sf/pal/announcement/db/allcommon/s2dao/internal/sqlparser/InternalCommandContextCreator.java ___________________________________________________________________ Name: svn:eol-style + native Added: announcement/trunk/src/main/java/jp/sf/pal/announcement/db/allcommon/s2dao/internal/sqlparser/InternalSqlParser.java =================================================================== --- announcement/trunk/src/main/java/jp/sf/pal/announcement/db/allcommon/s2dao/internal/sqlparser/InternalSqlParser.java (rev 0) +++ announcement/trunk/src/main/java/jp/sf/pal/announcement/db/allcommon/s2dao/internal/sqlparser/InternalSqlParser.java 2008-06-30 02:54:27 UTC (rev 1002) @@ -0,0 +1,1201 @@ +package jp.sf.pal.announcement.db.allcommon.s2dao.internal.sqlparser; + +import java.lang.reflect.Array; +import java.lang.reflect.Method; +import java.util.ArrayList; +import java.util.List; +import java.util.Map; +import java.util.Stack; +import java.util.StringTokenizer; + +import jp.sf.pal.announcement.db.allcommon.cbean.MapParameterBean; +import jp.sf.pal.announcement.db.allcommon.cbean.coption.LikeSearchOption; +import jp.sf.pal.announcement.db.allcommon.exception.BindVariableCommentNotFoundPropertyException; +import jp.sf.pal.announcement.db.allcommon.exception.BindVariableParameterNullValueException; +import jp.sf.pal.announcement.db.allcommon.exception.EmbeddedValueCommentNotFoundPropertyException; +import jp.sf.pal.announcement.db.allcommon.exception.EmbeddedValueParameterNullValueException; +import jp.sf.pal.announcement.db.allcommon.exception.EndCommentNotFoundException; +import jp.sf.pal.announcement.db.allcommon.exception.IfCommentConditionNotFoundException; +import jp.sf.pal.announcement.db.allcommon.exception.IfCommentNotBooleanResultException; +import jp.sf.pal.announcement.db.allcommon.exception.IfCommentWrongExpressionException; +import jp.sf.pal.announcement.db.allcommon.exception.RequiredOptionNotFoundException; +import jp.sf.pal.announcement.db.allcommon.s2dao.internal.util.InternalBindVariableUtil; +import jp.sf.pal.announcement.db.allcommon.util.SimpleStringUtil; +import jp.sf.pal.announcement.db.allcommon.util.SimpleSystemUtil; + +import org.seasar.dao.CommandContext; +import org.seasar.dao.Node; +import org.seasar.dao.node.AbstractNode; +import org.seasar.dao.node.BeginNode; +import org.seasar.dao.node.ContainerNode; +import org.seasar.dao.node.ElseNode; +import org.seasar.dao.node.PrefixSqlNode; +import org.seasar.dao.node.SqlNode; +import org.seasar.framework.beans.BeanDesc; +import org.seasar.framework.beans.PropertyDesc; +import org.seasar.framework.beans.factory.BeanDescFactory; +import org.seasar.framework.util.OgnlUtil; + +/** + * @author DBFlute(AutoGenerator) + */ +public class InternalSqlParser { + + // =================================================================================== + // Attribute + // ========= + protected InternalSqlTokenizer tokenizer; + + protected Stack nodeStack = new Stack(); + + protected String specifiedSql;// Extension! + + // =================================================================================== + // Constructor + // =========== + public InternalSqlParser(String sql) { + sql = sql.trim(); + if (sql.endsWith(";")) { + sql = sql.substring(0, sql.length() - 1); + } + specifiedSql = sql;// Extension! + tokenizer = new InternalSqlTokenizer(sql); + } + + // =================================================================================== + // Parse + // ===== + public Node parse() { + push(new ContainerNode()); + while (InternalSqlTokenizer.EOF != tokenizer.next()) { + parseToken(); + } + return pop(); + } + + protected void parseToken() { + switch (tokenizer.getTokenType()) { + case InternalSqlTokenizer.SQL: + parseSql(); + break; + case InternalSqlTokenizer.COMMENT: + parseComment(); + break; + case InternalSqlTokenizer.ELSE: + parseElse(); + break; + case InternalSqlTokenizer.BIND_VARIABLE: + parseBindVariable(); + break; + } + } + + protected void parseSql() { + String sql = tokenizer.getToken(); + if (isElseMode()) { + sql = InternalStringUtil.replace(sql, "--", ""); + } + Node node = peek(); + if ((node instanceof InternalIfNode || node instanceof ElseNode) + && node.getChildSize() == 0) { + + InternalSqlTokenizer st = new InternalSqlTokenizer(sql); + st.skipWhitespace(); + String token = st.skipToken(); + st.skipWhitespace(); + if (sql.startsWith(",")) { + if (sql.startsWith(", ")) { + node.addChild(new PrefixSqlNode(", ", sql.substring(2))); + } else { + node.addChild(new PrefixSqlNode(",", sql.substring(1))); + } + } else if ("AND".equalsIgnoreCase(token) + || "OR".equalsIgnoreCase(token)) { + node.addChild(new PrefixSqlNode(st.getBefore(), st.getAfter())); + } else { + node.addChild(new SqlNode(sql)); + } + } else { + node.addChild(new SqlNode(sql)); + } + } + + protected void parseComment() { + final String comment = tokenizer.getToken(); + if (isTargetComment(comment)) { + if (isIfComment(comment)) { + parseIf(); + } else if (isBeginComment(comment)) { + parseBegin(); + } else if (isEndComment(comment)) { + return; + } else { + parseCommentBindVariable(); + } + } else if (comment != null && 0 < comment.length()) { + // - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - + // [UnderReview]: Should I resolve bind character on scope comment(normal comment)? + // - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - + String before = tokenizer.getBefore(); + peek().addChild( + new SqlNode(before.substring(before.lastIndexOf("/*")))); + } + } + + protected void parseIf() { + final String condition = tokenizer.getToken().substring(2).trim(); + if (InternalStringUtil.isEmpty(condition)) { + throwIfCommentConditionNotFoundException(); + } + final ContainerNode ifNode = createIfNode(condition); + peek().addChild(ifNode); + push(ifNode); + parseEnd(); + } + + protected void throwIfCommentConditionNotFoundException() { + String msg = "Look! Read the message below." + getLineSeparator(); + msg = msg + + "/* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * *" + + getLineSeparator(); + msg = msg + "The condition of IF comment was Not Found!" + + getLineSeparator(); + msg = msg + getLineSeparator(); + msg = msg + "[Advice]" + getLineSeparator(); + msg = msg + "Please confirm the IF comment expression." + + getLineSeparator(); + msg = msg + + "It may exist the IF comment that DOESN'T have a condition." + + getLineSeparator(); + msg = msg + " For example:" + getLineSeparator(); + msg = msg + " before (x) -- /*IF*/XXX_ID = /*pmb.xxxId*/3/*END*/" + + getLineSeparator(); + msg = msg + + " after (o) -- /*IF pmb.xxxId != null*/XXX_ID = /*pmb.xxxId*/3/*END*/" + + getLineSeparator(); + msg = msg + getLineSeparator(); + msg = msg + "[IF Comment Expression]" + getLineSeparator() + + tokenizer.getToken() + getLineSeparator(); + msg = msg + getLineSeparator(); + msg = msg + "[Specified SQL]" + getLineSeparator() + specifiedSql + + getLineSeparator(); + msg = msg + "* * * * * * * * * */" + getLineSeparator(); + throw new IfCommentConditionNotFoundException(msg); + } + + protected void parseBegin() { + BeginNode beginNode = new BeginNode(); + peek().addChild(beginNode); + push(beginNode); + parseEnd(); + } + + protected void parseEnd() { + while (InternalSqlTokenizer.EOF != tokenizer.next()) { + if (tokenizer.getTokenType() == InternalSqlTokenizer.COMMENT + && isEndComment(tokenizer.getToken())) { + pop(); + return; + } + parseToken(); + } + throwEndCommentNotFoundException(); + } + + protected void throwEndCommentNotFoundException() { + String msg = "Look! Read the message below." + getLineSeparator(); + msg = msg + + "/* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * *" + + getLineSeparator(); + msg = msg + "The end comment was Not Found!" + getLineSeparator(); + msg = msg + getLineSeparator(); + msg = msg + "[Advice]" + getLineSeparator(); + msg = msg + "Please confirm the parameter comment logic." + + getLineSeparator(); + msg = msg + + "It may exist the parameter comment that DOESN'T have an end comment." + + getLineSeparator(); + msg = msg + " For example:" + getLineSeparator(); + msg = msg + + " before (x) -- /*IF pmb.xxxId != null*/XXX_ID = /*pmb.xxxId*/3" + + getLineSeparator(); + msg = msg + + " after (o) -- /*IF pmb.xxxId != null*/XXX_ID = /*pmb.xxxId*/3/*END*/" + + getLineSeparator(); + msg = msg + getLineSeparator(); + msg = msg + "[Specified SQL]" + getLineSeparator() + specifiedSql + + getLineSeparator(); + msg = msg + "* * * * * * * * * */" + getLineSeparator(); + throw new EndCommentNotFoundException(msg); + } + + protected void parseElse() { + final Node parent = peek(); + if (!(parent instanceof InternalIfNode)) { + return; + } + final InternalIfNode ifNode = (InternalIfNode) pop(); + final InternalElseNode elseNode = new InternalElseNode(); + ifNode.setElseNode(elseNode); + push(elseNode); + tokenizer.skipWhitespace(); + } + + protected void parseCommentBindVariable() { + final String expr = tokenizer.getToken(); + final String s = tokenizer.skipToken(); + if (expr.startsWith("$")) { + peek().addChild(createEmbeddedValueNode(expr.substring(1), s));// Extension! + } else { + peek().addChild(createBindVariableNode(expr, s));// Extension! + } + } + + protected void parseBindVariable() { + final String expr = tokenizer.getToken(); + peek().addChild(createBindVariableNode(expr, null));// Extension! + } + + protected Node pop() { + return (Node) nodeStack.pop(); + } + + protected Node peek() { + return (Node) nodeStack.peek(); + } + + protected void push(Node node) { + nodeStack.push(node); + } + + protected boolean isElseMode() { + for (int i = 0; i < nodeStack.size(); ++i) { + if (nodeStack.get(i) instanceof InternalElseNode) { + return true; + } + } + return false; + } + + private static boolean isTargetComment(String comment) { + return comment != null && comment.length() > 0 + && Character.isJavaIdentifierStart(comment.charAt(0)); + } + + private static boolean isIfComment(String comment) { + return comment.startsWith("IF"); + } + + private static boolean isBeginComment(String content) { + return content != null && "BEGIN".equals(content); + } + + private static boolean isEndComment(String content) { + return content != null && "END".equals(content); + } + + protected AbstractNode createBindVariableNode(String expr, String testValue) {// Extension! + return new InternalBindVariableNode(expr, testValue, specifiedSql); + } + + protected AbstractNode createEmbeddedValueNode(String expr, String testValue) {// Extension! + return new InternalEmbeddedValueNode(expr, testValue, specifiedSql); + } + + protected ContainerNode createIfNode(String expr) {// Extension! + return new InternalIfNode(expr, specifiedSql); + } + + // =================================================================================== + // General Helper + // ============== + protected String getLineSeparator() { + return SimpleSystemUtil.getLineSeparator(); + } + + protected final String replaceString(String text, String fromText, + String toText) { + return SimpleStringUtil.replace(text, fromText, toText); + } + + // =================================================================================== + // Extension + // ========= + // ----------------------------------------------------- + // BindVariableNode + // ---------------- + protected static class InternalBindVariableNode extends AbstractNode { + protected String _expression; + + protected String _testValue; + + protected String[] _names; + + protected String _specifiedSql; + + public InternalBindVariableNode(String expression, String testValue, + String specifiedSql) { + this._expression = expression; + this._testValue = testValue; + this._names = InternalStringUtil.split(expression, "."); + this._specifiedSql = specifiedSql; + } + + public void accept(CommandContext ctx) { + final Object value = ctx.getArg(_names[0]); + final Class clazz = ctx.getArgType(_names[0]); + final InternalValueAndType valueAndType = new InternalValueAndType(); + valueAndType.setTargetValue(value); + valueAndType.setTargetType(clazz); + setupValueAndType(valueAndType); + + if (valueAndType.getTargetValue() == null) { + throwBindOrEmbeddedParameterNullValueException(valueAndType); + } + if (!isInScope()) { + // Main Root + ctx.addSql("?", valueAndType.getTargetValue(), valueAndType + .getTargetType()); + } else { + if (List.class.isAssignableFrom(valueAndType.getTargetType())) { + bindArray(ctx, ((List) valueAndType.getTargetValue()) + .toArray()); + } else if (valueAndType.getTargetType().isArray()) { + bindArray(ctx, valueAndType.getTargetValue()); + } else { + ctx.addSql("?", valueAndType.getTargetValue(), valueAndType + .getTargetType()); + } + } + if (valueAndType.isValidRearOption()) { + ctx.addSql(valueAndType.buildRearOptionOnSql()); + } + } + + protected void setupValueAndType(InternalValueAndType valueAndType) { + final InternalValueAndTypeSetuper valueAndTypeSetuper = new InternalValueAndTypeSetuper( + _expression, _names, _specifiedSql, true); + valueAndTypeSetuper.setupValueAndType(valueAndType); + } + + protected void throwBindOrEmbeddedParameterNullValueException( + InternalValueAndType valueAndType) { + ParameterCommentExceptionProvider + .throwBindOrEmbeddedParameterNullValueException( + _expression, valueAndType.getTargetType(), + _specifiedSql, true); + } + + protected boolean isInScope() { + return _testValue != null && _testValue.startsWith("(") + && _testValue.endsWith(")"); + } + + protected void bindArray(CommandContext ctx, Object array) { + if (array == null) { + return; + } + final int length = Array.getLength(array); + if (length == 0) { + throwBindOrEmbeddedParameterEmptyListException(); + } + Class clazz = null; + for (int i = 0; i < length; ++i) { + final Object currentElement = Array.get(array, i); + if (currentElement != null) { + clazz = currentElement.getClass(); + break; + } + } + if (clazz == null) { + throwBindOrEmbeddedParameterNullOnlyListException(); + } + boolean existsValidElements = false; + ctx.addSql("("); + for (int i = 0; i < length; ++i) { + final Object currentElement = Array.get(array, i); + if (currentElement != null) { + if (!existsValidElements) { + ctx.addSql("?", currentElement, clazz); + existsValidElements = true; + } else { + ctx.addSql(", ?", currentElement, clazz); + } + } + } + ctx.addSql(")"); + } + + protected void throwBindOrEmbeddedParameterEmptyListException() { + ParameterCommentExceptionProvider + .throwBindOrEmbeddedParameterEmptyListException( + _expression, _specifiedSql, false); + } + + protected void throwBindOrEmbeddedParameterNullOnlyListException() { + ParameterCommentExceptionProvider + .throwBindOrEmbeddedParameterNullOnlyListException( + _expression, _specifiedSql, true); + } + } + + // ----------------------------------------------------- + // EmbeddedValueNode + // ----------------- + protected static class InternalEmbeddedValueNode extends AbstractNode { + protected String _expression; + + protected String _testValue; + + protected String[] _names; + + protected String _specifiedSql; + + public InternalEmbeddedValueNode(String expression, String testValue, + String specifiedSql) { + this._expression = expression; + this._testValue = testValue; + this._names = InternalStringUtil.split(expression, "."); + this._specifiedSql = specifiedSql; + } + + public void accept(CommandContext ctx) { + final Object value = ctx.getArg(_names[0]); + final Class clazz = ctx.getArgType(_names[0]); + final InternalValueAndType valueAndType = new InternalValueAndType(); + valueAndType.setTargetValue(value); + valueAndType.setTargetType(clazz); + setupValueAndType(valueAndType); + + if (valueAndType.getTargetValue() == null) { + throwBindOrEmbeddedParameterNullValueException(valueAndType); + } + if (!isInScope()) { + // Main Root + // - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - + // [UnderReview]: Should I make an original exception instead of this exception? + // - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - + if (valueAndType.getTargetValue() != null + && valueAndType.getTargetValue().toString() + .indexOf("?") > -1) { + throw new org.seasar.framework.exception.SRuntimeException( + "EDAO0023"); + } + ctx.addSql(valueAndType.getTargetValue().toString()); + } else { + if (List.class.isAssignableFrom(valueAndType.getTargetType())) { + embedArray(ctx, ((List) valueAndType.getTargetValue()) + .toArray()); + } else if (valueAndType.getTargetType().isArray()) { + embedArray(ctx, valueAndType.getTargetValue()); + } else { + // - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - + // [UnderReview]: Should I make an original exception instead of this exception? + // - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - + if (valueAndType.getTargetValue() != null + && valueAndType.getTargetValue().toString() + .indexOf("?") > -1) { + throw new org.seasar.framework.exception.SRuntimeException( + "EDAO0023"); + } + ctx.addSql(valueAndType.getTargetValue().toString()); + } + } + if (valueAndType.isValidRearOption()) { + ctx.addSql(valueAndType.buildRearOptionOnSql()); + } + } + + protected void setupValueAndType(InternalValueAndType valueAndType) { + final InternalValueAndTypeSetuper valueAndTypeSetuper = new InternalValueAndTypeSetuper( + _expression, _names, _specifiedSql, false); + valueAndTypeSetuper.setupValueAndType(valueAndType); + } + + protected void throwBindOrEmbeddedParameterNullValueException( + InternalValueAndType valueAndType) { + ParameterCommentExceptionProvider + .throwBindOrEmbeddedParameterNullValueException( + _expression, valueAndType.getTargetType(), + _specifiedSql, false); + } + + protected boolean isInScope() { + return _testValue != null && _testValue.startsWith("(") + && _testValue.endsWith(")"); + } + + protected void embedArray(CommandContext ctx, Object array) { + if (array == null) { + return; + } + final int length = Array.getLength(array); + if (length == 0) { + throwBindOrEmbeddedParameterEmptyListException(); + } + String quote = null; + for (int i = 0; i < length; ++i) { + final Object currentElement = Array.get(array, i); + if (currentElement != null) { + quote = !(currentElement instanceof Number) ? "'" : ""; + break; + } + } + if (quote == null) { + throwBindOrEmbeddedParameterNullOnlyListException(); + } + boolean existsValidElements = false; + ctx.addSql("("); + for (int i = 0; i < length; ++i) { + final Object currentElement = Array.get(array, i); + if (currentElement != null) { + if (!existsValidElements) { + ctx.addSql(quote + currentElement + quote); + existsValidElements = true; + } else { + ctx.addSql(", " + quote + currentElement + quote); + } + } + } + ctx.addSql(")"); + } + + protected void throwBindOrEmbeddedParameterEmptyListException() { + ParameterCommentExceptionProvider + .throwBindOrEmbeddedParameterEmptyListException( + _expression, _specifiedSql, false); + } + + protected void throwBindOrEmbeddedParameterNullOnlyListException() { + ParameterCommentExceptionProvider + .throwBindOrEmbeddedParameterNullOnlyListException( + _expression, _specifiedSql, false); + } + } + + // ----------------------------------------------------- + // Value and Type + // -------------- + protected static class InternalValueAndType { + public Object _targetValue; + + public Class _targetType; + + protected String _rearOption; + + public boolean isValidRearOption() { + return _targetValue != null && _rearOption != null + && _rearOption.trim().length() > 0; + } + + public String buildRearOptionOnSql() { + return " " + _rearOption.trim() + " "; + } + + public Object getTargetValue() { + return _targetValue; + } + + public void setTargetValue(Object targetValue) { + this._targetValue = targetValue; + } + + public Class getTargetType() { + return _targetType; + } + + public void setTargetType(Class targetType) { + this._targetType = targetType; + } + + public String getRearOption() { + return _rearOption; + } + + public void setRearOption(String rearOption) { + this._rearOption = rearOption; + } + } + + protected static class InternalValueAndTypeSetuper { + protected String _expression; + + protected String[] _names; + + protected String _specifiedSql; + + protected boolean _bind; + + public InternalValueAndTypeSetuper(String expression, String[] names, + String specifiedSql, boolean bind) { + this._expression = expression; + this._names = names; + this._specifiedSql = specifiedSql; + this._bind = bind; + } + + protected void setupValueAndType(InternalValueAndType valueAndType) { + Object value = valueAndType.getTargetValue(); + Class clazz = valueAndType.getTargetType(); + String rearOption = null; + for (int pos = 1; pos < _names.length; ++pos) { + if (value == null) { + break; + } + if (Map.class.isInstance(value)) { + final Map map = (Map) value; + value = map.get(_names[pos]); + if (value == null) { + break; + } + clazz = value.getClass(); + continue; + } + final BeanDesc beanDesc = BeanDescFactory.getBeanDesc(clazz); + final String currentName = _names[pos]; + if (beanDesc.hasPropertyDesc(currentName)) { + final PropertyDesc pd = beanDesc + .getPropertyDesc(currentName); + if (_names.length == (pos + 1) + && hasLikeSearchOption(beanDesc, currentName)) { + final LikeSearchOption option = getLikeSearchOption( + beanDesc, currentName, value); + value = getPropertyValue(clazz, value, currentName, pd); + if (value != null && value instanceof String + && ((String) value).length() != 0) { + value = option.generateRealValue((String) value); + rearOption = option.getRearOption(); + } + } else { + value = getPropertyValue(clazz, value, currentName, pd); + } + clazz = (value != null ? value.getClass() : pd + .getPropertyType()); + continue; + } + final String methodName = "get" + initCap(currentName); + if (beanDesc.hasMethod(methodName)) { + final Method method = beanDesc.getMethod(methodName); + value = invokeGetter(method, value); + clazz = method.getReturnType(); + continue; + } + if (pos == 1 && MapParameterBean.class.isAssignableFrom(clazz)) { + final MapParameterBean pmb = (MapParameterBean) value; + final Map map = pmb.getParameterMap(); + final Object elementValue = (map != null ? map + .get(_names[pos]) : null); + if (elementValue != null) { + value = elementValue; + clazz = elementValue.getClass(); + continue; + } + } + throwBindOrEmbeddedCommentNotFoundPropertyException( + _expression, clazz, currentName, _specifiedSql, _bind); + } + valueAndType.setTargetValue(value); + valueAndType.setTargetType(clazz); + valueAndType.setRearOption(rearOption); + } + + protected boolean hasLikeSearchOption(BeanDesc beanDesc, + String currentName) { + return beanDesc.hasPropertyDesc(currentName + + "InternalLikeSearchOption"); + } + + protected LikeSearchOption getLikeSearchOption(BeanDesc beanDesc, + String currentName, Object resourceBean) { + final PropertyDesc pb = beanDesc.getPropertyDesc(currentName + + "InternalLikeSearchOption"); + final LikeSearchOption option = (LikeSearchOption) pb + .getValue(resourceBean); + if (option == null) { + throwLikeSearchOptionNotFoundException(resourceBean, + currentName); + } + return option; + } + + protected void throwLikeSearchOptionNotFoundException( + Object resourceBean, String currentName) { + String msg = "Look! Read the message below." + getLineSeparator(); + msg = msg + + "/* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * *" + + getLineSeparator(); + msg = msg + + "The likeSearchOption was Not Found! (Should not be null!)" + + getLineSeparator(); + msg = msg + getLineSeparator(); + msg = msg + "[Advice]" + getLineSeparator(); + msg = msg + "Please confirm your method call:" + getLineSeparator(); + final String beanName = resourceBean.getClass().getSimpleName(); + final String methodName = "set" + initCap(currentName) + + "_LikeSearch(value, likeSearchOption);"; + msg = msg + " " + beanName + "." + methodName + + getLineSeparator(); + msg = msg + getLineSeparator(); + msg = msg + "[Target ParameterBean]" + getLineSeparator() + + resourceBean + getLineSeparator(); + msg = msg + "* * * * * * * * * */" + getLineSeparator(); + throw new RequiredOptionNotFoundException(msg); + } + + protected Object getPropertyValue(Class beanType, Object beanValue, + String currentName, PropertyDesc pd) { + try { + return pd.getValue(beanValue); + } catch (RuntimeException e) { + throwPropertyHandlingFailureException(beanType, beanValue, + currentName, _expression, _specifiedSql, _bind); + return null;// Unreachable! + } + } + + protected void throwPropertyHandlingFailureException(Class beanType, + Object beanValue, String currentName, String expression, + String specifiedSql, boolean bind) { + String msg = "Look! Read the message below." + getLineSeparator(); + msg = msg + + "/* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * *" + + getLineSeparator(); + msg = msg + "The handlig of the property was failed!" + + getLineSeparator(); + msg = msg + getLineSeparator(); + msg = msg + "[Advice]" + getLineSeparator(); + msg = msg + "This is the Framework Exception!" + getLineSeparator(); + msg = msg + getLineSeparator(); + msg = msg + "[" + (bind ? "Bind Variable" : "Embedded Value") + + " Comment Expression]" + getLineSeparator() + expression + + getLineSeparator(); + msg = msg + getLineSeparator(); + msg = msg + "[Bean Type]" + getLineSeparator() + beanType + + getLineSeparator(); + msg = msg + getLineSeparator(); + msg = msg + "[Bean Value]" + getLineSeparator() + beanValue + + getLineSeparator(); + msg = msg + getLineSeparator(); + msg = msg + "[Property Name]" + getLineSeparator() + currentName + + getLineSeparator(); + msg = msg + getLineSeparator(); + msg = msg + "[Specified SQL]" + getLineSeparator() + specifiedSql + + getLineSeparator(); + msg = msg + "* * * * * * * * * */" + getLineSeparator(); + throw new IllegalStateException(msg); + } + + protected String initCap(String name) { + return SimpleStringUtil.initCap(name); + } + + protected Object invokeGetter(Method method, Object target) { + try { + return method.invoke(target, (Object[]) null); + } catch (IllegalArgumentException e) { + throw new RuntimeException(e); + } catch (IllegalAccessException e) { + throw new RuntimeException(e); + } catch (java.lang.reflect.InvocationTargetException e) { + throw new RuntimeException(e); + } + } + + protected void throwBindOrEmbeddedCommentNotFoundPropertyException( + String expression, Class targetType, + String notFoundProperty, String specifiedSql, boolean bind) { + String msg = "Look! Read the message below." + getLineSeparator(); + msg = msg + + "/* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * *" + + getLineSeparator(); + msg = msg + "The property on the " + + (bind ? "bind variable" : "embedded value") + + " comment was Not Found!" + getLineSeparator(); + msg = msg + getLineSeparator(); + msg = msg + "[Advice]" + getLineSeparator(); + msg = msg + + "Please confirm the existence of your property on your arguments." + + getLineSeparator(); + msg = msg + "Abd has the property had misspelling?" + + getLineSeparator(); + msg = msg + getLineSeparator(); + msg = msg + "[" + (bind ? "Bind Variable" : "Embedded Value") + + " Comment Expression]" + getLineSeparator() + expression + + getLineSeparator(); + msg = msg + getLineSeparator(); + msg = msg + "[NotFound Property]" + getLineSeparator() + + (targetType != null ? targetType.getName() + "#" : "") + + notFoundProperty + getLineSeparator(); + msg = msg + getLineSeparator(); + msg = msg + "[Specified SQL]" + getLineSeparator() + specifiedSql + + getLineSeparator(); + msg = msg + "* * * * * * * * * */" + getLineSeparator(); + if (bind) { + throw new BindVariableCommentNotFoundPropertyException(msg); + } else { + throw new EmbeddedValueCommentNotFoundPropertyException(msg); + } + } + + protected String getLineSeparator() { + return SimpleSystemUtil.getLineSeparator(); + } + } + + // ----------------------------------------------------- + // Exception Provider + // ------------------ + protected static class ParameterCommentExceptionProvider { + public static void throwBindOrEmbeddedParameterNullValueException( + String expression, Class targetType, String specifiedSql, + boolean bind) { + String msg = "Look! Read the message below." + getLineSeparator(); + msg = msg + + "/* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * *" + + getLineSeparator(); + msg = msg + "The value of " + + (bind ? "bind variable" : "embedded value") + + " was Null!" + getLineSeparator(); + msg = msg + getLineSeparator(); + msg = msg + "[Advice]" + getLineSeparator(); + msg = msg + "Is it within the scope of your assumption?" + + getLineSeparator(); + msg = msg + + "If the answer is YES, please confirm your application logic about the parameter." + + getLineSeparator(); + msg = msg + + "If the answer is NO, please confirm the logic of parameter comment(especially IF comment)." + + getLineSeparator(); + msg = msg + " --> For example:" + getLineSeparator(); + msg = msg + " before (x) -- XXX_ID = /*pmb.xxxId*/3" + + getLineSeparator(); + msg = msg + + " after (o) -- /*IF pmb.xxxId != null*/XXX_ID = /*pmb.xxxId*/3/*END*/" + + getLineSeparator(); + msg = msg + getLineSeparator(); + msg = msg + "[" + (bind ? "Bind Variable" : "Embedded Value") + + " Comment Expression]" + getLineSeparator() + expression + + getLineSeparator(); + msg = msg + getLineSeparator(); + msg = msg + "[Parameter Property Type]" + getLineSeparator() + + targetType + getLineSeparator(); + msg = msg + getLineSeparator(); + msg = msg + "[Specified SQL]" + getLineSeparator() + specifiedSql + + getLineSeparator(); + msg = msg + "* * * * * * * * * */" + getLineSeparator(); + if (bind) { + throw new BindVariableParameterNullValueException(msg); + } else { + throw new EmbeddedValueParameterNullValueException(msg); + } + } + + public static void throwBindOrEmbeddedParameterEmptyListException( + String expression, String specifiedSql, boolean bind) { + String msg = "Look! Read the message below." + getLineSeparator(); + msg = msg + + "/* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * *" + + getLineSeparator(); + msg = msg + "The list of " + + (bind ? "bind variable" : "embedded value") + + " was empty!" + getLineSeparator(); + msg = msg + getLineSeparator(); + msg = msg + "[Advice]" + getLineSeparator(); + msg = msg + "Please confirm your application logic." + + getLineSeparator(); + msg = msg + " For example:" + getLineSeparator(); + msg = msg + " before (x):" + getLineSeparator(); + msg = msg + + " List xxxIdList = new ArrayList();" + + getLineSeparator(); + msg = msg + + " cb.query().setXxxId_InScope(xxxIdList);// Or pmb.setXxxIdList(xxxIdList);" + + getLineSeparator(); + msg = msg + " after (o):" + getLineSeparator(); + msg = msg + + " List xxxIdList = new ArrayList();" + + getLineSeparator(); + msg = msg + " xxxIdList.add(3);" + getLineSeparator(); + msg = msg + " xxxIdList.add(7);" + getLineSeparator(); + msg = msg + + " cb.query().setXxxId_InScope(xxxIdList);// Or pmb.setXxxIdList(xxxIdList);" + + getLineSeparator(); + msg = msg + getLineSeparator(); + msg = msg + "[" + (bind ? "Bind Variable" : "Embedded Value") + + " Comment Expression]" + getLineSeparator() + expression + + getLineSeparator(); + msg = msg + getLineSeparator(); + msg = msg + "[Specified SQL]" + getLineSeparator() + specifiedSql + + getLineSeparator(); + msg = msg + "* * * * * * * * * */" + getLineSeparator(); + throw new IllegalArgumentException(msg); + } + + public static void throwBindOrEmbeddedParameterNullOnlyListException( + String expression, String specifiedSql, boolean bind) { + String msg = "Look! Read the message below." + getLineSeparator(); + msg = msg + + "/* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * *" + + getLineSeparator(); + msg = msg + "The list of " + + (bind ? "bind variable" : "embedded value") + + " was 'Null Only List'!" + getLineSeparator(); + msg = msg + getLineSeparator(); + msg = msg + "[Advice]" + getLineSeparator(); + msg = msg + "Please confirm your application logic." + + getLineSeparator(); + msg = msg + " For example:" + getLineSeparator(); + msg = msg + " before (x):" + getLineSeparator(); + msg = msg + + " List xxxIdList = new ArrayList();" + + getLineSeparator(); + msg = msg + " xxxIdList.add(null);" + getLineSeparator(); + msg = msg + " xxxIdList.add(null);" + getLineSeparator(); + msg = msg + + " cb.query().setXxxId_InScope(xxxIdList);// Or pmb.setXxxIdList(xxxIdList);" + + getLineSeparator(); + msg = msg + " after (o):" + getLineSeparator(); + msg = msg + + " List xxxIdList = new ArrayList();" + + getLineSeparator(); + msg = msg + " xxxIdList.add(3);" + getLineSeparator(); + msg = msg + " xxxIdList.add(7);" + getLineSeparator(); + msg = msg + + " cb.query().setXxxId_InScope(xxxIdList);// Or pmb.setXxxIdList(xxxIdList);" + + getLineSeparator(); + msg = msg + getLineSeparator(); + msg = msg + "[" + (bind ? "Bind Variable" : "Embedded Value") + + " Comment Expression]" + getLineSeparator() + expression + + getLineSeparator(); + msg = msg + getLineSeparator(); + msg = msg + "[Specified SQL]" + getLineSeparator() + specifiedSql + + getLineSeparator(); + msg = msg + "* * * * * * * * * */" + getLineSeparator(); + throw new IllegalArgumentException(msg); + } + + protected static String getLineSeparator() { + return SimpleSystemUtil.getLineSeparator(); + } + } + + // ----------------------------------------------------- + // IfNode + // ------ + protected static class InternalIfNode extends ContainerNode { + private String _expression; + + private Object _parsedExpression; + + private InternalElseNode _elseNode; + + private String _specifiedSql; + + public InternalIfNode(String expression, String specifiedSql) { + this._expression = expression; + this._parsedExpression = OgnlUtil.parseExpression(expression); + this._specifiedSql = specifiedSql; + } + + public String getExpression() { + return _expression; + } + + public InternalElseNode getElseNode() { + return _elseNode; + } + + public void setElseNode(InternalElseNode elseNode) { + this._elseNode = elseNode; + } + + public void accept(CommandContext ctx) { + Object result = null; + try { + result = OgnlUtil.getValue(_parsedExpression, ctx); + } catch (RuntimeException e) { + if (!_expression.contains("pmb.")) { + throwIfCommentWrongExpressionException(_expression, e, + _specifiedSql); + } + final String replaced = InternalStringUtil.replace(_expression, + "pmb.", "pmb.parameterMap."); + final Object secondParsedExpression = OgnlUtil + .parseExpression(replaced); + try { + result = OgnlUtil.getValue(secondParsedExpression, ctx); + } catch (RuntimeException ignored) { + throwIfCommentWrongExpressionException(_expression, e, + _specifiedSql); + } + if (result == null) { + throwIfCommentWrongExpressionException(_expression, e, + _specifiedSql); + } + _parsedExpression = secondParsedExpression; + } + if (result != null && result instanceof Boolean) { + if (((Boolean) result).booleanValue()) { + super.accept(ctx); + ctx.setEnabled(true); + } else if (_elseNode != null) { + _elseNode.accept(ctx); + ctx.setEnabled(true); + } + } else { + throwIfCommentNotBooleanResultException(_expression, result, + _specifiedSql); + } + } + + protected void throwIfCommentWrongExpressionException( + String expression, RuntimeException cause, String specifiedSql) { + String msg = "Look! Read the message below." + getLineSeparator(); + msg = msg + + "/* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * *" + + getLineSeparator(); + msg = msg + "The IF comment of your specified SQL was Wrong!" + + getLineSeparator(); + msg = msg + getLineSeparator(); + msg = msg + "[Advice]" + getLineSeparator(); + msg = msg + + "Please confirm the existence of your property on your arguments." + + getLineSeparator(); + msg = msg + "And confirm the IF comment of your specified SQL." + + getLineSeparator(); + msg = msg + " For example, correct IF comment is as below:" + + getLineSeparator(); + msg = msg + " /*IF pmb.xxxId != null*/XXX_ID = .../*END*/" + + getLineSeparator(); + msg = msg + " /*IF pmb.isPaging()*/.../*END*/" + + getLineSeparator(); + msg = msg + + " /*IF pmb.xxxId == null && pmb.xxxName != null*/.../*END*/" + + getLineSeparator(); + msg = msg + + " /*IF pmb.xxxId == null || pmb.xxxName != null*/.../*END*/" + + getLineSeparator(); + msg = msg + getLineSeparator(); + msg = msg + "[IF Comment Expression]" + getLineSeparator() + + expression + getLineSeparator(); + msg = msg + getLineSeparator(); + msg = msg + "[Cause Message]" + getLineSeparator(); + msg = msg + cause.getClass() + ":" + getLineSeparator(); + msg = msg + " --> " + cause.getMessage() + getLineSeparator(); + final Throwable nestedCause = cause.getCause(); + if (nestedCause != null) { + msg = msg + nestedCause.getClass() + ":" + getLineSeparator(); + msg = msg + " --> " + nestedCause.getMessage() + + getLineSeparator(); + } + msg = msg + getLineSeparator(); + msg = msg + "[Specified SQL]" + getLineSeparator() + specifiedSql + + getLineSeparator(); + msg = msg + "* * * * * * * * * */" + getLineSeparator(); + throw new IfCommentWrongExpressionException(msg, cause); + } + + protected void throwIfCommentNotBooleanResultException( + String expression, Object result, String specifiedSql) { + String msg = "Look! Read the message below." + getLineSeparator(); + msg = msg + + "/* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * *" + + getLineSeparator(); + msg = msg + + "The boolean expression on IF comment of your specified SQL was Wrong!" + + getLineSeparator(); + msg = msg + getLineSeparator(); + msg = msg + "[Advice]" + getLineSeparator(); + msg = msg + + "Please confirm the grammar of your IF comment. Does it really express boolean?" + + getLineSeparator(); + msg = msg + + "And confirm the existence of your property on your arguments if you use parameterMap." + + getLineSeparator(); + msg = msg + getLineSeparator(); + msg = msg + "[IF Comment Expression]" + getLineSeparator() + + expression + getLineSeparator(); + msg = msg + getLineSeparator(); + msg = msg + "[IF Comment Result Value]" + getLineSeparator() + + result + getLineSeparator(); + msg = msg + getLineSeparator(); + msg = msg + "[Specified SQL]" + getLineSeparator() + specifiedSql + + getLineSeparator(); + msg = msg + "* * * * * * * * * */" + getLineSeparator(); + throw new IfCommentNotBooleanResultException(msg); + } + + protected String getLineSeparator() { + return SimpleSystemUtil.getLineSeparator(); + } + } + + // ----------------------------------------------------- + // ElseNode + // -------- + protected static class InternalElseNode extends ContainerNode { + public void accept(CommandContext ctx) { + super.accept(ctx); + ctx.setEnabled(true); + } + } + + // ----------------------------------------------------- + // StringUtil + // ---------- + protected static class InternalStringUtil { + + public static final String[] EMPTY_STRINGS = new String[0]; + + private InternalStringUtil() { + } + + public static final boolean isEmpty(String text) { + return text == null || text.length() == 0; + } + + public static final String replace(String text, String fromText, + String toText) { + return SimpleStringUtil.replace(text, fromText, toText); + } + + public static String[] split(String str, String delim) { + if (str == null) { + return EMPTY_STRINGS; + } + List list = new ArrayList(); + StringTokenizer st = new StringTokenizer(str, delim); + while (st.hasMoreElements()) { + list.add(st.nextToken()); + } + return (String[]) list.toArray(new String[list.size()]); + } + } + + // =================================================================================== + // Convert + // ======= + public static String convertTwoWaySql2DisplaySql(String twoWaySql, + Object arg) { + final String[] argNames = new String[] { "dto" }; + final Class[] argTypes = new Class[] { arg.getClass() }; + final Object[] args = new Object[] { arg }; + return convertTwoWaySql2DisplaySql(twoWaySql, argNames, argTypes, args); + } + + public static String convertTwoWaySql2DisplaySql(String twoWaySql, + String[] argNames, Class[] argTypes, Object[] args) { + final CommandContext context; + { + final InternalSqlParser parser = new InternalSqlParser(twoWaySql); + final Node node = parser.parse(); + final InternalCommandContextCreator creator = new InternalCommandContextCreator( + argNames, argTypes); + context = creator.createCommandContext(args); + node.accept(context); + } + final String preparedSql = context.getSql(); + return InternalBindVariableUtil.getCompleteSql(preparedSql, context + .getBindVariables()); + } +} Property changes on: announcement/trunk/src/main/java/jp/sf/pal/announcement/db/allcommon/s2dao/internal/sqlparser/InternalSqlParser.java ___________________________________________________________________ Name: svn:eol-style + native Added: announcement/trunk/src/main/java/jp/sf/pal/announcement/db/allcommon/s2dao/internal/sqlparser/InternalSqlTokenizer.java =================================================================== --- announcement/trunk/src/main/java/jp/sf/pal/announcement/db/allcommon/s2dao/internal/sqlparser/InternalSqlTokenizer.java (rev 0) +++ announcement/trunk/src/main/java/jp/sf/pal/announcement/db/allcommon/s2dao/internal/sqlparser/InternalSqlTokenizer.java 2008-06-30 02:54:27 UTC (rev 1002) @@ -0,0 +1,295 @@ +package jp.sf.pal.announcement.db.allcommon.s2dao.internal.sqlparser; + +import jp.sf.pal.announcement.db.allcommon.exception.EndCommentNotFoundException; +import jp.sf.pal.announcement.db.allcommon.util.SimpleSystemUtil; + +/** + * @author DBFlute(AutoGenerator) + */ +public class InternalSqlTokenizer { + + // =================================================================================== + // Definition + // ========== + public static final int SQL = 1; + + public static final int COMMENT = 2; + + public static final int ELSE = 3; + + public static final int BIND_VARIABLE = 4; + + public static final int EOF = 99; + + // =================================================================================== + // Attribute + // ========= + protected String sql; + + protected int position = 0; + + protected String token; + + protected int tokenType = SQL; + + protected int nextTokenType = SQL; + + protected int bindVariableNum = 0; + + // =================================================================================== + // Constructor + // =========== + public InternalSqlTokenizer(String sql) { + this.sql = sql; + } + + // =================================================================================== + // Tokenize + // ======== + public int next() { + if (position >= sql.length()) { + token = null; + tokenType = EOF; + nextTokenType = EOF; + return tokenType; + } + switch (nextTokenType) { + case SQL: + parseSql(); + break; + case COMMENT: + parseComment(); + break; + case ELSE: + parseElse(); + break; + case BIND_VARIABLE: + parseBindVariable(); + break; + default: + parseEof(); + break; + } + return tokenType; + } + + protected void parseSql() { + int commentStartPos = sql.indexOf("/*", position); + int commentStartPos2 = sql.indexOf("#*", position); + if (0 < commentStartPos2 && commentStartPos2 < commentStartPos) { + commentStartPos = commentStartPos2; + } + int lineCommentStartPos = sql.indexOf("--", position); + int bindVariableStartPos = sql.indexOf("?", position); + int elseCommentStartPos = -1; + int elseCommentLength = -1; + if (lineCommentStartPos >= 0) { + int skipPos = skipWhitespace(lineCommentStartPos + 2); + if (skipPos + 4 < sql.length() + && "ELSE".equals(sql.substring(skipPos, skipPos + 4))) { + elseCommentStartPos = lineCommentStartPos; + elseCommentLength = skipPos + 4 - lineCommentStartPos; + } + } + int nextStartPos = getNextStartPos(commentStartPos, + elseCommentStartPos, bindVariableStartPos); + if (nextStartPos < 0) { + token = sql.substring(position); + nextTokenType = EOF; + position = sql.length(); + tokenType = SQL; + } else { + token = sql.substring(position, nextStartPos); + tokenType = SQL; + boolean needNext = nextStartPos == position; + if (nextStartPos == commentStartPos) { + nextTokenType = COMMENT; + position = commentStartPos + 2; + } else if (nextStartPos == elseCommentStartPos) { + nextTokenType = ELSE; + position = elseCommentStartPos + elseCommentLength; + } else if (nextStartPos == bindVariableStartPos) { + nextTokenType = BIND_VARIABLE; + position = bindVariableStartPos; + } + if (needNext) { + next(); + } + } + } + + protected int getNextStartPos(int commentStartPos, int elseCommentStartPos, + int bindVariableStartPos) { + int nextStartPos = -1; + if (commentStartPos >= 0) { + nextStartPos = commentStartPos; + } + if (elseCommentStartPos >= 0 + && (nextStartPos < 0 || elseCommentStartPos < nextStartPos)) { + nextStartPos = elseCommentStartPos; + } + if (bindVariableStartPos >= 0 + && (nextStartPos < 0 || bindVariableStartPos < nextStartPos)) { + nextStartPos = bindVariableStartPos; + } + return nextStartPos; + } + + protected String nextBindVariableName() { + return "$" + ++bindVariableNum; + } + + protected void parseComment() { + int commentEndPos = sql.indexOf("*/", position); + int commentEndPos2 = sql.indexOf("*#", position); + if (0 < commentEndPos2 && commentEndPos2 < commentEndPos) { + commentEndPos = commentEndPos2; + } + if (commentEndPos < 0) { + throwEndCommentNotFoundException(sql.substring(position)); + } + token = sql.substring(position, commentEndPos); + nextTokenType = SQL; + position = commentEndPos + 2; + tokenType = COMMENT; + } + + protected void throwEndCommentNotFoundException(String expression) { + String msg = "Look! Read the message below." + getLineSeparator(); + msg = msg + + "/* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * *" + + getLineSeparator(); + msg = msg + "The end comment was Not Found!" + getLineSeparator(); + msg = msg + getLineSeparator(); + msg = msg + "[Advice]" + getLineSeparator(); + msg = msg + "Please confirm the parameter comment logic." + + getLineSeparator(); + msg = msg + + "It may exist the parameter comment that DOESN'T have an end comment." + + getLineSeparator(); + msg = msg + " For example:" + getLineSeparator(); + msg = msg + + " before (x) -- /*IF pmb.xxxId != null*/XXX_ID = /*pmb.xxxId*/3" + + getLineSeparator(); + msg = msg + + " after (o) -- /*IF pmb.xxxId != null*/XXX_ID = /*pmb.xxxId*/3/*END*/" + + getLineSeparator(); + msg = msg + getLineSeparator(); + msg = msg + "[End Comment Expected Place]" + getLineSeparator() + + expression + getLineSeparator(); + msg = msg + getLineSeparator(); + msg = msg + "[Specified SQL]" + getLineSeparator() + sql + + getLineSeparator(); + msg = msg + "* * * * * * * * * */" + getLineSeparator(); + throw new EndCommentNotFoundException(msg); + } + + protected void parseBindVariable() { + token = nextBindVariableName(); + nextTokenType = SQL; + position += 1; + tokenType = BIND_VARIABLE; + } + + protected void parseElse() { + token = null; + nextTokenType = SQL; + tokenType = ELSE; + } + + protected void parseEof() { + token = null; + tokenType = EOF; + nextTokenType = EOF; + } + + public String skipToken() { + int index = sql.length(); + char quote = position < sql.length() ? sql.charAt(position) : '\0'; + boolean quoting = quote == '\'' || quote == '('; + if (quote == '(') { + quote = ')'; + } + for (int i = quoting ? position + 1 : position; i < sql.length(); ++i) { + char c = sql.charAt(i); + if ((Character.isWhitespace(c) || c == ',' || c == ')' || c == '(') + && !quoting) { + index = i; + break; + } else if (c == '/' && i + 1 < sql.length() + && sql.charAt(i + 1) == '*') { + index = i; + break; + } else if (c == '-' && i + 1 < sql.length() + && sql.charAt(i + 1) == '-') { + index = i; + break; + } else if (quoting && quote == '\'' && c == '\'' + && (i + 1 >= sql.length() || sql.charAt(i + 1) != '\'')) { + index = i + 1; + break; + } else if (quoting && c == quote) { + index = i + 1; + break; + } + } + token = sql.substring(position, index); + tokenType = SQL; + nextTokenType = SQL; + position = index; + return token; + } + + public String skipWhitespace() { + int index = skipWhitespace(position); + token = sql.substring(position, index); + position = index; + return token; + } + + protected int skipWhitespace(int position) { + int index = sql.length(); + for (int i = position; i < sql.length(); ++i) { + char c = sql.charAt(i); + if (!Character.isWhitespace(c)) { + index = i; + break; + } + } + return index; + } + + // =================================================================================== + // General Helper + // ============== + protected String getLineSeparator() { + return SimpleSystemUtil.getLineSeparator(); + } + + // =================================================================================== + // Accessor + // ======== + public int getPosition() { + return position; + } + + public String getToken() { + return token; + } + + public String getBefore() { + return sql.substring(0, position); + } + + public String getAfter() { + return sql.substring(position); + } + + public int getTokenType() { + return tokenType; + } + + public int getNextTokenType() { + return nextTokenType; + } +} Property changes on: announcement/trunk/src/main/java/jp/sf/pal/announcement/db/allcommon/s2dao/internal/sqlparser/InternalSqlTokenizer.java ___________________________________________________________________ Name: svn:eol-style + native Added: announcement/trunk/src/main/java/jp/sf/pal/announcement/db/allcommon/s2dao/internal/util/InternalBindVariableUtil.java =================================================================== --- announcement/trunk/src/main/java/jp/sf/pal/announcement/db/allcommon/s2dao/internal/util/InternalBindVariableUtil.java (rev 0) +++ announcement/trunk/src/main/java/jp/sf/pal/announcement/db/allcommon/s2dao/internal/util/InternalBindVariableUtil.java 2008-06-30 02:54:27 UTC (rev 1002) @@ -0,0 +1,286 @@ +package jp.sf.pal.announcement.db.allcommon.s2dao.internal.util; + +import java.lang.reflect.InvocationTargetException; +import java.lang.reflect.Method; +import java.sql.Date; +import java.sql.Time; +import java.sql.Timestamp; +import java.text.SimpleDateFormat; +import java.util.Calendar; + +import org.seasar.extension.jdbc.ValueType; + +/** + * @author DBFlute(AutoGenerator) + */ +public class InternalBindVariableUtil { + + // =================================================================================== + // Definition + // ========== + private static final String NULL = "null"; + + // =================================================================================== + // Constructor + // =========== + private InternalBindVariableUtil() { + } + + public static String getCompleteSql(String sql, Object[] args) { + if (args == null || args.length == 0) { + return sql; + } + return getCompleteSql(sql, args, new ValueType[args.length]); + } + + public static String getCompleteSql(String sql, Object[] args, + ValueType[] valueTypes) { + if (args == null || args.length == 0) { + return sql; + } + StringBuffer buf = new StringBuffer(sql.length() + args.length * 15); + int pos = 0; + int pos2 = 0; + int pos3 = 0; + int pos4 = 0; + int pos5 = 0; + int pos6 = 0; + int index = 0; + while (true) { + pos = sql.indexOf('?', pos2); + pos3 = sql.indexOf('\'', pos2); + pos4 = sql.indexOf('\'', pos3 + 1); + pos5 = sql.indexOf("/*", pos2); + pos6 = sql.indexOf("*/", pos5 + 1); + if (pos > 0) { + if (pos3 >= 0 && pos3 < pos && pos < pos4) { + buf.append(sql.substring(pos2, pos4 + 1)); + pos2 = pos4 + 1; + } else if (pos5 >= 0 && pos5 < pos && pos < pos6) { + buf.append(sql.substring(pos2, pos6 + 1)); + pos2 = pos6 + 1; + } else { + if (args.length <= index) { + String msg = "The size of bind arguments is illegal:"; + msg = msg + " size=" + args.length + " sql=" + sql; + throw new IllegalStateException(msg); + } + buf.append(sql.substring(pos2, pos)); + buf.append(getBindVariableText(args[index], + valueTypes[index])); + pos2 = pos + 1; + index++; + } + } else { + buf.append(sql.substring(pos2)); + break; + } + } + return buf.toString(); + } + + public static String getBindVariableText(Object bindVariable) { + if (bindVariable instanceof String) { + return quote(bindVariable.toString()); + } else if (bindVariable instanceof Number) { + return bindVariable.toString(); + } else if (bindVariable instanceof Timestamp) { + SimpleDateFormat sdf = new SimpleDateFormat("yyyy-MM-dd HH.mm.ss"); + return quote(sdf.format((java.util.Date) bindVariable)); + } else if (bindVariable instanceof java.util.Date) { + SimpleDateFormat sdf = new SimpleDateFormat("yyyy-MM-dd"); + return quote(sdf.format((java.util.Date) bindVariable)); + } else if (bindVariable instanceof Boolean) { + return bindVariable.toString(); + } else if (bindVariable == null) { + return NULL; + } else { + return quote(bindVariable.toString()); + } + } + + // For various seasar's version. + protected static final Class[] TOTEXT_ARGUMENT_TYPES = new Class[] { Object.class }; + + protected static final Method TOTEXT_METHOD; + static { + Method method = null; + try { + method = ValueType.class.getMethod("toText", TOTEXT_ARGUMENT_TYPES); + } catch (SecurityException e) { + } catch (NoSuchMethodException e) { + } + TOTEXT_METHOD = method; + } + + public static String getBindVariableText(Object bindVariable, + ValueType valueType) { + if (valueType != null && TOTEXT_METHOD != null) { + try { + return (String) TOTEXT_METHOD.invoke(valueType, + new Object[] { bindVariable }); + } catch (IllegalArgumentException e) { + String msg = "ValueType.toText() threw the IllegalArgumentException:"; + msg = msg + " valueType=" + valueType + " bindVariable=" + + bindVariable; + throw new IllegalStateException(msg, e); + } catch (IllegalAccessException e) { + String msg = "ValueType.toText() threw the IllegalAccessException:"; + msg = msg + " valueType=" + valueType + " bindVariable=" + + bindVariable; + throw new IllegalStateException(msg, e); + } catch (InvocationTargetException e) { + if (e.getTargetException() instanceof RuntimeException) { + throw (RuntimeException) e.getTargetException(); + } else { + String msg = "ValueType.toText() threw the exception:"; + msg = msg + " valueType=" + valueType + " bindVariable=" + + bindVariable; + throw new IllegalStateException(msg, e.getTargetException()); + } + } + } + return getBindVariableText(bindVariable); + } + + public static String nullText() { + return NULL; + } + + public static String toText(Number value) { + if (value == null) { + return NULL; + } + return value.toString(); + } + + public static String toText(Boolean value) { + if (value == null) { + return NULL; + } + return quote(value.toString()); + } + + public static String toText(String value) { + if (value == null) { + return NULL; + } + return quote(value); + } + + public static String toText(Date value) { + if (value == null) { + return NULL; + } + Calendar calendar = Calendar.getInstance(); + calendar.setTime(value); + StringBuilder buf = new StringBuilder(); + addDate(buf, calendar); + return quote(buf.toString()); + } + + public static String toText(Time value) { + if (value == null) { + return NULL; + } + Calendar calendar = Calendar.getInstance(); + calendar.setTime(value); + StringBuilder buf = new StringBuilder(); + addTime(buf, calendar); + addTimeDecimalPart(buf, calendar.get(Calendar.MILLISECOND)); + return quote(buf.toString()); + } + + public static String toText(Timestamp value) { + if (value == null) { + return NULL; + } + Calendar calendar = Calendar.getInstance(); + calendar.setTime(value); + StringBuilder buf = new StringBuilder(30); + addDate(buf, calendar); + addTime(buf, calendar); + addTimeDecimalPart(buf, value.getNanos()); + return quote(buf.toString()); + } + + public static String toText(byte[] value) { + if (value == null) { + return NULL; + } + return quote(value.toString() + "(byteLength=" + + Integer.toString(value.length) + ")"); + } + + /** + * {@link Object}の文字列表現を返します。 + * + * @param value + * 値 + * @return 文字列表現 + */ + public static String toText(Object value) { + if (value == null) { + return NULL; + } + return quote(value.toString()); + } + + // yyyy-mm-dd + protected static void addDate(StringBuilder buf, Calendar calendar) { + int year = calendar.get(Calendar.YEAR); + buf.append(year); + buf.append('-'); + int month = calendar.get(Calendar.MONTH) + 1; + if (month < 10) { + buf.append('0'); + } + buf.append(month); + buf.append('-'); + int date = calendar.get(Calendar.DATE); + if (date < 10) { + buf.append('0'); + } + buf.append(date); + } + + // hh:mm:ss + protected static void addTime(StringBuilder buf, Calendar calendar) { + if (buf.length() > 0) { + buf.append(' '); + } + int hour = calendar.get(Calendar.HOUR_OF_DAY); + if (hour < 10) { + buf.append('0'); + } + buf.append(hour); + buf.append(':'); + int minute = calendar.get(Calendar.MINUTE); + if (minute < 10) { + buf.append('0'); + } + buf.append(minute); + buf.append(':'); + int second = calendar.get(Calendar.SECOND); + if (second < 10) { + buf.append('0'); + } + buf.append(second); + } + + // .000 + protected static void addTimeDecimalPart(StringBuilder buf, int decimalPart) { + if (decimalPart == 0) { + return; + } + if (buf.length() > 0) { + buf.append('.'); + } + buf.append(decimalPart); + } + + // 'text' + protected static String quote(String text) { + return "'" + text + "'"; + } +} Property changes on: announcement/trunk/src/main/java/jp/sf/pal/announcement/db/allcommon/s2dao/internal/util/InternalBindVariableUtil.java ___________________________________________________________________ Name: svn:eol-style + native Added: announcement/trunk/src/main/java/jp/sf/pal/announcement/db/allcommon/util/SimpleAssertUtil.java =================================================================== --- announcement/trunk/src/main/java/jp/sf/pal/announcement/db/allcommon/util/SimpleAssertUtil.java (rev 0) +++ announcement/trunk/src/main/java/jp/sf/pal/announcement/db/allcommon/util/SimpleAssertUtil.java 2008-06-30 02:54:27 UTC (rev 1002) @@ -0,0 +1,53 @@ +package jp.sf.pal.announcement.db.allcommon.util; + +/** + * @author DBFlute(AutoGenerator) + */ +public class SimpleAssertUtil { + + // =================================================================================== + // Assert + // ====== + // ----------------------------------------------------- + // Assert Object + // ------------- + /** + * Assert that the object is not null. + * + * @param variableName Variable name. (NotNull) + * @param value Value. (NotNull) + * @exception IllegalArgumentException + */ + public static void assertObjectNotNull(String variableName, Object value) { + if (variableName == null) { + String msg = "The value should not be null: variableName=" + + variableName + " value=" + value; + throw new IllegalArgumentException(msg); + } + if (value == null) { + String msg = "The value should not be null: variableName=" + + variableName; + throw new IllegalArgumentException(msg); + } + } + + // ----------------------------------------------------- + // Assert String + // ------------- + /** + * Assert that the entity is not null and not trimmed empty. + * + * @param variableName Variable name. (NotNull) + * @param value Value. (NotNull) + */ + public static void assertStringNotNullAndNotTrimmedEmpty( + String variableName, String value) { + assertObjectNotNull("variableName", variableName); + assertObjectNotNull("value", value); + if (value.trim().length() == 0) { + String msg = "The value should not be empty: variableName=" + + variableName + " value=" + value; + throw new IllegalArgumentException(msg); + } + } +} Property changes on: announcement/trunk/src/main/java/jp/sf/pal/announcement/db/allcommon/util/SimpleAssertUtil.java ___________________________________________________________________ Name: svn:eol-style + native Added: announcement/trunk/src/main/java/jp/sf/pal/announcement/db/allcommon/util/SimpleStringUtil.java =================================================================== --- announcement/trunk/src/main/java/jp/sf/pal/announcement/db/allcommon/util/SimpleStringUtil.java (rev 0) +++ announcement/trunk/src/main/java/jp/sf/pal/announcement/db/allcommon/util/SimpleStringUtil.java 2008-06-30 02:54:27 UTC (rev 1002) @@ -0,0 +1,61 @@ +package jp.sf.pal.announcement.db.allcommon.util; + +/** + * @author DBFlute(AutoGenerator) + */ +public class SimpleStringUtil { + + // =================================================================================== + // String + // ====== + public static String replace(String text, String fromText, String toText) { + if (text == null || fromText == null || toText == null) { + return null; + } + StringBuilder sb = new StringBuilder(); + int pos = 0; + int pos2 = 0; + do { + pos = text.indexOf(fromText, pos2); + if (pos == 0) { + sb.append(toText); + pos2 = fromText.length(); + } else if (pos > 0) { + sb.append(text.substring(pos2, pos)); + sb.append(toText); + pos2 = pos + fromText.length(); + } else { + sb.append(text.substring(pos2)); + return sb.toString(); + } + } while (true); + } + + public static String initCap(String str) { + assertObjectNotNull("str", str); + return str.substring(0, 1).toUpperCase() + str.substring(1); + } + + // ----------------------------------------------------- + // Assert Object + // ------------- + /** + * Assert that the object is not null. + * + * @param variableName Variable name. (NotNull) + * @param value Value. (NotNull) + * @exception IllegalArgumentException + */ + public static void assertObjectNotNull(String variableName, Object value) { + if (variableName == null) { + String msg = "The value should not be null: variableName=" + + variableName + " value=" + value; + throw new IllegalArgumentException(msg); + } + if (value == null) { + String msg = "The value should not be null: variableName=" + + variableName; + throw new IllegalArgumentException(msg); + } + } +} Property changes on: announcement/trunk/src/main/java/jp/sf/pal/announcement/db/allcommon/util/SimpleStringUtil.java ___________________________________________________________________ Name: svn:eol-style + native Added: announcement/trunk/src/main/java/jp/sf/pal/announcement/db/allcommon/util/SimpleSystemUtil.java =================================================================== --- announcement/trunk/src/main/java/jp/sf/pal/announcement/db/allcommon/util/SimpleSystemUtil.java (rev 0) +++ announcement/trunk/src/main/java/jp/sf/pal/announcement/db/allcommon/util/SimpleSystemUtil.java 2008-06-30 02:54:27 UTC (rev 1002) @@ -0,0 +1,14 @@ +package jp.sf.pal.announcement.db.allcommon.util; + +/** + * @author DBFlute(AutoGenerator) + */ +public class SimpleSystemUtil { + + // =================================================================================== + // System + // ====== + public static String getLineSeparator() { + return System.getProperty("line.separator"); + } +} Property changes on: announcement/trunk/src/main/java/jp/sf/pal/announcement/db/allcommon/util/SimpleSystemUtil.java ___________________________________________________________________ Name: svn:eol-style + native Added: announcement/trunk/src/main/java/jp/sf/pal/announcement/db/allcommon/util/TraceViewUtil.java =================================================================== --- announcement/trunk/src/main/java/jp/sf/pal/announcement/db/allcommon/util/TraceViewUtil.java (rev 0) +++ announcement/trunk/src/main/java/jp/sf/pal/announcement/db/allcommon/util/TraceViewUtil.java 2008-06-30 02:54:27 UTC (rev 1002) @@ -0,0 +1,66 @@ +package jp.sf.pal.announcement.db.allcommon.util; + +/** + * @author DBFlute(AutoGenerator) + */ +public class TraceViewUtil { + + /** + * Convert to performance view. + * + * @param afterMinusBefore The value of after-minus-before millisecound. + * @return Performance view. (ex. 1m23s456ms) (NotNull) + */ + public static String convertToPerformanceView(long afterMinusBefore) { + if (afterMinusBefore < 0) { + return String.valueOf(afterMinusBefore); + } + + long sec = afterMinusBefore / 1000; + final long min = sec / 60; + sec = sec % 60; + final long mil = afterMinusBefore % 1000; + + final StringBuffer sb = new StringBuffer(); + if (min >= 10) { // Minute + sb.append(min).append("m"); + } else if (min < 10 && min >= 0) { + sb.append("0").append(min).append("m"); + } + if (sec >= 10) { // Second + sb.append(sec).append("s"); + } else if (sec < 10 && sec >= 0) { + sb.append("0").append(sec).append("s"); + } + if (mil >= 100) { // Millisecond + sb.append(mil).append("ms"); + } else if (mil < 100 && mil >= 10) { + sb.append("0").append(mil).append("ms"); + } else if (mil < 10 && mil >= 0) { + sb.append("00").append(mil).append("ms"); + } + + return sb.toString(); + } + + /** + * Convert object array to string view. + * + * @param objArray The array of object. (Nullable) + * @return The string divided with comma. (NotNull: If the argument is null, returns empty string.) + */ + public static String convertObjectArrayToStringView(Object[] objArray) { + if (objArray == null) { + return ""; + } + final StringBuffer sb = new StringBuffer(); + for (int i = 0; i < objArray.length; i++) { + if (i == 0) { + sb.append(objArray[i]); + } else { + sb.append(", ").append(objArray[i]); + } + } + return sb.toString(); + } +} Property changes on: announcement/trunk/src/main/java/jp/sf/pal/announcement/db/allcommon/util/TraceViewUtil.java ___________________________________________________________________ Name: svn:eol-style + native Added: announcement/trunk/src/main/java/jp/sf/pal/announcement/db/allcommon/util/ValueLabelUtil.java =================================================================== --- announcement/trunk/src/main/java/jp/sf/pal/announcement/db/allcommon/util/ValueLabelUtil.java (rev 0) +++ announcement/trunk/src/main/java/jp/sf/pal/announcement/db/allcommon/util/ValueLabelUtil.java 2008-06-30 02:54:27 UTC (rev 1002) @@ -0,0 +1,64 @@ +package jp.sf.pal.announcement.db.allcommon.util; + +import java.util.LinkedHashMap; +import java.util.List; +import java.util.Map; + +/** + * @author DBFlute(AutoGenerator) + */ +public class ValueLabelUtil { + + /** + * Find the label by the value from the list of value label. + * @param valueLabelList The list of value label. (NotNull and NotEmpty) + * @param value Value. (NotNull) + * @return Label. (NotNull) + */ + public static String findLabel(List> valueLabelList, + Object value) { + if (valueLabelList == null) { + String msg = "The arguement[valueLabelList] should not be null."; + throw new IllegalArgumentException(msg); + } + if (valueLabelList.isEmpty()) { + String msg = "The arguement[valueLabelList] should not be empty."; + throw new IllegalArgumentException(msg); + } + if (value == null) { + String msg = "The arguement[value] should not be null."; + throw new IllegalArgumentException(msg); + } + for (Map elementMap : valueLabelList) { + final Object currentValue = elementMap.get("value"); + if (value.equals(currentValue)) { + return (String) elementMap.get("label"); + } + } + String msg = "Not found label by the value: value=" + value + + " valueLabelList=" + valueLabelList; + throw new IllegalStateException(msg); + } + + public static Map createValueLabelMap( + List> valueLabelList) { + final Map resultMap = new LinkedHashMap(); + for (Map elementMap : valueLabelList) { + final Object currentValue = elementMap.get("value"); + final String currentLabel = (String) elementMap.get("label"); + resultMap.put(currentValue, currentLabel); + } + return resultMap; + } + + public static Map createLabelValueMap( + List> valueLabelList) { + final Map resultMap = new LinkedHashMap(); + for (Map elementMap : valueLabelList) { + final Object currentValue = elementMap.get("value"); + final String currentLabel = (String) elementMap.get("label"); + resultMap.put(currentLabel, currentValue); + } + return resultMap; + } +} Property changes on: announcement/trunk/src/main/java/jp/sf/pal/announcement/db/allcommon/util/ValueLabelUtil.java ___________________________________________________________________ Name: svn:eol-style + native Added: announcement/trunk/src/main/java/jp/sf/pal/announcement/db/bsbhv/BsAnnouncementBhv.java =================================================================== --- announcement/trunk/src/main/java/jp/sf/pal/announcement/db/bsbhv/BsAnnouncementBhv.java (rev 0) +++ announcement/trunk/src/main/java/jp/sf/pal/announcement/db/bsbhv/BsAnnouncementBhv.java 2008-06-30 02:54:27 UTC (rev 1002) @@ -0,0 +1,556 @@ +package jp.sf.pal.announcement.db.bsbhv; + +import java.util.List; + +import jp.sf.pal.announcement.db.allcommon.DaoReadable; +import jp.sf.pal.announcement.db.allcommon.DaoWritable; +import jp.sf.pal.announcement.db.allcommon.Entity; +import jp.sf.pal.announcement.db.allcommon.bhv.setup.ConditionBeanSetupper; +import jp.sf.pal.announcement.db.allcommon.bhv.setup.ValueLabelSetupper; +import jp.sf.pal.announcement.db.allcommon.cbean.ConditionBean; +import jp.sf.pal.announcement.db.allcommon.cbean.ListResultBean; +import jp.sf.pal.announcement.db.allcommon.cbean.PagingBean; +import jp.sf.pal.announcement.db.allcommon.cbean.PagingHandler; +import jp.sf.pal.announcement.db.allcommon.cbean.PagingInvoker; +import jp.sf.pal.announcement.db.allcommon.cbean.PagingResultBean; +import jp.sf.pal.announcement.db.allcommon.dbmeta.DBMeta; +import jp.sf.pal.announcement.db.allcommon.dbmeta.hierarchy.HierarchyArranger; +import jp.sf.pal.announcement.db.allcommon.dbmeta.hierarchy.HierarchyBasicRequest; +import jp.sf.pal.announcement.db.allcommon.dbmeta.hierarchy.HierarchyRequest; +import jp.sf.pal.announcement.db.bsentity.dbmeta.AnnouncementDbm; +import jp.sf.pal.announcement.db.cbean.AnnouncementCB; +import jp.sf.pal.announcement.db.exdao.AnnouncementDao; +import jp.sf.pal.announcement.db.exentity.Announcement; +import jp.sf.pal.announcement.db.exentity.AnnouncementBody; + +/** + * The behavior of ANNOUNCEMENT. + *
    + * [primary-key]
    + *     ID
    + * 
    + * [column]
    + *     ID, SCOPE, ROLE, START_DATE, END_DATE, TITLE, SORT_ORDER, TIMESTAMP
    + * 
    + * [sequence]
    + *     
    + * 
    + * [identity]
    + *     ID
    + * 
    + * [version-no]
    + *     
    + * 
    + * [foreign-table]
    + *     
    + * 
    + * [referrer-table]
    + *     ANNOUNCEMENT_BODY
    + * 
    + * [foreign-property]
    + *     announcementBodyAsOne
    + * 
    + * [referrer-property]
    + *     
    + * 
    + * @author DBFlute(AutoGenerator) + */ + @ SuppressWarnings("unchecked") +public abstract class BsAnnouncementBhv extends + jp.sf.pal.announcement.db.allcommon.bhv.AbstractBehaviorWritable { + + // =================================================================================== + // Attribute + // ========= + protected AnnouncementDao _dao; + + // =================================================================================== + // Table name + // ========== + /** @return The name on database of table. (NotNull) */ + public String getTableDbName() { + return "ANNOUNCEMENT"; + } + + // =================================================================================== + // DBMeta + // ====== + /** @return The meta data of the database. (NotNull) */ + public DBMeta getDBMeta() { + return AnnouncementDbm.getInstance(); + } + + /** @return The meta data of the database as my table type. (NotNull) */ + public AnnouncementDbm getMyDBMeta() { + return AnnouncementDbm.getInstance(); + } + + // =================================================================================== + // Dao Accessor + // ============ + public AnnouncementDao getMyDao() { + return _dao; + } + + public void setMyDao(AnnouncementDao dao) { + assertObjectNotNull("dao", dao); + _dao = dao; + } + + public DaoReadable getDaoReadable() { + return getMyDao(); + } + + public DaoWritable getDaoWritable() { + return getMyDao(); + } + + // =================================================================================== + // New Instance + // ============ + public Entity newEntity() { + return newMyEntity(); + } + + public ConditionBean newConditionBean() { + return newMyConditionBean(); + } + + public Announcement newMyEntity() { + return new Announcement(); + } + + public AnnouncementCB newMyConditionBean() { + return new AnnouncementCB(); + } + + // =================================================================================== + // Basic Select Count + // ================== + /** + * Select the count of the condition-bean. {IgnorePagingCondition} + * @param cb The condition-bean of Announcement. (NotNull) + * @return The selected count. + */ + public int selectCount(AnnouncementCB cb) { + assertConditionBeanNotNull(cb); + return delegateSelectCount(cb); + } + + // =================================================================================== + // Basic Select Entity + // =================== + /** + * Select the entity by the condition-bean. + * @param cb The condition-bean of Announcement. (NotNull) + * @return The selected entity. (Nullalble) + * @exception jp.sf.pal.announcement.db.allcommon.exception.EntityDuplicatedException When the entity has been duplicated. + */ + public Announcement selectEntity(final AnnouncementCB cb) { + return helpSelectEntityInternally( + cb, + new InternalSelectEntityCallback() { + public List callbackSelectList( + AnnouncementCB cb) { + return selectList(cb); + } + }); + } + + /** + * Select the entity by the condition-bean with deleted check. + * @param cb The condition-bean of Announcement. (NotNull) + * @return The selected entity. (NotNull) + * @exception jp.sf.pal.announcement.db.allcommon.exception.EntityAlreadyDeletedException When the entity has already been deleted. + * @exception jp.sf.pal.announcement.db.allcommon.exception.EntityDuplicatedException When the entity has been duplicated. + */ + public Announcement selectEntityWithDeletedCheck(final AnnouncementCB cb) { + return helpSelectEntityWithDeletedCheckInternally( + cb, + new InternalSelectEntityWithDeletedCheckCallback() { + public List callbackSelectList( + AnnouncementCB cb) { + return selectList(cb); + } + }); + } + + /* (non-javadoc) + * Select the entity with deleted check. {by primary-key value} + * @param primaryKey The keys of primary. + * @return The selected entity. (NotNull) + * @exception jp.sf.pal.announcement.db.allcommon.exception.EntityAlreadyDeletedException When the entity has already been deleted. + * @exception jp.sf.pal.announcement.db.allcommon.exception.EntityDuplicatedException When the entity has been duplicated. + */ + public Announcement selectByPKValueWithDeletedCheck(Integer id) { + Announcement entity = new Announcement(); + entity.setId(id); + final AnnouncementCB cb = newMyConditionBean(); + cb.acceptPrimaryKeyMapString(getDBMeta().extractPrimaryKeyMapString( + entity)); + return selectEntityWithDeletedCheck(cb); + } + + // =================================================================================== + // Basic Select List + // ================= + /** + * Select the list as result-bean. + * @param cb The condition-bean of Announcement. (NotNull) + * @return The result-bean of selected list. (NotNull) + */ + public ListResultBean selectList(AnnouncementCB cb) { + assertConditionBeanNotNull(cb); + return new jp.sf.pal.announcement.db.allcommon.cbean.ResultBeanBuilder( + getTableDbName()).buildListResultBean(cb, + delegateSelectList(cb)); + } + + /** + * Select the page as result-bean. + * @param cb The condition-bean of Announcement. (NotNull) + * @return The result-bean of selected page. (NotNull) + */ + public PagingResultBean selectPage(final AnnouncementCB cb) { + assertConditionBeanNotNull(cb); + final PagingInvoker invoker = new PagingInvoker( + getTableDbName()); + final PagingHandler handler = new PagingHandler() { + public PagingBean getPagingBean() { + return cb; + } + + public int count() { + return selectCount(cb); + } + + public List paging() { + return selectList(cb); + } + }; + return invoker.invokePaging(handler); + } + + // =================================================================================== + // Various Select + // ============== + /** + * Select the list of value-label. + * @param cb The condition-bean of Announcement. (NotNull) + * @param valueLabelSetupper The setupper of value-label. (NotNull) + * @return The list of value-label. (NotNull) + */ + public List> selectValueLabelList( + AnnouncementCB cb, + ValueLabelSetupper valueLabelSetupper) { + return createValueLabelList(selectList(cb), valueLabelSetupper); + } + + // =================================================================================== + // Load Referrer + // ============= + + // =================================================================================== + // Pull Out Foreign + // ================ + + /** + * Pull out the list of referrer-as-one table 'AnnouncementBody'. + * @param announcementList The list of announcement. (NotNull) + * @return The list of referrer-as-one table. (NotNull) + */ + public List pulloutAnnouncementBodyAsOne( + List announcementList) { + return helpPulloutInternally(announcementList, + new InternalPulloutCallback() { + public AnnouncementBody callbackGetForeignEntity( + Announcement entity) { + return entity.getAnnouncementBodyAsOne(); + } + }); + } + + // =================================================================================== + // Basic Entity Update + // =================== + /** + * Insert the entity. + * @param announcement The entity of insert target. (NotNull) + */ + public void insert(Announcement announcement) { + assertEntityNotNull(announcement); + delegateInsert(announcement); + } + + @Override + protected void doCreate(Entity announcement) { + insert((Announcement) announcement); + } + + /** + * Update the entity modified-only. {UpdateCountZeroException, ConcurrencyControl} + * @param announcement The entity of update target. (NotNull) {PrimaryKeyRequired, ConcurrencyColumnRequired} + * @exception jp.sf.pal.announcement.db.allcommon.exception.EntityAlreadyDeletedException When the entity has already been deleted. + * @exception jp.sf.pal.announcement.db.allcommon.exception.EntityDuplicatedException When the entity has been duplicated. + */ + public void update(final Announcement announcement) { + helpUpdateInternally(announcement, + new InternalUpdateCallback() { + public int callbackDelegateUpdate(Announcement entity) { + return delegateUpdate(entity); + } + }); + } + + @Override + protected void doModify(Entity entity) { + update((Announcement) entity); + } + + @Override + protected void doModifyNonstrict(Entity entity) { + update((Announcement) entity); + } + + /** + * Insert or update the entity modified-only. {ConcurrencyControl(when update)} + * @param announcement The entity of insert or update target. (NotNull) + * @exception jp.sf.pal.announcement.db.allcommon.exception.EntityAlreadyDeletedException When the entity has already been deleted. + * @exception jp.sf.pal.announcement.db.allcommon.exception.EntityDuplicatedException When the entity has been duplicated. + */ + public void insertOrUpdate(final Announcement announcement) { + helpInsertOrUpdateInternally( + announcement, + new InternalInsertOrUpdateCallback() { + public void callbackInsert(Announcement entity) { + insert(entity); + } + + public void callbackUpdate(Announcement entity) { + update(entity); + } + + public AnnouncementCB callbackNewMyConditionBean() { + return newMyConditionBean(); + } + + public int callbackSelectCount(AnnouncementCB cb) { + return selectCount(cb); + } + }); + } + + @Override + protected void doCreateOrUpdate(Entity announcement) { + insertOrUpdate((Announcement) announcement); + } + + @Override + protected void doCreateOrUpdateNonstrict(Entity entity) { + insertOrUpdate((Announcement) entity); + } + + /** + * Delete the entity. {UpdateCountZeroException, ConcurrencyControl} + * @param announcement The entity of delete target. (NotNull) {PrimaryKeyRequired, ConcurrencyColumnRequired} + * @exception jp.sf.pal.announcement.db.allcommon.exception.EntityAlreadyDeletedException When the entity has already been deleted. + * @exception jp.sf.pal.announcement.db.allcommon.exception.EntityDuplicatedException When the entity has been duplicated. + */ + public void delete(Announcement announcement) { + helpDeleteInternally(announcement, + new InternalDeleteCallback() { + public int callbackDelegateDelete(Announcement entity) { + return delegateDelete(entity); + } + }); + } + + @Override + protected void doRemove(Entity announcement) { + delete((Announcement) announcement); + } + + // =================================================================================== + // Basic Batch Update + // ================== + /** + * Batch insert the list. This method use 'Batch Update' of java.sql.PreparedStatement. + * @param announcementList The list of the entity. (NotNull) + * @return The array of inserted count. + */ + public int[] batchInsert(List announcementList) { + assertObjectNotNull("announcementList", announcementList); + return delegateInsertList(announcementList); + } + + /** + * Batch update the list. All columns are update target. {NOT modified only}
    + * This method use 'Batch Update' of java.sql.PreparedStatement. + * @param announcementList The list of the entity. (NotNull) + * @return The array of updated count. + * @exception jp.sf.pal.announcement.db.allcommon.exception.EntityAlreadyDeletedException When the entity has already been deleted. + */ + public int[] batchUpdate(List announcementList) { + assertObjectNotNull("announcementList", announcementList); + return delegateUpdateList(announcementList); + } + + /** + * Batch delete the list.
    + * This method use 'Batch Update' of java.sql.PreparedStatement. + * @param announcementList The list of the entity. (NotNull) + * @return The array of deleted count. + * @exception jp.sf.pal.announcement.db.allcommon.exception.EntityAlreadyDeletedException When the entity has already been deleted. + */ + public int[] batchDelete(List announcementList) { + assertObjectNotNull("announcementList", announcementList); + return delegateDeleteList(announcementList); + } + + // =================================================================================== + // Various Update + // ============== + + // =================================================================================== + // Various Delete + // ============== + /** + * Query delete the several entities. + * @param cb Condition-bean. (NotNull) + * @return The deleted count. + */ + public int queryDelete(AnnouncementCB cb) { + assertConditionBeanNotNull(cb); + return getMyDao().deleteByQuery(cb); + } + + // =================================================================================== + // Delegate Method + // =============== + // ----------------------------------------------------- + // Select + // ------ + protected int delegateGetCountAll() { + return getMyDao().getCountAll(); + } + + protected List delegateGetListAll() { + return getMyDao().getListAll(); + } + + protected Announcement delegateGetEntity(Integer id) { + return getMyDao().getEntity(id); + } + + protected int delegateSelectCount(AnnouncementCB cb) { + assertConditionBeanNotNull(cb); + return getMyDao().selectCount(cb); + } + + protected Announcement delegateSelectEntity(AnnouncementCB cb) { + assertConditionBeanNotNull(cb); + return getMyDao().selectEntity(cb); + } + + protected List delegateSelectList(AnnouncementCB cb) { + assertConditionBeanNotNull(cb); + return getMyDao().selectList(cb); + } + + // ----------------------------------------------------- + // Update + // ------ + protected int delegateInsert(Announcement entity) { + if (!processBeforeInsert(entity)) { + return 1; + } + return getMyDao().insert(entity); + } + + protected int delegateUpdate(Announcement entity) { + if (!processBeforeUpdate(entity)) { + return 1; + } + return getMyDao().updateModifiedOnly(entity); + } + + protected int delegateDelete(Announcement entity) { + if (!processBeforeDelete(entity)) { + return 1; + } + return getMyDao().delete(entity); + } + + protected int[] delegateInsertList(List entityList) { + assertObjectNotNull("announcementList", entityList); + return getMyDao().insertList( + helpFilterBeforeInsertInternally(entityList)); + } + + protected int[] delegateUpdateList(List entityList) { + assertObjectNotNull("announcementList", entityList); + return getMyDao().updateList( + helpFilterBeforeUpdateInternally(entityList)); + } + + protected int[] delegateDeleteList(List entityList) { + assertObjectNotNull("announcementList", entityList); + return getMyDao().deleteList( + helpFilterBeforeDeleteInternally(entityList)); + } + + // =================================================================================== + // Hierarchy + // ========= + /** + * Create the basic request of hierarchy of Announcement.. + * @param sourceList The list of source. (NotNull) + * @param The type of source. + * @return Hierarchy request of Announcement. (NotNull) + */ + public HierarchyBasicRequest createHierarchyBasicRequest( + List sourceList) { + final HierarchyBasicRequest request = new HierarchyBasicRequest( + Announcement.class); + request.registerSourceList(sourceList); + return request; + } + + /** + * Arrange hierarchy. + * @param request Hierarchy request of Announcement. (NotNull) + * @return The list of Announcement. (NotNull) + */ + public List arrangeHierarchy( + HierarchyRequest request) { + return new HierarchyArranger().arrangeHierarchy(request); + } + + // =================================================================================== + // CBSetupper + // ========== + public static interface CBSetupper extends + ConditionBeanSetupper { + public void setup(AnnouncementCB cb); + } + + // =================================================================================== + // Optimistic Lock Info + // ==================== + @Override + protected boolean hasVersionNoValue(Entity entity) { + return false; + } + + @Override + protected boolean hasUpdateDateValue(Entity entity) { + return false; + } + + // =================================================================================== + // Helper + // ====== + protected Announcement downcast(Entity entity) { + return helpDowncastInternally(entity, Announcement.class); + } +} Property changes on: announcement/trunk/src/main/java/jp/sf/pal/announcement/db/bsbhv/BsAnnouncementBhv.java ___________________________________________________________________ Name: svn:eol-style + native Added: announcement/trunk/src/main/java/jp/sf/pal/announcement/db/bsbhv/BsAnnouncementBodyBhv.java =================================================================== --- announcement/trunk/src/main/java/jp/sf/pal/announcement/db/bsbhv/BsAnnouncementBodyBhv.java (rev 0) +++ announcement/trunk/src/main/java/jp/sf/pal/announcement/db/bsbhv/BsAnnouncementBodyBhv.java 2008-06-30 02:54:27 UTC (rev 1002) @@ -0,0 +1,559 @@ +package jp.sf.pal.announcement.db.bsbhv; + +import java.util.List; + +import jp.sf.pal.announcement.db.allcommon.DaoReadable; +import jp.sf.pal.announcement.db.allcommon.DaoWritable; +import jp.sf.pal.announcement.db.allcommon.Entity; +import jp.sf.pal.announcement.db.allcommon.bhv.setup.ConditionBeanSetupper; +import jp.sf.pal.announcement.db.allcommon.bhv.setup.ValueLabelSetupper; +import jp.sf.pal.announcement.db.allcommon.cbean.ConditionBean; +import jp.sf.pal.announcement.db.allcommon.cbean.ListResultBean; +import jp.sf.pal.announcement.db.allcommon.cbean.PagingBean; +import jp.sf.pal.announcement.db.allcommon.cbean.PagingHandler; +import jp.sf.pal.announcement.db.allcommon.cbean.PagingInvoker; +import jp.sf.pal.announcement.db.allcommon.cbean.PagingResultBean; +import jp.sf.pal.announcement.db.allcommon.dbmeta.DBMeta; +import jp.sf.pal.announcement.db.allcommon.dbmeta.hierarchy.HierarchyArranger; +import jp.sf.pal.announcement.db.allcommon.dbmeta.hierarchy.HierarchyBasicRequest; +import jp.sf.pal.announcement.db.allcommon.dbmeta.hierarchy.HierarchyRequest; +import jp.sf.pal.announcement.db.bsentity.dbmeta.AnnouncementBodyDbm; +import jp.sf.pal.announcement.db.cbean.AnnouncementBodyCB; +import jp.sf.pal.announcement.db.exdao.AnnouncementBodyDao; +import jp.sf.pal.announcement.db.exentity.Announcement; +import jp.sf.pal.announcement.db.exentity.AnnouncementBody; + +/** + * The behavior of ANNOUNCEMENT_BODY. + *
    + * [primary-key]
    + *     ID
    + * 
    + * [column]
    + *     ID, CONTENT
    + * 
    + * [sequence]
    + *     
    + * 
    + * [identity]
    + *     ${table.identityColumnName}
    + * 
    + * [version-no]
    + *     
    + * 
    + * [foreign-table]
    + *     ANNOUNCEMENT
    + * 
    + * [referrer-table]
    + *     
    + * 
    + * [foreign-property]
    + *     announcement
    + * 
    + * [referrer-property]
    + *     
    + * 
    + * @author DBFlute(AutoGenerator) + */ + @ SuppressWarnings("unchecked") +public abstract class BsAnnouncementBodyBhv extends + jp.sf.pal.announcement.db.allcommon.bhv.AbstractBehaviorWritable { + + // =================================================================================== + // Attribute + // ========= + protected AnnouncementBodyDao _dao; + + // =================================================================================== + // Table name + // ========== + /** @return The name on database of table. (NotNull) */ + public String getTableDbName() { + return "ANNOUNCEMENT_BODY"; + } + + // =================================================================================== + // DBMeta + // ====== + /** @return The meta data of the database. (NotNull) */ + public DBMeta getDBMeta() { + return AnnouncementBodyDbm.getInstance(); + } + + /** @return The meta data of the database as my table type. (NotNull) */ + public AnnouncementBodyDbm getMyDBMeta() { + return AnnouncementBodyDbm.getInstance(); + } + + // =================================================================================== + // Dao Accessor + // ============ + public AnnouncementBodyDao getMyDao() { + return _dao; + } + + public void setMyDao(AnnouncementBodyDao dao) { + assertObjectNotNull("dao", dao); + _dao = dao; + } + + public DaoReadable getDaoReadable() { + return getMyDao(); + } + + public DaoWritable getDaoWritable() { + return getMyDao(); + } + + // =================================================================================== + // New Instance + // ============ + public Entity newEntity() { + return newMyEntity(); + } + + public ConditionBean newConditionBean() { + return newMyConditionBean(); + } + + public AnnouncementBody newMyEntity() { + return new AnnouncementBody(); + } + + public AnnouncementBodyCB newMyConditionBean() { + return new AnnouncementBodyCB(); + } + + // =================================================================================== + // Basic Select Count + // ================== + /** + * Select the count of the condition-bean. {IgnorePagingCondition} + * @param cb The condition-bean of AnnouncementBody. (NotNull) + * @return The selected count. + */ + public int selectCount(AnnouncementBodyCB cb) { + assertConditionBeanNotNull(cb); + return delegateSelectCount(cb); + } + + // =================================================================================== + // Basic Select Entity + // =================== + /** + * Select the entity by the condition-bean. + * @param cb The condition-bean of AnnouncementBody. (NotNull) + * @return The selected entity. (Nullalble) + * @exception jp.sf.pal.announcement.db.allcommon.exception.EntityDuplicatedException When the entity has been duplicated. + */ + public AnnouncementBody selectEntity(final AnnouncementBodyCB cb) { + return helpSelectEntityInternally( + cb, + new InternalSelectEntityCallback() { + public List callbackSelectList( + AnnouncementBodyCB cb) { + return selectList(cb); + } + }); + } + + /** + * Select the entity by the condition-bean with deleted check. + * @param cb The condition-bean of AnnouncementBody. (NotNull) + * @return The selected entity. (NotNull) + * @exception jp.sf.pal.announcement.db.allcommon.exception.EntityAlreadyDeletedException When the entity has already been deleted. + * @exception jp.sf.pal.announcement.db.allcommon.exception.EntityDuplicatedException When the entity has been duplicated. + */ + public AnnouncementBody selectEntityWithDeletedCheck( + final AnnouncementBodyCB cb) { + return helpSelectEntityWithDeletedCheckInternally( + cb, + new InternalSelectEntityWithDeletedCheckCallback() { + public List callbackSelectList( + AnnouncementBodyCB cb) { + return selectList(cb); + } + }); + } + + /* (non-javadoc) + * Select the entity with deleted check. {by primary-key value} + * @param primaryKey The keys of primary. + * @return The selected entity. (NotNull) + * @exception jp.sf.pal.announcement.db.allcommon.exception.EntityAlreadyDeletedException When the entity has already been deleted. + * @exception jp.sf.pal.announcement.db.allcommon.exception.EntityDuplicatedException When the entity has been duplicated. + */ + public AnnouncementBody selectByPKValueWithDeletedCheck(Integer id) { + AnnouncementBody entity = new AnnouncementBody(); + entity.setId(id); + final AnnouncementBodyCB cb = newMyConditionBean(); + cb.acceptPrimaryKeyMapString(getDBMeta().extractPrimaryKeyMapString( + entity)); + return selectEntityWithDeletedCheck(cb); + } + + // =================================================================================== + // Basic Select List + // ================= + /** + * Select the list as result-bean. + * @param cb The condition-bean of AnnouncementBody. (NotNull) + * @return The result-bean of selected list. (NotNull) + */ + public ListResultBean selectList(AnnouncementBodyCB cb) { + assertConditionBeanNotNull(cb); + return new jp.sf.pal.announcement.db.allcommon.cbean.ResultBeanBuilder( + getTableDbName()).buildListResultBean(cb, + delegateSelectList(cb)); + } + + /** + * Select the page as result-bean. + * @param cb The condition-bean of AnnouncementBody. (NotNull) + * @return The result-bean of selected page. (NotNull) + */ + public PagingResultBean selectPage( + final AnnouncementBodyCB cb) { + assertConditionBeanNotNull(cb); + final PagingInvoker invoker = new PagingInvoker( + getTableDbName()); + final PagingHandler handler = new PagingHandler() { + public PagingBean getPagingBean() { + return cb; + } + + public int count() { + return selectCount(cb); + } + + public List paging() { + return selectList(cb); + } + }; + return invoker.invokePaging(handler); + } + + // =================================================================================== + // Various Select + // ============== + /** + * Select the list of value-label. + * @param cb The condition-bean of AnnouncementBody. (NotNull) + * @param valueLabelSetupper The setupper of value-label. (NotNull) + * @return The list of value-label. (NotNull) + */ + public List> selectValueLabelList( + AnnouncementBodyCB cb, + ValueLabelSetupper valueLabelSetupper) { + return createValueLabelList(selectList(cb), valueLabelSetupper); + } + + // =================================================================================== + // Load Referrer + // ============= + + // =================================================================================== + // Pull Out Foreign + // ================ + + /** + * Pull out the list of foreign table 'Announcement'. + * @param announcementBodyList The list of announcementBody. (NotNull) + * @return The list of foreign table. (NotNull) + */ + public List pulloutAnnouncement( + List announcementBodyList) { + return helpPulloutInternally(announcementBodyList, + new InternalPulloutCallback() { + public Announcement callbackGetForeignEntity( + AnnouncementBody entity) { + return entity.getAnnouncement(); + } + }); + } + + // =================================================================================== + // Basic Entity Update + // =================== + /** + * Insert the entity. + * @param announcementBody The entity of insert target. (NotNull) + */ + public void insert(AnnouncementBody announcementBody) { + assertEntityNotNull(announcementBody); + delegateInsert(announcementBody); + } + + @Override + protected void doCreate(Entity announcementBody) { + insert((AnnouncementBody) announcementBody); + } + + /** + * Update the entity modified-only. {UpdateCountZeroException, ConcurrencyControl} + * @param announcementBody The entity of update target. (NotNull) {PrimaryKeyRequired, ConcurrencyColumnRequired} + * @exception jp.sf.pal.announcement.db.allcommon.exception.EntityAlreadyDeletedException When the entity has already been deleted. + * @exception jp.sf.pal.announcement.db.allcommon.exception.EntityDuplicatedException When the entity has been duplicated. + */ + public void update(final AnnouncementBody announcementBody) { + helpUpdateInternally(announcementBody, + new InternalUpdateCallback() { + public int callbackDelegateUpdate(AnnouncementBody entity) { + return delegateUpdate(entity); + } + }); + } + + @Override + protected void doModify(Entity entity) { + update((AnnouncementBody) entity); + } + + @Override + protected void doModifyNonstrict(Entity entity) { + update((AnnouncementBody) entity); + } + + /** + * Insert or update the entity modified-only. {ConcurrencyControl(when update)} + * @param announcementBody The entity of insert or update target. (NotNull) + * @exception jp.sf.pal.announcement.db.allcommon.exception.EntityAlreadyDeletedException When the entity has already been deleted. + * @exception jp.sf.pal.announcement.db.allcommon.exception.EntityDuplicatedException When the entity has been duplicated. + */ + public void insertOrUpdate(final AnnouncementBody announcementBody) { + helpInsertOrUpdateInternally( + announcementBody, + new InternalInsertOrUpdateCallback() { + public void callbackInsert(AnnouncementBody entity) { + insert(entity); + } + + public void callbackUpdate(AnnouncementBody entity) { + update(entity); + } + + public AnnouncementBodyCB callbackNewMyConditionBean() { + return newMyConditionBean(); + } + + public int callbackSelectCount(AnnouncementBodyCB cb) { + return selectCount(cb); + } + }); + } + + @Override + protected void doCreateOrUpdate(Entity announcementBody) { + insertOrUpdate((AnnouncementBody) announcementBody); + } + + @Override + protected void doCreateOrUpdateNonstrict(Entity entity) { + insertOrUpdate((AnnouncementBody) entity); + } + + /** + * Delete the entity. {UpdateCountZeroException, ConcurrencyControl} + * @param announcementBody The entity of delete target. (NotNull) {PrimaryKeyRequired, ConcurrencyColumnRequired} + * @exception jp.sf.pal.announcement.db.allcommon.exception.EntityAlreadyDeletedException When the entity has already been deleted. + * @exception jp.sf.pal.announcement.db.allcommon.exception.EntityDuplicatedException When the entity has been duplicated. + */ + public void delete(AnnouncementBody announcementBody) { + helpDeleteInternally(announcementBody, + new InternalDeleteCallback() { + public int callbackDelegateDelete(AnnouncementBody entity) { + return delegateDelete(entity); + } + }); + } + + @Override + protected void doRemove(Entity announcementBody) { + delete((AnnouncementBody) announcementBody); + } + + // =================================================================================== + // Basic Batch Update + // ================== + /** + * Batch insert the list. This method use 'Batch Update' of java.sql.PreparedStatement. + * @param announcementBodyList The list of the entity. (NotNull) + * @return The array of inserted count. + */ + public int[] batchInsert(List announcementBodyList) { + assertObjectNotNull("announcementBodyList", announcementBodyList); + return delegateInsertList(announcementBodyList); + } + + /** + * Batch update the list. All columns are update target. {NOT modified only}
    + * This method use 'Batch Update' of java.sql.PreparedStatement. + * @param announcementBodyList The list of the entity. (NotNull) + * @return The array of updated count. + * @exception jp.sf.pal.announcement.db.allcommon.exception.EntityAlreadyDeletedException When the entity has already been deleted. + */ + public int[] batchUpdate(List announcementBodyList) { + assertObjectNotNull("announcementBodyList", announcementBodyList); + return delegateUpdateList(announcementBodyList); + } + + /** + * Batch delete the list.
    + * This method use 'Batch Update' of java.sql.PreparedStatement. + * @param announcementBodyList The list of the entity. (NotNull) + * @return The array of deleted count. + * @exception jp.sf.pal.announcement.db.allcommon.exception.EntityAlreadyDeletedException When the entity has already been deleted. + */ + public int[] batchDelete(List announcementBodyList) { + assertObjectNotNull("announcementBodyList", announcementBodyList); + return delegateDeleteList(announcementBodyList); + } + + // =================================================================================== + // Various Update + // ============== + + // =================================================================================== + // Various Delete + // ============== + /** + * Query delete the several entities. + * @param cb Condition-bean. (NotNull) + * @return The deleted count. + */ + public int queryDelete(AnnouncementBodyCB cb) { + assertConditionBeanNotNull(cb); + return getMyDao().deleteByQuery(cb); + } + + // =================================================================================== + // Delegate Method + // =============== + // ----------------------------------------------------- + // Select + // ------ + protected int delegateGetCountAll() { + return getMyDao().getCountAll(); + } + + protected List delegateGetListAll() { + return getMyDao().getListAll(); + } + + protected AnnouncementBody delegateGetEntity(Integer id) { + return getMyDao().getEntity(id); + } + + protected int delegateSelectCount(AnnouncementBodyCB cb) { + assertConditionBeanNotNull(cb); + return getMyDao().selectCount(cb); + } + + protected AnnouncementBody delegateSelectEntity(AnnouncementBodyCB cb) { + assertConditionBeanNotNull(cb); + return getMyDao().selectEntity(cb); + } + + protected List delegateSelectList(AnnouncementBodyCB cb) { + assertConditionBeanNotNull(cb); + return getMyDao().selectList(cb); + } + + // ----------------------------------------------------- + // Update + // ------ + protected int delegateInsert(AnnouncementBody entity) { + if (!processBeforeInsert(entity)) { + return 1; + } + return getMyDao().insert(entity); + } + + protected int delegateUpdate(AnnouncementBody entity) { + if (!processBeforeUpdate(entity)) { + return 1; + } + return getMyDao().updateModifiedOnly(entity); + } + + protected int delegateDelete(AnnouncementBody entity) { + if (!processBeforeDelete(entity)) { + return 1; + } + return getMyDao().delete(entity); + } + + protected int[] delegateInsertList(List entityList) { + assertObjectNotNull("announcementBodyList", entityList); + return getMyDao().insertList( + helpFilterBeforeInsertInternally(entityList)); + } + + protected int[] delegateUpdateList(List entityList) { + assertObjectNotNull("announcementBodyList", entityList); + return getMyDao().updateList( + helpFilterBeforeUpdateInternally(entityList)); + } + + protected int[] delegateDeleteList(List entityList) { + assertObjectNotNull("announcementBodyList", entityList); + return getMyDao().deleteList( + helpFilterBeforeDeleteInternally(entityList)); + } + + // =================================================================================== + // Hierarchy + // ========= + /** + * Create the basic request of hierarchy of AnnouncementBody.. + * @param sourceList The list of source. (NotNull) + * @param The type of source. + * @return Hierarchy request of AnnouncementBody. (NotNull) + */ + public HierarchyBasicRequest createHierarchyBasicRequest( + List sourceList) { + final HierarchyBasicRequest request = new HierarchyBasicRequest( + AnnouncementBody.class); + request.registerSourceList(sourceList); + return request; + } + + /** + * Arrange hierarchy. + * @param request Hierarchy request of AnnouncementBody. (NotNull) + * @return The list of AnnouncementBody. (NotNull) + */ + public List arrangeHierarchy( + HierarchyRequest request) { + return new HierarchyArranger() + .arrangeHierarchy(request); + } + + // =================================================================================== + // CBSetupper + // ========== + public static interface CBSetupper extends + ConditionBeanSetupper { + public void setup(AnnouncementBodyCB cb); + } + + // =================================================================================== + // Optimistic Lock Info + // ==================== + @Override + protected boolean hasVersionNoValue(Entity entity) { + return false; + } + + @Override + protected boolean hasUpdateDateValue(Entity entity) { + return false; + } + + // =================================================================================== + // Helper + // ====== + protected AnnouncementBody downcast(Entity entity) { + return helpDowncastInternally(entity, AnnouncementBody.class); + } +} Property changes on: announcement/trunk/src/main/java/jp/sf/pal/announcement/db/bsbhv/BsAnnouncementBodyBhv.java ___________________________________________________________________ Name: svn:eol-style + native Added: announcement/trunk/src/main/java/jp/sf/pal/announcement/db/bsdao/BsAnnouncementBodyDao.java =================================================================== --- announcement/trunk/src/main/java/jp/sf/pal/announcement/db/bsdao/BsAnnouncementBodyDao.java (rev 0) +++ announcement/trunk/src/main/java/jp/sf/pal/announcement/db/bsdao/BsAnnouncementBodyDao.java 2008-06-30 02:54:27 UTC (rev 1002) @@ -0,0 +1,51 @@ +package jp.sf.pal.announcement.db.bsdao; + +import java.util.List; + +import jp.sf.pal.announcement.db.cbean.AnnouncementBodyCB; +import jp.sf.pal.announcement.db.exentity.AnnouncementBody; + +/** + * The dao interface of ANNOUNCEMENT_BODY. + * @author DBFlute(AutoGenerator) + */ + @ SuppressWarnings("unchecked") +public interface BsAnnouncementBodyDao extends + jp.sf.pal.announcement.db.allcommon.DaoWritable { + + public Class BEAN = AnnouncementBody.class;// For S2Dao + + public static final String getCountAll_SQL = "select count(*) from ANNOUNCEMENT_BODY"; + + public int getCountAll(); + + public static final String getListAll_SQL = "select ID, CONTENT from ANNOUNCEMENT_BODY"; + + public java.util.List getListAll(); + + public static final String getEntity_SQL = "select ID, CONTENT from ANNOUNCEMENT_BODY where ANNOUNCEMENT_BODY.ID = /*id*/null"; + + public static final String getEntity_ARGS = "id"; + + public AnnouncementBody getEntity(Integer id); + + public int selectCount(AnnouncementBodyCB cb); + + public AnnouncementBody selectEntity(AnnouncementBodyCB cb); + + public List selectList(AnnouncementBodyCB cb); + + public int insert(AnnouncementBody entity); + + public int updateModifiedOnly(AnnouncementBody entity); + + public int delete(AnnouncementBody entity); + + public int[] insertList(List entityList); + + public int[] updateList(List entityList); + + public int[] deleteList(List entityList); + + public int deleteByQuery(AnnouncementBodyCB cb); +} Property changes on: announcement/trunk/src/main/java/jp/sf/pal/announcement/db/bsdao/BsAnnouncementBodyDao.java ___________________________________________________________________ Name: svn:eol-style + native Added: announcement/trunk/src/main/java/jp/sf/pal/announcement/db/bsdao/BsAnnouncementDao.java =================================================================== --- announcement/trunk/src/main/java/jp/sf/pal/announcement/db/bsdao/BsAnnouncementDao.java (rev 0) +++ announcement/trunk/src/main/java/jp/sf/pal/announcement/db/bsdao/BsAnnouncementDao.java 2008-06-30 02:54:27 UTC (rev 1002) @@ -0,0 +1,51 @@ +package jp.sf.pal.announcement.db.bsdao; + +import java.util.List; + +import jp.sf.pal.announcement.db.cbean.AnnouncementCB; +import jp.sf.pal.announcement.db.exentity.Announcement; + +/** + * The dao interface of ANNOUNCEMENT. + * @author DBFlute(AutoGenerator) + */ + @ SuppressWarnings("unchecked") +public interface BsAnnouncementDao extends + jp.sf.pal.announcement.db.allcommon.DaoWritable { + + public Class BEAN = Announcement.class;// For S2Dao + + public static final String getCountAll_SQL = "select count(*) from ANNOUNCEMENT"; + + public int getCountAll(); + + public static final String getListAll_SQL = "select ID, SCOPE, ROLE, START_DATE, END_DATE, TITLE, SORT_ORDER, TIMESTAMP from ANNOUNCEMENT"; + + public java.util.List getListAll(); + + public static final String getEntity_SQL = "select ID, SCOPE, ROLE, START_DATE, END_DATE, TITLE, SORT_ORDER, TIMESTAMP from ANNOUNCEMENT where ANNOUNCEMENT.ID = /*id*/null"; + + public static final String getEntity_ARGS = "id"; + + public Announcement getEntity(Integer id); + + public int selectCount(AnnouncementCB cb); + + public Announcement selectEntity(AnnouncementCB cb); + + public List selectList(AnnouncementCB cb); + + public int insert(Announcement entity); + + public int updateModifiedOnly(Announcement entity); + + public int delete(Announcement entity); + + public int[] insertList(List entityList); + + public int[] updateList(List entityList); + + public int[] deleteList(List entityList); + + public int deleteByQuery(AnnouncementCB cb); +} Property changes on: announcement/trunk/src/main/java/jp/sf/pal/announcement/db/bsdao/BsAnnouncementDao.java ___________________________________________________________________ Name: svn:eol-style + native Added: announcement/trunk/src/main/java/jp/sf/pal/announcement/db/bsentity/BsAnnouncement.java =================================================================== --- announcement/trunk/src/main/java/jp/sf/pal/announcement/db/bsentity/BsAnnouncement.java (rev 0) +++ announcement/trunk/src/main/java/jp/sf/pal/announcement/db/bsentity/BsAnnouncement.java 2008-06-30 02:54:27 UTC (rev 1002) @@ -0,0 +1,430 @@ +package jp.sf.pal.announcement.db.bsentity; + +import java.util.Set; + +import jp.sf.pal.announcement.db.allcommon.Entity; +import jp.sf.pal.announcement.db.allcommon.dbmeta.DBMeta; +import jp.sf.pal.announcement.db.allcommon.dbmeta.DBMetaInstanceHandler; +import jp.sf.pal.announcement.db.exentity.AnnouncementBody; + +/** + * The entity of ANNOUNCEMENT(TABLE). + *
    + * [primary-key]
    + *     ID
    + * 
    + * [column]
    + *     ID, SCOPE, ROLE, START_DATE, END_DATE, TITLE, SORT_ORDER, TIMESTAMP
    + * 
    + * [sequence]
    + *     
    + * 
    + * [identity]
    + *     ID
    + * 
    + * [version-no]
    + *     
    + * 
    + * [foreign-table]
    + *     
    + * 
    + * [referrer-table]
    + *     ANNOUNCEMENT_BODY
    + * 
    + * [foreign-property]
    + *     announcementBodyAsOne
    + * 
    + * [referrer-property]
    + *     
    + * 
    + * @author DBFlute(AutoGenerator) + */ + @ SuppressWarnings("unchecked") +public abstract class BsAnnouncement implements Entity, java.io.Serializable { + + // =================================================================================== + // Definition + // ========== + /** Serial version UID. (Default) */ + private static final long serialVersionUID = 1L; + + /** TABLE-Annotation for S2Dao. The value is ANNOUNCEMENT. */ + public static final String TABLE = "ANNOUNCEMENT"; + + /** ID-Annotation */ + public static final String id_ID = "identity"; + + // =================================================================================== + // Attribute + // ========= + // ----------------------------------------------------- + // Column + // ------ + /** The attribute of the column 'ID'. {PK : INC : int : NotNull} */ + protected Integer _id; + + /** The attribute of the column 'SCOPE'. {varchar(20) : NotNull} */ + protected String _scope; + + /** The attribute of the column 'ROLE'. {varchar(100)} */ + protected String _role; + + /** The attribute of the column 'START_DATE'. {datetime} */ + protected java.sql.Timestamp _startDate; + + /** The attribute of the column 'END_DATE'. {datetime} */ + protected java.sql.Timestamp _endDate; + + /** The attribute of the column 'TITLE'. {varchar(100) : NotNull} */ + protected String _title; + + /** The attribute of the column 'SORT_ORDER'. {int : NotNull} */ + protected Integer _sortOrder; + + /** The attribute of the column 'TIMESTAMP'. {timestamp : NotNull : Default=[CURRENT_TIMESTAMP]} */ + protected java.sql.Timestamp _timestamp; + + // ----------------------------------------------------- + // Internal + // -------- + /** The attribute of entity modified properties. (for S2Dao) */ + protected EntityModifiedProperties _modifiedProperties = newEntityModifiedProperties(); + + // =================================================================================== + // Constructor + // =========== + public BsAnnouncement() { + } + + // =================================================================================== + // Table Name + // ========== + public String getTableDbName() { + return "ANNOUNCEMENT"; + } + + public String getTablePropertyName() {// as JavaBeansRule + return "announcement"; + } + + // =================================================================================== + // DBMeta + // ====== + public DBMeta getDBMeta() { + return DBMetaInstanceHandler.findDBMeta(getTableDbName()); + } + + // =================================================================================== + // Classification Classifying + // ========================== + + // =================================================================================== + // Classification Determination + // ============================ + + // =================================================================================== + // Classification Name/Alias + // ========================= + + // =================================================================================== + // Foreign Property + // ================ + // /* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * + // Foreign Property = [announcementBodyAsOne] + // * * * * * * * * */ + public static final int announcementBodyAsOne_RELNO = 0; + + public static final String announcementBodyAsOne_RELKEYS = "ID:ID"; + + /** the entity of foreign property(referrer-as-one) 'announcementBodyAsOne'. */ + protected AnnouncementBody _childrenannouncementBodyAsOne; + + /** + * Get the entity of foreign property(referrer-as-one) 'announcementBodyAsOne'. {without lazy-load}
    + * @return the entity of foreign property(referrer-as-one) 'announcementBodyAsOne'. (Nullable: If the foreign key does not have 'NotNull' constraint, please check null.) + */ + public AnnouncementBody getAnnouncementBodyAsOne() { + return _childrenannouncementBodyAsOne; + } + + /** + * Set the entity of foreign property(referrer-as-one) 'announcementBodyAsOne'. + * @param announcementBodyAsOne The entity of foreign property(referrer-as-one) 'announcementBodyAsOne'. (Nullable) + */ + public void setAnnouncementBodyAsOne(AnnouncementBody announcementBodyAsOne) { + _childrenannouncementBodyAsOne = announcementBodyAsOne; + } + + // =================================================================================== + // Referrer Property + // ================= + + // =================================================================================== + // Determination + // ============= + public boolean hasPrimaryKeyValue() { + if (_id == null) { + return false; + } + return true; + } + + // =================================================================================== + // Modified Properties + // =================== + public Set getModifiedPropertyNames() { + return _modifiedProperties.getPropertyNames(); + } + + protected EntityModifiedProperties newEntityModifiedProperties() { + return new EntityModifiedProperties(); + } + + public void clearModifiedPropertyNames() { + _modifiedProperties.clear(); + } + + public boolean hasModification() { + return !_modifiedProperties.isEmpty(); + } + + // =================================================================================== + // Basic Override + // ============== + /** + * If the primary-key of the other is same as this one, returns true. + * @param other Other entity. + * @return Comparing result. + */ + public boolean equals(Object other) { + if (other == null || !(other instanceof BsAnnouncement)) { + return false; + } + final BsAnnouncement otherEntity = (BsAnnouncement) other; + if (!helpComparingValue(getId(), otherEntity.getId())) { + return false; + } + return true; + } + + protected boolean helpComparingValue(Object value1, Object value2) { + if (value1 == null && value2 == null) { + return true; + } + return value1 != null && value2 != null && value1.equals(value2); + } + + /** + * Calculates hash-code from primary-key. + * @return Hash-code from primary-keys. + */ + public int hashCode() { + int result = 0; + if (this.getId() != null) { + result = result + getId().hashCode(); + } + return result; + } + + /** + * @return The view string of columns. (NotNull) + */ + public String toString() { + final String delimiter = ","; + final StringBuilder sb = new StringBuilder(); + + sb.append(delimiter).append(getId()); + sb.append(delimiter).append(getScope()); + sb.append(delimiter).append(getRole()); + sb.append(delimiter).append(getStartDate()); + sb.append(delimiter).append(getEndDate()); + sb.append(delimiter).append(getTitle()); + sb.append(delimiter).append(getSortOrder()); + sb.append(delimiter).append(getTimestamp()); + + sb.delete(0, delimiter.length()); + sb.insert(0, "{").append("}"); + return sb.toString(); + } + + // =================================================================================== + // Accessor + // ======== + + /** The column annotation for S2Dao. {PK : INC : int : NotNull} */ + public static final String id_COLUMN = "ID"; + + /** + * Get the value of the column 'ID'.
    + * {PK : INC : int : NotNull} + * @return The value of the column 'ID'. (Nullable) + */ + public Integer getId() { + return _id; + } + + /** + * Set the value of the column 'ID'.
    + * {PK : INC : int : NotNull} + * @param id The value of the column 'ID'. (Nullable) + */ + public void setId(Integer id) { + _modifiedProperties.addPropertyName("id"); + this._id = id; + } + + /** The column annotation for S2Dao. {varchar(20) : NotNull} */ + public static final String scope_COLUMN = "SCOPE"; + + /** + * Get the value of the column 'SCOPE'.
    + * {varchar(20) : NotNull} + * @return The value of the column 'SCOPE'. (Nullable) + */ + public String getScope() { + return _scope; + } + + /** + * Set the value of the column 'SCOPE'.
    + * {varchar(20) : NotNull} + * @param scope The value of the column 'SCOPE'. (Nullable) + */ + public void setScope(String scope) { + _modifiedProperties.addPropertyName("scope"); + this._scope = scope; + } + + /** The column annotation for S2Dao. {varchar(100)} */ + public static final String role_COLUMN = "ROLE"; + + /** + * Get the value of the column 'ROLE'.
    + * {varchar(100)} + * @return The value of the column 'ROLE'. (Nullable) + */ + public String getRole() { + return _role; + } + + /** + * Set the value of the column 'ROLE'.
    + * {varchar(100)} + * @param role The value of the column 'ROLE'. (Nullable) + */ + public void setRole(String role) { + _modifiedProperties.addPropertyName("role"); + this._role = role; + } + + /** The column annotation for S2Dao. {datetime} */ + public static final String startDate_COLUMN = "START_DATE"; + + /** + * Get the value of the column 'START_DATE'.
    + * {datetime} + * @return The value of the column 'START_DATE'. (Nullable) + */ + public java.sql.Timestamp getStartDate() { + return _startDate; + } + + /** + * Set the value of the column 'START_DATE'.
    + * {datetime} + * @param startDate The value of the column 'START_DATE'. (Nullable) + */ + public void setStartDate(java.sql.Timestamp startDate) { + _modifiedProperties.addPropertyName("startDate"); + this._startDate = startDate; + } + + /** The column annotation for S2Dao. {datetime} */ + public static final String endDate_COLUMN = "END_DATE"; + + /** + * Get the value of the column 'END_DATE'.
    + * {datetime} + * @return The value of the column 'END_DATE'. (Nullable) + */ + public java.sql.Timestamp getEndDate() { + return _endDate; + } + + /** + * Set the value of the column 'END_DATE'.
    + * {datetime} + * @param endDate The value of the column 'END_DATE'. (Nullable) + */ + public void setEndDate(java.sql.Timestamp endDate) { + _modifiedProperties.addPropertyName("endDate"); + this._endDate = endDate; + } + + /** The column annotation for S2Dao. {varchar(100) : NotNull} */ + public static final String title_COLUMN = "TITLE"; + + /** + * Get the value of the column 'TITLE'.
    + * {varchar(100) : NotNull} + * @return The value of the column 'TITLE'. (Nullable) + */ + public String getTitle() { + return _title; + } + + /** + * Set the value of the column 'TITLE'.
    + * {varchar(100) : NotNull} + * @param title The value of the column 'TITLE'. (Nullable) + */ + public void setTitle(String title) { + _modifiedProperties.addPropertyName("title"); + this._title = title; + } + + /** The column annotation for S2Dao. {int : NotNull} */ + public static final String sortOrder_COLUMN = "SORT_ORDER"; + + /** + * Get the value of the column 'SORT_ORDER'.
    + * {int : NotNull} + * @return The value of the column 'SORT_ORDER'. (Nullable) + */ + public Integer getSortOrder() { + return _sortOrder; + } + + /** + * Set the value of the column 'SORT_ORDER'.
    + * {int : NotNull} + * @param sortOrder The value of the column 'SORT_ORDER'. (Nullable) + */ + public void setSortOrder(Integer sortOrder) { + _modifiedProperties.addPropertyName("sortOrder"); + this._sortOrder = sortOrder; + } + + /** The column annotation for S2Dao. {timestamp : NotNull : Default=[CURRENT_TIMESTAMP]} */ + public static final String timestamp_COLUMN = "TIMESTAMP"; + + /** + * Get the value of the column 'TIMESTAMP'.
    + * {timestamp : NotNull : Default=[CURRENT_TIMESTAMP]} + * @return The value of the column 'TIMESTAMP'. (Nullable) + */ + public java.sql.Timestamp getTimestamp() { + return _timestamp; + } + + /** + * Set the value of the column 'TIMESTAMP'.
    + * {timestamp : NotNull : Default=[CURRENT_TIMESTAMP]} + * @param timestamp The value of the column 'TIMESTAMP'. (Nullable) + */ + public void setTimestamp(java.sql.Timestamp timestamp) { + _modifiedProperties.addPropertyName("timestamp"); + this._timestamp = timestamp; + } + +} Property changes on: announcement/trunk/src/main/java/jp/sf/pal/announcement/db/bsentity/BsAnnouncement.java ___________________________________________________________________ Name: svn:eol-style + native Added: announcement/trunk/src/main/java/jp/sf/pal/announcement/db/bsentity/BsAnnouncementBody.java =================================================================== --- announcement/trunk/src/main/java/jp/sf/pal/announcement/db/bsentity/BsAnnouncementBody.java (rev 0) +++ announcement/trunk/src/main/java/jp/sf/pal/announcement/db/bsentity/BsAnnouncementBody.java 2008-06-30 02:54:27 UTC (rev 1002) @@ -0,0 +1,272 @@ +package jp.sf.pal.announcement.db.bsentity; + +import java.util.Set; + +import jp.sf.pal.announcement.db.allcommon.Entity; +import jp.sf.pal.announcement.db.allcommon.dbmeta.DBMeta; +import jp.sf.pal.announcement.db.allcommon.dbmeta.DBMetaInstanceHandler; +import jp.sf.pal.announcement.db.exentity.Announcement; + +/** + * The entity of ANNOUNCEMENT_BODY(TABLE). + *
    + * [primary-key]
    + *     ID
    + * 
    + * [column]
    + *     ID, CONTENT
    + * 
    + * [sequence]
    + *     
    + * 
    + * [identity]
    + *     ${table.identityColumnName}
    + * 
    + * [version-no]
    + *     
    + * 
    + * [foreign-table]
    + *     ANNOUNCEMENT
    + * 
    + * [referrer-table]
    + *     
    + * 
    + * [foreign-property]
    + *     announcement
    + * 
    + * [referrer-property]
    + *     
    + * 
    + * @author DBFlute(AutoGenerator) + */ + @ SuppressWarnings("unchecked") +public abstract class BsAnnouncementBody implements Entity, + java.io.Serializable { + + // =================================================================================== + // Definition + // ========== + /** Serial version UID. (Default) */ + private static final long serialVersionUID = 1L; + + /** TABLE-Annotation for S2Dao. The value is ANNOUNCEMENT_BODY. */ + public static final String TABLE = "ANNOUNCEMENT_BODY"; + + // =================================================================================== + // Attribute + // ========= + // ----------------------------------------------------- + // Column + // ------ + /** The attribute of the column 'ID'. {PK : int : NotNull : FK to ANNOUNCEMENT} */ + protected Integer _id; + + /** The attribute of the column 'CONTENT'. {text(65535) : NotNull} */ + protected String _content; + + // ----------------------------------------------------- + // Internal + // -------- + /** The attribute of entity modified properties. (for S2Dao) */ + protected EntityModifiedProperties _modifiedProperties = newEntityModifiedProperties(); + + // =================================================================================== + // Constructor + // =========== + public BsAnnouncementBody() { + } + + // =================================================================================== + // Table Name + // ========== + public String getTableDbName() { + return "ANNOUNCEMENT_BODY"; + } + + public String getTablePropertyName() {// as JavaBeansRule + return "announcementBody"; + } + + // =================================================================================== + // DBMeta + // ====== + public DBMeta getDBMeta() { + return DBMetaInstanceHandler.findDBMeta(getTableDbName()); + } + + // =================================================================================== + // Classification Classifying + // ========================== + + // =================================================================================== + // Classification Determination + // ============================ + + // =================================================================================== + // Classification Name/Alias + // ========================= + + // =================================================================================== + // Foreign Property + // ================ + // /* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * + // Foreign Property = [announcement] + // * * * * * * * * */ + public static final int announcement_RELNO = 0; + + public static final String announcement_RELKEYS = "ID:ID"; + + /** The entity of foreign property 'announcement'. */ + protected Announcement _parentAnnouncement; + + /** + * Get the entity of foreign property 'announcement'. {without lazy-load} + * @return The entity of foreign property 'announcement'. (Nullable: If the foreign key does not have 'NotNull' constraint, please check null.) + */ + public Announcement getAnnouncement() { + return _parentAnnouncement; + } + + /** + * Set the entity of foreign property 'announcement'. + * @param announcement The entity of foreign property 'announcement'. (Nullable) + */ + public void setAnnouncement(Announcement announcement) { + _parentAnnouncement = announcement; + } + + // =================================================================================== + // Referrer Property + // ================= + + // =================================================================================== + // Determination + // ============= + public boolean hasPrimaryKeyValue() { + if (_id == null) { + return false; + } + return true; + } + + // =================================================================================== + // Modified Properties + // =================== + public Set getModifiedPropertyNames() { + return _modifiedProperties.getPropertyNames(); + } + + protected EntityModifiedProperties newEntityModifiedProperties() { + return new EntityModifiedProperties(); + } + + public void clearModifiedPropertyNames() { + _modifiedProperties.clear(); + } + + public boolean hasModification() { + return !_modifiedProperties.isEmpty(); + } + + // =================================================================================== + // Basic Override + // ============== + /** + * If the primary-key of the other is same as this one, returns true. + * @param other Other entity. + * @return Comparing result. + */ + public boolean equals(Object other) { + if (other == null || !(other instanceof BsAnnouncementBody)) { + return false; + } + final BsAnnouncementBody otherEntity = (BsAnnouncementBody) other; + if (!helpComparingValue(getId(), otherEntity.getId())) { + return false; + } + return true; + } + + protected boolean helpComparingValue(Object value1, Object value2) { + if (value1 == null && value2 == null) { + return true; + } + return value1 != null && value2 != null && value1.equals(value2); + } + + /** + * Calculates hash-code from primary-key. + * @return Hash-code from primary-keys. + */ + public int hashCode() { + int result = 0; + if (this.getId() != null) { + result = result + getId().hashCode(); + } + return result; + } + + /** + * @return The view string of columns. (NotNull) + */ + public String toString() { + final String delimiter = ","; + final StringBuilder sb = new StringBuilder(); + + sb.append(delimiter).append(getId()); + sb.append(delimiter).append(getContent()); + + sb.delete(0, delimiter.length()); + sb.insert(0, "{").append("}"); + return sb.toString(); + } + + // =================================================================================== + // Accessor + // ======== + + /** The column annotation for S2Dao. {PK : int : NotNull : FK to ANNOUNCEMENT} */ + public static final String id_COLUMN = "ID"; + + /** + * Get the value of the column 'ID'.
    + * {PK : int : NotNull : FK to ANNOUNCEMENT} + * @return The value of the column 'ID'. (Nullable) + */ + public Integer getId() { + return _id; + } + + /** + * Set the value of the column 'ID'.
    + * {PK : int : NotNull : FK to ANNOUNCEMENT} + * @param id The value of the column 'ID'. (Nullable) + */ + public void setId(Integer id) { + _modifiedProperties.addPropertyName("id"); + this._id = id; + } + + /** The column annotation for S2Dao. {text(65535) : NotNull} */ + public static final String content_COLUMN = "CONTENT"; + + /** + * Get the value of the column 'CONTENT'.
    + * {text(65535) : NotNull} + * @return The value of the column 'CONTENT'. (Nullable) + */ + public String getContent() { + return _content; + } + + /** + * Set the value of the column 'CONTENT'.
    + * {text(65535) : NotNull} + * @param content The value of the column 'CONTENT'. (Nullable) + */ + public void setContent(String content) { + _modifiedProperties.addPropertyName("content"); + this._content = content; + } + +} Property changes on: announcement/trunk/src/main/java/jp/sf/pal/announcement/db/bsentity/BsAnnouncementBody.java ___________________________________________________________________ Name: svn:eol-style + native Added: announcement/trunk/src/main/java/jp/sf/pal/announcement/db/bsentity/dbmeta/AnnouncementBodyDbm.java =================================================================== --- announcement/trunk/src/main/java/jp/sf/pal/announcement/db/bsentity/dbmeta/AnnouncementBodyDbm.java (rev 0) +++ announcement/trunk/src/main/java/jp/sf/pal/announcement/db/bsentity/dbmeta/AnnouncementBodyDbm.java 2008-06-30 02:54:27 UTC (rev 1002) @@ -0,0 +1,573 @@ +package jp.sf.pal.announcement.db.bsentity.dbmeta; + +import java.util.ArrayList; +import java.util.Collections; +import java.util.HashMap; +import java.util.LinkedHashMap; +import java.util.List; +import java.util.Map; + +import jp.sf.pal.announcement.db.allcommon.Entity; +import jp.sf.pal.announcement.db.allcommon.dbmeta.AbstractDBMeta; +import jp.sf.pal.announcement.db.allcommon.dbmeta.info.ColumnInfo; +import jp.sf.pal.announcement.db.allcommon.dbmeta.info.ForeignInfo; +import jp.sf.pal.announcement.db.allcommon.dbmeta.info.RelationInfo; +import jp.sf.pal.announcement.db.allcommon.dbmeta.info.UniqueInfo; +import jp.sf.pal.announcement.db.exentity.AnnouncementBody; + +/** + * The DB meta of ANNOUNCEMENT_BODY. (Singleton) + *
    + * [primary-key]
    + *     ID
    + * 
    + * [column]
    + *     ID, CONTENT
    + * 
    + * [sequence]
    + *     
    + * 
    + * [identity]
    + *     ${table.identityColumnName}
    + * 
    + * [version-no]
    + *     
    + * 
    + * [foreign-table]
    + *     ANNOUNCEMENT
    + * 
    + * [referrer-table]
    + *     
    + * 
    + * [foreign-property]
    + *     announcement
    + * 
    + * [referrer-property]
    + *     
    + * 
    + * @author DBFlute(AutoGenerator) + */ + @ SuppressWarnings("unchecked") +public class AnnouncementBodyDbm extends AbstractDBMeta { + + // =================================================================================== + // Definition + // ========== + protected static final Class ENTITY_TYPE = AnnouncementBody.class; + + private static final AnnouncementBodyDbm _instance = new AnnouncementBodyDbm(); + + // =================================================================================== + // Constructor + // =========== + private AnnouncementBodyDbm() { + } + + // =================================================================================== + // Singleton + // ========= + public static AnnouncementBodyDbm getInstance() { + return _instance; + } + + // =================================================================================== + // Name Definition + // =============== + // ----------------------------------------------------- + // Table + // ----- + /** Table DB name. */ + public static final String TABLE_DB_NAME = "ANNOUNCEMENT_BODY"; + + /** Table property name(JavaBeansRule). */ + public static final String TABLE_PROPERTY_NAME = "announcementBody"; + + // ----------------------------------------------------- + // Column DB Name + // -------------- + /** DB name of ID. {PK : int : NotNull : FK to ANNOUNCEMENT} */ + public static final String DB_NAME_ID = "ID"; + + /** DB name of CONTENT. {text(65535) : NotNull} */ + public static final String DB_NAME_CONTENT = "CONTENT"; + + // ----------------------------------------------------- + // Column Property Name + // (JavaBeansRule) + // -------------------- + /** Property name(JavaBeansRule) of id. {PK : int : NotNull : FK to ANNOUNCEMENT} */ + public static final String PROPERTY_NAME_id = "id"; + + /** Property name(JavaBeansRule) of content. {text(65535) : NotNull} */ + public static final String PROPERTY_NAME_content = "content"; + + // ----------------------------------------------------- + // Foreign Name + // ------------ + /** The foreign property name(JavaBeansRule) of announcement. */ + public static final String FOREIGN_PROPERTY_NAME_announcement = "announcement"; + + // ----------------------------------------------------- + // Referrer Name + // ------------- + // ----------------------------------------------------- + // Name Map + // -------- + /** The map of {DB name : property name} key-to-lower. */ + private static Map _dbNamePropertyNameKeyToLowerMap; + + protected static Map createDbNamePropertyNameKeyToLowerMap() { + if (_dbNamePropertyNameKeyToLowerMap != null) { + return _dbNamePropertyNameKeyToLowerMap; + } + final Map map = new LinkedHashMap(); + map.put(TABLE_DB_NAME.toLowerCase(), TABLE_PROPERTY_NAME); + + map.put(DB_NAME_ID.toLowerCase(), PROPERTY_NAME_id); + map.put(DB_NAME_CONTENT.toLowerCase(), PROPERTY_NAME_content); + + _dbNamePropertyNameKeyToLowerMap = Collections.unmodifiableMap(map); + return _dbNamePropertyNameKeyToLowerMap; + } + + /** The map of {property name : DB name} key-to-lower. */ + private static Map _propertyNameDbNameKeyToLowerMap; + + protected static Map createPropertyNameDbNameKeyToLowerMap() { + if (_propertyNameDbNameKeyToLowerMap != null) { + return _propertyNameDbNameKeyToLowerMap; + } + final Map map = new LinkedHashMap(); + map.put(TABLE_PROPERTY_NAME.toLowerCase(), TABLE_DB_NAME); + + map.put(PROPERTY_NAME_id.toLowerCase(), DB_NAME_ID); + map.put(PROPERTY_NAME_content.toLowerCase(), DB_NAME_CONTENT); + + _propertyNameDbNameKeyToLowerMap = Collections.unmodifiableMap(map); + return _propertyNameDbNameKeyToLowerMap; + } + + // =================================================================================== + // Table Name + // ========== + public String getTableDbName() { + return TABLE_DB_NAME; + } + + public String getTablePropertyName() {// as JavaBeansRule + return TABLE_PROPERTY_NAME; + } + + // =================================================================================== + // Name Map + // ======== + /** + * @return The key-to-lower map of DB name(lower) and property name. (NotNull) + */ + public Map getDbNamePropertyNameKeyToLowerMap() { + return createDbNamePropertyNameKeyToLowerMap(); + } + + /** + * @return The key-to-lower map of property name(lower) and DB name. (NotNull) + */ + public Map getPropertyNameDbNameKeyToLowerMap() { + return createPropertyNameDbNameKeyToLowerMap(); + } + + // =================================================================================== + // Type Name + // ========= + public String getEntityTypeName() { + return "jp.sf.pal.announcement.db.exentity.AnnouncementBody"; + } + + public String getConditionBeanTypeName() { + return "jp.sf.pal.announcement.db.cbean.bs.AnnouncementBodyCB"; + } + + public String getDaoTypeName() { + return "jp.sf.pal.announcement.db.exdao.AnnouncementBodyDao"; + } + + public String getBehaviorTypeName() { + return "jp.sf.pal.announcement.db.exbhv.AnnouncementBodyBhv"; + } + + // =================================================================================== + // Object Type + // =========== + public Class getEntityType() { + return ENTITY_TYPE; + } + + // =================================================================================== + // Object Instance + // =============== + public Entity newEntity() { + return newMyEntity(); + } + + public AnnouncementBody newMyEntity() { + return new AnnouncementBody(); + } + + // =================================================================================== + // Column Info + // =========== + /** + * @return The list of DB name of columns. (NotNull and NotEmpty) + */ + public List getColumnInfoList() { + final List columnInfoList = new ArrayList(); + columnInfoList.add(columnId()); + columnInfoList.add(columnContent()); + return columnInfoList; + } + + /** @return The column information of id. (NotNull) */ + public ColumnInfo columnId() { + return new ColumnInfo(this, "ID", "id", Integer.class, true, null, null); + } + + /** @return The column information of content. (NotNull) */ + public ColumnInfo columnContent() { + return new ColumnInfo(this, "CONTENT", "content", String.class, false, + Integer.valueOf("65535"), Integer.valueOf("0")); + } + + // =================================================================================== + // Unique Info + // =========== + // ----------------------------------------------------- + // Primary Element + // --------------- + public UniqueInfo getPrimaryUniqueInfo() { + final UniqueInfo uniqueInfo = new UniqueInfo(); + uniqueInfo.setDBMeta(this); + uniqueInfo.addUniqueColumnList(new ColumnInfo(this, "ID", "id", + Integer.class, true, null, null)); + uniqueInfo.setPrimary(true); + return uniqueInfo; + } + + public boolean hasPrimaryKey() { + return true; + } + + public boolean hasTwoOrMorePrimaryKeys() { + return false; + } + + // =================================================================================== + // Relation Info + // ============= + // ----------------------------------------------------- + // Foreign Property + // ---------------- + public ForeignInfo foreignAnnouncement() { + final ForeignInfo foreignInfo = new ForeignInfo(); + foreignInfo.setForeignPropertyName("announcement"); + foreignInfo.setLocalDBMeta(AnnouncementBodyDbm.getInstance()); + foreignInfo.setForeignDBMeta(AnnouncementDbm.getInstance()); + final Map map = new LinkedHashMap(); + map.put(columnId(), AnnouncementDbm.getInstance().columnId()); + foreignInfo.setLocalForeignColumnInfoMap(map); + foreignInfo.setRelationNo(0); + foreignInfo.setOneToOne(true); + return foreignInfo; + } + + // ----------------------------------------------------- + // Referrer Property + // ----------------- + + // ----------------------------------------------------- + // Relation Trace + // -------------- + public AnnouncementBodyRelationTrace createRelationTrace( + RelationTraceFixHandler relationTraceFixHandler) { + return new AnnouncementBodyRelationTrace(relationTraceFixHandler); + } + + public AnnouncementBodyRelationTrace createRelationTrace( + List relationList, + List relationTraceList) { + return new AnnouncementBodyRelationTrace(relationList, + relationTraceList); + } + + public static class AnnouncementBodyRelationTrace extends + AbstractRelationTrace { + + /** + * Constructor for first step. + * @param relationTraceFixHandler The handler of fixed relation trace. (Nullable) + */ + public AnnouncementBodyRelationTrace( + RelationTraceFixHandler relationTraceFixHandler) { + super(relationTraceFixHandler); + } + + /** + * Constructor for relation step. + * @param relationList The list of relation. (NotNull) + * @param relationTraceList The list of relation trace. (NotNull) + */ + public AnnouncementBodyRelationTrace(List relationList, + List relationTraceList) { + super(relationList, relationTraceList); + } + + public AnnouncementDbm.AnnouncementRelationTrace foreignAnnouncement() { + _relationList.add(AnnouncementBodyDbm.getInstance() + .foreignAnnouncement()); + return AnnouncementDbm.getInstance().createRelationTrace( + _relationList, _relationTraceList); + } + + public RelationTrace columnId() { + return fixTrace(_relationList, AnnouncementBodyDbm.getInstance() + .columnId()); + } + + public RelationTrace columnContent() { + return fixTrace(_relationList, AnnouncementBodyDbm.getInstance() + .columnContent()); + } + } + + // =================================================================================== + // Sequence Info + // ============= + public boolean hasSequence() { + return false; + } + + // =================================================================================== + // Optimistic Lock Info + // ==================== + public boolean hasVersionNo() { + return false; + } + + public boolean hasUpdateDate() { + return false; + } + + // =================================================================================== + // Common Column Info + // ================== + public boolean hasCommonColumn() { + return false; + } + + // =================================================================================== + // Entity Handling + // =============== + // ----------------------------------------------------- + // Accept + // ------ + public void acceptPrimaryKeyMap(Entity entity, + Map primaryKeyMap) { + final AnnouncementBody myEntity = (AnnouncementBody) entity; + MapAssertUtil.assertPrimaryKeyMapNotNullAndNotEmpty(primaryKeyMap); + final MapStringValueAnalyzer analyzer = new MapStringValueAnalyzer( + primaryKeyMap, entity.getModifiedPropertyNames()); + + MapAssertUtil.assertColumnExistingInPrimaryKeyMap(primaryKeyMap, "ID"); + if (analyzer.init("ID", "id", "id")) { + myEntity.setId(analyzer.analyzeNumber(Integer.class)); + } + + } + + public void acceptPrimaryKeyMapString(Entity entity, + String primaryKeyMapString) { + MapStringUtil.acceptPrimaryKeyMapString(primaryKeyMapString, entity); + } + + public void acceptColumnValueMap(Entity entity, + Map columnValueMap) { + final AnnouncementBody myEntity = (AnnouncementBody) entity; + MapAssertUtil.assertColumnValueMapNotNullAndNotEmpty(columnValueMap); + final MapStringValueAnalyzer analyzer = new MapStringValueAnalyzer( + columnValueMap, entity.getModifiedPropertyNames()); + + if (analyzer.init("ID", "id", "id")) { + myEntity.setId(analyzer.analyzeNumber(Integer.class)); + } + if (analyzer.init("CONTENT", "content", "content")) { + myEntity.setContent(analyzer.analyzeString(String.class)); + } + + } + + public void acceptColumnValueMapString(Entity entity, + String columnValueMapString) { + MapStringUtil.acceptColumnValueMapString(columnValueMapString, entity); + } + + // ----------------------------------------------------- + // Extract + // ------- + public String extractPrimaryKeyMapString(Entity entity) { + return MapStringUtil.extractPrimaryKeyMapString(entity); + } + + public String extractPrimaryKeyMapString(Entity entity, String startBrace, + String endBrace, String delimiter, String equal) { + final AnnouncementBody myEntity = (AnnouncementBody) entity; + final String mapMarkAndStartBrace = MAP_STRING_MAP_MARK + startBrace; + final StringBuffer sb = new StringBuffer(); + helpAppendingColumnValueString(sb, delimiter, equal, "ID", myEntity + .getId()); + + sb.delete(0, delimiter.length()).insert(0, mapMarkAndStartBrace) + .append(endBrace); + return sb.toString(); + } + + public String extractColumnValueMapString(Entity entity) { + return MapStringUtil.extractColumnValueMapString(entity); + } + + public String extractColumnValueMapString(Entity entity, String startBrace, + String endBrace, String delimiter, String equal) { + final AnnouncementBody myEntity = (AnnouncementBody) entity; + final String mapMarkAndStartBrace = MAP_STRING_MAP_MARK + startBrace; + final StringBuffer sb = new StringBuffer(); + helpAppendingColumnValueString(sb, delimiter, equal, "ID", myEntity + .getId()); + helpAppendingColumnValueString(sb, delimiter, equal, "CONTENT", + myEntity.getContent()); + + sb.delete(0, delimiter.length()).insert(0, mapMarkAndStartBrace) + .append(endBrace); + return sb.toString(); + } + + private void helpAppendingColumnValueString(StringBuffer sb, + String delimiter, String equal, String colName, Object value) { + sb.append(delimiter).append(colName).append(equal); + sb.append(helpGettingColumnStringValue(value)); + } + + public String extractCommonColumnValueMapString(Entity entity) { + return "map:{}"; + } + + public String extractCommonColumnValueMapString(Entity entity, + String startBrace, String endBrace, String delimiter, String equal) { + return "map:" + startBrace + endBrace; + } + + // ----------------------------------------------------- + // Convert + // ------- + public List convertToColumnValueList(Entity entity) { + return new ArrayList(convertToColumnValueMap(entity).values()); + } + + public Map convertToColumnValueMap(Entity entity) { + final AnnouncementBody myEntity = downcast(entity); + final Map valueMap = new LinkedHashMap(); + valueMap.put("ID", myEntity.getId()); + valueMap.put("CONTENT", myEntity.getContent()); + return valueMap; + } + + public List convertToColumnStringValueList(Entity entity) { + return new ArrayList(convertToColumnStringValueMap(entity) + .values()); + } + + public Map convertToColumnStringValueMap(Entity entity) { + final AnnouncementBody myEntity = downcast(entity); + final Map valueMap = new LinkedHashMap(); + valueMap.put("ID", helpGettingColumnStringValue(myEntity.getId())); + valueMap.put("CONTENT", helpGettingColumnStringValue(myEntity + .getContent())); + return valueMap; + } + + // =================================================================================== + // JDBC Support + // ============ + public String getPreparedInsertClause() { + return getPreparedInsertClause(new PreparedInsertClauseOption()); + } + + public String getPreparedInsertClause( + PreparedInsertClauseOption preparedInsertClauseOption) { + if (preparedInsertClauseOption.getTablePrefix() != null) { + final String tablePrefix = preparedInsertClauseOption + .getTablePrefix(); + return "insert into " + tablePrefix + + "ANNOUNCEMENT_BODY(ID, CONTENT) values(? , ? )"; + } + return "insert into ANNOUNCEMENT_BODY(ID, CONTENT) values(? , ? )"; + } + + // =================================================================================== + // Entity Property Setup + // ===================== + // It's very INTERNAL! + protected Map> _entityPropertySetupperMap = new HashMap>(); + { + registerEntityPropertySetupper("ID", "id", + new EntityPropertyIdSetupper(), _entityPropertySetupperMap); + registerEntityPropertySetupper("CONTENT", "content", + new EntityPropertyContentSetupper(), _entityPropertySetupperMap); + } + + public boolean hasEntityPropertySetupper(String propertyName) { + return _entityPropertySetupperMap.containsKey(propertyName); + } + + public void setupEntityProperty(String propertyName, Object entity, + Object value) { + final EntityPropertySetupper callback = _entityPropertySetupperMap + .get(propertyName); + if (callback == null) { + String msg = "The propertyName was Not Found in the map of setupper of entity property:"; + msg = msg + " propertyName=" + propertyName + + " _entityPropertySetupperMap.keySet()=" + + _entityPropertySetupperMap.keySet(); + throw new IllegalStateException(msg); + } + callback.setup((AnnouncementBody) entity, value); + } + + public class EntityPropertyIdSetupper implements + EntityPropertySetupper { + public void setup(AnnouncementBody entity, Object value) { + entity.setId((Integer) value); + } + } + + public class EntityPropertyContentSetupper implements + EntityPropertySetupper { + public void setup(AnnouncementBody entity, Object value) { + entity.setContent((String) value); + } + } + + // =================================================================================== + // Helper + // ====== + protected AnnouncementBody downcast(Entity entity) { + assertObjectNotNull("entity", entity); + try { + return (AnnouncementBody) entity; + } catch (ClassCastException e) { + String msg = "The entity should be AnnouncementBody but it was: " + + entity.getClass(); + throw new RuntimeException(msg, e); + } + } + + protected void checkDowncast(Entity entity) { + downcast(entity); + } +} Property changes on: announcement/trunk/src/main/java/jp/sf/pal/announcement/db/bsentity/dbmeta/AnnouncementBodyDbm.java ___________________________________________________________________ Name: svn:eol-style + native Added: announcement/trunk/src/main/java/jp/sf/pal/announcement/db/bsentity/dbmeta/AnnouncementDbm.java =================================================================== --- announcement/trunk/src/main/java/jp/sf/pal/announcement/db/bsentity/dbmeta/AnnouncementDbm.java (rev 0) +++ announcement/trunk/src/main/java/jp/sf/pal/announcement/db/bsentity/dbmeta/AnnouncementDbm.java 2008-06-30 02:54:27 UTC (rev 1002) @@ -0,0 +1,799 @@ +package jp.sf.pal.announcement.db.bsentity.dbmeta; + +import java.util.ArrayList; +import java.util.Collections; +import java.util.HashMap; +import java.util.LinkedHashMap; +import java.util.List; +import java.util.Map; + +import jp.sf.pal.announcement.db.allcommon.Entity; +import jp.sf.pal.announcement.db.allcommon.dbmeta.AbstractDBMeta; +import jp.sf.pal.announcement.db.allcommon.dbmeta.info.ColumnInfo; +import jp.sf.pal.announcement.db.allcommon.dbmeta.info.ForeignInfo; +import jp.sf.pal.announcement.db.allcommon.dbmeta.info.RelationInfo; +import jp.sf.pal.announcement.db.allcommon.dbmeta.info.UniqueInfo; +import jp.sf.pal.announcement.db.exentity.Announcement; + +/** + * The DB meta of ANNOUNCEMENT. (Singleton) + *
    + * [primary-key]
    + *     ID
    + * 
    + * [column]
    + *     ID, SCOPE, ROLE, START_DATE, END_DATE, TITLE, SORT_ORDER, TIMESTAMP
    + * 
    + * [sequence]
    + *     
    + * 
    + * [identity]
    + *     ID
    + * 
    + * [version-no]
    + *     
    + * 
    + * [foreign-table]
    + *     
    + * 
    + * [referrer-table]
    + *     ANNOUNCEMENT_BODY
    + * 
    + * [foreign-property]
    + *     announcementBodyAsOne
    + * 
    + * [referrer-property]
    + *     
    + * 
    + * @author DBFlute(AutoGenerator) + */ + @ SuppressWarnings("unchecked") +public class AnnouncementDbm extends AbstractDBMeta { + + // =================================================================================== + // Definition + // ========== + protected static final Class ENTITY_TYPE = Announcement.class; + + private static final AnnouncementDbm _instance = new AnnouncementDbm(); + + // =================================================================================== + // Constructor + // =========== + private AnnouncementDbm() { + } + + // =================================================================================== + // Singleton + // ========= + public static AnnouncementDbm getInstance() { + return _instance; + } + + // =================================================================================== + // Name Definition + // =============== + // ----------------------------------------------------- + // Table + // ----- + /** Table DB name. */ + public static final String TABLE_DB_NAME = "ANNOUNCEMENT"; + + /** Table property name(JavaBeansRule). */ + public static final String TABLE_PROPERTY_NAME = "announcement"; + + // ----------------------------------------------------- + // Column DB Name + // -------------- + /** DB name of ID. {PK : INC : int : NotNull} */ + public static final String DB_NAME_ID = "ID"; + + /** DB name of SCOPE. {varchar(20) : NotNull} */ + public static final String DB_NAME_SCOPE = "SCOPE"; + + /** DB name of ROLE. {varchar(100)} */ + public static final String DB_NAME_ROLE = "ROLE"; + + /** DB name of START_DATE. {datetime} */ + public static final String DB_NAME_START_DATE = "START_DATE"; + + /** DB name of END_DATE. {datetime} */ + public static final String DB_NAME_END_DATE = "END_DATE"; + + /** DB name of TITLE. {varchar(100) : NotNull} */ + public static final String DB_NAME_TITLE = "TITLE"; + + /** DB name of SORT_ORDER. {int : NotNull} */ + public static final String DB_NAME_SORT_ORDER = "SORT_ORDER"; + + /** DB name of TIMESTAMP. {timestamp : NotNull : Default=[CURRENT_TIMESTAMP]} */ + public static final String DB_NAME_TIMESTAMP = "TIMESTAMP"; + + // ----------------------------------------------------- + // Column Property Name + // (JavaBeansRule) + // -------------------- + /** Property name(JavaBeansRule) of id. {PK : INC : int : NotNull} */ + public static final String PROPERTY_NAME_id = "id"; + + /** Property name(JavaBeansRule) of scope. {varchar(20) : NotNull} */ + public static final String PROPERTY_NAME_scope = "scope"; + + /** Property name(JavaBeansRule) of role. {varchar(100)} */ + public static final String PROPERTY_NAME_role = "role"; + + /** Property name(JavaBeansRule) of startDate. {datetime} */ + public static final String PROPERTY_NAME_startDate = "startDate"; + + /** Property name(JavaBeansRule) of endDate. {datetime} */ + public static final String PROPERTY_NAME_endDate = "endDate"; + + /** Property name(JavaBeansRule) of title. {varchar(100) : NotNull} */ + public static final String PROPERTY_NAME_title = "title"; + + /** Property name(JavaBeansRule) of sortOrder. {int : NotNull} */ + public static final String PROPERTY_NAME_sortOrder = "sortOrder"; + + /** Property name(JavaBeansRule) of timestamp. {timestamp : NotNull : Default=[CURRENT_TIMESTAMP]} */ + public static final String PROPERTY_NAME_timestamp = "timestamp"; + + // ----------------------------------------------------- + // Foreign Name + // ------------ + /** The foreign property name(JavaBeansRule) of announcementBodyAsOne. */ + public static final String FOREIGN_PROPERTY_NAME_announcementBodyAsOne = "announcementBodyAsOne"; + + // ----------------------------------------------------- + // Referrer Name + // ------------- + // ----------------------------------------------------- + // Name Map + // -------- + /** The map of {DB name : property name} key-to-lower. */ + private static Map _dbNamePropertyNameKeyToLowerMap; + + protected static Map createDbNamePropertyNameKeyToLowerMap() { + if (_dbNamePropertyNameKeyToLowerMap != null) { + return _dbNamePropertyNameKeyToLowerMap; + } + final Map map = new LinkedHashMap(); + map.put(TABLE_DB_NAME.toLowerCase(), TABLE_PROPERTY_NAME); + + map.put(DB_NAME_ID.toLowerCase(), PROPERTY_NAME_id); + map.put(DB_NAME_SCOPE.toLowerCase(), PROPERTY_NAME_scope); + map.put(DB_NAME_ROLE.toLowerCase(), PROPERTY_NAME_role); + map.put(DB_NAME_START_DATE.toLowerCase(), PROPERTY_NAME_startDate); + map.put(DB_NAME_END_DATE.toLowerCase(), PROPERTY_NAME_endDate); + map.put(DB_NAME_TITLE.toLowerCase(), PROPERTY_NAME_title); + map.put(DB_NAME_SORT_ORDER.toLowerCase(), PROPERTY_NAME_sortOrder); + map.put(DB_NAME_TIMESTAMP.toLowerCase(), PROPERTY_NAME_timestamp); + + _dbNamePropertyNameKeyToLowerMap = Collections.unmodifiableMap(map); + return _dbNamePropertyNameKeyToLowerMap; + } + + /** The map of {property name : DB name} key-to-lower. */ + private static Map _propertyNameDbNameKeyToLowerMap; + + protected static Map createPropertyNameDbNameKeyToLowerMap() { + if (_propertyNameDbNameKeyToLowerMap != null) { + return _propertyNameDbNameKeyToLowerMap; + } + final Map map = new LinkedHashMap(); + map.put(TABLE_PROPERTY_NAME.toLowerCase(), TABLE_DB_NAME); + + map.put(PROPERTY_NAME_id.toLowerCase(), DB_NAME_ID); + map.put(PROPERTY_NAME_scope.toLowerCase(), DB_NAME_SCOPE); + map.put(PROPERTY_NAME_role.toLowerCase(), DB_NAME_ROLE); + map.put(PROPERTY_NAME_startDate.toLowerCase(), DB_NAME_START_DATE); + map.put(PROPERTY_NAME_endDate.toLowerCase(), DB_NAME_END_DATE); + map.put(PROPERTY_NAME_title.toLowerCase(), DB_NAME_TITLE); + map.put(PROPERTY_NAME_sortOrder.toLowerCase(), DB_NAME_SORT_ORDER); + map.put(PROPERTY_NAME_timestamp.toLowerCase(), DB_NAME_TIMESTAMP); + + _propertyNameDbNameKeyToLowerMap = Collections.unmodifiableMap(map); + return _propertyNameDbNameKeyToLowerMap; + } + + // =================================================================================== + // Table Name + // ========== + public String getTableDbName() { + return TABLE_DB_NAME; + } + + public String getTablePropertyName() {// as JavaBeansRule + return TABLE_PROPERTY_NAME; + } + + // =================================================================================== + // Name Map + // ======== + /** + * @return The key-to-lower map of DB name(lower) and property name. (NotNull) + */ + public Map getDbNamePropertyNameKeyToLowerMap() { + return createDbNamePropertyNameKeyToLowerMap(); + } + + /** + * @return The key-to-lower map of property name(lower) and DB name. (NotNull) + */ + public Map getPropertyNameDbNameKeyToLowerMap() { + return createPropertyNameDbNameKeyToLowerMap(); + } + + // =================================================================================== + // Type Name + // ========= + public String getEntityTypeName() { + return "jp.sf.pal.announcement.db.exentity.Announcement"; + } + + public String getConditionBeanTypeName() { + return "jp.sf.pal.announcement.db.cbean.bs.AnnouncementCB"; + } + + public String getDaoTypeName() { + return "jp.sf.pal.announcement.db.exdao.AnnouncementDao"; + } + + public String getBehaviorTypeName() { + return "jp.sf.pal.announcement.db.exbhv.AnnouncementBhv"; + } + + // =================================================================================== + // Object Type + // =========== + public Class getEntityType() { + return ENTITY_TYPE; + } + + // =================================================================================== + // Object Instance + // =============== + public Entity newEntity() { + return newMyEntity(); + } + + public Announcement newMyEntity() { + return new Announcement(); + } + + // =================================================================================== + // Column Info + // =========== + /** + * @return The list of DB name of columns. (NotNull and NotEmpty) + */ + public List getColumnInfoList() { + final List columnInfoList = new ArrayList(); + columnInfoList.add(columnId()); + columnInfoList.add(columnScope()); + columnInfoList.add(columnRole()); + columnInfoList.add(columnStartDate()); + columnInfoList.add(columnEndDate()); + columnInfoList.add(columnTitle()); + columnInfoList.add(columnSortOrder()); + columnInfoList.add(columnTimestamp()); + return columnInfoList; + } + + /** @return The column information of id. (NotNull) */ + public ColumnInfo columnId() { + return new ColumnInfo(this, "ID", "id", Integer.class, true, null, null); + } + + /** @return The column information of scope. (NotNull) */ + public ColumnInfo columnScope() { + return new ColumnInfo(this, "SCOPE", "scope", String.class, false, + Integer.valueOf("20"), Integer.valueOf("0")); + } + + /** @return The column information of role. (NotNull) */ + public ColumnInfo columnRole() { + return new ColumnInfo(this, "ROLE", "role", String.class, false, + Integer.valueOf("100"), Integer.valueOf("0")); + } + + /** @return The column information of startDate. (NotNull) */ + public ColumnInfo columnStartDate() { + return new ColumnInfo(this, "START_DATE", "startDate", + java.sql.Timestamp.class, false, null, null); + } + + /** @return The column information of endDate. (NotNull) */ + public ColumnInfo columnEndDate() { + return new ColumnInfo(this, "END_DATE", "endDate", + java.sql.Timestamp.class, false, null, null); + } + + /** @return The column information of title. (NotNull) */ + public ColumnInfo columnTitle() { + return new ColumnInfo(this, "TITLE", "title", String.class, false, + Integer.valueOf("100"), Integer.valueOf("0")); + } + + /** @return The column information of sortOrder. (NotNull) */ + public ColumnInfo columnSortOrder() { + return new ColumnInfo(this, "SORT_ORDER", "sortOrder", Integer.class, + false, null, null); + } + + /** @return The column information of timestamp. (NotNull) */ + public ColumnInfo columnTimestamp() { + return new ColumnInfo(this, "TIMESTAMP", "timestamp", + java.sql.Timestamp.class, false, null, null); + } + + // =================================================================================== + // Unique Info + // =========== + // ----------------------------------------------------- + // Primary Element + // --------------- + public UniqueInfo getPrimaryUniqueInfo() { + final UniqueInfo uniqueInfo = new UniqueInfo(); + uniqueInfo.setDBMeta(this); + uniqueInfo.addUniqueColumnList(new ColumnInfo(this, "ID", "id", + Integer.class, true, null, null)); + uniqueInfo.setPrimary(true); + return uniqueInfo; + } + + public boolean hasPrimaryKey() { + return true; + } + + public boolean hasTwoOrMorePrimaryKeys() { + return false; + } + + // =================================================================================== + // Relation Info + // ============= + // ----------------------------------------------------- + // Foreign Property + // ---------------- + + public ForeignInfo foreignAnnouncementBodyAsOne() { + final ForeignInfo foreignInfo = new ForeignInfo(); + foreignInfo.setForeignPropertyName("announcementBodyAsOne"); + foreignInfo.setLocalDBMeta(AnnouncementDbm.getInstance()); + foreignInfo.setForeignDBMeta(AnnouncementBodyDbm.getInstance()); + final Map map = new LinkedHashMap(); + map.put(columnId(), AnnouncementBodyDbm.getInstance().columnId()); + foreignInfo.setLocalForeignColumnInfoMap(map); + foreignInfo.setRelationNo(0); + foreignInfo.setOneToOne(true); + return foreignInfo; + } + + // ----------------------------------------------------- + // Referrer Property + // ----------------- + + // ----------------------------------------------------- + // Relation Trace + // -------------- + public AnnouncementRelationTrace createRelationTrace( + RelationTraceFixHandler relationTraceFixHandler) { + return new AnnouncementRelationTrace(relationTraceFixHandler); + } + + public AnnouncementRelationTrace createRelationTrace( + List relationList, + List relationTraceList) { + return new AnnouncementRelationTrace(relationList, relationTraceList); + } + + public static class AnnouncementRelationTrace extends AbstractRelationTrace { + + /** + * Constructor for first step. + * @param relationTraceFixHandler The handler of fixed relation trace. (Nullable) + */ + public AnnouncementRelationTrace( + RelationTraceFixHandler relationTraceFixHandler) { + super(relationTraceFixHandler); + } + + /** + * Constructor for relation step. + * @param relationList The list of relation. (NotNull) + * @param relationTraceList The list of relation trace. (NotNull) + */ + public AnnouncementRelationTrace(List relationList, + List relationTraceList) { + super(relationList, relationTraceList); + } + + public AnnouncementBodyDbm.AnnouncementBodyRelationTrace foreignAnnouncementBodyAsOne() { + _relationList.add(AnnouncementDbm.getInstance() + .foreignAnnouncementBodyAsOne()); + return AnnouncementBodyDbm.getInstance().createRelationTrace( + _relationList, _relationTraceList); + } + + public RelationTrace columnId() { + return fixTrace(_relationList, AnnouncementDbm.getInstance() + .columnId()); + } + + public RelationTrace columnScope() { + return fixTrace(_relationList, AnnouncementDbm.getInstance() + .columnScope()); + } + + public RelationTrace columnRole() { + return fixTrace(_relationList, AnnouncementDbm.getInstance() + .columnRole()); + } + + public RelationTrace columnStartDate() { + return fixTrace(_relationList, AnnouncementDbm.getInstance() + .columnStartDate()); + } + + public RelationTrace columnEndDate() { + return fixTrace(_relationList, AnnouncementDbm.getInstance() + .columnEndDate()); + } + + public RelationTrace columnTitle() { + return fixTrace(_relationList, AnnouncementDbm.getInstance() + .columnTitle()); + } + + public RelationTrace columnSortOrder() { + return fixTrace(_relationList, AnnouncementDbm.getInstance() + .columnSortOrder()); + } + + public RelationTrace columnTimestamp() { + return fixTrace(_relationList, AnnouncementDbm.getInstance() + .columnTimestamp()); + } + } + + // =================================================================================== + // Sequence Info + // ============= + public boolean hasSequence() { + return false; + } + + // =================================================================================== + // Optimistic Lock Info + // ==================== + public boolean hasVersionNo() { + return false; + } + + public boolean hasUpdateDate() { + return false; + } + + // =================================================================================== + // Common Column Info + // ================== + public boolean hasCommonColumn() { + return false; + } + + // =================================================================================== + // Entity Handling + // =============== + // ----------------------------------------------------- + // Accept + // ------ + public void acceptPrimaryKeyMap(Entity entity, + Map primaryKeyMap) { + final Announcement myEntity = (Announcement) entity; + MapAssertUtil.assertPrimaryKeyMapNotNullAndNotEmpty(primaryKeyMap); + final MapStringValueAnalyzer analyzer = new MapStringValueAnalyzer( + primaryKeyMap, entity.getModifiedPropertyNames()); + + MapAssertUtil.assertColumnExistingInPrimaryKeyMap(primaryKeyMap, "ID"); + if (analyzer.init("ID", "id", "id")) { + myEntity.setId(analyzer.analyzeNumber(Integer.class)); + } + + } + + public void acceptPrimaryKeyMapString(Entity entity, + String primaryKeyMapString) { + MapStringUtil.acceptPrimaryKeyMapString(primaryKeyMapString, entity); + } + + public void acceptColumnValueMap(Entity entity, + Map columnValueMap) { + final Announcement myEntity = (Announcement) entity; + MapAssertUtil.assertColumnValueMapNotNullAndNotEmpty(columnValueMap); + final MapStringValueAnalyzer analyzer = new MapStringValueAnalyzer( + columnValueMap, entity.getModifiedPropertyNames()); + + if (analyzer.init("ID", "id", "id")) { + myEntity.setId(analyzer.analyzeNumber(Integer.class)); + } + if (analyzer.init("SCOPE", "scope", "scope")) { + myEntity.setScope(analyzer.analyzeString(String.class)); + } + if (analyzer.init("ROLE", "role", "role")) { + myEntity.setRole(analyzer.analyzeString(String.class)); + } + if (analyzer.init("START_DATE", "startDate", "startDate")) { + myEntity.setStartDate(analyzer + .analyzeDate(java.sql.Timestamp.class)); + } + if (analyzer.init("END_DATE", "endDate", "endDate")) { + myEntity.setEndDate(analyzer.analyzeDate(java.sql.Timestamp.class)); + } + if (analyzer.init("TITLE", "title", "title")) { + myEntity.setTitle(analyzer.analyzeString(String.class)); + } + if (analyzer.init("SORT_ORDER", "sortOrder", "sortOrder")) { + myEntity.setSortOrder(analyzer.analyzeNumber(Integer.class)); + } + if (analyzer.init("TIMESTAMP", "timestamp", "timestamp")) { + myEntity.setTimestamp(analyzer + .analyzeDate(java.sql.Timestamp.class)); + } + + } + + public void acceptColumnValueMapString(Entity entity, + String columnValueMapString) { + MapStringUtil.acceptColumnValueMapString(columnValueMapString, entity); + } + + // ----------------------------------------------------- + // Extract + // ------- + public String extractPrimaryKeyMapString(Entity entity) { + return MapStringUtil.extractPrimaryKeyMapString(entity); + } + + public String extractPrimaryKeyMapString(Entity entity, String startBrace, + String endBrace, String delimiter, String equal) { + final Announcement myEntity = (Announcement) entity; + final String mapMarkAndStartBrace = MAP_STRING_MAP_MARK + startBrace; + final StringBuffer sb = new StringBuffer(); + helpAppendingColumnValueString(sb, delimiter, equal, "ID", myEntity + .getId()); + + sb.delete(0, delimiter.length()).insert(0, mapMarkAndStartBrace) + .append(endBrace); + return sb.toString(); + } + + public String extractColumnValueMapString(Entity entity) { + return MapStringUtil.extractColumnValueMapString(entity); + } + + public String extractColumnValueMapString(Entity entity, String startBrace, + String endBrace, String delimiter, String equal) { + final Announcement myEntity = (Announcement) entity; + final String mapMarkAndStartBrace = MAP_STRING_MAP_MARK + startBrace; + final StringBuffer sb = new StringBuffer(); + helpAppendingColumnValueString(sb, delimiter, equal, "ID", myEntity + .getId()); + helpAppendingColumnValueString(sb, delimiter, equal, "SCOPE", myEntity + .getScope()); + helpAppendingColumnValueString(sb, delimiter, equal, "ROLE", myEntity + .getRole()); + helpAppendingColumnValueString(sb, delimiter, equal, "START_DATE", + myEntity.getStartDate()); + helpAppendingColumnValueString(sb, delimiter, equal, "END_DATE", + myEntity.getEndDate()); + helpAppendingColumnValueString(sb, delimiter, equal, "TITLE", myEntity + .getTitle()); + helpAppendingColumnValueString(sb, delimiter, equal, "SORT_ORDER", + myEntity.getSortOrder()); + helpAppendingColumnValueString(sb, delimiter, equal, "TIMESTAMP", + myEntity.getTimestamp()); + + sb.delete(0, delimiter.length()).insert(0, mapMarkAndStartBrace) + .append(endBrace); + return sb.toString(); + } + + private void helpAppendingColumnValueString(StringBuffer sb, + String delimiter, String equal, String colName, Object value) { + sb.append(delimiter).append(colName).append(equal); + sb.append(helpGettingColumnStringValue(value)); + } + + public String extractCommonColumnValueMapString(Entity entity) { + return "map:{}"; + } + + public String extractCommonColumnValueMapString(Entity entity, + String startBrace, String endBrace, String delimiter, String equal) { + return "map:" + startBrace + endBrace; + } + + // ----------------------------------------------------- + // Convert + // ------- + public List convertToColumnValueList(Entity entity) { + return new ArrayList(convertToColumnValueMap(entity).values()); + } + + public Map convertToColumnValueMap(Entity entity) { + final Announcement myEntity = downcast(entity); + final Map valueMap = new LinkedHashMap(); + valueMap.put("ID", myEntity.getId()); + valueMap.put("SCOPE", myEntity.getScope()); + valueMap.put("ROLE", myEntity.getRole()); + valueMap.put("START_DATE", myEntity.getStartDate()); + valueMap.put("END_DATE", myEntity.getEndDate()); + valueMap.put("TITLE", myEntity.getTitle()); + valueMap.put("SORT_ORDER", myEntity.getSortOrder()); + valueMap.put("TIMESTAMP", myEntity.getTimestamp()); + return valueMap; + } + + public List convertToColumnStringValueList(Entity entity) { + return new ArrayList(convertToColumnStringValueMap(entity) + .values()); + } + + public Map convertToColumnStringValueMap(Entity entity) { + final Announcement myEntity = downcast(entity); + final Map valueMap = new LinkedHashMap(); + valueMap.put("ID", helpGettingColumnStringValue(myEntity.getId())); + valueMap + .put("SCOPE", helpGettingColumnStringValue(myEntity.getScope())); + valueMap.put("ROLE", helpGettingColumnStringValue(myEntity.getRole())); + valueMap.put("START_DATE", helpGettingColumnStringValue(myEntity + .getStartDate())); + valueMap.put("END_DATE", helpGettingColumnStringValue(myEntity + .getEndDate())); + valueMap + .put("TITLE", helpGettingColumnStringValue(myEntity.getTitle())); + valueMap.put("SORT_ORDER", helpGettingColumnStringValue(myEntity + .getSortOrder())); + valueMap.put("TIMESTAMP", helpGettingColumnStringValue(myEntity + .getTimestamp())); + return valueMap; + } + + // =================================================================================== + // JDBC Support + // ============ + public String getPreparedInsertClause() { + return getPreparedInsertClause(new PreparedInsertClauseOption()); + } + + public String getPreparedInsertClause( + PreparedInsertClauseOption preparedInsertClauseOption) { + if (preparedInsertClauseOption.getTablePrefix() != null) { + final String tablePrefix = preparedInsertClauseOption + .getTablePrefix(); + return "insert into " + + tablePrefix + + "ANNOUNCEMENT(ID, SCOPE, ROLE, START_DATE, END_DATE, TITLE, SORT_ORDER, TIMESTAMP) values(? , ? , ? , ? , ? , ? , ? , ? )"; + } + return "insert into ANNOUNCEMENT(ID, SCOPE, ROLE, START_DATE, END_DATE, TITLE, SORT_ORDER, TIMESTAMP) values(? , ? , ? , ? , ? , ? , ? , ? )"; + } + + // =================================================================================== + // Entity Property Setup + // ===================== + // It's very INTERNAL! + protected Map> _entityPropertySetupperMap = new HashMap>(); + { + registerEntityPropertySetupper("ID", "id", + new EntityPropertyIdSetupper(), _entityPropertySetupperMap); + registerEntityPropertySetupper("SCOPE", "scope", + new EntityPropertyScopeSetupper(), _entityPropertySetupperMap); + registerEntityPropertySetupper("ROLE", "role", + new EntityPropertyRoleSetupper(), _entityPropertySetupperMap); + registerEntityPropertySetupper("START_DATE", "startDate", + new EntityPropertyStartDateSetupper(), + _entityPropertySetupperMap); + registerEntityPropertySetupper("END_DATE", "endDate", + new EntityPropertyEndDateSetupper(), _entityPropertySetupperMap); + registerEntityPropertySetupper("TITLE", "title", + new EntityPropertyTitleSetupper(), _entityPropertySetupperMap); + registerEntityPropertySetupper("SORT_ORDER", "sortOrder", + new EntityPropertySortOrderSetupper(), + _entityPropertySetupperMap); + registerEntityPropertySetupper("TIMESTAMP", "timestamp", + new EntityPropertyTimestampSetupper(), + _entityPropertySetupperMap); + } + + public boolean hasEntityPropertySetupper(String propertyName) { + return _entityPropertySetupperMap.containsKey(propertyName); + } + + public void setupEntityProperty(String propertyName, Object entity, + Object value) { + final EntityPropertySetupper callback = _entityPropertySetupperMap + .get(propertyName); + if (callback == null) { + String msg = "The propertyName was Not Found in the map of setupper of entity property:"; + msg = msg + " propertyName=" + propertyName + + " _entityPropertySetupperMap.keySet()=" + + _entityPropertySetupperMap.keySet(); + throw new IllegalStateException(msg); + } + callback.setup((Announcement) entity, value); + } + + public class EntityPropertyIdSetupper implements + EntityPropertySetupper { + public void setup(Announcement entity, Object value) { + entity.setId((Integer) value); + } + } + + public class EntityPropertyScopeSetupper implements + EntityPropertySetupper { + public void setup(Announcement entity, Object value) { + entity.setScope((String) value); + } + } + + public class EntityPropertyRoleSetupper implements + EntityPropertySetupper { + public void setup(Announcement entity, Object value) { + entity.setRole((String) value); + } + } + + public class EntityPropertyStartDateSetupper implements + EntityPropertySetupper { + public void setup(Announcement entity, Object value) { + entity.setStartDate((java.sql.Timestamp) value); + } + } + + public class EntityPropertyEndDateSetupper implements + EntityPropertySetupper { + public void setup(Announcement entity, Object value) { + entity.setEndDate((java.sql.Timestamp) value); + } + } + + public class EntityPropertyTitleSetupper implements + EntityPropertySetupper { + public void setup(Announcement entity, Object value) { + entity.setTitle((String) value); + } + } + + public class EntityPropertySortOrderSetupper implements + EntityPropertySetupper { + public void setup(Announcement entity, Object value) { + entity.setSortOrder((Integer) value); + } + } + + public class EntityPropertyTimestampSetupper implements + EntityPropertySetupper { + public void setup(Announcement entity, Object value) { + entity.setTimestamp((java.sql.Timestamp) value); + } + } + + // =================================================================================== + // Helper + // ====== + protected Announcement downcast(Entity entity) { + assertObjectNotNull("entity", entity); + try { + return (Announcement) entity; + } catch (ClassCastException e) { + String msg = "The entity should be Announcement but it was: " + + entity.getClass(); + throw new RuntimeException(msg, e); + } + } + + protected void checkDowncast(Entity entity) { + downcast(entity); + } +} Property changes on: announcement/trunk/src/main/java/jp/sf/pal/announcement/db/bsentity/dbmeta/AnnouncementDbm.java ___________________________________________________________________ Name: svn:eol-style + native Added: announcement/trunk/src/main/java/jp/sf/pal/announcement/db/cbean/AnnouncementBodyCB.java =================================================================== --- announcement/trunk/src/main/java/jp/sf/pal/announcement/db/cbean/AnnouncementBodyCB.java (rev 0) +++ announcement/trunk/src/main/java/jp/sf/pal/announcement/db/cbean/AnnouncementBodyCB.java 2008-06-30 02:54:27 UTC (rev 1002) @@ -0,0 +1,14 @@ +package jp.sf.pal.announcement.db.cbean; + +/** + * The condition-bean of ANNOUNCEMENT_BODY. + *

    + * You can implement your original methods here. + * This class is NOT overrided when re-generating. + *

    + * @author DBFlute(AutoGenerator) + */ + @ SuppressWarnings("unchecked") +public class AnnouncementBodyCB extends + jp.sf.pal.announcement.db.cbean.bs.BsAnnouncementBodyCB { +} Property changes on: announcement/trunk/src/main/java/jp/sf/pal/announcement/db/cbean/AnnouncementBodyCB.java ___________________________________________________________________ Name: svn:eol-style + native Added: announcement/trunk/src/main/java/jp/sf/pal/announcement/db/cbean/AnnouncementCB.java =================================================================== --- announcement/trunk/src/main/java/jp/sf/pal/announcement/db/cbean/AnnouncementCB.java (rev 0) +++ announcement/trunk/src/main/java/jp/sf/pal/announcement/db/cbean/AnnouncementCB.java 2008-06-30 02:54:27 UTC (rev 1002) @@ -0,0 +1,14 @@ +package jp.sf.pal.announcement.db.cbean; + +/** + * The condition-bean of ANNOUNCEMENT. + *

    + * You can implement your original methods here. + * This class is NOT overrided when re-generating. + *

    + * @author DBFlute(AutoGenerator) + */ + @ SuppressWarnings("unchecked") +public class AnnouncementCB extends + jp.sf.pal.announcement.db.cbean.bs.BsAnnouncementCB { +} Property changes on: announcement/trunk/src/main/java/jp/sf/pal/announcement/db/cbean/AnnouncementCB.java ___________________________________________________________________ Name: svn:eol-style + native Added: announcement/trunk/src/main/java/jp/sf/pal/announcement/db/cbean/bs/BsAnnouncementBodyCB.java =================================================================== --- announcement/trunk/src/main/java/jp/sf/pal/announcement/db/cbean/bs/BsAnnouncementBodyCB.java (rev 0) +++ announcement/trunk/src/main/java/jp/sf/pal/announcement/db/cbean/bs/BsAnnouncementBodyCB.java 2008-06-30 02:54:27 UTC (rev 1002) @@ -0,0 +1,157 @@ +package jp.sf.pal.announcement.db.cbean.bs; + +import jp.sf.pal.announcement.db.allcommon.cbean.AbstractConditionBean; +import jp.sf.pal.announcement.db.allcommon.cbean.ConditionBean; +import jp.sf.pal.announcement.db.allcommon.cbean.ConditionQuery; +import jp.sf.pal.announcement.db.cbean.cq.AnnouncementBodyCQ; + +/** + * The base condition-bean of ANNOUNCEMENT_BODY. + * @author DBFlute(AutoGenerator) + */ + @ SuppressWarnings("unchecked") +public class BsAnnouncementBodyCB extends AbstractConditionBean { + + // =================================================================================== + // Annotation + // ========== + /** @Deprecated */ + public static final String TABLE = "ANNOUNCEMENT_BODY"; + + // =================================================================================== + // Attribute + // ========= + protected AnnouncementBodyCQ _conditionQuery; + + // =================================================================================== + // Table Name + // ========== + public String getTableDbName() { + return "ANNOUNCEMENT_BODY"; + } + + public String getTableSqlName() { + return "ANNOUNCEMENT_BODY"; + } + + // =================================================================================== + // PrimaryKey Map + // ============== + public void acceptPrimaryKeyMap( + java.util.Map primaryKeyMap) { + if (primaryKeyMap == null) { + String msg = "The argument[primaryKeyMap] must not be null."; + throw new IllegalArgumentException(msg); + } + if (primaryKeyMap.isEmpty()) { + String msg = "The argument[primaryKeyMap] must not be empty."; + throw new IllegalArgumentException(msg); + } + + if (!primaryKeyMap.containsKey("ID")) { + String msg = "The primaryKeyMap must have the value of ID"; + throw new IllegalStateException(msg + ": primaryKeyMap --> " + + primaryKeyMap); + } + { + Object obj = primaryKeyMap.get("ID"); + if (obj instanceof Integer) { + query().setId_Equal((Integer) obj); + } else { + + if (obj instanceof Integer) { + query().setId_Equal((Integer) obj); + } else { + try { + query().setId_Equal(new Integer((String) obj)); + } catch (RuntimeException e) { + String msg = "setId(new Integer((String)obj))"; + throw new RuntimeException(msg + + " threw the exception: value=[" + obj + "]", + e); + } + } + } + } + + } + + // =================================================================================== + // OrderBy Setting + // =============== + public ConditionBean addOrderBy_PK_Asc() { + query().addOrderBy_Id_Asc(); + return this; + } + + public ConditionBean addOrderBy_PK_Desc() { + query().addOrderBy_Id_Desc(); + return this; + } + + // =================================================================================== + // Query + // ===== + public AnnouncementBodyCQ query() { + return getConditionQuery(); + } + + public AnnouncementBodyCQ getConditionQuery() { + if (_conditionQuery == null) { + _conditionQuery = new AnnouncementBodyCQ(null, getSqlClause(), + getSqlClause().getLocalTableAliasName(), 0); + } + return _conditionQuery; + } + + public ConditionQuery getConditionQueryAsInterface() { + return getConditionQuery(); + } + + // =================================================================================== + // Union Query + // =========== + public void union(AnnouncementBodyCQ unionQuery) { + query().xsetUnionQuery(unionQuery); + } + + public void unionAll(AnnouncementBodyCQ unionAllQuery) { + query().xsetUnionAllQuery(unionAllQuery); + } + + public boolean hasUnionQueryOrUnionAllQuery() { + return query().hasUnionQueryOrUnionAllQuery(); + } + + // =================================================================================== + // Setup Select + // ============ + + protected jp.sf.pal.announcement.db.cbean.nss.AnnouncementNss _nssAnnouncement; + + public jp.sf.pal.announcement.db.cbean.nss.AnnouncementNss getNssAnnouncement() { + if (_nssAnnouncement == null) { + _nssAnnouncement = new jp.sf.pal.announcement.db.cbean.nss.AnnouncementNss( + null);// for Dummy + } + return _nssAnnouncement; + } + + public jp.sf.pal.announcement.db.cbean.nss.AnnouncementNss setupSelect_Announcement() { + assertSetupSelectBeforeUnion("setupSelect_Announcement()"); + final String foreignTableAliasName = query().queryAnnouncement() + .getRealAliasName(); + final String localRelationPath = query().getRelationPath(); + getSqlClause().registerSelectedSelectColumn(foreignTableAliasName, + "ANNOUNCEMENT_BODY", "announcement", localRelationPath); + getSqlClause().registerSelectedForeignInfo( + query().queryAnnouncement().getRelationPath(), "announcement"); + if (_nssAnnouncement == null || !_nssAnnouncement.hasConditionQuery()) { + _nssAnnouncement = new jp.sf.pal.announcement.db.cbean.nss.AnnouncementNss( + query().queryAnnouncement()); + } + limitSelect_Off(); + return _nssAnnouncement; + } + +} Property changes on: announcement/trunk/src/main/java/jp/sf/pal/announcement/db/cbean/bs/BsAnnouncementBodyCB.java ___________________________________________________________________ Name: svn:eol-style + native Added: announcement/trunk/src/main/java/jp/sf/pal/announcement/db/cbean/bs/BsAnnouncementCB.java =================================================================== --- announcement/trunk/src/main/java/jp/sf/pal/announcement/db/cbean/bs/BsAnnouncementCB.java (rev 0) +++ announcement/trunk/src/main/java/jp/sf/pal/announcement/db/cbean/bs/BsAnnouncementCB.java 2008-06-30 02:54:27 UTC (rev 1002) @@ -0,0 +1,159 @@ +package jp.sf.pal.announcement.db.cbean.bs; + +import jp.sf.pal.announcement.db.allcommon.cbean.AbstractConditionBean; +import jp.sf.pal.announcement.db.allcommon.cbean.ConditionBean; +import jp.sf.pal.announcement.db.allcommon.cbean.ConditionQuery; +import jp.sf.pal.announcement.db.cbean.cq.AnnouncementCQ; + +/** + * The base condition-bean of ANNOUNCEMENT. + * @author DBFlute(AutoGenerator) + */ + @ SuppressWarnings("unchecked") +public class BsAnnouncementCB extends AbstractConditionBean { + + // =================================================================================== + // Annotation + // ========== + /** @Deprecated */ + public static final String TABLE = "ANNOUNCEMENT"; + + // =================================================================================== + // Attribute + // ========= + protected AnnouncementCQ _conditionQuery; + + // =================================================================================== + // Table Name + // ========== + public String getTableDbName() { + return "ANNOUNCEMENT"; + } + + public String getTableSqlName() { + return "ANNOUNCEMENT"; + } + + // =================================================================================== + // PrimaryKey Map + // ============== + public void acceptPrimaryKeyMap( + java.util.Map primaryKeyMap) { + if (primaryKeyMap == null) { + String msg = "The argument[primaryKeyMap] must not be null."; + throw new IllegalArgumentException(msg); + } + if (primaryKeyMap.isEmpty()) { + String msg = "The argument[primaryKeyMap] must not be empty."; + throw new IllegalArgumentException(msg); + } + + if (!primaryKeyMap.containsKey("ID")) { + String msg = "The primaryKeyMap must have the value of ID"; + throw new IllegalStateException(msg + ": primaryKeyMap --> " + + primaryKeyMap); + } + { + Object obj = primaryKeyMap.get("ID"); + if (obj instanceof Integer) { + query().setId_Equal((Integer) obj); + } else { + + if (obj instanceof Integer) { + query().setId_Equal((Integer) obj); + } else { + try { + query().setId_Equal(new Integer((String) obj)); + } catch (RuntimeException e) { + String msg = "setId(new Integer((String)obj))"; + throw new RuntimeException(msg + + " threw the exception: value=[" + obj + "]", + e); + } + } + } + } + + } + + // =================================================================================== + // OrderBy Setting + // =============== + public ConditionBean addOrderBy_PK_Asc() { + query().addOrderBy_Id_Asc(); + return this; + } + + public ConditionBean addOrderBy_PK_Desc() { + query().addOrderBy_Id_Desc(); + return this; + } + + // =================================================================================== + // Query + // ===== + public AnnouncementCQ query() { + return getConditionQuery(); + } + + public AnnouncementCQ getConditionQuery() { + if (_conditionQuery == null) { + _conditionQuery = new AnnouncementCQ(null, getSqlClause(), + getSqlClause().getLocalTableAliasName(), 0); + } + return _conditionQuery; + } + + public ConditionQuery getConditionQueryAsInterface() { + return getConditionQuery(); + } + + // =================================================================================== + // Union Query + // =========== + public void union(AnnouncementCQ unionQuery) { + query().xsetUnionQuery(unionQuery); + } + + public void unionAll(AnnouncementCQ unionAllQuery) { + query().xsetUnionAllQuery(unionAllQuery); + } + + public boolean hasUnionQueryOrUnionAllQuery() { + return query().hasUnionQueryOrUnionAllQuery(); + } + + // =================================================================================== + // Setup Select + // ============ + + protected jp.sf.pal.announcement.db.cbean.nss.AnnouncementBodyNss _nssAnnouncementBodyAsOne; + + public jp.sf.pal.announcement.db.cbean.nss.AnnouncementBodyNss getNssAnnouncementBodyAsOne() { + if (_nssAnnouncementBodyAsOne == null) { + _nssAnnouncementBodyAsOne = new jp.sf.pal.announcement.db.cbean.nss.AnnouncementBodyNss( + null);// for Dummy + } + return _nssAnnouncementBodyAsOne; + } + + public jp.sf.pal.announcement.db.cbean.nss.AnnouncementBodyNss setupSelect_AnnouncementBodyAsOne() { + assertSetupSelectBeforeUnion("setupSelect_AnnouncementBodyAsOne()"); + final String foreignTableAliasName = query() + .queryAnnouncementBodyAsOne().getRealAliasName(); + final String localRelationPath = query().getRelationPath(); + getSqlClause().registerSelectedSelectColumn(foreignTableAliasName, + "ANNOUNCEMENT", "announcementBodyAsOne", localRelationPath); + getSqlClause().registerSelectedForeignInfo( + query().queryAnnouncementBodyAsOne().getRelationPath(), + "announcementBodyAsOne"); + if (_nssAnnouncementBodyAsOne == null + || !_nssAnnouncementBodyAsOne.hasConditionQuery()) { + _nssAnnouncementBodyAsOne = new jp.sf.pal.announcement.db.cbean.nss.AnnouncementBodyNss( + query().queryAnnouncementBodyAsOne()); + } + limitSelect_Off(); + return _nssAnnouncementBodyAsOne; + } + +} Property changes on: announcement/trunk/src/main/java/jp/sf/pal/announcement/db/cbean/bs/BsAnnouncementCB.java ___________________________________________________________________ Name: svn:eol-style + native Added: announcement/trunk/src/main/java/jp/sf/pal/announcement/db/cbean/cq/AnnouncementBodyCQ.java =================================================================== --- announcement/trunk/src/main/java/jp/sf/pal/announcement/db/cbean/cq/AnnouncementBodyCQ.java (rev 0) +++ announcement/trunk/src/main/java/jp/sf/pal/announcement/db/cbean/cq/AnnouncementBodyCQ.java 2008-06-30 02:54:27 UTC (rev 1002) @@ -0,0 +1,40 @@ +package jp.sf.pal.announcement.db.cbean.cq; + +import jp.sf.pal.announcement.db.allcommon.cbean.ConditionQuery; +import jp.sf.pal.announcement.db.allcommon.cbean.sqlclause.SqlClause; +import jp.sf.pal.announcement.db.cbean.cq.bs.BsAnnouncementBodyCQ; + +/** + * The condition-query of ANNOUNCEMENT_BODY. + *

    + * You can implement your original methods here. + * This class is NOT overrided when re-generating. + *

    + * @author DBFlute(AutoGenerator) + */ + @ SuppressWarnings("unchecked") +public class AnnouncementBodyCQ extends BsAnnouncementBodyCQ { + + // =================================================================================== + // Constructor + // =========== + /** + * Constructor. + * @param childQuery Child query as abstract class. (Nullable: If null, this is base instance.) + * @param sqlClause SQL clause instance. (NotNull) + * @param aliasName My alias name. (NotNull) + * @param nestLevel Nest level. + */ + public AnnouncementBodyCQ(ConditionQuery childQuery, SqlClause sqlClause, + String aliasName, int nestLevel) { + super(childQuery, sqlClause, aliasName, nestLevel); + } + + // =================================================================================== + // Arrange Method + // ============== + // You can make original arrange query methods here. + // public void arranegeXxx() { + // ... + // } +} Property changes on: announcement/trunk/src/main/java/jp/sf/pal/announcement/db/cbean/cq/AnnouncementBodyCQ.java ___________________________________________________________________ Name: svn:eol-style + native Added: announcement/trunk/src/main/java/jp/sf/pal/announcement/db/cbean/cq/AnnouncementCQ.java =================================================================== --- announcement/trunk/src/main/java/jp/sf/pal/announcement/db/cbean/cq/AnnouncementCQ.java (rev 0) +++ announcement/trunk/src/main/java/jp/sf/pal/announcement/db/cbean/cq/AnnouncementCQ.java 2008-06-30 02:54:27 UTC (rev 1002) @@ -0,0 +1,40 @@ +package jp.sf.pal.announcement.db.cbean.cq; + +import jp.sf.pal.announcement.db.allcommon.cbean.ConditionQuery; +import jp.sf.pal.announcement.db.allcommon.cbean.sqlclause.SqlClause; +import jp.sf.pal.announcement.db.cbean.cq.bs.BsAnnouncementCQ; + +/** + * The condition-query of ANNOUNCEMENT. + *

    + * You can implement your original methods here. + * This class is NOT overrided when re-generating. + *

    + * @author DBFlute(AutoGenerator) + */ + @ SuppressWarnings("unchecked") +public class AnnouncementCQ extends BsAnnouncementCQ { + + // =================================================================================== + // Constructor + // =========== + /** + * Constructor. + * @param childQuery Child query as abstract class. (Nullable: If null, this is base instance.) + * @param sqlClause SQL clause instance. (NotNull) + * @param aliasName My alias name. (NotNull) + * @param nestLevel Nest level. + */ + public AnnouncementCQ(ConditionQuery childQuery, SqlClause sqlClause, + String aliasName, int nestLevel) { + super(childQuery, sqlClause, aliasName, nestLevel); + } + + // =================================================================================== + // Arrange Method + // ============== + // You can make original arrange query methods here. + // public void arranegeXxx() { + // ... + // } +} Property changes on: announcement/trunk/src/main/java/jp/sf/pal/announcement/db/cbean/cq/AnnouncementCQ.java ___________________________________________________________________ Name: svn:eol-style + native Added: announcement/trunk/src/main/java/jp/sf/pal/announcement/db/cbean/cq/bs/AbstractBsAnnouncementBodyCQ.java =================================================================== --- announcement/trunk/src/main/java/jp/sf/pal/announcement/db/cbean/cq/bs/AbstractBsAnnouncementBodyCQ.java (rev 0) +++ announcement/trunk/src/main/java/jp/sf/pal/announcement/db/cbean/cq/bs/AbstractBsAnnouncementBodyCQ.java 2008-06-30 02:54:27 UTC (rev 1002) @@ -0,0 +1,247 @@ +package jp.sf.pal.announcement.db.cbean.cq.bs; + +import java.util.Collection; + +import jp.sf.pal.announcement.db.allcommon.cbean.AbstractConditionQuery; +import jp.sf.pal.announcement.db.allcommon.cbean.ConditionQuery; +import jp.sf.pal.announcement.db.allcommon.cbean.ckey.ConditionKey; +import jp.sf.pal.announcement.db.allcommon.cbean.cvalue.ConditionValue; +import jp.sf.pal.announcement.db.allcommon.cbean.sqlclause.SqlClause; + +/** + * The abstract condition-query of ANNOUNCEMENT_BODY. + * @author DBFlute(AutoGenerator) + */ + @ SuppressWarnings("unchecked") +public abstract class AbstractBsAnnouncementBodyCQ extends + AbstractConditionQuery { + + // =================================================================================== + // Constructor + // =========== + public AbstractBsAnnouncementBodyCQ(ConditionQuery childQuery, + SqlClause sqlClause, String aliasName, int nestLevel) { + super(childQuery, sqlClause, aliasName, nestLevel); + } + + // =================================================================================== + // Table Name + // ========== + public String getTableDbName() { + return "ANNOUNCEMENT_BODY"; + } + + public String getTableSqlName() { + return "ANNOUNCEMENT_BODY"; + } + + // =================================================================================== + // Query + // ===== + + /** + * Equal(=). And NullIgnored, OnceRegistered. {PK : int : NotNull : FK to ANNOUNCEMENT} + * @param id The value of id as equal. + */ + public void setId_Equal(Integer id) { + registerId(ConditionKey.CK_EQUAL, id); + } + + /** + * NotEqual(!=). And NullIgnored, OnceRegistered. + * @param id The value of id as notEqual. + */ + public void setId_NotEqual(Integer id) { + registerId(ConditionKey.CK_NOT_EQUAL, id); + } + + /** + * GreaterThan(>). And NullIgnored, OnceRegistered. + * @param id The value of id as greaterThan. + */ + public void setId_GreaterThan(Integer id) { + registerId(ConditionKey.CK_GREATER_THAN, id); + } + + /** + * LessThan(<). And NullIgnored, OnceRegistered. + * @param id The value of id as lessThan. + */ + public void setId_LessThan(Integer id) { + registerId(ConditionKey.CK_LESS_THAN, id); + } + + /** + * GreaterEqual(>=). And NullIgnored, OnceRegistered. + * @param id The value of id as greaterEqual. + */ + public void setId_GreaterEqual(Integer id) { + registerId(ConditionKey.CK_GREATER_EQUAL, id); + } + + /** + * LessEqual(<=). And NullIgnored, OnceRegistered. + * @param id The value of id as lessEqual. + */ + public void setId_LessEqual(Integer id) { + registerId(ConditionKey.CK_LESS_EQUAL, id); + } + + /** + * InScope(in (1, 2)). And NullIgnored, NullElementIgnored, SeveralRegistered. + * @param idList The collection of id as inScope. + */ + public void setId_InScope(Collection idList) { + registerId(ConditionKey.CK_IN_SCOPE, convertToList(idList)); + } + + /** + * NotInScope(not in (1, 2)). And NullIgnored, NullElementIgnored, SeveralRegistered. + * @param idList The collection of id as notInScope. + */ + public void setId_NotInScope(Collection idList) { + registerId(ConditionKey.CK_NOT_IN_SCOPE, convertToList(idList)); + } + + /** + * InScopeSubQuery{in (select xxx.ID from ANNOUNCEMENT where ...)}. + * @param announcementCBquery The sub-query of Id_InScopeSubQuery_Announcement using inScopeSubQuery. (NotNull) + */ + public void setId_InScopeSubQuery_Announcement( + jp.sf.pal.announcement.db.cbean.cq.AnnouncementCQ announcementCBquery) { + assertObjectNotNull("announcementCBquery", announcementCBquery); + final String subQueryPropertyName = keepId_InScopeSubQuery_Announcement(announcementCBquery);// for saving query-value. + registerInScopeSubQuery(announcementCBquery, "ID", "ID", + subQueryPropertyName); + } + + abstract public String keepId_InScopeSubQuery_Announcement( + jp.sf.pal.announcement.db.cbean.cq.AnnouncementCQ subQuery); + + protected void registerId(ConditionKey key, Object value) { + registerQuery(key, value, getCValueId(), "ID", "Id", "id"); + } + + protected void registerInlineId(ConditionKey key, Object value) { + registerInlineQuery(key, value, getCValueId(), "ID", "Id", "id"); + } + + abstract protected ConditionValue getCValueId(); + + /** + * Equal(=). And NullOrEmptyIgnored, OnceRegistered. {text(65535) : NotNull} + * @param content The value of content as equal. + */ + public void setContent_Equal(String content) { + registerContent(ConditionKey.CK_EQUAL, filterRemoveEmptyString(content)); + } + + /** + * NotEqual(!=). And NullOrEmptyIgnored, OnceRegistered. + * @param content The value of content as notEqual. + */ + public void setContent_NotEqual(String content) { + registerContent(ConditionKey.CK_NOT_EQUAL, + filterRemoveEmptyString(content)); + } + + /** + * GreaterThan(>). And NullOrEmptyIgnored, OnceRegistered. + * @param content The value of content as greaterThan. + */ + public void setContent_GreaterThan(String content) { + registerContent(ConditionKey.CK_GREATER_THAN, + filterRemoveEmptyString(content)); + } + + /** + * LessThan(<). And NullOrEmptyIgnored, OnceRegistered. + * @param content The value of content as lessThan. + */ + public void setContent_LessThan(String content) { + registerContent(ConditionKey.CK_LESS_THAN, + filterRemoveEmptyString(content)); + } + + /** + * GreaterEqual(>=). And NullOrEmptyIgnored, OnceRegistered. + * @param content The value of content as greaterEqual. + */ + public void setContent_GreaterEqual(String content) { + registerContent(ConditionKey.CK_GREATER_EQUAL, + filterRemoveEmptyString(content)); + } + + /** + * LessEqual(<=). And NullOrEmptyIgnored, OnceRegistered. + * @param content The value of content as lessEqual. + */ + public void setContent_LessEqual(String content) { + registerContent(ConditionKey.CK_LESS_EQUAL, + filterRemoveEmptyString(content)); + } + + /** + * PrefixSearch(like 'xxx%'). And NullOrEmptyIgnored, OnceRegistered. + * @param content The value of content as prefixSearch. + */ + public void setContent_PrefixSearch(String content) { + registerContent(ConditionKey.CK_PREFIX_SEARCH, + filterRemoveEmptyString(content)); + } + + /** + * LikeSearch(like 'xxx%' escape ...). And NullOrEmptyIgnored, SeveralRegistered. + * @param content The value of content as likeSearch. + * @param likeSearchOption The option of like-search. (NotNull) + */ + public void setContent_LikeSearch( + String content, + jp.sf.pal.announcement.db.allcommon.cbean.coption.LikeSearchOption likeSearchOption) { + registerLikeSearchQuery(ConditionKey.CK_LIKE_SEARCH, + filterRemoveEmptyString(content), getCValueContent(), + "CONTENT", "Content", "content", likeSearchOption); + } + + /** + * InScope(in ('a', 'b')). And NullOrEmptyIgnored, NullOrEmptyElementIgnored, SeveralRegistered. + * @param contentList The collection of content as inScope. + */ + public void setContent_InScope(Collection contentList) { + registerContent(ConditionKey.CK_IN_SCOPE, convertToList(contentList)); + } + + /** + * InScope(in ('a', 'b')). And NullOrEmptyIgnored, NullOrEmptyElementIgnored, SeveralRegistered. + * @param content The collection of content as inScope. + * @param inScopeOption The option of in-scope. (NotNull) + */ + public void setContent_InScope( + String content, + jp.sf.pal.announcement.db.allcommon.cbean.coption.InScopeOption inScopeOption) { + registerInScopeQuery(ConditionKey.CK_IN_SCOPE, + filterRemoveEmptyString(content), getCValueContent(), + "CONTENT", "Content", "content", inScopeOption); + } + + /** + * NotInScope(not in ('a', 'b')). And NullOrEmptyIgnored, NullOrEmptyElementIgnored, SeveralRegistered. + * @param contentList The collection of content as notInScope. + */ + public void setContent_NotInScope(Collection contentList) { + registerContent(ConditionKey.CK_NOT_IN_SCOPE, + convertToList(contentList)); + } + + protected void registerContent(ConditionKey key, Object value) { + registerQuery(key, value, getCValueContent(), "CONTENT", "Content", + "content"); + } + + protected void registerInlineContent(ConditionKey key, Object value) { + registerInlineQuery(key, value, getCValueContent(), "CONTENT", + "Content", "content"); + } + + abstract protected ConditionValue getCValueContent(); +} Property changes on: announcement/trunk/src/main/java/jp/sf/pal/announcement/db/cbean/cq/bs/AbstractBsAnnouncementBodyCQ.java ___________________________________________________________________ Name: svn:eol-style + native Added: announcement/trunk/src/main/java/jp/sf/pal/announcement/db/cbean/cq/bs/AbstractBsAnnouncementCQ.java =================================================================== --- announcement/trunk/src/main/java/jp/sf/pal/announcement/db/cbean/cq/bs/AbstractBsAnnouncementCQ.java (rev 0) +++ announcement/trunk/src/main/java/jp/sf/pal/announcement/db/cbean/cq/bs/AbstractBsAnnouncementCQ.java 2008-06-30 02:54:27 UTC (rev 1002) @@ -0,0 +1,868 @@ +package jp.sf.pal.announcement.db.cbean.cq.bs; + +import java.util.Collection; + +import jp.sf.pal.announcement.db.allcommon.cbean.AbstractConditionQuery; +import jp.sf.pal.announcement.db.allcommon.cbean.ConditionQuery; +import jp.sf.pal.announcement.db.allcommon.cbean.ckey.ConditionKey; +import jp.sf.pal.announcement.db.allcommon.cbean.cvalue.ConditionValue; +import jp.sf.pal.announcement.db.allcommon.cbean.sqlclause.SqlClause; + +/** + * The abstract condition-query of ANNOUNCEMENT. + * @author DBFlute(AutoGenerator) + */ + @ SuppressWarnings("unchecked") +public abstract class AbstractBsAnnouncementCQ extends AbstractConditionQuery { + + // =================================================================================== + // Constructor + // =========== + public AbstractBsAnnouncementCQ(ConditionQuery childQuery, + SqlClause sqlClause, String aliasName, int nestLevel) { + super(childQuery, sqlClause, aliasName, nestLevel); + } + + // =================================================================================== + // Table Name + // ========== + public String getTableDbName() { + return "ANNOUNCEMENT"; + } + + public String getTableSqlName() { + return "ANNOUNCEMENT"; + } + + // =================================================================================== + // Query + // ===== + + /** + * Equal(=). And NullIgnored, OnceRegistered. {PK : INC : int : NotNull} + * @param id The value of id as equal. + */ + public void setId_Equal(Integer id) { + registerId(ConditionKey.CK_EQUAL, id); + } + + /** + * NotEqual(!=). And NullIgnored, OnceRegistered. + * @param id The value of id as notEqual. + */ + public void setId_NotEqual(Integer id) { + registerId(ConditionKey.CK_NOT_EQUAL, id); + } + + /** + * GreaterThan(>). And NullIgnored, OnceRegistered. + * @param id The value of id as greaterThan. + */ + public void setId_GreaterThan(Integer id) { + registerId(ConditionKey.CK_GREATER_THAN, id); + } + + /** + * LessThan(<). And NullIgnored, OnceRegistered. + * @param id The value of id as lessThan. + */ + public void setId_LessThan(Integer id) { + registerId(ConditionKey.CK_LESS_THAN, id); + } + + /** + * GreaterEqual(>=). And NullIgnored, OnceRegistered. + * @param id The value of id as greaterEqual. + */ + public void setId_GreaterEqual(Integer id) { + registerId(ConditionKey.CK_GREATER_EQUAL, id); + } + + /** + * LessEqual(<=). And NullIgnored, OnceRegistered. + * @param id The value of id as lessEqual. + */ + public void setId_LessEqual(Integer id) { + registerId(ConditionKey.CK_LESS_EQUAL, id); + } + + /** + * InScope(in (1, 2)). And NullIgnored, NullElementIgnored, SeveralRegistered. + * @param idList The collection of id as inScope. + */ + public void setId_InScope(Collection idList) { + registerId(ConditionKey.CK_IN_SCOPE, convertToList(idList)); + } + + /** + * NotInScope(not in (1, 2)). And NullIgnored, NullElementIgnored, SeveralRegistered. + * @param idList The collection of id as notInScope. + */ + public void setId_NotInScope(Collection idList) { + registerId(ConditionKey.CK_NOT_IN_SCOPE, convertToList(idList)); + } + + /** + * InScopeSubQuery{in (select xxx.ID from ANNOUNCEMENT_BODY where ...)}. + * @param announcementBodyCBquery The sub-query of Id_InScopeSubQuery_AnnouncementBodyList using inScopeSubQuery. (NotNull) + */ + public void setId_InScopeSubQuery_AnnouncementBodyList( + jp.sf.pal.announcement.db.cbean.cq.AnnouncementBodyCQ announcementBodyCBquery) { + assertObjectNotNull("announcementBodyCBquery", announcementBodyCBquery); + final String subQueryPropertyName = keepId_InScopeSubQuery_AnnouncementBodyList(announcementBodyCBquery);// for saving query-value. + registerInScopeSubQuery(announcementBodyCBquery, "ID", "ID", + subQueryPropertyName); + } + + abstract public String keepId_InScopeSubQuery_AnnouncementBodyList( + jp.sf.pal.announcement.db.cbean.cq.AnnouncementBodyCQ subQuery); + + /** + * ExistsSubQuery{exists (select xxx.ID from ANNOUNCEMENT_BODY where ...)}. + * @param announcementBodyCBquery The sub-query of Id_ExistsSubQuery_AnnouncementBodyList using existsSubQuery. (NotNull) + */ + public void setId_ExistsSubQuery_AnnouncementBodyList( + jp.sf.pal.announcement.db.cbean.cq.AnnouncementBodyCQ announcementBodyCBquery) { + assertObjectNotNull("announcementBodyCBquery", announcementBodyCBquery); + final String subQueryPropertyName = keepId_ExistsSubQuery_AnnouncementBodyList(announcementBodyCBquery);// for saving query-value. + registerExistsSubQuery(announcementBodyCBquery, "ID", "ID", + subQueryPropertyName); + } + + abstract public String keepId_ExistsSubQuery_AnnouncementBodyList( + jp.sf.pal.announcement.db.cbean.cq.AnnouncementBodyCQ subQuery); + + protected void registerId(ConditionKey key, Object value) { + registerQuery(key, value, getCValueId(), "ID", "Id", "id"); + } + + protected void registerInlineId(ConditionKey key, Object value) { + registerInlineQuery(key, value, getCValueId(), "ID", "Id", "id"); + } + + abstract protected ConditionValue getCValueId(); + + /** + * Equal(=). And NullOrEmptyIgnored, OnceRegistered. {varchar(20) : NotNull} + * @param scope The value of scope as equal. + */ + public void setScope_Equal(String scope) { + registerScope(ConditionKey.CK_EQUAL, filterRemoveEmptyString(scope)); + } + + /** + * NotEqual(!=). And NullOrEmptyIgnored, OnceRegistered. + * @param scope The value of scope as notEqual. + */ + public void setScope_NotEqual(String scope) { + registerScope(ConditionKey.CK_NOT_EQUAL, filterRemoveEmptyString(scope)); + } + + /** + * GreaterThan(>). And NullOrEmptyIgnored, OnceRegistered. + * @param scope The value of scope as greaterThan. + */ + public void setScope_GreaterThan(String scope) { + registerScope(ConditionKey.CK_GREATER_THAN, + filterRemoveEmptyString(scope)); + } + + /** + * LessThan(<). And NullOrEmptyIgnored, OnceRegistered. + * @param scope The value of scope as lessThan. + */ + public void setScope_LessThan(String scope) { + registerScope(ConditionKey.CK_LESS_THAN, filterRemoveEmptyString(scope)); + } + + /** + * GreaterEqual(>=). And NullOrEmptyIgnored, OnceRegistered. + * @param scope The value of scope as greaterEqual. + */ + public void setScope_GreaterEqual(String scope) { + registerScope(ConditionKey.CK_GREATER_EQUAL, + filterRemoveEmptyString(scope)); + } + + /** + * LessEqual(<=). And NullOrEmptyIgnored, OnceRegistered. + * @param scope The value of scope as lessEqual. + */ + public void setScope_LessEqual(String scope) { + registerScope(ConditionKey.CK_LESS_EQUAL, + filterRemoveEmptyString(scope)); + } + + /** + * PrefixSearch(like 'xxx%'). And NullOrEmptyIgnored, OnceRegistered. + * @param scope The value of scope as prefixSearch. + */ + public void setScope_PrefixSearch(String scope) { + registerScope(ConditionKey.CK_PREFIX_SEARCH, + filterRemoveEmptyString(scope)); + } + + /** + * LikeSearch(like 'xxx%' escape ...). And NullOrEmptyIgnored, SeveralRegistered. + * @param scope The value of scope as likeSearch. + * @param likeSearchOption The option of like-search. (NotNull) + */ + public void setScope_LikeSearch( + String scope, + jp.sf.pal.announcement.db.allcommon.cbean.coption.LikeSearchOption likeSearchOption) { + registerLikeSearchQuery(ConditionKey.CK_LIKE_SEARCH, + filterRemoveEmptyString(scope), getCValueScope(), "SCOPE", + "Scope", "scope", likeSearchOption); + } + + /** + * InScope(in ('a', 'b')). And NullOrEmptyIgnored, NullOrEmptyElementIgnored, SeveralRegistered. + * @param scopeList The collection of scope as inScope. + */ + public void setScope_InScope(Collection scopeList) { + registerScope(ConditionKey.CK_IN_SCOPE, convertToList(scopeList)); + } + + /** + * InScope(in ('a', 'b')). And NullOrEmptyIgnored, NullOrEmptyElementIgnored, SeveralRegistered. + * @param scope The collection of scope as inScope. + * @param inScopeOption The option of in-scope. (NotNull) + */ + public void setScope_InScope( + String scope, + jp.sf.pal.announcement.db.allcommon.cbean.coption.InScopeOption inScopeOption) { + registerInScopeQuery(ConditionKey.CK_IN_SCOPE, + filterRemoveEmptyString(scope), getCValueScope(), "SCOPE", + "Scope", "scope", inScopeOption); + } + + /** + * NotInScope(not in ('a', 'b')). And NullOrEmptyIgnored, NullOrEmptyElementIgnored, SeveralRegistered. + * @param scopeList The collection of scope as notInScope. + */ + public void setScope_NotInScope(Collection scopeList) { + registerScope(ConditionKey.CK_NOT_IN_SCOPE, convertToList(scopeList)); + } + + protected void registerScope(ConditionKey key, Object value) { + registerQuery(key, value, getCValueScope(), "SCOPE", "Scope", "scope"); + } + + protected void registerInlineScope(ConditionKey key, Object value) { + registerInlineQuery(key, value, getCValueScope(), "SCOPE", "Scope", + "scope"); + } + + abstract protected ConditionValue getCValueScope(); + + /** + * Equal(=). And NullOrEmptyIgnored, OnceRegistered. {varchar(100)} + * @param role The value of role as equal. + */ + public void setRole_Equal(String role) { + registerRole(ConditionKey.CK_EQUAL, filterRemoveEmptyString(role)); + } + + /** + * NotEqual(!=). And NullOrEmptyIgnored, OnceRegistered. + * @param role The value of role as notEqual. + */ + public void setRole_NotEqual(String role) { + registerRole(ConditionKey.CK_NOT_EQUAL, filterRemoveEmptyString(role)); + } + + /** + * GreaterThan(>). And NullOrEmptyIgnored, OnceRegistered. + * @param role The value of role as greaterThan. + */ + public void setRole_GreaterThan(String role) { + registerRole(ConditionKey.CK_GREATER_THAN, + filterRemoveEmptyString(role)); + } + + /** + * LessThan(<). And NullOrEmptyIgnored, OnceRegistered. + * @param role The value of role as lessThan. + */ + public void setRole_LessThan(String role) { + registerRole(ConditionKey.CK_LESS_THAN, filterRemoveEmptyString(role)); + } + + /** + * GreaterEqual(>=). And NullOrEmptyIgnored, OnceRegistered. + * @param role The value of role as greaterEqual. + */ + public void setRole_GreaterEqual(String role) { + registerRole(ConditionKey.CK_GREATER_EQUAL, + filterRemoveEmptyString(role)); + } + + /** + * LessEqual(<=). And NullOrEmptyIgnored, OnceRegistered. + * @param role The value of role as lessEqual. + */ + public void setRole_LessEqual(String role) { + registerRole(ConditionKey.CK_LESS_EQUAL, filterRemoveEmptyString(role)); + } + + /** + * PrefixSearch(like 'xxx%'). And NullOrEmptyIgnored, OnceRegistered. + * @param role The value of role as prefixSearch. + */ + public void setRole_PrefixSearch(String role) { + registerRole(ConditionKey.CK_PREFIX_SEARCH, + filterRemoveEmptyString(role)); + } + + /** + * LikeSearch(like 'xxx%' escape ...). And NullOrEmptyIgnored, SeveralRegistered. + * @param role The value of role as likeSearch. + * @param likeSearchOption The option of like-search. (NotNull) + */ + public void setRole_LikeSearch( + String role, + jp.sf.pal.announcement.db.allcommon.cbean.coption.LikeSearchOption likeSearchOption) { + registerLikeSearchQuery(ConditionKey.CK_LIKE_SEARCH, + filterRemoveEmptyString(role), getCValueRole(), "ROLE", "Role", + "role", likeSearchOption); + } + + /** + * InScope(in ('a', 'b')). And NullOrEmptyIgnored, NullOrEmptyElementIgnored, SeveralRegistered. + * @param roleList The collection of role as inScope. + */ + public void setRole_InScope(Collection roleList) { + registerRole(ConditionKey.CK_IN_SCOPE, convertToList(roleList)); + } + + /** + * InScope(in ('a', 'b')). And NullOrEmptyIgnored, NullOrEmptyElementIgnored, SeveralRegistered. + * @param role The collection of role as inScope. + * @param inScopeOption The option of in-scope. (NotNull) + */ + public void setRole_InScope( + String role, + jp.sf.pal.announcement.db.allcommon.cbean.coption.InScopeOption inScopeOption) { + registerInScopeQuery(ConditionKey.CK_IN_SCOPE, + filterRemoveEmptyString(role), getCValueRole(), "ROLE", "Role", + "role", inScopeOption); + } + + /** + * NotInScope(not in ('a', 'b')). And NullOrEmptyIgnored, NullOrEmptyElementIgnored, SeveralRegistered. + * @param roleList The collection of role as notInScope. + */ + public void setRole_NotInScope(Collection roleList) { + registerRole(ConditionKey.CK_NOT_IN_SCOPE, convertToList(roleList)); + } + + /** + * IsNull(is null). And OnceRegistered. {varchar(100)} + */ + public void setRole_IsNull() { + registerRole(ConditionKey.CK_IS_NULL, DUMMY_OBJECT); + } + + /** + * IsNotNull(is not null). And OnceRegistered. {varchar(100)} + */ + public void setRole_IsNotNull() { + registerRole(ConditionKey.CK_IS_NOT_NULL, DUMMY_OBJECT); + } + + protected void registerRole(ConditionKey key, Object value) { + registerQuery(key, value, getCValueRole(), "ROLE", "Role", "role"); + } + + protected void registerInlineRole(ConditionKey key, Object value) { + registerInlineQuery(key, value, getCValueRole(), "ROLE", "Role", "role"); + } + + abstract protected ConditionValue getCValueRole(); + + /** + * Equal(=). And NullIgnored, OnceRegistered. {datetime} + * @param startDate The value of startDate as equal. + */ + public void setStartDate_Equal(java.sql.Timestamp startDate) { + registerStartDate(ConditionKey.CK_EQUAL, startDate); + } + + /** + * NotEqual(!=). And NullIgnored, OnceRegistered. + * @param startDate The value of startDate as notEqual. + */ + public void setStartDate_NotEqual(java.sql.Timestamp startDate) { + registerStartDate(ConditionKey.CK_NOT_EQUAL, startDate); + } + + /** + * GreaterThan(>). And NullIgnored, OnceRegistered. + * @param startDate The value of startDate as greaterThan. + */ + public void setStartDate_GreaterThan(java.sql.Timestamp startDate) { + registerStartDate(ConditionKey.CK_GREATER_THAN, startDate); + } + + /** + * LessThan(>). And NullIgnored, OnceRegistered. + * @param startDate The value of startDate as lessThan. + */ + public void setStartDate_LessThan(java.sql.Timestamp startDate) { + registerStartDate(ConditionKey.CK_LESS_THAN, startDate); + } + + /** + * GreaterEqual(>). And NullIgnored, OnceRegistered. + * @param startDate The value of startDate as greaterEqual. + */ + public void setStartDate_GreaterEqual(java.sql.Timestamp startDate) { + registerStartDate(ConditionKey.CK_GREATER_EQUAL, startDate); + } + + /** + * LessEqual(>). And NullIgnored, OnceRegistered. + * @param startDate The value of startDate as lessEqual. + */ + public void setStartDate_LessEqual(java.sql.Timestamp startDate) { + registerStartDate(ConditionKey.CK_LESS_EQUAL, startDate); + } + + /** + * FromTo($fromDate <= COLUMN_NAME <= $toDate). And NullIgnored, OnceRegistered. {datetime} + * @param fromDate The from-date of startDate. (Nullable) + * @param toDate The to-date of startDate. (Nullable) + * @param fromToOption The option of from-to. (NotNull) + */ + public void setStartDate_FromTo( + java.util.Date fromDate, + java.util.Date toDate, + jp.sf.pal.announcement.db.allcommon.cbean.coption.FromToOption fromToOption) { + registerFromToQuery((fromDate != null ? new java.sql.Timestamp(fromDate + .getTime()) : null), (toDate != null ? new java.sql.Timestamp( + toDate.getTime()) : null), getCValueStartDate(), "START_DATE", + "StartDate", "startDate", fromToOption); + } + + /** + * FromTo($fromDate <= COLUMN_NAME < $toDate + 1). And NullIgnored, OnceRegistered. {datetime} + * @param fromDate The from-date of startDate. (Nullable) + * @param toDate The to-date of startDate. (Nullable) + */ + public void setStartDate_DateFromTo(java.util.Date fromDate, + java.util.Date toDate) { + setStartDate_FromTo( + fromDate, + toDate, + new jp.sf.pal.announcement.db.allcommon.cbean.coption.DateFromToOption()); + } + + /** + * IsNull(is null). And OnceRegistered. {datetime} + */ + public void setStartDate_IsNull() { + registerStartDate(ConditionKey.CK_IS_NULL, DUMMY_OBJECT); + } + + /** + * IsNotNull(is not null). And OnceRegistered. {datetime} + */ + public void setStartDate_IsNotNull() { + registerStartDate(ConditionKey.CK_IS_NOT_NULL, DUMMY_OBJECT); + } + + protected void registerStartDate(ConditionKey key, Object value) { + registerQuery(key, value, getCValueStartDate(), "START_DATE", + "StartDate", "startDate"); + } + + protected void registerInlineStartDate(ConditionKey key, Object value) { + registerInlineQuery(key, value, getCValueStartDate(), "START_DATE", + "StartDate", "startDate"); + } + + abstract protected ConditionValue getCValueStartDate(); + + /** + * Equal(=). And NullIgnored, OnceRegistered. {datetime} + * @param endDate The value of endDate as equal. + */ + public void setEndDate_Equal(java.sql.Timestamp endDate) { + registerEndDate(ConditionKey.CK_EQUAL, endDate); + } + + /** + * NotEqual(!=). And NullIgnored, OnceRegistered. + * @param endDate The value of endDate as notEqual. + */ + public void setEndDate_NotEqual(java.sql.Timestamp endDate) { + registerEndDate(ConditionKey.CK_NOT_EQUAL, endDate); + } + + /** + * GreaterThan(>). And NullIgnored, OnceRegistered. + * @param endDate The value of endDate as greaterThan. + */ + public void setEndDate_GreaterThan(java.sql.Timestamp endDate) { + registerEndDate(ConditionKey.CK_GREATER_THAN, endDate); + } + + /** + * LessThan(>). And NullIgnored, OnceRegistered. + * @param endDate The value of endDate as lessThan. + */ + public void setEndDate_LessThan(java.sql.Timestamp endDate) { + registerEndDate(ConditionKey.CK_LESS_THAN, endDate); + } + + /** + * GreaterEqual(>). And NullIgnored, OnceRegistered. + * @param endDate The value of endDate as greaterEqual. + */ + public void setEndDate_GreaterEqual(java.sql.Timestamp endDate) { + registerEndDate(ConditionKey.CK_GREATER_EQUAL, endDate); + } + + /** + * LessEqual(>). And NullIgnored, OnceRegistered. + * @param endDate The value of endDate as lessEqual. + */ + public void setEndDate_LessEqual(java.sql.Timestamp endDate) { + registerEndDate(ConditionKey.CK_LESS_EQUAL, endDate); + } + + /** + * FromTo($fromDate <= COLUMN_NAME <= $toDate). And NullIgnored, OnceRegistered. {datetime} + * @param fromDate The from-date of endDate. (Nullable) + * @param toDate The to-date of endDate. (Nullable) + * @param fromToOption The option of from-to. (NotNull) + */ + public void setEndDate_FromTo( + java.util.Date fromDate, + java.util.Date toDate, + jp.sf.pal.announcement.db.allcommon.cbean.coption.FromToOption fromToOption) { + registerFromToQuery((fromDate != null ? new java.sql.Timestamp(fromDate + .getTime()) : null), (toDate != null ? new java.sql.Timestamp( + toDate.getTime()) : null), getCValueEndDate(), "END_DATE", + "EndDate", "endDate", fromToOption); + } + + /** + * FromTo($fromDate <= COLUMN_NAME < $toDate + 1). And NullIgnored, OnceRegistered. {datetime} + * @param fromDate The from-date of endDate. (Nullable) + * @param toDate The to-date of endDate. (Nullable) + */ + public void setEndDate_DateFromTo(java.util.Date fromDate, + java.util.Date toDate) { + setEndDate_FromTo( + fromDate, + toDate, + new jp.sf.pal.announcement.db.allcommon.cbean.coption.DateFromToOption()); + } + + /** + * IsNull(is null). And OnceRegistered. {datetime} + */ + public void setEndDate_IsNull() { + registerEndDate(ConditionKey.CK_IS_NULL, DUMMY_OBJECT); + } + + /** + * IsNotNull(is not null). And OnceRegistered. {datetime} + */ + public void setEndDate_IsNotNull() { + registerEndDate(ConditionKey.CK_IS_NOT_NULL, DUMMY_OBJECT); + } + + protected void registerEndDate(ConditionKey key, Object value) { + registerQuery(key, value, getCValueEndDate(), "END_DATE", "EndDate", + "endDate"); + } + + protected void registerInlineEndDate(ConditionKey key, Object value) { + registerInlineQuery(key, value, getCValueEndDate(), "END_DATE", + "EndDate", "endDate"); + } + + abstract protected ConditionValue getCValueEndDate(); + + /** + * Equal(=). And NullOrEmptyIgnored, OnceRegistered. {varchar(100) : NotNull} + * @param title The value of title as equal. + */ + public void setTitle_Equal(String title) { + registerTitle(ConditionKey.CK_EQUAL, filterRemoveEmptyString(title)); + } + + /** + * NotEqual(!=). And NullOrEmptyIgnored, OnceRegistered. + * @param title The value of title as notEqual. + */ + public void setTitle_NotEqual(String title) { + registerTitle(ConditionKey.CK_NOT_EQUAL, filterRemoveEmptyString(title)); + } + + /** + * GreaterThan(>). And NullOrEmptyIgnored, OnceRegistered. + * @param title The value of title as greaterThan. + */ + public void setTitle_GreaterThan(String title) { + registerTitle(ConditionKey.CK_GREATER_THAN, + filterRemoveEmptyString(title)); + } + + /** + * LessThan(<). And NullOrEmptyIgnored, OnceRegistered. + * @param title The value of title as lessThan. + */ + public void setTitle_LessThan(String title) { + registerTitle(ConditionKey.CK_LESS_THAN, filterRemoveEmptyString(title)); + } + + /** + * GreaterEqual(>=). And NullOrEmptyIgnored, OnceRegistered. + * @param title The value of title as greaterEqual. + */ + public void setTitle_GreaterEqual(String title) { + registerTitle(ConditionKey.CK_GREATER_EQUAL, + filterRemoveEmptyString(title)); + } + + /** + * LessEqual(<=). And NullOrEmptyIgnored, OnceRegistered. + * @param title The value of title as lessEqual. + */ + public void setTitle_LessEqual(String title) { + registerTitle(ConditionKey.CK_LESS_EQUAL, + filterRemoveEmptyString(title)); + } + + /** + * PrefixSearch(like 'xxx%'). And NullOrEmptyIgnored, OnceRegistered. + * @param title The value of title as prefixSearch. + */ + public void setTitle_PrefixSearch(String title) { + registerTitle(ConditionKey.CK_PREFIX_SEARCH, + filterRemoveEmptyString(title)); + } + + /** + * LikeSearch(like 'xxx%' escape ...). And NullOrEmptyIgnored, SeveralRegistered. + * @param title The value of title as likeSearch. + * @param likeSearchOption The option of like-search. (NotNull) + */ + public void setTitle_LikeSearch( + String title, + jp.sf.pal.announcement.db.allcommon.cbean.coption.LikeSearchOption likeSearchOption) { + registerLikeSearchQuery(ConditionKey.CK_LIKE_SEARCH, + filterRemoveEmptyString(title), getCValueTitle(), "TITLE", + "Title", "title", likeSearchOption); + } + + /** + * InScope(in ('a', 'b')). And NullOrEmptyIgnored, NullOrEmptyElementIgnored, SeveralRegistered. + * @param titleList The collection of title as inScope. + */ + public void setTitle_InScope(Collection titleList) { + registerTitle(ConditionKey.CK_IN_SCOPE, convertToList(titleList)); + } + + /** + * InScope(in ('a', 'b')). And NullOrEmptyIgnored, NullOrEmptyElementIgnored, SeveralRegistered. + * @param title The collection of title as inScope. + * @param inScopeOption The option of in-scope. (NotNull) + */ + public void setTitle_InScope( + String title, + jp.sf.pal.announcement.db.allcommon.cbean.coption.InScopeOption inScopeOption) { + registerInScopeQuery(ConditionKey.CK_IN_SCOPE, + filterRemoveEmptyString(title), getCValueTitle(), "TITLE", + "Title", "title", inScopeOption); + } + + /** + * NotInScope(not in ('a', 'b')). And NullOrEmptyIgnored, NullOrEmptyElementIgnored, SeveralRegistered. + * @param titleList The collection of title as notInScope. + */ + public void setTitle_NotInScope(Collection titleList) { + registerTitle(ConditionKey.CK_NOT_IN_SCOPE, convertToList(titleList)); + } + + protected void registerTitle(ConditionKey key, Object value) { + registerQuery(key, value, getCValueTitle(), "TITLE", "Title", "title"); + } + + protected void registerInlineTitle(ConditionKey key, Object value) { + registerInlineQuery(key, value, getCValueTitle(), "TITLE", "Title", + "title"); + } + + abstract protected ConditionValue getCValueTitle(); + + /** + * Equal(=). And NullIgnored, OnceRegistered. {int : NotNull} + * @param sortOrder The value of sortOrder as equal. + */ + public void setSortOrder_Equal(Integer sortOrder) { + registerSortOrder(ConditionKey.CK_EQUAL, sortOrder); + } + + /** + * NotEqual(!=). And NullIgnored, OnceRegistered. + * @param sortOrder The value of sortOrder as notEqual. + */ + public void setSortOrder_NotEqual(Integer sortOrder) { + registerSortOrder(ConditionKey.CK_NOT_EQUAL, sortOrder); + } + + /** + * GreaterThan(>). And NullIgnored, OnceRegistered. + * @param sortOrder The value of sortOrder as greaterThan. + */ + public void setSortOrder_GreaterThan(Integer sortOrder) { + registerSortOrder(ConditionKey.CK_GREATER_THAN, sortOrder); + } + + /** + * LessThan(<). And NullIgnored, OnceRegistered. + * @param sortOrder The value of sortOrder as lessThan. + */ + public void setSortOrder_LessThan(Integer sortOrder) { + registerSortOrder(ConditionKey.CK_LESS_THAN, sortOrder); + } + + /** + * GreaterEqual(>=). And NullIgnored, OnceRegistered. + * @param sortOrder The value of sortOrder as greaterEqual. + */ + public void setSortOrder_GreaterEqual(Integer sortOrder) { + registerSortOrder(ConditionKey.CK_GREATER_EQUAL, sortOrder); + } + + /** + * LessEqual(<=). And NullIgnored, OnceRegistered. + * @param sortOrder The value of sortOrder as lessEqual. + */ + public void setSortOrder_LessEqual(Integer sortOrder) { + registerSortOrder(ConditionKey.CK_LESS_EQUAL, sortOrder); + } + + /** + * InScope(in (1, 2)). And NullIgnored, NullElementIgnored, SeveralRegistered. + * @param sortOrderList The collection of sortOrder as inScope. + */ + public void setSortOrder_InScope(Collection sortOrderList) { + registerSortOrder(ConditionKey.CK_IN_SCOPE, + convertToList(sortOrderList)); + } + + /** + * NotInScope(not in (1, 2)). And NullIgnored, NullElementIgnored, SeveralRegistered. + * @param sortOrderList The collection of sortOrder as notInScope. + */ + public void setSortOrder_NotInScope(Collection sortOrderList) { + registerSortOrder(ConditionKey.CK_NOT_IN_SCOPE, + convertToList(sortOrderList)); + } + + protected void registerSortOrder(ConditionKey key, Object value) { + registerQuery(key, value, getCValueSortOrder(), "SORT_ORDER", + "SortOrder", "sortOrder"); + } + + protected void registerInlineSortOrder(ConditionKey key, Object value) { + registerInlineQuery(key, value, getCValueSortOrder(), "SORT_ORDER", + "SortOrder", "sortOrder"); + } + + abstract protected ConditionValue getCValueSortOrder(); + + /** + * Equal(=). And NullIgnored, OnceRegistered. {timestamp : NotNull : Default=[CURRENT_TIMESTAMP]} + * @param timestamp The value of timestamp as equal. + */ + public void setTimestamp_Equal(java.sql.Timestamp timestamp) { + registerTimestamp(ConditionKey.CK_EQUAL, timestamp); + } + + /** + * NotEqual(!=). And NullIgnored, OnceRegistered. + * @param timestamp The value of timestamp as notEqual. + */ + public void setTimestamp_NotEqual(java.sql.Timestamp timestamp) { + registerTimestamp(ConditionKey.CK_NOT_EQUAL, timestamp); + } + + /** + * GreaterThan(>). And NullIgnored, OnceRegistered. + * @param timestamp The value of timestamp as greaterThan. + */ + public void setTimestamp_GreaterThan(java.sql.Timestamp timestamp) { + registerTimestamp(ConditionKey.CK_GREATER_THAN, timestamp); + } + + /** + * LessThan(>). And NullIgnored, OnceRegistered. + * @param timestamp The value of timestamp as lessThan. + */ + public void setTimestamp_LessThan(java.sql.Timestamp timestamp) { + registerTimestamp(ConditionKey.CK_LESS_THAN, timestamp); + } + + /** + * GreaterEqual(>). And NullIgnored, OnceRegistered. + * @param timestamp The value of timestamp as greaterEqual. + */ + public void setTimestamp_GreaterEqual(java.sql.Timestamp timestamp) { + registerTimestamp(ConditionKey.CK_GREATER_EQUAL, timestamp); + } + + /** + * LessEqual(>). And NullIgnored, OnceRegistered. + * @param timestamp The value of timestamp as lessEqual. + */ + public void setTimestamp_LessEqual(java.sql.Timestamp timestamp) { + registerTimestamp(ConditionKey.CK_LESS_EQUAL, timestamp); + } + + /** + * FromTo($fromDate <= COLUMN_NAME <= $toDate). And NullIgnored, OnceRegistered. {timestamp : NotNull : Default=[CURRENT_TIMESTAMP]} + * @param fromDate The from-date of timestamp. (Nullable) + * @param toDate The to-date of timestamp. (Nullable) + * @param fromToOption The option of from-to. (NotNull) + */ + public void setTimestamp_FromTo( + java.util.Date fromDate, + java.util.Date toDate, + jp.sf.pal.announcement.db.allcommon.cbean.coption.FromToOption fromToOption) { + registerFromToQuery((fromDate != null ? new java.sql.Timestamp(fromDate + .getTime()) : null), (toDate != null ? new java.sql.Timestamp( + toDate.getTime()) : null), getCValueTimestamp(), "TIMESTAMP", + "Timestamp", "timestamp", fromToOption); + } + + /** + * FromTo($fromDate <= COLUMN_NAME < $toDate + 1). And NullIgnored, OnceRegistered. {timestamp : NotNull : Default=[CURRENT_TIMESTAMP]} + * @param fromDate The from-date of timestamp. (Nullable) + * @param toDate The to-date of timestamp. (Nullable) + */ + public void setTimestamp_DateFromTo(java.util.Date fromDate, + java.util.Date toDate) { + setTimestamp_FromTo( + fromDate, + toDate, + new jp.sf.pal.announcement.db.allcommon.cbean.coption.DateFromToOption()); + } + + protected void registerTimestamp(ConditionKey key, Object value) { + registerQuery(key, value, getCValueTimestamp(), "TIMESTAMP", + "Timestamp", "timestamp"); + } + + protected void registerInlineTimestamp(ConditionKey key, Object value) { + registerInlineQuery(key, value, getCValueTimestamp(), "TIMESTAMP", + "Timestamp", "timestamp"); + } + + abstract protected ConditionValue getCValueTimestamp(); +} Property changes on: announcement/trunk/src/main/java/jp/sf/pal/announcement/db/cbean/cq/bs/AbstractBsAnnouncementCQ.java ___________________________________________________________________ Name: svn:eol-style + native Added: announcement/trunk/src/main/java/jp/sf/pal/announcement/db/cbean/cq/bs/BsAnnouncementBodyCQ.java =================================================================== --- announcement/trunk/src/main/java/jp/sf/pal/announcement/db/cbean/cq/bs/BsAnnouncementBodyCQ.java (rev 0) +++ announcement/trunk/src/main/java/jp/sf/pal/announcement/db/cbean/cq/bs/BsAnnouncementBodyCQ.java 2008-06-30 02:54:27 UTC (rev 1002) @@ -0,0 +1,224 @@ +package jp.sf.pal.announcement.db.cbean.cq.bs; + +import jp.sf.pal.announcement.db.allcommon.cbean.ConditionQuery; +import jp.sf.pal.announcement.db.allcommon.cbean.cvalue.ConditionValue; +import jp.sf.pal.announcement.db.allcommon.cbean.sqlclause.SqlClause; +import jp.sf.pal.announcement.db.cbean.cq.ciq.AnnouncementBodyCIQ; + +/** + * The base condition-query of ANNOUNCEMENT_BODY. + * @author DBFlute(AutoGenerator) + */ + @ SuppressWarnings("unchecked") +public class BsAnnouncementBodyCQ extends AbstractBsAnnouncementBodyCQ { + + // =================================================================================== + // Attribute + // ========= + protected AnnouncementBodyCIQ _inlineQuery; + + // =================================================================================== + // Constructor + // =========== + public BsAnnouncementBodyCQ(ConditionQuery childQuery, SqlClause sqlClause, + String aliasName, int nestLevel) { + super(childQuery, sqlClause, aliasName, nestLevel); + } + + // =================================================================================== + // Inline + // ====== + /** + * Prepare inline query. + * @return Inline query. (NotNull) + */ + public AnnouncementBodyCIQ inline() { + if (_inlineQuery == null) { + _inlineQuery = new AnnouncementBodyCIQ(getChildQuery(), + getSqlClause(), getAliasName(), getNestLevel(), this); + } + _inlineQuery.xsetOnClauseInline(false); + return _inlineQuery; + } + + /** + * Prepare on-clause query. + * @return On-clause query. (NotNull) + */ + public AnnouncementBodyCIQ on() { + if (isBaseQuery(this)) { + throw new UnsupportedOperationException( + "Unsupported onClause of Base Table!"); + } + AnnouncementBodyCIQ inlineQuery = inline(); + inlineQuery.xsetOnClauseInline(true); + return inlineQuery; + } + + // =================================================================================== + // IncludeAsMine + // ============= + // public void includeAsMine_Xxx() + // Include select-column of Xxx as mine. + // Alias name is property name of this column. + // Be careful to whether your table have the same column. + // + // public void includeAsMine_Xxx(String aliasName) { + // Your aliasName should not contain comma. + // + /** @deprecated Please Use includeAsMine_Id(String aliasName).*/ + public void includeAsMine_Id() { + registerIncludedSelectColumn("Id", getRealColumnName("ID")); + } + + public void includeAsMine_Id(String aliasName) { + registerIncludedSelectColumn(aliasName, getRealColumnName("ID")); + } + + /** @deprecated Please Use includeAsMine_Content(String aliasName).*/ + public void includeAsMine_Content() { + registerIncludedSelectColumn("Content", getRealColumnName("CONTENT")); + } + + public void includeAsMine_Content(String aliasName) { + registerIncludedSelectColumn(aliasName, getRealColumnName("CONTENT")); + } + + // =================================================================================== + // Query + // ===== + + protected ConditionValue _id; + + public ConditionValue getId() { + if (_id == null) { + _id = new ConditionValue(); + } + return _id; + } + + protected ConditionValue getCValueId() { + return getId(); + } + + protected java.util.Map _id_InScopeSubQuery_AnnouncementMap; + + public java.util.Map getId_InScopeSubQuery_Announcement() { + return _id_InScopeSubQuery_AnnouncementMap; + } + + public String keepId_InScopeSubQuery_Announcement( + jp.sf.pal.announcement.db.cbean.cq.AnnouncementCQ subQuery) { + if (_id_InScopeSubQuery_AnnouncementMap == null) { + _id_InScopeSubQuery_AnnouncementMap = new java.util.LinkedHashMap(); + } + final String key = "subQueryMapKey" + + (_id_InScopeSubQuery_AnnouncementMap.size() + 1); + _id_InScopeSubQuery_AnnouncementMap.put(key, subQuery); + return "id_InScopeSubQuery_Announcement." + key; + } + + public BsAnnouncementBodyCQ addOrderBy_Id_Asc() { + registerOrderBy("ID", true); + return this; + } + + public BsAnnouncementBodyCQ addOrderBy_Id_Desc() { + registerOrderBy("ID", false); + return this; + } + + protected ConditionValue _content; + + public ConditionValue getContent() { + if (_content == null) { + _content = new ConditionValue(); + } + return _content; + } + + protected ConditionValue getCValueContent() { + return getContent(); + } + + public BsAnnouncementBodyCQ addOrderBy_Content_Asc() { + registerOrderBy("CONTENT", true); + return this; + } + + public BsAnnouncementBodyCQ addOrderBy_Content_Desc() { + registerOrderBy("CONTENT", false); + return this; + } + + // =================================================================================== + // Union Query + // =========== + protected void reflectRelationOnUnionQuery(ConditionQuery baseQueryAsSuper, + ConditionQuery unionQueryAsSuper) { + final jp.sf.pal.announcement.db.cbean.cq.AnnouncementBodyCQ baseQuery = (jp.sf.pal.announcement.db.cbean.cq.AnnouncementBodyCQ) baseQueryAsSuper; + final jp.sf.pal.announcement.db.cbean.cq.AnnouncementBodyCQ unionQuery = (jp.sf.pal.announcement.db.cbean.cq.AnnouncementBodyCQ) unionQueryAsSuper; + if (baseQuery.hasConditionQueryAnnouncement()) { + unionQuery.queryAnnouncement().reflectRelationOnUnionQuery( + baseQuery.queryAnnouncement(), + unionQuery.queryAnnouncement()); + } + + } + + // =================================================================================== + // Foreign Query + // ============= + + // /* * * * * * * * * * * * * * * * * * * * * * * + // ForeignTable = [ANNOUNCEMENT(TABLE)] + // ForeignProperty = [announcement] + // * * * * * * * * */ + + /** + * Query for announcement. + * @return Instance of jp.sf.pal.announcement.db.cbean.cq.AnnouncementCQ as announcement. (NotNull) + */ + public jp.sf.pal.announcement.db.cbean.cq.AnnouncementCQ queryAnnouncement() { + return getConditionQueryAnnouncement(); + } + + protected jp.sf.pal.announcement.db.cbean.cq.AnnouncementCQ _conditionQueryAnnouncement; + + public jp.sf.pal.announcement.db.cbean.cq.AnnouncementCQ getConditionQueryAnnouncement() { + if (_conditionQueryAnnouncement == null) { + _conditionQueryAnnouncement = createQueryAnnouncement(); + setupOuterJoin_Announcement(); + } + return _conditionQueryAnnouncement; + } + + protected void setupOuterJoin_Announcement() { + final java.util.Map joinOnMap = new java.util.LinkedHashMap(); + joinOnMap.put(getRealColumnName("ID"), getConditionQueryAnnouncement() + .getRealColumnName("ID")); + getSqlClause().registerOuterJoin( + getConditionQueryAnnouncement().getTableSqlName(), + getConditionQueryAnnouncement().getRealAliasName(), joinOnMap); + } + + protected jp.sf.pal.announcement.db.cbean.cq.AnnouncementCQ createQueryAnnouncement() { + final String nextRelationPath = resolveNextRelationPathAnnouncement(); + final String resolvedAliasName = resolveJoinAliasName(nextRelationPath, + getNextNestLevel()); + final jp.sf.pal.announcement.db.cbean.cq.AnnouncementCQ cq = new jp.sf.pal.announcement.db.cbean.cq.AnnouncementCQ( + this, getSqlClause(), resolvedAliasName, getNextNestLevel()); + cq.xsetForeignPropertyName("announcement"); + cq.xsetRelationPath(nextRelationPath); + return cq; + } + + protected String resolveNextRelationPathAnnouncement() { + return resolveNextRelationPath("ANNOUNCEMENT_BODY", "announcement"); + } + + public boolean hasConditionQueryAnnouncement() { + return _conditionQueryAnnouncement != null; + } + +} Property changes on: announcement/trunk/src/main/java/jp/sf/pal/announcement/db/cbean/cq/bs/BsAnnouncementBodyCQ.java ___________________________________________________________________ Name: svn:eol-style + native Added: announcement/trunk/src/main/java/jp/sf/pal/announcement/db/cbean/cq/bs/BsAnnouncementCQ.java =================================================================== --- announcement/trunk/src/main/java/jp/sf/pal/announcement/db/cbean/cq/bs/BsAnnouncementCQ.java (rev 0) +++ announcement/trunk/src/main/java/jp/sf/pal/announcement/db/cbean/cq/bs/BsAnnouncementCQ.java 2008-06-30 02:54:27 UTC (rev 1002) @@ -0,0 +1,438 @@ +package jp.sf.pal.announcement.db.cbean.cq.bs; + +import jp.sf.pal.announcement.db.allcommon.cbean.ConditionQuery; +import jp.sf.pal.announcement.db.allcommon.cbean.cvalue.ConditionValue; +import jp.sf.pal.announcement.db.allcommon.cbean.sqlclause.SqlClause; +import jp.sf.pal.announcement.db.cbean.cq.ciq.AnnouncementCIQ; + +/** + * The base condition-query of ANNOUNCEMENT. + * @author DBFlute(AutoGenerator) + */ + @ SuppressWarnings("unchecked") +public class BsAnnouncementCQ extends AbstractBsAnnouncementCQ { + + // =================================================================================== + // Attribute + // ========= + protected AnnouncementCIQ _inlineQuery; + + // =================================================================================== + // Constructor + // =========== + public BsAnnouncementCQ(ConditionQuery childQuery, SqlClause sqlClause, + String aliasName, int nestLevel) { + super(childQuery, sqlClause, aliasName, nestLevel); + } + + // =================================================================================== + // Inline + // ====== + /** + * Prepare inline query. + * @return Inline query. (NotNull) + */ + public AnnouncementCIQ inline() { + if (_inlineQuery == null) { + _inlineQuery = new AnnouncementCIQ(getChildQuery(), getSqlClause(), + getAliasName(), getNestLevel(), this); + } + _inlineQuery.xsetOnClauseInline(false); + return _inlineQuery; + } + + /** + * Prepare on-clause query. + * @return On-clause query. (NotNull) + */ + public AnnouncementCIQ on() { + if (isBaseQuery(this)) { + throw new UnsupportedOperationException( + "Unsupported onClause of Base Table!"); + } + AnnouncementCIQ inlineQuery = inline(); + inlineQuery.xsetOnClauseInline(true); + return inlineQuery; + } + + // =================================================================================== + // IncludeAsMine + // ============= + // public void includeAsMine_Xxx() + // Include select-column of Xxx as mine. + // Alias name is property name of this column. + // Be careful to whether your table have the same column. + // + // public void includeAsMine_Xxx(String aliasName) { + // Your aliasName should not contain comma. + // + /** @deprecated Please Use includeAsMine_Id(String aliasName).*/ + public void includeAsMine_Id() { + registerIncludedSelectColumn("Id", getRealColumnName("ID")); + } + + public void includeAsMine_Id(String aliasName) { + registerIncludedSelectColumn(aliasName, getRealColumnName("ID")); + } + + /** @deprecated Please Use includeAsMine_Scope(String aliasName).*/ + public void includeAsMine_Scope() { + registerIncludedSelectColumn("Scope", getRealColumnName("SCOPE")); + } + + public void includeAsMine_Scope(String aliasName) { + registerIncludedSelectColumn(aliasName, getRealColumnName("SCOPE")); + } + + /** @deprecated Please Use includeAsMine_Role(String aliasName).*/ + public void includeAsMine_Role() { + registerIncludedSelectColumn("Role", getRealColumnName("ROLE")); + } + + public void includeAsMine_Role(String aliasName) { + registerIncludedSelectColumn(aliasName, getRealColumnName("ROLE")); + } + + /** @deprecated Please Use includeAsMine_StartDate(String aliasName).*/ + public void includeAsMine_StartDate() { + registerIncludedSelectColumn("StartDate", + getRealColumnName("START_DATE")); + } + + public void includeAsMine_StartDate(String aliasName) { + registerIncludedSelectColumn(aliasName, getRealColumnName("START_DATE")); + } + + /** @deprecated Please Use includeAsMine_EndDate(String aliasName).*/ + public void includeAsMine_EndDate() { + registerIncludedSelectColumn("EndDate", getRealColumnName("END_DATE")); + } + + public void includeAsMine_EndDate(String aliasName) { + registerIncludedSelectColumn(aliasName, getRealColumnName("END_DATE")); + } + + /** @deprecated Please Use includeAsMine_Title(String aliasName).*/ + public void includeAsMine_Title() { + registerIncludedSelectColumn("Title", getRealColumnName("TITLE")); + } + + public void includeAsMine_Title(String aliasName) { + registerIncludedSelectColumn(aliasName, getRealColumnName("TITLE")); + } + + /** @deprecated Please Use includeAsMine_SortOrder(String aliasName).*/ + public void includeAsMine_SortOrder() { + registerIncludedSelectColumn("SortOrder", + getRealColumnName("SORT_ORDER")); + } + + public void includeAsMine_SortOrder(String aliasName) { + registerIncludedSelectColumn(aliasName, getRealColumnName("SORT_ORDER")); + } + + /** @deprecated Please Use includeAsMine_Timestamp(String aliasName).*/ + public void includeAsMine_Timestamp() { + registerIncludedSelectColumn("Timestamp", + getRealColumnName("TIMESTAMP")); + } + + public void includeAsMine_Timestamp(String aliasName) { + registerIncludedSelectColumn(aliasName, getRealColumnName("TIMESTAMP")); + } + + // =================================================================================== + // Query + // ===== + + protected ConditionValue _id; + + public ConditionValue getId() { + if (_id == null) { + _id = new ConditionValue(); + } + return _id; + } + + protected ConditionValue getCValueId() { + return getId(); + } + + protected java.util.Map _id_InScopeSubQuery_AnnouncementBodyListMap; + + public java.util.Map getId_InScopeSubQuery_AnnouncementBodyList() { + return _id_InScopeSubQuery_AnnouncementBodyListMap; + } + + public String keepId_InScopeSubQuery_AnnouncementBodyList( + jp.sf.pal.announcement.db.cbean.cq.AnnouncementBodyCQ subQuery) { + if (_id_InScopeSubQuery_AnnouncementBodyListMap == null) { + _id_InScopeSubQuery_AnnouncementBodyListMap = new java.util.LinkedHashMap(); + } + final String key = "subQueryMapKey" + + (_id_InScopeSubQuery_AnnouncementBodyListMap.size() + 1); + _id_InScopeSubQuery_AnnouncementBodyListMap.put(key, subQuery); + return "id_InScopeSubQuery_AnnouncementBodyList." + key; + } + + protected java.util.Map _id_ExistsSubQuery_AnnouncementBodyListMap; + + public java.util.Map getId_ExistsSubQuery_AnnouncementBodyList() { + return _id_ExistsSubQuery_AnnouncementBodyListMap; + } + + public String keepId_ExistsSubQuery_AnnouncementBodyList( + jp.sf.pal.announcement.db.cbean.cq.AnnouncementBodyCQ subQuery) { + if (_id_ExistsSubQuery_AnnouncementBodyListMap == null) { + _id_ExistsSubQuery_AnnouncementBodyListMap = new java.util.LinkedHashMap(); + } + final String key = "subQueryMapKey" + + (_id_ExistsSubQuery_AnnouncementBodyListMap.size() + 1); + _id_ExistsSubQuery_AnnouncementBodyListMap.put(key, subQuery); + return "id_ExistsSubQuery_AnnouncementBodyList." + key; + } + + public BsAnnouncementCQ addOrderBy_Id_Asc() { + registerOrderBy("ID", true); + return this; + } + + public BsAnnouncementCQ addOrderBy_Id_Desc() { + registerOrderBy("ID", false); + return this; + } + + protected ConditionValue _scope; + + public ConditionValue getScope() { + if (_scope == null) { + _scope = new ConditionValue(); + } + return _scope; + } + + protected ConditionValue getCValueScope() { + return getScope(); + } + + public BsAnnouncementCQ addOrderBy_Scope_Asc() { + registerOrderBy("SCOPE", true); + return this; + } + + public BsAnnouncementCQ addOrderBy_Scope_Desc() { + registerOrderBy("SCOPE", false); + return this; + } + + protected ConditionValue _role; + + public ConditionValue getRole() { + if (_role == null) { + _role = new ConditionValue(); + } + return _role; + } + + protected ConditionValue getCValueRole() { + return getRole(); + } + + public BsAnnouncementCQ addOrderBy_Role_Asc() { + registerOrderBy("ROLE", true); + return this; + } + + public BsAnnouncementCQ addOrderBy_Role_Desc() { + registerOrderBy("ROLE", false); + return this; + } + + protected ConditionValue _startDate; + + public ConditionValue getStartDate() { + if (_startDate == null) { + _startDate = new ConditionValue(); + } + return _startDate; + } + + protected ConditionValue getCValueStartDate() { + return getStartDate(); + } + + public BsAnnouncementCQ addOrderBy_StartDate_Asc() { + registerOrderBy("START_DATE", true); + return this; + } + + public BsAnnouncementCQ addOrderBy_StartDate_Desc() { + registerOrderBy("START_DATE", false); + return this; + } + + protected ConditionValue _endDate; + + public ConditionValue getEndDate() { + if (_endDate == null) { + _endDate = new ConditionValue(); + } + return _endDate; + } + + protected ConditionValue getCValueEndDate() { + return getEndDate(); + } + + public BsAnnouncementCQ addOrderBy_EndDate_Asc() { + registerOrderBy("END_DATE", true); + return this; + } + + public BsAnnouncementCQ addOrderBy_EndDate_Desc() { + registerOrderBy("END_DATE", false); + return this; + } + + protected ConditionValue _title; + + public ConditionValue getTitle() { + if (_title == null) { + _title = new ConditionValue(); + } + return _title; + } + + protected ConditionValue getCValueTitle() { + return getTitle(); + } + + public BsAnnouncementCQ addOrderBy_Title_Asc() { + registerOrderBy("TITLE", true); + return this; + } + + public BsAnnouncementCQ addOrderBy_Title_Desc() { + registerOrderBy("TITLE", false); + return this; + } + + protected ConditionValue _sortOrder; + + public ConditionValue getSortOrder() { + if (_sortOrder == null) { + _sortOrder = new ConditionValue(); + } + return _sortOrder; + } + + protected ConditionValue getCValueSortOrder() { + return getSortOrder(); + } + + public BsAnnouncementCQ addOrderBy_SortOrder_Asc() { + registerOrderBy("SORT_ORDER", true); + return this; + } + + public BsAnnouncementCQ addOrderBy_SortOrder_Desc() { + registerOrderBy("SORT_ORDER", false); + return this; + } + + protected ConditionValue _timestamp; + + public ConditionValue getTimestamp() { + if (_timestamp == null) { + _timestamp = new ConditionValue(); + } + return _timestamp; + } + + protected ConditionValue getCValueTimestamp() { + return getTimestamp(); + } + + public BsAnnouncementCQ addOrderBy_Timestamp_Asc() { + registerOrderBy("TIMESTAMP", true); + return this; + } + + public BsAnnouncementCQ addOrderBy_Timestamp_Desc() { + registerOrderBy("TIMESTAMP", false); + return this; + } + + // =================================================================================== + // Union Query + // =========== + protected void reflectRelationOnUnionQuery(ConditionQuery baseQueryAsSuper, + ConditionQuery unionQueryAsSuper) { + final jp.sf.pal.announcement.db.cbean.cq.AnnouncementCQ baseQuery = (jp.sf.pal.announcement.db.cbean.cq.AnnouncementCQ) baseQueryAsSuper; + final jp.sf.pal.announcement.db.cbean.cq.AnnouncementCQ unionQuery = (jp.sf.pal.announcement.db.cbean.cq.AnnouncementCQ) unionQueryAsSuper; + if (baseQuery.hasConditionQueryAnnouncementBodyAsOne()) { + unionQuery.queryAnnouncementBodyAsOne() + .reflectRelationOnUnionQuery( + baseQuery.queryAnnouncementBodyAsOne(), + unionQuery.queryAnnouncementBodyAsOne()); + } + + } + + // =================================================================================== + // Foreign Query + // ============= + + // /* * * * * * * * * * * * * * * * * * * * * * * {as one} + // ReferrerTable = [ANNOUNCEMENT_BODY(TABLE)] + // ReferrerProperty = [announcementBodyAsOne] + // * * * * * * * * */ + + /** + * Query for announcementBodyAsOne. + * @return Instance of jp.sf.pal.announcement.db.cbean.cq.AnnouncementBodyCQ as announcementBodyAsOne. (NotNull) + */ + public jp.sf.pal.announcement.db.cbean.cq.AnnouncementBodyCQ queryAnnouncementBodyAsOne() { + return getConditionQueryAnnouncementBodyAsOne(); + } + + protected jp.sf.pal.announcement.db.cbean.cq.AnnouncementBodyCQ _conditionQueryAnnouncementBodyAsOne; + + public jp.sf.pal.announcement.db.cbean.cq.AnnouncementBodyCQ getConditionQueryAnnouncementBodyAsOne() { + if (_conditionQueryAnnouncementBodyAsOne == null) { + _conditionQueryAnnouncementBodyAsOne = createQueryAnnouncementBodyAsOne(); + setupOuterJoin_AnnouncementBodyAsOne(); + } + return _conditionQueryAnnouncementBodyAsOne; + } + + protected void setupOuterJoin_AnnouncementBodyAsOne() { + final java.util.Map joinOnMap = new java.util.LinkedHashMap(); + joinOnMap.put(getRealColumnName("ID"), + getConditionQueryAnnouncementBodyAsOne() + .getRealColumnName("ID")); + getSqlClause().registerOuterJoin( + getConditionQueryAnnouncementBodyAsOne().getTableSqlName(), + getConditionQueryAnnouncementBodyAsOne().getRealAliasName(), + joinOnMap); + } + + protected jp.sf.pal.announcement.db.cbean.cq.AnnouncementBodyCQ createQueryAnnouncementBodyAsOne() { + final String nextRelationPath = resolveNextRelationPathAnnouncementBodyAsOne(); + final String resolvedAliasName = resolveJoinAliasName(nextRelationPath, + getNextNestLevel()); + final jp.sf.pal.announcement.db.cbean.cq.AnnouncementBodyCQ cq = new jp.sf.pal.announcement.db.cbean.cq.AnnouncementBodyCQ( + this, getSqlClause(), resolvedAliasName, getNextNestLevel()); + cq.xsetForeignPropertyName("announcementBodyAsOne"); + cq.xsetRelationPath(nextRelationPath); + return cq; + } + + protected String resolveNextRelationPathAnnouncementBodyAsOne() { + return resolveNextRelationPath("ANNOUNCEMENT", "announcementBodyAsOne"); + } + + public boolean hasConditionQueryAnnouncementBodyAsOne() { + return _conditionQueryAnnouncementBodyAsOne != null; + } +} Property changes on: announcement/trunk/src/main/java/jp/sf/pal/announcement/db/cbean/cq/bs/BsAnnouncementCQ.java ___________________________________________________________________ Name: svn:eol-style + native Added: announcement/trunk/src/main/java/jp/sf/pal/announcement/db/cbean/cq/ciq/AnnouncementBodyCIQ.java =================================================================== --- announcement/trunk/src/main/java/jp/sf/pal/announcement/db/cbean/cq/ciq/AnnouncementBodyCIQ.java (rev 0) +++ announcement/trunk/src/main/java/jp/sf/pal/announcement/db/cbean/cq/ciq/AnnouncementBodyCIQ.java 2008-06-30 02:54:27 UTC (rev 1002) @@ -0,0 +1,98 @@ +package jp.sf.pal.announcement.db.cbean.cq.ciq; + +import jp.sf.pal.announcement.db.allcommon.cbean.ConditionQuery; +import jp.sf.pal.announcement.db.allcommon.cbean.ckey.ConditionKey; +import jp.sf.pal.announcement.db.allcommon.cbean.coption.ConditionOption; +import jp.sf.pal.announcement.db.allcommon.cbean.cvalue.ConditionValue; +import jp.sf.pal.announcement.db.allcommon.cbean.sqlclause.SqlClause; +import jp.sf.pal.announcement.db.cbean.cq.bs.AbstractBsAnnouncementBodyCQ; +import jp.sf.pal.announcement.db.cbean.cq.bs.BsAnnouncementBodyCQ; + +/** + * The condition-inline-query of ANNOUNCEMENT_BODY. + * @author DBFlute(AutoGenerator) + */ + @ SuppressWarnings("unchecked") +public class AnnouncementBodyCIQ extends AbstractBsAnnouncementBodyCQ { + + // =================================================================================== + // Attribute + // ========= + protected BsAnnouncementBodyCQ _myCQ; + + // =================================================================================== + // Constructor + // =========== + public AnnouncementBodyCIQ(ConditionQuery childQuery, SqlClause sqlClause, + String aliasName, int nestLevel, BsAnnouncementBodyCQ myCQ) { + super(childQuery, sqlClause, aliasName, nestLevel); + _myCQ = myCQ; + _foreignPropertyName = _myCQ.getForeignPropertyName();// Accept foreign property name. + _relationPath = _myCQ.getRelationPath();// Accept relation path. + } + + // =================================================================================== + // Override about Register + // ======================= + @Override + protected void reflectRelationOnUnionQuery(ConditionQuery baseQueryAsSuper, + ConditionQuery unionQueryAsSuper) { + throw new UnsupportedOperationException( + "InlineQuery must not need UNION method: " + baseQueryAsSuper + + " : " + unionQueryAsSuper); + } + + @Override + protected void setupConditionValueAndRegisterWhereClause(ConditionKey key, + Object value, ConditionValue cvalue, String colName, + String capPropName, String uncapPropName) { + registerInlineQuery(key, value, cvalue, colName, capPropName, + uncapPropName); + } + + @Override + protected void setupConditionValueAndRegisterWhereClause(ConditionKey key, + Object value, ConditionValue cvalue, String colName, + String capPropName, String uncapPropName, ConditionOption option) { + registerInlineQuery(key, value, cvalue, colName, capPropName, + uncapPropName, option); + } + + @Override + protected void registerWhereClause(String whereClause) { + registerInlineWhereClause(whereClause); + } + + @Override + protected String getInScopeSubQueryRealColumnName(String columnName) { + if (_onClauseInline) { + throw new UnsupportedOperationException( + "InScopeSubQuery of on-clause is unsupported"); + } + return _onClauseInline ? getRealAliasName() + "." + columnName + : columnName; + } + + @Override + protected void registerExistsSubQuery(ConditionQuery subQuery, + String columnName, String relatedColumnName, String propertyName) { + throw new UnsupportedOperationException( + "Sorry! ExistsSubQuery at inline view is unsupported. So please use InScopeSubQyery."); + } + + // =================================================================================== + // Override about Query + // ==================== + protected ConditionValue getCValueId() { + return _myCQ.getId(); + } + + public String keepId_InScopeSubQuery_Announcement( + jp.sf.pal.announcement.db.cbean.cq.AnnouncementCQ subQuery) { + return _myCQ.keepId_InScopeSubQuery_Announcement(subQuery); + } + + protected ConditionValue getCValueContent() { + return _myCQ.getContent(); + } +} Property changes on: announcement/trunk/src/main/java/jp/sf/pal/announcement/db/cbean/cq/ciq/AnnouncementBodyCIQ.java ___________________________________________________________________ Name: svn:eol-style + native Added: announcement/trunk/src/main/java/jp/sf/pal/announcement/db/cbean/cq/ciq/AnnouncementCIQ.java =================================================================== --- announcement/trunk/src/main/java/jp/sf/pal/announcement/db/cbean/cq/ciq/AnnouncementCIQ.java (rev 0) +++ announcement/trunk/src/main/java/jp/sf/pal/announcement/db/cbean/cq/ciq/AnnouncementCIQ.java 2008-06-30 02:54:27 UTC (rev 1002) @@ -0,0 +1,128 @@ +package jp.sf.pal.announcement.db.cbean.cq.ciq; + +import jp.sf.pal.announcement.db.allcommon.cbean.ConditionQuery; +import jp.sf.pal.announcement.db.allcommon.cbean.ckey.ConditionKey; +import jp.sf.pal.announcement.db.allcommon.cbean.coption.ConditionOption; +import jp.sf.pal.announcement.db.allcommon.cbean.cvalue.ConditionValue; +import jp.sf.pal.announcement.db.allcommon.cbean.sqlclause.SqlClause; +import jp.sf.pal.announcement.db.cbean.cq.bs.AbstractBsAnnouncementCQ; +import jp.sf.pal.announcement.db.cbean.cq.bs.BsAnnouncementCQ; + +/** + * The condition-inline-query of ANNOUNCEMENT. + * @author DBFlute(AutoGenerator) + */ + @ SuppressWarnings("unchecked") +public class AnnouncementCIQ extends AbstractBsAnnouncementCQ { + + // =================================================================================== + // Attribute + // ========= + protected BsAnnouncementCQ _myCQ; + + // =================================================================================== + // Constructor + // =========== + public AnnouncementCIQ(ConditionQuery childQuery, SqlClause sqlClause, + String aliasName, int nestLevel, BsAnnouncementCQ myCQ) { + super(childQuery, sqlClause, aliasName, nestLevel); + _myCQ = myCQ; + _foreignPropertyName = _myCQ.getForeignPropertyName();// Accept foreign property name. + _relationPath = _myCQ.getRelationPath();// Accept relation path. + } + + // =================================================================================== + // Override about Register + // ======================= + @Override + protected void reflectRelationOnUnionQuery(ConditionQuery baseQueryAsSuper, + ConditionQuery unionQueryAsSuper) { + throw new UnsupportedOperationException( + "InlineQuery must not need UNION method: " + baseQueryAsSuper + + " : " + unionQueryAsSuper); + } + + @Override + protected void setupConditionValueAndRegisterWhereClause(ConditionKey key, + Object value, ConditionValue cvalue, String colName, + String capPropName, String uncapPropName) { + registerInlineQuery(key, value, cvalue, colName, capPropName, + uncapPropName); + } + + @Override + protected void setupConditionValueAndRegisterWhereClause(ConditionKey key, + Object value, ConditionValue cvalue, String colName, + String capPropName, String uncapPropName, ConditionOption option) { + registerInlineQuery(key, value, cvalue, colName, capPropName, + uncapPropName, option); + } + + @Override + protected void registerWhereClause(String whereClause) { + registerInlineWhereClause(whereClause); + } + + @Override + protected String getInScopeSubQueryRealColumnName(String columnName) { + if (_onClauseInline) { + throw new UnsupportedOperationException( + "InScopeSubQuery of on-clause is unsupported"); + } + return _onClauseInline ? getRealAliasName() + "." + columnName + : columnName; + } + + @Override + protected void registerExistsSubQuery(ConditionQuery subQuery, + String columnName, String relatedColumnName, String propertyName) { + throw new UnsupportedOperationException( + "Sorry! ExistsSubQuery at inline view is unsupported. So please use InScopeSubQyery."); + } + + // =================================================================================== + // Override about Query + // ==================== + protected ConditionValue getCValueId() { + return _myCQ.getId(); + } + + public String keepId_InScopeSubQuery_AnnouncementBodyList( + jp.sf.pal.announcement.db.cbean.cq.AnnouncementBodyCQ subQuery) { + return _myCQ.keepId_InScopeSubQuery_AnnouncementBodyList(subQuery); + } + + public String keepId_ExistsSubQuery_AnnouncementBodyList( + jp.sf.pal.announcement.db.cbean.cq.AnnouncementBodyCQ subQuery) { + throw new UnsupportedOperationException( + "ExistsSubQuery at inline() is unsupported! Sorry!"); + } + + protected ConditionValue getCValueScope() { + return _myCQ.getScope(); + } + + protected ConditionValue getCValueRole() { + return _myCQ.getRole(); + } + + protected ConditionValue getCValueStartDate() { + return _myCQ.getStartDate(); + } + + protected ConditionValue getCValueEndDate() { + return _myCQ.getEndDate(); + } + + protected ConditionValue getCValueTitle() { + return _myCQ.getTitle(); + } + + protected ConditionValue getCValueSortOrder() { + return _myCQ.getSortOrder(); + } + + protected ConditionValue getCValueTimestamp() { + return _myCQ.getTimestamp(); + } +} Property changes on: announcement/trunk/src/main/java/jp/sf/pal/announcement/db/cbean/cq/ciq/AnnouncementCIQ.java ___________________________________________________________________ Name: svn:eol-style + native Added: announcement/trunk/src/main/java/jp/sf/pal/announcement/db/cbean/nss/AnnouncementBodyNss.java =================================================================== --- announcement/trunk/src/main/java/jp/sf/pal/announcement/db/cbean/nss/AnnouncementBodyNss.java (rev 0) +++ announcement/trunk/src/main/java/jp/sf/pal/announcement/db/cbean/nss/AnnouncementBodyNss.java 2008-06-30 02:54:27 UTC (rev 1002) @@ -0,0 +1,60 @@ +package jp.sf.pal.announcement.db.cbean.nss; + +import jp.sf.pal.announcement.db.cbean.cq.AnnouncementBodyCQ; + +/** + * The nest-select-setupper of ANNOUNCEMENT_BODY. + * @author DBFlute(AutoGenerator) + */ + @ SuppressWarnings("unchecked") +public class AnnouncementBodyNss { + + // =================================================================================== + // Attribute + // ========= + protected AnnouncementBodyCQ _query; + + // =================================================================================== + // Constructor + // =========== + public AnnouncementBodyNss(AnnouncementBodyCQ query) { + _query = query; + } + + // =================================================================================== + // Accessor + // ======== + public boolean hasConditionQuery() { + return _query != null; + } + + // =================================================================================== + // With Nested Foreign Table + // ========================= + + public AnnouncementNss withAnnouncement() { + assertConditionQuery(); + final String foreignTableAliasName = _query.queryAnnouncement() + .getRealAliasName(); + final String localRelationPath = _query.getRelationPath(); + _query.getSqlClause().registerSelectedSelectColumn( + foreignTableAliasName, "ANNOUNCEMENT_BODY", "announcement", + localRelationPath); + _query.getSqlClause().registerSelectedForeignInfo( + _query.queryAnnouncement().getRelationPath(), "announcement"); + return new AnnouncementNss(_query.queryAnnouncement()); + } + + // =================================================================================== + // With Nested Referrer Table + // ========================== + + // =================================================================================== + // Helper + // ====== + protected void assertConditionQuery() { + if (!hasConditionQuery()) { + throw new IllegalStateException("The query should not be null."); + } + } +} Property changes on: announcement/trunk/src/main/java/jp/sf/pal/announcement/db/cbean/nss/AnnouncementBodyNss.java ___________________________________________________________________ Name: svn:eol-style + native Added: announcement/trunk/src/main/java/jp/sf/pal/announcement/db/cbean/nss/AnnouncementNss.java =================================================================== --- announcement/trunk/src/main/java/jp/sf/pal/announcement/db/cbean/nss/AnnouncementNss.java (rev 0) +++ announcement/trunk/src/main/java/jp/sf/pal/announcement/db/cbean/nss/AnnouncementNss.java 2008-06-30 02:54:27 UTC (rev 1002) @@ -0,0 +1,61 @@ +package jp.sf.pal.announcement.db.cbean.nss; + +import jp.sf.pal.announcement.db.cbean.cq.AnnouncementCQ; + +/** + * The nest-select-setupper of ANNOUNCEMENT. + * @author DBFlute(AutoGenerator) + */ + @ SuppressWarnings("unchecked") +public class AnnouncementNss { + + // =================================================================================== + // Attribute + // ========= + protected AnnouncementCQ _query; + + // =================================================================================== + // Constructor + // =========== + public AnnouncementNss(AnnouncementCQ query) { + _query = query; + } + + // =================================================================================== + // Accessor + // ======== + public boolean hasConditionQuery() { + return _query != null; + } + + // =================================================================================== + // With Nested Foreign Table + // ========================= + + // =================================================================================== + // With Nested Referrer Table + // ========================== + + public AnnouncementBodyNss withAnnouncementBodyAsOne() { + assertConditionQuery(); + final String foreignTableAliasName = _query + .queryAnnouncementBodyAsOne().getRealAliasName(); + final String localRelationPath = _query.getRelationPath(); + _query.getSqlClause().registerSelectedSelectColumn( + foreignTableAliasName, "ANNOUNCEMENT", "announcementBodyAsOne", + localRelationPath); + _query.getSqlClause().registerSelectedForeignInfo( + _query.queryAnnouncementBodyAsOne().getRelationPath(), + "announcementBodyAsOne"); + return new AnnouncementBodyNss(_query.queryAnnouncementBodyAsOne()); + } + + // =================================================================================== + // Helper + // ====== + protected void assertConditionQuery() { + if (!hasConditionQuery()) { + throw new IllegalStateException("The query should not be null."); + } + } +} Property changes on: announcement/trunk/src/main/java/jp/sf/pal/announcement/db/cbean/nss/AnnouncementNss.java ___________________________________________________________________ Name: svn:eol-style + native Added: announcement/trunk/src/main/java/jp/sf/pal/announcement/db/exbhv/AnnouncementBhv.java =================================================================== --- announcement/trunk/src/main/java/jp/sf/pal/announcement/db/exbhv/AnnouncementBhv.java (rev 0) +++ announcement/trunk/src/main/java/jp/sf/pal/announcement/db/exbhv/AnnouncementBhv.java 2008-06-30 02:54:27 UTC (rev 1002) @@ -0,0 +1,14 @@ +package jp.sf.pal.announcement.db.exbhv; + +/** + * The behavior of ANNOUNCEMENT. + *

    + * You can implement your original methods here. + * This class is NOT overrided when re-generating. + *

    + * @author DBFlute(AutoGenerator) + */ + @ SuppressWarnings("unchecked") +public class AnnouncementBhv extends + jp.sf.pal.announcement.db.bsbhv.BsAnnouncementBhv { +} Property changes on: announcement/trunk/src/main/java/jp/sf/pal/announcement/db/exbhv/AnnouncementBhv.java ___________________________________________________________________ Name: svn:eol-style + native Added: announcement/trunk/src/main/java/jp/sf/pal/announcement/db/exbhv/AnnouncementBodyBhv.java =================================================================== --- announcement/trunk/src/main/java/jp/sf/pal/announcement/db/exbhv/AnnouncementBodyBhv.java (rev 0) +++ announcement/trunk/src/main/java/jp/sf/pal/announcement/db/exbhv/AnnouncementBodyBhv.java 2008-06-30 02:54:27 UTC (rev 1002) @@ -0,0 +1,14 @@ +package jp.sf.pal.announcement.db.exbhv; + +/** + * The behavior of ANNOUNCEMENT_BODY. + *

    + * You can implement your original methods here. + * This class is NOT overrided when re-generating. + *

    + * @author DBFlute(AutoGenerator) + */ + @ SuppressWarnings("unchecked") +public class AnnouncementBodyBhv extends + jp.sf.pal.announcement.db.bsbhv.BsAnnouncementBodyBhv { +} Added: announcement/trunk/src/main/java/jp/sf/pal/announcement/db/exdao/AnnouncementBodyDao.java =================================================================== --- announcement/trunk/src/main/java/jp/sf/pal/announcement/db/exdao/AnnouncementBodyDao.java (rev 0) +++ announcement/trunk/src/main/java/jp/sf/pal/announcement/db/exdao/AnnouncementBodyDao.java 2008-06-30 02:54:27 UTC (rev 1002) @@ -0,0 +1,14 @@ +package jp.sf.pal.announcement.db.exdao; + +/** + * The dao interface of ANNOUNCEMENT_BODY.
    + *

    + * You can implement your original methods here. + * This class is NOT overrided when re-generating. + *

    + * @author DBFlute(AutoGenerator) + */ + @ SuppressWarnings("unchecked") +public interface AnnouncementBodyDao extends + jp.sf.pal.announcement.db.bsdao.BsAnnouncementBodyDao { +} Property changes on: announcement/trunk/src/main/java/jp/sf/pal/announcement/db/exdao/AnnouncementBodyDao.java ___________________________________________________________________ Name: svn:eol-style + native Added: announcement/trunk/src/main/java/jp/sf/pal/announcement/db/exdao/AnnouncementDao.java =================================================================== --- announcement/trunk/src/main/java/jp/sf/pal/announcement/db/exdao/AnnouncementDao.java (rev 0) +++ announcement/trunk/src/main/java/jp/sf/pal/announcement/db/exdao/AnnouncementDao.java 2008-06-30 02:54:27 UTC (rev 1002) @@ -0,0 +1,14 @@ +package jp.sf.pal.announcement.db.exdao; + +/** + * The dao interface of ANNOUNCEMENT.
    + *

    + * You can implement your original methods here. + * This class is NOT overrided when re-generating. + *

    + * @author DBFlute(AutoGenerator) + */ + @ SuppressWarnings("unchecked") +public interface AnnouncementDao extends + jp.sf.pal.announcement.db.bsdao.BsAnnouncementDao { +} Property changes on: announcement/trunk/src/main/java/jp/sf/pal/announcement/db/exdao/AnnouncementDao.java ___________________________________________________________________ Name: svn:eol-style + native Added: announcement/trunk/src/main/java/jp/sf/pal/announcement/db/exentity/Announcement.java =================================================================== --- announcement/trunk/src/main/java/jp/sf/pal/announcement/db/exentity/Announcement.java (rev 0) +++ announcement/trunk/src/main/java/jp/sf/pal/announcement/db/exentity/Announcement.java 2008-06-30 02:54:27 UTC (rev 1002) @@ -0,0 +1,30 @@ +package jp.sf.pal.announcement.db.exentity; + +/** + * The entity of ANNOUNCEMENT. + *

    + * You can implement your original methods here. + * This class is NOT overrided when re-generating. + *

    + * @author DBFlute(AutoGenerator) + */ + @ SuppressWarnings("unchecked") +public class Announcement extends + jp.sf.pal.announcement.db.bsentity.BsAnnouncement { + + /** Serial version UID. (Default) */ + private static final long serialVersionUID = 1L; + + public String getContent() { + if (getAnnouncementBodyAsOne() != null) { + return getAnnouncementBodyAsOne().getContent(); + } + return null; + } + + public void setContent(String content) { + if (getAnnouncementBodyAsOne() != null) { + getAnnouncementBodyAsOne().setContent(content); + } + } +} Property changes on: announcement/trunk/src/main/java/jp/sf/pal/announcement/db/exentity/Announcement.java ___________________________________________________________________ Name: svn:eol-style + native Added: announcement/trunk/src/main/java/jp/sf/pal/announcement/db/exentity/AnnouncementBody.java =================================================================== --- announcement/trunk/src/main/java/jp/sf/pal/announcement/db/exentity/AnnouncementBody.java (rev 0) +++ announcement/trunk/src/main/java/jp/sf/pal/announcement/db/exentity/AnnouncementBody.java 2008-06-30 02:54:27 UTC (rev 1002) @@ -0,0 +1,24 @@ +package jp.sf.pal.announcement.db.exentity; + +/** + * The entity of ANNOUNCEMENT_BODY. + *

    + * You can implement your original methods here. + * This class is NOT overrided when re-generating. + *

    + * @author DBFlute(AutoGenerator) + */ + @ SuppressWarnings("unchecked") +public class AnnouncementBody extends + jp.sf.pal.announcement.db.bsentity.BsAnnouncementBody { + + /** Serial version UID. (Default) */ + private static final long serialVersionUID = 1L; + + public AnnouncementBody() { + } + + public AnnouncementBody(String content) { + setContent(content); + } +} Property changes on: announcement/trunk/src/main/java/jp/sf/pal/announcement/db/exentity/AnnouncementBody.java ___________________________________________________________________ Name: svn:eol-style + native Added: announcement/trunk/src/main/java/jp/sf/pal/announcement/dxo/AnnouncementDxo.java =================================================================== --- announcement/trunk/src/main/java/jp/sf/pal/announcement/dxo/AnnouncementDxo.java (rev 0) +++ announcement/trunk/src/main/java/jp/sf/pal/announcement/dxo/AnnouncementDxo.java 2008-06-30 02:54:27 UTC (rev 1002) @@ -0,0 +1,18 @@ +package jp.sf.pal.announcement.dxo; + +import java.util.List; +import java.util.Map; + +import jp.sf.pal.announcement.db.exentity.Announcement; +import jp.sf.pal.announcement.web.edit.EditContentPage; + +public interface AnnouncementDxo { + public void convertFromAnnouncementToPage(Announcement announcement, + EditContentPage page); + + public void convertFromListAnnouncementToListMap( + List announcementList, List> list); + + public void convertFromPageToAnnouncement(EditContentPage page, + Announcement announcement); +} Property changes on: announcement/trunk/src/main/java/jp/sf/pal/announcement/dxo/AnnouncementDxo.java ___________________________________________________________________ Name: svn:eol-style + native Added: announcement/trunk/src/main/java/jp/sf/pal/announcement/filter/AnnouncementFilter.java =================================================================== --- announcement/trunk/src/main/java/jp/sf/pal/announcement/filter/AnnouncementFilter.java (rev 0) +++ announcement/trunk/src/main/java/jp/sf/pal/announcement/filter/AnnouncementFilter.java 2008-06-30 02:54:27 UTC (rev 1002) @@ -0,0 +1,45 @@ +package jp.sf.pal.announcement.filter; + +import java.io.IOException; + +import javax.portlet.ActionRequest; +import javax.portlet.ActionResponse; +import javax.portlet.PortletException; +import javax.portlet.RenderRequest; +import javax.portlet.RenderResponse; + +import jp.sf.pal.announcement.AnnouncementConstraints; + +import org.apache.portals.bridges.portletfilter.PortletFilter; +import org.apache.portals.bridges.portletfilter.PortletFilterChain; +import org.apache.portals.bridges.portletfilter.PortletFilterConfig; + +public class AnnouncementFilter implements PortletFilter { + + private String scope; + + public void init(PortletFilterConfig config) throws PortletException { + scope = config.getPortletConfig().getInitParameter( + AnnouncementConstraints.SCOPE_KEY); + if (scope == null) { + scope = AnnouncementConstraints.DEFAULT_SCOPE; + } + } + + public void destroy() { + } + + public void processActionFilter(ActionRequest request, + ActionResponse response, PortletFilterChain chain) + throws PortletException, IOException { + request.setAttribute(AnnouncementConstraints.SCOPE_KEY, scope); + chain.processActionFilter(request, response); + } + + public void renderFilter(RenderRequest request, RenderResponse response, + PortletFilterChain chain) throws PortletException, IOException { + request.setAttribute(AnnouncementConstraints.SCOPE_KEY, scope); + chain.renderFilter(request, response); + } + +} Property changes on: announcement/trunk/src/main/java/jp/sf/pal/announcement/filter/AnnouncementFilter.java ___________________________________________________________________ Name: svn:eol-style + native Added: announcement/trunk/src/main/java/jp/sf/pal/announcement/service/AnnouncementService.java =================================================================== --- announcement/trunk/src/main/java/jp/sf/pal/announcement/service/AnnouncementService.java (rev 0) +++ announcement/trunk/src/main/java/jp/sf/pal/announcement/service/AnnouncementService.java 2008-06-30 02:54:27 UTC (rev 1002) @@ -0,0 +1,135 @@ +package jp.sf.pal.announcement.service; + +import java.io.Serializable; +import java.sql.Timestamp; +import java.util.List; + +import javax.faces.context.ExternalContext; +import javax.faces.context.FacesContext; + +import jp.sf.pal.announcement.AnnouncementConstraints; +import jp.sf.pal.announcement.db.cbean.AnnouncementCB; +import jp.sf.pal.announcement.db.exbhv.AnnouncementBhv; +import jp.sf.pal.announcement.db.exbhv.AnnouncementBodyBhv; +import jp.sf.pal.announcement.db.exentity.Announcement; +import jp.sf.pal.announcement.db.exentity.AnnouncementBody; + +public class AnnouncementService implements Serializable { + + private static final long serialVersionUID = -1001360275545848402L; + + private AnnouncementBhv announcementBhv; + + private AnnouncementBodyBhv announcementBodyBhv; + + public Announcement getCurrentAvailableAnnouncement() { + Timestamp now = new Timestamp(System.currentTimeMillis()); + AnnouncementCB cb = new AnnouncementCB(); + cb.setupSelect_AnnouncementBodyAsOne(); + cb.query().setScope_Equal(getScope()); + cb.query().setStartDate_LessEqual(now); + cb.query().setEndDate_GreaterEqual(now); + cb.query().addOrderBy_SortOrder_Desc(); + List announcementList = announcementBhv.selectList(cb); + if (!announcementList.isEmpty()) { + ExternalContext externalContext = FacesContext.getCurrentInstance() + .getExternalContext(); + for (Announcement announcement : announcementList) { + if (announcement.getRole() != null) { + if (externalContext.isUserInRole(announcement.getRole())) { + return announcement; + } + } else { + return announcement; + } + } + } + return getDefaultAnnouncement(); + } + + public Announcement getAnnouncement(Integer id) { + if (id == null) { + return null; + } + AnnouncementCB cb = new AnnouncementCB(); + cb.setupSelect_AnnouncementBodyAsOne(); + cb.query().setScope_Equal(getScope()); + cb.query().setId_Equal(id); + return announcementBhv.selectEntity(cb); + } + + public void deleteAnnouncement(Announcement announcement) { + announcementBhv.delete(announcement); + } + + public List getAnnouncementList() { + AnnouncementCB cb = new AnnouncementCB(); + cb.query().setScope_Equal(getScope()); + cb.query().addOrderBy_SortOrder_Desc(); + return announcementBhv.selectList(cb); + } + + public void createAnnouncement(Announcement announcement) { + // prepare + announcement.setScope(getScope()); + if (announcement.getStartDate() == null) { + announcement.setStartDate(new Timestamp( + AnnouncementConstraints.MIN_DATE)); + } + if (announcement.getEndDate() == null) { + announcement.setEndDate(new Timestamp( + AnnouncementConstraints.MAX_DATE)); + } + + List announcementList = getAnnouncementList(); + if (announcement.getRole() != null) { + announcementList.add(0, announcement); + } else { + announcementList.add(announcement); + } + int sortOrder = announcementList.size(); + for (Announcement am : announcementList) { + am.setSortOrder(sortOrder); + announcementBhv.createOrModify(am); + sortOrder--; + } + + AnnouncementBody ab = announcement.getAnnouncementBodyAsOne(); + ab.setId(announcement.getId()); + announcementBodyBhv.create(ab); + } + + public void updateAnnouncement(Announcement announcement) { + announcementBhv.update(announcement); + announcementBodyBhv.update(announcement.getAnnouncementBodyAsOne()); + } + + private String getScope() { + return (String) FacesContext.getCurrentInstance().getExternalContext() + .getRequestMap().get(AnnouncementConstraints.SCOPE_KEY); + } + + private Announcement getDefaultAnnouncement() { + Announcement announcement = new Announcement(); + announcement.setTitle("No Title"); + announcement.setAnnouncementBodyAsOne(new AnnouncementBody( + "No content.")); + return announcement; + } + + public AnnouncementBhv getAnnouncementBhv() { + return announcementBhv; + } + + public void setAnnouncementBhv(AnnouncementBhv announcementBhv) { + this.announcementBhv = announcementBhv; + } + + public AnnouncementBodyBhv getAnnouncementBodyBhv() { + return announcementBodyBhv; + } + + public void setAnnouncementBodyBhv(AnnouncementBodyBhv announcementBodyBhv) { + this.announcementBodyBhv = announcementBodyBhv; + } +} Property changes on: announcement/trunk/src/main/java/jp/sf/pal/announcement/service/AnnouncementService.java ___________________________________________________________________ Name: svn:eol-style + native Added: announcement/trunk/src/main/java/jp/sf/pal/announcement/web/edit/EditContentPage.java =================================================================== --- announcement/trunk/src/main/java/jp/sf/pal/announcement/web/edit/EditContentPage.java (rev 0) +++ announcement/trunk/src/main/java/jp/sf/pal/announcement/web/edit/EditContentPage.java 2008-06-30 02:54:27 UTC (rev 1002) @@ -0,0 +1,251 @@ +package jp.sf.pal.announcement.web.edit; + +import java.io.Serializable; +import java.util.ArrayList; +import java.util.Date; +import java.util.List; +import java.util.Map; + +import javax.faces.context.ExternalContext; +import javax.faces.context.FacesContext; + +import jp.sf.pal.announcement.AnnouncementConstraints; +import jp.sf.pal.announcement.db.exentity.Announcement; +import jp.sf.pal.announcement.db.exentity.AnnouncementBody; +import jp.sf.pal.announcement.dxo.AnnouncementDxo; +import jp.sf.pal.announcement.service.AnnouncementService; +import jp.sf.pal.common.util.FacesMessageUtil; + +import org.seasar.framework.log.Logger; +import org.seasar.teeda.extension.annotation.convert.DateTimeConverter; +import org.seasar.teeda.extension.annotation.validator.Required; +import org.seasar.teeda.extension.util.LabelHelper; + +public class EditContentPage implements Serializable { + + private static final long serialVersionUID = 9019345839703716443L; + + /** + * Logger for this class + */ + private static final Logger logger = Logger + .getLogger(EditContentPage.class); + + public String mode; + + public Integer id; + + @Required + public String title; + + @DateTimeConverter(pattern = "yyyy/MM/dd") + public Date startDate; + + @DateTimeConverter(pattern = "yyyy/MM/dd") + public Date endDate; + + public String role; + + @Required + public String content; + + public List> announcementItems; + + private AnnouncementService announcementService; + + private AnnouncementDxo announcementDxo; + + private LabelHelper labelHelper; + + public Class initialize() { + return null; + } + + public Class prerender() { + if (id != null) { + Announcement announcement = announcementService.getAnnouncement(id); + if (announcement == null) { + FacesMessageUtil.addErrorMessage("could.not.find.announcement", + new Object[] { id }); + logger.log("EAM0001", new Object[] { id }); + } else { + if ("delete".equals(mode)) { + //delete + try { + announcementService.deleteAnnouncement(announcement); + FacesMessageUtil.addInfoMessage("deleted.announcement", + new Object[] { id }); + if (logger.isInfoEnabled()) { + logger.log("IAM0001", new Object[] { id }); + } + } catch (Exception e) { + FacesMessageUtil.addErrorMessage( + "failed.to.delete.announcement", + new Object[] { id }); + logger.log("EAM0002", new Object[] { id }, e); + } + } else { + // edit mode + announcementDxo.convertFromAnnouncementToPage(announcement, + this); + } + } + } + + // announcement list + List announcementList = announcementService + .getAnnouncementList(); + announcementItems = new ArrayList>(); + announcementDxo.convertFromListAnnouncementToListMap(announcementList, + announcementItems); + + FacesMessageUtil.renderMessages(); + return null; + } + + public Class doFinishCreateNew() { + return EditContentPage.class; + } + + public Class doFinishSave() { + if (id == null) { + // new + Announcement announcement = new Announcement(); + announcement.setAnnouncementBodyAsOne(new AnnouncementBody()); + + // update values + announcementDxo.convertFromPageToAnnouncement(this, announcement); + + try { + announcementService.createAnnouncement(announcement); + + FacesMessageUtil.addInfoMessage("created.announcement"); + if (logger.isInfoEnabled()) { + logger.log("IAM0002", null); + } + } catch (Exception e) { + FacesMessageUtil + .addErrorMessage("failed.to.create.announcement"); + logger.log("EAM0004", null, e); + return null; + } + + } else { + // update + Announcement announcement = announcementService.getAnnouncement(id); + if (announcement == null) { + FacesMessageUtil.addErrorMessage("could.not.find.announcement", + new Object[] { id }); + logger.log("EAM0003", new Object[] { id }); + return null; + } + + // update values + announcementDxo.convertFromPageToAnnouncement(this, announcement); + + try { + announcementService.updateAnnouncement(announcement); + + FacesMessageUtil.addInfoMessage("updated.announcement", + new Object[] { id }); + if (logger.isInfoEnabled()) { + logger.log("IAM0003", new Object[] { id }); + } + } catch (Exception e) { + FacesMessageUtil + .addErrorMessage("failed.to.update.announcement"); + logger.log("EAM0005", null, e); + return null; + } + } + + return EditContentPage.class; + } + + public String getFckeditorContent() { + ExternalContext externalContext = FacesContext.getCurrentInstance() + .getExternalContext(); + String namespace = externalContext.encodeNamespace(""); + String contextPath = externalContext.getRequestContextPath(); + + StringBuilder buf = new StringBuilder(); + buf.append("").append("\n"); + return buf.toString(); + } + + public String getFckeditorScriptSrc() { + return FacesContext.getCurrentInstance().getExternalContext() + .getRequestContextPath() + + "/fckeditor/fckeditor.js"; + } + + public AnnouncementService getAnnouncementService() { + return announcementService; + } + + public void setAnnouncementService(AnnouncementService announcementService) { + this.announcementService = announcementService; + } + + public AnnouncementDxo getAnnouncementDxo() { + return announcementDxo; + } + + public void setAnnouncementDxo(AnnouncementDxo announcementDxo) { + this.announcementDxo = announcementDxo; + } + + public LabelHelper getLabelHelper() { + return labelHelper; + } + + public void setLabelHelper(LabelHelper labelHelper) { + this.labelHelper = labelHelper; + } + + public Date getStartDate() { + if (startDate != null + && startDate.getTime() <= AnnouncementConstraints.MIN_DATE) { + return null; + } + return startDate; + } + + public Date getEndDate() { + if (endDate != null + && endDate.getTime() >= AnnouncementConstraints.MAX_DATE) { + return null; + } + return endDate; + } + + public String getDoFinishSaveValue() { + if (id == null) { + return labelHelper.getLabelValue("create"); + } else { + return labelHelper.getLabelValue("update"); + } + } + + public String getDoFinishCreateNewValue() { + return labelHelper.getLabelValue("new"); + } + +} Property changes on: announcement/trunk/src/main/java/jp/sf/pal/announcement/web/edit/EditContentPage.java ___________________________________________________________________ Name: svn:eol-style + native Added: announcement/trunk/src/main/java/jp/sf/pal/announcement/web/view/DisplayContentPage.java =================================================================== --- announcement/trunk/src/main/java/jp/sf/pal/announcement/web/view/DisplayContentPage.java (rev 0) +++ announcement/trunk/src/main/java/jp/sf/pal/announcement/web/view/DisplayContentPage.java 2008-06-30 02:54:27 UTC (rev 1002) @@ -0,0 +1,53 @@ +package jp.sf.pal.announcement.web.view; + +import java.io.Serializable; + +import javax.portlet.PortletResponse; +import javax.portlet.RenderResponse; + +import jp.sf.pal.announcement.db.exentity.Announcement; +import jp.sf.pal.announcement.service.AnnouncementService; +import jp.sf.pal.common.util.FacesMessageUtil; + +public class DisplayContentPage implements Serializable { + + private static final long serialVersionUID = -3596529450894248441L; + + public String content; + + private AnnouncementService announcementService; + + private PortletResponse response; + + public Class initialize() { + return null; + } + + public Class prerender() { + Announcement announcement = announcementService + .getCurrentAvailableAnnouncement(); + content = announcement.getAnnouncementBodyAsOne().getContent(); + if (response instanceof RenderResponse) { + ((RenderResponse) response).setTitle(announcement.getTitle()); + } + FacesMessageUtil.renderMessages(); + return null; + } + + public AnnouncementService getAnnouncementService() { + return announcementService; + } + + public void setAnnouncementService(AnnouncementService announcementService) { + this.announcementService = announcementService; + } + + public PortletResponse getResponse() { + return response; + } + + public void setResponse(PortletResponse response) { + this.response = response; + } + +} Property changes on: announcement/trunk/src/main/java/jp/sf/pal/announcement/web/view/DisplayContentPage.java ___________________________________________________________________ Name: svn:eol-style + native Added: announcement/trunk/src/main/resources/AMMessages.properties =================================================================== --- announcement/trunk/src/main/resources/AMMessages.properties (rev 0) +++ announcement/trunk/src/main/resources/AMMessages.properties 2008-06-30 02:54:27 UTC (rev 1002) @@ -0,0 +1,10 @@ +EAM0001=Could not find the announcement(id={0}). +EAM0002=Failed to delete the announcement(id={0}). +EAM0003=Could not find the announcement(id={0}). +EAM0004=Failed to create the announcement. +EAM0005=Failed to update the announcement(id={0}). + +IAM0001=Deleted announcement({0}). +IAM0002=Created announcement. +IAM0003=Updated announcement({0}). + Property changes on: announcement/trunk/src/main/resources/AMMessages.properties ___________________________________________________________________ Name: svn:eol-style + native Added: announcement/trunk/src/main/resources/app.dicon =================================================================== --- announcement/trunk/src/main/resources/app.dicon (rev 0) +++ announcement/trunk/src/main/resources/app.dicon 2008-06-30 02:54:27 UTC (rev 1002) @@ -0,0 +1,11 @@ + + + + + + + + + + Added: announcement/trunk/src/main/resources/appMessages.properties =================================================================== --- announcement/trunk/src/main/resources/appMessages.properties (rev 0) +++ announcement/trunk/src/main/resources/appMessages.properties 2008-06-30 02:54:27 UTC (rev 1002) @@ -0,0 +1,7 @@ +could.not.find.announcement=Could not find the annnouncement(id={0}). If you see this error again, please contact to a site administrator. +deleted.announcement=Deleted announcement(id={0}). +failed.to.delete.announcement=Failed to delete the announcement(id={0}). If you see this error again, please contact to a site administrator. +created.announcement=Created announcement. +failed.to.create.announcement=Failed to create an announcement. If you see this error again, please contact to a site administrator. +updated.announcement=Updated announcement(id={0}). +failed.to.update.announcement=Failed to update the announcement(id={0}). If you see this error again, please contact to a site administrator. Property changes on: announcement/trunk/src/main/resources/appMessages.properties ___________________________________________________________________ Name: svn:eol-style + native Added: announcement/trunk/src/main/resources/appMessages_ja.properties =================================================================== --- announcement/trunk/src/main/resources/appMessages_ja.properties (rev 0) +++ announcement/trunk/src/main/resources/appMessages_ja.properties 2008-06-30 02:54:27 UTC (rev 1002) @@ -0,0 +1,7 @@ +could.not.find.announcement=\u304a\u77e5\u3089\u305b\u60c5\u5831(id={0})\u3092\u898b\u3064\u3051\u3089\u308c\u307e\u305b\u3093\u3067\u3057\u305f\u3002\u518d\u5ea6\u3001\u3053\u306e\u30a8\u30e9\u30fc\u304c\u8868\u793a\u3055\u308c\u308b\u5834\u5408\u306f\u7ba1\u7406\u8005\u306b\u304a\u554f\u3044\u5408\u308f\u305b\u304f\u3060\u3055\u3044\u3002 +deleted.announcement=\u304a\u77e5\u3089\u305b\u60c5\u5831(id={0})\u3092\u524a\u9664\u3057\u307e\u3057\u305f\u3002 +failed.to.delete.announcement=\u304a\u77e5\u3089\u305b\u60c5\u5831(id={0})\u306e\u524a\u9664\u306b\u5931\u6557\u3057\u307e\u3057\u305f\u3002\u518d\u5ea6\u3001\u3053\u306e\u30a8\u30e9\u30fc\u304c\u8868\u793a\u3055\u308c\u308b\u5834\u5408\u306f\u7ba1\u7406\u8005\u306b\u304a\u554f\u3044\u5408\u308f\u305b\u304f\u3060\u3055\u3044\u3002 +created.announcement=\u304a\u77e5\u3089\u305b\u60c5\u5831\u3092\u4f5c\u6210\u3057\u307e\u3057\u305f\u3002 +failed.to.create.announcement=\u304a\u77e5\u3089\u305b\u60c5\u5831\u306e\u4f5c\u6210\u306b\u5931\u6557\u3057\u307e\u3057\u305f\u3002\u518d\u5ea6\u3001\u3053\u306e\u30a8\u30e9\u30fc\u304c\u8868\u793a\u3055\u308c\u308b\u5834\u5408\u306f\u7ba1\u7406\u8005\u306b\u304a\u554f\u3044\u5408\u308f\u305b\u304f\u3060\u3055\u3044\u3002 +updated.announcement=\u304a\u77e5\u3089\u305b\u60c5\u5831(id={0})\u3092\u66f4\u65b0\u3057\u307e\u3057\u305f\u3002 +failed.to.update.announcement=\u304a\u77e5\u3089\u305b\u60c5\u5831(id={0})\u306e\u66f4\u65b0\u306b\u5931\u6557\u3057\u307e\u3057\u305f\u3002\u518d\u5ea6\u3001\u3053\u306e\u30a8\u30e9\u30fc\u304c\u8868\u793a\u3055\u308c\u308b\u5834\u5408\u306f\u7ba1\u7406\u8005\u306b\u304a\u554f\u3044\u5408\u308f\u305b\u304f\u3060\u3055\u3044\u3002 Property changes on: announcement/trunk/src/main/resources/appMessages_ja.properties ___________________________________________________________________ Name: svn:eol-style + native Added: announcement/trunk/src/main/resources/app_aop.dicon =================================================================== --- announcement/trunk/src/main/resources/app_aop.dicon (rev 0) +++ announcement/trunk/src/main/resources/app_aop.dicon 2008-06-30 02:54:27 UTC (rev 1002) @@ -0,0 +1,8 @@ + + + + + + + Added: announcement/trunk/src/main/resources/convention.dicon =================================================================== --- announcement/trunk/src/main/resources/convention.dicon (rev 0) +++ announcement/trunk/src/main/resources/convention.dicon 2008-06-30 02:54:27 UTC (rev 1002) @@ -0,0 +1,10 @@ + + + + + + "jp.sf.pal.announcement" + + + Added: announcement/trunk/src/main/resources/creator.dicon =================================================================== --- announcement/trunk/src/main/resources/creator.dicon (rev 0) +++ announcement/trunk/src/main/resources/creator.dicon 2008-06-30 02:54:27 UTC (rev 1002) @@ -0,0 +1,19 @@ + + + + + + + + + + + + + + + + + + Added: announcement/trunk/src/main/resources/customizer.dicon =================================================================== --- announcement/trunk/src/main/resources/customizer.dicon (rev 0) +++ announcement/trunk/src/main/resources/customizer.dicon 2008-06-30 02:54:27 UTC (rev 1002) @@ -0,0 +1,73 @@ + + + + + + + + traceCustomizer + + + + + + "app_aop.appFacesExceptionThrowsInterceptor" + + "do.*, initialize, prerender" + + + + + + + traceCustomizer + + + + + + "app_aop.actionSupportInterceptor" + + "do.*, initialize, prerender" + + + + + + + traceCustomizer + + + requiredTxCustomizer + + + + + traceCustomizer + + + + + traceCustomizer + + + s2DaoCustomizer + + + + + traceCustomizer + + + s2DxoCustomizer + + + + + traceCustomizer + + + + + Added: announcement/trunk/src/main/resources/dbflute.dicon =================================================================== --- announcement/trunk/src/main/resources/dbflute.dicon (rev 0) +++ announcement/trunk/src/main/resources/dbflute.dicon 2008-06-30 02:54:27 UTC (rev 1002) @@ -0,0 +1,56 @@ + + + + + + + + + "UTF-8" + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + dbflute.interceptor + + + + + + dbflute.interceptor + + + + + + dbflute.interceptor + + + + Added: announcement/trunk/src/main/resources/env.txt =================================================================== --- announcement/trunk/src/main/resources/env.txt (rev 0) +++ announcement/trunk/src/main/resources/env.txt 2008-06-30 02:54:27 UTC (rev 1002) @@ -0,0 +1 @@ +product Property changes on: announcement/trunk/src/main/resources/env.txt ___________________________________________________________________ Name: svn:eol-style + native Added: announcement/trunk/src/main/resources/env_ut.txt =================================================================== --- announcement/trunk/src/main/resources/env_ut.txt (rev 0) +++ announcement/trunk/src/main/resources/env_ut.txt 2008-06-30 02:54:27 UTC (rev 1002) @@ -0,0 +1 @@ +ut \ No newline at end of file Property changes on: announcement/trunk/src/main/resources/env_ut.txt ___________________________________________________________________ Name: svn:eol-style + native Added: announcement/trunk/src/main/resources/jdbc.dicon =================================================================== --- announcement/trunk/src/main/resources/jdbc.dicon (rev 0) +++ announcement/trunk/src/main/resources/jdbc.dicon 2008-06-30 02:54:27 UTC (rev 1002) @@ -0,0 +1,158 @@ + + + + + + + + + + + + 100 + + + + + + + + + + + + + + + + + "com.mysql.jdbc.Driver" + + + "jdbc:mysql://localhost:3306/announcement?noDatetimeStringSync=true&zeroDateTimeBehavior=convertToNull&useUnicode=true&characterEncoding=UTF-8&autoReconnect=true" + + "amuser" + "am123" + + + + + + + 600 + 10 + true + + + + + + + + + + Added: announcement/trunk/src/main/resources/jp/sf/pal/announcement/web/edit/label.properties =================================================================== --- announcement/trunk/src/main/resources/jp/sf/pal/announcement/web/edit/label.properties (rev 0) +++ announcement/trunk/src/main/resources/jp/sf/pal/announcement/web/edit/label.properties 2008-06-30 02:54:27 UTC (rev 1002) @@ -0,0 +1,21 @@ +title=Title +startDate=Start Date +endDate=End Date +role=Role +content=Content + +titleInput=Title: +releaseDateInput=Release Date: +roleInput=Role: + +listTitle=Title +listStartDate=Start Date +listEndDate=End Date +listRole=Role +listAction=Action + +edit=Edit +delete=Delete +new=New +create=Create +update=Update Property changes on: announcement/trunk/src/main/resources/jp/sf/pal/announcement/web/edit/label.properties ___________________________________________________________________ Name: svn:eol-style + native Added: announcement/trunk/src/main/resources/jp/sf/pal/announcement/web/edit/label_ja.properties =================================================================== --- announcement/trunk/src/main/resources/jp/sf/pal/announcement/web/edit/label_ja.properties (rev 0) +++ announcement/trunk/src/main/resources/jp/sf/pal/announcement/web/edit/label_ja.properties 2008-06-30 02:54:27 UTC (rev 1002) @@ -0,0 +1,21 @@ +title=\u30bf\u30a4\u30c8\u30eb +startDate=\u958b\u59cb\u65e5 +endDate=\u7d42\u4e86\u65e5 +role=\u30ed\u30fc\u30eb +content=\u5185\u5bb9 + +titleInput=\u30bf\u30a4\u30c8\u30eb: +releaseDateInput=\u516c\u958b\u65e5: +roleInput=\u30ed\u30fc\u30eb: + +listTitle=\u30bf\u30a4\u30c8\u30eb +listStartDate=\u958b\u59cb\u65e5 +listEndDate=\u7d42\u4e86\u65e5 +listRole=\u30ed\u30fc\u30eb +listAction=\u51e6\u7406 + +edit=\u7de8\u96c6 +delete=\u524a\u9664 +new=\u30ea\u30bb\u30c3\u30c8 +create=\u4f5c\u6210 +update=\u66f4\u65b0 Property changes on: announcement/trunk/src/main/resources/jp/sf/pal/announcement/web/edit/label_ja.properties ___________________________________________________________________ Name: svn:eol-style + native Added: announcement/trunk/src/main/resources/s2container.dicon =================================================================== --- announcement/trunk/src/main/resources/s2container.dicon (rev 0) +++ announcement/trunk/src/main/resources/s2container.dicon 2008-06-30 02:54:27 UTC (rev 1002) @@ -0,0 +1,8 @@ + + + + + + + \ No newline at end of file Added: announcement/trunk/src/main/resources/teedaCustomize.dicon =================================================================== --- announcement/trunk/src/main/resources/teedaCustomize.dicon (rev 0) +++ announcement/trunk/src/main/resources/teedaCustomize.dicon 2008-06-30 02:54:27 UTC (rev 1002) @@ -0,0 +1,10 @@ + + + + + true + + + + Added: announcement/trunk/src/main/resources/teedaErrorPage.dicon =================================================================== --- announcement/trunk/src/main/resources/teedaErrorPage.dicon (rev 0) +++ announcement/trunk/src/main/resources/teedaErrorPage.dicon 2008-06-30 02:54:27 UTC (rev 1002) @@ -0,0 +1,21 @@ + + + + + + Added: announcement/trunk/src/main/webapp/WEB-INF/faces-config.xml =================================================================== --- announcement/trunk/src/main/webapp/WEB-INF/faces-config.xml (rev 0) +++ announcement/trunk/src/main/webapp/WEB-INF/faces-config.xml 2008-06-30 02:54:27 UTC (rev 1002) @@ -0,0 +1,19 @@ + + + + + + + + + + appMessages + + en + ja + + + + \ No newline at end of file Property changes on: announcement/trunk/src/main/webapp/WEB-INF/faces-config.xml ___________________________________________________________________ Name: svn:eol-style + native Added: announcement/trunk/src/main/webapp/WEB-INF/portlet.xml =================================================================== --- announcement/trunk/src/main/webapp/WEB-INF/portlet.xml (rev 0) +++ announcement/trunk/src/main/webapp/WEB-INF/portlet.xml 2008-06-30 02:54:27 UTC (rev 1002) @@ -0,0 +1,38 @@ + + + + AnnouncementPortlet + Announcement + Display and manage announcements. + org.apache.portals.bridges.portletfilter.FilterPortlet + + portlet-class + org.seasar.teeda.core.portlet.FacesPortlet + + + portlet-filters + jp.sf.pal.announcement.filter.AnnouncementFilter,jp.sf.pal.facesresponse.FacesResponseFilter,jp.sf.pal.pooptimizer.OptimizerFilter,org.seasar.portlet.filter.S2PortletFilter,org.seasar.portlet.filter.HotdeployPortletFilter + + + view-page + /view/view/displayContent.html + + + edit-page + /view/edit/editContent.html + + + text/html + VIEW + EDIT + + en + ja + + + Announcement + Announcement + Announcement + + + Property changes on: announcement/trunk/src/main/webapp/WEB-INF/portlet.xml ___________________________________________________________________ Name: svn:eol-style + native Added: announcement/trunk/src/main/webapp/WEB-INF/web.xml =================================================================== --- announcement/trunk/src/main/webapp/WEB-INF/web.xml (rev 0) +++ announcement/trunk/src/main/webapp/WEB-INF/web.xml 2008-06-30 02:54:27 UTC (rev 1002) @@ -0,0 +1,99 @@ + + + + + javax.faces.STATE_SAVING_METHOD + server + + State saving method: "client" or "server" (= default) + See JSF Specification 2.5.2 + + + + javax.faces.DEFAULT_SUFFIX + .html + + + s2filter + org.seasar.framework.container.filter.S2ContainerFilter + + + hotdeployfilter + org.seasar.framework.container.hotdeploy.HotdeployFilter + + + encodingfilter + org.seasar.extension.filter.EncodingFilter + + encoding + UTF-8 + + + + s2filter + /* + + + hotdeployfilter + /* + + + + encodingfilter + /* + + + + org.seasar.teeda.core.webapp.TeedaPortletExtendedConfigureListener + + + + facesServlet + javax.faces.webapp.FacesServlet + 2 + + + s2servlet + + org.seasar.framework.container.servlet.PortletExtendedS2ContainerServlet + 1 + + + facesServlet + /view/* + + + s2servlet + /s2servlet + + + + index.html + + + + User Auth + /view/* + + + manager + + + + BASIC + User Auth + + + admin + + + manager + + Property changes on: announcement/trunk/src/main/webapp/WEB-INF/web.xml ___________________________________________________________________ Name: svn:eol-style + native Added: announcement/trunk/src/main/webapp/fckeditor/editor/_source/classes/fckcontextmenu.js =================================================================== --- announcement/trunk/src/main/webapp/fckeditor/editor/_source/classes/fckcontextmenu.js (rev 0) +++ announcement/trunk/src/main/webapp/fckeditor/editor/_source/classes/fckcontextmenu.js 2008-06-30 02:54:27 UTC (rev 1002) @@ -0,0 +1,214 @@ +?/* + * FCKeditor - The text editor for Internet - http://www.fckeditor.net + * Copyright (C) 2003-2008 Frederico Caldeira Knabben + * + * == BEGIN LICENSE == + * + * Licensed under the terms of any of the following licenses at your + * choice: + * + * - GNU General Public License Version 2 or later (the "GPL") + * http://www.gnu.org/licenses/gpl.html + * + * - GNU Lesser General Public License Version 2.1 or later (the "LGPL") + * http://www.gnu.org/licenses/lgpl.html + * + * - Mozilla Public License Version 1.1 or later (the "MPL") + * http://www.mozilla.org/MPL/MPL-1.1.html + * + * == END LICENSE == + * + * FCKContextMenu Class: renders an control a context menu. + */ + +var FCKContextMenu = function( parentWindow, langDir ) +{ + this.CtrlDisable = false ; + + var oPanel = this._Panel = new FCKPanel( parentWindow ) ; + oPanel.AppendStyleSheet( FCKConfig.SkinEditorCSS ) ; + oPanel.IsContextMenu = true ; + + // The FCKTools.DisableSelection doesn't seems to work to avoid dragging of the icons in Mozilla + // so we stop the start of the dragging + if ( FCKBrowserInfo.IsGecko ) + oPanel.Document.addEventListener( 'draggesture', function(e) {e.preventDefault(); return false;}, true ) ; + + var oMenuBlock = this._MenuBlock = new FCKMenuBlock() ; + oMenuBlock.Panel = oPanel ; + oMenuBlock.OnClick = FCKTools.CreateEventListener( FCKContextMenu_MenuBlock_OnClick, this ) ; + + this._Redraw = true ; +} + + +FCKContextMenu.prototype.SetMouseClickWindow = function( mouseClickWindow ) +{ + if ( !FCKBrowserInfo.IsIE ) + { + this._Document = mouseClickWindow.document ; + if ( FCKBrowserInfo.IsOpera && !( 'oncontextmenu' in document.createElement('foo') ) ) + { + this._Document.addEventListener( 'mousedown', FCKContextMenu_Document_OnMouseDown, false ) ; + this._Document.addEventListener( 'mouseup', FCKContextMenu_Document_OnMouseUp, false ) ; + } + this._Document.addEventListener( 'contextmenu', FCKContextMenu_Document_OnContextMenu, false ) ; + } +} + +/** + The customData parameter is just a value that will be send to the command that is executed, + so it's possible to reuse the same command for several items just by assigning different data for each one. +*/ +FCKContextMenu.prototype.AddItem = function( name, label, iconPathOrStripInfoArrayOrIndex, isDisabled, customData ) +{ + var oItem = this._MenuBlock.AddItem( name, label, iconPathOrStripInfoArrayOrIndex, isDisabled, customData ) ; + this._Redraw = true ; + return oItem ; +} + +FCKContextMenu.prototype.AddSeparator = function() +{ + this._MenuBlock.AddSeparator() ; + this._Redraw = true ; +} + +FCKContextMenu.prototype.RemoveAllItems = function() +{ + this._MenuBlock.RemoveAllItems() ; + this._Redraw = true ; +} + +FCKContextMenu.prototype.AttachToElement = function( element ) +{ + if ( FCKBrowserInfo.IsIE ) + FCKTools.AddEventListenerEx( element, 'contextmenu', FCKContextMenu_AttachedElement_OnContextMenu, this ) ; + else + element._FCKContextMenu = this ; +} + +function FCKContextMenu_Document_OnContextMenu( e ) +{ + var el = e.target ; + + while ( el ) + { + if ( el._FCKContextMenu ) + { + if ( el._FCKContextMenu.CtrlDisable && ( e.ctrlKey || e.metaKey ) ) + return true ; + + FCKTools.CancelEvent( e ) ; + FCKContextMenu_AttachedElement_OnContextMenu( e, el._FCKContextMenu, el ) ; + return false ; + } + el = el.parentNode ; + } + return true ; +} + +var FCKContextMenu_OverrideButton ; + +function FCKContextMenu_Document_OnMouseDown( e ) +{ + if( !e || e.button != 2 ) + return false ; + + var el = e.target ; + + while ( el ) + { + if ( el._FCKContextMenu ) + { + if ( el._FCKContextMenu.CtrlDisable && ( e.ctrlKey || e.metaKey ) ) + return true ; + + var overrideButton = FCKContextMenu_OverrideButton ; + if( !overrideButton ) + { + var doc = FCKTools.GetElementDocument( e.target ) ; + overrideButton = FCKContextMenu_OverrideButton = doc.createElement('input') ; + overrideButton.type = 'button' ; + var buttonHolder = doc.createElement('p') ; + doc.body.appendChild( buttonHolder ) ; + buttonHolder.appendChild( overrideButton ) ; + } + + overrideButton.style.cssText = 'position:absolute;top:' + ( e.clientY - 2 ) + + 'px;left:' + ( e.clientX - 2 ) + + 'px;width:5px;height:5px;opacity:0.01' ; + } + el = el.parentNode ; + } + return false ; +} + +function FCKContextMenu_Document_OnMouseUp( e ) +{ + var overrideButton = FCKContextMenu_OverrideButton ; + + if ( overrideButton ) + { + var parent = overrideButton.parentNode ; + parent.parentNode.removeChild( parent ) ; + FCKContextMenu_OverrideButton = undefined ; + + if( e && e.button == 2 ) + { + FCKContextMenu_Document_OnContextMenu( e ) ; + return false ; + } + } + return true ; +} + +function FCKContextMenu_AttachedElement_OnContextMenu( ev, fckContextMenu, el ) +{ + if ( fckContextMenu.CtrlDisable && ( ev.ctrlKey || ev.metaKey ) ) + return true ; + + var eTarget = el || this ; + + if ( fckContextMenu.OnBeforeOpen ) + fckContextMenu.OnBeforeOpen.call( fckContextMenu, eTarget ) ; + + if ( fckContextMenu._MenuBlock.Count() == 0 ) + return false ; + + if ( fckContextMenu._Redraw ) + { + fckContextMenu._MenuBlock.Create( fckContextMenu._Panel.MainNode ) ; + fckContextMenu._Redraw = false ; + } + + // This will avoid that the content of the context menu can be dragged in IE + // as the content of the panel is recreated we need to do it every time + FCKTools.DisableSelection( fckContextMenu._Panel.Document.body ) ; + + var x = 0 ; + var y = 0 ; + if ( FCKBrowserInfo.IsIE ) + { + x = ev.screenX ; + y = ev.screenY ; + } + else if ( FCKBrowserInfo.IsSafari ) + { + x = ev.clientX ; + y = ev.clientY ; + } + else + { + x = ev.pageX ; + y = ev.pageY ; + } + fckContextMenu._Panel.Show( x, y, ev.currentTarget || null ) ; + + return false ; +} + +function FCKContextMenu_MenuBlock_OnClick( menuItem, contextMenu ) +{ + contextMenu._Panel.Hide() ; + FCKTools.RunFunction( contextMenu.OnItemClick, contextMenu, menuItem ) ; +} Property changes on: announcement/trunk/src/main/webapp/fckeditor/editor/_source/classes/fckcontextmenu.js ___________________________________________________________________ Name: svn:eol-style + native Added: announcement/trunk/src/main/webapp/fckeditor/editor/_source/classes/fckdataprocessor.js =================================================================== --- announcement/trunk/src/main/webapp/fckeditor/editor/_source/classes/fckdataprocessor.js (rev 0) +++ announcement/trunk/src/main/webapp/fckeditor/editor/_source/classes/fckdataprocessor.js 2008-06-30 02:54:27 UTC (rev 1002) @@ -0,0 +1,119 @@ +?/* + * FCKeditor - The text editor for Internet - http://www.fckeditor.net + * Copyright (C) 2003-2008 Frederico Caldeira Knabben + * + * == BEGIN LICENSE == + * + * Licensed under the terms of any of the following licenses at your + * choice: + * + * - GNU General Public License Version 2 or later (the "GPL") + * http://www.gnu.org/licenses/gpl.html + * + * - GNU Lesser General Public License Version 2.1 or later (the "LGPL") + * http://www.gnu.org/licenses/lgpl.html + * + * - Mozilla Public License Version 1.1 or later (the "MPL") + * http://www.mozilla.org/MPL/MPL-1.1.html + * + * == END LICENSE == + * + * The Data Processor is responsible for transforming the input and output data + * in the editor. For more info: + * http://dev.fckeditor.net/wiki/Components/DataProcessor + * + * The default implementation offers the base XHTML compatibility features of + * FCKeditor. Further Data Processors may be implemented for other purposes. + * + */ + +var FCKDataProcessor = function() +{} + +FCKDataProcessor.prototype = +{ + /* + * Returns a string representing the HTML format of "data". The returned + * value will be loaded in the editor. + * The HTML must be from to , including , and + * eventually the DOCTYPE. + * Note: HTML comments may already be part of the data because of the + * pre-processing made with ProtectedSource. + * @param {String} data The data to be converted in the + * DataProcessor specific format. + */ + ConvertToHtml : function( data ) + { + // The default data processor must handle two different cases depending + // on the FullPage setting. Custom Data Processors will not be + // compatible with FullPage, much probably. + if ( FCKConfig.FullPage ) + { + // Save the DOCTYPE. + FCK.DocTypeDeclaration = data.match( FCKRegexLib.DocTypeTag ) ; + + // Check if the tag is available. + if ( !FCKRegexLib.HasBodyTag.test( data ) ) + data = '' + data + '' ; + + // Check if the tag is available. + if ( !FCKRegexLib.HtmlOpener.test( data ) ) + data = '' + data + '' ; + + // Check if the tag is available. + if ( !FCKRegexLib.HeadOpener.test( data ) ) + data = data.replace( FCKRegexLib.HtmlOpener, '$&' ) ; + + return data ; + } + else + { + var html = + FCKConfig.DocType + + ' 0 && !FCKRegexLib.Html4DocType.test( FCKConfig.DocType ) ) + html += ' style="overflow-y: scroll"' ; + + html += '>' + + '' + + data + + '' ; + + return html ; + } + }, + + /* + * Converts a DOM (sub-)tree to a string in the data format. + * @param {Object} rootNode The node that contains the DOM tree to be + * converted to the data format. + * @param {Boolean} excludeRoot Indicates that the root node must not + * be included in the conversion, only its children. + * @param {Boolean} format Indicates that the data must be formatted + * for human reading. Not all Data Processors may provide it. + */ + ConvertToDataFormat : function( rootNode, excludeRoot, ignoreIfEmptyParagraph, format ) + { + var data = FCKXHtml.GetXHTML( rootNode, !excludeRoot, format ) ; + + if ( ignoreIfEmptyParagraph && FCKRegexLib.EmptyOutParagraph.test( data ) ) + return '' ; + + return data ; + }, + + /* + * Makes any necessary changes to a piece of HTML for insertion in the + * editor selection position. + * @param {String} html The HTML to be fixed. + */ + FixHtml : function( html ) + { + return html ; + } +} ; Property changes on: announcement/trunk/src/main/webapp/fckeditor/editor/_source/classes/fckdataprocessor.js ___________________________________________________________________ Name: svn:eol-style + native Added: announcement/trunk/src/main/webapp/fckeditor/editor/_source/classes/fckdocumentfragment_gecko.js =================================================================== --- announcement/trunk/src/main/webapp/fckeditor/editor/_source/classes/fckdocumentfragment_gecko.js (rev 0) +++ announcement/trunk/src/main/webapp/fckeditor/editor/_source/classes/fckdocumentfragment_gecko.js 2008-06-30 02:54:27 UTC (rev 1002) @@ -0,0 +1,46 @@ +?/* + * FCKeditor - The text editor for Internet - http://www.fckeditor.net + * Copyright (C) 2003-2008 Frederico Caldeira Knabben + * + * == BEGIN LICENSE == + * + * Licensed under the terms of any of the following licenses at your + * choice: + * + * - GNU General Public License Version 2 or later (the "GPL") + * http://www.gnu.org/licenses/gpl.html + * + * - GNU Lesser General Public License Version 2.1 or later (the "LGPL") + * http://www.gnu.org/licenses/lgpl.html + * + * - Mozilla Public License Version 1.1 or later (the "MPL") + * http://www.mozilla.org/MPL/MPL-1.1.html + * + * == END LICENSE == + * + * This is a generic Document Fragment object. It is not intended to provide + * the W3C implementation, but is a way to fix the missing of a real Document + * Fragment in IE (where document.createDocumentFragment() returns a normal + * document instead), giving a standard interface for it. + * (IE Implementation) + */ + +var FCKDocumentFragment = function( parentDocument, baseDocFrag ) +{ + this.RootNode = baseDocFrag || parentDocument.createDocumentFragment() ; +} + +FCKDocumentFragment.prototype = +{ + + // Append the contents of this Document Fragment to another element. + AppendTo : function( targetNode ) + { + targetNode.appendChild( this.RootNode ) ; + }, + + InsertAfterNode : function( existingNode ) + { + FCKDomTools.InsertAfterNode( existingNode, this.RootNode ) ; + } +} Property changes on: announcement/trunk/src/main/webapp/fckeditor/editor/_source/classes/fckdocumentfragment_gecko.js ___________________________________________________________________ Name: svn:eol-style + native Added: announcement/trunk/src/main/webapp/fckeditor/editor/_source/classes/fckdocumentfragment_ie.js =================================================================== --- announcement/trunk/src/main/webapp/fckeditor/editor/_source/classes/fckdocumentfragment_ie.js (rev 0) +++ announcement/trunk/src/main/webapp/fckeditor/editor/_source/classes/fckdocumentfragment_ie.js 2008-06-30 02:54:27 UTC (rev 1002) @@ -0,0 +1,58 @@ +?/* + * FCKeditor - The text editor for Internet - http://www.fckeditor.net + * Copyright (C) 2003-2008 Frederico Caldeira Knabben + * + * == BEGIN LICENSE == + * + * Licensed under the terms of any of the following licenses at your + * choice: + * + * - GNU General Public License Version 2 or later (the "GPL") + * http://www.gnu.org/licenses/gpl.html + * + * - GNU Lesser General Public License Version 2.1 or later (the "LGPL") + * http://www.gnu.org/licenses/lgpl.html + * + * - Mozilla Public License Version 1.1 or later (the "MPL") + * http://www.mozilla.org/MPL/MPL-1.1.html + * + * == END LICENSE == + * + * This is a generic Document Fragment object. It is not intended to provide + * the W3C implementation, but is a way to fix the missing of a real Document + * Fragment in IE (where document.createDocumentFragment() returns a normal + * document instead), giving a standard interface for it. + * (IE Implementation) + */ + +var FCKDocumentFragment = function( parentDocument ) +{ + this._Document = parentDocument ; + this.RootNode = parentDocument.createElement( 'div' ) ; +} + +// Append the contents of this Document Fragment to another node. +FCKDocumentFragment.prototype = +{ + + AppendTo : function( targetNode ) + { + FCKDomTools.MoveChildren( this.RootNode, targetNode ) ; + }, + + AppendHtml : function( html ) + { + var eTmpDiv = this._Document.createElement( 'div' ) ; + eTmpDiv.innerHTML = html ; + FCKDomTools.MoveChildren( eTmpDiv, this.RootNode ) ; + }, + + InsertAfterNode : function( existingNode ) + { + var eRoot = this.RootNode ; + var eLast ; + + while( ( eLast = eRoot.lastChild ) ) + FCKDomTools.InsertAfterNode( existingNode, eRoot.removeChild( eLast ) ) ; + } +} ; Property changes on: announcement/trunk/src/main/webapp/fckeditor/editor/_source/classes/fckdocumentfragment_ie.js ___________________________________________________________________ Name: svn:eol-style + native Added: announcement/trunk/src/main/webapp/fckeditor/editor/_source/classes/fckdomrange.js =================================================================== --- announcement/trunk/src/main/webapp/fckeditor/editor/_source/classes/fckdomrange.js (rev 0) +++ announcement/trunk/src/main/webapp/fckeditor/editor/_source/classes/fckdomrange.js 2008-06-30 02:54:27 UTC (rev 1002) @@ -0,0 +1,924 @@ +?/* + * FCKeditor - The text editor for Internet - http://www.fckeditor.net + * Copyright (C) 2003-2008 Frederico Caldeira Knabben + * + * == BEGIN LICENSE == + * + * Licensed under the terms of any of the following licenses at your + * choice: + * + * - GNU General Public License Version 2 or later (the "GPL") + * http://www.gnu.org/licenses/gpl.html + * + * - GNU Lesser General Public License Version 2.1 or later (the "LGPL") + * http://www.gnu.org/licenses/lgpl.html + * + * - Mozilla Public License Version 1.1 or later (the "MPL") + * http://www.mozilla.org/MPL/MPL-1.1.html + * + * == END LICENSE == + * + * Class for working with a selection range, much like the W3C DOM Range, but + * it is not intended to be an implementation of the W3C interface. + */ + +var FCKDomRange = function( sourceWindow ) +{ + this.Window = sourceWindow ; + this._Cache = {} ; +} + +FCKDomRange.prototype = +{ + + _UpdateElementInfo : function() + { + var innerRange = this._Range ; + + if ( !innerRange ) + this.Release( true ) ; + else + { + // For text nodes, the node itself is the StartNode. + var eStart = innerRange.startContainer ; + var eEnd = innerRange.endContainer ; + + var oElementPath = new FCKElementPath( eStart ) ; + this.StartNode = eStart.nodeType == 3 ? eStart : eStart.childNodes[ innerRange.startOffset ] ; + this.StartContainer = eStart ; + this.StartBlock = oElementPath.Block ; + this.StartBlockLimit = oElementPath.BlockLimit ; + + if ( eStart != eEnd ) + oElementPath = new FCKElementPath( eEnd ) ; + + // The innerRange.endContainer[ innerRange.endOffset ] is not + // usually part of the range, but the marker for the range end. So, + // let's get the previous available node as the real end. + var eEndNode = eEnd ; + if ( innerRange.endOffset == 0 ) + { + while ( eEndNode && !eEndNode.previousSibling ) + eEndNode = eEndNode.parentNode ; + + if ( eEndNode ) + eEndNode = eEndNode.previousSibling ; + } + else if ( eEndNode.nodeType == 1 ) + eEndNode = eEndNode.childNodes[ innerRange.endOffset - 1 ] ; + + this.EndNode = eEndNode ; + this.EndContainer = eEnd ; + this.EndBlock = oElementPath.Block ; + this.EndBlockLimit = oElementPath.BlockLimit ; + } + + this._Cache = {} ; + }, + + CreateRange : function() + { + return new FCKW3CRange( this.Window.document ) ; + }, + + DeleteContents : function() + { + if ( this._Range ) + { + this._Range.deleteContents() ; + this._UpdateElementInfo() ; + } + }, + + ExtractContents : function() + { + if ( this._Range ) + { + var docFrag = this._Range.extractContents() ; + this._UpdateElementInfo() ; + return docFrag ; + } + return null ; + }, + + CheckIsCollapsed : function() + { + if ( this._Range ) + return this._Range.collapsed ; + + return false ; + }, + + Collapse : function( toStart ) + { + if ( this._Range ) + this._Range.collapse( toStart ) ; + + this._UpdateElementInfo() ; + }, + + Clone : function() + { + var oClone = FCKTools.CloneObject( this ) ; + + if ( this._Range ) + oClone._Range = this._Range.cloneRange() ; + + return oClone ; + }, + + MoveToNodeContents : function( targetNode ) + { + if ( !this._Range ) + this._Range = this.CreateRange() ; + + this._Range.selectNodeContents( targetNode ) ; + + this._UpdateElementInfo() ; + }, + + MoveToElementStart : function( targetElement ) + { + this.SetStart(targetElement,1) ; + this.SetEnd(targetElement,1) ; + }, + + // Moves to the first editing point inside a element. For example, in a + // element tree like "

    Text

    ", the start editing point + // is "

    ^ Text

    " (inside ). + MoveToElementEditStart : function( targetElement ) + { + var editableElement ; + + while ( targetElement && targetElement.nodeType == 1 ) + { + if ( FCKDomTools.CheckIsEditable( targetElement ) ) + editableElement = targetElement ; + else if ( editableElement ) + break ; // If we already found an editable element, stop the loop. + + targetElement = targetElement.firstChild ; + } + + if ( editableElement ) + this.MoveToElementStart( editableElement ) ; + }, + + InsertNode : function( node ) + { + if ( this._Range ) + this._Range.insertNode( node ) ; + }, + + CheckIsEmpty : function() + { + if ( this.CheckIsCollapsed() ) + return true ; + + // Inserts the contents of the range in a div tag. + var eToolDiv = this.Window.document.createElement( 'div' ) ; + this._Range.cloneContents().AppendTo( eToolDiv ) ; + + FCKDomTools.TrimNode( eToolDiv ) ; + + return ( eToolDiv.innerHTML.length == 0 ) ; + }, + + /** + * Checks if the start boundary of the current range is "visually" (like a + * selection caret) at the beginning of the block. It means that some + * things could be brefore the range, like spaces or empty inline elements, + * but it would still be considered at the beginning of the block. + */ + CheckStartOfBlock : function() + { + var cache = this._Cache ; + var bIsStartOfBlock = cache.IsStartOfBlock ; + + if ( bIsStartOfBlock != undefined ) + return bIsStartOfBlock ; + + // Take the block reference. + var block = this.StartBlock || this.StartBlockLimit ; + + var container = this._Range.startContainer ; + var offset = this._Range.startOffset ; + var currentNode ; + + if ( offset > 0 ) + { + // First, check the start container. If it is a text node, get the + // substring of the node value before the range offset. + if ( container.nodeType == 3 ) + { + var textValue = container.nodeValue.substr( 0, offset ).Trim() ; + + // If we have some text left in the container, we are not at + // the end for the block. + if ( textValue.length != 0 ) + return cache.IsStartOfBlock = false ; + } + else + currentNode = container.childNodes[ offset - 1 ] ; + } + + // We'll not have a currentNode if the container was a text node, or + // the offset is zero. + if ( !currentNode ) + currentNode = FCKDomTools.GetPreviousSourceNode( container, true, null, block ) ; + + while ( currentNode ) + { + switch ( currentNode.nodeType ) + { + case 1 : + // It's not an inline element. + if ( !FCKListsLib.InlineChildReqElements[ currentNode.nodeName.toLowerCase() ] ) + return cache.IsStartOfBlock = false ; + + break ; + + case 3 : + // It's a text node with real text. + if ( currentNode.nodeValue.Trim().length > 0 ) + return cache.IsStartOfBlock = false ; + } + + currentNode = FCKDomTools.GetPreviousSourceNode( currentNode, false, null, block ) ; + } + + return cache.IsStartOfBlock = true ; + }, + + /** + * Checks if the end boundary of the current range is "visually" (like a + * selection caret) at the end of the block. It means that some things + * could be after the range, like spaces, empty inline elements, or a + * single
    , but it would still be considered at the end of the block. + */ + CheckEndOfBlock : function( refreshSelection ) + { + var isEndOfBlock = this._Cache.IsEndOfBlock ; + + if ( isEndOfBlock != undefined ) + return isEndOfBlock ; + + // Take the block reference. + var block = this.EndBlock || this.EndBlockLimit ; + + var container = this._Range.endContainer ; + var offset = this._Range.endOffset ; + var currentNode ; + + // First, check the end container. If it is a text node, get the + // substring of the node value after the range offset. + if ( container.nodeType == 3 ) + { + var textValue = container.nodeValue ; + if ( offset < textValue.length ) + { + textValue = textValue.substr( offset ) ; + + // If we have some text left in the container, we are not at + // the end for the block. + if ( textValue.Trim().length != 0 ) + return this._Cache.IsEndOfBlock = false ; + } + } + else + currentNode = container.childNodes[ offset ] ; + + // We'll not have a currentNode if the container was a text node, of + // the offset is out the container children limits (after it probably). + if ( !currentNode ) + currentNode = FCKDomTools.GetNextSourceNode( container, true, null, block ) ; + + var hadBr = false ; + + while ( currentNode ) + { + switch ( currentNode.nodeType ) + { + case 1 : + var nodeName = currentNode.nodeName.toLowerCase() ; + + // It's an inline element. + if ( FCKListsLib.InlineChildReqElements[ nodeName ] ) + break ; + + // It is the first
    found. + if ( nodeName == 'br' && !hadBr ) + { + hadBr = true ; + break ; + } + + return this._Cache.IsEndOfBlock = false ; + + case 3 : + // It's a text node with real text. + if ( currentNode.nodeValue.Trim().length > 0 ) + return this._Cache.IsEndOfBlock = false ; + } + + currentNode = FCKDomTools.GetNextSourceNode( currentNode, false, null, block ) ; + } + + if ( refreshSelection ) + this.Select() ; + + return this._Cache.IsEndOfBlock = true ; + }, + + // This is an "intrusive" way to create a bookmark. It includes tags + // in the range boundaries. The advantage of it is that it is possible to + // handle DOM mutations when moving back to the bookmark. + // Attention: the inclusion of nodes in the DOM is a design choice and + // should not be changed as there are other points in the code that may be + // using those nodes to perform operations. See GetBookmarkNode. + // For performance, includeNodes=true if intended to SelectBookmark. + CreateBookmark : function( includeNodes ) + { + // Create the bookmark info (random IDs). + var oBookmark = + { + StartId : (new Date()).valueOf() + Math.floor(Math.random()*1000) + 'S', + EndId : (new Date()).valueOf() + Math.floor(Math.random()*1000) + 'E' + } ; + + var oDoc = this.Window.document ; + var eStartSpan ; + var eEndSpan ; + var oClone ; + + // For collapsed ranges, add just the start marker. + if ( !this.CheckIsCollapsed() ) + { + eEndSpan = oDoc.createElement( 'span' ) ; + eEndSpan.style.display = 'none' ; + eEndSpan.id = oBookmark.EndId ; + eEndSpan.setAttribute( '_fck_bookmark', true ) ; + + // For IE, it must have something inside, otherwise it may be + // removed during DOM operations. +// if ( FCKBrowserInfo.IsIE ) + eEndSpan.innerHTML = ' ' ; + + oClone = this.Clone() ; + oClone.Collapse( false ) ; + oClone.InsertNode( eEndSpan ) ; + } + + eStartSpan = oDoc.createElement( 'span' ) ; + eStartSpan.style.display = 'none' ; + eStartSpan.id = oBookmark.StartId ; + eStartSpan.setAttribute( '_fck_bookmark', true ) ; + + // For IE, it must have something inside, otherwise it may be removed + // during DOM operations. +// if ( FCKBrowserInfo.IsIE ) + eStartSpan.innerHTML = ' ' ; + + oClone = this.Clone() ; + oClone.Collapse( true ) ; + oClone.InsertNode( eStartSpan ) ; + + if ( includeNodes ) + { + oBookmark.StartNode = eStartSpan ; + oBookmark.EndNode = eEndSpan ; + } + + // Update the range position. + if ( eEndSpan ) + { + this.SetStart( eStartSpan, 4 ) ; + this.SetEnd( eEndSpan, 3 ) ; + } + else + this.MoveToPosition( eStartSpan, 4 ) ; + + return oBookmark ; + }, + + // This one should be a part of a hypothetic "bookmark" object. + GetBookmarkNode : function( bookmark, start ) + { + var doc = this.Window.document ; + + if ( start ) + return bookmark.StartNode || doc.getElementById( bookmark.StartId ) ; + else + return bookmark.EndNode || doc.getElementById( bookmark.EndId ) ; + }, + + MoveToBookmark : function( bookmark, preserveBookmark ) + { + var eStartSpan = this.GetBookmarkNode( bookmark, true ) ; + var eEndSpan = this.GetBookmarkNode( bookmark, false ) ; + + this.SetStart( eStartSpan, 3 ) ; + + if ( !preserveBookmark ) + FCKDomTools.RemoveNode( eStartSpan ) ; + + // If collapsed, the end span will not be available. + if ( eEndSpan ) + { + this.SetEnd( eEndSpan, 3 ) ; + + if ( !preserveBookmark ) + FCKDomTools.RemoveNode( eEndSpan ) ; + } + else + this.Collapse( true ) ; + + this._UpdateElementInfo() ; + }, + + // Non-intrusive bookmark algorithm + CreateBookmark2 : function() + { + // If there is no range then get out of here. + // It happens on initial load in Safari #962 and if the editor it's hidden also in Firefox + if ( ! this._Range ) + return { "Start" : 0, "End" : 0 } ; + + // First, we record down the offset values + var bookmark = + { + "Start" : [ this._Range.startOffset ], + "End" : [ this._Range.endOffset ] + } ; + // Since we're treating the document tree as normalized, we need to backtrack the text lengths + // of previous text nodes into the offset value. + var curStart = this._Range.startContainer.previousSibling ; + var curEnd = this._Range.endContainer.previousSibling ; + + // Also note that the node that we use for "address base" would change during backtracking. + var addrStart = this._Range.startContainer ; + var addrEnd = this._Range.endContainer ; + while ( curStart && addrStart.nodeType == 3 ) + { + bookmark.Start[0] += curStart.length ; + addrStart = curStart ; + curStart = curStart.previousSibling ; + } + while ( curEnd && addrEnd.nodeType == 3 ) + { + bookmark.End[0] += curEnd.length ; + addrEnd = curEnd ; + curEnd = curEnd.previousSibling ; + } + + // If the object pointed to by the startOffset and endOffset are text nodes, we need + // to backtrack and add in the text offset to the bookmark addresses. + if ( addrStart.nodeType == 1 && addrStart.childNodes[bookmark.Start[0]] && addrStart.childNodes[bookmark.Start[0]].nodeType == 3 ) + { + var curNode = addrStart.childNodes[bookmark.Start[0]] ; + var offset = 0 ; + while ( curNode.previousSibling && curNode.previousSibling.nodeType == 3 ) + { + curNode = curNode.previousSibling ; + offset += curNode.length ; + } + addrStart = curNode ; + bookmark.Start[0] = offset ; + } + if ( addrEnd.nodeType == 1 && addrEnd.childNodes[bookmark.End[0]] && addrEnd.childNodes[bookmark.End[0]].nodeType == 3 ) + { + var curNode = addrEnd.childNodes[bookmark.End[0]] ; + var offset = 0 ; + while ( curNode.previousSibling && curNode.previousSibling.nodeType == 3 ) + { + curNode = curNode.previousSibling ; + offset += curNode.length ; + } + addrEnd = curNode ; + bookmark.End[0] = offset ; + } + + // Then, we record down the precise position of the container nodes + // by walking up the DOM tree and counting their childNode index + bookmark.Start = FCKDomTools.GetNodeAddress( addrStart, true ).concat( bookmark.Start ) ; + bookmark.End = FCKDomTools.GetNodeAddress( addrEnd, true ).concat( bookmark.End ) ; + return bookmark; + }, + + MoveToBookmark2 : function( bookmark ) + { + // Reverse the childNode counting algorithm in CreateBookmark2() + var curStart = FCKDomTools.GetNodeFromAddress( this.Window.document, bookmark.Start.slice( 0, -1 ), true ) ; + var curEnd = FCKDomTools.GetNodeFromAddress( this.Window.document, bookmark.End.slice( 0, -1 ), true ) ; + + // Generate the W3C Range object and update relevant data + this.Release( true ) ; + this._Range = new FCKW3CRange( this.Window.document ) ; + var startOffset = bookmark.Start[ bookmark.Start.length - 1 ] ; + var endOffset = bookmark.End[ bookmark.End.length - 1 ] ; + while ( curStart.nodeType == 3 && startOffset > curStart.length ) + { + if ( ! curStart.nextSibling || curStart.nextSibling.nodeType != 3 ) + break ; + startOffset -= curStart.length ; + curStart = curStart.nextSibling ; + } + while ( curEnd.nodeType == 3 && endOffset > curEnd.length ) + { + if ( ! curEnd.nextSibling || curEnd.nextSibling.nodeType != 3 ) + break ; + endOffset -= curEnd.length ; + curEnd = curEnd.nextSibling ; + } + this._Range.setStart( curStart, startOffset ) ; + this._Range.setEnd( curEnd, endOffset ) ; + this._UpdateElementInfo() ; + }, + + MoveToPosition : function( targetElement, position ) + { + this.SetStart( targetElement, position ) ; + this.Collapse( true ) ; + }, + + /* + * Moves the position of the start boundary of the range to a specific position + * relatively to a element. + * @position: + * 1 = After Start ^contents + * 2 = Before End contents^ + * 3 = Before Start ^contents + * 4 = After End contents^ + */ + SetStart : function( targetElement, position, noInfoUpdate ) + { + var oRange = this._Range ; + if ( !oRange ) + oRange = this._Range = this.CreateRange() ; + + switch( position ) + { + case 1 : // After Start ^contents + oRange.setStart( targetElement, 0 ) ; + break ; + + case 2 : // Before End contents^ + oRange.setStart( targetElement, targetElement.childNodes.length ) ; + break ; + + case 3 : // Before Start ^contents + oRange.setStartBefore( targetElement ) ; + break ; + + case 4 : // After End contents^ + oRange.setStartAfter( targetElement ) ; + } + + if ( !noInfoUpdate ) + this._UpdateElementInfo() ; + }, + + /* + * Moves the position of the start boundary of the range to a specific position + * relatively to a element. + * @position: + * 1 = After Start ^contents + * 2 = Before End contents^ + * 3 = Before Start ^contents + * 4 = After End contents^ + */ + SetEnd : function( targetElement, position, noInfoUpdate ) + { + var oRange = this._Range ; + if ( !oRange ) + oRange = this._Range = this.CreateRange() ; + + switch( position ) + { + case 1 : // After Start ^contents + oRange.setEnd( targetElement, 0 ) ; + break ; + + case 2 : // Before End contents^ + oRange.setEnd( targetElement, targetElement.childNodes.length ) ; + break ; + + case 3 : // Before Start ^contents + oRange.setEndBefore( targetElement ) ; + break ; + + case 4 : // After End contents^ + oRange.setEndAfter( targetElement ) ; + } + + if ( !noInfoUpdate ) + this._UpdateElementInfo() ; + }, + + Expand : function( unit ) + { + var oNode, oSibling ; + + switch ( unit ) + { + // Expand the range to include all inline parent elements if we are + // are in their boundary limits. + // For example (where [ ] are the range limits): + // Before => Some [Some sample text]. + // After => Some [Some sample text]. + case 'inline_elements' : + // Expand the start boundary. + if ( this._Range.startOffset == 0 ) + { + oNode = this._Range.startContainer ; + + if ( oNode.nodeType != 1 ) + oNode = oNode.previousSibling ? null : oNode.parentNode ; + + if ( oNode ) + { + while ( FCKListsLib.InlineNonEmptyElements[ oNode.nodeName.toLowerCase() ] ) + { + this._Range.setStartBefore( oNode ) ; + + if ( oNode != oNode.parentNode.firstChild ) + break ; + + oNode = oNode.parentNode ; + } + } + } + + // Expand the end boundary. + oNode = this._Range.endContainer ; + var offset = this._Range.endOffset ; + + if ( ( oNode.nodeType == 3 && offset >= oNode.nodeValue.length ) || ( oNode.nodeType == 1 && offset >= oNode.childNodes.length ) || ( oNode.nodeType != 1 && oNode.nodeType != 3 ) ) + { + if ( oNode.nodeType != 1 ) + oNode = oNode.nextSibling ? null : oNode.parentNode ; + + if ( oNode ) + { + while ( FCKListsLib.InlineNonEmptyElements[ oNode.nodeName.toLowerCase() ] ) + { + this._Range.setEndAfter( oNode ) ; + + if ( oNode != oNode.parentNode.lastChild ) + break ; + + oNode = oNode.parentNode ; + } + } + } + + break ; + + case 'block_contents' : + case 'list_contents' : + var boundarySet = FCKListsLib.BlockBoundaries ; + if ( unit == 'list_contents' || FCKConfig.EnterMode == 'br' ) + boundarySet = FCKListsLib.ListBoundaries ; + + if ( this.StartBlock && FCKConfig.EnterMode != 'br' && unit == 'block_contents' ) + this.SetStart( this.StartBlock, 1 ) ; + else + { + // Get the start node for the current range. + oNode = this._Range.startContainer ; + + // If it is an element, get the node right before of it (in source order). + if ( oNode.nodeType == 1 ) + { + var lastNode = oNode.childNodes[ this._Range.startOffset ] ; + if ( lastNode ) + oNode = FCKDomTools.GetPreviousSourceNode( lastNode, true ) ; + else + oNode = oNode.lastChild || oNode ; + } + + // We must look for the left boundary, relative to the range + // start, which is limited by a block element. + while ( oNode + && ( oNode.nodeType != 1 + || ( oNode != this.StartBlockLimit + && !boundarySet[ oNode.nodeName.toLowerCase() ] ) ) ) + { + this._Range.setStartBefore( oNode ) ; + oNode = oNode.previousSibling || oNode.parentNode ; + } + } + + if ( this.EndBlock && FCKConfig.EnterMode != 'br' && unit == 'block_contents' && this.EndBlock.nodeName.toLowerCase() != 'li' ) + this.SetEnd( this.EndBlock, 2 ) ; + else + { + oNode = this._Range.endContainer ; + if ( oNode.nodeType == 1 ) + oNode = oNode.childNodes[ this._Range.endOffset ] || oNode.lastChild ; + + // We must look for the right boundary, relative to the range + // end, which is limited by a block element. + while ( oNode + && ( oNode.nodeType != 1 + || ( oNode != this.StartBlockLimit + && !boundarySet[ oNode.nodeName.toLowerCase() ] ) ) ) + { + this._Range.setEndAfter( oNode ) ; + oNode = oNode.nextSibling || oNode.parentNode ; + } + + // In EnterMode='br', the end
    boundary element must + // be included in the expanded range. + if ( oNode && oNode.nodeName.toLowerCase() == 'br' ) + this._Range.setEndAfter( oNode ) ; + } + + this._UpdateElementInfo() ; + } + }, + + /** + * Split the block element for the current range. It deletes the contents + * of the range and splits the block in the collapsed position, resulting + * in two sucessive blocks. The range is then positioned in the middle of + * them. + * + * It returns and object with the following properties: + * - PreviousBlock : a reference to the block element that preceeds + * the range after the split. + * - NextBlock : a reference to the block element that follows the + * range after the split. + * - WasStartOfBlock : a boolean indicating that the range was + * originaly at the start of the block. + * - WasEndOfBlock : a boolean indicating that the range was originaly + * at the end of the block. + * + * If the range was originaly at the start of the block, no split will happen + * and the PreviousBlock value will be null. The same is valid for the + * NextBlock value if the range was at the end of the block. + */ + SplitBlock : function( forceBlockTag ) + { + var blockTag = forceBlockTag || FCKConfig.EnterMode ; + + if ( !this._Range ) + this.MoveToSelection() ; + + // The range boundaries must be in the same "block limit" element. + if ( this.StartBlockLimit == this.EndBlockLimit ) + { + // Get the current blocks. + var eStartBlock = this.StartBlock ; + var eEndBlock = this.EndBlock ; + var oElementPath = null ; + + if ( blockTag != 'br' ) + { + if ( !eStartBlock ) + { + eStartBlock = this.FixBlock( true, blockTag ) ; + eEndBlock = this.EndBlock ; // FixBlock may have fixed the EndBlock too. + } + + if ( !eEndBlock ) + eEndBlock = this.FixBlock( false, blockTag ) ; + } + + // Get the range position. + var bIsStartOfBlock = ( eStartBlock != null && this.CheckStartOfBlock() ) ; + var bIsEndOfBlock = ( eEndBlock != null && this.CheckEndOfBlock() ) ; + + // Delete the current contents. + if ( !this.CheckIsEmpty() ) + this.DeleteContents() ; + + if ( eStartBlock && eEndBlock && eStartBlock == eEndBlock ) + { + if ( bIsEndOfBlock ) + { + oElementPath = new FCKElementPath( this.StartContainer ) ; + this.MoveToPosition( eEndBlock, 4 ) ; + eEndBlock = null ; + } + else if ( bIsStartOfBlock ) + { + oElementPath = new FCKElementPath( this.StartContainer ) ; + this.MoveToPosition( eStartBlock, 3 ) ; + eStartBlock = null ; + } + else + { + // Extract the contents of the block from the selection point to the end of its contents. + this.SetEnd( eStartBlock, 2 ) ; + var eDocFrag = this.ExtractContents() ; + + // Duplicate the block element after it. + eEndBlock = eStartBlock.cloneNode( false ) ; + eEndBlock.removeAttribute( 'id', false ) ; + + // Place the extracted contents in the duplicated block. + eDocFrag.AppendTo( eEndBlock ) ; + + FCKDomTools.InsertAfterNode( eStartBlock, eEndBlock ) ; + + this.MoveToPosition( eStartBlock, 4 ) ; + + // In Gecko, the last child node must be a bogus
    . + // Note: bogus
    added under
      or
        would cause lists to be incorrectly rendered. + if ( FCKBrowserInfo.IsGecko && + ! eStartBlock.nodeName.IEquals( ['ul', 'ol'] ) ) + FCKTools.AppendBogusBr( eStartBlock ) ; + } + } + + return { + PreviousBlock : eStartBlock, + NextBlock : eEndBlock, + WasStartOfBlock : bIsStartOfBlock, + WasEndOfBlock : bIsEndOfBlock, + ElementPath : oElementPath + } ; + } + + return null ; + }, + + // Transform a block without a block tag in a valid block (orphan text in the body or td, usually). + FixBlock : function( isStart, blockTag ) + { + // Bookmark the range so we can restore it later. + var oBookmark = this.CreateBookmark() ; + + // Collapse the range to the requested ending boundary. + this.Collapse( isStart ) ; + + // Expands it to the block contents. + this.Expand( 'block_contents' ) ; + + // Create the fixed block. + var oFixedBlock = this.Window.document.createElement( blockTag ) ; + + // Move the contents of the temporary range to the fixed block. + this.ExtractContents().AppendTo( oFixedBlock ) ; + FCKDomTools.TrimNode( oFixedBlock ) ; + + // If the fixed block is empty (not counting bookmark nodes) + // Add a
        inside to expand it. + if ( FCKDomTools.CheckIsEmptyElement(oFixedBlock, function( element ) { return element.getAttribute('_fck_bookmark') != 'true' ; } ) + && FCKBrowserInfo.IsGeckoLike ) + FCKTools.AppendBogusBr( oFixedBlock ) ; + + // Insert the fixed block into the DOM. + this.InsertNode( oFixedBlock ) ; + + // Move the range back to the bookmarked place. + this.MoveToBookmark( oBookmark ) ; + + return oFixedBlock ; + }, + + Release : function( preserveWindow ) + { + if ( !preserveWindow ) + this.Window = null ; + + this.StartNode = null ; + this.StartContainer = null ; + this.StartBlock = null ; + this.StartBlockLimit = null ; + this.EndNode = null ; + this.EndContainer = null ; + this.EndBlock = null ; + this.EndBlockLimit = null ; + this._Range = null ; + this._Cache = null ; + }, + + CheckHasRange : function() + { + return !!this._Range ; + }, + + GetTouchedStartNode : function() + { + var range = this._Range ; + var container = range.startContainer ; + + if ( range.collapsed || container.nodeType != 1 ) + return container ; + + return container.childNodes[ range.startOffset ] || container ; + }, + + GetTouchedEndNode : function() + { + var range = this._Range ; + var container = range.endContainer ; + + if ( range.collapsed || container.nodeType != 1 ) + return container ; + + return container.childNodes[ range.endOffset - 1 ] || container ; + } +} ; Property changes on: announcement/trunk/src/main/webapp/fckeditor/editor/_source/classes/fckdomrange.js ___________________________________________________________________ Name: svn:eol-style + native Added: announcement/trunk/src/main/webapp/fckeditor/editor/_source/classes/fckdomrange_gecko.js =================================================================== --- announcement/trunk/src/main/webapp/fckeditor/editor/_source/classes/fckdomrange_gecko.js (rev 0) +++ announcement/trunk/src/main/webapp/fckeditor/editor/_source/classes/fckdomrange_gecko.js 2008-06-30 02:54:27 UTC (rev 1002) @@ -0,0 +1,104 @@ +?/* + * FCKeditor - The text editor for Internet - http://www.fckeditor.net + * Copyright (C) 2003-2008 Frederico Caldeira Knabben + * + * == BEGIN LICENSE == + * + * Licensed under the terms of any of the following licenses at your + * choice: + * + * - GNU General Public License Version 2 or later (the "GPL") + * http://www.gnu.org/licenses/gpl.html + * + * - GNU Lesser General Public License Version 2.1 or later (the "LGPL") + * http://www.gnu.org/licenses/lgpl.html + * + * - Mozilla Public License Version 1.1 or later (the "MPL") + * http://www.mozilla.org/MPL/MPL-1.1.html + * + * == END LICENSE == + * + * Class for working with a selection range, much like the W3C DOM Range, but + * it is not intended to be an implementation of the W3C interface. + * (Gecko Implementation) + */ + +FCKDomRange.prototype.MoveToSelection = function() +{ + this.Release( true ) ; + + var oSel = this.Window.getSelection() ; + + if ( oSel && oSel.rangeCount > 0 ) + { + this._Range = FCKW3CRange.CreateFromRange( this.Window.document, oSel.getRangeAt(0) ) ; + this._UpdateElementInfo() ; + } + else + if ( this.Window.document ) + this.MoveToElementStart( this.Window.document.body ) ; +} + +FCKDomRange.prototype.Select = function() +{ + var oRange = this._Range ; + if ( oRange ) + { + var startContainer = oRange.startContainer ; + + // If we have a collapsed range, inside an empty element, we must add + // something to it, otherwise the caret will not be visible. + if ( oRange.collapsed && startContainer.nodeType == 1 && startContainer.childNodes.length == 0 ) + startContainer.appendChild( oRange._Document.createTextNode('') ) ; + + var oDocRange = this.Window.document.createRange() ; + oDocRange.setStart( startContainer, oRange.startOffset ) ; + + try + { + oDocRange.setEnd( oRange.endContainer, oRange.endOffset ) ; + } + catch ( e ) + { + // There is a bug in Firefox implementation (it would be too easy + // otherwise). The new start can't be after the end (W3C says it can). + // So, let's create a new range and collapse it to the desired point. + if ( e.toString().Contains( 'NS_ERROR_ILLEGAL_VALUE' ) ) + { + oRange.collapse( true ) ; + oDocRange.setEnd( oRange.endContainer, oRange.endOffset ) ; + } + else + throw( e ) ; + } + + var oSel = this.Window.getSelection() ; + oSel.removeAllRanges() ; + + // We must add a clone otherwise Firefox will have rendering issues. + oSel.addRange( oDocRange ) ; + } +} + +// Not compatible with bookmark created with CreateBookmark2. +// The bookmark nodes will be deleted from the document. +FCKDomRange.prototype.SelectBookmark = function( bookmark ) +{ + var domRange = this.Window.document.createRange() ; + + var startNode = this.GetBookmarkNode( bookmark, true ) ; + var endNode = this.GetBookmarkNode( bookmark, false ) ; + + domRange.setStart( startNode.parentNode, FCKDomTools.GetIndexOf( startNode ) ) ; + FCKDomTools.RemoveNode( startNode ) ; + + if ( endNode ) + { + domRange.setEnd( endNode.parentNode, FCKDomTools.GetIndexOf( endNode ) ) ; + FCKDomTools.RemoveNode( endNode ) ; + } + + var selection = this.Window.getSelection() ; + selection.removeAllRanges() ; + selection.addRange( domRange ) ; +} Property changes on: announcement/trunk/src/main/webapp/fckeditor/editor/_source/classes/fckdomrange_gecko.js ___________________________________________________________________ Name: svn:eol-style + native Added: announcement/trunk/src/main/webapp/fckeditor/editor/_source/classes/fckdomrange_ie.js =================================================================== --- announcement/trunk/src/main/webapp/fckeditor/editor/_source/classes/fckdomrange_ie.js (rev 0) +++ announcement/trunk/src/main/webapp/fckeditor/editor/_source/classes/fckdomrange_ie.js 2008-06-30 02:54:27 UTC (rev 1002) @@ -0,0 +1,199 @@ +?/* + * FCKeditor - The text editor for Internet - http://www.fckeditor.net + * Copyright (C) 2003-2008 Frederico Caldeira Knabben + * + * == BEGIN LICENSE == + * + * Licensed under the terms of any of the following licenses at your + * choice: + * + * - GNU General Public License Version 2 or later (the "GPL") + * http://www.gnu.org/licenses/gpl.html + * + * - GNU Lesser General Public License Version 2.1 or later (the "LGPL") + * http://www.gnu.org/licenses/lgpl.html + * + * - Mozilla Public License Version 1.1 or later (the "MPL") + * http://www.mozilla.org/MPL/MPL-1.1.html + * + * == END LICENSE == + * + * Class for working with a selection range, much like the W3C DOM Range, but + * it is not intended to be an implementation of the W3C interface. + * (IE Implementation) + */ + +FCKDomRange.prototype.MoveToSelection = function() +{ + this.Release( true ) ; + + this._Range = new FCKW3CRange( this.Window.document ) ; + + var oSel = this.Window.document.selection ; + + if ( oSel.type != 'Control' ) + { + var eMarkerStart = this._GetSelectionMarkerTag( true ) ; + var eMarkerEnd = this._GetSelectionMarkerTag( false ) ; + + if ( !eMarkerStart && !eMarkerEnd ) + { + this._Range.setStart( this.Window.document.body, 0 ) ; + this._UpdateElementInfo() ; + return ; + } + + // Set the start boundary. + this._Range.setStart( eMarkerStart.parentNode, FCKDomTools.GetIndexOf( eMarkerStart ) ) ; + eMarkerStart.parentNode.removeChild( eMarkerStart ) ; + + // Set the end boundary. + this._Range.setEnd( eMarkerEnd.parentNode, FCKDomTools.GetIndexOf( eMarkerEnd ) ) ; + eMarkerEnd.parentNode.removeChild( eMarkerEnd ) ; + + this._UpdateElementInfo() ; + } + else + { + var oControl = oSel.createRange().item(0) ; + + if ( oControl ) + { + this._Range.setStartBefore( oControl ) ; + this._Range.setEndAfter( oControl ) ; + this._UpdateElementInfo() ; + } + } +} + +FCKDomRange.prototype.Select = function( forceExpand ) +{ + if ( this._Range ) + this.SelectBookmark( this.CreateBookmark( true ), forceExpand ) ; +} + +// Not compatible with bookmark created with CreateBookmark2. +// The bookmark nodes will be deleted from the document. +FCKDomRange.prototype.SelectBookmark = function( bookmark, forceExpand ) +{ + var bIsCollapsed = this.CheckIsCollapsed() ; + var bIsStartMakerAlone ; + var dummySpan ; + + // Create marker tags for the start and end boundaries. + var eStartMarker = this.GetBookmarkNode( bookmark, true ) ; + + if ( !eStartMarker ) + return ; + + var eEndMarker ; + if ( !bIsCollapsed ) + eEndMarker = this.GetBookmarkNode( bookmark, false ) ; + + // Create the main range which will be used for the selection. + var oIERange = this.Window.document.body.createTextRange() ; + + // Position the range at the start boundary. + oIERange.moveToElementText( eStartMarker ) ; + oIERange.moveStart( 'character', 1 ) ; + + if ( eEndMarker ) + { + // Create a tool range for the end. + var oIERangeEnd = this.Window.document.body.createTextRange() ; + + // Position the tool range at the end. + oIERangeEnd.moveToElementText( eEndMarker ) ; + + // Move the end boundary of the main range to match the tool range. + oIERange.setEndPoint( 'EndToEnd', oIERangeEnd ) ; + oIERange.moveEnd( 'character', -1 ) ; + } + else + { + bIsStartMakerAlone = ( forceExpand || !eStartMarker.previousSibling || eStartMarker.previousSibling.nodeName.toLowerCase() == 'br' ) && !eStartMarker.nextSibing ; + + // Append a temporary  before the selection. + // This is needed to avoid IE destroying selections inside empty + // inline elements, like (#253). + // It is also needed when placing the selection right after an inline + // element to avoid the selection moving inside of it. + dummySpan = this.Window.document.createElement( 'span' ) ; + dummySpan.innerHTML = '' ; // Zero Width No-Break Space (U+FEFF). See #1359. + eStartMarker.parentNode.insertBefore( dummySpan, eStartMarker ) ; + + if ( bIsStartMakerAlone ) + { + // To expand empty blocks or line spaces after
        , we need + // instead to have any char, which will be later deleted using the + // selection. + // \ufeff = Zero Width No-Break Space (U+FEFF). See #1359. + eStartMarker.parentNode.insertBefore( this.Window.document.createTextNode( '\ufeff' ), eStartMarker ) ; + } + } + + if ( !this._Range ) + this._Range = this.CreateRange() ; + + // Remove the markers (reset the position, because of the changes in the DOM tree). + this._Range.setStartBefore( eStartMarker ) ; + eStartMarker.parentNode.removeChild( eStartMarker ) ; + + if ( bIsCollapsed ) + { + if ( bIsStartMakerAlone ) + { + // Move the selection start to include the temporary . + oIERange.moveStart( 'character', -1 ) ; + + oIERange.select() ; + + // Remove our temporary stuff. + this.Window.document.selection.clear() ; + } + else + oIERange.select() ; + + FCKDomTools.RemoveNode( dummySpan ) ; + } + else + { + this._Range.setEndBefore( eEndMarker ) ; + eEndMarker.parentNode.removeChild( eEndMarker ) ; + oIERange.select() ; + } +} + +FCKDomRange.prototype._GetSelectionMarkerTag = function( toStart ) +{ + var doc = this.Window.document ; + var selection = doc.selection ; + + // Get a range for the start boundary. + var oRange ; + + // IE may throw an "unspecified error" on some cases (it happened when + // loading _samples/default.html), so try/catch. + try + { + oRange = selection.createRange() ; + } + catch (e) + { + return null ; + } + + // IE might take the range object to the main window instead of inside the editor iframe window. + // This is known to happen when the editor window has not been selected before (See #933). + // We need to avoid that. + if ( oRange.parentElement().document != doc ) + return null ; + + oRange.collapse( toStart === true ) ; + + // Paste a marker element at the collapsed range and get it from the DOM. + var sMarkerId = 'fck_dom_range_temp_' + (new Date()).valueOf() + '_' + Math.floor(Math.random()*1000) ; + oRange.pasteHTML( '' ) ; + + return doc.getElementById( sMarkerId ) ; +} Property changes on: announcement/trunk/src/main/webapp/fckeditor/editor/_source/classes/fckdomrange_ie.js ___________________________________________________________________ Name: svn:eol-style + native Added: announcement/trunk/src/main/webapp/fckeditor/editor/_source/classes/fckdomrangeiterator.js =================================================================== --- announcement/trunk/src/main/webapp/fckeditor/editor/_source/classes/fckdomrangeiterator.js (rev 0) +++ announcement/trunk/src/main/webapp/fckeditor/editor/_source/classes/fckdomrangeiterator.js 2008-06-30 02:54:27 UTC (rev 1002) @@ -0,0 +1,327 @@ +?/* + * FCKeditor - The text editor for Internet - http://www.fckeditor.net + * Copyright (C) 2003-2008 Frederico Caldeira Knabben + * + * == BEGIN LICENSE == + * + * Licensed under the terms of any of the following licenses at your + * choice: + * + * - GNU General Public License Version 2 or later (the "GPL") + * http://www.gnu.org/licenses/gpl.html + * + * - GNU Lesser General Public License Version 2.1 or later (the "LGPL") + * http://www.gnu.org/licenses/lgpl.html + * + * - Mozilla Public License Version 1.1 or later (the "MPL") + * http://www.mozilla.org/MPL/MPL-1.1.html + * + * == END LICENSE == + * + * This class can be used to interate through nodes inside a range. + * + * During interation, the provided range can become invalid, due to document + * mutations, so CreateBookmark() used to restore it after processing, if + * needed. + */ + +var FCKDomRangeIterator = function( range ) +{ + /** + * The FCKDomRange object that marks the interation boundaries. + */ + this.Range = range ; + + /** + * Indicates that
        elements must be used as paragraph boundaries. + */ + this.ForceBrBreak = false ; + + /** + * Guarantees that the iterator will always return "real" block elements. + * If "false", elements like
      1. , and are returned. If "true", a + * dedicated block element block element will be created inside those + * elements to hold the selected content. + */ + this.EnforceRealBlocks = false ; +} + +FCKDomRangeIterator.CreateFromSelection = function( targetWindow ) +{ + var range = new FCKDomRange( targetWindow ) ; + range.MoveToSelection() ; + return new FCKDomRangeIterator( range ) ; +} + +FCKDomRangeIterator.prototype = +{ + /** + * Get the next paragraph element. It automatically breaks the document + * when necessary to generate block elements for the paragraphs. + */ + GetNextParagraph : function() + { + // The block element to be returned. + var block ; + + // The range object used to identify the paragraph contents. + var range ; + + // Indicated that the current element in the loop is the last one. + var isLast ; + + // Instructs to cleanup remaining BRs. + var removePreviousBr ; + var removeLastBr ; + + var boundarySet = this.ForceBrBreak ? FCKListsLib.ListBoundaries : FCKListsLib.BlockBoundaries ; + + // This is the first iteration. Let's initialize it. + if ( !this._LastNode ) + { + var range = this.Range.Clone() ; + range.Expand( this.ForceBrBreak ? 'list_contents' : 'block_contents' ) ; + + this._NextNode = range.GetTouchedStartNode() ; + this._LastNode = range.GetTouchedEndNode() ; + + // Let's reuse this variable. + range = null ; + } + + var currentNode = this._NextNode ; + var lastNode = this._LastNode ; + + this._NextNode = null ; + + while ( currentNode ) + { + // closeRange indicates that a paragraph boundary has been found, + // so the range can be closed. + var closeRange = false ; + + // includeNode indicates that the current node is good to be part + // of the range. By default, any non-element node is ok for it. + var includeNode = ( currentNode.nodeType != 1 ) ; + + var continueFromSibling = false ; + + // If it is an element node, let's check if it can be part of the + // range. + if ( !includeNode ) + { + var nodeName = currentNode.nodeName.toLowerCase() ; + + if ( boundarySet[ nodeName ] && ( !FCKBrowserInfo.IsIE || currentNode.scopeName == 'HTML' ) ) + { + //
        boundaries must be part of the range. It will + // happen only if ForceBrBreak. + if ( nodeName == 'br' ) + includeNode = true ; + else if ( !range && currentNode.childNodes.length == 0 && nodeName != 'hr' ) + { + // If we have found an empty block, and haven't started + // the range yet, it means we must return this block. + block = currentNode ; + isLast = currentNode == lastNode ; + break ; + } + + // The range must finish right before the boundary, + // including possibly skipped empty spaces. (#1603) + if ( range ) + { + range.SetEnd( currentNode, 3, true ) ; + + // The found boundary must be set as the next one at this + // point. (#1717) + if ( nodeName != 'br' ) + this._NextNode = currentNode ; + } + + closeRange = true ; + } + else + { + // If we have child nodes, let's check them. + if ( currentNode.firstChild ) + { + // If we don't have a range yet, let's start it. + if ( !range ) + { + range = new FCKDomRange( this.Range.Window ) ; + range.SetStart( currentNode, 3, true ) ; + } + + currentNode = currentNode.firstChild ; + continue ; + } + includeNode = true ; + } + } + else if ( currentNode.nodeType == 3 ) + { + // Ignore normal whitespaces (i.e. not including   or + // other unicode whitespaces) before/after a block node. + if ( /^[\r\n\t ]+$/.test( currentNode.nodeValue ) ) + includeNode = false ; + } + + // The current node is good to be part of the range and we are + // starting a new range, initialize it first. + if ( includeNode && !range ) + { + range = new FCKDomRange( this.Range.Window ) ; + range.SetStart( currentNode, 3, true ) ; + } + + // The last node has been found. + isLast = ( ( !closeRange || includeNode ) && currentNode == lastNode ) ; +// isLast = ( currentNode == lastNode && ( currentNode.nodeType != 1 || currentNode.childNodes.length == 0 ) ) ; + + // If we are in an element boundary, let's check if it is time + // to close the range, otherwise we include the parent within it. + if ( range && !closeRange ) + { + while ( !currentNode.nextSibling && !isLast ) + { + var parentNode = currentNode.parentNode ; + + if ( boundarySet[ parentNode.nodeName.toLowerCase() ] ) + { + closeRange = true ; + isLast = isLast || ( parentNode == lastNode ) ; + break ; + } + + currentNode = parentNode ; + includeNode = true ; + isLast = ( currentNode == lastNode ) ; + continueFromSibling = true ; + } + } + + // Now finally include the node. + if ( includeNode ) + range.SetEnd( currentNode, 4, true ) ; + + // We have found a block boundary. Let's close the range and move out of the + // loop. + if ( ( closeRange || isLast ) && range ) + { + range._UpdateElementInfo() ; + + if ( range.StartNode == range.EndNode + && range.StartNode.parentNode == range.StartBlockLimit + && range.StartNode.getAttribute && range.StartNode.getAttribute( '_fck_bookmark' ) ) + range = null ; + else + break ; + } + + if ( isLast ) + break ; + + currentNode = FCKDomTools.GetNextSourceNode( currentNode, continueFromSibling, null, lastNode ) ; + } + + // Now, based on the processed range, look for (or create) the block to be returned. + if ( !block ) + { + // If no range has been found, this is the end. + if ( !range ) + { + this._NextNode = null ; + return null ; + } + + block = range.StartBlock ; + + if ( !block + && !this.EnforceRealBlocks + && range.StartBlockLimit.nodeName.IEquals( 'DIV', 'TH', 'TD' ) + && range.CheckStartOfBlock() + && range.CheckEndOfBlock() ) + { + block = range.StartBlockLimit ; + } + else if ( !block || ( this.EnforceRealBlocks && block.nodeName.toLowerCase() == 'li' ) ) + { + // Create the fixed block. + block = this.Range.Window.document.createElement( FCKConfig.EnterMode == 'p' ? 'p' : 'div' ) ; + + // Move the contents of the temporary range to the fixed block. + range.ExtractContents().AppendTo( block ) ; + FCKDomTools.TrimNode( block ) ; + + // Insert the fixed block into the DOM. + range.InsertNode( block ) ; + + removePreviousBr = true ; + removeLastBr = true ; + } + else if ( block.nodeName.toLowerCase() != 'li' ) + { + // If the range doesn't includes the entire contents of the + // block, we must split it, isolating the range in a dedicated + // block. + if ( !range.CheckStartOfBlock() || !range.CheckEndOfBlock() ) + { + // The resulting block will be a clone of the current one. + block = block.cloneNode( false ) ; + + // Extract the range contents, moving it to the new block. + range.ExtractContents().AppendTo( block ) ; + FCKDomTools.TrimNode( block ) ; + + // Split the block. At this point, the range will be in the + // right position for our intents. + var splitInfo = range.SplitBlock() ; + + removePreviousBr = !splitInfo.WasStartOfBlock ; + removeLastBr = !splitInfo.WasEndOfBlock ; + + // Insert the new block into the DOM. + range.InsertNode( block ) ; + } + } + else if ( !isLast ) + { + // LIs are returned as is, with all their children (due to the + // nested lists). But, the next node is the node right after + // the current range, which could be an
      2. child (nested + // lists) or the next sibling
      3. . + + this._NextNode = block == lastNode ? null : FCKDomTools.GetNextSourceNode( range.EndNode, true, null, lastNode ) ; + return block ; + } + } + + if ( removePreviousBr ) + { + var previousSibling = block.previousSibling ; + if ( previousSibling && previousSibling.nodeType == 1 ) + { + if ( previousSibling.nodeName.toLowerCase() == 'br' ) + previousSibling.parentNode.removeChild( previousSibling ) ; + else if ( previousSibling.lastChild && previousSibling.lastChild.nodeName.IEquals( 'br' ) ) + previousSibling.removeChild( previousSibling.lastChild ) ; + } + } + + if ( removeLastBr ) + { + var lastChild = block.lastChild ; + if ( lastChild && lastChild.nodeType == 1 && lastChild.nodeName.toLowerCase() == 'br' ) + block.removeChild( lastChild ) ; + } + + // Get a reference for the next element. This is important because the + // above block can be removed or changed, so we can rely on it for the + // next interation. + if ( !this._NextNode ) + this._NextNode = ( isLast || block == lastNode ) ? null : FCKDomTools.GetNextSourceNode( block, true, null, lastNode ) ; + + return block ; + } +} ; Property changes on: announcement/trunk/src/main/webapp/fckeditor/editor/_source/classes/fckdomrangeiterator.js ___________________________________________________________________ Name: svn:eol-style + native Added: announcement/trunk/src/main/webapp/fckeditor/editor/_source/classes/fckeditingarea.js =================================================================== --- announcement/trunk/src/main/webapp/fckeditor/editor/_source/classes/fckeditingarea.js (rev 0) +++ announcement/trunk/src/main/webapp/fckeditor/editor/_source/classes/fckeditingarea.js 2008-06-30 02:54:27 UTC (rev 1002) @@ -0,0 +1,363 @@ +?/* + * FCKeditor - The text editor for Internet - http://www.fckeditor.net + * Copyright (C) 2003-2008 Frederico Caldeira Knabben + * + * == BEGIN LICENSE == + * + * Licensed under the terms of any of the following licenses at your + * choice: + * + * - GNU General Public License Version 2 or later (the "GPL") + * http://www.gnu.org/licenses/gpl.html + * + * - GNU Lesser General Public License Version 2.1 or later (the "LGPL") + * http://www.gnu.org/licenses/lgpl.html + * + * - Mozilla Public License Version 1.1 or later (the "MPL") + * http://www.mozilla.org/MPL/MPL-1.1.html + * + * == END LICENSE == + * + * FCKEditingArea Class: renders an editable area. + */ + +/** + * @constructor + * @param {String} targetElement The element that will hold the editing area. Any child element present in the target will be deleted. + */ +var FCKEditingArea = function( targetElement ) +{ + this.TargetElement = targetElement ; + this.Mode = FCK_EDITMODE_WYSIWYG ; + + if ( FCK.IECleanup ) + FCK.IECleanup.AddItem( this, FCKEditingArea_Cleanup ) ; +} + + +/** + * @param {String} html The complete HTML for the page, including DOCTYPE and the tag. + */ +FCKEditingArea.prototype.Start = function( html, secondCall ) +{ + var eTargetElement = this.TargetElement ; + var oTargetDocument = FCKTools.GetElementDocument( eTargetElement ) ; + + // Remove all child nodes from the target. + while( eTargetElement.firstChild ) + eTargetElement.removeChild( eTargetElement.firstChild ) ; + + if ( this.Mode == FCK_EDITMODE_WYSIWYG ) + { + // For FF, document.domain must be set only when different, otherwhise + // we'll strangely have "Permission denied" issues. + if ( FCK_IS_CUSTOM_DOMAIN ) + html = '' + html ; + + // IE has a bug with the tag... it must have a closer, + // otherwise the all successive tags will be set as children nodes of the . + if ( FCKBrowserInfo.IsIE ) + html = html.replace( /(]*?)\s*\/?>(?!\s*<\/base>)/gi, '$1>' ) ; + else if ( !secondCall ) + { + // Gecko moves some tags out of the body to the head, so we must use + // innerHTML to set the body contents (SF BUG 1526154). + + // Extract the BODY contents from the html. + var oMatchBefore = html.match( FCKRegexLib.BeforeBody ) ; + var oMatchAfter = html.match( FCKRegexLib.AfterBody ) ; + + if ( oMatchBefore && oMatchAfter ) + { + var sBody = html.substr( oMatchBefore[1].length, + html.length - oMatchBefore[1].length - oMatchAfter[1].length ) ; // This is the BODY tag contents. + + html = + oMatchBefore[1] + // This is the HTML until the tag, inclusive. + ' ' + + oMatchAfter[1] ; // This is the HTML from the tag, inclusive. + + // If nothing in the body, place a BOGUS tag so the cursor will appear. + if ( FCKBrowserInfo.IsGecko && ( sBody.length == 0 || FCKRegexLib.EmptyParagraph.test( sBody ) ) ) + sBody = '
        ' ; + + this._BodyHTML = sBody ; + + } + else + this._BodyHTML = html ; // Invalid HTML input. + } + + // Create the editing area IFRAME. + var oIFrame = this.IFrame = oTargetDocument.createElement( 'iframe' ) ; + + // IE: Avoid JavaScript errors thrown by the editing are source (like tags events). + // See #1055. + var sOverrideError = '' ; + + oIFrame.frameBorder = 0 ; + oIFrame.style.width = oIFrame.style.height = '100%' ; + + if ( FCK_IS_CUSTOM_DOMAIN && FCKBrowserInfo.IsIE ) + { + window._FCKHtmlToLoad = html.replace( //i, '' + sOverrideError ) ; + oIFrame.src = 'javascript:void( (function(){' + + 'document.open() ;' + + 'document.domain="' + document.domain + '" ;' + + 'document.write( window.parent._FCKHtmlToLoad );' + + 'document.close() ;' + + 'window.parent._FCKHtmlToLoad = null ;' + + '})() )' ; + } + else if ( !FCKBrowserInfo.IsGecko ) + { + // Firefox will render the tables inside the body in Quirks mode if the + // source of the iframe is set to javascript. see #515 + oIFrame.src = 'javascript:void(0)' ; + } + + // Append the new IFRAME to the target. For IE, it must be done after + // setting the "src", to avoid the "secure/unsecure" message under HTTPS. + eTargetElement.appendChild( oIFrame ) ; + + // Get the window and document objects used to interact with the newly created IFRAME. + this.Window = oIFrame.contentWindow ; + + // IE: Avoid JavaScript errors thrown by the editing are source (like tags events). + // TODO: This error handler is not being fired. + // this.Window.onerror = function() { alert( 'Error!' ) ; return true ; } + + if ( !FCK_IS_CUSTOM_DOMAIN || !FCKBrowserInfo.IsIE ) + { + var oDoc = this.Window.document ; + + oDoc.open() ; + oDoc.write( html.replace( //i, '' + sOverrideError ) ) ; + oDoc.close() ; + } + + if ( FCKBrowserInfo.IsAIR ) + FCKAdobeAIR.EditingArea_Start( oDoc, html ) ; + + // Firefox 1.0.x is buggy... ohh yes... so let's do it two times and it + // will magically work. + if ( FCKBrowserInfo.IsGecko10 && !secondCall ) + { + this.Start( html, true ) ; + return ; + } + + if ( oIFrame.readyState && oIFrame.readyState != 'completed' ) + { + var editArea = this ; + ( oIFrame.onreadystatechange = function() + { + if ( oIFrame.readyState == 'complete' ) + { + oIFrame.onreadystatechange = null ; + editArea.Window._FCKEditingArea = editArea ; + FCKEditingArea_CompleteStart.call( editArea.Window ) ; + } + // It happened that IE changed the state to "complete" after the + // "if" and before the "onreadystatechange" assignement, making we + // lost the event call, so we do a manual call just to be sure. + } )() ; + } + else + { + this.Window._FCKEditingArea = this ; + + // FF 1.0.x is buggy... we must wait a lot to enable editing because + // sometimes the content simply disappears, for example when pasting + // "bla1!!bla2" in the source and then switching + // back to design. + if ( FCKBrowserInfo.IsGecko10 ) + this.Window.setTimeout( FCKEditingArea_CompleteStart, 500 ) ; + else + FCKEditingArea_CompleteStart.call( this.Window ) ; + } + } + else + { + var eTextarea = this.Textarea = oTargetDocument.createElement( 'textarea' ) ; + eTextarea.className = 'SourceField' ; + eTextarea.dir = 'ltr' ; + FCKDomTools.SetElementStyles( eTextarea, + { + width : '100%', + height : '100%', + border : 'none', + resize : 'none', + outline : 'none' + } ) ; + eTargetElement.appendChild( eTextarea ) ; + + eTextarea.value = html ; + + // Fire the "OnLoad" event. + FCKTools.RunFunction( this.OnLoad ) ; + } +} + +// "this" here is FCKEditingArea.Window +function FCKEditingArea_CompleteStart() +{ + // On Firefox, the DOM takes a little to become available. So we must wait for it in a loop. + if ( !this.document.body ) + { + this.setTimeout( FCKEditingArea_CompleteStart, 50 ) ; + return ; + } + + var oEditorArea = this._FCKEditingArea ; + + // Save this reference to be re-used later. + oEditorArea.Document = oEditorArea.Window.document ; + + oEditorArea.MakeEditable() ; + + // Fire the "OnLoad" event. + FCKTools.RunFunction( oEditorArea.OnLoad ) ; +} + +FCKEditingArea.prototype.MakeEditable = function() +{ + var oDoc = this.Document ; + + if ( FCKBrowserInfo.IsIE ) + { + // Kludge for #141 and #523 + oDoc.body.disabled = true ; + oDoc.body.contentEditable = true ; + oDoc.body.removeAttribute( "disabled" ) ; + + /* The following commands don't throw errors, but have no effect. + oDoc.execCommand( 'AutoDetect', false, false ) ; + oDoc.execCommand( 'KeepSelection', false, true ) ; + */ + } + else + { + try + { + // Disable Firefox 2 Spell Checker. + oDoc.body.spellcheck = ( this.FFSpellChecker !== false ) ; + + if ( this._BodyHTML ) + { + oDoc.body.innerHTML = this._BodyHTML ; + oDoc.body.offsetLeft ; // Don't remove, this is a hack to fix Opera 9.50, see #2264. + this._BodyHTML = null ; + } + + oDoc.designMode = 'on' ; + + // Tell Gecko (Firefox 1.5+) to enable or not live resizing of objects (by Alfonso Martinez) + oDoc.execCommand( 'enableObjectResizing', false, !FCKConfig.DisableObjectResizing ) ; + + // Disable the standard table editing features of Firefox. + oDoc.execCommand( 'enableInlineTableEditing', false, !FCKConfig.DisableFFTableHandles ) ; + } + catch (e) + { + // In Firefox if the iframe is initially hidden it can't be set to designMode and it raises an exception + // So we set up a DOM Mutation event Listener on the HTML, as it will raise several events when the document is visible again + FCKTools.AddEventListener( this.Window.frameElement, 'DOMAttrModified', FCKEditingArea_Document_AttributeNodeModified ) ; + } + + } +} + +// This function processes the notifications of the DOM Mutation event on the document +// We use it to know that the document will be ready to be editable again (or we hope so) +function FCKEditingArea_Document_AttributeNodeModified( evt ) +{ + var editingArea = evt.currentTarget.contentWindow._FCKEditingArea ; + + // We want to run our function after the events no longer fire, so we can know that it's a stable situation + if ( editingArea._timer ) + window.clearTimeout( editingArea._timer ) ; + + editingArea._timer = FCKTools.SetTimeout( FCKEditingArea_MakeEditableByMutation, 1000, editingArea ) ; +} + +// This function ideally should be called after the document is visible, it does clean up of the +// mutation tracking and tries again to make the area editable. +function FCKEditingArea_MakeEditableByMutation() +{ + // Clean up + delete this._timer ; + // Now we don't want to keep on getting this event + FCKTools.RemoveEventListener( this.Window.frameElement, 'DOMAttrModified', FCKEditingArea_Document_AttributeNodeModified ) ; + // Let's try now to set the editing area editable + // If it fails it will set up the Mutation Listener again automatically + this.MakeEditable() ; +} + +FCKEditingArea.prototype.Focus = function() +{ + try + { + if ( this.Mode == FCK_EDITMODE_WYSIWYG ) + { + if ( FCKBrowserInfo.IsIE ) + this._FocusIE() ; + else + this.Window.focus() ; + } + else + { + var oDoc = FCKTools.GetElementDocument( this.Textarea ) ; + if ( (!oDoc.hasFocus || oDoc.hasFocus() ) && oDoc.activeElement == this.Textarea ) + return ; + + this.Textarea.focus() ; + } + } + catch(e) {} +} + +FCKEditingArea.prototype._FocusIE = function() +{ + // In IE it can happen that the document is in theory focused but the + // active element is outside of it. + this.Document.body.setActive() ; + + this.Window.focus() ; + + // Kludge for #141... yet more code to workaround IE bugs + var range = this.Document.selection.createRange() ; + + var parentNode = range.parentElement() ; + var parentTag = parentNode.nodeName.toLowerCase() ; + + // Only apply the fix when in a block, and the block is empty. + if ( parentNode.childNodes.length > 0 || + !( FCKListsLib.BlockElements[parentTag] || + FCKListsLib.NonEmptyBlockElements[parentTag] ) ) + { + return ; + } + + // Force the selection to happen, in this way we guarantee the focus will + // be there. + range = new FCKDomRange( this.Window ) ; + range.MoveToElementEditStart( parentNode ) ; + range.Select() ; +} + +function FCKEditingArea_Cleanup() +{ + if ( this.Document ) + this.Document.body.innerHTML = "" ; + this.TargetElement = null ; + this.IFrame = null ; + this.Document = null ; + this.Textarea = null ; + + if ( this.Window ) + { + this.Window._FCKEditingArea = null ; + this.Window = null ; + } +} Property changes on: announcement/trunk/src/main/webapp/fckeditor/editor/_source/classes/fckeditingarea.js ___________________________________________________________________ Name: svn:eol-style + native Added: announcement/trunk/src/main/webapp/fckeditor/editor/_source/classes/fckelementpath.js =================================================================== --- announcement/trunk/src/main/webapp/fckeditor/editor/_source/classes/fckelementpath.js (rev 0) +++ announcement/trunk/src/main/webapp/fckeditor/editor/_source/classes/fckelementpath.js 2008-06-30 02:54:27 UTC (rev 1002) @@ -0,0 +1,89 @@ +?/* + * FCKeditor - The text editor for Internet - http://www.fckeditor.net + * Copyright (C) 2003-2008 Frederico Caldeira Knabben + * + * == BEGIN LICENSE == + * + * Licensed under the terms of any of the following licenses at your + * choice: + * + * - GNU General Public License Version 2 or later (the "GPL") + * http://www.gnu.org/licenses/gpl.html + * + * - GNU Lesser General Public License Version 2.1 or later (the "LGPL") + * http://www.gnu.org/licenses/lgpl.html + * + * - Mozilla Public License Version 1.1 or later (the "MPL") + * http://www.mozilla.org/MPL/MPL-1.1.html + * + * == END LICENSE == + * + * Manages the DOM ascensors element list of a specific DOM node + * (limited to body, inclusive). + */ + +var FCKElementPath = function( lastNode ) +{ + var eBlock = null ; + var eBlockLimit = null ; + + var aElements = new Array() ; + + var e = lastNode ; + while ( e ) + { + if ( e.nodeType == 1 ) + { + if ( !this.LastElement ) + this.LastElement = e ; + + var sElementName = e.nodeName.toLowerCase() ; + if ( FCKBrowserInfo.IsIE && e.scopeName != 'HTML' ) + sElementName = e.scopeName.toLowerCase() + ':' + sElementName ; + + if ( !eBlockLimit ) + { + if ( !eBlock && FCKListsLib.PathBlockElements[ sElementName ] != null ) + eBlock = e ; + + if ( FCKListsLib.PathBlockLimitElements[ sElementName ] != null ) + { + // DIV is considered the Block, if no block is available (#525) + // and if it doesn't contain other blocks. + if ( !eBlock && sElementName == 'div' && !FCKElementPath._CheckHasBlock( e ) ) + eBlock = e ; + else + eBlockLimit = e ; + } + } + + aElements.push( e ) ; + + if ( sElementName == 'body' ) + break ; + } + e = e.parentNode ; + } + + this.Block = eBlock ; + this.BlockLimit = eBlockLimit ; + this.Elements = aElements ; +} + +/** + * Check if an element contains any block element. + */ +FCKElementPath._CheckHasBlock = function( element ) +{ + var childNodes = element.childNodes ; + + for ( var i = 0, count = childNodes.length ; i < count ; i++ ) + { + var child = childNodes[i] ; + + if ( child.nodeType == 1 && FCKListsLib.BlockElements[ child.nodeName.toLowerCase() ] ) + return true ; + } + + return false ; +} Property changes on: announcement/trunk/src/main/webapp/fckeditor/editor/_source/classes/fckelementpath.js ___________________________________________________________________ Name: svn:eol-style + native Added: announcement/trunk/src/main/webapp/fckeditor/editor/_source/classes/fckenterkey.js =================================================================== --- announcement/trunk/src/main/webapp/fckeditor/editor/_source/classes/fckenterkey.js (rev 0) +++ announcement/trunk/src/main/webapp/fckeditor/editor/_source/classes/fckenterkey.js 2008-06-30 02:54:27 UTC (rev 1002) @@ -0,0 +1,691 @@ +?/* + * FCKeditor - The text editor for Internet - http://www.fckeditor.net + * Copyright (C) 2003-2008 Frederico Caldeira Knabben + * + * == BEGIN LICENSE == + * + * Licensed under the terms of any of the following licenses at your + * choice: + * + * - GNU General Public License Version 2 or later (the "GPL") + * http://www.gnu.org/licenses/gpl.html + * + * - GNU Lesser General Public License Version 2.1 or later (the "LGPL") + * http://www.gnu.org/licenses/lgpl.html + * + * - Mozilla Public License Version 1.1 or later (the "MPL") + * http://www.mozilla.org/MPL/MPL-1.1.html + * + * == END LICENSE == + * + * Controls the [Enter] keystroke behavior in a document. + */ + +/* + * Constructor. + * @targetDocument : the target document. + * @enterMode : the behavior for the keystroke. + * May be "p", "div", "br". Default is "p". + * @shiftEnterMode : the behavior for the + keystroke. + * May be "p", "div", "br". Defaults to "br". + */ +var FCKEnterKey = function( targetWindow, enterMode, shiftEnterMode, tabSpaces ) +{ + this.Window = targetWindow ; + this.EnterMode = enterMode || 'p' ; + this.ShiftEnterMode = shiftEnterMode || 'br' ; + + // Setup the Keystroke Handler. + var oKeystrokeHandler = new FCKKeystrokeHandler( false ) ; + oKeystrokeHandler._EnterKey = this ; + oKeystrokeHandler.OnKeystroke = FCKEnterKey_OnKeystroke ; + + oKeystrokeHandler.SetKeystrokes( [ + [ 13 , 'Enter' ], + [ SHIFT + 13, 'ShiftEnter' ], + [ 8 , 'Backspace' ], + [ CTRL + 8 , 'CtrlBackspace' ], + [ 46 , 'Delete' ] + ] ) ; + + this.TabText = '' ; + + // Safari by default inserts 4 spaces on TAB, while others make the editor + // loose focus. So, we need to handle it here to not include those spaces. + if ( tabSpaces > 0 || FCKBrowserInfo.IsSafari ) + { + while ( tabSpaces-- ) + this.TabText += '\xa0' ; + + oKeystrokeHandler.SetKeystrokes( [ 9, 'Tab' ] ); + } + + oKeystrokeHandler.AttachToElement( targetWindow.document ) ; +} + + +function FCKEnterKey_OnKeystroke( keyCombination, keystrokeValue ) +{ + var oEnterKey = this._EnterKey ; + + try + { + switch ( keystrokeValue ) + { + case 'Enter' : + return oEnterKey.DoEnter() ; + break ; + case 'ShiftEnter' : + return oEnterKey.DoShiftEnter() ; + break ; + case 'Backspace' : + return oEnterKey.DoBackspace() ; + break ; + case 'Delete' : + return oEnterKey.DoDelete() ; + break ; + case 'Tab' : + return oEnterKey.DoTab() ; + break ; + case 'CtrlBackspace' : + return oEnterKey.DoCtrlBackspace() ; + break ; + } + } + catch (e) + { + // If for any reason we are not able to handle it, go + // ahead with the browser default behavior. + } + + return false ; +} + +/* + * Executes the key behavior. + */ +FCKEnterKey.prototype.DoEnter = function( mode, hasShift ) +{ + // Save an undo snapshot before doing anything + FCKUndo.SaveUndoStep() ; + + this._HasShift = ( hasShift === true ) ; + + var parentElement = FCKSelection.GetParentElement() ; + var parentPath = new FCKElementPath( parentElement ) ; + var sMode = mode || this.EnterMode ; + + if ( sMode == 'br' || parentPath.Block && parentPath.Block.tagName.toLowerCase() == 'pre' ) + return this._ExecuteEnterBr() ; + else + return this._ExecuteEnterBlock( sMode ) ; +} + +/* + * Executes the + key behavior. + */ +FCKEnterKey.prototype.DoShiftEnter = function() +{ + return this.DoEnter( this.ShiftEnterMode, true ) ; +} + +/* + * Executes the key behavior. + */ +FCKEnterKey.prototype.DoBackspace = function() +{ + var bCustom = false ; + + // Get the current selection. + var oRange = new FCKDomRange( this.Window ) ; + oRange.MoveToSelection() ; + + // Kludge for #247 + if ( FCKBrowserInfo.IsIE && this._CheckIsAllContentsIncluded( oRange, this.Window.document.body ) ) + { + this._FixIESelectAllBug( oRange ) ; + return true ; + } + + var isCollapsed = oRange.CheckIsCollapsed() ; + + if ( !isCollapsed ) + { + // Bug #327, Backspace with an img selection would activate the default action in IE. + // Let's override that with our logic here. + if ( FCKBrowserInfo.IsIE && this.Window.document.selection.type.toLowerCase() == "control" ) + { + var controls = this.Window.document.selection.createRange() ; + for ( var i = controls.length - 1 ; i >= 0 ; i-- ) + { + var el = controls.item( i ) ; + el.parentNode.removeChild( el ) ; + } + return true ; + } + + return false ; + } + + // On IE, it is better for us handle the deletion if the caret is preceeded + // by a
        (#1383). + if ( FCKBrowserInfo.IsIE ) + { + var previousElement = FCKDomTools.GetPreviousSourceElement( oRange.StartNode, true ) ; + + if ( previousElement && previousElement.nodeName.toLowerCase() == 'br' ) + { + // Create a range that starts after the
        and ends at the + // current range position. + var testRange = oRange.Clone() ; + testRange.SetStart( previousElement, 4 ) ; + + // If that range is empty, we can proceed cleaning that
        manually. + if ( testRange.CheckIsEmpty() ) + { + previousElement.parentNode.removeChild( previousElement ) ; + return true ; + } + } + } + + var oStartBlock = oRange.StartBlock ; + var oEndBlock = oRange.EndBlock ; + + // The selection boundaries must be in the same "block limit" element + if ( oRange.StartBlockLimit == oRange.EndBlockLimit && oStartBlock && oEndBlock ) + { + if ( !isCollapsed ) + { + var bEndOfBlock = oRange.CheckEndOfBlock() ; + + oRange.DeleteContents() ; + + if ( oStartBlock != oEndBlock ) + { + oRange.SetStart(oEndBlock,1) ; + oRange.SetEnd(oEndBlock,1) ; + +// if ( bEndOfBlock ) +// oEndBlock.parentNode.removeChild( oEndBlock ) ; + } + + oRange.Select() ; + + bCustom = ( oStartBlock == oEndBlock ) ; + } + + if ( oRange.CheckStartOfBlock() ) + { + var oCurrentBlock = oRange.StartBlock ; + + var ePrevious = FCKDomTools.GetPreviousSourceElement( oCurrentBlock, true, [ 'BODY', oRange.StartBlockLimit.nodeName ], ['UL','OL'] ) ; + + bCustom = this._ExecuteBackspace( oRange, ePrevious, oCurrentBlock ) ; + } + else if ( FCKBrowserInfo.IsGeckoLike ) + { + // Firefox and Opera (#1095) loose the selection when executing + // CheckStartOfBlock, so we must reselect. + oRange.Select() ; + } + } + + oRange.Release() ; + return bCustom ; +} + +FCKEnterKey.prototype.DoCtrlBackspace = function() +{ + FCKUndo.SaveUndoStep() ; + var oRange = new FCKDomRange( this.Window ) ; + oRange.MoveToSelection() ; + if ( FCKBrowserInfo.IsIE && this._CheckIsAllContentsIncluded( oRange, this.Window.document.body ) ) + { + this._FixIESelectAllBug( oRange ) ; + return true ; + } + return false ; +} + +FCKEnterKey.prototype._ExecuteBackspace = function( range, previous, currentBlock ) +{ + var bCustom = false ; + + // We could be in a nested LI. + if ( !previous && currentBlock && currentBlock.nodeName.IEquals( 'LI' ) && currentBlock.parentNode.parentNode.nodeName.IEquals( 'LI' ) ) + { + this._OutdentWithSelection( currentBlock, range ) ; + return true ; + } + + if ( previous && previous.nodeName.IEquals( 'LI' ) ) + { + var oNestedList = FCKDomTools.GetLastChild( previous, ['UL','OL'] ) ; + + while ( oNestedList ) + { + previous = FCKDomTools.GetLastChild( oNestedList, 'LI' ) ; + oNestedList = FCKDomTools.GetLastChild( previous, ['UL','OL'] ) ; + } + } + + if ( previous && currentBlock ) + { + // If we are in a LI, and the previous block is not an LI, we must outdent it. + if ( currentBlock.nodeName.IEquals( 'LI' ) && !previous.nodeName.IEquals( 'LI' ) ) + { + this._OutdentWithSelection( currentBlock, range ) ; + return true ; + } + + // Take a reference to the parent for post processing cleanup. + var oCurrentParent = currentBlock.parentNode ; + + var sPreviousName = previous.nodeName.toLowerCase() ; + if ( FCKListsLib.EmptyElements[ sPreviousName ] != null || sPreviousName == 'table' ) + { + FCKDomTools.RemoveNode( previous ) ; + bCustom = true ; + } + else + { + // Remove the current block. + FCKDomTools.RemoveNode( currentBlock ) ; + + // Remove any empty tag left by the block removal. + while ( oCurrentParent.innerHTML.Trim().length == 0 ) + { + var oParent = oCurrentParent.parentNode ; + oParent.removeChild( oCurrentParent ) ; + oCurrentParent = oParent ; + } + + // Cleanup the previous and the current elements. + FCKDomTools.LTrimNode( currentBlock ) ; + FCKDomTools.RTrimNode( previous ) ; + + // Append a space to the previous. + // Maybe it is not always desirable... + // previous.appendChild( this.Window.document.createTextNode( ' ' ) ) ; + + // Set the range to the end of the previous element and bookmark it. + range.SetStart( previous, 2, true ) ; + range.Collapse( true ) ; + var oBookmark = range.CreateBookmark( true ) ; + + // Move the contents of the block to the previous element and delete it. + // But for some block types (e.g. table), moving the children to the previous block makes no sense. + // So a check is needed. (See #1081) + if ( ! currentBlock.tagName.IEquals( [ 'TABLE' ] ) ) + FCKDomTools.MoveChildren( currentBlock, previous ) ; + + // Place the selection at the bookmark. + range.SelectBookmark( oBookmark ) ; + + bCustom = true ; + } + } + + return bCustom ; +} + +/* + * Executes the key behavior. + */ +FCKEnterKey.prototype.DoDelete = function() +{ + // Save an undo snapshot before doing anything + // This is to conform with the behavior seen in MS Word + FCKUndo.SaveUndoStep() ; + + // The has the same effect as the , so we have the same + // results if we just move to the next block and apply the same logic. + + var bCustom = false ; + + // Get the current selection. + var oRange = new FCKDomRange( this.Window ) ; + oRange.MoveToSelection() ; + + // Kludge for #247 + if ( FCKBrowserInfo.IsIE && this._CheckIsAllContentsIncluded( oRange, this.Window.document.body ) ) + { + this._FixIESelectAllBug( oRange ) ; + return true ; + } + + // There is just one special case for collapsed selections at the end of a block. + if ( oRange.CheckIsCollapsed() && oRange.CheckEndOfBlock( FCKBrowserInfo.IsGeckoLike ) ) + { + var oCurrentBlock = oRange.StartBlock ; + var eCurrentCell = FCKTools.GetElementAscensor( oCurrentBlock, 'td' ); + + var eNext = FCKDomTools.GetNextSourceElement( oCurrentBlock, true, [ oRange.StartBlockLimit.nodeName ], + ['UL','OL','TR'], true ) ; + + // Bug #1323 : if we're in a table cell, and the next node belongs to a different cell, then don't + // delete anything. + if ( eCurrentCell ) + { + var eNextCell = FCKTools.GetElementAscensor( eNext, 'td' ); + if ( eNextCell != eCurrentCell ) + return true ; + } + + bCustom = this._ExecuteBackspace( oRange, oCurrentBlock, eNext ) ; + } + + oRange.Release() ; + return bCustom ; +} + +/* + * Executes the key behavior. + */ +FCKEnterKey.prototype.DoTab = function() +{ + var oRange = new FCKDomRange( this.Window ); + oRange.MoveToSelection() ; + + // If the user pressed inside a table, we should give him the default behavior ( moving between cells ) + // instead of giving him more non-breaking spaces. (Bug #973) + var node = oRange._Range.startContainer ; + while ( node ) + { + if ( node.nodeType == 1 ) + { + var tagName = node.tagName.toLowerCase() ; + if ( tagName == "tr" || tagName == "td" || tagName == "th" || tagName == "tbody" || tagName == "table" ) + return false ; + else + break ; + } + node = node.parentNode ; + } + + if ( this.TabText ) + { + oRange.DeleteContents() ; + oRange.InsertNode( this.Window.document.createTextNode( this.TabText ) ) ; + oRange.Collapse( false ) ; + oRange.Select() ; + } + return true ; +} + +FCKEnterKey.prototype._ExecuteEnterBlock = function( blockTag, range ) +{ + // Get the current selection. + var oRange = range || new FCKDomRange( this.Window ) ; + + var oSplitInfo = oRange.SplitBlock( blockTag ) ; + + if ( oSplitInfo ) + { + // Get the current blocks. + var ePreviousBlock = oSplitInfo.PreviousBlock ; + var eNextBlock = oSplitInfo.NextBlock ; + + var bIsStartOfBlock = oSplitInfo.WasStartOfBlock ; + var bIsEndOfBlock = oSplitInfo.WasEndOfBlock ; + + // If there is one block under a list item, modify the split so that the list item gets split as well. (Bug #1647) + if ( eNextBlock ) + { + if ( eNextBlock.parentNode.nodeName.IEquals( 'li' ) ) + { + FCKDomTools.BreakParent( eNextBlock, eNextBlock.parentNode ) ; + FCKDomTools.MoveNode( eNextBlock, eNextBlock.nextSibling, true ) ; + } + } + else if ( ePreviousBlock && ePreviousBlock.parentNode.nodeName.IEquals( 'li' ) ) + { + FCKDomTools.BreakParent( ePreviousBlock, ePreviousBlock.parentNode ) ; + oRange.MoveToElementEditStart( ePreviousBlock.nextSibling ); + FCKDomTools.MoveNode( ePreviousBlock, ePreviousBlock.previousSibling ) ; + } + + // If we have both the previous and next blocks, it means that the + // boundaries were on separated blocks, or none of them where on the + // block limits (start/end). + if ( !bIsStartOfBlock && !bIsEndOfBlock ) + { + // If the next block is an
      4. with another list tree as the first child + // We'll need to append a placeholder or the list item wouldn't be editable. (Bug #1420) + if ( eNextBlock.nodeName.IEquals( 'li' ) && eNextBlock.firstChild + && eNextBlock.firstChild.nodeName.IEquals( ['ul', 'ol'] ) ) + eNextBlock.insertBefore( FCKTools.GetElementDocument( eNextBlock ).createTextNode( '\xa0' ), eNextBlock.firstChild ) ; + // Move the selection to the end block. + if ( eNextBlock ) + oRange.MoveToElementEditStart( eNextBlock ) ; + } + else + { + if ( bIsStartOfBlock && bIsEndOfBlock && ePreviousBlock.tagName.toUpperCase() == 'LI' ) + { + oRange.MoveToElementStart( ePreviousBlock ) ; + this._OutdentWithSelection( ePreviousBlock, oRange ) ; + oRange.Release() ; + return true ; + } + + var eNewBlock ; + + if ( ePreviousBlock ) + { + var sPreviousBlockTag = ePreviousBlock.tagName.toUpperCase() ; + + // If is a header tag, or we are in a Shift+Enter (#77), + // create a new block element (later in the code). + if ( !this._HasShift && !(/^H[1-6]$/).test( sPreviousBlockTag ) ) + { + // Otherwise, duplicate the previous block. + eNewBlock = FCKDomTools.CloneElement( ePreviousBlock ) ; + } + } + else if ( eNextBlock ) + eNewBlock = FCKDomTools.CloneElement( eNextBlock ) ; + + if ( !eNewBlock ) + eNewBlock = this.Window.document.createElement( blockTag ) ; + + // Recreate the inline elements tree, which was available + // before the hitting enter, so the same styles will be + // available in the new block. + var elementPath = oSplitInfo.ElementPath ; + if ( elementPath ) + { + for ( var i = 0, len = elementPath.Elements.length ; i < len ; i++ ) + { + var element = elementPath.Elements[i] ; + + if ( element == elementPath.Block || element == elementPath.BlockLimit ) + break ; + + if ( FCKListsLib.InlineChildReqElements[ element.nodeName.toLowerCase() ] ) + { + element = FCKDomTools.CloneElement( element ) ; + FCKDomTools.MoveChildren( eNewBlock, element ) ; + eNewBlock.appendChild( element ) ; + } + } + } + + if ( FCKBrowserInfo.IsGeckoLike ) + FCKTools.AppendBogusBr( eNewBlock ) ; + + oRange.InsertNode( eNewBlock ) ; + + // This is tricky, but to make the new block visible correctly + // we must select it. + if ( FCKBrowserInfo.IsIE ) + { + // Move the selection to the new block. + oRange.MoveToElementEditStart( eNewBlock ) ; + oRange.Select() ; + } + + // Move the selection to the new block. + oRange.MoveToElementEditStart( bIsStartOfBlock && !bIsEndOfBlock ? eNextBlock : eNewBlock ) ; + } + + if ( FCKBrowserInfo.IsGeckoLike ) + FCKDomTools.ScrollIntoView( eNextBlock || eNewBlock, false ) ; + + oRange.Select() ; + } + + // Release the resources used by the range. + oRange.Release() ; + + return true ; +} + +FCKEnterKey.prototype._ExecuteEnterBr = function( blockTag ) +{ + // Get the current selection. + var oRange = new FCKDomRange( this.Window ) ; + oRange.MoveToSelection() ; + + // The selection boundaries must be in the same "block limit" element. + if ( oRange.StartBlockLimit == oRange.EndBlockLimit ) + { + oRange.DeleteContents() ; + + // Get the new selection (it is collapsed at this point). + oRange.MoveToSelection() ; + + var bIsStartOfBlock = oRange.CheckStartOfBlock() ; + var bIsEndOfBlock = oRange.CheckEndOfBlock() ; + + var sStartBlockTag = oRange.StartBlock ? oRange.StartBlock.tagName.toUpperCase() : '' ; + + var bHasShift = this._HasShift ; + var bIsPre = false ; + + if ( !bHasShift && sStartBlockTag == 'LI' ) + return this._ExecuteEnterBlock( null, oRange ) ; + + // If we are at the end of a header block. + if ( !bHasShift && bIsEndOfBlock && (/^H[1-6]$/).test( sStartBlockTag ) ) + { + // Insert a BR after the current paragraph. + FCKDomTools.InsertAfterNode( oRange.StartBlock, this.Window.document.createElement( 'br' ) ) ; + + // The space is required by Gecko only to make the cursor blink. + if ( FCKBrowserInfo.IsGecko ) + FCKDomTools.InsertAfterNode( oRange.StartBlock, this.Window.document.createTextNode( '' ) ) ; + + // IE and Gecko have different behaviors regarding the position. + oRange.SetStart( oRange.StartBlock.nextSibling, FCKBrowserInfo.IsIE ? 3 : 1 ) ; + } + else + { + var eLineBreak ; + bIsPre = sStartBlockTag.IEquals( 'pre' ) ; + if ( bIsPre ) + eLineBreak = this.Window.document.createTextNode( FCKBrowserInfo.IsIE ? '\r' : '\n' ) ; + else + eLineBreak = this.Window.document.createElement( 'br' ) ; + + oRange.InsertNode( eLineBreak ) ; + + // The space is required by Gecko only to make the cursor blink. + if ( FCKBrowserInfo.IsGecko ) + FCKDomTools.InsertAfterNode( eLineBreak, this.Window.document.createTextNode( '' ) ) ; + + // If we are at the end of a block, we must be sure the bogus node is available in that block. + if ( bIsEndOfBlock && FCKBrowserInfo.IsGeckoLike ) + FCKTools.AppendBogusBr( eLineBreak.parentNode ) ; + + if ( FCKBrowserInfo.IsIE ) + oRange.SetStart( eLineBreak, 4 ) ; + else + oRange.SetStart( eLineBreak.nextSibling, 1 ) ; + + if ( ! FCKBrowserInfo.IsIE ) + { + var dummy = null ; + if ( FCKBrowserInfo.IsOpera ) + dummy = this.Window.document.createElement( 'span' ) ; + else + dummy = this.Window.document.createElement( 'br' ) ; + + eLineBreak.parentNode.insertBefore( dummy, eLineBreak.nextSibling ) ; + + if ( FCKBrowserInfo.IsSafari ) + FCKDomTools.ScrollIntoView( dummy, false ) ; + else + dummy.scrollIntoView( false ) ; + + dummy.parentNode.removeChild( dummy ) ; + } + } + + // This collapse guarantees the cursor will be blinking. + oRange.Collapse( true ) ; + + oRange.Select( bIsPre ) ; + } + + // Release the resources used by the range. + oRange.Release() ; + + return true ; +} + +// Outdents a LI, maintaining the selection defined on a range. +FCKEnterKey.prototype._OutdentWithSelection = function( li, range ) +{ + var oBookmark = range.CreateBookmark() ; + + FCKListHandler.OutdentListItem( li ) ; + + range.MoveToBookmark( oBookmark ) ; + range.Select() ; +} + +// Is all the contents under a node included by a range? +FCKEnterKey.prototype._CheckIsAllContentsIncluded = function( range, node ) +{ + var startOk = false ; + var endOk = false ; + + /* + FCKDebug.Output( 'sc='+range.StartContainer.nodeName+ + ',so='+range._Range.startOffset+ + ',ec='+range.EndContainer.nodeName+ + ',eo='+range._Range.endOffset ) ; + */ + if ( range.StartContainer == node || range.StartContainer == node.firstChild ) + startOk = ( range._Range.startOffset == 0 ) ; + + if ( range.EndContainer == node || range.EndContainer == node.lastChild ) + { + var nodeLength = range.EndContainer.nodeType == 3 ? range.EndContainer.length : range.EndContainer.childNodes.length ; + endOk = ( range._Range.endOffset == nodeLength ) ; + } + + return startOk && endOk ; +} + +// Kludge for #247 +FCKEnterKey.prototype._FixIESelectAllBug = function( range ) +{ + var doc = this.Window.document ; + doc.body.innerHTML = '' ; + var editBlock ; + if ( FCKConfig.EnterMode.IEquals( ['div', 'p'] ) ) + { + editBlock = doc.createElement( FCKConfig.EnterMode ) ; + doc.body.appendChild( editBlock ) ; + } + else + editBlock = doc.body ; + + range.MoveToNodeContents( editBlock ) ; + range.Collapse( true ) ; + range.Select() ; + range.Release() ; +} Property changes on: announcement/trunk/src/main/webapp/fckeditor/editor/_source/classes/fckenterkey.js ___________________________________________________________________ Name: svn:eol-style + native Added: announcement/trunk/src/main/webapp/fckeditor/editor/_source/classes/fckevents.js =================================================================== --- announcement/trunk/src/main/webapp/fckeditor/editor/_source/classes/fckevents.js (rev 0) +++ announcement/trunk/src/main/webapp/fckeditor/editor/_source/classes/fckevents.js 2008-06-30 02:54:27 UTC (rev 1002) @@ -0,0 +1,71 @@ +?/* + * FCKeditor - The text editor for Internet - http://www.fckeditor.net + * Copyright (C) 2003-2008 Frederico Caldeira Knabben + * + * == BEGIN LICENSE == + * + * Licensed under the terms of any of the following licenses at your + * choice: + * + * - GNU General Public License Version 2 or later (the "GPL") + * http://www.gnu.org/licenses/gpl.html + * + * - GNU Lesser General Public License Version 2.1 or later (the "LGPL") + * http://www.gnu.org/licenses/lgpl.html + * + * - Mozilla Public License Version 1.1 or later (the "MPL") + * http://www.mozilla.org/MPL/MPL-1.1.html + * + * == END LICENSE == + * + * FCKEvents Class: used to handle events is a advanced way. + */ + +var FCKEvents = function( eventsOwner ) +{ + this.Owner = eventsOwner ; + this._RegisteredEvents = new Object() ; +} + +FCKEvents.prototype.AttachEvent = function( eventName, functionPointer ) +{ + var aTargets ; + + if ( !( aTargets = this._RegisteredEvents[ eventName ] ) ) + this._RegisteredEvents[ eventName ] = [ functionPointer ] ; + else + { + // Check that the event handler isn't already registered with the same listener + // It doesn't detect function pointers belonging to an object (at least in Gecko) + if ( aTargets.IndexOf( functionPointer ) == -1 ) + aTargets.push( functionPointer ) ; + } +} + +FCKEvents.prototype.FireEvent = function( eventName, params ) +{ + var bReturnValue = true ; + + var oCalls = this._RegisteredEvents[ eventName ] ; + + if ( oCalls ) + { + for ( var i = 0 ; i < oCalls.length ; i++ ) + { + try + { + bReturnValue = ( oCalls[ i ]( this.Owner, params ) && bReturnValue ) ; + } + catch(e) + { + // Ignore the following error. It may happen if pointing to a + // script not anymore available (#934): + // -2146823277 = Can't execute code from a freed script + if ( e.number != -2146823277 ) + throw e ; + } + } + } + + return bReturnValue ; +} Property changes on: announcement/trunk/src/main/webapp/fckeditor/editor/_source/classes/fckevents.js ___________________________________________________________________ Name: svn:eol-style + native Added: announcement/trunk/src/main/webapp/fckeditor/editor/_source/classes/fckhtmliterator.js =================================================================== --- announcement/trunk/src/main/webapp/fckeditor/editor/_source/classes/fckhtmliterator.js (rev 0) +++ announcement/trunk/src/main/webapp/fckeditor/editor/_source/classes/fckhtmliterator.js 2008-06-30 02:54:27 UTC (rev 1002) @@ -0,0 +1,142 @@ +?/* + * FCKeditor - The text editor for Internet - http://www.fckeditor.net + * Copyright (C) 2003-2008 Frederico Caldeira Knabben + * + * == BEGIN LICENSE == + * + * Licensed under the terms of any of the following licenses at your + * choice: + * + * - GNU General Public License Version 2 or later (the "GPL") + * http://www.gnu.org/licenses/gpl.html + * + * - GNU Lesser General Public License Version 2.1 or later (the "LGPL") + * http://www.gnu.org/licenses/lgpl.html + * + * - Mozilla Public License Version 1.1 or later (the "MPL") + * http://www.mozilla.org/MPL/MPL-1.1.html + * + * == END LICENSE == + * + * This class can be used to interate through nodes inside a range. + * + * During interation, the provided range can become invalid, due to document + * mutations, so CreateBookmark() used to restore it after processing, if + * needed. + */ + +var FCKHtmlIterator = function( source ) +{ + this._sourceHtml = source ; +} +FCKHtmlIterator.prototype = +{ + Next : function() + { + var sourceHtml = this._sourceHtml ; + if ( sourceHtml == null ) + return null ; + + var match = FCKRegexLib.HtmlTag.exec( sourceHtml ) ; + var isTag = false ; + var value = "" ; + if ( match ) + { + if ( match.index > 0 ) + { + value = sourceHtml.substr( 0, match.index ) ; + this._sourceHtml = sourceHtml.substr( match.index ) ; + } + else + { + isTag = true ; + value = match[0] ; + this._sourceHtml = sourceHtml.substr( match[0].length ) ; + } + } + else + { + value = sourceHtml ; + this._sourceHtml = null ; + } + return { 'isTag' : isTag, 'value' : value } ; + }, + + Each : function( func ) + { + var chunk ; + while ( ( chunk = this.Next() ) ) + func( chunk.isTag, chunk.value ) ; + } +} ; +/* + * FCKeditor - The text editor for Internet - http://www.fckeditor.net + * Copyright (C) 2003-2008 Frederico Caldeira Knabben + * + * == BEGIN LICENSE == + * + * Licensed under the terms of any of the following licenses at your + * choice: + * + * - GNU General Public License Version 2 or later (the "GPL") + * http://www.gnu.org/licenses/gpl.html + * + * - GNU Lesser General Public License Version 2.1 or later (the "LGPL") + * http://www.gnu.org/licenses/lgpl.html + * + * - Mozilla Public License Version 1.1 or later (the "MPL") + * http://www.mozilla.org/MPL/MPL-1.1.html + * + * == END LICENSE == + * + * This class can be used to interate through nodes inside a range. + * + * During interation, the provided range can become invalid, due to document + * mutations, so CreateBookmark() used to restore it after processing, if + * needed. + */ + +var FCKHtmlIterator = function( source ) +{ + this._sourceHtml = source ; +} +FCKHtmlIterator.prototype = +{ + Next : function() + { + var sourceHtml = this._sourceHtml ; + if ( sourceHtml == null ) + return null ; + + var match = FCKRegexLib.HtmlTag.exec( sourceHtml ) ; + var isTag = false ; + var value = "" ; + if ( match ) + { + if ( match.index > 0 ) + { + value = sourceHtml.substr( 0, match.index ) ; + this._sourceHtml = sourceHtml.substr( match.index ) ; + } + else + { + isTag = true ; + value = match[0] ; + this._sourceHtml = sourceHtml.substr( match[0].length ) ; + } + } + else + { + value = sourceHtml ; + this._sourceHtml = null ; + } + return { 'isTag' : isTag, 'value' : value } ; + }, + + Each : function( func ) + { + var chunk ; + while ( ( chunk = this.Next() ) ) + func( chunk.isTag, chunk.value ) ; + } +} ; Property changes on: announcement/trunk/src/main/webapp/fckeditor/editor/_source/classes/fckhtmliterator.js ___________________________________________________________________ Name: svn:eol-style + native Added: announcement/trunk/src/main/webapp/fckeditor/editor/_source/classes/fckicon.js =================================================================== --- announcement/trunk/src/main/webapp/fckeditor/editor/_source/classes/fckicon.js (rev 0) +++ announcement/trunk/src/main/webapp/fckeditor/editor/_source/classes/fckicon.js 2008-06-30 02:54:27 UTC (rev 1002) @@ -0,0 +1,103 @@ +?/* + * FCKeditor - The text editor for Internet - http://www.fckeditor.net + * Copyright (C) 2003-2008 Frederico Caldeira Knabben + * + * == BEGIN LICENSE == + * + * Licensed under the terms of any of the following licenses at your + * choice: + * + * - GNU General Public License Version 2 or later (the "GPL") + * http://www.gnu.org/licenses/gpl.html + * + * - GNU Lesser General Public License Version 2.1 or later (the "LGPL") + * http://www.gnu.org/licenses/lgpl.html + * + * - Mozilla Public License Version 1.1 or later (the "MPL") + * http://www.mozilla.org/MPL/MPL-1.1.html + * + * == END LICENSE == + * + * FCKIcon Class: renders an icon from a single image, a strip or even a + * spacer. + */ + +var FCKIcon = function( iconPathOrStripInfoArray ) +{ + var sTypeOf = iconPathOrStripInfoArray ? typeof( iconPathOrStripInfoArray ) : 'undefined' ; + switch ( sTypeOf ) + { + case 'number' : + this.Path = FCKConfig.SkinPath + 'fck_strip.gif' ; + this.Size = 16 ; + this.Position = iconPathOrStripInfoArray ; + break ; + + case 'undefined' : + this.Path = FCK_SPACER_PATH ; + break ; + + case 'string' : + this.Path = iconPathOrStripInfoArray ; + break ; + + default : + // It is an array in the format [ StripFilePath, IconSize, IconPosition ] + this.Path = iconPathOrStripInfoArray[0] ; + this.Size = iconPathOrStripInfoArray[1] ; + this.Position = iconPathOrStripInfoArray[2] ; + } +} + +FCKIcon.prototype.CreateIconElement = function( document ) +{ + var eIcon, eIconImage ; + + if ( this.Position ) // It is using an icons strip image. + { + var sPos = '-' + ( ( this.Position - 1 ) * this.Size ) + 'px' ; + + if ( FCKBrowserInfo.IsIE ) + { + //
        + + eIcon = document.createElement( 'DIV' ) ; + + eIconImage = eIcon.appendChild( document.createElement( 'IMG' ) ) ; + eIconImage.src = this.Path ; + eIconImage.style.top = sPos ; + } + else + { + // + + eIcon = document.createElement( 'IMG' ) ; + eIcon.src = FCK_SPACER_PATH ; + eIcon.style.backgroundPosition = '0px ' + sPos ; + eIcon.style.backgroundImage = 'url("' + this.Path + '")' ; + } + } + else // It is using a single icon image. + { + if ( FCKBrowserInfo.IsIE ) + { + // IE makes the button 1px higher if using the directly, so we + // are changing to the
        system to clip the image correctly. + eIcon = document.createElement( 'DIV' ) ; + + eIconImage = eIcon.appendChild( document.createElement( 'IMG' ) ) ; + eIconImage.src = this.Path ? this.Path : FCK_SPACER_PATH ; + } + else + { + // This is not working well with IE. See notes above. + // + eIcon = document.createElement( 'IMG' ) ; + eIcon.src = this.Path ? this.Path : FCK_SPACER_PATH ; + } + } + + eIcon.className = 'TB_Button_Image' ; + + return eIcon ; +} Property changes on: announcement/trunk/src/main/webapp/fckeditor/editor/_source/classes/fckicon.js ___________________________________________________________________ Name: svn:eol-style + native Added: announcement/trunk/src/main/webapp/fckeditor/editor/_source/classes/fckiecleanup.js =================================================================== --- announcement/trunk/src/main/webapp/fckeditor/editor/_source/classes/fckiecleanup.js (rev 0) +++ announcement/trunk/src/main/webapp/fckeditor/editor/_source/classes/fckiecleanup.js 2008-06-30 02:54:27 UTC (rev 1002) @@ -0,0 +1,68 @@ +?/* + * FCKeditor - The text editor for Internet - http://www.fckeditor.net + * Copyright (C) 2003-2008 Frederico Caldeira Knabben + * + * == BEGIN LICENSE == + * + * Licensed under the terms of any of the following licenses at your + * choice: + * + * - GNU General Public License Version 2 or later (the "GPL") + * http://www.gnu.org/licenses/gpl.html + * + * - GNU Lesser General Public License Version 2.1 or later (the "LGPL") + * http://www.gnu.org/licenses/lgpl.html + * + * - Mozilla Public License Version 1.1 or later (the "MPL") + * http://www.mozilla.org/MPL/MPL-1.1.html + * + * == END LICENSE == + * + * FCKIECleanup Class: a generic class used as a tool to remove IE leaks. + */ + +var FCKIECleanup = function( attachWindow ) +{ + // If the attachWindow already have a cleanup object, just use that one. + if ( attachWindow._FCKCleanupObj ) + this.Items = attachWindow._FCKCleanupObj.Items ; + else + { + this.Items = new Array() ; + + attachWindow._FCKCleanupObj = this ; + FCKTools.AddEventListenerEx( attachWindow, 'unload', FCKIECleanup_Cleanup ) ; +// attachWindow.attachEvent( 'onunload', FCKIECleanup_Cleanup ) ; + } +} + +FCKIECleanup.prototype.AddItem = function( dirtyItem, cleanupFunction ) +{ + this.Items.push( [ dirtyItem, cleanupFunction ] ) ; +} + +function FCKIECleanup_Cleanup() +{ + if ( !this._FCKCleanupObj || ( FCKConfig.MsWebBrowserControlCompat && !window.FCKUnloadFlag ) ) + return ; + + var aItems = this._FCKCleanupObj.Items ; + + while ( aItems.length > 0 ) + { + + // It is important to remove from the end to the beginning (pop()), + // because of the order things get created in the editor. In the code, + // elements in deeper position in the DOM are placed at the end of the + // cleanup function, so we must cleanup then first, otherwise IE could + // throw some crazy memory errors (IE bug). + var oItem = aItems.pop() ; + if ( oItem ) + oItem[1].call( oItem[0] ) ; + } + + this._FCKCleanupObj = null ; + + if ( CollectGarbage ) + CollectGarbage() ; +} Property changes on: announcement/trunk/src/main/webapp/fckeditor/editor/_source/classes/fckiecleanup.js ___________________________________________________________________ Name: svn:eol-style + native Added: announcement/trunk/src/main/webapp/fckeditor/editor/_source/classes/fckimagepreloader.js =================================================================== --- announcement/trunk/src/main/webapp/fckeditor/editor/_source/classes/fckimagepreloader.js (rev 0) +++ announcement/trunk/src/main/webapp/fckeditor/editor/_source/classes/fckimagepreloader.js 2008-06-30 02:54:27 UTC (rev 1002) @@ -0,0 +1,64 @@ +?/* + * FCKeditor - The text editor for Internet - http://www.fckeditor.net + * Copyright (C) 2003-2008 Frederico Caldeira Knabben + * + * == BEGIN LICENSE == + * + * Licensed under the terms of any of the following licenses at your + * choice: + * + * - GNU General Public License Version 2 or later (the "GPL") + * http://www.gnu.org/licenses/gpl.html + * + * - GNU Lesser General Public License Version 2.1 or later (the "LGPL") + * http://www.gnu.org/licenses/lgpl.html + * + * - Mozilla Public License Version 1.1 or later (the "MPL") + * http://www.mozilla.org/MPL/MPL-1.1.html + * + * == END LICENSE == + * + * Preload a list of images, firing an event when complete. + */ + +var FCKImagePreloader = function() +{ + this._Images = new Array() ; +} + +FCKImagePreloader.prototype = +{ + AddImages : function( images ) + { + if ( typeof( images ) == 'string' ) + images = images.split( ';' ) ; + + this._Images = this._Images.concat( images ) ; + }, + + Start : function() + { + var aImages = this._Images ; + this._PreloadCount = aImages.length ; + + for ( var i = 0 ; i < aImages.length ; i++ ) + { + var eImg = document.createElement( 'img' ) ; + FCKTools.AddEventListenerEx( eImg, 'load', _FCKImagePreloader_OnImage, this ) ; + FCKTools.AddEventListenerEx( eImg, 'error', _FCKImagePreloader_OnImage, this ) ; + eImg.src = aImages[i] ; + + _FCKImagePreloader_ImageCache.push( eImg ) ; + } + } +}; + +// All preloaded images must be placed in a global array, otherwise the preload +// magic will not happen. +var _FCKImagePreloader_ImageCache = new Array() ; + +function _FCKImagePreloader_OnImage( ev, imagePreloader ) +{ + if ( (--imagePreloader._PreloadCount) == 0 && imagePreloader.OnComplete ) + imagePreloader.OnComplete() ; +} Property changes on: announcement/trunk/src/main/webapp/fckeditor/editor/_source/classes/fckimagepreloader.js ___________________________________________________________________ Name: svn:eol-style + native Added: announcement/trunk/src/main/webapp/fckeditor/editor/_source/classes/fckkeystrokehandler.js =================================================================== --- announcement/trunk/src/main/webapp/fckeditor/editor/_source/classes/fckkeystrokehandler.js (rev 0) +++ announcement/trunk/src/main/webapp/fckeditor/editor/_source/classes/fckkeystrokehandler.js 2008-06-30 02:54:27 UTC (rev 1002) @@ -0,0 +1,141 @@ +?/* + * FCKeditor - The text editor for Internet - http://www.fckeditor.net + * Copyright (C) 2003-2008 Frederico Caldeira Knabben + * + * == BEGIN LICENSE == + * + * Licensed under the terms of any of the following licenses at your + * choice: + * + * - GNU General Public License Version 2 or later (the "GPL") + * http://www.gnu.org/licenses/gpl.html + * + * - GNU Lesser General Public License Version 2.1 or later (the "LGPL") + * http://www.gnu.org/licenses/lgpl.html + * + * - Mozilla Public License Version 1.1 or later (the "MPL") + * http://www.mozilla.org/MPL/MPL-1.1.html + * + * == END LICENSE == + * + * Control keyboard keystroke combinations. + */ + +var FCKKeystrokeHandler = function( cancelCtrlDefaults ) +{ + this.Keystrokes = new Object() ; + this.CancelCtrlDefaults = ( cancelCtrlDefaults !== false ) ; +} + +/* + * Listen to keystroke events in an element or DOM document object. + * @target: The element or document to listen to keystroke events. + */ +FCKKeystrokeHandler.prototype.AttachToElement = function( target ) +{ + // For newer browsers, it is enough to listen to the keydown event only. + // Some browsers instead, don't cancel key events in the keydown, but in the + // keypress. So we must do a longer trip in those cases. + FCKTools.AddEventListenerEx( target, 'keydown', _FCKKeystrokeHandler_OnKeyDown, this ) ; + if ( FCKBrowserInfo.IsGecko10 || FCKBrowserInfo.IsOpera || ( FCKBrowserInfo.IsGecko && FCKBrowserInfo.IsMac ) ) + FCKTools.AddEventListenerEx( target, 'keypress', _FCKKeystrokeHandler_OnKeyPress, this ) ; +} + +/* + * Sets a list of keystrokes. It can receive either a single array or "n" + * arguments, each one being an array of 1 or 2 elemenst. The first element + * is the keystroke combination, and the second is the value to assign to it. + * If the second element is missing, the keystroke definition is removed. + */ +FCKKeystrokeHandler.prototype.SetKeystrokes = function() +{ + // Look through the arguments. + for ( var i = 0 ; i < arguments.length ; i++ ) + { + var keyDef = arguments[i] ; + + // If the configuration for the keystrokes is missing some element or has any extra comma + // this item won't be valid, so skip it and keep on processing. + if ( !keyDef ) + continue ; + + if ( typeof( keyDef[0] ) == 'object' ) // It is an array with arrays defining the keystrokes. + this.SetKeystrokes.apply( this, keyDef ) ; + else + { + if ( keyDef.length == 1 ) // If it has only one element, remove the keystroke. + delete this.Keystrokes[ keyDef[0] ] ; + else // Otherwise add it. + this.Keystrokes[ keyDef[0] ] = keyDef[1] === true ? true : keyDef ; + } + } +} + +function _FCKKeystrokeHandler_OnKeyDown( ev, keystrokeHandler ) +{ + // Get the key code. + var keystroke = ev.keyCode || ev.which ; + + // Combine it with the CTRL, SHIFT and ALT states. + var keyModifiers = 0 ; + + if ( ev.ctrlKey || ev.metaKey ) + keyModifiers += CTRL ; + + if ( ev.shiftKey ) + keyModifiers += SHIFT ; + + if ( ev.altKey ) + keyModifiers += ALT ; + + var keyCombination = keystroke + keyModifiers ; + + var cancelIt = keystrokeHandler._CancelIt = false ; + + // Look for its definition availability. + var keystrokeValue = keystrokeHandler.Keystrokes[ keyCombination ] ; + +// FCKDebug.Output( 'KeyDown: ' + keyCombination + ' - Value: ' + keystrokeValue ) ; + + // If the keystroke is defined + if ( keystrokeValue ) + { + // If the keystroke has been explicitly set to "true" OR calling the + // "OnKeystroke" event, it doesn't return "true", the default behavior + // must be preserved. + if ( keystrokeValue === true || !( keystrokeHandler.OnKeystroke && keystrokeHandler.OnKeystroke.apply( keystrokeHandler, keystrokeValue ) ) ) + return true ; + + cancelIt = true ; + } + + // By default, it will cancel all combinations with the CTRL key only (except positioning keys). + if ( cancelIt || ( keystrokeHandler.CancelCtrlDefaults && keyModifiers == CTRL && ( keystroke < 33 || keystroke > 40 ) ) ) + { + keystrokeHandler._CancelIt = true ; + + if ( ev.preventDefault ) + return ev.preventDefault() ; + + ev.returnValue = false ; + ev.cancelBubble = true ; + return false ; + } + + return true ; +} + +function _FCKKeystrokeHandler_OnKeyPress( ev, keystrokeHandler ) +{ + if ( keystrokeHandler._CancelIt ) + { +// FCKDebug.Output( 'KeyPress Cancel', 'Red') ; + + if ( ev.preventDefault ) + return ev.preventDefault() ; + + return false ; + } + + return true ; +} Property changes on: announcement/trunk/src/main/webapp/fckeditor/editor/_source/classes/fckkeystrokehandler.js ___________________________________________________________________ Name: svn:eol-style + native Added: announcement/trunk/src/main/webapp/fckeditor/editor/_source/classes/fckmenublock.js =================================================================== --- announcement/trunk/src/main/webapp/fckeditor/editor/_source/classes/fckmenublock.js (rev 0) +++ announcement/trunk/src/main/webapp/fckeditor/editor/_source/classes/fckmenublock.js 2008-06-30 02:54:27 UTC (rev 1002) @@ -0,0 +1,153 @@ +?/* + * FCKeditor - The text editor for Internet - http://www.fckeditor.net + * Copyright (C) 2003-2008 Frederico Caldeira Knabben + * + * == BEGIN LICENSE == + * + * Licensed under the terms of any of the following licenses at your + * choice: + * + * - GNU General Public License Version 2 or later (the "GPL") + * http://www.gnu.org/licenses/gpl.html + * + * - GNU Lesser General Public License Version 2.1 or later (the "LGPL") + * http://www.gnu.org/licenses/lgpl.html + * + * - Mozilla Public License Version 1.1 or later (the "MPL") + * http://www.mozilla.org/MPL/MPL-1.1.html + * + * == END LICENSE == + * + * Renders a list of menu items. + */ + +var FCKMenuBlock = function() +{ + this._Items = new Array() ; +} + + +FCKMenuBlock.prototype.Count = function() +{ + return this._Items.length ; +} + +FCKMenuBlock.prototype.AddItem = function( name, label, iconPathOrStripInfoArrayOrIndex, isDisabled, customData ) +{ + var oItem = new FCKMenuItem( this, name, label, iconPathOrStripInfoArrayOrIndex, isDisabled, customData ) ; + + oItem.OnClick = FCKTools.CreateEventListener( FCKMenuBlock_Item_OnClick, this ) ; + oItem.OnActivate = FCKTools.CreateEventListener( FCKMenuBlock_Item_OnActivate, this ) ; + + this._Items.push( oItem ) ; + + return oItem ; +} + +FCKMenuBlock.prototype.AddSeparator = function() +{ + this._Items.push( new FCKMenuSeparator() ) ; +} + +FCKMenuBlock.prototype.RemoveAllItems = function() +{ + this._Items = new Array() ; + + var eItemsTable = this._ItemsTable ; + if ( eItemsTable ) + { + while ( eItemsTable.rows.length > 0 ) + eItemsTable.deleteRow( 0 ) ; + } +} + +FCKMenuBlock.prototype.Create = function( parentElement ) +{ + if ( !this._ItemsTable ) + { + if ( FCK.IECleanup ) + FCK.IECleanup.AddItem( this, FCKMenuBlock_Cleanup ) ; + + this._Window = FCKTools.GetElementWindow( parentElement ) ; + + var oDoc = FCKTools.GetElementDocument( parentElement ) ; + + var eTable = parentElement.appendChild( oDoc.createElement( 'table' ) ) ; + eTable.cellPadding = 0 ; + eTable.cellSpacing = 0 ; + + FCKTools.DisableSelection( eTable ) ; + + var oMainElement = eTable.insertRow(-1).insertCell(-1) ; + oMainElement.className = 'MN_Menu' ; + + var eItemsTable = this._ItemsTable = oMainElement.appendChild( oDoc.createElement( 'table' ) ) ; + eItemsTable.cellPadding = 0 ; + eItemsTable.cellSpacing = 0 ; + } + + for ( var i = 0 ; i < this._Items.length ; i++ ) + this._Items[i].Create( this._ItemsTable ) ; +} + +/* Events */ + +function FCKMenuBlock_Item_OnClick( clickedItem, menuBlock ) +{ + if ( menuBlock.Hide ) + menuBlock.Hide() ; + + FCKTools.RunFunction( menuBlock.OnClick, menuBlock, [ clickedItem ] ) ; +} + +function FCKMenuBlock_Item_OnActivate( menuBlock ) +{ + var oActiveItem = menuBlock._ActiveItem ; + + if ( oActiveItem && oActiveItem != this ) + { + // Set the focus to this menu block window (to fire OnBlur on opened panels). + if ( !FCKBrowserInfo.IsIE && oActiveItem.HasSubMenu && !this.HasSubMenu ) + { + menuBlock._Window.focus() ; + + // Due to the event model provided by Opera, we need to set + // HasFocus here as the above focus() call will not fire the focus + // event in the panel immediately (#1200). + menuBlock.Panel.HasFocus = true ; + } + + oActiveItem.Deactivate() ; + } + + menuBlock._ActiveItem = this ; +} + +function FCKMenuBlock_Cleanup() +{ + this._Window = null ; + this._ItemsTable = null ; +} + +// ################# // + +var FCKMenuSeparator = function() +{} + +FCKMenuSeparator.prototype.Create = function( parentTable ) +{ + var oDoc = FCKTools.GetElementDocument( parentTable ) ; + + var r = parentTable.insertRow(-1) ; + + var eCell = r.insertCell(-1) ; + eCell.className = 'MN_Separator MN_Icon' ; + + eCell = r.insertCell(-1) ; + eCell.className = 'MN_Separator' ; + eCell.appendChild( oDoc.createElement( 'DIV' ) ).className = 'MN_Separator_Line' ; + + eCell = r.insertCell(-1) ; + eCell.className = 'MN_Separator' ; + eCell.appendChild( oDoc.createElement( 'DIV' ) ).className = 'MN_Separator_Line' ; +} Property changes on: announcement/trunk/src/main/webapp/fckeditor/editor/_source/classes/fckmenublock.js ___________________________________________________________________ Name: svn:eol-style + native Added: announcement/trunk/src/main/webapp/fckeditor/editor/_source/classes/fckmenublockpanel.js =================================================================== --- announcement/trunk/src/main/webapp/fckeditor/editor/_source/classes/fckmenublockpanel.js (rev 0) +++ announcement/trunk/src/main/webapp/fckeditor/editor/_source/classes/fckmenublockpanel.js 2008-06-30 02:54:27 UTC (rev 1002) @@ -0,0 +1,54 @@ +?/* + * FCKeditor - The text editor for Internet - http://www.fckeditor.net + * Copyright (C) 2003-2008 Frederico Caldeira Knabben + * + * == BEGIN LICENSE == + * + * Licensed under the terms of any of the following licenses at your + * choice: + * + * - GNU General Public License Version 2 or later (the "GPL") + * http://www.gnu.org/licenses/gpl.html + * + * - GNU Lesser General Public License Version 2.1 or later (the "LGPL") + * http://www.gnu.org/licenses/lgpl.html + * + * - Mozilla Public License Version 1.1 or later (the "MPL") + * http://www.mozilla.org/MPL/MPL-1.1.html + * + * == END LICENSE == + * + * This class is a menu block that behaves like a panel. It's a mix of the + * FCKMenuBlock and FCKPanel classes. + */ + +var FCKMenuBlockPanel = function() +{ + // Call the "base" constructor. + FCKMenuBlock.call( this ) ; +} + +FCKMenuBlockPanel.prototype = new FCKMenuBlock() ; + + +// Override the create method. +FCKMenuBlockPanel.prototype.Create = function() +{ + var oPanel = this.Panel = ( this.Parent && this.Parent.Panel ? this.Parent.Panel.CreateChildPanel() : new FCKPanel() ) ; + oPanel.AppendStyleSheet( FCKConfig.SkinEditorCSS ) ; + + // Call the "base" implementation. + FCKMenuBlock.prototype.Create.call( this, oPanel.MainNode ) ; +} + +FCKMenuBlockPanel.prototype.Show = function( x, y, relElement ) +{ + if ( !this.Panel.CheckIsOpened() ) + this.Panel.Show( x, y, relElement ) ; +} + +FCKMenuBlockPanel.prototype.Hide = function() +{ + if ( this.Panel.CheckIsOpened() ) + this.Panel.Hide() ; +} Property changes on: announcement/trunk/src/main/webapp/fckeditor/editor/_source/classes/fckmenublockpanel.js ___________________________________________________________________ Name: svn:eol-style + native Added: announcement/trunk/src/main/webapp/fckeditor/editor/_source/classes/fckmenuitem.js =================================================================== --- announcement/trunk/src/main/webapp/fckeditor/editor/_source/classes/fckmenuitem.js (rev 0) +++ announcement/trunk/src/main/webapp/fckeditor/editor/_source/classes/fckmenuitem.js 2008-06-30 02:54:27 UTC (rev 1002) @@ -0,0 +1,161 @@ +?/* + * FCKeditor - The text editor for Internet - http://www.fckeditor.net + * Copyright (C) 2003-2008 Frederico Caldeira Knabben + * + * == BEGIN LICENSE == + * + * Licensed under the terms of any of the following licenses at your + * choice: + * + * - GNU General Public License Version 2 or later (the "GPL") + * http://www.gnu.org/licenses/gpl.html + * + * - GNU Lesser General Public License Version 2.1 or later (the "LGPL") + * http://www.gnu.org/licenses/lgpl.html + * + * - Mozilla Public License Version 1.1 or later (the "MPL") + * http://www.mozilla.org/MPL/MPL-1.1.html + * + * == END LICENSE == + * + * Defines and renders a menu items in a menu block. + */ + +var FCKMenuItem = function( parentMenuBlock, name, label, iconPathOrStripInfoArray, isDisabled, customData ) +{ + this.Name = name ; + this.Label = label || name ; + this.IsDisabled = isDisabled ; + + this.Icon = new FCKIcon( iconPathOrStripInfoArray ) ; + + this.SubMenu = new FCKMenuBlockPanel() ; + this.SubMenu.Parent = parentMenuBlock ; + this.SubMenu.OnClick = FCKTools.CreateEventListener( FCKMenuItem_SubMenu_OnClick, this ) ; + this.CustomData = customData ; + + if ( FCK.IECleanup ) + FCK.IECleanup.AddItem( this, FCKMenuItem_Cleanup ) ; +} + + +FCKMenuItem.prototype.AddItem = function( name, label, iconPathOrStripInfoArrayOrIndex, isDisabled, customData ) +{ + this.HasSubMenu = true ; + return this.SubMenu.AddItem( name, label, iconPathOrStripInfoArrayOrIndex, isDisabled, customData ) ; +} + +FCKMenuItem.prototype.AddSeparator = function() +{ + this.SubMenu.AddSeparator() ; +} + +FCKMenuItem.prototype.Create = function( parentTable ) +{ + var bHasSubMenu = this.HasSubMenu ; + + var oDoc = FCKTools.GetElementDocument( parentTable ) ; + + // Add a row in the table to hold the menu item. + var r = this.MainElement = parentTable.insertRow(-1) ; + r.className = this.IsDisabled ? 'MN_Item_Disabled' : 'MN_Item' ; + + // Set the row behavior. + if ( !this.IsDisabled ) + { + FCKTools.AddEventListenerEx( r, 'mouseover', FCKMenuItem_OnMouseOver, [ this ] ) ; + FCKTools.AddEventListenerEx( r, 'click', FCKMenuItem_OnClick, [ this ] ) ; + + if ( !bHasSubMenu ) + FCKTools.AddEventListenerEx( r, 'mouseout', FCKMenuItem_OnMouseOut, [ this ] ) ; + } + + // Create the icon cell. + var eCell = r.insertCell(-1) ; + eCell.className = 'MN_Icon' ; + eCell.appendChild( this.Icon.CreateIconElement( oDoc ) ) ; + + // Create the label cell. + eCell = r.insertCell(-1) ; + eCell.className = 'MN_Label' ; + eCell.noWrap = true ; + eCell.appendChild( oDoc.createTextNode( this.Label ) ) ; + + // Create the arrow cell and setup the sub menu panel (if needed). + eCell = r.insertCell(-1) ; + if ( bHasSubMenu ) + { + eCell.className = 'MN_Arrow' ; + + // The arrow is a fixed size image. + var eArrowImg = eCell.appendChild( oDoc.createElement( 'IMG' ) ) ; + eArrowImg.src = FCK_IMAGES_PATH + 'arrow_' + FCKLang.Dir + '.gif' ; + eArrowImg.width = 4 ; + eArrowImg.height = 7 ; + + this.SubMenu.Create() ; + this.SubMenu.Panel.OnHide = FCKTools.CreateEventListener( FCKMenuItem_SubMenu_OnHide, this ) ; + } +} + +FCKMenuItem.prototype.Activate = function() +{ + this.MainElement.className = 'MN_Item_Over' ; + + if ( this.HasSubMenu ) + { + // Show the child menu block. The ( +2, -2 ) correction is done because + // of the padding in the skin. It is not a good solution because one + // could change the skin and so the final result would not be accurate. + // For now it is ok because we are controlling the skin. + this.SubMenu.Show( this.MainElement.offsetWidth + 2, -2, this.MainElement ) ; + } + + FCKTools.RunFunction( this.OnActivate, this ) ; +} + +FCKMenuItem.prototype.Deactivate = function() +{ + this.MainElement.className = 'MN_Item' ; + + if ( this.HasSubMenu ) + this.SubMenu.Hide() ; +} + +/* Events */ + +function FCKMenuItem_SubMenu_OnClick( clickedItem, listeningItem ) +{ + FCKTools.RunFunction( listeningItem.OnClick, listeningItem, [ clickedItem ] ) ; +} + +function FCKMenuItem_SubMenu_OnHide( menuItem ) +{ + menuItem.Deactivate() ; +} + +function FCKMenuItem_OnClick( ev, menuItem ) +{ + if ( menuItem.HasSubMenu ) + menuItem.Activate() ; + else + { + menuItem.Deactivate() ; + FCKTools.RunFunction( menuItem.OnClick, menuItem, [ menuItem ] ) ; + } +} + +function FCKMenuItem_OnMouseOver( ev, menuItem ) +{ + menuItem.Activate() ; +} + +function FCKMenuItem_OnMouseOut( ev, menuItem ) +{ + menuItem.Deactivate() ; +} + +function FCKMenuItem_Cleanup() +{ + this.MainElement = null ; +} Property changes on: announcement/trunk/src/main/webapp/fckeditor/editor/_source/classes/fckmenuitem.js ___________________________________________________________________ Name: svn:eol-style + native Added: announcement/trunk/src/main/webapp/fckeditor/editor/_source/classes/fckpanel.js =================================================================== --- announcement/trunk/src/main/webapp/fckeditor/editor/_source/classes/fckpanel.js (rev 0) +++ announcement/trunk/src/main/webapp/fckeditor/editor/_source/classes/fckpanel.js 2008-06-30 02:54:27 UTC (rev 1002) @@ -0,0 +1,386 @@ +?/* + * FCKeditor - The text editor for Internet - http://www.fckeditor.net + * Copyright (C) 2003-2008 Frederico Caldeira Knabben + * + * == BEGIN LICENSE == + * + * Licensed under the terms of any of the following licenses at your + * choice: + * + * - GNU General Public License Version 2 or later (the "GPL") + * http://www.gnu.org/licenses/gpl.html + * + * - GNU Lesser General Public License Version 2.1 or later (the "LGPL") + * http://www.gnu.org/licenses/lgpl.html + * + * - Mozilla Public License Version 1.1 or later (the "MPL") + * http://www.mozilla.org/MPL/MPL-1.1.html + * + * == END LICENSE == + * + * Component that creates floating panels. It is used by many + * other components, like the toolbar items, context menu, etc... + */ + +var FCKPanel = function( parentWindow ) +{ + this.IsRTL = ( FCKLang.Dir == 'rtl' ) ; + this.IsContextMenu = false ; + this._LockCounter = 0 ; + + this._Window = parentWindow || window ; + + var oDocument ; + + if ( FCKBrowserInfo.IsIE ) + { + // Create the Popup that will hold the panel. + // The popup has to be created before playing with domain hacks, see #1666. + this._Popup = this._Window.createPopup() ; + + // this._Window cannot be accessed while playing with domain hacks, but local variable is ok. + // See #1666. + var pDoc = this._Window.document ; + + // This is a trick to IE6 (not IE7). The original domain must be set + // before creating the popup, so we are able to take a refence to the + // document inside of it, and the set the proper domain for it. (#123) + if ( FCK_IS_CUSTOM_DOMAIN && !FCKBrowserInfo.IsIE7 ) + { + pDoc.domain = FCK_ORIGINAL_DOMAIN ; + document.domain = FCK_ORIGINAL_DOMAIN ; + } + + oDocument = this.Document = this._Popup.document ; + + // Set the proper domain inside the popup. + if ( FCK_IS_CUSTOM_DOMAIN ) + { + oDocument.domain = FCK_RUNTIME_DOMAIN ; + pDoc.domain = FCK_RUNTIME_DOMAIN ; + document.domain = FCK_RUNTIME_DOMAIN ; + } + + FCK.IECleanup.AddItem( this, FCKPanel_Cleanup ) ; + } + else + { + var oIFrame = this._IFrame = this._Window.document.createElement('iframe') ; + FCKTools.ResetStyles( oIFrame ); + oIFrame.src = 'javascript:void(0)' ; + oIFrame.allowTransparency = true ; + oIFrame.frameBorder = '0' ; + oIFrame.scrolling = 'no' ; + oIFrame.style.width = oIFrame.style.height = '0px' ; + FCKDomTools.SetElementStyles( oIFrame, + { + position : 'absolute', + zIndex : FCKConfig.FloatingPanelsZIndex + } ) ; + + this._Window.document.body.appendChild( oIFrame ) ; + + var oIFrameWindow = oIFrame.contentWindow ; + + oDocument = this.Document = oIFrameWindow.document ; + + // Workaround for Safari 12256. Ticket #63 + var sBase = '' ; + if ( FCKBrowserInfo.IsSafari ) + sBase = '' ; + + // Initialize the IFRAME document body. + oDocument.open() ; + oDocument.write( '' + sBase + '<\/head><\/body><\/html>' ) ; + oDocument.close() ; + + if( FCKBrowserInfo.IsAIR ) + FCKAdobeAIR.Panel_Contructor( oDocument, window.document.location ) ; + + FCKTools.AddEventListenerEx( oIFrameWindow, 'focus', FCKPanel_Window_OnFocus, this ) ; + FCKTools.AddEventListenerEx( oIFrameWindow, 'blur', FCKPanel_Window_OnBlur, this ) ; + } + + oDocument.dir = FCKLang.Dir ; + + FCKTools.AddEventListener( oDocument, 'contextmenu', FCKTools.CancelEvent ) ; + + + // Create the main DIV that is used as the panel base. + this.MainNode = oDocument.body.appendChild( oDocument.createElement('DIV') ) ; + + // The "float" property must be set so Firefox calculates the size correctly. + this.MainNode.style.cssFloat = this.IsRTL ? 'right' : 'left' ; +} + + +FCKPanel.prototype.AppendStyleSheet = function( styleSheet ) +{ + FCKTools.AppendStyleSheet( this.Document, styleSheet ) ; +} + +FCKPanel.prototype.Preload = function( x, y, relElement ) +{ + // The offsetWidth and offsetHeight properties are not available if the + // element is not visible. So we must "show" the popup with no size to + // be able to use that values in the second call (IE only). + if ( this._Popup ) + this._Popup.show( x, y, 0, 0, relElement ) ; +} + +FCKPanel.prototype.Show = function( x, y, relElement, width, height ) +{ + var iMainWidth ; + var eMainNode = this.MainNode ; + + if ( this._Popup ) + { + // The offsetWidth and offsetHeight properties are not available if the + // element is not visible. So we must "show" the popup with no size to + // be able to use that values in the second call. + this._Popup.show( x, y, 0, 0, relElement ) ; + + // The following lines must be place after the above "show", otherwise it + // doesn't has the desired effect. + FCKDomTools.SetElementStyles( eMainNode, + { + width : width ? width + 'px' : '', + height : height ? height + 'px' : '' + } ) ; + + iMainWidth = eMainNode.offsetWidth ; + + if ( this.IsRTL ) + { + if ( this.IsContextMenu ) + x = x - iMainWidth + 1 ; + else if ( relElement ) + x = ( x * -1 ) + relElement.offsetWidth - iMainWidth ; + } + + // Second call: Show the Popup at the specified location, with the correct size. + this._Popup.show( x, y, iMainWidth, eMainNode.offsetHeight, relElement ) ; + + if ( this.OnHide ) + { + if ( this._Timer ) + CheckPopupOnHide.call( this, true ) ; + + this._Timer = FCKTools.SetInterval( CheckPopupOnHide, 100, this ) ; + } + } + else + { + // Do not fire OnBlur while the panel is opened. + if ( typeof( FCK.ToolbarSet.CurrentInstance.FocusManager ) != 'undefined' ) + FCK.ToolbarSet.CurrentInstance.FocusManager.Lock() ; + + if ( this.ParentPanel ) + { + this.ParentPanel.Lock() ; + + // Due to a bug on FF3, we must ensure that the parent panel will + // blur (#1584). + FCKPanel_Window_OnBlur( null, this.ParentPanel ) ; + } + + // Toggle the iframe scrolling attribute to prevent the panel + // scrollbars from disappearing in FF Mac. (#191) + if ( FCKBrowserInfo.IsGecko && FCKBrowserInfo.IsMac ) + { + this._IFrame.scrolling = '' ; + FCKTools.RunFunction( function(){ this._IFrame.scrolling = 'no'; }, this ) ; + } + + // Be sure we'll not have more than one Panel opened at the same time. + // Do not unlock focus manager here because we're displaying another floating panel + // instead of returning the editor to a "no panel" state (Bug #1514). + if ( FCK.ToolbarSet.CurrentInstance.GetInstanceObject( 'FCKPanel' )._OpenedPanel && + FCK.ToolbarSet.CurrentInstance.GetInstanceObject( 'FCKPanel' )._OpenedPanel != this ) + FCK.ToolbarSet.CurrentInstance.GetInstanceObject( 'FCKPanel' )._OpenedPanel.Hide( false, true ) ; + + FCKDomTools.SetElementStyles( eMainNode, + { + width : width ? width + 'px' : '', + height : height ? height + 'px' : '' + } ) ; + + iMainWidth = eMainNode.offsetWidth ; + + if ( !width ) this._IFrame.width = 1 ; + if ( !height ) this._IFrame.height = 1 ; + + // This is weird... but with Firefox, we must get the offsetWidth before + // setting the _IFrame size (which returns "0"), and then after that, + // to return the correct width. Remove the first step and it will not + // work when the editor is in RTL. + // + // The "|| eMainNode.firstChild.offsetWidth" part has been added + // for Opera compatibility (see #570). + iMainWidth = eMainNode.offsetWidth || eMainNode.firstChild.offsetWidth ; + + // Base the popup coordinates upon the coordinates of relElement. + var oPos = FCKTools.GetDocumentPosition( this._Window, + relElement.nodeType == 9 ? + ( FCKTools.IsStrictMode( relElement ) ? relElement.documentElement : relElement.body ) : + relElement ) ; + + // Minus the offsets provided by any positioned parent element of the panel iframe. + var positionedAncestor = FCKDomTools.GetPositionedAncestor( this._IFrame.parentNode ) ; + if ( positionedAncestor ) + { + var nPos = FCKTools.GetDocumentPosition( FCKTools.GetElementWindow( positionedAncestor ), positionedAncestor ) ; + oPos.x -= nPos.x ; + oPos.y -= nPos.y ; + } + + if ( this.IsRTL && !this.IsContextMenu ) + x = ( x * -1 ) ; + + x += oPos.x ; + y += oPos.y ; + + if ( this.IsRTL ) + { + if ( this.IsContextMenu ) + x = x - iMainWidth + 1 ; + else if ( relElement ) + x = x + relElement.offsetWidth - iMainWidth ; + } + else + { + var oViewPaneSize = FCKTools.GetViewPaneSize( this._Window ) ; + var oScrollPosition = FCKTools.GetScrollPosition( this._Window ) ; + + var iViewPaneHeight = oViewPaneSize.Height + oScrollPosition.Y ; + var iViewPaneWidth = oViewPaneSize.Width + oScrollPosition.X ; + + if ( ( x + iMainWidth ) > iViewPaneWidth ) + x -= x + iMainWidth - iViewPaneWidth ; + + if ( ( y + eMainNode.offsetHeight ) > iViewPaneHeight ) + y -= y + eMainNode.offsetHeight - iViewPaneHeight ; + } + + // Set the context menu DIV in the specified location. + FCKDomTools.SetElementStyles( this._IFrame, + { + left : x + 'px', + top : y + 'px' + } ) ; + + // Move the focus to the IFRAME so we catch the "onblur". + this._IFrame.contentWindow.focus() ; + this._IsOpened = true ; + + var me = this ; + this._resizeTimer = setTimeout( function() + { + var iWidth = eMainNode.offsetWidth || eMainNode.firstChild.offsetWidth ; + var iHeight = eMainNode.offsetHeight ; + me._IFrame.style.width = iWidth + 'px' ; + me._IFrame.style.height = iHeight + 'px' ; + + }, 0 ) ; + + FCK.ToolbarSet.CurrentInstance.GetInstanceObject( 'FCKPanel' )._OpenedPanel = this ; + } + + FCKTools.RunFunction( this.OnShow, this ) ; +} + +FCKPanel.prototype.Hide = function( ignoreOnHide, ignoreFocusManagerUnlock ) +{ + if ( this._Popup ) + this._Popup.hide() ; + else + { + if ( !this._IsOpened || this._LockCounter > 0 ) + return ; + + // Enable the editor to fire the "OnBlur". + if ( typeof( FCKFocusManager ) != 'undefined' && !ignoreFocusManagerUnlock ) + FCKFocusManager.Unlock() ; + + // It is better to set the sizes to 0, otherwise Firefox would have + // rendering problems. + this._IFrame.style.width = this._IFrame.style.height = '0px' ; + + this._IsOpened = false ; + + if ( this._resizeTimer ) + { + clearTimeout( this._resizeTimer ) ; + this._resizeTimer = null ; + } + + if ( this.ParentPanel ) + this.ParentPanel.Unlock() ; + + if ( !ignoreOnHide ) + FCKTools.RunFunction( this.OnHide, this ) ; + } +} + +FCKPanel.prototype.CheckIsOpened = function() +{ + if ( this._Popup ) + return this._Popup.isOpen ; + else + return this._IsOpened ; +} + +FCKPanel.prototype.CreateChildPanel = function() +{ + var oWindow = this._Popup ? FCKTools.GetDocumentWindow( this.Document ) : this._Window ; + + var oChildPanel = new FCKPanel( oWindow ) ; + oChildPanel.ParentPanel = this ; + + return oChildPanel ; +} + +FCKPanel.prototype.Lock = function() +{ + this._LockCounter++ ; +} + +FCKPanel.prototype.Unlock = function() +{ + if ( --this._LockCounter == 0 && !this.HasFocus ) + this.Hide() ; +} + +/* Events */ + +function FCKPanel_Window_OnFocus( e, panel ) +{ + panel.HasFocus = true ; +} + +function FCKPanel_Window_OnBlur( e, panel ) +{ + panel.HasFocus = false ; + + if ( panel._LockCounter == 0 ) + FCKTools.RunFunction( panel.Hide, panel ) ; +} + +function CheckPopupOnHide( forceHide ) +{ + if ( forceHide || !this._Popup.isOpen ) + { + window.clearInterval( this._Timer ) ; + this._Timer = null ; + + FCKTools.RunFunction( this.OnHide, this ) ; + } +} + +function FCKPanel_Cleanup() +{ + this._Popup = null ; + this._Window = null ; + this.Document = null ; + this.MainNode = null ; +} Property changes on: announcement/trunk/src/main/webapp/fckeditor/editor/_source/classes/fckpanel.js ___________________________________________________________________ Name: svn:eol-style + native Added: announcement/trunk/src/main/webapp/fckeditor/editor/_source/classes/fckplugin.js =================================================================== --- announcement/trunk/src/main/webapp/fckeditor/editor/_source/classes/fckplugin.js (rev 0) +++ announcement/trunk/src/main/webapp/fckeditor/editor/_source/classes/fckplugin.js 2008-06-30 02:54:27 UTC (rev 1002) @@ -0,0 +1,56 @@ +?/* + * FCKeditor - The text editor for Internet - http://www.fckeditor.net + * Copyright (C) 2003-2008 Frederico Caldeira Knabben + * + * == BEGIN LICENSE == + * + * Licensed under the terms of any of the following licenses at your + * choice: + * + * - GNU General Public License Version 2 or later (the "GPL") + * http://www.gnu.org/licenses/gpl.html + * + * - GNU Lesser General Public License Version 2.1 or later (the "LGPL") + * http://www.gnu.org/licenses/lgpl.html + * + * - Mozilla Public License Version 1.1 or later (the "MPL") + * http://www.mozilla.org/MPL/MPL-1.1.html + * + * == END LICENSE == + * + * FCKPlugin Class: Represents a single plugin. + */ + +var FCKPlugin = function( name, availableLangs, basePath ) +{ + this.Name = name ; + this.BasePath = basePath ? basePath : FCKConfig.PluginsPath ; + this.Path = this.BasePath + name + '/' ; + + if ( !availableLangs || availableLangs.length == 0 ) + this.AvailableLangs = new Array() ; + else + this.AvailableLangs = availableLangs.split(',') ; +} + +FCKPlugin.prototype.Load = function() +{ + // Load the language file, if defined. + if ( this.AvailableLangs.length > 0 ) + { + var sLang ; + + // Check if the plugin has the language file for the active language. + if ( this.AvailableLangs.IndexOf( FCKLanguageManager.ActiveLanguage.Code ) >= 0 ) + sLang = FCKLanguageManager.ActiveLanguage.Code ; + else + // Load the default language file (first one) if the current one is not available. + sLang = this.AvailableLangs[0] ; + + // Add the main plugin script. + LoadScript( this.Path + 'lang/' + sLang + '.js' ) ; + } + + // Add the main plugin script. + LoadScript( this.Path + 'fckplugin.js' ) ; +} Property changes on: announcement/trunk/src/main/webapp/fckeditor/editor/_source/classes/fckplugin.js ___________________________________________________________________ Name: svn:eol-style + native Added: announcement/trunk/src/main/webapp/fckeditor/editor/_source/classes/fckspecialcombo.js =================================================================== --- announcement/trunk/src/main/webapp/fckeditor/editor/_source/classes/fckspecialcombo.js (rev 0) +++ announcement/trunk/src/main/webapp/fckeditor/editor/_source/classes/fckspecialcombo.js 2008-06-30 02:54:27 UTC (rev 1002) @@ -0,0 +1,376 @@ +?/* + * FCKeditor - The text editor for Internet - http://www.fckeditor.net + * Copyright (C) 2003-2008 Frederico Caldeira Knabben + * + * == BEGIN LICENSE == + * + * Licensed under the terms of any of the following licenses at your + * choice: + * + * - GNU General Public License Version 2 or later (the "GPL") + * http://www.gnu.org/licenses/gpl.html + * + * - GNU Lesser General Public License Version 2.1 or later (the "LGPL") + * http://www.gnu.org/licenses/lgpl.html + * + * - Mozilla Public License Version 1.1 or later (the "MPL") + * http://www.mozilla.org/MPL/MPL-1.1.html + * + * == END LICENSE == + * + * FCKSpecialCombo Class: represents a special combo. + */ + +var FCKSpecialCombo = function( caption, fieldWidth, panelWidth, panelMaxHeight, parentWindow ) +{ + // Default properties values. + this.FieldWidth = fieldWidth || 100 ; + this.PanelWidth = panelWidth || 150 ; + this.PanelMaxHeight = panelMaxHeight || 150 ; + this.Label = ' ' ; + this.Caption = caption ; + this.Tooltip = caption ; + this.Style = FCK_TOOLBARITEM_ICONTEXT ; + + this.Enabled = true ; + + this.Items = new Object() ; + + this._Panel = new FCKPanel( parentWindow || window ) ; + this._Panel.AppendStyleSheet( FCKConfig.SkinEditorCSS ) ; + this._PanelBox = this._Panel.MainNode.appendChild( this._Panel.Document.createElement( 'DIV' ) ) ; + this._PanelBox.className = 'SC_Panel' ; + this._PanelBox.style.width = this.PanelWidth + 'px' ; + + this._PanelBox.innerHTML = '
        ' ; + + this._ItemsHolderEl = this._PanelBox.getElementsByTagName('TD')[0] ; + + if ( FCK.IECleanup ) + FCK.IECleanup.AddItem( this, FCKSpecialCombo_Cleanup ) ; + +// this._Panel.StyleSheet = FCKConfig.SkinPath + 'fck_contextmenu.css' ; +// this._Panel.Create() ; +// this._Panel.PanelDiv.className += ' SC_Panel' ; +// this._Panel.PanelDiv.innerHTML = '
        ' ; +// this._ItemsHolderEl = this._Panel.PanelDiv.getElementsByTagName('TD')[0] ; +} + +function FCKSpecialCombo_ItemOnMouseOver() +{ + this.className += ' SC_ItemOver' ; +} + +function FCKSpecialCombo_ItemOnMouseOut() +{ + this.className = this.originalClass ; +} + +function FCKSpecialCombo_ItemOnClick( ev, specialCombo, itemId ) +{ + this.className = this.originalClass ; + + specialCombo._Panel.Hide() ; + + specialCombo.SetLabel( this.FCKItemLabel ) ; + + if ( typeof( specialCombo.OnSelect ) == 'function' ) + specialCombo.OnSelect( itemId, this ) ; +} + +FCKSpecialCombo.prototype.ClearItems = function () +{ + if ( this.Items ) + this.Items = {} ; + + var itemsholder = this._ItemsHolderEl ; + while ( itemsholder.firstChild ) + itemsholder.removeChild( itemsholder.firstChild ) ; +} + +FCKSpecialCombo.prototype.AddItem = function( id, html, label, bgColor ) +{ + //
        Bold 1
        + var oDiv = this._ItemsHolderEl.appendChild( this._Panel.Document.createElement( 'DIV' ) ) ; + oDiv.className = oDiv.originalClass = 'SC_Item' ; + oDiv.innerHTML = html ; + oDiv.FCKItemLabel = label || id ; + oDiv.Selected = false ; + + // In IE, the width must be set so the borders are shown correctly when the content overflows. + if ( FCKBrowserInfo.IsIE ) + oDiv.style.width = '100%' ; + + if ( bgColor ) + oDiv.style.backgroundColor = bgColor ; + + FCKTools.AddEventListenerEx( oDiv, 'mouseover', FCKSpecialCombo_ItemOnMouseOver ) ; + FCKTools.AddEventListenerEx( oDiv, 'mouseout', FCKSpecialCombo_ItemOnMouseOut ) ; + FCKTools.AddEventListenerEx( oDiv, 'click', FCKSpecialCombo_ItemOnClick, [ this, id ] ) ; + + this.Items[ id.toString().toLowerCase() ] = oDiv ; + + return oDiv ; +} + +FCKSpecialCombo.prototype.SelectItem = function( item ) +{ + if ( typeof item == 'string' ) + item = this.Items[ item.toString().toLowerCase() ] ; + + if ( item ) + { + item.className = item.originalClass = 'SC_ItemSelected' ; + item.Selected = true ; + } +} + +FCKSpecialCombo.prototype.SelectItemByLabel = function( itemLabel, setLabel ) +{ + for ( var id in this.Items ) + { + var oDiv = this.Items[id] ; + + if ( oDiv.FCKItemLabel == itemLabel ) + { + oDiv.className = oDiv.originalClass = 'SC_ItemSelected' ; + oDiv.Selected = true ; + + if ( setLabel ) + this.SetLabel( itemLabel ) ; + } + } +} + +FCKSpecialCombo.prototype.DeselectAll = function( clearLabel ) +{ + for ( var i in this.Items ) + { + if ( !this.Items[i] ) continue; + this.Items[i].className = this.Items[i].originalClass = 'SC_Item' ; + this.Items[i].Selected = false ; + } + + if ( clearLabel ) + this.SetLabel( '' ) ; +} + +FCKSpecialCombo.prototype.SetLabelById = function( id ) +{ + id = id ? id.toString().toLowerCase() : '' ; + + var oDiv = this.Items[ id ] ; + this.SetLabel( oDiv ? oDiv.FCKItemLabel : '' ) ; +} + +FCKSpecialCombo.prototype.SetLabel = function( text ) +{ + text = ( !text || text.length == 0 ) ? ' ' : text ; + + if ( text == this.Label ) + return ; + + this.Label = text ; + + var labelEl = this._LabelEl ; + if ( labelEl ) + { + labelEl.innerHTML = text ; + + // It may happen that the label is some HTML, including tags. This + // would be a problem because when the user click on those tags, the + // combo will get the selection from the editing area. So we must + // disable any kind of selection here. + FCKTools.DisableSelection( labelEl ) ; + } +} + +FCKSpecialCombo.prototype.SetEnabled = function( isEnabled ) +{ + this.Enabled = isEnabled ; + + // In IE it can happen when the page is reloaded that _OuterTable is null, so check its existence + if ( this._OuterTable ) + this._OuterTable.className = isEnabled ? '' : 'SC_FieldDisabled' ; +} + +FCKSpecialCombo.prototype.Create = function( targetElement ) +{ + var oDoc = FCKTools.GetElementDocument( targetElement ) ; + var eOuterTable = this._OuterTable = targetElement.appendChild( oDoc.createElement( 'TABLE' ) ) ; + eOuterTable.cellPadding = 0 ; + eOuterTable.cellSpacing = 0 ; + + eOuterTable.insertRow(-1) ; + + var sClass ; + var bShowLabel ; + + switch ( this.Style ) + { + case FCK_TOOLBARITEM_ONLYICON : + sClass = 'TB_ButtonType_Icon' ; + bShowLabel = false; + break ; + case FCK_TOOLBARITEM_ONLYTEXT : + sClass = 'TB_ButtonType_Text' ; + bShowLabel = false; + break ; + case FCK_TOOLBARITEM_ICONTEXT : + bShowLabel = true; + break ; + } + + if ( this.Caption && this.Caption.length > 0 && bShowLabel ) + { + var oCaptionCell = eOuterTable.rows[0].insertCell(-1) ; + oCaptionCell.innerHTML = this.Caption ; + oCaptionCell.className = 'SC_FieldCaption' ; + } + + // Create the main DIV element. + var oField = FCKTools.AppendElement( eOuterTable.rows[0].insertCell(-1), 'div' ) ; + if ( bShowLabel ) + { + oField.className = 'SC_Field' ; + oField.style.width = this.FieldWidth + 'px' ; + oField.innerHTML = '
         
        ' ; + + this._LabelEl = oField.getElementsByTagName('label')[0] ; // Memory Leak + this._LabelEl.innerHTML = this.Label ; + } + else + { + oField.className = 'TB_Button_Off' ; + //oField.innerHTML = '' + this.Caption + '
         
        ' ; + //oField.innerHTML = '
         
        ' ; + + // Gets the correct CSS class to use for the specified style (param). + oField.innerHTML = '' + + '' + + //'' + + '' + + '' + + '' + + '' + + '' + + '' + + '
        ' + this.Caption + '
        ' ; + } + + + // Events Handlers + + FCKTools.AddEventListenerEx( oField, 'mouseover', FCKSpecialCombo_OnMouseOver, this ) ; + FCKTools.AddEventListenerEx( oField, 'mouseout', FCKSpecialCombo_OnMouseOut, this ) ; + FCKTools.AddEventListenerEx( oField, 'click', FCKSpecialCombo_OnClick, this ) ; + + FCKTools.DisableSelection( this._Panel.Document.body ) ; +} + +function FCKSpecialCombo_Cleanup() +{ + this._LabelEl = null ; + this._OuterTable = null ; + this._ItemsHolderEl = null ; + this._PanelBox = null ; + + if ( this.Items ) + { + for ( var key in this.Items ) + this.Items[key] = null ; + } +} + +function FCKSpecialCombo_OnMouseOver( ev, specialCombo ) +{ + if ( specialCombo.Enabled ) + { + switch ( specialCombo.Style ) + { + case FCK_TOOLBARITEM_ONLYICON : + this.className = 'TB_Button_On_Over'; + break ; + case FCK_TOOLBARITEM_ONLYTEXT : + this.className = 'TB_Button_On_Over'; + break ; + case FCK_TOOLBARITEM_ICONTEXT : + this.className = 'SC_Field SC_FieldOver' ; + break ; + } + } +} + +function FCKSpecialCombo_OnMouseOut( ev, specialCombo ) +{ + switch ( specialCombo.Style ) + { + case FCK_TOOLBARITEM_ONLYICON : + this.className = 'TB_Button_Off'; + break ; + case FCK_TOOLBARITEM_ONLYTEXT : + this.className = 'TB_Button_Off'; + break ; + case FCK_TOOLBARITEM_ICONTEXT : + this.className='SC_Field' ; + break ; + } +} + +function FCKSpecialCombo_OnClick( e, specialCombo ) +{ + // For Mozilla we must stop the event propagation to avoid it hiding + // the panel because of a click outside of it. +// if ( e ) +// { +// e.stopPropagation() ; +// FCKPanelEventHandlers.OnDocumentClick( e ) ; +// } + + if ( specialCombo.Enabled ) + { + var oPanel = specialCombo._Panel ; + var oPanelBox = specialCombo._PanelBox ; + var oItemsHolder = specialCombo._ItemsHolderEl ; + var iMaxHeight = specialCombo.PanelMaxHeight ; + + if ( specialCombo.OnBeforeClick ) + specialCombo.OnBeforeClick( specialCombo ) ; + + // This is a tricky thing. We must call the "Load" function, otherwise + // it will not be possible to retrieve "oItemsHolder.offsetHeight" (IE only). + if ( FCKBrowserInfo.IsIE ) + oPanel.Preload( 0, this.offsetHeight, this ) ; + + if ( oItemsHolder.offsetHeight > iMaxHeight ) +// { + oPanelBox.style.height = iMaxHeight + 'px' ; + +// if ( FCKBrowserInfo.IsGecko ) +// oPanelBox.style.overflow = '-moz-scrollbars-vertical' ; +// } + else + oPanelBox.style.height = '' ; + +// oPanel.PanelDiv.style.width = specialCombo.PanelWidth + 'px' ; + + oPanel.Show( 0, this.offsetHeight, this ) ; + } + +// return false ; +} + +/* +Sample Combo Field HTML output: + +
        + + + + + + + +
         
        +
        +*/ Property changes on: announcement/trunk/src/main/webapp/fckeditor/editor/_source/classes/fckspecialcombo.js ___________________________________________________________________ Name: svn:eol-style + native Added: announcement/trunk/src/main/webapp/fckeditor/editor/_source/classes/fckstyle.js =================================================================== --- announcement/trunk/src/main/webapp/fckeditor/editor/_source/classes/fckstyle.js (rev 0) +++ announcement/trunk/src/main/webapp/fckeditor/editor/_source/classes/fckstyle.js 2008-06-30 02:54:27 UTC (rev 1002) @@ -0,0 +1,1449 @@ +?/* + * FCKeditor - The text editor for Internet - http://www.fckeditor.net + * Copyright (C) 2003-2008 Frederico Caldeira Knabben + * + * == BEGIN LICENSE == + * + * Licensed under the terms of any of the following licenses at your + * choice: + * + * - GNU General Public License Version 2 or later (the "GPL") + * http://www.gnu.org/licenses/gpl.html + * + * - GNU Lesser General Public License Version 2.1 or later (the "LGPL") + * http://www.gnu.org/licenses/lgpl.html + * + * - Mozilla Public License Version 1.1 or later (the "MPL") + * http://www.mozilla.org/MPL/MPL-1.1.html + * + * == END LICENSE == + * + * FCKStyle Class: contains a style definition, and all methods to work with + * the style in a document. + */ + +/** + * @param {Object} styleDesc A "style descriptor" object, containing the raw + * style definition in the following format: + * '' ; + FCK._BehaviorsStyle = sStyle ; + } + + return FCK._BehaviorsStyle ; +} + +function Doc_OnMouseUp() +{ + if ( FCK.EditorWindow.event.srcElement.tagName == 'HTML' ) + { + FCK.Focus() ; + FCK.EditorWindow.event.cancelBubble = true ; + FCK.EditorWindow.event.returnValue = false ; + } +} + +function Doc_OnPaste() +{ + var body = FCK.EditorDocument.body ; + + body.detachEvent( 'onpaste', Doc_OnPaste ) ; + + var ret = FCK.Paste( !FCKConfig.ForcePasteAsPlainText && !FCKConfig.AutoDetectPasteFromWord ) ; + + body.attachEvent( 'onpaste', Doc_OnPaste ) ; + + return ret ; +} + +function Doc_OnDblClick() +{ + FCK.OnDoubleClick( FCK.EditorWindow.event.srcElement ) ; + FCK.EditorWindow.event.cancelBubble = true ; +} + +function Doc_OnSelectionChange() +{ + // Don't fire the event if no document is loaded. + if ( !FCK.IsSelectionChangeLocked && FCK.EditorDocument ) + FCK.Events.FireEvent( "OnSelectionChange" ) ; +} + +function Doc_OnDrop() +{ + if ( FCK.MouseDownFlag ) + { + FCK.MouseDownFlag = false ; + return ; + } + + if ( FCKConfig.ForcePasteAsPlainText ) + { + var evt = FCK.EditorWindow.event ; + + if ( FCK._CheckIsPastingEnabled() || FCKConfig.ShowDropDialog ) + FCK.PasteAsPlainText( evt.dataTransfer.getData( 'Text' ) ) ; + + evt.returnValue = false ; + evt.cancelBubble = true ; + } +} + +FCK.InitializeBehaviors = function( dontReturn ) +{ + // Set the focus to the editable area when clicking in the document area. + // TODO: The cursor must be positioned at the end. + this.EditorDocument.attachEvent( 'onmouseup', Doc_OnMouseUp ) ; + + // Intercept pasting operations + this.EditorDocument.body.attachEvent( 'onpaste', Doc_OnPaste ) ; + + // Intercept drop operations + this.EditorDocument.body.attachEvent( 'ondrop', Doc_OnDrop ) ; + + // Reset the context menu. + FCK.ContextMenu._InnerContextMenu.AttachToElement( FCK.EditorDocument.body ) ; + + this.EditorDocument.attachEvent("onkeydown", FCK._KeyDownListener ) ; + + this.EditorDocument.attachEvent("ondblclick", Doc_OnDblClick ) ; + + // Catch cursor selection changes. + this.EditorDocument.attachEvent("onselectionchange", Doc_OnSelectionChange ) ; + + FCKTools.AddEventListener( FCK.EditorDocument, 'mousedown', Doc_OnMouseDown ) ; +} + +FCK.InsertHtml = function( html ) +{ + html = FCKConfig.ProtectedSource.Protect( html ) ; + html = FCK.ProtectEvents( html ) ; + html = FCK.ProtectUrls( html ) ; + html = FCK.ProtectTags( html ) ; + +// FCK.Focus() ; + FCKSelection.Restore() ; + FCK.EditorWindow.focus() ; + + FCKUndo.SaveUndoStep() ; + + // Gets the actual selection. + var oSel = FCKSelection.GetSelection() ; + + // Deletes the actual selection contents. + if ( oSel.type.toLowerCase() == 'control' ) + oSel.clear() ; + + // Using the following trick, any comment in the beginning of the HTML will + // be preserved. + html = '' + html ; + + // Insert the HTML. + oSel.createRange().pasteHTML( html ) ; + + // Remove the fake node + FCK.EditorDocument.getElementById('__fakeFCKRemove__').removeNode( true ) ; + + FCKDocumentProcessor.Process( FCK.EditorDocument ) ; + + // For some strange reason the SaveUndoStep() call doesn't activate the undo button at the first InsertHtml() call. + this.Events.FireEvent( "OnSelectionChange" ) ; +} + +FCK.SetInnerHtml = function( html ) // IE Only +{ + var oDoc = FCK.EditorDocument ; + // Using the following trick, any comment in the beginning of the HTML will + // be preserved. + oDoc.body.innerHTML = '
         
        ' + html ; + oDoc.getElementById('__fakeFCKRemove__').removeNode( true ) ; +} + +function FCK_PreloadImages() +{ + var oPreloader = new FCKImagePreloader() ; + + // Add the configured images. + oPreloader.AddImages( FCKConfig.PreloadImages ) ; + + // Add the skin icons strip. + oPreloader.AddImages( FCKConfig.SkinPath + 'fck_strip.gif' ) ; + + oPreloader.OnComplete = LoadToolbarSetup ; + oPreloader.Start() ; +} + +// Disable the context menu in the editor (outside the editing area). +function Document_OnContextMenu() +{ + return ( event.srcElement._FCKShowContextMenu == true ) ; +} +document.oncontextmenu = Document_OnContextMenu ; + +function FCK_Cleanup() +{ + this.LinkedField = null ; + this.EditorWindow = null ; + this.EditorDocument = null ; +} + +FCK._ExecPaste = function() +{ + // As we call ExecuteNamedCommand('Paste'), it would enter in a loop. So, let's use a semaphore. + if ( FCK._PasteIsRunning ) + return true ; + + if ( FCKConfig.ForcePasteAsPlainText ) + { + FCK.PasteAsPlainText() ; + return false ; + } + + var sHTML = FCK._CheckIsPastingEnabled( true ) ; + + if ( sHTML === false ) + FCKTools.RunFunction( FCKDialog.OpenDialog, FCKDialog, ['FCKDialog_Paste', FCKLang.Paste, 'dialog/fck_paste.html', 400, 330, 'Security'] ) ; + else + { + if ( FCKConfig.AutoDetectPasteFromWord && sHTML.length > 0 ) + { + var re = /<\w[^>]*(( class="?MsoNormal"?)|(="mso-))/gi ; + if ( re.test( sHTML ) ) + { + if ( confirm( FCKLang.PasteWordConfirm ) ) + { + FCK.PasteFromWord() ; + return false ; + } + } + } + + // Instead of inserting the retrieved HTML, let's leave the OS work for us, + // by calling FCK.ExecuteNamedCommand( 'Paste' ). It could give better results. + + // Enable the semaphore to avoid a loop. + FCK._PasteIsRunning = true ; + + FCK.ExecuteNamedCommand( 'Paste' ) ; + + // Removes the semaphore. + delete FCK._PasteIsRunning ; + } + + // Let's always make a custom implementation (return false), otherwise + // the new Keyboard Handler may conflict with this code, and the CTRL+V code + // could result in a simple "V" being pasted. + return false ; +} + +FCK.PasteAsPlainText = function( forceText ) +{ + if ( !FCK._CheckIsPastingEnabled() ) + { + FCKDialog.OpenDialog( 'FCKDialog_Paste', FCKLang.PasteAsText, 'dialog/fck_paste.html', 400, 330, 'PlainText' ) ; + return ; + } + + // Get the data available in the clipboard in text format. + var sText = null ; + if ( ! forceText ) + sText = clipboardData.getData("Text") ; + else + sText = forceText ; + + if ( sText && sText.length > 0 ) + { + // Replace the carriage returns with
        + sText = FCKTools.HTMLEncode( sText ) ; + sText = FCKTools.ProcessLineBreaks( window, FCKConfig, sText ) ; + + var closeTagIndex = sText.search( '

        ' ) ; + var startTagIndex = sText.search( '

        ' ) ; + + if ( ( closeTagIndex != -1 && startTagIndex != -1 && closeTagIndex < startTagIndex ) + || ( closeTagIndex != -1 && startTagIndex == -1 ) ) + { + var prefix = sText.substr( 0, closeTagIndex ) ; + sText = sText.substr( closeTagIndex + 4 ) ; + this.InsertHtml( prefix ) ; + } + + // Insert the resulting data in the editor. + FCKUndo.SaveLocked = true ; + this.InsertHtml( sText ) ; + FCKUndo.SaveLocked = false ; + } +} + +FCK._CheckIsPastingEnabled = function( returnContents ) +{ + // The following seams to be the only reliable way to check is script + // pasting operations are enabled in the security settings of IE6 and IE7. + // It adds a little bit of overhead to the check, but so far that's the + // only way, mainly because of IE7. + + FCK._PasteIsEnabled = false ; + + document.body.attachEvent( 'onpaste', FCK_CheckPasting_Listener ) ; + + // The execCommand in GetClipboardHTML will fire the "onpaste", only if the + // security settings are enabled. + var oReturn = FCK.GetClipboardHTML() ; + + document.body.detachEvent( 'onpaste', FCK_CheckPasting_Listener ) ; + + if ( FCK._PasteIsEnabled ) + { + if ( !returnContents ) + oReturn = true ; + } + else + oReturn = false ; + + delete FCK._PasteIsEnabled ; + + return oReturn ; +} + +function FCK_CheckPasting_Listener() +{ + FCK._PasteIsEnabled = true ; +} + +FCK.GetClipboardHTML = function() +{ + var oDiv = document.getElementById( '___FCKHiddenDiv' ) ; + + if ( !oDiv ) + { + oDiv = document.createElement( 'DIV' ) ; + oDiv.id = '___FCKHiddenDiv' ; + + var oDivStyle = oDiv.style ; + oDivStyle.position = 'absolute' ; + oDivStyle.visibility = oDivStyle.overflow = 'hidden' ; + oDivStyle.width = oDivStyle.height = 1 ; + + document.body.appendChild( oDiv ) ; + } + + oDiv.innerHTML = '' ; + + var oTextRange = document.body.createTextRange() ; + oTextRange.moveToElementText( oDiv ) ; + oTextRange.execCommand( 'Paste' ) ; + + var sData = oDiv.innerHTML ; + oDiv.innerHTML = '' ; + + return sData ; +} + +FCK.CreateLink = function( url, noUndo ) +{ + // Creates the array that will be returned. It contains one or more created links (see #220). + var aCreatedLinks = new Array() ; + + // Remove any existing link in the selection. + FCK.ExecuteNamedCommand( 'Unlink', null, false, !!noUndo ) ; + + if ( url.length > 0 ) + { + // If there are several images, and you try to link each one, all the images get inside the link: + // -> -> due to the call to 'CreateLink' (bug in IE) + if (FCKSelection.GetType() == 'Control') + { + // Create a link + var oLink = this.EditorDocument.createElement( 'A' ) ; + oLink.href = url ; + + // Get the selected object + var oControl = FCKSelection.GetSelectedElement() ; + // Put the link just before the object + oControl.parentNode.insertBefore(oLink, oControl) ; + // Move the object inside the link + oControl.parentNode.removeChild( oControl ) ; + oLink.appendChild( oControl ) ; + + return [ oLink ] ; + } + + // Generate a temporary name for the link. + var sTempUrl = 'javascript:void(0);/*' + ( new Date().getTime() ) + '*/' ; + + // Use the internal "CreateLink" command to create the link. + FCK.ExecuteNamedCommand( 'CreateLink', sTempUrl, false, !!noUndo ) ; + + // Look for the just create link. + var oLinks = this.EditorDocument.links ; + + for ( i = 0 ; i < oLinks.length ; i++ ) + { + var oLink = oLinks[i] ; + + // Check it this a newly created link. + // getAttribute must be used. oLink.url may cause problems with IE7 (#555). + if ( oLink.getAttribute( 'href', 2 ) == sTempUrl ) + { + var sInnerHtml = oLink.innerHTML ; // Save the innerHTML (IE changes it if it is like an URL). + oLink.href = url ; + oLink.innerHTML = sInnerHtml ; // Restore the innerHTML. + + // If the last child is a
        move it outside the link or it + // will be too easy to select this link again #388. + var oLastChild = oLink.lastChild ; + if ( oLastChild && oLastChild.nodeName == 'BR' ) + { + // Move the BR after the link. + FCKDomTools.InsertAfterNode( oLink, oLink.removeChild( oLastChild ) ) ; + } + + aCreatedLinks.push( oLink ) ; + } + } + } + + return aCreatedLinks ; +} + +function _FCK_RemoveDisabledAtt() +{ + this.removeAttribute( 'disabled' ) ; +} + +function Doc_OnMouseDown( evt ) +{ + var e = evt.srcElement ; + + // Radio buttons and checkboxes should not be allowed to be triggered in IE + // in editable mode. Otherwise the whole browser window may be locked by + // the buttons. (#1782) + if ( e.nodeName.IEquals( 'input' ) && e.type.IEquals( ['radio', 'checkbox'] ) && !e.disabled ) + { + e.disabled = true ; + FCKTools.SetTimeout( _FCK_RemoveDisabledAtt, 1, e ) ; + } +} Property changes on: announcement/trunk/src/main/webapp/fckeditor/editor/_source/internals/fck_ie.js ___________________________________________________________________ Name: svn:eol-style + native Added: announcement/trunk/src/main/webapp/fckeditor/editor/_source/internals/fckbrowserinfo.js =================================================================== --- announcement/trunk/src/main/webapp/fckeditor/editor/_source/internals/fckbrowserinfo.js (rev 0) +++ announcement/trunk/src/main/webapp/fckeditor/editor/_source/internals/fckbrowserinfo.js 2008-06-30 02:54:27 UTC (rev 1002) @@ -0,0 +1,61 @@ +?/* + * FCKeditor - The text editor for Internet - http://www.fckeditor.net + * Copyright (C) 2003-2008 Frederico Caldeira Knabben + * + * == BEGIN LICENSE == + * + * Licensed under the terms of any of the following licenses at your + * choice: + * + * - GNU General Public License Version 2 or later (the "GPL") + * http://www.gnu.org/licenses/gpl.html + * + * - GNU Lesser General Public License Version 2.1 or later (the "LGPL") + * http://www.gnu.org/licenses/lgpl.html + * + * - Mozilla Public License Version 1.1 or later (the "MPL") + * http://www.mozilla.org/MPL/MPL-1.1.html + * + * == END LICENSE == + * + * Contains browser detection information. + */ + +var s = navigator.userAgent.toLowerCase() ; + +var FCKBrowserInfo = +{ + IsIE : /*@cc_on!@*/false, + IsIE7 : /*@cc_on!@*/false && ( parseInt( s.match( /msie (\d+)/ )[1], 10 ) >= 7 ), + IsIE6 : /*@cc_on!@*/false && ( parseInt( s.match( /msie (\d+)/ )[1], 10 ) >= 6 ), + IsSafari : s.Contains(' applewebkit/'), // Read "IsWebKit" + IsOpera : !!window.opera, + IsAIR : s.Contains(' adobeair/'), + IsMac : s.Contains('macintosh') +} ; + +// Completes the browser info with further Gecko information. +(function( browserInfo ) +{ + browserInfo.IsGecko = ( navigator.product == 'Gecko' ) && !browserInfo.IsSafari && !browserInfo.IsOpera ; + browserInfo.IsGeckoLike = ( browserInfo.IsGecko || browserInfo.IsSafari || browserInfo.IsOpera ) ; + + if ( browserInfo.IsGecko ) + { + var geckoMatch = s.match( /rv:(\d+\.\d+)/ ) ; + var geckoVersion = geckoMatch && parseFloat( geckoMatch[1] ) ; + + // Actually "10" refers to Gecko versions before Firefox 1.5, when + // Gecko 1.8 (build 20051111) has been released. + + // Some browser (like Mozilla 1.7.13) may have a Gecko build greater + // than 20051111, so we must also check for the revision number not to + // be 1.7 (we are assuming that rv < 1.7 will not have build > 20051111). + + if ( geckoVersion ) + { + browserInfo.IsGecko10 = ( geckoVersion < 1.8 ) ; + browserInfo.IsGecko19 = ( geckoVersion > 1.8 ) ; + } + } +})(FCKBrowserInfo) ; Property changes on: announcement/trunk/src/main/webapp/fckeditor/editor/_source/internals/fckbrowserinfo.js ___________________________________________________________________ Name: svn:eol-style + native Added: announcement/trunk/src/main/webapp/fckeditor/editor/_source/internals/fckcodeformatter.js =================================================================== --- announcement/trunk/src/main/webapp/fckeditor/editor/_source/internals/fckcodeformatter.js (rev 0) +++ announcement/trunk/src/main/webapp/fckeditor/editor/_source/internals/fckcodeformatter.js 2008-06-30 02:54:27 UTC (rev 1002) @@ -0,0 +1,100 @@ +?/* + * FCKeditor - The text editor for Internet - http://www.fckeditor.net + * Copyright (C) 2003-2008 Frederico Caldeira Knabben + * + * == BEGIN LICENSE == + * + * Licensed under the terms of any of the following licenses at your + * choice: + * + * - GNU General Public License Version 2 or later (the "GPL") + * http://www.gnu.org/licenses/gpl.html + * + * - GNU Lesser General Public License Version 2.1 or later (the "LGPL") + * http://www.gnu.org/licenses/lgpl.html + * + * - Mozilla Public License Version 1.1 or later (the "MPL") + * http://www.mozilla.org/MPL/MPL-1.1.html + * + * == END LICENSE == + * + * Format the HTML. + */ + +var FCKCodeFormatter = new Object() ; + +FCKCodeFormatter.Init = function() +{ + var oRegex = this.Regex = new Object() ; + + // Regex for line breaks. + oRegex.BlocksOpener = /\<(P|DIV|H1|H2|H3|H4|H5|H6|ADDRESS|PRE|OL|UL|LI|TITLE|META|LINK|BASE|SCRIPT|LINK|TD|TH|AREA|OPTION)[^\>]*\>/gi ; + oRegex.BlocksCloser = /\<\/(P|DIV|H1|H2|H3|H4|H5|H6|ADDRESS|PRE|OL|UL|LI|TITLE|META|LINK|BASE|SCRIPT|LINK|TD|TH|AREA|OPTION)[^\>]*\>/gi ; + + oRegex.NewLineTags = /\<(BR|HR)[^\>]*\>/gi ; + + oRegex.MainTags = /\<\/?(HTML|HEAD|BODY|FORM|TABLE|TBODY|THEAD|TR)[^\>]*\>/gi ; + + oRegex.LineSplitter = /\s*\n+\s*/g ; + + // Regex for indentation. + oRegex.IncreaseIndent = /^\<(HTML|HEAD|BODY|FORM|TABLE|TBODY|THEAD|TR|UL|OL)[ \/\>]/i ; + oRegex.DecreaseIndent = /^\<\/(HTML|HEAD|BODY|FORM|TABLE|TBODY|THEAD|TR|UL|OL)[ \>]/i ; + oRegex.FormatIndentatorRemove = new RegExp( '^' + FCKConfig.FormatIndentator ) ; + + oRegex.ProtectedTags = /(]*>)([\s\S]*?)(<\/PRE>)/gi ; +} + +FCKCodeFormatter._ProtectData = function( outer, opener, data, closer ) +{ + return opener + '___FCKpd___' + FCKCodeFormatter.ProtectedData.AddItem( data ) + closer ; +} + +FCKCodeFormatter.Format = function( html ) +{ + if ( !this.Regex ) + this.Init() ; + + // Protected content that remain untouched during the + // process go in the following array. + FCKCodeFormatter.ProtectedData = new Array() ; + + var sFormatted = html.replace( this.Regex.ProtectedTags, FCKCodeFormatter._ProtectData ) ; + + // Line breaks. + sFormatted = sFormatted.replace( this.Regex.BlocksOpener, '\n$&' ) ; + sFormatted = sFormatted.replace( this.Regex.BlocksCloser, '$&\n' ) ; + sFormatted = sFormatted.replace( this.Regex.NewLineTags, '$&\n' ) ; + sFormatted = sFormatted.replace( this.Regex.MainTags, '\n$&\n' ) ; + + // Indentation. + var sIndentation = '' ; + + var asLines = sFormatted.split( this.Regex.LineSplitter ) ; + sFormatted = '' ; + + for ( var i = 0 ; i < asLines.length ; i++ ) + { + var sLine = asLines[i] ; + + if ( sLine.length == 0 ) + continue ; + + if ( this.Regex.DecreaseIndent.test( sLine ) ) + sIndentation = sIndentation.replace( this.Regex.FormatIndentatorRemove, '' ) ; + + sFormatted += sIndentation + sLine + '\n' ; + + if ( this.Regex.IncreaseIndent.test( sLine ) ) + sIndentation += FCKConfig.FormatIndentator ; + } + + // Now we put back the protected data. + for ( var j = 0 ; j < FCKCodeFormatter.ProtectedData.length ; j++ ) + { + var oRegex = new RegExp( '___FCKpd___' + j ) ; + sFormatted = sFormatted.replace( oRegex, FCKCodeFormatter.ProtectedData[j].replace( /\$/g, '$$$$' ) ) ; + } + + return sFormatted.Trim() ; +} Property changes on: announcement/trunk/src/main/webapp/fckeditor/editor/_source/internals/fckcodeformatter.js ___________________________________________________________________ Name: svn:eol-style + native Added: announcement/trunk/src/main/webapp/fckeditor/editor/_source/internals/fckcommands.js =================================================================== --- announcement/trunk/src/main/webapp/fckeditor/editor/_source/internals/fckcommands.js (rev 0) +++ announcement/trunk/src/main/webapp/fckeditor/editor/_source/internals/fckcommands.js 2008-06-30 02:54:27 UTC (rev 1002) @@ -0,0 +1,167 @@ +?/* + * FCKeditor - The text editor for Internet - http://www.fckeditor.net + * Copyright (C) 2003-2008 Frederico Caldeira Knabben + * + * == BEGIN LICENSE == + * + * Licensed under the terms of any of the following licenses at your + * choice: + * + * - GNU General Public License Version 2 or later (the "GPL") + * http://www.gnu.org/licenses/gpl.html + * + * - GNU Lesser General Public License Version 2.1 or later (the "LGPL") + * http://www.gnu.org/licenses/lgpl.html + * + * - Mozilla Public License Version 1.1 or later (the "MPL") + * http://www.mozilla.org/MPL/MPL-1.1.html + * + * == END LICENSE == + * + * Define all commands available in the editor. + */ + +var FCKCommands = FCK.Commands = new Object() ; +FCKCommands.LoadedCommands = new Object() ; + +FCKCommands.RegisterCommand = function( commandName, command ) +{ + this.LoadedCommands[ commandName ] = command ; +} + +FCKCommands.GetCommand = function( commandName ) +{ + var oCommand = FCKCommands.LoadedCommands[ commandName ] ; + + if ( oCommand ) + return oCommand ; + + switch ( commandName ) + { + case 'Bold' : + case 'Italic' : + case 'Underline' : + case 'StrikeThrough': + case 'Subscript' : + case 'Superscript' : oCommand = new FCKCoreStyleCommand( commandName ) ; break ; + + case 'RemoveFormat' : oCommand = new FCKRemoveFormatCommand() ; break ; + + case 'DocProps' : oCommand = new FCKDialogCommand( 'DocProps' , FCKLang.DocProps , 'dialog/fck_docprops.html' , 400, 380, FCKCommands.GetFullPageState ) ; break ; + case 'Templates' : oCommand = new FCKDialogCommand( 'Templates' , FCKLang.DlgTemplatesTitle , 'dialog/fck_template.html' , 380, 450 ) ; break ; + case 'Link' : oCommand = new FCKDialogCommand( 'Link' , FCKLang.DlgLnkWindowTitle , 'dialog/fck_link.html' , 400, 300 ) ; break ; + case 'Unlink' : oCommand = new FCKUnlinkCommand() ; break ; + case 'Anchor' : oCommand = new FCKDialogCommand( 'Anchor' , FCKLang.DlgAnchorTitle , 'dialog/fck_anchor.html' , 370, 160 ) ; break ; + case 'AnchorDelete' : oCommand = new FCKAnchorDeleteCommand() ; break ; + case 'BulletedList' : oCommand = new FCKDialogCommand( 'BulletedList', FCKLang.BulletedListProp , 'dialog/fck_listprop.html?UL' , 370, 160 ) ; break ; + case 'NumberedList' : oCommand = new FCKDialogCommand( 'NumberedList', FCKLang.NumberedListProp , 'dialog/fck_listprop.html?OL' , 370, 160 ) ; break ; + case 'About' : oCommand = new FCKDialogCommand( 'About' , FCKLang.About , 'dialog/fck_about.html' , 420, 330, function(){ return FCK_TRISTATE_OFF ; } ) ; break ; + case 'Find' : oCommand = new FCKDialogCommand( 'Find' , FCKLang.DlgFindAndReplaceTitle, 'dialog/fck_replace.html' , 340, 230, null, null, 'Find' ) ; break ; + case 'Replace' : oCommand = new FCKDialogCommand( 'Replace' , FCKLang.DlgFindAndReplaceTitle, 'dialog/fck_replace.html' , 340, 230, null, null, 'Replace' ) ; break ; + + case 'Image' : oCommand = new FCKDialogCommand( 'Image' , FCKLang.DlgImgTitle , 'dialog/fck_image.html' , 450, 390 ) ; break ; + case 'Flash' : oCommand = new FCKDialogCommand( 'Flash' , FCKLang.DlgFlashTitle , 'dialog/fck_flash.html' , 450, 390 ) ; break ; + case 'SpecialChar' : oCommand = new FCKDialogCommand( 'SpecialChar', FCKLang.DlgSpecialCharTitle , 'dialog/fck_specialchar.html' , 400, 290 ) ; break ; + case 'Smiley' : oCommand = new FCKDialogCommand( 'Smiley' , FCKLang.DlgSmileyTitle , 'dialog/fck_smiley.html' , FCKConfig.SmileyWindowWidth, FCKConfig.SmileyWindowHeight ) ; break ; + case 'Table' : oCommand = new FCKDialogCommand( 'Table' , FCKLang.DlgTableTitle , 'dialog/fck_table.html' , 480, 250 ) ; break ; + case 'TableProp' : oCommand = new FCKDialogCommand( 'Table' , FCKLang.DlgTableTitle , 'dialog/fck_table.html?Parent', 480, 250 ) ; break ; + case 'TableCellProp': oCommand = new FCKDialogCommand( 'TableCell' , FCKLang.DlgCellTitle , 'dialog/fck_tablecell.html' , 550, 240 ) ; break ; + + case 'Style' : oCommand = new FCKStyleCommand() ; break ; + + case 'FontName' : oCommand = new FCKFontNameCommand() ; break ; + case 'FontSize' : oCommand = new FCKFontSizeCommand() ; break ; + case 'FontFormat' : oCommand = new FCKFormatBlockCommand() ; break ; + + case 'Source' : oCommand = new FCKSourceCommand() ; break ; + case 'Preview' : oCommand = new FCKPreviewCommand() ; break ; + case 'Save' : oCommand = new FCKSaveCommand() ; break ; + case 'NewPage' : oCommand = new FCKNewPageCommand() ; break ; + case 'PageBreak' : oCommand = new FCKPageBreakCommand() ; break ; + case 'Rule' : oCommand = new FCKRuleCommand() ; break ; + + case 'TextColor' : oCommand = new FCKTextColorCommand('ForeColor') ; break ; + case 'BGColor' : oCommand = new FCKTextColorCommand('BackColor') ; break ; + + case 'Paste' : oCommand = new FCKPasteCommand() ; break ; + case 'PasteText' : oCommand = new FCKPastePlainTextCommand() ; break ; + case 'PasteWord' : oCommand = new FCKPasteWordCommand() ; break ; + + case 'JustifyLeft' : oCommand = new FCKJustifyCommand( 'left' ) ; break ; + case 'JustifyCenter' : oCommand = new FCKJustifyCommand( 'center' ) ; break ; + case 'JustifyRight' : oCommand = new FCKJustifyCommand( 'right' ) ; break ; + case 'JustifyFull' : oCommand = new FCKJustifyCommand( 'justify' ) ; break ; + case 'Indent' : oCommand = new FCKIndentCommand( 'indent', FCKConfig.IndentLength ) ; break ; + case 'Outdent' : oCommand = new FCKIndentCommand( 'outdent', FCKConfig.IndentLength * -1 ) ; break ; + case 'Blockquote' : oCommand = new FCKBlockQuoteCommand() ; break ; + + case 'TableInsertRowAfter' : oCommand = new FCKTableCommand('TableInsertRowAfter') ; break ; + case 'TableInsertRowBefore' : oCommand = new FCKTableCommand('TableInsertRowBefore') ; break ; + case 'TableDeleteRows' : oCommand = new FCKTableCommand('TableDeleteRows') ; break ; + case 'TableInsertColumnAfter' : oCommand = new FCKTableCommand('TableInsertColumnAfter') ; break ; + case 'TableInsertColumnBefore' : oCommand = new FCKTableCommand('TableInsertColumnBefore') ; break ; + case 'TableDeleteColumns' : oCommand = new FCKTableCommand('TableDeleteColumns') ; break ; + case 'TableInsertCellAfter' : oCommand = new FCKTableCommand('TableInsertCellAfter') ; break ; + case 'TableInsertCellBefore' : oCommand = new FCKTableCommand('TableInsertCellBefore') ; break ; + case 'TableDeleteCells' : oCommand = new FCKTableCommand('TableDeleteCells') ; break ; + case 'TableMergeCells' : oCommand = new FCKTableCommand('TableMergeCells') ; break ; + case 'TableMergeRight' : oCommand = new FCKTableCommand('TableMergeRight') ; break ; + case 'TableMergeDown' : oCommand = new FCKTableCommand('TableMergeDown') ; break ; + case 'TableHorizontalSplitCell' : oCommand = new FCKTableCommand('TableHorizontalSplitCell') ; break ; + case 'TableVerticalSplitCell' : oCommand = new FCKTableCommand('TableVerticalSplitCell') ; break ; + case 'TableDelete' : oCommand = new FCKTableCommand('TableDelete') ; break ; + + case 'Form' : oCommand = new FCKDialogCommand( 'Form' , FCKLang.Form , 'dialog/fck_form.html' , 380, 210 ) ; break ; + case 'Checkbox' : oCommand = new FCKDialogCommand( 'Checkbox' , FCKLang.Checkbox , 'dialog/fck_checkbox.html' , 380, 200 ) ; break ; + case 'Radio' : oCommand = new FCKDialogCommand( 'Radio' , FCKLang.RadioButton , 'dialog/fck_radiobutton.html' , 380, 200 ) ; break ; + case 'TextField' : oCommand = new FCKDialogCommand( 'TextField' , FCKLang.TextField , 'dialog/fck_textfield.html' , 380, 210 ) ; break ; + case 'Textarea' : oCommand = new FCKDialogCommand( 'Textarea' , FCKLang.Textarea , 'dialog/fck_textarea.html' , 380, 210 ) ; break ; + case 'HiddenField' : oCommand = new FCKDialogCommand( 'HiddenField', FCKLang.HiddenField , 'dialog/fck_hiddenfield.html' , 380, 190 ) ; break ; + case 'Button' : oCommand = new FCKDialogCommand( 'Button' , FCKLang.Button , 'dialog/fck_button.html' , 380, 210 ) ; break ; + case 'Select' : oCommand = new FCKDialogCommand( 'Select' , FCKLang.SelectionField, 'dialog/fck_select.html' , 400, 340 ) ; break ; + case 'ImageButton' : oCommand = new FCKDialogCommand( 'ImageButton', FCKLang.ImageButton , 'dialog/fck_image.html?ImageButton', 450, 390 ) ; break ; + + case 'SpellCheck' : oCommand = new FCKSpellCheckCommand() ; break ; + case 'FitWindow' : oCommand = new FCKFitWindow() ; break ; + + case 'Undo' : oCommand = new FCKUndoCommand() ; break ; + case 'Redo' : oCommand = new FCKRedoCommand() ; break ; + case 'Copy' : oCommand = new FCKCutCopyCommand( false ) ; break ; + case 'Cut' : oCommand = new FCKCutCopyCommand( true ) ; break ; + + case 'SelectAll' : oCommand = new FCKSelectAllCommand() ; break ; + case 'InsertOrderedList' : oCommand = new FCKListCommand( 'insertorderedlist', 'ol' ) ; break ; + case 'InsertUnorderedList' : oCommand = new FCKListCommand( 'insertunorderedlist', 'ul' ) ; break ; + case 'ShowBlocks' : oCommand = new FCKShowBlockCommand( 'ShowBlocks', FCKConfig.StartupShowBlocks ? FCK_TRISTATE_ON : FCK_TRISTATE_OFF ) ; break ; + + // Generic Undefined command (usually used when a command is under development). + case 'Undefined' : oCommand = new FCKUndefinedCommand() ; break ; + + // By default we assume that it is a named command. + default: + if ( FCKRegexLib.NamedCommands.test( commandName ) ) + oCommand = new FCKNamedCommand( commandName ) ; + else + { + alert( FCKLang.UnknownCommand.replace( /%1/g, commandName ) ) ; + return null ; + } + } + + FCKCommands.LoadedCommands[ commandName ] = oCommand ; + + return oCommand ; +} + +// Gets the state of the "Document Properties" button. It must be enabled only +// when "Full Page" editing is available. +FCKCommands.GetFullPageState = function() +{ + return FCKConfig.FullPage ? FCK_TRISTATE_OFF : FCK_TRISTATE_DISABLED ; +} + + +FCKCommands.GetBooleanState = function( isDisabled ) +{ + return isDisabled ? FCK_TRISTATE_DISABLED : FCK_TRISTATE_OFF ; +} Property changes on: announcement/trunk/src/main/webapp/fckeditor/editor/_source/internals/fckcommands.js ___________________________________________________________________ Name: svn:eol-style + native Added: announcement/trunk/src/main/webapp/fckeditor/editor/_source/internals/fckconfig.js =================================================================== --- announcement/trunk/src/main/webapp/fckeditor/editor/_source/internals/fckconfig.js (rev 0) +++ announcement/trunk/src/main/webapp/fckeditor/editor/_source/internals/fckconfig.js 2008-06-30 02:54:27 UTC (rev 1002) @@ -0,0 +1,237 @@ +?/* + * FCKeditor - The text editor for Internet - http://www.fckeditor.net + * Copyright (C) 2003-2008 Frederico Caldeira Knabben + * + * == BEGIN LICENSE == + * + * Licensed under the terms of any of the following licenses at your + * choice: + * + * - GNU General Public License Version 2 or later (the "GPL") + * http://www.gnu.org/licenses/gpl.html + * + * - GNU Lesser General Public License Version 2.1 or later (the "LGPL") + * http://www.gnu.org/licenses/lgpl.html + * + * - Mozilla Public License Version 1.1 or later (the "MPL") + * http://www.mozilla.org/MPL/MPL-1.1.html + * + * == END LICENSE == + * + * Creates and initializes the FCKConfig object. + */ + +var FCKConfig = FCK.Config = new Object() ; + +/* + For the next major version (probably 3.0) we should move all this stuff to + another dedicated object and leave FCKConfig as a holder object for settings only). +*/ + +// Editor Base Path +if ( document.location.protocol == 'file:' ) +{ + FCKConfig.BasePath = decodeURIComponent( document.location.pathname.substr(1) ) ; + FCKConfig.BasePath = FCKConfig.BasePath.replace( /\\/gi, '/' ) ; + + // The way to address local files is different according to the OS. + // In Windows it is file:// but in MacOs it is file:/// so let's get it automatically + var sFullProtocol = document.location.href.match( /^(file\:\/{2,3})/ )[1] ; + // #945 Opera does strange things with files loaded from the disk, and it fails in Mac to load xml files + if ( FCKBrowserInfo.IsOpera ) + sFullProtocol += 'localhost/' ; + + FCKConfig.BasePath = sFullProtocol + FCKConfig.BasePath.substring( 0, FCKConfig.BasePath.lastIndexOf( '/' ) + 1) ; +} +else + FCKConfig.BasePath = document.location.protocol + '//' + document.location.host + + document.location.pathname.substring( 0, document.location.pathname.lastIndexOf( '/' ) + 1) ; + +FCKConfig.FullBasePath = FCKConfig.BasePath ; + +FCKConfig.EditorPath = FCKConfig.BasePath.replace( /editor\/$/, '' ) ; + +// There is a bug in Gecko. If the editor is hidden on startup, an error is +// thrown when trying to get the screen dimensions. +try +{ + FCKConfig.ScreenWidth = screen.width ; + FCKConfig.ScreenHeight = screen.height ; +} +catch (e) +{ + FCKConfig.ScreenWidth = 800 ; + FCKConfig.ScreenHeight = 600 ; +} + +// Override the actual configuration values with the values passed throw the +// hidden field "___Config". +FCKConfig.ProcessHiddenField = function() +{ + this.PageConfig = new Object() ; + + // Get the hidden field. + var oConfigField = window.parent.document.getElementById( FCK.Name + '___Config' ) ; + + // Do nothing if the config field was not defined. + if ( ! oConfigField ) return ; + + var aCouples = oConfigField.value.split('&') ; + + for ( var i = 0 ; i < aCouples.length ; i++ ) + { + if ( aCouples[i].length == 0 ) + continue ; + + var aConfig = aCouples[i].split( '=' ) ; + var sKey = decodeURIComponent( aConfig[0] ) ; + var sVal = decodeURIComponent( aConfig[1] ) ; + + if ( sKey == 'CustomConfigurationsPath' ) // The Custom Config File path must be loaded immediately. + FCKConfig[ sKey ] = sVal ; + + else if ( sVal.toLowerCase() == "true" ) // If it is a boolean TRUE. + this.PageConfig[ sKey ] = true ; + + else if ( sVal.toLowerCase() == "false" ) // If it is a boolean FALSE. + this.PageConfig[ sKey ] = false ; + + else if ( sVal.length > 0 && !isNaN( sVal ) ) // If it is a number. + this.PageConfig[ sKey ] = parseInt( sVal, 10 ) ; + + else // In any other case it is a string. + this.PageConfig[ sKey ] = sVal ; + } +} + +function FCKConfig_LoadPageConfig() +{ + var oPageConfig = FCKConfig.PageConfig ; + for ( var sKey in oPageConfig ) + FCKConfig[ sKey ] = oPageConfig[ sKey ] ; +} + +function FCKConfig_PreProcess() +{ + var oConfig = FCKConfig ; + + // Force debug mode if fckdebug=true in the QueryString (main page). + if ( oConfig.AllowQueryStringDebug ) + { + try + { + if ( (/fckdebug=true/i).test( window.top.location.search ) ) + oConfig.Debug = true ; + } + catch (e) { /* Ignore it. Much probably we are inside a FRAME where the "top" is in another domain (security error). */ } + } + + // Certifies that the "PluginsPath" configuration ends with a slash. + if ( !oConfig.PluginsPath.EndsWith('/') ) + oConfig.PluginsPath += '/' ; + + // If no ToolbarComboPreviewCSS, point it to EditorAreaCSS. + var sComboPreviewCSS = oConfig.ToolbarComboPreviewCSS ; + if ( !sComboPreviewCSS || sComboPreviewCSS.length == 0 ) + oConfig.ToolbarComboPreviewCSS = oConfig.EditorAreaCSS ; + + // Turn the attributes that will be removed in the RemoveFormat from a string to an array + oConfig.RemoveAttributesArray = (oConfig.RemoveAttributes || '').split( ',' ); + + if ( !FCKConfig.SkinEditorCSS || FCKConfig.SkinEditorCSS.length == 0 ) + FCKConfig.SkinEditorCSS = FCKConfig.SkinPath + 'fck_editor.css' ; + + if ( !FCKConfig.SkinDialogCSS || FCKConfig.SkinDialogCSS.length == 0 ) + FCKConfig.SkinDialogCSS = FCKConfig.SkinPath + 'fck_dialog.css' ; +} + +// Define toolbar sets collection. +FCKConfig.ToolbarSets = new Object() ; + +// Defines the plugins collection. +FCKConfig.Plugins = new Object() ; +FCKConfig.Plugins.Items = new Array() ; + +FCKConfig.Plugins.Add = function( name, langs, path ) +{ + FCKConfig.Plugins.Items.AddItem( [name, langs, path] ) ; +} + +// FCKConfig.ProtectedSource: object that holds a collection of Regular +// Expressions that defined parts of the raw HTML that must remain untouched +// like custom tags, scripts, server side code, etc... +FCKConfig.ProtectedSource = new Object() ; + +// Generates a string used to identify and locate the Protected Tags comments. +FCKConfig.ProtectedSource._CodeTag = (new Date()).valueOf() ; + +// Initialize the regex array with the default ones. +FCKConfig.ProtectedSource.RegexEntries = [ + // First of any other protection, we must protect all comments to avoid + // loosing them (of course, IE related). + //g , + + // Script tags will also be forced to be protected, otherwise IE will execute them. + //gi, + + //

        + + + + + Preview
        + + + + + + Property changes on: announcement/trunk/src/main/webapp/fckeditor/editor/dialog/fck_docprops.html ___________________________________________________________________ Name: svn:eol-style + native Added: announcement/trunk/src/main/webapp/fckeditor/editor/dialog/fck_flash/fck_flash.js =================================================================== --- announcement/trunk/src/main/webapp/fckeditor/editor/dialog/fck_flash/fck_flash.js (rev 0) +++ announcement/trunk/src/main/webapp/fckeditor/editor/dialog/fck_flash/fck_flash.js 2008-06-30 02:54:27 UTC (rev 1002) @@ -0,0 +1,300 @@ +?/* + * FCKeditor - The text editor for Internet - http://www.fckeditor.net + * Copyright (C) 2003-2008 Frederico Caldeira Knabben + * + * == BEGIN LICENSE == + * + * Licensed under the terms of any of the following licenses at your + * choice: + * + * - GNU General Public License Version 2 or later (the "GPL") + * http://www.gnu.org/licenses/gpl.html + * + * - GNU Lesser General Public License Version 2.1 or later (the "LGPL") + * http://www.gnu.org/licenses/lgpl.html + * + * - Mozilla Public License Version 1.1 or later (the "MPL") + * http://www.mozilla.org/MPL/MPL-1.1.html + * + * == END LICENSE == + * + * Scripts related to the Flash dialog window (see fck_flash.html). + */ + +var dialog = window.parent ; +var oEditor = dialog.InnerDialogLoaded() ; +var FCK = oEditor.FCK ; +var FCKLang = oEditor.FCKLang ; +var FCKConfig = oEditor.FCKConfig ; +var FCKTools = oEditor.FCKTools ; + +//#### Dialog Tabs + +// Set the dialog tabs. +dialog.AddTab( 'Info', oEditor.FCKLang.DlgInfoTab ) ; + +if ( FCKConfig.FlashUpload ) + dialog.AddTab( 'Upload', FCKLang.DlgLnkUpload ) ; + +if ( !FCKConfig.FlashDlgHideAdvanced ) + dialog.AddTab( 'Advanced', oEditor.FCKLang.DlgAdvancedTag ) ; + +// Function called when a dialog tag is selected. +function OnDialogTabChange( tabCode ) +{ + ShowE('divInfo' , ( tabCode == 'Info' ) ) ; + ShowE('divUpload' , ( tabCode == 'Upload' ) ) ; + ShowE('divAdvanced' , ( tabCode == 'Advanced' ) ) ; +} + +// Get the selected flash embed (if available). +var oFakeImage = dialog.Selection.GetSelectedElement() ; +var oEmbed ; + +if ( oFakeImage ) +{ + if ( oFakeImage.tagName == 'IMG' && oFakeImage.getAttribute('_fckflash') ) + oEmbed = FCK.GetRealElement( oFakeImage ) ; + else + oFakeImage = null ; +} + +window.onload = function() +{ + // Translate the dialog box texts. + oEditor.FCKLanguageManager.TranslatePage(document) ; + + // Load the selected element information (if any). + LoadSelection() ; + + // Show/Hide the "Browse Server" button. + GetE('tdBrowse').style.display = FCKConfig.FlashBrowser ? '' : 'none' ; + + // Set the actual uploader URL. + if ( FCKConfig.FlashUpload ) + GetE('frmUpload').action = FCKConfig.FlashUploadURL ; + + dialog.SetAutoSize( true ) ; + + // Activate the "OK" button. + dialog.SetOkButton( true ) ; + + SelectField( 'txtUrl' ) ; +} + +function LoadSelection() +{ + if ( ! oEmbed ) return ; + + GetE('txtUrl').value = GetAttribute( oEmbed, 'src', '' ) ; + GetE('txtWidth').value = GetAttribute( oEmbed, 'width', '' ) ; + GetE('txtHeight').value = GetAttribute( oEmbed, 'height', '' ) ; + + // Get Advances Attributes + GetE('txtAttId').value = oEmbed.id ; + GetE('chkAutoPlay').checked = GetAttribute( oEmbed, 'play', 'true' ) == 'true' ; + GetE('chkLoop').checked = GetAttribute( oEmbed, 'loop', 'true' ) == 'true' ; + GetE('chkMenu').checked = GetAttribute( oEmbed, 'menu', 'true' ) == 'true' ; + GetE('cmbScale').value = GetAttribute( oEmbed, 'scale', '' ).toLowerCase() ; + + GetE('txtAttTitle').value = oEmbed.title ; + + if ( oEditor.FCKBrowserInfo.IsIE ) + { + GetE('txtAttClasses').value = oEmbed.getAttribute('className') || '' ; + GetE('txtAttStyle').value = oEmbed.style.cssText ; + } + else + { + GetE('txtAttClasses').value = oEmbed.getAttribute('class',2) || '' ; + GetE('txtAttStyle').value = oEmbed.getAttribute('style',2) || '' ; + } + + UpdatePreview() ; +} + +//#### The OK button was hit. +function Ok() +{ + if ( GetE('txtUrl').value.length == 0 ) + { + dialog.SetSelectedTab( 'Info' ) ; + GetE('txtUrl').focus() ; + + alert( oEditor.FCKLang.DlgAlertUrl ) ; + + return false ; + } + + oEditor.FCKUndo.SaveUndoStep() ; + if ( !oEmbed ) + { + oEmbed = FCK.EditorDocument.createElement( 'EMBED' ) ; + oFakeImage = null ; + } + UpdateEmbed( oEmbed ) ; + + if ( !oFakeImage ) + { + oFakeImage = oEditor.FCKDocumentProcessor_CreateFakeImage( 'FCK__Flash', oEmbed ) ; + oFakeImage.setAttribute( '_fckflash', 'true', 0 ) ; + oFakeImage = FCK.InsertElement( oFakeImage ) ; + } + + oEditor.FCKEmbedAndObjectProcessor.RefreshView( oFakeImage, oEmbed ) ; + + return true ; +} + +function UpdateEmbed( e ) +{ + SetAttribute( e, 'type' , 'application/x-shockwave-flash' ) ; + SetAttribute( e, 'pluginspage' , 'http://www.macromedia.com/go/getflashplayer' ) ; + + SetAttribute( e, 'src', GetE('txtUrl').value ) ; + SetAttribute( e, "width" , GetE('txtWidth').value ) ; + SetAttribute( e, "height", GetE('txtHeight').value ) ; + + // Advances Attributes + + SetAttribute( e, 'id' , GetE('txtAttId').value ) ; + SetAttribute( e, 'scale', GetE('cmbScale').value ) ; + + SetAttribute( e, 'play', GetE('chkAutoPlay').checked ? 'true' : 'false' ) ; + SetAttribute( e, 'loop', GetE('chkLoop').checked ? 'true' : 'false' ) ; + SetAttribute( e, 'menu', GetE('chkMenu').checked ? 'true' : 'false' ) ; + + SetAttribute( e, 'title' , GetE('txtAttTitle').value ) ; + + if ( oEditor.FCKBrowserInfo.IsIE ) + { + SetAttribute( e, 'className', GetE('txtAttClasses').value ) ; + e.style.cssText = GetE('txtAttStyle').value ; + } + else + { + SetAttribute( e, 'class', GetE('txtAttClasses').value ) ; + SetAttribute( e, 'style', GetE('txtAttStyle').value ) ; + } +} + +var ePreview ; + +function SetPreviewElement( previewEl ) +{ + ePreview = previewEl ; + + if ( GetE('txtUrl').value.length > 0 ) + UpdatePreview() ; +} + +function UpdatePreview() +{ + if ( !ePreview ) + return ; + + while ( ePreview.firstChild ) + ePreview.removeChild( ePreview.firstChild ) ; + + if ( GetE('txtUrl').value.length == 0 ) + ePreview.innerHTML = ' ' ; + else + { + var oDoc = ePreview.ownerDocument || ePreview.document ; + var e = oDoc.createElement( 'EMBED' ) ; + + SetAttribute( e, 'src', GetE('txtUrl').value ) ; + SetAttribute( e, 'type', 'application/x-shockwave-flash' ) ; + SetAttribute( e, 'width', '100%' ) ; + SetAttribute( e, 'height', '100%' ) ; + + ePreview.appendChild( e ) ; + } +} + +// + +function BrowseServer() +{ + OpenFileBrowser( FCKConfig.FlashBrowserURL, FCKConfig.FlashBrowserWindowWidth, FCKConfig.FlashBrowserWindowHeight ) ; +} + +function SetUrl( url, width, height ) +{ + GetE('txtUrl').value = url ; + + if ( width ) + GetE('txtWidth').value = width ; + + if ( height ) + GetE('txtHeight').value = height ; + + UpdatePreview() ; + + dialog.SetSelectedTab( 'Info' ) ; +} + +function OnUploadCompleted( errorNumber, fileUrl, fileName, customMsg ) +{ + // Remove animation + window.parent.Throbber.Hide() ; + GetE( 'divUpload' ).style.display = '' ; + + switch ( errorNumber ) + { + case 0 : // No errors + alert( 'Your file has been successfully uploaded' ) ; + break ; + case 1 : // Custom error + alert( customMsg ) ; + return ; + case 101 : // Custom warning + alert( customMsg ) ; + break ; + case 201 : + alert( 'A file with the same name is already available. The uploaded file has been renamed to "' + fileName + '"' ) ; + break ; + case 202 : + alert( 'Invalid file type' ) ; + return ; + case 203 : + alert( "Security error. You probably don't have enough permissions to upload. Please check your server." ) ; + return ; + case 500 : + alert( 'The connector is disabled' ) ; + break ; + default : + alert( 'Error on file upload. Error number: ' + errorNumber ) ; + return ; + } + + SetUrl( fileUrl ) ; + GetE('frmUpload').reset() ; +} + +var oUploadAllowedExtRegex = new RegExp( FCKConfig.FlashUploadAllowedExtensions, 'i' ) ; +var oUploadDeniedExtRegex = new RegExp( FCKConfig.FlashUploadDeniedExtensions, 'i' ) ; + +function CheckUpload() +{ + var sFile = GetE('txtUploadFile').value ; + + if ( sFile.length == 0 ) + { + alert( 'Please select a file to upload' ) ; + return false ; + } + + if ( ( FCKConfig.FlashUploadAllowedExtensions.length > 0 && !oUploadAllowedExtRegex.test( sFile ) ) || + ( FCKConfig.FlashUploadDeniedExtensions.length > 0 && oUploadDeniedExtRegex.test( sFile ) ) ) + { + OnUploadCompleted( 202 ) ; + return false ; + } + + // Show animation + window.parent.Throbber.Show( 100 ) ; + GetE( 'divUpload' ).style.display = 'none' ; + + return true ; +} Property changes on: announcement/trunk/src/main/webapp/fckeditor/editor/dialog/fck_flash/fck_flash.js ___________________________________________________________________ Name: svn:eol-style + native Added: announcement/trunk/src/main/webapp/fckeditor/editor/dialog/fck_flash/fck_flash_preview.html =================================================================== --- announcement/trunk/src/main/webapp/fckeditor/editor/dialog/fck_flash/fck_flash_preview.html (rev 0) +++ announcement/trunk/src/main/webapp/fckeditor/editor/dialog/fck_flash/fck_flash_preview.html 2008-06-30 02:54:27 UTC (rev 1002) @@ -0,0 +1,50 @@ + + + + + + + + + + + + Property changes on: announcement/trunk/src/main/webapp/fckeditor/editor/dialog/fck_flash/fck_flash_preview.html ___________________________________________________________________ Name: svn:eol-style + native Added: announcement/trunk/src/main/webapp/fckeditor/editor/dialog/fck_flash.html =================================================================== --- announcement/trunk/src/main/webapp/fckeditor/editor/dialog/fck_flash.html (rev 0) +++ announcement/trunk/src/main/webapp/fckeditor/editor/dialog/fck_flash.html 2008-06-30 02:54:27 UTC (rev 1002) @@ -0,0 +1,152 @@ + + + + + Flash Properties + + + + + + + +
        + + + + + + + + + + +
        + + + + + + + + +
        URL +
        +
        +
        + + + + + + +
        + Width
        + +
          + Height
        + +
        +
        + + + + +
        + + + + + + + +
        Preview
        +
        +
        +
        + + + + Property changes on: announcement/trunk/src/main/webapp/fckeditor/editor/dialog/fck_flash.html ___________________________________________________________________ Name: svn:eol-style + native Added: announcement/trunk/src/main/webapp/fckeditor/editor/dialog/fck_form.html =================================================================== --- announcement/trunk/src/main/webapp/fckeditor/editor/dialog/fck_form.html (rev 0) +++ announcement/trunk/src/main/webapp/fckeditor/editor/dialog/fck_form.html 2008-06-30 02:54:27 UTC (rev 1002) @@ -0,0 +1,109 @@ + + + + + + + + + + + + + + + +
        + + + + + + + + + + +
        + Name
        + +
        + Action
        + +
        + Method
        + +
        +
        + + Property changes on: announcement/trunk/src/main/webapp/fckeditor/editor/dialog/fck_form.html ___________________________________________________________________ Name: svn:eol-style + native Added: announcement/trunk/src/main/webapp/fckeditor/editor/dialog/fck_hiddenfield.html =================================================================== --- announcement/trunk/src/main/webapp/fckeditor/editor/dialog/fck_hiddenfield.html (rev 0) +++ announcement/trunk/src/main/webapp/fckeditor/editor/dialog/fck_hiddenfield.html 2008-06-30 02:54:27 UTC (rev 1002) @@ -0,0 +1,115 @@ + + + + + Hidden Field Properties + + + + + + + + + + +
        + + + + + + + +
        + Name
        + +
        + Value
        + +
        +
        + + Property changes on: announcement/trunk/src/main/webapp/fckeditor/editor/dialog/fck_hiddenfield.html ___________________________________________________________________ Name: svn:eol-style + native Added: announcement/trunk/src/main/webapp/fckeditor/editor/dialog/fck_image/fck_image.js =================================================================== --- announcement/trunk/src/main/webapp/fckeditor/editor/dialog/fck_image/fck_image.js (rev 0) +++ announcement/trunk/src/main/webapp/fckeditor/editor/dialog/fck_image/fck_image.js 2008-06-30 02:54:27 UTC (rev 1002) @@ -0,0 +1,512 @@ +?/* + * FCKeditor - The text editor for Internet - http://www.fckeditor.net + * Copyright (C) 2003-2008 Frederico Caldeira Knabben + * + * == BEGIN LICENSE == + * + * Licensed under the terms of any of the following licenses at your + * choice: + * + * - GNU General Public License Version 2 or later (the "GPL") + * http://www.gnu.org/licenses/gpl.html + * + * - GNU Lesser General Public License Version 2.1 or later (the "LGPL") + * http://www.gnu.org/licenses/lgpl.html + * + * - Mozilla Public License Version 1.1 or later (the "MPL") + * http://www.mozilla.org/MPL/MPL-1.1.html + * + * == END LICENSE == + * + * Scripts related to the Image dialog window (see fck_image.html). + */ + +var dialog = window.parent ; +var oEditor = dialog.InnerDialogLoaded() ; +var FCK = oEditor.FCK ; +var FCKLang = oEditor.FCKLang ; +var FCKConfig = oEditor.FCKConfig ; +var FCKDebug = oEditor.FCKDebug ; +var FCKTools = oEditor.FCKTools ; + +var bImageButton = ( document.location.search.length > 0 && document.location.search.substr(1) == 'ImageButton' ) ; + +//#### Dialog Tabs + +// Set the dialog tabs. +dialog.AddTab( 'Info', FCKLang.DlgImgInfoTab ) ; + +if ( !bImageButton && !FCKConfig.ImageDlgHideLink ) + dialog.AddTab( 'Link', FCKLang.DlgImgLinkTab ) ; + +if ( FCKConfig.ImageUpload ) + dialog.AddTab( 'Upload', FCKLang.DlgLnkUpload ) ; + +if ( !FCKConfig.ImageDlgHideAdvanced ) + dialog.AddTab( 'Advanced', FCKLang.DlgAdvancedTag ) ; + +// Function called when a dialog tag is selected. +function OnDialogTabChange( tabCode ) +{ + ShowE('divInfo' , ( tabCode == 'Info' ) ) ; + ShowE('divLink' , ( tabCode == 'Link' ) ) ; + ShowE('divUpload' , ( tabCode == 'Upload' ) ) ; + ShowE('divAdvanced' , ( tabCode == 'Advanced' ) ) ; +} + +// Get the selected image (if available). +var oImage = dialog.Selection.GetSelectedElement() ; + +if ( oImage && oImage.tagName != 'IMG' && !( oImage.tagName == 'INPUT' && oImage.type == 'image' ) ) + oImage = null ; + +// Get the active link. +var oLink = dialog.Selection.GetSelection().MoveToAncestorNode( 'A' ) ; + +var oImageOriginal ; + +function UpdateOriginal( resetSize ) +{ + if ( !eImgPreview ) + return ; + + if ( GetE('txtUrl').value.length == 0 ) + { + oImageOriginal = null ; + return ; + } + + oImageOriginal = document.createElement( 'IMG' ) ; // new Image() ; + + if ( resetSize ) + { + oImageOriginal.onload = function() + { + this.onload = null ; + ResetSizes() ; + } + } + + oImageOriginal.src = eImgPreview.src ; +} + +var bPreviewInitialized ; + +window.onload = function() +{ + // Translate the dialog box texts. + oEditor.FCKLanguageManager.TranslatePage(document) ; + + GetE('btnLockSizes').title = FCKLang.DlgImgLockRatio ; + GetE('btnResetSize').title = FCKLang.DlgBtnResetSize ; + + // Load the selected element information (if any). + LoadSelection() ; + + // Show/Hide the "Browse Server" button. + GetE('tdBrowse').style.display = FCKConfig.ImageBrowser ? '' : 'none' ; + GetE('divLnkBrowseServer').style.display = FCKConfig.LinkBrowser ? '' : 'none' ; + + UpdateOriginal() ; + + // Set the actual uploader URL. + if ( FCKConfig.ImageUpload ) + GetE('frmUpload').action = FCKConfig.ImageUploadURL ; + + dialog.SetAutoSize( true ) ; + + // Activate the "OK" button. + dialog.SetOkButton( true ) ; + + SelectField( 'txtUrl' ) ; +} + +function LoadSelection() +{ + if ( ! oImage ) return ; + + var sUrl = oImage.getAttribute( '_fcksavedurl' ) ; + if ( sUrl == null ) + sUrl = GetAttribute( oImage, 'src', '' ) ; + + GetE('txtUrl').value = sUrl ; + GetE('txtAlt').value = GetAttribute( oImage, 'alt', '' ) ; + GetE('txtVSpace').value = GetAttribute( oImage, 'vspace', '' ) ; + GetE('txtHSpace').value = GetAttribute( oImage, 'hspace', '' ) ; + GetE('txtBorder').value = GetAttribute( oImage, 'border', '' ) ; + GetE('cmbAlign').value = GetAttribute( oImage, 'align', '' ) ; + + var iWidth, iHeight ; + + var regexSize = /^\s*(\d+)px\s*$/i ; + + if ( oImage.style.width ) + { + var aMatchW = oImage.style.width.match( regexSize ) ; + if ( aMatchW ) + { + iWidth = aMatchW[1] ; + oImage.style.width = '' ; + SetAttribute( oImage, 'width' , iWidth ) ; + } + } + + if ( oImage.style.height ) + { + var aMatchH = oImage.style.height.match( regexSize ) ; + if ( aMatchH ) + { + iHeight = aMatchH[1] ; + oImage.style.height = '' ; + SetAttribute( oImage, 'height', iHeight ) ; + } + } + + GetE('txtWidth').value = iWidth ? iWidth : GetAttribute( oImage, "width", '' ) ; + GetE('txtHeight').value = iHeight ? iHeight : GetAttribute( oImage, "height", '' ) ; + + // Get Advances Attributes + GetE('txtAttId').value = oImage.id ; + GetE('cmbAttLangDir').value = oImage.dir ; + GetE('txtAttLangCode').value = oImage.lang ; + GetE('txtAttTitle').value = oImage.title ; + GetE('txtLongDesc').value = oImage.longDesc ; + + if ( oEditor.FCKBrowserInfo.IsIE ) + { + GetE('txtAttClasses').value = oImage.className || '' ; + GetE('txtAttStyle').value = oImage.style.cssText ; + } + else + { + GetE('txtAttClasses').value = oImage.getAttribute('class',2) || '' ; + GetE('txtAttStyle').value = oImage.getAttribute('style',2) ; + } + + if ( oLink ) + { + var sLinkUrl = oLink.getAttribute( '_fcksavedurl' ) ; + if ( sLinkUrl == null ) + sLinkUrl = oLink.getAttribute('href',2) ; + + GetE('txtLnkUrl').value = sLinkUrl ; + GetE('cmbLnkTarget').value = oLink.target ; + } + + UpdatePreview() ; +} + +//#### The OK button was hit. +function Ok() +{ + if ( GetE('txtUrl').value.length == 0 ) + { + dialog.SetSelectedTab( 'Info' ) ; + GetE('txtUrl').focus() ; + + alert( FCKLang.DlgImgAlertUrl ) ; + + return false ; + } + + var bHasImage = ( oImage != null ) ; + + if ( bHasImage && bImageButton && oImage.tagName == 'IMG' ) + { + if ( confirm( 'Do you want to transform the selected image on a image button?' ) ) + oImage = null ; + } + else if ( bHasImage && !bImageButton && oImage.tagName == 'INPUT' ) + { + if ( confirm( 'Do you want to transform the selected image button on a simple image?' ) ) + oImage = null ; + } + + oEditor.FCKUndo.SaveUndoStep() ; + if ( !bHasImage ) + { + if ( bImageButton ) + { + oImage = FCK.EditorDocument.createElement( 'input' ) ; + oImage.type = 'image' ; + oImage = FCK.InsertElement( oImage ) ; + } + else + oImage = FCK.InsertElement( 'img' ) ; + } + + UpdateImage( oImage ) ; + + var sLnkUrl = GetE('txtLnkUrl').value.Trim() ; + + if ( sLnkUrl.length == 0 ) + { + if ( oLink ) + FCK.ExecuteNamedCommand( 'Unlink' ) ; + } + else + { + if ( oLink ) // Modifying an existent link. + oLink.href = sLnkUrl ; + else // Creating a new link. + { + if ( !bHasImage ) + oEditor.FCKSelection.SelectNode( oImage ) ; + + oLink = oEditor.FCK.CreateLink( sLnkUrl )[0] ; + + if ( !bHasImage ) + { + oEditor.FCKSelection.SelectNode( oLink ) ; + oEditor.FCKSelection.Collapse( false ) ; + } + } + + SetAttribute( oLink, '_fcksavedurl', sLnkUrl ) ; + SetAttribute( oLink, 'target', GetE('cmbLnkTarget').value ) ; + } + + return true ; +} + +function UpdateImage( e, skipId ) +{ + e.src = GetE('txtUrl').value ; + SetAttribute( e, "_fcksavedurl", GetE('txtUrl').value ) ; + SetAttribute( e, "alt" , GetE('txtAlt').value ) ; + SetAttribute( e, "width" , GetE('txtWidth').value ) ; + SetAttribute( e, "height", GetE('txtHeight').value ) ; + SetAttribute( e, "vspace", GetE('txtVSpace').value ) ; + SetAttribute( e, "hspace", GetE('txtHSpace').value ) ; + SetAttribute( e, "border", GetE('txtBorder').value ) ; + SetAttribute( e, "align" , GetE('cmbAlign').value ) ; + + // Advances Attributes + + if ( ! skipId ) + SetAttribute( e, 'id', GetE('txtAttId').value ) ; + + SetAttribute( e, 'dir' , GetE('cmbAttLangDir').value ) ; + SetAttribute( e, 'lang' , GetE('txtAttLangCode').value ) ; + SetAttribute( e, 'title' , GetE('txtAttTitle').value ) ; + SetAttribute( e, 'longDesc' , GetE('txtLongDesc').value ) ; + + if ( oEditor.FCKBrowserInfo.IsIE ) + { + e.className = GetE('txtAttClasses').value ; + e.style.cssText = GetE('txtAttStyle').value ; + } + else + { + SetAttribute( e, 'class' , GetE('txtAttClasses').value ) ; + SetAttribute( e, 'style', GetE('txtAttStyle').value ) ; + } +} + +var eImgPreview ; +var eImgPreviewLink ; + +function SetPreviewElements( imageElement, linkElement ) +{ + eImgPreview = imageElement ; + eImgPreviewLink = linkElement ; + + UpdatePreview() ; + UpdateOriginal() ; + + bPreviewInitialized = true ; +} + +function UpdatePreview() +{ + if ( !eImgPreview || !eImgPreviewLink ) + return ; + + if ( GetE('txtUrl').value.length == 0 ) + eImgPreviewLink.style.display = 'none' ; + else + { + UpdateImage( eImgPreview, true ) ; + + if ( GetE('txtLnkUrl').value.Trim().length > 0 ) + eImgPreviewLink.href = 'javascript:void(null);' ; + else + SetAttribute( eImgPreviewLink, 'href', '' ) ; + + eImgPreviewLink.style.display = '' ; + } +} + +var bLockRatio = true ; + +function SwitchLock( lockButton ) +{ + bLockRatio = !bLockRatio ; + lockButton.className = bLockRatio ? 'BtnLocked' : 'BtnUnlocked' ; + lockButton.title = bLockRatio ? 'Lock sizes' : 'Unlock sizes' ; + + if ( bLockRatio ) + { + if ( GetE('txtWidth').value.length > 0 ) + OnSizeChanged( 'Width', GetE('txtWidth').value ) ; + else + OnSizeChanged( 'Height', GetE('txtHeight').value ) ; + } +} + +// Fired when the width or height input texts change +function OnSizeChanged( dimension, value ) +{ + // Verifies if the aspect ration has to be maintained + if ( oImageOriginal && bLockRatio ) + { + var e = dimension == 'Width' ? GetE('txtHeight') : GetE('txtWidth') ; + + if ( value.length == 0 || isNaN( value ) ) + { + e.value = '' ; + return ; + } + + if ( dimension == 'Width' ) + value = value == 0 ? 0 : Math.round( oImageOriginal.height * ( value / oImageOriginal.width ) ) ; + else + value = value == 0 ? 0 : Math.round( oImageOriginal.width * ( value / oImageOriginal.height ) ) ; + + if ( !isNaN( value ) ) + e.value = value ; + } + + UpdatePreview() ; +} + +// Fired when the Reset Size button is clicked +function ResetSizes() +{ + if ( ! oImageOriginal ) return ; + if ( oEditor.FCKBrowserInfo.IsGecko && !oImageOriginal.complete ) + { + setTimeout( ResetSizes, 50 ) ; + return ; + } + + GetE('txtWidth').value = oImageOriginal.width ; + GetE('txtHeight').value = oImageOriginal.height ; + + UpdatePreview() ; +} + +function BrowseServer() +{ + OpenServerBrowser( + 'Image', + FCKConfig.ImageBrowserURL, + FCKConfig.ImageBrowserWindowWidth, + FCKConfig.ImageBrowserWindowHeight ) ; +} + +function LnkBrowseServer() +{ + OpenServerBrowser( + 'Link', + FCKConfig.LinkBrowserURL, + FCKConfig.LinkBrowserWindowWidth, + FCKConfig.LinkBrowserWindowHeight ) ; +} + +function OpenServerBrowser( type, url, width, height ) +{ + sActualBrowser = type ; + OpenFileBrowser( url, width, height ) ; +} + +var sActualBrowser ; + +function SetUrl( url, width, height, alt ) +{ + if ( sActualBrowser == 'Link' ) + { + GetE('txtLnkUrl').value = url ; + UpdatePreview() ; + } + else + { + GetE('txtUrl').value = url ; + GetE('txtWidth').value = width ? width : '' ; + GetE('txtHeight').value = height ? height : '' ; + + if ( alt ) + GetE('txtAlt').value = alt; + + UpdatePreview() ; + UpdateOriginal( true ) ; + } + + dialog.SetSelectedTab( 'Info' ) ; +} + +function OnUploadCompleted( errorNumber, fileUrl, fileName, customMsg ) +{ + // Remove animation + window.parent.Throbber.Hide() ; + GetE( 'divUpload' ).style.display = '' ; + + switch ( errorNumber ) + { + case 0 : // No errors + alert( 'Your file has been successfully uploaded' ) ; + break ; + case 1 : // Custom error + alert( customMsg ) ; + return ; + case 101 : // Custom warning + alert( customMsg ) ; + break ; + case 201 : + alert( 'A file with the same name is already available. The uploaded file has been renamed to "' + fileName + '"' ) ; + break ; + case 202 : + alert( 'Invalid file type' ) ; + return ; + case 203 : + alert( "Security error. You probably don't have enough permissions to upload. Please check your server." ) ; + return ; + case 500 : + alert( 'The connector is disabled' ) ; + break ; + default : + alert( 'Error on file upload. Error number: ' + errorNumber ) ; + return ; + } + + sActualBrowser = '' ; + SetUrl( fileUrl ) ; + GetE('frmUpload').reset() ; +} + +var oUploadAllowedExtRegex = new RegExp( FCKConfig.ImageUploadAllowedExtensions, 'i' ) ; +var oUploadDeniedExtRegex = new RegExp( FCKConfig.ImageUploadDeniedExtensions, 'i' ) ; + +function CheckUpload() +{ + var sFile = GetE('txtUploadFile').value ; + + if ( sFile.length == 0 ) + { + alert( 'Please select a file to upload' ) ; + return false ; + } + + if ( ( FCKConfig.ImageUploadAllowedExtensions.length > 0 && !oUploadAllowedExtRegex.test( sFile ) ) || + ( FCKConfig.ImageUploadDeniedExtensions.length > 0 && oUploadDeniedExtRegex.test( sFile ) ) ) + { + OnUploadCompleted( 202 ) ; + return false ; + } + + // Show animation + window.parent.Throbber.Show( 100 ) ; + GetE( 'divUpload' ).style.display = 'none' ; + + return true ; +} Property changes on: announcement/trunk/src/main/webapp/fckeditor/editor/dialog/fck_image/fck_image.js ___________________________________________________________________ Name: svn:eol-style + native Added: announcement/trunk/src/main/webapp/fckeditor/editor/dialog/fck_image/fck_image_preview.html =================================================================== --- announcement/trunk/src/main/webapp/fckeditor/editor/dialog/fck_image/fck_image_preview.html (rev 0) +++ announcement/trunk/src/main/webapp/fckeditor/editor/dialog/fck_image/fck_image_preview.html 2008-06-30 02:54:27 UTC (rev 1002) @@ -0,0 +1,72 @@ + + + + + + + + + + + +
        + + Lorem ipsum dolor sit amet, consectetuer adipiscing + elit. Maecenas feugiat consequat diam. Maecenas metus. Vivamus diam purus, cursus + a, commodo non, facilisis vitae, nulla. Aenean dictum lacinia tortor. Nunc iaculis, + nibh non iaculis aliquam, orci felis euismod neque, sed ornare massa mauris sed + velit. Nulla pretium mi et risus. Fusce mi pede, tempor id, cursus ac, ullamcorper + nec, enim. Sed tortor. Curabitur molestie. Duis velit augue, condimentum at, ultrices + a, luctus ut, orci. Donec pellentesque egestas eros. Integer cursus, augue in cursus + faucibus, eros pede bibendum sem, in tempus tellus justo quis ligula. Etiam eget + tortor. Vestibulum rutrum, est ut placerat elementum, lectus nisl aliquam velit, + tempor aliquam eros nunc nonummy metus. In eros metus, gravida a, gravida sed, lobortis + id, turpis. Ut ultrices, ipsum at venenatis fringilla, sem nulla lacinia tellus, + eget aliquet turpis mauris non enim. Nam turpis. Suspendisse lacinia. Curabitur + ac tortor ut ipsum egestas elementum. Nunc imperdiet gravida mauris. +
        + + Property changes on: announcement/trunk/src/main/webapp/fckeditor/editor/dialog/fck_image/fck_image_preview.html ___________________________________________________________________ Name: svn:eol-style + native Added: announcement/trunk/src/main/webapp/fckeditor/editor/dialog/fck_image.html =================================================================== --- announcement/trunk/src/main/webapp/fckeditor/editor/dialog/fck_image.html (rev 0) +++ announcement/trunk/src/main/webapp/fckeditor/editor/dialog/fck_image.html 2008-06-30 02:54:27 UTC (rev 1002) @@ -0,0 +1,258 @@ + + + + + Image Properties + + + + + + + +
        + + + + + + + + + + +
        + + + + + + + + +
        + URL +
        + +
        +
        + Short Description
        +
        +
        + + + + + + +
        +
        + + + + + + + + + + + +
        + Width  + +
        +
        +
        +
        +
        +
        + Height  +
        +
        + + + + + + + + + + + + + + + + + +
        + Border  +
        + HSpace  +
        + VSpace  +
        + Align  + +
        +
        +     + + + + + + + +
        + Preview
        + +
        +
        +
        +
        + + + + + Property changes on: announcement/trunk/src/main/webapp/fckeditor/editor/dialog/fck_image.html ___________________________________________________________________ Name: svn:eol-style + native Added: announcement/trunk/src/main/webapp/fckeditor/editor/dialog/fck_link/fck_link.js =================================================================== --- announcement/trunk/src/main/webapp/fckeditor/editor/dialog/fck_link/fck_link.js (rev 0) +++ announcement/trunk/src/main/webapp/fckeditor/editor/dialog/fck_link/fck_link.js 2008-06-30 02:54:27 UTC (rev 1002) @@ -0,0 +1,744 @@ +?/* + * FCKeditor - The text editor for Internet - http://www.fckeditor.net + * Copyright (C) 2003-2008 Frederico Caldeira Knabben + * + * == BEGIN LICENSE == + * + * Licensed under the terms of any of the following licenses at your + * choice: + * + * - GNU General Public License Version 2 or later (the "GPL") + * http://www.gnu.org/licenses/gpl.html + * + * - GNU Lesser General Public License Version 2.1 or later (the "LGPL") + * http://www.gnu.org/licenses/lgpl.html + * + * - Mozilla Public License Version 1.1 or later (the "MPL") + * http://www.mozilla.org/MPL/MPL-1.1.html + * + * == END LICENSE == + * + * Scripts related to the Link dialog window (see fck_link.html). + */ + +var dialog = window.parent ; +var oEditor = dialog.InnerDialogLoaded() ; + +var FCK = oEditor.FCK ; +var FCKLang = oEditor.FCKLang ; +var FCKConfig = oEditor.FCKConfig ; +var FCKRegexLib = oEditor.FCKRegexLib ; +var FCKTools = oEditor.FCKTools ; + +//#### Dialog Tabs + +// Set the dialog tabs. +dialog.AddTab( 'Info', FCKLang.DlgLnkInfoTab ) ; + +if ( !FCKConfig.LinkDlgHideTarget ) + dialog.AddTab( 'Target', FCKLang.DlgLnkTargetTab, true ) ; + +if ( FCKConfig.LinkUpload ) + dialog.AddTab( 'Upload', FCKLang.DlgLnkUpload, true ) ; + +if ( !FCKConfig.LinkDlgHideAdvanced ) + dialog.AddTab( 'Advanced', FCKLang.DlgAdvancedTag ) ; + +// Function called when a dialog tag is selected. +function OnDialogTabChange( tabCode ) +{ + ShowE('divInfo' , ( tabCode == 'Info' ) ) ; + ShowE('divTarget' , ( tabCode == 'Target' ) ) ; + ShowE('divUpload' , ( tabCode == 'Upload' ) ) ; + ShowE('divAttribs' , ( tabCode == 'Advanced' ) ) ; + + dialog.SetAutoSize( true ) ; +} + +//#### Regular Expressions library. +var oRegex = new Object() ; + +oRegex.UriProtocol = /^(((http|https|ftp|news):\/\/)|mailto:)/gi ; + +oRegex.UrlOnChangeProtocol = /^(http|https|ftp|news):\/\/(?=.)/gi ; + +oRegex.UrlOnChangeTestOther = /^((javascript:)|[#\/\.])/gi ; + +oRegex.ReserveTarget = /^_(blank|self|top|parent)$/i ; + +oRegex.PopupUri = /^javascript:void\(\s*window.open\(\s*'([^']+)'\s*,\s*(?:'([^']*)'|null)\s*,\s*'([^']*)'\s*\)\s*\)\s*$/ ; + +// Accessible popups +oRegex.OnClickPopup = /^\s*on[cC]lick="\s*window.open\(\s*this\.href\s*,\s*(?:'([^']*)'|null)\s*,\s*'([^']*)'\s*\)\s*;\s*return\s*false;*\s*"$/ ; + +oRegex.PopupFeatures = /(?:^|,)([^=]+)=(\d+|yes|no)/gi ; + +//#### Parser Functions + +var oParser = new Object() ; + +oParser.ParseEMailUrl = function( emailUrl ) +{ + // Initializes the EMailInfo object. + var oEMailInfo = new Object() ; + oEMailInfo.Address = '' ; + oEMailInfo.Subject = '' ; + oEMailInfo.Body = '' ; + + var oParts = emailUrl.match( /^([^\?]+)\??(.+)?/ ) ; + if ( oParts ) + { + // Set the e-mail address. + oEMailInfo.Address = oParts[1] ; + + // Look for the optional e-mail parameters. + if ( oParts[2] ) + { + var oMatch = oParts[2].match( /(^|&)subject=([^&]+)/i ) ; + if ( oMatch ) oEMailInfo.Subject = decodeURIComponent( oMatch[2] ) ; + + oMatch = oParts[2].match( /(^|&)body=([^&]+)/i ) ; + if ( oMatch ) oEMailInfo.Body = decodeURIComponent( oMatch[2] ) ; + } + } + + return oEMailInfo ; +} + +oParser.CreateEMailUri = function( address, subject, body ) +{ + var sBaseUri = 'mailto:' + address ; + + var sParams = '' ; + + if ( subject.length > 0 ) + sParams = '?subject=' + encodeURIComponent( subject ) ; + + if ( body.length > 0 ) + { + sParams += ( sParams.length == 0 ? '?' : '&' ) ; + sParams += 'body=' + encodeURIComponent( body ) ; + } + + return sBaseUri + sParams ; +} + +//#### Initialization Code + +// oLink: The actual selected link in the editor. +var oLink = dialog.Selection.GetSelection().MoveToAncestorNode( 'A' ) ; +if ( oLink ) + FCK.Selection.SelectNode( oLink ) ; + +window.onload = function() +{ + // Translate the dialog box texts. + oEditor.FCKLanguageManager.TranslatePage(document) ; + + // Fill the Anchor Names and Ids combos. + LoadAnchorNamesAndIds() ; + + // Load the selected link information (if any). + LoadSelection() ; + + // Update the dialog box. + SetLinkType( GetE('cmbLinkType').value ) ; + + // Show/Hide the "Browse Server" button. + GetE('divBrowseServer').style.display = FCKConfig.LinkBrowser ? '' : 'none' ; + + // Show the initial dialog content. + GetE('divInfo').style.display = '' ; + + // Set the actual uploader URL. + if ( FCKConfig.LinkUpload ) + GetE('frmUpload').action = FCKConfig.LinkUploadURL ; + + // Set the default target (from configuration). + SetDefaultTarget() ; + + // Activate the "OK" button. + dialog.SetOkButton( true ) ; + + // Select the first field. + switch( GetE('cmbLinkType').value ) + { + case 'url' : + SelectField( 'txtUrl' ) ; + break ; + case 'email' : + SelectField( 'txtEMailAddress' ) ; + break ; + case 'anchor' : + if ( GetE('divSelAnchor').style.display != 'none' ) + SelectField( 'cmbAnchorName' ) ; + else + SelectField( 'cmbLinkType' ) ; + } +} + +var bHasAnchors ; + +function LoadAnchorNamesAndIds() +{ + // Since version 2.0, the anchors are replaced in the DOM by IMGs so the user see the icon + // to edit them. So, we must look for that images now. + var aAnchors = new Array() ; + var i ; + var oImages = oEditor.FCK.EditorDocument.getElementsByTagName( 'IMG' ) ; + for( i = 0 ; i < oImages.length ; i++ ) + { + if ( oImages[i].getAttribute('_fckanchor') ) + aAnchors[ aAnchors.length ] = oEditor.FCK.GetRealElement( oImages[i] ) ; + } + + // Add also real anchors + var oLinks = oEditor.FCK.EditorDocument.getElementsByTagName( 'A' ) ; + for( i = 0 ; i < oLinks.length ; i++ ) + { + if ( oLinks[i].name && ( oLinks[i].name.length > 0 ) ) + aAnchors[ aAnchors.length ] = oLinks[i] ; + } + + var aIds = FCKTools.GetAllChildrenIds( oEditor.FCK.EditorDocument.body ) ; + + bHasAnchors = ( aAnchors.length > 0 || aIds.length > 0 ) ; + + for ( i = 0 ; i < aAnchors.length ; i++ ) + { + var sName = aAnchors[i].name ; + if ( sName && sName.length > 0 ) + FCKTools.AddSelectOption( GetE('cmbAnchorName'), sName, sName ) ; + } + + for ( i = 0 ; i < aIds.length ; i++ ) + { + FCKTools.AddSelectOption( GetE('cmbAnchorId'), aIds[i], aIds[i] ) ; + } + + ShowE( 'divSelAnchor' , bHasAnchors ) ; + ShowE( 'divNoAnchor' , !bHasAnchors ) ; +} + +function LoadSelection() +{ + if ( !oLink ) return ; + + var sType = 'url' ; + + // Get the actual Link href. + var sHRef = oLink.getAttribute( '_fcksavedurl' ) ; + if ( sHRef == null ) + sHRef = oLink.getAttribute( 'href' , 2 ) || '' ; + + // Look for a popup javascript link. + var oPopupMatch = oRegex.PopupUri.exec( sHRef ) ; + if( oPopupMatch ) + { + GetE('cmbTarget').value = 'popup' ; + sHRef = oPopupMatch[1] ; + FillPopupFields( oPopupMatch[2], oPopupMatch[3] ) ; + SetTarget( 'popup' ) ; + } + + // Accessible popups, the popup data is in the onclick attribute + if ( !oPopupMatch ) + { + var onclick = oLink.getAttribute( 'onclick_fckprotectedatt' ) ; + if ( onclick ) + { + // Decode the protected string + onclick = decodeURIComponent( onclick ) ; + + oPopupMatch = oRegex.OnClickPopup.exec( onclick ) ; + if( oPopupMatch ) + { + GetE( 'cmbTarget' ).value = 'popup' ; + FillPopupFields( oPopupMatch[1], oPopupMatch[2] ) ; + SetTarget( 'popup' ) ; + } + } + } + + // Search for the protocol. + var sProtocol = oRegex.UriProtocol.exec( sHRef ) ; + + if ( sProtocol ) + { + sProtocol = sProtocol[0].toLowerCase() ; + GetE('cmbLinkProtocol').value = sProtocol ; + + // Remove the protocol and get the remaining URL. + var sUrl = sHRef.replace( oRegex.UriProtocol, '' ) ; + + if ( sProtocol == 'mailto:' ) // It is an e-mail link. + { + sType = 'email' ; + + var oEMailInfo = oParser.ParseEMailUrl( sUrl ) ; + GetE('txtEMailAddress').value = oEMailInfo.Address ; + GetE('txtEMailSubject').value = oEMailInfo.Subject ; + GetE('txtEMailBody').value = oEMailInfo.Body ; + } + else // It is a normal link. + { + sType = 'url' ; + GetE('txtUrl').value = sUrl ; + } + } + else if ( sHRef.substr(0,1) == '#' && sHRef.length > 1 ) // It is an anchor link. + { + sType = 'anchor' ; + GetE('cmbAnchorName').value = GetE('cmbAnchorId').value = sHRef.substr(1) ; + } + else // It is another type of link. + { + sType = 'url' ; + + GetE('cmbLinkProtocol').value = '' ; + GetE('txtUrl').value = sHRef ; + } + + if ( !oPopupMatch ) + { + // Get the target. + var sTarget = oLink.target ; + + if ( sTarget && sTarget.length > 0 ) + { + if ( oRegex.ReserveTarget.test( sTarget ) ) + { + sTarget = sTarget.toLowerCase() ; + GetE('cmbTarget').value = sTarget ; + } + else + GetE('cmbTarget').value = 'frame' ; + GetE('txtTargetFrame').value = sTarget ; + } + } + + // Get Advances Attributes + GetE('txtAttId').value = oLink.id ; + GetE('txtAttName').value = oLink.name ; + GetE('cmbAttLangDir').value = oLink.dir ; + GetE('txtAttLangCode').value = oLink.lang ; + GetE('txtAttAccessKey').value = oLink.accessKey ; + GetE('txtAttTabIndex').value = oLink.tabIndex <= 0 ? '' : oLink.tabIndex ; + GetE('txtAttTitle').value = oLink.title ; + GetE('txtAttContentType').value = oLink.type ; + GetE('txtAttCharSet').value = oLink.charset ; + + var sClass ; + if ( oEditor.FCKBrowserInfo.IsIE ) + { + sClass = oLink.getAttribute('className',2) || '' ; + // Clean up temporary classes for internal use: + sClass = sClass.replace( FCKRegexLib.FCK_Class, '' ) ; + + GetE('txtAttStyle').value = oLink.style.cssText ; + } + else + { + sClass = oLink.getAttribute('class',2) || '' ; + GetE('txtAttStyle').value = oLink.getAttribute('style',2) || '' ; + } + GetE('txtAttClasses').value = sClass ; + + // Update the Link type combo. + GetE('cmbLinkType').value = sType ; +} + +//#### Link type selection. +function SetLinkType( linkType ) +{ + ShowE('divLinkTypeUrl' , (linkType == 'url') ) ; + ShowE('divLinkTypeAnchor' , (linkType == 'anchor') ) ; + ShowE('divLinkTypeEMail' , (linkType == 'email') ) ; + + if ( !FCKConfig.LinkDlgHideTarget ) + dialog.SetTabVisibility( 'Target' , (linkType == 'url') ) ; + + if ( FCKConfig.LinkUpload ) + dialog.SetTabVisibility( 'Upload' , (linkType == 'url') ) ; + + if ( !FCKConfig.LinkDlgHideAdvanced ) + dialog.SetTabVisibility( 'Advanced' , (linkType != 'anchor' || bHasAnchors) ) ; + + if ( linkType == 'email' ) + dialog.SetAutoSize( true ) ; +} + +//#### Target type selection. +function SetTarget( targetType ) +{ + GetE('tdTargetFrame').style.display = ( targetType == 'popup' ? 'none' : '' ) ; + GetE('tdPopupName').style.display = + GetE('tablePopupFeatures').style.display = ( targetType == 'popup' ? '' : 'none' ) ; + + switch ( targetType ) + { + case "_blank" : + case "_self" : + case "_parent" : + case "_top" : + GetE('txtTargetFrame').value = targetType ; + break ; + case "" : + GetE('txtTargetFrame').value = '' ; + break ; + } + + if ( targetType == 'popup' ) + dialog.SetAutoSize( true ) ; +} + +//#### Called while the user types the URL. +function OnUrlChange() +{ + var sUrl = GetE('txtUrl').value ; + var sProtocol = oRegex.UrlOnChangeProtocol.exec( sUrl ) ; + + if ( sProtocol ) + { + sUrl = sUrl.substr( sProtocol[0].length ) ; + GetE('txtUrl').value = sUrl ; + GetE('cmbLinkProtocol').value = sProtocol[0].toLowerCase() ; + } + else if ( oRegex.UrlOnChangeTestOther.test( sUrl ) ) + { + GetE('cmbLinkProtocol').value = '' ; + } +} + +//#### Called while the user types the target name. +function OnTargetNameChange() +{ + var sFrame = GetE('txtTargetFrame').value ; + + if ( sFrame.length == 0 ) + GetE('cmbTarget').value = '' ; + else if ( oRegex.ReserveTarget.test( sFrame ) ) + GetE('cmbTarget').value = sFrame.toLowerCase() ; + else + GetE('cmbTarget').value = 'frame' ; +} + +// Accessible popups +function BuildOnClickPopup() +{ + var sWindowName = "'" + GetE('txtPopupName').value.replace(/\W/gi, "") + "'" ; + + var sFeatures = '' ; + var aChkFeatures = document.getElementsByName( 'chkFeature' ) ; + for ( var i = 0 ; i < aChkFeatures.length ; i++ ) + { + if ( i > 0 ) sFeatures += ',' ; + sFeatures += aChkFeatures[i].value + '=' + ( aChkFeatures[i].checked ? 'yes' : 'no' ) ; + } + + if ( GetE('txtPopupWidth').value.length > 0 ) sFeatures += ',width=' + GetE('txtPopupWidth').value ; + if ( GetE('txtPopupHeight').value.length > 0 ) sFeatures += ',height=' + GetE('txtPopupHeight').value ; + if ( GetE('txtPopupLeft').value.length > 0 ) sFeatures += ',left=' + GetE('txtPopupLeft').value ; + if ( GetE('txtPopupTop').value.length > 0 ) sFeatures += ',top=' + GetE('txtPopupTop').value ; + + if ( sFeatures != '' ) + sFeatures = sFeatures + ",status" ; + + return ( "window.open(this.href," + sWindowName + ",'" + sFeatures + "'); return false" ) ; +} + +//#### Fills all Popup related fields. +function FillPopupFields( windowName, features ) +{ + if ( windowName ) + GetE('txtPopupName').value = windowName ; + + var oFeatures = new Object() ; + var oFeaturesMatch ; + while( ( oFeaturesMatch = oRegex.PopupFeatures.exec( features ) ) != null ) + { + var sValue = oFeaturesMatch[2] ; + if ( sValue == ( 'yes' || '1' ) ) + oFeatures[ oFeaturesMatch[1] ] = true ; + else if ( ! isNaN( sValue ) && sValue != 0 ) + oFeatures[ oFeaturesMatch[1] ] = sValue ; + } + + // Update all features check boxes. + var aChkFeatures = document.getElementsByName('chkFeature') ; + for ( var i = 0 ; i < aChkFeatures.length ; i++ ) + { + if ( oFeatures[ aChkFeatures[i].value ] ) + aChkFeatures[i].checked = true ; + } + + // Update position and size text boxes. + if ( oFeatures['width'] ) GetE('txtPopupWidth').value = oFeatures['width'] ; + if ( oFeatures['height'] ) GetE('txtPopupHeight').value = oFeatures['height'] ; + if ( oFeatures['left'] ) GetE('txtPopupLeft').value = oFeatures['left'] ; + if ( oFeatures['top'] ) GetE('txtPopupTop').value = oFeatures['top'] ; +} + +//#### The OK button was hit. +function Ok() +{ + var sUri, sInnerHtml ; + oEditor.FCKUndo.SaveUndoStep() ; + + switch ( GetE('cmbLinkType').value ) + { + case 'url' : + sUri = GetE('txtUrl').value ; + + if ( sUri.length == 0 ) + { + alert( FCKLang.DlnLnkMsgNoUrl ) ; + return false ; + } + + sUri = GetE('cmbLinkProtocol').value + sUri ; + + break ; + + case 'email' : + sUri = GetE('txtEMailAddress').value ; + + if ( sUri.length == 0 ) + { + alert( FCKLang.DlnLnkMsgNoEMail ) ; + return false ; + } + + sUri = oParser.CreateEMailUri( + sUri, + GetE('txtEMailSubject').value, + GetE('txtEMailBody').value ) ; + break ; + + case 'anchor' : + var sAnchor = GetE('cmbAnchorName').value ; + if ( sAnchor.length == 0 ) sAnchor = GetE('cmbAnchorId').value ; + + if ( sAnchor.length == 0 ) + { + alert( FCKLang.DlnLnkMsgNoAnchor ) ; + return false ; + } + + sUri = '#' + sAnchor ; + break ; + } + + // If no link is selected, create a new one (it may result in more than one link creation - #220). + var aLinks = oLink ? [ oLink ] : oEditor.FCK.CreateLink( sUri, true ) ; + + // If no selection, no links are created, so use the uri as the link text (by dom, 2006-05-26) + var aHasSelection = ( aLinks.length > 0 ) ; + if ( !aHasSelection ) + { + sInnerHtml = sUri; + + // Built a better text for empty links. + switch ( GetE('cmbLinkType').value ) + { + // anchor: use old behavior --> return true + case 'anchor': + sInnerHtml = sInnerHtml.replace( /^#/, '' ) ; + break ; + + // url: try to get path + case 'url': + var oLinkPathRegEx = new RegExp("//?([^?\"']+)([?].*)?$") ; + var asLinkPath = oLinkPathRegEx.exec( sUri ) ; + if (asLinkPath != null) + sInnerHtml = asLinkPath[1]; // use matched path + break ; + + // mailto: try to get email address + case 'email': + sInnerHtml = GetE('txtEMailAddress').value ; + break ; + } + + // Create a new (empty) anchor. + aLinks = [ oEditor.FCK.InsertElement( 'a' ) ] ; + } + + for ( var i = 0 ; i < aLinks.length ; i++ ) + { + oLink = aLinks[i] ; + + if ( aHasSelection ) + sInnerHtml = oLink.innerHTML ; // Save the innerHTML (IE changes it if it is like an URL). + + oLink.href = sUri ; + SetAttribute( oLink, '_fcksavedurl', sUri ) ; + + var onclick; + // Accessible popups + if( GetE('cmbTarget').value == 'popup' ) + { + onclick = BuildOnClickPopup() ; + // Encode the attribute + onclick = encodeURIComponent( " onclick=\"" + onclick + "\"" ) ; + SetAttribute( oLink, 'onclick_fckprotectedatt', onclick ) ; + } + else + { + // Check if the previous onclick was for a popup: + // In that case remove the onclick handler. + onclick = oLink.getAttribute( 'onclick_fckprotectedatt' ) ; + if ( onclick ) + { + // Decode the protected string + onclick = decodeURIComponent( onclick ) ; + + if( oRegex.OnClickPopup.test( onclick ) ) + SetAttribute( oLink, 'onclick_fckprotectedatt', '' ) ; + } + } + + oLink.innerHTML = sInnerHtml ; // Set (or restore) the innerHTML + + // Target + if( GetE('cmbTarget').value != 'popup' ) + SetAttribute( oLink, 'target', GetE('txtTargetFrame').value ) ; + else + SetAttribute( oLink, 'target', null ) ; + + // Let's set the "id" only for the first link to avoid duplication. + if ( i == 0 ) + SetAttribute( oLink, 'id', GetE('txtAttId').value ) ; + + // Advances Attributes + SetAttribute( oLink, 'name' , GetE('txtAttName').value ) ; + SetAttribute( oLink, 'dir' , GetE('cmbAttLangDir').value ) ; + SetAttribute( oLink, 'lang' , GetE('txtAttLangCode').value ) ; + SetAttribute( oLink, 'accesskey', GetE('txtAttAccessKey').value ) ; + SetAttribute( oLink, 'tabindex' , ( GetE('txtAttTabIndex').value > 0 ? GetE('txtAttTabIndex').value : null ) ) ; + SetAttribute( oLink, 'title' , GetE('txtAttTitle').value ) ; + SetAttribute( oLink, 'type' , GetE('txtAttContentType').value ) ; + SetAttribute( oLink, 'charset' , GetE('txtAttCharSet').value ) ; + + if ( oEditor.FCKBrowserInfo.IsIE ) + { + var sClass = GetE('txtAttClasses').value ; + // If it's also an anchor add an internal class + if ( GetE('txtAttName').value.length != 0 ) + sClass += ' FCK__AnchorC' ; + SetAttribute( oLink, 'className', sClass ) ; + + oLink.style.cssText = GetE('txtAttStyle').value ; + } + else + { + SetAttribute( oLink, 'class', GetE('txtAttClasses').value ) ; + SetAttribute( oLink, 'style', GetE('txtAttStyle').value ) ; + } + } + + // Select the (first) link. + oEditor.FCKSelection.SelectNode( aLinks[0] ); + + return true ; +} + +function BrowseServer() +{ + OpenFileBrowser( FCKConfig.LinkBrowserURL, FCKConfig.LinkBrowserWindowWidth, FCKConfig.LinkBrowserWindowHeight ) ; +} + +function SetUrl( url ) +{ + GetE('txtUrl').value = url ; + OnUrlChange() ; + dialog.SetSelectedTab( 'Info' ) ; +} + +function OnUploadCompleted( errorNumber, fileUrl, fileName, customMsg ) +{ + // Remove animation + window.parent.Throbber.Hide() ; + GetE( 'divUpload' ).style.display = '' ; + + switch ( errorNumber ) + { + case 0 : // No errors + alert( 'Your file has been successfully uploaded' ) ; + break ; + case 1 : // Custom error + alert( customMsg ) ; + return ; + case 101 : // Custom warning + alert( customMsg ) ; + break ; + case 201 : + alert( 'A file with the same name is already available. The uploaded file has been renamed to "' + fileName + '"' ) ; + break ; + case 202 : + alert( 'Invalid file type' ) ; + return ; + case 203 : + alert( "Security error. You probably don't have enough permissions to upload. Please check your server." ) ; + return ; + case 500 : + alert( 'The connector is disabled' ) ; + break ; + default : + alert( 'Error on file upload. Error number: ' + errorNumber ) ; + return ; + } + + SetUrl( fileUrl ) ; + GetE('frmUpload').reset() ; +} + +var oUploadAllowedExtRegex = new RegExp( FCKConfig.LinkUploadAllowedExtensions, 'i' ) ; +var oUploadDeniedExtRegex = new RegExp( FCKConfig.LinkUploadDeniedExtensions, 'i' ) ; + +function CheckUpload() +{ + var sFile = GetE('txtUploadFile').value ; + + if ( sFile.length == 0 ) + { + alert( 'Please select a file to upload' ) ; + return false ; + } + + if ( ( FCKConfig.LinkUploadAllowedExtensions.length > 0 && !oUploadAllowedExtRegex.test( sFile ) ) || + ( FCKConfig.LinkUploadDeniedExtensions.length > 0 && oUploadDeniedExtRegex.test( sFile ) ) ) + { + OnUploadCompleted( 202 ) ; + return false ; + } + + // Show animation + window.parent.Throbber.Show( 100 ) ; + GetE( 'divUpload' ).style.display = 'none' ; + + return true ; +} + +function SetDefaultTarget() +{ + var target = FCKConfig.DefaultLinkTarget || '' ; + + if ( oLink || target.length == 0 ) + return ; + + switch ( target ) + { + case '_blank' : + case '_self' : + case '_parent' : + case '_top' : + GetE('cmbTarget').value = target ; + break ; + default : + GetE('cmbTarget').value = 'frame' ; + break ; + } + + GetE('txtTargetFrame').value = target ; +} Property changes on: announcement/trunk/src/main/webapp/fckeditor/editor/dialog/fck_link/fck_link.js ___________________________________________________________________ Name: svn:eol-style + native Added: announcement/trunk/src/main/webapp/fckeditor/editor/dialog/fck_link.html =================================================================== --- announcement/trunk/src/main/webapp/fckeditor/editor/dialog/fck_link.html (rev 0) +++ announcement/trunk/src/main/webapp/fckeditor/editor/dialog/fck_link.html 2008-06-30 02:54:27 UTC (rev 1002) @@ -0,0 +1,295 @@ + + + + + Link Properties + + + + + + + + + + + + Property changes on: announcement/trunk/src/main/webapp/fckeditor/editor/dialog/fck_link.html ___________________________________________________________________ Name: svn:eol-style + native Added: announcement/trunk/src/main/webapp/fckeditor/editor/dialog/fck_listprop.html =================================================================== --- announcement/trunk/src/main/webapp/fckeditor/editor/dialog/fck_listprop.html (rev 0) +++ announcement/trunk/src/main/webapp/fckeditor/editor/dialog/fck_listprop.html 2008-06-30 02:54:27 UTC (rev 1002) @@ -0,0 +1,120 @@ + + + + + + + + + + + + + + + +
        + + + + + +
        + List Type
        + + +   +
        +
        + + Property changes on: announcement/trunk/src/main/webapp/fckeditor/editor/dialog/fck_listprop.html ___________________________________________________________________ Name: svn:eol-style + native Added: announcement/trunk/src/main/webapp/fckeditor/editor/dialog/fck_paste.html =================================================================== --- announcement/trunk/src/main/webapp/fckeditor/editor/dialog/fck_paste.html (rev 0) +++ announcement/trunk/src/main/webapp/fckeditor/editor/dialog/fck_paste.html 2008-06-30 02:54:27 UTC (rev 1002) @@ -0,0 +1,339 @@ + + + + + + + + + + + + + + + + + + + + + + +
        + +
        + Please paste inside the following box using the keyboard + (Ctrl+V) and hit OK.
        +   +
        +
        + +
        + + + +
        + + + +
        + + Property changes on: announcement/trunk/src/main/webapp/fckeditor/editor/dialog/fck_paste.html ___________________________________________________________________ Name: svn:eol-style + native Added: announcement/trunk/src/main/webapp/fckeditor/editor/dialog/fck_radiobutton.html =================================================================== --- announcement/trunk/src/main/webapp/fckeditor/editor/dialog/fck_radiobutton.html (rev 0) +++ announcement/trunk/src/main/webapp/fckeditor/editor/dialog/fck_radiobutton.html 2008-06-30 02:54:27 UTC (rev 1002) @@ -0,0 +1,104 @@ + + + + + Radio Button Properties + + + + + + + + + + +
        + + + + + + + + + + +
        + Name
        + +
        + Value
        + +
        +
        + + Property changes on: announcement/trunk/src/main/webapp/fckeditor/editor/dialog/fck_radiobutton.html ___________________________________________________________________ Name: svn:eol-style + native Added: announcement/trunk/src/main/webapp/fckeditor/editor/dialog/fck_replace.html =================================================================== --- announcement/trunk/src/main/webapp/fckeditor/editor/dialog/fck_replace.html (rev 0) +++ announcement/trunk/src/main/webapp/fckeditor/editor/dialog/fck_replace.html 2008-06-30 02:54:27 UTC (rev 1002) @@ -0,0 +1,648 @@ + + + + + + + + + + + + + + + Property changes on: announcement/trunk/src/main/webapp/fckeditor/editor/dialog/fck_replace.html ___________________________________________________________________ Name: svn:eol-style + native Added: announcement/trunk/src/main/webapp/fckeditor/editor/dialog/fck_select/fck_select.js =================================================================== --- announcement/trunk/src/main/webapp/fckeditor/editor/dialog/fck_select/fck_select.js (rev 0) +++ announcement/trunk/src/main/webapp/fckeditor/editor/dialog/fck_select/fck_select.js 2008-06-30 02:54:27 UTC (rev 1002) @@ -0,0 +1,194 @@ +?/* + * FCKeditor - The text editor for Internet - http://www.fckeditor.net + * Copyright (C) 2003-2008 Frederico Caldeira Knabben + * + * == BEGIN LICENSE == + * + * Licensed under the terms of any of the following licenses at your + * choice: + * + * - GNU General Public License Version 2 or later (the "GPL") + * http://www.gnu.org/licenses/gpl.html + * + * - GNU Lesser General Public License Version 2.1 or later (the "LGPL") + * http://www.gnu.org/licenses/lgpl.html + * + * - Mozilla Public License Version 1.1 or later (the "MPL") + * http://www.mozilla.org/MPL/MPL-1.1.html + * + * == END LICENSE == + * + * Scripts for the fck_select.html page. + */ + +function Select( combo ) +{ + var iIndex = combo.selectedIndex ; + + oListText.selectedIndex = iIndex ; + oListValue.selectedIndex = iIndex ; + + var oTxtText = document.getElementById( "txtText" ) ; + var oTxtValue = document.getElementById( "txtValue" ) ; + + oTxtText.value = oListText.value ; + oTxtValue.value = oListValue.value ; +} + +function Add() +{ + var oTxtText = document.getElementById( "txtText" ) ; + var oTxtValue = document.getElementById( "txtValue" ) ; + + AddComboOption( oListText, oTxtText.value, oTxtText.value ) ; + AddComboOption( oListValue, oTxtValue.value, oTxtValue.value ) ; + + oListText.selectedIndex = oListText.options.length - 1 ; + oListValue.selectedIndex = oListValue.options.length - 1 ; + + oTxtText.value = '' ; + oTxtValue.value = '' ; + + oTxtText.focus() ; +} + +function Modify() +{ + var iIndex = oListText.selectedIndex ; + + if ( iIndex < 0 ) return ; + + var oTxtText = document.getElementById( "txtText" ) ; + var oTxtValue = document.getElementById( "txtValue" ) ; + + oListText.options[ iIndex ].innerHTML = HTMLEncode( oTxtText.value ) ; + oListText.options[ iIndex ].value = oTxtText.value ; + + oListValue.options[ iIndex ].innerHTML = HTMLEncode( oTxtValue.value ) ; + oListValue.options[ iIndex ].value = oTxtValue.value ; + + oTxtText.value = '' ; + oTxtValue.value = '' ; + + oTxtText.focus() ; +} + +function Move( steps ) +{ + ChangeOptionPosition( oListText, steps ) ; + ChangeOptionPosition( oListValue, steps ) ; +} + +function Delete() +{ + RemoveSelectedOptions( oListText ) ; + RemoveSelectedOptions( oListValue ) ; +} + +function SetSelectedValue() +{ + var iIndex = oListValue.selectedIndex ; + if ( iIndex < 0 ) return ; + + var oTxtValue = document.getElementById( "txtSelValue" ) ; + + oTxtValue.value = oListValue.options[ iIndex ].value ; +} + +// Moves the selected option by a number of steps (also negative) +function ChangeOptionPosition( combo, steps ) +{ + var iActualIndex = combo.selectedIndex ; + + if ( iActualIndex < 0 ) + return ; + + var iFinalIndex = iActualIndex + steps ; + + if ( iFinalIndex < 0 ) + iFinalIndex = 0 ; + + if ( iFinalIndex > ( combo.options.length - 1 ) ) + iFinalIndex = combo.options.length - 1 ; + + if ( iActualIndex == iFinalIndex ) + return ; + + var oOption = combo.options[ iActualIndex ] ; + var sText = HTMLDecode( oOption.innerHTML ) ; + var sValue = oOption.value ; + + combo.remove( iActualIndex ) ; + + oOption = AddComboOption( combo, sText, sValue, null, iFinalIndex ) ; + + oOption.selected = true ; +} + +// Remove all selected options from a SELECT object +function RemoveSelectedOptions(combo) +{ + // Save the selected index + var iSelectedIndex = combo.selectedIndex ; + + var oOptions = combo.options ; + + // Remove all selected options + for ( var i = oOptions.length - 1 ; i >= 0 ; i-- ) + { + if (oOptions[i].selected) combo.remove(i) ; + } + + // Reset the selection based on the original selected index + if ( combo.options.length > 0 ) + { + if ( iSelectedIndex >= combo.options.length ) iSelectedIndex = combo.options.length - 1 ; + combo.selectedIndex = iSelectedIndex ; + } +} + +// Add a new option to a SELECT object (combo or list) +function AddComboOption( combo, optionText, optionValue, documentObject, index ) +{ + var oOption ; + + if ( documentObject ) + oOption = documentObject.createElement("OPTION") ; + else + oOption = document.createElement("OPTION") ; + + if ( index != null ) + combo.options.add( oOption, index ) ; + else + combo.options.add( oOption ) ; + + oOption.innerHTML = optionText.length > 0 ? HTMLEncode( optionText ) : ' ' ; + oOption.value = optionValue ; + + return oOption ; +} + +function HTMLEncode( text ) +{ + if ( !text ) + return '' ; + + text = text.replace( /&/g, '&' ) ; + text = text.replace( //g, '>' ) ; + + return text ; +} + + +function HTMLDecode( text ) +{ + if ( !text ) + return '' ; + + text = text.replace( />/g, '>' ) ; + text = text.replace( /</g, '<' ) ; + text = text.replace( /&/g, '&' ) ; + + return text ; +} Property changes on: announcement/trunk/src/main/webapp/fckeditor/editor/dialog/fck_select/fck_select.js ___________________________________________________________________ Name: svn:eol-style + native Added: announcement/trunk/src/main/webapp/fckeditor/editor/dialog/fck_select.html =================================================================== --- announcement/trunk/src/main/webapp/fckeditor/editor/dialog/fck_select.html (rev 0) +++ announcement/trunk/src/main/webapp/fckeditor/editor/dialog/fck_select.html 2008-06-30 02:54:27 UTC (rev 1002) @@ -0,0 +1,180 @@ + + + + + Select Properties + + + + + + + + + + + +
        + + + + + + + + + + + + + + +
        Name 
        Value 
        Size  lines
        +
        +
        +  Available + Options  + + + + + + + + + + + + + + + + + + +
        Text
        + +
        Value
        + +
        + + +
        +
        + +
           +
        +
        + + Property changes on: announcement/trunk/src/main/webapp/fckeditor/editor/dialog/fck_select.html ___________________________________________________________________ Name: svn:eol-style + native Added: announcement/trunk/src/main/webapp/fckeditor/editor/dialog/fck_smiley.html =================================================================== --- announcement/trunk/src/main/webapp/fckeditor/editor/dialog/fck_smiley.html (rev 0) +++ announcement/trunk/src/main/webapp/fckeditor/editor/dialog/fck_smiley.html 2008-06-30 02:54:27 UTC (rev 1002) @@ -0,0 +1,111 @@ + + + + + + + + + + + + + + +
        + + Property changes on: announcement/trunk/src/main/webapp/fckeditor/editor/dialog/fck_smiley.html ___________________________________________________________________ Name: svn:eol-style + native Added: announcement/trunk/src/main/webapp/fckeditor/editor/dialog/fck_source.html =================================================================== --- announcement/trunk/src/main/webapp/fckeditor/editor/dialog/fck_source.html (rev 0) +++ announcement/trunk/src/main/webapp/fckeditor/editor/dialog/fck_source.html 2008-06-30 02:54:27 UTC (rev 1002) @@ -0,0 +1,68 @@ + + + + + Source + + + + + + + + + + +
        + + Property changes on: announcement/trunk/src/main/webapp/fckeditor/editor/dialog/fck_source.html ___________________________________________________________________ Name: svn:eol-style + native Added: announcement/trunk/src/main/webapp/fckeditor/editor/dialog/fck_specialchar.html =================================================================== --- announcement/trunk/src/main/webapp/fckeditor/editor/dialog/fck_specialchar.html (rev 0) +++ announcement/trunk/src/main/webapp/fckeditor/editor/dialog/fck_specialchar.html 2008-06-30 02:54:27 UTC (rev 1002) @@ -0,0 +1,121 @@ + + + + + + + + + + + + + + + + + +
        + + +
        +
             + + + + +
         
        +
        + + Property changes on: announcement/trunk/src/main/webapp/fckeditor/editor/dialog/fck_specialchar.html ___________________________________________________________________ Name: svn:eol-style + native Added: announcement/trunk/src/main/webapp/fckeditor/editor/dialog/fck_spellerpages/spellerpages/blank.html =================================================================== Property changes on: announcement/trunk/src/main/webapp/fckeditor/editor/dialog/fck_spellerpages/spellerpages/blank.html ___________________________________________________________________ Name: svn:eol-style + native Added: announcement/trunk/src/main/webapp/fckeditor/editor/dialog/fck_spellerpages/spellerpages/controlWindow.js =================================================================== --- announcement/trunk/src/main/webapp/fckeditor/editor/dialog/fck_spellerpages/spellerpages/controlWindow.js (rev 0) +++ announcement/trunk/src/main/webapp/fckeditor/editor/dialog/fck_spellerpages/spellerpages/controlWindow.js 2008-06-30 02:54:27 UTC (rev 1002) @@ -0,0 +1,87 @@ +?//////////////////////////////////////////////////// +// controlWindow object +//////////////////////////////////////////////////// +function controlWindow( controlForm ) { + // private properties + this._form = controlForm; + + // public properties + this.windowType = "controlWindow"; +// this.noSuggestionSelection = "- No suggestions -"; // by FredCK + this.noSuggestionSelection = FCKLang.DlgSpellNoSuggestions ; + // set up the properties for elements of the given control form + this.suggestionList = this._form.sugg; + this.evaluatedText = this._form.misword; + this.replacementText = this._form.txtsugg; + this.undoButton = this._form.btnUndo; + + // public methods + this.addSuggestion = addSuggestion; + this.clearSuggestions = clearSuggestions; + this.selectDefaultSuggestion = selectDefaultSuggestion; + this.resetForm = resetForm; + this.setSuggestedText = setSuggestedText; + this.enableUndo = enableUndo; + this.disableUndo = disableUndo; +} + +function resetForm() { + if( this._form ) { + this._form.reset(); + } +} + +function setSuggestedText() { + var slct = this.suggestionList; + var txt = this.replacementText; + var str = ""; + if( (slct.options[0].text) && slct.options[0].text != this.noSuggestionSelection ) { + str = slct.options[slct.selectedIndex].text; + } + txt.value = str; +} + +function selectDefaultSuggestion() { + var slct = this.suggestionList; + var txt = this.replacementText; + if( slct.options.length == 0 ) { + this.addSuggestion( this.noSuggestionSelection ); + } else { + slct.options[0].selected = true; + } + this.setSuggestedText(); +} + +function addSuggestion( sugg_text ) { + var slct = this.suggestionList; + if( sugg_text ) { + var i = slct.options.length; + var newOption = new Option( sugg_text, 'sugg_text'+i ); + slct.options[i] = newOption; + } +} + +function clearSuggestions() { + var slct = this.suggestionList; + for( var j = slct.length - 1; j > -1; j-- ) { + if( slct.options[j] ) { + slct.options[j] = null; + } + } +} + +function enableUndo() { + if( this.undoButton ) { + if( this.undoButton.disabled == true ) { + this.undoButton.disabled = false; + } + } +} + +function disableUndo() { + if( this.undoButton ) { + if( this.undoButton.disabled == false ) { + this.undoButton.disabled = true; + } + } +} Property changes on: announcement/trunk/src/main/webapp/fckeditor/editor/dialog/fck_spellerpages/spellerpages/controlWindow.js ___________________________________________________________________ Name: svn:eol-style + native Added: announcement/trunk/src/main/webapp/fckeditor/editor/dialog/fck_spellerpages/spellerpages/controls.html =================================================================== --- announcement/trunk/src/main/webapp/fckeditor/editor/dialog/fck_spellerpages/spellerpages/controls.html (rev 0) +++ announcement/trunk/src/main/webapp/fckeditor/editor/dialog/fck_spellerpages/spellerpages/controls.html 2008-06-30 02:54:27 UTC (rev 1002) @@ -0,0 +1,153 @@ + + + + + + + +
        + + + + + + + + + + + + + + + + + + +
        Not in dictionary:
        Change to:
        + + + + + + + +
        + +
        + +
        +
           + + + + + + + + + + + + + + + + + + + + + + +
        + +    + +
        + +    + +
        + +    + +
        +
        +
        + + Property changes on: announcement/trunk/src/main/webapp/fckeditor/editor/dialog/fck_spellerpages/spellerpages/controls.html ___________________________________________________________________ Name: svn:eol-style + native Added: announcement/trunk/src/main/webapp/fckeditor/editor/dialog/fck_spellerpages/spellerpages/server-scripts/spellchecker.cfm =================================================================== --- announcement/trunk/src/main/webapp/fckeditor/editor/dialog/fck_spellerpages/spellerpages/server-scripts/spellchecker.cfm (rev 0) +++ announcement/trunk/src/main/webapp/fckeditor/editor/dialog/fck_spellerpages/spellerpages/server-scripts/spellchecker.cfm 2008-06-30 02:54:27 UTC (rev 1002) @@ -0,0 +1,148 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + ]+>", " ", "all")> + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + Added: announcement/trunk/src/main/webapp/fckeditor/editor/dialog/fck_spellerpages/spellerpages/server-scripts/spellchecker.php =================================================================== --- announcement/trunk/src/main/webapp/fckeditor/editor/dialog/fck_spellerpages/spellerpages/server-scripts/spellchecker.php (rev 0) +++ announcement/trunk/src/main/webapp/fckeditor/editor/dialog/fck_spellerpages/spellerpages/server-scripts/spellchecker.php 2008-06-30 02:54:27 UTC (rev 1002) @@ -0,0 +1,199 @@ +$val ) { + # $val = str_replace( "'", "%27", $val ); + echo "textinputs[$key] = decodeURIComponent(\"" . $val . "\");\n"; + } +} + +# make declarations for the text input index +function print_textindex_decl( $text_input_idx ) { + echo "words[$text_input_idx] = [];\n"; + echo "suggs[$text_input_idx] = [];\n"; +} + +# set an element of the JavaScript 'words' array to a misspelled word +function print_words_elem( $word, $index, $text_input_idx ) { + echo "words[$text_input_idx][$index] = '" . escape_quote( $word ) . "';\n"; +} + + +# set an element of the JavaScript 'suggs' array to a list of suggestions +function print_suggs_elem( $suggs, $index, $text_input_idx ) { + echo "suggs[$text_input_idx][$index] = ["; + foreach( $suggs as $key=>$val ) { + if( $val ) { + echo "'" . escape_quote( $val ) . "'"; + if ( $key+1 < count( $suggs )) { + echo ", "; + } + } + } + echo "];\n"; +} + +# escape single quote +function escape_quote( $str ) { + return preg_replace ( "/'/", "\\'", $str ); +} + + +# handle a server-side error. +function error_handler( $err ) { + echo "error = '" . preg_replace( "/['\\\\]/", "\\\\$0", $err ) . "';\n"; +} + +## get the list of misspelled words. Put the results in the javascript words array +## for each misspelled word, get suggestions and put in the javascript suggs array +function print_checker_results() { + + global $aspell_prog; + global $aspell_opts; + global $tempfiledir; + global $textinputs; + global $input_separator; + $aspell_err = ""; + # create temp file + $tempfile = tempnam( $tempfiledir, 'aspell_data_' ); + + # open temp file, add the submitted text. + if( $fh = fopen( $tempfile, 'w' )) { + for( $i = 0; $i < count( $textinputs ); $i++ ) { + $text = urldecode( $textinputs[$i] ); + + // Strip all tags for the text. (by FredCK - #339 / #681) + $text = preg_replace( "/<[^>]+>/", " ", $text ) ; + + $lines = explode( "\n", $text ); + fwrite ( $fh, "%\n" ); # exit terse mode + fwrite ( $fh, "^$input_separator\n" ); + fwrite ( $fh, "!\n" ); # enter terse mode + foreach( $lines as $key=>$value ) { + # use carat on each line to escape possible aspell commands + fwrite( $fh, "^$value\n" ); + } + } + fclose( $fh ); + + # exec aspell command - redirect STDERR to STDOUT + $cmd = "$aspell_prog $aspell_opts < $tempfile 2>&1"; + if( $aspellret = shell_exec( $cmd )) { + $linesout = explode( "\n", $aspellret ); + $index = 0; + $text_input_index = -1; + # parse each line of aspell return + foreach( $linesout as $key=>$val ) { + $chardesc = substr( $val, 0, 1 ); + # if '&', then not in dictionary but has suggestions + # if '#', then not in dictionary and no suggestions + # if '*', then it is a delimiter between text inputs + # if '@' then version info + if( $chardesc == '&' || $chardesc == '#' ) { + $line = explode( " ", $val, 5 ); + print_words_elem( $line[1], $index, $text_input_index ); + if( isset( $line[4] )) { + $suggs = explode( ", ", $line[4] ); + } else { + $suggs = array(); + } + print_suggs_elem( $suggs, $index, $text_input_index ); + $index++; + } elseif( $chardesc == '*' ) { + $text_input_index++; + print_textindex_decl( $text_input_index ); + $index = 0; + } elseif( $chardesc != '@' && $chardesc != "" ) { + # assume this is error output + $aspell_err .= $val; + } + } + if( $aspell_err ) { + $aspell_err = "Error executing `$cmd`\\n$aspell_err"; + error_handler( $aspell_err ); + } + } else { + error_handler( "System error: Aspell program execution failed (`$cmd`)" ); + } + } else { + error_handler( "System error: Could not open file '$tempfile' for writing" ); + } + + # close temp file, delete file + unlink( $tempfile ); +} + + +?> + + + + + + + + + + + + + + + Added: announcement/trunk/src/main/webapp/fckeditor/editor/dialog/fck_spellerpages/spellerpages/server-scripts/spellchecker.pl =================================================================== --- announcement/trunk/src/main/webapp/fckeditor/editor/dialog/fck_spellerpages/spellerpages/server-scripts/spellchecker.pl (rev 0) +++ announcement/trunk/src/main/webapp/fckeditor/editor/dialog/fck_spellerpages/spellerpages/server-scripts/spellchecker.pl 2008-06-30 02:54:27 UTC (rev 1002) @@ -0,0 +1,181 @@ +#!/usr/bin/perl + +use CGI qw/ :standard /; +use File::Temp qw/ tempfile tempdir /; + +# my $spellercss = '/speller/spellerStyle.css'; # by FredCK +my $spellercss = '../spellerStyle.css'; # by FredCK +# my $wordWindowSrc = '/speller/wordWindow.js'; # by FredCK +my $wordWindowSrc = '../wordWindow.js'; # by FredCK +my @textinputs = param( 'textinputs[]' ); # array +# my $aspell_cmd = 'aspell'; # by FredCK (for Linux) +my $aspell_cmd = '"C:\Program Files\Aspell\bin\aspell.exe"'; # by FredCK (for Windows) +my $lang = 'en_US'; +# my $aspell_opts = "-a --lang=$lang --encoding=utf-8"; # by FredCK +my $aspell_opts = "-a --lang=$lang --encoding=utf-8 -H --rem-sgml-check=alt"; # by FredCK +my $input_separator = "A"; + +# set the 'wordtext' JavaScript variable to the submitted text. +sub printTextVar { + for( my $i = 0; $i <= $#textinputs; $i++ ) { + print "textinputs[$i] = decodeURIComponent('" . escapeQuote( $textinputs[$i] ) . "')\n"; + } +} + +sub printTextIdxDecl { + my $idx = shift; + print "words[$idx] = [];\n"; + print "suggs[$idx] = [];\n"; +} + +sub printWordsElem { + my( $textIdx, $wordIdx, $word ) = @_; + print "words[$textIdx][$wordIdx] = '" . escapeQuote( $word ) . "';\n"; +} + +sub printSuggsElem { + my( $textIdx, $wordIdx, @suggs ) = @_; + print "suggs[$textIdx][$wordIdx] = ["; + for my $i ( 0..$#suggs ) { + print "'" . escapeQuote( $suggs[$i] ) . "'"; + if( $i < $#suggs ) { + print ", "; + } + } + print "];\n"; +} + +sub printCheckerResults { + my $textInputIdx = -1; + my $wordIdx = 0; + my $unhandledText; + # create temp file + my $dir = tempdir( CLEANUP => 1 ); + my( $fh, $tmpfilename ) = tempfile( DIR => $dir ); + + # temp file was created properly? + + # open temp file, add the submitted text. + for( my $i = 0; $i <= $#textinputs; $i++ ) { + $text = url_decode( $textinputs[$i] ); + # Strip all tags for the text. (by FredCK - #339 / #681) + $text =~ s/<[^>]+>/ /g; + @lines = split( /\n/, $text ); + print $fh "\%\n"; # exit terse mode + print $fh "^$input_separator\n"; + print $fh "!\n"; # enter terse mode + for my $line ( @lines ) { + # use carat on each line to escape possible aspell commands + print $fh "^$line\n"; + } + + } + # exec aspell command + my $cmd = "$aspell_cmd $aspell_opts < $tmpfilename 2>&1"; + open ASPELL, "$cmd |" or handleError( "Could not execute `$cmd`\\n$!" ) and return; + # parse each line of aspell return + for my $ret ( ) { + chomp( $ret ); + # if '&', then not in dictionary but has suggestions + # if '#', then not in dictionary and no suggestions + # if '*', then it is a delimiter between text inputs + if( $ret =~ /^\*/ ) { + $textInputIdx++; + printTextIdxDecl( $textInputIdx ); + $wordIdx = 0; + + } elsif( $ret =~ /^(&|#)/ ) { + my @tokens = split( " ", $ret, 5 ); + printWordsElem( $textInputIdx, $wordIdx, $tokens[1] ); + my @suggs = (); + if( $tokens[4] ) { + @suggs = split( ", ", $tokens[4] ); + } + printSuggsElem( $textInputIdx, $wordIdx, @suggs ); + $wordIdx++; + } else { + $unhandledText .= $ret; + } + } + close ASPELL or handleError( "Error executing `$cmd`\\n$unhandledText" ) and return; +} + +sub escapeQuote { + my $str = shift; + $str =~ s/'/\\'/g; + return $str; +} + +sub handleError { + my $err = shift; + print "error = '" . escapeQuote( $err ) . "';\n"; +} + +sub url_decode { + local $_ = @_ ? shift : $_; + defined or return; + # change + signs to spaces + tr/+/ /; + # change hex escapes to the proper characters + s/%([a-fA-F0-9]{2})/pack "H2", $1/eg; + return $_; +} + +# # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # +# Display HTML +# # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # + +print < + + + + + + + + + + + + + +EOF Property changes on: announcement/trunk/src/main/webapp/fckeditor/editor/dialog/fck_spellerpages/spellerpages/server-scripts/spellchecker.pl ___________________________________________________________________ Name: svn:eol-style + native Added: announcement/trunk/src/main/webapp/fckeditor/editor/dialog/fck_spellerpages/spellerpages/spellChecker.js =================================================================== --- announcement/trunk/src/main/webapp/fckeditor/editor/dialog/fck_spellerpages/spellerpages/spellChecker.js (rev 0) +++ announcement/trunk/src/main/webapp/fckeditor/editor/dialog/fck_spellerpages/spellerpages/spellChecker.js 2008-06-30 02:54:27 UTC (rev 1002) @@ -0,0 +1,461 @@ +?//////////////////////////////////////////////////// +// spellChecker.js +// +// spellChecker object +// +// This file is sourced on web pages that have a textarea object to evaluate +// for spelling. It includes the implementation for the spellCheckObject. +// +//////////////////////////////////////////////////// + + +// constructor +function spellChecker( textObject ) { + + // public properties - configurable +// this.popUpUrl = '/speller/spellchecker.html'; // by FredCK + this.popUpUrl = 'fck_spellerpages/spellerpages/spellchecker.html'; // by FredCK + this.popUpName = 'spellchecker'; +// this.popUpProps = "menu=no,width=440,height=350,top=70,left=120,resizable=yes,status=yes"; // by FredCK + this.popUpProps = null ; // by FredCK +// this.spellCheckScript = '/speller/server-scripts/spellchecker.php'; // by FredCK + //this.spellCheckScript = '/cgi-bin/spellchecker.pl'; + + // values used to keep track of what happened to a word + this.replWordFlag = "R"; // single replace + this.ignrWordFlag = "I"; // single ignore + this.replAllFlag = "RA"; // replace all occurances + this.ignrAllFlag = "IA"; // ignore all occurances + this.fromReplAll = "~RA"; // an occurance of a "replace all" word + this.fromIgnrAll = "~IA"; // an occurance of a "ignore all" word + // properties set at run time + this.wordFlags = new Array(); + this.currentTextIndex = 0; + this.currentWordIndex = 0; + this.spellCheckerWin = null; + this.controlWin = null; + this.wordWin = null; + this.textArea = textObject; // deprecated + this.textInputs = arguments; + + // private methods + this._spellcheck = _spellcheck; + this._getSuggestions = _getSuggestions; + this._setAsIgnored = _setAsIgnored; + this._getTotalReplaced = _getTotalReplaced; + this._setWordText = _setWordText; + this._getFormInputs = _getFormInputs; + + // public methods + this.openChecker = openChecker; + this.startCheck = startCheck; + this.checkTextBoxes = checkTextBoxes; + this.checkTextAreas = checkTextAreas; + this.spellCheckAll = spellCheckAll; + this.ignoreWord = ignoreWord; + this.ignoreAll = ignoreAll; + this.replaceWord = replaceWord; + this.replaceAll = replaceAll; + this.terminateSpell = terminateSpell; + this.undo = undo; + + // set the current window's "speller" property to the instance of this class. + // this object can now be referenced by child windows/frames. + window.speller = this; +} + +// call this method to check all text boxes (and only text boxes) in the HTML document +function checkTextBoxes() { + this.textInputs = this._getFormInputs( "^text$" ); + this.openChecker(); +} + +// call this method to check all textareas (and only textareas ) in the HTML document +function checkTextAreas() { + this.textInputs = this._getFormInputs( "^textarea$" ); + this.openChecker(); +} + +// call this method to check all text boxes and textareas in the HTML document +function spellCheckAll() { + this.textInputs = this._getFormInputs( "^text(area)?$" ); + this.openChecker(); +} + +// call this method to check text boxe(s) and/or textarea(s) that were passed in to the +// object's constructor or to the textInputs property +function openChecker() { + this.spellCheckerWin = window.open( this.popUpUrl, this.popUpName, this.popUpProps ); + if( !this.spellCheckerWin.opener ) { + this.spellCheckerWin.opener = window; + } +} + +function startCheck( wordWindowObj, controlWindowObj ) { + + // set properties from args + this.wordWin = wordWindowObj; + this.controlWin = controlWindowObj; + + // reset properties + this.wordWin.resetForm(); + this.controlWin.resetForm(); + this.currentTextIndex = 0; + this.currentWordIndex = 0; + // initialize the flags to an array - one element for each text input + this.wordFlags = new Array( this.wordWin.textInputs.length ); + // each element will be an array that keeps track of each word in the text + for( var i=0; i wi ) || i > ti ) { + // future word: set as "from ignore all" if + // 1) do not already have a flag and + // 2) have the same value as current word + if(( this.wordWin.getTextVal( i, j ) == s_word_to_repl ) + && ( !this.wordFlags[i][j] )) { + this._setAsIgnored( i, j, this.fromIgnrAll ); + } + } + } + } + + // finally, move on + this.currentWordIndex++; + this._spellcheck(); + return true; +} + +function replaceWord() { + var wi = this.currentWordIndex; + var ti = this.currentTextIndex; + if( !this.wordWin ) { + alert( 'Error: Word frame not available.' ); + return false; + } + if( !this.wordWin.getTextVal( ti, wi )) { + alert( 'Error: "Not in dictionary" text is missing' ); + return false; + } + if( !this.controlWin.replacementText ) { + return false ; + } + var txt = this.controlWin.replacementText; + if( txt.value ) { + var newspell = new String( txt.value ); + if( this._setWordText( ti, wi, newspell, this.replWordFlag )) { + this.currentWordIndex++; + this._spellcheck(); + } + } + return true; +} + +function replaceAll() { + var ti = this.currentTextIndex; + var wi = this.currentWordIndex; + if( !this.wordWin ) { + alert( 'Error: Word frame not available.' ); + return false; + } + var s_word_to_repl = this.wordWin.getTextVal( ti, wi ); + if( !s_word_to_repl ) { + alert( 'Error: "Not in dictionary" text is missing' ); + return false; + } + var txt = this.controlWin.replacementText; + if( !txt.value ) return false; + var newspell = new String( txt.value ); + + // set this word as a "replace all" word. + this._setWordText( ti, wi, newspell, this.replAllFlag ); + + // loop through all the words after this word + for( var i = ti; i < this.wordWin.textInputs.length; i++ ) { + for( var j = 0; j < this.wordWin.totalWords( i ); j++ ) { + if(( i == ti && j > wi ) || i > ti ) { + // future word: set word text to s_word_to_repl if + // 1) do not already have a flag and + // 2) have the same value as s_word_to_repl + if(( this.wordWin.getTextVal( i, j ) == s_word_to_repl ) + && ( !this.wordFlags[i][j] )) { + this._setWordText( i, j, newspell, this.fromReplAll ); + } + } + } + } + + // finally, move on + this.currentWordIndex++; + this._spellcheck(); + return true; +} + +function terminateSpell() { + // called when we have reached the end of the spell checking. + var msg = ""; // by FredCK + var numrepl = this._getTotalReplaced(); + if( numrepl == 0 ) { + // see if there were no misspellings to begin with + if( !this.wordWin ) { + msg = ""; + } else { + if( this.wordWin.totalMisspellings() ) { +// msg += "No words changed."; // by FredCK + msg += FCKLang.DlgSpellNoChanges ; // by FredCK + } else { +// msg += "No misspellings found."; // by FredCK + msg += FCKLang.DlgSpellNoMispell ; // by FredCK + } + } + } else if( numrepl == 1 ) { +// msg += "One word changed."; // by FredCK + msg += FCKLang.DlgSpellOneChange ; // by FredCK + } else { +// msg += numrepl + " words changed."; // by FredCK + msg += FCKLang.DlgSpellManyChanges.replace( /%1/g, numrepl ) ; + } + if( msg ) { +// msg += "\n"; // by FredCK + alert( msg ); + } + + if( numrepl > 0 ) { + // update the text field(s) on the opener window + for( var i = 0; i < this.textInputs.length; i++ ) { + // this.textArea.value = this.wordWin.text; + if( this.wordWin ) { + if( this.wordWin.textInputs[i] ) { + this.textInputs[i].value = this.wordWin.textInputs[i]; + } + } + } + } + + // return back to the calling window +// this.spellCheckerWin.close(); // by FredCK + if ( typeof( this.OnFinished ) == 'function' ) // by FredCK + this.OnFinished(numrepl) ; // by FredCK + + return true; +} + +function undo() { + // skip if this is the first word! + var ti = this.currentTextIndex; + var wi = this.currentWordIndex; + + if( this.wordWin.totalPreviousWords( ti, wi ) > 0 ) { + this.wordWin.removeFocus( ti, wi ); + + // go back to the last word index that was acted upon + do { + // if the current word index is zero then reset the seed + if( this.currentWordIndex == 0 && this.currentTextIndex > 0 ) { + this.currentTextIndex--; + this.currentWordIndex = this.wordWin.totalWords( this.currentTextIndex )-1; + if( this.currentWordIndex < 0 ) this.currentWordIndex = 0; + } else { + if( this.currentWordIndex > 0 ) { + this.currentWordIndex--; + } + } + } while ( + this.wordWin.totalWords( this.currentTextIndex ) == 0 + || this.wordFlags[this.currentTextIndex][this.currentWordIndex] == this.fromIgnrAll + || this.wordFlags[this.currentTextIndex][this.currentWordIndex] == this.fromReplAll + ); + + var text_idx = this.currentTextIndex; + var idx = this.currentWordIndex; + var preReplSpell = this.wordWin.originalSpellings[text_idx][idx]; + + // if we got back to the first word then set the Undo button back to disabled + if( this.wordWin.totalPreviousWords( text_idx, idx ) == 0 ) { + this.controlWin.disableUndo(); + } + + var i, j, origSpell ; + // examine what happened to this current word. + switch( this.wordFlags[text_idx][idx] ) { + // replace all: go through this and all the future occurances of the word + // and revert them all to the original spelling and clear their flags + case this.replAllFlag : + for( i = text_idx; i < this.wordWin.textInputs.length; i++ ) { + for( j = 0; j < this.wordWin.totalWords( i ); j++ ) { + if(( i == text_idx && j >= idx ) || i > text_idx ) { + origSpell = this.wordWin.originalSpellings[i][j]; + if( origSpell == preReplSpell ) { + this._setWordText ( i, j, origSpell, undefined ); + } + } + } + } + break; + + // ignore all: go through all the future occurances of the word + // and clear their flags + case this.ignrAllFlag : + for( i = text_idx; i < this.wordWin.textInputs.length; i++ ) { + for( j = 0; j < this.wordWin.totalWords( i ); j++ ) { + if(( i == text_idx && j >= idx ) || i > text_idx ) { + origSpell = this.wordWin.originalSpellings[i][j]; + if( origSpell == preReplSpell ) { + this.wordFlags[i][j] = undefined; + } + } + } + } + break; + + // replace: revert the word to its original spelling + case this.replWordFlag : + this._setWordText ( text_idx, idx, preReplSpell, undefined ); + break; + } + + // For all four cases, clear the wordFlag of this word. re-start the process + this.wordFlags[text_idx][idx] = undefined; + this._spellcheck(); + } +} + +function _spellcheck() { + var ww = this.wordWin; + + // check if this is the last word in the current text element + if( this.currentWordIndex == ww.totalWords( this.currentTextIndex) ) { + this.currentTextIndex++; + this.currentWordIndex = 0; + // keep going if we're not yet past the last text element + if( this.currentTextIndex < this.wordWin.textInputs.length ) { + this._spellcheck(); + return; + } else { + this.terminateSpell(); + return; + } + } + + // if this is after the first one make sure the Undo button is enabled + if( this.currentWordIndex > 0 ) { + this.controlWin.enableUndo(); + } + + // skip the current word if it has already been worked on + if( this.wordFlags[this.currentTextIndex][this.currentWordIndex] ) { + // increment the global current word index and move on. + this.currentWordIndex++; + this._spellcheck(); + } else { + var evalText = ww.getTextVal( this.currentTextIndex, this.currentWordIndex ); + if( evalText ) { + this.controlWin.evaluatedText.value = evalText; + ww.setFocus( this.currentTextIndex, this.currentWordIndex ); + this._getSuggestions( this.currentTextIndex, this.currentWordIndex ); + } + } +} + +function _getSuggestions( text_num, word_num ) { + this.controlWin.clearSuggestions(); + // add suggestion in list for each suggested word. + // get the array of suggested words out of the + // three-dimensional array containing all suggestions. + var a_suggests = this.wordWin.suggestions[text_num][word_num]; + if( a_suggests ) { + // got an array of suggestions. + for( var ii = 0; ii < a_suggests.length; ii++ ) { + this.controlWin.addSuggestion( a_suggests[ii] ); + } + } + this.controlWin.selectDefaultSuggestion(); +} + +function _setAsIgnored( text_num, word_num, flag ) { + // set the UI + this.wordWin.removeFocus( text_num, word_num ); + // do the bookkeeping + this.wordFlags[text_num][word_num] = flag; + return true; +} + +function _getTotalReplaced() { + var i_replaced = 0; + for( var i = 0; i < this.wordFlags.length; i++ ) { + for( var j = 0; j < this.wordFlags[i].length; j++ ) { + if(( this.wordFlags[i][j] == this.replWordFlag ) + || ( this.wordFlags[i][j] == this.replAllFlag ) + || ( this.wordFlags[i][j] == this.fromReplAll )) { + i_replaced++; + } + } + } + return i_replaced; +} + +function _setWordText( text_num, word_num, newText, flag ) { + // set the UI and form inputs + this.wordWin.setText( text_num, word_num, newText ); + // keep track of what happened to this word: + this.wordFlags[text_num][word_num] = flag; + return true; +} + +function _getFormInputs( inputPattern ) { + var inputs = new Array(); + for( var i = 0; i < document.forms.length; i++ ) { + for( var j = 0; j < document.forms[i].elements.length; j++ ) { + if( document.forms[i].elements[j].type.match( inputPattern )) { + inputs[inputs.length] = document.forms[i].elements[j]; + } + } + } + return inputs; +} Property changes on: announcement/trunk/src/main/webapp/fckeditor/editor/dialog/fck_spellerpages/spellerpages/spellChecker.js ___________________________________________________________________ Name: svn:eol-style + native Added: announcement/trunk/src/main/webapp/fckeditor/editor/dialog/fck_spellerpages/spellerpages/spellchecker.html =================================================================== --- announcement/trunk/src/main/webapp/fckeditor/editor/dialog/fck_spellerpages/spellerpages/spellchecker.html (rev 0) +++ announcement/trunk/src/main/webapp/fckeditor/editor/dialog/fck_spellerpages/spellerpages/spellchecker.html 2008-06-30 02:54:27 UTC (rev 1002) @@ -0,0 +1,71 @@ + + + + + + +Speller Pages + + + + + + Property changes on: announcement/trunk/src/main/webapp/fckeditor/editor/dialog/fck_spellerpages/spellerpages/spellchecker.html ___________________________________________________________________ Name: svn:eol-style + native Added: announcement/trunk/src/main/webapp/fckeditor/editor/dialog/fck_spellerpages/spellerpages/spellerStyle.css =================================================================== --- announcement/trunk/src/main/webapp/fckeditor/editor/dialog/fck_spellerpages/spellerpages/spellerStyle.css (rev 0) +++ announcement/trunk/src/main/webapp/fckeditor/editor/dialog/fck_spellerpages/spellerpages/spellerStyle.css 2008-06-30 02:54:27 UTC (rev 1002) @@ -0,0 +1,49 @@ +.blend { + font-family: courier new; + font-size: 10pt; + border: 0; + margin-bottom:-1; +} +.normalLabel { + font-size:8pt; +} +.normalText { + font-family:arial, helvetica, sans-serif; + font-size:10pt; + color:000000; + background-color:FFFFFF; +} +.plainText { + font-family: courier new, courier, monospace; + font-size: 10pt; + color:000000; + background-color:FFFFFF; +} +.controlWindowBody { + font-family:arial, helvetica, sans-serif; + font-size:8pt; + padding: 7px ; /* by FredCK */ + margin: 0px ; /* by FredCK */ + /* color:000000; by FredCK */ + /* background-color:DADADA; by FredCK */ +} +.readonlyInput { + background-color:DADADA; + color:000000; + font-size:8pt; + width:392px; +} +.textDefault { + font-size:8pt; + width: 200px; +} +.buttonDefault { + width:90px; + height:22px; + font-size:8pt; +} +.suggSlct { + width:200px; + margin-top:2; + font-size:8pt; +} Property changes on: announcement/trunk/src/main/webapp/fckeditor/editor/dialog/fck_spellerpages/spellerpages/spellerStyle.css ___________________________________________________________________ Name: svn:eol-style + native Added: announcement/trunk/src/main/webapp/fckeditor/editor/dialog/fck_spellerpages/spellerpages/wordWindow.js =================================================================== --- announcement/trunk/src/main/webapp/fckeditor/editor/dialog/fck_spellerpages/spellerpages/wordWindow.js (rev 0) +++ announcement/trunk/src/main/webapp/fckeditor/editor/dialog/fck_spellerpages/spellerpages/wordWindow.js 2008-06-30 02:54:27 UTC (rev 1002) @@ -0,0 +1,272 @@ +?//////////////////////////////////////////////////// +// wordWindow object +//////////////////////////////////////////////////// +function wordWindow() { + // private properties + this._forms = []; + + // private methods + this._getWordObject = _getWordObject; + //this._getSpellerObject = _getSpellerObject; + this._wordInputStr = _wordInputStr; + this._adjustIndexes = _adjustIndexes; + this._isWordChar = _isWordChar; + this._lastPos = _lastPos; + + // public properties + this.wordChar = /[a-zA-Z]/; + this.windowType = "wordWindow"; + this.originalSpellings = new Array(); + this.suggestions = new Array(); + this.checkWordBgColor = "pink"; + this.normWordBgColor = "white"; + this.text = ""; + this.textInputs = new Array(); + this.indexes = new Array(); + //this.speller = this._getSpellerObject(); + + // public methods + this.resetForm = resetForm; + this.totalMisspellings = totalMisspellings; + this.totalWords = totalWords; + this.totalPreviousWords = totalPreviousWords; + //this.getTextObjectArray = getTextObjectArray; + this.getTextVal = getTextVal; + this.setFocus = setFocus; + this.removeFocus = removeFocus; + this.setText = setText; + //this.getTotalWords = getTotalWords; + this.writeBody = writeBody; + this.printForHtml = printForHtml; +} + +function resetForm() { + if( this._forms ) { + for( var i = 0; i < this._forms.length; i++ ) { + this._forms[i].reset(); + } + } + return true; +} + +function totalMisspellings() { + var total_words = 0; + for( var i = 0; i < this.textInputs.length; i++ ) { + total_words += this.totalWords( i ); + } + return total_words; +} + +function totalWords( textIndex ) { + return this.originalSpellings[textIndex].length; +} + +function totalPreviousWords( textIndex, wordIndex ) { + var total_words = 0; + for( var i = 0; i <= textIndex; i++ ) { + for( var j = 0; j < this.totalWords( i ); j++ ) { + if( i == textIndex && j == wordIndex ) { + break; + } else { + total_words++; + } + } + } + return total_words; +} + +//function getTextObjectArray() { +// return this._form.elements; +//} + +function getTextVal( textIndex, wordIndex ) { + var word = this._getWordObject( textIndex, wordIndex ); + if( word ) { + return word.value; + } +} + +function setFocus( textIndex, wordIndex ) { + var word = this._getWordObject( textIndex, wordIndex ); + if( word ) { + if( word.type == "text" ) { + word.focus(); + word.style.backgroundColor = this.checkWordBgColor; + } + } +} + +function removeFocus( textIndex, wordIndex ) { + var word = this._getWordObject( textIndex, wordIndex ); + if( word ) { + if( word.type == "text" ) { + word.blur(); + word.style.backgroundColor = this.normWordBgColor; + } + } +} + +function setText( textIndex, wordIndex, newText ) { + var word = this._getWordObject( textIndex, wordIndex ); + var beginStr; + var endStr; + if( word ) { + var pos = this.indexes[textIndex][wordIndex]; + var oldText = word.value; + // update the text given the index of the string + beginStr = this.textInputs[textIndex].substring( 0, pos ); + endStr = this.textInputs[textIndex].substring( + pos + oldText.length, + this.textInputs[textIndex].length + ); + this.textInputs[textIndex] = beginStr + newText + endStr; + + // adjust the indexes on the stack given the differences in + // length between the new word and old word. + var lengthDiff = newText.length - oldText.length; + this._adjustIndexes( textIndex, wordIndex, lengthDiff ); + + word.size = newText.length; + word.value = newText; + this.removeFocus( textIndex, wordIndex ); + } +} + + +function writeBody() { + var d = window.document; + var is_html = false; + + d.open(); + + // iterate through each text input. + for( var txtid = 0; txtid < this.textInputs.length; txtid++ ) { + var end_idx = 0; + var begin_idx = 0; + d.writeln( '
        ' ); + var wordtxt = this.textInputs[txtid]; + this.indexes[txtid] = []; + + if( wordtxt ) { + var orig = this.originalSpellings[txtid]; + if( !orig ) break; + + //!!! plain text, or HTML mode? + d.writeln( '
        ' ); + // iterate through each occurrence of a misspelled word. + for( var i = 0; i < orig.length; i++ ) { + // find the position of the current misspelled word, + // starting at the last misspelled word. + // and keep looking if it's a substring of another word + do { + begin_idx = wordtxt.indexOf( orig[i], end_idx ); + end_idx = begin_idx + orig[i].length; + // word not found? messed up! + if( begin_idx == -1 ) break; + // look at the characters immediately before and after + // the word. If they are word characters we'll keep looking. + var before_char = wordtxt.charAt( begin_idx - 1 ); + var after_char = wordtxt.charAt( end_idx ); + } while ( + this._isWordChar( before_char ) + || this._isWordChar( after_char ) + ); + + // keep track of its position in the original text. + this.indexes[txtid][i] = begin_idx; + + // write out the characters before the current misspelled word + for( var j = this._lastPos( txtid, i ); j < begin_idx; j++ ) { + // !!! html mode? make it html compatible + d.write( this.printForHtml( wordtxt.charAt( j ))); + } + + // write out the misspelled word. + d.write( this._wordInputStr( orig[i] )); + + // if it's the last word, write out the rest of the text + if( i == orig.length-1 ){ + d.write( printForHtml( wordtxt.substr( end_idx ))); + } + } + + d.writeln( '
        ' ); + + } + d.writeln( '
        ' ); + } + //for ( var j = 0; j < d.forms.length; j++ ) { + // alert( d.forms[j].name ); + // for( var k = 0; k < d.forms[j].elements.length; k++ ) { + // alert( d.forms[j].elements[k].name + ": " + d.forms[j].elements[k].value ); + // } + //} + + // set the _forms property + this._forms = d.forms; + d.close(); +} + +// return the character index in the full text after the last word we evaluated +function _lastPos( txtid, idx ) { + if( idx > 0 ) + return this.indexes[txtid][idx-1] + this.originalSpellings[txtid][idx-1].length; + else + return 0; +} + +function printForHtml( n ) { + return n ; // by FredCK +/* + var htmlstr = n; + if( htmlstr.length == 1 ) { + // do simple case statement if it's just one character + switch ( n ) { + case "\n": + htmlstr = '
        '; + break; + case "<": + htmlstr = '<'; + break; + case ">": + htmlstr = '>'; + break; + } + return htmlstr; + } else { + htmlstr = htmlstr.replace( //g, '>' ); + htmlstr = htmlstr.replace( /\n/g, '
        ' ); + return htmlstr; + } +*/ +} + +function _isWordChar( letter ) { + if( letter.search( this.wordChar ) == -1 ) { + return false; + } else { + return true; + } +} + +function _getWordObject( textIndex, wordIndex ) { + if( this._forms[textIndex] ) { + if( this._forms[textIndex].elements[wordIndex] ) { + return this._forms[textIndex].elements[wordIndex]; + } + } + return null; +} + +function _wordInputStr( word ) { + var str = ''; + return str; +} + +function _adjustIndexes( textIndex, wordIndex, lengthDiff ) { + for( var i = wordIndex + 1; i < this.originalSpellings[textIndex].length; i++ ) { + this.indexes[textIndex][i] = this.indexes[textIndex][i] + lengthDiff; + } +} Property changes on: announcement/trunk/src/main/webapp/fckeditor/editor/dialog/fck_spellerpages/spellerpages/wordWindow.js ___________________________________________________________________ Name: svn:eol-style + native Added: announcement/trunk/src/main/webapp/fckeditor/editor/dialog/fck_spellerpages.html =================================================================== --- announcement/trunk/src/main/webapp/fckeditor/editor/dialog/fck_spellerpages.html (rev 0) +++ announcement/trunk/src/main/webapp/fckeditor/editor/dialog/fck_spellerpages.html 2008-06-30 02:54:27 UTC (rev 1002) @@ -0,0 +1,65 @@ + + + + + Spell Check + + + + + + + + + + + Property changes on: announcement/trunk/src/main/webapp/fckeditor/editor/dialog/fck_spellerpages.html ___________________________________________________________________ Name: svn:eol-style + native Added: announcement/trunk/src/main/webapp/fckeditor/editor/dialog/fck_table.html =================================================================== --- announcement/trunk/src/main/webapp/fckeditor/editor/dialog/fck_table.html (rev 0) +++ announcement/trunk/src/main/webapp/fckeditor/editor/dialog/fck_table.html 2008-06-30 02:54:27 UTC (rev 1002) @@ -0,0 +1,298 @@ + + + + + Table Properties + + + + + + + + + + +
        + + + + + + +
        + + + + + + + + + + + + + + + + + + + + + +
        + Rows: +  
        + Columns: +  
        +   +  
        + Border size: +  
        + Alignment: +  
        +
        +     + + + + + + + + + + + + + + + + + + + + + + + + + + +
        + Width: +   +  
        + Height: +   +  pixels
        +   +   +  
        + Cell spacing: +   +  
        + Cell padding: +   +  
        +
        + + + + + + + + + + + +
        + Caption +   +
        + Summary +   +
        +
        + + Property changes on: announcement/trunk/src/main/webapp/fckeditor/editor/dialog/fck_table.html ___________________________________________________________________ Name: svn:eol-style + native Added: announcement/trunk/src/main/webapp/fckeditor/editor/dialog/fck_tablecell.html =================================================================== --- announcement/trunk/src/main/webapp/fckeditor/editor/dialog/fck_tablecell.html (rev 0) +++ announcement/trunk/src/main/webapp/fckeditor/editor/dialog/fck_tablecell.html 2008-06-30 02:54:27 UTC (rev 1002) @@ -0,0 +1,257 @@ + + + + + Table Cell Properties + + + + + + + + + + +
        + + + + + + +
        + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
        + Width: +   
        + Height: +   pixels
        +   +  
        + Word Wrap: +  
        +   +  
        + Horizontal Alignment: +  
        + Vertical Alignment: +  
        +
        +     + + + + + + + + + + + + + + + + + + + + + + + + + + +
        + Rows Span: +   + +
        + Columns Span: +   + +
        +   +   +  
        + Background Color: +   +   +
        + Border Color: +   +   +
        +
        +
        + + Property changes on: announcement/trunk/src/main/webapp/fckeditor/editor/dialog/fck_tablecell.html ___________________________________________________________________ Name: svn:eol-style + native Added: announcement/trunk/src/main/webapp/fckeditor/editor/dialog/fck_template/images/template1.gif =================================================================== (Binary files differ) Property changes on: announcement/trunk/src/main/webapp/fckeditor/editor/dialog/fck_template/images/template1.gif ___________________________________________________________________ Name: svn:mime-type + application/octet-stream Added: announcement/trunk/src/main/webapp/fckeditor/editor/dialog/fck_template/images/template2.gif =================================================================== (Binary files differ) Property changes on: announcement/trunk/src/main/webapp/fckeditor/editor/dialog/fck_template/images/template2.gif ___________________________________________________________________ Name: svn:mime-type + application/octet-stream Added: announcement/trunk/src/main/webapp/fckeditor/editor/dialog/fck_template/images/template3.gif =================================================================== (Binary files differ) Property changes on: announcement/trunk/src/main/webapp/fckeditor/editor/dialog/fck_template/images/template3.gif ___________________________________________________________________ Name: svn:mime-type + application/octet-stream Added: announcement/trunk/src/main/webapp/fckeditor/editor/dialog/fck_template.html =================================================================== --- announcement/trunk/src/main/webapp/fckeditor/editor/dialog/fck_template.html (rev 0) +++ announcement/trunk/src/main/webapp/fckeditor/editor/dialog/fck_template.html 2008-06-30 02:54:27 UTC (rev 1002) @@ -0,0 +1,242 @@ + + + + + + + + + + + + + + + + + + + + + + +
        + Please select the template to open in the editor
        + (the actual contents will be lost):
        +
        +
        + + +
        +
        + + Property changes on: announcement/trunk/src/main/webapp/fckeditor/editor/dialog/fck_template.html ___________________________________________________________________ Name: svn:eol-style + native Added: announcement/trunk/src/main/webapp/fckeditor/editor/dialog/fck_textarea.html =================================================================== --- announcement/trunk/src/main/webapp/fckeditor/editor/dialog/fck_textarea.html (rev 0) +++ announcement/trunk/src/main/webapp/fckeditor/editor/dialog/fck_textarea.html 2008-06-30 02:54:27 UTC (rev 1002) @@ -0,0 +1,94 @@ + + + + + Text Area Properties + + + + + + + + + + +
        + + + + +
        + Name
        + + Collumns
        + +
        + Rows
        + +
        +
        + + Property changes on: announcement/trunk/src/main/webapp/fckeditor/editor/dialog/fck_textarea.html ___________________________________________________________________ Name: svn:eol-style + native Added: announcement/trunk/src/main/webapp/fckeditor/editor/dialog/fck_textfield.html =================================================================== --- announcement/trunk/src/main/webapp/fckeditor/editor/dialog/fck_textfield.html (rev 0) +++ announcement/trunk/src/main/webapp/fckeditor/editor/dialog/fck_textfield.html 2008-06-30 02:54:27 UTC (rev 1002) @@ -0,0 +1,136 @@ + + + + + + + + + + + + + + + +
        + + + + + + + + + + + + + + + + +
        + Name
        + +
        + + Value
        + +
        + Character Width
        + +
        + + Maximum Characters
        + +
        + Type
        + +
        +   +
        +
        + + Property changes on: announcement/trunk/src/main/webapp/fckeditor/editor/dialog/fck_textfield.html ___________________________________________________________________ Name: svn:eol-style + native Added: announcement/trunk/src/main/webapp/fckeditor/editor/dtd/fck_dtd_test.html =================================================================== --- announcement/trunk/src/main/webapp/fckeditor/editor/dtd/fck_dtd_test.html (rev 0) +++ announcement/trunk/src/main/webapp/fckeditor/editor/dtd/fck_dtd_test.html 2008-06-30 02:54:27 UTC (rev 1002) @@ -0,0 +1,41 @@ + + + + DTD Test Page + + + + + +

        + DTD Contents +

        + + +
        + + Property changes on: announcement/trunk/src/main/webapp/fckeditor/editor/dtd/fck_dtd_test.html ___________________________________________________________________ Name: svn:eol-style + native Added: announcement/trunk/src/main/webapp/fckeditor/editor/dtd/fck_xhtml10strict.js =================================================================== --- announcement/trunk/src/main/webapp/fckeditor/editor/dtd/fck_xhtml10strict.js (rev 0) +++ announcement/trunk/src/main/webapp/fckeditor/editor/dtd/fck_xhtml10strict.js 2008-06-30 02:54:27 UTC (rev 1002) @@ -0,0 +1,116 @@ +?/* + * FCKeditor - The text editor for Internet - http://www.fckeditor.net + * Copyright (C) 2003-2008 Frederico Caldeira Knabben + * + * == BEGIN LICENSE == + * + * Licensed under the terms of any of the following licenses at your + * choice: + * + * - GNU General Public License Version 2 or later (the "GPL") + * http://www.gnu.org/licenses/gpl.html + * + * - GNU Lesser General Public License Version 2.1 or later (the "LGPL") + * http://www.gnu.org/licenses/lgpl.html + * + * - Mozilla Public License Version 1.1 or later (the "MPL") + * http://www.mozilla.org/MPL/MPL-1.1.html + * + * == END LICENSE == + * + * Contains the DTD mapping for XHTML 1.0 Strict. + * This file was automatically generated from the file: xhtml10-strict.dtd + */ +FCK.DTD = (function() +{ + var X = FCKTools.Merge ; + + var H,I,J,K,C,L,M,A,B,D,E,G,N,F ; + A = {ins:1, del:1, script:1} ; + B = {hr:1, ul:1, div:1, blockquote:1, noscript:1, table:1, address:1, pre:1, p:1, h5:1, dl:1, h4:1, ol:1, h6:1, h1:1, h3:1, h2:1} ; + C = X({fieldset:1}, B) ; + D = X({sub:1, bdo:1, 'var':1, sup:1, br:1, kbd:1, map:1, samp:1, b:1, acronym:1, '#':1, abbr:1, code:1, i:1, cite:1, tt:1, strong:1, q:1, em:1, big:1, small:1, span:1, dfn:1}, A) ; + E = X({img:1, object:1}, D) ; + F = {input:1, button:1, textarea:1, select:1, label:1} ; + G = X({a:1}, F) ; + H = {img:1, noscript:1, br:1, kbd:1, button:1, h5:1, h4:1, samp:1, h6:1, ol:1, h1:1, h3:1, h2:1, form:1, select:1, '#':1, ins:1, abbr:1, label:1, code:1, table:1, script:1, cite:1, input:1, strong:1, textarea:1, big:1, small:1, span:1, hr:1, sub:1, bdo:1, 'var':1, div:1, object:1, sup:1, map:1, dl:1, del:1, fieldset:1, ul:1, b:1, acronym:1, a:1, blockquote:1, i:1, address:1, tt:1, q:1, pre:1, p:1, em:1, dfn:1} ; + + I = X({form:1, fieldset:1}, B, E, G) ; + J = {tr:1} ; + K = {'#':1} ; + L = X(E, G) ; + M = {li:1} ; + N = X({form:1}, A, C) ; + + return { + col: {}, + tr: {td:1, th:1}, + img: {}, + colgroup: {col:1}, + noscript: N, + td: I, + br: {}, + th: I, + kbd: L, + button: X(B, E), + h5: L, + h4: L, + samp: L, + h6: L, + ol: M, + h1: L, + h3: L, + option: K, + h2: L, + form: X(A, C), + select: {optgroup:1, option:1}, + ins: I, + abbr: L, + label: L, + code: L, + table: {thead:1, col:1, tbody:1, tr:1, colgroup:1, caption:1, tfoot:1}, + script: K, + tfoot: J, + cite: L, + li: I, + input: {}, + strong: L, + textarea: K, + big: L, + small: L, + span: L, + dt: L, + hr: {}, + sub: L, + optgroup: {option:1}, + bdo: L, + param: {}, + 'var': L, + div: I, + object: X({param:1}, H), + sup: L, + dd: I, + area: {}, + map: X({form:1, area:1}, A, C), + dl: {dt:1, dd:1}, + del: I, + fieldset: X({legend:1}, H), + thead: J, + ul: M, + acronym: L, + b: L, + a: X({img:1, object:1}, D, F), + blockquote: N, + caption: L, + i: L, + tbody: J, + address: L, + tt: L, + legend: L, + q: L, + pre: X({a:1}, D, F), + p: L, + em: L, + dfn: L + } ; +})() ; Property changes on: announcement/trunk/src/main/webapp/fckeditor/editor/dtd/fck_xhtml10strict.js ___________________________________________________________________ Name: svn:eol-style + native Added: announcement/trunk/src/main/webapp/fckeditor/editor/dtd/fck_xhtml10transitional.js =================================================================== --- announcement/trunk/src/main/webapp/fckeditor/editor/dtd/fck_xhtml10transitional.js (rev 0) +++ announcement/trunk/src/main/webapp/fckeditor/editor/dtd/fck_xhtml10transitional.js 2008-06-30 02:54:27 UTC (rev 1002) @@ -0,0 +1,140 @@ +?/* + * FCKeditor - The text editor for Internet - http://www.fckeditor.net + * Copyright (C) 2003-2008 Frederico Caldeira Knabben + * + * == BEGIN LICENSE == + * + * Licensed under the terms of any of the following licenses at your + * choice: + * + * - GNU General Public License Version 2 or later (the "GPL") + * http://www.gnu.org/licenses/gpl.html + * + * - GNU Lesser General Public License Version 2.1 or later (the "LGPL") + * http://www.gnu.org/licenses/lgpl.html + * + * - Mozilla Public License Version 1.1 or later (the "MPL") + * http://www.mozilla.org/MPL/MPL-1.1.html + * + * == END LICENSE == + * + * Contains the DTD mapping for XHTML 1.0 Transitional. + * This file was automatically generated from the file: xhtml10-transitional.dtd + */ +FCK.DTD = (function() +{ + var X = FCKTools.Merge ; + + var A,L,J,M,N,O,D,H,P,K,Q,F,G,C,B,E,I ; + A = {isindex:1, fieldset:1} ; + B = {input:1, button:1, select:1, textarea:1, label:1} ; + C = X({a:1}, B) ; + D = X({iframe:1}, C) ; + E = {hr:1, ul:1, menu:1, div:1, blockquote:1, noscript:1, table:1, center:1, address:1, dir:1, pre:1, h5:1, dl:1, h4:1, noframes:1, h6:1, ol:1, h1:1, h3:1, h2:1} ; + F = {ins:1, del:1, script:1} ; + G = X({b:1, acronym:1, bdo:1, 'var':1, '#':1, abbr:1, code:1, br:1, i:1, cite:1, kbd:1, u:1, strike:1, s:1, tt:1, strong:1, q:1, samp:1, em:1, dfn:1, span:1}, F) ; + H = X({sub:1, img:1, object:1, sup:1, basefont:1, map:1, applet:1, font:1, big:1, small:1}, G) ; + I = X({p:1}, H) ; + J = X({iframe:1}, H, B) ; + K = {img:1, noscript:1, br:1, kbd:1, center:1, button:1, basefont:1, h5:1, h4:1, samp:1, h6:1, ol:1, h1:1, h3:1, h2:1, form:1, font:1, '#':1, select:1, menu:1, ins:1, abbr:1, label:1, code:1, table:1, script:1, cite:1, input:1, iframe:1, strong:1, textarea:1, noframes:1, big:1, small:1, span:1, hr:1, sub:1, bdo:1, 'var':1, div:1, object:1, sup:1, strike:1, dir:1, map:1, dl:1, applet:1, del:1, isindex:1, fieldset:1, ul:1, b:1, acronym:1, a:1, blockquote:1, i:1, u:1, s:1, tt:1, address:1, q:1, pre:1, p:1, em:1, dfn:1} ; + + L = X({a:1}, J) ; + M = {tr:1} ; + N = {'#':1} ; + O = X({param:1}, K) ; + P = X({form:1}, A, D, E, I) ; + Q = {li:1} ; + + return { + col: {}, + tr: {td:1, th:1}, + img: {}, + colgroup: {col:1}, + noscript: P, + td: P, + br: {}, + th: P, + center: P, + kbd: L, + button: X(I, E), + basefont: {}, + h5: L, + h4: L, + samp: L, + h6: L, + ol: Q, + h1: L, + h3: L, + option: N, + h2: L, + form: X(A, D, E, I), + select: {optgroup:1, option:1}, + font: J, // Changed from L to J (see (1)) + ins: P, + menu: Q, + abbr: L, + label: L, + table: {thead:1, col:1, tbody:1, tr:1, colgroup:1, caption:1, tfoot:1}, + code: L, + script: N, + tfoot: M, + cite: L, + li: P, + input: {}, + iframe: P, + strong: J, // Changed from L to J (see (1)) + textarea: N, + noframes: P, + big: J, // Changed from L to J (see (1)) + small: J, // Changed from L to J (see (1)) + span: J, // Changed from L to J (see (1)) + hr: {}, + dt: L, + sub: J, // Changed from L to J (see (1)) + optgroup: {option:1}, + param: {}, + bdo: L, + 'var': J, // Changed from L to J (see (1)) + div: P, + object: O, + sup: J, // Changed from L to J (see (1)) + dd: P, + strike: J, // Changed from L to J (see (1)) + area: {}, + dir: Q, + map: X({area:1, form:1, p:1}, A, F, E), + applet: O, + dl: {dt:1, dd:1}, + del: P, + isindex: {}, + fieldset: X({legend:1}, K), + thead: M, + ul: Q, + acronym: L, + b: J, // Changed from L to J (see (1)) + a: J, + blockquote: P, + caption: L, + i: J, // Changed from L to J (see (1)) + u: J, // Changed from L to J (see (1)) + tbody: M, + s: L, + address: X(D, I), + tt: J, // Changed from L to J (see (1)) + legend: L, + q: L, + pre: X(G, C), + p: L, + em: J, // Changed from L to J (see (1)) + dfn: L + } ; +})() ; + +/* + Notes: + (1) According to the DTD, many elements, like accept elements + inside of them. But, to produce better output results, we have manually + changed the map to avoid breaking the links on pieces, having + "this is a link test", instead of + "this is a link test". +*/ Property changes on: announcement/trunk/src/main/webapp/fckeditor/editor/dtd/fck_xhtml10transitional.js ___________________________________________________________________ Name: svn:eol-style + native Added: announcement/trunk/src/main/webapp/fckeditor/editor/fckdebug.html =================================================================== --- announcement/trunk/src/main/webapp/fckeditor/editor/fckdebug.html (rev 0) +++ announcement/trunk/src/main/webapp/fckeditor/editor/fckdebug.html 2008-06-30 02:54:27 UTC (rev 1002) @@ -0,0 +1,153 @@ + + + + + FCKeditor Debug Window + + + + + + + + + + + +
        + + + + + +
        + FCKeditor Debug Window +
        +
        + +
        + + Property changes on: announcement/trunk/src/main/webapp/fckeditor/editor/fckdebug.html ___________________________________________________________________ Name: svn:eol-style + native Added: announcement/trunk/src/main/webapp/fckeditor/editor/fckdialog.html =================================================================== --- announcement/trunk/src/main/webapp/fckeditor/editor/fckdialog.html (rev 0) +++ announcement/trunk/src/main/webapp/fckeditor/editor/fckdialog.html 2008-06-30 02:54:27 UTC (rev 1002) @@ -0,0 +1,812 @@ + + + + + + + + + + +
        + +
        +
        + + + + + +
          + +   + +
        +
        +
        +
        +
        +
        +
        +
        +
        +
        +
        + + + + + Property changes on: announcement/trunk/src/main/webapp/fckeditor/editor/fckdialog.html ___________________________________________________________________ Name: svn:eol-style + native Added: announcement/trunk/src/main/webapp/fckeditor/editor/fckeditor.html =================================================================== --- announcement/trunk/src/main/webapp/fckeditor/editor/fckeditor.html (rev 0) +++ announcement/trunk/src/main/webapp/fckeditor/editor/fckeditor.html 2008-06-30 02:54:27 UTC (rev 1002) @@ -0,0 +1,285 @@ + + + + + FCKeditor + + + + + + + + + + + + + + + + + + + +
        + + Property changes on: announcement/trunk/src/main/webapp/fckeditor/editor/fckeditor.html ___________________________________________________________________ Name: svn:eol-style + native Added: announcement/trunk/src/main/webapp/fckeditor/editor/fckeditor.original.html =================================================================== --- announcement/trunk/src/main/webapp/fckeditor/editor/fckeditor.original.html (rev 0) +++ announcement/trunk/src/main/webapp/fckeditor/editor/fckeditor.original.html 2008-06-30 02:54:27 UTC (rev 1002) @@ -0,0 +1,392 @@ +? + + + + FCKeditor + + + + + + + + + + + + + + + + + + + +
        + + Property changes on: announcement/trunk/src/main/webapp/fckeditor/editor/fckeditor.original.html ___________________________________________________________________ Name: svn:eol-style + native Added: announcement/trunk/src/main/webapp/fckeditor/editor/filemanager/browser/default/browser.css =================================================================== --- announcement/trunk/src/main/webapp/fckeditor/editor/filemanager/browser/default/browser.css (rev 0) +++ announcement/trunk/src/main/webapp/fckeditor/editor/filemanager/browser/default/browser.css 2008-06-30 02:54:27 UTC (rev 1002) @@ -0,0 +1,87 @@ +/* + * FCKeditor - The text editor for Internet - http://www.fckeditor.net + * Copyright (C) 2003-2008 Frederico Caldeira Knabben + * + * == BEGIN LICENSE == + * + * Licensed under the terms of any of the following licenses at your + * choice: + * + * - GNU General Public License Version 2 or later (the "GPL") + * http://www.gnu.org/licenses/gpl.html + * + * - GNU Lesser General Public License Version 2.1 or later (the "LGPL") + * http://www.gnu.org/licenses/lgpl.html + * + * - Mozilla Public License Version 1.1 or later (the "MPL") + * http://www.mozilla.org/MPL/MPL-1.1.html + * + * == END LICENSE == + * + * CSS styles used by all pages that compose the File Browser. + */ + +body +{ + background-color: #f1f1e3; + margin-top:0; + margin-bottom:0; +} + +form +{ + margin: 0; + padding: 0; +} + +.Frame +{ + background-color: #f1f1e3; + border: thin inset #f1f1e3; +} + +body.FileArea +{ + background-color: #ffffff; + margin: 10px; +} + +body, td, input, select +{ + font-size: 11px; + font-family: 'Microsoft Sans Serif' , Arial, Helvetica, Verdana; +} + +.ActualFolder +{ + font-weight: bold; + font-size: 14px; +} + +.PopupButtons +{ + border-top: #d5d59d 1px solid; + background-color: #e3e3c7; + padding: 7px 10px 7px 10px; +} + +.Button, button +{ + color: #3b3b1f; + border: #737357 1px solid; + background-color: #c7c78f; +} + +.FolderListCurrentFolder img +{ + background-image: url(images/FolderOpened.gif); +} + +.FolderListFolder img +{ + background-image: url(images/Folder.gif); +} + +.fullHeight { + height: 100%; +} Property changes on: announcement/trunk/src/main/webapp/fckeditor/editor/filemanager/browser/default/browser.css ___________________________________________________________________ Name: svn:eol-style + native Added: announcement/trunk/src/main/webapp/fckeditor/editor/filemanager/browser/default/browser.html =================================================================== --- announcement/trunk/src/main/webapp/fckeditor/editor/filemanager/browser/default/browser.html (rev 0) +++ announcement/trunk/src/main/webapp/fckeditor/editor/filemanager/browser/default/browser.html 2008-06-30 02:54:27 UTC (rev 1002) @@ -0,0 +1,200 @@ + + + + + FCKeditor - Resources Browser + + + + + + + + + + + + + + + + + + + + + Property changes on: announcement/trunk/src/main/webapp/fckeditor/editor/filemanager/browser/default/browser.html ___________________________________________________________________ Name: svn:eol-style + native Added: announcement/trunk/src/main/webapp/fckeditor/editor/filemanager/browser/default/frmactualfolder.html =================================================================== --- announcement/trunk/src/main/webapp/fckeditor/editor/filemanager/browser/default/frmactualfolder.html (rev 0) +++ announcement/trunk/src/main/webapp/fckeditor/editor/filemanager/browser/default/frmactualfolder.html 2008-06-30 02:54:27 UTC (rev 1002) @@ -0,0 +1,95 @@ + + + + + Folder path + + + + + + + + + +
        + +
        + + Property changes on: announcement/trunk/src/main/webapp/fckeditor/editor/filemanager/browser/default/frmactualfolder.html ___________________________________________________________________ Name: svn:eol-style + native Added: announcement/trunk/src/main/webapp/fckeditor/editor/filemanager/browser/default/frmcreatefolder.html =================================================================== --- announcement/trunk/src/main/webapp/fckeditor/editor/filemanager/browser/default/frmcreatefolder.html (rev 0) +++ announcement/trunk/src/main/webapp/fckeditor/editor/filemanager/browser/default/frmcreatefolder.html 2008-06-30 02:54:27 UTC (rev 1002) @@ -0,0 +1,114 @@ + + + + + Create Folder + + + + + + + + + + +
        + +
        + + Property changes on: announcement/trunk/src/main/webapp/fckeditor/editor/filemanager/browser/default/frmcreatefolder.html ___________________________________________________________________ Name: svn:eol-style + native Added: announcement/trunk/src/main/webapp/fckeditor/editor/filemanager/browser/default/frmfolders.html =================================================================== --- announcement/trunk/src/main/webapp/fckeditor/editor/filemanager/browser/default/frmfolders.html (rev 0) +++ announcement/trunk/src/main/webapp/fckeditor/editor/filemanager/browser/default/frmfolders.html 2008-06-30 02:54:27 UTC (rev 1002) @@ -0,0 +1,198 @@ + + + + + Folders + + + + + + + + + + + +
        + + Property changes on: announcement/trunk/src/main/webapp/fckeditor/editor/filemanager/browser/default/frmfolders.html ___________________________________________________________________ Name: svn:eol-style + native Added: announcement/trunk/src/main/webapp/fckeditor/editor/filemanager/browser/default/frmresourceslist.html =================================================================== --- announcement/trunk/src/main/webapp/fckeditor/editor/filemanager/browser/default/frmresourceslist.html (rev 0) +++ announcement/trunk/src/main/webapp/fckeditor/editor/filemanager/browser/default/frmresourceslist.html 2008-06-30 02:54:27 UTC (rev 1002) @@ -0,0 +1,169 @@ + + + + + Resources + + + + + + + + Property changes on: announcement/trunk/src/main/webapp/fckeditor/editor/filemanager/browser/default/frmresourceslist.html ___________________________________________________________________ Name: svn:eol-style + native Added: announcement/trunk/src/main/webapp/fckeditor/editor/filemanager/browser/default/frmresourcetype.html =================================================================== --- announcement/trunk/src/main/webapp/fckeditor/editor/filemanager/browser/default/frmresourcetype.html (rev 0) +++ announcement/trunk/src/main/webapp/fckeditor/editor/filemanager/browser/default/frmresourcetype.html 2008-06-30 02:54:27 UTC (rev 1002) @@ -0,0 +1,69 @@ + + + + + Available types + + + + + + + + + + +
        + Resource Type
        + +
        + + Property changes on: announcement/trunk/src/main/webapp/fckeditor/editor/filemanager/browser/default/frmresourcetype.html ___________________________________________________________________ Name: svn:eol-style + native Added: announcement/trunk/src/main/webapp/fckeditor/editor/filemanager/browser/default/frmupload.html =================================================================== --- announcement/trunk/src/main/webapp/fckeditor/editor/filemanager/browser/default/frmupload.html (rev 0) +++ announcement/trunk/src/main/webapp/fckeditor/editor/filemanager/browser/default/frmupload.html 2008-06-30 02:54:27 UTC (rev 1002) @@ -0,0 +1,115 @@ + + + + + File Upload + + + + + + +
        + + + + +
        + Upload a new file in this folder
        + + + + + +
         
        +
        +
        + + Property changes on: announcement/trunk/src/main/webapp/fckeditor/editor/filemanager/browser/default/frmupload.html ___________________________________________________________________ Name: svn:eol-style + native Added: announcement/trunk/src/main/webapp/fckeditor/editor/filemanager/browser/default/images/ButtonArrow.gif =================================================================== (Binary files differ) Property changes on: announcement/trunk/src/main/webapp/fckeditor/editor/filemanager/browser/default/images/ButtonArrow.gif ___________________________________________________________________ Name: svn:mime-type + application/octet-stream Added: announcement/trunk/src/main/webapp/fckeditor/editor/filemanager/browser/default/images/Folder.gif =================================================================== (Binary files differ) Property changes on: announcement/trunk/src/main/webapp/fckeditor/editor/filemanager/browser/default/images/Folder.gif ___________________________________________________________________ Name: svn:mime-type + application/octet-stream Added: announcement/trunk/src/main/webapp/fckeditor/editor/filemanager/browser/default/images/Folder32.gif =================================================================== (Binary files differ) Property changes on: announcement/trunk/src/main/webapp/fckeditor/editor/filemanager/browser/default/images/Folder32.gif ___________________________________________________________________ Name: svn:mime-type + application/octet-stream Added: announcement/trunk/src/main/webapp/fckeditor/editor/filemanager/browser/default/images/FolderOpened.gif =================================================================== (Binary files differ) Property changes on: announcement/trunk/src/main/webapp/fckeditor/editor/filemanager/browser/default/images/FolderOpened.gif ___________________________________________________________________ Name: svn:mime-type + application/octet-stream Added: announcement/trunk/src/main/webapp/fckeditor/editor/filemanager/browser/default/images/FolderOpened32.gif =================================================================== (Binary files differ) Property changes on: announcement/trunk/src/main/webapp/fckeditor/editor/filemanager/browser/default/images/FolderOpened32.gif ___________________________________________________________________ Name: svn:mime-type + application/octet-stream Added: announcement/trunk/src/main/webapp/fckeditor/editor/filemanager/browser/default/images/FolderUp.gif =================================================================== (Binary files differ) Property changes on: announcement/trunk/src/main/webapp/fckeditor/editor/filemanager/browser/default/images/FolderUp.gif ___________________________________________________________________ Name: svn:mime-type + application/octet-stream Added: announcement/trunk/src/main/webapp/fckeditor/editor/filemanager/browser/default/images/icons/32/ai.gif =================================================================== (Binary files differ) Property changes on: announcement/trunk/src/main/webapp/fckeditor/editor/filemanager/browser/default/images/icons/32/ai.gif ___________________________________________________________________ Name: svn:mime-type + application/octet-stream Added: announcement/trunk/src/main/webapp/fckeditor/editor/filemanager/browser/default/images/icons/32/avi.gif =================================================================== (Binary files differ) Property changes on: announcement/trunk/src/main/webapp/fckeditor/editor/filemanager/browser/default/images/icons/32/avi.gif ___________________________________________________________________ Name: svn:mime-type + application/octet-stream Added: announcement/trunk/src/main/webapp/fckeditor/editor/filemanager/browser/default/images/icons/32/bmp.gif =================================================================== (Binary files differ) Property changes on: announcement/trunk/src/main/webapp/fckeditor/editor/filemanager/browser/default/images/icons/32/bmp.gif ___________________________________________________________________ Name: svn:mime-type + application/octet-stream Added: announcement/trunk/src/main/webapp/fckeditor/editor/filemanager/browser/default/images/icons/32/cs.gif =================================================================== (Binary files differ) Property changes on: announcement/trunk/src/main/webapp/fckeditor/editor/filemanager/browser/default/images/icons/32/cs.gif ___________________________________________________________________ Name: svn:mime-type + application/octet-stream Added: announcement/trunk/src/main/webapp/fckeditor/editor/filemanager/browser/default/images/icons/32/default.icon.gif =================================================================== (Binary files differ) Property changes on: announcement/trunk/src/main/webapp/fckeditor/editor/filemanager/browser/default/images/icons/32/default.icon.gif ___________________________________________________________________ Name: svn:mime-type + application/octet-stream Added: announcement/trunk/src/main/webapp/fckeditor/editor/filemanager/browser/default/images/icons/32/dll.gif =================================================================== (Binary files differ) Property changes on: announcement/trunk/src/main/webapp/fckeditor/editor/filemanager/browser/default/images/icons/32/dll.gif ___________________________________________________________________ Name: svn:mime-type + application/octet-stream Added: announcement/trunk/src/main/webapp/fckeditor/editor/filemanager/browser/default/images/icons/32/doc.gif =================================================================== (Binary files differ) Property changes on: announcement/trunk/src/main/webapp/fckeditor/editor/filemanager/browser/default/images/icons/32/doc.gif ___________________________________________________________________ Name: svn:mime-type + application/octet-stream Added: announcement/trunk/src/main/webapp/fckeditor/editor/filemanager/browser/default/images/icons/32/exe.gif =================================================================== (Binary files differ) Property changes on: announcement/trunk/src/main/webapp/fckeditor/editor/filemanager/browser/default/images/icons/32/exe.gif ___________________________________________________________________ Name: svn:mime-type + application/octet-stream Added: announcement/trunk/src/main/webapp/fckeditor/editor/filemanager/browser/default/images/icons/32/fla.gif =================================================================== (Binary files differ) Property changes on: announcement/trunk/src/main/webapp/fckeditor/editor/filemanager/browser/default/images/icons/32/fla.gif ___________________________________________________________________ Name: svn:mime-type + application/octet-stream Added: announcement/trunk/src/main/webapp/fckeditor/editor/filemanager/browser/default/images/icons/32/gif.gif =================================================================== (Binary files differ) Property changes on: announcement/trunk/src/main/webapp/fckeditor/editor/filemanager/browser/default/images/icons/32/gif.gif ___________________________________________________________________ Name: svn:mime-type + application/octet-stream Added: announcement/trunk/src/main/webapp/fckeditor/editor/filemanager/browser/default/images/icons/32/htm.gif =================================================================== (Binary files differ) Property changes on: announcement/trunk/src/main/webapp/fckeditor/editor/filemanager/browser/default/images/icons/32/htm.gif ___________________________________________________________________ Name: svn:mime-type + application/octet-stream Added: announcement/trunk/src/main/webapp/fckeditor/editor/filemanager/browser/default/images/icons/32/html.gif =================================================================== (Binary files differ) Property changes on: announcement/trunk/src/main/webapp/fckeditor/editor/filemanager/browser/default/images/icons/32/html.gif ___________________________________________________________________ Name: svn:mime-type + application/octet-stream Added: announcement/trunk/src/main/webapp/fckeditor/editor/filemanager/browser/default/images/icons/32/jpg.gif =================================================================== (Binary files differ) Property changes on: announcement/trunk/src/main/webapp/fckeditor/editor/filemanager/browser/default/images/icons/32/jpg.gif ___________________________________________________________________ Name: svn:mime-type + application/octet-stream Added: announcement/trunk/src/main/webapp/fckeditor/editor/filemanager/browser/default/images/icons/32/js.gif =================================================================== (Binary files differ) Property changes on: announcement/trunk/src/main/webapp/fckeditor/editor/filemanager/browser/default/images/icons/32/js.gif ___________________________________________________________________ Name: svn:mime-type + application/octet-stream Added: announcement/trunk/src/main/webapp/fckeditor/editor/filemanager/browser/default/images/icons/32/mdb.gif =================================================================== (Binary files differ) Property changes on: announcement/trunk/src/main/webapp/fckeditor/editor/filemanager/browser/default/images/icons/32/mdb.gif ___________________________________________________________________ Name: svn:mime-type + application/octet-stream Added: announcement/trunk/src/main/webapp/fckeditor/editor/filemanager/browser/default/images/icons/32/mp3.gif =================================================================== (Binary files differ) Property changes on: announcement/trunk/src/main/webapp/fckeditor/editor/filemanager/browser/default/images/icons/32/mp3.gif ___________________________________________________________________ Name: svn:mime-type + application/octet-stream Added: announcement/trunk/src/main/webapp/fckeditor/editor/filemanager/browser/default/images/icons/32/pdf.gif =================================================================== (Binary files differ) Property changes on: announcement/trunk/src/main/webapp/fckeditor/editor/filemanager/browser/default/images/icons/32/pdf.gif ___________________________________________________________________ Name: svn:mime-type + application/octet-stream Added: announcement/trunk/src/main/webapp/fckeditor/editor/filemanager/browser/default/images/icons/32/png.gif =================================================================== (Binary files differ) Property changes on: announcement/trunk/src/main/webapp/fckeditor/editor/filemanager/browser/default/images/icons/32/png.gif ___________________________________________________________________ Name: svn:mime-type + application/octet-stream Added: announcement/trunk/src/main/webapp/fckeditor/editor/filemanager/browser/default/images/icons/32/ppt.gif =================================================================== (Binary files differ) Property changes on: announcement/trunk/src/main/webapp/fckeditor/editor/filemanager/browser/default/images/icons/32/ppt.gif ___________________________________________________________________ Name: svn:mime-type + application/octet-stream Added: announcement/trunk/src/main/webapp/fckeditor/editor/filemanager/browser/default/images/icons/32/rdp.gif =================================================================== (Binary files differ) Property changes on: announcement/trunk/src/main/webapp/fckeditor/editor/filemanager/browser/default/images/icons/32/rdp.gif ___________________________________________________________________ Name: svn:mime-type + application/octet-stream Added: announcement/trunk/src/main/webapp/fckeditor/editor/filemanager/browser/default/images/icons/32/swf.gif =================================================================== (Binary files differ) Property changes on: announcement/trunk/src/main/webapp/fckeditor/editor/filemanager/browser/default/images/icons/32/swf.gif ___________________________________________________________________ Name: svn:mime-type + application/octet-stream Added: announcement/trunk/src/main/webapp/fckeditor/editor/filemanager/browser/default/images/icons/32/swt.gif =================================================================== (Binary files differ) Property changes on: announcement/trunk/src/main/webapp/fckeditor/editor/filemanager/browser/default/images/icons/32/swt.gif ___________________________________________________________________ Name: svn:mime-type + application/octet-stream Added: announcement/trunk/src/main/webapp/fckeditor/editor/filemanager/browser/default/images/icons/32/txt.gif =================================================================== (Binary files differ) Property changes on: announcement/trunk/src/main/webapp/fckeditor/editor/filemanager/browser/default/images/icons/32/txt.gif ___________________________________________________________________ Name: svn:mime-type + application/octet-stream Added: announcement/trunk/src/main/webapp/fckeditor/editor/filemanager/browser/default/images/icons/32/vsd.gif =================================================================== (Binary files differ) Property changes on: announcement/trunk/src/main/webapp/fckeditor/editor/filemanager/browser/default/images/icons/32/vsd.gif ___________________________________________________________________ Name: svn:mime-type + application/octet-stream Added: announcement/trunk/src/main/webapp/fckeditor/editor/filemanager/browser/default/images/icons/32/xls.gif =================================================================== (Binary files differ) Property changes on: announcement/trunk/src/main/webapp/fckeditor/editor/filemanager/browser/default/images/icons/32/xls.gif ___________________________________________________________________ Name: svn:mime-type + application/octet-stream Added: announcement/trunk/src/main/webapp/fckeditor/editor/filemanager/browser/default/images/icons/32/xml.gif =================================================================== (Binary files differ) Property changes on: announcement/trunk/src/main/webapp/fckeditor/editor/filemanager/browser/default/images/icons/32/xml.gif ___________________________________________________________________ Name: svn:mime-type + application/octet-stream Added: announcement/trunk/src/main/webapp/fckeditor/editor/filemanager/browser/default/images/icons/32/zip.gif =================================================================== (Binary files differ) Property changes on: announcement/trunk/src/main/webapp/fckeditor/editor/filemanager/browser/default/images/icons/32/zip.gif ___________________________________________________________________ Name: svn:mime-type + application/octet-stream Added: announcement/trunk/src/main/webapp/fckeditor/editor/filemanager/browser/default/images/icons/ai.gif =================================================================== (Binary files differ) Property changes on: announcement/trunk/src/main/webapp/fckeditor/editor/filemanager/browser/default/images/icons/ai.gif ___________________________________________________________________ Name: svn:mime-type + application/octet-stream Added: announcement/trunk/src/main/webapp/fckeditor/editor/filemanager/browser/default/images/icons/avi.gif =================================================================== (Binary files differ) Property changes on: announcement/trunk/src/main/webapp/fckeditor/editor/filemanager/browser/default/images/icons/avi.gif ___________________________________________________________________ Name: svn:mime-type + application/octet-stream Added: announcement/trunk/src/main/webapp/fckeditor/editor/filemanager/browser/default/images/icons/bmp.gif =================================================================== (Binary files differ) Property changes on: announcement/trunk/src/main/webapp/fckeditor/editor/filemanager/browser/default/images/icons/bmp.gif ___________________________________________________________________ Name: svn:mime-type + application/octet-stream Added: announcement/trunk/src/main/webapp/fckeditor/editor/filemanager/browser/default/images/icons/cs.gif =================================================================== (Binary files differ) Property changes on: announcement/trunk/src/main/webapp/fckeditor/editor/filemanager/browser/default/images/icons/cs.gif ___________________________________________________________________ Name: svn:mime-type + application/octet-stream Added: announcement/trunk/src/main/webapp/fckeditor/editor/filemanager/browser/default/images/icons/default.icon.gif =================================================================== (Binary files differ) Property changes on: announcement/trunk/src/main/webapp/fckeditor/editor/filemanager/browser/default/images/icons/default.icon.gif ___________________________________________________________________ Name: svn:mime-type + application/octet-stream Added: announcement/trunk/src/main/webapp/fckeditor/editor/filemanager/browser/default/images/icons/dll.gif =================================================================== (Binary files differ) Property changes on: announcement/trunk/src/main/webapp/fckeditor/editor/filemanager/browser/default/images/icons/dll.gif ___________________________________________________________________ Name: svn:mime-type + application/octet-stream Added: announcement/trunk/src/main/webapp/fckeditor/editor/filemanager/browser/default/images/icons/doc.gif =================================================================== (Binary files differ) Property changes on: announcement/trunk/src/main/webapp/fckeditor/editor/filemanager/browser/default/images/icons/doc.gif ___________________________________________________________________ Name: svn:mime-type + application/octet-stream Added: announcement/trunk/src/main/webapp/fckeditor/editor/filemanager/browser/default/images/icons/exe.gif =================================================================== (Binary files differ) Property changes on: announcement/trunk/src/main/webapp/fckeditor/editor/filemanager/browser/default/images/icons/exe.gif ___________________________________________________________________ Name: svn:mime-type + application/octet-stream Added: announcement/trunk/src/main/webapp/fckeditor/editor/filemanager/browser/default/images/icons/fla.gif =================================================================== (Binary files differ) Property changes on: announcement/trunk/src/main/webapp/fckeditor/editor/filemanager/browser/default/images/icons/fla.gif ___________________________________________________________________ Name: svn:mime-type + application/octet-stream Added: announcement/trunk/src/main/webapp/fckeditor/editor/filemanager/browser/default/images/icons/gif.gif =================================================================== (Binary files differ) Property changes on: announcement/trunk/src/main/webapp/fckeditor/editor/filemanager/browser/default/images/icons/gif.gif ___________________________________________________________________ Name: svn:mime-type + application/octet-stream Added: announcement/trunk/src/main/webapp/fckeditor/editor/filemanager/browser/default/images/icons/htm.gif =================================================================== (Binary files differ) Property changes on: announcement/trunk/src/main/webapp/fckeditor/editor/filemanager/browser/default/images/icons/htm.gif ___________________________________________________________________ Name: svn:mime-type + application/octet-stream Added: announcement/trunk/src/main/webapp/fckeditor/editor/filemanager/browser/default/images/icons/html.gif =================================================================== (Binary files differ) Property changes on: announcement/trunk/src/main/webapp/fckeditor/editor/filemanager/browser/default/images/icons/html.gif ___________________________________________________________________ Name: svn:mime-type + application/octet-stream Added: announcement/trunk/src/main/webapp/fckeditor/editor/filemanager/browser/default/images/icons/jpg.gif =================================================================== (Binary files differ) Property changes on: announcement/trunk/src/main/webapp/fckeditor/editor/filemanager/browser/default/images/icons/jpg.gif ___________________________________________________________________ Name: svn:mime-type + application/octet-stream Added: announcement/trunk/src/main/webapp/fckeditor/editor/filemanager/browser/default/images/icons/js.gif =================================================================== (Binary files differ) Property changes on: announcement/trunk/src/main/webapp/fckeditor/editor/filemanager/browser/default/images/icons/js.gif ___________________________________________________________________ Name: svn:mime-type + application/octet-stream Added: announcement/trunk/src/main/webapp/fckeditor/editor/filemanager/browser/default/images/icons/mdb.gif =================================================================== (Binary files differ) Property changes on: announcement/trunk/src/main/webapp/fckeditor/editor/filemanager/browser/default/images/icons/mdb.gif ___________________________________________________________________ Name: svn:mime-type + application/octet-stream Added: announcement/trunk/src/main/webapp/fckeditor/editor/filemanager/browser/default/images/icons/mp3.gif =================================================================== (Binary files differ) Property changes on: announcement/trunk/src/main/webapp/fckeditor/editor/filemanager/browser/default/images/icons/mp3.gif ___________________________________________________________________ Name: svn:mime-type + application/octet-stream Added: announcement/trunk/src/main/webapp/fckeditor/editor/filemanager/browser/default/images/icons/pdf.gif =================================================================== (Binary files differ) Property changes on: announcement/trunk/src/main/webapp/fckeditor/editor/filemanager/browser/default/images/icons/pdf.gif ___________________________________________________________________ Name: svn:mime-type + application/octet-stream Added: announcement/trunk/src/main/webapp/fckeditor/editor/filemanager/browser/default/images/icons/png.gif =================================================================== (Binary files differ) Property changes on: announcement/trunk/src/main/webapp/fckeditor/editor/filemanager/browser/default/images/icons/png.gif ___________________________________________________________________ Name: svn:mime-type + application/octet-stream Added: announcement/trunk/src/main/webapp/fckeditor/editor/filemanager/browser/default/images/icons/ppt.gif =================================================================== (Binary files differ) Property changes on: announcement/trunk/src/main/webapp/fckeditor/editor/filemanager/browser/default/images/icons/ppt.gif ___________________________________________________________________ Name: svn:mime-type + application/octet-stream Added: announcement/trunk/src/main/webapp/fckeditor/editor/filemanager/browser/default/images/icons/rdp.gif =================================================================== (Binary files differ) Property changes on: announcement/trunk/src/main/webapp/fckeditor/editor/filemanager/browser/default/images/icons/rdp.gif ___________________________________________________________________ Name: svn:mime-type + application/octet-stream Added: announcement/trunk/src/main/webapp/fckeditor/editor/filemanager/browser/default/images/icons/swf.gif =================================================================== (Binary files differ) Property changes on: announcement/trunk/src/main/webapp/fckeditor/editor/filemanager/browser/default/images/icons/swf.gif ___________________________________________________________________ Name: svn:mime-type + application/octet-stream Added: announcement/trunk/src/main/webapp/fckeditor/editor/filemanager/browser/default/images/icons/swt.gif =================================================================== (Binary files differ) Property changes on: announcement/trunk/src/main/webapp/fckeditor/editor/filemanager/browser/default/images/icons/swt.gif ___________________________________________________________________ Name: svn:mime-type + application/octet-stream Added: announcement/trunk/src/main/webapp/fckeditor/editor/filemanager/browser/default/images/icons/txt.gif =================================================================== (Binary files differ) Property changes on: announcement/trunk/src/main/webapp/fckeditor/editor/filemanager/browser/default/images/icons/txt.gif ___________________________________________________________________ Name: svn:mime-type + application/octet-stream Added: announcement/trunk/src/main/webapp/fckeditor/editor/filemanager/browser/default/images/icons/vsd.gif =================================================================== (Binary files differ) Property changes on: announcement/trunk/src/main/webapp/fckeditor/editor/filemanager/browser/default/images/icons/vsd.gif ___________________________________________________________________ Name: svn:mime-type + application/octet-stream Added: announcement/trunk/src/main/webapp/fckeditor/editor/filemanager/browser/default/images/icons/xls.gif =================================================================== (Binary files differ) Property changes on: announcement/trunk/src/main/webapp/fckeditor/editor/filemanager/browser/default/images/icons/xls.gif ___________________________________________________________________ Name: svn:mime-type + application/octet-stream Added: announcement/trunk/src/main/webapp/fckeditor/editor/filemanager/browser/default/images/icons/xml.gif =================================================================== (Binary files differ) Property changes on: announcement/trunk/src/main/webapp/fckeditor/editor/filemanager/browser/default/images/icons/xml.gif ___________________________________________________________________ Name: svn:mime-type + application/octet-stream Added: announcement/trunk/src/main/webapp/fckeditor/editor/filemanager/browser/default/images/icons/zip.gif =================================================================== (Binary files differ) Property changes on: announcement/trunk/src/main/webapp/fckeditor/editor/filemanager/browser/default/images/icons/zip.gif ___________________________________________________________________ Name: svn:mime-type + application/octet-stream Added: announcement/trunk/src/main/webapp/fckeditor/editor/filemanager/browser/default/images/spacer.gif =================================================================== (Binary files differ) Property changes on: announcement/trunk/src/main/webapp/fckeditor/editor/filemanager/browser/default/images/spacer.gif ___________________________________________________________________ Name: svn:mime-type + application/octet-stream Added: announcement/trunk/src/main/webapp/fckeditor/editor/filemanager/browser/default/js/common.js =================================================================== --- announcement/trunk/src/main/webapp/fckeditor/editor/filemanager/browser/default/js/common.js (rev 0) +++ announcement/trunk/src/main/webapp/fckeditor/editor/filemanager/browser/default/js/common.js 2008-06-30 02:54:27 UTC (rev 1002) @@ -0,0 +1,88 @@ +?/* + * FCKeditor - The text editor for Internet - http://www.fckeditor.net + * Copyright (C) 2003-2008 Frederico Caldeira Knabben + * + * == BEGIN LICENSE == + * + * Licensed under the terms of any of the following licenses at your + * choice: + * + * - GNU General Public License Version 2 or later (the "GPL") + * http://www.gnu.org/licenses/gpl.html + * + * - GNU Lesser General Public License Version 2.1 or later (the "LGPL") + * http://www.gnu.org/licenses/lgpl.html + * + * - Mozilla Public License Version 1.1 or later (the "MPL") + * http://www.mozilla.org/MPL/MPL-1.1.html + * + * == END LICENSE == + * + * Common objects and functions shared by all pages that compose the + * File Browser dialog window. + */ + +// Automatically detect the correct document.domain (#1919). +(function() +{ + var d = document.domain ; + + while ( true ) + { + // Test if we can access a parent property. + try + { + var test = window.top.opener.document.domain ; + break ; + } + catch( e ) + {} + + // Remove a domain part: www.mytest.example.com => mytest.example.com => example.com ... + d = d.replace( /.*?(?:\.|$)/, '' ) ; + + if ( d.length == 0 ) + break ; // It was not able to detect the domain. + + try + { + document.domain = d ; + } + catch (e) + { + break ; + } + } +})() ; + +function AddSelectOption( selectElement, optionText, optionValue ) +{ + var oOption = document.createElement("OPTION") ; + + oOption.text = optionText ; + oOption.value = optionValue ; + + selectElement.options.add(oOption) ; + + return oOption ; +} + +var oConnector = window.parent.oConnector ; +var oIcons = window.parent.oIcons ; + + +function StringBuilder( value ) +{ + this._Strings = new Array( value || '' ) ; +} + +StringBuilder.prototype.Append = function( value ) +{ + if ( value ) + this._Strings.push( value ) ; +} + +StringBuilder.prototype.ToString = function() +{ + return this._Strings.join( '' ) ; +} Property changes on: announcement/trunk/src/main/webapp/fckeditor/editor/filemanager/browser/default/js/common.js ___________________________________________________________________ Name: svn:eol-style + native Added: announcement/trunk/src/main/webapp/fckeditor/editor/filemanager/browser/default/js/fckxml.js =================================================================== --- announcement/trunk/src/main/webapp/fckeditor/editor/filemanager/browser/default/js/fckxml.js (rev 0) +++ announcement/trunk/src/main/webapp/fckeditor/editor/filemanager/browser/default/js/fckxml.js 2008-06-30 02:54:27 UTC (rev 1002) @@ -0,0 +1,147 @@ +?/* + * FCKeditor - The text editor for Internet - http://www.fckeditor.net + * Copyright (C) 2003-2008 Frederico Caldeira Knabben + * + * == BEGIN LICENSE == + * + * Licensed under the terms of any of the following licenses at your + * choice: + * + * - GNU General Public License Version 2 or later (the "GPL") + * http://www.gnu.org/licenses/gpl.html + * + * - GNU Lesser General Public License Version 2.1 or later (the "LGPL") + * http://www.gnu.org/licenses/lgpl.html + * + * - Mozilla Public License Version 1.1 or later (the "MPL") + * http://www.mozilla.org/MPL/MPL-1.1.html + * + * == END LICENSE == + * + * Defines the FCKXml object that is used for XML data calls + * and XML processing. + * + * This script is shared by almost all pages that compose the + * File Browser frameset. + */ + +var FCKXml = function() +{} + +FCKXml.prototype.GetHttpRequest = function() +{ + // Gecko / IE7 + try { return new XMLHttpRequest(); } + catch(e) {} + + // IE6 + try { return new ActiveXObject( 'Msxml2.XMLHTTP' ) ; } + catch(e) {} + + // IE5 + try { return new ActiveXObject( 'Microsoft.XMLHTTP' ) ; } + catch(e) {} + + return null ; +} + +FCKXml.prototype.LoadUrl = function( urlToCall, asyncFunctionPointer ) +{ + var oFCKXml = this ; + + var bAsync = ( typeof(asyncFunctionPointer) == 'function' ) ; + + var oXmlHttp = this.GetHttpRequest() ; + + oXmlHttp.open( "GET", urlToCall, bAsync ) ; + + if ( bAsync ) + { + oXmlHttp.onreadystatechange = function() + { + if ( oXmlHttp.readyState == 4 ) + { + var oXml ; + try + { + // this is the same test for an FF2 bug as in fckxml_gecko.js + // but we've moved the responseXML assignment into the try{} + // so we don't even have to check the return status codes. + var test = oXmlHttp.responseXML.firstChild ; + oXml = oXmlHttp.responseXML ; + } + catch ( e ) + { + try + { + oXml = (new DOMParser()).parseFromString( oXmlHttp.responseText, 'text/xml' ) ; + } + catch ( e ) {} + } + + if ( !oXml || !oXml.firstChild || oXml.firstChild.nodeName == 'parsererror' ) + { + alert( 'The server didn\'t send back a proper XML response. Please contact your system administrator.\n\n' + + 'XML request error: ' + oXmlHttp.statusText + ' (' + oXmlHttp.status + ')\n\n' + + 'Requested URL:\n' + urlToCall + '\n\n' + + 'Response text:\n' + oXmlHttp.responseText ) ; + return ; + } + + oFCKXml.DOMDocument = oXml ; + asyncFunctionPointer( oFCKXml ) ; + } + } + } + + oXmlHttp.send( null ) ; + + if ( ! bAsync ) + { + if ( oXmlHttp.status == 200 || oXmlHttp.status == 304 ) + this.DOMDocument = oXmlHttp.responseXML ; + else + { + alert( 'XML request error: ' + oXmlHttp.statusText + ' (' + oXmlHttp.status + ')' ) ; + } + } +} + +FCKXml.prototype.SelectNodes = function( xpath ) +{ + if ( navigator.userAgent.indexOf('MSIE') >= 0 ) // IE + return this.DOMDocument.selectNodes( xpath ) ; + else // Gecko + { + var aNodeArray = new Array(); + + var xPathResult = this.DOMDocument.evaluate( xpath, this.DOMDocument, + this.DOMDocument.createNSResolver(this.DOMDocument.documentElement), XPathResult.ORDERED_NODE_ITERATOR_TYPE, null) ; + if ( xPathResult ) + { + var oNode = xPathResult.iterateNext() ; + while( oNode ) + { + aNodeArray[aNodeArray.length] = oNode ; + oNode = xPathResult.iterateNext(); + } + } + return aNodeArray ; + } +} + +FCKXml.prototype.SelectSingleNode = function( xpath ) +{ + if ( navigator.userAgent.indexOf('MSIE') >= 0 ) // IE + return this.DOMDocument.selectSingleNode( xpath ) ; + else // Gecko + { + var xPathResult = this.DOMDocument.evaluate( xpath, this.DOMDocument, + this.DOMDocument.createNSResolver(this.DOMDocument.documentElement), 9, null); + + if ( xPathResult && xPathResult.singleNodeValue ) + return xPathResult.singleNodeValue ; + else + return null ; + } +} Property changes on: announcement/trunk/src/main/webapp/fckeditor/editor/filemanager/browser/default/js/fckxml.js ___________________________________________________________________ Name: svn:eol-style + native Added: announcement/trunk/src/main/webapp/fckeditor/editor/filemanager/connectors/asp/basexml.asp =================================================================== --- announcement/trunk/src/main/webapp/fckeditor/editor/filemanager/connectors/asp/basexml.asp (rev 0) +++ announcement/trunk/src/main/webapp/fckeditor/editor/filemanager/connectors/asp/basexml.asp 2008-06-30 02:54:27 UTC (rev 1002) @@ -0,0 +1,63 @@ +?<% + ' FCKeditor - The text editor for Internet - http://www.fckeditor.net + ' Copyright (C) 2003-2008 Frederico Caldeira Knabben + ' + ' == BEGIN LICENSE == + ' + ' Licensed under the terms of any of the following licenses at your + ' choice: + ' + ' - GNU General Public License Version 2 or later (the "GPL") + ' http://www.gnu.org/licenses/gpl.html + ' + ' - GNU Lesser General Public License Version 2.1 or later (the "LGPL") + ' http://www.gnu.org/licenses/lgpl.html + ' + ' - Mozilla Public License Version 1.1 or later (the "MPL") + ' http://www.mozilla.org/MPL/MPL-1.1.html + ' + ' == END LICENSE == + ' + ' This file include the functions that create the base XML output. +%> +<% + +Sub SetXmlHeaders() + ' Cleans the response buffer. + Response.Clear() + + ' Prevent the browser from caching the result. + Response.CacheControl = "no-cache" + + ' Set the response format. + Response.CodePage = 65001 + Response.CharSet = "UTF-8" + Response.ContentType = "text/xml" +End Sub + +Sub CreateXmlHeader( command, resourceType, currentFolder, url ) + ' Create the XML document header. + Response.Write "" + + ' Create the main "Connector" node. + Response.Write "" + + ' Add the current folder node. + Response.Write "" +End Sub + +Sub CreateXmlFooter() + Response.Write "" +End Sub + +Sub SendError( number, text ) + SetXmlHeaders + + ' Create the XML document header. + Response.Write "" + + Response.Write "" + + Response.End +End Sub +%> Added: announcement/trunk/src/main/webapp/fckeditor/editor/filemanager/connectors/asp/class_upload.asp =================================================================== --- announcement/trunk/src/main/webapp/fckeditor/editor/filemanager/connectors/asp/class_upload.asp (rev 0) +++ announcement/trunk/src/main/webapp/fckeditor/editor/filemanager/connectors/asp/class_upload.asp 2008-06-30 02:54:27 UTC (rev 1002) @@ -0,0 +1,353 @@ +?<% + ' FCKeditor - The text editor for Internet - http://www.fckeditor.net + ' Copyright (C) 2003-2008 Frederico Caldeira Knabben + ' + ' == BEGIN LICENSE == + ' + ' Licensed under the terms of any of the following licenses at your + ' choice: + ' + ' - GNU General Public License Version 2 or later (the "GPL") + ' http://www.gnu.org/licenses/gpl.html + ' + ' - GNU Lesser General Public License Version 2.1 or later (the "LGPL") + ' http://www.gnu.org/licenses/lgpl.html + ' + ' - Mozilla Public License Version 1.1 or later (the "MPL") + ' http://www.mozilla.org/MPL/MPL-1.1.html + ' + ' == END LICENSE == + ' + ' These are the classes used to handle ASP upload without using third + ' part components (OCX/DLL). +%> +<% +'********************************************** +' File: NetRube_Upload.asp +' Version: NetRube Upload Class Version 2.3 Build 20070528 +' Author: NetRube +' Email: NetRube @ 126.com +' Date: 05/28/2007 +' Comments: The code for the Upload. +' This can free usage, but please +' not to delete this copyright information. +' If you have a modification version, +' Please send out a duplicate to me. +'********************************************** +' 文件名: NetRube_Upload.asp +' 版本: NetRube Upload Class Version 2.3 Build 20070528 +' 作者: NetRube(网??巴佬) +' ?子?件: NetRube @ 126.com +' 日期: 2007年05月28日 +' 声明: 文件上?? +' 本上??可以自由使用,但?保留此版?声明信息 +' 如果您?本上???行修改??, +' ??送一份?俺。 +'********************************************** + +Class NetRube_Upload + + Public File, Form + Private oSourceData + Private nMaxSize, nErr, sAllowed, sDenied, sHtmlExtensions + + Private Sub Class_Initialize + nErr = 0 + nMaxSize = 1048576 + + Set File = Server.CreateObject("Scripting.Dictionary") + File.CompareMode = 1 + Set Form = Server.CreateObject("Scripting.Dictionary") + Form.CompareMode = 1 + + Set oSourceData = Server.CreateObject("ADODB.Stream") + oSourceData.Type = 1 + oSourceData.Mode = 3 + oSourceData.Open + End Sub + + Private Sub Class_Terminate + Form.RemoveAll + Set Form = Nothing + File.RemoveAll + Set File = Nothing + + oSourceData.Close + Set oSourceData = Nothing + End Sub + + Public Property Get Version + Version = "NetRube Upload Class Version 2.3 Build 20070528" + End Property + + Public Property Get ErrNum + ErrNum = nErr + End Property + + Public Property Let MaxSize(nSize) + nMaxSize = nSize + End Property + + Public Property Let Allowed(sExt) + sAllowed = sExt + End Property + + Public Property Let Denied(sExt) + sDenied = sExt + End Property + + Public Property Let HtmlExtensions(sExt) + sHtmlExtensions = sExt + End Property + + Public Sub GetData + Dim aCType + aCType = Split(Request.ServerVariables("HTTP_CONTENT_TYPE"), ";") + if ( uBound(aCType) < 0 ) then + nErr = 1 + Exit Sub + end if + If aCType(0) <> "multipart/form-data" Then + nErr = 1 + Exit Sub + End If + + Dim nTotalSize + nTotalSize = Request.TotalBytes + If nTotalSize < 1 Then + nErr = 2 + Exit Sub + End If + If nMaxSize > 0 And nTotalSize > nMaxSize Then + nErr = 3 + Exit Sub + End If + + 'Thankful long(yrl031715 @ 163.com) + 'Fix upload large file. + '********************************************** + ' 修正作者:long + ' ?系?件: yrl031715 @ 163.com + ' 修正??:2007年5月6日 + ' 修正?明:由于iis6的Content-Length ?信息中包含的?求?度超?了 AspMaxRequestEntityAllowed 的?(默?200K), IIS 将返回一个 403 ??信息. + ' 直接?致在iis6下??FCKeditor上?功能?,一旦文件超?200K,上?文件?文件管理器失去响?,受此影响,文件的快速上?功能也存在在缺陷。 + ' 在参考 宝玉 的 Asp无?件上???度条 演示程序后作出如下修改,以修正在iis6下的??。 + + Dim nTotalBytes, nPartBytes, ReadBytes + ReadBytes = 0 + nTotalBytes = Request.TotalBytes + '循?分??取 + Do While ReadBytes < nTotalBytes + '分??取 + nPartBytes = 64 * 1024 '分成??64k + If nPartBytes + ReadBytes > nTotalBytes Then + nPartBytes = nTotalBytes - ReadBytes + End If + oSourceData.Write Request.BinaryRead(nPartBytes) + ReadBytes = ReadBytes + nPartBytes + Loop + '********************************************** + oSourceData.Position = 0 + + Dim oTotalData, oFormStream, sFormHeader, sFormName, bCrLf, nBoundLen, nFormStart, nFormEnd, nPosStart, nPosEnd, sBoundary + + oTotalData = oSourceData.Read + bCrLf = ChrB(13) & ChrB(10) + sBoundary = MidB(oTotalData, 1, InStrB(1, oTotalData, bCrLf) - 1) + nBoundLen = LenB(sBoundary) + 2 + nFormStart = nBoundLen + + Set oFormStream = Server.CreateObject("ADODB.Stream") + + Do While (nFormStart + 2) < nTotalSize + nFormEnd = InStrB(nFormStart, oTotalData, bCrLf & bCrLf) + 3 + + With oFormStream + .Type = 1 + .Mode = 3 + .Open + oSourceData.Position = nFormStart + oSourceData.CopyTo oFormStream, nFormEnd - nFormStart + .Position = 0 + .Type = 2 + .CharSet = "UTF-8" + sFormHeader = .ReadText + .Close + End With + + nFormStart = InStrB(nFormEnd, oTotalData, sBoundary) - 1 + nPosStart = InStr(22, sFormHeader, " name=", 1) + 7 + nPosEnd = InStr(nPosStart, sFormHeader, """") + sFormName = Mid(sFormHeader, nPosStart, nPosEnd - nPosStart) + + If InStr(45, sFormHeader, " filename=", 1) > 0 Then + Set File(sFormName) = New NetRube_FileInfo + File(sFormName).FormName = sFormName + File(sFormName).Start = nFormEnd + File(sFormName).Size = nFormStart - nFormEnd - 2 + nPosStart = InStr(nPosEnd, sFormHeader, " filename=", 1) + 11 + nPosEnd = InStr(nPosStart, sFormHeader, """") + File(sFormName).ClientPath = Mid(sFormHeader, nPosStart, nPosEnd - nPosStart) + File(sFormName).Name = Mid(File(sFormName).ClientPath, InStrRev(File(sFormName).ClientPath, "\") + 1) + File(sFormName).Ext = LCase(Mid(File(sFormName).Name, InStrRev(File(sFormName).Name, ".") + 1)) + nPosStart = InStr(nPosEnd, sFormHeader, "Content-Type: ", 1) + 14 + nPosEnd = InStr(nPosStart, sFormHeader, vbCr) + File(sFormName).MIME = Mid(sFormHeader, nPosStart, nPosEnd - nPosStart) + Else + With oFormStream + .Type = 1 + .Mode = 3 + .Open + oSourceData.Position = nFormEnd + oSourceData.CopyTo oFormStream, nFormStart - nFormEnd - 2 + .Position = 0 + .Type = 2 + .CharSet = "UTF-8" + Form(sFormName) = .ReadText + .Close + End With + End If + + nFormStart = nFormStart + nBoundLen + Loop + + oTotalData = "" + Set oFormStream = Nothing + End Sub + + Public Sub SaveAs(sItem, sFileName) + If File(sItem).Size < 1 Then + nErr = 2 + Exit Sub + End If + + If Not IsAllowed(File(sItem).Ext) Then + nErr = 4 + Exit Sub + End If + + If InStr( LCase( sFileName ), "::$data" ) > 0 Then + nErr = 4 + Exit Sub + End If + + Dim sFileExt, iFileSize + sFileExt = File(sItem).Ext + iFileSize = File(sItem).Size + + ' Check XSS. + If Not IsHtmlExtension( sFileExt ) Then + ' Calculate the size of data to load (max 1Kb). + Dim iXSSSize + iXSSSize = iFileSize + + If iXSSSize > 1024 Then + iXSSSize = 1024 + End If + + ' Read the data. + Dim sData + oSourceData.Position = File(sItem).Start + sData = oSourceData.Read( iXSSSize ) ' Byte Array + sData = ByteArray2Text( sData ) ' String + + ' Sniff HTML data. + If SniffHtml( sData ) Then + nErr = 4 + Exit Sub + End If + End If + + Dim oFileStream + Set oFileStream = Server.CreateObject("ADODB.Stream") + With oFileStream + .Type = 1 + .Mode = 3 + .Open + oSourceData.Position = File(sItem).Start + oSourceData.CopyTo oFileStream, File(sItem).Size + .Position = 0 + .SaveToFile sFileName, 2 + .Close + End With + Set oFileStream = Nothing + End Sub + + Private Function IsAllowed(sExt) + Dim oRE + Set oRE = New RegExp + oRE.IgnoreCase = True + oRE.Global = True + + If sDenied = "" Then + oRE.Pattern = sAllowed + IsAllowed = (sAllowed = "") Or oRE.Test(sExt) + Else + oRE.Pattern = sDenied + IsAllowed = Not oRE.Test(sExt) + End If + + Set oRE = Nothing + End Function + + Private Function IsHtmlExtension( sExt ) + If sHtmlExtensions = "" Then + Exit Function + End If + + Dim oRE + Set oRE = New RegExp + oRE.IgnoreCase = True + oRE.Global = True + oRE.Pattern = sHtmlExtensions + + IsHtmlExtension = oRE.Test(sExt) + + Set oRE = Nothing + End Function + + Private Function SniffHtml( sData ) + + Dim oRE + Set oRE = New RegExp + oRE.IgnoreCase = True + oRE.Global = True + + Dim aPatterns + aPatterns = Array( " Added: announcement/trunk/src/main/webapp/fckeditor/editor/filemanager/connectors/asp/commands.asp =================================================================== --- announcement/trunk/src/main/webapp/fckeditor/editor/filemanager/connectors/asp/commands.asp (rev 0) +++ announcement/trunk/src/main/webapp/fckeditor/editor/filemanager/connectors/asp/commands.asp 2008-06-30 02:54:27 UTC (rev 1002) @@ -0,0 +1,198 @@ +?<% + ' FCKeditor - The text editor for Internet - http://www.fckeditor.net + ' Copyright (C) 2003-2008 Frederico Caldeira Knabben + ' + ' == BEGIN LICENSE == + ' + ' Licensed under the terms of any of the following licenses at your + ' choice: + ' + ' - GNU General Public License Version 2 or later (the "GPL") + ' http://www.gnu.org/licenses/gpl.html + ' + ' - GNU Lesser General Public License Version 2.1 or later (the "LGPL") + ' http://www.gnu.org/licenses/lgpl.html + ' + ' - Mozilla Public License Version 1.1 or later (the "MPL") + ' http://www.mozilla.org/MPL/MPL-1.1.html + ' + ' == END LICENSE == + ' + ' This file include the functions that handle the Command requests + ' in the ASP Connector. +%> +<% +Sub GetFolders( resourceType, currentFolder ) + ' Map the virtual path to the local server path. + Dim sServerDir + sServerDir = ServerMapFolder( resourceType, currentFolder, "GetFolders" ) + + ' Open the "Folders" node. + Response.Write "" + + Dim oFSO, oCurrentFolder, oFolders, oFolder + Set oFSO = Server.CreateObject( "Scripting.FileSystemObject" ) + if not (oFSO.FolderExists( sServerDir ) ) then + Set oFSO = Nothing + SendError 102, currentFolder + end if + + Set oCurrentFolder = oFSO.GetFolder( sServerDir ) + Set oFolders = oCurrentFolder.SubFolders + + For Each oFolder in oFolders + Response.Write "" + Next + + Set oFSO = Nothing + + ' Close the "Folders" node. + Response.Write "" +End Sub + +Sub GetFoldersAndFiles( resourceType, currentFolder ) + ' Map the virtual path to the local server path. + Dim sServerDir + sServerDir = ServerMapFolder( resourceType, currentFolder, "GetFoldersAndFiles" ) + + Dim oFSO, oCurrentFolder, oFolders, oFolder, oFiles, oFile + Set oFSO = Server.CreateObject( "Scripting.FileSystemObject" ) + if not (oFSO.FolderExists( sServerDir ) ) then + Set oFSO = Nothing + SendError 102, currentFolder + end if + + Set oCurrentFolder = oFSO.GetFolder( sServerDir ) + Set oFolders = oCurrentFolder.SubFolders + Set oFiles = oCurrentFolder.Files + + ' Open the "Folders" node. + Response.Write "" + + For Each oFolder in oFolders + Response.Write "" + Next + + ' Close the "Folders" node. + Response.Write "" + + ' Open the "Files" node. + Response.Write "" + + For Each oFile in oFiles + Dim iFileSize + iFileSize = Round( oFile.size / 1024 ) + If ( iFileSize < 1 AND oFile.size <> 0 ) Then iFileSize = 1 + + Response.Write "" + Next + + ' Close the "Files" node. + Response.Write "" +End Sub + +Sub CreateFolder( resourceType, currentFolder ) + Dim sErrorNumber + + Dim sNewFolderName + sNewFolderName = Request.QueryString( "NewFolderName" ) + sNewFolderName = SanitizeFolderName( sNewFolderName ) + + If ( sNewFolderName = "" OR InStr( 1, sNewFolderName, ".." ) > 0 ) Then + sErrorNumber = "102" + Else + ' Map the virtual path to the local server path of the current folder. + Dim sServerDir + sServerDir = ServerMapFolder( resourceType, CombineLocalPaths(currentFolder, sNewFolderName), "CreateFolder" ) + + On Error Resume Next + + CreateServerFolder sServerDir + + Dim iErrNumber, sErrDescription + iErrNumber = err.number + sErrDescription = err.Description + + On Error Goto 0 + + Select Case iErrNumber + Case 0 + sErrorNumber = "0" + Case 52 + sErrorNumber = "102" ' Invalid Folder Name. + Case 70 + sErrorNumber = "103" ' Security Error. + Case 76 + sErrorNumber = "102" ' Path too long. + Case Else + sErrorNumber = "110" + End Select + End If + + ' Create the "Error" node. + Response.Write "" +End Sub + +Sub FileUpload( resourceType, currentFolder, sCommand ) + Dim oUploader + Set oUploader = New NetRube_Upload + oUploader.MaxSize = 0 + oUploader.Allowed = ConfigAllowedExtensions.Item( resourceType ) + oUploader.Denied = ConfigDeniedExtensions.Item( resourceType ) + oUploader.HtmlExtensions = ConfigHtmlExtensions + oUploader.GetData + + Dim sErrorNumber + sErrorNumber = "0" + + Dim sFileName, sOriginalFileName, sExtension + sFileName = "" + + If oUploader.ErrNum > 0 Then + sErrorNumber = "202" + Else + ' Map the virtual path to the local server path. + Dim sServerDir + sServerDir = ServerMapFolder( resourceType, currentFolder, sCommand ) + + Dim oFSO + Set oFSO = Server.CreateObject( "Scripting.FileSystemObject" ) + if not (oFSO.FolderExists( sServerDir ) ) then + sErrorNumber = "102" + else + ' Get the uploaded file name. + sFileName = oUploader.File( "NewFile" ).Name + sExtension = oUploader.File( "NewFile" ).Ext + sFileName = SanitizeFileName( sFileName ) + sOriginalFileName = sFileName + + Dim iCounter + iCounter = 0 + + Do While ( True ) + Dim sFilePath + sFilePath = CombineLocalPaths(sServerDir, sFileName) + + If ( oFSO.FileExists( sFilePath ) ) Then + iCounter = iCounter + 1 + sFileName = RemoveExtension( sOriginalFileName ) & "(" & iCounter & ")." & sExtension + sErrorNumber = "201" + Else + oUploader.SaveAs "NewFile", sFilePath + If oUploader.ErrNum > 0 Then sErrorNumber = "202" + Exit Do + End If + Loop + end if + End If + + Set oUploader = Nothing + + dim sFileUrl + sFileUrl = CombinePaths( GetResourceTypePath( resourceType, sCommand ) , currentFolder ) + sFileUrl = CombinePaths( sFileUrl, sFileName ) + + SendUploadResults sErrorNumber, sFileUrl, sFileName, "" +End Sub + +%> Added: announcement/trunk/src/main/webapp/fckeditor/editor/filemanager/connectors/asp/config.asp =================================================================== --- announcement/trunk/src/main/webapp/fckeditor/editor/filemanager/connectors/asp/config.asp (rev 0) +++ announcement/trunk/src/main/webapp/fckeditor/editor/filemanager/connectors/asp/config.asp 2008-06-30 02:54:27 UTC (rev 1002) @@ -0,0 +1,128 @@ +?<% + ' FCKeditor - The text editor for Internet - http://www.fckeditor.net + ' Copyright (C) 2003-2008 Frederico Caldeira Knabben + ' + ' == BEGIN LICENSE == + ' + ' Licensed under the terms of any of the following licenses at your + ' choice: + ' + ' - GNU General Public License Version 2 or later (the "GPL") + ' http://www.gnu.org/licenses/gpl.html + ' + ' - GNU Lesser General Public License Version 2.1 or later (the "LGPL") + ' http://www.gnu.org/licenses/lgpl.html + ' + ' - Mozilla Public License Version 1.1 or later (the "MPL") + ' http://www.mozilla.org/MPL/MPL-1.1.html + ' + ' == END LICENSE == + ' + ' Configuration file for the File Manager Connector for ASP. +%> +<% + +' SECURITY: You must explicitly enable this "connector" (set it to "True"). +' WARNING: don't just set "ConfigIsEnabled = true", you must be sure that only +' authenticated users can access this file or use some kind of session checking. +Dim ConfigIsEnabled +ConfigIsEnabled = False + +' Path to user files relative to the document root. +' This setting is preserved only for backward compatibility. +' You should look at the settings for each resource type to get the full potential +Dim ConfigUserFilesPath +ConfigUserFilesPath = "/userfiles/" + +' Due to security issues with Apache modules, it is recommended to leave the +' following setting enabled. +Dim ConfigForceSingleExtension +ConfigForceSingleExtension = true + +' What the user can do with this connector +Dim ConfigAllowedCommands +ConfigAllowedCommands = "QuickUpload|FileUpload|GetFolders|GetFoldersAndFiles|CreateFolder" + +' Allowed Resource Types +Dim ConfigAllowedTypes +ConfigAllowedTypes = "File|Image|Flash|Media" + +' For security, HTML is allowed in the first Kb of data for files having the +' following extensions only. +Dim ConfigHtmlExtensions +ConfigHtmlExtensions = "html|htm|xml|xsd|txt|js" +' +' Configuration settings for each Resource Type +' +' - AllowedExtensions: the possible extensions that can be allowed. +' If it is empty then any file type can be uploaded. +' +' - DeniedExtensions: The extensions that won't be allowed. +' If it is empty then no restrictions are done here. +' +' For a file to be uploaded it has to fulfill both the AllowedExtensions +' and DeniedExtensions (that's it: not being denied) conditions. +' +' - FileTypesPath: the virtual folder relative to the document root where +' these resources will be located. +' Attention: It must start and end with a slash: '/' +' +' - FileTypesAbsolutePath: the physical path to the above folder. It must be +' an absolute path. +' If it's an empty string then it will be autocalculated. +' Useful if you are using a virtual directory, symbolic link or alias. +' Examples: 'C:\\MySite\\userfiles\\' or '/root/mysite/userfiles/'. +' Attention: The above 'FileTypesPath' must point to the same directory. +' Attention: It must end with a slash: '/' +' +' - QuickUploadPath: the virtual folder relative to the document root where +' these resources will be uploaded using the Upload tab in the resources +' dialogs. +' Attention: It must start and end with a slash: '/' +' +' - QuickUploadAbsolutePath: the physical path to the above folder. It must be +' an absolute path. +' If it's an empty string then it will be autocalculated. +' Useful if you are using a virtual directory, symbolic link or alias. +' Examples: 'C:\\MySite\\userfiles\\' or '/root/mysite/userfiles/'. +' Attention: The above 'QuickUploadPath' must point to the same directory. +' Attention: It must end with a slash: '/' +' + +Dim ConfigAllowedExtensions, ConfigDeniedExtensions, ConfigFileTypesPath, ConfigFileTypesAbsolutePath, ConfigQuickUploadPath, ConfigQuickUploadAbsolutePath +Set ConfigAllowedExtensions = CreateObject( "Scripting.Dictionary" ) +Set ConfigDeniedExtensions = CreateObject( "Scripting.Dictionary" ) +Set ConfigFileTypesPath = CreateObject( "Scripting.Dictionary" ) +Set ConfigFileTypesAbsolutePath = CreateObject( "Scripting.Dictionary" ) +Set ConfigQuickUploadPath = CreateObject( "Scripting.Dictionary" ) +Set ConfigQuickUploadAbsolutePath = CreateObject( "Scripting.Dictionary" ) + +ConfigAllowedExtensions.Add "File", "7z|aiff|asf|avi|bmp|csv|doc|fla|flv|gif|gz|gzip|jpeg|jpg|mid|mov|mp3|mp4|mpc|mpeg|mpg|ods|odt|pdf|png|ppt|pxd|qt|ram|rar|rm|rmi|rmvb|rtf|sdc|sitd|swf|sxc|sxw|tar|tgz|tif|tiff|txt|vsd|wav|wma|wmv|xls|xml|zip" +ConfigDeniedExtensions.Add "File", "" +ConfigFileTypesPath.Add "File", ConfigUserFilesPath & "file/" +ConfigFileTypesAbsolutePath.Add "File", "" +ConfigQuickUploadPath.Add "File", ConfigUserFilesPath +ConfigQuickUploadAbsolutePath.Add "File", "" + +ConfigAllowedExtensions.Add "Image", "bmp|gif|jpeg|jpg|png" +ConfigDeniedExtensions.Add "Image", "" +ConfigFileTypesPath.Add "Image", ConfigUserFilesPath & "image/" +ConfigFileTypesAbsolutePath.Add "Image", "" +ConfigQuickUploadPath.Add "Image", ConfigUserFilesPath +ConfigQuickUploadAbsolutePath.Add "Image", "" + +ConfigAllowedExtensions.Add "Flash", "swf|flv" +ConfigDeniedExtensions.Add "Flash", "" +ConfigFileTypesPath.Add "Flash", ConfigUserFilesPath & "flash/" +ConfigFileTypesAbsolutePath.Add "Flash", "" +ConfigQuickUploadPath.Add "Flash", ConfigUserFilesPath +ConfigQuickUploadAbsolutePath.Add "Flash", "" + +ConfigAllowedExtensions.Add "Media", "aiff|asf|avi|bmp|fla|flv|gif|jpeg|jpg|mid|mov|mp3|mp4|mpc|mpeg|mpg|png|qt|ram|rm|rmi|rmvb|swf|tif|tiff|wav|wma|wmv" +ConfigDeniedExtensions.Add "Media", "" +ConfigFileTypesPath.Add "Media", ConfigUserFilesPath & "media/" +ConfigFileTypesAbsolutePath.Add "Media", "" +ConfigQuickUploadPath.Add "Media", ConfigUserFilesPath +ConfigQuickUploadAbsolutePath.Add "Media", "" + +%> Added: announcement/trunk/src/main/webapp/fckeditor/editor/filemanager/connectors/asp/connector.asp =================================================================== --- announcement/trunk/src/main/webapp/fckeditor/editor/filemanager/connectors/asp/connector.asp (rev 0) +++ announcement/trunk/src/main/webapp/fckeditor/editor/filemanager/connectors/asp/connector.asp 2008-06-30 02:54:27 UTC (rev 1002) @@ -0,0 +1,88 @@ +?<%@ CodePage=65001 Language="VBScript"%> +<% +Option Explicit +Response.Buffer = True +%> +<% + ' FCKeditor - The text editor for Internet - http://www.fckeditor.net + ' Copyright (C) 2003-2008 Frederico Caldeira Knabben + ' + ' == BEGIN LICENSE == + ' + ' Licensed under the terms of any of the following licenses at your + ' choice: + ' + ' - GNU General Public License Version 2 or later (the "GPL") + ' http://www.gnu.org/licenses/gpl.html + ' + ' - GNU Lesser General Public License Version 2.1 or later (the "LGPL") + ' http://www.gnu.org/licenses/lgpl.html + ' + ' - Mozilla Public License Version 1.1 or later (the "MPL") + ' http://www.mozilla.org/MPL/MPL-1.1.html + ' + ' == END LICENSE == + ' + ' This is the File Manager Connector for ASP. +%> + + + + + + +<% + +If ( ConfigIsEnabled = False ) Then + SendError 1, "This connector is disabled. Please check the ""editor/filemanager/connectors/asp/config.asp"" file" +End If + +DoResponse + +Sub DoResponse() + Dim sCommand, sResourceType, sCurrentFolder + + ' Get the main request information. + sCommand = Request.QueryString("Command") + + sResourceType = Request.QueryString("Type") + If ( sResourceType = "" ) Then sResourceType = "File" + + sCurrentFolder = GetCurrentFolder() + + ' Check if it is an allowed command + if ( Not IsAllowedCommand( sCommand ) ) then + SendError 1, "The """ & sCommand & """ command isn't allowed" + end if + + ' Check if it is an allowed resource type. + if ( Not IsAllowedType( sResourceType ) ) Then + SendError 1, "The """ & sResourceType & """ resource type isn't allowed" + end if + + ' File Upload doesn't have to Return XML, so it must be intercepted before anything. + If ( sCommand = "FileUpload" ) Then + FileUpload sResourceType, sCurrentFolder, sCommand + Exit Sub + End If + + SetXmlHeaders + + CreateXmlHeader sCommand, sResourceType, sCurrentFolder, GetUrlFromPath( sResourceType, sCurrentFolder, sCommand) + + ' Execute the required command. + Select Case sCommand + Case "GetFolders" + GetFolders sResourceType, sCurrentFolder + Case "GetFoldersAndFiles" + GetFoldersAndFiles sResourceType, sCurrentFolder + Case "CreateFolder" + CreateFolder sResourceType, sCurrentFolder + End Select + + CreateXmlFooter + + Response.End +End Sub + +%> Added: announcement/trunk/src/main/webapp/fckeditor/editor/filemanager/connectors/asp/io.asp =================================================================== --- announcement/trunk/src/main/webapp/fckeditor/editor/filemanager/connectors/asp/io.asp (rev 0) +++ announcement/trunk/src/main/webapp/fckeditor/editor/filemanager/connectors/asp/io.asp 2008-06-30 02:54:27 UTC (rev 1002) @@ -0,0 +1,236 @@ +?<% + ' FCKeditor - The text editor for Internet - http://www.fckeditor.net + ' Copyright (C) 2003-2008 Frederico Caldeira Knabben + ' + ' == BEGIN LICENSE == + ' + ' Licensed under the terms of any of the following licenses at your + ' choice: + ' + ' - GNU General Public License Version 2 or later (the "GPL") + ' http://www.gnu.org/licenses/gpl.html + ' + ' - GNU Lesser General Public License Version 2.1 or later (the "LGPL") + ' http://www.gnu.org/licenses/lgpl.html + ' + ' - Mozilla Public License Version 1.1 or later (the "MPL") + ' http://www.mozilla.org/MPL/MPL-1.1.html + ' + ' == END LICENSE == + ' + ' This file include IO specific functions used by the ASP Connector. +%> +<% +function CombinePaths( sBasePath, sFolder) + CombinePaths = RemoveFromEnd( sBasePath, "/" ) & "/" & RemoveFromStart( sFolder, "/" ) +end function + +function CombineLocalPaths( sBasePath, sFolder) + sFolder = replace(sFolder, "/", "\") + ' The RemoveFrom* functions use RegExp, so we must escape the \ + CombineLocalPaths = RemoveFromEnd( sBasePath, "\\" ) & "\" & RemoveFromStart( sFolder, "\\" ) +end function + +Function GetResourceTypePath( resourceType, sCommand ) + if ( sCommand = "QuickUpload") then + GetResourceTypePath = ConfigQuickUploadPath.Item( resourceType ) + else + GetResourceTypePath = ConfigFileTypesPath.Item( resourceType ) + end if +end Function + +Function GetResourceTypeDirectory( resourceType, sCommand ) + if ( sCommand = "QuickUpload") then + + if ( ConfigQuickUploadAbsolutePath.Item( resourceType ) <> "" ) then + GetResourceTypeDirectory = ConfigQuickUploadAbsolutePath.Item( resourceType ) + else + ' Map the "UserFiles" path to a local directory. + GetResourceTypeDirectory = Server.MapPath( ConfigQuickUploadPath.Item( resourceType ) ) + end if + else + if ( ConfigFileTypesAbsolutePath.Item( resourceType ) <> "" ) then + GetResourceTypeDirectory = ConfigFileTypesAbsolutePath.Item( resourceType ) + else + ' Map the "UserFiles" path to a local directory. + GetResourceTypeDirectory = Server.MapPath( ConfigFileTypesPath.Item( resourceType ) ) + end if + end if +end Function + +Function GetUrlFromPath( resourceType, folderPath, sCommand ) + GetUrlFromPath = CombinePaths( GetResourceTypePath( resourceType, sCommand ), folderPath ) +End Function + +Function RemoveExtension( fileName ) + RemoveExtension = Left( fileName, InStrRev( fileName, "." ) - 1 ) +End Function + +Function ServerMapFolder( resourceType, folderPath, sCommand ) + Dim sResourceTypePath + ' Get the resource type directory. + sResourceTypePath = GetResourceTypeDirectory( resourceType, sCommand ) + + ' Ensure that the directory exists. + CreateServerFolder sResourceTypePath + + ' Return the resource type directory combined with the required path. + ServerMapFolder = CombineLocalPaths( sResourceTypePath, folderPath ) +End Function + +Sub CreateServerFolder( folderPath ) + Dim oFSO + Set oFSO = Server.CreateObject( "Scripting.FileSystemObject" ) + + Dim sParent + sParent = oFSO.GetParentFolderName( folderPath ) + + ' If folderPath is a network path (\\server\folder\) then sParent is an empty string. + ' Get out. + if (sParent = "") then exit sub + + ' Check if the parent exists, or create it. + If ( NOT oFSO.FolderExists( sParent ) ) Then CreateServerFolder( sParent ) + + If ( oFSO.FolderExists( folderPath ) = False ) Then + On Error resume next + oFSO.CreateFolder( folderPath ) + + if err.number<>0 then + dim sErrorNumber + Dim iErrNumber, sErrDescription + iErrNumber = err.number + sErrDescription = err.Description + + On Error Goto 0 + + Select Case iErrNumber + Case 52 + sErrorNumber = "102" ' Invalid Folder Name. + Case 70 + sErrorNumber = "103" ' Security Error. + Case 76 + sErrorNumber = "102" ' Path too long. + Case Else + sErrorNumber = "110" + End Select + + SendError sErrorNumber, "CreateServerFolder(" & folderPath & ") : " & sErrDescription + end if + + End If + + Set oFSO = Nothing +End Sub + +Function IsAllowedExt( extension, resourceType ) + Dim oRE + Set oRE = New RegExp + oRE.IgnoreCase = True + oRE.Global = True + + Dim sAllowed, sDenied + sAllowed = ConfigAllowedExtensions.Item( resourceType ) + sDenied = ConfigDeniedExtensions.Item( resourceType ) + + IsAllowedExt = True + + If sDenied <> "" Then + oRE.Pattern = sDenied + IsAllowedExt = Not oRE.Test( extension ) + End If + + If IsAllowedExt And sAllowed <> "" Then + oRE.Pattern = sAllowed + IsAllowedExt = oRE.Test( extension ) + End If + + Set oRE = Nothing +End Function + +Function IsAllowedType( resourceType ) + Dim oRE + Set oRE = New RegExp + oRE.IgnoreCase = True + oRE.Global = True + oRE.Pattern = "^(" & ConfigAllowedTypes & ")$" + + IsAllowedType = oRE.Test( resourceType ) + + Set oRE = Nothing +End Function + +Function IsAllowedCommand( sCommand ) + Dim oRE + Set oRE = New RegExp + oRE.IgnoreCase = True + oRE.Global = True + oRE.Pattern = "^(" & ConfigAllowedCommands & ")$" + + IsAllowedCommand = oRE.Test( sCommand ) + + Set oRE = Nothing +End Function + +function GetCurrentFolder() + dim sCurrentFolder + sCurrentFolder = Request.QueryString("CurrentFolder") + If ( sCurrentFolder = "" ) Then sCurrentFolder = "/" + + ' Check the current folder syntax (must begin and start with a slash). + If ( Right( sCurrentFolder, 1 ) <> "/" ) Then sCurrentFolder = sCurrentFolder & "/" + If ( Left( sCurrentFolder, 1 ) <> "/" ) Then sCurrentFolder = "/" & sCurrentFolder + + ' Check for invalid folder paths (..) + If ( InStr( 1, sCurrentFolder, ".." ) <> 0 OR InStr( 1, sCurrentFolder, "\" ) <> 0) Then + SendError 102, "" + End If + + GetCurrentFolder = sCurrentFolder +end function + +' Do a cleanup of the folder name to avoid possible problems +function SanitizeFolderName( sNewFolderName ) + Dim oRegex + Set oRegex = New RegExp + oRegex.Global = True + +' remove . \ / | : ? * " < > and control characters + oRegex.Pattern = "(\.|\\|\/|\||:|\?|\*|""|\<|\>|[\u0000-\u001F]|\u007F)" + SanitizeFolderName = oRegex.Replace( sNewFolderName, "_" ) + + Set oRegex = Nothing +end function + +' Do a cleanup of the file name to avoid possible problems +function SanitizeFileName( sNewFileName ) + Dim oRegex + Set oRegex = New RegExp + oRegex.Global = True + + if ( ConfigForceSingleExtension = True ) then + oRegex.Pattern = "\.(?![^.]*$)" + sNewFileName = oRegex.Replace( sNewFileName, "_" ) + end if + +' remove \ / | : ? * " < > and control characters + oRegex.Pattern = "(\\|\/|\||:|\?|\*|""|\<|\>|[\u0000-\u001F]|\u007F)" + SanitizeFileName = oRegex.Replace( sNewFileName, "_" ) + + Set oRegex = Nothing +end function + +' This is the function that sends the results of the uploading process. +Sub SendUploadResults( errorNumber, fileUrl, fileName, customMsg ) + Response.Clear + Response.Write "" + Response.End +End Sub + +%> Added: announcement/trunk/src/main/webapp/fckeditor/editor/filemanager/connectors/asp/upload.asp =================================================================== --- announcement/trunk/src/main/webapp/fckeditor/editor/filemanager/connectors/asp/upload.asp (rev 0) +++ announcement/trunk/src/main/webapp/fckeditor/editor/filemanager/connectors/asp/upload.asp 2008-06-30 02:54:27 UTC (rev 1002) @@ -0,0 +1,65 @@ +?<%@ CodePage=65001 Language="VBScript"%> +<% +Option Explicit +Response.Buffer = True +%> +<% + ' FCKeditor - The text editor for Internet - http://www.fckeditor.net + ' Copyright (C) 2003-2008 Frederico Caldeira Knabben + ' + ' == BEGIN LICENSE == + ' + ' Licensed under the terms of any of the following licenses at your + ' choice: + ' + ' - GNU General Public License Version 2 or later (the "GPL") + ' http://www.gnu.org/licenses/gpl.html + ' + ' - GNU Lesser General Public License Version 2.1 or later (the "LGPL") + ' http://www.gnu.org/licenses/lgpl.html + ' + ' - Mozilla Public License Version 1.1 or later (the "MPL") + ' http://www.mozilla.org/MPL/MPL-1.1.html + ' + ' == END LICENSE == + ' + ' This is the "File Uploader" for ASP. +%> + + + + + +<% + +Sub SendError( number, text ) + SendUploadResults number, "", "", text +End Sub + +' Check if this uploader has been enabled. +If ( ConfigIsEnabled = False ) Then + SendUploadResults "1", "", "", "This file uploader is disabled. Please check the ""editor/filemanager/connectors/asp/config.asp"" file" +End If + + Dim sCommand, sResourceType, sCurrentFolder + + sCommand = "QuickUpload" + + sResourceType = Request.QueryString("Type") + If ( sResourceType = "" ) Then sResourceType = "File" + + sCurrentFolder = GetCurrentFolder() + + ' Is Upload enabled? + if ( Not IsAllowedCommand( sCommand ) ) then + SendUploadResults "1", "", "", "The """ & sCommand & """ command isn't allowed" + end if + + ' Check if it is an allowed resource type. + if ( Not IsAllowedType( sResourceType ) ) Then + SendUploadResults "1", "", "", "The " & sResourceType & " resource type isn't allowed" + end if + + FileUpload sResourceType, sCurrentFolder, sCommand + +%> Added: announcement/trunk/src/main/webapp/fckeditor/editor/filemanager/connectors/asp/util.asp =================================================================== --- announcement/trunk/src/main/webapp/fckeditor/editor/filemanager/connectors/asp/util.asp (rev 0) +++ announcement/trunk/src/main/webapp/fckeditor/editor/filemanager/connectors/asp/util.asp 2008-06-30 02:54:27 UTC (rev 1002) @@ -0,0 +1,55 @@ +?<% + ' FCKeditor - The text editor for Internet - http://www.fckeditor.net + ' Copyright (C) 2003-2008 Frederico Caldeira Knabben + ' + ' == BEGIN LICENSE == + ' + ' Licensed under the terms of any of the following licenses at your + ' choice: + ' + ' - GNU General Public License Version 2 or later (the "GPL") + ' http://www.gnu.org/licenses/gpl.html + ' + ' - GNU Lesser General Public License Version 2.1 or later (the "LGPL") + ' http://www.gnu.org/licenses/lgpl.html + ' + ' - Mozilla Public License Version 1.1 or later (the "MPL") + ' http://www.mozilla.org/MPL/MPL-1.1.html + ' + ' == END LICENSE == + ' + ' This file include generic functions used by the ASP Connector. +%> +<% +Function RemoveFromStart( sourceString, charToRemove ) + Dim oRegex + Set oRegex = New RegExp + oRegex.Pattern = "^" & charToRemove & "+" + + RemoveFromStart = oRegex.Replace( sourceString, "" ) +End Function + +Function RemoveFromEnd( sourceString, charToRemove ) + Dim oRegex + Set oRegex = New RegExp + oRegex.Pattern = charToRemove & "+$" + + RemoveFromEnd = oRegex.Replace( sourceString, "" ) +End Function + +Function ConvertToXmlAttribute( value ) + ConvertToXmlAttribute = Replace( value, "&", "&" ) +End Function + +Function InArray( value, sourceArray ) + Dim i + For i = 0 to UBound( sourceArray ) + If sourceArray(i) = value Then + InArray = True + Exit Function + End If + Next + InArray = False +End Function + +%> Added: announcement/trunk/src/main/webapp/fckeditor/editor/filemanager/connectors/aspx/config.ascx =================================================================== --- announcement/trunk/src/main/webapp/fckeditor/editor/filemanager/connectors/aspx/config.ascx (rev 0) +++ announcement/trunk/src/main/webapp/fckeditor/editor/filemanager/connectors/aspx/config.ascx 2008-06-30 02:54:27 UTC (rev 1002) @@ -0,0 +1,98 @@ +<%@ Control Language="C#" EnableViewState="false" AutoEventWireup="false" Inherits="FredCK.FCKeditorV2.FileBrowser.Config" %> +<%-- + * FCKeditor - The text editor for Internet - http://www.fckeditor.net + * Copyright (C) 2003-2008 Frederico Caldeira Knabben + * + * == BEGIN LICENSE == + * + * Licensed under the terms of any of the following licenses at your + * choice: + * + * - GNU General Public License Version 2 or later (the "GPL") + * http://www.gnu.org/licenses/gpl.html + * + * - GNU Lesser General Public License Version 2.1 or later (the "LGPL") + * http://www.gnu.org/licenses/lgpl.html + * + * - Mozilla Public License Version 1.1 or later (the "MPL") + * http://www.mozilla.org/MPL/MPL-1.1.html + * + * == END LICENSE == + * + * Configuration file for the File Browser Connector for ASP.NET. +--%> + Added: announcement/trunk/src/main/webapp/fckeditor/editor/filemanager/connectors/aspx/connector.aspx =================================================================== --- announcement/trunk/src/main/webapp/fckeditor/editor/filemanager/connectors/aspx/connector.aspx (rev 0) +++ announcement/trunk/src/main/webapp/fckeditor/editor/filemanager/connectors/aspx/connector.aspx 2008-06-30 02:54:27 UTC (rev 1002) @@ -0,0 +1,32 @@ +<%@ Page Language="c#" Trace="false" Inherits="FredCK.FCKeditorV2.FileBrowser.Connector" AutoEventWireup="false" %> +<%@ Register Src="config.ascx" TagName="Config" TagPrefix="FCKeditor" %> +<%-- + * FCKeditor - The text editor for Internet - http://www.fckeditor.net + * Copyright (C) 2003-2008 Frederico Caldeira Knabben + * + * == BEGIN LICENSE == + * + * Licensed under the terms of any of the following licenses at your + * choice: + * + * - GNU General Public License Version 2 or later (the "GPL") + * http://www.gnu.org/licenses/gpl.html + * + * - GNU Lesser General Public License Version 2.1 or later (the "LGPL") + * http://www.gnu.org/licenses/lgpl.html + * + * - Mozilla Public License Version 1.1 or later (the "MPL") + * http://www.mozilla.org/MPL/MPL-1.1.html + * + * == END LICENSE == + * + * This is the File Browser Connector for ASP.NET. + * + * The code of this page if included in the FCKeditor.Net package, + * in the FredCK.FCKeditorV2.dll assembly file. So to use it you must + * include that DLL in your "bin" directory. + * + * To download the FCKeditor.Net package, go to our official web site: + * http://www.fckeditor.net +--%> + Added: announcement/trunk/src/main/webapp/fckeditor/editor/filemanager/connectors/aspx/upload.aspx =================================================================== --- announcement/trunk/src/main/webapp/fckeditor/editor/filemanager/connectors/aspx/upload.aspx (rev 0) +++ announcement/trunk/src/main/webapp/fckeditor/editor/filemanager/connectors/aspx/upload.aspx 2008-06-30 02:54:27 UTC (rev 1002) @@ -0,0 +1,32 @@ +<%@ Page Language="c#" Trace="false" Inherits="FredCK.FCKeditorV2.FileBrowser.Uploader" AutoEventWireup="false" %> +<%@ Register Src="config.ascx" TagName="Config" TagPrefix="FCKeditor" %> +<%-- + * FCKeditor - The text editor for Internet - http://www.fckeditor.net + * Copyright (C) 2003-2008 Frederico Caldeira Knabben + * + * == BEGIN LICENSE == + * + * Licensed under the terms of any of the following licenses at your + * choice: + * + * - GNU General Public License Version 2 or later (the "GPL") + * http://www.gnu.org/licenses/gpl.html + * + * - GNU Lesser General Public License Version 2.1 or later (the "LGPL") + * http://www.gnu.org/licenses/lgpl.html + * + * - Mozilla Public License Version 1.1 or later (the "MPL") + * http://www.mozilla.org/MPL/MPL-1.1.html + * + * == END LICENSE == + * + * This is the Uploader for ASP.NET. + * + * The code of this page if included in the FCKeditor.Net package, + * in the FredCK.FCKeditorV2.dll assemblyfile. So to use it you must + * include that DLL in your "bin" directory. + * + * To download the FCKeditor.Net package, go to our official web site: + * http://www.fckeditor.net +--%> + Added: announcement/trunk/src/main/webapp/fckeditor/editor/filemanager/connectors/cfm/ImageObject.cfc =================================================================== --- announcement/trunk/src/main/webapp/fckeditor/editor/filemanager/connectors/cfm/ImageObject.cfc (rev 0) +++ announcement/trunk/src/main/webapp/fckeditor/editor/filemanager/connectors/cfm/ImageObject.cfc 2008-06-30 02:54:27 UTC (rev 1002) @@ -0,0 +1,273 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + Added: announcement/trunk/src/main/webapp/fckeditor/editor/filemanager/connectors/cfm/cf5_connector.cfm =================================================================== --- announcement/trunk/src/main/webapp/fckeditor/editor/filemanager/connectors/cfm/cf5_connector.cfm (rev 0) +++ announcement/trunk/src/main/webapp/fckeditor/editor/filemanager/connectors/cfm/cf5_connector.cfm 2008-06-30 02:54:27 UTC (rev 1002) @@ -0,0 +1,315 @@ + + + + + + + + + + + + userFilesPath = config.userFilesPath; + + if ( userFilesPath eq "" ) + { + userFilesPath = "/userfiles/"; + } + + // make sure the user files path is correctly formatted + userFilesPath = replace(userFilesPath, "\", "/", "ALL"); + userFilesPath = replace(userFilesPath, '//', '/', 'ALL'); + if ( right(userFilesPath,1) NEQ "/" ) + { + userFilesPath = userFilesPath & "/"; + } + if ( left(userFilesPath,1) NEQ "/" ) + { + userFilesPath = "/" & userFilesPath; + } + + // make sure the current folder is correctly formatted + url.currentFolder = replace(url.currentFolder, "\", "/", "ALL"); + url.currentFolder = replace(url.currentFolder, '//', '/', 'ALL'); + if ( right(url.currentFolder,1) neq "/" ) + { + url.currentFolder = url.currentFolder & "/"; + } + if ( left(url.currentFolder,1) neq "/" ) + { + url.currentFolder = "/" & url.currentFolder; + } + + if ( find("/",getBaseTemplatePath()) neq 0 ) + { + fs = "/"; + } + else + { + fs = "\"; + } + + // Get the base physical path to the web root for this application. The code to determine the path automatically assumes that + // the "FCKeditor" directory in the http request path is directly off the web root for the application and that it's not a + // virtual directory or a symbolic link / junction. Use the serverPath config setting to force a physical path if necessary. + if ( len(config.serverPath) ) + { + serverPath = config.serverPath; + + if ( right(serverPath,1) neq fs ) + { + serverPath = serverPath & fs; + } + } + else + { + serverPath = replaceNoCase(getBaseTemplatePath(),replace(cgi.script_name,"/",fs,"all"),"") & replace(userFilesPath,"/",fs,"all"); + } + + rootPath = left( serverPath, Len(serverPath) - Len(userFilesPath) ) ; + xmlContent = ""; // append to this string to build content + + + + + + + + + + + + + + + + + + + + + + + + "> + + + + "> + + + + '> + + + + '> + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + "> + + + + + + + + + + + + + + + + + + + + + + + + + + + + + i=1; + folders = ""; + while( i lte qDir.recordCount ) { + if( not compareNoCase( qDir.type[i], "FILE" )) + break; + if( not listFind(".,..", qDir.name[i]) ) + folders = folders & ''; + i=i+1; + } + + xmlContent = xmlContent & '' & folders & ''; + + + + + + + + + + + + i=1; + folders = ""; + files = ""; + while( i lte qDir.recordCount ) { + if( not compareNoCase( qDir.type[i], "DIR" ) and not listFind(".,..", qDir.name[i]) ) { + folders = folders & ''; + } else if( not compareNoCase( qDir.type[i], "FILE" ) ) { + fileSizeKB = round(qDir.size[i] / 1024); + files = files & ''; + } + i=i+1; + } + + xmlContent = xmlContent & '' & folders & ''; + xmlContent = xmlContent & '' & files & ''; + + + + + + + + + + + newFolderName = url.newFolderName; + if( reFind("[^A-Za-z0-9_\-\.]", newFolderName) ) { + // Munge folder name same way as we do the filename + // This means folder names are always US-ASCII so we don't have to worry about CF5 and UTF-8 + newFolderName = reReplace(newFolderName, "[^A-Za-z0-9\-\.]", "_", "all"); + newFolderName = reReplace(newFolderName, "_{2,}", "_", "all"); + newFolderName = reReplace(newFolderName, "([^_]+)_+$", "\1", "all"); + newFolderName = reReplace(newFolderName, "$_([^_]+)$", "\1", "all"); + } + + + + + + + + + + + + + + + + + + + + + '> + + + + + + + + + + + + xmlHeader = ''; + xmlHeader = xmlHeader & ''; + xmlFooter = ''; + + + + + + +#xmlHeader##xmlContent##xmlFooter# Added: announcement/trunk/src/main/webapp/fckeditor/editor/filemanager/connectors/cfm/cf5_upload.cfm =================================================================== --- announcement/trunk/src/main/webapp/fckeditor/editor/filemanager/connectors/cfm/cf5_upload.cfm (rev 0) +++ announcement/trunk/src/main/webapp/fckeditor/editor/filemanager/connectors/cfm/cf5_upload.cfm 2008-06-30 02:54:27 UTC (rev 1002) @@ -0,0 +1,299 @@ + + + + + + + + + + + + + function SendUploadResults(errorNumber, fileUrl, fileName, customMsg) + { + WriteOutput(''); + } + + + + + + + + + + + + + + + + + + + + + + + + userFilesPath = config.userFilesPath; + + if ( userFilesPath eq "" ) { + userFilesPath = "/userfiles/"; + } + + // make sure the user files path is correctly formatted + userFilesPath = replace(userFilesPath, "\", "/", "ALL"); + userFilesPath = replace(userFilesPath, '//', '/', 'ALL'); + if ( right(userFilesPath,1) NEQ "/" ) { + userFilesPath = userFilesPath & "/"; + } + if ( left(userFilesPath,1) NEQ "/" ) { + userFilesPath = "/" & userFilesPath; + } + + // make sure the current folder is correctly formatted + url.currentFolder = replace(url.currentFolder, "\", "/", "ALL"); + url.currentFolder = replace(url.currentFolder, '//', '/', 'ALL'); + if ( right(url.currentFolder,1) neq "/" ) { + url.currentFolder = url.currentFolder & "/"; + } + if ( left(url.currentFolder,1) neq "/" ) { + url.currentFolder = "/" & url.currentFolder; + } + + if (find("/",getBaseTemplatePath())) { + fs = "/"; + } else { + fs = "\"; + } + + // Get the base physical path to the web root for this application. The code to determine the path automatically assumes that + // the "FCKeditor" directory in the http request path is directly off the web root for the application and that it's not a + // virtual directory or a symbolic link / junction. Use the serverPath config setting to force a physical path if necessary. + if ( len(config.serverPath) ) { + serverPath = config.serverPath; + + if ( right(serverPath,1) neq fs ) { + serverPath = serverPath & fs; + } + } else { + serverPath = replaceNoCase(getBaseTemplatePath(),replace(cgi.script_name,"/",fs,"all"),"") & replace(userFilesPath,"/",fs,"all"); + } + + rootPath = left( serverPath, Len(serverPath) - Len(userFilesPath) ) ; + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + errorNumber = 0; + fileName = cffile.ClientFileName ; + fileExt = cffile.ServerFileExt ; + fileExisted = false ; + + // munge filename for html download. Only a-z, 0-9, _, - and . are allowed + if( reFind("[^A-Za-z0-9_\-\.]", fileName) ) { + fileName = reReplace(fileName, "[^A-Za-z0-9\-\.]", "_", "ALL"); + fileName = reReplace(fileName, "_{2,}", "_", "ALL"); + fileName = reReplace(fileName, "([^_]+)_+$", "\1", "ALL"); + fileName = reReplace(fileName, "$_([^_]+)$", "\1", "ALL"); + } + + // remove additional dots from file name + if( isDefined("Config.ForceSingleExtension") and Config.ForceSingleExtension ) + fileName = replace( fileName, '.', "_", "all" ) ; + + // When the original filename already exists, add numbers (0), (1), (2), ... at the end of the filename. + if( compare( cffile.ServerFileName, fileName ) ) { + counter = 0; + tmpFileName = fileName; + while( fileExists("#currentFolderPath##fileName#.#fileExt#") ) { + fileExisted = true ; + counter = counter + 1 ; + fileName = tmpFileName & '(#counter#)' ; + } + } + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + Added: announcement/trunk/src/main/webapp/fckeditor/editor/filemanager/connectors/cfm/cf_basexml.cfm =================================================================== --- announcement/trunk/src/main/webapp/fckeditor/editor/filemanager/connectors/cfm/cf_basexml.cfm (rev 0) +++ announcement/trunk/src/main/webapp/fckeditor/editor/filemanager/connectors/cfm/cf_basexml.cfm 2008-06-30 02:54:27 UTC (rev 1002) @@ -0,0 +1,68 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + Added: announcement/trunk/src/main/webapp/fckeditor/editor/filemanager/connectors/cfm/cf_commands.cfm =================================================================== --- announcement/trunk/src/main/webapp/fckeditor/editor/filemanager/connectors/cfm/cf_commands.cfm (rev 0) +++ announcement/trunk/src/main/webapp/fckeditor/editor/filemanager/connectors/cfm/cf_commands.cfm 2008-06-30 02:54:27 UTC (rev 1002) @@ -0,0 +1,230 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + sFileExt = GetExtension( sFileName ) ; + sFilePart = RemoveExtension( sFileName ); + while( fileExists( sServerDir & sFileName ) ) + { + counter = counter + 1; + sFileName = sFilePart & '(#counter#).' & CFFILE.ClientFileExt; + errorNumber = 201; + } + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + while( i lte qDir.recordCount ) + { + if( compareNoCase( qDir.type[i], "FILE" ) and not listFind( ".,..", qDir.name[i] ) ) + { + folders = folders & '' ; + } + i = i + 1; + } + + #folders# + + + + + + + + + + + + + + + + while( i lte qDir.recordCount ) + { + if( not compareNoCase( qDir.type[i], "DIR" ) and not listFind( ".,..", qDir.name[i] ) ) + { + folders = folders & '' ; + } + else if( not compareNoCase( qDir.type[i], "FILE" ) ) + { + fileSizeKB = round(qDir.size[i] / 1024) ; + files = files & '' ; + } + i = i + 1 ; + } + + #folders# + #files# + + + + + + + + + + + + + + + + sNewFolderName = SanitizeFolderName( sNewFolderName ) ; + + + + + + + + + + + + + + + + + + + + + + + + + Added: announcement/trunk/src/main/webapp/fckeditor/editor/filemanager/connectors/cfm/cf_connector.cfm =================================================================== --- announcement/trunk/src/main/webapp/fckeditor/editor/filemanager/connectors/cfm/cf_connector.cfm (rev 0) +++ announcement/trunk/src/main/webapp/fckeditor/editor/filemanager/connectors/cfm/cf_connector.cfm 2008-06-30 02:54:27 UTC (rev 1002) @@ -0,0 +1,89 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + Added: announcement/trunk/src/main/webapp/fckeditor/editor/filemanager/connectors/cfm/cf_io.cfm =================================================================== --- announcement/trunk/src/main/webapp/fckeditor/editor/filemanager/connectors/cfm/cf_io.cfm (rev 0) +++ announcement/trunk/src/main/webapp/fckeditor/editor/filemanager/connectors/cfm/cf_io.cfm 2008-06-30 02:54:27 UTC (rev 1002) @@ -0,0 +1,291 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +|[[:cntrl:]]+', "_", "all" )> + + + + + + + + + + var chunk = ""; + var fileReaderClass = ""; + var fileReader = ""; + var file = ""; + var done = false; + var counter = 0; + var byteArray = ""; + + if( not fileExists( ARGUMENTS.fileName ) ) + { + return "" ; + } + + if (REQUEST.CFVersion gte 8) + { + file = FileOpen( ARGUMENTS.fileName, "readbinary" ) ; + byteArray = FileRead( file, 1024 ) ; + chunk = toString( toBinary( toBase64( byteArray ) ) ) ; + FileClose( file ) ; + } + else + { + fileReaderClass = createObject("java", "java.io.FileInputStream"); + fileReader = fileReaderClass.init(fileName); + + while(not done) + { + char = fileReader.read(); + counter = counter + 1; + if ( char eq -1 or counter eq ARGUMENTS.bytes) + { + done = true; + } + else + { + chunk = chunk & chr(char) ; + } + } + } + + + + + + + + + + + + + + + + + + + + + + + + + + + + +|[[:cntrl:]]+', "_", "all" )> + + + Added: announcement/trunk/src/main/webapp/fckeditor/editor/filemanager/connectors/cfm/cf_upload.cfm =================================================================== --- announcement/trunk/src/main/webapp/fckeditor/editor/filemanager/connectors/cfm/cf_upload.cfm (rev 0) +++ announcement/trunk/src/main/webapp/fckeditor/editor/filemanager/connectors/cfm/cf_upload.cfm 2008-06-30 02:54:27 UTC (rev 1002) @@ -0,0 +1,72 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + Added: announcement/trunk/src/main/webapp/fckeditor/editor/filemanager/connectors/cfm/cf_util.cfm =================================================================== --- announcement/trunk/src/main/webapp/fckeditor/editor/filemanager/connectors/cfm/cf_util.cfm (rev 0) +++ announcement/trunk/src/main/webapp/fckeditor/editor/filemanager/connectors/cfm/cf_util.cfm 2008-06-30 02:54:27 UTC (rev 1002) @@ -0,0 +1,131 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + > + + + + + + + + + + + + + + + Added: announcement/trunk/src/main/webapp/fckeditor/editor/filemanager/connectors/cfm/config.cfm =================================================================== --- announcement/trunk/src/main/webapp/fckeditor/editor/filemanager/connectors/cfm/config.cfm (rev 0) +++ announcement/trunk/src/main/webapp/fckeditor/editor/filemanager/connectors/cfm/config.cfm 2008-06-30 02:54:27 UTC (rev 1002) @@ -0,0 +1,189 @@ + + + + + Config = StructNew() ; + + // SECURITY: You must explicitly enable this "connector". (Set enabled to "true") + Config.Enabled = false ; + + + // Path to uploaded files relative to the document root. + Config.UserFilesPath = "/userfiles/" ; + + // Use this to force the server path if FCKeditor is not running directly off + // the root of the application or the FCKeditor directory in the URL is a virtual directory + // or a symbolic link / junction + // Example: C:\inetpub\wwwroot\myDocs\ + Config.ServerPath = "" ; + + // Due to security issues with Apache modules, it is recommended to leave the + // following setting enabled. + Config.ForceSingleExtension = true ; + + // Perform additional checks for image files - if set to true, validate image size + // (This feature works in MX 6.0 and above) + Config.SecureImageUploads = true; + + // What the user can do with this connector + Config.ConfigAllowedCommands = "QuickUpload,FileUpload,GetFolders,GetFoldersAndFiles,CreateFolder" ; + + //Allowed Resource Types + Config.ConfigAllowedTypes = "File,Image,Flash,Media" ; + + // For security, HTML is allowed in the first Kb of data for files having the + // following extensions only. + // (This feature works in MX 6.0 and above)) + Config.HtmlExtensions = "html,htm,xml,xsd,txt,js" ; + + //Due to known issues with GetTempDirectory function, it is + //recommended to set this vairiable to a valid directory + //instead of using the GetTempDirectory function + //(used by MX 6.0 and above) + Config.TempDirectory = GetTempDirectory(); + +// Configuration settings for each Resource Type +// +// - AllowedExtensions: the possible extensions that can be allowed. +// If it is empty then any file type can be uploaded. +// - DeniedExtensions: The extensions that won't be allowed. +// If it is empty then no restrictions are done here. +// +// For a file to be uploaded it has to fulfill both the AllowedExtensions +// and DeniedExtensions (that's it: not being denied) conditions. +// +// - FileTypesPath: the virtual folder relative to the document root where +// these resources will be located. +// Attention: It must start and end with a slash: '/' +// +// - FileTypesAbsolutePath: the physical path to the above folder. It must be +// an absolute path. +// If it's an empty string then it will be autocalculated. +// Usefull if you are using a virtual directory, symbolic link or alias. +// Examples: 'C:\\MySite\\userfiles\\' or '/root/mysite/userfiles/'. +// Attention: The above 'FileTypesPath' must point to the same directory. +// Attention: It must end with a slash: '/' +// +// +// - QuickUploadPath: the virtual folder relative to the document root where +// these resources will be uploaded using the Upload tab in the resources +// dialogs. +// Attention: It must start and end with a slash: '/' +// +// - QuickUploadAbsolutePath: the physical path to the above folder. It must be +// an absolute path. +// If it's an empty string then it will be autocalculated. +// Usefull if you are using a virtual directory, symbolic link or alias. +// Examples: 'C:\\MySite\\userfiles\\' or '/root/mysite/userfiles/'. +// Attention: The above 'QuickUploadPath' must point to the same directory. +// Attention: It must end with a slash: '/' + + Config.AllowedExtensions = StructNew() ; + Config.DeniedExtensions = StructNew() ; + Config.FileTypesPath = StructNew() ; + Config.FileTypesAbsolutePath = StructNew() ; + Config.QuickUploadPath = StructNew() ; + Config.QuickUploadAbsolutePath = StructNew() ; + + Config.AllowedExtensions["File"] = "7z,aiff,asf,avi,bmp,csv,doc,fla,flv,gif,gz,gzip,jpeg,jpg,mid,mov,mp3,mp4,mpc,mpeg,mpg,ods,odt,pdf,png,ppt,pxd,qt,ram,rar,rm,rmi,rmvb,rtf,sdc,sitd,swf,sxc,sxw,tar,tgz,tif,tiff,txt,vsd,wav,wma,wmv,xls,xml,zip" ; + Config.DeniedExtensions["File"] = "" ; + Config.FileTypesPath["File"] = Config.UserFilesPath & 'file/' ; + Config.FileTypesAbsolutePath["File"] = iif( Config.ServerPath eq "", de(""), de(Config.ServerPath & 'file/') ) ; + Config.QuickUploadPath["File"] = Config.FileTypesPath["File"] ; + Config.QuickUploadAbsolutePath["File"] = Config.FileTypesAbsolutePath["File"] ; + + Config.AllowedExtensions["Image"] = "bmp,gif,jpeg,jpg,png" ; + Config.DeniedExtensions["Image"] = "" ; + Config.FileTypesPath["Image"] = Config.UserFilesPath & 'image/' ; + Config.FileTypesAbsolutePath["Image"] = iif( Config.ServerPath eq "", de(""), de(Config.ServerPath & 'image/') ) ; + Config.QuickUploadPath["Image"] = Config.FileTypesPath["Image"] ; + Config.QuickUploadAbsolutePath["Image"] = Config.FileTypesAbsolutePath["Image"] ; + + Config.AllowedExtensions["Flash"] = "swf,flv" ; + Config.DeniedExtensions["Flash"] = "" ; + Config.FileTypesPath["Flash"] = Config.UserFilesPath & 'flash/' ; + Config.FileTypesAbsolutePath["Flash"] = iif( Config.ServerPath eq "", de(""), de(Config.ServerPath & 'flash/') ) ; + Config.QuickUploadPath["Flash"] = Config.FileTypesPath["Flash"] ; + Config.QuickUploadAbsolutePath["Flash"] = Config.FileTypesAbsolutePath["Flash"] ; + + Config.AllowedExtensions["Media"] = "aiff,asf,avi,bmp,fla,flv,gif,jpeg,jpg,mid,mov,mp3,mp4,mpc,mpeg,mpg,png,qt,ram,rm,rmi,rmvb,swf,tif,tiff,wav,wma,wmv" ; + Config.DeniedExtensions["Media"] = "" ; + Config.FileTypesPath["Media"] = Config.UserFilesPath & 'media/' ; + Config.FileTypesAbsolutePath["Media"] = iif( Config.ServerPath eq "", de(""), de(Config.ServerPath & 'media/') ) ; + Config.QuickUploadPath["Media"] = Config.FileTypesPath["Media"] ; + Config.QuickUploadAbsolutePath["Media"] = Config.FileTypesAbsolutePath["Media"] ; + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + function structCopyKeys(stFrom, stTo) { + for ( key in stFrom ) { + if ( isStruct(stFrom[key]) ) { + structCopyKeys(stFrom[key],stTo[key]); + } else { + stTo[key] = stFrom[key]; + } + } + } + structCopyKeys(FCKeditor, config); + + + Added: announcement/trunk/src/main/webapp/fckeditor/editor/filemanager/connectors/cfm/connector.cfm =================================================================== --- announcement/trunk/src/main/webapp/fckeditor/editor/filemanager/connectors/cfm/connector.cfm (rev 0) +++ announcement/trunk/src/main/webapp/fckeditor/editor/filemanager/connectors/cfm/connector.cfm 2008-06-30 02:54:27 UTC (rev 1002) @@ -0,0 +1,32 @@ + + + + + + + + + + Added: announcement/trunk/src/main/webapp/fckeditor/editor/filemanager/connectors/cfm/image.cfc =================================================================== --- announcement/trunk/src/main/webapp/fckeditor/editor/filemanager/connectors/cfm/image.cfc (rev 0) +++ announcement/trunk/src/main/webapp/fckeditor/editor/filemanager/connectors/cfm/image.cfc 2008-06-30 02:54:27 UTC (rev 1002) @@ -0,0 +1,1324 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + paths = arrayNew(1); + paths[1] = expandPath("metadata-extractor-2.3.1.jar"); + loader = createObject("component", "javaloader.JavaLoader").init(paths); + + //at this stage we only have access to the class, but we don't have an instance + JpegMetadataReader = loader.create("com.drew.imaging.jpeg.JpegMetadataReader"); + + myMetaData = JpegMetadataReader.readMetadata(inFile); + directories = myMetaData.getDirectoryIterator(); + while (directories.hasNext()) { + currentDirectory = directories.next(); + tags = currentDirectory.getTagIterator(); + while (tags.hasNext()) { + currentTag = tags.next(); + if (currentTag.getTagName() DOES NOT CONTAIN "Unknown") { //leave out the junk data + queryAddRow(retQry); + querySetCell(retQry,"dirName",replace(currentTag.getDirectoryName(),' ','_','ALL')); + tagName = replace(currentTag.getTagName(),' ','','ALL'); + tagName = replace(tagName,'/','','ALL'); + querySetCell(retQry,"tagName",tagName); + querySetCell(retQry,"tagValue",currentTag.getDescription()); + } + } + } + return retQry; + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + resizedImage = CreateObject("java", "java.awt.image.BufferedImage"); + at = CreateObject("java", "java.awt.geom.AffineTransform"); + op = CreateObject("java", "java.awt.image.AffineTransformOp"); + + w = img.getWidth(); + h = img.getHeight(); + + if (preserveAspect and cropToExact and newHeight gt 0 and newWidth gt 0) + { + if (w / h gt newWidth / newHeight){ + newWidth = 0; + } else if (w / h lt newWidth / newHeight){ + newHeight = 0; + } + } else if (preserveAspect and newHeight gt 0 and newWidth gt 0) { + if (w / h gt newWidth / newHeight){ + newHeight = 0; + } else if (w / h lt newWidth / newHeight){ + newWidth = 0; + } + } + if (newWidth gt 0 and newHeight eq 0) { + scale = newWidth / w; + w = newWidth; + h = round(h*scale); + } else if (newHeight gt 0 and newWidth eq 0) { + scale = newHeight / h; + h = newHeight; + w = round(w*scale); + } else if (newHeight gt 0 and newWidth gt 0) { + w = newWidth; + h = newHeight; + } else { + retVal = throw( retVal.errorMessage); + return retVal; + } + resizedImage.init(javacast("int",w),javacast("int",h),img.getType()); + + w = w / img.getWidth(); + h = h / img.getHeight(); + + + + op.init(at.getScaleInstance(javacast("double",w),javacast("double",h)), rh); + // resizedImage = op.createCompatibleDestImage(img, img.getColorModel()); + op.filter(img, resizedImage); + + imgInfo = getimageinfo(resizedImage, ""); + if (imgInfo.errorCode gt 0) + { + return imgInfo; + } + + cropOffsetX = max( Int( (imgInfo.width/2) - (newWidth/2) ), 0 ); + cropOffsetY = max( Int( (imgInfo.height/2) - (newHeight/2) ), 0 ); + // There is a chance that the image is exactly the correct + // width and height and don't need to be cropped + if + ( + preserveAspect and cropToExact + and + (imgInfo.width IS NOT specifiedWidth OR imgInfo.height IS NOT specifiedHeight) + ) + { + // Get the correct offset to get the center of the image + cropOffsetX = max( Int( (imgInfo.width/2) - (specifiedWidth/2) ), 0 ); + cropOffsetY = max( Int( (imgInfo.height/2) - (specifiedHeight/2) ), 0 ); + + cropImageResult = crop( resizedImage, "", "", cropOffsetX, cropOffsetY, specifiedWidth, specifiedHeight ); + if ( cropImageResult.errorCode GT 0) + { + return cropImageResult; + } else { + resizedImage = cropImageResult.img; + } + } + if (outputFile eq "") + { + retVal.img = resizedImage; + return retVal; + } else { + saveImage = writeImage(outputFile, resizedImage, jpegCompression); + if (saveImage.errorCode gt 0) + { + return saveImage; + } else { + return retVal; + } + } + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + if (fromX + newWidth gt img.getWidth() + OR + fromY + newHeight gt img.getHeight() + ) + { + retval = throw( "The cropped image dimensions go beyond the original image dimensions."); + return retVal; + } + croppedImage = img.getSubimage(javaCast("int", fromX), javaCast("int", fromY), javaCast("int", newWidth), javaCast("int", newHeight) ); + if (outputFile eq "") + { + retVal.img = croppedImage; + return retVal; + } else { + saveImage = writeImage(outputFile, croppedImage, jpegCompression); + if (saveImage.errorCode gt 0) + { + return saveImage; + } else { + return retVal; + } + } + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + rotatedImage = CreateObject("java", "java.awt.image.BufferedImage"); + at = CreateObject("java", "java.awt.geom.AffineTransform"); + op = CreateObject("java", "java.awt.image.AffineTransformOp"); + + iw = img.getWidth(); h = iw; + ih = img.getHeight(); w = ih; + + if(arguments.degrees eq 180) { w = iw; h = ih; } + + x = (w/2)-(iw/2); + y = (h/2)-(ih/2); + + rotatedImage.init(javacast("int",w),javacast("int",h),img.getType()); + + at.rotate(arguments.degrees * 0.0174532925,w/2,h/2); + at.translate(x,y); + op.init(at, rh); + + op.filter(img, rotatedImage); + + if (outputFile eq "") + { + retVal.img = rotatedImage; + return retVal; + } else { + saveImage = writeImage(outputFile, rotatedImage, jpegCompression); + if (saveImage.errorCode gt 0) + { + return saveImage; + } else { + return retVal; + } + } + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + if (outputFile eq "") + { + retVal = throw( "The convert method requires a valid output filename."); + return retVal; + } else { + saveImage = writeImage(outputFile, img, jpegCompression); + if (saveImage.errorCode gt 0) + { + return saveImage; + } else { + return retVal; + } + } + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + /* + JPEG output method handles compression + */ + out = createObject("java", "java.io.BufferedOutputStream"); + fos = createObject("java", "java.io.FileOutputStream"); + fos.init(tempOutputFile); + out.init(fos); + JPEGCodec = createObject("java", "com.sun.image.codec.jpeg.JPEGCodec"); + encoder = JPEGCodec.createJPEGEncoder(out); + param = encoder.getDefaultJPEGEncodeParam(img); + param.setQuality(quality, false); + encoder.setJPEGEncodeParam(param); + encoder.encode(img); + out.close(); + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + flippedImage = CreateObject("java", "java.awt.image.BufferedImage"); + at = CreateObject("java", "java.awt.geom.AffineTransform"); + op = CreateObject("java", "java.awt.image.AffineTransformOp"); + + flippedImage.init(img.getWidth(), img.getHeight(), img.getType()); + + if (direction eq "horizontal") { + at = at.getScaleInstance(-1, 1); + at.translate(-img.getWidth(), 0); + } else { + at = at.getScaleInstance(1,-1); + at.translate(0, -img.getHeight()); + } + op.init(at, rh); + op.filter(img, flippedImage); + + if (outputFile eq "") + { + retVal.img = flippedImage; + return retVal; + } else { + saveImage = writeImage(outputFile, flippedImage, jpegCompression); + if (saveImage.errorCode gt 0) + { + return saveImage; + } else { + return retVal; + } + } + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + // initialize the blur filter + variables.blurFilter.init(arguments.blurAmount); + // move the source image into the destination image + // so we can repeatedly blur it. + destImage = srcImage; + + for (i=1; i lte iterations; i=i+1) + { + // do the blur i times + destImage = variables.blurFilter.filter(destImage); + } + + + if (outputFile eq "") + { + // return the image object + retVal.img = destImage; + return retVal; + } else { + // write the image object to the specified file. + saveImage = writeImage(outputFile, destImage, jpegCompression); + if (saveImage.errorCode gt 0) + { + return saveImage; + } else { + return retVal; + } + } + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + // initialize the sharpen filter + variables.sharpenFilter.init(); + + destImage = variables.sharpenFilter.filter(srcImage); + + + if (outputFile eq "") + { + // return the image object + retVal.img = destImage; + return retVal; + } else { + // write the image object to the specified file. + saveImage = writeImage(outputFile, destImage, jpegCompression); + if (saveImage.errorCode gt 0) + { + return saveImage; + } else { + return retVal; + } + } + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + // initialize the posterize filter + variables.posterizeFilter.init(arguments.amount); + + destImage = variables.posterizeFilter.filter(srcImage); + + + if (outputFile eq "") + { + // return the image object + retVal.img = destImage; + return retVal; + } else { + // write the image object to the specified file. + saveImage = writeImage(outputFile, destImage, jpegCompression); + if (saveImage.errorCode gt 0) + { + return saveImage; + } else { + return retVal; + } + } + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + // load objects + bgImage = CreateObject("java", "java.awt.image.BufferedImage"); + fontImage = CreateObject("java", "java.awt.image.BufferedImage"); + overlayImage = CreateObject("java", "java.awt.image.BufferedImage"); + Color = CreateObject("java","java.awt.Color"); + font = createObject("java","java.awt.Font"); + font_stream = createObject("java","java.io.FileInputStream"); + ac = CreateObject("Java", "java.awt.AlphaComposite"); + + // set up basic needs + fontColor = Color.init(javacast("int", rgb.red), javacast("int", rgb.green), javacast("int", rgb.blue)); + + if (fontDetails.fontFile neq "") + { + font_stream.init(arguments.fontDetails.fontFile); + font = font.createFont(font.TRUETYPE_FONT, font_stream); + font = font.deriveFont(javacast("float",arguments.fontDetails.size)); + } else { + font.init(fontDetails.fontName, evaluate(fontDetails.style), fontDetails.size); + } + // get font metrics using a 1x1 bufferedImage + fontImage.init(1,1,img.getType()); + g2 = fontImage.createGraphics(); + g2.setRenderingHints(getRenderingHints()); + fc = g2.getFontRenderContext(); + bounds = font.getStringBounds(content,fc); + + g2 = img.createGraphics(); + g2.setRenderingHints(getRenderingHints()); + g2.setFont(font); + g2.setColor(fontColor); + // in case you want to change the alpha + // g2.setComposite(ac.getInstance(ac.SRC_OVER, 0.50)); + + // the location (arguments.fontDetails.size+y) doesn't really work + // the way I want it to. + g2.drawString(content,javacast("int",x),javacast("int",arguments.fontDetails.size+y)); + + if (outputFile eq "") + { + retVal.img = img; + return retVal; + } else { + saveImage = writeImage(outputFile, img, jpegCompression); + if (saveImage.errorCode gt 0) + { + return saveImage; + } else { + return retVal; + } + } + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + at = CreateObject("java", "java.awt.geom.AffineTransform"); + op = CreateObject("java", "java.awt.image.AffineTransformOp"); + ac = CreateObject("Java", "java.awt.AlphaComposite"); + gfx = originalImage.getGraphics(); + gfx.setComposite(ac.getInstance(ac.SRC_OVER, alpha)); + + at.init(); + // op.init(at,op.TYPE_BILINEAR); + op.init(at, rh); + + gfx.drawImage(wmImage, op, javaCast("int",arguments.placeAtX), javacast("int", arguments.placeAtY)); + + gfx.dispose(); + + if (outputFile eq "") + { + retVal.img = originalImage; + return retVal; + } else { + saveImage = writeImage(outputFile, originalImage, jpegCompression); + if (saveImage.errorCode gt 0) + { + return saveImage; + } else { + return retVal; + } + } + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + // convert the image to a specified BufferedImage type and return it + + var width = bImage.getWidth(); + var height = bImage.getHeight(); + var newImage = createObject("java","java.awt.image.BufferedImage").init(javacast("int",width), javacast("int",height), javacast("int",type)); + // int[] rgbArray = new int[width*height]; + var rgbArray = variables.arrObj.newInstance(variables.intClass, javacast("int",width*height)); + + bImage.getRGB( + javacast("int",0), + javacast("int",0), + javacast("int",width), + javacast("int",height), + rgbArray, + javacast("int",0), + javacast("int",width) + ); + newImage.setRGB( + javacast("int",0), + javacast("int",0), + javacast("int",width), + javacast("int",height), + rgbArray, + javacast("int",0), + javacast("int",width) + ); + return newImage; + + + + + Added: announcement/trunk/src/main/webapp/fckeditor/editor/filemanager/connectors/cfm/upload.cfm =================================================================== --- announcement/trunk/src/main/webapp/fckeditor/editor/filemanager/connectors/cfm/upload.cfm (rev 0) +++ announcement/trunk/src/main/webapp/fckeditor/editor/filemanager/connectors/cfm/upload.cfm 2008-06-30 02:54:27 UTC (rev 1002) @@ -0,0 +1,31 @@ + + + + + + + + + Added: announcement/trunk/src/main/webapp/fckeditor/editor/filemanager/connectors/lasso/config.lasso =================================================================== --- announcement/trunk/src/main/webapp/fckeditor/editor/filemanager/connectors/lasso/config.lasso (rev 0) +++ announcement/trunk/src/main/webapp/fckeditor/editor/filemanager/connectors/lasso/config.lasso 2008-06-30 02:54:27 UTC (rev 1002) @@ -0,0 +1,65 @@ +[//lasso +/* + * FCKeditor - The text editor for Internet - http://www.fckeditor.net + * Copyright (C) 2003-2008 Frederico Caldeira Knabben + * + * == BEGIN LICENSE == + * + * Licensed under the terms of any of the following licenses at your + * choice: + * + * - GNU General Public License Version 2 or later (the "GPL") + * http://www.gnu.org/licenses/gpl.html + * + * - GNU Lesser General Public License Version 2.1 or later (the "LGPL") + * http://www.gnu.org/licenses/lgpl.html + * + * - Mozilla Public License Version 1.1 or later (the "MPL") + * http://www.mozilla.org/MPL/MPL-1.1.html + * + * == END LICENSE == + * + * Configuration file for the File Manager Connector for Lasso. + */ + + /*..................................................................... + The connector uses the file tags, which require authentication. Enter a + valid username and password from Lasso admin for a group with file tags + permissions for uploads and the path you define in UserFilesPath below. + */ + + var('connection') = array( + -username='xxxxxxxx', + -password='xxxxxxxx' + ); + + + /*..................................................................... + Set the base path for files that users can upload and browse (relative + to server root). + + Set which file extensions are allowed and/or denied for each file type. + */ + var('config') = map( + 'Enabled' = false, + 'UserFilesPath' = '/userfiles/', + 'Subdirectories' = map( + 'File' = 'File/', + 'Image' = 'Image/', + 'Flash' = 'Flash/', + 'Media' = 'Media/' + ), + 'AllowedExtensions' = map( + 'File' = array('7z','aiff','asf','avi','bmp','csv','doc','fla','flv','gif','gz','gzip','jpeg','jpg','mid','mov','mp3','mp4','mpc','mpeg','mpg','ods','odt','pdf','png','ppt','pxd','qt','ram','rar','rm','rmi','rmvb','rtf','sdc','sitd','swf','sxc','sxw','tar','tgz','tif','tiff','txt','vsd','wav','wma','wmv','xls','xml','zip'), + 'Image' = array('bmp','gif','jpeg','jpg','png'), + 'Flash' = array('swf','flv'), + 'Media' = array('aiff','asf','avi','bmp','fla','flv','gif','jpeg','jpg','mid','mov','mp3','mp4','mpc','mpeg','mpg','png','qt','ram','rm','rmi','rmvb','swf','tif','tiff','wav','wma','wmv') + ), + 'DeniedExtensions' = map( + 'File' = array(), + 'Image' = array(), + 'Flash' = array(), + 'Media' = array() + ) + ); +] Added: announcement/trunk/src/main/webapp/fckeditor/editor/filemanager/connectors/lasso/connector.lasso =================================================================== --- announcement/trunk/src/main/webapp/fckeditor/editor/filemanager/connectors/lasso/connector.lasso (rev 0) +++ announcement/trunk/src/main/webapp/fckeditor/editor/filemanager/connectors/lasso/connector.lasso 2008-06-30 02:54:27 UTC (rev 1002) @@ -0,0 +1,322 @@ +[//lasso +/* + * FCKeditor - The text editor for Internet - http://www.fckeditor.net + * Copyright (C) 2003-2008 Frederico Caldeira Knabben + * + * == BEGIN LICENSE == + * + * Licensed under the terms of any of the following licenses at your + * choice: + * + * - GNU General Public License Version 2 or later (the "GPL") + * http://www.gnu.org/licenses/gpl.html + * + * - GNU Lesser General Public License Version 2.1 or later (the "LGPL") + * http://www.gnu.org/licenses/lgpl.html + * + * - Mozilla Public License Version 1.1 or later (the "MPL") + * http://www.mozilla.org/MPL/MPL-1.1.html + * + * == END LICENSE == + * + * This is the File Manager Connector for Lasso. + */ + + /*..................................................................... + Include global configuration. See config.lasso for details. + */ + include('config.lasso'); + + + /*..................................................................... + Translate current date/time to GMT for custom header. + */ + var('headerDate') = date_localtogmt(date)->format('%a, %d %b %Y %T GMT'); + + + /*..................................................................... + Convert query string parameters to variables and initialize output. + */ + var( + 'Command' = action_param('Command'), + 'Type' = action_param('Type'), + 'CurrentFolder' = action_param('CurrentFolder'), + 'ServerPath' = action_param('ServerPath'), + 'NewFolderName' = action_param('NewFolderName'), + 'NewFile' = null, + 'NewFileName' = string, + 'OrigFilePath' = string, + 'NewFilePath' = string, + 'commandData' = string, + 'folders' = '\t\n', + 'files' = '\t\n', + 'errorNumber' = integer, + 'responseType' = 'xml', + 'uploadResult' = '0' + ); + + /*..................................................................... + Custom tag sets the HTML response. + */ + + define_tag( + 'htmlreply', + -namespace='fck_', + -priority='replace', + -required='uploadResult', + -optional='NewFilePath', + -type='string', + -description='Sets the HTML response for the FCKEditor File Upload feature.' + ); + $__html_reply__ = '\ + + '; + else; + $__html_reply__ = $__html_reply__ + '\ + window.parent.OnUploadCompleted(' + $uploadResult + '); + + '; + /if; + /define_tag; + + + /*..................................................................... + Calculate the path to the current folder. + */ + $ServerPath == '' ? $ServerPath = $config->find('UserFilesPath'); + + var('currentFolderURL' = $ServerPath + + $config->find('Subdirectories')->find(action_param('Type')) + + $CurrentFolder + ); + + if($CurrentFolder->(Find: '..') || $CurrentFolder->(Find: '\\')); + if($Command == 'FileUpload'); + $responseType = 'html'; + $uploadResult = '102'; + fck_htmlreply( + -uploadResult=$uploadResult + ); + else; + $errorNumber = 102; + $commandData += '\n'; + /if; + else; + + /*..................................................................... + Build the appropriate response per the 'Command' parameter. Wrap the + entire process in an inline for file tag permissions. + */ + inline($connection); + select($Command); + /*............................................................. + List all subdirectories in the 'Current Folder' directory. + */ + case('GetFolders'); + $commandData += '\t\n'; + + iterate(file_listdirectory($currentFolderURL), local('this')); + #this->endswith('/') ? $commandData += '\t\t\n'; + /iterate; + + $commandData += '\t\n'; + + + /*............................................................. + List both files and folders in the 'Current Folder' directory. + Include the file sizes in kilobytes. + */ + case('GetFoldersAndFiles'); + iterate(file_listdirectory($currentFolderURL), local('this')); + if(#this->endswith('/')); + $folders += '\t\t\n'; + else; + local('size') = file_getsize($currentFolderURL + #this) / 1024; + $files += '\t\t\n'; + /if; + /iterate; + + $folders += '\t\n'; + $files += '\t\n'; + + $commandData += $folders + $files; + + + /*............................................................. + Create a directory 'NewFolderName' within the 'Current Folder.' + */ + case('CreateFolder'); + $NewFolderName = (String_ReplaceRegExp: $NewFolderName, -find='\\.|\\\\|\\/|\\||\\:|\\?|\\*|"|<|>', -replace='_'); + var('newFolder' = $currentFolderURL + $NewFolderName + '/'); + file_create($newFolder); + + + /*......................................................... + Map Lasso's file error codes to FCKEditor's error codes. + */ + select(file_currenterror( -errorcode)); + case(0); + $errorNumber = 0; + case( -9983); + $errorNumber = 101; + case( -9976); + $errorNumber = 102; + case( -9977); + $errorNumber = 102; + case( -9961); + $errorNumber = 103; + case; + $errorNumber = 110; + /select; + + $commandData += '\n'; + + + /*............................................................. + Process an uploaded file. + */ + case('FileUpload'); + /*......................................................... + This is the only command that returns an HTML response. + */ + $responseType = 'html'; + + + /*......................................................... + Was a file actually uploaded? + */ + if(file_uploads->size); + $NewFile = file_uploads->get(1); + else; + $uploadResult = '202'; + /if; + + if($uploadResult == '0'); + /*..................................................... + Split the file's extension from the filename in order + to follow the API's naming convention for duplicate + files. (Test.txt, Test(1).txt, Test(2).txt, etc.) + */ + $NewFileName = $NewFile->find('OrigName'); + $NewFileName = (String_ReplaceRegExp: $NewFileName, -find='\\\\|\\/|\\||\\:|\\?|\\*|"|<|>', -replace='_'); + $OrigFilePath = $currentFolderURL + $NewFileName; + $NewFilePath = $OrigFilePath; + local('fileExtension') = '.' + $NewFile->find('OrigExtension'); + #fileExtension = (String_ReplaceRegExp: #fileExtension, -find='\\\\|\\/|\\||\\:|\\?|\\*|"|<|>', -replace='_'); + local('shortFileName') = $NewFileName->removetrailing(#fileExtension)&; + + + /*..................................................... + Make sure the file extension is allowed. + */ + if($config->find('DeniedExtensions')->find($Type) >> $NewFile->find('OrigExtension')); + $uploadResult = '202'; + else; + /*................................................. + Rename the target path until it is unique. + */ + while(file_exists($NewFilePath)); + $NewFilePath = $currentFolderURL + #shortFileName + '(' + loop_count + ')' + #fileExtension; + /while; + + + /*................................................. + Copy the uploaded file to its final location. + */ + file_copy($NewFile->find('path'), $NewFilePath); + + + /*................................................. + Set the error code for the response. Note whether + the file had to be renamed. + */ + select(file_currenterror( -errorcode)); + case(0); + $OrigFilePath != $NewFilePath ? $uploadResult = 201; + case; + $uploadResult = file_currenterror( -errorcode); + /select; + /if; + /if; + fck_htmlreply( + -uploadResult=$uploadResult, + -NewFilePath=$NewFilePath + ); + /select; + /inline; + /if; + + /*..................................................................... + Send a custom header for xml responses. + */ + if($responseType == 'xml'); + header; +] +HTTP/1.0 200 OK +Date: [$headerDate] +Server: Lasso Professional [lasso_version( -lassoversion)] +Expires: Mon, 26 Jul 1997 05:00:00 GMT +Last-Modified: [$headerDate] +Cache-Control: no-store, no-cache, must-revalidate, post-check=0, pre-check=0 +Pragma: no-cache +Keep-Alive: timeout=15, max=98 +Connection: Keep-Alive +Content-Type: text/xml; charset=utf-8 +[//lasso +/header; + + /* + Set the content type encoding for Lasso. + */ + content_type('text/xml; charset=utf-8'); + + /* + Wrap the response as XML and output. + */ + $__html_reply__ = '\ + +'; + + if($errorNumber != '102'); + $__html_reply__ += ''; + /if; + + $__html_reply__ += $commandData + ' +'; + /if; +] Added: announcement/trunk/src/main/webapp/fckeditor/editor/filemanager/connectors/lasso/upload.lasso =================================================================== --- announcement/trunk/src/main/webapp/fckeditor/editor/filemanager/connectors/lasso/upload.lasso (rev 0) +++ announcement/trunk/src/main/webapp/fckeditor/editor/filemanager/connectors/lasso/upload.lasso 2008-06-30 02:54:27 UTC (rev 1002) @@ -0,0 +1,168 @@ +[//lasso +/* + * FCKeditor - The text editor for Internet - http://www.fckeditor.net + * Copyright (C) 2003-2008 Frederico Caldeira Knabben + * + * == BEGIN LICENSE == + * + * Licensed under the terms of any of the following licenses at your + * choice: + * + * - GNU General Public License Version 2 or later (the "GPL") + * http://www.gnu.org/licenses/gpl.html + * + * - GNU Lesser General Public License Version 2.1 or later (the "LGPL") + * http://www.gnu.org/licenses/lgpl.html + * + * - Mozilla Public License Version 1.1 or later (the "MPL") + * http://www.mozilla.org/MPL/MPL-1.1.html + * + * == END LICENSE == + * + * This is the "File Uploader" for Lasso. + */ + + /*..................................................................... + Include global configuration. See config.lasso for details. + */ + include('config.lasso'); + + + /*..................................................................... + Convert query string parameters to variables and initialize output. + */ + var( + 'Type' = action_param('Type'), + 'CurrentFolder' = action_param('CurrentFolder'), + 'ServerPath' = action_param('ServerPath'), + 'NewFile' = null, + 'NewFileName' = string, + 'OrigFilePath' = string, + 'NewFilePath' = string, + 'errorNumber' = 0, + 'customMsg' = '' + ); + + $Type == '' ? $Type = 'File'; + + + /*..................................................................... + Calculate the path to the current folder. + */ + $ServerPath == '' ? $ServerPath = $config->find('UserFilesPath'); + + var('currentFolderURL' = $ServerPath + + $config->find('Subdirectories')->find(action_param('Type')) + + action_param('CurrentFolder') + ); + + /*..................................................................... + Custom tag sets the HTML response. + */ + + define_tag( + 'sendresults', + -namespace='fck_', + -priority='replace', + -required='errorNumber', + -type='integer', + -optional='fileUrl', + -type='string', + -optional='fileName', + -type='string', + -optional='customMsg', + -type='string', + -description='Sets the HTML response for the FCKEditor Quick Upload feature.' + ); + + $__html_reply__ = ' + '; + /define_tag; + + if($CurrentFolder->(Find: '..') || $CurrentFolder->(Find: '\\')); + $errorNumber = 102; + /if; + + if($config->find('Enabled')); + /*................................................................. + Process an uploaded file. + */ + inline($connection); + /*............................................................. + Was a file actually uploaded? + */ + if($errorNumber != '102'); + file_uploads->size ? $NewFile = file_uploads->get(1) | $errorNumber = 202; + /if; + + if($errorNumber == 0); + /*......................................................... + Split the file's extension from the filename in order + to follow the API's naming convention for duplicate + files. (Test.txt, Test(1).txt, Test(2).txt, etc.) + */ + $NewFileName = $NewFile->find('OrigName'); + $OrigFilePath = $currentFolderURL + $NewFileName; + $NewFilePath = $OrigFilePath; + local('fileExtension') = '.' + $NewFile->find('OrigExtension'); + local('shortFileName') = $NewFileName->removetrailing(#fileExtension)&; + + + /*......................................................... + Make sure the file extension is allowed. + */ + + if($config->find('DeniedExtensions')->find($Type) >> $NewFile->find('OrigExtension')); + $errorNumber = 202; + else; + /*..................................................... + Rename the target path until it is unique. + */ + while(file_exists($NewFilePath)); + $NewFileName = #shortFileName + '(' + loop_count + ')' + #fileExtension; + $NewFilePath = $currentFolderURL + $NewFileName; + /while; + + + /*..................................................... + Copy the uploaded file to its final location. + */ + file_copy($NewFile->find('path'), $NewFilePath); + + + /*..................................................... + Set the error code for the response. + */ + select(file_currenterror( -errorcode)); + case(0); + $OrigFilePath != $NewFilePath ? $errorNumber = 201; + case; + $errorNumber = 202; + /select; + /if; + /if; + /inline; + else; + $errorNumber = 1; + $customMsg = 'This file uploader is disabled. Please check the "editor/filemanager/upload/lasso/config.lasso" file.'; + /if; + + fck_sendresults( + -errorNumber=$errorNumber, + -fileUrl=$NewFilePath, + -fileName=$NewFileName, + -customMsg=$customMsg + ); +] Added: announcement/trunk/src/main/webapp/fckeditor/editor/filemanager/connectors/perl/basexml.pl =================================================================== --- announcement/trunk/src/main/webapp/fckeditor/editor/filemanager/connectors/perl/basexml.pl (rev 0) +++ announcement/trunk/src/main/webapp/fckeditor/editor/filemanager/connectors/perl/basexml.pl 2008-06-30 02:54:27 UTC (rev 1002) @@ -0,0 +1,63 @@ +##### +# FCKeditor - The text editor for Internet - http://www.fckeditor.net +# Copyright (C) 2003-2008 Frederico Caldeira Knabben +# +# == BEGIN LICENSE == +# +# Licensed under the terms of any of the following licenses at your +# choice: +# +# - GNU General Public License Version 2 or later (the "GPL") +# http://www.gnu.org/licenses/gpl.html +# +# - GNU Lesser General Public License Version 2.1 or later (the "LGPL") +# http://www.gnu.org/licenses/lgpl.html +# +# - Mozilla Public License Version 1.1 or later (the "MPL") +# http://www.mozilla.org/MPL/MPL-1.1.html +# +# == END LICENSE == +# +# This is the File Manager Connector for Perl. +##### + +sub CreateXmlHeader +{ + local($command,$resourceType,$currentFolder) = @_; + + # Create the XML document header. + print ''; + + # Create the main "Connector" node. + print ''; + + # Add the current folder node. + print ''; +} + +sub CreateXmlFooter +{ + print ''; +} + +sub SendError +{ + local( $number, $text ) = @_; + + print << "_HTML_HEAD_"; +Content-Type:text/xml; charset=utf-8 +Pragma: no-cache +Cache-Control: no-cache +Expires: Thu, 01 Dec 1994 16:00:00 GMT + +_HTML_HEAD_ + + # Create the XML document header + print '' ; + + print '' ; + + exit ; +} + +1; Property changes on: announcement/trunk/src/main/webapp/fckeditor/editor/filemanager/connectors/perl/basexml.pl ___________________________________________________________________ Name: svn:eol-style + native Added: announcement/trunk/src/main/webapp/fckeditor/editor/filemanager/connectors/perl/commands.pl =================================================================== --- announcement/trunk/src/main/webapp/fckeditor/editor/filemanager/connectors/perl/commands.pl (rev 0) +++ announcement/trunk/src/main/webapp/fckeditor/editor/filemanager/connectors/perl/commands.pl 2008-06-30 02:54:27 UTC (rev 1002) @@ -0,0 +1,187 @@ +##### +# FCKeditor - The text editor for Internet - http://www.fckeditor.net +# Copyright (C) 2003-2008 Frederico Caldeira Knabben +# +# == BEGIN LICENSE == +# +# Licensed under the terms of any of the following licenses at your +# choice: +# +# - GNU General Public License Version 2 or later (the "GPL") +# http://www.gnu.org/licenses/gpl.html +# +# - GNU Lesser General Public License Version 2.1 or later (the "LGPL") +# http://www.gnu.org/licenses/lgpl.html +# +# - Mozilla Public License Version 1.1 or later (the "MPL") +# http://www.mozilla.org/MPL/MPL-1.1.html +# +# == END LICENSE == +# +# This is the File Manager Connector for Perl. +##### + +sub GetFolders +{ + + local($resourceType, $currentFolder) = @_; + + # Map the virtual path to the local server path. + $sServerDir = &ServerMapFolder($resourceType, $currentFolder); + print ""; # Open the "Folders" node. + + opendir(DIR,"$sServerDir"); + @files = grep(!/^\.\.?$/,readdir(DIR)); + closedir(DIR); + + foreach $sFile (@files) { + if($sFile != '.' && $sFile != '..' && (-d "$sServerDir$sFile")) { + $cnv_filename = &ConvertToXmlAttribute($sFile); + print ''; + } + } + print ""; # Close the "Folders" node. +} + +sub GetFoldersAndFiles +{ + + local($resourceType, $currentFolder) = @_; + # Map the virtual path to the local server path. + $sServerDir = &ServerMapFolder($resourceType,$currentFolder); + + # Initialize the output buffers for "Folders" and "Files". + $sFolders = ''; + $sFiles = ''; + + opendir(DIR,"$sServerDir"); + @files = grep(!/^\.\.?$/,readdir(DIR)); + closedir(DIR); + + foreach $sFile (@files) { + if($sFile ne '.' && $sFile ne '..') { + if(-d "$sServerDir$sFile") { + $cnv_filename = &ConvertToXmlAttribute($sFile); + $sFolders .= '' ; + } else { + ($iFileSize,$refdate,$filedate,$fileperm) = (stat("$sServerDir$sFile"))[7,8,9,2]; + if($iFileSize > 0) { + $iFileSize = int($iFileSize / 1024); + if($iFileSize < 1) { + $iFileSize = 1; + } + } + $cnv_filename = &ConvertToXmlAttribute($sFile); + $sFiles .= '' ; + } + } + } + print $sFolders ; + print ''; # Close the "Folders" node. + print $sFiles ; + print ''; # Close the "Files" node. +} + +sub CreateFolder +{ + + local($resourceType, $currentFolder) = @_; + $sErrorNumber = '0' ; + $sErrorMsg = '' ; + + if($FORM{'NewFolderName'} ne "") { + $sNewFolderName = $FORM{'NewFolderName'}; + $sNewFolderName =~ s/\.|\\|\/|\||\:|\?|\*|\"|<|>|[[:cntrl:]]/_/g; + # Map the virtual path to the local server path of the current folder. + $sServerDir = &ServerMapFolder($resourceType, $currentFolder); + if(-w $sServerDir) { + $sServerDir .= $sNewFolderName; + $sErrorMsg = &CreateServerFolder($sServerDir); + if($sErrorMsg == 0) { + $sErrorNumber = '0'; + } elsif($sErrorMsg eq 'Invalid argument' || $sErrorMsg eq 'No such file or directory') { + $sErrorNumber = '102'; #// Path too long. + } else { + $sErrorNumber = '110'; + } + } else { + $sErrorNumber = '103'; + } + } else { + $sErrorNumber = '102' ; + } + # Create the "Error" node. + $cnv_errmsg = &ConvertToXmlAttribute($sErrorMsg); + print ''; +} + +sub FileUpload +{ +eval("use File::Copy;"); + + local($resourceType, $currentFolder) = @_; + + $sErrorNumber = '0' ; + $sFileName = '' ; + if($new_fname) { + # Map the virtual path to the local server path. + $sServerDir = &ServerMapFolder($resourceType,$currentFolder); + + # Get the uploaded file name. + $sFileName = $new_fname; + $sFileName =~ s/\\|\/|\||\:|\?|\*|\"|<|>|[[:cntrl:]]/_/g; + $sOriginalFileName = $sFileName; + + $iCounter = 0; + while(1) { + $sFilePath = $sServerDir . $sFileName; + if(-e $sFilePath) { + $iCounter++ ; + ($path,$BaseName,$ext) = &RemoveExtension($sOriginalFileName); + $sFileName = $BaseName . '(' . $iCounter . ').' . $ext; + $sErrorNumber = '201'; + } else { + copy("$img_dir/$new_fname","$sFilePath"); + if (defined $CHMOD_ON_UPLOAD) { + if ($CHMOD_ON_UPLOAD) { + umask(000); + chmod($CHMOD_ON_UPLOAD,$sFilePath); + } + } + else { + umask(000); + chmod(0777,$sFilePath); + } + unlink("$img_dir/$new_fname"); + last; + } + } + } else { + $sErrorNumber = '202' ; + } + $sFileName =~ s/"/\\"/g; + + SendUploadResults($sErrorNumber, $resourceType.$currentFolder.$sFileName, $sFileName, ''); +} + +sub SendUploadResults +{ + + local($sErrorNumber, $sFileUrl, $sFileName, $customMsg) = @_; + + # Minified version of the document.domain automatic fix script (#1919). + # The original script can be found at _dev/domain_fix_template.js + # Note: in Perl replace \ with \\ and $ with \$ + print < +(function(){var d=document.domain;while (true){try{var A=window.parent.document.domain;break;}catch(e) {};d=d.replace(/.*?(?:\\.|\$)/,'');if (d.length==0) break;try{document.domain=d;}catch (e){break;}}})(); + +EOF + print 'window.parent.OnUploadCompleted(' . $sErrorNumber . ',"' . JS_cnv($sFileUrl) . '","' . JS_cnv($sFileName) . '","' . JS_cnv($customMsg) . '") ;'; + print ''; + exit ; +} + +1; Property changes on: announcement/trunk/src/main/webapp/fckeditor/editor/filemanager/connectors/perl/commands.pl ___________________________________________________________________ Name: svn:eol-style + native Added: announcement/trunk/src/main/webapp/fckeditor/editor/filemanager/connectors/perl/connector.cgi =================================================================== --- announcement/trunk/src/main/webapp/fckeditor/editor/filemanager/connectors/perl/connector.cgi (rev 0) +++ announcement/trunk/src/main/webapp/fckeditor/editor/filemanager/connectors/perl/connector.cgi 2008-06-30 02:54:27 UTC (rev 1002) @@ -0,0 +1,136 @@ +#!/usr/bin/env perl + +##### +# FCKeditor - The text editor for Internet - http://www.fckeditor.net +# Copyright (C) 2003-2008 Frederico Caldeira Knabben +# +# == BEGIN LICENSE == +# +# Licensed under the terms of any of the following licenses at your +# choice: +# +# - GNU General Public License Version 2 or later (the "GPL") +# http://www.gnu.org/licenses/gpl.html +# +# - GNU Lesser General Public License Version 2.1 or later (the "LGPL") +# http://www.gnu.org/licenses/lgpl.html +# +# - Mozilla Public License Version 1.1 or later (the "MPL") +# http://www.mozilla.org/MPL/MPL-1.1.html +# +# == END LICENSE == +# +# This is the File Manager Connector for Perl. +##### + +## +# ATTENTION: To enable this connector, look for the "SECURITY" comment in this file. +## + +## START: Hack for Windows (Not important to understand the editor code... Perl specific). +if(Windows_check()) { + chdir(GetScriptPath($0)); +} + +sub Windows_check +{ + # IIS,PWS(NT/95) + $www_server_os = $^O; + # Win98 & NT(SP4) + if($www_server_os eq "") { $www_server_os= $ENV{'OS'}; } + # AnHTTPd/Omni/IIS + if($ENV{'SERVER_SOFTWARE'} =~ /AnWeb|Omni|IIS\//i) { $www_server_os= 'win'; } + # Win Apache + if($ENV{'WINDIR'} ne "") { $www_server_os= 'win'; } + if($www_server_os=~ /win/i) { return(1); } + return(0); +} + +sub GetScriptPath { + local($path) = @_; + if($path =~ /[\:\/\\]/) { $path =~ s/(.*?)[\/\\][^\/\\]+$/$1/; } else { $path = '.'; } + $path; +} +## END: Hack for IIS + +require 'util.pl'; +require 'io.pl'; +require 'basexml.pl'; +require 'commands.pl'; +require 'upload_fck.pl'; + +## +# SECURITY: REMOVE/COMMENT THE FOLLOWING LINE TO ENABLE THIS CONNECTOR. +## + &SendError( 1, 'This connector is disabled. Please check the "editor/filemanager/connectors/perl/connector.cgi" file' ) ; + + &read_input(); + + if($FORM{'ServerPath'} ne "") { + $GLOBALS{'UserFilesPath'} = $FORM{'ServerPath'}; + if(!($GLOBALS{'UserFilesPath'} =~ /\/$/)) { + $GLOBALS{'UserFilesPath'} .= '/' ; + } + } else { + $GLOBALS{'UserFilesPath'} = '/userfiles/'; + } + + # Map the "UserFiles" path to a local directory. + $rootpath = &GetRootPath(); + $GLOBALS{'UserFilesDirectory'} = $rootpath . $GLOBALS{'UserFilesPath'}; + + &DoResponse(); + +sub DoResponse +{ + + if($FORM{'Command'} eq "" || $FORM{'Type'} eq "" || $FORM{'CurrentFolder'} eq "") { + return ; + } + # Get the main request informaiton. + $sCommand = $FORM{'Command'}; + $sResourceType = $FORM{'Type'}; + $sCurrentFolder = $FORM{'CurrentFolder'}; + + # Check the current folder syntax (must begin and start with a slash). + if(!($sCurrentFolder =~ /\/$/)) { + $sCurrentFolder .= '/'; + } + if(!($sCurrentFolder =~ /^\//)) { + $sCurrentFolder = '/' . $sCurrentFolder; + } + + # Check for invalid folder paths (..) + if ( $sCurrentFolder =~ /(?:\.\.|\\)/ ) { + SendError( 102, "" ) ; + } + + # File Upload doesn't have to Return XML, so it must be intercepted before anything. + if($sCommand eq 'FileUpload') { + FileUpload($sResourceType,$sCurrentFolder); + return ; + } + + print << "_HTML_HEAD_"; +Content-Type:text/xml; charset=utf-8 +Pragma: no-cache +Cache-Control: no-cache +Expires: Thu, 01 Dec 1994 16:00:00 GMT + +_HTML_HEAD_ + + &CreateXmlHeader($sCommand,$sResourceType,$sCurrentFolder); + + # Execute the required command. + if($sCommand eq 'GetFolders') { + &GetFolders($sResourceType,$sCurrentFolder); + } elsif($sCommand eq 'GetFoldersAndFiles') { + &GetFoldersAndFiles($sResourceType,$sCurrentFolder); + } elsif($sCommand eq 'CreateFolder') { + &CreateFolder($sResourceType,$sCurrentFolder); + } + + &CreateXmlFooter(); + + exit ; +} Property changes on: announcement/trunk/src/main/webapp/fckeditor/editor/filemanager/connectors/perl/connector.cgi ___________________________________________________________________ Name: svn:eol-style + native Added: announcement/trunk/src/main/webapp/fckeditor/editor/filemanager/connectors/perl/io.pl =================================================================== --- announcement/trunk/src/main/webapp/fckeditor/editor/filemanager/connectors/perl/io.pl (rev 0) +++ announcement/trunk/src/main/webapp/fckeditor/editor/filemanager/connectors/perl/io.pl 2008-06-30 02:54:27 UTC (rev 1002) @@ -0,0 +1,141 @@ +##### +# FCKeditor - The text editor for Internet - http://www.fckeditor.net +# Copyright (C) 2003-2008 Frederico Caldeira Knabben +# +# == BEGIN LICENSE == +# +# Licensed under the terms of any of the following licenses at your +# choice: +# +# - GNU General Public License Version 2 or later (the "GPL") +# http://www.gnu.org/licenses/gpl.html +# +# - GNU Lesser General Public License Version 2.1 or later (the "LGPL") +# http://www.gnu.org/licenses/lgpl.html +# +# - Mozilla Public License Version 1.1 or later (the "MPL") +# http://www.mozilla.org/MPL/MPL-1.1.html +# +# == END LICENSE == +# +# This is the File Manager Connector for Perl. +##### + +sub GetUrlFromPath +{ + local($resourceType, $folderPath) = @_; + + if($resourceType eq '') { + $rmpath = &RemoveFromEnd($GLOBALS{'UserFilesPath'},'/'); + return("$rmpath$folderPath"); + } else { + return("$GLOBALS{'UserFilesPath'}$resourceType$folderPath"); + } +} + +sub RemoveExtension +{ + local($fileName) = @_; + local($path, $base, $ext); + if($fileName !~ /\./) { + $fileName .= '.'; + } + if($fileName =~ /([^\\\/]*)\.(.*)$/) { + $base = $1; + $ext = $2; + if($fileName =~ /(.*)$base\.$ext$/) { + $path = $1; + } + } + return($path,$base,$ext); + +} + +sub ServerMapFolder +{ + local($resourceType,$folderPath) = @_; + + # Get the resource type directory. + $sResourceTypePath = $GLOBALS{'UserFilesDirectory'} . $resourceType . '/'; + + # Ensure that the directory exists. + &CreateServerFolder($sResourceTypePath); + + # Return the resource type directory combined with the required path. + $rmpath = &RemoveFromStart($folderPath,'/'); + return("$sResourceTypePath$rmpath"); +} + +sub GetParentFolder +{ + local($folderPath) = @_; + + $folderPath =~ s/[\/][^\/]+[\/]?$//g; + return $folderPath; +} + +sub CreateServerFolder +{ + local($folderPath) = @_; + + $sParent = &GetParentFolder($folderPath); + # Check if the parent exists, or create it. + if(!(-e $sParent)) { + $sErrorMsg = &CreateServerFolder($sParent); + if($sErrorMsg == 1) { + return(1); + } + } + if(!(-e $folderPath)) { + if (defined $CHMOD_ON_FOLDER_CREATE && !$CHMOD_ON_FOLDER_CREATE) { + mkdir("$folderPath"); + } + else { + umask(000); + if (defined $CHMOD_ON_FOLDER_CREATE) { + mkdir("$folderPath",$CHMOD_ON_FOLDER_CREATE); + } + else { + mkdir("$folderPath",0777); + } + } + + return(0); + } else { + return(1); + } +} + +sub GetRootPath +{ +#use Cwd; + +# my $dir = getcwd; +# print $dir; +# $dir =~ s/$ENV{'DOCUMENT_ROOT'}//g; +# print $dir; +# return($dir); + +# $wk = $0; +# $wk =~ s/\/connector\.cgi//g; +# if($wk) { +# $current_dir = $wk; +# } else { +# $current_dir = `pwd`; +# } +# return($current_dir); +use Cwd; + + if($ENV{'DOCUMENT_ROOT'}) { + $dir = $ENV{'DOCUMENT_ROOT'}; + } else { + my $dir = getcwd; + $workdir =~ s/\/connector\.cgi//g; + $dir =~ s/$workdir//g; + } + return($dir); + + + +} +1; Property changes on: announcement/trunk/src/main/webapp/fckeditor/editor/filemanager/connectors/perl/io.pl ___________________________________________________________________ Name: svn:eol-style + native Added: announcement/trunk/src/main/webapp/fckeditor/editor/filemanager/connectors/perl/upload.cgi =================================================================== --- announcement/trunk/src/main/webapp/fckeditor/editor/filemanager/connectors/perl/upload.cgi (rev 0) +++ announcement/trunk/src/main/webapp/fckeditor/editor/filemanager/connectors/perl/upload.cgi 2008-06-30 02:54:27 UTC (rev 1002) @@ -0,0 +1,117 @@ +#!/usr/bin/env perl + +##### +# FCKeditor - The text editor for Internet - http://www.fckeditor.net +# Copyright (C) 2003-2008 Frederico Caldeira Knabben +# +# == BEGIN LICENSE == +# +# Licensed under the terms of any of the following licenses at your +# choice: +# +# - GNU General Public License Version 2 or later (the "GPL") +# http://www.gnu.org/licenses/gpl.html +# +# - GNU Lesser General Public License Version 2.1 or later (the "LGPL") +# http://www.gnu.org/licenses/lgpl.html +# +# - Mozilla Public License Version 1.1 or later (the "MPL") +# http://www.mozilla.org/MPL/MPL-1.1.html +# +# == END LICENSE == +# +# This is the File Manager Connector for Perl. +##### + +## +# ATTENTION: To enable this connector, look for the "SECURITY" comment in this file. +## + +## START: Hack for Windows (Not important to understand the editor code... Perl specific). +if(Windows_check()) { + chdir(GetScriptPath($0)); +} + +sub Windows_check +{ + # IIS,PWS(NT/95) + $www_server_os = $^O; + # Win98 & NT(SP4) + if($www_server_os eq "") { $www_server_os= $ENV{'OS'}; } + # AnHTTPd/Omni/IIS + if($ENV{'SERVER_SOFTWARE'} =~ /AnWeb|Omni|IIS\//i) { $www_server_os= 'win'; } + # Win Apache + if($ENV{'WINDIR'} ne "") { $www_server_os= 'win'; } + if($www_server_os=~ /win/i) { return(1); } + return(0); +} + +sub GetScriptPath { + local($path) = @_; + if($path =~ /[\:\/\\]/) { $path =~ s/(.*?)[\/\\][^\/\\]+$/$1/; } else { $path = '.'; } + $path; +} +## END: Hack for IIS + +require 'util.pl'; +require 'io.pl'; +require 'basexml.pl'; +require 'commands.pl'; +require 'upload_fck.pl'; + +## +# SECURITY: REMOVE/COMMENT THE FOLLOWING LINE TO ENABLE THIS CONNECTOR. +## + &SendUploadResults(1, '', '', 'This connector is disabled. Please check the "editor/filemanager/connectors/perl/upload.cgi" file' ) ; + + &read_input(); + + if($FORM{'ServerPath'} ne "") { + $GLOBALS{'UserFilesPath'} = $FORM{'ServerPath'}; + if(!($GLOBALS{'UserFilesPath'} =~ /\/$/)) { + $GLOBALS{'UserFilesPath'} .= '/' ; + } + } else { + $GLOBALS{'UserFilesPath'} = '/userfiles/'; + } + + # Map the "UserFiles" path to a local directory. + $rootpath = &GetRootPath(); + $GLOBALS{'UserFilesDirectory'} = $rootpath . $GLOBALS{'UserFilesPath'}; + + &DoResponse(); + +sub DoResponse +{ + # Get the main request information. + $sCommand = 'FileUpload'; #$FORM{'Command'}; + $sResourceType = $FORM{'Type'}; + $sCurrentFolder = $FORM{'CurrentFolder'}; + + if ($sResourceType eq '') { + $sResourceType = 'File' ; + } + if ($sCurrentFolder eq '') { + $sCurrentFolder = '/' ; + } + + # Check the current folder syntax (must begin and start with a slash). + if(!($sCurrentFolder =~ /\/$/)) { + $sCurrentFolder .= '/'; + } + if(!($sCurrentFolder =~ /^\//)) { + $sCurrentFolder = '/' . $sCurrentFolder; + } + + # Check for invalid folder paths (..) + if ( $sCurrentFolder =~ /(?:\.\.|\\)/ ) { + SendError( 102, "" ) ; + } + + # File Upload doesn't have to Return XML, so it must be intercepted before anything. + if($sCommand eq 'FileUpload') { + FileUpload($sResourceType,$sCurrentFolder); + return ; + } + +} Property changes on: announcement/trunk/src/main/webapp/fckeditor/editor/filemanager/connectors/perl/upload.cgi ___________________________________________________________________ Name: svn:eol-style + native Added: announcement/trunk/src/main/webapp/fckeditor/editor/filemanager/connectors/perl/upload_fck.pl =================================================================== --- announcement/trunk/src/main/webapp/fckeditor/editor/filemanager/connectors/perl/upload_fck.pl (rev 0) +++ announcement/trunk/src/main/webapp/fckeditor/editor/filemanager/connectors/perl/upload_fck.pl 2008-06-30 02:54:27 UTC (rev 1002) @@ -0,0 +1,686 @@ +##### +# FCKeditor - The text editor for Internet - http://www.fckeditor.net +# Copyright (C) 2003-2008 Frederico Caldeira Knabben +# +# == BEGIN LICENSE == +# +# Licensed under the terms of any of the following licenses at your +# choice: +# +# - GNU General Public License Version 2 or later (the "GPL") +# http://www.gnu.org/licenses/gpl.html +# +# - GNU Lesser General Public License Version 2.1 or later (the "LGPL") +# http://www.gnu.org/licenses/lgpl.html +# +# - Mozilla Public License Version 1.1 or later (the "MPL") +# http://www.mozilla.org/MPL/MPL-1.1.html +# +# == END LICENSE == +# +# This is the File Manager Connector for Perl. +##### + +# image data save dir +$img_dir = './temp/'; + + +# File size max(unit KB) +$MAX_CONTENT_SIZE = 30000; + +# After file is uploaded, sometimes it is required to change its permissions +# so that it was possible to access it at the later time. +# If possible, it is recommended to set more restrictive permissions, like 0755. +# Set to 0 to disable this feature. +$CHMOD_ON_UPLOAD = 0777; + +# See comments above. +# Used when creating folders that does not exist. +$CHMOD_ON_FOLDER_CREATE = 0755; + +# Filelock (1=use,0=not use) +$PM{'flock'} = '1'; + + +# upload Content-Type list +my %UPLOAD_CONTENT_TYPE_LIST = ( + 'image/(x-)?png' => 'png', # PNG image + 'image/p?jpe?g' => 'jpg', # JPEG image + 'image/gif' => 'gif', # GIF image + 'image/x-xbitmap' => 'xbm', # XBM image + + 'image/(x-(MS-)?)?bmp' => 'bmp', # Windows BMP image + 'image/pict' => 'pict', # Macintosh PICT image + 'image/tiff' => 'tif', # TIFF image + 'application/pdf' => 'pdf', # PDF image + 'application/x-shockwave-flash' => 'swf', # Shockwave Flash + + 'video/(x-)?msvideo' => 'avi', # Microsoft Video + 'video/quicktime' => 'mov', # QuickTime Video + 'video/mpeg' => 'mpeg', # MPEG Video + 'video/x-mpeg2' => 'mpv2', # MPEG2 Video + + 'audio/(x-)?midi?' => 'mid', # MIDI Audio + 'audio/(x-)?wav' => 'wav', # WAV Audio + 'audio/basic' => 'au', # ULAW Audio + 'audio/mpeg' => 'mpga', # MPEG Audio + + 'application/(x-)?zip(-compressed)?' => 'zip', # ZIP Compress + + 'text/html' => 'html', # HTML + 'text/plain' => 'txt', # TEXT + '(?:application|text)/(?:rtf|richtext)' => 'rtf', # RichText + + 'application/msword' => 'doc', # Microsoft Word + 'application/vnd.ms-excel' => 'xls', # Microsoft Excel + + '' +); + +# Upload is permitted. +# A regular expression is possible. +my %UPLOAD_EXT_LIST = ( + 'png' => 'PNG image', + 'p?jpe?g|jpe|jfif|pjp' => 'JPEG image', + 'gif' => 'GIF image', + 'xbm' => 'XBM image', + + 'bmp|dib|rle' => 'Windows BMP image', + 'pi?ct' => 'Macintosh PICT image', + 'tiff?' => 'TIFF image', + 'pdf' => 'PDF image', + 'swf' => 'Shockwave Flash', + + 'avi' => 'Microsoft Video', + 'moo?v|qt' => 'QuickTime Video', + 'm(p(e?gv?|e|v)|1v)' => 'MPEG Video', + 'mp(v2|2v)' => 'MPEG2 Video', + + 'midi?|kar|smf|rmi|mff' => 'MIDI Audio', + 'wav' => 'WAVE Audio', + 'au|snd' => 'ULAW Audio', + 'mp(e?ga|2|a|3)|abs' => 'MPEG Audio', + + 'zip' => 'ZIP Compress', + 'lzh' => 'LZH Compress', + 'cab' => 'CAB Compress', + + 'd?html?' => 'HTML', + 'rtf|rtx' => 'RichText', + 'txt|text' => 'Text', + + '' +); + + +# sjis or euc +my $CHARCODE = 'sjis'; + +$TRANS_2BYTE_CODE = 0; + +############################################################################## +# Summary +# +# Form Read input +# +# Parameters +# Returns +# Memo +############################################################################## +sub read_input +{ +eval("use File::Copy;"); +eval("use File::Path;"); + + my ($FORM) = @_; + + if (defined $CHMOD_ON_FOLDER_CREATE && !$CHMOD_ON_FOLDER_CREATE) { + mkdir("$img_dir"); + } + else { + umask(000); + if (defined $CHMOD_ON_FOLDER_CREATE) { + mkdir("$img_dir",$CHMOD_ON_FOLDER_CREATE); + } + else { + mkdir("$img_dir",0777); + } + } + + undef $img_data_exists; + undef @NEWFNAMES; + undef @NEWFNAME_DATA; + + if($ENV{'CONTENT_LENGTH'} > 10000000 || $ENV{'CONTENT_LENGTH'} > $MAX_CONTENT_SIZE * 1024) { + &upload_error( + 'Size Error', + sprintf( + "Transmitting size is too large.MAX %d KB Now Size %d KB(%d bytes Over)", + $MAX_CONTENT_SIZE, + int($ENV{'CONTENT_LENGTH'} / 1024), + $ENV{'CONTENT_LENGTH'} - $MAX_CONTENT_SIZE * 1024 + ) + ); + } + + my $Buffer; + if($ENV{'CONTENT_TYPE'} =~ /multipart\/form-data/) { + # METHOD POST only + return unless($ENV{'CONTENT_LENGTH'}); + + binmode(STDIN); + # STDIN A pause character is detected.'(MacIE3.0 boundary of $ENV{'CONTENT_TYPE'} cannot be trusted.) + my $Boundary = ; + $Boundary =~ s/\x0D\x0A//; + $Boundary = quotemeta($Boundary); + while() { + if(/^\s*Content-Disposition:/i) { + my($name,$ContentType,$FileName); + # form data get + if(/\bname="([^"]+)"/i || /\bname=([^\s:;]+)/i) { + $name = $1; + $name =~ tr/+/ /; + $name =~ s/%([a-fA-F0-9][a-fA-F0-9])/pack("C", hex($1))/eg; + &Encode(\$name); + } + if(/\bfilename="([^"]*)"/i || /\bfilename=([^\s:;]*)/i) { + $FileName = $1 || 'unknown'; + } + # head read + while() { + last if(! /\w/); + if(/^\s*Content-Type:\s*"([^"]+)"/i || /^\s*Content-Type:\s*([^\s:;]+)/i) { + $ContentType = $1; + } + } + # body read + $value = ""; + while() { + last if(/^$Boundary/o); + $value .= $_; + }; + $lastline = $_; + $value =~s /\x0D\x0A$//; + if($value ne '') { + if($FileName || $ContentType) { + $img_data_exists = 1; + ( + $FileName, # + $Ext, # + $Length, # + $ImageWidth, # + $ImageHeight, # + $ContentName # + ) = &CheckContentType(\$value,$FileName,$ContentType); + + $FORM{$name} = $FileName; + $new_fname = $FileName; + push(@NEWFNAME_DATA,"$FileName\t$Ext\t$Length\t$ImageWidth\t$ImageHeight\t$ContentName"); + + # Multi-upload correspondence + push(@NEWFNAMES,$new_fname); + open(OUT,">$img_dir/$new_fname"); + binmode(OUT); + eval "flock(OUT,2);" if($PM{'flock'} == 1); + print OUT $value; + eval "flock(OUT,8);" if($PM{'flock'} == 1); + close(OUT); + + } elsif($name) { + $value =~ tr/+/ /; + $value =~ s/%([a-fA-F0-9][a-fA-F0-9])/pack("C", hex($1))/eg; + &Encode(\$value,'trans'); + $FORM{$name} .= "\0" if(defined($FORM{$name})); + $FORM{$name} .= $value; + } + } + }; + last if($lastline =~ /^$Boundary\-\-/o); + } + } elsif($ENV{'CONTENT_LENGTH'}) { + read(STDIN,$Buffer,$ENV{'CONTENT_LENGTH'}); + } + foreach(split(/&/,$Buffer),split(/&/,$ENV{'QUERY_STRING'})) { + my($name, $value) = split(/=/); + $name =~ tr/+/ /; + $name =~ s/%([a-fA-F0-9][a-fA-F0-9])/pack("C", hex($1))/eg; + $value =~ tr/+/ /; + $value =~ s/%([a-fA-F0-9][a-fA-F0-9])/pack("C", hex($1))/eg; + + &Encode(\$name); + &Encode(\$value,'trans'); + $FORM{$name} .= "\0" if(defined($FORM{$name})); + $FORM{$name} .= $value; + + } + +} + +############################################################################## +# Summary +# +# CheckContentType +# +# Parameters +# Returns +# Memo +############################################################################## +sub CheckContentType +{ + + my($DATA,$FileName,$ContentType) = @_; + my($Ext,$ImageWidth,$ImageHeight,$ContentName,$Infomation); + my $DataLength = length($$DATA); + + # An unknown file type + + $_ = $ContentType; + my $UnknownType = ( + !$_ + || /^application\/(x-)?macbinary$/i + || /^application\/applefile$/i + || /^application\/octet-stream$/i + || /^text\/plane$/i + || /^x-unknown-content-type/i + ); + + # MacBinary(Mac Unnecessary data are deleted.) + if($UnknownType || $ENV{'HTTP_USER_AGENT'} =~ /Macintosh|Mac_/) { + if($DataLength > 128 && !unpack("C",substr($$DATA,0,1)) && !unpack("C",substr($$DATA,74,1)) && !unpack("C",substr($$DATA,82,1)) ) { + my $MacBinary_ForkLength = unpack("N", substr($$DATA, 83, 4)); # ForkLength Get + my $MacBinary_FileName = quotemeta(substr($$DATA, 2, unpack("C",substr($$DATA, 1, 1)))); + if($MacBinary_FileName && $MacBinary_ForkLength && $DataLength >= $MacBinary_ForkLength + 128 + && ($FileName =~ /$MacBinary_FileName/i || substr($$DATA,102,4) eq 'mBIN')) { # DATA TOP 128byte MacBinary!! + $$DATA = substr($$DATA,128,$MacBinary_ForkLength); + my $ResourceLength = $DataLength - $MacBinary_ForkLength - 128; + $DataLength = $MacBinary_ForkLength; + } + } + } + + # A file name is changed into EUC. +# &jcode::convert(\$FileName,'euc',$FormCodeDefault); +# &jcode::h2z_euc(\$FileName); + $FileName =~ s/^.*\\//; # Windows, Mac + $FileName =~ s/^.*\///; # UNIX + $FileName =~ s/&/&/g; + $FileName =~ s/"/"/g; + $FileName =~ s//>/g; +# +# if($CHARCODE ne 'euc') { +# &jcode::convert(\$FileName,$CHARCODE,'euc'); +# } + + # An extension is extracted and it changes into a small letter. + my $FileExt; + if($FileName =~ /\.(\w+)$/) { + $FileExt = $1; + $FileExt =~ tr/A-Z/a-z/; + } + + # Executable file detection (ban on upload) + if($$DATA =~ /^MZ/) { + $Ext = 'exe'; + } + # text + if(!$Ext && ($UnknownType || $ContentType =~ /^text\//i || $ContentType =~ /^application\/(?:rtf|richtext)$/i || $ContentType =~ /^image\/x-xbitmap$/i) + && ! $$DATA =~ /[\000-\006\177\377]/) { +# $$DATA =~ s/\x0D\x0A/\n/g; +# $$DATA =~ tr/\x0D\x0A/\n\n/; +# +# if( +# $$DATA =~ /<\s*SCRIPT(?:.|\n)*?>/i +# || $$DATA =~ /<\s*(?:.|\n)*?\bONLOAD\s*=(?:.|\n)*?>/i +# || $$DATA =~ /<\s*(?:.|\n)*?\bONCLICK\s*=(?:.|\n)*?>/i +# ) { +# $Infomation = '(JavaScript contains)'; +# } +# if($$DATA =~ /<\s*TABLE(?:.|\n)*?>/i +# || $$DATA =~ /<\s*BLINK(?:.|\n)*?>/i +# || $$DATA =~ /<\s*MARQUEE(?:.|\n)*?>/i +# || $$DATA =~ /<\s*OBJECT(?:.|\n)*?>/i +# || $$DATA =~ /<\s*EMBED(?:.|\n)*?>/i +# || $$DATA =~ /<\s*FRAME(?:.|\n)*?>/i +# || $$DATA =~ /<\s*APPLET(?:.|\n)*?>/i +# || $$DATA =~ /<\s*FORM(?:.|\n)*?>/i +# || $$DATA =~ /<\s*(?:.|\n)*?\bSRC\s*=(?:.|\n)*?>/i +# || $$DATA =~ /<\s*(?:.|\n)*?\bDYNSRC\s*=(?:.|\n)*?>/i +# ) { +# $Infomation = '(the HTML tag which is not safe is included)'; +# } + + if($FileExt =~ /^txt$/i || $FileExt =~ /^cgi$/i || $FileExt =~ /^pl$/i) { # Text File + $Ext = 'txt'; + } elsif($ContentType =~ /^text\/html$/i || $FileExt =~ /html?/i || $$DATA =~ /<\s*HTML(?:.|\n)*?>/i) { # HTML File + $Ext = 'html'; + } elsif($ContentType =~ /^image\/x-xbitmap$/i || $FileExt =~ /^xbm$/i) { # XBM(x-BitMap) Image + my $XbmName = $1; + my ($XbmWidth, $XbmHeight); + if($$DATA =~ /\#define\s*$XbmName\_width\s*(\d+)/i) { + $XbmWidth = $1; + } + if($$DATA =~ /\#define\s*$XbmName\_height\s*(\d+)/i) { + $XbmHeight = $1; + } + if($XbmWidth && $XbmHeight) { + $Ext = 'xbm'; + $ImageWidth = $XbmWidth; + $ImageHeight = $XbmHeight; + } + } else { # + $Ext = 'txt'; + } + } + + # image + if(!$Ext && ($UnknownType || $ContentType =~ /^image\//i)) { + # PNG + if($$DATA =~ /^\x89PNG\x0D\x0A\x1A\x0A/) { + if(substr($$DATA, 12, 4) eq 'IHDR') { + $Ext = 'png'; + ($ImageWidth, $ImageHeight) = unpack("N2", substr($$DATA, 16, 8)); + } + } elsif($$DATA =~ /^GIF8(?:9|7)a/) { # GIF89a(modified), GIF89a, GIF87a + $Ext = 'gif'; + ($ImageWidth, $ImageHeight) = unpack("v2", substr($$DATA, 6, 4)); + } elsif($$DATA =~ /^II\x2a\x00\x08\x00\x00\x00/ || $$DATA =~ /^MM\x00\x2a\x00\x00\x00\x08/) { # TIFF + $Ext = 'tif'; + } elsif($$DATA =~ /^BM/) { # BMP + $Ext = 'bmp'; + } elsif($$DATA =~ /^\xFF\xD8\xFF/ || $$DATA =~ /JFIF/) { # JPEG + my $HeaderPoint = index($$DATA, "\xFF\xD8\xFF", 0); + my $Point = $HeaderPoint + 2; + while($Point < $DataLength) { + my($Maker, $MakerType, $MakerLength) = unpack("C2n",substr($$DATA,$Point,4)); + if($Maker != 0xFF || $MakerType == 0xd9 || $MakerType == 0xda) { + last; + } elsif($MakerType >= 0xC0 && $MakerType <= 0xC3) { + $Ext = 'jpg'; + ($ImageHeight, $ImageWidth) = unpack("n2", substr($$DATA, $Point + 5, 4)); + if($HeaderPoint > 0) { + $$DATA = substr($$DATA, $HeaderPoint); + $DataLength = length($$DATA); + } + last; + } else { + $Point += $MakerLength + 2; + } + } + } + } + + # audio + if(!$Ext && ($UnknownType || $ContentType =~ /^audio\//i)) { + # MIDI Audio + if($$DATA =~ /^MThd/) { + $Ext = 'mid'; + } elsif($$DATA =~ /^\x2esnd/) { # ULAW Audio + $Ext = 'au'; + } elsif($$DATA =~ /^RIFF/ || $$DATA =~ /^ID3/ && $$DATA =~ /RIFF/) { + my $HeaderPoint = index($$DATA, "RIFF", 0); + $_ = substr($$DATA, $HeaderPoint + 8, 8); + if(/^WAVEfmt $/) { + # WAVE + if(unpack("V",substr($$DATA, $HeaderPoint + 16, 4)) == 16) { + $Ext = 'wav'; + } else { # RIFF WAVE MP3 + $Ext = 'mp3'; + } + } elsif(/^RMIDdata$/) { # RIFF MIDI + $Ext = 'rmi'; + } elsif(/^RMP3data$/) { # RIFF MP3 + $Ext = 'rmp'; + } + if($ContentType =~ /^audio\//i) { + $Infomation .= '(RIFF '. substr($$DATA, $HeaderPoint + 8, 4). ')'; + } + } + } + + # a binary file + unless ($Ext) { + # PDF image + if($$DATA =~ /^\%PDF/) { + # Picture size is not measured. + $Ext = 'pdf'; + } elsif($$DATA =~ /^FWS/) { # Shockwave Flash + $Ext = 'swf'; + } elsif($$DATA =~ /^RIFF/ || $$DATA =~ /^ID3/ && $$DATA =~ /RIFF/) { + my $HeaderPoint = index($$DATA, "RIFF", 0); + $_ = substr($$DATA,$HeaderPoint + 8, 8); + # AVI + if(/^AVI LIST$/) { + $Ext = 'avi'; + } + if($ContentType =~ /^video\//i) { + $Infomation .= '(RIFF '. substr($$DATA, $HeaderPoint + 8, 4). ')'; + } + } elsif($$DATA =~ /^PK/) { # ZIP Compress File + $Ext = 'zip'; + } elsif($$DATA =~ /^MSCF/) { # CAB Compress File + $Ext = 'cab'; + } elsif($$DATA =~ /^Rar\!/) { # RAR Compress File + $Ext = 'rar'; + } elsif(substr($$DATA, 2, 5) =~ /^\-lh(\d+|d)\-$/) { # LHA Compress File + $Infomation .= "(lh$1)"; + $Ext = 'lzh'; + } elsif(substr($$DATA, 325, 25) eq "Apple Video Media Handler" || substr($$DATA, 325, 30) eq "Apple \x83\x72\x83\x66\x83\x49\x81\x45\x83\x81\x83\x66\x83\x42\x83\x41\x83\x6E\x83\x93\x83\x68\x83\x89") { + # QuickTime + $Ext = 'mov'; + } + } + + # Header analysis failure + unless ($Ext) { + # It will be followed if it applies for the MIME type from the browser. + foreach (keys %UPLOAD_CONTENT_TYPE_LIST) { + next unless ($_); + if($ContentType =~ /^$_$/i) { + $Ext = $UPLOAD_CONTENT_TYPE_LIST{$_}; + $ContentName = &CheckContentExt($Ext); + if( + grep {$_ eq $Ext;} ( + 'png', + 'gif', + 'jpg', + 'xbm', + 'tif', + 'bmp', + 'pdf', + 'swf', + 'mov', + 'zip', + 'cab', + 'lzh', + 'rar', + 'mid', + 'rmi', + 'au', + 'wav', + 'avi', + 'exe' + ) + ) { + $Infomation .= ' / Header analysis failure'; + } + if($Ext ne $FileExt && &CheckContentExt($FileExt) eq $ContentName) { + $Ext = $FileExt; + } + last; + } + } + # a MIME type is unknown--It judges from an extension. + unless ($Ext) { + $ContentName = &CheckContentExt($FileExt); + if($ContentName) { + $Ext = $FileExt; + $Infomation .= ' / MIME type is unknown('. $ContentType. ')'; + last; + } + } + } + +# $ContentName = &CheckContentExt($Ext) unless($ContentName); +# if($Ext && $ContentName) { +# $ContentName .= $Infomation; +# } else { +# &upload_error( +# 'Extension Error', +# "$FileName A not corresponding extension ($Ext)
        The extension which can be responded ". join(',', sort values(%UPLOAD_EXT_LIST)) +# ); +# } + +# # SSI Tag Deletion +# if($Ext =~ /.?html?/ && $$DATA =~ /<\!/) { +# foreach ( +# 'config', +# 'echo', +# 'exec', +# 'flastmod', +# 'fsize', +# 'include' +# ) { +# $$DATA =~ s/\#\s*$_/\&\#35\;$_/ig +# } +# } + + return ( + $FileName, + $Ext, + int($DataLength / 1024 + 1), + $ImageWidth, + $ImageHeight, + $ContentName + ); +} + +############################################################################## +# Summary +# +# Extension discernment +# +# Parameters +# Returns +# Memo +############################################################################## + +sub CheckContentExt +{ + + my($Ext) = @_; + my $ContentName; + foreach (keys %UPLOAD_EXT_LIST) { + next unless ($_); + if($_ && $Ext =~ /^$_$/) { + $ContentName = $UPLOAD_EXT_LIST{$_}; + last; + } + } + return $ContentName; + +} + +############################################################################## +# Summary +# +# Form decode +# +# Parameters +# Returns +# Memo +############################################################################## +sub Encode +{ + + my($value,$Trans) = @_; + +# my $FormCode = &jcode::getcode($value) || $FormCodeDefault; +# $FormCodeDefault ||= $FormCode; +# +# if($Trans && $TRANS_2BYTE_CODE) { +# if($FormCode ne 'euc') { +# &jcode::convert($value, 'euc', $FormCode); +# } +# &jcode::tr( +# $value, +# "\xA3\xB0-\xA3\xB9\xA3\xC1-\xA3\xDA\xA3\xE1-\xA3\xFA", +# '0-9A-Za-z' +# ); +# if($CHARCODE ne 'euc') { +# &jcode::convert($value,$CHARCODE,'euc'); +# } +# } else { +# if($CHARCODE ne $FormCode) { +# &jcode::convert($value,$CHARCODE,$FormCode); +# } +# } +# if($CHARCODE eq 'euc') { +# &jcode::h2z_euc($value); +# } elsif($CHARCODE eq 'sjis') { +# &jcode::h2z_sjis($value); +# } + +} + +############################################################################## +# Summary +# +# Error Msg +# +# Parameters +# Returns +# Memo +############################################################################## + +sub upload_error +{ + + local($error_message) = $_[0]; + local($error_message2) = $_[1]; + + print "Content-type: text/html\n\n"; + print< + +Error Message + + + + + +
        Error Message
        +
          +

          $error_message

          +$error_message2
          +
        + + +EOF + &rm_tmp_uploaded_files; # Image Temporary deletion + exit; +} + +############################################################################## +# Summary +# +# Image Temporary deletion +# +# Parameters +# Returns +# Memo +############################################################################## + +sub rm_tmp_uploaded_files +{ + if($img_data_exists == 1){ + sleep 1; + foreach $fname_list(@NEWFNAMES) { + if(-e "$img_dir/$fname_list") { + unlink("$img_dir/$fname_list"); + } + } + } + +} +1; Property changes on: announcement/trunk/src/main/webapp/fckeditor/editor/filemanager/connectors/perl/upload_fck.pl ___________________________________________________________________ Name: svn:eol-style + native Added: announcement/trunk/src/main/webapp/fckeditor/editor/filemanager/connectors/perl/util.pl =================================================================== --- announcement/trunk/src/main/webapp/fckeditor/editor/filemanager/connectors/perl/util.pl (rev 0) +++ announcement/trunk/src/main/webapp/fckeditor/editor/filemanager/connectors/perl/util.pl 2008-06-30 02:54:27 UTC (rev 1002) @@ -0,0 +1,68 @@ +##### +# FCKeditor - The text editor for Internet - http://www.fckeditor.net +# Copyright (C) 2003-2008 Frederico Caldeira Knabben +# +# == BEGIN LICENSE == +# +# Licensed under the terms of any of the following licenses at your +# choice: +# +# - GNU General Public License Version 2 or later (the "GPL") +# http://www.gnu.org/licenses/gpl.html +# +# - GNU Lesser General Public License Version 2.1 or later (the "LGPL") +# http://www.gnu.org/licenses/lgpl.html +# +# - Mozilla Public License Version 1.1 or later (the "MPL") +# http://www.mozilla.org/MPL/MPL-1.1.html +# +# == END LICENSE == +# +# This is the File Manager Connector for Perl. +##### + +sub RemoveFromStart +{ + local($sourceString, $charToRemove) = @_; + $sPattern = '^' . $charToRemove . '+' ; + $sourceString =~ s/^$charToRemove+//g; + return $sourceString; +} + +sub RemoveFromEnd +{ + local($sourceString, $charToRemove) = @_; + $sPattern = $charToRemove . '+$' ; + $sourceString =~ s/$charToRemove+$//g; + return $sourceString; +} + +sub ConvertToXmlAttribute +{ + local($value) = @_; + return $value; +# return utf8_encode(htmlspecialchars($value)); + +} + +sub specialchar_cnv +{ + local($ch) = @_; + + $ch =~ s/&/&/g; # & + $ch =~ s/\"/"/g; #" + $ch =~ s/\'/'/g; # ' + $ch =~ s//>/g; # > + return($ch); +} + +sub JS_cnv +{ + local($ch) = @_; + + $ch =~ s/\"/\\\"/g; #" + return($ch); +} + +1; Property changes on: announcement/trunk/src/main/webapp/fckeditor/editor/filemanager/connectors/perl/util.pl ___________________________________________________________________ Name: svn:eol-style + native Added: announcement/trunk/src/main/webapp/fckeditor/editor/filemanager/connectors/php/basexml.php =================================================================== --- announcement/trunk/src/main/webapp/fckeditor/editor/filemanager/connectors/php/basexml.php (rev 0) +++ announcement/trunk/src/main/webapp/fckeditor/editor/filemanager/connectors/php/basexml.php 2008-06-30 02:54:27 UTC (rev 1002) @@ -0,0 +1,93 @@ +' ; + + // Create the main "Connector" node. + echo '' ; + + // Add the current folder node. + echo '' ; + + $GLOBALS['HeaderSent'] = true ; +} + +function CreateXmlFooter() +{ + echo '' ; +} + +function SendError( $number, $text ) +{ + if ( isset( $GLOBALS['HeaderSent'] ) && $GLOBALS['HeaderSent'] ) + { + SendErrorNode( $number, $text ) ; + CreateXmlFooter() ; + } + else + { + SetXmlHeaders() ; + + // Create the XML document header + echo '' ; + + echo '' ; + + SendErrorNode( $number, $text ) ; + + echo '' ; + } + exit ; +} + +function SendErrorNode( $number, $text ) +{ + echo '' ; +} +?> Added: announcement/trunk/src/main/webapp/fckeditor/editor/filemanager/connectors/php/commands.php =================================================================== --- announcement/trunk/src/main/webapp/fckeditor/editor/filemanager/connectors/php/commands.php (rev 0) +++ announcement/trunk/src/main/webapp/fckeditor/editor/filemanager/connectors/php/commands.php 2008-06-30 02:54:27 UTC (rev 1002) @@ -0,0 +1,273 @@ +' ; + } + + closedir( $oCurrentFolder ) ; + + // Open the "Folders" node. + echo "" ; + + natcasesort( $aFolders ) ; + foreach ( $aFolders as $sFolder ) + echo $sFolder ; + + // Close the "Folders" node. + echo "" ; +} + +function GetFoldersAndFiles( $resourceType, $currentFolder ) +{ + // Map the virtual path to the local server path. + $sServerDir = ServerMapFolder( $resourceType, $currentFolder, 'GetFoldersAndFiles' ) ; + + // Arrays that will hold the folders and files names. + $aFolders = array() ; + $aFiles = array() ; + + $oCurrentFolder = opendir( $sServerDir ) ; + + while ( $sFile = readdir( $oCurrentFolder ) ) + { + if ( $sFile != '.' && $sFile != '..' ) + { + if ( is_dir( $sServerDir . $sFile ) ) + $aFolders[] = '' ; + else + { + $iFileSize = @filesize( $sServerDir . $sFile ) ; + if ( !$iFileSize ) { + $iFileSize = 0 ; + } + if ( $iFileSize > 0 ) + { + $iFileSize = round( $iFileSize / 1024 ) ; + if ( $iFileSize < 1 ) $iFileSize = 1 ; + } + + $aFiles[] = '' ; + } + } + } + + // Send the folders + natcasesort( $aFolders ) ; + echo '' ; + + foreach ( $aFolders as $sFolder ) + echo $sFolder ; + + echo '' ; + + // Send the files + natcasesort( $aFiles ) ; + echo '' ; + + foreach ( $aFiles as $sFiles ) + echo $sFiles ; + + echo '' ; +} + +function CreateFolder( $resourceType, $currentFolder ) +{ + if (!isset($_GET)) { + global $_GET; + } + $sErrorNumber = '0' ; + $sErrorMsg = '' ; + + if ( isset( $_GET['NewFolderName'] ) ) + { + $sNewFolderName = $_GET['NewFolderName'] ; + $sNewFolderName = SanitizeFolderName( $sNewFolderName ) ; + + if ( strpos( $sNewFolderName, '..' ) !== FALSE ) + $sErrorNumber = '102' ; // Invalid folder name. + else + { + // Map the virtual path to the local server path of the current folder. + $sServerDir = ServerMapFolder( $resourceType, $currentFolder, 'CreateFolder' ) ; + + if ( is_writable( $sServerDir ) ) + { + $sServerDir .= $sNewFolderName ; + + $sErrorMsg = CreateServerFolder( $sServerDir ) ; + + switch ( $sErrorMsg ) + { + case '' : + $sErrorNumber = '0' ; + break ; + case 'Invalid argument' : + case 'No such file or directory' : + $sErrorNumber = '102' ; // Path too long. + break ; + default : + $sErrorNumber = '110' ; + break ; + } + } + else + $sErrorNumber = '103' ; + } + } + else + $sErrorNumber = '102' ; + + // Create the "Error" node. + echo '' ; +} + +function FileUpload( $resourceType, $currentFolder, $sCommand ) +{ + if (!isset($_FILES)) { + global $_FILES; + } + $sErrorNumber = '0' ; + $sFileName = '' ; + + if ( isset( $_FILES['NewFile'] ) && !is_null( $_FILES['NewFile']['tmp_name'] ) ) + { + global $Config ; + + $oFile = $_FILES['NewFile'] ; + + // Map the virtual path to the local server path. + $sServerDir = ServerMapFolder( $resourceType, $currentFolder, $sCommand ) ; + + // Get the uploaded file name. + $sFileName = $oFile['name'] ; + $sFileName = SanitizeFileName( $sFileName ) ; + + $sOriginalFileName = $sFileName ; + + // Get the extension. + $sExtension = substr( $sFileName, ( strrpos($sFileName, '.') + 1 ) ) ; + $sExtension = strtolower( $sExtension ) ; + + if ( isset( $Config['SecureImageUploads'] ) ) + { + if ( ( $isImageValid = IsImageValid( $oFile['tmp_name'], $sExtension ) ) === false ) + { + $sErrorNumber = '202' ; + } + } + + if ( isset( $Config['HtmlExtensions'] ) ) + { + if ( !IsHtmlExtension( $sExtension, $Config['HtmlExtensions'] ) && + ( $detectHtml = DetectHtml( $oFile['tmp_name'] ) ) === true ) + { + $sErrorNumber = '202' ; + } + } + + // Check if it is an allowed extension. + if ( !$sErrorNumber && IsAllowedExt( $sExtension, $resourceType ) ) + { + $iCounter = 0 ; + + while ( true ) + { + $sFilePath = $sServerDir . $sFileName ; + + if ( is_file( $sFilePath ) ) + { + $iCounter++ ; + $sFileName = RemoveExtension( $sOriginalFileName ) . '(' . $iCounter . ').' . $sExtension ; + $sErrorNumber = '201' ; + } + else + { + move_uploaded_file( $oFile['tmp_name'], $sFilePath ) ; + + if ( is_file( $sFilePath ) ) + { + if ( isset( $Config['ChmodOnUpload'] ) && !$Config['ChmodOnUpload'] ) + { + break ; + } + + $permissions = 0777; + + if ( isset( $Config['ChmodOnUpload'] ) && $Config['ChmodOnUpload'] ) + { + $permissions = $Config['ChmodOnUpload'] ; + } + + $oldumask = umask(0) ; + chmod( $sFilePath, $permissions ) ; + umask( $oldumask ) ; + } + + break ; + } + } + + if ( file_exists( $sFilePath ) ) + { + //previous checks failed, try once again + if ( isset( $isImageValid ) && $isImageValid === -1 && IsImageValid( $sFilePath, $sExtension ) === false ) + { + @unlink( $sFilePath ) ; + $sErrorNumber = '202' ; + } + else if ( isset( $detectHtml ) && $detectHtml === -1 && DetectHtml( $sFilePath ) === true ) + { + @unlink( $sFilePath ) ; + $sErrorNumber = '202' ; + } + } + } + else + $sErrorNumber = '202' ; + } + else + $sErrorNumber = '202' ; + + + $sFileUrl = CombinePaths( GetResourceTypePath( $resourceType, $sCommand ) , $currentFolder ) ; + $sFileUrl = CombinePaths( $sFileUrl, $sFileName ) ; + + SendUploadResults( $sErrorNumber, $sFileUrl, $sFileName ) ; + + exit ; +} +?> Added: announcement/trunk/src/main/webapp/fckeditor/editor/filemanager/connectors/php/config.php =================================================================== --- announcement/trunk/src/main/webapp/fckeditor/editor/filemanager/connectors/php/config.php (rev 0) +++ announcement/trunk/src/main/webapp/fckeditor/editor/filemanager/connectors/php/config.php 2008-06-30 02:54:27 UTC (rev 1002) @@ -0,0 +1,151 @@ + Added: announcement/trunk/src/main/webapp/fckeditor/editor/filemanager/connectors/php/connector.php =================================================================== --- announcement/trunk/src/main/webapp/fckeditor/editor/filemanager/connectors/php/connector.php (rev 0) +++ announcement/trunk/src/main/webapp/fckeditor/editor/filemanager/connectors/php/connector.php 2008-06-30 02:54:27 UTC (rev 1002) @@ -0,0 +1,87 @@ + Added: announcement/trunk/src/main/webapp/fckeditor/editor/filemanager/connectors/php/io.php =================================================================== --- announcement/trunk/src/main/webapp/fckeditor/editor/filemanager/connectors/php/io.php (rev 0) +++ announcement/trunk/src/main/webapp/fckeditor/editor/filemanager/connectors/php/io.php 2008-06-30 02:54:27 UTC (rev 1002) @@ -0,0 +1,295 @@ + 0 ) + return $Config['QuickUploadAbsolutePath'][$resourceType] ; + + // Map the "UserFiles" path to a local directory. + return Server_MapPath( $Config['QuickUploadPath'][$resourceType] ) ; + } + else + { + if ( strlen( $Config['FileTypesAbsolutePath'][$resourceType] ) > 0 ) + return $Config['FileTypesAbsolutePath'][$resourceType] ; + + // Map the "UserFiles" path to a local directory. + return Server_MapPath( $Config['FileTypesPath'][$resourceType] ) ; + } +} + +function GetUrlFromPath( $resourceType, $folderPath, $sCommand ) +{ + return CombinePaths( GetResourceTypePath( $resourceType, $sCommand ), $folderPath ) ; +} + +function RemoveExtension( $fileName ) +{ + return substr( $fileName, 0, strrpos( $fileName, '.' ) ) ; +} + +function ServerMapFolder( $resourceType, $folderPath, $sCommand ) +{ + // Get the resource type directory. + $sResourceTypePath = GetResourceTypeDirectory( $resourceType, $sCommand ) ; + + // Ensure that the directory exists. + $sErrorMsg = CreateServerFolder( $sResourceTypePath ) ; + if ( $sErrorMsg != '' ) + SendError( 1, "Error creating folder \"{$sResourceTypePath}\" ({$sErrorMsg})" ) ; + + // Return the resource type directory combined with the required path. + return CombinePaths( $sResourceTypePath , $folderPath ) ; +} + +function GetParentFolder( $folderPath ) +{ + $sPattern = "-[/\\\\][^/\\\\]+[/\\\\]?$-" ; + return preg_replace( $sPattern, '', $folderPath ) ; +} + +function CreateServerFolder( $folderPath, $lastFolder = null ) +{ + global $Config ; + $sParent = GetParentFolder( $folderPath ) ; + + // Ensure the folder path has no double-slashes, or mkdir may fail on certain platforms + while ( strpos($folderPath, '//') !== false ) + { + $folderPath = str_replace( '//', '/', $folderPath ) ; + } + + // Check if the parent exists, or create it. + if ( !file_exists( $sParent ) ) + { + //prevents agains infinite loop when we can't create root folder + if ( !is_null( $lastFolder ) && $lastFolder === $sParent) { + return "Can't create $folderPath directory" ; + } + + $sErrorMsg = CreateServerFolder( $sParent, $folderPath ) ; + if ( $sErrorMsg != '' ) + return $sErrorMsg ; + } + + if ( !file_exists( $folderPath ) ) + { + // Turn off all error reporting. + error_reporting( 0 ) ; + + $php_errormsg = '' ; + // Enable error tracking to catch the error. + ini_set( 'track_errors', '1' ) ; + + if ( isset( $Config['ChmodOnFolderCreate'] ) && !$Config['ChmodOnFolderCreate'] ) + { + mkdir( $folderPath ) ; + } + else + { + $permissions = 0777 ; + if ( isset( $Config['ChmodOnFolderCreate'] ) ) + { + $permissions = $Config['ChmodOnFolderCreate'] ; + } + // To create the folder with 0777 permissions, we need to set umask to zero. + $oldumask = umask(0) ; + mkdir( $folderPath, $permissions ) ; + umask( $oldumask ) ; + } + + $sErrorMsg = $php_errormsg ; + + // Restore the configurations. + ini_restore( 'track_errors' ) ; + ini_restore( 'error_reporting' ) ; + + return $sErrorMsg ; + } + else + return '' ; +} + +function GetRootPath() +{ + if (!isset($_SERVER)) { + global $_SERVER; + } + $sRealPath = realpath( './' ) ; + // #2124 ensure that no slash is at the end + $sRealPath = rtrim($sRealPath,"\\/"); + + $sSelfPath = $_SERVER['PHP_SELF'] ; + $sSelfPath = substr( $sSelfPath, 0, strrpos( $sSelfPath, '/' ) ) ; + + $sSelfPath = str_replace( '/', DIRECTORY_SEPARATOR, $sSelfPath ) ; + + $position = strpos( $sRealPath, $sSelfPath ) ; + + // This can check only that this script isn't run from a virtual dir + // But it avoids the problems that arise if it isn't checked + if ( $position === false || $position <> strlen( $sRealPath ) - strlen( $sSelfPath ) ) + SendError( 1, 'Sorry, can\'t map "UserFilesPath" to a physical path. You must set the "UserFilesAbsolutePath" value in "editor/filemanager/connectors/php/config.php".' ) ; + + return substr( $sRealPath, 0, $position ) ; +} + +// Emulate the asp Server.mapPath function. +// given an url path return the physical directory that it corresponds to +function Server_MapPath( $path ) +{ + // This function is available only for Apache + if ( function_exists( 'apache_lookup_uri' ) ) + { + $info = apache_lookup_uri( $path ) ; + return $info->filename . $info->path_info ; + } + + // This isn't correct but for the moment there's no other solution + // If this script is under a virtual directory or symlink it will detect the problem and stop + return GetRootPath() . $path ; +} + +function IsAllowedExt( $sExtension, $resourceType ) +{ + global $Config ; + // Get the allowed and denied extensions arrays. + $arAllowed = $Config['AllowedExtensions'][$resourceType] ; + $arDenied = $Config['DeniedExtensions'][$resourceType] ; + + if ( count($arAllowed) > 0 && !in_array( $sExtension, $arAllowed ) ) + return false ; + + if ( count($arDenied) > 0 && in_array( $sExtension, $arDenied ) ) + return false ; + + return true ; +} + +function IsAllowedType( $resourceType ) +{ + global $Config ; + if ( !in_array( $resourceType, $Config['ConfigAllowedTypes'] ) ) + return false ; + + return true ; +} + +function IsAllowedCommand( $sCommand ) +{ + global $Config ; + + if ( !in_array( $sCommand, $Config['ConfigAllowedCommands'] ) ) + return false ; + + return true ; +} + +function GetCurrentFolder() +{ + if (!isset($_GET)) { + global $_GET; + } + $sCurrentFolder = isset( $_GET['CurrentFolder'] ) ? $_GET['CurrentFolder'] : '/' ; + + // Check the current folder syntax (must begin and start with a slash). + if ( !preg_match( '|/$|', $sCurrentFolder ) ) + $sCurrentFolder .= '/' ; + if ( strpos( $sCurrentFolder, '/' ) !== 0 ) + $sCurrentFolder = '/' . $sCurrentFolder ; + + // Ensure the folder path has no double-slashes + while ( strpos ($sCurrentFolder, '//') !== false ) { + $sCurrentFolder = str_replace ('//', '/', $sCurrentFolder) ; + } + + // Check for invalid folder paths (..) + if ( strpos( $sCurrentFolder, '..' ) || strpos( $sCurrentFolder, "\\" )) + SendError( 102, '' ) ; + + return $sCurrentFolder ; +} + +// Do a cleanup of the folder name to avoid possible problems +function SanitizeFolderName( $sNewFolderName ) +{ + $sNewFolderName = stripslashes( $sNewFolderName ) ; + + // Remove . \ / | : ? * " < > + $sNewFolderName = preg_replace( '/\\.|\\\\|\\/|\\||\\:|\\?|\\*|"|<|>|[[:cntrl:]]/', '_', $sNewFolderName ) ; + + return $sNewFolderName ; +} + +// Do a cleanup of the file name to avoid possible problems +function SanitizeFileName( $sNewFileName ) +{ + global $Config ; + + $sNewFileName = stripslashes( $sNewFileName ) ; + + // Replace dots in the name with underscores (only one dot can be there... security issue). + if ( $Config['ForceSingleExtension'] ) + $sNewFileName = preg_replace( '/\\.(?![^.]*$)/', '_', $sNewFileName ) ; + + // Remove \ / | : ? * " < > + $sNewFileName = preg_replace( '/\\\\|\\/|\\||\\:|\\?|\\*|"|<|>|[[:cntrl:]]/', '_', $sNewFileName ) ; + + return $sNewFileName ; +} + +// This is the function that sends the results of the uploading process. +function SendUploadResults( $errorNumber, $fileUrl = '', $fileName = '', $customMsg = '' ) +{ + // Minified version of the document.domain automatic fix script (#1919). + // The original script can be found at _dev/domain_fix_template.js + echo << +(function(){var d=document.domain;while (true){try{var A=window.parent.document.domain;break;}catch(e) {};d=d.replace(/.*?(?:\.|$)/,'');if (d.length==0) break;try{document.domain=d;}catch (e){break;}}})(); +EOF; + + $rpl = array( '\\' => '\\\\', '"' => '\\"' ) ; + echo 'window.parent.OnUploadCompleted(' . $errorNumber . ',"' . strtr( $fileUrl, $rpl ) . '","' . strtr( $fileName, $rpl ) . '", "' . strtr( $customMsg, $rpl ) . '") ;' ; + echo '' ; + exit ; +} + +?> Added: announcement/trunk/src/main/webapp/fckeditor/editor/filemanager/connectors/php/phpcompat.php =================================================================== --- announcement/trunk/src/main/webapp/fckeditor/editor/filemanager/connectors/php/phpcompat.php (rev 0) +++ announcement/trunk/src/main/webapp/fckeditor/editor/filemanager/connectors/php/phpcompat.php 2008-06-30 02:54:27 UTC (rev 1002) @@ -0,0 +1,17 @@ + Added: announcement/trunk/src/main/webapp/fckeditor/editor/filemanager/connectors/php/util.php =================================================================== --- announcement/trunk/src/main/webapp/fckeditor/editor/filemanager/connectors/php/util.php (rev 0) +++ announcement/trunk/src/main/webapp/fckeditor/editor/filemanager/connectors/php/util.php 2008-06-30 02:54:27 UTC (rev 1002) @@ -0,0 +1,220 @@ + $val ) + { + $lcaseHtmlExtensions[$key] = strtolower( $val ) ; + } + return in_array( $ext, $lcaseHtmlExtensions ) ; +} + +/** + * Detect HTML in the first KB to prevent against potential security issue with + * IE/Safari/Opera file type auto detection bug. + * Returns true if file contain insecure HTML code at the beginning. + * + * @param string $filePath absolute path to file + * @return boolean + */ +function DetectHtml( $filePath ) +{ + $fp = @fopen( $filePath, 'rb' ) ; + + //open_basedir restriction, see #1906 + if ( $fp === false || !flock( $fp, LOCK_SH ) ) + { + return -1 ; + } + + $chunk = fread( $fp, 1024 ) ; + flock( $fp, LOCK_UN ) ; + fclose( $fp ) ; + + $chunk = strtolower( $chunk ) ; + + if (!$chunk) + { + return false ; + } + + $chunk = trim( $chunk ) ; + + if ( preg_match( "/= 4.0.7 + if ( function_exists( 'version_compare' ) ) { + $sCurrentVersion = phpversion(); + if ( version_compare( $sCurrentVersion, "4.2.0" ) >= 0 ) { + $imageCheckExtensions[] = "tiff"; + $imageCheckExtensions[] = "tif"; + } + if ( version_compare( $sCurrentVersion, "4.3.0" ) >= 0 ) { + $imageCheckExtensions[] = "swc"; + } + if ( version_compare( $sCurrentVersion, "4.3.2" ) >= 0 ) { + $imageCheckExtensions[] = "jpc"; + $imageCheckExtensions[] = "jp2"; + $imageCheckExtensions[] = "jpx"; + $imageCheckExtensions[] = "jb2"; + $imageCheckExtensions[] = "xbm"; + $imageCheckExtensions[] = "wbmp"; + } + } + + if ( !in_array( $extension, $imageCheckExtensions ) ) { + return true; + } + + if ( @getimagesize( $filePath ) === false ) { + return false ; + } + + return true; +} + +?> Added: announcement/trunk/src/main/webapp/fckeditor/editor/filemanager/connectors/py/config.py =================================================================== --- announcement/trunk/src/main/webapp/fckeditor/editor/filemanager/connectors/py/config.py (rev 0) +++ announcement/trunk/src/main/webapp/fckeditor/editor/filemanager/connectors/py/config.py 2008-06-30 02:54:27 UTC (rev 1002) @@ -0,0 +1,146 @@ +#!/usr/bin/env python +""" + * FCKeditor - The text editor for Internet - http://www.fckeditor.net + * Copyright (C) 2003-2008 Frederico Caldeira Knabben + * + * == BEGIN LICENSE == + * + * Licensed under the terms of any of the following licenses at your + * choice: + * + * - GNU General Public License Version 2 or later (the "GPL") + * http://www.gnu.org/licenses/gpl.html + * + * - GNU Lesser General Public License Version 2.1 or later (the "LGPL") + * http://www.gnu.org/licenses/lgpl.html + * + * - Mozilla Public License Version 1.1 or later (the "MPL") + * http://www.mozilla.org/MPL/MPL-1.1.html + * + * == END LICENSE == + * + * Configuration file for the File Manager Connector for Python +""" + +# INSTALLATION NOTE: You must set up your server environment accordingly to run +# python scripts. This connector requires Python 2.4 or greater. +# +# Supported operation modes: +# * WSGI (recommended): You'll need apache + mod_python + modpython_gateway +# or any web server capable of the WSGI python standard +# * Plain Old CGI: Any server capable of running standard python scripts +# (although mod_python is recommended for performance) +# This was the previous connector version operation mode +# +# If you're using Apache web server, replace the htaccess.txt to to .htaccess, +# and set the proper options and paths. +# For WSGI and mod_python, you may need to download modpython_gateway from: +# http://projects.amor.org/misc/svn/modpython_gateway.py and copy it in this +# directory. + + +# SECURITY: You must explicitly enable this "connector". (Set it to "True"). +# WARNING: don't just set "ConfigIsEnabled = True", you must be sure that only +# authenticated users can access this file or use some kind of session checking. +Enabled = False + +# Path to user files relative to the document root. +UserFilesPath = '/userfiles/' + +# Fill the following value it you prefer to specify the absolute path for the +# user files directory. Useful if you are using a virtual directory, symbolic +# link or alias. Examples: 'C:\\MySite\\userfiles\\' or '/root/mysite/userfiles/'. +# Attention: The above 'UserFilesPath' must point to the same directory. +# WARNING: GetRootPath may not work in virtual or mod_python configurations, and +# may not be thread safe. Use this configuration parameter instead. +UserFilesAbsolutePath = '' + +# Due to security issues with Apache modules, it is recommended to leave the +# following setting enabled. +ForceSingleExtension = True + +# What the user can do with this connector +ConfigAllowedCommands = [ 'QuickUpload', 'FileUpload', 'GetFolders', 'GetFoldersAndFiles', 'CreateFolder' ] + +# Allowed Resource Types +ConfigAllowedTypes = ['File', 'Image', 'Flash', 'Media'] + +# After file is uploaded, sometimes it is required to change its permissions +# so that it was possible to access it at the later time. +# If possible, it is recommended to set more restrictive permissions, like 0755. +# Set to 0 to disable this feature. +# Note: not needed on Windows-based servers. +ChmodOnUpload = 0755 + +# See comments above. +# Used when creating folders that does not exist. +ChmodOnFolderCreate = 0755 + +# Do not touch this 3 lines, see "Configuration settings for each Resource Type" +AllowedExtensions = {}; DeniedExtensions = {}; +FileTypesPath = {}; FileTypesAbsolutePath = {}; +QuickUploadPath = {}; QuickUploadAbsolutePath = {}; + +# Configuration settings for each Resource Type +# +# - AllowedExtensions: the possible extensions that can be allowed. +# If it is empty then any file type can be uploaded. +# - DeniedExtensions: The extensions that won't be allowed. +# If it is empty then no restrictions are done here. +# +# For a file to be uploaded it has to fulfill both the AllowedExtensions +# and DeniedExtensions (that's it: not being denied) conditions. +# +# - FileTypesPath: the virtual folder relative to the document root where +# these resources will be located. +# Attention: It must start and end with a slash: '/' +# +# - FileTypesAbsolutePath: the physical path to the above folder. It must be +# an absolute path. +# If it's an empty string then it will be autocalculated. +# Useful if you are using a virtual directory, symbolic link or alias. +# Examples: 'C:\\MySite\\userfiles\\' or '/root/mysite/userfiles/'. +# Attention: The above 'FileTypesPath' must point to the same directory. +# Attention: It must end with a slash: '/' +# +# +# - QuickUploadPath: the virtual folder relative to the document root where +# these resources will be uploaded using the Upload tab in the resources +# dialogs. +# Attention: It must start and end with a slash: '/' +# +# - QuickUploadAbsolutePath: the physical path to the above folder. It must be +# an absolute path. +# If it's an empty string then it will be autocalculated. +# Useful if you are using a virtual directory, symbolic link or alias. +# Examples: 'C:\\MySite\\userfiles\\' or '/root/mysite/userfiles/'. +# Attention: The above 'QuickUploadPath' must point to the same directory. +# Attention: It must end with a slash: '/' + +AllowedExtensions['File'] = ['7z','aiff','asf','avi','bmp','csv','doc','fla','flv','gif','gz','gzip','jpeg','jpg','mid','mov','mp3','mp4','mpc','mpeg','mpg','ods','odt','pdf','png','ppt','pxd','qt','ram','rar','rm','rmi','rmvb','rtf','sdc','sitd','swf','sxc','sxw','tar','tgz','tif','tiff','txt','vsd','wav','wma','wmv','xls','xml','zip'] +DeniedExtensions['File'] = [] +FileTypesPath['File'] = UserFilesPath + 'file/' +FileTypesAbsolutePath['File'] = (not UserFilesAbsolutePath == '') and (UserFilesAbsolutePath + 'file/') or '' +QuickUploadPath['File'] = FileTypesPath['File'] +QuickUploadAbsolutePath['File'] = FileTypesAbsolutePath['File'] + +AllowedExtensions['Image'] = ['bmp','gif','jpeg','jpg','png'] +DeniedExtensions['Image'] = [] +FileTypesPath['Image'] = UserFilesPath + 'image/' +FileTypesAbsolutePath['Image'] = (not UserFilesAbsolutePath == '') and UserFilesAbsolutePath + 'image/' or '' +QuickUploadPath['Image'] = FileTypesPath['Image'] +QuickUploadAbsolutePath['Image']= FileTypesAbsolutePath['Image'] + +AllowedExtensions['Flash'] = ['swf','flv'] +DeniedExtensions['Flash'] = [] +FileTypesPath['Flash'] = UserFilesPath + 'flash/' +FileTypesAbsolutePath['Flash'] = ( not UserFilesAbsolutePath == '') and UserFilesAbsolutePath + 'flash/' or '' +QuickUploadPath['Flash'] = FileTypesPath['Flash'] +QuickUploadAbsolutePath['Flash']= FileTypesAbsolutePath['Flash'] + +AllowedExtensions['Media'] = ['aiff','asf','avi','bmp','fla', 'flv','gif','jpeg','jpg','mid','mov','mp3','mp4','mpc','mpeg','mpg','png','qt','ram','rm','rmi','rmvb','swf','tif','tiff','wav','wma','wmv'] +DeniedExtensions['Media'] = [] +FileTypesPath['Media'] = UserFilesPath + 'media/' +FileTypesAbsolutePath['Media'] = ( not UserFilesAbsolutePath == '') and UserFilesAbsolutePath + 'media/' or '' +QuickUploadPath['Media'] = FileTypesPath['Media'] +QuickUploadAbsolutePath['Media']= FileTypesAbsolutePath['Media'] Property changes on: announcement/trunk/src/main/webapp/fckeditor/editor/filemanager/connectors/py/config.py ___________________________________________________________________ Name: svn:eol-style + native Added: announcement/trunk/src/main/webapp/fckeditor/editor/filemanager/connectors/py/connector.py =================================================================== --- announcement/trunk/src/main/webapp/fckeditor/editor/filemanager/connectors/py/connector.py (rev 0) +++ announcement/trunk/src/main/webapp/fckeditor/editor/filemanager/connectors/py/connector.py 2008-06-30 02:54:27 UTC (rev 1002) @@ -0,0 +1,118 @@ +#!/usr/bin/env python + +""" +FCKeditor - The text editor for Internet - http://www.fckeditor.net +Copyright (C) 2003-2008 Frederico Caldeira Knabben + +== BEGIN LICENSE == + +Licensed under the terms of any of the following licenses at your +choice: + + - GNU General Public License Version 2 or later (the "GPL") + http://www.gnu.org/licenses/gpl.html + + - GNU Lesser General Public License Version 2.1 or later (the "LGPL") + http://www.gnu.org/licenses/lgpl.html + + - Mozilla Public License Version 1.1 or later (the "MPL") + http://www.mozilla.org/MPL/MPL-1.1.html + +== END LICENSE == + +Connector for Python (CGI and WSGI). + +See config.py for configuration settings + +""" +import os + +from fckutil import * +from fckcommands import * # default command's implementation +from fckoutput import * # base http, xml and html output mixins +from fckconnector import FCKeditorConnectorBase # import base connector +import config as Config + +class FCKeditorConnector( FCKeditorConnectorBase, + GetFoldersCommandMixin, + GetFoldersAndFilesCommandMixin, + CreateFolderCommandMixin, + UploadFileCommandMixin, + BaseHttpMixin, BaseXmlMixin, BaseHtmlMixin ): + "The Standard connector class." + def doResponse(self): + "Main function. Process the request, set headers and return a string as response." + s = "" + # Check if this connector is disabled + if not(Config.Enabled): + return self.sendError(1, "This connector is disabled. Please check the connector configurations in \"editor/filemanager/connectors/py/config.py\" and try again.") + # Make sure we have valid inputs + for key in ("Command","Type","CurrentFolder"): + if not self.request.has_key (key): + return + # Get command, resource type and current folder + command = self.request.get("Command") + resourceType = self.request.get("Type") + currentFolder = getCurrentFolder(self.request.get("CurrentFolder")) + # Check for invalid paths + if currentFolder is None: + return self.sendError(102, "") + + # Check if it is an allowed command + if ( not command in Config.ConfigAllowedCommands ): + return self.sendError( 1, 'The %s command isn\'t allowed' % command ) + + if ( not resourceType in Config.ConfigAllowedTypes ): + return self.sendError( 1, 'Invalid type specified' ) + + # Setup paths + if command == "QuickUpload": + self.userFilesFolder = Config.QuickUploadAbsolutePath[resourceType] + self.webUserFilesFolder = Config.QuickUploadPath[resourceType] + else: + self.userFilesFolder = Config.FileTypesAbsolutePath[resourceType] + self.webUserFilesFolder = Config.FileTypesPath[resourceType] + + if not self.userFilesFolder: # no absolute path given (dangerous...) + self.userFilesFolder = mapServerPath(self.environ, + self.webUserFilesFolder) + # Ensure that the directory exists. + if not os.path.exists(self.userFilesFolder): + try: + self.createServerFoldercreateServerFolder( self.userFilesFolder ) + except: + return self.sendError(1, "This connector couldn\'t access to local user\'s files directories. Please check the UserFilesAbsolutePath in \"editor/filemanager/connectors/py/config.py\" and try again. ") + + # File upload doesn't have to return XML, so intercept here + if (command == "FileUpload"): + return self.uploadFile(resourceType, currentFolder) + + # Create Url + url = combinePaths( self.webUserFilesFolder, currentFolder ) + + # Begin XML + s += self.createXmlHeader(command, resourceType, currentFolder, url) + # Execute the command + selector = {"GetFolders": self.getFolders, + "GetFoldersAndFiles": self.getFoldersAndFiles, + "CreateFolder": self.createFolder, + } + s += selector[command](resourceType, currentFolder) + s += self.createXmlFooter() + return s + +# Running from command line (plain old CGI) +if __name__ == '__main__': + try: + # Create a Connector Instance + conn = FCKeditorConnector() + data = conn.doResponse() + for header in conn.headers: + print '%s: %s' % header + print + print data + except: + print "Content-Type: text/plain" + print + import cgi + cgi.print_exception() Property changes on: announcement/trunk/src/main/webapp/fckeditor/editor/filemanager/connectors/py/connector.py ___________________________________________________________________ Name: svn:eol-style + native Added: announcement/trunk/src/main/webapp/fckeditor/editor/filemanager/connectors/py/fckcommands.py =================================================================== --- announcement/trunk/src/main/webapp/fckeditor/editor/filemanager/connectors/py/fckcommands.py (rev 0) +++ announcement/trunk/src/main/webapp/fckeditor/editor/filemanager/connectors/py/fckcommands.py 2008-06-30 02:54:27 UTC (rev 1002) @@ -0,0 +1,198 @@ +#!/usr/bin/env python + +""" +FCKeditor - The text editor for Internet - http://www.fckeditor.net +Copyright (C) 2003-2008 Frederico Caldeira Knabben + +== BEGIN LICENSE == + +Licensed under the terms of any of the following licenses at your +choice: + +- GNU General Public License Version 2 or later (the "GPL") +http://www.gnu.org/licenses/gpl.html + +- GNU Lesser General Public License Version 2.1 or later (the "LGPL") +http://www.gnu.org/licenses/lgpl.html + +- Mozilla Public License Version 1.1 or later (the "MPL") +http://www.mozilla.org/MPL/MPL-1.1.html + +== END LICENSE == + +Connector for Python (CGI and WSGI). + +""" + +import os +try: # Windows needs stdio set for binary mode for file upload to work. + import msvcrt + msvcrt.setmode (0, os.O_BINARY) # stdin = 0 + msvcrt.setmode (1, os.O_BINARY) # stdout = 1 +except ImportError: + pass + +from fckutil import * +from fckoutput import * +import config as Config + +class GetFoldersCommandMixin (object): + def getFolders(self, resourceType, currentFolder): + """ + Purpose: command to recieve a list of folders + """ + # Map the virtual path to our local server + serverPath = mapServerFolder(self.userFilesFolder,currentFolder) + s = """""" # Open the folders node + for someObject in os.listdir(serverPath): + someObjectPath = mapServerFolder(serverPath, someObject) + if os.path.isdir(someObjectPath): + s += """""" % ( + convertToXmlAttribute(someObject) + ) + s += """""" # Close the folders node + return s + +class GetFoldersAndFilesCommandMixin (object): + def getFoldersAndFiles(self, resourceType, currentFolder): + """ + Purpose: command to recieve a list of folders and files + """ + # Map the virtual path to our local server + serverPath = mapServerFolder(self.userFilesFolder,currentFolder) + # Open the folders / files node + folders = """""" + files = """""" + for someObject in os.listdir(serverPath): + someObjectPath = mapServerFolder(serverPath, someObject) + if os.path.isdir(someObjectPath): + folders += """""" % ( + convertToXmlAttribute(someObject) + ) + elif os.path.isfile(someObjectPath): + size = os.path.getsize(someObjectPath) + files += """""" % ( + convertToXmlAttribute(someObject), + os.path.getsize(someObjectPath) + ) + # Close the folders / files node + folders += """""" + files += """""" + return folders + files + +class CreateFolderCommandMixin (object): + def createFolder(self, resourceType, currentFolder): + """ + Purpose: command to create a new folder + """ + errorNo = 0; errorMsg =''; + if self.request.has_key("NewFolderName"): + newFolder = self.request.get("NewFolderName", None) + newFolder = sanitizeFolderName (newFolder) + try: + newFolderPath = mapServerFolder(self.userFilesFolder, combinePaths(currentFolder, newFolder)) + self.createServerFolder(newFolderPath) + except Exception, e: + errorMsg = str(e).decode('iso-8859-1').encode('utf-8') # warning with encodigns!!! + if hasattr(e,'errno'): + if e.errno==17: #file already exists + errorNo=0 + elif e.errno==13: # permission denied + errorNo = 103 + elif e.errno==36 or e.errno==2 or e.errno==22: # filename too long / no such file / invalid name + errorNo = 102 + else: + errorNo = 110 + else: + errorNo = 102 + return self.sendErrorNode ( errorNo, errorMsg ) + + def createServerFolder(self, folderPath): + "Purpose: physically creates a folder on the server" + # No need to check if the parent exists, just create all hierachy + + try: + permissions = Config.ChmodOnFolderCreate + if not permissions: + os.makedirs(folderPath) + except AttributeError: #ChmodOnFolderCreate undefined + permissions = 0755 + + if permissions: + oldumask = os.umask(0) + os.makedirs(folderPath,mode=0755) + os.umask( oldumask ) + +class UploadFileCommandMixin (object): + def uploadFile(self, resourceType, currentFolder): + """ + Purpose: command to upload files to server (same as FileUpload) + """ + errorNo = 0 + if self.request.has_key("NewFile"): + # newFile has all the contents we need + newFile = self.request.get("NewFile", "") + # Get the file name + newFileName = newFile.filename + newFileName = sanitizeFileName( newFileName ) + newFileNameOnly = removeExtension(newFileName) + newFileExtension = getExtension(newFileName).lower() + allowedExtensions = Config.AllowedExtensions[resourceType] + deniedExtensions = Config.DeniedExtensions[resourceType] + + if (allowedExtensions): + # Check for allowed + isAllowed = False + if (newFileExtension in allowedExtensions): + isAllowed = True + elif (deniedExtensions): + # Check for denied + isAllowed = True + if (newFileExtension in deniedExtensions): + isAllowed = False + else: + # No extension limitations + isAllowed = True + + if (isAllowed): + # Upload to operating system + # Map the virtual path to the local server path + currentFolderPath = mapServerFolder(self.userFilesFolder, currentFolder) + i = 0 + while (True): + newFilePath = os.path.join (currentFolderPath,newFileName) + if os.path.exists(newFilePath): + i += 1 + newFileName = "%s(%04d).%s" % ( + newFileNameOnly, i, newFileExtension + ) + errorNo= 201 # file renamed + else: + # Read file contents and write to the desired path (similar to php's move_uploaded_file) + fout = file(newFilePath, 'wb') + while (True): + chunk = newFile.file.read(100000) + if not chunk: break + fout.write (chunk) + fout.close() + + if os.path.exists ( newFilePath ): + doChmod = False + try: + doChmod = Config.ChmodOnUpload + permissions = Config.ChmodOnUpload + except AttributeError: #ChmodOnUpload undefined + doChmod = True + permissions = 0755 + if ( doChmod ): + oldumask = os.umask(0) + os.chmod( newFilePath, permissions ) + os.umask( oldumask ) + + newFileUrl = self.webUserFilesFolder + currentFolder + newFileName + + return self.sendUploadResults( errorNo , newFileUrl, newFileName ) + else: + return self.sendUploadResults( errorNo = 203, customMsg = "Extension not allowed" ) + else: + return self.sendUploadResults( errorNo = 202, customMsg = "No File" ) Property changes on: announcement/trunk/src/main/webapp/fckeditor/editor/filemanager/connectors/py/fckcommands.py ___________________________________________________________________ Name: svn:eol-style + native Added: announcement/trunk/src/main/webapp/fckeditor/editor/filemanager/connectors/py/fckconnector.py =================================================================== --- announcement/trunk/src/main/webapp/fckeditor/editor/filemanager/connectors/py/fckconnector.py (rev 0) +++ announcement/trunk/src/main/webapp/fckeditor/editor/filemanager/connectors/py/fckconnector.py 2008-06-30 02:54:27 UTC (rev 1002) @@ -0,0 +1,90 @@ +#!/usr/bin/env python + +""" +FCKeditor - The text editor for Internet - http://www.fckeditor.net +Copyright (C) 2003-2008 Frederico Caldeira Knabben + +== BEGIN LICENSE == + +Licensed under the terms of any of the following licenses at your +choice: + +- GNU General Public License Version 2 or later (the "GPL") +http://www.gnu.org/licenses/gpl.html + +- GNU Lesser General Public License Version 2.1 or later (the "LGPL") +http://www.gnu.org/licenses/lgpl.html + +- Mozilla Public License Version 1.1 or later (the "MPL") +http://www.mozilla.org/MPL/MPL-1.1.html + +== END LICENSE == + +Base Connector for Python (CGI and WSGI). + +See config.py for configuration settings + +""" +import cgi, os + +from fckutil import * +from fckcommands import * # default command's implementation +from fckoutput import * # base http, xml and html output mixins +import config as Config + +class FCKeditorConnectorBase( object ): + "The base connector class. Subclass it to extend functionality (see Zope example)" + + def __init__(self, environ=None): + "Constructor: Here you should parse request fields, initialize variables, etc." + self.request = FCKeditorRequest(environ) # Parse request + self.headers = [] # Clean Headers + if environ: + self.environ = environ + else: + self.environ = os.environ + + # local functions + + def setHeader(self, key, value): + self.headers.append ((key, value)) + return + +class FCKeditorRequest(object): + "A wrapper around the request object" + def __init__(self, environ): + if environ: # WSGI + self.request = cgi.FieldStorage(fp=environ['wsgi.input'], + environ=environ, + keep_blank_values=1) + self.environ = environ + else: # plain old cgi + self.environ = os.environ + self.request = cgi.FieldStorage() + if 'REQUEST_METHOD' in self.environ and 'QUERY_STRING' in self.environ: + if self.environ['REQUEST_METHOD'].upper()=='POST': + # we are in a POST, but GET query_string exists + # cgi parses by default POST data, so parse GET QUERY_STRING too + self.get_request = cgi.FieldStorage(fp=None, + environ={ + 'REQUEST_METHOD':'GET', + 'QUERY_STRING':self.environ['QUERY_STRING'], + }, + ) + else: + self.get_request={} + + def has_key(self, key): + return self.request.has_key(key) or self.get_request.has_key(key) + + def get(self, key, default=None): + if key in self.request.keys(): + field = self.request[key] + elif key in self.get_request.keys(): + field = self.get_request[key] + else: + return default + if hasattr(field,"filename") and field.filename: #file upload, do not convert return value + return field + else: + return field.value Property changes on: announcement/trunk/src/main/webapp/fckeditor/editor/filemanager/connectors/py/fckconnector.py ___________________________________________________________________ Name: svn:eol-style + native Added: announcement/trunk/src/main/webapp/fckeditor/editor/filemanager/connectors/py/fckoutput.py =================================================================== --- announcement/trunk/src/main/webapp/fckeditor/editor/filemanager/connectors/py/fckoutput.py (rev 0) +++ announcement/trunk/src/main/webapp/fckeditor/editor/filemanager/connectors/py/fckoutput.py 2008-06-30 02:54:27 UTC (rev 1002) @@ -0,0 +1,116 @@ +#!/usr/bin/env python + +""" +FCKeditor - The text editor for Internet - http://www.fckeditor.net +Copyright (C) 2003-2008 Frederico Caldeira Knabben + +== BEGIN LICENSE == + +Licensed under the terms of any of the following licenses at your +choice: + +- GNU General Public License Version 2 or later (the "GPL") +http://www.gnu.org/licenses/gpl.html + +- GNU Lesser General Public License Version 2.1 or later (the "LGPL") +http://www.gnu.org/licenses/lgpl.html + +- Mozilla Public License Version 1.1 or later (the "MPL") +http://www.mozilla.org/MPL/MPL-1.1.html + +== END LICENSE == + +Connector for Python (CGI and WSGI). + +""" + +from time import gmtime, strftime +import string + +def escape(text, replace=string.replace): + """ + Converts the special characters '<', '>', and '&'. + + RFC 1866 specifies that these characters be represented + in HTML as < > and & respectively. In Python + 1.5 we use the new string.replace() function for speed. + """ + text = replace(text, '&', '&') # must be done 1st + text = replace(text, '<', '<') + text = replace(text, '>', '>') + text = replace(text, '"', '"') + return text + +def convertToXmlAttribute(value): + if (value is None): + value = "" + return escape(value) + +class BaseHttpMixin(object): + def setHttpHeaders(self, content_type='text/xml'): + "Purpose: to prepare the headers for the xml to return" + # Prevent the browser from caching the result. + # Date in the past + self.setHeader('Expires','Mon, 26 Jul 1997 05:00:00 GMT') + # always modified + self.setHeader('Last-Modified',strftime("%a, %d %b %Y %H:%M:%S GMT", gmtime())) + # HTTP/1.1 + self.setHeader('Cache-Control','no-store, no-cache, must-revalidate') + self.setHeader('Cache-Control','post-check=0, pre-check=0') + # HTTP/1.0 + self.setHeader('Pragma','no-cache') + + # Set the response format. + self.setHeader( 'Content-Type', content_type + '; charset=utf-8' ) + return + +class BaseXmlMixin(object): + def createXmlHeader(self, command, resourceType, currentFolder, url): + "Purpose: returns the xml header" + self.setHttpHeaders() + # Create the XML document header + s = """""" + # Create the main connector node + s += """""" % ( + command, + resourceType + ) + # Add the current folder node + s += """""" % ( + convertToXmlAttribute(currentFolder), + convertToXmlAttribute(url), + ) + return s + + def createXmlFooter(self): + "Purpose: returns the xml footer" + return """""" + + def sendError(self, number, text): + "Purpose: in the event of an error, return an xml based error" + self.setHttpHeaders() + return ("""""" + + """""" + + self.sendErrorNode (number, text) + + """""" ) + + def sendErrorNode(self, number, text): + return """""" % (number, convertToXmlAttribute(text)) + +class BaseHtmlMixin(object): + def sendUploadResults( self, errorNo = 0, fileUrl = '', fileName = '', customMsg = '' ): + self.setHttpHeaders("text/html") + "This is the function that sends the results of the uploading process" + + "Minified version of the document.domain automatic fix script (#1919)." + "The original script can be found at _dev/domain_fix_template.js" + return """""" % { + 'errorNumber': errorNo, + 'fileUrl': fileUrl.replace ('"', '\\"'), + 'fileName': fileName.replace ( '"', '\\"' ) , + 'customMsg': customMsg.replace ( '"', '\\"' ), + } Property changes on: announcement/trunk/src/main/webapp/fckeditor/editor/filemanager/connectors/py/fckoutput.py ___________________________________________________________________ Name: svn:eol-style + native Added: announcement/trunk/src/main/webapp/fckeditor/editor/filemanager/connectors/py/fckutil.py =================================================================== --- announcement/trunk/src/main/webapp/fckeditor/editor/filemanager/connectors/py/fckutil.py (rev 0) +++ announcement/trunk/src/main/webapp/fckeditor/editor/filemanager/connectors/py/fckutil.py 2008-06-30 02:54:27 UTC (rev 1002) @@ -0,0 +1,126 @@ +#!/usr/bin/env python + +""" +FCKeditor - The text editor for Internet - http://www.fckeditor.net +Copyright (C) 2003-2008 Frederico Caldeira Knabben + +== BEGIN LICENSE == + +Licensed under the terms of any of the following licenses at your +choice: + +- GNU General Public License Version 2 or later (the "GPL") +http://www.gnu.org/licenses/gpl.html + +- GNU Lesser General Public License Version 2.1 or later (the "LGPL") +http://www.gnu.org/licenses/lgpl.html + +- Mozilla Public License Version 1.1 or later (the "MPL") +http://www.mozilla.org/MPL/MPL-1.1.html + +== END LICENSE == + +Utility functions for the File Manager Connector for Python + +""" + +import string, re +import os +import config as Config + +# Generic manipulation functions + +def removeExtension(fileName): + index = fileName.rindex(".") + newFileName = fileName[0:index] + return newFileName + +def getExtension(fileName): + index = fileName.rindex(".") + 1 + fileExtension = fileName[index:] + return fileExtension + +def removeFromStart(string, char): + return string.lstrip(char) + +def removeFromEnd(string, char): + return string.rstrip(char) + +# Path functions + +def combinePaths( basePath, folder ): + return removeFromEnd( basePath, '/' ) + '/' + removeFromStart( folder, '/' ) + +def getFileName(filename): + " Purpose: helper function to extrapolate the filename " + for splitChar in ["/", "\\"]: + array = filename.split(splitChar) + if (len(array) > 1): + filename = array[-1] + return filename + +def sanitizeFolderName( newFolderName ): + "Do a cleanup of the folder name to avoid possible problems" + # Remove . \ / | : ? * " < > and control characters + return re.sub( '(?u)\\.|\\\\|\\/|\\||\\:|\\?|\\*|"|<|>|[^\u0000-\u001f\u007f-\u009f]', '_', newFolderName ) + +def sanitizeFileName( newFileName ): + "Do a cleanup of the file name to avoid possible problems" + # Replace dots in the name with underscores (only one dot can be there... security issue). + if ( Config.ForceSingleExtension ): # remove dots + newFileName = re.sub ( '/\\.(?![^.]*$)/', '_', newFileName ) ; + newFileName = newFileName.replace('\\','/') # convert windows to unix path + newFileName = os.path.basename (newFileName) # strip directories + # Remove \ / | : ? * + return re.sub ( '(?u)/\\\\|\\/|\\||\\:|\\?|\\*|"|<|>|[^\u0000-\u001f\u007f-\u009f]/', '_', newFileName ) + +def getCurrentFolder(currentFolder): + if not currentFolder: + currentFolder = '/' + + # Check the current folder syntax (must begin and end with a slash). + if (currentFolder[-1] <> "/"): + currentFolder += "/" + if (currentFolder[0] <> "/"): + currentFolder = "/" + currentFolder + + # Ensure the folder path has no double-slashes + while '//' in currentFolder: + currentFolder = currentFolder.replace('//','/') + + # Check for invalid folder paths (..) + if '..' in currentFolder or '\\' in currentFolder: + return None + + return currentFolder + +def mapServerPath( environ, url): + " Emulate the asp Server.mapPath function. Given an url path return the physical directory that it corresponds to " + # This isn't correct but for the moment there's no other solution + # If this script is under a virtual directory or symlink it will detect the problem and stop + return combinePaths( getRootPath(environ), url ) + +def mapServerFolder(resourceTypePath, folderPath): + return combinePaths ( resourceTypePath , folderPath ) + +def getRootPath(environ): + "Purpose: returns the root path on the server" + # WARNING: this may not be thread safe, and doesn't work w/ VirtualServer/mod_python + # Use Config.UserFilesAbsolutePath instead + + if environ.has_key('DOCUMENT_ROOT'): + return environ['DOCUMENT_ROOT'] + else: + realPath = os.path.realpath( './' ) + selfPath = environ['SCRIPT_FILENAME'] + selfPath = selfPath [ : selfPath.rfind( '/' ) ] + selfPath = selfPath.replace( '/', os.path.sep) + + position = realPath.find(selfPath) + + # This can check only that this script isn't run from a virtual dir + # But it avoids the problems that arise if it isn't checked + raise realPath + if ( position < 0 or position <> len(realPath) - len(selfPath) or realPath[ : position ]==''): + raise Exception('Sorry, can\'t map "UserFilesPath" to a physical path. You must set the "UserFilesAbsolutePath" value in "editor/filemanager/connectors/py/config.py".') + return realPath[ : position ] Property changes on: announcement/trunk/src/main/webapp/fckeditor/editor/filemanager/connectors/py/fckutil.py ___________________________________________________________________ Name: svn:eol-style + native Added: announcement/trunk/src/main/webapp/fckeditor/editor/filemanager/connectors/py/htaccess.txt =================================================================== --- announcement/trunk/src/main/webapp/fckeditor/editor/filemanager/connectors/py/htaccess.txt (rev 0) +++ announcement/trunk/src/main/webapp/fckeditor/editor/filemanager/connectors/py/htaccess.txt 2008-06-30 02:54:27 UTC (rev 1002) @@ -0,0 +1,23 @@ +# replace the name of this file to .htaccess (if using apache), +# and set the proper options and paths according your enviroment + +Allow from all + +# If using mod_python uncomment this: +PythonPath "[r'C:\Archivos de programa\Apache Software Foundation\Apache2.2\htdocs\fckeditor\editor\filemanager\connectors\py'] + sys.path" + + +# Recomended: WSGI application running with mod_python and modpython_gateway +SetHandler python-program +PythonHandler modpython_gateway::handler +PythonOption wsgi.application wsgi::App + + +# Emulated CGI with mod_python and cgihandler +#AddHandler mod_python .py +#PythonHandler mod_python.cgihandler + + +# Plain old CGI +#Options +ExecCGI +#AddHandler cgi-script py Property changes on: announcement/trunk/src/main/webapp/fckeditor/editor/filemanager/connectors/py/htaccess.txt ___________________________________________________________________ Name: svn:eol-style + native Added: announcement/trunk/src/main/webapp/fckeditor/editor/filemanager/connectors/py/upload.py =================================================================== --- announcement/trunk/src/main/webapp/fckeditor/editor/filemanager/connectors/py/upload.py (rev 0) +++ announcement/trunk/src/main/webapp/fckeditor/editor/filemanager/connectors/py/upload.py 2008-06-30 02:54:27 UTC (rev 1002) @@ -0,0 +1,88 @@ +#!/usr/bin/env python + +""" +FCKeditor - The text editor for Internet - http://www.fckeditor.net +Copyright (C) 2003-2008 Frederico Caldeira Knabben + +== BEGIN LICENSE == + +Licensed under the terms of any of the following licenses at your +choice: + +- GNU General Public License Version 2 or later (the "GPL") +http://www.gnu.org/licenses/gpl.html + +- GNU Lesser General Public License Version 2.1 or later (the "LGPL") +http://www.gnu.org/licenses/lgpl.html + +- Mozilla Public License Version 1.1 or later (the "MPL") +http://www.mozilla.org/MPL/MPL-1.1.html + +== END LICENSE == + +This is the "File Uploader" for Python + +""" +import os + +from fckutil import * +from fckcommands import * # default command's implementation +from fckconnector import FCKeditorConnectorBase # import base connector +import config as Config + +class FCKeditorQuickUpload( FCKeditorConnectorBase, + UploadFileCommandMixin, + BaseHttpMixin, BaseHtmlMixin): + def doResponse(self): + "Main function. Process the request, set headers and return a string as response." + # Check if this connector is disabled + if not(Config.Enabled): + return self.sendUploadResults(1, "This file uploader is disabled. Please check the \"editor/filemanager/connectors/py/config.py\"") + command = 'QuickUpload' + # The file type (from the QueryString, by default 'File'). + resourceType = self.request.get('Type','File') + currentFolder = getCurrentFolder(self.request.get("CurrentFolder","")) + # Check for invalid paths + if currentFolder is None: + return self.sendUploadResults(102, '', '', "") + + # Check if it is an allowed command + if ( not command in Config.ConfigAllowedCommands ): + return self.sendUploadResults( 1, '', '', 'The %s command isn\'t allowed' % command ) + + if ( not resourceType in Config.ConfigAllowedTypes ): + return self.sendUploadResults( 1, '', '', 'Invalid type specified' ) + + # Setup paths + self.userFilesFolder = Config.QuickUploadAbsolutePath[resourceType] + self.webUserFilesFolder = Config.QuickUploadPath[resourceType] + if not self.userFilesFolder: # no absolute path given (dangerous...) + self.userFilesFolder = mapServerPath(self.environ, + self.webUserFilesFolder) + + # Ensure that the directory exists. + if not os.path.exists(self.userFilesFolder): + try: + self.createServerFoldercreateServerFolder( self.userFilesFolder ) + except: + return self.sendError(1, "This connector couldn\'t access to local user\'s files directories. Please check the UserFilesAbsolutePath in \"editor/filemanager/connectors/py/config.py\" and try again. ") + + # File upload doesn't have to return XML, so intercept here + return self.uploadFile(resourceType, currentFolder) + +# Running from command line (plain old CGI) +if __name__ == '__main__': + try: + # Create a Connector Instance + conn = FCKeditorQuickUpload() + data = conn.doResponse() + for header in conn.headers: + if not header is None: + print '%s: %s' % header + print + print data + except: + print "Content-Type: text/plain" + print + import cgi + cgi.print_exception() Property changes on: announcement/trunk/src/main/webapp/fckeditor/editor/filemanager/connectors/py/upload.py ___________________________________________________________________ Name: svn:eol-style + native Added: announcement/trunk/src/main/webapp/fckeditor/editor/filemanager/connectors/py/wsgi.py =================================================================== --- announcement/trunk/src/main/webapp/fckeditor/editor/filemanager/connectors/py/wsgi.py (rev 0) +++ announcement/trunk/src/main/webapp/fckeditor/editor/filemanager/connectors/py/wsgi.py 2008-06-30 02:54:27 UTC (rev 1002) @@ -0,0 +1,58 @@ +#!/usr/bin/env python + +""" +FCKeditor - The text editor for Internet - http://www.fckeditor.net +Copyright (C) 2003-2008 Frederico Caldeira Knabben + +== BEGIN LICENSE == + +Licensed under the terms of any of the following licenses at your +choice: + + - GNU General Public License Version 2 or later (the "GPL") + http://www.gnu.org/licenses/gpl.html + + - GNU Lesser General Public License Version 2.1 or later (the "LGPL") + http://www.gnu.org/licenses/lgpl.html + + - Mozilla Public License Version 1.1 or later (the "MPL") + http://www.mozilla.org/MPL/MPL-1.1.html + +== END LICENSE == + +Connector/QuickUpload for Python (WSGI wrapper). + +See config.py for configuration settings + +""" + +from connector import FCKeditorConnector +from upload import FCKeditorQuickUpload + +import cgitb +from cStringIO import StringIO + +# Running from WSGI capable server (recomended) +def App(environ, start_response): + "WSGI entry point. Run the connector" + if environ['SCRIPT_NAME'].endswith("connector.py"): + conn = FCKeditorConnector(environ) + elif environ['SCRIPT_NAME'].endswith("upload.py"): + conn = FCKeditorQuickUpload(environ) + else: + start_response ("200 Ok", [('Content-Type','text/html')]) + yield "Unknown page requested: " + yield environ['SCRIPT_NAME'] + return + try: + # run the connector + data = conn.doResponse() + # Start WSGI response: + start_response ("200 Ok", conn.headers) + # Send response text + yield data + except: + start_response("500 Internal Server Error",[("Content-type","text/html")]) + file = StringIO() + cgitb.Hook(file = file).handle() + yield file.getvalue() Property changes on: announcement/trunk/src/main/webapp/fckeditor/editor/filemanager/connectors/py/wsgi.py ___________________________________________________________________ Name: svn:eol-style + native Added: announcement/trunk/src/main/webapp/fckeditor/editor/filemanager/connectors/py/zope.py =================================================================== --- announcement/trunk/src/main/webapp/fckeditor/editor/filemanager/connectors/py/zope.py (rev 0) +++ announcement/trunk/src/main/webapp/fckeditor/editor/filemanager/connectors/py/zope.py 2008-06-30 02:54:27 UTC (rev 1002) @@ -0,0 +1,188 @@ +#!/usr/bin/env python + +""" +FCKeditor - The text editor for Internet - http://www.fckeditor.net +Copyright (C) 2003-2008 Frederico Caldeira Knabben + +== BEGIN LICENSE == + +Licensed under the terms of any of the following licenses at your +choice: + +- GNU General Public License Version 2 or later (the "GPL") +http://www.gnu.org/licenses/gpl.html + +- GNU Lesser General Public License Version 2.1 or later (the "LGPL") +http://www.gnu.org/licenses/lgpl.html + +- Mozilla Public License Version 1.1 or later (the "MPL") +http://www.mozilla.org/MPL/MPL-1.1.html + +== END LICENSE == + +Connector for Python and Zope. + +This code was not tested at all. +It just was ported from pre 2.5 release, so for further reference see +\editor\filemanager\browser\default\connectors\py\connector.py in previous +releases. + +""" + +from fckutil import * +from connector import * +import config as Config + +class FCKeditorConnectorZope(FCKeditorConnector): + """ + Zope versiof FCKeditorConnector + """ + # Allow access (Zope) + __allow_access_to_unprotected_subobjects__ = 1 + + def __init__(self, context=None): + """ + Constructor + """ + FCKeditorConnector.__init__(self, environ=None) # call superclass constructor + # Instance Attributes + self.context = context + self.request = FCKeditorRequest(context) + + def getZopeRootContext(self): + if self.zopeRootContext is None: + self.zopeRootContext = self.context.getPhysicalRoot() + return self.zopeRootContext + + def getZopeUploadContext(self): + if self.zopeUploadContext is None: + folderNames = self.userFilesFolder.split("/") + c = self.getZopeRootContext() + for folderName in folderNames: + if (folderName <> ""): + c = c[folderName] + self.zopeUploadContext = c + return self.zopeUploadContext + + def setHeader(self, key, value): + self.context.REQUEST.RESPONSE.setHeader(key, value) + + def getFolders(self, resourceType, currentFolder): + # Open the folders node + s = "" + s += """""" + zopeFolder = self.findZopeFolder(resourceType, currentFolder) + for (name, o) in zopeFolder.objectItems(["Folder"]): + s += """""" % ( + convertToXmlAttribute(name) + ) + # Close the folders node + s += """""" + return s + + def getZopeFoldersAndFiles(self, resourceType, currentFolder): + folders = self.getZopeFolders(resourceType, currentFolder) + files = self.getZopeFiles(resourceType, currentFolder) + s = folders + files + return s + + def getZopeFiles(self, resourceType, currentFolder): + # Open the files node + s = "" + s += """""" + zopeFolder = self.findZopeFolder(resourceType, currentFolder) + for (name, o) in zopeFolder.objectItems(["File","Image"]): + s += """""" % ( + convertToXmlAttribute(name), + ((o.get_size() / 1024) + 1) + ) + # Close the files node + s += """""" + return s + + def findZopeFolder(self, resourceType, folderName): + # returns the context of the resource / folder + zopeFolder = self.getZopeUploadContext() + folderName = self.removeFromStart(folderName, "/") + folderName = self.removeFromEnd(folderName, "/") + if (resourceType <> ""): + try: + zopeFolder = zopeFolder[resourceType] + except: + zopeFolder.manage_addProduct["OFSP"].manage_addFolder(id=resourceType, title=resourceType) + zopeFolder = zopeFolder[resourceType] + if (folderName <> ""): + folderNames = folderName.split("/") + for folderName in folderNames: + zopeFolder = zopeFolder[folderName] + return zopeFolder + + def createFolder(self, resourceType, currentFolder): + # Find out where we are + zopeFolder = self.findZopeFolder(resourceType, currentFolder) + errorNo = 0 + errorMsg = "" + if self.request.has_key("NewFolderName"): + newFolder = self.request.get("NewFolderName", None) + zopeFolder.manage_addProduct["OFSP"].manage_addFolder(id=newFolder, title=newFolder) + else: + errorNo = 102 + return self.sendErrorNode ( errorNo, errorMsg ) + + def uploadFile(self, resourceType, currentFolder, count=None): + zopeFolder = self.findZopeFolder(resourceType, currentFolder) + file = self.request.get("NewFile", None) + fileName = self.getFileName(file.filename) + fileNameOnly = self.removeExtension(fileName) + fileExtension = self.getExtension(fileName).lower() + if (count): + nid = "%s.%s.%s" % (fileNameOnly, count, fileExtension) + else: + nid = fileName + title = nid + try: + zopeFolder.manage_addProduct['OFSP'].manage_addFile( + id=nid, + title=title, + file=file.read() + ) + except: + if (count): + count += 1 + else: + count = 1 + return self.zopeFileUpload(resourceType, currentFolder, count) + return self.sendUploadResults( 0 ) + +class FCKeditorRequest(object): + "A wrapper around the request object" + def __init__(self, context=None): + r = context.REQUEST + self.request = r + + def has_key(self, key): + return self.request.has_key(key) + + def get(self, key, default=None): + return self.request.get(key, default) + +""" +Running from zope, you will need to modify this connector. +If you have uploaded the FCKeditor into Zope (like me), you need to +move this connector out of Zope, and replace the "connector" with an +alias as below. The key to it is to pass the Zope context in, as +we then have a like to the Zope context. + +## Script (Python) "connector.py" +##bind container=container +##bind context=context +##bind namespace= +##bind script=script +##bind subpath=traverse_subpath +##parameters=*args, **kws +##title=ALIAS +## + +import Products.zope as connector +return connector.FCKeditorConnectorZope(context=context).doResponse() +""" Property changes on: announcement/trunk/src/main/webapp/fckeditor/editor/filemanager/connectors/py/zope.py ___________________________________________________________________ Name: svn:eol-style + native Added: announcement/trunk/src/main/webapp/fckeditor/editor/filemanager/connectors/test.html =================================================================== --- announcement/trunk/src/main/webapp/fckeditor/editor/filemanager/connectors/test.html (rev 0) +++ announcement/trunk/src/main/webapp/fckeditor/editor/filemanager/connectors/test.html 2008-06-30 02:54:27 UTC (rev 1002) @@ -0,0 +1,210 @@ + + + + + FCKeditor - Connectors Tests + + + + + + + + + + + +
        + + + + + + + + +
        + Connector:
        + +
        +     + Current Folder
        +
        +     + Resource Type
        + +
        +
        + + + + + + + + + + +
        + Get Folders +     + Get Folders and Files +     + Create Folder +     +
        + File Upload
        + + +
        +
        +
        + URL: +
        + +
        + + Property changes on: announcement/trunk/src/main/webapp/fckeditor/editor/filemanager/connectors/test.html ___________________________________________________________________ Name: svn:eol-style + native Added: announcement/trunk/src/main/webapp/fckeditor/editor/filemanager/connectors/uploadtest.html =================================================================== --- announcement/trunk/src/main/webapp/fckeditor/editor/filemanager/connectors/uploadtest.html (rev 0) +++ announcement/trunk/src/main/webapp/fckeditor/editor/filemanager/connectors/uploadtest.html 2008-06-30 02:54:27 UTC (rev 1002) @@ -0,0 +1,192 @@ + + + + FCKeditor - Uploaders Tests + + + + + + + + + + + +
        + + + + + + + + +
        + Select the "File Uploader" to use:
        + +
        + Resource Type
        + +
        + Current Folder:
        + +
               + Custom Uploader URL:
        + +
        +
        + + + + + + +
        +
        + Upload a new file:
        +
        + + +
        +
               + Uploaded File URL:
        + +
        +
        + Post URL:   +
        + +
        + + Property changes on: announcement/trunk/src/main/webapp/fckeditor/editor/filemanager/connectors/uploadtest.html ___________________________________________________________________ Name: svn:eol-style + native Added: announcement/trunk/src/main/webapp/fckeditor/editor/images/anchor.gif =================================================================== (Binary files differ) Property changes on: announcement/trunk/src/main/webapp/fckeditor/editor/images/anchor.gif ___________________________________________________________________ Name: svn:mime-type + application/octet-stream Added: announcement/trunk/src/main/webapp/fckeditor/editor/images/arrow_ltr.gif =================================================================== (Binary files differ) Property changes on: announcement/trunk/src/main/webapp/fckeditor/editor/images/arrow_ltr.gif ___________________________________________________________________ Name: svn:mime-type + application/octet-stream Added: announcement/trunk/src/main/webapp/fckeditor/editor/images/arrow_rtl.gif =================================================================== (Binary files differ) Property changes on: announcement/trunk/src/main/webapp/fckeditor/editor/images/arrow_rtl.gif ___________________________________________________________________ Name: svn:mime-type + application/octet-stream Added: announcement/trunk/src/main/webapp/fckeditor/editor/images/smiley/msn/angel_smile.gif =================================================================== (Binary files differ) Property changes on: announcement/trunk/src/main/webapp/fckeditor/editor/images/smiley/msn/angel_smile.gif ___________________________________________________________________ Name: svn:mime-type + application/octet-stream Added: announcement/trunk/src/main/webapp/fckeditor/editor/images/smiley/msn/angry_smile.gif =================================================================== (Binary files differ) Property changes on: announcement/trunk/src/main/webapp/fckeditor/editor/images/smiley/msn/angry_smile.gif ___________________________________________________________________ Name: svn:mime-type + application/octet-stream Added: announcement/trunk/src/main/webapp/fckeditor/editor/images/smiley/msn/broken_heart.gif =================================================================== (Binary files differ) Property changes on: announcement/trunk/src/main/webapp/fckeditor/editor/images/smiley/msn/broken_heart.gif ___________________________________________________________________ Name: svn:mime-type + application/octet-stream Added: announcement/trunk/src/main/webapp/fckeditor/editor/images/smiley/msn/cake.gif =================================================================== (Binary files differ) Property changes on: announcement/trunk/src/main/webapp/fckeditor/editor/images/smiley/msn/cake.gif ___________________________________________________________________ Name: svn:mime-type + application/octet-stream Added: announcement/trunk/src/main/webapp/fckeditor/editor/images/smiley/msn/confused_smile.gif =================================================================== (Binary files differ) Property changes on: announcement/trunk/src/main/webapp/fckeditor/editor/images/smiley/msn/confused_smile.gif ___________________________________________________________________ Name: svn:mime-type + application/octet-stream Added: announcement/trunk/src/main/webapp/fckeditor/editor/images/smiley/msn/cry_smile.gif =================================================================== (Binary files differ) Property changes on: announcement/trunk/src/main/webapp/fckeditor/editor/images/smiley/msn/cry_smile.gif ___________________________________________________________________ Name: svn:mime-type + application/octet-stream Added: announcement/trunk/src/main/webapp/fckeditor/editor/images/smiley/msn/devil_smile.gif =================================================================== (Binary files differ) Property changes on: announcement/trunk/src/main/webapp/fckeditor/editor/images/smiley/msn/devil_smile.gif ___________________________________________________________________ Name: svn:mime-type + application/octet-stream Added: announcement/trunk/src/main/webapp/fckeditor/editor/images/smiley/msn/embaressed_smile.gif =================================================================== (Binary files differ) Property changes on: announcement/trunk/src/main/webapp/fckeditor/editor/images/smiley/msn/embaressed_smile.gif ___________________________________________________________________ Name: svn:mime-type + application/octet-stream Added: announcement/trunk/src/main/webapp/fckeditor/editor/images/smiley/msn/envelope.gif =================================================================== (Binary files differ) Property changes on: announcement/trunk/src/main/webapp/fckeditor/editor/images/smiley/msn/envelope.gif ___________________________________________________________________ Name: svn:mime-type + application/octet-stream Added: announcement/trunk/src/main/webapp/fckeditor/editor/images/smiley/msn/heart.gif =================================================================== (Binary files differ) Property changes on: announcement/trunk/src/main/webapp/fckeditor/editor/images/smiley/msn/heart.gif ___________________________________________________________________ Name: svn:mime-type + application/octet-stream Added: announcement/trunk/src/main/webapp/fckeditor/editor/images/smiley/msn/kiss.gif =================================================================== (Binary files differ) Property changes on: announcement/trunk/src/main/webapp/fckeditor/editor/images/smiley/msn/kiss.gif ___________________________________________________________________ Name: svn:mime-type + application/octet-stream Added: announcement/trunk/src/main/webapp/fckeditor/editor/images/smiley/msn/lightbulb.gif =================================================================== (Binary files differ) Property changes on: announcement/trunk/src/main/webapp/fckeditor/editor/images/smiley/msn/lightbulb.gif ___________________________________________________________________ Name: svn:mime-type + application/octet-stream Added: announcement/trunk/src/main/webapp/fckeditor/editor/images/smiley/msn/omg_smile.gif =================================================================== (Binary files differ) Property changes on: announcement/trunk/src/main/webapp/fckeditor/editor/images/smiley/msn/omg_smile.gif ___________________________________________________________________ Name: svn:mime-type + application/octet-stream Added: announcement/trunk/src/main/webapp/fckeditor/editor/images/smiley/msn/regular_smile.gif =================================================================== (Binary files differ) Property changes on: announcement/trunk/src/main/webapp/fckeditor/editor/images/smiley/msn/regular_smile.gif ___________________________________________________________________ Name: svn:mime-type + application/octet-stream Added: announcement/trunk/src/main/webapp/fckeditor/editor/images/smiley/msn/sad_smile.gif =================================================================== (Binary files differ) Property changes on: announcement/trunk/src/main/webapp/fckeditor/editor/images/smiley/msn/sad_smile.gif ___________________________________________________________________ Name: svn:mime-type + application/octet-stream Added: announcement/trunk/src/main/webapp/fckeditor/editor/images/smiley/msn/shades_smile.gif =================================================================== (Binary files differ) Property changes on: announcement/trunk/src/main/webapp/fckeditor/editor/images/smiley/msn/shades_smile.gif ___________________________________________________________________ Name: svn:mime-type + application/octet-stream Added: announcement/trunk/src/main/webapp/fckeditor/editor/images/smiley/msn/teeth_smile.gif =================================================================== (Binary files differ) Property changes on: announcement/trunk/src/main/webapp/fckeditor/editor/images/smiley/msn/teeth_smile.gif ___________________________________________________________________ Name: svn:mime-type + application/octet-stream Added: announcement/trunk/src/main/webapp/fckeditor/editor/images/smiley/msn/thumbs_down.gif =================================================================== (Binary files differ) Property changes on: announcement/trunk/src/main/webapp/fckeditor/editor/images/smiley/msn/thumbs_down.gif ___________________________________________________________________ Name: svn:mime-type + application/octet-stream Added: announcement/trunk/src/main/webapp/fckeditor/editor/images/smiley/msn/thumbs_up.gif =================================================================== (Binary files differ) Property changes on: announcement/trunk/src/main/webapp/fckeditor/editor/images/smiley/msn/thumbs_up.gif ___________________________________________________________________ Name: svn:mime-type + application/octet-stream Added: announcement/trunk/src/main/webapp/fckeditor/editor/images/smiley/msn/tounge_smile.gif =================================================================== (Binary files differ) Property changes on: announcement/trunk/src/main/webapp/fckeditor/editor/images/smiley/msn/tounge_smile.gif ___________________________________________________________________ Name: svn:mime-type + application/octet-stream Added: announcement/trunk/src/main/webapp/fckeditor/editor/images/smiley/msn/whatchutalkingabout_smile.gif =================================================================== (Binary files differ) Property changes on: announcement/trunk/src/main/webapp/fckeditor/editor/images/smiley/msn/whatchutalkingabout_smile.gif ___________________________________________________________________ Name: svn:mime-type + application/octet-stream Added: announcement/trunk/src/main/webapp/fckeditor/editor/images/smiley/msn/wink_smile.gif =================================================================== (Binary files differ) Property changes on: announcement/trunk/src/main/webapp/fckeditor/editor/images/smiley/msn/wink_smile.gif ___________________________________________________________________ Name: svn:mime-type + application/octet-stream Added: announcement/trunk/src/main/webapp/fckeditor/editor/images/spacer.gif =================================================================== (Binary files differ) Property changes on: announcement/trunk/src/main/webapp/fckeditor/editor/images/spacer.gif ___________________________________________________________________ Name: svn:mime-type + application/octet-stream Added: announcement/trunk/src/main/webapp/fckeditor/editor/js/fckadobeair.js =================================================================== --- announcement/trunk/src/main/webapp/fckeditor/editor/js/fckadobeair.js (rev 0) +++ announcement/trunk/src/main/webapp/fckeditor/editor/js/fckadobeair.js 2008-06-30 02:54:27 UTC (rev 1002) @@ -0,0 +1,176 @@ +?/* + * FCKeditor - The text editor for Internet - http://www.fckeditor.net + * Copyright (C) 2003-2008 Frederico Caldeira Knabben + * + * == BEGIN LICENSE == + * + * Licensed under the terms of any of the following licenses at your + * choice: + * + * - GNU General Public License Version 2 or later (the "GPL") + * http://www.gnu.org/licenses/gpl.html + * + * - GNU Lesser General Public License Version 2.1 or later (the "LGPL") + * http://www.gnu.org/licenses/lgpl.html + * + * - Mozilla Public License Version 1.1 or later (the "MPL") + * http://www.mozilla.org/MPL/MPL-1.1.html + * + * == END LICENSE == + * + * Compatibility code for Adobe AIR. + */ + +if ( FCKBrowserInfo.IsAIR ) +{ + var FCKAdobeAIR = (function() + { + /* + * ### Private functions. + */ + + var getDocumentHead = function( doc ) + { + var head ; + var heads = doc.getElementsByTagName( 'head' ) ; + + if( heads && heads[0] ) + head = heads[0] ; + else + { + head = doc.createElement( 'head' ) ; + doc.documentElement.insertBefore( head, doc.documentElement.firstChild ) ; + } + + return head ; + } ; + + /* + * ### Public interface. + */ + return { + FCKeditorAPI_Evaluate : function( parentWindow, script ) + { + // TODO : This one doesn't work always. The parent window will + // point to an anonymous function in this window. If this + // window is destroyied the parent window will be pointing to + // an invalid reference. + + // Evaluate the script in this window. + eval( script ) ; + + // Point the FCKeditorAPI property of the parent window to the + // local reference. + parentWindow.FCKeditorAPI = window.FCKeditorAPI ; + }, + + EditingArea_Start : function( doc, html ) + { + // Get the HTML for the . + var headInnerHtml = html.match( /([\s\S]*)<\/head>/i )[1] ; + + if ( headInnerHtml && headInnerHtml.length > 0 ) + { + // Inject the HTML inside a
        . + // Do that before getDocumentHead because WebKit moves + // elements to the at this point. + var div = doc.createElement( 'div' ) ; + div.innerHTML = headInnerHtml ; + + // Move the
        nodes to . + FCKDomTools.MoveChildren( div, getDocumentHead( doc ) ) ; + } + + doc.body.innerHTML = html.match( /([\s\S]*)<\/body>/i )[1] ; + + //prevent clicking on hyperlinks and navigating away + doc.addEventListener('click', function( ev ) + { + ev.preventDefault() ; + ev.stopPropagation() ; + }, true ) ; + }, + + Panel_Contructor : function( doc, baseLocation ) + { + var head = getDocumentHead( doc ) ; + + // Set the href. + head.appendChild( doc.createElement('base') ).href = baseLocation ; + + doc.body.style.margin = '0px' ; + doc.body.style.padding = '0px' ; + }, + + ToolbarSet_GetOutElement : function( win, outMatch ) + { + var toolbarTarget = win.parent ; + + var targetWindowParts = outMatch[1].split( '.' ) ; + while ( targetWindowParts.length > 0 ) + { + var part = targetWindowParts.shift() ; + if ( part.length > 0 ) + toolbarTarget = toolbarTarget[ part ] ; + } + + toolbarTarget = toolbarTarget.document.getElementById( outMatch[2] ) ; + }, + + ToolbarSet_InitOutFrame : function( doc ) + { + var head = getDocumentHead( doc ) ; + + head.appendChild( doc.createElement('base') ).href = window.document.location ; + + var targetWindow = doc.defaultView; + + targetWindow.adjust = function() + { + targetWindow.frameElement.height = doc.body.scrollHeight; + } ; + + targetWindow.onresize = targetWindow.adjust ; + targetWindow.setTimeout( targetWindow.adjust, 0 ) ; + + doc.body.style.overflow = 'hidden'; + doc.body.innerHTML = document.getElementById( 'xToolbarSpace' ).innerHTML ; + } + } ; + })(); + + /* + * ### Overrides + */ + ( function() + { + // Save references for override reuse. + var _Original_FCKPanel_Window_OnFocus = FCKPanel_Window_OnFocus ; + var _Original_FCKPanel_Window_OnBlur = FCKPanel_Window_OnBlur ; + var _Original_FCK_StartEditor = FCK.StartEditor ; + + FCKPanel_Window_OnFocus = function( e, panel ) + { + // Call the original implementation. + _Original_FCKPanel_Window_OnFocus.call( this, e, panel ) ; + + if ( panel._focusTimer ) + clearTimeout( panel._focusTimer ) ; + } + + FCKPanel_Window_OnBlur = function( e, panel ) + { + // Delay the execution of the original function. + panel._focusTimer = FCKTools.SetTimeout( _Original_FCKPanel_Window_OnBlur, 100, this, [ e, panel ] ) ; + } + + FCK.StartEditor = function() + { + // Force pointing to the CSS files instead of using the inline CSS cached styles. + window.FCK_InternalCSS = FCKConfig.BasePath + 'css/fck_internal.css' ; + window.FCK_ShowTableBordersCSS = FCKConfig.BasePath + 'css/fck_showtableborders_gecko.css' ; + + _Original_FCK_StartEditor.apply( this, arguments ) ; + } + })(); +} Property changes on: announcement/trunk/src/main/webapp/fckeditor/editor/js/fckadobeair.js ___________________________________________________________________ Name: svn:eol-style + native Added: announcement/trunk/src/main/webapp/fckeditor/editor/js/fckeditorcode_gecko.js =================================================================== --- announcement/trunk/src/main/webapp/fckeditor/editor/js/fckeditorcode_gecko.js (rev 0) +++ announcement/trunk/src/main/webapp/fckeditor/editor/js/fckeditorcode_gecko.js 2008-06-30 02:54:27 UTC (rev 1002) @@ -0,0 +1,108 @@ +?/* + * FCKeditor - The text editor for Internet - http://www.fckeditor.net + * Copyright (C) 2003-2008 Frederico Caldeira Knabben + * + * == BEGIN LICENSE == + * + * Licensed under the terms of any of the following licenses at your + * choice: + * + * - GNU General Public License Version 2 or later (the "GPL") + * http://www.gnu.org/licenses/gpl.html + * + * - GNU Lesser General Public License Version 2.1 or later (the "LGPL") + * http://www.gnu.org/licenses/lgpl.html + * + * - Mozilla Public License Version 1.1 or later (the "MPL") + * http://www.mozilla.org/MPL/MPL-1.1.html + * + * == END LICENSE == + * + * This file has been compressed for better performance. The original source + * can be found at "editor/_source". + */ + +var FCK_STATUS_NOTLOADED=window.parent.FCK_STATUS_NOTLOADED=0;var FCK_STATUS_ACTIVE=window.parent.FCK_STATUS_ACTIVE=1;var FCK_STATUS_COMPLETE=window.parent.FCK_STATUS_COMPLETE=2;var FCK_TRISTATE_OFF=window.parent.FCK_TRISTATE_OFF=0;var FCK_TRISTATE_ON=window.parent.FCK_TRISTATE_ON=1;var FCK_TRISTATE_DISABLED=window.parent.FCK_TRISTATE_DISABLED=-1;var FCK_UNKNOWN=window.parent.FCK_UNKNOWN=-9;var FCK_TOOLBARITEM_ONLYICON=window.parent.FCK_TOOLBARITEM_ONLYICON=0;var FCK_TOOLBARITEM_ONLYTEXT=window.parent.FCK_TOOLBARITEM_ONLYTEXT=1;var FCK_TOOLBARITEM_ICONTEXT=window.parent.FCK_TOOLBARITEM_ICONTEXT=2;var FCK_EDITMODE_WYSIWYG=window.parent.FCK_EDITMODE_WYSIWYG=0;var FCK_EDITMODE_SOURCE=window.parent.FCK_EDITMODE_SOURCE=1;var FCK_IMAGES_PATH='images/';var FCK_SPACER_PATH='images/spacer.gif';var CTRL=1000;var SHIFT=2000;var ALT=4000;var FCK_STYLE_BLOCK=0;var FCK_STYLE_INLINE=1;var FCK_STYLE_OBJECT=2; +String.prototype.Contains=function(A){return (this.indexOf(A)>-1);};String.prototype.Equals=function(){var A=arguments;if (A.length==1&&A[0].pop) A=A[0];for (var i=0;iC) return false;if (B){var E=new RegExp(A+'$','i');return E.test(this);}else return (D==0||this.substr(C-D,D)==A);};String.prototype.Remove=function(A,B){var s='';if (A>0) s=this.substring(0,A);if (A+B=7),IsIE6:/*@cc_on!@*/false && ( parseInt( s.match( /msie (\d+)/)[1],10)>=6),IsSafari:s.Contains(' applewebkit/'),IsOpera:!!window.opera,IsAIR:s.Contains(' adobeair/'),IsMac:s.Contains('macintosh')};(function(A){A.IsGecko=(navigator.product=='Gecko')&&!A.IsSafari&&!A.IsOpera;A.IsGeckoLike=(A.IsGecko||A.IsSafari||A.IsOpera);if (A.IsGecko){var B=s.match(/rv:(\d+\.\d+)/);var C=B&&parseFloat(B[1]);if (C){A.IsGecko10=(C<1.8);A.IsGecko19=(C>1.8);}}})(FCKBrowserInfo); +var FCKURLParams={};(function(){var A=document.location.search.substr(1).split('&');for (var i=0;i';if (!FCKRegexLib.HtmlOpener.test(A)) A=''+A+'';if (!FCKRegexLib.HeadOpener.test(A)) A=A.replace(FCKRegexLib.HtmlOpener,'$&');return A;}else{var B=FCKConfig.DocType+'0&&!FCKRegexLib.Html4DocType.test(FCKConfig.DocType)) B+=' style="overflow-y: scroll"';B+='>'+A+'';return B;}},ConvertToDataFormat:function(A,B,C,D){var E=FCKXHtml.GetXHTML(A,!B,D);if (C&&FCKRegexLib.EmptyOutParagraph.test(E)) return '';return E;},FixHtml:function(A){return A;}}; +var FCK={Name:FCKURLParams['InstanceName'],Status:0,EditMode:0,Toolbar:null,HasFocus:false,DataProcessor:new FCKDataProcessor(),GetInstanceObject:(function(){var w=window;return function(name){return w[name];}})(),AttachToOnSelectionChange:function(A){this.Events.AttachEvent('OnSelectionChange',A);},GetLinkedFieldValue:function(){return this.LinkedField.value;},GetParentForm:function(){return this.LinkedField.form;},StartupValue:'',IsDirty:function(){if (this.EditMode==1) return (this.StartupValue!=this.EditingArea.Textarea.value);else{if (!this.EditorDocument) return false;return (this.StartupValue!=this.EditorDocument.body.innerHTML);}},ResetIsDirty:function(){if (this.EditMode==1) this.StartupValue=this.EditingArea.Textarea.value;else if (this.EditorDocument.body) this.StartupValue=this.EditorDocument.body.innerHTML;},StartEditor:function(){this.TempBaseTag=FCKConfig.BaseHref.length>0?'':'';var A=FCK.KeystrokeHandler=new FCKKeystrokeHandler();A.OnKeystroke=_FCK_KeystrokeHandler_OnKeystroke;A.SetKeystrokes(FCKConfig.Keystrokes);if (FCKBrowserInfo.IsIE7){if ((CTRL+86/*V*/) in A.Keystrokes) A.SetKeystrokes([CTRL+86,true]);if ((SHIFT+45/*INS*/) in A.Keystrokes) A.SetKeystrokes([SHIFT+45,true]);};A.SetKeystrokes([CTRL+8,true]);this.EditingArea=new FCKEditingArea(document.getElementById('xEditingArea'));this.EditingArea.FFSpellChecker=FCKConfig.FirefoxSpellChecker;this.SetData(this.GetLinkedFieldValue(),true);FCKTools.AddEventListener(document,"keydown",this._TabKeyHandler);this.AttachToOnSelectionChange(_FCK_PaddingNodeListener);if (FCKBrowserInfo.IsGecko) this.AttachToOnSelectionChange(this._ExecCheckEmptyBlock);},Focus:function(){FCK.EditingArea.Focus();},SetStatus:function(A){this.Status=A;if (A==1){FCKFocusManager.AddWindow(window,true);if (FCKBrowserInfo.IsIE) FCKFocusManager.AddWindow(window.frameElement,true);if (FCKConfig.StartupFocus) FCK.Focus();};this.Events.FireEvent('OnStatusChange',A);},FixBody:function(){var A=FCKConfig.EnterMode;if (A!='p'&&A!='div') return;var B=this.EditorDocument;if (!B) return;var C=B.body;if (!C) return;FCKDomTools.TrimNode(C);var D=C.firstChild;var E;while (D){var F=false;switch (D.nodeType){case 1:var G=D.nodeName.toLowerCase();if (!FCKListsLib.BlockElements[G]&&G!='li'&&!D.getAttribute('_fckfakelement')&&D.getAttribute('_moz_dirty')==null) F=true;break;case 3:if (E||D.nodeValue.Trim().length>0) F=true;break;case 8:if (E) F=true;break;};if (F){var H=D.parentNode;if (!E) E=H.insertBefore(B.createElement(A),D);E.appendChild(H.removeChild(D));D=E.nextSibling;}else{if (E){FCKDomTools.TrimNode(E);E=null;};D=D.nextSibling;}};if (E) FCKDomTools.TrimNode(E);},GetData:function(A){if (FCK.EditMode==1) return FCK.EditingArea.Textarea.value;this.FixBody();var B=FCK.EditorDocument;if (!B) return null;var C=FCKConfig.FullPage;var D=FCK.DataProcessor.ConvertToDataFormat(C?B.documentElement:B.body,!C,FCKConfig.IgnoreEmptyParagraphValue,A);D=FCK.ProtectEventsRestore(D);if (FCKBrowserInfo.IsIE) D=D.replace(FCKRegexLib.ToReplace,'$1');if (C){if (FCK.DocTypeDeclaration&&FCK.DocTypeDeclaration.length>0) D=FCK.DocTypeDeclaration+'\n'+D;if (FCK.XmlDeclaration&&FCK.XmlDeclaration.length>0) D=FCK.XmlDeclaration+'\n'+D;};return FCKConfig.ProtectedSource.Revert(D);},UpdateLinkedField:function(){var A=FCK.GetXHTML(FCKConfig.FormatOutput);if (FCKConfig.HtmlEncodeOutput) A=FCKTools.HTMLEncode(A);FCK.LinkedField.value=A;FCK.Events.FireEvent('OnAfterLinkedFieldUpdate');},RegisteredDoubleClickHandlers:{},OnDoubleClick:function(A){var B=FCK.RegisteredDoubleClickHandlers[A.tagName.toUpperCase()];if (B){for (var i=0;i0?'|ABBR|XML|EMBED|OBJECT':'ABBR|XML|EMBED|OBJECT';var C;if (B.length>0){C=new RegExp('<('+B+')(?!\w|:)','gi');A=A.replace(C,'','gi');A=A.replace(C,'<\/FCK:$1>');};B='META';if (FCKBrowserInfo.IsIE) B+='|HR';C=new RegExp('<(('+B+')(?=\\s|>|/)[\\s\\S]*?)/?>','gi');A=A.replace(C,'');return A;},SetData:function(A,B){this.EditingArea.Mode=FCK.EditMode;if (FCKBrowserInfo.IsIE&&FCK.EditorDocument){FCK.EditorDocument.detachEvent("onselectionchange",Doc_OnSelectionChange);};if (FCK.EditMode==0){this._ForceResetIsDirty=(B===true);A=FCKConfig.ProtectedSource.Protect(A);A=FCK.DataProcessor.ConvertToHtml(A);A=A.replace(FCKRegexLib.InvalidSelfCloseTags,'$1>');A=FCK.ProtectEvents(A);A=FCK.ProtectUrls(A);A=FCK.ProtectTags(A);if (FCK.TempBaseTag.length>0&&!FCKRegexLib.HasBaseTag.test(A)) A=A.replace(FCKRegexLib.HeadOpener,'$&'+FCK.TempBaseTag);var C='';if (!FCKConfig.FullPage) C+=_FCK_GetEditorAreaStyleTags();if (FCKBrowserInfo.IsIE) C+=FCK._GetBehaviorsStyle();else if (FCKConfig.ShowBorders) C+=FCKTools.GetStyleHtml(FCK_ShowTableBordersCSS,true);C+=FCKTools.GetStyleHtml(FCK_InternalCSS,true);A=A.replace(FCKRegexLib.HeadCloser,C+'$&');this.EditingArea.OnLoad=_FCK_EditingArea_OnLoad;this.EditingArea.Start(A);}else{FCK.EditorWindow=null;FCK.EditorDocument=null;FCKDomTools.PaddingNode=null;this.EditingArea.OnLoad=null;this.EditingArea.Start(A);this.EditingArea.Textarea._FCKShowContextMenu=true;FCK.EnterKeyHandler=null;if (B) this.ResetIsDirty();FCK.KeystrokeHandler.AttachToElement(this.EditingArea.Textarea);this.EditingArea.Textarea.focus();FCK.Events.FireEvent('OnAfterSetHTML');};if (FCKBrowserInfo.IsGecko) window.onresize();},RedirectNamedCommands:{},ExecuteNamedCommand:function(A,B,C,D){if (!D) FCKUndo.SaveUndoStep();if (!C&&FCK.RedirectNamedCommands[A]!=null) FCK.ExecuteRedirectedNamedCommand(A,B);else{FCK.Focus();FCK.EditorDocument.execCommand(A,false,B);FCK.Events.FireEvent('OnSelectionChange');};if (!D) FCKUndo.SaveUndoStep();},GetNamedCommandState:function(A){try{if (FCKBrowserInfo.IsSafari&&FCK.EditorWindow&&A.IEquals('Paste')) return 0;if (!FCK.EditorDocument.queryCommandEnabled(A)) return -1;else{return FCK.EditorDocument.queryCommandState(A)?1:0;}}catch (e){return 0;}},GetNamedCommandValue:function(A){var B='';var C=FCK.GetNamedCommandState(A);if (C==-1) return null;try{B=this.EditorDocument.queryCommandValue(A);}catch(e) {};return B?B:'';},Paste:function(A){if (FCK.Status!=2||!FCK.Events.FireEvent('OnPaste')) return false;return A||FCK._ExecPaste();},PasteFromWord:function(){FCKDialog.OpenDialog('FCKDialog_Paste',FCKLang.PasteFromWord,'dialog/fck_paste.html',400,330,'Word');},Preview:function(){var A;if (FCKConfig.FullPage){if (FCK.TempBaseTag.length>0) A=FCK.TempBaseTag+FCK.GetXHTML();else A=FCK.GetXHTML();}else{A=FCKConfig.DocType+''+FCK.TempBaseTag+''+FCKLang.Preview+''+_FCK_GetEditorAreaStyleTags()+''+FCK.GetXHTML()+'';};var B=FCKConfig.ScreenWidth*0.8;var C=FCKConfig.ScreenHeight*0.7;var D=(FCKConfig.ScreenWidth-B)/2;var E='';if (FCK_IS_CUSTOM_DOMAIN&&FCKBrowserInfo.IsIE){window._FCKHtmlToLoad=A;E='javascript:void( (function(){document.open() ;document.domain="'+document.domain+'" ;document.write( window.opener._FCKHtmlToLoad );document.close() ;window.opener._FCKHtmlToLoad = null ;})() )';};var F=window.open(E,null,'toolbar=yes,location=no,status=yes,menubar=yes,scrollbars=yes,resizable=yes,width='+B+',height='+C+',left='+D);if (!FCK_IS_CUSTOM_DOMAIN||!FCKBrowserInfo.IsIE){F.document.write(A);F.document.close();}},SwitchEditMode:function(A){var B=(FCK.EditMode==0);var C=FCK.IsDirty();var D;if (B){FCKCommands.GetCommand('ShowBlocks').SaveState();if (!A&&FCKBrowserInfo.IsIE) FCKUndo.SaveUndoStep();D=FCK.GetXHTML(FCKConfig.FormatSource);if (D==null) return false;}else D=this.EditingArea.Textarea.value;FCK.EditMode=B?1:0;FCK.SetData(D,!C);FCK.Focus();FCKTools.RunFunction(FCK.ToolbarSet.RefreshModeState,FCK.ToolbarSet);return true;},InsertElement:function(A){if (typeof A=='string') A=this.EditorDocument.createElement(A);var B=A.nodeName.toLowerCase();FCKSelection.Restore();var C=new FCKDomRange(this.EditorWindow);C.MoveToSelection();C.DeleteContents();if (FCKListsLib.BlockElements[B]!=null){if (C.StartBlock){if (C.CheckStartOfBlock()) C.MoveToPosition(C.StartBlock,3);else if (C.CheckEndOfBlock()) C.MoveToPosition(C.StartBlock,4);else C.SplitBlock();};C.InsertNode(A);var D=FCKDomTools.GetNextSourceElement(A,false,null,['hr','br','param','img','area','input'],true);if (!D&&FCKConfig.EnterMode!='br'){D=this.EditorDocument.body.appendChild(this.EditorDocument.createElement(FCKConfig.EnterMode));if (FCKBrowserInfo.IsGeckoLike) FCKTools.AppendBogusBr(D);};if (FCKListsLib.EmptyElements[B]==null) C.MoveToElementEditStart(A);else if (D) C.MoveToElementEditStart(D);else C.MoveToPosition(A,4);if (FCKBrowserInfo.IsGecko){if (D) D.scrollIntoView(false);A.scrollIntoView(false);}}else{C.InsertNode(A);C.SetStart(A,4);C.SetEnd(A,4);};C.Select();C.Release();this.Focus();return A;},_InsertBlockElement:function(A){},_IsFunctionKey:function(A){if (A>=16&&A<=20) return true;if (A==27||(A>=33&&A<=40)) return true;if (A==45) return true;return false;},_KeyDownListener:function(A){if (!A) A=FCK.EditorWindow.event;if (FCK.EditorWindow){if (!FCK._IsFunctionKey(A.keyCode)&&!(A.ctrlKey||A.metaKey)&&!(A.keyCode==46)) FCK._KeyDownUndo();};return true;},_KeyDownUndo:function(){if (!FCKUndo.Typing){FCKUndo.SaveUndoStep();FCKUndo.Typing=true;FCK.Events.FireEvent("OnSelectionChange");};FCKUndo.TypesCount++;FCKUndo.Changed=1;if (FCKUndo.TypesCount>FCKUndo.MaxTypes){FCKUndo.TypesCount=0;FCKUndo.SaveUndoStep();}},_TabKeyHandler:function(A){if (!A) A=window.event;var B=A.keyCode;if (B==9&&FCK.EditMode!=0){if (FCKBrowserInfo.IsIE){var C=document.selection.createRange();if (C.parentElement()!=FCK.EditingArea.Textarea) return true;C.text='\t';C.select();}else{var a=[];var D=FCK.EditingArea.Textarea;var E=D.selectionStart;var F=D.selectionEnd;a.push(D.value.substr(0,E));a.push('\t');a.push(D.value.substr(F));D.value=a.join('');D.setSelectionRange(E+1,E+1);};if (A.preventDefault) return A.preventDefault();return A.returnValue=false;};return true;}};FCK.Events=new FCKEvents(FCK);FCK.GetHTML=FCK.GetXHTML=FCK.GetData;FCK.SetHTML=FCK.SetData;FCK.InsertElementAndGetIt=FCK.CreateElement=FCK.InsertElement;function _FCK_ProtectEvents_ReplaceTags(A){return A.replace(FCKRegexLib.EventAttributes,_FCK_ProtectEvents_ReplaceEvents);};function _FCK_ProtectEvents_ReplaceEvents(A,B){return ' '+B+'_fckprotectedatt="'+encodeURIComponent(A)+'"';};function _FCK_ProtectEvents_RestoreEvents(A,B){return decodeURIComponent(B);};function _FCK_MouseEventsListener(A){if (!A) A=window.event;if (A.type=='mousedown') FCK.MouseDownFlag=true;else if (A.type=='mouseup') FCK.MouseDownFlag=false;else if (A.type=='mousemove') FCK.Events.FireEvent('OnMouseMove',A);};function _FCK_PaddingNodeListener(){if (FCKConfig.EnterMode.IEquals('br')) return;FCKDomTools.EnforcePaddingNode(FCK.EditorDocument,FCKConfig.EnterMode);if (!FCKBrowserInfo.IsIE&&FCKDomTools.PaddingNode){var A=FCKSelection.GetSelection();if (A&&A.rangeCount==1){var B=A.getRangeAt(0);if (B.collapsed&&B.startContainer==FCK.EditorDocument.body&&B.startOffset==0){B.selectNodeContents(FCKDomTools.PaddingNode);B.collapse(true);A.removeAllRanges();A.addRange(B);}}}else if (FCKDomTools.PaddingNode){var C=FCKSelection.GetParentElement();var D=FCKDomTools.PaddingNode;if (C&&C.nodeName.IEquals('body')){if (FCK.EditorDocument.body.childNodes.length==1&&FCK.EditorDocument.body.firstChild==D){if (FCKSelection._GetSelectionDocument(FCK.EditorDocument.selection)!=FCK.EditorDocument) return;var B=FCK.EditorDocument.body.createTextRange();var F=false;if (!D.childNodes.firstChild){D.appendChild(FCKTools.GetElementDocument(D).createTextNode('\ufeff'));F=true;};B.moveToElementText(D);B.select();if (F) B.pasteHTML('');}}}};function _FCK_EditingArea_OnLoad(){FCK.EditorWindow=FCK.EditingArea.Window;FCK.EditorDocument=FCK.EditingArea.Document;FCK.InitializeBehaviors();FCK.MouseDownFlag=false;FCKTools.AddEventListener(FCK.EditorDocument,'mousemove',_FCK_MouseEventsListener);FCKTools.AddEventListener(FCK.EditorDocument,'mousedown',_FCK_MouseEventsListener);FCKTools.AddEventListener(FCK.EditorDocument,'mouseup',_FCK_MouseEventsListener);if (FCKBrowserInfo.IsSafari){var A=function(evt){if (!(evt.ctrlKey||evt.metaKey)) return;if (FCK.EditMode!=0) return;switch (evt.keyCode){case 89:FCKUndo.Redo();break;case 90:FCKUndo.Undo();break;}};FCKTools.AddEventListener(FCK.EditorDocument,'keyup',A);};FCK.EnterKeyHandler=new FCKEnterKey(FCK.EditorWindow,FCKConfig.EnterMode,FCKConfig.ShiftEnterMode,FCKConfig.TabSpaces);FCK.KeystrokeHandler.AttachToElement(FCK.EditorDocument);if (FCK._ForceResetIsDirty) FCK.ResetIsDirty();if (FCKBrowserInfo.IsIE&&FCK.HasFocus) FCK.EditorDocument.body.setActive();FCK.OnAfterSetHTML();FCKCommands.GetCommand('ShowBlocks').RestoreState();if (FCK.Status!=0) return;FCK.SetStatus(1);};function _FCK_GetEditorAreaStyleTags(){return FCKTools.GetStyleHtml(FCKConfig.EditorAreaCSS)+FCKTools.GetStyleHtml(FCKConfig.EditorAreaStyles);};function _FCK_KeystrokeHandler_OnKeystroke(A,B){if (FCK.Status!=2) return false;if (FCK.EditMode==0){switch (B){case 'Paste':return!FCK.Paste();case 'Cut':FCKUndo.SaveUndoStep();return false;}}else{if (B.Equals('Paste','Undo','Redo','SelectAll','Cut')) return false;};var C=FCK.Commands.GetCommand(B);if (C.GetState()==-1) return false;return (C.Execute.apply(C,FCKTools.ArgumentsToArray(arguments,2))!==false);};(function(){var A=window.parent.document;var B=A.getElementById(FCK.Name);var i=0;while (B||i==0){if (B&&B.tagName.toLowerCase().Equals('input','textarea')){FCK.LinkedField=B;break;};B=A.getElementsByName(FCK.Name)[i++];}})();var FCKTempBin={Elements:[],AddElement:function(A){var B=this.Elements.length;this.Elements[B]=A;return B;},RemoveElement:function(A){var e=this.Elements[A];this.Elements[A]=null;return e;},Reset:function(){var i=0;while (i40) return;};var C=function(H){if (H.nodeType!=1) return false;var D=H.tagName.toLowerCase();return (FCKListsLib.BlockElements[D]||FCKListsLib.EmptyElements[D]);};var E=function(){var F=FCKSelection.GetSelection();var G=F.getRangeAt(0);if (!G||!G.collapsed) return;var H=G.endContainer;if (H.nodeType!=3) return;if (H.nodeValue.length!=G.endOffset) return;var I=H.parentNode.tagName.toLowerCase();if (!(I=='a'||(!FCKBrowserInfo.IsOpera&&String(H.parentNode.contentEditable)=='false')||(!(FCKListsLib.BlockElements[I]||FCKListsLib.NonEmptyBlockElements[I])&&B==35))) return;var J=FCKTools.GetNextTextNode(H,H.parentNode,C);if (J) return;G=FCK.EditorDocument.createRange();J=FCKTools.GetNextTextNode(H,H.parentNode.parentNode,C);if (J){if (FCKBrowserInfo.IsOpera&&B==37) return;G.setStart(J,0);G.setEnd(J,0);}else{while (H.parentNode&&H.parentNode!=FCK.EditorDocument.body&&H.parentNode!=FCK.EditorDocument.documentElement&&H==H.parentNode.lastChild&&(!FCKListsLib.BlockElements[H.parentNode.tagName.toLowerCase()]&&!FCKListsLib.NonEmptyBlockElements[H.parentNode.tagName.toLowerCase()])) H=H.parentNode;if (FCKListsLib.BlockElements[I]||FCKListsLib.EmptyElements[I]||H==FCK.EditorDocument.body){G.setStart(H,H.childNodes.length);G.setEnd(H,H.childNodes.length);}else{var K=H.nextSibling;while (K){if (K.nodeType!=1){K=K.nextSibling;continue;};var L=K.tagName.toLowerCase();if (FCKListsLib.BlockElements[L]||FCKListsLib.EmptyElements[L]||FCKListsLib.NonEmptyBlockElements[L]) break;K=K.nextSibling;};var M=FCK.EditorDocument.createTextNode('');if (K) H.parentNode.insertBefore(M,K);else H.parentNode.appendChild(M);G.setStart(M,0);G.setEnd(M,0);}};F.removeAllRanges();F.addRange(G);FCK.Events.FireEvent("OnSelectionChange");};setTimeout(E,1);};this.ExecOnSelectionChangeTimer=function(){if (FCK.LastOnChangeTimer) window.clearTimeout(FCK.LastOnChangeTimer);FCK.LastOnChangeTimer=window.setTimeout(FCK.ExecOnSelectionChange,100);};this.EditorDocument.addEventListener('mouseup',this.ExecOnSelectionChange,false);this.EditorDocument.addEventListener('keyup',this.ExecOnSelectionChangeTimer,false);this._DblClickListener=function(e){FCK.OnDoubleClick(e.target);e.stopPropagation();};this.EditorDocument.addEventListener('dblclick',this._DblClickListener,true);this.EditorDocument.addEventListener('keydown',this._KeyDownListener,false);if (FCKBrowserInfo.IsGecko){this.EditorWindow.addEventListener('dragdrop',this._ExecDrop,true);}else if (FCKBrowserInfo.IsSafari){var N=function(evt){ if (!FCK.MouseDownFlag) evt.returnValue=false;};this.EditorDocument.addEventListener('dragenter',N,true);this.EditorDocument.addEventListener('dragover',N,true);this.EditorDocument.addEventListener('drop',this._ExecDrop,true);this.EditorDocument.addEventListener('mousedown',function(ev){var O=ev.srcElement;if (O.nodeName.IEquals('IMG','HR','INPUT','TEXTAREA','SELECT')){FCKSelection.SelectNode(O);}},true);this.EditorDocument.addEventListener('mouseup',function(ev){if (ev.srcElement.nodeName.IEquals('INPUT','TEXTAREA','SELECT')) ev.preventDefault()},true);this.EditorDocument.addEventListener('click',function(ev){if (ev.srcElement.nodeName.IEquals('INPUT','TEXTAREA','SELECT')) ev.preventDefault()},true);};if (FCKBrowserInfo.IsGecko||FCKBrowserInfo.IsOpera){this.EditorDocument.addEventListener('keypress',this._ExecCheckCaret,false);this.EditorDocument.addEventListener('click',this._ExecCheckCaret,false);};FCK.ContextMenu._InnerContextMenu.SetMouseClickWindow(FCK.EditorWindow);FCK.ContextMenu._InnerContextMenu.AttachToElement(FCK.EditorDocument);};FCK.MakeEditable=function(){this.EditingArea.MakeEditable();};function Document_OnContextMenu(e){if (!e.target._FCKShowContextMenu) e.preventDefault();};document.oncontextmenu=Document_OnContextMenu;FCK._BaseGetNamedCommandState=FCK.GetNamedCommandState;FCK.GetNamedCommandState=function(A){switch (A){case 'Unlink':return FCKSelection.HasAncestorNode('A')?0:-1;default:return FCK._BaseGetNamedCommandState(A);}};FCK.RedirectNamedCommands={Print:true,Paste:true};FCK.ExecuteRedirectedNamedCommand=function(A,B){switch (A){case 'Print':FCK.EditorWindow.print();break;case 'Paste':try{if (FCKBrowserInfo.IsSafari) throw '';if (FCK.Paste()) FCK.ExecuteNamedCommand('Paste',null,true);}catch (e) { FCKDialog.OpenDialog('FCKDialog_Paste',FCKLang.Paste,'dialog/fck_paste.html',400,330,'Security');};break;default:FCK.ExecuteNamedCommand(A,B);}};FCK._ExecPaste=function(){FCKUndo.SaveUndoStep();if (FCKConfig.ForcePasteAsPlainText){FCK.PasteAsPlainText();return false;};return true;};FCK.InsertHtml=function(A){var B=FCK.EditorDocument;A=FCKConfig.ProtectedSource.Protect(A);A=FCK.ProtectEvents(A);A=FCK.ProtectUrls(A);A=FCK.ProtectTags(A);FCKUndo.SaveUndoStep();if (FCKBrowserInfo.IsGecko){A=''+A+'';};B.execCommand('inserthtml',false,A);if (FCKBrowserInfo.IsGecko){FCKDomTools.RemoveNode(B.getElementById('__fakeFCKRemove1__'));FCKDomTools.RemoveNode(B.getElementById('__fakeFCKRemove2__'));};this.Focus();var C=new FCKDomRange(this.EditorWindow);C.MoveToSelection();var D=C.CreateBookmark();FCKDocumentProcessor.Process(B);try{C.MoveToBookmark(D);C.Select();}catch (e) {};this.Events.FireEvent("OnSelectionChange");};FCK.PasteAsPlainText=function(){FCKTools.RunFunction(FCKDialog.OpenDialog,FCKDialog,['FCKDialog_Paste',FCKLang.PasteAsText,'dialog/fck_paste.html',400,330,'PlainText']);};FCK.GetClipboardHTML=function(){return '';};FCK.CreateLink=function(A,B){var C=[];if (FCKSelection.GetSelection().isCollapsed) return C;FCK.ExecuteNamedCommand('Unlink',null,false,!!B);if (A.length>0){var D='javascript:void(0);/*'+(new Date().getTime())+'*/';FCK.ExecuteNamedCommand('CreateLink',D,false,!!B);var E=this.EditorDocument.evaluate("//a[@href='"+D+"']",this.EditorDocument.body,null,XPathResult.UNORDERED_NODE_SNAPSHOT_TYPE,null);for (var i=0;i0&&!isNaN(E)) this.PageConfig[D]=parseInt(E,10);else this.PageConfig[D]=E;}};function FCKConfig_LoadPageConfig(){var A=FCKConfig.PageConfig;for (var B in A) FCKConfig[B]=A[B];};function FCKConfig_PreProcess(){var A=FCKConfig;if (A.AllowQueryStringDebug){try{if ((/fckdebug=true/i).test(window.top.location.search)) A.Debug=true;}catch (e) {/*Ignore it. Much probably we are inside a FRAME where the "top" is in another domain (security error).*/}};if (!A.PluginsPath.EndsWith('/')) A.PluginsPath+='/';var B=A.ToolbarComboPreviewCSS;if (!B||B.length==0) A.ToolbarComboPreviewCSS=A.EditorAreaCSS;A.RemoveAttributesArray=(A.RemoveAttributes||'').split(',');if (!FCKConfig.SkinEditorCSS||FCKConfig.SkinEditorCSS.length==0) FCKConfig.SkinEditorCSS=FCKConfig.SkinPath+'fck_editor.css';if (!FCKConfig.SkinDialogCSS||FCKConfig.SkinDialogCSS.length==0) FCKConfig.SkinDialogCSS=FCKConfig.SkinPath+'fck_dialog.css';};FCKConfig.ToolbarSets={};FCKConfig.Plugins={};FCKConfig.Plugins.Items=[];FCKConfig.Plugins.Add=function(A,B,C){FCKConfig.Plugins.Items.AddItem([A,B,C]);};FCKConfig.ProtectedSource={};FCKConfig.ProtectedSource._CodeTag=(new Date()).valueOf();FCKConfig.ProtectedSource.RegexEntries=[//g,//gi,//gi];FCKConfig.ProtectedSource.Add=function(A){this.RegexEntries.AddItem(A);};FCKConfig.ProtectedSource.Protect=function(A){var B=this._CodeTag;function _Replace(protectedSource){var C=FCKTempBin.AddElement(protectedSource);return '';};for (var i=0;i|>)","g");return A.replace(D,_Replace);};FCKConfig.GetBodyAttributes=function(){var A='';if (this.BodyId&&this.BodyId.length>0) A+=' id="'+this.BodyId+'"';if (this.BodyClass&&this.BodyClass.length>0) A+=' class="'+this.BodyClass+'"';return A;};FCKConfig.ApplyBodyAttributes=function(A){if (this.BodyId&&this.BodyId.length>0) A.id=FCKConfig.BodyId;if (this.BodyClass&&this.BodyClass.length>0) A.className+=' '+FCKConfig.BodyClass;}; +var FCKDebug={Output:function(){},OutputObject:function(){}}; +var FCKDomTools={MoveChildren:function(A,B,C){if (A==B) return;var D;if (C){while ((D=A.lastChild)) B.insertBefore(A.removeChild(D),B.firstChild);}else{while ((D=A.firstChild)) B.appendChild(A.removeChild(D));}},MoveNode:function(A,B,C){if (C) B.insertBefore(FCKDomTools.RemoveNode(A),B.firstChild);else B.appendChild(FCKDomTools.RemoveNode(A));},TrimNode:function(A){this.LTrimNode(A);this.RTrimNode(A);},LTrimNode:function(A){var B;while ((B=A.firstChild)){if (B.nodeType==3){var C=B.nodeValue.LTrim();var D=B.nodeValue.length;if (C.length==0){A.removeChild(B);continue;}else if (C.length0) break;if (A.lastChild) A=A.lastChild;else return this.GetPreviousSourceElement(A,B,C,D);};return null;},GetNextSourceElement:function(A,B,C,D,E){while((A=this.GetNextSourceNode(A,E))){if (A.nodeType==1){if (C&&A.nodeName.IEquals(C)) break;if (D&&A.nodeName.IEquals(D)) return this.GetNextSourceElement(A,B,C,D);return A;}else if (B&&A.nodeType==3&&A.nodeValue.RTrim().length>0) break;};return null;},GetNextSourceNode:function(A,B,C,D){if (!A) return null;var E;if (!B&&A.firstChild) E=A.firstChild;else{if (D&&A==D) return null;E=A.nextSibling;if (!E&&(!D||D!=A.parentNode)) return this.GetNextSourceNode(A.parentNode,true,C,D);};if (C&&E&&E.nodeType!=C) return this.GetNextSourceNode(E,false,C,D);return E;},GetPreviousSourceNode:function(A,B,C,D){if (!A) return null;var E;if (!B&&A.lastChild) E=A.lastChild;else{if (D&&A==D) return null;E=A.previousSibling;if (!E&&(!D||D!=A.parentNode)) return this.GetPreviousSourceNode(A.parentNode,true,C,D);};if (C&&E&&E.nodeType!=C) return this.GetPreviousSourceNode(E,false,C,D);return E;},InsertAfterNode:function(A,B){return A.parentNode.insertBefore(B,A.nextSibling);},GetParents:function(A){var B=[];while (A){B.unshift(A);A=A.parentNode;};return B;},GetCommonParents:function(A,B){var C=this.GetParents(A);var D=this.GetParents(B);var E=[];for (var i=0;i0) D[C.pop().toLowerCase()]=1;var E=this.GetCommonParents(A,B);var F=null;while ((F=E.pop())){if (D[F.nodeName.toLowerCase()]) return F;};return null;},GetIndexOf:function(A){var B=A.parentNode?A.parentNode.firstChild:null;var C=-1;while (B){C++;if (B==A) return C;B=B.nextSibling;};return-1;},PaddingNode:null,EnforcePaddingNode:function(A,B){try{if (!A||!A.body) return;}catch (e){return;};this.CheckAndRemovePaddingNode(A,B,true);try{if (A.body.lastChild&&(A.body.lastChild.nodeType!=1||A.body.lastChild.tagName.toLowerCase()==B.toLowerCase())) return;}catch (e){return;};var C=A.createElement(B);if (FCKBrowserInfo.IsGecko&&FCKListsLib.NonEmptyBlockElements[B]) FCKTools.AppendBogusBr(C);this.PaddingNode=C;if (A.body.childNodes.length==1&&A.body.firstChild.nodeType==1&&A.body.firstChild.tagName.toLowerCase()=='br'&&(A.body.firstChild.getAttribute('_moz_dirty')!=null||A.body.firstChild.getAttribute('type')=='_moz')) A.body.replaceChild(C,A.body.firstChild);else A.body.appendChild(C);},CheckAndRemovePaddingNode:function(A,B,C){var D=this.PaddingNode;if (!D) return;try{if (D.parentNode!=A.body||D.tagName.toLowerCase()!=B||(D.childNodes.length>1)||(D.firstChild&&D.firstChild.nodeValue!='\xa0'&&String(D.firstChild.tagName).toLowerCase()!='br')){this.PaddingNode=null;return;}}catch (e){this.PaddingNode=null;return;};if (!C){if (D.parentNode.childNodes.length>1) D.parentNode.removeChild(D);this.PaddingNode=null;}},HasAttribute:function(A,B){if (A.hasAttribute) return A.hasAttribute(B);else{var C=A.attributes[B];return (C!=undefined&&C.specified);}},HasAttributes:function(A){var B=A.attributes;for (var i=0;i0) return true;}else if (B[i].specified) return true;};return false;},RemoveAttribute:function(A,B){if (FCKBrowserInfo.IsIE&&B.toLowerCase()=='class') B='className';return A.removeAttribute(B,0);},RemoveAttributes:function (A,B){for (var i=0;i0) return false;C=C.nextSibling;};return D?this.CheckIsEmptyElement(D,B):true;},SetElementStyles:function(A,B){var C=A.style;for (var D in B) C[D]=B[D];},SetOpacity:function(A,B){if (FCKBrowserInfo.IsIE){B=Math.round(B*100);A.style.filter=(B>100?'':'progid:DXImageTransform.Microsoft.Alpha(opacity='+B+')');}else A.style.opacity=B;},GetCurrentElementStyle:function(A,B){if (FCKBrowserInfo.IsIE) return A.currentStyle[B];else return A.ownerDocument.defaultView.getComputedStyle(A,'').getPropertyValue(B);},GetPositionedAncestor:function(A){var B=A;while (B!=FCKTools.GetElementDocument(B).documentElement){if (this.GetCurrentElementStyle(B,'position')!='static') return B;if (B==FCKTools.GetElementDocument(B).documentElement&¤tWindow!=w) B=currentWindow.frameElement;else B=B.parentNode;};return null;},ScrollIntoView:function(A,B){var C=FCKTools.GetElementWindow(A);var D=FCKTools.GetViewPaneSize(C).Height;var E=D*-1;if (B===false){E+=A.offsetHeight;E+=parseInt(this.GetCurrentElementStyle(A,'marginBottom')||0,10);};E+=A.offsetTop;while ((A=A.offsetParent)) E+=A.offsetTop||0;var F=FCKTools.GetScrollPosition(C).Y;if (E>0&&E>F) C.scrollTo(0,E);},CheckIsEditable:function(A){var B=A.nodeName.toLowerCase();var C=FCK.DTD[B]||FCK.DTD.span;return (C['#']&&!FCKListsLib.NonEditableElements[B]);}}; +var FCKTools={};FCKTools.CreateBogusBR=function(A){var B=A.createElement('br');B.setAttribute('type','_moz');return B;};FCKTools.FixCssUrls=function(A,B){if (!A||A.length==0) return B;return B.replace(/url\s*\(([\s'"]*)(.*?)([\s"']*)\)/g,function(match,opener,path,closer){if (/^\/|^\w?:/.test(path)) return match;else return 'url('+opener+A+path+closer+')';});};FCKTools._GetUrlFixedCss=function(A,B){var C=A.match(/^([^|]+)\|([\s\S]*)/);if (C) return FCKTools.FixCssUrls(C[1],C[2]);else return A;};FCKTools.AppendStyleSheet=function(A,B){if (!B) return [];if (typeof(B)=='string'){if (/[\\\/\.][^{}]*$/.test(B)){return this.AppendStyleSheet(A,B.split(','));}else return [this.AppendStyleString(A,FCKTools._GetUrlFixedCss(B))];}else{var C=[];for (var i=0;i'+styleDef+'';};var C=function(cssFileUrl,markTemp){if (cssFileUrl.length==0) return '';var B=markTemp?' _fcktemp="true"':'';return '';};return function(cssFileOrArrayOrDef,markTemp){if (!cssFileOrArrayOrDef) return '';if (typeof(cssFileOrArrayOrDef)=='string'){if (/[\\\/\.][^{}]*$/.test(cssFileOrArrayOrDef)){return this.GetStyleHtml(cssFileOrArrayOrDef.split(','),markTemp);}else return A(this._GetUrlFixedCss(cssFileOrArrayOrDef),markTemp);}else{var E='';for (var i=0;i/g,'>');return A;};FCKTools.HTMLDecode=function(A){if (!A) return '';A=A.replace(/>/g,'>');A=A.replace(/</g,'<');A=A.replace(/&/g,'&');return A;};FCKTools._ProcessLineBreaksForPMode=function(A,B,C,D,E){var F=0;var G="

        ";var H="

        ";var I="
        ";if (C){G="
      5. ";H="
      6. ";F=1;}while (D&&D!=A.FCK.EditorDocument.body){if (D.tagName.toLowerCase()=='p'){F=1;break;};D=D.parentNode;};for (var i=0;i0) return A[A.length-1];return null;};FCKTools.GetDocumentPosition=function(w,A){var x=0;var y=0;var B=A;var C=null;var D=FCKTools.GetElementWindow(B);while (B&&!(D==w&&(B==w.document.body||B==w.document.documentElement))){x+=B.offsetLeft-B.scrollLeft;y+=B.offsetTop-B.scrollTop;if (!FCKBrowserInfo.IsOpera){var E=C;while (E&&E!=B){x-=E.scrollLeft;y-=E.scrollTop;E=E.parentNode;}};C=B;if (B.offsetParent) B=B.offsetParent;else{if (D!=w){B=D.frameElement;C=null;if (B) D=B.contentWindow.parent;}else B=null;}};if (FCKDomTools.GetCurrentElementStyle(w.document.body,'position')!='static'||(FCKBrowserInfo.IsIE&&FCKDomTools.GetPositionedAncestor(A)==null)){x+=w.document.body.offsetLeft;y+=w.document.body.offsetTop;};return { "x":x,"y":y };};FCKTools.GetWindowPosition=function(w,A){var B=this.GetDocumentPosition(w,A);var C=FCKTools.GetScrollPosition(w);B.x-=C.X;B.y-=C.Y;return B;};FCKTools.ProtectFormStyles=function(A){if (!A||A.nodeType!=1||A.tagName.toLowerCase()!='form') return [];var B=[];var C=['style','className'];for (var i=0;i0){for (var i=B.length-1;i>=0;i--){var C=B[i][0];var D=B[i][1];if (D) A.insertBefore(C,D);else A.appendChild(C);}}};FCKTools.GetNextNode=function(A,B){if (A.firstChild) return A.firstChild;else if (A.nextSibling) return A.nextSibling;else{var C=A.parentNode;while (C){if (C==B) return null;if (C.nextSibling) return C.nextSibling;else C=C.parentNode;}};return null;};FCKTools.GetNextTextNode=function(A,B,C){node=this.GetNextNode(A,B);if (C&&node&&C(node)) return null;while (node&&node.nodeType!=3){node=this.GetNextNode(node,B);if (C&&node&&C(node)) return null;};return node;};FCKTools.Merge=function(){var A=arguments;var o=A[0];for (var i=1;i');document.domain = '"+FCK_RUNTIME_DOMAIN+"';document.close();}() ) ;";if (FCKBrowserInfo.IsIE){if (FCKBrowserInfo.IsIE7||!FCKBrowserInfo.IsIE6) return "";else return "javascript: '';";};return "javascript: void(0);";};FCKTools.ResetStyles=function(A){A.style.cssText='margin:0;padding:0;border:0;background-color:transparent;background-image:none;';}; +FCKTools.CancelEvent=function(e){if (e) e.preventDefault();};FCKTools.DisableSelection=function(A){if (FCKBrowserInfo.IsGecko) A.style.MozUserSelect='none';else if (FCKBrowserInfo.IsSafari) A.style.KhtmlUserSelect='none';else A.style.userSelect='none';};FCKTools._AppendStyleSheet=function(A,B){var e=A.createElement('LINK');e.rel='stylesheet';e.type='text/css';e.href=B;A.getElementsByTagName("HEAD")[0].appendChild(e);return e;};FCKTools.AppendStyleString=function(A,B){if (!B) return null;var e=A.createElement("STYLE");e.appendChild(A.createTextNode(B));A.getElementsByTagName("HEAD")[0].appendChild(e);return e;};FCKTools.ClearElementAttributes=function(A){for (var i=0;i0) B[B.length]=D;C(parent.childNodes[i]);}};C(A);return B;};FCKTools.RemoveOuterTags=function(e){var A=e.ownerDocument.createDocumentFragment();for (var i=0;i','text/xml');FCKDomTools.RemoveNode(B.firstChild);return B;};return null;};FCKTools.GetScrollPosition=function(A){return { X:A.pageXOffset,Y:A.pageYOffset };};FCKTools.AddEventListener=function(A,B,C){A.addEventListener(B,C,false);};FCKTools.RemoveEventListener=function(A,B,C){A.removeEventListener(B,C,false);};FCKTools.AddEventListenerEx=function(A,B,C,D){A.addEventListener(B,function(e){C.apply(A,[e].concat(D||[]));},false);};FCKTools.GetViewPaneSize=function(A){return { Width:A.innerWidth,Height:A.innerHeight };};FCKTools.SaveStyles=function(A){var B=FCKTools.ProtectFormStyles(A);var C={};if (A.className.length>0){C.Class=A.className;A.className='';};var D=A.getAttribute('style');if (D&&D.length>0){C.Inline=D;A.setAttribute('style','',0);};FCKTools.RestoreFormStyles(A,B);return C;};FCKTools.RestoreStyles=function(A,B){var C=FCKTools.ProtectFormStyles(A);A.className=B.Class||'';if (B.Inline) A.setAttribute('style',B.Inline,0);else A.removeAttribute('style',0);FCKTools.RestoreFormStyles(A,C);};FCKTools.RegisterDollarFunction=function(A){A.$=function(id){return A.document.getElementById(id);};};FCKTools.AppendElement=function(A,B){return A.appendChild(A.ownerDocument.createElement(B));};FCKTools.GetElementPosition=function(A,B){var c={ X:0,Y:0 };var C=B||window;var D=FCKTools.GetElementWindow(A);var E=null;while (A){var F=D.getComputedStyle(A,'').position;if (F&&F!='static'&&A.style.zIndex!=FCKConfig.FloatingPanelsZIndex) break;c.X+=A.offsetLeft-A.scrollLeft;c.Y+=A.offsetTop-A.scrollTop;if (!FCKBrowserInfo.IsOpera){var G=E;while (G&&G!=A){c.X-=G.scrollLeft;c.Y-=G.scrollTop;G=G.parentNode;}};E=A;if (A.offsetParent) A=A.offsetParent;else{if (D!=C){A=D.frameElement;E=null;if (A) D=FCKTools.GetElementWindow(A);}else{c.X+=A.scrollLeft;c.Y+=A.scrollTop;break;}}};return c;}; +var FCKeditorAPI;function InitializeAPI(){var A=window.parent;if (!(FCKeditorAPI=A.FCKeditorAPI)){var B='window.FCKeditorAPI = {Version : "2.6.2",VersionBuild : "19417",Instances : new Object(),GetInstance : function( name ){return this.Instances[ name ];},_FormSubmit : function(){for ( var name in FCKeditorAPI.Instances ){var oEditor = FCKeditorAPI.Instances[ name ] ;if ( oEditor.GetParentForm && oEditor.GetParentForm() == this )oEditor.UpdateLinkedField() ;}this._FCKOriginalSubmit() ;},_FunctionQueue : {Functions : new Array(),IsRunning : false,Add : function( f ){this.Functions.push( f );if ( !this.IsRunning )this.StartNext();},StartNext : function(){var aQueue = this.Functions ;if ( aQueue.length > 0 ){this.IsRunning = true;aQueue[0].call();}else this.IsRunning = false;},Remove : function( f ){var aQueue = this.Functions;var i = 0, fFunc;while( (fFunc = aQueue[ i ]) ){if ( fFunc == f )aQueue.splice( i,1 );i++ ;}this.StartNext();}}}';if (A.execScript) A.execScript(B,'JavaScript');else{if (FCKBrowserInfo.IsGecko10){eval.call(A,B);}else if(FCKBrowserInfo.IsAIR){FCKAdobeAIR.FCKeditorAPI_Evaluate(A,B);}else if (FCKBrowserInfo.IsSafari||FCKBrowserInfo.IsGecko19){var C=A.document;var D=C.createElement('script');D.appendChild(C.createTextNode(B));C.documentElement.appendChild(D);}else A.eval(B);};FCKeditorAPI=A.FCKeditorAPI;FCKeditorAPI.__Instances=FCKeditorAPI.Instances;};FCKeditorAPI.Instances[FCK.Name]=FCK;};function _AttachFormSubmitToAPI(){var A=FCK.GetParentForm();if (A){FCKTools.AddEventListener(A,'submit',FCK.UpdateLinkedField);if (!A._FCKOriginalSubmit&&(typeof(A.submit)=='function'||(!A.submit.tagName&&!A.submit.length))){A._FCKOriginalSubmit=A.submit;A.submit=FCKeditorAPI._FormSubmit;}}};function FCKeditorAPI_Cleanup(){if (window.FCKConfig&&FCKConfig.MsWebBrowserControlCompat&&!window.FCKUnloadFlag) return;delete FCKeditorAPI.Instances[FCK.Name];};function FCKeditorAPI_ConfirmCleanup(){if (window.FCKConfig&&FCKConfig.MsWebBrowserControlCompat) window.FCKUnloadFlag=true;};FCKTools.AddEventListener(window,'unload',FCKeditorAPI_Cleanup);FCKTools.AddEventListener(window,'beforeunload',FCKeditorAPI_ConfirmCleanup); +var FCKImagePreloader=function(){this._Images=[];};FCKImagePreloader.prototype={AddImages:function(A){if (typeof(A)=='string') A=A.split(';');this._Images=this._Images.concat(A);},Start:function(){var A=this._Images;this._PreloadCount=A.length;for (var i=0;i]*\>)/i,AfterBody:/(\<\/body\>[\s\S]*$)/i,ToReplace:/___fcktoreplace:([\w]+)/ig,MetaHttpEquiv:/http-equiv\s*=\s*["']?([^"' ]+)/i,HasBaseTag:/]/i,HtmlOpener:/]*>/i,HeadOpener:/]*>/i,HeadCloser:/<\/head\s*>/i,FCK_Class:/\s*FCK__[^ ]*(?=\s+|$)/,ElementName:/(^[a-z_:][\w.\-:]*\w$)|(^[a-z_]$)/,ForceSimpleAmpersand:/___FCKAmp___/g,SpaceNoClose:/\/>/g,EmptyParagraph:/^<(p|div|address|h\d|center)(?=[ >])[^>]*>\s*(<\/\1>)?$/,EmptyOutParagraph:/^<(p|div|address|h\d|center)(?=[ >])[^>]*>(?:\s*| )(<\/\1>)?$/,TagBody:/>]+))/gi,ProtectUrlsA:/]+))/gi,ProtectUrlsArea:/]+))/gi,Html4DocType:/HTML 4\.0 Transitional/i,DocTypeTag:/]*>/i,HtmlDocType:/DTD HTML/,TagsWithEvent:/<[^\>]+ on\w+[\s\r\n]*=[\s\r\n]*?('|")[\s\S]+?\>/g,EventAttributes:/\s(on\w+)[\s\r\n]*=[\s\r\n]*?('|")([\s\S]*?)\2/g,ProtectedEvents:/\s\w+_fckprotectedatt="([^"]+)"/g,StyleProperties:/\S+\s*:/g,InvalidSelfCloseTags:/(<(?!base|meta|link|hr|br|param|img|area|input)([a-zA-Z0-9:]+)[^>]*)\/>/gi,StyleVariableAttName:/#\(\s*("|')(.+?)\1[^\)]*\s*\)/g,RegExp:/^\/(.*)\/([gim]*)$/,HtmlTag:/<[^\s<>](?:"[^"]*"|'[^']*'|[^<])*>/}; +var FCKListsLib={BlockElements:{ address:1,blockquote:1,center:1,div:1,dl:1,fieldset:1,form:1,h1:1,h2:1,h3:1,h4:1,h5:1,h6:1,hr:1,marquee:1,noscript:1,ol:1,p:1,pre:1,script:1,table:1,ul:1 },NonEmptyBlockElements:{ p:1,div:1,form:1,h1:1,h2:1,h3:1,h4:1,h5:1,h6:1,address:1,pre:1,ol:1,ul:1,li:1,td:1,th:1 },InlineChildReqElements:{ abbr:1,acronym:1,b:1,bdo:1,big:1,cite:1,code:1,del:1,dfn:1,em:1,font:1,i:1,ins:1,label:1,kbd:1,q:1,samp:1,small:1,span:1,strike:1,strong:1,sub:1,sup:1,tt:1,u:1,'var':1 },InlineNonEmptyElements:{ a:1,abbr:1,acronym:1,b:1,bdo:1,big:1,cite:1,code:1,del:1,dfn:1,em:1,font:1,i:1,ins:1,label:1,kbd:1,q:1,samp:1,small:1,span:1,strike:1,strong:1,sub:1,sup:1,tt:1,u:1,'var':1 },EmptyElements:{ base:1,col:1,meta:1,link:1,hr:1,br:1,param:1,img:1,area:1,input:1 },PathBlockElements:{ address:1,blockquote:1,dl:1,h1:1,h2:1,h3:1,h4:1,h5:1,h6:1,p:1,pre:1,li:1,dt:1,de:1 },PathBlockLimitElements:{ body:1,div:1,td:1,th:1,caption:1,form:1 },StyleBlockElements:{ address:1,div:1,h1:1,h2:1,h3:1,h4:1,h5:1,h6:1,p:1,pre:1 },StyleObjectElements:{ img:1,hr:1,li:1,table:1,tr:1,td:1,embed:1,object:1,ol:1,ul:1 },NonEditableElements:{ button:1,option:1,script:1,iframe:1,textarea:1,object:1,embed:1,map:1,applet:1 },BlockBoundaries:{ p:1,div:1,h1:1,h2:1,h3:1,h4:1,h5:1,h6:1,hr:1,address:1,pre:1,ol:1,ul:1,li:1,dt:1,de:1,table:1,thead:1,tbody:1,tfoot:1,tr:1,th:1,td:1,caption:1,col:1,colgroup:1,blockquote:1,body:1 },ListBoundaries:{ p:1,div:1,h1:1,h2:1,h3:1,h4:1,h5:1,h6:1,hr:1,address:1,pre:1,ol:1,ul:1,li:1,dt:1,de:1,table:1,thead:1,tbody:1,tfoot:1,tr:1,th:1,td:1,caption:1,col:1,colgroup:1,blockquote:1,body:1,br:1 }}; +var FCKLanguageManager=FCK.Language={AvailableLanguages:{af:'Afrikaans',ar:'Arabic',bg:'Bulgarian',bn:'Bengali/Bangla',bs:'Bosnian',ca:'Catalan',cs:'Czech',da:'Danish',de:'German',el:'Greek',en:'English','en-au':'English (Australia)','en-ca':'English (Canadian)','en-uk':'English (United Kingdom)',eo:'Esperanto',es:'Spanish',et:'Estonian',eu:'Basque',fa:'Persian',fi:'Finnish',fo:'Faroese',fr:'French','fr-ca':'French (Canada)',gl:'Galician',gu:'Gujarati',he:'Hebrew',hi:'Hindi',hr:'Croatian',hu:'Hungarian',it:'Italian',ja:'Japanese',km:'Khmer',ko:'Korean',lt:'Lithuanian',lv:'Latvian',mn:'Mongolian',ms:'Malay',nb:'Norwegian Bokmal',nl:'Dutch',no:'Norwegian',pl:'Polish',pt:'Portuguese (Portugal)','pt-br':'Portuguese (Brazil)',ro:'Romanian',ru:'Russian',sk:'Slovak',sl:'Slovenian',sr:'Serbian (Cyrillic)','sr-latn':'Serbian (Latin)',sv:'Swedish',th:'Thai',tr:'Turkish',uk:'Ukrainian',vi:'Vietnamese',zh:'Chinese Traditional','zh-cn':'Chinese Simplified'},GetActiveLanguage:function(){if (FCKConfig.AutoDetectLanguage){var A;if (navigator.userLanguage) A=navigator.userLanguage.toLowerCase();else if (navigator.language) A=navigator.language.toLowerCase();else{return FCKConfig.DefaultLanguage;};if (A.length>=5){A=A.substr(0,5);if (this.AvailableLanguages[A]) return A;};if (A.length>=2){A=A.substr(0,2);if (this.AvailableLanguages[A]) return A;}};return this.DefaultLanguage;},TranslateElements:function(A,B,C,D){var e=A.getElementsByTagName(B);var E,s;for (var i=0;i0) C+='|'+FCKConfig.AdditionalNumericEntities;FCKXHtmlEntities.EntitiesRegex=new RegExp(C,'g');}; +var FCKXHtml={};FCKXHtml.CurrentJobNum=0;FCKXHtml.GetXHTML=function(A,B,C){FCKDomTools.CheckAndRemovePaddingNode(FCKTools.GetElementDocument(A),FCKConfig.EnterMode);FCKXHtmlEntities.Initialize();this._NbspEntity=(FCKConfig.ProcessHTMLEntities?'nbsp':'#160');var D=FCK.IsDirty();FCKXHtml.SpecialBlocks=[];this.XML=FCKTools.CreateXmlObject('DOMDocument');this.MainNode=this.XML.appendChild(this.XML.createElement('xhtml'));FCKXHtml.CurrentJobNum++;if (B) this._AppendNode(this.MainNode,A);else this._AppendChildNodes(this.MainNode,A,false);var E=this._GetMainXmlString();this.XML=null;if (FCKBrowserInfo.IsSafari) E=E.replace(/^/,'');E=E.substr(7,E.length-15).Trim();if (FCKConfig.DocType.length>0&&FCKRegexLib.HtmlDocType.test(FCKConfig.DocType)) E=E.replace(FCKRegexLib.SpaceNoClose,'>');else E=E.replace(FCKRegexLib.SpaceNoClose,' />');if (FCKConfig.ForceSimpleAmpersand) E=E.replace(FCKRegexLib.ForceSimpleAmpersand,'&');if (C) E=FCKCodeFormatter.Format(E);for (var i=0;i0;if (C) A.appendChild(this.XML.createTextNode(B.replace(FCKXHtmlEntities.EntitiesRegex,FCKXHtml_GetEntity)));return C;};function FCKXHtml_GetEntity(A){var B=FCKXHtmlEntities.Entities[A]||('#'+A.charCodeAt(0));return '#?-:'+B+';';};FCKXHtml.TagProcessors={a:function(A,B){if (B.innerHTML.Trim().length==0&&!B.name) return false;var C=B.getAttribute('_fcksavedurl');if (C!=null) FCKXHtml._AppendAttribute(A,'href',C);if (FCKBrowserInfo.IsIE){if (B.name) FCKXHtml._AppendAttribute(A,'name',B.name);};A=FCKXHtml._AppendChildNodes(A,B,false);return A;},area:function(A,B){var C=B.getAttribute('_fcksavedurl');if (C!=null) FCKXHtml._AppendAttribute(A,'href',C);if (FCKBrowserInfo.IsIE){if (!A.attributes.getNamedItem('coords')){var D=B.getAttribute('coords',2);if (D&&D!='0,0,0') FCKXHtml._AppendAttribute(A,'coords',D);};if (!A.attributes.getNamedItem('shape')){var E=B.getAttribute('shape',2);if (E&&E.length>0) FCKXHtml._AppendAttribute(A,'shape',E.toLowerCase());}};return A;},body:function(A,B){A=FCKXHtml._AppendChildNodes(A,B,false);A.removeAttribute('spellcheck');return A;},iframe:function(A,B){var C=B.innerHTML;if (FCKBrowserInfo.IsGecko) C=FCKTools.HTMLDecode(C);C=C.replace(/\s_fcksavedurl="[^"]*"/g,'');A.appendChild(FCKXHtml.XML.createTextNode(FCKXHtml._AppendSpecialItem(C)));return A;},img:function(A,B){if (!A.attributes.getNamedItem('alt')) FCKXHtml._AppendAttribute(A,'alt','');var C=B.getAttribute('_fcksavedurl');if (C!=null) FCKXHtml._AppendAttribute(A,'src',C);if (B.style.width) A.removeAttribute('width');if (B.style.height) A.removeAttribute('height');return A;},li:function(A,B,C){if (C.nodeName.IEquals(['ul','ol'])) return FCKXHtml._AppendChildNodes(A,B,true);var D=FCKXHtml.XML.createElement('ul');B._fckxhtmljob=null;do{FCKXHtml._AppendNode(D,B);do{B=FCKDomTools.GetNextSibling(B);} while (B&&B.nodeType==3&&B.nodeValue.Trim().length==0)} while (B&&B.nodeName.toLowerCase()=='li') return D;},ol:function(A,B,C){if (B.innerHTML.Trim().length==0) return false;var D=C.lastChild;if (D&&D.nodeType==3) D=D.previousSibling;if (D&&D.nodeName.toUpperCase()=='LI'){B._fckxhtmljob=null;FCKXHtml._AppendNode(D,B);return false;};A=FCKXHtml._AppendChildNodes(A,B);return A;},pre:function (A,B){var C=B.firstChild;if (C&&C.nodeType==3) A.appendChild(FCKXHtml.XML.createTextNode(FCKXHtml._AppendSpecialItem('\r\n')));FCKXHtml._AppendChildNodes(A,B,true);return A;},script:function(A,B){if (!A.attributes.getNamedItem('type')) FCKXHtml._AppendAttribute(A,'type','text/javascript');A.appendChild(FCKXHtml.XML.createTextNode(FCKXHtml._AppendSpecialItem(B.text)));return A;},span:function(A,B){if (B.innerHTML.length==0) return false;A=FCKXHtml._AppendChildNodes(A,B,false);return A;},style:function(A,B){if (!A.attributes.getNamedItem('type')) FCKXHtml._AppendAttribute(A,'type','text/css');var C=B.innerHTML;if (FCKBrowserInfo.IsIE) C=C.replace(/^(\r\n|\n|\r)/,'');A.appendChild(FCKXHtml.XML.createTextNode(FCKXHtml._AppendSpecialItem(C)));return A;},title:function(A,B){A.appendChild(FCKXHtml.XML.createTextNode(FCK.EditorDocument.title));return A;}};FCKXHtml.TagProcessors.ul=FCKXHtml.TagProcessors.ol; +FCKXHtml._GetMainXmlString=function(){return (new XMLSerializer()).serializeToString(this.MainNode);};FCKXHtml._AppendAttributes=function(A,B,C){var D=B.attributes;for (var n=0;n]*\>/gi;A.BlocksCloser=/\<\/(P|DIV|H1|H2|H3|H4|H5|H6|ADDRESS|PRE|OL|UL|LI|TITLE|META|LINK|BASE|SCRIPT|LINK|TD|TH|AREA|OPTION)[^\>]*\>/gi;A.NewLineTags=/\<(BR|HR)[^\>]*\>/gi;A.MainTags=/\<\/?(HTML|HEAD|BODY|FORM|TABLE|TBODY|THEAD|TR)[^\>]*\>/gi;A.LineSplitter=/\s*\n+\s*/g;A.IncreaseIndent=/^\<(HTML|HEAD|BODY|FORM|TABLE|TBODY|THEAD|TR|UL|OL)[ \/\>]/i;A.DecreaseIndent=/^\<\/(HTML|HEAD|BODY|FORM|TABLE|TBODY|THEAD|TR|UL|OL)[ \>]/i;A.FormatIndentatorRemove=new RegExp('^'+FCKConfig.FormatIndentator);A.ProtectedTags=/(]*>)([\s\S]*?)(<\/PRE>)/gi;};FCKCodeFormatter._ProtectData=function(A,B,C,D){return B+'___FCKpd___'+FCKCodeFormatter.ProtectedData.AddItem(C)+D;};FCKCodeFormatter.Format=function(A){if (!this.Regex) this.Init();FCKCodeFormatter.ProtectedData=[];var B=A.replace(this.Regex.ProtectedTags,FCKCodeFormatter._ProtectData);B=B.replace(this.Regex.BlocksOpener,'\n$&');B=B.replace(this.Regex.BlocksCloser,'$&\n');B=B.replace(this.Regex.NewLineTags,'$&\n');B=B.replace(this.Regex.MainTags,'\n$&\n');var C='';var D=B.split(this.Regex.LineSplitter);B='';for (var i=0;iB[i]) return 1;};if (A.lengthB.length) return 1;return 0;};FCKUndo._CheckIsBookmarksEqual=function(A,B){if (!(A&&B)) return false;if (FCKBrowserInfo.IsIE){var C=A[1].search(A[0].StartId);var D=B[1].search(B[0].StartId);var E=A[1].search(A[0].EndId);var F=B[1].search(B[0].EndId);return C==D&&E==F;}else{return this._CompareCursors(A.Start,B.Start)==0&&this._CompareCursors(A.End,B.End)==0;}};FCKUndo.SaveUndoStep=function(){if (FCK.EditMode!=0||this.SaveLocked) return;if (this.SavedData.length) this.Changed=true;var A=FCK.EditorDocument.body.innerHTML;var B=this._GetBookmark();this.SavedData=this.SavedData.slice(0,this.CurrentIndex+1);if (this.CurrentIndex>0&&A==this.SavedData[this.CurrentIndex][0]&&this._CheckIsBookmarksEqual(B,this.SavedData[this.CurrentIndex][1])) return;else if (this.CurrentIndex==0&&this.SavedData.length&&A==this.SavedData[0][0]){this.SavedData[0][1]=B;return;};if (this.CurrentIndex+1>=FCKConfig.MaxUndoLevels) this.SavedData.shift();else this.CurrentIndex++;this.SavedData[this.CurrentIndex]=[A,B];FCK.Events.FireEvent("OnSelectionChange");};FCKUndo.CheckUndoState=function(){return (this.Changed||this.CurrentIndex>0);};FCKUndo.CheckRedoState=function(){return (this.CurrentIndex<(this.SavedData.length-1));};FCKUndo.Undo=function(){if (this.CheckUndoState()){if (this.CurrentIndex==(this.SavedData.length-1)){this.SaveUndoStep();};this._ApplyUndoLevel(--this.CurrentIndex);FCK.Events.FireEvent("OnSelectionChange");}};FCKUndo.Redo=function(){if (this.CheckRedoState()){this._ApplyUndoLevel(++this.CurrentIndex);FCK.Events.FireEvent("OnSelectionChange");}};FCKUndo._ApplyUndoLevel=function(A){var B=this.SavedData[A];if (!B) return;if (FCKBrowserInfo.IsIE){if (B[1]&&B[1][1]) FCK.SetInnerHtml(B[1][1]);else FCK.SetInnerHtml(B[0]);}else FCK.EditorDocument.body.innerHTML=B[0];this._SelectBookmark(B[1]);this.TypesCount=0;this.Changed=false;this.Typing=false;}; +var FCKEditingArea=function(A){this.TargetElement=A;this.Mode=0;if (FCK.IECleanup) FCK.IECleanup.AddItem(this,FCKEditingArea_Cleanup);};FCKEditingArea.prototype.Start=function(A,B){var C=this.TargetElement;var D=FCKTools.GetElementDocument(C);while(C.firstChild) C.removeChild(C.firstChild);if (this.Mode==0){if (FCK_IS_CUSTOM_DOMAIN) A=''+A;if (FCKBrowserInfo.IsIE) A=A.replace(/(]*?)\s*\/?>(?!\s*<\/base>)/gi,'$1>');else if (!B){var E=A.match(FCKRegexLib.BeforeBody);var F=A.match(FCKRegexLib.AfterBody);if (E&&F){var G=A.substr(E[1].length,A.length-E[1].length-F[1].length);A=E[1]+' '+F[1];if (FCKBrowserInfo.IsGecko&&(G.length==0||FCKRegexLib.EmptyParagraph.test(G))) G='
        ';this._BodyHTML=G;}else this._BodyHTML=A;};var H=this.IFrame=D.createElement('iframe');var I='';H.frameBorder=0;H.style.width=H.style.height='100%';if (FCK_IS_CUSTOM_DOMAIN&&FCKBrowserInfo.IsIE){window._FCKHtmlToLoad=A.replace(//i,''+I);H.src='javascript:void( (function(){document.open() ;document.domain="'+document.domain+'" ;document.write( window.parent._FCKHtmlToLoad );document.close() ;window.parent._FCKHtmlToLoad = null ;})() )';}else if (!FCKBrowserInfo.IsGecko){H.src='javascript:void(0)';};C.appendChild(H);this.Window=H.contentWindow;if (!FCK_IS_CUSTOM_DOMAIN||!FCKBrowserInfo.IsIE){var J=this.Window.document;J.open();J.write(A.replace(//i,''+I));J.close();};if (FCKBrowserInfo.IsAIR) FCKAdobeAIR.EditingArea_Start(J,A);if (FCKBrowserInfo.IsGecko10&&!B){this.Start(A,true);return;};if (H.readyState&&H.readyState!='completed'){var K=this;(H.onreadystatechange=function(){if (H.readyState=='complete'){H.onreadystatechange=null;K.Window._FCKEditingArea=K;FCKEditingArea_CompleteStart.call(K.Window);}})();}else{this.Window._FCKEditingArea=this;if (FCKBrowserInfo.IsGecko10) this.Window.setTimeout(FCKEditingArea_CompleteStart,500);else FCKEditingArea_CompleteStart.call(this.Window);}}else{var L=this.Textarea=D.createElement('textarea');L.className='SourceField';L.dir='ltr';FCKDomTools.SetElementStyles(L,{width:'100%',height:'100%',border:'none',resize:'none',outline:'none'});C.appendChild(L);L.value=A;FCKTools.RunFunction(this.OnLoad);}};function FCKEditingArea_CompleteStart(){if (!this.document.body){this.setTimeout(FCKEditingArea_CompleteStart,50);return;};var A=this._FCKEditingArea;A.Document=A.Window.document;A.MakeEditable();FCKTools.RunFunction(A.OnLoad);};FCKEditingArea.prototype.MakeEditable=function(){var A=this.Document;if (FCKBrowserInfo.IsIE){A.body.disabled=true;A.body.contentEditable=true;A.body.removeAttribute("disabled");}else{try{A.body.spellcheck=(this.FFSpellChecker!==false);if (this._BodyHTML){A.body.innerHTML=this._BodyHTML;A.body.offsetLeft;this._BodyHTML=null;};A.designMode='on';A.execCommand('enableObjectResizing',false,!FCKConfig.DisableObjectResizing);A.execCommand('enableInlineTableEditing',false,!FCKConfig.DisableFFTableHandles);}catch (e){FCKTools.AddEventListener(this.Window.frameElement,'DOMAttrModified',FCKEditingArea_Document_AttributeNodeModified);}}};function FCKEditingArea_Document_AttributeNodeModified(A){var B=A.currentTarget.contentWindow._FCKEditingArea;if (B._timer) window.clearTimeout(B._timer);B._timer=FCKTools.SetTimeout(FCKEditingArea_MakeEditableByMutation,1000,B);};function FCKEditingArea_MakeEditableByMutation(){delete this._timer;FCKTools.RemoveEventListener(this.Window.frameElement,'DOMAttrModified',FCKEditingArea_Document_AttributeNodeModified);this.MakeEditable();};FCKEditingArea.prototype.Focus=function(){try{if (this.Mode==0){if (FCKBrowserInfo.IsIE) this._FocusIE();else this.Window.focus();}else{var A=FCKTools.GetElementDocument(this.Textarea);if ((!A.hasFocus||A.hasFocus())&&A.activeElement==this.Textarea) return;this.Textarea.focus();}}catch(e) {}};FCKEditingArea.prototype._FocusIE=function(){this.Document.body.setActive();this.Window.focus();var A=this.Document.selection.createRange();var B=A.parentElement();var C=B.nodeName.toLowerCase();if (B.childNodes.length>0||!(FCKListsLib.BlockElements[C]||FCKListsLib.NonEmptyBlockElements[C])){return;};A=new FCKDomRange(this.Window);A.MoveToElementEditStart(B);A.Select();};function FCKEditingArea_Cleanup(){if (this.Document) this.Document.body.innerHTML="";this.TargetElement=null;this.IFrame=null;this.Document=null;this.Textarea=null;if (this.Window){this.Window._FCKEditingArea=null;this.Window=null;}}; +var FCKKeystrokeHandler=function(A){this.Keystrokes={};this.CancelCtrlDefaults=(A!==false);};FCKKeystrokeHandler.prototype.AttachToElement=function(A){FCKTools.AddEventListenerEx(A,'keydown',_FCKKeystrokeHandler_OnKeyDown,this);if (FCKBrowserInfo.IsGecko10||FCKBrowserInfo.IsOpera||(FCKBrowserInfo.IsGecko&&FCKBrowserInfo.IsMac)) FCKTools.AddEventListenerEx(A,'keypress',_FCKKeystrokeHandler_OnKeyPress,this);};FCKKeystrokeHandler.prototype.SetKeystrokes=function(){for (var i=0;i40))){B._CancelIt=true;if (A.preventDefault) return A.preventDefault();A.returnValue=false;A.cancelBubble=true;return false;};return true;};function _FCKKeystrokeHandler_OnKeyPress(A,B){if (B._CancelIt){if (A.preventDefault) return A.preventDefault();return false;};return true;}; +FCK.DTD=(function(){var X=FCKTools.Merge;var A,L,J,M,N,O,D,H,P,K,Q,F,G,C,B,E,I;A={isindex:1,fieldset:1};B={input:1,button:1,select:1,textarea:1,label:1};C=X({a:1},B);D=X({iframe:1},C);E={hr:1,ul:1,menu:1,div:1,blockquote:1,noscript:1,table:1,center:1,address:1,dir:1,pre:1,h5:1,dl:1,h4:1,noframes:1,h6:1,ol:1,h1:1,h3:1,h2:1};F={ins:1,del:1,script:1};G=X({b:1,acronym:1,bdo:1,'var':1,'#':1,abbr:1,code:1,br:1,i:1,cite:1,kbd:1,u:1,strike:1,s:1,tt:1,strong:1,q:1,samp:1,em:1,dfn:1,span:1},F);H=X({sub:1,img:1,object:1,sup:1,basefont:1,map:1,applet:1,font:1,big:1,small:1},G);I=X({p:1},H);J=X({iframe:1},H,B);K={img:1,noscript:1,br:1,kbd:1,center:1,button:1,basefont:1,h5:1,h4:1,samp:1,h6:1,ol:1,h1:1,h3:1,h2:1,form:1,font:1,'#':1,select:1,menu:1,ins:1,abbr:1,label:1,code:1,table:1,script:1,cite:1,input:1,iframe:1,strong:1,textarea:1,noframes:1,big:1,small:1,span:1,hr:1,sub:1,bdo:1,'var':1,div:1,object:1,sup:1,strike:1,dir:1,map:1,dl:1,applet:1,del:1,isindex:1,fieldset:1,ul:1,b:1,acronym:1,a:1,blockquote:1,i:1,u:1,s:1,tt:1,address:1,q:1,pre:1,p:1,em:1,dfn:1};L=X({a:1},J);M={tr:1};N={'#':1};O=X({param:1},K);P=X({form:1},A,D,E,I);Q={li:1};return {col:{},tr:{td:1,th:1},img:{},colgroup:{col:1},noscript:P,td:P,br:{},th:P,center:P,kbd:L,button:X(I,E),basefont:{},h5:L,h4:L,samp:L,h6:L,ol:Q,h1:L,h3:L,option:N,h2:L,form:X(A,D,E,I),select:{optgroup:1,option:1},font:J,ins:P,menu:Q,abbr:L,label:L,table:{thead:1,col:1,tbody:1,tr:1,colgroup:1,caption:1,tfoot:1},code:L,script:N,tfoot:M,cite:L,li:P,input:{},iframe:P,strong:J,textarea:N,noframes:P,big:J,small:J,span:J,hr:{},dt:L,sub:J,optgroup:{option:1},param:{},bdo:L,'var':J,div:P,object:O,sup:J,dd:P,strike:J,area:{},dir:Q,map:X({area:1,form:1,p:1},A,F,E),applet:O,dl:{dt:1,dd:1},del:P,isindex:{},fieldset:X({legend:1},K),thead:M,ul:Q,acronym:L,b:J,a:J,blockquote:P,caption:L,i:J,u:J,tbody:M,s:L,address:X(D,I),tt:J,legend:L,q:L,pre:X(G,C),p:L,em:J,dfn:L};})(); +var FCKStyle=function(A){this.Element=(A.Element||'span').toLowerCase();this._StyleDesc=A;};FCKStyle.prototype={GetType:function(){var A=this.GetType_$;if (A!=undefined) return A;var B=this.Element;if (B=='#'||FCKListsLib.StyleBlockElements[B]) A=0;else if (FCKListsLib.StyleObjectElements[B]) A=2;else A=1;return (this.GetType_$=A);},ApplyToSelection:function(A){var B=new FCKDomRange(A);B.MoveToSelection();this.ApplyToRange(B,true);},ApplyToRange:function(A,B,C){switch (this.GetType()){case 0:this.ApplyToRange=this._ApplyBlockStyle;break;case 1:this.ApplyToRange=this._ApplyInlineStyle;break;default:return;};this.ApplyToRange(A,B,C);},ApplyToObject:function(A){if (!A) return;this.BuildElement(null,A);},RemoveFromSelection:function(A){var B=new FCKDomRange(A);B.MoveToSelection();this.RemoveFromRange(B,true);},RemoveFromRange:function(A,B,C){var D;var E=this._GetAttribsForComparison();var F=this._GetOverridesForComparison();if (A.CheckIsCollapsed()){var D=A.CreateBookmark(true);var H=A.GetBookmarkNode(D,true);var I=new FCKElementPath(H.parentNode);var J=[];var K=!FCKDomTools.GetNextSibling(H);var L=K||!FCKDomTools.GetPreviousSibling(H);var M;var N=-1;for (var i=0;i=0;i--){var E=D[i];for (var F in B){if (FCKDomTools.HasAttribute(E,F)){switch (F){case 'style':this._RemoveStylesFromElement(E);break;case 'class':if (FCKDomTools.GetAttributeValue(E,F)!=this.GetFinalAttributeValue(F)) continue;default:FCKDomTools.RemoveAttribute(E,F);}}};this._RemoveOverrides(E,C[this.Element]);this._RemoveNoAttribElement(E);};for (var G in C){if (G!=this.Element){D=A.getElementsByTagName(G);for (var i=D.length-1;i>=0;i--){var E=D[i];this._RemoveOverrides(E,C[G]);this._RemoveNoAttribElement(E);}}}},_RemoveStylesFromElement:function(A){var B=A.style.cssText;var C=this.GetFinalStyleValue();if (B.length>0&&C.length==0) return;C='(^|;)\\s*('+C.replace(/\s*([^ ]+):.*?(;|$)/g,'$1|').replace(/\|$/,'')+'):[^;]+';var D=new RegExp(C,'gi');B=B.replace(D,'').Trim();if (B.length==0||B==';') FCKDomTools.RemoveAttribute(A,'style');else A.style.cssText=B.replace(D,'');},_RemoveOverrides:function(A,B){var C=B&&B.Attributes;if (C){for (var i=0;i0) C.style.cssText=this.GetFinalStyleValue();return C;},_CompareAttributeValues:function(A,B,C){if (A=='style'&&B&&C){B=B.replace(/;$/,'').toLowerCase();C=C.replace(/;$/,'').toLowerCase();};return (B==C||((B===null||B==='')&&(C===null||C==='')))},GetFinalAttributeValue:function(A){var B=this._StyleDesc.Attributes;var B=B?B[A]:null;if (!B&&A=='style') return this.GetFinalStyleValue();if (B&&this._Variables) B=B.Replace(FCKRegexLib.StyleVariableAttName,this._GetVariableReplace,this);return B;},GetFinalStyleValue:function(){var A=this._GetStyleText();if (A.length>0&&this._Variables){A=A.Replace(FCKRegexLib.StyleVariableAttName,this._GetVariableReplace,this);A=FCKTools.NormalizeCssText(A);};return A;},_GetVariableReplace:function(){return this._Variables[arguments[2]]||arguments[0];},SetVariable:function(A,B){var C=this._Variables;if (!C) C=this._Variables={};this._Variables[A]=B;},_FromPre:function(A,B,C){var D=B.innerHTML;D=D.replace(/(\r\n|\r)/g,'\n');D=D.replace(/^[ \t]*\n/,'');D=D.replace(/\n$/,'');D=D.replace(/^[ \t]+|[ \t]+$/g,function(match,offset,s){if (match.length==1) return ' ';else if (offset==0) return new Array(match.length).join(' ')+' ';else return ' '+new Array(match.length).join(' ');});var E=new FCKHtmlIterator(D);var F=[];E.Each(function(isTag,value){if (!isTag){value=value.replace(/\n/g,'
        ');value=value.replace(/[ \t]{2,}/g,function (match){return new Array(match.length).join(' ')+' ';});};F.push(value);});C.innerHTML=F.join('');return C;},_ToPre:function(A,B,C){var D=B.innerHTML.Trim();D=D.replace(/[ \t\r\n]*(]*>)[ \t\r\n]*/gi,'
        ');var E=new FCKHtmlIterator(D);var F=[];E.Each(function(isTag,value){if (!isTag) value=value.replace(/([ \t\n\r]+| )/g,' ');else if (isTag&&value=='
        ') value='\n';F.push(value);});if (FCKBrowserInfo.IsIE){var G=A.createElement('div');G.appendChild(C);C.outerHTML='
        \n'+F.join('')+'
        ';C=G.removeChild(G.firstChild);}else C.innerHTML=F.join('');return C;},_ApplyBlockStyle:function(A,B,C){var D;if (B) D=A.CreateBookmark();var E=new FCKDomRangeIterator(A);E.EnforceRealBlocks=true;var F;var G=A.Window.document;var H=[];var I=[];while((F=E.GetNextParagraph())){var J=this.BuildElement(G);var K=J.nodeName.IEquals('pre');var L=F.nodeName.IEquals('pre');if (K&&!L){J=this._ToPre(G,F,J);H.push(J);}else if (!K&&L){J=this._FromPre(G,F,J);I.push(J);}else FCKDomTools.MoveChildren(F,J);F.parentNode.insertBefore(J,F);FCKDomTools.RemoveNode(F);};for (var i=0;i0){A.InsertNode(I);this.RemoveFromElement(I);this._MergeSiblings(I,this._GetAttribsForComparison());if (!FCKBrowserInfo.IsIE) I.normalize();};A.Release(true);}};this._FixBookmarkStart(K);if (B) A.SelectBookmark(J);if (C) A.MoveToBookmark(J);},_FixBookmarkStart:function(A){var B;while ((B=A.nextSibling)){if (B.nodeType==1&&FCKListsLib.InlineNonEmptyElements[B.nodeName.toLowerCase()]){if (!B.firstChild) FCKDomTools.RemoveNode(B);else FCKDomTools.MoveNode(A,B,true);continue;};if (B.nodeType==3&&B.length==0){FCKDomTools.RemoveNode(B);continue;};break;}},_MergeSiblings:function(A,B){if (!A||A.nodeType!=1||!FCKListsLib.InlineNonEmptyElements[A.nodeName.toLowerCase()]) return;this._MergeNextSibling(A,B);this._MergePreviousSibling(A,B);},_MergeNextSibling:function(A,B){var C=A.nextSibling;var D=(C&&C.nodeType==1&&C.getAttribute('_fck_bookmark'));if (D) C=C.nextSibling;if (C&&C.nodeType==1&&C.nodeName==A.nodeName){if (!B) B=this._CreateElementAttribsForComparison(A);if (this._CheckAttributesMatch(C,B)){var E=A.lastChild;if (D) FCKDomTools.MoveNode(A.nextSibling,A);FCKDomTools.MoveChildren(C,A);FCKDomTools.RemoveNode(C);if (E) this._MergeNextSibling(E);}}},_MergePreviousSibling:function(A,B){var C=A.previousSibling;var D=(C&&C.nodeType==1&&C.getAttribute('_fck_bookmark'));if (D) C=C.previousSibling;if (C&&C.nodeType==1&&C.nodeName==A.nodeName){if (!B) B=this._CreateElementAttribsForComparison(A);if (this._CheckAttributesMatch(C,B)){var E=A.firstChild;if (D) FCKDomTools.MoveNode(A.previousSibling,A,true);FCKDomTools.MoveChildren(C,A,true);FCKDomTools.RemoveNode(C);if (E) this._MergePreviousSibling(E);}}},_GetStyleText:function(){var A=this._StyleDesc.Styles;var B=(this._StyleDesc.Attributes?this._StyleDesc.Attributes['style']||'':'');if (B.length>0) B+=';';for (var C in A) B+=C+':'+A[C]+';';if (B.length>0&&!(/#\(/.test(B))){B=FCKTools.NormalizeCssText(B);};return (this._GetStyleText=function() { return B;})();},_GetAttribsForComparison:function(){var A=this._GetAttribsForComparison_$;if (A) return A;A={};var B=this._StyleDesc.Attributes;if (B){for (var C in B){A[C.toLowerCase()]=B[C].toLowerCase();}};if (this._GetStyleText().length>0){A['style']=this._GetStyleText().toLowerCase();};FCKTools.AppendLengthProperty(A,'_length');return (this._GetAttribsForComparison_$=A);},_GetOverridesForComparison:function(){var A=this._GetOverridesForComparison_$;if (A) return A;A={};var B=this._StyleDesc.Overrides;if (B){if (!FCKTools.IsArray(B)) B=[B];for (var i=0;i0) return true;};B=B.nextSibling;};return false;}}; +var FCKElementPath=function(A){var B=null;var C=null;var D=[];var e=A;while (e){if (e.nodeType==1){if (!this.LastElement) this.LastElement=e;var E=e.nodeName.toLowerCase();if (FCKBrowserInfo.IsIE&&e.scopeName!='HTML') E=e.scopeName.toLowerCase()+':'+E;if (!C){if (!B&&FCKListsLib.PathBlockElements[E]!=null) B=e;if (FCKListsLib.PathBlockLimitElements[E]!=null){if (!B&&E=='div'&&!FCKElementPath._CheckHasBlock(e)) B=e;else C=e;}};D.push(e);if (E=='body') break;};e=e.parentNode;};this.Block=B;this.BlockLimit=C;this.Elements=D;};FCKElementPath._CheckHasBlock=function(A){var B=A.childNodes;for (var i=0,count=B.length;i0){if (D.nodeType==3){var G=D.nodeValue.substr(0,E).Trim();if (G.length!=0) return A.IsStartOfBlock=false;}else F=D.childNodes[E-1];};if (!F) F=FCKDomTools.GetPreviousSourceNode(D,true,null,C);while (F){switch (F.nodeType){case 1:if (!FCKListsLib.InlineChildReqElements[F.nodeName.toLowerCase()]) return A.IsStartOfBlock=false;break;case 3:if (F.nodeValue.Trim().length>0) return A.IsStartOfBlock=false;};F=FCKDomTools.GetPreviousSourceNode(F,false,null,C);};return A.IsStartOfBlock=true;},CheckEndOfBlock:function(A){var B=this._Cache.IsEndOfBlock;if (B!=undefined) return B;var C=this.EndBlock||this.EndBlockLimit;var D=this._Range.endContainer;var E=this._Range.endOffset;var F;if (D.nodeType==3){var G=D.nodeValue;if (E0) return this._Cache.IsEndOfBlock=false;};F=FCKDomTools.GetNextSourceNode(F,false,null,C);};if (A) this.Select();return this._Cache.IsEndOfBlock=true;},CreateBookmark:function(A){var B={StartId:(new Date()).valueOf()+Math.floor(Math.random()*1000)+'S',EndId:(new Date()).valueOf()+Math.floor(Math.random()*1000)+'E'};var C=this.Window.document;var D;var E;var F;if (!this.CheckIsCollapsed()){E=C.createElement('span');E.style.display='none';E.id=B.EndId;E.setAttribute('_fck_bookmark',true);E.innerHTML=' ';F=this.Clone();F.Collapse(false);F.InsertNode(E);};D=C.createElement('span');D.style.display='none';D.id=B.StartId;D.setAttribute('_fck_bookmark',true);D.innerHTML=' ';F=this.Clone();F.Collapse(true);F.InsertNode(D);if (A){B.StartNode=D;B.EndNode=E;};if (E){this.SetStart(D,4);this.SetEnd(E,3);}else this.MoveToPosition(D,4);return B;},GetBookmarkNode:function(A,B){var C=this.Window.document;if (B) return A.StartNode||C.getElementById(A.StartId);else return A.EndNode||C.getElementById(A.EndId);},MoveToBookmark:function(A,B){var C=this.GetBookmarkNode(A,true);var D=this.GetBookmarkNode(A,false);this.SetStart(C,3);if (!B) FCKDomTools.RemoveNode(C);if (D){this.SetEnd(D,3);if (!B) FCKDomTools.RemoveNode(D);}else this.Collapse(true);this._UpdateElementInfo();},CreateBookmark2:function(){if (!this._Range) return { "Start":0,"End":0 };var A={"Start":[this._Range.startOffset],"End":[this._Range.endOffset]};var B=this._Range.startContainer.previousSibling;var C=this._Range.endContainer.previousSibling;var D=this._Range.startContainer;var E=this._Range.endContainer;while (B&&D.nodeType==3){A.Start[0]+=B.length;D=B;B=B.previousSibling;}while (C&&E.nodeType==3){A.End[0]+=C.length;E=C;C=C.previousSibling;};if (D.nodeType==1&&D.childNodes[A.Start[0]]&&D.childNodes[A.Start[0]].nodeType==3){var F=D.childNodes[A.Start[0]];var G=0;while (F.previousSibling&&F.previousSibling.nodeType==3){F=F.previousSibling;G+=F.length;};D=F;A.Start[0]=G;};if (E.nodeType==1&&E.childNodes[A.End[0]]&&E.childNodes[A.End[0]].nodeType==3){var F=E.childNodes[A.End[0]];var G=0;while (F.previousSibling&&F.previousSibling.nodeType==3){F=F.previousSibling;G+=F.length;};E=F;A.End[0]=G;};A.Start=FCKDomTools.GetNodeAddress(D,true).concat(A.Start);A.End=FCKDomTools.GetNodeAddress(E,true).concat(A.End);return A;},MoveToBookmark2:function(A){var B=FCKDomTools.GetNodeFromAddress(this.Window.document,A.Start.slice(0,-1),true);var C=FCKDomTools.GetNodeFromAddress(this.Window.document,A.End.slice(0,-1),true);this.Release(true);this._Range=new FCKW3CRange(this.Window.document);var D=A.Start[A.Start.length-1];var E=A.End[A.End.length-1];while (B.nodeType==3&&D>B.length){if (!B.nextSibling||B.nextSibling.nodeType!=3) break;D-=B.length;B=B.nextSibling;}while (C.nodeType==3&&E>C.length){if (!C.nextSibling||C.nextSibling.nodeType!=3) break;E-=C.length;C=C.nextSibling;};this._Range.setStart(B,D);this._Range.setEnd(C,E);this._UpdateElementInfo();},MoveToPosition:function(A,B){this.SetStart(A,B);this.Collapse(true);},SetStart:function(A,B,C){var D=this._Range;if (!D) D=this._Range=this.CreateRange();switch(B){case 1:D.setStart(A,0);break;case 2:D.setStart(A,A.childNodes.length);break;case 3:D.setStartBefore(A);break;case 4:D.setStartAfter(A);};if (!C) this._UpdateElementInfo();},SetEnd:function(A,B,C){var D=this._Range;if (!D) D=this._Range=this.CreateRange();switch(B){case 1:D.setEnd(A,0);break;case 2:D.setEnd(A,A.childNodes.length);break;case 3:D.setEndBefore(A);break;case 4:D.setEndAfter(A);};if (!C) this._UpdateElementInfo();},Expand:function(A){var B,oSibling;switch (A){case 'inline_elements':if (this._Range.startOffset==0){B=this._Range.startContainer;if (B.nodeType!=1) B=B.previousSibling?null:B.parentNode;if (B){while (FCKListsLib.InlineNonEmptyElements[B.nodeName.toLowerCase()]){this._Range.setStartBefore(B);if (B!=B.parentNode.firstChild) break;B=B.parentNode;}}};B=this._Range.endContainer;var C=this._Range.endOffset;if ((B.nodeType==3&&C>=B.nodeValue.length)||(B.nodeType==1&&C>=B.childNodes.length)||(B.nodeType!=1&&B.nodeType!=3)){if (B.nodeType!=1) B=B.nextSibling?null:B.parentNode;if (B){while (FCKListsLib.InlineNonEmptyElements[B.nodeName.toLowerCase()]){this._Range.setEndAfter(B);if (B!=B.parentNode.lastChild) break;B=B.parentNode;}}};break;case 'block_contents':case 'list_contents':var D=FCKListsLib.BlockBoundaries;if (A=='list_contents'||FCKConfig.EnterMode=='br') D=FCKListsLib.ListBoundaries;if (this.StartBlock&&FCKConfig.EnterMode!='br'&&A=='block_contents') this.SetStart(this.StartBlock,1);else{B=this._Range.startContainer;if (B.nodeType==1){var E=B.childNodes[this._Range.startOffset];if (E) B=FCKDomTools.GetPreviousSourceNode(E,true);else B=B.lastChild||B;}while (B&&(B.nodeType!=1||(B!=this.StartBlockLimit&&!D[B.nodeName.toLowerCase()]))){this._Range.setStartBefore(B);B=B.previousSibling||B.parentNode;}};if (this.EndBlock&&FCKConfig.EnterMode!='br'&&A=='block_contents'&&this.EndBlock.nodeName.toLowerCase()!='li') this.SetEnd(this.EndBlock,2);else{B=this._Range.endContainer;if (B.nodeType==1) B=B.childNodes[this._Range.endOffset]||B.lastChild;while (B&&(B.nodeType!=1||(B!=this.StartBlockLimit&&!D[B.nodeName.toLowerCase()]))){this._Range.setEndAfter(B);B=B.nextSibling||B.parentNode;};if (B&&B.nodeName.toLowerCase()=='br') this._Range.setEndAfter(B);};this._UpdateElementInfo();}},SplitBlock:function(A){var B=A||FCKConfig.EnterMode;if (!this._Range) this.MoveToSelection();if (this.StartBlockLimit==this.EndBlockLimit){var C=this.StartBlock;var D=this.EndBlock;var E=null;if (B!='br'){if (!C){C=this.FixBlock(true,B);D=this.EndBlock;};if (!D) D=this.FixBlock(false,B);};var F=(C!=null&&this.CheckStartOfBlock());var G=(D!=null&&this.CheckEndOfBlock());if (!this.CheckIsEmpty()) this.DeleteContents();if (C&&D&&C==D){if (G){E=new FCKElementPath(this.StartContainer);this.MoveToPosition(D,4);D=null;}else if (F){E=new FCKElementPath(this.StartContainer);this.MoveToPosition(C,3);C=null;}else{this.SetEnd(C,2);var H=this.ExtractContents();D=C.cloneNode(false);D.removeAttribute('id',false);H.AppendTo(D);FCKDomTools.InsertAfterNode(C,D);this.MoveToPosition(C,4);if (FCKBrowserInfo.IsGecko&&!C.nodeName.IEquals(['ul','ol'])) FCKTools.AppendBogusBr(C);}};return {PreviousBlock:C,NextBlock:D,WasStartOfBlock:F,WasEndOfBlock:G,ElementPath:E};};return null;},FixBlock:function(A,B){var C=this.CreateBookmark();this.Collapse(A);this.Expand('block_contents');var D=this.Window.document.createElement(B);this.ExtractContents().AppendTo(D);FCKDomTools.TrimNode(D);if (FCKDomTools.CheckIsEmptyElement(D,function(element) { return element.getAttribute('_fck_bookmark')!='true';})&&FCKBrowserInfo.IsGeckoLike) FCKTools.AppendBogusBr(D);this.InsertNode(D);this.MoveToBookmark(C);return D;},Release:function(A){if (!A) this.Window=null;this.StartNode=null;this.StartContainer=null;this.StartBlock=null;this.StartBlockLimit=null;this.EndNode=null;this.EndContainer=null;this.EndBlock=null;this.EndBlockLimit=null;this._Range=null;this._Cache=null;},CheckHasRange:function(){return!!this._Range;},GetTouchedStartNode:function(){var A=this._Range;var B=A.startContainer;if (A.collapsed||B.nodeType!=1) return B;return B.childNodes[A.startOffset]||B;},GetTouchedEndNode:function(){var A=this._Range;var B=A.endContainer;if (A.collapsed||B.nodeType!=1) return B;return B.childNodes[A.endOffset-1]||B;}}; +FCKDomRange.prototype.MoveToSelection=function(){this.Release(true);var A=this.Window.getSelection();if (A&&A.rangeCount>0){this._Range=FCKW3CRange.CreateFromRange(this.Window.document,A.getRangeAt(0));this._UpdateElementInfo();}else if (this.Window.document) this.MoveToElementStart(this.Window.document.body);};FCKDomRange.prototype.Select=function(){var A=this._Range;if (A){var B=A.startContainer;if (A.collapsed&&B.nodeType==1&&B.childNodes.length==0) B.appendChild(A._Document.createTextNode(''));var C=this.Window.document.createRange();C.setStart(B,A.startOffset);try{C.setEnd(A.endContainer,A.endOffset);}catch (e){if (e.toString().Contains('NS_ERROR_ILLEGAL_VALUE')){A.collapse(true);C.setEnd(A.endContainer,A.endOffset);}else throw(e);};var D=this.Window.getSelection();D.removeAllRanges();D.addRange(C);}};FCKDomRange.prototype.SelectBookmark=function(A){var B=this.Window.document.createRange();var C=this.GetBookmarkNode(A,true);var D=this.GetBookmarkNode(A,false);B.setStart(C.parentNode,FCKDomTools.GetIndexOf(C));FCKDomTools.RemoveNode(C);if (D){B.setEnd(D.parentNode,FCKDomTools.GetIndexOf(D));FCKDomTools.RemoveNode(D);};var E=this.Window.getSelection();E.removeAllRanges();E.addRange(B);}; +var FCKDomRangeIterator=function(A){this.Range=A;this.ForceBrBreak=false;this.EnforceRealBlocks=false;};FCKDomRangeIterator.CreateFromSelection=function(A){var B=new FCKDomRange(A);B.MoveToSelection();return new FCKDomRangeIterator(B);};FCKDomRangeIterator.prototype={GetNextParagraph:function(){var A;var B;var C;var D;var E;var F=this.ForceBrBreak?FCKListsLib.ListBoundaries:FCKListsLib.BlockBoundaries;if (!this._LastNode){var B=this.Range.Clone();B.Expand(this.ForceBrBreak?'list_contents':'block_contents');this._NextNode=B.GetTouchedStartNode();this._LastNode=B.GetTouchedEndNode();B=null;};var H=this._NextNode;var I=this._LastNode;this._NextNode=null;while (H){var J=false;var K=(H.nodeType!=1);var L=false;if (!K){var M=H.nodeName.toLowerCase();if (F[M]&&(!FCKBrowserInfo.IsIE||H.scopeName=='HTML')){if (M=='br') K=true;else if (!B&&H.childNodes.length==0&&M!='hr'){A=H;C=H==I;break;};if (B){B.SetEnd(H,3,true);if (M!='br') this._NextNode=H;};J=true;}else{if (H.firstChild){if (!B){B=new FCKDomRange(this.Range.Window);B.SetStart(H,3,true);};H=H.firstChild;continue;};K=true;}}else if (H.nodeType==3){if (/^[\r\n\t ]+$/.test(H.nodeValue)) K=false;};if (K&&!B){B=new FCKDomRange(this.Range.Window);B.SetStart(H,3,true);};C=((!J||K)&&H==I);if (B&&!J){while (!H.nextSibling&&!C){var N=H.parentNode;if (F[N.nodeName.toLowerCase()]){J=true;C=C||(N==I);break;};H=N;K=true;C=(H==I);L=true;}};if (K) B.SetEnd(H,4,true);if ((J||C)&&B){B._UpdateElementInfo();if (B.StartNode==B.EndNode&&B.StartNode.parentNode==B.StartBlockLimit&&B.StartNode.getAttribute&&B.StartNode.getAttribute('_fck_bookmark')) B=null;else break;};if (C) break;H=FCKDomTools.GetNextSourceNode(H,L,null,I);};if (!A){if (!B){this._NextNode=null;return null;};A=B.StartBlock;if (!A&&!this.EnforceRealBlocks&&B.StartBlockLimit.nodeName.IEquals('DIV','TH','TD')&&B.CheckStartOfBlock()&&B.CheckEndOfBlock()){A=B.StartBlockLimit;}else if (!A||(this.EnforceRealBlocks&&A.nodeName.toLowerCase()=='li')){A=this.Range.Window.document.createElement(FCKConfig.EnterMode=='p'?'p':'div');B.ExtractContents().AppendTo(A);FCKDomTools.TrimNode(A);B.InsertNode(A);D=true;E=true;}else if (A.nodeName.toLowerCase()!='li'){if (!B.CheckStartOfBlock()||!B.CheckEndOfBlock()){A=A.cloneNode(false);B.ExtractContents().AppendTo(A);FCKDomTools.TrimNode(A);var O=B.SplitBlock();D=!O.WasStartOfBlock;E=!O.WasEndOfBlock;B.InsertNode(A);}}else if (!C){this._NextNode=A==I?null:FCKDomTools.GetNextSourceNode(B.EndNode,true,null,I);return A;}};if (D){var P=A.previousSibling;if (P&&P.nodeType==1){if (P.nodeName.toLowerCase()=='br') P.parentNode.removeChild(P);else if (P.lastChild&&P.lastChild.nodeName.IEquals('br')) P.removeChild(P.lastChild);}};if (E){var Q=A.lastChild;if (Q&&Q.nodeType==1&&Q.nodeName.toLowerCase()=='br') A.removeChild(Q);};if (!this._NextNode) this._NextNode=(C||A==I)?null:FCKDomTools.GetNextSourceNode(A,true,null,I);return A;}}; +var FCKDocumentFragment=function(A,B){this.RootNode=B||A.createDocumentFragment();};FCKDocumentFragment.prototype={AppendTo:function(A){A.appendChild(this.RootNode);},InsertAfterNode:function(A){FCKDomTools.InsertAfterNode(A,this.RootNode);}}; +var FCKW3CRange=function(A){this._Document=A;this.startContainer=null;this.startOffset=null;this.endContainer=null;this.endOffset=null;this.collapsed=true;};FCKW3CRange.CreateRange=function(A){return new FCKW3CRange(A);};FCKW3CRange.CreateFromRange=function(A,B){var C=FCKW3CRange.CreateRange(A);C.setStart(B.startContainer,B.startOffset);C.setEnd(B.endContainer,B.endOffset);return C;};FCKW3CRange.prototype={_UpdateCollapsed:function(){this.collapsed=(this.startContainer==this.endContainer&&this.startOffset==this.endOffset);},setStart:function(A,B){this.startContainer=A;this.startOffset=B;if (!this.endContainer){this.endContainer=A;this.endOffset=B;};this._UpdateCollapsed();},setEnd:function(A,B){this.endContainer=A;this.endOffset=B;if (!this.startContainer){this.startContainer=A;this.startOffset=B;};this._UpdateCollapsed();},setStartAfter:function(A){this.setStart(A.parentNode,FCKDomTools.GetIndexOf(A)+1);},setStartBefore:function(A){this.setStart(A.parentNode,FCKDomTools.GetIndexOf(A));},setEndAfter:function(A){this.setEnd(A.parentNode,FCKDomTools.GetIndexOf(A)+1);},setEndBefore:function(A){this.setEnd(A.parentNode,FCKDomTools.GetIndexOf(A));},collapse:function(A){if (A){this.endContainer=this.startContainer;this.endOffset=this.startOffset;}else{this.startContainer=this.endContainer;this.startOffset=this.endOffset;};this.collapsed=true;},selectNodeContents:function(A){this.setStart(A,0);this.setEnd(A,A.nodeType==3?A.data.length:A.childNodes.length);},insertNode:function(A){var B=this.startContainer;var C=this.startOffset;if (B.nodeType==3){B.splitText(C);if (B==this.endContainer) this.setEnd(B.nextSibling,this.endOffset-this.startOffset);FCKDomTools.InsertAfterNode(B,A);return;}else{B.insertBefore(A,B.childNodes[C]||null);if (B==this.endContainer){this.endOffset++;this.collapsed=false;}}},deleteContents:function(){if (this.collapsed) return;this._ExecContentsAction(0);},extractContents:function(){var A=new FCKDocumentFragment(this._Document);if (!this.collapsed) this._ExecContentsAction(1,A);return A;},cloneContents:function(){var A=new FCKDocumentFragment(this._Document);if (!this.collapsed) this._ExecContentsAction(2,A);return A;},_ExecContentsAction:function(A,B){var C=this.startContainer;var D=this.endContainer;var E=this.startOffset;var F=this.endOffset;var G=false;var H=false;if (D.nodeType==3) D=D.splitText(F);else{if (D.childNodes.length>0){if (F>D.childNodes.length-1){D=FCKDomTools.InsertAfterNode(D.lastChild,this._Document.createTextNode(''));H=true;}else D=D.childNodes[F];}};if (C.nodeType==3){C.splitText(E);if (C==D) D=C.nextSibling;}else{if (E==0){C=C.insertBefore(this._Document.createTextNode(''),C.firstChild);G=true;}else if (E>C.childNodes.length-1){C=C.appendChild(this._Document.createTextNode(''));G=true;}else C=C.childNodes[E].previousSibling;};var I=FCKDomTools.GetParents(C);var J=FCKDomTools.GetParents(D);var i,topStart,topEnd;for (i=0;i0&&levelStartNode!=D) levelClone=K.appendChild(levelStartNode.cloneNode(levelStartNode==D));if (!I[k]||levelStartNode.parentNode!=I[k].parentNode){currentNode=levelStartNode.previousSibling;while(currentNode){if (currentNode==I[k]||currentNode==C) break;currentSibling=currentNode.previousSibling;if (A==2) K.insertBefore(currentNode.cloneNode(true),K.firstChild);else{currentNode.parentNode.removeChild(currentNode);if (A==1) K.insertBefore(currentNode,K.firstChild);};currentNode=currentSibling;}};if (K) K=levelClone;};if (A==2){var L=this.startContainer;if (L.nodeType==3){L.data+=L.nextSibling.data;L.parentNode.removeChild(L.nextSibling);};var M=this.endContainer;if (M.nodeType==3&&M.nextSibling){M.data+=M.nextSibling.data;M.parentNode.removeChild(M.nextSibling);}}else{if (topStart&&topEnd&&(C.parentNode!=topStart.parentNode||D.parentNode!=topEnd.parentNode)){var N=FCKDomTools.GetIndexOf(topEnd);if (G&&topEnd.parentNode==C.parentNode) N--;this.setStart(topEnd.parentNode,N);};this.collapse(true);};if(G) C.parentNode.removeChild(C);if(H&&D.parentNode) D.parentNode.removeChild(D);},cloneRange:function(){return FCKW3CRange.CreateFromRange(this._Document,this);}}; +var FCKEnterKey=function(A,B,C,D){this.Window=A;this.EnterMode=B||'p';this.ShiftEnterMode=C||'br';var E=new FCKKeystrokeHandler(false);E._EnterKey=this;E.OnKeystroke=FCKEnterKey_OnKeystroke;E.SetKeystrokes([[13,'Enter'],[SHIFT+13,'ShiftEnter'],[8,'Backspace'],[CTRL+8,'CtrlBackspace'],[46,'Delete']]);this.TabText='';if (D>0||FCKBrowserInfo.IsSafari){while (D--) this.TabText+='\xa0';E.SetKeystrokes([9,'Tab']);};E.AttachToElement(A.document);};function FCKEnterKey_OnKeystroke(A,B){var C=this._EnterKey;try{switch (B){case 'Enter':return C.DoEnter();break;case 'ShiftEnter':return C.DoShiftEnter();break;case 'Backspace':return C.DoBackspace();break;case 'Delete':return C.DoDelete();break;case 'Tab':return C.DoTab();break;case 'CtrlBackspace':return C.DoCtrlBackspace();break;}}catch (e){};return false;};FCKEnterKey.prototype.DoEnter=function(A,B){FCKUndo.SaveUndoStep();this._HasShift=(B===true);var C=FCKSelection.GetParentElement();var D=new FCKElementPath(C);var E=A||this.EnterMode;if (E=='br'||D.Block&&D.Block.tagName.toLowerCase()=='pre') return this._ExecuteEnterBr();else return this._ExecuteEnterBlock(E);};FCKEnterKey.prototype.DoShiftEnter=function(){return this.DoEnter(this.ShiftEnterMode,true);};FCKEnterKey.prototype.DoBackspace=function(){var A=false;var B=new FCKDomRange(this.Window);B.MoveToSelection();if (FCKBrowserInfo.IsIE&&this._CheckIsAllContentsIncluded(B,this.Window.document.body)){this._FixIESelectAllBug(B);return true;};var C=B.CheckIsCollapsed();if (!C){if (FCKBrowserInfo.IsIE&&this.Window.document.selection.type.toLowerCase()=="control"){var D=this.Window.document.selection.createRange();for (var i=D.length-1;i>=0;i--){var E=D.item(i);E.parentNode.removeChild(E);};return true;};return false;};if (FCKBrowserInfo.IsIE){var F=FCKDomTools.GetPreviousSourceElement(B.StartNode,true);if (F&&F.nodeName.toLowerCase()=='br'){var G=B.Clone();G.SetStart(F,4);if (G.CheckIsEmpty()){F.parentNode.removeChild(F);return true;}}};var H=B.StartBlock;var I=B.EndBlock;if (B.StartBlockLimit==B.EndBlockLimit&&H&&I){if (!C){var J=B.CheckEndOfBlock();B.DeleteContents();if (H!=I){B.SetStart(I,1);B.SetEnd(I,1);};B.Select();A=(H==I);};if (B.CheckStartOfBlock()){var K=B.StartBlock;var L=FCKDomTools.GetPreviousSourceElement(K,true,['BODY',B.StartBlockLimit.nodeName],['UL','OL']);A=this._ExecuteBackspace(B,L,K);}else if (FCKBrowserInfo.IsGeckoLike){B.Select();}};B.Release();return A;};FCKEnterKey.prototype.DoCtrlBackspace=function(){FCKUndo.SaveUndoStep();var A=new FCKDomRange(this.Window);A.MoveToSelection();if (FCKBrowserInfo.IsIE&&this._CheckIsAllContentsIncluded(A,this.Window.document.body)){this._FixIESelectAllBug(A);return true;};return false;};FCKEnterKey.prototype._ExecuteBackspace=function(A,B,C){var D=false;if (!B&&C&&C.nodeName.IEquals('LI')&&C.parentNode.parentNode.nodeName.IEquals('LI')){this._OutdentWithSelection(C,A);return true;};if (B&&B.nodeName.IEquals('LI')){var E=FCKDomTools.GetLastChild(B,['UL','OL']);while (E){B=FCKDomTools.GetLastChild(E,'LI');E=FCKDomTools.GetLastChild(B,['UL','OL']);}};if (B&&C){if (C.nodeName.IEquals('LI')&&!B.nodeName.IEquals('LI')){this._OutdentWithSelection(C,A);return true;};var F=C.parentNode;var G=B.nodeName.toLowerCase();if (FCKListsLib.EmptyElements[G]!=null||G=='table'){FCKDomTools.RemoveNode(B);D=true;}else{FCKDomTools.RemoveNode(C);while (F.innerHTML.Trim().length==0){var H=F.parentNode;H.removeChild(F);F=H;};FCKDomTools.LTrimNode(C);FCKDomTools.RTrimNode(B);A.SetStart(B,2,true);A.Collapse(true);var I=A.CreateBookmark(true);if (!C.tagName.IEquals(['TABLE'])) FCKDomTools.MoveChildren(C,B);A.SelectBookmark(I);D=true;}};return D;};FCKEnterKey.prototype.DoDelete=function(){FCKUndo.SaveUndoStep();var A=false;var B=new FCKDomRange(this.Window);B.MoveToSelection();if (FCKBrowserInfo.IsIE&&this._CheckIsAllContentsIncluded(B,this.Window.document.body)){this._FixIESelectAllBug(B);return true;};if (B.CheckIsCollapsed()&&B.CheckEndOfBlock(FCKBrowserInfo.IsGeckoLike)){var C=B.StartBlock;var D=FCKTools.GetElementAscensor(C,'td');var E=FCKDomTools.GetNextSourceElement(C,true,[B.StartBlockLimit.nodeName],['UL','OL','TR'],true);if (D){var F=FCKTools.GetElementAscensor(E,'td');if (F!=D) return true;};A=this._ExecuteBackspace(B,C,E);};B.Release();return A;};FCKEnterKey.prototype.DoTab=function(){var A=new FCKDomRange(this.Window);A.MoveToSelection();var B=A._Range.startContainer;while (B){if (B.nodeType==1){var C=B.tagName.toLowerCase();if (C=="tr"||C=="td"||C=="th"||C=="tbody"||C=="table") return false;else break;};B=B.parentNode;};if (this.TabText){A.DeleteContents();A.InsertNode(this.Window.document.createTextNode(this.TabText));A.Collapse(false);A.Select();};return true;};FCKEnterKey.prototype._ExecuteEnterBlock=function(A,B){var C=B||new FCKDomRange(this.Window);var D=C.SplitBlock(A);if (D){var E=D.PreviousBlock;var F=D.NextBlock;var G=D.WasStartOfBlock;var H=D.WasEndOfBlock;if (F){if (F.parentNode.nodeName.IEquals('li')){FCKDomTools.BreakParent(F,F.parentNode);FCKDomTools.MoveNode(F,F.nextSibling,true);}}else if (E&&E.parentNode.nodeName.IEquals('li')){FCKDomTools.BreakParent(E,E.parentNode);C.MoveToElementEditStart(E.nextSibling);FCKDomTools.MoveNode(E,E.previousSibling);};if (!G&&!H){if (F.nodeName.IEquals('li')&&F.firstChild&&F.firstChild.nodeName.IEquals(['ul','ol'])) F.insertBefore(FCKTools.GetElementDocument(F).createTextNode('\xa0'),F.firstChild);if (F) C.MoveToElementEditStart(F);}else{if (G&&H&&E.tagName.toUpperCase()=='LI'){C.MoveToElementStart(E);this._OutdentWithSelection(E,C);C.Release();return true;};var I;if (E){var J=E.tagName.toUpperCase();if (!this._HasShift&&!(/^H[1-6]$/).test(J)){I=FCKDomTools.CloneElement(E);}}else if (F) I=FCKDomTools.CloneElement(F);if (!I) I=this.Window.document.createElement(A);var K=D.ElementPath;if (K){for (var i=0,len=K.Elements.length;i=0&&(C=B[i--])){if (C.name.length>0){if (C.innerHTML!==''){if (FCKBrowserInfo.IsIE) C.className+=' FCK__AnchorC';}else{var D=FCKDocumentProcessor_CreateFakeImage('FCK__Anchor',C.cloneNode(true));D.setAttribute('_fckanchor','true',0);C.parentNode.insertBefore(D,C);C.parentNode.removeChild(C);}}}}};var FCKPageBreaksProcessor=FCKDocumentProcessor.AppendNew();FCKPageBreaksProcessor.ProcessDocument=function(A){var B=A.getElementsByTagName('DIV');var C;var i=B.length-1;while (i>=0&&(C=B[i--])){if (C.style.pageBreakAfter=='always'&&C.childNodes.length==1&&C.childNodes[0].style&&C.childNodes[0].style.display=='none'){var D=FCKDocumentProcessor_CreateFakeImage('FCK__PageBreak',C.cloneNode(true));C.parentNode.insertBefore(D,C);C.parentNode.removeChild(C);}}};FCKEmbedAndObjectProcessor=(function(){var A=[];var B=function(el){var C=el.cloneNode(true);var D;var E=D=FCKDocumentProcessor_CreateFakeImage('FCK__UnknownObject',C);FCKEmbedAndObjectProcessor.RefreshView(E,el);for (var i=0;i=0;i--) B(F[i]);var G=doc.getElementsByTagName('embed');for (var i=G.length-1;i>=0;i--) B(G[i]);});},RefreshView:function(placeHolder,original){if (original.getAttribute('width')>0) placeHolder.style.width=FCKTools.ConvertHtmlSizeToStyle(original.getAttribute('width'));if (original.getAttribute('height')>0) placeHolder.style.height=FCKTools.ConvertHtmlSizeToStyle(original.getAttribute('height'));},AddCustomHandler:function(func){A.push(func);}});})();FCK.GetRealElement=function(A){var e=FCKTempBin.Elements[A.getAttribute('_fckrealelement')];if (A.getAttribute('_fckflash')){if (A.style.width.length>0) e.width=FCKTools.ConvertStyleSizeToHtml(A.style.width);if (A.style.height.length>0) e.height=FCKTools.ConvertStyleSizeToHtml(A.style.height);};return e;};if (FCKBrowserInfo.IsIE){FCKDocumentProcessor.AppendNew().ProcessDocument=function(A){var B=A.getElementsByTagName('HR');var C;var i=B.length-1;while (i>=0&&(C=B[i--])){var D=A.createElement('hr');D.mergeAttributes(C,true);FCKDomTools.InsertAfterNode(C,D);C.parentNode.removeChild(C);}}};FCKDocumentProcessor.AppendNew().ProcessDocument=function(A){var B=A.getElementsByTagName('INPUT');var C;var i=B.length-1;while (i>=0&&(C=B[i--])){if (C.type=='hidden'){var D=FCKDocumentProcessor_CreateFakeImage('FCK__InputHidden',C.cloneNode(true));D.setAttribute('_fckinputhidden','true',0);C.parentNode.insertBefore(D,C);C.parentNode.removeChild(C);}}};FCKEmbedAndObjectProcessor.AddCustomHandler(function(A,B){if (!(A.nodeName.IEquals('embed')&&(A.type=='application/x-shockwave-flash'||/\.swf($|#|\?)/i.test(A.src)))) return;B.className='FCK__Flash';B.setAttribute('_fckflash','true',0);});if (FCKBrowserInfo.IsSafari){FCKDocumentProcessor.AppendNew().ProcessDocument=function(A){var B=A.getElementsByClassName?A.getElementsByClassName('Apple-style-span'):Array.prototype.filter.call(A.getElementsByTagName('span'),function(item){ return item.className=='Apple-style-span';});for (var i=B.length-1;i>=0;i--) FCKDomTools.RemoveNode(B[i],true);}}; +var FCKSelection=FCK.Selection={GetParentBlock:function(){var A=this.GetParentElement();while (A){if (FCKListsLib.BlockBoundaries[A.nodeName.toLowerCase()]) break;A=A.parentNode;};return A;},ApplyStyle:function(A){FCKStyles.ApplyStyle(new FCKStyle(A));}}; +FCKSelection.GetType=function(){var A='Text';var B;try { B=this.GetSelection();} catch (e) {};if (B&&B.rangeCount==1){var C=B.getRangeAt(0);if (C.startContainer==C.endContainer&&(C.endOffset-C.startOffset)==1&&C.startContainer.nodeType==1&&FCKListsLib.StyleObjectElements[C.startContainer.childNodes[C.startOffset].nodeName.toLowerCase()]){A='Control';}};return A;};FCKSelection.GetSelectedElement=function(){var A=!!FCK.EditorWindow&&this.GetSelection();if (!A||A.rangeCount<1) return null;var B=A.getRangeAt(0);if (B.startContainer!=B.endContainer||B.startContainer.nodeType!=1||B.startOffset!=B.endOffset-1) return null;var C=B.startContainer.childNodes[B.startOffset];if (C.nodeType!=1) return null;return C;};FCKSelection.GetParentElement=function(){if (this.GetType()=='Control') return FCKSelection.GetSelectedElement().parentNode;else{var A=this.GetSelection();if (A){if (A.anchorNode&&A.anchorNode==A.focusNode) return A.anchorNode.parentNode;var B=new FCKElementPath(A.anchorNode);var C=new FCKElementPath(A.focusNode);var D=null;var E=null;if (B.Elements.length>C.Elements.length){D=B.Elements;E=C.Elements;}else{D=C.Elements;E=B.Elements;};var F=D.length-E.length;for(var i=0;i0){var C=B.getRangeAt(A?0:(B.rangeCount-1));var D=A?C.startContainer:C.endContainer;return (D.nodeType==1?D:D.parentNode);}};return null;};FCKSelection.SelectNode=function(A){var B=FCK.EditorDocument.createRange();B.selectNode(A);var C=this.GetSelection();C.removeAllRanges();C.addRange(B);};FCKSelection.Collapse=function(A){var B=this.GetSelection();if (A==null||A===true) B.collapseToStart();else B.collapseToEnd();};FCKSelection.HasAncestorNode=function(A){var B=this.GetSelectedElement();if (!B&&FCK.EditorWindow){try { B=this.GetSelection().getRangeAt(0).startContainer;}catch(e){}}while (B){if (B.nodeType==1&&B.nodeName.IEquals(A)) return true;B=B.parentNode;};return false;};FCKSelection.MoveToAncestorNode=function(A){var B;var C=this.GetSelectedElement();if (!C) C=this.GetSelection().getRangeAt(0).startContainer;while (C){if (C.nodeName.IEquals(A)) return C;C=C.parentNode;};return null;};FCKSelection.Delete=function(){var A=this.GetSelection();for (var i=0;i=0;i--){if (C[i]) FCKTableHandler.DeleteRows(C[i]);};return;};var E=FCKTools.GetElementAscensor(A,'TABLE');if (E.rows.length==1){FCKTableHandler.DeleteTable(E);return;};A.parentNode.removeChild(A);};FCKTableHandler.DeleteTable=function(A){if (!A){A=FCKSelection.GetSelectedElement();if (!A||A.tagName!='TABLE') A=FCKSelection.MoveToAncestorNode('TABLE');};if (!A) return;FCKSelection.SelectNode(A);FCKSelection.Collapse();if (A.parentNode.childNodes.length==1) A.parentNode.parentNode.removeChild(A.parentNode);else A.parentNode.removeChild(A);};FCKTableHandler.InsertColumn=function(A){var B=null;var C=this.GetSelectedCells();if (C&&C.length) B=C[A?0:(C.length-1)];if (!B) return;var D=FCKTools.GetElementAscensor(B,'TABLE');var E=B.cellIndex;for (var i=0;i=0;i--){if (B[i]) FCKTableHandler.DeleteColumns(B[i]);};return;};if (!A) return;var C=FCKTools.GetElementAscensor(A,'TABLE');var D=A.cellIndex;for (var i=C.rows.length-1;i>=0;i--){var E=C.rows[i];if (D==0&&E.cells.length==1){FCKTableHandler.DeleteRows(E);continue;};if (E.cells[D]) E.removeChild(E.cells[D]);}};FCKTableHandler.InsertCell=function(A,B){var C=null;var D=this.GetSelectedCells();if (D&&D.length) C=D[B?0:(D.length-1)];if (!C) return null;var E=FCK.EditorDocument.createElement('TD');if (FCKBrowserInfo.IsGeckoLike) FCKTools.AppendBogusBr(E);if (!B&&C.cellIndex==C.parentNode.cells.length-1) C.parentNode.appendChild(E);else C.parentNode.insertBefore(E,B?C:C.nextSibling);return E;};FCKTableHandler.DeleteCell=function(A){if (A.parentNode.cells.length==1){FCKTableHandler.DeleteRows(FCKTools.GetElementAscensor(A,'TR'));return;};A.parentNode.removeChild(A);};FCKTableHandler.DeleteCells=function(){var A=FCKTableHandler.GetSelectedCells();for (var i=A.length-1;i>=0;i--){FCKTableHandler.DeleteCell(A[i]);}};FCKTableHandler._MarkCells=function(A,B){for (var i=0;i=E.height){for (D=F;D0){var L=K.removeChild(K.firstChild);if (L.nodeType!=1||(L.getAttribute('type',2)!='_moz'&&L.getAttribute('_moz_dirty')!=null)){I.appendChild(L);J++;}}};if (J>0) I.appendChild(FCKTools.GetElementDocument(B).createElement('br'));};this._ReplaceCellsByMarker(C,'_SelectedCells',B);this._UnmarkCells(A,'_SelectedCells');this._InstallTableMap(C,B.parentNode.parentNode);B.appendChild(I);if (FCKBrowserInfo.IsGeckoLike&&(!B.firstChild)) FCKTools.AppendBogusBr(B);this._MoveCaretToCell(B,false);};FCKTableHandler.MergeRight=function(){var A=this.GetMergeRightTarget();if (A==null) return;var B=A.refCell;var C=A.tableMap;var D=A.nextCell;var E=FCK.EditorDocument.createDocumentFragment();while (D&&D.childNodes&&D.childNodes.length>0) E.appendChild(D.removeChild(D.firstChild));D.parentNode.removeChild(D);B.appendChild(E);this._MarkCells([D],'_Replace');this._ReplaceCellsByMarker(C,'_Replace',B);this._InstallTableMap(C,B.parentNode.parentNode);this._MoveCaretToCell(B,false);};FCKTableHandler.MergeDown=function(){var A=this.GetMergeDownTarget();if (A==null) return;var B=A.refCell;var C=A.tableMap;var D=A.nextCell;var E=FCKTools.GetElementDocument(B).createDocumentFragment();while (D&&D.childNodes&&D.childNodes.length>0) E.appendChild(D.removeChild(D.firstChild));if (E.firstChild) E.insertBefore(FCKTools.GetElementDocument(D).createElement('br'),E.firstChild);B.appendChild(E);this._MarkCells([D],'_Replace');this._ReplaceCellsByMarker(C,'_Replace',B);this._InstallTableMap(C,B.parentNode.parentNode);this._MoveCaretToCell(B,false);};FCKTableHandler.HorizontalSplitCell=function(){var A=FCKTableHandler.GetSelectedCells();if (A.length!=1) return;var B=A[0];var C=this._CreateTableMap(B.parentNode.parentNode);var D=B.parentNode.rowIndex;var E=FCKTableHandler._GetCellIndexSpan(C,D,B);var F=isNaN(B.colSpan)?1:B.colSpan;if (F>1){var G=Math.ceil(F/2);var H=FCKTools.GetElementDocument(B).createElement('td');if (FCKBrowserInfo.IsGeckoLike) FCKTools.AppendBogusBr(H);var I=E+G;var J=E+F;var K=isNaN(B.rowSpan)?1:B.rowSpan;for (var r=D;r1){B.rowSpan=Math.ceil(E/2);var G=F+Math.ceil(E/2);var H=null;for (var i=D+1;i0){var C=B.rows[0];C.parentNode.removeChild(C);};for (var i=0;iE) E=j;if (D._colScanned===true) continue;if (A[i][j-1]==D) D.colSpan++;if (A[i][j+1]!=D) D._colScanned=true;}};for (var i=0;i<=E;i++){for (var j=0;j ';var A=FCKDocumentProcessor_CreateFakeImage('FCK__PageBreak',e);var B=new FCKDomRange(FCK.EditorWindow);B.MoveToSelection();var C=B.SplitBlock();B.InsertNode(A);FCK.Events.FireEvent('OnSelectionChange');};FCKPageBreakCommand.prototype.GetState=function(){if (FCK.EditMode!=0) return -1;return 0;};var FCKUnlinkCommand=function(){this.Name='Unlink';};FCKUnlinkCommand.prototype.Execute=function(){FCKUndo.SaveUndoStep();if (FCKBrowserInfo.IsGeckoLike){var A=FCK.Selection.MoveToAncestorNode('A');if (A) FCKTools.RemoveOuterTags(A);return;};FCK.ExecuteNamedCommand(this.Name);};FCKUnlinkCommand.prototype.GetState=function(){if (FCK.EditMode!=0) return -1;var A=FCK.GetNamedCommandState(this.Name);if (A==0&&FCK.EditMode==0){var B=FCKSelection.MoveToAncestorNode('A');var C=(B&&B.name.length>0&&B.href.length==0);if (C) A=-1;};return A;};var FCKSelectAllCommand=function(){this.Name='SelectAll';};FCKSelectAllCommand.prototype.Execute=function(){if (FCK.EditMode==0){FCK.ExecuteNamedCommand('SelectAll');}else{var A=FCK.EditingArea.Textarea;if (FCKBrowserInfo.IsIE){A.createTextRange().execCommand('SelectAll');}else{A.selectionStart=0;A.selectionEnd=A.value.length;};A.focus();}};FCKSelectAllCommand.prototype.GetState=function(){if (FCK.EditMode!=0) return -1;return 0;};var FCKPasteCommand=function(){this.Name='Paste';};FCKPasteCommand.prototype={Execute:function(){if (FCKBrowserInfo.IsIE) FCK.Paste();else FCK.ExecuteNamedCommand('Paste');},GetState:function(){if (FCK.EditMode!=0) return -1;return FCK.GetNamedCommandState('Paste');}};var FCKRuleCommand=function(){this.Name='Rule';};FCKRuleCommand.prototype={Execute:function(){FCKUndo.SaveUndoStep();FCK.InsertElement('hr');},GetState:function(){if (FCK.EditMode!=0) return -1;return FCK.GetNamedCommandState('InsertHorizontalRule');}};var FCKCutCopyCommand=function(A){this.Name=A?'Cut':'Copy';};FCKCutCopyCommand.prototype={Execute:function(){var A=false;if (FCKBrowserInfo.IsIE){var B=function(){A=true;};var C='on'+this.Name.toLowerCase();FCK.EditorDocument.body.attachEvent(C,B);FCK.ExecuteNamedCommand(this.Name);FCK.EditorDocument.body.detachEvent(C,B);}else{try{FCK.ExecuteNamedCommand(this.Name);A=true;}catch(e){}};if (!A) alert(FCKLang['PasteError'+this.Name]);},GetState:function(){return FCK.EditMode!=0?-1:FCK.GetNamedCommandState('Cut');}};var FCKAnchorDeleteCommand=function(){this.Name='AnchorDelete';};FCKAnchorDeleteCommand.prototype={Execute:function(){if (FCK.Selection.GetType()=='Control'){FCK.Selection.Delete();}else{var A=FCK.Selection.GetSelectedElement();if (A){if (A.tagName=='IMG'&&A.getAttribute('_fckanchor')) oAnchor=FCK.GetRealElement(A);else A=null;};if (!A){oAnchor=FCK.Selection.MoveToAncestorNode('A');if (oAnchor) FCK.Selection.SelectNode(oAnchor);};if (oAnchor.href.length!=0){oAnchor.removeAttribute('name');if (FCKBrowserInfo.IsIE) oAnchor.className=oAnchor.className.replace(FCKRegexLib.FCK_Class,'');return;};if (A){A.parentNode.removeChild(A);return;};if (oAnchor.innerHTML.length==0){oAnchor.parentNode.removeChild(oAnchor);return;};FCKTools.RemoveOuterTags(oAnchor);};if (FCKBrowserInfo.IsGecko) FCK.Selection.Collapse(true);},GetState:function(){if (FCK.EditMode!=0) return -1;return FCK.GetNamedCommandState('Unlink');}}; +var FCKShowBlockCommand=function(A,B){this.Name=A;if (B!=undefined) this._SavedState=B;else this._SavedState=null;};FCKShowBlockCommand.prototype.Execute=function(){var A=this.GetState();if (A==-1) return;var B=FCK.EditorDocument.body;if (A==1) B.className=B.className.replace(/(^| )FCK__ShowBlocks/g,'');else B.className+=' FCK__ShowBlocks';FCK.Events.FireEvent('OnSelectionChange');};FCKShowBlockCommand.prototype.GetState=function(){if (FCK.EditMode!=0) return -1;if (!FCK.EditorDocument) return 0;if (/FCK__ShowBlocks(?:\s|$)/.test(FCK.EditorDocument.body.className)) return 1;return 0;};FCKShowBlockCommand.prototype.SaveState=function(){this._SavedState=this.GetState();};FCKShowBlockCommand.prototype.RestoreState=function(){if (this._SavedState!=null&&this.GetState()!=this._SavedState) this.Execute();}; +var FCKSpellCheckCommand=function(){this.Name='SpellCheck';this.IsEnabled=(FCKConfig.SpellChecker=='SpellerPages');};FCKSpellCheckCommand.prototype.Execute=function(){FCKDialog.OpenDialog('FCKDialog_SpellCheck','Spell Check','dialog/fck_spellerpages.html',440,480);};FCKSpellCheckCommand.prototype.GetState=function(){if (FCK.EditMode!=0) return -1;return this.IsEnabled?0:-1;}; +var FCKTextColorCommand=function(A){this.Name=A=='ForeColor'?'TextColor':'BGColor';this.Type=A;var B;if (FCKBrowserInfo.IsIE) B=window;else if (FCK.ToolbarSet._IFrame) B=FCKTools.GetElementWindow(FCK.ToolbarSet._IFrame);else B=window.parent;this._Panel=new FCKPanel(B);this._Panel.AppendStyleSheet(FCKConfig.SkinEditorCSS);this._Panel.MainNode.className='FCK_Panel';this._CreatePanelBody(this._Panel.Document,this._Panel.MainNode);FCK.ToolbarSet.ToolbarItems.GetItem(this.Name).RegisterPanel(this._Panel);FCKTools.DisableSelection(this._Panel.Document.body);};FCKTextColorCommand.prototype.Execute=function(A,B,C){this._Panel.Show(A,B,C);};FCKTextColorCommand.prototype.SetColor=function(A){FCKUndo.SaveUndoStep();var B=FCKStyles.GetStyle('_FCK_'+(this.Type=='ForeColor'?'Color':'BackColor'));if (!A||A.length==0) FCK.Styles.RemoveStyle(B);else{B.SetVariable('Color',A);FCKStyles.ApplyStyle(B);};FCKUndo.SaveUndoStep();FCK.Focus();FCK.Events.FireEvent('OnSelectionChange');};FCKTextColorCommand.prototype.GetState=function(){if (FCK.EditMode!=0) return -1;return 0;};function FCKTextColorCommand_OnMouseOver(){this.className='ColorSelected';};function FCKTextColorCommand_OnMouseOut(){this.className='ColorDeselected';};function FCKTextColorCommand_OnClick(A,B,C){this.className='ColorDeselected';B.SetColor(C);B._Panel.Hide();};function FCKTextColorCommand_AutoOnClick(A,B){this.className='ColorDeselected';B.SetColor('');B._Panel.Hide();};function FCKTextColorCommand_MoreOnClick(A,B){this.className='ColorDeselected';B._Panel.Hide();FCKDialog.OpenDialog('FCKDialog_Color',FCKLang.DlgColorTitle,'dialog/fck_colorselector.html',410,320,FCKTools.Bind(B,B.SetColor));};FCKTextColorCommand.prototype._CreatePanelBody=function(A,B){function CreateSelectionDiv(){var C=A.createElement("DIV");C.className='ColorDeselected';FCKTools.AddEventListenerEx(C,'mouseover',FCKTextColorCommand_OnMouseOver);FCKTools.AddEventListenerEx(C,'mouseout',FCKTextColorCommand_OnMouseOut);return C;};var D=B.appendChild(A.createElement("TABLE"));D.className='ForceBaseFont';D.style.tableLayout='fixed';D.cellPadding=0;D.cellSpacing=0;D.border=0;D.width=150;var E=D.insertRow(-1).insertCell(-1);E.colSpan=8;var C=E.appendChild(CreateSelectionDiv());C.innerHTML='\n \n \n \n \n
        '+FCKLang.ColorAutomatic+'
        ';FCKTools.AddEventListenerEx(C,'click',FCKTextColorCommand_AutoOnClick,this);if (!FCKBrowserInfo.IsIE) C.style.width='96%';var G=FCKConfig.FontColors.toString().split(',');var H=0;while (H
        ';if (H>=G.length) C.style.visibility='hidden';else FCKTools.AddEventListenerEx(C,'click',FCKTextColorCommand_OnClick,[this,L]);}};if (FCKConfig.EnableMoreFontColors){E=D.insertRow(-1).insertCell(-1);E.colSpan=8;C=E.appendChild(CreateSelectionDiv());C.innerHTML='
        '+FCKLang.ColorMoreColors+'
        ';FCKTools.AddEventListenerEx(C,'click',FCKTextColorCommand_MoreOnClick,this);};if (!FCKBrowserInfo.IsIE) C.style.width='96%';}; +var FCKPastePlainTextCommand=function(){this.Name='PasteText';};FCKPastePlainTextCommand.prototype.Execute=function(){FCK.PasteAsPlainText();};FCKPastePlainTextCommand.prototype.GetState=function(){if (FCK.EditMode!=0) return -1;return FCK.GetNamedCommandState('Paste');}; +var FCKPasteWordCommand=function(){this.Name='PasteWord';};FCKPasteWordCommand.prototype.Execute=function(){FCK.PasteFromWord();};FCKPasteWordCommand.prototype.GetState=function(){if (FCK.EditMode!=0||FCKConfig.ForcePasteAsPlainText) return -1;else return FCK.GetNamedCommandState('Paste');}; +var FCKTableCommand=function(A){this.Name=A;};FCKTableCommand.prototype.Execute=function(){FCKUndo.SaveUndoStep();if (!FCKBrowserInfo.IsGecko){switch (this.Name){case 'TableMergeRight':return FCKTableHandler.MergeRight();case 'TableMergeDown':return FCKTableHandler.MergeDown();}};switch (this.Name){case 'TableInsertRowAfter':return FCKTableHandler.InsertRow(false);case 'TableInsertRowBefore':return FCKTableHandler.InsertRow(true);case 'TableDeleteRows':return FCKTableHandler.DeleteRows();case 'TableInsertColumnAfter':return FCKTableHandler.InsertColumn(false);case 'TableInsertColumnBefore':return FCKTableHandler.InsertColumn(true);case 'TableDeleteColumns':return FCKTableHandler.DeleteColumns();case 'TableInsertCellAfter':return FCKTableHandler.InsertCell(null,false);case 'TableInsertCellBefore':return FCKTableHandler.InsertCell(null,true);case 'TableDeleteCells':return FCKTableHandler.DeleteCells();case 'TableMergeCells':return FCKTableHandler.MergeCells();case 'TableHorizontalSplitCell':return FCKTableHandler.HorizontalSplitCell();case 'TableVerticalSplitCell':return FCKTableHandler.VerticalSplitCell();case 'TableDelete':return FCKTableHandler.DeleteTable();default:return alert(FCKLang.UnknownCommand.replace(/%1/g,this.Name));}};FCKTableCommand.prototype.GetState=function(){if (FCK.EditorDocument!=null&&FCKSelection.HasAncestorNode('TABLE')){switch (this.Name){case 'TableHorizontalSplitCell':case 'TableVerticalSplitCell':if (FCKTableHandler.GetSelectedCells().length==1) return 0;else return -1;case 'TableMergeCells':if (FCKTableHandler.CheckIsSelectionRectangular()&&FCKTableHandler.GetSelectedCells().length>1) return 0;else return -1;case 'TableMergeRight':return FCKTableHandler.GetMergeRightTarget()?0:-1;case 'TableMergeDown':return FCKTableHandler.GetMergeDownTarget()?0:-1;default:return 0;}}else return -1;}; +var FCKFitWindow=function(){this.Name='FitWindow';};FCKFitWindow.prototype.Execute=function(){var A=window.frameElement;var B=A.style;var C=parent;var D=C.document.documentElement;var E=C.document.body;var F=E.style;var G;if (!this.IsMaximized){if(FCKBrowserInfo.IsIE) C.attachEvent('onresize',FCKFitWindow_Resize);else C.addEventListener('resize',FCKFitWindow_Resize,true);this._ScrollPos=FCKTools.GetScrollPosition(C);G=A;while((G=G.parentNode)){if (G.nodeType==1){G._fckSavedStyles=FCKTools.SaveStyles(G);G.style.zIndex=FCKConfig.FloatingPanelsZIndex-1;}};if (FCKBrowserInfo.IsIE){this.documentElementOverflow=D.style.overflow;D.style.overflow='hidden';F.overflow='hidden';}else{F.overflow='hidden';F.width='0px';F.height='0px';};this._EditorFrameStyles=FCKTools.SaveStyles(A);var H=FCKTools.GetViewPaneSize(C);B.position="absolute";A.offsetLeft;B.zIndex=FCKConfig.FloatingPanelsZIndex-1;B.left="0px";B.top="0px";B.width=H.Width+"px";B.height=H.Height+"px";if (!FCKBrowserInfo.IsIE){B.borderRight=B.borderBottom="9999px solid white";B.backgroundColor="white";};C.scrollTo(0,0);var I=FCKTools.GetWindowPosition(C,A);if (I.x!=0) B.left=(-1*I.x)+"px";if (I.y!=0) B.top=(-1*I.y)+"px";this.IsMaximized=true;}else{if(FCKBrowserInfo.IsIE) C.detachEvent("onresize",FCKFitWindow_Resize);else C.removeEventListener("resize",FCKFitWindow_Resize,true);G=A;while((G=G.parentNode)){if (G._fckSavedStyles){FCKTools.RestoreStyles(G,G._fckSavedStyles);G._fckSavedStyles=null;}};if (FCKBrowserInfo.IsIE) D.style.overflow=this.documentElementOverflow;FCKTools.RestoreStyles(A,this._EditorFrameStyles);C.scrollTo(this._ScrollPos.X,this._ScrollPos.Y);this.IsMaximized=false;};FCKToolbarItems.GetItem('FitWindow').RefreshState();if (FCK.EditMode==0) FCK.EditingArea.MakeEditable();FCK.Focus();};FCKFitWindow.prototype.GetState=function(){if (FCKConfig.ToolbarLocation!='In') return -1;else return (this.IsMaximized?1:0);};function FCKFitWindow_Resize(){var A=FCKTools.GetViewPaneSize(parent);var B=window.frameElement.style;B.width=A.Width+'px';B.height=A.Height+'px';}; +var FCKListCommand=function(A,B){this.Name=A;this.TagName=B;};FCKListCommand.prototype={GetState:function(){if (FCK.EditMode!=0||!FCK.EditorWindow) return -1;var A=FCKSelection.GetBoundaryParentElement(true);var B=A;while (B){if (B.nodeName.IEquals(['ul','ol'])) break;B=B.parentNode;};if (B&&B.nodeName.IEquals(this.TagName)) return 1;else return 0;},Execute:function(){FCKUndo.SaveUndoStep();var A=FCK.EditorDocument;var B=new FCKDomRange(FCK.EditorWindow);B.MoveToSelection();var C=this.GetState();if (C==0){FCKDomTools.TrimNode(A.body);if (!A.body.firstChild){var D=A.createElement('p');A.body.appendChild(D);B.MoveToNodeContents(D);}};var E=B.CreateBookmark();var F=[];var G={};var H=new FCKDomRangeIterator(B);var I;H.ForceBrBreak=(C==0);var J=true;var K=null;while (J){while ((I=H.GetNextParagraph())){var L=new FCKElementPath(I);var M=null;var N=false;var O=L.BlockLimit;for (var i=L.Elements.length-1;i>=0;i--){var P=L.Elements[i];if (P.nodeName.IEquals(['ol','ul'])){if (O._FCK_ListGroupObject) O._FCK_ListGroupObject=null;var Q=P._FCK_ListGroupObject;if (Q) Q.contents.push(I);else{Q={ 'root':P,'contents':[I] };F.push(Q);FCKDomTools.SetElementMarker(G,P,'_FCK_ListGroupObject',Q);};N=true;break;}};if (N) continue;var R=O;if (R._FCK_ListGroupObject) R._FCK_ListGroupObject.contents.push(I);else{var Q={ 'root':R,'contents':[I] };FCKDomTools.SetElementMarker(G,R,'_FCK_ListGroupObject',Q);F.push(Q);}};if (FCKBrowserInfo.IsIE) J=false;else{if (K==null){K=[];var T=FCKSelection.GetSelection();if (T&&F.length==0) K.push(T.getRangeAt(0));for (var i=1;T&&i0){var Q=F.shift();if (C==0){if (Q.root.nodeName.IEquals(['ul','ol'])) this._ChangeListType(Q,G,W);else this._CreateList(Q,W);}else if (C==1&&Q.root.nodeName.IEquals(['ul','ol'])) this._RemoveList(Q,G);};for (var i=0;iC[i-1].indent+1){var H=C[i-1].indent+1-C[i].indent;var I=C[i].indent;while (C[i]&&C[i].indent>=I){C[i].indent+=H;i++;};i--;}};var J=FCKDomTools.ArrayToList(C,B);if (A.root.nextSibling==null||A.root.nextSibling.nodeName.IEquals('br')){if (J.listNode.lastChild.nodeName.IEquals('br')) J.listNode.removeChild(J.listNode.lastChild);};A.root.parentNode.replaceChild(J.listNode,A.root);}}; +var FCKJustifyCommand=function(A){this.AlignValue=A;var B=FCKConfig.ContentLangDirection.toLowerCase();this.IsDefaultAlign=(A=='left'&&B=='ltr')||(A=='right'&&B=='rtl');var C=this._CssClassName=(function(){var D=FCKConfig.JustifyClasses;if (D){switch (A){case 'left':return D[0]||null;case 'center':return D[1]||null;case 'right':return D[2]||null;case 'justify':return D[3]||null;}};return null;})();if (C&&C.length>0) this._CssClassRegex=new RegExp('(?:^|\\s+)'+C+'(?=$|\\s)');};FCKJustifyCommand._GetClassNameRegex=function(){var A=FCKJustifyCommand._ClassRegex;if (A!=undefined) return A;var B=[];var C=FCKConfig.JustifyClasses;if (C){for (var i=0;i<4;i++){var D=C[i];if (D&&D.length>0) B.push(D);}};if (B.length>0) A=new RegExp('(?:^|\\s+)(?:'+B.join('|')+')(?=$|\\s)');else A=null;return FCKJustifyCommand._ClassRegex=A;};FCKJustifyCommand.prototype={Execute:function(){FCKUndo.SaveUndoStep();var A=new FCKDomRange(FCK.EditorWindow);A.MoveToSelection();var B=this.GetState();if (B==-1) return;var C=A.CreateBookmark();var D=this._CssClassName;var E=new FCKDomRangeIterator(A);var F;while ((F=E.GetNextParagraph())){F.removeAttribute('align');if (D){var G=F.className.replace(FCKJustifyCommand._GetClassNameRegex(),'');if (B==0){if (G.length>0) G+=' ';F.className=G+D;}else if (G.length==0) FCKDomTools.RemoveAttribute(F,'class');}else{var H=F.style;if (B==0) H.textAlign=this.AlignValue;else{H.textAlign='';if (H.cssText.length==0) F.removeAttribute('style');}}};A.MoveToBookmark(C);A.Select();FCK.Focus();FCK.Events.FireEvent('OnSelectionChange');},GetState:function(){if (FCK.EditMode!=0||!FCK.EditorWindow) return -1;var A=new FCKElementPath(FCKSelection.GetBoundaryParentElement(true));var B=A.Block||A.BlockLimit;if (!B||B.nodeName.toLowerCase()=='body') return 0;var C;if (FCKBrowserInfo.IsIE) C=B.currentStyle.textAlign;else C=FCK.EditorWindow.getComputedStyle(B,'').getPropertyValue('text-align');C=C.replace(/(-moz-|-webkit-|start|auto)/i,'');if ((!C&&this.IsDefaultAlign)||C==this.AlignValue) return 1;return 0;}}; +var FCKIndentCommand=function(A,B){this.Name=A;this.Offset=B;this.IndentCSSProperty=FCKConfig.ContentLangDirection.IEquals('ltr')?'marginLeft':'marginRight';};FCKIndentCommand._InitIndentModeParameters=function(){if (FCKConfig.IndentClasses&&FCKConfig.IndentClasses.length>0){this._UseIndentClasses=true;this._IndentClassMap={};for (var i=0;i0?H+' ':'')+FCKConfig.IndentClasses[G-1];}else{var I=parseInt(E.style[this.IndentCSSProperty],10);if (isNaN(I)) I=0;I+=this.Offset;I=Math.max(I,0);I=Math.ceil(I/this.Offset)*this.Offset;E.style[this.IndentCSSProperty]=I?I+FCKConfig.IndentUnit:'';if (E.getAttribute('style')=='') E.removeAttribute('style');}}},_IndentList:function(A,B){var C=A.StartContainer;var D=A.EndContainer;while (C&&C.parentNode!=B) C=C.parentNode;while (D&&D.parentNode!=B) D=D.parentNode;if (!C||!D) return;var E=C;var F=[];var G=false;while (G==false){if (E==D) G=true;F.push(E);E=E.nextSibling;};if (F.length<1) return;var H=FCKDomTools.GetParents(B);for (var i=0;iN;i++) M[i].indent+=I;var O=FCKDomTools.ArrayToList(M);if (O) B.parentNode.replaceChild(O.listNode,B);FCKDomTools.ClearAllMarkers(L);}}; +var FCKBlockQuoteCommand=function(){};FCKBlockQuoteCommand.prototype={Execute:function(){FCKUndo.SaveUndoStep();var A=this.GetState();var B=new FCKDomRange(FCK.EditorWindow);B.MoveToSelection();var C=B.CreateBookmark();if (FCKBrowserInfo.IsIE){var D=B.GetBookmarkNode(C,true);var E=B.GetBookmarkNode(C,false);var F;if (D&&D.parentNode.nodeName.IEquals('blockquote')&&!D.previousSibling){F=D;while ((F=F.nextSibling)){if (FCKListsLib.BlockElements[F.nodeName.toLowerCase()]) FCKDomTools.MoveNode(D,F,true);}};if (E&&E.parentNode.nodeName.IEquals('blockquote')&&!E.previousSibling){F=E;while ((F=F.nextSibling)){if (FCKListsLib.BlockElements[F.nodeName.toLowerCase()]){if (F.firstChild==D) FCKDomTools.InsertAfterNode(D,E);else FCKDomTools.MoveNode(E,F,true);}}}};var G=new FCKDomRangeIterator(B);var H;if (A==0){G.EnforceRealBlocks=true;var I=[];while ((H=G.GetNextParagraph())) I.push(H);if (I.length<1){para=B.Window.document.createElement(FCKConfig.EnterMode.IEquals('p')?'p':'div');B.InsertNode(para);para.appendChild(B.Window.document.createTextNode('\ufeff'));B.MoveToBookmark(C);B.MoveToNodeContents(para);B.Collapse(true);C=B.CreateBookmark();I.push(para);};var J=I[0].parentNode;var K=[];for (var i=0;i0){H=I.shift();while (H.parentNode!=J) H=H.parentNode;if (H!=L) K.push(H);L=H;}while (K.length>0){H=K.shift();if (H.nodeName.IEquals('blockquote')){var M=FCKTools.GetElementDocument(H).createDocumentFragment();while (H.firstChild){M.appendChild(H.removeChild(H.firstChild));I.push(M.lastChild);};H.parentNode.replaceChild(M,H);}else I.push(H);};var N=B.Window.document.createElement('blockquote');J.insertBefore(N,I[0]);while (I.length>0){H=I.shift();N.appendChild(H);}}else if (A==1){var O=[];while ((H=G.GetNextParagraph())){var P=null;var Q=null;while (H.parentNode){if (H.parentNode.nodeName.IEquals('blockquote')){P=H.parentNode;Q=H;break;};H=H.parentNode;};if (P&&Q) O.push(Q);};var R=[];while (O.length>0){var S=O.shift();var N=S.parentNode;if (S==S.parentNode.firstChild){N.parentNode.insertBefore(N.removeChild(S),N);if (!N.firstChild) N.parentNode.removeChild(N);}else if (S==S.parentNode.lastChild){N.parentNode.insertBefore(N.removeChild(S),N.nextSibling);if (!N.firstChild) N.parentNode.removeChild(N);}else FCKDomTools.BreakParent(S,S.parentNode,B);R.push(S);};if (FCKConfig.EnterMode.IEquals('br')){while (R.length){var S=R.shift();var W=true;if (S.nodeName.IEquals('div')){var M=FCKTools.GetElementDocument(S).createDocumentFragment();var Y=W&&S.previousSibling&&!FCKListsLib.BlockBoundaries[S.previousSibling.nodeName.toLowerCase()];if (W&&Y) M.appendChild(FCKTools.GetElementDocument(S).createElement('br'));var Z=S.nextSibling&&!FCKListsLib.BlockBoundaries[S.nextSibling.nodeName.toLowerCase()];while (S.firstChild) M.appendChild(S.removeChild(S.firstChild));if (Z) M.appendChild(FCKTools.GetElementDocument(S).createElement('br'));S.parentNode.replaceChild(M,S);W=false;}}}};B.MoveToBookmark(C);B.Select();FCK.Focus();FCK.Events.FireEvent('OnSelectionChange');},GetState:function(){if (FCK.EditMode!=0||!FCK.EditorWindow) return -1;var A=new FCKElementPath(FCKSelection.GetBoundaryParentElement(true));var B=A.Block||A.BlockLimit;if (!B||B.nodeName.toLowerCase()=='body') return 0;for (var i=0;i';B.open();B.write(''+F+'<\/head><\/body><\/html>');B.close();if(FCKBrowserInfo.IsAIR) FCKAdobeAIR.Panel_Contructor(B,window.document.location);FCKTools.AddEventListenerEx(E,'focus',FCKPanel_Window_OnFocus,this);FCKTools.AddEventListenerEx(E,'blur',FCKPanel_Window_OnBlur,this);};B.dir=FCKLang.Dir;FCKTools.AddEventListener(B,'contextmenu',FCKTools.CancelEvent);this.MainNode=B.body.appendChild(B.createElement('DIV'));this.MainNode.style.cssFloat=this.IsRTL?'right':'left';};FCKPanel.prototype.AppendStyleSheet=function(A){FCKTools.AppendStyleSheet(this.Document,A);};FCKPanel.prototype.Preload=function(x,y,A){if (this._Popup) this._Popup.show(x,y,0,0,A);};FCKPanel.prototype.Show=function(x,y,A,B,C){var D;var E=this.MainNode;if (this._Popup){this._Popup.show(x,y,0,0,A);FCKDomTools.SetElementStyles(E,{B:B?B+'px':'',C:C?C+'px':''});D=E.offsetWidth;if (this.IsRTL){if (this.IsContextMenu) x=x-D+1;else if (A) x=(x*-1)+A.offsetWidth-D;};this._Popup.show(x,y,D,E.offsetHeight,A);if (this.OnHide){if (this._Timer) CheckPopupOnHide.call(this,true);this._Timer=FCKTools.SetInterval(CheckPopupOnHide,100,this);}}else{if (typeof(FCK.ToolbarSet.CurrentInstance.FocusManager)!='undefined') FCK.ToolbarSet.CurrentInstance.FocusManager.Lock();if (this.ParentPanel){this.ParentPanel.Lock();FCKPanel_Window_OnBlur(null,this.ParentPanel);};if (FCKBrowserInfo.IsGecko&&FCKBrowserInfo.IsMac){this._IFrame.scrolling='';FCKTools.RunFunction(function(){ this._IFrame.scrolling='no';},this);};if (FCK.ToolbarSet.CurrentInstance.GetInstanceObject('FCKPanel')._OpenedPanel&&FCK.ToolbarSet.CurrentInstance.GetInstanceObject('FCKPanel')._OpenedPanel!=this) FCK.ToolbarSet.CurrentInstance.GetInstanceObject('FCKPanel')._OpenedPanel.Hide(false,true);FCKDomTools.SetElementStyles(E,{B:B?B+'px':'',C:C?C+'px':''});D=E.offsetWidth;if (!B) this._IFrame.width=1;if (!C) this._IFrame.height=1;D=E.offsetWidth||E.firstChild.offsetWidth;var F=FCKTools.GetDocumentPosition(this._Window,A.nodeType==9?(FCKTools.IsStrictMode(A)?A.documentElement:A.body):A);var G=FCKDomTools.GetPositionedAncestor(this._IFrame.parentNode);if (G){var H=FCKTools.GetDocumentPosition(FCKTools.GetElementWindow(G),G);F.x-=H.x;F.y-=H.y;};if (this.IsRTL&&!this.IsContextMenu) x=(x*-1);x+=F.x;y+=F.y;if (this.IsRTL){if (this.IsContextMenu) x=x-D+1;else if (A) x=x+A.offsetWidth-D;}else{var I=FCKTools.GetViewPaneSize(this._Window);var J=FCKTools.GetScrollPosition(this._Window);var K=I.Height+J.Y;var L=I.Width+J.X;if ((x+D)>L) x-=x+D-L;if ((y+E.offsetHeight)>K) y-=y+E.offsetHeight-K;};FCKDomTools.SetElementStyles(this._IFrame,{left:x+'px',top:y+'px'});this._IFrame.contentWindow.focus();this._IsOpened=true;var M=this;this._resizeTimer=setTimeout(function(){var N=E.offsetWidth||E.firstChild.offsetWidth;var O=E.offsetHeight;M._IFrame.style.width=N+'px';M._IFrame.style.height=O+'px';},0);FCK.ToolbarSet.CurrentInstance.GetInstanceObject('FCKPanel')._OpenedPanel=this;};FCKTools.RunFunction(this.OnShow,this);};FCKPanel.prototype.Hide=function(A,B){if (this._Popup) this._Popup.hide();else{if (!this._IsOpened||this._LockCounter>0) return;if (typeof(FCKFocusManager)!='undefined'&&!B) FCKFocusManager.Unlock();this._IFrame.style.width=this._IFrame.style.height='0px';this._IsOpened=false;if (this._resizeTimer){clearTimeout(this._resizeTimer);this._resizeTimer=null;};if (this.ParentPanel) this.ParentPanel.Unlock();if (!A) FCKTools.RunFunction(this.OnHide,this);}};FCKPanel.prototype.CheckIsOpened=function(){if (this._Popup) return this._Popup.isOpen;else return this._IsOpened;};FCKPanel.prototype.CreateChildPanel=function(){var A=this._Popup?FCKTools.GetDocumentWindow(this.Document):this._Window;var B=new FCKPanel(A);B.ParentPanel=this;return B;};FCKPanel.prototype.Lock=function(){this._LockCounter++;};FCKPanel.prototype.Unlock=function(){if (--this._LockCounter==0&&!this.HasFocus) this.Hide();};function FCKPanel_Window_OnFocus(e,A){A.HasFocus=true;};function FCKPanel_Window_OnBlur(e,A){A.HasFocus=false;if (A._LockCounter==0) FCKTools.RunFunction(A.Hide,A);};function CheckPopupOnHide(A){if (A||!this._Popup.isOpen){window.clearInterval(this._Timer);this._Timer=null;FCKTools.RunFunction(this.OnHide,this);}};function FCKPanel_Cleanup(){this._Popup=null;this._Window=null;this.Document=null;this.MainNode=null;}; +var FCKIcon=function(A){var B=A?typeof(A):'undefined';switch (B){case 'number':this.Path=FCKConfig.SkinPath+'fck_strip.gif';this.Size=16;this.Position=A;break;case 'undefined':this.Path=FCK_SPACER_PATH;break;case 'string':this.Path=A;break;default:this.Path=A[0];this.Size=A[1];this.Position=A[2];}};FCKIcon.prototype.CreateIconElement=function(A){var B,eIconImage;if (this.Position){var C='-'+((this.Position-1)*this.Size)+'px';if (FCKBrowserInfo.IsIE){B=A.createElement('DIV');eIconImage=B.appendChild(A.createElement('IMG'));eIconImage.src=this.Path;eIconImage.style.top=C;}else{B=A.createElement('IMG');B.src=FCK_SPACER_PATH;B.style.backgroundPosition='0px '+C;B.style.backgroundImage='url("'+this.Path+'")';}}else{if (FCKBrowserInfo.IsIE){B=A.createElement('DIV');eIconImage=B.appendChild(A.createElement('IMG'));eIconImage.src=this.Path?this.Path:FCK_SPACER_PATH;}else{B=A.createElement('IMG');B.src=this.Path?this.Path:FCK_SPACER_PATH;}};B.className='TB_Button_Image';return B;}; +var FCKToolbarButtonUI=function(A,B,C,D,E,F){this.Name=A;this.Label=B||A;this.Tooltip=C||this.Label;this.Style=E||0;this.State=F||0;this.Icon=new FCKIcon(D);if (FCK.IECleanup) FCK.IECleanup.AddItem(this,FCKToolbarButtonUI_Cleanup);};FCKToolbarButtonUI.prototype._CreatePaddingElement=function(A){var B=A.createElement('IMG');B.className='TB_Button_Padding';B.src=FCK_SPACER_PATH;return B;};FCKToolbarButtonUI.prototype.Create=function(A){var B=FCKTools.GetElementDocument(A);var C=this.MainElement=B.createElement('DIV');C.title=this.Tooltip;if (FCKBrowserInfo.IsGecko) C.onmousedown=FCKTools.CancelEvent;FCKTools.AddEventListenerEx(C,'mouseover',FCKToolbarButtonUI_OnMouseOver,this);FCKTools.AddEventListenerEx(C,'mouseout',FCKToolbarButtonUI_OnMouseOut,this);FCKTools.AddEventListenerEx(C,'click',FCKToolbarButtonUI_OnClick,this);this.ChangeState(this.State,true);if (this.Style==0&&!this.ShowArrow){C.appendChild(this.Icon.CreateIconElement(B));}else{var D=C.appendChild(B.createElement('TABLE'));D.cellPadding=0;D.cellSpacing=0;var E=D.insertRow(-1);var F=E.insertCell(-1);if (this.Style==0||this.Style==2) F.appendChild(this.Icon.CreateIconElement(B));else F.appendChild(this._CreatePaddingElement(B));if (this.Style==1||this.Style==2){F=E.insertCell(-1);F.className='TB_Button_Text';F.noWrap=true;F.appendChild(B.createTextNode(this.Label));};if (this.ShowArrow){if (this.Style!=0){E.insertCell(-1).appendChild(this._CreatePaddingElement(B));};F=E.insertCell(-1);var G=F.appendChild(B.createElement('IMG'));G.src=FCKConfig.SkinPath+'images/toolbar.buttonarrow.gif';G.width=5;G.height=3;};F=E.insertCell(-1);F.appendChild(this._CreatePaddingElement(B));};A.appendChild(C);};FCKToolbarButtonUI.prototype.ChangeState=function(A,B){if (!B&&this.State==A) return;var e=this.MainElement;if (!e) return;switch (parseInt(A,10)){case 0:e.className='TB_Button_Off';break;case 1:e.className='TB_Button_On';break;case -1:e.className='TB_Button_Disabled';break;};this.State=A;};function FCKToolbarButtonUI_OnMouseOver(A,B){if (B.State==0) this.className='TB_Button_Off_Over';else if (B.State==1) this.className='TB_Button_On_Over';};function FCKToolbarButtonUI_OnMouseOut(A,B){if (B.State==0) this.className='TB_Button_Off';else if (B.State==1) this.className='TB_Button_On';};function FCKToolbarButtonUI_OnClick(A,B){if (B.OnClick&&B.State!=-1) B.OnClick(B);};function FCKToolbarButtonUI_Cleanup(){this.MainElement=null;}; +var FCKToolbarButton=function(A,B,C,D,E,F,G){this.CommandName=A;this.Label=B;this.Tooltip=C;this.Style=D;this.SourceView=E?true:false;this.ContextSensitive=F?true:false;if (G==null) this.IconPath=FCKConfig.SkinPath+'toolbar/'+A.toLowerCase()+'.gif';else if (typeof(G)=='number') this.IconPath=[FCKConfig.SkinPath+'fck_strip.gif',16,G];else this.IconPath=G;};FCKToolbarButton.prototype.Create=function(A){this._UIButton=new FCKToolbarButtonUI(this.CommandName,this.Label,this.Tooltip,this.IconPath,this.Style);this._UIButton.OnClick=this.Click;this._UIButton._ToolbarButton=this;this._UIButton.Create(A);};FCKToolbarButton.prototype.RefreshState=function(){var A=this._UIButton;if (!A) return;var B=FCK.ToolbarSet.CurrentInstance.Commands.GetCommand(this.CommandName).GetState();if (B==A.State) return;A.ChangeState(B);};FCKToolbarButton.prototype.Click=function(){var A=this._ToolbarButton||this;FCK.ToolbarSet.CurrentInstance.Commands.GetCommand(A.CommandName).Execute();};FCKToolbarButton.prototype.Enable=function(){this.RefreshState();};FCKToolbarButton.prototype.Disable=function(){this._UIButton.ChangeState(-1);}; +var FCKSpecialCombo=function(A,B,C,D,E){this.FieldWidth=B||100;this.PanelWidth=C||150;this.PanelMaxHeight=D||150;this.Label=' ';this.Caption=A;this.Tooltip=A;this.Style=2;this.Enabled=true;this.Items={};this._Panel=new FCKPanel(E||window);this._Panel.AppendStyleSheet(FCKConfig.SkinEditorCSS);this._PanelBox=this._Panel.MainNode.appendChild(this._Panel.Document.createElement('DIV'));this._PanelBox.className='SC_Panel';this._PanelBox.style.width=this.PanelWidth+'px';this._PanelBox.innerHTML='
        ';this._ItemsHolderEl=this._PanelBox.getElementsByTagName('TD')[0];if (FCK.IECleanup) FCK.IECleanup.AddItem(this,FCKSpecialCombo_Cleanup);};function FCKSpecialCombo_ItemOnMouseOver(){this.className+=' SC_ItemOver';};function FCKSpecialCombo_ItemOnMouseOut(){this.className=this.originalClass;};function FCKSpecialCombo_ItemOnClick(A,B,C){this.className=this.originalClass;B._Panel.Hide();B.SetLabel(this.FCKItemLabel);if (typeof(B.OnSelect)=='function') B.OnSelect(C,this);};FCKSpecialCombo.prototype.ClearItems=function (){if (this.Items) this.Items={};var A=this._ItemsHolderEl;while (A.firstChild) A.removeChild(A.firstChild);};FCKSpecialCombo.prototype.AddItem=function(A,B,C,D){var E=this._ItemsHolderEl.appendChild(this._Panel.Document.createElement('DIV'));E.className=E.originalClass='SC_Item';E.innerHTML=B;E.FCKItemLabel=C||A;E.Selected=false;if (FCKBrowserInfo.IsIE) E.style.width='100%';if (D) E.style.backgroundColor=D;FCKTools.AddEventListenerEx(E,'mouseover',FCKSpecialCombo_ItemOnMouseOver);FCKTools.AddEventListenerEx(E,'mouseout',FCKSpecialCombo_ItemOnMouseOut);FCKTools.AddEventListenerEx(E,'click',FCKSpecialCombo_ItemOnClick,[this,A]);this.Items[A.toString().toLowerCase()]=E;return E;};FCKSpecialCombo.prototype.SelectItem=function(A){if (typeof A=='string') A=this.Items[A.toString().toLowerCase()];if (A){A.className=A.originalClass='SC_ItemSelected';A.Selected=true;}};FCKSpecialCombo.prototype.SelectItemByLabel=function(A,B){for (var C in this.Items){var D=this.Items[C];if (D.FCKItemLabel==A){D.className=D.originalClass='SC_ItemSelected';D.Selected=true;if (B) this.SetLabel(A);}}};FCKSpecialCombo.prototype.DeselectAll=function(A){for (var i in this.Items){if (!this.Items[i]) continue;this.Items[i].className=this.Items[i].originalClass='SC_Item';this.Items[i].Selected=false;};if (A) this.SetLabel('');};FCKSpecialCombo.prototype.SetLabelById=function(A){A=A?A.toString().toLowerCase():'';var B=this.Items[A];this.SetLabel(B?B.FCKItemLabel:'');};FCKSpecialCombo.prototype.SetLabel=function(A){A=(!A||A.length==0)?' ':A;if (A==this.Label) return;this.Label=A;var B=this._LabelEl;if (B){B.innerHTML=A;FCKTools.DisableSelection(B);}};FCKSpecialCombo.prototype.SetEnabled=function(A){this.Enabled=A;if (this._OuterTable) this._OuterTable.className=A?'':'SC_FieldDisabled';};FCKSpecialCombo.prototype.Create=function(A){var B=FCKTools.GetElementDocument(A);var C=this._OuterTable=A.appendChild(B.createElement('TABLE'));C.cellPadding=0;C.cellSpacing=0;C.insertRow(-1);var D;var E;switch (this.Style){case 0:D='TB_ButtonType_Icon';E=false;break;case 1:D='TB_ButtonType_Text';E=false;break;case 2:E=true;break;};if (this.Caption&&this.Caption.length>0&&E){var F=C.rows[0].insertCell(-1);F.innerHTML=this.Caption;F.className='SC_FieldCaption';};var G=FCKTools.AppendElement(C.rows[0].insertCell(-1),'div');if (E){G.className='SC_Field';G.style.width=this.FieldWidth+'px';G.innerHTML='
         
        ';this._LabelEl=G.getElementsByTagName('label')[0];this._LabelEl.innerHTML=this.Label;}else{G.className='TB_Button_Off';G.innerHTML='
        '+this.Caption+'
        ';};FCKTools.AddEventListenerEx(G,'mouseover',FCKSpecialCombo_OnMouseOver,this);FCKTools.AddEventListenerEx(G,'mouseout',FCKSpecialCombo_OnMouseOut,this);FCKTools.AddEventListenerEx(G,'click',FCKSpecialCombo_OnClick,this);FCKTools.DisableSelection(this._Panel.Document.body);};function FCKSpecialCombo_Cleanup(){this._LabelEl=null;this._OuterTable=null;this._ItemsHolderEl=null;this._PanelBox=null;if (this.Items){for (var A in this.Items) this.Items[A]=null;}};function FCKSpecialCombo_OnMouseOver(A,B){if (B.Enabled){switch (B.Style){case 0:this.className='TB_Button_On_Over';break;case 1:this.className='TB_Button_On_Over';break;case 2:this.className='SC_Field SC_FieldOver';break;}}};function FCKSpecialCombo_OnMouseOut(A,B){switch (B.Style){case 0:this.className='TB_Button_Off';break;case 1:this.className='TB_Button_Off';break;case 2:this.className='SC_Field';break;}};function FCKSpecialCombo_OnClick(e,A){if (A.Enabled){var B=A._Panel;var C=A._PanelBox;var D=A._ItemsHolderEl;var E=A.PanelMaxHeight;if (A.OnBeforeClick) A.OnBeforeClick(A);if (FCKBrowserInfo.IsIE) B.Preload(0,this.offsetHeight,this);if (D.offsetHeight>E) C.style.height=E+'px';else C.style.height='';B.Show(0,this.offsetHeight,this);}}; +var FCKToolbarSpecialCombo=function(){this.SourceView=false;this.ContextSensitive=true;this.FieldWidth=null;this.PanelWidth=null;this.PanelMaxHeight=null;};FCKToolbarSpecialCombo.prototype.DefaultLabel='';function FCKToolbarSpecialCombo_OnSelect(A,B){FCK.ToolbarSet.CurrentInstance.Commands.GetCommand(this.CommandName).Execute(A,B);};FCKToolbarSpecialCombo.prototype.Create=function(A){this._Combo=new FCKSpecialCombo(this.GetLabel(),this.FieldWidth,this.PanelWidth,this.PanelMaxHeight,FCKBrowserInfo.IsIE?window:FCKTools.GetElementWindow(A).parent);this._Combo.Tooltip=this.Tooltip;this._Combo.Style=this.Style;this.CreateItems(this._Combo);this._Combo.Create(A);this._Combo.CommandName=this.CommandName;this._Combo.OnSelect=FCKToolbarSpecialCombo_OnSelect;};function FCKToolbarSpecialCombo_RefreshActiveItems(A,B){A.DeselectAll();A.SelectItem(B);A.SetLabelById(B);};FCKToolbarSpecialCombo.prototype.RefreshState=function(){var A;var B=FCK.ToolbarSet.CurrentInstance.Commands.GetCommand(this.CommandName).GetState();if (B!=-1){A=1;if (this.RefreshActiveItems) this.RefreshActiveItems(this._Combo,B);else{if (this._LastValue!==B){this._LastValue=B;if (!B||B.length==0){this._Combo.DeselectAll();this._Combo.SetLabel(this.DefaultLabel);}else FCKToolbarSpecialCombo_RefreshActiveItems(this._Combo,B);}}}else A=-1;if (A==this.State) return;if (A==-1){this._Combo.DeselectAll();this._Combo.SetLabel('');};this.State=A;this._Combo.SetEnabled(A!=-1);};FCKToolbarSpecialCombo.prototype.Enable=function(){this.RefreshState();};FCKToolbarSpecialCombo.prototype.Disable=function(){this.State=-1;this._Combo.DeselectAll();this._Combo.SetLabel('');this._Combo.SetEnabled(false);}; +var FCKToolbarStyleCombo=function(A,B){if (A===false) return;this.CommandName='Style';this.Label=this.GetLabel();this.Tooltip=A?A:this.Label;this.Style=B?B:2;this.DefaultLabel=FCKConfig.DefaultStyleLabel||'';};FCKToolbarStyleCombo.prototype=new FCKToolbarSpecialCombo;FCKToolbarStyleCombo.prototype.GetLabel=function(){return FCKLang.Style;};FCKToolbarStyleCombo.prototype.GetStyles=function(){var A={};var B=FCK.ToolbarSet.CurrentInstance.Styles.GetStyles();for (var C in B){var D=B[C];if (!D.IsCore) A[C]=D;};return A;};FCKToolbarStyleCombo.prototype.CreateItems=function(A){var B=A._Panel.Document;FCKTools.AppendStyleSheet(B,FCKConfig.ToolbarComboPreviewCSS);FCKTools.AppendStyleString(B,FCKConfig.EditorAreaStyles);B.body.className+=' ForceBaseFont';FCKConfig.ApplyBodyAttributes(B.body);var C=this.GetStyles();for (var D in C){var E=C[D];var F=E.GetType()==2?D:FCKToolbarStyleCombo_BuildPreview(E,E.Label||D);var G=A.AddItem(D,F);G.Style=E;};A.OnBeforeClick=this.StyleCombo_OnBeforeClick;};FCKToolbarStyleCombo.prototype.RefreshActiveItems=function(A){var B=FCK.ToolbarSet.CurrentInstance.Selection.GetBoundaryParentElement(true);if (B){var C=new FCKElementPath(B);var D=C.Elements;for (var e=0;e');var E=A.Element;if (E=='bdo') E='span';D=['<',E];var F=A._StyleDesc.Attributes;if (F){for (var G in F){D.push(' ',G,'="',A.GetFinalAttributeValue(G),'"');}};if (A._GetStyleText().length>0) D.push(' style="',A.GetFinalStyleValue(),'"');D.push('>',B,'');if (C==0) D.push('');return D.join('');}; +var FCKToolbarFontFormatCombo=function(A,B){if (A===false) return;this.CommandName='FontFormat';this.Label=this.GetLabel();this.Tooltip=A?A:this.Label;this.Style=B?B:2;this.NormalLabel='Normal';this.PanelWidth=190;this.DefaultLabel=FCKConfig.DefaultFontFormatLabel||'';};FCKToolbarFontFormatCombo.prototype=new FCKToolbarStyleCombo(false);FCKToolbarFontFormatCombo.prototype.GetLabel=function(){return FCKLang.FontFormat;};FCKToolbarFontFormatCombo.prototype.GetStyles=function(){var A={};var B=FCKLang['FontFormats'].split(';');var C={p:B[0],pre:B[1],address:B[2],h1:B[3],h2:B[4],h3:B[5],h4:B[6],h5:B[7],h6:B[8],div:B[9]||(B[0]+' (DIV)')};var D=FCKConfig.FontFormats.split(';');for (var i=0;i';G.open();G.write(''+H+''+document.getElementById('xToolbarSpace').innerHTML+'');G.close();if(FCKBrowserInfo.IsAIR) FCKAdobeAIR.ToolbarSet_InitOutFrame(G);FCKTools.AddEventListener(G,'contextmenu',FCKTools.CancelEvent);FCKTools.AppendStyleSheet(G,FCKConfig.SkinEditorCSS);B=D.__FCKToolbarSet=new FCKToolbarSet(G);B._IFrame=F;if (FCK.IECleanup) FCK.IECleanup.AddItem(D,FCKToolbarSet_Target_Cleanup);};B.CurrentInstance=FCK;if (!B.ToolbarItems) B.ToolbarItems=FCKToolbarItems;FCK.AttachToOnSelectionChange(B.RefreshItemsState);return B;};function FCK_OnBlur(A){var B=A.ToolbarSet;if (B.CurrentInstance==A) B.Disable();};function FCK_OnFocus(A){var B=A.ToolbarSet;var C=A||FCK;B.CurrentInstance.FocusManager.RemoveWindow(B._IFrame.contentWindow);B.CurrentInstance=C;C.FocusManager.AddWindow(B._IFrame.contentWindow,true);B.Enable();};function FCKToolbarSet_Cleanup(){this._TargetElement=null;this._IFrame=null;};function FCKToolbarSet_Target_Cleanup(){this.__FCKToolbarSet=null;};var FCKToolbarSet=function(A){this._Document=A;this._TargetElement=A.getElementById('xToolbar');var B=A.getElementById('xExpandHandle');var C=A.getElementById('xCollapseHandle');B.title=FCKLang.ToolbarExpand;FCKTools.AddEventListener(B,'click',FCKToolbarSet_Expand_OnClick);C.title=FCKLang.ToolbarCollapse;FCKTools.AddEventListener(C,'click',FCKToolbarSet_Collapse_OnClick);if (!FCKConfig.ToolbarCanCollapse||FCKConfig.ToolbarStartExpanded) this.Expand();else this.Collapse();C.style.display=FCKConfig.ToolbarCanCollapse?'':'none';if (FCKConfig.ToolbarCanCollapse) C.style.display='';else A.getElementById('xTBLeftBorder').style.display='';this.Toolbars=[];this.IsLoaded=false;if (FCK.IECleanup) FCK.IECleanup.AddItem(this,FCKToolbarSet_Cleanup);};function FCKToolbarSet_Expand_OnClick(){FCK.ToolbarSet.Expand();};function FCKToolbarSet_Collapse_OnClick(){FCK.ToolbarSet.Collapse();};FCKToolbarSet.prototype.Expand=function(){this._ChangeVisibility(false);};FCKToolbarSet.prototype.Collapse=function(){this._ChangeVisibility(true);};FCKToolbarSet.prototype._ChangeVisibility=function(A){this._Document.getElementById('xCollapsed').style.display=A?'':'none';this._Document.getElementById('xExpanded').style.display=A?'none':'';if (FCKBrowserInfo.IsGecko){FCKTools.RunFunction(window.onresize);}};FCKToolbarSet.prototype.Load=function(A){this.Name=A;this.Items=[];this.ItemsWysiwygOnly=[];this.ItemsContextSensitive=[];this._TargetElement.innerHTML='';var B=FCKConfig.ToolbarSets[A];if (!B){alert(FCKLang.UnknownToolbarSet.replace(/%1/g,A));return;};this.Toolbars=[];for (var x=0;x0) break;}catch (e){break;};D=D.parent;};var E=D.document;var F=function(){if (!B) B=FCKConfig.FloatingPanelsZIndex+999;return++B;};var G=function(){if (!C) return;var H=FCKTools.IsStrictMode(E)?E.documentElement:E.body;FCKDomTools.SetElementStyles(C,{'width':Math.max(H.scrollWidth,H.clientWidth,E.scrollWidth||0)-1+'px','height':Math.max(H.scrollHeight,H.clientHeight,E.scrollHeight||0)-1+'px'});};return {OpenDialog:function(dialogName,dialogTitle,dialogPage,width,height,customValue,parentWindow,resizable){if (!A) this.DisplayMainCover();var I={Title:dialogTitle,Page:dialogPage,Editor:window,CustomValue:customValue,TopWindow:D};FCK.ToolbarSet.CurrentInstance.Selection.Save();var J=FCKTools.GetViewPaneSize(D);var K={ 'X':0,'Y':0 };var L=FCKBrowserInfo.IsIE&&(!FCKBrowserInfo.IsIE7||!FCKTools.IsStrictMode(D.document));if (L) K=FCKTools.GetScrollPosition(D);var M=Math.max(K.Y+(J.Height-height-20)/2,0);var N=Math.max(K.X+(J.Width-width-20)/2,0);var O=E.createElement('iframe');FCKTools.ResetStyles(O);O.src=FCKConfig.BasePath+'fckdialog.html';O.frameBorder=0;O.allowTransparency=true;FCKDomTools.SetElementStyles(O,{'position':(L)?'absolute':'fixed','top':M+'px','left':N+'px','width':width+'px','height':height+'px','zIndex':F()});O._DialogArguments=I;E.body.appendChild(O);O._ParentDialog=A;A=O;},OnDialogClose:function(dialogWindow){var O=dialogWindow.frameElement;FCKDomTools.RemoveNode(O);if (O._ParentDialog){A=O._ParentDialog;O._ParentDialog.contentWindow.SetEnabled(true);}else{if (!FCKBrowserInfo.IsIE) FCK.Focus();this.HideMainCover();setTimeout(function(){ A=null;},0);FCK.ToolbarSet.CurrentInstance.Selection.Release();}},DisplayMainCover:function(){C=E.createElement('div');FCKTools.ResetStyles(C);FCKDomTools.SetElementStyles(C,{'position':'absolute','zIndex':F(),'top':'0px','left':'0px','backgroundColor':FCKConfig.BackgroundBlockerColor});FCKDomTools.SetOpacity(C,FCKConfig.BackgroundBlockerOpacity);if (FCKBrowserInfo.IsIE&&!FCKBrowserInfo.IsIE7){var Q=E.createElement('iframe');FCKTools.ResetStyles(Q);Q.hideFocus=true;Q.frameBorder=0;Q.src=FCKTools.GetVoidUrl();FCKDomTools.SetElementStyles(Q,{'width':'100%','height':'100%','position':'absolute','left':'0px','top':'0px','filter':'progid:DXImageTransform.Microsoft.Alpha(opacity=0)'});C.appendChild(Q);};FCKTools.AddEventListener(D,'resize',G);G();E.body.appendChild(C);FCKFocusManager.Lock();var R=FCK.ToolbarSet.CurrentInstance.GetInstanceObject('frameElement');R._fck_originalTabIndex=R.tabIndex;R.tabIndex=-1;},HideMainCover:function(){FCKDomTools.RemoveNode(C);FCKFocusManager.Unlock();var R=FCK.ToolbarSet.CurrentInstance.GetInstanceObject('frameElement');R.tabIndex=R._fck_originalTabIndex;FCKDomTools.ClearElementJSProperty(R,'_fck_originalTabIndex');},GetCover:function(){return C;}};})(); +var FCKMenuItem=function(A,B,C,D,E,F){this.Name=B;this.Label=C||B;this.IsDisabled=E;this.Icon=new FCKIcon(D);this.SubMenu=new FCKMenuBlockPanel();this.SubMenu.Parent=A;this.SubMenu.OnClick=FCKTools.CreateEventListener(FCKMenuItem_SubMenu_OnClick,this);this.CustomData=F;if (FCK.IECleanup) FCK.IECleanup.AddItem(this,FCKMenuItem_Cleanup);};FCKMenuItem.prototype.AddItem=function(A,B,C,D,E){this.HasSubMenu=true;return this.SubMenu.AddItem(A,B,C,D,E);};FCKMenuItem.prototype.AddSeparator=function(){this.SubMenu.AddSeparator();};FCKMenuItem.prototype.Create=function(A){var B=this.HasSubMenu;var C=FCKTools.GetElementDocument(A);var r=this.MainElement=A.insertRow(-1);r.className=this.IsDisabled?'MN_Item_Disabled':'MN_Item';if (!this.IsDisabled){FCKTools.AddEventListenerEx(r,'mouseover',FCKMenuItem_OnMouseOver,[this]);FCKTools.AddEventListenerEx(r,'click',FCKMenuItem_OnClick,[this]);if (!B) FCKTools.AddEventListenerEx(r,'mouseout',FCKMenuItem_OnMouseOut,[this]);};var D=r.insertCell(-1);D.className='MN_Icon';D.appendChild(this.Icon.CreateIconElement(C));D=r.insertCell(-1);D.className='MN_Label';D.noWrap=true;D.appendChild(C.createTextNode(this.Label));D=r.insertCell(-1);if (B){D.className='MN_Arrow';var E=D.appendChild(C.createElement('IMG'));E.src=FCK_IMAGES_PATH+'arrow_'+FCKLang.Dir+'.gif';E.width=4;E.height=7;this.SubMenu.Create();this.SubMenu.Panel.OnHide=FCKTools.CreateEventListener(FCKMenuItem_SubMenu_OnHide,this);}};FCKMenuItem.prototype.Activate=function(){this.MainElement.className='MN_Item_Over';if (this.HasSubMenu){this.SubMenu.Show(this.MainElement.offsetWidth+2,-2,this.MainElement);};FCKTools.RunFunction(this.OnActivate,this);};FCKMenuItem.prototype.Deactivate=function(){this.MainElement.className='MN_Item';if (this.HasSubMenu) this.SubMenu.Hide();};function FCKMenuItem_SubMenu_OnClick(A,B){FCKTools.RunFunction(B.OnClick,B,[A]);};function FCKMenuItem_SubMenu_OnHide(A){A.Deactivate();};function FCKMenuItem_OnClick(A,B){if (B.HasSubMenu) B.Activate();else{B.Deactivate();FCKTools.RunFunction(B.OnClick,B,[B]);}};function FCKMenuItem_OnMouseOver(A,B){B.Activate();};function FCKMenuItem_OnMouseOut(A,B){B.Deactivate();};function FCKMenuItem_Cleanup(){this.MainElement=null;}; +var FCKMenuBlock=function(){this._Items=[];};FCKMenuBlock.prototype.Count=function(){return this._Items.length;};FCKMenuBlock.prototype.AddItem=function(A,B,C,D,E){var F=new FCKMenuItem(this,A,B,C,D,E);F.OnClick=FCKTools.CreateEventListener(FCKMenuBlock_Item_OnClick,this);F.OnActivate=FCKTools.CreateEventListener(FCKMenuBlock_Item_OnActivate,this);this._Items.push(F);return F;};FCKMenuBlock.prototype.AddSeparator=function(){this._Items.push(new FCKMenuSeparator());};FCKMenuBlock.prototype.RemoveAllItems=function(){this._Items=[];var A=this._ItemsTable;if (A){while (A.rows.length>0) A.deleteRow(0);}};FCKMenuBlock.prototype.Create=function(A){if (!this._ItemsTable){if (FCK.IECleanup) FCK.IECleanup.AddItem(this,FCKMenuBlock_Cleanup);this._Window=FCKTools.GetElementWindow(A);var B=FCKTools.GetElementDocument(A);var C=A.appendChild(B.createElement('table'));C.cellPadding=0;C.cellSpacing=0;FCKTools.DisableSelection(C);var D=C.insertRow(-1).insertCell(-1);D.className='MN_Menu';var E=this._ItemsTable=D.appendChild(B.createElement('table'));E.cellPadding=0;E.cellSpacing=0;};for (var i=0;i0&&F.href.length==0);if (G) return;menu.AddSeparator();if (E) menu.AddItem('Link',FCKLang.EditLink,34);menu.AddItem('Unlink',FCKLang.RemoveLink,35);}}};case 'Image':return {AddItems:function(menu,tag,tagName){if (tagName=='IMG'&&!tag.getAttribute('_fckfakelement')){menu.AddSeparator();menu.AddItem('Image',FCKLang.ImageProperties,37);}}};case 'Anchor':return {AddItems:function(menu,tag,tagName){var F=FCKSelection.MoveToAncestorNode('A');var G=(F&&F.name.length>0);if (G||(tagName=='IMG'&&tag.getAttribute('_fckanchor'))){menu.AddSeparator();menu.AddItem('Anchor',FCKLang.AnchorProp,36);menu.AddItem('AnchorDelete',FCKLang.AnchorDelete);}}};case 'Flash':return {AddItems:function(menu,tag,tagName){if (tagName=='IMG'&&tag.getAttribute('_fckflash')){menu.AddSeparator();menu.AddItem('Flash',FCKLang.FlashProperties,38);}}};case 'Form':return {AddItems:function(menu,tag,tagName){if (FCKSelection.HasAncestorNode('FORM')){menu.AddSeparator();menu.AddItem('Form',FCKLang.FormProp,48);}}};case 'Checkbox':return {AddItems:function(menu,tag,tagName){if (tagName=='INPUT'&&tag.type=='checkbox'){menu.AddSeparator();menu.AddItem('Checkbox',FCKLang.CheckboxProp,49);}}};case 'Radio':return {AddItems:function(menu,tag,tagName){if (tagName=='INPUT'&&tag.type=='radio'){menu.AddSeparator();menu.AddItem('Radio',FCKLang.RadioButtonProp,50);}}};case 'TextField':return {AddItems:function(menu,tag,tagName){if (tagName=='INPUT'&&(tag.type=='text'||tag.type=='password')){menu.AddSeparator();menu.AddItem('TextField',FCKLang.TextFieldProp,51);}}};case 'HiddenField':return {AddItems:function(menu,tag,tagName){if (tagName=='IMG'&&tag.getAttribute('_fckinputhidden')){menu.AddSeparator();menu.AddItem('HiddenField',FCKLang.HiddenFieldProp,56);}}};case 'ImageButton':return {AddItems:function(menu,tag,tagName){if (tagName=='INPUT'&&tag.type=='image'){menu.AddSeparator();menu.AddItem('ImageButton',FCKLang.ImageButtonProp,55);}}};case 'Button':return {AddItems:function(menu,tag,tagName){if (tagName=='INPUT'&&(tag.type=='button'||tag.type=='submit'||tag.type=='reset')){menu.AddSeparator();menu.AddItem('Button',FCKLang.ButtonProp,54);}}};case 'Select':return {AddItems:function(menu,tag,tagName){if (tagName=='SELECT'){menu.AddSeparator();menu.AddItem('Select',FCKLang.SelectionFieldProp,53);}}};case 'Textarea':return {AddItems:function(menu,tag,tagName){if (tagName=='TEXTAREA'){menu.AddSeparator();menu.AddItem('Textarea',FCKLang.TextareaProp,52);}}};case 'BulletedList':return {AddItems:function(menu,tag,tagName){if (FCKSelection.HasAncestorNode('UL')){menu.AddSeparator();menu.AddItem('BulletedList',FCKLang.BulletedListProp,27);}}};case 'NumberedList':return {AddItems:function(menu,tag,tagName){if (FCKSelection.HasAncestorNode('OL')){menu.AddSeparator();menu.AddItem('NumberedList',FCKLang.NumberedListProp,26);}}};};return null;};function FCK_ContextMenu_OnBeforeOpen(){FCK.Events.FireEvent('OnSelectionChange');var A,sTagName;if ((A=FCKSelection.GetSelectedElement())) sTagName=A.tagName;var B=FCK.ContextMenu._InnerContextMenu;B.RemoveAllItems();var C=FCK.ContextMenu.Listeners;for (var i=0;i0){D=A.substr(0,B.index);this._sourceHtml=A.substr(B.index);}else{C=true;D=B[0];this._sourceHtml=A.substr(B[0].length);}}else{D=A;this._sourceHtml=null;};return { 'isTag':C,'value':D };},Each:function(A){var B;while ((B=this.Next())) A(B.isTag,B.value);}};var FCKHtmlIterator=function(A){this._sourceHtml=A;};FCKHtmlIterator.prototype={Next:function(){var A=this._sourceHtml;if (A==null) return null;var B=FCKRegexLib.HtmlTag.exec(A);var C=false;var D="";if (B){if (B.index>0){D=A.substr(0,B.index);this._sourceHtml=A.substr(B.index);}else{C=true;D=B[0];this._sourceHtml=A.substr(B[0].length);}}else{D=A;this._sourceHtml=null;};return { 'isTag':C,'value':D };},Each:function(A){var B;while ((B=this.Next())) A(B.isTag,B.value);}}; +var FCKPlugin=function(A,B,C){this.Name=A;this.BasePath=C?C:FCKConfig.PluginsPath;this.Path=this.BasePath+A+'/';if (!B||B.length==0) this.AvailableLangs=[];else this.AvailableLangs=B.split(',');};FCKPlugin.prototype.Load=function(){if (this.AvailableLangs.length>0){var A;if (this.AvailableLangs.IndexOf(FCKLanguageManager.ActiveLanguage.Code)>=0) A=FCKLanguageManager.ActiveLanguage.Code;else A=this.AvailableLangs[0];LoadScript(this.Path+'lang/'+A+'.js');};LoadScript(this.Path+'fckplugin.js');}; +var FCKPlugins=FCK.Plugins={};FCKPlugins.ItemsCount=0;FCKPlugins.Items={};FCKPlugins.Load=function(){var A=FCKPlugins.Items;for (var i=0;i-1);};String.prototype.Equals=function(){var A=arguments;if (A.length==1&&A[0].pop) A=A[0];for (var i=0;iC) return false;if (B){var E=new RegExp(A+'$','i');return E.test(this);}else return (D==0||this.substr(C-D,D)==A);};String.prototype.Remove=function(A,B){var s='';if (A>0) s=this.substring(0,A);if (A+B0){var B=A.pop();if (B) B[1].call(B[0]);};this._FCKCleanupObj=null;if (CollectGarbage) CollectGarbage();}; +var s=navigator.userAgent.toLowerCase();var FCKBrowserInfo={IsIE:/*@cc_on!@*/false,IsIE7:/*@cc_on!@*/false && ( parseInt( s.match( /msie (\d+)/)[1],10)>=7),IsIE6:/*@cc_on!@*/false && ( parseInt( s.match( /msie (\d+)/)[1],10)>=6),IsSafari:s.Contains(' applewebkit/'),IsOpera:!!window.opera,IsAIR:s.Contains(' adobeair/'),IsMac:s.Contains('macintosh')};(function(A){A.IsGecko=(navigator.product=='Gecko')&&!A.IsSafari&&!A.IsOpera;A.IsGeckoLike=(A.IsGecko||A.IsSafari||A.IsOpera);if (A.IsGecko){var B=s.match(/rv:(\d+\.\d+)/);var C=B&&parseFloat(B[1]);if (C){A.IsGecko10=(C<1.8);A.IsGecko19=(C>1.8);}}})(FCKBrowserInfo); +var FCKURLParams={};(function(){var A=document.location.search.substr(1).split('&');for (var i=0;i';if (!FCKRegexLib.HtmlOpener.test(A)) A=''+A+'';if (!FCKRegexLib.HeadOpener.test(A)) A=A.replace(FCKRegexLib.HtmlOpener,'$&');return A;}else{var B=FCKConfig.DocType+'0&&!FCKRegexLib.Html4DocType.test(FCKConfig.DocType)) B+=' style="overflow-y: scroll"';B+='>'+A+'';return B;}},ConvertToDataFormat:function(A,B,C,D){var E=FCKXHtml.GetXHTML(A,!B,D);if (C&&FCKRegexLib.EmptyOutParagraph.test(E)) return '';return E;},FixHtml:function(A){return A;}}; +var FCK={Name:FCKURLParams['InstanceName'],Status:0,EditMode:0,Toolbar:null,HasFocus:false,DataProcessor:new FCKDataProcessor(),GetInstanceObject:(function(){var w=window;return function(name){return w[name];}})(),AttachToOnSelectionChange:function(A){this.Events.AttachEvent('OnSelectionChange',A);},GetLinkedFieldValue:function(){return this.LinkedField.value;},GetParentForm:function(){return this.LinkedField.form;},StartupValue:'',IsDirty:function(){if (this.EditMode==1) return (this.StartupValue!=this.EditingArea.Textarea.value);else{if (!this.EditorDocument) return false;return (this.StartupValue!=this.EditorDocument.body.innerHTML);}},ResetIsDirty:function(){if (this.EditMode==1) this.StartupValue=this.EditingArea.Textarea.value;else if (this.EditorDocument.body) this.StartupValue=this.EditorDocument.body.innerHTML;},StartEditor:function(){this.TempBaseTag=FCKConfig.BaseHref.length>0?'':'';var A=FCK.KeystrokeHandler=new FCKKeystrokeHandler();A.OnKeystroke=_FCK_KeystrokeHandler_OnKeystroke;A.SetKeystrokes(FCKConfig.Keystrokes);if (FCKBrowserInfo.IsIE7){if ((CTRL+86/*V*/) in A.Keystrokes) A.SetKeystrokes([CTRL+86,true]);if ((SHIFT+45/*INS*/) in A.Keystrokes) A.SetKeystrokes([SHIFT+45,true]);};A.SetKeystrokes([CTRL+8,true]);this.EditingArea=new FCKEditingArea(document.getElementById('xEditingArea'));this.EditingArea.FFSpellChecker=FCKConfig.FirefoxSpellChecker;this.SetData(this.GetLinkedFieldValue(),true);FCKTools.AddEventListener(document,"keydown",this._TabKeyHandler);this.AttachToOnSelectionChange(_FCK_PaddingNodeListener);if (FCKBrowserInfo.IsGecko) this.AttachToOnSelectionChange(this._ExecCheckEmptyBlock);},Focus:function(){FCK.EditingArea.Focus();},SetStatus:function(A){this.Status=A;if (A==1){FCKFocusManager.AddWindow(window,true);if (FCKBrowserInfo.IsIE) FCKFocusManager.AddWindow(window.frameElement,true);if (FCKConfig.StartupFocus) FCK.Focus();};this.Events.FireEvent('OnStatusChange',A);},FixBody:function(){var A=FCKConfig.EnterMode;if (A!='p'&&A!='div') return;var B=this.EditorDocument;if (!B) return;var C=B.body;if (!C) return;FCKDomTools.TrimNode(C);var D=C.firstChild;var E;while (D){var F=false;switch (D.nodeType){case 1:var G=D.nodeName.toLowerCase();if (!FCKListsLib.BlockElements[G]&&G!='li'&&!D.getAttribute('_fckfakelement')&&D.getAttribute('_moz_dirty')==null) F=true;break;case 3:if (E||D.nodeValue.Trim().length>0) F=true;break;case 8:if (E) F=true;break;};if (F){var H=D.parentNode;if (!E) E=H.insertBefore(B.createElement(A),D);E.appendChild(H.removeChild(D));D=E.nextSibling;}else{if (E){FCKDomTools.TrimNode(E);E=null;};D=D.nextSibling;}};if (E) FCKDomTools.TrimNode(E);},GetData:function(A){if (FCK.EditMode==1) return FCK.EditingArea.Textarea.value;this.FixBody();var B=FCK.EditorDocument;if (!B) return null;var C=FCKConfig.FullPage;var D=FCK.DataProcessor.ConvertToDataFormat(C?B.documentElement:B.body,!C,FCKConfig.IgnoreEmptyParagraphValue,A);D=FCK.ProtectEventsRestore(D);if (FCKBrowserInfo.IsIE) D=D.replace(FCKRegexLib.ToReplace,'$1');if (C){if (FCK.DocTypeDeclaration&&FCK.DocTypeDeclaration.length>0) D=FCK.DocTypeDeclaration+'\n'+D;if (FCK.XmlDeclaration&&FCK.XmlDeclaration.length>0) D=FCK.XmlDeclaration+'\n'+D;};return FCKConfig.ProtectedSource.Revert(D);},UpdateLinkedField:function(){var A=FCK.GetXHTML(FCKConfig.FormatOutput);if (FCKConfig.HtmlEncodeOutput) A=FCKTools.HTMLEncode(A);FCK.LinkedField.value=A;FCK.Events.FireEvent('OnAfterLinkedFieldUpdate');},RegisteredDoubleClickHandlers:{},OnDoubleClick:function(A){var B=FCK.RegisteredDoubleClickHandlers[A.tagName.toUpperCase()];if (B){for (var i=0;i0?'|ABBR|XML|EMBED|OBJECT':'ABBR|XML|EMBED|OBJECT';var C;if (B.length>0){C=new RegExp('<('+B+')(?!\w|:)','gi');A=A.replace(C,'','gi');A=A.replace(C,'<\/FCK:$1>');};B='META';if (FCKBrowserInfo.IsIE) B+='|HR';C=new RegExp('<(('+B+')(?=\\s|>|/)[\\s\\S]*?)/?>','gi');A=A.replace(C,'');return A;},SetData:function(A,B){this.EditingArea.Mode=FCK.EditMode;if (FCKBrowserInfo.IsIE&&FCK.EditorDocument){FCK.EditorDocument.detachEvent("onselectionchange",Doc_OnSelectionChange);};if (FCK.EditMode==0){this._ForceResetIsDirty=(B===true);A=FCKConfig.ProtectedSource.Protect(A);A=FCK.DataProcessor.ConvertToHtml(A);A=A.replace(FCKRegexLib.InvalidSelfCloseTags,'$1>');A=FCK.ProtectEvents(A);A=FCK.ProtectUrls(A);A=FCK.ProtectTags(A);if (FCK.TempBaseTag.length>0&&!FCKRegexLib.HasBaseTag.test(A)) A=A.replace(FCKRegexLib.HeadOpener,'$&'+FCK.TempBaseTag);var C='';if (!FCKConfig.FullPage) C+=_FCK_GetEditorAreaStyleTags();if (FCKBrowserInfo.IsIE) C+=FCK._GetBehaviorsStyle();else if (FCKConfig.ShowBorders) C+=FCKTools.GetStyleHtml(FCK_ShowTableBordersCSS,true);C+=FCKTools.GetStyleHtml(FCK_InternalCSS,true);A=A.replace(FCKRegexLib.HeadCloser,C+'$&');this.EditingArea.OnLoad=_FCK_EditingArea_OnLoad;this.EditingArea.Start(A);}else{FCK.EditorWindow=null;FCK.EditorDocument=null;FCKDomTools.PaddingNode=null;this.EditingArea.OnLoad=null;this.EditingArea.Start(A);this.EditingArea.Textarea._FCKShowContextMenu=true;FCK.EnterKeyHandler=null;if (B) this.ResetIsDirty();FCK.KeystrokeHandler.AttachToElement(this.EditingArea.Textarea);this.EditingArea.Textarea.focus();FCK.Events.FireEvent('OnAfterSetHTML');};if (FCKBrowserInfo.IsGecko) window.onresize();},RedirectNamedCommands:{},ExecuteNamedCommand:function(A,B,C,D){if (!D) FCKUndo.SaveUndoStep();if (!C&&FCK.RedirectNamedCommands[A]!=null) FCK.ExecuteRedirectedNamedCommand(A,B);else{FCK.Focus();FCK.EditorDocument.execCommand(A,false,B);FCK.Events.FireEvent('OnSelectionChange');};if (!D) FCKUndo.SaveUndoStep();},GetNamedCommandState:function(A){try{if (FCKBrowserInfo.IsSafari&&FCK.EditorWindow&&A.IEquals('Paste')) return 0;if (!FCK.EditorDocument.queryCommandEnabled(A)) return -1;else{return FCK.EditorDocument.queryCommandState(A)?1:0;}}catch (e){return 0;}},GetNamedCommandValue:function(A){var B='';var C=FCK.GetNamedCommandState(A);if (C==-1) return null;try{B=this.EditorDocument.queryCommandValue(A);}catch(e) {};return B?B:'';},Paste:function(A){if (FCK.Status!=2||!FCK.Events.FireEvent('OnPaste')) return false;return A||FCK._ExecPaste();},PasteFromWord:function(){FCKDialog.OpenDialog('FCKDialog_Paste',FCKLang.PasteFromWord,'dialog/fck_paste.html',400,330,'Word');},Preview:function(){var A;if (FCKConfig.FullPage){if (FCK.TempBaseTag.length>0) A=FCK.TempBaseTag+FCK.GetXHTML();else A=FCK.GetXHTML();}else{A=FCKConfig.DocType+''+FCK.TempBaseTag+''+FCKLang.Preview+''+_FCK_GetEditorAreaStyleTags()+''+FCK.GetXHTML()+'';};var B=FCKConfig.ScreenWidth*0.8;var C=FCKConfig.ScreenHeight*0.7;var D=(FCKConfig.ScreenWidth-B)/2;var E='';if (FCK_IS_CUSTOM_DOMAIN&&FCKBrowserInfo.IsIE){window._FCKHtmlToLoad=A;E='javascript:void( (function(){document.open() ;document.domain="'+document.domain+'" ;document.write( window.opener._FCKHtmlToLoad );document.close() ;window.opener._FCKHtmlToLoad = null ;})() )';};var F=window.open(E,null,'toolbar=yes,location=no,status=yes,menubar=yes,scrollbars=yes,resizable=yes,width='+B+',height='+C+',left='+D);if (!FCK_IS_CUSTOM_DOMAIN||!FCKBrowserInfo.IsIE){F.document.write(A);F.document.close();}},SwitchEditMode:function(A){var B=(FCK.EditMode==0);var C=FCK.IsDirty();var D;if (B){FCKCommands.GetCommand('ShowBlocks').SaveState();if (!A&&FCKBrowserInfo.IsIE) FCKUndo.SaveUndoStep();D=FCK.GetXHTML(FCKConfig.FormatSource);if (D==null) return false;}else D=this.EditingArea.Textarea.value;FCK.EditMode=B?1:0;FCK.SetData(D,!C);FCK.Focus();FCKTools.RunFunction(FCK.ToolbarSet.RefreshModeState,FCK.ToolbarSet);return true;},InsertElement:function(A){if (typeof A=='string') A=this.EditorDocument.createElement(A);var B=A.nodeName.toLowerCase();FCKSelection.Restore();var C=new FCKDomRange(this.EditorWindow);C.MoveToSelection();C.DeleteContents();if (FCKListsLib.BlockElements[B]!=null){if (C.StartBlock){if (C.CheckStartOfBlock()) C.MoveToPosition(C.StartBlock,3);else if (C.CheckEndOfBlock()) C.MoveToPosition(C.StartBlock,4);else C.SplitBlock();};C.InsertNode(A);var D=FCKDomTools.GetNextSourceElement(A,false,null,['hr','br','param','img','area','input'],true);if (!D&&FCKConfig.EnterMode!='br'){D=this.EditorDocument.body.appendChild(this.EditorDocument.createElement(FCKConfig.EnterMode));if (FCKBrowserInfo.IsGeckoLike) FCKTools.AppendBogusBr(D);};if (FCKListsLib.EmptyElements[B]==null) C.MoveToElementEditStart(A);else if (D) C.MoveToElementEditStart(D);else C.MoveToPosition(A,4);if (FCKBrowserInfo.IsGecko){if (D) D.scrollIntoView(false);A.scrollIntoView(false);}}else{C.InsertNode(A);C.SetStart(A,4);C.SetEnd(A,4);};C.Select();C.Release();this.Focus();return A;},_InsertBlockElement:function(A){},_IsFunctionKey:function(A){if (A>=16&&A<=20) return true;if (A==27||(A>=33&&A<=40)) return true;if (A==45) return true;return false;},_KeyDownListener:function(A){if (!A) A=FCK.EditorWindow.event;if (FCK.EditorWindow){if (!FCK._IsFunctionKey(A.keyCode)&&!(A.ctrlKey||A.metaKey)&&!(A.keyCode==46)) FCK._KeyDownUndo();};return true;},_KeyDownUndo:function(){if (!FCKUndo.Typing){FCKUndo.SaveUndoStep();FCKUndo.Typing=true;FCK.Events.FireEvent("OnSelectionChange");};FCKUndo.TypesCount++;FCKUndo.Changed=1;if (FCKUndo.TypesCount>FCKUndo.MaxTypes){FCKUndo.TypesCount=0;FCKUndo.SaveUndoStep();}},_TabKeyHandler:function(A){if (!A) A=window.event;var B=A.keyCode;if (B==9&&FCK.EditMode!=0){if (FCKBrowserInfo.IsIE){var C=document.selection.createRange();if (C.parentElement()!=FCK.EditingArea.Textarea) return true;C.text='\t';C.select();}else{var a=[];var D=FCK.EditingArea.Textarea;var E=D.selectionStart;var F=D.selectionEnd;a.push(D.value.substr(0,E));a.push('\t');a.push(D.value.substr(F));D.value=a.join('');D.setSelectionRange(E+1,E+1);};if (A.preventDefault) return A.preventDefault();return A.returnValue=false;};return true;}};FCK.Events=new FCKEvents(FCK);FCK.GetHTML=FCK.GetXHTML=FCK.GetData;FCK.SetHTML=FCK.SetData;FCK.InsertElementAndGetIt=FCK.CreateElement=FCK.InsertElement;function _FCK_ProtectEvents_ReplaceTags(A){return A.replace(FCKRegexLib.EventAttributes,_FCK_ProtectEvents_ReplaceEvents);};function _FCK_ProtectEvents_ReplaceEvents(A,B){return ' '+B+'_fckprotectedatt="'+encodeURIComponent(A)+'"';};function _FCK_ProtectEvents_RestoreEvents(A,B){return decodeURIComponent(B);};function _FCK_MouseEventsListener(A){if (!A) A=window.event;if (A.type=='mousedown') FCK.MouseDownFlag=true;else if (A.type=='mouseup') FCK.MouseDownFlag=false;else if (A.type=='mousemove') FCK.Events.FireEvent('OnMouseMove',A);};function _FCK_PaddingNodeListener(){if (FCKConfig.EnterMode.IEquals('br')) return;FCKDomTools.EnforcePaddingNode(FCK.EditorDocument,FCKConfig.EnterMode);if (!FCKBrowserInfo.IsIE&&FCKDomTools.PaddingNode){var A=FCKSelection.GetSelection();if (A&&A.rangeCount==1){var B=A.getRangeAt(0);if (B.collapsed&&B.startContainer==FCK.EditorDocument.body&&B.startOffset==0){B.selectNodeContents(FCKDomTools.PaddingNode);B.collapse(true);A.removeAllRanges();A.addRange(B);}}}else if (FCKDomTools.PaddingNode){var C=FCKSelection.GetParentElement();var D=FCKDomTools.PaddingNode;if (C&&C.nodeName.IEquals('body')){if (FCK.EditorDocument.body.childNodes.length==1&&FCK.EditorDocument.body.firstChild==D){if (FCKSelection._GetSelectionDocument(FCK.EditorDocument.selection)!=FCK.EditorDocument) return;var B=FCK.EditorDocument.body.createTextRange();var F=false;if (!D.childNodes.firstChild){D.appendChild(FCKTools.GetElementDocument(D).createTextNode('\ufeff'));F=true;};B.moveToElementText(D);B.select();if (F) B.pasteHTML('');}}}};function _FCK_EditingArea_OnLoad(){FCK.EditorWindow=FCK.EditingArea.Window;FCK.EditorDocument=FCK.EditingArea.Document;FCK.InitializeBehaviors();FCK.MouseDownFlag=false;FCKTools.AddEventListener(FCK.EditorDocument,'mousemove',_FCK_MouseEventsListener);FCKTools.AddEventListener(FCK.EditorDocument,'mousedown',_FCK_MouseEventsListener);FCKTools.AddEventListener(FCK.EditorDocument,'mouseup',_FCK_MouseEventsListener);if (FCKBrowserInfo.IsSafari){var A=function(evt){if (!(evt.ctrlKey||evt.metaKey)) return;if (FCK.EditMode!=0) return;switch (evt.keyCode){case 89:FCKUndo.Redo();break;case 90:FCKUndo.Undo();break;}};FCKTools.AddEventListener(FCK.EditorDocument,'keyup',A);};FCK.EnterKeyHandler=new FCKEnterKey(FCK.EditorWindow,FCKConfig.EnterMode,FCKConfig.ShiftEnterMode,FCKConfig.TabSpaces);FCK.KeystrokeHandler.AttachToElement(FCK.EditorDocument);if (FCK._ForceResetIsDirty) FCK.ResetIsDirty();if (FCKBrowserInfo.IsIE&&FCK.HasFocus) FCK.EditorDocument.body.setActive();FCK.OnAfterSetHTML();FCKCommands.GetCommand('ShowBlocks').RestoreState();if (FCK.Status!=0) return;FCK.SetStatus(1);};function _FCK_GetEditorAreaStyleTags(){return FCKTools.GetStyleHtml(FCKConfig.EditorAreaCSS)+FCKTools.GetStyleHtml(FCKConfig.EditorAreaStyles);};function _FCK_KeystrokeHandler_OnKeystroke(A,B){if (FCK.Status!=2) return false;if (FCK.EditMode==0){switch (B){case 'Paste':return!FCK.Paste();case 'Cut':FCKUndo.SaveUndoStep();return false;}}else{if (B.Equals('Paste','Undo','Redo','SelectAll','Cut')) return false;};var C=FCK.Commands.GetCommand(B);if (C.GetState()==-1) return false;return (C.Execute.apply(C,FCKTools.ArgumentsToArray(arguments,2))!==false);};(function(){var A=window.parent.document;var B=A.getElementById(FCK.Name);var i=0;while (B||i==0){if (B&&B.tagName.toLowerCase().Equals('input','textarea')){FCK.LinkedField=B;break;};B=A.getElementsByName(FCK.Name)[i++];}})();var FCKTempBin={Elements:[],AddElement:function(A){var B=this.Elements.length;this.Elements[B]=A;return B;},RemoveElement:function(A){var e=this.Elements[A];this.Elements[A]=null;return e;},Reset:function(){var i=0;while (i0) C+='TABLE { behavior: '+B+' ; }';C+='';FCK._BehaviorsStyle=C;};return FCK._BehaviorsStyle;};function Doc_OnMouseUp(){if (FCK.EditorWindow.event.srcElement.tagName=='HTML'){FCK.Focus();FCK.EditorWindow.event.cancelBubble=true;FCK.EditorWindow.event.returnValue=false;}};function Doc_OnPaste(){var A=FCK.EditorDocument.body;A.detachEvent('onpaste',Doc_OnPaste);var B=FCK.Paste(!FCKConfig.ForcePasteAsPlainText&&!FCKConfig.AutoDetectPasteFromWord);A.attachEvent('onpaste',Doc_OnPaste);return B;};function Doc_OnDblClick(){FCK.OnDoubleClick(FCK.EditorWindow.event.srcElement);FCK.EditorWindow.event.cancelBubble=true;};function Doc_OnSelectionChange(){if (!FCK.IsSelectionChangeLocked&&FCK.EditorDocument) FCK.Events.FireEvent("OnSelectionChange");};function Doc_OnDrop(){if (FCK.MouseDownFlag){FCK.MouseDownFlag=false;return;};if (FCKConfig.ForcePasteAsPlainText){var A=FCK.EditorWindow.event;if (FCK._CheckIsPastingEnabled()||FCKConfig.ShowDropDialog) FCK.PasteAsPlainText(A.dataTransfer.getData('Text'));A.returnValue=false;A.cancelBubble=true;}};FCK.InitializeBehaviors=function(A){this.EditorDocument.attachEvent('onmouseup',Doc_OnMouseUp);this.EditorDocument.body.attachEvent('onpaste',Doc_OnPaste);this.EditorDocument.body.attachEvent('ondrop',Doc_OnDrop);FCK.ContextMenu._InnerContextMenu.AttachToElement(FCK.EditorDocument.body);this.EditorDocument.attachEvent("onkeydown",FCK._KeyDownListener);this.EditorDocument.attachEvent("ondblclick",Doc_OnDblClick);this.EditorDocument.attachEvent("onselectionchange",Doc_OnSelectionChange);FCKTools.AddEventListener(FCK.EditorDocument,'mousedown',Doc_OnMouseDown);};FCK.InsertHtml=function(A){A=FCKConfig.ProtectedSource.Protect(A);A=FCK.ProtectEvents(A);A=FCK.ProtectUrls(A);A=FCK.ProtectTags(A);FCKSelection.Restore();FCK.EditorWindow.focus();FCKUndo.SaveUndoStep();var B=FCKSelection.GetSelection();if (B.type.toLowerCase()=='control') B.clear();A=''+A;B.createRange().pasteHTML(A);FCK.EditorDocument.getElementById('__fakeFCKRemove__').removeNode(true);FCKDocumentProcessor.Process(FCK.EditorDocument);this.Events.FireEvent("OnSelectionChange");};FCK.SetInnerHtml=function(A){var B=FCK.EditorDocument;B.body.innerHTML='
         
        '+A;B.getElementById('__fakeFCKRemove__').removeNode(true);};function FCK_PreloadImages(){var A=new FCKImagePreloader();A.AddImages(FCKConfig.PreloadImages);A.AddImages(FCKConfig.SkinPath+'fck_strip.gif');A.OnComplete=LoadToolbarSetup;A.Start();};function Document_OnContextMenu(){return (event.srcElement._FCKShowContextMenu==true);};document.oncontextmenu=Document_OnContextMenu;function FCK_Cleanup(){this.LinkedField=null;this.EditorWindow=null;this.EditorDocument=null;};FCK._ExecPaste=function(){if (FCK._PasteIsRunning) return true;if (FCKConfig.ForcePasteAsPlainText){FCK.PasteAsPlainText();return false;};var A=FCK._CheckIsPastingEnabled(true);if (A===false) FCKTools.RunFunction(FCKDialog.OpenDialog,FCKDialog,['FCKDialog_Paste',FCKLang.Paste,'dialog/fck_paste.html',400,330,'Security']);else{if (FCKConfig.AutoDetectPasteFromWord&&A.length>0){var B=/<\w[^>]*(( class="?MsoNormal"?)|(="mso-))/gi;if (B.test(A)){if (confirm(FCKLang.PasteWordConfirm)){FCK.PasteFromWord();return false;}}};FCK._PasteIsRunning=true;FCK.ExecuteNamedCommand('Paste');delete FCK._PasteIsRunning;};return false;};FCK.PasteAsPlainText=function(A){if (!FCK._CheckIsPastingEnabled()){FCKDialog.OpenDialog('FCKDialog_Paste',FCKLang.PasteAsText,'dialog/fck_paste.html',400,330,'PlainText');return;};var B=null;if (!A) B=clipboardData.getData("Text");else B=A;if (B&&B.length>0){B=FCKTools.HTMLEncode(B);B=FCKTools.ProcessLineBreaks(window,FCKConfig,B);var C=B.search('

        ');var D=B.search('

        ');if ((C!=-1&&D!=-1&&C0){if (FCKSelection.GetType()=='Control'){var D=this.EditorDocument.createElement('A');D.href=A;var E=FCKSelection.GetSelectedElement();E.parentNode.insertBefore(D,E);E.parentNode.removeChild(E);D.appendChild(E);return [D];};var F='javascript:void(0);/*'+(new Date().getTime())+'*/';FCK.ExecuteNamedCommand('CreateLink',F,false,!!B);var G=this.EditorDocument.links;for (i=0;i0&&!isNaN(E)) this.PageConfig[D]=parseInt(E,10);else this.PageConfig[D]=E;}};function FCKConfig_LoadPageConfig(){var A=FCKConfig.PageConfig;for (var B in A) FCKConfig[B]=A[B];};function FCKConfig_PreProcess(){var A=FCKConfig;if (A.AllowQueryStringDebug){try{if ((/fckdebug=true/i).test(window.top.location.search)) A.Debug=true;}catch (e) {/*Ignore it. Much probably we are inside a FRAME where the "top" is in another domain (security error).*/}};if (!A.PluginsPath.EndsWith('/')) A.PluginsPath+='/';var B=A.ToolbarComboPreviewCSS;if (!B||B.length==0) A.ToolbarComboPreviewCSS=A.EditorAreaCSS;A.RemoveAttributesArray=(A.RemoveAttributes||'').split(',');if (!FCKConfig.SkinEditorCSS||FCKConfig.SkinEditorCSS.length==0) FCKConfig.SkinEditorCSS=FCKConfig.SkinPath+'fck_editor.css';if (!FCKConfig.SkinDialogCSS||FCKConfig.SkinDialogCSS.length==0) FCKConfig.SkinDialogCSS=FCKConfig.SkinPath+'fck_dialog.css';};FCKConfig.ToolbarSets={};FCKConfig.Plugins={};FCKConfig.Plugins.Items=[];FCKConfig.Plugins.Add=function(A,B,C){FCKConfig.Plugins.Items.AddItem([A,B,C]);};FCKConfig.ProtectedSource={};FCKConfig.ProtectedSource._CodeTag=(new Date()).valueOf();FCKConfig.ProtectedSource.RegexEntries=[//g,//gi,//gi];FCKConfig.ProtectedSource.Add=function(A){this.RegexEntries.AddItem(A);};FCKConfig.ProtectedSource.Protect=function(A){var B=this._CodeTag;function _Replace(protectedSource){var C=FCKTempBin.AddElement(protectedSource);return '';};for (var i=0;i|>)","g");return A.replace(D,_Replace);};FCKConfig.GetBodyAttributes=function(){var A='';if (this.BodyId&&this.BodyId.length>0) A+=' id="'+this.BodyId+'"';if (this.BodyClass&&this.BodyClass.length>0) A+=' class="'+this.BodyClass+'"';return A;};FCKConfig.ApplyBodyAttributes=function(A){if (this.BodyId&&this.BodyId.length>0) A.id=FCKConfig.BodyId;if (this.BodyClass&&this.BodyClass.length>0) A.className+=' '+FCKConfig.BodyClass;}; +var FCKDebug={Output:function(){},OutputObject:function(){}}; +var FCKDomTools={MoveChildren:function(A,B,C){if (A==B) return;var D;if (C){while ((D=A.lastChild)) B.insertBefore(A.removeChild(D),B.firstChild);}else{while ((D=A.firstChild)) B.appendChild(A.removeChild(D));}},MoveNode:function(A,B,C){if (C) B.insertBefore(FCKDomTools.RemoveNode(A),B.firstChild);else B.appendChild(FCKDomTools.RemoveNode(A));},TrimNode:function(A){this.LTrimNode(A);this.RTrimNode(A);},LTrimNode:function(A){var B;while ((B=A.firstChild)){if (B.nodeType==3){var C=B.nodeValue.LTrim();var D=B.nodeValue.length;if (C.length==0){A.removeChild(B);continue;}else if (C.length0) break;if (A.lastChild) A=A.lastChild;else return this.GetPreviousSourceElement(A,B,C,D);};return null;},GetNextSourceElement:function(A,B,C,D,E){while((A=this.GetNextSourceNode(A,E))){if (A.nodeType==1){if (C&&A.nodeName.IEquals(C)) break;if (D&&A.nodeName.IEquals(D)) return this.GetNextSourceElement(A,B,C,D);return A;}else if (B&&A.nodeType==3&&A.nodeValue.RTrim().length>0) break;};return null;},GetNextSourceNode:function(A,B,C,D){if (!A) return null;var E;if (!B&&A.firstChild) E=A.firstChild;else{if (D&&A==D) return null;E=A.nextSibling;if (!E&&(!D||D!=A.parentNode)) return this.GetNextSourceNode(A.parentNode,true,C,D);};if (C&&E&&E.nodeType!=C) return this.GetNextSourceNode(E,false,C,D);return E;},GetPreviousSourceNode:function(A,B,C,D){if (!A) return null;var E;if (!B&&A.lastChild) E=A.lastChild;else{if (D&&A==D) return null;E=A.previousSibling;if (!E&&(!D||D!=A.parentNode)) return this.GetPreviousSourceNode(A.parentNode,true,C,D);};if (C&&E&&E.nodeType!=C) return this.GetPreviousSourceNode(E,false,C,D);return E;},InsertAfterNode:function(A,B){return A.parentNode.insertBefore(B,A.nextSibling);},GetParents:function(A){var B=[];while (A){B.unshift(A);A=A.parentNode;};return B;},GetCommonParents:function(A,B){var C=this.GetParents(A);var D=this.GetParents(B);var E=[];for (var i=0;i0) D[C.pop().toLowerCase()]=1;var E=this.GetCommonParents(A,B);var F=null;while ((F=E.pop())){if (D[F.nodeName.toLowerCase()]) return F;};return null;},GetIndexOf:function(A){var B=A.parentNode?A.parentNode.firstChild:null;var C=-1;while (B){C++;if (B==A) return C;B=B.nextSibling;};return-1;},PaddingNode:null,EnforcePaddingNode:function(A,B){try{if (!A||!A.body) return;}catch (e){return;};this.CheckAndRemovePaddingNode(A,B,true);try{if (A.body.lastChild&&(A.body.lastChild.nodeType!=1||A.body.lastChild.tagName.toLowerCase()==B.toLowerCase())) return;}catch (e){return;};var C=A.createElement(B);if (FCKBrowserInfo.IsGecko&&FCKListsLib.NonEmptyBlockElements[B]) FCKTools.AppendBogusBr(C);this.PaddingNode=C;if (A.body.childNodes.length==1&&A.body.firstChild.nodeType==1&&A.body.firstChild.tagName.toLowerCase()=='br'&&(A.body.firstChild.getAttribute('_moz_dirty')!=null||A.body.firstChild.getAttribute('type')=='_moz')) A.body.replaceChild(C,A.body.firstChild);else A.body.appendChild(C);},CheckAndRemovePaddingNode:function(A,B,C){var D=this.PaddingNode;if (!D) return;try{if (D.parentNode!=A.body||D.tagName.toLowerCase()!=B||(D.childNodes.length>1)||(D.firstChild&&D.firstChild.nodeValue!='\xa0'&&String(D.firstChild.tagName).toLowerCase()!='br')){this.PaddingNode=null;return;}}catch (e){this.PaddingNode=null;return;};if (!C){if (D.parentNode.childNodes.length>1) D.parentNode.removeChild(D);this.PaddingNode=null;}},HasAttribute:function(A,B){if (A.hasAttribute) return A.hasAttribute(B);else{var C=A.attributes[B];return (C!=undefined&&C.specified);}},HasAttributes:function(A){var B=A.attributes;for (var i=0;i0) return true;}else if (B[i].specified) return true;};return false;},RemoveAttribute:function(A,B){if (FCKBrowserInfo.IsIE&&B.toLowerCase()=='class') B='className';return A.removeAttribute(B,0);},RemoveAttributes:function (A,B){for (var i=0;i0) return false;C=C.nextSibling;};return D?this.CheckIsEmptyElement(D,B):true;},SetElementStyles:function(A,B){var C=A.style;for (var D in B) C[D]=B[D];},SetOpacity:function(A,B){if (FCKBrowserInfo.IsIE){B=Math.round(B*100);A.style.filter=(B>100?'':'progid:DXImageTransform.Microsoft.Alpha(opacity='+B+')');}else A.style.opacity=B;},GetCurrentElementStyle:function(A,B){if (FCKBrowserInfo.IsIE) return A.currentStyle[B];else return A.ownerDocument.defaultView.getComputedStyle(A,'').getPropertyValue(B);},GetPositionedAncestor:function(A){var B=A;while (B!=FCKTools.GetElementDocument(B).documentElement){if (this.GetCurrentElementStyle(B,'position')!='static') return B;if (B==FCKTools.GetElementDocument(B).documentElement&¤tWindow!=w) B=currentWindow.frameElement;else B=B.parentNode;};return null;},ScrollIntoView:function(A,B){var C=FCKTools.GetElementWindow(A);var D=FCKTools.GetViewPaneSize(C).Height;var E=D*-1;if (B===false){E+=A.offsetHeight;E+=parseInt(this.GetCurrentElementStyle(A,'marginBottom')||0,10);};E+=A.offsetTop;while ((A=A.offsetParent)) E+=A.offsetTop||0;var F=FCKTools.GetScrollPosition(C).Y;if (E>0&&E>F) C.scrollTo(0,E);},CheckIsEditable:function(A){var B=A.nodeName.toLowerCase();var C=FCK.DTD[B]||FCK.DTD.span;return (C['#']&&!FCKListsLib.NonEditableElements[B]);}}; +var FCKTools={};FCKTools.CreateBogusBR=function(A){var B=A.createElement('br');B.setAttribute('type','_moz');return B;};FCKTools.FixCssUrls=function(A,B){if (!A||A.length==0) return B;return B.replace(/url\s*\(([\s'"]*)(.*?)([\s"']*)\)/g,function(match,opener,path,closer){if (/^\/|^\w?:/.test(path)) return match;else return 'url('+opener+A+path+closer+')';});};FCKTools._GetUrlFixedCss=function(A,B){var C=A.match(/^([^|]+)\|([\s\S]*)/);if (C) return FCKTools.FixCssUrls(C[1],C[2]);else return A;};FCKTools.AppendStyleSheet=function(A,B){if (!B) return [];if (typeof(B)=='string'){if (/[\\\/\.][^{}]*$/.test(B)){return this.AppendStyleSheet(A,B.split(','));}else return [this.AppendStyleString(A,FCKTools._GetUrlFixedCss(B))];}else{var C=[];for (var i=0;i'+styleDef+'';};var C=function(cssFileUrl,markTemp){if (cssFileUrl.length==0) return '';var B=markTemp?' _fcktemp="true"':'';return '';};return function(cssFileOrArrayOrDef,markTemp){if (!cssFileOrArrayOrDef) return '';if (typeof(cssFileOrArrayOrDef)=='string'){if (/[\\\/\.][^{}]*$/.test(cssFileOrArrayOrDef)){return this.GetStyleHtml(cssFileOrArrayOrDef.split(','),markTemp);}else return A(this._GetUrlFixedCss(cssFileOrArrayOrDef),markTemp);}else{var E='';for (var i=0;i/g,'>');return A;};FCKTools.HTMLDecode=function(A){if (!A) return '';A=A.replace(/>/g,'>');A=A.replace(/</g,'<');A=A.replace(/&/g,'&');return A;};FCKTools._ProcessLineBreaksForPMode=function(A,B,C,D,E){var F=0;var G="

        ";var H="

        ";var I="
        ";if (C){G="
      7. ";H="
      8. ";F=1;}while (D&&D!=A.FCK.EditorDocument.body){if (D.tagName.toLowerCase()=='p'){F=1;break;};D=D.parentNode;};for (var i=0;i0) return A[A.length-1];return null;};FCKTools.GetDocumentPosition=function(w,A){var x=0;var y=0;var B=A;var C=null;var D=FCKTools.GetElementWindow(B);while (B&&!(D==w&&(B==w.document.body||B==w.document.documentElement))){x+=B.offsetLeft-B.scrollLeft;y+=B.offsetTop-B.scrollTop;if (!FCKBrowserInfo.IsOpera){var E=C;while (E&&E!=B){x-=E.scrollLeft;y-=E.scrollTop;E=E.parentNode;}};C=B;if (B.offsetParent) B=B.offsetParent;else{if (D!=w){B=D.frameElement;C=null;if (B) D=B.contentWindow.parent;}else B=null;}};if (FCKDomTools.GetCurrentElementStyle(w.document.body,'position')!='static'||(FCKBrowserInfo.IsIE&&FCKDomTools.GetPositionedAncestor(A)==null)){x+=w.document.body.offsetLeft;y+=w.document.body.offsetTop;};return { "x":x,"y":y };};FCKTools.GetWindowPosition=function(w,A){var B=this.GetDocumentPosition(w,A);var C=FCKTools.GetScrollPosition(w);B.x-=C.X;B.y-=C.Y;return B;};FCKTools.ProtectFormStyles=function(A){if (!A||A.nodeType!=1||A.tagName.toLowerCase()!='form') return [];var B=[];var C=['style','className'];for (var i=0;i0){for (var i=B.length-1;i>=0;i--){var C=B[i][0];var D=B[i][1];if (D) A.insertBefore(C,D);else A.appendChild(C);}}};FCKTools.GetNextNode=function(A,B){if (A.firstChild) return A.firstChild;else if (A.nextSibling) return A.nextSibling;else{var C=A.parentNode;while (C){if (C==B) return null;if (C.nextSibling) return C.nextSibling;else C=C.parentNode;}};return null;};FCKTools.GetNextTextNode=function(A,B,C){node=this.GetNextNode(A,B);if (C&&node&&C(node)) return null;while (node&&node.nodeType!=3){node=this.GetNextNode(node,B);if (C&&node&&C(node)) return null;};return node;};FCKTools.Merge=function(){var A=arguments;var o=A[0];for (var i=1;i');document.domain = '"+FCK_RUNTIME_DOMAIN+"';document.close();}() ) ;";if (FCKBrowserInfo.IsIE){if (FCKBrowserInfo.IsIE7||!FCKBrowserInfo.IsIE6) return "";else return "javascript: '';";};return "javascript: void(0);";};FCKTools.ResetStyles=function(A){A.style.cssText='margin:0;padding:0;border:0;background-color:transparent;background-image:none;';}; +FCKTools.CancelEvent=function(e){return false;};FCKTools._AppendStyleSheet=function(A,B){return A.createStyleSheet(B).owningElement;};FCKTools.AppendStyleString=function(A,B){if (!B) return null;var s=A.createStyleSheet("");s.cssText=B;return s;};FCKTools.ClearElementAttributes=function(A){A.clearAttributes();};FCKTools.GetAllChildrenIds=function(A){var B=[];for (var i=0;i0) B[B.length]=C;};return B;};FCKTools.RemoveOuterTags=function(e){e.insertAdjacentHTML('beforeBegin',e.innerHTML);e.parentNode.removeChild(e);};FCKTools.CreateXmlObject=function(A){var B;switch (A){case 'XmlHttp':try { return new XMLHttpRequest();} catch (e) {};B=['MSXML2.XmlHttp','Microsoft.XmlHttp'];break;case 'DOMDocument':B=['MSXML2.DOMDocument','Microsoft.XmlDom'];break;};for (var i=0;i<2;i++){try { return new ActiveXObject(B[i]);}catch (e){}};if (FCKLang.NoActiveX){alert(FCKLang.NoActiveX);FCKLang.NoActiveX=null;};return null;};FCKTools.DisableSelection=function(A){A.unselectable='on';var e,i=0;while ((e=A.all[i++])){switch (e.tagName){case 'IFRAME':case 'TEXTAREA':case 'INPUT':case 'SELECT':break;default:e.unselectable='on';}}};FCKTools.GetScrollPosition=function(A){var B=A.document;var C={ X:B.documentElement.scrollLeft,Y:B.documentElement.scrollTop };if (C.X>0||C.Y>0) return C;return { X:B.body.scrollLeft,Y:B.body.scrollTop };};FCKTools.AddEventListener=function(A,B,C){A.attachEvent('on'+B,C);};FCKTools.RemoveEventListener=function(A,B,C){A.detachEvent('on'+B,C);};FCKTools.AddEventListenerEx=function(A,B,C,D){var o={};o.Source=A;o.Params=D||[];o.Listener=function(ev){return C.apply(o.Source,[ev].concat(o.Params));};if (FCK.IECleanup) FCK.IECleanup.AddItem(null,function() { o.Source=null;o.Params=null;});A.attachEvent('on'+B,o.Listener);A=null;D=null;};FCKTools.GetViewPaneSize=function(A){var B;var C=A.document.documentElement;if (C&&C.clientWidth) B=C;else B=A.document.body;if (B) return { Width:B.clientWidth,Height:B.clientHeight };else return { Width:0,Height:0 };};FCKTools.SaveStyles=function(A){var B=FCKTools.ProtectFormStyles(A);var C={};if (A.className.length>0){C.Class=A.className;A.className='';};var D=A.style.cssText;if (D.length>0){C.Inline=D;A.style.cssText='';};FCKTools.RestoreFormStyles(A,B);return C;};FCKTools.RestoreStyles=function(A,B){var C=FCKTools.ProtectFormStyles(A);A.className=B.Class||'';A.style.cssText=B.Inline||'';FCKTools.RestoreFormStyles(A,C);};FCKTools.RegisterDollarFunction=function(A){A.$=A.document.getElementById;};FCKTools.AppendElement=function(A,B){return A.appendChild(this.GetElementDocument(A).createElement(B));};FCKTools.ToLowerCase=function(A){return A.toLowerCase();}; +var FCKeditorAPI;function InitializeAPI(){var A=window.parent;if (!(FCKeditorAPI=A.FCKeditorAPI)){var B='window.FCKeditorAPI = {Version : "2.6.2",VersionBuild : "19417",Instances : new Object(),GetInstance : function( name ){return this.Instances[ name ];},_FormSubmit : function(){for ( var name in FCKeditorAPI.Instances ){var oEditor = FCKeditorAPI.Instances[ name ] ;if ( oEditor.GetParentForm && oEditor.GetParentForm() == this )oEditor.UpdateLinkedField() ;}this._FCKOriginalSubmit() ;},_FunctionQueue : {Functions : new Array(),IsRunning : false,Add : function( f ){this.Functions.push( f );if ( !this.IsRunning )this.StartNext();},StartNext : function(){var aQueue = this.Functions ;if ( aQueue.length > 0 ){this.IsRunning = true;aQueue[0].call();}else this.IsRunning = false;},Remove : function( f ){var aQueue = this.Functions;var i = 0, fFunc;while( (fFunc = aQueue[ i ]) ){if ( fFunc == f )aQueue.splice( i,1 );i++ ;}this.StartNext();}}}';if (A.execScript) A.execScript(B,'JavaScript');else{if (FCKBrowserInfo.IsGecko10){eval.call(A,B);}else if(FCKBrowserInfo.IsAIR){FCKAdobeAIR.FCKeditorAPI_Evaluate(A,B);}else if (FCKBrowserInfo.IsSafari||FCKBrowserInfo.IsGecko19){var C=A.document;var D=C.createElement('script');D.appendChild(C.createTextNode(B));C.documentElement.appendChild(D);}else A.eval(B);};FCKeditorAPI=A.FCKeditorAPI;FCKeditorAPI.__Instances=FCKeditorAPI.Instances;};FCKeditorAPI.Instances[FCK.Name]=FCK;};function _AttachFormSubmitToAPI(){var A=FCK.GetParentForm();if (A){FCKTools.AddEventListener(A,'submit',FCK.UpdateLinkedField);if (!A._FCKOriginalSubmit&&(typeof(A.submit)=='function'||(!A.submit.tagName&&!A.submit.length))){A._FCKOriginalSubmit=A.submit;A.submit=FCKeditorAPI._FormSubmit;}}};function FCKeditorAPI_Cleanup(){if (window.FCKConfig&&FCKConfig.MsWebBrowserControlCompat&&!window.FCKUnloadFlag) return;delete FCKeditorAPI.Instances[FCK.Name];};function FCKeditorAPI_ConfirmCleanup(){if (window.FCKConfig&&FCKConfig.MsWebBrowserControlCompat) window.FCKUnloadFlag=true;};FCKTools.AddEventListener(window,'unload',FCKeditorAPI_Cleanup);FCKTools.AddEventListener(window,'beforeunload',FCKeditorAPI_ConfirmCleanup); +var FCKImagePreloader=function(){this._Images=[];};FCKImagePreloader.prototype={AddImages:function(A){if (typeof(A)=='string') A=A.split(';');this._Images=this._Images.concat(A);},Start:function(){var A=this._Images;this._PreloadCount=A.length;for (var i=0;i]*\>)/i,AfterBody:/(\<\/body\>[\s\S]*$)/i,ToReplace:/___fcktoreplace:([\w]+)/ig,MetaHttpEquiv:/http-equiv\s*=\s*["']?([^"' ]+)/i,HasBaseTag:/]/i,HtmlOpener:/]*>/i,HeadOpener:/]*>/i,HeadCloser:/<\/head\s*>/i,FCK_Class:/\s*FCK__[^ ]*(?=\s+|$)/,ElementName:/(^[a-z_:][\w.\-:]*\w$)|(^[a-z_]$)/,ForceSimpleAmpersand:/___FCKAmp___/g,SpaceNoClose:/\/>/g,EmptyParagraph:/^<(p|div|address|h\d|center)(?=[ >])[^>]*>\s*(<\/\1>)?$/,EmptyOutParagraph:/^<(p|div|address|h\d|center)(?=[ >])[^>]*>(?:\s*| )(<\/\1>)?$/,TagBody:/>]+))/gi,ProtectUrlsA:/]+))/gi,ProtectUrlsArea:/]+))/gi,Html4DocType:/HTML 4\.0 Transitional/i,DocTypeTag:/]*>/i,HtmlDocType:/DTD HTML/,TagsWithEvent:/<[^\>]+ on\w+[\s\r\n]*=[\s\r\n]*?('|")[\s\S]+?\>/g,EventAttributes:/\s(on\w+)[\s\r\n]*=[\s\r\n]*?('|")([\s\S]*?)\2/g,ProtectedEvents:/\s\w+_fckprotectedatt="([^"]+)"/g,StyleProperties:/\S+\s*:/g,InvalidSelfCloseTags:/(<(?!base|meta|link|hr|br|param|img|area|input)([a-zA-Z0-9:]+)[^>]*)\/>/gi,StyleVariableAttName:/#\(\s*("|')(.+?)\1[^\)]*\s*\)/g,RegExp:/^\/(.*)\/([gim]*)$/,HtmlTag:/<[^\s<>](?:"[^"]*"|'[^']*'|[^<])*>/}; +var FCKListsLib={BlockElements:{ address:1,blockquote:1,center:1,div:1,dl:1,fieldset:1,form:1,h1:1,h2:1,h3:1,h4:1,h5:1,h6:1,hr:1,marquee:1,noscript:1,ol:1,p:1,pre:1,script:1,table:1,ul:1 },NonEmptyBlockElements:{ p:1,div:1,form:1,h1:1,h2:1,h3:1,h4:1,h5:1,h6:1,address:1,pre:1,ol:1,ul:1,li:1,td:1,th:1 },InlineChildReqElements:{ abbr:1,acronym:1,b:1,bdo:1,big:1,cite:1,code:1,del:1,dfn:1,em:1,font:1,i:1,ins:1,label:1,kbd:1,q:1,samp:1,small:1,span:1,strike:1,strong:1,sub:1,sup:1,tt:1,u:1,'var':1 },InlineNonEmptyElements:{ a:1,abbr:1,acronym:1,b:1,bdo:1,big:1,cite:1,code:1,del:1,dfn:1,em:1,font:1,i:1,ins:1,label:1,kbd:1,q:1,samp:1,small:1,span:1,strike:1,strong:1,sub:1,sup:1,tt:1,u:1,'var':1 },EmptyElements:{ base:1,col:1,meta:1,link:1,hr:1,br:1,param:1,img:1,area:1,input:1 },PathBlockElements:{ address:1,blockquote:1,dl:1,h1:1,h2:1,h3:1,h4:1,h5:1,h6:1,p:1,pre:1,li:1,dt:1,de:1 },PathBlockLimitElements:{ body:1,div:1,td:1,th:1,caption:1,form:1 },StyleBlockElements:{ address:1,div:1,h1:1,h2:1,h3:1,h4:1,h5:1,h6:1,p:1,pre:1 },StyleObjectElements:{ img:1,hr:1,li:1,table:1,tr:1,td:1,embed:1,object:1,ol:1,ul:1 },NonEditableElements:{ button:1,option:1,script:1,iframe:1,textarea:1,object:1,embed:1,map:1,applet:1 },BlockBoundaries:{ p:1,div:1,h1:1,h2:1,h3:1,h4:1,h5:1,h6:1,hr:1,address:1,pre:1,ol:1,ul:1,li:1,dt:1,de:1,table:1,thead:1,tbody:1,tfoot:1,tr:1,th:1,td:1,caption:1,col:1,colgroup:1,blockquote:1,body:1 },ListBoundaries:{ p:1,div:1,h1:1,h2:1,h3:1,h4:1,h5:1,h6:1,hr:1,address:1,pre:1,ol:1,ul:1,li:1,dt:1,de:1,table:1,thead:1,tbody:1,tfoot:1,tr:1,th:1,td:1,caption:1,col:1,colgroup:1,blockquote:1,body:1,br:1 }}; +var FCKLanguageManager=FCK.Language={AvailableLanguages:{af:'Afrikaans',ar:'Arabic',bg:'Bulgarian',bn:'Bengali/Bangla',bs:'Bosnian',ca:'Catalan',cs:'Czech',da:'Danish',de:'German',el:'Greek',en:'English','en-au':'English (Australia)','en-ca':'English (Canadian)','en-uk':'English (United Kingdom)',eo:'Esperanto',es:'Spanish',et:'Estonian',eu:'Basque',fa:'Persian',fi:'Finnish',fo:'Faroese',fr:'French','fr-ca':'French (Canada)',gl:'Galician',gu:'Gujarati',he:'Hebrew',hi:'Hindi',hr:'Croatian',hu:'Hungarian',it:'Italian',ja:'Japanese',km:'Khmer',ko:'Korean',lt:'Lithuanian',lv:'Latvian',mn:'Mongolian',ms:'Malay',nb:'Norwegian Bokmal',nl:'Dutch',no:'Norwegian',pl:'Polish',pt:'Portuguese (Portugal)','pt-br':'Portuguese (Brazil)',ro:'Romanian',ru:'Russian',sk:'Slovak',sl:'Slovenian',sr:'Serbian (Cyrillic)','sr-latn':'Serbian (Latin)',sv:'Swedish',th:'Thai',tr:'Turkish',uk:'Ukrainian',vi:'Vietnamese',zh:'Chinese Traditional','zh-cn':'Chinese Simplified'},GetActiveLanguage:function(){if (FCKConfig.AutoDetectLanguage){var A;if (navigator.userLanguage) A=navigator.userLanguage.toLowerCase();else if (navigator.language) A=navigator.language.toLowerCase();else{return FCKConfig.DefaultLanguage;};if (A.length>=5){A=A.substr(0,5);if (this.AvailableLanguages[A]) return A;};if (A.length>=2){A=A.substr(0,2);if (this.AvailableLanguages[A]) return A;}};return this.DefaultLanguage;},TranslateElements:function(A,B,C,D){var e=A.getElementsByTagName(B);var E,s;for (var i=0;i0) C+='|'+FCKConfig.AdditionalNumericEntities;FCKXHtmlEntities.EntitiesRegex=new RegExp(C,'g');}; +var FCKXHtml={};FCKXHtml.CurrentJobNum=0;FCKXHtml.GetXHTML=function(A,B,C){FCKDomTools.CheckAndRemovePaddingNode(FCKTools.GetElementDocument(A),FCKConfig.EnterMode);FCKXHtmlEntities.Initialize();this._NbspEntity=(FCKConfig.ProcessHTMLEntities?'nbsp':'#160');var D=FCK.IsDirty();FCKXHtml.SpecialBlocks=[];this.XML=FCKTools.CreateXmlObject('DOMDocument');this.MainNode=this.XML.appendChild(this.XML.createElement('xhtml'));FCKXHtml.CurrentJobNum++;if (B) this._AppendNode(this.MainNode,A);else this._AppendChildNodes(this.MainNode,A,false);var E=this._GetMainXmlString();this.XML=null;if (FCKBrowserInfo.IsSafari) E=E.replace(/^/,'');E=E.substr(7,E.length-15).Trim();if (FCKConfig.DocType.length>0&&FCKRegexLib.HtmlDocType.test(FCKConfig.DocType)) E=E.replace(FCKRegexLib.SpaceNoClose,'>');else E=E.replace(FCKRegexLib.SpaceNoClose,' />');if (FCKConfig.ForceSimpleAmpersand) E=E.replace(FCKRegexLib.ForceSimpleAmpersand,'&');if (C) E=FCKCodeFormatter.Format(E);for (var i=0;i0;if (C) A.appendChild(this.XML.createTextNode(B.replace(FCKXHtmlEntities.EntitiesRegex,FCKXHtml_GetEntity)));return C;};function FCKXHtml_GetEntity(A){var B=FCKXHtmlEntities.Entities[A]||('#'+A.charCodeAt(0));return '#?-:'+B+';';};FCKXHtml.TagProcessors={a:function(A,B){if (B.innerHTML.Trim().length==0&&!B.name) return false;var C=B.getAttribute('_fcksavedurl');if (C!=null) FCKXHtml._AppendAttribute(A,'href',C);if (FCKBrowserInfo.IsIE){if (B.name) FCKXHtml._AppendAttribute(A,'name',B.name);};A=FCKXHtml._AppendChildNodes(A,B,false);return A;},area:function(A,B){var C=B.getAttribute('_fcksavedurl');if (C!=null) FCKXHtml._AppendAttribute(A,'href',C);if (FCKBrowserInfo.IsIE){if (!A.attributes.getNamedItem('coords')){var D=B.getAttribute('coords',2);if (D&&D!='0,0,0') FCKXHtml._AppendAttribute(A,'coords',D);};if (!A.attributes.getNamedItem('shape')){var E=B.getAttribute('shape',2);if (E&&E.length>0) FCKXHtml._AppendAttribute(A,'shape',E.toLowerCase());}};return A;},body:function(A,B){A=FCKXHtml._AppendChildNodes(A,B,false);A.removeAttribute('spellcheck');return A;},iframe:function(A,B){var C=B.innerHTML;if (FCKBrowserInfo.IsGecko) C=FCKTools.HTMLDecode(C);C=C.replace(/\s_fcksavedurl="[^"]*"/g,'');A.appendChild(FCKXHtml.XML.createTextNode(FCKXHtml._AppendSpecialItem(C)));return A;},img:function(A,B){if (!A.attributes.getNamedItem('alt')) FCKXHtml._AppendAttribute(A,'alt','');var C=B.getAttribute('_fcksavedurl');if (C!=null) FCKXHtml._AppendAttribute(A,'src',C);if (B.style.width) A.removeAttribute('width');if (B.style.height) A.removeAttribute('height');return A;},li:function(A,B,C){if (C.nodeName.IEquals(['ul','ol'])) return FCKXHtml._AppendChildNodes(A,B,true);var D=FCKXHtml.XML.createElement('ul');B._fckxhtmljob=null;do{FCKXHtml._AppendNode(D,B);do{B=FCKDomTools.GetNextSibling(B);} while (B&&B.nodeType==3&&B.nodeValue.Trim().length==0)} while (B&&B.nodeName.toLowerCase()=='li') return D;},ol:function(A,B,C){if (B.innerHTML.Trim().length==0) return false;var D=C.lastChild;if (D&&D.nodeType==3) D=D.previousSibling;if (D&&D.nodeName.toUpperCase()=='LI'){B._fckxhtmljob=null;FCKXHtml._AppendNode(D,B);return false;};A=FCKXHtml._AppendChildNodes(A,B);return A;},pre:function (A,B){var C=B.firstChild;if (C&&C.nodeType==3) A.appendChild(FCKXHtml.XML.createTextNode(FCKXHtml._AppendSpecialItem('\r\n')));FCKXHtml._AppendChildNodes(A,B,true);return A;},script:function(A,B){if (!A.attributes.getNamedItem('type')) FCKXHtml._AppendAttribute(A,'type','text/javascript');A.appendChild(FCKXHtml.XML.createTextNode(FCKXHtml._AppendSpecialItem(B.text)));return A;},span:function(A,B){if (B.innerHTML.length==0) return false;A=FCKXHtml._AppendChildNodes(A,B,false);return A;},style:function(A,B){if (!A.attributes.getNamedItem('type')) FCKXHtml._AppendAttribute(A,'type','text/css');var C=B.innerHTML;if (FCKBrowserInfo.IsIE) C=C.replace(/^(\r\n|\n|\r)/,'');A.appendChild(FCKXHtml.XML.createTextNode(FCKXHtml._AppendSpecialItem(C)));return A;},title:function(A,B){A.appendChild(FCKXHtml.XML.createTextNode(FCK.EditorDocument.title));return A;}};FCKXHtml.TagProcessors.ul=FCKXHtml.TagProcessors.ol; +FCKXHtml._GetMainXmlString=function(){return this.MainNode.xml;};FCKXHtml._AppendAttributes=function(A,B,C,D){var E=B.attributes;for (var n=0;n0) FCKXHtml._AppendAttribute(A,'align',B.align);A=FCKXHtml._AppendChildNodes(A,B,true);return A;};FCKXHtml.TagProcessors['font']=function(A,B){if (A.attributes.length==0) A=FCKXHtml.XML.createDocumentFragment();A=FCKXHtml._AppendChildNodes(A,B);return A;};FCKXHtml.TagProcessors['form']=function(A,B){if (B.acceptCharset&&B.acceptCharset.length>0&&B.acceptCharset!='UNKNOWN') FCKXHtml._AppendAttribute(A,'accept-charset',B.acceptCharset);var C=B.attributes['name'];if (C&&C.value.length>0) FCKXHtml._AppendAttribute(A,'name',C.value);A=FCKXHtml._AppendChildNodes(A,B,true);return A;};FCKXHtml.TagProcessors['input']=function(A,B){if (B.name) FCKXHtml._AppendAttribute(A,'name',B.name);if (B.value&&!A.attributes.getNamedItem('value')) FCKXHtml._AppendAttribute(A,'value',B.value);if (!A.attributes.getNamedItem('type')) FCKXHtml._AppendAttribute(A,'type','text');return A;};FCKXHtml.TagProcessors['label']=function(A,B){if (B.htmlFor.length>0) FCKXHtml._AppendAttribute(A,'for',B.htmlFor);A=FCKXHtml._AppendChildNodes(A,B);return A;};FCKXHtml.TagProcessors['map']=function(A,B){if (!A.attributes.getNamedItem('name')){var C=B.name;if (C) FCKXHtml._AppendAttribute(A,'name',C);};A=FCKXHtml._AppendChildNodes(A,B,true);return A;};FCKXHtml.TagProcessors['meta']=function(A,B){var C=A.attributes.getNamedItem('http-equiv');if (C==null||C.value.length==0){var D=B.outerHTML.match(FCKRegexLib.MetaHttpEquiv);if (D){D=D[1];FCKXHtml._AppendAttribute(A,'http-equiv',D);}};return A;};FCKXHtml.TagProcessors['option']=function(A,B){if (B.selected&&!A.attributes.getNamedItem('selected')) FCKXHtml._AppendAttribute(A,'selected','selected');A=FCKXHtml._AppendChildNodes(A,B);return A;};FCKXHtml.TagProcessors['textarea']=FCKXHtml.TagProcessors['select']=function(A,B){if (B.name) FCKXHtml._AppendAttribute(A,'name',B.name);A=FCKXHtml._AppendChildNodes(A,B);return A;}; +var FCKCodeFormatter={};FCKCodeFormatter.Init=function(){var A=this.Regex={};A.BlocksOpener=/\<(P|DIV|H1|H2|H3|H4|H5|H6|ADDRESS|PRE|OL|UL|LI|TITLE|META|LINK|BASE|SCRIPT|LINK|TD|TH|AREA|OPTION)[^\>]*\>/gi;A.BlocksCloser=/\<\/(P|DIV|H1|H2|H3|H4|H5|H6|ADDRESS|PRE|OL|UL|LI|TITLE|META|LINK|BASE|SCRIPT|LINK|TD|TH|AREA|OPTION)[^\>]*\>/gi;A.NewLineTags=/\<(BR|HR)[^\>]*\>/gi;A.MainTags=/\<\/?(HTML|HEAD|BODY|FORM|TABLE|TBODY|THEAD|TR)[^\>]*\>/gi;A.LineSplitter=/\s*\n+\s*/g;A.IncreaseIndent=/^\<(HTML|HEAD|BODY|FORM|TABLE|TBODY|THEAD|TR|UL|OL)[ \/\>]/i;A.DecreaseIndent=/^\<\/(HTML|HEAD|BODY|FORM|TABLE|TBODY|THEAD|TR|UL|OL)[ \>]/i;A.FormatIndentatorRemove=new RegExp('^'+FCKConfig.FormatIndentator);A.ProtectedTags=/(]*>)([\s\S]*?)(<\/PRE>)/gi;};FCKCodeFormatter._ProtectData=function(A,B,C,D){return B+'___FCKpd___'+FCKCodeFormatter.ProtectedData.AddItem(C)+D;};FCKCodeFormatter.Format=function(A){if (!this.Regex) this.Init();FCKCodeFormatter.ProtectedData=[];var B=A.replace(this.Regex.ProtectedTags,FCKCodeFormatter._ProtectData);B=B.replace(this.Regex.BlocksOpener,'\n$&');B=B.replace(this.Regex.BlocksCloser,'$&\n');B=B.replace(this.Regex.NewLineTags,'$&\n');B=B.replace(this.Regex.MainTags,'\n$&\n');var C='';var D=B.split(this.Regex.LineSplitter);B='';for (var i=0;iB[i]) return 1;};if (A.lengthB.length) return 1;return 0;};FCKUndo._CheckIsBookmarksEqual=function(A,B){if (!(A&&B)) return false;if (FCKBrowserInfo.IsIE){var C=A[1].search(A[0].StartId);var D=B[1].search(B[0].StartId);var E=A[1].search(A[0].EndId);var F=B[1].search(B[0].EndId);return C==D&&E==F;}else{return this._CompareCursors(A.Start,B.Start)==0&&this._CompareCursors(A.End,B.End)==0;}};FCKUndo.SaveUndoStep=function(){if (FCK.EditMode!=0||this.SaveLocked) return;if (this.SavedData.length) this.Changed=true;var A=FCK.EditorDocument.body.innerHTML;var B=this._GetBookmark();this.SavedData=this.SavedData.slice(0,this.CurrentIndex+1);if (this.CurrentIndex>0&&A==this.SavedData[this.CurrentIndex][0]&&this._CheckIsBookmarksEqual(B,this.SavedData[this.CurrentIndex][1])) return;else if (this.CurrentIndex==0&&this.SavedData.length&&A==this.SavedData[0][0]){this.SavedData[0][1]=B;return;};if (this.CurrentIndex+1>=FCKConfig.MaxUndoLevels) this.SavedData.shift();else this.CurrentIndex++;this.SavedData[this.CurrentIndex]=[A,B];FCK.Events.FireEvent("OnSelectionChange");};FCKUndo.CheckUndoState=function(){return (this.Changed||this.CurrentIndex>0);};FCKUndo.CheckRedoState=function(){return (this.CurrentIndex<(this.SavedData.length-1));};FCKUndo.Undo=function(){if (this.CheckUndoState()){if (this.CurrentIndex==(this.SavedData.length-1)){this.SaveUndoStep();};this._ApplyUndoLevel(--this.CurrentIndex);FCK.Events.FireEvent("OnSelectionChange");}};FCKUndo.Redo=function(){if (this.CheckRedoState()){this._ApplyUndoLevel(++this.CurrentIndex);FCK.Events.FireEvent("OnSelectionChange");}};FCKUndo._ApplyUndoLevel=function(A){var B=this.SavedData[A];if (!B) return;if (FCKBrowserInfo.IsIE){if (B[1]&&B[1][1]) FCK.SetInnerHtml(B[1][1]);else FCK.SetInnerHtml(B[0]);}else FCK.EditorDocument.body.innerHTML=B[0];this._SelectBookmark(B[1]);this.TypesCount=0;this.Changed=false;this.Typing=false;}; +var FCKEditingArea=function(A){this.TargetElement=A;this.Mode=0;if (FCK.IECleanup) FCK.IECleanup.AddItem(this,FCKEditingArea_Cleanup);};FCKEditingArea.prototype.Start=function(A,B){var C=this.TargetElement;var D=FCKTools.GetElementDocument(C);while(C.firstChild) C.removeChild(C.firstChild);if (this.Mode==0){if (FCK_IS_CUSTOM_DOMAIN) A=''+A;if (FCKBrowserInfo.IsIE) A=A.replace(/(]*?)\s*\/?>(?!\s*<\/base>)/gi,'$1>');else if (!B){var E=A.match(FCKRegexLib.BeforeBody);var F=A.match(FCKRegexLib.AfterBody);if (E&&F){var G=A.substr(E[1].length,A.length-E[1].length-F[1].length);A=E[1]+' '+F[1];if (FCKBrowserInfo.IsGecko&&(G.length==0||FCKRegexLib.EmptyParagraph.test(G))) G='
        ';this._BodyHTML=G;}else this._BodyHTML=A;};var H=this.IFrame=D.createElement('iframe');var I='';H.frameBorder=0;H.style.width=H.style.height='100%';if (FCK_IS_CUSTOM_DOMAIN&&FCKBrowserInfo.IsIE){window._FCKHtmlToLoad=A.replace(//i,''+I);H.src='javascript:void( (function(){document.open() ;document.domain="'+document.domain+'" ;document.write( window.parent._FCKHtmlToLoad );document.close() ;window.parent._FCKHtmlToLoad = null ;})() )';}else if (!FCKBrowserInfo.IsGecko){H.src='javascript:void(0)';};C.appendChild(H);this.Window=H.contentWindow;if (!FCK_IS_CUSTOM_DOMAIN||!FCKBrowserInfo.IsIE){var J=this.Window.document;J.open();J.write(A.replace(//i,''+I));J.close();};if (FCKBrowserInfo.IsAIR) FCKAdobeAIR.EditingArea_Start(J,A);if (FCKBrowserInfo.IsGecko10&&!B){this.Start(A,true);return;};if (H.readyState&&H.readyState!='completed'){var K=this;(H.onreadystatechange=function(){if (H.readyState=='complete'){H.onreadystatechange=null;K.Window._FCKEditingArea=K;FCKEditingArea_CompleteStart.call(K.Window);}})();}else{this.Window._FCKEditingArea=this;if (FCKBrowserInfo.IsGecko10) this.Window.setTimeout(FCKEditingArea_CompleteStart,500);else FCKEditingArea_CompleteStart.call(this.Window);}}else{var L=this.Textarea=D.createElement('textarea');L.className='SourceField';L.dir='ltr';FCKDomTools.SetElementStyles(L,{width:'100%',height:'100%',border:'none',resize:'none',outline:'none'});C.appendChild(L);L.value=A;FCKTools.RunFunction(this.OnLoad);}};function FCKEditingArea_CompleteStart(){if (!this.document.body){this.setTimeout(FCKEditingArea_CompleteStart,50);return;};var A=this._FCKEditingArea;A.Document=A.Window.document;A.MakeEditable();FCKTools.RunFunction(A.OnLoad);};FCKEditingArea.prototype.MakeEditable=function(){var A=this.Document;if (FCKBrowserInfo.IsIE){A.body.disabled=true;A.body.contentEditable=true;A.body.removeAttribute("disabled");}else{try{A.body.spellcheck=(this.FFSpellChecker!==false);if (this._BodyHTML){A.body.innerHTML=this._BodyHTML;A.body.offsetLeft;this._BodyHTML=null;};A.designMode='on';A.execCommand('enableObjectResizing',false,!FCKConfig.DisableObjectResizing);A.execCommand('enableInlineTableEditing',false,!FCKConfig.DisableFFTableHandles);}catch (e){FCKTools.AddEventListener(this.Window.frameElement,'DOMAttrModified',FCKEditingArea_Document_AttributeNodeModified);}}};function FCKEditingArea_Document_AttributeNodeModified(A){var B=A.currentTarget.contentWindow._FCKEditingArea;if (B._timer) window.clearTimeout(B._timer);B._timer=FCKTools.SetTimeout(FCKEditingArea_MakeEditableByMutation,1000,B);};function FCKEditingArea_MakeEditableByMutation(){delete this._timer;FCKTools.RemoveEventListener(this.Window.frameElement,'DOMAttrModified',FCKEditingArea_Document_AttributeNodeModified);this.MakeEditable();};FCKEditingArea.prototype.Focus=function(){try{if (this.Mode==0){if (FCKBrowserInfo.IsIE) this._FocusIE();else this.Window.focus();}else{var A=FCKTools.GetElementDocument(this.Textarea);if ((!A.hasFocus||A.hasFocus())&&A.activeElement==this.Textarea) return;this.Textarea.focus();}}catch(e) {}};FCKEditingArea.prototype._FocusIE=function(){this.Document.body.setActive();this.Window.focus();var A=this.Document.selection.createRange();var B=A.parentElement();var C=B.nodeName.toLowerCase();if (B.childNodes.length>0||!(FCKListsLib.BlockElements[C]||FCKListsLib.NonEmptyBlockElements[C])){return;};A=new FCKDomRange(this.Window);A.MoveToElementEditStart(B);A.Select();};function FCKEditingArea_Cleanup(){if (this.Document) this.Document.body.innerHTML="";this.TargetElement=null;this.IFrame=null;this.Document=null;this.Textarea=null;if (this.Window){this.Window._FCKEditingArea=null;this.Window=null;}}; +var FCKKeystrokeHandler=function(A){this.Keystrokes={};this.CancelCtrlDefaults=(A!==false);};FCKKeystrokeHandler.prototype.AttachToElement=function(A){FCKTools.AddEventListenerEx(A,'keydown',_FCKKeystrokeHandler_OnKeyDown,this);if (FCKBrowserInfo.IsGecko10||FCKBrowserInfo.IsOpera||(FCKBrowserInfo.IsGecko&&FCKBrowserInfo.IsMac)) FCKTools.AddEventListenerEx(A,'keypress',_FCKKeystrokeHandler_OnKeyPress,this);};FCKKeystrokeHandler.prototype.SetKeystrokes=function(){for (var i=0;i40))){B._CancelIt=true;if (A.preventDefault) return A.preventDefault();A.returnValue=false;A.cancelBubble=true;return false;};return true;};function _FCKKeystrokeHandler_OnKeyPress(A,B){if (B._CancelIt){if (A.preventDefault) return A.preventDefault();return false;};return true;}; +FCK.DTD=(function(){var X=FCKTools.Merge;var A,L,J,M,N,O,D,H,P,K,Q,F,G,C,B,E,I;A={isindex:1,fieldset:1};B={input:1,button:1,select:1,textarea:1,label:1};C=X({a:1},B);D=X({iframe:1},C);E={hr:1,ul:1,menu:1,div:1,blockquote:1,noscript:1,table:1,center:1,address:1,dir:1,pre:1,h5:1,dl:1,h4:1,noframes:1,h6:1,ol:1,h1:1,h3:1,h2:1};F={ins:1,del:1,script:1};G=X({b:1,acronym:1,bdo:1,'var':1,'#':1,abbr:1,code:1,br:1,i:1,cite:1,kbd:1,u:1,strike:1,s:1,tt:1,strong:1,q:1,samp:1,em:1,dfn:1,span:1},F);H=X({sub:1,img:1,object:1,sup:1,basefont:1,map:1,applet:1,font:1,big:1,small:1},G);I=X({p:1},H);J=X({iframe:1},H,B);K={img:1,noscript:1,br:1,kbd:1,center:1,button:1,basefont:1,h5:1,h4:1,samp:1,h6:1,ol:1,h1:1,h3:1,h2:1,form:1,font:1,'#':1,select:1,menu:1,ins:1,abbr:1,label:1,code:1,table:1,script:1,cite:1,input:1,iframe:1,strong:1,textarea:1,noframes:1,big:1,small:1,span:1,hr:1,sub:1,bdo:1,'var':1,div:1,object:1,sup:1,strike:1,dir:1,map:1,dl:1,applet:1,del:1,isindex:1,fieldset:1,ul:1,b:1,acronym:1,a:1,blockquote:1,i:1,u:1,s:1,tt:1,address:1,q:1,pre:1,p:1,em:1,dfn:1};L=X({a:1},J);M={tr:1};N={'#':1};O=X({param:1},K);P=X({form:1},A,D,E,I);Q={li:1};return {col:{},tr:{td:1,th:1},img:{},colgroup:{col:1},noscript:P,td:P,br:{},th:P,center:P,kbd:L,button:X(I,E),basefont:{},h5:L,h4:L,samp:L,h6:L,ol:Q,h1:L,h3:L,option:N,h2:L,form:X(A,D,E,I),select:{optgroup:1,option:1},font:J,ins:P,menu:Q,abbr:L,label:L,table:{thead:1,col:1,tbody:1,tr:1,colgroup:1,caption:1,tfoot:1},code:L,script:N,tfoot:M,cite:L,li:P,input:{},iframe:P,strong:J,textarea:N,noframes:P,big:J,small:J,span:J,hr:{},dt:L,sub:J,optgroup:{option:1},param:{},bdo:L,'var':J,div:P,object:O,sup:J,dd:P,strike:J,area:{},dir:Q,map:X({area:1,form:1,p:1},A,F,E),applet:O,dl:{dt:1,dd:1},del:P,isindex:{},fieldset:X({legend:1},K),thead:M,ul:Q,acronym:L,b:J,a:J,blockquote:P,caption:L,i:J,u:J,tbody:M,s:L,address:X(D,I),tt:J,legend:L,q:L,pre:X(G,C),p:L,em:J,dfn:L};})(); +var FCKStyle=function(A){this.Element=(A.Element||'span').toLowerCase();this._StyleDesc=A;};FCKStyle.prototype={GetType:function(){var A=this.GetType_$;if (A!=undefined) return A;var B=this.Element;if (B=='#'||FCKListsLib.StyleBlockElements[B]) A=0;else if (FCKListsLib.StyleObjectElements[B]) A=2;else A=1;return (this.GetType_$=A);},ApplyToSelection:function(A){var B=new FCKDomRange(A);B.MoveToSelection();this.ApplyToRange(B,true);},ApplyToRange:function(A,B,C){switch (this.GetType()){case 0:this.ApplyToRange=this._ApplyBlockStyle;break;case 1:this.ApplyToRange=this._ApplyInlineStyle;break;default:return;};this.ApplyToRange(A,B,C);},ApplyToObject:function(A){if (!A) return;this.BuildElement(null,A);},RemoveFromSelection:function(A){var B=new FCKDomRange(A);B.MoveToSelection();this.RemoveFromRange(B,true);},RemoveFromRange:function(A,B,C){var D;var E=this._GetAttribsForComparison();var F=this._GetOverridesForComparison();if (A.CheckIsCollapsed()){var D=A.CreateBookmark(true);var H=A.GetBookmarkNode(D,true);var I=new FCKElementPath(H.parentNode);var J=[];var K=!FCKDomTools.GetNextSibling(H);var L=K||!FCKDomTools.GetPreviousSibling(H);var M;var N=-1;for (var i=0;i=0;i--){var E=D[i];for (var F in B){if (FCKDomTools.HasAttribute(E,F)){switch (F){case 'style':this._RemoveStylesFromElement(E);break;case 'class':if (FCKDomTools.GetAttributeValue(E,F)!=this.GetFinalAttributeValue(F)) continue;default:FCKDomTools.RemoveAttribute(E,F);}}};this._RemoveOverrides(E,C[this.Element]);this._RemoveNoAttribElement(E);};for (var G in C){if (G!=this.Element){D=A.getElementsByTagName(G);for (var i=D.length-1;i>=0;i--){var E=D[i];this._RemoveOverrides(E,C[G]);this._RemoveNoAttribElement(E);}}}},_RemoveStylesFromElement:function(A){var B=A.style.cssText;var C=this.GetFinalStyleValue();if (B.length>0&&C.length==0) return;C='(^|;)\\s*('+C.replace(/\s*([^ ]+):.*?(;|$)/g,'$1|').replace(/\|$/,'')+'):[^;]+';var D=new RegExp(C,'gi');B=B.replace(D,'').Trim();if (B.length==0||B==';') FCKDomTools.RemoveAttribute(A,'style');else A.style.cssText=B.replace(D,'');},_RemoveOverrides:function(A,B){var C=B&&B.Attributes;if (C){for (var i=0;i0) C.style.cssText=this.GetFinalStyleValue();return C;},_CompareAttributeValues:function(A,B,C){if (A=='style'&&B&&C){B=B.replace(/;$/,'').toLowerCase();C=C.replace(/;$/,'').toLowerCase();};return (B==C||((B===null||B==='')&&(C===null||C==='')))},GetFinalAttributeValue:function(A){var B=this._StyleDesc.Attributes;var B=B?B[A]:null;if (!B&&A=='style') return this.GetFinalStyleValue();if (B&&this._Variables) B=B.Replace(FCKRegexLib.StyleVariableAttName,this._GetVariableReplace,this);return B;},GetFinalStyleValue:function(){var A=this._GetStyleText();if (A.length>0&&this._Variables){A=A.Replace(FCKRegexLib.StyleVariableAttName,this._GetVariableReplace,this);A=FCKTools.NormalizeCssText(A);};return A;},_GetVariableReplace:function(){return this._Variables[arguments[2]]||arguments[0];},SetVariable:function(A,B){var C=this._Variables;if (!C) C=this._Variables={};this._Variables[A]=B;},_FromPre:function(A,B,C){var D=B.innerHTML;D=D.replace(/(\r\n|\r)/g,'\n');D=D.replace(/^[ \t]*\n/,'');D=D.replace(/\n$/,'');D=D.replace(/^[ \t]+|[ \t]+$/g,function(match,offset,s){if (match.length==1) return ' ';else if (offset==0) return new Array(match.length).join(' ')+' ';else return ' '+new Array(match.length).join(' ');});var E=new FCKHtmlIterator(D);var F=[];E.Each(function(isTag,value){if (!isTag){value=value.replace(/\n/g,'
        ');value=value.replace(/[ \t]{2,}/g,function (match){return new Array(match.length).join(' ')+' ';});};F.push(value);});C.innerHTML=F.join('');return C;},_ToPre:function(A,B,C){var D=B.innerHTML.Trim();D=D.replace(/[ \t\r\n]*(]*>)[ \t\r\n]*/gi,'
        ');var E=new FCKHtmlIterator(D);var F=[];E.Each(function(isTag,value){if (!isTag) value=value.replace(/([ \t\n\r]+| )/g,' ');else if (isTag&&value=='
        ') value='\n';F.push(value);});if (FCKBrowserInfo.IsIE){var G=A.createElement('div');G.appendChild(C);C.outerHTML='
        \n'+F.join('')+'
        ';C=G.removeChild(G.firstChild);}else C.innerHTML=F.join('');return C;},_ApplyBlockStyle:function(A,B,C){var D;if (B) D=A.CreateBookmark();var E=new FCKDomRangeIterator(A);E.EnforceRealBlocks=true;var F;var G=A.Window.document;var H=[];var I=[];while((F=E.GetNextParagraph())){var J=this.BuildElement(G);var K=J.nodeName.IEquals('pre');var L=F.nodeName.IEquals('pre');if (K&&!L){J=this._ToPre(G,F,J);H.push(J);}else if (!K&&L){J=this._FromPre(G,F,J);I.push(J);}else FCKDomTools.MoveChildren(F,J);F.parentNode.insertBefore(J,F);FCKDomTools.RemoveNode(F);};for (var i=0;i0){A.InsertNode(I);this.RemoveFromElement(I);this._MergeSiblings(I,this._GetAttribsForComparison());if (!FCKBrowserInfo.IsIE) I.normalize();};A.Release(true);}};this._FixBookmarkStart(K);if (B) A.SelectBookmark(J);if (C) A.MoveToBookmark(J);},_FixBookmarkStart:function(A){var B;while ((B=A.nextSibling)){if (B.nodeType==1&&FCKListsLib.InlineNonEmptyElements[B.nodeName.toLowerCase()]){if (!B.firstChild) FCKDomTools.RemoveNode(B);else FCKDomTools.MoveNode(A,B,true);continue;};if (B.nodeType==3&&B.length==0){FCKDomTools.RemoveNode(B);continue;};break;}},_MergeSiblings:function(A,B){if (!A||A.nodeType!=1||!FCKListsLib.InlineNonEmptyElements[A.nodeName.toLowerCase()]) return;this._MergeNextSibling(A,B);this._MergePreviousSibling(A,B);},_MergeNextSibling:function(A,B){var C=A.nextSibling;var D=(C&&C.nodeType==1&&C.getAttribute('_fck_bookmark'));if (D) C=C.nextSibling;if (C&&C.nodeType==1&&C.nodeName==A.nodeName){if (!B) B=this._CreateElementAttribsForComparison(A);if (this._CheckAttributesMatch(C,B)){var E=A.lastChild;if (D) FCKDomTools.MoveNode(A.nextSibling,A);FCKDomTools.MoveChildren(C,A);FCKDomTools.RemoveNode(C);if (E) this._MergeNextSibling(E);}}},_MergePreviousSibling:function(A,B){var C=A.previousSibling;var D=(C&&C.nodeType==1&&C.getAttribute('_fck_bookmark'));if (D) C=C.previousSibling;if (C&&C.nodeType==1&&C.nodeName==A.nodeName){if (!B) B=this._CreateElementAttribsForComparison(A);if (this._CheckAttributesMatch(C,B)){var E=A.firstChild;if (D) FCKDomTools.MoveNode(A.previousSibling,A,true);FCKDomTools.MoveChildren(C,A,true);FCKDomTools.RemoveNode(C);if (E) this._MergePreviousSibling(E);}}},_GetStyleText:function(){var A=this._StyleDesc.Styles;var B=(this._StyleDesc.Attributes?this._StyleDesc.Attributes['style']||'':'');if (B.length>0) B+=';';for (var C in A) B+=C+':'+A[C]+';';if (B.length>0&&!(/#\(/.test(B))){B=FCKTools.NormalizeCssText(B);};return (this._GetStyleText=function() { return B;})();},_GetAttribsForComparison:function(){var A=this._GetAttribsForComparison_$;if (A) return A;A={};var B=this._StyleDesc.Attributes;if (B){for (var C in B){A[C.toLowerCase()]=B[C].toLowerCase();}};if (this._GetStyleText().length>0){A['style']=this._GetStyleText().toLowerCase();};FCKTools.AppendLengthProperty(A,'_length');return (this._GetAttribsForComparison_$=A);},_GetOverridesForComparison:function(){var A=this._GetOverridesForComparison_$;if (A) return A;A={};var B=this._StyleDesc.Overrides;if (B){if (!FCKTools.IsArray(B)) B=[B];for (var i=0;i0) return true;};B=B.nextSibling;};return false;}}; +var FCKElementPath=function(A){var B=null;var C=null;var D=[];var e=A;while (e){if (e.nodeType==1){if (!this.LastElement) this.LastElement=e;var E=e.nodeName.toLowerCase();if (FCKBrowserInfo.IsIE&&e.scopeName!='HTML') E=e.scopeName.toLowerCase()+':'+E;if (!C){if (!B&&FCKListsLib.PathBlockElements[E]!=null) B=e;if (FCKListsLib.PathBlockLimitElements[E]!=null){if (!B&&E=='div'&&!FCKElementPath._CheckHasBlock(e)) B=e;else C=e;}};D.push(e);if (E=='body') break;};e=e.parentNode;};this.Block=B;this.BlockLimit=C;this.Elements=D;};FCKElementPath._CheckHasBlock=function(A){var B=A.childNodes;for (var i=0,count=B.length;i0){if (D.nodeType==3){var G=D.nodeValue.substr(0,E).Trim();if (G.length!=0) return A.IsStartOfBlock=false;}else F=D.childNodes[E-1];};if (!F) F=FCKDomTools.GetPreviousSourceNode(D,true,null,C);while (F){switch (F.nodeType){case 1:if (!FCKListsLib.InlineChildReqElements[F.nodeName.toLowerCase()]) return A.IsStartOfBlock=false;break;case 3:if (F.nodeValue.Trim().length>0) return A.IsStartOfBlock=false;};F=FCKDomTools.GetPreviousSourceNode(F,false,null,C);};return A.IsStartOfBlock=true;},CheckEndOfBlock:function(A){var B=this._Cache.IsEndOfBlock;if (B!=undefined) return B;var C=this.EndBlock||this.EndBlockLimit;var D=this._Range.endContainer;var E=this._Range.endOffset;var F;if (D.nodeType==3){var G=D.nodeValue;if (E0) return this._Cache.IsEndOfBlock=false;};F=FCKDomTools.GetNextSourceNode(F,false,null,C);};if (A) this.Select();return this._Cache.IsEndOfBlock=true;},CreateBookmark:function(A){var B={StartId:(new Date()).valueOf()+Math.floor(Math.random()*1000)+'S',EndId:(new Date()).valueOf()+Math.floor(Math.random()*1000)+'E'};var C=this.Window.document;var D;var E;var F;if (!this.CheckIsCollapsed()){E=C.createElement('span');E.style.display='none';E.id=B.EndId;E.setAttribute('_fck_bookmark',true);E.innerHTML=' ';F=this.Clone();F.Collapse(false);F.InsertNode(E);};D=C.createElement('span');D.style.display='none';D.id=B.StartId;D.setAttribute('_fck_bookmark',true);D.innerHTML=' ';F=this.Clone();F.Collapse(true);F.InsertNode(D);if (A){B.StartNode=D;B.EndNode=E;};if (E){this.SetStart(D,4);this.SetEnd(E,3);}else this.MoveToPosition(D,4);return B;},GetBookmarkNode:function(A,B){var C=this.Window.document;if (B) return A.StartNode||C.getElementById(A.StartId);else return A.EndNode||C.getElementById(A.EndId);},MoveToBookmark:function(A,B){var C=this.GetBookmarkNode(A,true);var D=this.GetBookmarkNode(A,false);this.SetStart(C,3);if (!B) FCKDomTools.RemoveNode(C);if (D){this.SetEnd(D,3);if (!B) FCKDomTools.RemoveNode(D);}else this.Collapse(true);this._UpdateElementInfo();},CreateBookmark2:function(){if (!this._Range) return { "Start":0,"End":0 };var A={"Start":[this._Range.startOffset],"End":[this._Range.endOffset]};var B=this._Range.startContainer.previousSibling;var C=this._Range.endContainer.previousSibling;var D=this._Range.startContainer;var E=this._Range.endContainer;while (B&&D.nodeType==3){A.Start[0]+=B.length;D=B;B=B.previousSibling;}while (C&&E.nodeType==3){A.End[0]+=C.length;E=C;C=C.previousSibling;};if (D.nodeType==1&&D.childNodes[A.Start[0]]&&D.childNodes[A.Start[0]].nodeType==3){var F=D.childNodes[A.Start[0]];var G=0;while (F.previousSibling&&F.previousSibling.nodeType==3){F=F.previousSibling;G+=F.length;};D=F;A.Start[0]=G;};if (E.nodeType==1&&E.childNodes[A.End[0]]&&E.childNodes[A.End[0]].nodeType==3){var F=E.childNodes[A.End[0]];var G=0;while (F.previousSibling&&F.previousSibling.nodeType==3){F=F.previousSibling;G+=F.length;};E=F;A.End[0]=G;};A.Start=FCKDomTools.GetNodeAddress(D,true).concat(A.Start);A.End=FCKDomTools.GetNodeAddress(E,true).concat(A.End);return A;},MoveToBookmark2:function(A){var B=FCKDomTools.GetNodeFromAddress(this.Window.document,A.Start.slice(0,-1),true);var C=FCKDomTools.GetNodeFromAddress(this.Window.document,A.End.slice(0,-1),true);this.Release(true);this._Range=new FCKW3CRange(this.Window.document);var D=A.Start[A.Start.length-1];var E=A.End[A.End.length-1];while (B.nodeType==3&&D>B.length){if (!B.nextSibling||B.nextSibling.nodeType!=3) break;D-=B.length;B=B.nextSibling;}while (C.nodeType==3&&E>C.length){if (!C.nextSibling||C.nextSibling.nodeType!=3) break;E-=C.length;C=C.nextSibling;};this._Range.setStart(B,D);this._Range.setEnd(C,E);this._UpdateElementInfo();},MoveToPosition:function(A,B){this.SetStart(A,B);this.Collapse(true);},SetStart:function(A,B,C){var D=this._Range;if (!D) D=this._Range=this.CreateRange();switch(B){case 1:D.setStart(A,0);break;case 2:D.setStart(A,A.childNodes.length);break;case 3:D.setStartBefore(A);break;case 4:D.setStartAfter(A);};if (!C) this._UpdateElementInfo();},SetEnd:function(A,B,C){var D=this._Range;if (!D) D=this._Range=this.CreateRange();switch(B){case 1:D.setEnd(A,0);break;case 2:D.setEnd(A,A.childNodes.length);break;case 3:D.setEndBefore(A);break;case 4:D.setEndAfter(A);};if (!C) this._UpdateElementInfo();},Expand:function(A){var B,oSibling;switch (A){case 'inline_elements':if (this._Range.startOffset==0){B=this._Range.startContainer;if (B.nodeType!=1) B=B.previousSibling?null:B.parentNode;if (B){while (FCKListsLib.InlineNonEmptyElements[B.nodeName.toLowerCase()]){this._Range.setStartBefore(B);if (B!=B.parentNode.firstChild) break;B=B.parentNode;}}};B=this._Range.endContainer;var C=this._Range.endOffset;if ((B.nodeType==3&&C>=B.nodeValue.length)||(B.nodeType==1&&C>=B.childNodes.length)||(B.nodeType!=1&&B.nodeType!=3)){if (B.nodeType!=1) B=B.nextSibling?null:B.parentNode;if (B){while (FCKListsLib.InlineNonEmptyElements[B.nodeName.toLowerCase()]){this._Range.setEndAfter(B);if (B!=B.parentNode.lastChild) break;B=B.parentNode;}}};break;case 'block_contents':case 'list_contents':var D=FCKListsLib.BlockBoundaries;if (A=='list_contents'||FCKConfig.EnterMode=='br') D=FCKListsLib.ListBoundaries;if (this.StartBlock&&FCKConfig.EnterMode!='br'&&A=='block_contents') this.SetStart(this.StartBlock,1);else{B=this._Range.startContainer;if (B.nodeType==1){var E=B.childNodes[this._Range.startOffset];if (E) B=FCKDomTools.GetPreviousSourceNode(E,true);else B=B.lastChild||B;}while (B&&(B.nodeType!=1||(B!=this.StartBlockLimit&&!D[B.nodeName.toLowerCase()]))){this._Range.setStartBefore(B);B=B.previousSibling||B.parentNode;}};if (this.EndBlock&&FCKConfig.EnterMode!='br'&&A=='block_contents'&&this.EndBlock.nodeName.toLowerCase()!='li') this.SetEnd(this.EndBlock,2);else{B=this._Range.endContainer;if (B.nodeType==1) B=B.childNodes[this._Range.endOffset]||B.lastChild;while (B&&(B.nodeType!=1||(B!=this.StartBlockLimit&&!D[B.nodeName.toLowerCase()]))){this._Range.setEndAfter(B);B=B.nextSibling||B.parentNode;};if (B&&B.nodeName.toLowerCase()=='br') this._Range.setEndAfter(B);};this._UpdateElementInfo();}},SplitBlock:function(A){var B=A||FCKConfig.EnterMode;if (!this._Range) this.MoveToSelection();if (this.StartBlockLimit==this.EndBlockLimit){var C=this.StartBlock;var D=this.EndBlock;var E=null;if (B!='br'){if (!C){C=this.FixBlock(true,B);D=this.EndBlock;};if (!D) D=this.FixBlock(false,B);};var F=(C!=null&&this.CheckStartOfBlock());var G=(D!=null&&this.CheckEndOfBlock());if (!this.CheckIsEmpty()) this.DeleteContents();if (C&&D&&C==D){if (G){E=new FCKElementPath(this.StartContainer);this.MoveToPosition(D,4);D=null;}else if (F){E=new FCKElementPath(this.StartContainer);this.MoveToPosition(C,3);C=null;}else{this.SetEnd(C,2);var H=this.ExtractContents();D=C.cloneNode(false);D.removeAttribute('id',false);H.AppendTo(D);FCKDomTools.InsertAfterNode(C,D);this.MoveToPosition(C,4);if (FCKBrowserInfo.IsGecko&&!C.nodeName.IEquals(['ul','ol'])) FCKTools.AppendBogusBr(C);}};return {PreviousBlock:C,NextBlock:D,WasStartOfBlock:F,WasEndOfBlock:G,ElementPath:E};};return null;},FixBlock:function(A,B){var C=this.CreateBookmark();this.Collapse(A);this.Expand('block_contents');var D=this.Window.document.createElement(B);this.ExtractContents().AppendTo(D);FCKDomTools.TrimNode(D);if (FCKDomTools.CheckIsEmptyElement(D,function(element) { return element.getAttribute('_fck_bookmark')!='true';})&&FCKBrowserInfo.IsGeckoLike) FCKTools.AppendBogusBr(D);this.InsertNode(D);this.MoveToBookmark(C);return D;},Release:function(A){if (!A) this.Window=null;this.StartNode=null;this.StartContainer=null;this.StartBlock=null;this.StartBlockLimit=null;this.EndNode=null;this.EndContainer=null;this.EndBlock=null;this.EndBlockLimit=null;this._Range=null;this._Cache=null;},CheckHasRange:function(){return!!this._Range;},GetTouchedStartNode:function(){var A=this._Range;var B=A.startContainer;if (A.collapsed||B.nodeType!=1) return B;return B.childNodes[A.startOffset]||B;},GetTouchedEndNode:function(){var A=this._Range;var B=A.endContainer;if (A.collapsed||B.nodeType!=1) return B;return B.childNodes[A.endOffset-1]||B;}}; +FCKDomRange.prototype.MoveToSelection=function(){this.Release(true);this._Range=new FCKW3CRange(this.Window.document);var A=this.Window.document.selection;if (A.type!='Control'){var B=this._GetSelectionMarkerTag(true);var C=this._GetSelectionMarkerTag(false);if (!B&&!C){this._Range.setStart(this.Window.document.body,0);this._UpdateElementInfo();return;};this._Range.setStart(B.parentNode,FCKDomTools.GetIndexOf(B));B.parentNode.removeChild(B);this._Range.setEnd(C.parentNode,FCKDomTools.GetIndexOf(C));C.parentNode.removeChild(C);this._UpdateElementInfo();}else{var D=A.createRange().item(0);if (D){this._Range.setStartBefore(D);this._Range.setEndAfter(D);this._UpdateElementInfo();}}};FCKDomRange.prototype.Select=function(A){if (this._Range) this.SelectBookmark(this.CreateBookmark(true),A);};FCKDomRange.prototype.SelectBookmark=function(A,B){var C=this.CheckIsCollapsed();var D;var E;var F=this.GetBookmarkNode(A,true);if (!F) return;var G;if (!C) G=this.GetBookmarkNode(A,false);var H=this.Window.document.body.createTextRange();H.moveToElementText(F);H.moveStart('character',1);if (G){var I=this.Window.document.body.createTextRange();I.moveToElementText(G);H.setEndPoint('EndToEnd',I);H.moveEnd('character',-1);}else{D=(B||!F.previousSibling||F.previousSibling.nodeName.toLowerCase()=='br')&&!F.nextSibing;E=this.Window.document.createElement('span');E.innerHTML='';F.parentNode.insertBefore(E,F);if (D){F.parentNode.insertBefore(this.Window.document.createTextNode('\ufeff'),F);}};if (!this._Range) this._Range=this.CreateRange();this._Range.setStartBefore(F);F.parentNode.removeChild(F);if (C){if (D){H.moveStart('character',-1);H.select();this.Window.document.selection.clear();}else H.select();FCKDomTools.RemoveNode(E);}else{this._Range.setEndBefore(G);G.parentNode.removeChild(G);H.select();}};FCKDomRange.prototype._GetSelectionMarkerTag=function(A){var B=this.Window.document;var C=B.selection;var D;try{D=C.createRange();}catch (e){return null;};if (D.parentElement().document!=B) return null;D.collapse(A===true);var E='fck_dom_range_temp_'+(new Date()).valueOf()+'_'+Math.floor(Math.random()*1000);D.pasteHTML('');return B.getElementById(E);}; +var FCKDomRangeIterator=function(A){this.Range=A;this.ForceBrBreak=false;this.EnforceRealBlocks=false;};FCKDomRangeIterator.CreateFromSelection=function(A){var B=new FCKDomRange(A);B.MoveToSelection();return new FCKDomRangeIterator(B);};FCKDomRangeIterator.prototype={GetNextParagraph:function(){var A;var B;var C;var D;var E;var F=this.ForceBrBreak?FCKListsLib.ListBoundaries:FCKListsLib.BlockBoundaries;if (!this._LastNode){var B=this.Range.Clone();B.Expand(this.ForceBrBreak?'list_contents':'block_contents');this._NextNode=B.GetTouchedStartNode();this._LastNode=B.GetTouchedEndNode();B=null;};var H=this._NextNode;var I=this._LastNode;this._NextNode=null;while (H){var J=false;var K=(H.nodeType!=1);var L=false;if (!K){var M=H.nodeName.toLowerCase();if (F[M]&&(!FCKBrowserInfo.IsIE||H.scopeName=='HTML')){if (M=='br') K=true;else if (!B&&H.childNodes.length==0&&M!='hr'){A=H;C=H==I;break;};if (B){B.SetEnd(H,3,true);if (M!='br') this._NextNode=H;};J=true;}else{if (H.firstChild){if (!B){B=new FCKDomRange(this.Range.Window);B.SetStart(H,3,true);};H=H.firstChild;continue;};K=true;}}else if (H.nodeType==3){if (/^[\r\n\t ]+$/.test(H.nodeValue)) K=false;};if (K&&!B){B=new FCKDomRange(this.Range.Window);B.SetStart(H,3,true);};C=((!J||K)&&H==I);if (B&&!J){while (!H.nextSibling&&!C){var N=H.parentNode;if (F[N.nodeName.toLowerCase()]){J=true;C=C||(N==I);break;};H=N;K=true;C=(H==I);L=true;}};if (K) B.SetEnd(H,4,true);if ((J||C)&&B){B._UpdateElementInfo();if (B.StartNode==B.EndNode&&B.StartNode.parentNode==B.StartBlockLimit&&B.StartNode.getAttribute&&B.StartNode.getAttribute('_fck_bookmark')) B=null;else break;};if (C) break;H=FCKDomTools.GetNextSourceNode(H,L,null,I);};if (!A){if (!B){this._NextNode=null;return null;};A=B.StartBlock;if (!A&&!this.EnforceRealBlocks&&B.StartBlockLimit.nodeName.IEquals('DIV','TH','TD')&&B.CheckStartOfBlock()&&B.CheckEndOfBlock()){A=B.StartBlockLimit;}else if (!A||(this.EnforceRealBlocks&&A.nodeName.toLowerCase()=='li')){A=this.Range.Window.document.createElement(FCKConfig.EnterMode=='p'?'p':'div');B.ExtractContents().AppendTo(A);FCKDomTools.TrimNode(A);B.InsertNode(A);D=true;E=true;}else if (A.nodeName.toLowerCase()!='li'){if (!B.CheckStartOfBlock()||!B.CheckEndOfBlock()){A=A.cloneNode(false);B.ExtractContents().AppendTo(A);FCKDomTools.TrimNode(A);var O=B.SplitBlock();D=!O.WasStartOfBlock;E=!O.WasEndOfBlock;B.InsertNode(A);}}else if (!C){this._NextNode=A==I?null:FCKDomTools.GetNextSourceNode(B.EndNode,true,null,I);return A;}};if (D){var P=A.previousSibling;if (P&&P.nodeType==1){if (P.nodeName.toLowerCase()=='br') P.parentNode.removeChild(P);else if (P.lastChild&&P.lastChild.nodeName.IEquals('br')) P.removeChild(P.lastChild);}};if (E){var Q=A.lastChild;if (Q&&Q.nodeType==1&&Q.nodeName.toLowerCase()=='br') A.removeChild(Q);};if (!this._NextNode) this._NextNode=(C||A==I)?null:FCKDomTools.GetNextSourceNode(A,true,null,I);return A;}}; +var FCKDocumentFragment=function(A){this._Document=A;this.RootNode=A.createElement('div');};FCKDocumentFragment.prototype={AppendTo:function(A){FCKDomTools.MoveChildren(this.RootNode,A);},AppendHtml:function(A){var B=this._Document.createElement('div');B.innerHTML=A;FCKDomTools.MoveChildren(B,this.RootNode);},InsertAfterNode:function(A){var B=this.RootNode;var C;while((C=B.lastChild)) FCKDomTools.InsertAfterNode(A,B.removeChild(C));}}; +var FCKW3CRange=function(A){this._Document=A;this.startContainer=null;this.startOffset=null;this.endContainer=null;this.endOffset=null;this.collapsed=true;};FCKW3CRange.CreateRange=function(A){return new FCKW3CRange(A);};FCKW3CRange.CreateFromRange=function(A,B){var C=FCKW3CRange.CreateRange(A);C.setStart(B.startContainer,B.startOffset);C.setEnd(B.endContainer,B.endOffset);return C;};FCKW3CRange.prototype={_UpdateCollapsed:function(){this.collapsed=(this.startContainer==this.endContainer&&this.startOffset==this.endOffset);},setStart:function(A,B){this.startContainer=A;this.startOffset=B;if (!this.endContainer){this.endContainer=A;this.endOffset=B;};this._UpdateCollapsed();},setEnd:function(A,B){this.endContainer=A;this.endOffset=B;if (!this.startContainer){this.startContainer=A;this.startOffset=B;};this._UpdateCollapsed();},setStartAfter:function(A){this.setStart(A.parentNode,FCKDomTools.GetIndexOf(A)+1);},setStartBefore:function(A){this.setStart(A.parentNode,FCKDomTools.GetIndexOf(A));},setEndAfter:function(A){this.setEnd(A.parentNode,FCKDomTools.GetIndexOf(A)+1);},setEndBefore:function(A){this.setEnd(A.parentNode,FCKDomTools.GetIndexOf(A));},collapse:function(A){if (A){this.endContainer=this.startContainer;this.endOffset=this.startOffset;}else{this.startContainer=this.endContainer;this.startOffset=this.endOffset;};this.collapsed=true;},selectNodeContents:function(A){this.setStart(A,0);this.setEnd(A,A.nodeType==3?A.data.length:A.childNodes.length);},insertNode:function(A){var B=this.startContainer;var C=this.startOffset;if (B.nodeType==3){B.splitText(C);if (B==this.endContainer) this.setEnd(B.nextSibling,this.endOffset-this.startOffset);FCKDomTools.InsertAfterNode(B,A);return;}else{B.insertBefore(A,B.childNodes[C]||null);if (B==this.endContainer){this.endOffset++;this.collapsed=false;}}},deleteContents:function(){if (this.collapsed) return;this._ExecContentsAction(0);},extractContents:function(){var A=new FCKDocumentFragment(this._Document);if (!this.collapsed) this._ExecContentsAction(1,A);return A;},cloneContents:function(){var A=new FCKDocumentFragment(this._Document);if (!this.collapsed) this._ExecContentsAction(2,A);return A;},_ExecContentsAction:function(A,B){var C=this.startContainer;var D=this.endContainer;var E=this.startOffset;var F=this.endOffset;var G=false;var H=false;if (D.nodeType==3) D=D.splitText(F);else{if (D.childNodes.length>0){if (F>D.childNodes.length-1){D=FCKDomTools.InsertAfterNode(D.lastChild,this._Document.createTextNode(''));H=true;}else D=D.childNodes[F];}};if (C.nodeType==3){C.splitText(E);if (C==D) D=C.nextSibling;}else{if (E==0){C=C.insertBefore(this._Document.createTextNode(''),C.firstChild);G=true;}else if (E>C.childNodes.length-1){C=C.appendChild(this._Document.createTextNode(''));G=true;}else C=C.childNodes[E].previousSibling;};var I=FCKDomTools.GetParents(C);var J=FCKDomTools.GetParents(D);var i,topStart,topEnd;for (i=0;i0&&levelStartNode!=D) levelClone=K.appendChild(levelStartNode.cloneNode(levelStartNode==D));if (!I[k]||levelStartNode.parentNode!=I[k].parentNode){currentNode=levelStartNode.previousSibling;while(currentNode){if (currentNode==I[k]||currentNode==C) break;currentSibling=currentNode.previousSibling;if (A==2) K.insertBefore(currentNode.cloneNode(true),K.firstChild);else{currentNode.parentNode.removeChild(currentNode);if (A==1) K.insertBefore(currentNode,K.firstChild);};currentNode=currentSibling;}};if (K) K=levelClone;};if (A==2){var L=this.startContainer;if (L.nodeType==3){L.data+=L.nextSibling.data;L.parentNode.removeChild(L.nextSibling);};var M=this.endContainer;if (M.nodeType==3&&M.nextSibling){M.data+=M.nextSibling.data;M.parentNode.removeChild(M.nextSibling);}}else{if (topStart&&topEnd&&(C.parentNode!=topStart.parentNode||D.parentNode!=topEnd.parentNode)){var N=FCKDomTools.GetIndexOf(topEnd);if (G&&topEnd.parentNode==C.parentNode) N--;this.setStart(topEnd.parentNode,N);};this.collapse(true);};if(G) C.parentNode.removeChild(C);if(H&&D.parentNode) D.parentNode.removeChild(D);},cloneRange:function(){return FCKW3CRange.CreateFromRange(this._Document,this);}}; +var FCKEnterKey=function(A,B,C,D){this.Window=A;this.EnterMode=B||'p';this.ShiftEnterMode=C||'br';var E=new FCKKeystrokeHandler(false);E._EnterKey=this;E.OnKeystroke=FCKEnterKey_OnKeystroke;E.SetKeystrokes([[13,'Enter'],[SHIFT+13,'ShiftEnter'],[8,'Backspace'],[CTRL+8,'CtrlBackspace'],[46,'Delete']]);this.TabText='';if (D>0||FCKBrowserInfo.IsSafari){while (D--) this.TabText+='\xa0';E.SetKeystrokes([9,'Tab']);};E.AttachToElement(A.document);};function FCKEnterKey_OnKeystroke(A,B){var C=this._EnterKey;try{switch (B){case 'Enter':return C.DoEnter();break;case 'ShiftEnter':return C.DoShiftEnter();break;case 'Backspace':return C.DoBackspace();break;case 'Delete':return C.DoDelete();break;case 'Tab':return C.DoTab();break;case 'CtrlBackspace':return C.DoCtrlBackspace();break;}}catch (e){};return false;};FCKEnterKey.prototype.DoEnter=function(A,B){FCKUndo.SaveUndoStep();this._HasShift=(B===true);var C=FCKSelection.GetParentElement();var D=new FCKElementPath(C);var E=A||this.EnterMode;if (E=='br'||D.Block&&D.Block.tagName.toLowerCase()=='pre') return this._ExecuteEnterBr();else return this._ExecuteEnterBlock(E);};FCKEnterKey.prototype.DoShiftEnter=function(){return this.DoEnter(this.ShiftEnterMode,true);};FCKEnterKey.prototype.DoBackspace=function(){var A=false;var B=new FCKDomRange(this.Window);B.MoveToSelection();if (FCKBrowserInfo.IsIE&&this._CheckIsAllContentsIncluded(B,this.Window.document.body)){this._FixIESelectAllBug(B);return true;};var C=B.CheckIsCollapsed();if (!C){if (FCKBrowserInfo.IsIE&&this.Window.document.selection.type.toLowerCase()=="control"){var D=this.Window.document.selection.createRange();for (var i=D.length-1;i>=0;i--){var E=D.item(i);E.parentNode.removeChild(E);};return true;};return false;};if (FCKBrowserInfo.IsIE){var F=FCKDomTools.GetPreviousSourceElement(B.StartNode,true);if (F&&F.nodeName.toLowerCase()=='br'){var G=B.Clone();G.SetStart(F,4);if (G.CheckIsEmpty()){F.parentNode.removeChild(F);return true;}}};var H=B.StartBlock;var I=B.EndBlock;if (B.StartBlockLimit==B.EndBlockLimit&&H&&I){if (!C){var J=B.CheckEndOfBlock();B.DeleteContents();if (H!=I){B.SetStart(I,1);B.SetEnd(I,1);};B.Select();A=(H==I);};if (B.CheckStartOfBlock()){var K=B.StartBlock;var L=FCKDomTools.GetPreviousSourceElement(K,true,['BODY',B.StartBlockLimit.nodeName],['UL','OL']);A=this._ExecuteBackspace(B,L,K);}else if (FCKBrowserInfo.IsGeckoLike){B.Select();}};B.Release();return A;};FCKEnterKey.prototype.DoCtrlBackspace=function(){FCKUndo.SaveUndoStep();var A=new FCKDomRange(this.Window);A.MoveToSelection();if (FCKBrowserInfo.IsIE&&this._CheckIsAllContentsIncluded(A,this.Window.document.body)){this._FixIESelectAllBug(A);return true;};return false;};FCKEnterKey.prototype._ExecuteBackspace=function(A,B,C){var D=false;if (!B&&C&&C.nodeName.IEquals('LI')&&C.parentNode.parentNode.nodeName.IEquals('LI')){this._OutdentWithSelection(C,A);return true;};if (B&&B.nodeName.IEquals('LI')){var E=FCKDomTools.GetLastChild(B,['UL','OL']);while (E){B=FCKDomTools.GetLastChild(E,'LI');E=FCKDomTools.GetLastChild(B,['UL','OL']);}};if (B&&C){if (C.nodeName.IEquals('LI')&&!B.nodeName.IEquals('LI')){this._OutdentWithSelection(C,A);return true;};var F=C.parentNode;var G=B.nodeName.toLowerCase();if (FCKListsLib.EmptyElements[G]!=null||G=='table'){FCKDomTools.RemoveNode(B);D=true;}else{FCKDomTools.RemoveNode(C);while (F.innerHTML.Trim().length==0){var H=F.parentNode;H.removeChild(F);F=H;};FCKDomTools.LTrimNode(C);FCKDomTools.RTrimNode(B);A.SetStart(B,2,true);A.Collapse(true);var I=A.CreateBookmark(true);if (!C.tagName.IEquals(['TABLE'])) FCKDomTools.MoveChildren(C,B);A.SelectBookmark(I);D=true;}};return D;};FCKEnterKey.prototype.DoDelete=function(){FCKUndo.SaveUndoStep();var A=false;var B=new FCKDomRange(this.Window);B.MoveToSelection();if (FCKBrowserInfo.IsIE&&this._CheckIsAllContentsIncluded(B,this.Window.document.body)){this._FixIESelectAllBug(B);return true;};if (B.CheckIsCollapsed()&&B.CheckEndOfBlock(FCKBrowserInfo.IsGeckoLike)){var C=B.StartBlock;var D=FCKTools.GetElementAscensor(C,'td');var E=FCKDomTools.GetNextSourceElement(C,true,[B.StartBlockLimit.nodeName],['UL','OL','TR'],true);if (D){var F=FCKTools.GetElementAscensor(E,'td');if (F!=D) return true;};A=this._ExecuteBackspace(B,C,E);};B.Release();return A;};FCKEnterKey.prototype.DoTab=function(){var A=new FCKDomRange(this.Window);A.MoveToSelection();var B=A._Range.startContainer;while (B){if (B.nodeType==1){var C=B.tagName.toLowerCase();if (C=="tr"||C=="td"||C=="th"||C=="tbody"||C=="table") return false;else break;};B=B.parentNode;};if (this.TabText){A.DeleteContents();A.InsertNode(this.Window.document.createTextNode(this.TabText));A.Collapse(false);A.Select();};return true;};FCKEnterKey.prototype._ExecuteEnterBlock=function(A,B){var C=B||new FCKDomRange(this.Window);var D=C.SplitBlock(A);if (D){var E=D.PreviousBlock;var F=D.NextBlock;var G=D.WasStartOfBlock;var H=D.WasEndOfBlock;if (F){if (F.parentNode.nodeName.IEquals('li')){FCKDomTools.BreakParent(F,F.parentNode);FCKDomTools.MoveNode(F,F.nextSibling,true);}}else if (E&&E.parentNode.nodeName.IEquals('li')){FCKDomTools.BreakParent(E,E.parentNode);C.MoveToElementEditStart(E.nextSibling);FCKDomTools.MoveNode(E,E.previousSibling);};if (!G&&!H){if (F.nodeName.IEquals('li')&&F.firstChild&&F.firstChild.nodeName.IEquals(['ul','ol'])) F.insertBefore(FCKTools.GetElementDocument(F).createTextNode('\xa0'),F.firstChild);if (F) C.MoveToElementEditStart(F);}else{if (G&&H&&E.tagName.toUpperCase()=='LI'){C.MoveToElementStart(E);this._OutdentWithSelection(E,C);C.Release();return true;};var I;if (E){var J=E.tagName.toUpperCase();if (!this._HasShift&&!(/^H[1-6]$/).test(J)){I=FCKDomTools.CloneElement(E);}}else if (F) I=FCKDomTools.CloneElement(F);if (!I) I=this.Window.document.createElement(A);var K=D.ElementPath;if (K){for (var i=0,len=K.Elements.length;i=0&&(C=B[i--])){if (C.name.length>0){if (C.innerHTML!==''){if (FCKBrowserInfo.IsIE) C.className+=' FCK__AnchorC';}else{var D=FCKDocumentProcessor_CreateFakeImage('FCK__Anchor',C.cloneNode(true));D.setAttribute('_fckanchor','true',0);C.parentNode.insertBefore(D,C);C.parentNode.removeChild(C);}}}}};var FCKPageBreaksProcessor=FCKDocumentProcessor.AppendNew();FCKPageBreaksProcessor.ProcessDocument=function(A){var B=A.getElementsByTagName('DIV');var C;var i=B.length-1;while (i>=0&&(C=B[i--])){if (C.style.pageBreakAfter=='always'&&C.childNodes.length==1&&C.childNodes[0].style&&C.childNodes[0].style.display=='none'){var D=FCKDocumentProcessor_CreateFakeImage('FCK__PageBreak',C.cloneNode(true));C.parentNode.insertBefore(D,C);C.parentNode.removeChild(C);}}};FCKEmbedAndObjectProcessor=(function(){var A=[];var B=function(el){var C=el.cloneNode(true);var D;var E=D=FCKDocumentProcessor_CreateFakeImage('FCK__UnknownObject',C);FCKEmbedAndObjectProcessor.RefreshView(E,el);for (var i=0;i=0;i--) B(F[i]);var G=doc.getElementsByTagName('embed');for (var i=G.length-1;i>=0;i--) B(G[i]);});},RefreshView:function(placeHolder,original){if (original.getAttribute('width')>0) placeHolder.style.width=FCKTools.ConvertHtmlSizeToStyle(original.getAttribute('width'));if (original.getAttribute('height')>0) placeHolder.style.height=FCKTools.ConvertHtmlSizeToStyle(original.getAttribute('height'));},AddCustomHandler:function(func){A.push(func);}});})();FCK.GetRealElement=function(A){var e=FCKTempBin.Elements[A.getAttribute('_fckrealelement')];if (A.getAttribute('_fckflash')){if (A.style.width.length>0) e.width=FCKTools.ConvertStyleSizeToHtml(A.style.width);if (A.style.height.length>0) e.height=FCKTools.ConvertStyleSizeToHtml(A.style.height);};return e;};if (FCKBrowserInfo.IsIE){FCKDocumentProcessor.AppendNew().ProcessDocument=function(A){var B=A.getElementsByTagName('HR');var C;var i=B.length-1;while (i>=0&&(C=B[i--])){var D=A.createElement('hr');D.mergeAttributes(C,true);FCKDomTools.InsertAfterNode(C,D);C.parentNode.removeChild(C);}}};FCKDocumentProcessor.AppendNew().ProcessDocument=function(A){var B=A.getElementsByTagName('INPUT');var C;var i=B.length-1;while (i>=0&&(C=B[i--])){if (C.type=='hidden'){var D=FCKDocumentProcessor_CreateFakeImage('FCK__InputHidden',C.cloneNode(true));D.setAttribute('_fckinputhidden','true',0);C.parentNode.insertBefore(D,C);C.parentNode.removeChild(C);}}};FCKEmbedAndObjectProcessor.AddCustomHandler(function(A,B){if (!(A.nodeName.IEquals('embed')&&(A.type=='application/x-shockwave-flash'||/\.swf($|#|\?)/i.test(A.src)))) return;B.className='FCK__Flash';B.setAttribute('_fckflash','true',0);});if (FCKBrowserInfo.IsSafari){FCKDocumentProcessor.AppendNew().ProcessDocument=function(A){var B=A.getElementsByClassName?A.getElementsByClassName('Apple-style-span'):Array.prototype.filter.call(A.getElementsByTagName('span'),function(item){ return item.className=='Apple-style-span';});for (var i=B.length-1;i>=0;i--) FCKDomTools.RemoveNode(B[i],true);}}; +var FCKSelection=FCK.Selection={GetParentBlock:function(){var A=this.GetParentElement();while (A){if (FCKListsLib.BlockBoundaries[A.nodeName.toLowerCase()]) break;A=A.parentNode;};return A;},ApplyStyle:function(A){FCKStyles.ApplyStyle(new FCKStyle(A));}}; +FCKSelection.GetType=function(){try{var A=FCKSelection.GetSelection().type;if (A=='Control'||A=='Text') return A;if (this.GetSelection().createRange().parentElement) return 'Text';}catch(e){};return 'None';};FCKSelection.GetSelectedElement=function(){if (this.GetType()=='Control'){var A=this.GetSelection().createRange();if (A&&A.item) return this.GetSelection().createRange().item(0);};return null;};FCKSelection.GetParentElement=function(){switch (this.GetType()){case 'Control':var A=FCKSelection.GetSelectedElement();return A?A.parentElement:null;case 'None':return null;default:return this.GetSelection().createRange().parentElement();}};FCKSelection.GetBoundaryParentElement=function(A){switch (this.GetType()){case 'Control':var B=FCKSelection.GetSelectedElement();return B?B.parentElement:null;case 'None':return null;default:var C=FCK.EditorDocument;var D=C.selection.createRange();D.collapse(A!==false);var B=D.parentElement();return FCKTools.GetElementDocument(B)==C?B:null;}};FCKSelection.SelectNode=function(A){FCK.Focus();this.GetSelection().empty();var B;try{B=FCK.EditorDocument.body.createControlRange();B.addElement(A);}catch(e){B=FCK.EditorDocument.body.createTextRange();B.moveToElementText(A);};B.select();};FCKSelection.Collapse=function(A){FCK.Focus();if (this.GetType()=='Text'){var B=this.GetSelection().createRange();B.collapse(A==null||A===true);B.select();}};FCKSelection.HasAncestorNode=function(A){var B;if (this.GetSelection().type=="Control"){B=this.GetSelectedElement();}else{var C=this.GetSelection().createRange();B=C.parentElement();}while (B){if (B.nodeName.IEquals(A)) return true;B=B.parentNode;};return false;};FCKSelection.MoveToAncestorNode=function(A){var B,oRange;if (!FCK.EditorDocument) return null;if (this.GetSelection().type=="Control"){oRange=this.GetSelection().createRange();for (i=0;i=0;i--){if (C[i]) FCKTableHandler.DeleteRows(C[i]);};return;};var E=FCKTools.GetElementAscensor(A,'TABLE');if (E.rows.length==1){FCKTableHandler.DeleteTable(E);return;};A.parentNode.removeChild(A);};FCKTableHandler.DeleteTable=function(A){if (!A){A=FCKSelection.GetSelectedElement();if (!A||A.tagName!='TABLE') A=FCKSelection.MoveToAncestorNode('TABLE');};if (!A) return;FCKSelection.SelectNode(A);FCKSelection.Collapse();if (A.parentNode.childNodes.length==1) A.parentNode.parentNode.removeChild(A.parentNode);else A.parentNode.removeChild(A);};FCKTableHandler.InsertColumn=function(A){var B=null;var C=this.GetSelectedCells();if (C&&C.length) B=C[A?0:(C.length-1)];if (!B) return;var D=FCKTools.GetElementAscensor(B,'TABLE');var E=B.cellIndex;for (var i=0;i=0;i--){if (B[i]) FCKTableHandler.DeleteColumns(B[i]);};return;};if (!A) return;var C=FCKTools.GetElementAscensor(A,'TABLE');var D=A.cellIndex;for (var i=C.rows.length-1;i>=0;i--){var E=C.rows[i];if (D==0&&E.cells.length==1){FCKTableHandler.DeleteRows(E);continue;};if (E.cells[D]) E.removeChild(E.cells[D]);}};FCKTableHandler.InsertCell=function(A,B){var C=null;var D=this.GetSelectedCells();if (D&&D.length) C=D[B?0:(D.length-1)];if (!C) return null;var E=FCK.EditorDocument.createElement('TD');if (FCKBrowserInfo.IsGeckoLike) FCKTools.AppendBogusBr(E);if (!B&&C.cellIndex==C.parentNode.cells.length-1) C.parentNode.appendChild(E);else C.parentNode.insertBefore(E,B?C:C.nextSibling);return E;};FCKTableHandler.DeleteCell=function(A){if (A.parentNode.cells.length==1){FCKTableHandler.DeleteRows(FCKTools.GetElementAscensor(A,'TR'));return;};A.parentNode.removeChild(A);};FCKTableHandler.DeleteCells=function(){var A=FCKTableHandler.GetSelectedCells();for (var i=A.length-1;i>=0;i--){FCKTableHandler.DeleteCell(A[i]);}};FCKTableHandler._MarkCells=function(A,B){for (var i=0;i=E.height){for (D=F;D0){var L=K.removeChild(K.firstChild);if (L.nodeType!=1||(L.getAttribute('type',2)!='_moz'&&L.getAttribute('_moz_dirty')!=null)){I.appendChild(L);J++;}}};if (J>0) I.appendChild(FCKTools.GetElementDocument(B).createElement('br'));};this._ReplaceCellsByMarker(C,'_SelectedCells',B);this._UnmarkCells(A,'_SelectedCells');this._InstallTableMap(C,B.parentNode.parentNode);B.appendChild(I);if (FCKBrowserInfo.IsGeckoLike&&(!B.firstChild)) FCKTools.AppendBogusBr(B);this._MoveCaretToCell(B,false);};FCKTableHandler.MergeRight=function(){var A=this.GetMergeRightTarget();if (A==null) return;var B=A.refCell;var C=A.tableMap;var D=A.nextCell;var E=FCK.EditorDocument.createDocumentFragment();while (D&&D.childNodes&&D.childNodes.length>0) E.appendChild(D.removeChild(D.firstChild));D.parentNode.removeChild(D);B.appendChild(E);this._MarkCells([D],'_Replace');this._ReplaceCellsByMarker(C,'_Replace',B);this._InstallTableMap(C,B.parentNode.parentNode);this._MoveCaretToCell(B,false);};FCKTableHandler.MergeDown=function(){var A=this.GetMergeDownTarget();if (A==null) return;var B=A.refCell;var C=A.tableMap;var D=A.nextCell;var E=FCKTools.GetElementDocument(B).createDocumentFragment();while (D&&D.childNodes&&D.childNodes.length>0) E.appendChild(D.removeChild(D.firstChild));if (E.firstChild) E.insertBefore(FCKTools.GetElementDocument(D).createElement('br'),E.firstChild);B.appendChild(E);this._MarkCells([D],'_Replace');this._ReplaceCellsByMarker(C,'_Replace',B);this._InstallTableMap(C,B.parentNode.parentNode);this._MoveCaretToCell(B,false);};FCKTableHandler.HorizontalSplitCell=function(){var A=FCKTableHandler.GetSelectedCells();if (A.length!=1) return;var B=A[0];var C=this._CreateTableMap(B.parentNode.parentNode);var D=B.parentNode.rowIndex;var E=FCKTableHandler._GetCellIndexSpan(C,D,B);var F=isNaN(B.colSpan)?1:B.colSpan;if (F>1){var G=Math.ceil(F/2);var H=FCKTools.GetElementDocument(B).createElement('td');if (FCKBrowserInfo.IsGeckoLike) FCKTools.AppendBogusBr(H);var I=E+G;var J=E+F;var K=isNaN(B.rowSpan)?1:B.rowSpan;for (var r=D;r1){B.rowSpan=Math.ceil(E/2);var G=F+Math.ceil(E/2);var H=null;for (var i=D+1;i0){var C=B.rows[0];C.parentNode.removeChild(C);};for (var i=0;iE) E=j;if (D._colScanned===true) continue;if (A[i][j-1]==D) D.colSpan++;if (A[i][j+1]!=D) D._colScanned=true;}};for (var i=0;i<=E;i++){for (var j=0;j=0&&C.compareEndPoints('StartToEnd',E)<=0)||(C.compareEndPoints('EndToStart',E)>=0&&C.compareEndPoints('EndToEnd',E)<=0)){B[B.length]=D.cells[i];}}}};return B;}; +var FCKXml=function(){this.Error=false;};FCKXml.GetAttribute=function(A,B,C){var D=A.attributes.getNamedItem(B);return D?D.value:C;};FCKXml.TransformToObject=function(A){if (!A) return null;var B={};var C=A.attributes;for (var i=0;i ';var A=FCKDocumentProcessor_CreateFakeImage('FCK__PageBreak',e);var B=new FCKDomRange(FCK.EditorWindow);B.MoveToSelection();var C=B.SplitBlock();B.InsertNode(A);FCK.Events.FireEvent('OnSelectionChange');};FCKPageBreakCommand.prototype.GetState=function(){if (FCK.EditMode!=0) return -1;return 0;};var FCKUnlinkCommand=function(){this.Name='Unlink';};FCKUnlinkCommand.prototype.Execute=function(){FCKUndo.SaveUndoStep();if (FCKBrowserInfo.IsGeckoLike){var A=FCK.Selection.MoveToAncestorNode('A');if (A) FCKTools.RemoveOuterTags(A);return;};FCK.ExecuteNamedCommand(this.Name);};FCKUnlinkCommand.prototype.GetState=function(){if (FCK.EditMode!=0) return -1;var A=FCK.GetNamedCommandState(this.Name);if (A==0&&FCK.EditMode==0){var B=FCKSelection.MoveToAncestorNode('A');var C=(B&&B.name.length>0&&B.href.length==0);if (C) A=-1;};return A;};var FCKSelectAllCommand=function(){this.Name='SelectAll';};FCKSelectAllCommand.prototype.Execute=function(){if (FCK.EditMode==0){FCK.ExecuteNamedCommand('SelectAll');}else{var A=FCK.EditingArea.Textarea;if (FCKBrowserInfo.IsIE){A.createTextRange().execCommand('SelectAll');}else{A.selectionStart=0;A.selectionEnd=A.value.length;};A.focus();}};FCKSelectAllCommand.prototype.GetState=function(){if (FCK.EditMode!=0) return -1;return 0;};var FCKPasteCommand=function(){this.Name='Paste';};FCKPasteCommand.prototype={Execute:function(){if (FCKBrowserInfo.IsIE) FCK.Paste();else FCK.ExecuteNamedCommand('Paste');},GetState:function(){if (FCK.EditMode!=0) return -1;return FCK.GetNamedCommandState('Paste');}};var FCKRuleCommand=function(){this.Name='Rule';};FCKRuleCommand.prototype={Execute:function(){FCKUndo.SaveUndoStep();FCK.InsertElement('hr');},GetState:function(){if (FCK.EditMode!=0) return -1;return FCK.GetNamedCommandState('InsertHorizontalRule');}};var FCKCutCopyCommand=function(A){this.Name=A?'Cut':'Copy';};FCKCutCopyCommand.prototype={Execute:function(){var A=false;if (FCKBrowserInfo.IsIE){var B=function(){A=true;};var C='on'+this.Name.toLowerCase();FCK.EditorDocument.body.attachEvent(C,B);FCK.ExecuteNamedCommand(this.Name);FCK.EditorDocument.body.detachEvent(C,B);}else{try{FCK.ExecuteNamedCommand(this.Name);A=true;}catch(e){}};if (!A) alert(FCKLang['PasteError'+this.Name]);},GetState:function(){return FCK.EditMode!=0?-1:FCK.GetNamedCommandState('Cut');}};var FCKAnchorDeleteCommand=function(){this.Name='AnchorDelete';};FCKAnchorDeleteCommand.prototype={Execute:function(){if (FCK.Selection.GetType()=='Control'){FCK.Selection.Delete();}else{var A=FCK.Selection.GetSelectedElement();if (A){if (A.tagName=='IMG'&&A.getAttribute('_fckanchor')) oAnchor=FCK.GetRealElement(A);else A=null;};if (!A){oAnchor=FCK.Selection.MoveToAncestorNode('A');if (oAnchor) FCK.Selection.SelectNode(oAnchor);};if (oAnchor.href.length!=0){oAnchor.removeAttribute('name');if (FCKBrowserInfo.IsIE) oAnchor.className=oAnchor.className.replace(FCKRegexLib.FCK_Class,'');return;};if (A){A.parentNode.removeChild(A);return;};if (oAnchor.innerHTML.length==0){oAnchor.parentNode.removeChild(oAnchor);return;};FCKTools.RemoveOuterTags(oAnchor);};if (FCKBrowserInfo.IsGecko) FCK.Selection.Collapse(true);},GetState:function(){if (FCK.EditMode!=0) return -1;return FCK.GetNamedCommandState('Unlink');}}; +var FCKShowBlockCommand=function(A,B){this.Name=A;if (B!=undefined) this._SavedState=B;else this._SavedState=null;};FCKShowBlockCommand.prototype.Execute=function(){var A=this.GetState();if (A==-1) return;var B=FCK.EditorDocument.body;if (A==1) B.className=B.className.replace(/(^| )FCK__ShowBlocks/g,'');else B.className+=' FCK__ShowBlocks';FCK.Events.FireEvent('OnSelectionChange');};FCKShowBlockCommand.prototype.GetState=function(){if (FCK.EditMode!=0) return -1;if (!FCK.EditorDocument) return 0;if (/FCK__ShowBlocks(?:\s|$)/.test(FCK.EditorDocument.body.className)) return 1;return 0;};FCKShowBlockCommand.prototype.SaveState=function(){this._SavedState=this.GetState();};FCKShowBlockCommand.prototype.RestoreState=function(){if (this._SavedState!=null&&this.GetState()!=this._SavedState) this.Execute();}; +var FCKSpellCheckCommand=function(){this.Name='SpellCheck';this.IsEnabled=(FCKConfig.SpellChecker=='ieSpell'||FCKConfig.SpellChecker=='SpellerPages');};FCKSpellCheckCommand.prototype.Execute=function(){switch (FCKConfig.SpellChecker){case 'ieSpell':this._RunIeSpell();break;case 'SpellerPages':FCKDialog.OpenDialog('FCKDialog_SpellCheck','Spell Check','dialog/fck_spellerpages.html',440,480);break;}};FCKSpellCheckCommand.prototype._RunIeSpell=function(){try{var A=new ActiveXObject("ieSpell.ieSpellExtension");A.CheckAllLinkedDocuments(FCK.EditorDocument);}catch(e){if(e.number==-2146827859){if (confirm(FCKLang.IeSpellDownload)) window.open(FCKConfig.IeSpellDownloadUrl,'IeSpellDownload');}else alert('Error Loading ieSpell: '+e.message+' ('+e.number+')');}};FCKSpellCheckCommand.prototype.GetState=function(){if (FCK.EditMode!=0) return -1;return this.IsEnabled?0:-1;}; +var FCKTextColorCommand=function(A){this.Name=A=='ForeColor'?'TextColor':'BGColor';this.Type=A;var B;if (FCKBrowserInfo.IsIE) B=window;else if (FCK.ToolbarSet._IFrame) B=FCKTools.GetElementWindow(FCK.ToolbarSet._IFrame);else B=window.parent;this._Panel=new FCKPanel(B);this._Panel.AppendStyleSheet(FCKConfig.SkinEditorCSS);this._Panel.MainNode.className='FCK_Panel';this._CreatePanelBody(this._Panel.Document,this._Panel.MainNode);FCK.ToolbarSet.ToolbarItems.GetItem(this.Name).RegisterPanel(this._Panel);FCKTools.DisableSelection(this._Panel.Document.body);};FCKTextColorCommand.prototype.Execute=function(A,B,C){this._Panel.Show(A,B,C);};FCKTextColorCommand.prototype.SetColor=function(A){FCKUndo.SaveUndoStep();var B=FCKStyles.GetStyle('_FCK_'+(this.Type=='ForeColor'?'Color':'BackColor'));if (!A||A.length==0) FCK.Styles.RemoveStyle(B);else{B.SetVariable('Color',A);FCKStyles.ApplyStyle(B);};FCKUndo.SaveUndoStep();FCK.Focus();FCK.Events.FireEvent('OnSelectionChange');};FCKTextColorCommand.prototype.GetState=function(){if (FCK.EditMode!=0) return -1;return 0;};function FCKTextColorCommand_OnMouseOver(){this.className='ColorSelected';};function FCKTextColorCommand_OnMouseOut(){this.className='ColorDeselected';};function FCKTextColorCommand_OnClick(A,B,C){this.className='ColorDeselected';B.SetColor(C);B._Panel.Hide();};function FCKTextColorCommand_AutoOnClick(A,B){this.className='ColorDeselected';B.SetColor('');B._Panel.Hide();};function FCKTextColorCommand_MoreOnClick(A,B){this.className='ColorDeselected';B._Panel.Hide();FCKDialog.OpenDialog('FCKDialog_Color',FCKLang.DlgColorTitle,'dialog/fck_colorselector.html',410,320,FCKTools.Bind(B,B.SetColor));};FCKTextColorCommand.prototype._CreatePanelBody=function(A,B){function CreateSelectionDiv(){var C=A.createElement("DIV");C.className='ColorDeselected';FCKTools.AddEventListenerEx(C,'mouseover',FCKTextColorCommand_OnMouseOver);FCKTools.AddEventListenerEx(C,'mouseout',FCKTextColorCommand_OnMouseOut);return C;};var D=B.appendChild(A.createElement("TABLE"));D.className='ForceBaseFont';D.style.tableLayout='fixed';D.cellPadding=0;D.cellSpacing=0;D.border=0;D.width=150;var E=D.insertRow(-1).insertCell(-1);E.colSpan=8;var C=E.appendChild(CreateSelectionDiv());C.innerHTML='\n \n \n \n \n
        '+FCKLang.ColorAutomatic+'
        ';FCKTools.AddEventListenerEx(C,'click',FCKTextColorCommand_AutoOnClick,this);if (!FCKBrowserInfo.IsIE) C.style.width='96%';var G=FCKConfig.FontColors.toString().split(',');var H=0;while (H
        ';if (H>=G.length) C.style.visibility='hidden';else FCKTools.AddEventListenerEx(C,'click',FCKTextColorCommand_OnClick,[this,L]);}};if (FCKConfig.EnableMoreFontColors){E=D.insertRow(-1).insertCell(-1);E.colSpan=8;C=E.appendChild(CreateSelectionDiv());C.innerHTML='
        '+FCKLang.ColorMoreColors+'
        ';FCKTools.AddEventListenerEx(C,'click',FCKTextColorCommand_MoreOnClick,this);};if (!FCKBrowserInfo.IsIE) C.style.width='96%';}; +var FCKPastePlainTextCommand=function(){this.Name='PasteText';};FCKPastePlainTextCommand.prototype.Execute=function(){FCK.PasteAsPlainText();};FCKPastePlainTextCommand.prototype.GetState=function(){if (FCK.EditMode!=0) return -1;return FCK.GetNamedCommandState('Paste');}; +var FCKPasteWordCommand=function(){this.Name='PasteWord';};FCKPasteWordCommand.prototype.Execute=function(){FCK.PasteFromWord();};FCKPasteWordCommand.prototype.GetState=function(){if (FCK.EditMode!=0||FCKConfig.ForcePasteAsPlainText) return -1;else return FCK.GetNamedCommandState('Paste');}; +var FCKTableCommand=function(A){this.Name=A;};FCKTableCommand.prototype.Execute=function(){FCKUndo.SaveUndoStep();if (!FCKBrowserInfo.IsGecko){switch (this.Name){case 'TableMergeRight':return FCKTableHandler.MergeRight();case 'TableMergeDown':return FCKTableHandler.MergeDown();}};switch (this.Name){case 'TableInsertRowAfter':return FCKTableHandler.InsertRow(false);case 'TableInsertRowBefore':return FCKTableHandler.InsertRow(true);case 'TableDeleteRows':return FCKTableHandler.DeleteRows();case 'TableInsertColumnAfter':return FCKTableHandler.InsertColumn(false);case 'TableInsertColumnBefore':return FCKTableHandler.InsertColumn(true);case 'TableDeleteColumns':return FCKTableHandler.DeleteColumns();case 'TableInsertCellAfter':return FCKTableHandler.InsertCell(null,false);case 'TableInsertCellBefore':return FCKTableHandler.InsertCell(null,true);case 'TableDeleteCells':return FCKTableHandler.DeleteCells();case 'TableMergeCells':return FCKTableHandler.MergeCells();case 'TableHorizontalSplitCell':return FCKTableHandler.HorizontalSplitCell();case 'TableVerticalSplitCell':return FCKTableHandler.VerticalSplitCell();case 'TableDelete':return FCKTableHandler.DeleteTable();default:return alert(FCKLang.UnknownCommand.replace(/%1/g,this.Name));}};FCKTableCommand.prototype.GetState=function(){if (FCK.EditorDocument!=null&&FCKSelection.HasAncestorNode('TABLE')){switch (this.Name){case 'TableHorizontalSplitCell':case 'TableVerticalSplitCell':if (FCKTableHandler.GetSelectedCells().length==1) return 0;else return -1;case 'TableMergeCells':if (FCKTableHandler.CheckIsSelectionRectangular()&&FCKTableHandler.GetSelectedCells().length>1) return 0;else return -1;case 'TableMergeRight':return FCKTableHandler.GetMergeRightTarget()?0:-1;case 'TableMergeDown':return FCKTableHandler.GetMergeDownTarget()?0:-1;default:return 0;}}else return -1;}; +var FCKFitWindow=function(){this.Name='FitWindow';};FCKFitWindow.prototype.Execute=function(){var A=window.frameElement;var B=A.style;var C=parent;var D=C.document.documentElement;var E=C.document.body;var F=E.style;var G;if (!this.IsMaximized){if(FCKBrowserInfo.IsIE) C.attachEvent('onresize',FCKFitWindow_Resize);else C.addEventListener('resize',FCKFitWindow_Resize,true);this._ScrollPos=FCKTools.GetScrollPosition(C);G=A;while((G=G.parentNode)){if (G.nodeType==1){G._fckSavedStyles=FCKTools.SaveStyles(G);G.style.zIndex=FCKConfig.FloatingPanelsZIndex-1;}};if (FCKBrowserInfo.IsIE){this.documentElementOverflow=D.style.overflow;D.style.overflow='hidden';F.overflow='hidden';}else{F.overflow='hidden';F.width='0px';F.height='0px';};this._EditorFrameStyles=FCKTools.SaveStyles(A);var H=FCKTools.GetViewPaneSize(C);B.position="absolute";A.offsetLeft;B.zIndex=FCKConfig.FloatingPanelsZIndex-1;B.left="0px";B.top="0px";B.width=H.Width+"px";B.height=H.Height+"px";if (!FCKBrowserInfo.IsIE){B.borderRight=B.borderBottom="9999px solid white";B.backgroundColor="white";};C.scrollTo(0,0);var I=FCKTools.GetWindowPosition(C,A);if (I.x!=0) B.left=(-1*I.x)+"px";if (I.y!=0) B.top=(-1*I.y)+"px";this.IsMaximized=true;}else{if(FCKBrowserInfo.IsIE) C.detachEvent("onresize",FCKFitWindow_Resize);else C.removeEventListener("resize",FCKFitWindow_Resize,true);G=A;while((G=G.parentNode)){if (G._fckSavedStyles){FCKTools.RestoreStyles(G,G._fckSavedStyles);G._fckSavedStyles=null;}};if (FCKBrowserInfo.IsIE) D.style.overflow=this.documentElementOverflow;FCKTools.RestoreStyles(A,this._EditorFrameStyles);C.scrollTo(this._ScrollPos.X,this._ScrollPos.Y);this.IsMaximized=false;};FCKToolbarItems.GetItem('FitWindow').RefreshState();if (FCK.EditMode==0) FCK.EditingArea.MakeEditable();FCK.Focus();};FCKFitWindow.prototype.GetState=function(){if (FCKConfig.ToolbarLocation!='In') return -1;else return (this.IsMaximized?1:0);};function FCKFitWindow_Resize(){var A=FCKTools.GetViewPaneSize(parent);var B=window.frameElement.style;B.width=A.Width+'px';B.height=A.Height+'px';}; +var FCKListCommand=function(A,B){this.Name=A;this.TagName=B;};FCKListCommand.prototype={GetState:function(){if (FCK.EditMode!=0||!FCK.EditorWindow) return -1;var A=FCKSelection.GetBoundaryParentElement(true);var B=A;while (B){if (B.nodeName.IEquals(['ul','ol'])) break;B=B.parentNode;};if (B&&B.nodeName.IEquals(this.TagName)) return 1;else return 0;},Execute:function(){FCKUndo.SaveUndoStep();var A=FCK.EditorDocument;var B=new FCKDomRange(FCK.EditorWindow);B.MoveToSelection();var C=this.GetState();if (C==0){FCKDomTools.TrimNode(A.body);if (!A.body.firstChild){var D=A.createElement('p');A.body.appendChild(D);B.MoveToNodeContents(D);}};var E=B.CreateBookmark();var F=[];var G={};var H=new FCKDomRangeIterator(B);var I;H.ForceBrBreak=(C==0);var J=true;var K=null;while (J){while ((I=H.GetNextParagraph())){var L=new FCKElementPath(I);var M=null;var N=false;var O=L.BlockLimit;for (var i=L.Elements.length-1;i>=0;i--){var P=L.Elements[i];if (P.nodeName.IEquals(['ol','ul'])){if (O._FCK_ListGroupObject) O._FCK_ListGroupObject=null;var Q=P._FCK_ListGroupObject;if (Q) Q.contents.push(I);else{Q={ 'root':P,'contents':[I] };F.push(Q);FCKDomTools.SetElementMarker(G,P,'_FCK_ListGroupObject',Q);};N=true;break;}};if (N) continue;var R=O;if (R._FCK_ListGroupObject) R._FCK_ListGroupObject.contents.push(I);else{var Q={ 'root':R,'contents':[I] };FCKDomTools.SetElementMarker(G,R,'_FCK_ListGroupObject',Q);F.push(Q);}};if (FCKBrowserInfo.IsIE) J=false;else{if (K==null){K=[];var T=FCKSelection.GetSelection();if (T&&F.length==0) K.push(T.getRangeAt(0));for (var i=1;T&&i0){var Q=F.shift();if (C==0){if (Q.root.nodeName.IEquals(['ul','ol'])) this._ChangeListType(Q,G,W);else this._CreateList(Q,W);}else if (C==1&&Q.root.nodeName.IEquals(['ul','ol'])) this._RemoveList(Q,G);};for (var i=0;iC[i-1].indent+1){var H=C[i-1].indent+1-C[i].indent;var I=C[i].indent;while (C[i]&&C[i].indent>=I){C[i].indent+=H;i++;};i--;}};var J=FCKDomTools.ArrayToList(C,B);if (A.root.nextSibling==null||A.root.nextSibling.nodeName.IEquals('br')){if (J.listNode.lastChild.nodeName.IEquals('br')) J.listNode.removeChild(J.listNode.lastChild);};A.root.parentNode.replaceChild(J.listNode,A.root);}}; +var FCKJustifyCommand=function(A){this.AlignValue=A;var B=FCKConfig.ContentLangDirection.toLowerCase();this.IsDefaultAlign=(A=='left'&&B=='ltr')||(A=='right'&&B=='rtl');var C=this._CssClassName=(function(){var D=FCKConfig.JustifyClasses;if (D){switch (A){case 'left':return D[0]||null;case 'center':return D[1]||null;case 'right':return D[2]||null;case 'justify':return D[3]||null;}};return null;})();if (C&&C.length>0) this._CssClassRegex=new RegExp('(?:^|\\s+)'+C+'(?=$|\\s)');};FCKJustifyCommand._GetClassNameRegex=function(){var A=FCKJustifyCommand._ClassRegex;if (A!=undefined) return A;var B=[];var C=FCKConfig.JustifyClasses;if (C){for (var i=0;i<4;i++){var D=C[i];if (D&&D.length>0) B.push(D);}};if (B.length>0) A=new RegExp('(?:^|\\s+)(?:'+B.join('|')+')(?=$|\\s)');else A=null;return FCKJustifyCommand._ClassRegex=A;};FCKJustifyCommand.prototype={Execute:function(){FCKUndo.SaveUndoStep();var A=new FCKDomRange(FCK.EditorWindow);A.MoveToSelection();var B=this.GetState();if (B==-1) return;var C=A.CreateBookmark();var D=this._CssClassName;var E=new FCKDomRangeIterator(A);var F;while ((F=E.GetNextParagraph())){F.removeAttribute('align');if (D){var G=F.className.replace(FCKJustifyCommand._GetClassNameRegex(),'');if (B==0){if (G.length>0) G+=' ';F.className=G+D;}else if (G.length==0) FCKDomTools.RemoveAttribute(F,'class');}else{var H=F.style;if (B==0) H.textAlign=this.AlignValue;else{H.textAlign='';if (H.cssText.length==0) F.removeAttribute('style');}}};A.MoveToBookmark(C);A.Select();FCK.Focus();FCK.Events.FireEvent('OnSelectionChange');},GetState:function(){if (FCK.EditMode!=0||!FCK.EditorWindow) return -1;var A=new FCKElementPath(FCKSelection.GetBoundaryParentElement(true));var B=A.Block||A.BlockLimit;if (!B||B.nodeName.toLowerCase()=='body') return 0;var C;if (FCKBrowserInfo.IsIE) C=B.currentStyle.textAlign;else C=FCK.EditorWindow.getComputedStyle(B,'').getPropertyValue('text-align');C=C.replace(/(-moz-|-webkit-|start|auto)/i,'');if ((!C&&this.IsDefaultAlign)||C==this.AlignValue) return 1;return 0;}}; +var FCKIndentCommand=function(A,B){this.Name=A;this.Offset=B;this.IndentCSSProperty=FCKConfig.ContentLangDirection.IEquals('ltr')?'marginLeft':'marginRight';};FCKIndentCommand._InitIndentModeParameters=function(){if (FCKConfig.IndentClasses&&FCKConfig.IndentClasses.length>0){this._UseIndentClasses=true;this._IndentClassMap={};for (var i=0;i0?H+' ':'')+FCKConfig.IndentClasses[G-1];}else{var I=parseInt(E.style[this.IndentCSSProperty],10);if (isNaN(I)) I=0;I+=this.Offset;I=Math.max(I,0);I=Math.ceil(I/this.Offset)*this.Offset;E.style[this.IndentCSSProperty]=I?I+FCKConfig.IndentUnit:'';if (E.getAttribute('style')=='') E.removeAttribute('style');}}},_IndentList:function(A,B){var C=A.StartContainer;var D=A.EndContainer;while (C&&C.parentNode!=B) C=C.parentNode;while (D&&D.parentNode!=B) D=D.parentNode;if (!C||!D) return;var E=C;var F=[];var G=false;while (G==false){if (E==D) G=true;F.push(E);E=E.nextSibling;};if (F.length<1) return;var H=FCKDomTools.GetParents(B);for (var i=0;iN;i++) M[i].indent+=I;var O=FCKDomTools.ArrayToList(M);if (O) B.parentNode.replaceChild(O.listNode,B);FCKDomTools.ClearAllMarkers(L);}}; +var FCKBlockQuoteCommand=function(){};FCKBlockQuoteCommand.prototype={Execute:function(){FCKUndo.SaveUndoStep();var A=this.GetState();var B=new FCKDomRange(FCK.EditorWindow);B.MoveToSelection();var C=B.CreateBookmark();if (FCKBrowserInfo.IsIE){var D=B.GetBookmarkNode(C,true);var E=B.GetBookmarkNode(C,false);var F;if (D&&D.parentNode.nodeName.IEquals('blockquote')&&!D.previousSibling){F=D;while ((F=F.nextSibling)){if (FCKListsLib.BlockElements[F.nodeName.toLowerCase()]) FCKDomTools.MoveNode(D,F,true);}};if (E&&E.parentNode.nodeName.IEquals('blockquote')&&!E.previousSibling){F=E;while ((F=F.nextSibling)){if (FCKListsLib.BlockElements[F.nodeName.toLowerCase()]){if (F.firstChild==D) FCKDomTools.InsertAfterNode(D,E);else FCKDomTools.MoveNode(E,F,true);}}}};var G=new FCKDomRangeIterator(B);var H;if (A==0){G.EnforceRealBlocks=true;var I=[];while ((H=G.GetNextParagraph())) I.push(H);if (I.length<1){para=B.Window.document.createElement(FCKConfig.EnterMode.IEquals('p')?'p':'div');B.InsertNode(para);para.appendChild(B.Window.document.createTextNode('\ufeff'));B.MoveToBookmark(C);B.MoveToNodeContents(para);B.Collapse(true);C=B.CreateBookmark();I.push(para);};var J=I[0].parentNode;var K=[];for (var i=0;i0){H=I.shift();while (H.parentNode!=J) H=H.parentNode;if (H!=L) K.push(H);L=H;}while (K.length>0){H=K.shift();if (H.nodeName.IEquals('blockquote')){var M=FCKTools.GetElementDocument(H).createDocumentFragment();while (H.firstChild){M.appendChild(H.removeChild(H.firstChild));I.push(M.lastChild);};H.parentNode.replaceChild(M,H);}else I.push(H);};var N=B.Window.document.createElement('blockquote');J.insertBefore(N,I[0]);while (I.length>0){H=I.shift();N.appendChild(H);}}else if (A==1){var O=[];while ((H=G.GetNextParagraph())){var P=null;var Q=null;while (H.parentNode){if (H.parentNode.nodeName.IEquals('blockquote')){P=H.parentNode;Q=H;break;};H=H.parentNode;};if (P&&Q) O.push(Q);};var R=[];while (O.length>0){var S=O.shift();var N=S.parentNode;if (S==S.parentNode.firstChild){N.parentNode.insertBefore(N.removeChild(S),N);if (!N.firstChild) N.parentNode.removeChild(N);}else if (S==S.parentNode.lastChild){N.parentNode.insertBefore(N.removeChild(S),N.nextSibling);if (!N.firstChild) N.parentNode.removeChild(N);}else FCKDomTools.BreakParent(S,S.parentNode,B);R.push(S);};if (FCKConfig.EnterMode.IEquals('br')){while (R.length){var S=R.shift();var W=true;if (S.nodeName.IEquals('div')){var M=FCKTools.GetElementDocument(S).createDocumentFragment();var Y=W&&S.previousSibling&&!FCKListsLib.BlockBoundaries[S.previousSibling.nodeName.toLowerCase()];if (W&&Y) M.appendChild(FCKTools.GetElementDocument(S).createElement('br'));var Z=S.nextSibling&&!FCKListsLib.BlockBoundaries[S.nextSibling.nodeName.toLowerCase()];while (S.firstChild) M.appendChild(S.removeChild(S.firstChild));if (Z) M.appendChild(FCKTools.GetElementDocument(S).createElement('br'));S.parentNode.replaceChild(M,S);W=false;}}}};B.MoveToBookmark(C);B.Select();FCK.Focus();FCK.Events.FireEvent('OnSelectionChange');},GetState:function(){if (FCK.EditMode!=0||!FCK.EditorWindow) return -1;var A=new FCKElementPath(FCKSelection.GetBoundaryParentElement(true));var B=A.Block||A.BlockLimit;if (!B||B.nodeName.toLowerCase()=='body') return 0;for (var i=0;i';B.open();B.write(''+F+'<\/head><\/body><\/html>');B.close();if(FCKBrowserInfo.IsAIR) FCKAdobeAIR.Panel_Contructor(B,window.document.location);FCKTools.AddEventListenerEx(E,'focus',FCKPanel_Window_OnFocus,this);FCKTools.AddEventListenerEx(E,'blur',FCKPanel_Window_OnBlur,this);};B.dir=FCKLang.Dir;FCKTools.AddEventListener(B,'contextmenu',FCKTools.CancelEvent);this.MainNode=B.body.appendChild(B.createElement('DIV'));this.MainNode.style.cssFloat=this.IsRTL?'right':'left';};FCKPanel.prototype.AppendStyleSheet=function(A){FCKTools.AppendStyleSheet(this.Document,A);};FCKPanel.prototype.Preload=function(x,y,A){if (this._Popup) this._Popup.show(x,y,0,0,A);};FCKPanel.prototype.Show=function(x,y,A,B,C){var D;var E=this.MainNode;if (this._Popup){this._Popup.show(x,y,0,0,A);FCKDomTools.SetElementStyles(E,{B:B?B+'px':'',C:C?C+'px':''});D=E.offsetWidth;if (this.IsRTL){if (this.IsContextMenu) x=x-D+1;else if (A) x=(x*-1)+A.offsetWidth-D;};this._Popup.show(x,y,D,E.offsetHeight,A);if (this.OnHide){if (this._Timer) CheckPopupOnHide.call(this,true);this._Timer=FCKTools.SetInterval(CheckPopupOnHide,100,this);}}else{if (typeof(FCK.ToolbarSet.CurrentInstance.FocusManager)!='undefined') FCK.ToolbarSet.CurrentInstance.FocusManager.Lock();if (this.ParentPanel){this.ParentPanel.Lock();FCKPanel_Window_OnBlur(null,this.ParentPanel);};if (FCKBrowserInfo.IsGecko&&FCKBrowserInfo.IsMac){this._IFrame.scrolling='';FCKTools.RunFunction(function(){ this._IFrame.scrolling='no';},this);};if (FCK.ToolbarSet.CurrentInstance.GetInstanceObject('FCKPanel')._OpenedPanel&&FCK.ToolbarSet.CurrentInstance.GetInstanceObject('FCKPanel')._OpenedPanel!=this) FCK.ToolbarSet.CurrentInstance.GetInstanceObject('FCKPanel')._OpenedPanel.Hide(false,true);FCKDomTools.SetElementStyles(E,{B:B?B+'px':'',C:C?C+'px':''});D=E.offsetWidth;if (!B) this._IFrame.width=1;if (!C) this._IFrame.height=1;D=E.offsetWidth||E.firstChild.offsetWidth;var F=FCKTools.GetDocumentPosition(this._Window,A.nodeType==9?(FCKTools.IsStrictMode(A)?A.documentElement:A.body):A);var G=FCKDomTools.GetPositionedAncestor(this._IFrame.parentNode);if (G){var H=FCKTools.GetDocumentPosition(FCKTools.GetElementWindow(G),G);F.x-=H.x;F.y-=H.y;};if (this.IsRTL&&!this.IsContextMenu) x=(x*-1);x+=F.x;y+=F.y;if (this.IsRTL){if (this.IsContextMenu) x=x-D+1;else if (A) x=x+A.offsetWidth-D;}else{var I=FCKTools.GetViewPaneSize(this._Window);var J=FCKTools.GetScrollPosition(this._Window);var K=I.Height+J.Y;var L=I.Width+J.X;if ((x+D)>L) x-=x+D-L;if ((y+E.offsetHeight)>K) y-=y+E.offsetHeight-K;};FCKDomTools.SetElementStyles(this._IFrame,{left:x+'px',top:y+'px'});this._IFrame.contentWindow.focus();this._IsOpened=true;var M=this;this._resizeTimer=setTimeout(function(){var N=E.offsetWidth||E.firstChild.offsetWidth;var O=E.offsetHeight;M._IFrame.style.width=N+'px';M._IFrame.style.height=O+'px';},0);FCK.ToolbarSet.CurrentInstance.GetInstanceObject('FCKPanel')._OpenedPanel=this;};FCKTools.RunFunction(this.OnShow,this);};FCKPanel.prototype.Hide=function(A,B){if (this._Popup) this._Popup.hide();else{if (!this._IsOpened||this._LockCounter>0) return;if (typeof(FCKFocusManager)!='undefined'&&!B) FCKFocusManager.Unlock();this._IFrame.style.width=this._IFrame.style.height='0px';this._IsOpened=false;if (this._resizeTimer){clearTimeout(this._resizeTimer);this._resizeTimer=null;};if (this.ParentPanel) this.ParentPanel.Unlock();if (!A) FCKTools.RunFunction(this.OnHide,this);}};FCKPanel.prototype.CheckIsOpened=function(){if (this._Popup) return this._Popup.isOpen;else return this._IsOpened;};FCKPanel.prototype.CreateChildPanel=function(){var A=this._Popup?FCKTools.GetDocumentWindow(this.Document):this._Window;var B=new FCKPanel(A);B.ParentPanel=this;return B;};FCKPanel.prototype.Lock=function(){this._LockCounter++;};FCKPanel.prototype.Unlock=function(){if (--this._LockCounter==0&&!this.HasFocus) this.Hide();};function FCKPanel_Window_OnFocus(e,A){A.HasFocus=true;};function FCKPanel_Window_OnBlur(e,A){A.HasFocus=false;if (A._LockCounter==0) FCKTools.RunFunction(A.Hide,A);};function CheckPopupOnHide(A){if (A||!this._Popup.isOpen){window.clearInterval(this._Timer);this._Timer=null;FCKTools.RunFunction(this.OnHide,this);}};function FCKPanel_Cleanup(){this._Popup=null;this._Window=null;this.Document=null;this.MainNode=null;}; +var FCKIcon=function(A){var B=A?typeof(A):'undefined';switch (B){case 'number':this.Path=FCKConfig.SkinPath+'fck_strip.gif';this.Size=16;this.Position=A;break;case 'undefined':this.Path=FCK_SPACER_PATH;break;case 'string':this.Path=A;break;default:this.Path=A[0];this.Size=A[1];this.Position=A[2];}};FCKIcon.prototype.CreateIconElement=function(A){var B,eIconImage;if (this.Position){var C='-'+((this.Position-1)*this.Size)+'px';if (FCKBrowserInfo.IsIE){B=A.createElement('DIV');eIconImage=B.appendChild(A.createElement('IMG'));eIconImage.src=this.Path;eIconImage.style.top=C;}else{B=A.createElement('IMG');B.src=FCK_SPACER_PATH;B.style.backgroundPosition='0px '+C;B.style.backgroundImage='url("'+this.Path+'")';}}else{if (FCKBrowserInfo.IsIE){B=A.createElement('DIV');eIconImage=B.appendChild(A.createElement('IMG'));eIconImage.src=this.Path?this.Path:FCK_SPACER_PATH;}else{B=A.createElement('IMG');B.src=this.Path?this.Path:FCK_SPACER_PATH;}};B.className='TB_Button_Image';return B;}; +var FCKToolbarButtonUI=function(A,B,C,D,E,F){this.Name=A;this.Label=B||A;this.Tooltip=C||this.Label;this.Style=E||0;this.State=F||0;this.Icon=new FCKIcon(D);if (FCK.IECleanup) FCK.IECleanup.AddItem(this,FCKToolbarButtonUI_Cleanup);};FCKToolbarButtonUI.prototype._CreatePaddingElement=function(A){var B=A.createElement('IMG');B.className='TB_Button_Padding';B.src=FCK_SPACER_PATH;return B;};FCKToolbarButtonUI.prototype.Create=function(A){var B=FCKTools.GetElementDocument(A);var C=this.MainElement=B.createElement('DIV');C.title=this.Tooltip;if (FCKBrowserInfo.IsGecko) C.onmousedown=FCKTools.CancelEvent;FCKTools.AddEventListenerEx(C,'mouseover',FCKToolbarButtonUI_OnMouseOver,this);FCKTools.AddEventListenerEx(C,'mouseout',FCKToolbarButtonUI_OnMouseOut,this);FCKTools.AddEventListenerEx(C,'click',FCKToolbarButtonUI_OnClick,this);this.ChangeState(this.State,true);if (this.Style==0&&!this.ShowArrow){C.appendChild(this.Icon.CreateIconElement(B));}else{var D=C.appendChild(B.createElement('TABLE'));D.cellPadding=0;D.cellSpacing=0;var E=D.insertRow(-1);var F=E.insertCell(-1);if (this.Style==0||this.Style==2) F.appendChild(this.Icon.CreateIconElement(B));else F.appendChild(this._CreatePaddingElement(B));if (this.Style==1||this.Style==2){F=E.insertCell(-1);F.className='TB_Button_Text';F.noWrap=true;F.appendChild(B.createTextNode(this.Label));};if (this.ShowArrow){if (this.Style!=0){E.insertCell(-1).appendChild(this._CreatePaddingElement(B));};F=E.insertCell(-1);var G=F.appendChild(B.createElement('IMG'));G.src=FCKConfig.SkinPath+'images/toolbar.buttonarrow.gif';G.width=5;G.height=3;};F=E.insertCell(-1);F.appendChild(this._CreatePaddingElement(B));};A.appendChild(C);};FCKToolbarButtonUI.prototype.ChangeState=function(A,B){if (!B&&this.State==A) return;var e=this.MainElement;if (!e) return;switch (parseInt(A,10)){case 0:e.className='TB_Button_Off';break;case 1:e.className='TB_Button_On';break;case -1:e.className='TB_Button_Disabled';break;};this.State=A;};function FCKToolbarButtonUI_OnMouseOver(A,B){if (B.State==0) this.className='TB_Button_Off_Over';else if (B.State==1) this.className='TB_Button_On_Over';};function FCKToolbarButtonUI_OnMouseOut(A,B){if (B.State==0) this.className='TB_Button_Off';else if (B.State==1) this.className='TB_Button_On';};function FCKToolbarButtonUI_OnClick(A,B){if (B.OnClick&&B.State!=-1) B.OnClick(B);};function FCKToolbarButtonUI_Cleanup(){this.MainElement=null;}; +var FCKToolbarButton=function(A,B,C,D,E,F,G){this.CommandName=A;this.Label=B;this.Tooltip=C;this.Style=D;this.SourceView=E?true:false;this.ContextSensitive=F?true:false;if (G==null) this.IconPath=FCKConfig.SkinPath+'toolbar/'+A.toLowerCase()+'.gif';else if (typeof(G)=='number') this.IconPath=[FCKConfig.SkinPath+'fck_strip.gif',16,G];else this.IconPath=G;};FCKToolbarButton.prototype.Create=function(A){this._UIButton=new FCKToolbarButtonUI(this.CommandName,this.Label,this.Tooltip,this.IconPath,this.Style);this._UIButton.OnClick=this.Click;this._UIButton._ToolbarButton=this;this._UIButton.Create(A);};FCKToolbarButton.prototype.RefreshState=function(){var A=this._UIButton;if (!A) return;var B=FCK.ToolbarSet.CurrentInstance.Commands.GetCommand(this.CommandName).GetState();if (B==A.State) return;A.ChangeState(B);};FCKToolbarButton.prototype.Click=function(){var A=this._ToolbarButton||this;FCK.ToolbarSet.CurrentInstance.Commands.GetCommand(A.CommandName).Execute();};FCKToolbarButton.prototype.Enable=function(){this.RefreshState();};FCKToolbarButton.prototype.Disable=function(){this._UIButton.ChangeState(-1);}; +var FCKSpecialCombo=function(A,B,C,D,E){this.FieldWidth=B||100;this.PanelWidth=C||150;this.PanelMaxHeight=D||150;this.Label=' ';this.Caption=A;this.Tooltip=A;this.Style=2;this.Enabled=true;this.Items={};this._Panel=new FCKPanel(E||window);this._Panel.AppendStyleSheet(FCKConfig.SkinEditorCSS);this._PanelBox=this._Panel.MainNode.appendChild(this._Panel.Document.createElement('DIV'));this._PanelBox.className='SC_Panel';this._PanelBox.style.width=this.PanelWidth+'px';this._PanelBox.innerHTML='
        ';this._ItemsHolderEl=this._PanelBox.getElementsByTagName('TD')[0];if (FCK.IECleanup) FCK.IECleanup.AddItem(this,FCKSpecialCombo_Cleanup);};function FCKSpecialCombo_ItemOnMouseOver(){this.className+=' SC_ItemOver';};function FCKSpecialCombo_ItemOnMouseOut(){this.className=this.originalClass;};function FCKSpecialCombo_ItemOnClick(A,B,C){this.className=this.originalClass;B._Panel.Hide();B.SetLabel(this.FCKItemLabel);if (typeof(B.OnSelect)=='function') B.OnSelect(C,this);};FCKSpecialCombo.prototype.ClearItems=function (){if (this.Items) this.Items={};var A=this._ItemsHolderEl;while (A.firstChild) A.removeChild(A.firstChild);};FCKSpecialCombo.prototype.AddItem=function(A,B,C,D){var E=this._ItemsHolderEl.appendChild(this._Panel.Document.createElement('DIV'));E.className=E.originalClass='SC_Item';E.innerHTML=B;E.FCKItemLabel=C||A;E.Selected=false;if (FCKBrowserInfo.IsIE) E.style.width='100%';if (D) E.style.backgroundColor=D;FCKTools.AddEventListenerEx(E,'mouseover',FCKSpecialCombo_ItemOnMouseOver);FCKTools.AddEventListenerEx(E,'mouseout',FCKSpecialCombo_ItemOnMouseOut);FCKTools.AddEventListenerEx(E,'click',FCKSpecialCombo_ItemOnClick,[this,A]);this.Items[A.toString().toLowerCase()]=E;return E;};FCKSpecialCombo.prototype.SelectItem=function(A){if (typeof A=='string') A=this.Items[A.toString().toLowerCase()];if (A){A.className=A.originalClass='SC_ItemSelected';A.Selected=true;}};FCKSpecialCombo.prototype.SelectItemByLabel=function(A,B){for (var C in this.Items){var D=this.Items[C];if (D.FCKItemLabel==A){D.className=D.originalClass='SC_ItemSelected';D.Selected=true;if (B) this.SetLabel(A);}}};FCKSpecialCombo.prototype.DeselectAll=function(A){for (var i in this.Items){if (!this.Items[i]) continue;this.Items[i].className=this.Items[i].originalClass='SC_Item';this.Items[i].Selected=false;};if (A) this.SetLabel('');};FCKSpecialCombo.prototype.SetLabelById=function(A){A=A?A.toString().toLowerCase():'';var B=this.Items[A];this.SetLabel(B?B.FCKItemLabel:'');};FCKSpecialCombo.prototype.SetLabel=function(A){A=(!A||A.length==0)?' ':A;if (A==this.Label) return;this.Label=A;var B=this._LabelEl;if (B){B.innerHTML=A;FCKTools.DisableSelection(B);}};FCKSpecialCombo.prototype.SetEnabled=function(A){this.Enabled=A;if (this._OuterTable) this._OuterTable.className=A?'':'SC_FieldDisabled';};FCKSpecialCombo.prototype.Create=function(A){var B=FCKTools.GetElementDocument(A);var C=this._OuterTable=A.appendChild(B.createElement('TABLE'));C.cellPadding=0;C.cellSpacing=0;C.insertRow(-1);var D;var E;switch (this.Style){case 0:D='TB_ButtonType_Icon';E=false;break;case 1:D='TB_ButtonType_Text';E=false;break;case 2:E=true;break;};if (this.Caption&&this.Caption.length>0&&E){var F=C.rows[0].insertCell(-1);F.innerHTML=this.Caption;F.className='SC_FieldCaption';};var G=FCKTools.AppendElement(C.rows[0].insertCell(-1),'div');if (E){G.className='SC_Field';G.style.width=this.FieldWidth+'px';G.innerHTML='
         
        ';this._LabelEl=G.getElementsByTagName('label')[0];this._LabelEl.innerHTML=this.Label;}else{G.className='TB_Button_Off';G.innerHTML='
        '+this.Caption+'
        ';};FCKTools.AddEventListenerEx(G,'mouseover',FCKSpecialCombo_OnMouseOver,this);FCKTools.AddEventListenerEx(G,'mouseout',FCKSpecialCombo_OnMouseOut,this);FCKTools.AddEventListenerEx(G,'click',FCKSpecialCombo_OnClick,this);FCKTools.DisableSelection(this._Panel.Document.body);};function FCKSpecialCombo_Cleanup(){this._LabelEl=null;this._OuterTable=null;this._ItemsHolderEl=null;this._PanelBox=null;if (this.Items){for (var A in this.Items) this.Items[A]=null;}};function FCKSpecialCombo_OnMouseOver(A,B){if (B.Enabled){switch (B.Style){case 0:this.className='TB_Button_On_Over';break;case 1:this.className='TB_Button_On_Over';break;case 2:this.className='SC_Field SC_FieldOver';break;}}};function FCKSpecialCombo_OnMouseOut(A,B){switch (B.Style){case 0:this.className='TB_Button_Off';break;case 1:this.className='TB_Button_Off';break;case 2:this.className='SC_Field';break;}};function FCKSpecialCombo_OnClick(e,A){if (A.Enabled){var B=A._Panel;var C=A._PanelBox;var D=A._ItemsHolderEl;var E=A.PanelMaxHeight;if (A.OnBeforeClick) A.OnBeforeClick(A);if (FCKBrowserInfo.IsIE) B.Preload(0,this.offsetHeight,this);if (D.offsetHeight>E) C.style.height=E+'px';else C.style.height='';B.Show(0,this.offsetHeight,this);}}; +var FCKToolbarSpecialCombo=function(){this.SourceView=false;this.ContextSensitive=true;this.FieldWidth=null;this.PanelWidth=null;this.PanelMaxHeight=null;};FCKToolbarSpecialCombo.prototype.DefaultLabel='';function FCKToolbarSpecialCombo_OnSelect(A,B){FCK.ToolbarSet.CurrentInstance.Commands.GetCommand(this.CommandName).Execute(A,B);};FCKToolbarSpecialCombo.prototype.Create=function(A){this._Combo=new FCKSpecialCombo(this.GetLabel(),this.FieldWidth,this.PanelWidth,this.PanelMaxHeight,FCKBrowserInfo.IsIE?window:FCKTools.GetElementWindow(A).parent);this._Combo.Tooltip=this.Tooltip;this._Combo.Style=this.Style;this.CreateItems(this._Combo);this._Combo.Create(A);this._Combo.CommandName=this.CommandName;this._Combo.OnSelect=FCKToolbarSpecialCombo_OnSelect;};function FCKToolbarSpecialCombo_RefreshActiveItems(A,B){A.DeselectAll();A.SelectItem(B);A.SetLabelById(B);};FCKToolbarSpecialCombo.prototype.RefreshState=function(){var A;var B=FCK.ToolbarSet.CurrentInstance.Commands.GetCommand(this.CommandName).GetState();if (B!=-1){A=1;if (this.RefreshActiveItems) this.RefreshActiveItems(this._Combo,B);else{if (this._LastValue!==B){this._LastValue=B;if (!B||B.length==0){this._Combo.DeselectAll();this._Combo.SetLabel(this.DefaultLabel);}else FCKToolbarSpecialCombo_RefreshActiveItems(this._Combo,B);}}}else A=-1;if (A==this.State) return;if (A==-1){this._Combo.DeselectAll();this._Combo.SetLabel('');};this.State=A;this._Combo.SetEnabled(A!=-1);};FCKToolbarSpecialCombo.prototype.Enable=function(){this.RefreshState();};FCKToolbarSpecialCombo.prototype.Disable=function(){this.State=-1;this._Combo.DeselectAll();this._Combo.SetLabel('');this._Combo.SetEnabled(false);}; +var FCKToolbarStyleCombo=function(A,B){if (A===false) return;this.CommandName='Style';this.Label=this.GetLabel();this.Tooltip=A?A:this.Label;this.Style=B?B:2;this.DefaultLabel=FCKConfig.DefaultStyleLabel||'';};FCKToolbarStyleCombo.prototype=new FCKToolbarSpecialCombo;FCKToolbarStyleCombo.prototype.GetLabel=function(){return FCKLang.Style;};FCKToolbarStyleCombo.prototype.GetStyles=function(){var A={};var B=FCK.ToolbarSet.CurrentInstance.Styles.GetStyles();for (var C in B){var D=B[C];if (!D.IsCore) A[C]=D;};return A;};FCKToolbarStyleCombo.prototype.CreateItems=function(A){var B=A._Panel.Document;FCKTools.AppendStyleSheet(B,FCKConfig.ToolbarComboPreviewCSS);FCKTools.AppendStyleString(B,FCKConfig.EditorAreaStyles);B.body.className+=' ForceBaseFont';FCKConfig.ApplyBodyAttributes(B.body);var C=this.GetStyles();for (var D in C){var E=C[D];var F=E.GetType()==2?D:FCKToolbarStyleCombo_BuildPreview(E,E.Label||D);var G=A.AddItem(D,F);G.Style=E;};A.OnBeforeClick=this.StyleCombo_OnBeforeClick;};FCKToolbarStyleCombo.prototype.RefreshActiveItems=function(A){var B=FCK.ToolbarSet.CurrentInstance.Selection.GetBoundaryParentElement(true);if (B){var C=new FCKElementPath(B);var D=C.Elements;for (var e=0;e');var E=A.Element;if (E=='bdo') E='span';D=['<',E];var F=A._StyleDesc.Attributes;if (F){for (var G in F){D.push(' ',G,'="',A.GetFinalAttributeValue(G),'"');}};if (A._GetStyleText().length>0) D.push(' style="',A.GetFinalStyleValue(),'"');D.push('>',B,'');if (C==0) D.push('');return D.join('');}; +var FCKToolbarFontFormatCombo=function(A,B){if (A===false) return;this.CommandName='FontFormat';this.Label=this.GetLabel();this.Tooltip=A?A:this.Label;this.Style=B?B:2;this.NormalLabel='Normal';this.PanelWidth=190;this.DefaultLabel=FCKConfig.DefaultFontFormatLabel||'';};FCKToolbarFontFormatCombo.prototype=new FCKToolbarStyleCombo(false);FCKToolbarFontFormatCombo.prototype.GetLabel=function(){return FCKLang.FontFormat;};FCKToolbarFontFormatCombo.prototype.GetStyles=function(){var A={};var B=FCKLang['FontFormats'].split(';');var C={p:B[0],pre:B[1],address:B[2],h1:B[3],h2:B[4],h3:B[5],h4:B[6],h5:B[7],h6:B[8],div:B[9]||(B[0]+' (DIV)')};var D=FCKConfig.FontFormats.split(';');for (var i=0;i';G.open();G.write(''+H+''+document.getElementById('xToolbarSpace').innerHTML+'');G.close();if(FCKBrowserInfo.IsAIR) FCKAdobeAIR.ToolbarSet_InitOutFrame(G);FCKTools.AddEventListener(G,'contextmenu',FCKTools.CancelEvent);FCKTools.AppendStyleSheet(G,FCKConfig.SkinEditorCSS);B=D.__FCKToolbarSet=new FCKToolbarSet(G);B._IFrame=F;if (FCK.IECleanup) FCK.IECleanup.AddItem(D,FCKToolbarSet_Target_Cleanup);};B.CurrentInstance=FCK;if (!B.ToolbarItems) B.ToolbarItems=FCKToolbarItems;FCK.AttachToOnSelectionChange(B.RefreshItemsState);return B;};function FCK_OnBlur(A){var B=A.ToolbarSet;if (B.CurrentInstance==A) B.Disable();};function FCK_OnFocus(A){var B=A.ToolbarSet;var C=A||FCK;B.CurrentInstance.FocusManager.RemoveWindow(B._IFrame.contentWindow);B.CurrentInstance=C;C.FocusManager.AddWindow(B._IFrame.contentWindow,true);B.Enable();};function FCKToolbarSet_Cleanup(){this._TargetElement=null;this._IFrame=null;};function FCKToolbarSet_Target_Cleanup(){this.__FCKToolbarSet=null;};var FCKToolbarSet=function(A){this._Document=A;this._TargetElement=A.getElementById('xToolbar');var B=A.getElementById('xExpandHandle');var C=A.getElementById('xCollapseHandle');B.title=FCKLang.ToolbarExpand;FCKTools.AddEventListener(B,'click',FCKToolbarSet_Expand_OnClick);C.title=FCKLang.ToolbarCollapse;FCKTools.AddEventListener(C,'click',FCKToolbarSet_Collapse_OnClick);if (!FCKConfig.ToolbarCanCollapse||FCKConfig.ToolbarStartExpanded) this.Expand();else this.Collapse();C.style.display=FCKConfig.ToolbarCanCollapse?'':'none';if (FCKConfig.ToolbarCanCollapse) C.style.display='';else A.getElementById('xTBLeftBorder').style.display='';this.Toolbars=[];this.IsLoaded=false;if (FCK.IECleanup) FCK.IECleanup.AddItem(this,FCKToolbarSet_Cleanup);};function FCKToolbarSet_Expand_OnClick(){FCK.ToolbarSet.Expand();};function FCKToolbarSet_Collapse_OnClick(){FCK.ToolbarSet.Collapse();};FCKToolbarSet.prototype.Expand=function(){this._ChangeVisibility(false);};FCKToolbarSet.prototype.Collapse=function(){this._ChangeVisibility(true);};FCKToolbarSet.prototype._ChangeVisibility=function(A){this._Document.getElementById('xCollapsed').style.display=A?'':'none';this._Document.getElementById('xExpanded').style.display=A?'none':'';if (FCKBrowserInfo.IsGecko){FCKTools.RunFunction(window.onresize);}};FCKToolbarSet.prototype.Load=function(A){this.Name=A;this.Items=[];this.ItemsWysiwygOnly=[];this.ItemsContextSensitive=[];this._TargetElement.innerHTML='';var B=FCKConfig.ToolbarSets[A];if (!B){alert(FCKLang.UnknownToolbarSet.replace(/%1/g,A));return;};this.Toolbars=[];for (var x=0;x0) break;}catch (e){break;};D=D.parent;};var E=D.document;var F=function(){if (!B) B=FCKConfig.FloatingPanelsZIndex+999;return++B;};var G=function(){if (!C) return;var H=FCKTools.IsStrictMode(E)?E.documentElement:E.body;FCKDomTools.SetElementStyles(C,{'width':Math.max(H.scrollWidth,H.clientWidth,E.scrollWidth||0)-1+'px','height':Math.max(H.scrollHeight,H.clientHeight,E.scrollHeight||0)-1+'px'});};return {OpenDialog:function(dialogName,dialogTitle,dialogPage,width,height,customValue,parentWindow,resizable){if (!A) this.DisplayMainCover();var I={Title:dialogTitle,Page:dialogPage,Editor:window,CustomValue:customValue,TopWindow:D};FCK.ToolbarSet.CurrentInstance.Selection.Save();var J=FCKTools.GetViewPaneSize(D);var K={ 'X':0,'Y':0 };var L=FCKBrowserInfo.IsIE&&(!FCKBrowserInfo.IsIE7||!FCKTools.IsStrictMode(D.document));if (L) K=FCKTools.GetScrollPosition(D);var M=Math.max(K.Y+(J.Height-height-20)/2,0);var N=Math.max(K.X+(J.Width-width-20)/2,0);var O=E.createElement('iframe');FCKTools.ResetStyles(O);O.src=FCKConfig.BasePath+'fckdialog.html';O.frameBorder=0;O.allowTransparency=true;FCKDomTools.SetElementStyles(O,{'position':(L)?'absolute':'fixed','top':M+'px','left':N+'px','width':width+'px','height':height+'px','zIndex':F()});O._DialogArguments=I;E.body.appendChild(O);O._ParentDialog=A;A=O;},OnDialogClose:function(dialogWindow){var O=dialogWindow.frameElement;FCKDomTools.RemoveNode(O);if (O._ParentDialog){A=O._ParentDialog;O._ParentDialog.contentWindow.SetEnabled(true);}else{if (!FCKBrowserInfo.IsIE) FCK.Focus();this.HideMainCover();setTimeout(function(){ A=null;},0);FCK.ToolbarSet.CurrentInstance.Selection.Release();}},DisplayMainCover:function(){C=E.createElement('div');FCKTools.ResetStyles(C);FCKDomTools.SetElementStyles(C,{'position':'absolute','zIndex':F(),'top':'0px','left':'0px','backgroundColor':FCKConfig.BackgroundBlockerColor});FCKDomTools.SetOpacity(C,FCKConfig.BackgroundBlockerOpacity);if (FCKBrowserInfo.IsIE&&!FCKBrowserInfo.IsIE7){var Q=E.createElement('iframe');FCKTools.ResetStyles(Q);Q.hideFocus=true;Q.frameBorder=0;Q.src=FCKTools.GetVoidUrl();FCKDomTools.SetElementStyles(Q,{'width':'100%','height':'100%','position':'absolute','left':'0px','top':'0px','filter':'progid:DXImageTransform.Microsoft.Alpha(opacity=0)'});C.appendChild(Q);};FCKTools.AddEventListener(D,'resize',G);G();E.body.appendChild(C);FCKFocusManager.Lock();var R=FCK.ToolbarSet.CurrentInstance.GetInstanceObject('frameElement');R._fck_originalTabIndex=R.tabIndex;R.tabIndex=-1;},HideMainCover:function(){FCKDomTools.RemoveNode(C);FCKFocusManager.Unlock();var R=FCK.ToolbarSet.CurrentInstance.GetInstanceObject('frameElement');R.tabIndex=R._fck_originalTabIndex;FCKDomTools.ClearElementJSProperty(R,'_fck_originalTabIndex');},GetCover:function(){return C;}};})(); +var FCKMenuItem=function(A,B,C,D,E,F){this.Name=B;this.Label=C||B;this.IsDisabled=E;this.Icon=new FCKIcon(D);this.SubMenu=new FCKMenuBlockPanel();this.SubMenu.Parent=A;this.SubMenu.OnClick=FCKTools.CreateEventListener(FCKMenuItem_SubMenu_OnClick,this);this.CustomData=F;if (FCK.IECleanup) FCK.IECleanup.AddItem(this,FCKMenuItem_Cleanup);};FCKMenuItem.prototype.AddItem=function(A,B,C,D,E){this.HasSubMenu=true;return this.SubMenu.AddItem(A,B,C,D,E);};FCKMenuItem.prototype.AddSeparator=function(){this.SubMenu.AddSeparator();};FCKMenuItem.prototype.Create=function(A){var B=this.HasSubMenu;var C=FCKTools.GetElementDocument(A);var r=this.MainElement=A.insertRow(-1);r.className=this.IsDisabled?'MN_Item_Disabled':'MN_Item';if (!this.IsDisabled){FCKTools.AddEventListenerEx(r,'mouseover',FCKMenuItem_OnMouseOver,[this]);FCKTools.AddEventListenerEx(r,'click',FCKMenuItem_OnClick,[this]);if (!B) FCKTools.AddEventListenerEx(r,'mouseout',FCKMenuItem_OnMouseOut,[this]);};var D=r.insertCell(-1);D.className='MN_Icon';D.appendChild(this.Icon.CreateIconElement(C));D=r.insertCell(-1);D.className='MN_Label';D.noWrap=true;D.appendChild(C.createTextNode(this.Label));D=r.insertCell(-1);if (B){D.className='MN_Arrow';var E=D.appendChild(C.createElement('IMG'));E.src=FCK_IMAGES_PATH+'arrow_'+FCKLang.Dir+'.gif';E.width=4;E.height=7;this.SubMenu.Create();this.SubMenu.Panel.OnHide=FCKTools.CreateEventListener(FCKMenuItem_SubMenu_OnHide,this);}};FCKMenuItem.prototype.Activate=function(){this.MainElement.className='MN_Item_Over';if (this.HasSubMenu){this.SubMenu.Show(this.MainElement.offsetWidth+2,-2,this.MainElement);};FCKTools.RunFunction(this.OnActivate,this);};FCKMenuItem.prototype.Deactivate=function(){this.MainElement.className='MN_Item';if (this.HasSubMenu) this.SubMenu.Hide();};function FCKMenuItem_SubMenu_OnClick(A,B){FCKTools.RunFunction(B.OnClick,B,[A]);};function FCKMenuItem_SubMenu_OnHide(A){A.Deactivate();};function FCKMenuItem_OnClick(A,B){if (B.HasSubMenu) B.Activate();else{B.Deactivate();FCKTools.RunFunction(B.OnClick,B,[B]);}};function FCKMenuItem_OnMouseOver(A,B){B.Activate();};function FCKMenuItem_OnMouseOut(A,B){B.Deactivate();};function FCKMenuItem_Cleanup(){this.MainElement=null;}; +var FCKMenuBlock=function(){this._Items=[];};FCKMenuBlock.prototype.Count=function(){return this._Items.length;};FCKMenuBlock.prototype.AddItem=function(A,B,C,D,E){var F=new FCKMenuItem(this,A,B,C,D,E);F.OnClick=FCKTools.CreateEventListener(FCKMenuBlock_Item_OnClick,this);F.OnActivate=FCKTools.CreateEventListener(FCKMenuBlock_Item_OnActivate,this);this._Items.push(F);return F;};FCKMenuBlock.prototype.AddSeparator=function(){this._Items.push(new FCKMenuSeparator());};FCKMenuBlock.prototype.RemoveAllItems=function(){this._Items=[];var A=this._ItemsTable;if (A){while (A.rows.length>0) A.deleteRow(0);}};FCKMenuBlock.prototype.Create=function(A){if (!this._ItemsTable){if (FCK.IECleanup) FCK.IECleanup.AddItem(this,FCKMenuBlock_Cleanup);this._Window=FCKTools.GetElementWindow(A);var B=FCKTools.GetElementDocument(A);var C=A.appendChild(B.createElement('table'));C.cellPadding=0;C.cellSpacing=0;FCKTools.DisableSelection(C);var D=C.insertRow(-1).insertCell(-1);D.className='MN_Menu';var E=this._ItemsTable=D.appendChild(B.createElement('table'));E.cellPadding=0;E.cellSpacing=0;};for (var i=0;i0&&F.href.length==0);if (G) return;menu.AddSeparator();if (E) menu.AddItem('Link',FCKLang.EditLink,34);menu.AddItem('Unlink',FCKLang.RemoveLink,35);}}};case 'Image':return {AddItems:function(menu,tag,tagName){if (tagName=='IMG'&&!tag.getAttribute('_fckfakelement')){menu.AddSeparator();menu.AddItem('Image',FCKLang.ImageProperties,37);}}};case 'Anchor':return {AddItems:function(menu,tag,tagName){var F=FCKSelection.MoveToAncestorNode('A');var G=(F&&F.name.length>0);if (G||(tagName=='IMG'&&tag.getAttribute('_fckanchor'))){menu.AddSeparator();menu.AddItem('Anchor',FCKLang.AnchorProp,36);menu.AddItem('AnchorDelete',FCKLang.AnchorDelete);}}};case 'Flash':return {AddItems:function(menu,tag,tagName){if (tagName=='IMG'&&tag.getAttribute('_fckflash')){menu.AddSeparator();menu.AddItem('Flash',FCKLang.FlashProperties,38);}}};case 'Form':return {AddItems:function(menu,tag,tagName){if (FCKSelection.HasAncestorNode('FORM')){menu.AddSeparator();menu.AddItem('Form',FCKLang.FormProp,48);}}};case 'Checkbox':return {AddItems:function(menu,tag,tagName){if (tagName=='INPUT'&&tag.type=='checkbox'){menu.AddSeparator();menu.AddItem('Checkbox',FCKLang.CheckboxProp,49);}}};case 'Radio':return {AddItems:function(menu,tag,tagName){if (tagName=='INPUT'&&tag.type=='radio'){menu.AddSeparator();menu.AddItem('Radio',FCKLang.RadioButtonProp,50);}}};case 'TextField':return {AddItems:function(menu,tag,tagName){if (tagName=='INPUT'&&(tag.type=='text'||tag.type=='password')){menu.AddSeparator();menu.AddItem('TextField',FCKLang.TextFieldProp,51);}}};case 'HiddenField':return {AddItems:function(menu,tag,tagName){if (tagName=='IMG'&&tag.getAttribute('_fckinputhidden')){menu.AddSeparator();menu.AddItem('HiddenField',FCKLang.HiddenFieldProp,56);}}};case 'ImageButton':return {AddItems:function(menu,tag,tagName){if (tagName=='INPUT'&&tag.type=='image'){menu.AddSeparator();menu.AddItem('ImageButton',FCKLang.ImageButtonProp,55);}}};case 'Button':return {AddItems:function(menu,tag,tagName){if (tagName=='INPUT'&&(tag.type=='button'||tag.type=='submit'||tag.type=='reset')){menu.AddSeparator();menu.AddItem('Button',FCKLang.ButtonProp,54);}}};case 'Select':return {AddItems:function(menu,tag,tagName){if (tagName=='SELECT'){menu.AddSeparator();menu.AddItem('Select',FCKLang.SelectionFieldProp,53);}}};case 'Textarea':return {AddItems:function(menu,tag,tagName){if (tagName=='TEXTAREA'){menu.AddSeparator();menu.AddItem('Textarea',FCKLang.TextareaProp,52);}}};case 'BulletedList':return {AddItems:function(menu,tag,tagName){if (FCKSelection.HasAncestorNode('UL')){menu.AddSeparator();menu.AddItem('BulletedList',FCKLang.BulletedListProp,27);}}};case 'NumberedList':return {AddItems:function(menu,tag,tagName){if (FCKSelection.HasAncestorNode('OL')){menu.AddSeparator();menu.AddItem('NumberedList',FCKLang.NumberedListProp,26);}}};};return null;};function FCK_ContextMenu_OnBeforeOpen(){FCK.Events.FireEvent('OnSelectionChange');var A,sTagName;if ((A=FCKSelection.GetSelectedElement())) sTagName=A.tagName;var B=FCK.ContextMenu._InnerContextMenu;B.RemoveAllItems();var C=FCK.ContextMenu.Listeners;for (var i=0;i0){D=A.substr(0,B.index);this._sourceHtml=A.substr(B.index);}else{C=true;D=B[0];this._sourceHtml=A.substr(B[0].length);}}else{D=A;this._sourceHtml=null;};return { 'isTag':C,'value':D };},Each:function(A){var B;while ((B=this.Next())) A(B.isTag,B.value);}};var FCKHtmlIterator=function(A){this._sourceHtml=A;};FCKHtmlIterator.prototype={Next:function(){var A=this._sourceHtml;if (A==null) return null;var B=FCKRegexLib.HtmlTag.exec(A);var C=false;var D="";if (B){if (B.index>0){D=A.substr(0,B.index);this._sourceHtml=A.substr(B.index);}else{C=true;D=B[0];this._sourceHtml=A.substr(B[0].length);}}else{D=A;this._sourceHtml=null;};return { 'isTag':C,'value':D };},Each:function(A){var B;while ((B=this.Next())) A(B.isTag,B.value);}}; +var FCKPlugin=function(A,B,C){this.Name=A;this.BasePath=C?C:FCKConfig.PluginsPath;this.Path=this.BasePath+A+'/';if (!B||B.length==0) this.AvailableLangs=[];else this.AvailableLangs=B.split(',');};FCKPlugin.prototype.Load=function(){if (this.AvailableLangs.length>0){var A;if (this.AvailableLangs.IndexOf(FCKLanguageManager.ActiveLanguage.Code)>=0) A=FCKLanguageManager.ActiveLanguage.Code;else A=this.AvailableLangs[0];LoadScript(this.Path+'lang/'+A+'.js');};LoadScript(this.Path+'fckplugin.js');}; +var FCKPlugins=FCK.Plugins={};FCKPlugins.ItemsCount=0;FCKPlugins.Items={};FCKPlugins.Load=function(){var A=FCKPlugins.Items;for (var i=0;i", +DlgInfoTab : "Info", +DlgAlertUrl : "Voeg asseblief die URL in", + +// General Dialogs Labels +DlgGenNotSet : "", +DlgGenId : "Id", +DlgGenLangDir : "Taal rigting", +DlgGenLangDirLtr : "Links na regs (LTR)", +DlgGenLangDirRtl : "Regs na links (RTL)", +DlgGenLangCode : "Taal kode", +DlgGenAccessKey : "Toegang sleutel", +DlgGenName : "Naam", +DlgGenTabIndex : "Tab Index", +DlgGenLongDescr : "Lang beskreiwing URL", +DlgGenClass : "Skakel Tiepe", +DlgGenTitle : "Voorbeveelings Titel", +DlgGenContType : "Voorbeveelings inhoud soort", +DlgGenLinkCharset : "Geskakelde voorbeeld karakterstel", +DlgGenStyle : "Styl", + +// Image Dialog +DlgImgTitle : "Beeld eienskappe", +DlgImgInfoTab : "Beeld informasie", +DlgImgBtnUpload : "Stuur dit na die Server", +DlgImgURL : "URL", +DlgImgUpload : "Uplaai", +DlgImgAlt : "Alternatiewe beskrywing", +DlgImgWidth : "Weidte", +DlgImgHeight : "Hoogde", +DlgImgLockRatio : "Behou preporsie", +DlgBtnResetSize : "Herstel groote", +DlgImgBorder : "Kant", +DlgImgHSpace : "HSpasie", +DlgImgVSpace : "VSpasie", +DlgImgAlign : "Paradeer", +DlgImgAlignLeft : "Links", +DlgImgAlignAbsBottom: "Abs Onder", +DlgImgAlignAbsMiddle: "Abs Middel", +DlgImgAlignBaseline : "Baseline", +DlgImgAlignBottom : "Onder", +DlgImgAlignMiddle : "Middel", +DlgImgAlignRight : "Regs", +DlgImgAlignTextTop : "Text Bo", +DlgImgAlignTop : "Bo", +DlgImgPreview : "Voorskou", +DlgImgAlertUrl : "Voeg asseblief Beeld URL in.", +DlgImgLinkTab : "Skakel", + +// Flash Dialog +DlgFlashTitle : "Flash eienskappe", +DlgFlashChkPlay : "Automaties Speel", +DlgFlashChkLoop : "Herhaling", +DlgFlashChkMenu : "Laat Flash Menu toe", +DlgFlashScale : "Scale", +DlgFlashScaleAll : "Wys alles", +DlgFlashScaleNoBorder : "Geen kante", +DlgFlashScaleFit : "Presiese pas", + +// Link Dialog +DlgLnkWindowTitle : "Skakel", +DlgLnkInfoTab : "Skakel informasie", +DlgLnkTargetTab : "Mikpunt", + +DlgLnkType : "Skakel soort", +DlgLnkTypeURL : "URL", +DlgLnkTypeAnchor : "Skakel na plekhouers in text", +DlgLnkTypeEMail : "E-Mail", +DlgLnkProto : "Protokol", +DlgLnkProtoOther : "", +DlgLnkURL : "URL", +DlgLnkAnchorSel : "Kies 'n plekhouer", +DlgLnkAnchorByName : "Volgens plekhouer naam", +DlgLnkAnchorById : "Volgens element Id", +DlgLnkNoAnchors : "(Geen plekhouers beskikbaar in dokument}", +DlgLnkEMail : "E-Mail Adres", +DlgLnkEMailSubject : "Boodskap Opskrif", +DlgLnkEMailBody : "Boodskap Inhoud", +DlgLnkUpload : "Oplaai", +DlgLnkBtnUpload : "Stuur na Server", + +DlgLnkTarget : "Mikpunt", +DlgLnkTargetFrame : "", +DlgLnkTargetPopup : "", +DlgLnkTargetBlank : "Nuwe Venster (_blank)", +DlgLnkTargetParent : "Vorige Venster (_parent)", +DlgLnkTargetSelf : "Selfde Venster (_self)", +DlgLnkTargetTop : "Boonste Venster (_top)", +DlgLnkTargetFrameName : "Mikpunt Venster Naam", +DlgLnkPopWinName : "Popup Venster Naam", +DlgLnkPopWinFeat : "Popup Venster Geaartheid", +DlgLnkPopResize : "Verstelbare Groote", +DlgLnkPopLocation : "Adres Balk", +DlgLnkPopMenu : "Menu Balk", +DlgLnkPopScroll : "Gleibalkstuk", +DlgLnkPopStatus : "Status Balk", +DlgLnkPopToolbar : "Gereedskap Balk", +DlgLnkPopFullScrn : "Voll Skerm (IE)", +DlgLnkPopDependent : "Afhanklik (Netscape)", +DlgLnkPopWidth : "Weite", +DlgLnkPopHeight : "Hoogde", +DlgLnkPopLeft : "Links Posisie", +DlgLnkPopTop : "Bo Posisie", + +DlnLnkMsgNoUrl : "Voeg asseblief die URL in", +DlnLnkMsgNoEMail : "Voeg asseblief die e-mail adres in", +DlnLnkMsgNoAnchor : "Kies asseblief 'n plekhouer", +DlnLnkMsgInvPopName : "Die popup naam moet begin met alphabetiese karakters sonder spasies.", + +// Color Dialog +DlgColorTitle : "Kies Kleur", +DlgColorBtnClear : "Maak skoon", +DlgColorHighlight : "Highlight", +DlgColorSelected : "Geselekteer", + +// Smiley Dialog +DlgSmileyTitle : "Voeg Smiley by", + +// Special Character Dialog +DlgSpecialCharTitle : "Kies spesiale karakter", + +// Table Dialog +DlgTableTitle : "Tabel eienskappe", +DlgTableRows : "Reie", +DlgTableColumns : "Kolome", +DlgTableBorder : "Kant groote", +DlgTableAlign : "Parideering", +DlgTableAlignNotSet : "", +DlgTableAlignLeft : "Links", +DlgTableAlignCenter : "Middel", +DlgTableAlignRight : "Regs", +DlgTableWidth : "Weite", +DlgTableWidthPx : "pixels", +DlgTableWidthPc : "percent", +DlgTableHeight : "Hoogde", +DlgTableCellSpace : "Cell spasieering", +DlgTableCellPad : "Cell buffer", +DlgTableCaption : "Beskreiwing", +DlgTableSummary : "Opsomming", + +// Table Cell Dialog +DlgCellTitle : "Cell eienskappe", +DlgCellWidth : "Weite", +DlgCellWidthPx : "pixels", +DlgCellWidthPc : "percent", +DlgCellHeight : "Hoogde", +DlgCellWordWrap : "Woord Wrap", +DlgCellWordWrapNotSet : "", +DlgCellWordWrapYes : "Ja", +DlgCellWordWrapNo : "Nee", +DlgCellHorAlign : "Horisontale rigting", +DlgCellHorAlignNotSet : "", +DlgCellHorAlignLeft : "Links", +DlgCellHorAlignCenter : "Middel", +DlgCellHorAlignRight: "Regs", +DlgCellVerAlign : "Vertikale rigting", +DlgCellVerAlignNotSet : "", +DlgCellVerAlignTop : "Bo", +DlgCellVerAlignMiddle : "Middel", +DlgCellVerAlignBottom : "Onder", +DlgCellVerAlignBaseline : "Baseline", +DlgCellRowSpan : "Rei strekking", +DlgCellCollSpan : "Kolom strekking", +DlgCellBackColor : "Agtergrond Kleur", +DlgCellBorderColor : "Kant Kleur", +DlgCellBtnSelect : "Keuse...", + +// Find and Replace Dialog +DlgFindAndReplaceTitle : "Find and Replace", //MISSING + +// Find Dialog +DlgFindTitle : "Vind", +DlgFindFindBtn : "Vind", +DlgFindNotFoundMsg : "Die gespesifiseerde karakters word nie gevind nie.", + +// Replace Dialog +DlgReplaceTitle : "Vervang", +DlgReplaceFindLbl : "Soek wat:", +DlgReplaceReplaceLbl : "Vervang met:", +DlgReplaceCaseChk : "Vergelyk karakter skryfweise", +DlgReplaceReplaceBtn : "Vervang", +DlgReplaceReplAllBtn : "Vervang alles", +DlgReplaceWordChk : "Vergelyk komplete woord", + +// Paste Operations / Dialog +PasteErrorCut : "U browser se sekuriteit instelling behinder die uitsny aksie. Gebruik asseblief die sleutel kombenasie(Ctrl+X).", +PasteErrorCopy : "U browser se sekuriteit instelling behinder die kopieerings aksie. Gebruik asseblief die sleutel kombenasie(Ctrl+C).", + +PasteAsText : "Voeg slegs karakters by", +PasteFromWord : "Byvoeging uit Word", + +DlgPasteMsg2 : "Voeg asseblief die inhoud in die gegewe box by met sleutel kombenasie(Ctrl+V) en druk OK.", +DlgPasteSec : "Because of your browser security settings, the editor is not able to access your clipboard data directly. You are required to paste it again in this window.", //MISSING +DlgPasteIgnoreFont : "Ignoreer karakter soort defenisies", +DlgPasteRemoveStyles : "Verweider Styl defenisies", + +// Color Picker +ColorAutomatic : "Automaties", +ColorMoreColors : "Meer Kleure...", + +// Document Properties +DocProps : "Dokument Eienskappe", + +// Anchor Dialog +DlgAnchorTitle : "Plekhouer Eienskappe", +DlgAnchorName : "Plekhouer Naam", +DlgAnchorErrorName : "Voltooi die plekhouer naam asseblief", + +// Speller Pages Dialog +DlgSpellNotInDic : "Nie in woordeboek nie", +DlgSpellChangeTo : "Verander na", +DlgSpellBtnIgnore : "Ignoreer", +DlgSpellBtnIgnoreAll : "Ignoreer na-volgende", +DlgSpellBtnReplace : "Vervang", +DlgSpellBtnReplaceAll : "vervang na-volgende", +DlgSpellBtnUndo : "Ont-skep", +DlgSpellNoSuggestions : "- Geen voorstel -", +DlgSpellProgress : "Spelling word beproef...", +DlgSpellNoMispell : "Spellproef kompleet: Geen foute", +DlgSpellNoChanges : "Spellproef kompleet: Geen woord veranderings", +DlgSpellOneChange : "Spellproef kompleet: Een woord verander", +DlgSpellManyChanges : "Spellproef kompleet: %1 woorde verander", + +IeSpellDownload : "Geen Spellproefer geinstaleer nie. Wil U dit aflaai?", + +// Button Dialog +DlgButtonText : "Karakters (Waarde)", +DlgButtonType : "Soort", +DlgButtonTypeBtn : "Knop", +DlgButtonTypeSbm : "Indien", +DlgButtonTypeRst : "Reset", + +// Checkbox and Radio Button Dialogs +DlgCheckboxName : "Naam", +DlgCheckboxValue : "Waarde", +DlgCheckboxSelected : "Uitgekies", + +// Form Dialog +DlgFormName : "Naam", +DlgFormAction : "Aksie", +DlgFormMethod : "Metode", + +// Select Field Dialog +DlgSelectName : "Naam", +DlgSelectValue : "Waarde", +DlgSelectSize : "Grote", +DlgSelectLines : "lyne", +DlgSelectChkMulti : "Laat meerere keuses toe", +DlgSelectOpAvail : "Beskikbare Opsies", +DlgSelectOpText : "Karakters", +DlgSelectOpValue : "Waarde", +DlgSelectBtnAdd : "Byvoeg", +DlgSelectBtnModify : "Verander", +DlgSelectBtnUp : "Op", +DlgSelectBtnDown : "Af", +DlgSelectBtnSetValue : "Stel as uitgekiesde waarde", +DlgSelectBtnDelete : "Verweider", + +// Textarea Dialog +DlgTextareaName : "Naam", +DlgTextareaCols : "Kolom", +DlgTextareaRows : "Reie", + +// Text Field Dialog +DlgTextName : "Naam", +DlgTextValue : "Waarde", +DlgTextCharWidth : "Karakter weite", +DlgTextMaxChars : "Maximale karakters", +DlgTextType : "Soort", +DlgTextTypeText : "Karakters", +DlgTextTypePass : "Wagwoord", + +// Hidden Field Dialog +DlgHiddenName : "Naam", +DlgHiddenValue : "Waarde", + +// Bulleted List Dialog +BulletedListProp : "Gepunkte lys eienskappe", +NumberedListProp : "Genommerde lys eienskappe", +DlgLstStart : "Begin", +DlgLstType : "Soort", +DlgLstTypeCircle : "Sirkel", +DlgLstTypeDisc : "Skyf", +DlgLstTypeSquare : "Vierkant", +DlgLstTypeNumbers : "Nommer (1, 2, 3)", +DlgLstTypeLCase : "Klein Letters (a, b, c)", +DlgLstTypeUCase : "Hoof Letters (A, B, C)", +DlgLstTypeSRoman : "Klein Romeinse nommers (i, ii, iii)", +DlgLstTypeLRoman : "Groot Romeinse nommers (I, II, III)", + +// Document Properties Dialog +DlgDocGeneralTab : "Algemeen", +DlgDocBackTab : "Agtergrond", +DlgDocColorsTab : "Kleure en Rante", +DlgDocMetaTab : "Meta Data", + +DlgDocPageTitle : "Bladsy Opskrif", +DlgDocLangDir : "Taal rigting", +DlgDocLangDirLTR : "Link na Regs (LTR)", +DlgDocLangDirRTL : "Regs na Links (RTL)", +DlgDocLangCode : "Taal Kode", +DlgDocCharSet : "Karakterstel Kodeering", +DlgDocCharSetCE : "Sentraal Europa", +DlgDocCharSetCT : "Chinees Traditioneel (Big5)", +DlgDocCharSetCR : "Cyrillic", +DlgDocCharSetGR : "Grieks", +DlgDocCharSetJP : "Japanees", +DlgDocCharSetKR : "Koreans", +DlgDocCharSetTR : "Turks", +DlgDocCharSetUN : "Unicode (UTF-8)", +DlgDocCharSetWE : "Western European", +DlgDocCharSetOther : "Ander Karakterstel Kodeering", + +DlgDocDocType : "Dokument Opskrif Soort", +DlgDocDocTypeOther : "Ander Dokument Opskrif Soort", +DlgDocIncXHTML : "Voeg XHTML verklaring by", +DlgDocBgColor : "Agtergrond kleur", +DlgDocBgImage : "Agtergrond Beeld URL", +DlgDocBgNoScroll : "Vasgeklemde Agtergrond", +DlgDocCText : "Karakters", +DlgDocCLink : "Skakel", +DlgDocCVisited : "Besoekte Skakel", +DlgDocCActive : "Aktiewe Skakel", +DlgDocMargins : "Bladsy Rante", +DlgDocMaTop : "Bo", +DlgDocMaLeft : "Links", +DlgDocMaRight : "Regs", +DlgDocMaBottom : "Onder", +DlgDocMeIndex : "Dokument Index Sleutelwoorde(comma verdeelt)", +DlgDocMeDescr : "Dokument Beskrywing", +DlgDocMeAuthor : "Skrywer", +DlgDocMeCopy : "Kopiereg", +DlgDocPreview : "Voorskou", + +// Templates Dialog +Templates : "Templates", +DlgTemplatesTitle : "Inhoud Templates", +DlgTemplatesSelMsg : "Kies die template om te gebruik in die editor
        (Inhoud word vervang!):", +DlgTemplatesLoading : "Templates word gelaai. U geduld asseblief...", +DlgTemplatesNoTpl : "(Geen templates gedefinieerd)", +DlgTemplatesReplace : "Vervang bestaande inhoud", + +// About Dialog +DlgAboutAboutTab : "Meer oor", +DlgAboutBrowserInfoTab : "Blaai Informasie deur", +DlgAboutLicenseTab : "Lesensie", +DlgAboutVersion : "weergawe", +DlgAboutInfo : "Vir meer informasie gaan na " +}; Property changes on: announcement/trunk/src/main/webapp/fckeditor/editor/lang/af.js ___________________________________________________________________ Name: svn:eol-style + native Added: announcement/trunk/src/main/webapp/fckeditor/editor/lang/ar.js =================================================================== --- announcement/trunk/src/main/webapp/fckeditor/editor/lang/ar.js (rev 0) +++ announcement/trunk/src/main/webapp/fckeditor/editor/lang/ar.js 2008-06-30 02:54:27 UTC (rev 1002) @@ -0,0 +1,515 @@ +?/* + * FCKeditor - The text editor for Internet - http://www.fckeditor.net + * Copyright (C) 2003-2008 Frederico Caldeira Knabben + * + * == BEGIN LICENSE == + * + * Licensed under the terms of any of the following licenses at your + * choice: + * + * - GNU General Public License Version 2 or later (the "GPL") + * http://www.gnu.org/licenses/gpl.html + * + * - GNU Lesser General Public License Version 2.1 or later (the "LGPL") + * http://www.gnu.org/licenses/lgpl.html + * + * - Mozilla Public License Version 1.1 or later (the "MPL") + * http://www.mozilla.org/MPL/MPL-1.1.html + * + * == END LICENSE == + * + * Arabic language file. + */ + +var FCKLang = +{ +// Language direction : "ltr" (left to right) or "rtl" (right to left). +Dir : "rtl", + +ToolbarCollapse : "?? ???? ???????", +ToolbarExpand : "???? ???? ???????", + +// Toolbar Items and Context Menu +Save : "???", +NewPage : "???? ?????", +Preview : "?????? ??????", +Cut : "??", +Copy : "???", +Paste : "???", +PasteText : "??? ??? ????", +PasteWord : "??? ?? ????", +Print : "?????", +SelectAll : "????? ????", +RemoveFormat : "????? ?????????", +InsertLinkLbl : "????", +InsertLink : "?????/????? ????", +RemoveLink : "????? ????", +Anchor : "?????/????? ????? ??????", +AnchorDelete : "????? ????? ??????", +InsertImageLbl : "????", +InsertImage : "?????/????? ????", +InsertFlashLbl : "????", +InsertFlash : "?????/????? ???? ????", +InsertTableLbl : "????", +InsertTable : "?????/????? ????", +InsertLineLbl : "?? ????", +InsertLine : "????? ?? ????", +InsertSpecialCharLbl: "????", +InsertSpecialChar : "????? ????..?", +InsertSmileyLbl : "????????", +InsertSmiley : "????? ????????", +About : "??? FCKeditor", +Bold : "????", +Italic : "????", +Underline : "?????", +StrikeThrough : "?????? ??", +Subscript : "?????", +Superscript : "?????", +LeftJustify : "?????? ??? ??????", +CenterJustify : "?????", +RightJustify : "?????? ??? ??????", +BlockJustify : "???", +DecreaseIndent : "????? ??????? ???????", +IncreaseIndent : "????? ??????? ???????", +Blockquote : "??????", +Undo : "?????", +Redo : "?????", +NumberedListLbl : "????? ????", +NumberedList : "?????/????? ????? ????", +BulletedListLbl : "????? ????", +BulletedList : "?????/????? ????? ????", +ShowTableBorders : "?????? ???? ???????", +ShowDetails : "?????? ????????", +Style : "???", +FontFormat : "?????", +Font : "??", +FontSize : "??? ????", +TextColor : "??? ????", +BGColor : "??? ???????", +Source : "???? ??????", +Find : "???", +Replace : "???????", +SpellCheck : "????? ??????", +UniversalKeyboard : "???? ???????? ????????", +PageBreakLbl : "??? ??????", +PageBreak : "????? ???? ?????", + +Form : "?????", +Checkbox : "???? ??????", +RadioButton : "?? ????", +TextField : "???? ??", +Textarea : "????? ??", +HiddenField : "????? ??? ???", +Button : "?? ???", +SelectionField : "????? ??????", +ImageButton : "?? ????", + +FitWindow : "????? ??? ??????", +ShowBlocks : "???? ??????", + +// Context Menu +EditLink : "????? ????", +CellCM : "????", +RowCM : "??", +ColumnCM : "????", +InsertRowAfter : "????? ?? ???", +InsertRowBefore : "????? ?? ???", +DeleteRows : "??? ????", +InsertColumnAfter : "????? ???? ???", +InsertColumnBefore : "????? ???? ???", +DeleteColumns : "??? ?????", +InsertCellAfter : "????? ???? ???", +InsertCellBefore : "????? ???? ???", +DeleteCells : "??? ?????", +MergeCells : "??? ?????", +MergeRight : "??? ??????", +MergeDown : "??? ??????", +HorizontalSplitCell : "????? ?????? ??????", +VerticalSplitCell : "????? ?????? ???????", +TableDelete : "??? ??????", +CellProperties : "????? ??????", +TableProperties : "????? ??????", +ImageProperties : "????? ??????", +FlashProperties : "????? ???? ??????", + +AnchorProp : "????? ??????? ????????", +ButtonProp : "????? ?? ?????", +CheckboxProp : "????? ???? ????????", +HiddenFieldProp : "????? ????? ?????", +RadioButtonProp : "????? ?? ??????", +ImageButtonProp : "????? ?? ??????", +TextFieldProp : "????? ???? ????", +SelectionFieldProp : "????? ??????? ????????", +TextareaProp : "????? ????? ????", +FormProp : "????? ???????", + +FontFormats : "????;?????;???;??????? 1;??????? 2;??????? 3;??????? 4;??????? 5;??????? 6", + +// Alerts and Messages +ProcessingXHTML : "????? ?????? ????? ??? ???????? XHTML. ?? ?????? ??????...", +Done : "??", +PasteWordConfirm : "???? ?? ???? ?????? ???? ????? ?? ?????? ????. ?? ??? ?????? ??? ?????? ?? ????? ??????", +NotCompatiblePaste : "??? ?????? ????? ?????? ?? ?????Internet Explorer ????? 5.5 ??? ???. ?? ??? ????? ??? ????? ??????", +UnknownToolbarItem : "???? ???? ????? ??? ????? \"%1\"", +UnknownCommand : "??? ??? ????? \"%1\"", +NotImplemented : "?? ??? ??? ??? ?????", +UnknownToolbarSet : "?? ????? ?? ?????? ??? ??? ??????? \"%1\" ", +NoActiveX : "?????? ?????? ??? ?? ???? ??? ?????? ??????. ????? ???? ????? ?????? \"Run ActiveX controls and plug-ins\". ?? ????? ????? ?????? ?????? ??????", +BrowseServerBlocked : "?????? ??? ???? ???????. ???? ??? ?????? ??? ???? ????? ??????? ???????? ?????", +DialogBlocked : "?????? ??? ????? ?????? . ???? ???? ?? ?? ???? ??????? ??????? ???? .", + +// Dialogs +DlgBtnOK : "?????", +DlgBtnCancel : "????? ?????", +DlgBtnClose : "?????", +DlgBtnBrowseServer : "???? ??????", +DlgAdvancedTag : "?????", +DlgOpOther : "", +DlgInfoTab : "???????", +DlgAlertUrl : "?????? ????? ????? ????????", + +// General Dialogs Labels +DlgGenNotSet : "", +DlgGenId : "?????", +DlgGenLangDir : "????? ????", +DlgGenLangDirLtr : "?????? ?????? (LTR)", +DlgGenLangDirRtl : "?????? ?????? (RTL)", +DlgGenLangCode : "??? ?????", +DlgGenAccessKey : "?????? ????????", +DlgGenName : "?????", +DlgGenTabIndex : "???????", +DlgGenLongDescr : "????? ????? ???????", +DlgGenClass : "???? ???????", +DlgGenTitle : "????? ??????", +DlgGenContType : "??? ???????", +DlgGenLinkCharset : "????? ?????? ????????", +DlgGenStyle : "???", + +// Image Dialog +DlgImgTitle : "????? ??????", +DlgImgInfoTab : "??????? ??????", +DlgImgBtnUpload : "?????? ??????", +DlgImgURL : "???? ??????", +DlgImgUpload : "???", +DlgImgAlt : "?????", +DlgImgWidth : "?????", +DlgImgHeight : "????????", +DlgImgLockRatio : "????? ?????", +DlgBtnResetSize : "??????? ????? ??????", +DlgImgBorder : "??? ??????", +DlgImgHSpace : "????? ????", +DlgImgVSpace : "????? ?????", +DlgImgAlign : "??????", +DlgImgAlignLeft : "????", +DlgImgAlignAbsBottom: "???? ????", +DlgImgAlignAbsMiddle: "??? ?????", +DlgImgAlignBaseline : "??? ?????", +DlgImgAlignBottom : "????", +DlgImgAlignMiddle : "???", +DlgImgAlignRight : "????", +DlgImgAlignTextTop : "???? ????", +DlgImgAlignTop : "????", +DlgImgPreview : "??????", +DlgImgAlertUrl : "????? ???? ?????? ???? ???? ???? ??? ??????.", +DlgImgLinkTab : "??????", + +// Flash Dialog +DlgFlashTitle : "????? ???? ??????", +DlgFlashChkPlay : "????? ??????", +DlgFlashChkLoop : "?????", +DlgFlashChkMenu : "????? ????? ???? ??????", +DlgFlashScale : "?????", +DlgFlashScaleAll : "????? ????", +DlgFlashScaleNoBorder : "??? ????", +DlgFlashScaleFit : "??? ???", + +// Link Dialog +DlgLnkWindowTitle : "?????? ?????", +DlgLnkInfoTab : "??????? ??????", +DlgLnkTargetTab : "?????", + +DlgLnkType : "??? ?????", +DlgLnkTypeURL : "???????", +DlgLnkTypeAnchor : "???? ?? ??? ???????", +DlgLnkTypeEMail : "???? ????????", +DlgLnkProto : "??????????", +DlgLnkProtoOther : "", +DlgLnkURL : "??????", +DlgLnkAnchorSel : "???? ????? ??????", +DlgLnkAnchorByName : "??? ??? ???????", +DlgLnkAnchorById : "??? ????? ??????", +DlgLnkNoAnchors : "(?? ???? ?????? ?????? ?? ??? ???????)", +DlgLnkEMail : "????? ???? ????????", +DlgLnkEMailSubject : "????? ???????", +DlgLnkEMailBody : "????? ???????", +DlgLnkUpload : "???", +DlgLnkBtnUpload : "?????? ??????", + +DlgLnkTarget : "?????", +DlgLnkTargetFrame : "", +DlgLnkTargetPopup : "", +DlgLnkTargetBlank : "???? ???? (_blank)", +DlgLnkTargetParent : "?????? ????? (_parent)", +DlgLnkTargetSelf : "??? ?????? (_self)", +DlgLnkTargetTop : "???? ????? (_top)", +DlgLnkTargetFrameName : "??? ?????? ?????", +DlgLnkPopWinName : "????? ??????? ????????", +DlgLnkPopWinFeat : "????? ??????? ????????", +DlgLnkPopResize : "????? ???????", +DlgLnkPopLocation : "???? ???????", +DlgLnkPopMenu : "??????? ????????", +DlgLnkPopScroll : "????? ???????", +DlgLnkPopStatus : "???? ?????? ??????", +DlgLnkPopToolbar : "???? ???????", +DlgLnkPopFullScrn : "??? ?????? (IE)", +DlgLnkPopDependent : "???? (Netscape)", +DlgLnkPopWidth : "?????", +DlgLnkPopHeight : "????????", +DlgLnkPopLeft : "??????? ??????", +DlgLnkPopTop : "??????? ??????", + +DlnLnkMsgNoUrl : "????? ???? ????? ?????? ???? ???? ???? ??????", +DlnLnkMsgNoEMail : "????? ???? ????? ?????? ??????????", +DlnLnkMsgNoAnchor : "????? ??? ??????? ???????? ????????", +DlnLnkMsgInvPopName : "??? ??????? ???????? ??? ?? ???? ???? ????? ??? ??????", + +// Color Dialog +DlgColorTitle : "???? ?????", +DlgColorBtnClear : "???", +DlgColorHighlight : "?????", +DlgColorSelected : "??????", + +// Smiley Dialog +DlgSmileyTitle : "????? ???????? ", + +// Special Character Dialog +DlgSpecialCharTitle : "????? ???", + +// Table Dialog +DlgTableTitle : "????? ????", +DlgTableRows : "????", +DlgTableColumns : "?????", +DlgTableBorder : "??? ??????", +DlgTableAlign : "????????", +DlgTableAlignNotSet : "", +DlgTableAlignLeft : "????", +DlgTableAlignCenter : "???", +DlgTableAlignRight : "????", +DlgTableWidth : "?????", +DlgTableWidthPx : "????", +DlgTableWidthPc : "??????", +DlgTableHeight : "????????", +DlgTableCellSpace : "????? ???????", +DlgTableCellPad : "??????? ???????", +DlgTableCaption : "?????", +DlgTableSummary : "???????", + +// Table Cell Dialog +DlgCellTitle : "????? ??????", +DlgCellWidth : "?????", +DlgCellWidthPx : "????", +DlgCellWidthPc : "??????", +DlgCellHeight : "????????", +DlgCellWordWrap : "?????? ????", +DlgCellWordWrapNotSet : "", +DlgCellWordWrapYes : "???", +DlgCellWordWrapNo : "??", +DlgCellHorAlign : "???????? ???????", +DlgCellHorAlignNotSet : "", +DlgCellHorAlignLeft : "????", +DlgCellHorAlignCenter : "???", +DlgCellHorAlignRight: "????", +DlgCellVerAlign : "???????? ????????", +DlgCellVerAlignNotSet : "", +DlgCellVerAlignTop : "????", +DlgCellVerAlignMiddle : "???", +DlgCellVerAlignBottom : "????", +DlgCellVerAlignBaseline : "??? ?????", +DlgCellRowSpan : "?????? ??????", +DlgCellCollSpan : "?????? ???????", +DlgCellBackColor : "??? ???????", +DlgCellBorderColor : "??? ??????", +DlgCellBtnSelect : "????...", + +// Find and Replace Dialog +DlgFindAndReplaceTitle : "??? ????????", + +// Find Dialog +DlgFindTitle : "???", +DlgFindFindBtn : "????", +DlgFindNotFoundMsg : "?? ??? ?????? ??? ???? ??????.", + +// Replace Dialog +DlgReplaceTitle : "???????", +DlgReplaceFindLbl : "????? ??:", +DlgReplaceReplaceLbl : "??????? ??:", +DlgReplaceCaseChk : "?????? ???? ??????", +DlgReplaceReplaceBtn : "???????", +DlgReplaceReplAllBtn : "??????? ????", +DlgReplaceWordChk : "?????? ??????? ???", + +// Paste Operations / Dialog +PasteErrorCut : "????????? ??????? ??????? ???? ??????? ???? ???? ????????. ????? ?????? ???? ???????? ???? ??? (Ctrl+X).", +PasteErrorCopy : "????????? ??????? ??????? ???? ??????? ???? ????? ????????. ????? ?????? ???? ???????? ???? ??? (Ctrl+C).", + +PasteAsText : "??? ??? ????", +PasteFromWord : "??? ?? ????", + +DlgPasteMsg2 : "???? ???? ??????? ???????? ???? (Ctrl+V) ?? ???? ????????? ?? ???? ?? ?????.", +DlgPasteSec : "????? ???????? ?????? ?????? ???????? ?? ????? ??? ?????? ?? ?????? ?????? ??????? ??? ??? ???? ??? ??????? ??? ???? ?? ??? ???????.", +DlgPasteIgnoreFont : "????? ??????? ????? ??????", +DlgPasteRemoveStyles : "????? ??????? ???????", + +// Color Picker +ColorAutomatic : "??????", +ColorMoreColors : "????? ??????...", + +// Document Properties +DocProps : "????? ??????", + +// Anchor Dialog +DlgAnchorTitle : "????? ????? ??????", +DlgAnchorName : "??? ??????? ????????", +DlgAnchorErrorName : "?????? ????? ??? ??????? ????????", + +// Speller Pages Dialog +DlgSpellNotInDic : "???? ?? ???????", +DlgSpellChangeTo : "??????? ???", +DlgSpellBtnIgnore : "?????", +DlgSpellBtnIgnoreAll : "????? ????", +DlgSpellBtnReplace : "?????", +DlgSpellBtnReplaceAll : "????? ????", +DlgSpellBtnUndo : "?????", +DlgSpellNoSuggestions : "- ?? ???? ???????? -", +DlgSpellProgress : "???? ??????? ????????", +DlgSpellNoMispell : "?? ????? ??????? ????????: ?? ??? ?????? ??? ?? ????? ???????", +DlgSpellNoChanges : "?? ????? ??????? ????????: ?? ??? ????? ?? ????", +DlgSpellOneChange : "?? ????? ??????? ????????: ?? ????? ???? ????? ???", +DlgSpellManyChanges : "?? ????? ??????? ????????: ?? ????? %1 ?????\????", + +IeSpellDownload : "?????? ???????? (?????????) ??? ?????. ?? ??? ?????? ?????", + +// Button Dialog +DlgButtonText : "??????/???????", +DlgButtonType : "??? ????", +DlgButtonTypeBtn : "??", +DlgButtonTypeSbm : "?????", +DlgButtonTypeRst : "????? ?????", + +// Checkbox and Radio Button Dialogs +DlgCheckboxName : "?????", +DlgCheckboxValue : "??????", +DlgCheckboxSelected : "????", + +// Form Dialog +DlgFormName : "?????", +DlgFormAction : "??? ?????", +DlgFormMethod : "???????", + +// Select Field Dialog +DlgSelectName : "?????", +DlgSelectValue : "??????", +DlgSelectSize : "?????", +DlgSelectLines : "??????", +DlgSelectChkMulti : "?????? ???????? ??????", +DlgSelectOpAvail : "???????? ???????", +DlgSelectOpText : "????", +DlgSelectOpValue : "??????", +DlgSelectBtnAdd : "?????", +DlgSelectBtnModify : "?????", +DlgSelectBtnUp : "????? ?????", +DlgSelectBtnDown : "????? ?????", +DlgSelectBtnSetValue : "?????? ?????", +DlgSelectBtnDelete : "?????", + +// Textarea Dialog +DlgTextareaName : "?????", +DlgTextareaCols : "???????", +DlgTextareaRows : "??????", + +// Text Field Dialog +DlgTextName : "?????", +DlgTextValue : "??????", +DlgTextCharWidth : "????? ???????", +DlgTextMaxChars : "??? ?????? ??????", +DlgTextType : "??? ???????", +DlgTextTypeText : "??", +DlgTextTypePass : "???? ????", + +// Hidden Field Dialog +DlgHiddenName : "?????", +DlgHiddenValue : "??????", + +// Bulleted List Dialog +BulletedListProp : "????? ??????? ??????", +NumberedListProp : "????? ??????? ??????", +DlgLstStart : "????? ???", +DlgLstType : "?????", +DlgLstTypeCircle : "?????", +DlgLstTypeDisc : "???", +DlgLstTypeSquare : "????", +DlgLstTypeNumbers : "????? (1? 2? 3)?", +DlgLstTypeLCase : "???? ????? (a, b, c)?", +DlgLstTypeUCase : "???? ????? (A, B, C)?", +DlgLstTypeSRoman : "????? ?????? ???? (i, ii, iii)?", +DlgLstTypeLRoman : "????? ?????? ???? (I, II, III)?", + +// Document Properties Dialog +DlgDocGeneralTab : "???", +DlgDocBackTab : "???????", +DlgDocColorsTab : "??????? ????????", +DlgDocMetaTab : "????????? ???????", + +DlgDocPageTitle : "????? ??????", +DlgDocLangDir : "????? ?????", +DlgDocLangDirLTR : "?????? ?????? (LTR)", +DlgDocLangDirRTL : "?????? ?????? (RTL)", +DlgDocLangCode : "??? ?????", +DlgDocCharSet : "????? ??????", +DlgDocCharSetCE : "?????? ??????", +DlgDocCharSetCT : "??????? ????????? (Big5)", +DlgDocCharSetCR : "?????????", +DlgDocCharSetGR : "?????????", +DlgDocCharSetJP : "?????????", +DlgDocCharSetKR : "???????", +DlgDocCharSetTR : "???????", +DlgDocCharSetUN : "Unicode (UTF-8)", +DlgDocCharSetWE : "?????? ???????", +DlgDocCharSetOther : "????? ???", + +DlgDocDocType : "?????? ??? ??????", +DlgDocDocTypeOther : "?????? ??? ???? ????", +DlgDocIncXHTML : "????? ???????? ??? XHTML?", +DlgDocBgColor : "??? ???????", +DlgDocBgImage : "???? ?????? ???????", +DlgDocBgNoScroll : "????? ????? ?????", +DlgDocCText : "????", +DlgDocCLink : "???????", +DlgDocCVisited : "???????", +DlgDocCActive : "??????", +DlgDocMargins : "????? ??????", +DlgDocMaTop : "????", +DlgDocMaLeft : "????", +DlgDocMaRight : "????", +DlgDocMaBottom : "????", +DlgDocMeIndex : "??????? ???????? (?????? ??????)?", +DlgDocMeDescr : "??? ??????", +DlgDocMeAuthor : "??????", +DlgDocMeCopy : "??????", +DlgDocPreview : "??????", + +// Templates Dialog +Templates : "???????", +DlgTemplatesTitle : "????? ???????", +DlgTemplatesSelMsg : "???? ?????? ???? ??? ???? ?? ??????
        (???? ????? ??????? ??????):", +DlgTemplatesLoading : "???? ????? ????? ???????? ?????? ????????...", +DlgTemplatesNoTpl : "(?? ??? ????? ?? ????)", +DlgTemplatesReplace : "??????? ???????", + +// About Dialog +DlgAboutAboutTab : "????", +DlgAboutBrowserInfoTab : "??????? ??????", +DlgAboutLicenseTab : "???????", +DlgAboutVersion : "???????", +DlgAboutInfo : "????? ?? ????????? ???? ??????" +}; Property changes on: announcement/trunk/src/main/webapp/fckeditor/editor/lang/ar.js ___________________________________________________________________ Name: svn:eol-style + native Added: announcement/trunk/src/main/webapp/fckeditor/editor/lang/bg.js =================================================================== --- announcement/trunk/src/main/webapp/fckeditor/editor/lang/bg.js (rev 0) +++ announcement/trunk/src/main/webapp/fckeditor/editor/lang/bg.js 2008-06-30 02:54:27 UTC (rev 1002) @@ -0,0 +1,515 @@ +?/* + * FCKeditor - The text editor for Internet - http://www.fckeditor.net + * Copyright (C) 2003-2008 Frederico Caldeira Knabben + * + * == BEGIN LICENSE == + * + * Licensed under the terms of any of the following licenses at your + * choice: + * + * - GNU General Public License Version 2 or later (the "GPL") + * http://www.gnu.org/licenses/gpl.html + * + * - GNU Lesser General Public License Version 2.1 or later (the "LGPL") + * http://www.gnu.org/licenses/lgpl.html + * + * - Mozilla Public License Version 1.1 or later (the "MPL") + * http://www.mozilla.org/MPL/MPL-1.1.html + * + * == END LICENSE == + * + * Bulgarian language file. + */ + +var FCKLang = +{ +// Language direction : "ltr" (left to right) or "rtl" (right to left). +Dir : "ltr", + +ToolbarCollapse : "Скрий панела с инструментите", +ToolbarExpand : "Покажи панела с инструментите", + +// Toolbar Items and Context Menu +Save : "Запази", +NewPage : "Нова страница", +Preview : "Предварителен изглед", +Cut : "Изрежи", +Copy : "Запамети", +Paste : "Вмъкни", +PasteText : "Вмъкни само текст", +PasteWord : "Вмъкни от MS Word", +Print : "Печат", +SelectAll : "Селектирай всичко", +RemoveFormat : "Изтрий форматирането", +InsertLinkLbl : "Връзка", +InsertLink : "Добави/Редактирай връзка", +RemoveLink : "Изтрий връзка", +Anchor : "Добави/Редактирай котва", +AnchorDelete : "Remove Anchor", //MISSING +InsertImageLbl : "Изображение", +InsertImage : "Добави/Редактирай изображение", +InsertFlashLbl : "Flash", +InsertFlash : "Добави/Редактиай Flash обект", +InsertTableLbl : "Таблица", +InsertTable : "Добави/Редактирай таблица", +InsertLineLbl : "Линия", +InsertLine : "Вмъкни хоризонтална линия", +InsertSpecialCharLbl: "Специален символ", +InsertSpecialChar : "Вмъкни специален символ", +InsertSmileyLbl : "Усмивка", +InsertSmiley : "Добави усмивка", +About : "За FCKeditor", +Bold : "Удебелен", +Italic : "Курсив", +Underline : "Подчертан", +StrikeThrough : "Зачертан", +Subscript : "Индекс за база", +Superscript : "Индекс за степен", +LeftJustify : "Подравняване в ляво", +CenterJustify : "Подравнявне в средата", +RightJustify : "Подравняване в дясно", +BlockJustify : "Двустранно подравняване", +DecreaseIndent : "Намали отстъпа", +IncreaseIndent : "Увеличи отстъпа", +Blockquote : "Blockquote", //MISSING +Undo : "Отмени", +Redo : "Повтори", +NumberedListLbl : "Нумериран списък", +NumberedList : "Добави/Изтрий нумериран списък", +BulletedListLbl : "Ненумериран списък", +BulletedList : "Добави/Изтрий ненумериран списък", +ShowTableBorders : "Покажи рамките на таблицата", +ShowDetails : "Покажи подробности", +Style : "Стил", +FontFormat : "Формат", +Font : "Шрифт", +FontSize : "Размер", +TextColor : "Цвят на текста", +BGColor : "Цвят на фона", +Source : "Код", +Find : "Търси", +Replace : "Замести", +SpellCheck : "Провери правописа", +UniversalKeyboard : "Универсална клавиатура", +PageBreakLbl : "Нов ред", +PageBreak : "Вмъкни нов ред", + +Form : "Формуляр", +Checkbox : "Поле за отметка", +RadioButton : "Поле за опция", +TextField : "Текстово поле", +Textarea : "Текстова област", +HiddenField : "Скрито поле", +Button : "Бутон", +SelectionField : "Падащо меню с опции", +ImageButton : "Бутон-изображение", + +FitWindow : "Maximize the editor size", //MISSING +ShowBlocks : "Show Blocks", //MISSING + +// Context Menu +EditLink : "Редактирай връзка", +CellCM : "Cell", //MISSING +RowCM : "Row", //MISSING +ColumnCM : "Column", //MISSING +InsertRowAfter : "Insert Row After", //MISSING +InsertRowBefore : "Insert Row Before", //MISSING +DeleteRows : "Изтрий редовете", +InsertColumnAfter : "Insert Column After", //MISSING +InsertColumnBefore : "Insert Column Before", //MISSING +DeleteColumns : "Изтрий колоните", +InsertCellAfter : "Insert Cell After", //MISSING +InsertCellBefore : "Insert Cell Before", //MISSING +DeleteCells : "Изтрий клетките", +MergeCells : "Обедини клетките", +MergeRight : "Merge Right", //MISSING +MergeDown : "Merge Down", //MISSING +HorizontalSplitCell : "Split Cell Horizontally", //MISSING +VerticalSplitCell : "Split Cell Vertically", //MISSING +TableDelete : "Изтрий таблицата", +CellProperties : "Параметри на клетката", +TableProperties : "Параметри на таблицата", +ImageProperties : "Параметри на изображението", +FlashProperties : "Параметри на Flash обекта", + +AnchorProp : "Параметри на котвата", +ButtonProp : "Параметри на бутона", +CheckboxProp : "Параметри на полето за отметка", +HiddenFieldProp : "Параметри на скритото поле", +RadioButtonProp : "Параметри на полето за опция", +ImageButtonProp : "Параметри на бутона-изображение", +TextFieldProp : "Параметри на текстовото-поле", +SelectionFieldProp : "Параметри на падащото меню с опции", +TextareaProp : "Параметри на текстовата област", +FormProp : "Параметри на формуляра", + +FontFormats : "Нормален;Форматиран;Адрес;Заглавие 1;Заглавие 2;Заглавие 3;Заглавие 4;Заглавие 5;Заглавие 6;Параграф (DIV)", + +// Alerts and Messages +ProcessingXHTML : "Обработка на XHTML. Моля изчакайте...", +Done : "Готово", +PasteWordConfirm : "Текстът, който искате да вмъкнете е копиран от MS Word. Желаете ли да бъде изчистен преди вмъкването?", +NotCompatiblePaste : "Тази операция изисква MS Internet Explorer версия 5.5 или по-висока. Желаете ли да вмъкнете запаметеното без изчистване?", +UnknownToolbarItem : "Непознат инструмент \"%1\"", +UnknownCommand : "Непозната команда \"%1\"", +NotImplemented : "Командата не е имплементирана", +UnknownToolbarSet : "Панелът \"%1\" не съществува", +NoActiveX : "Your browser's security settings could limit some features of the editor. You must enable the option \"Run ActiveX controls and plug-ins\". You may experience errors and notice missing features.", //MISSING +BrowseServerBlocked : "The resources browser could not be opened. Make sure that all popup blockers are disabled.", //MISSING +DialogBlocked : "It was not possible to open the dialog window. Make sure all popup blockers are disabled.", //MISSING + +// Dialogs +DlgBtnOK : "ОК", +DlgBtnCancel : "Отказ", +DlgBtnClose : "Затвори", +DlgBtnBrowseServer : "Разгледай сървъра", +DlgAdvancedTag : "Подробности...", +DlgOpOther : "<Друго>", +DlgInfoTab : "Информация", +DlgAlertUrl : "Моля, въведете пълния път (URL)", + +// General Dialogs Labels +DlgGenNotSet : "<не е настроен>", +DlgGenId : "Идентификатор", +DlgGenLangDir : "посока на речта", +DlgGenLangDirLtr : "От ляво на дясно", +DlgGenLangDirRtl : "От дясно на ляво", +DlgGenLangCode : "Код на езика", +DlgGenAccessKey : "Бърз клавиш", +DlgGenName : "Име", +DlgGenTabIndex : "Ред на достъп", +DlgGenLongDescr : "Описание на връзката", +DlgGenClass : "Клас от стиловите таблици", +DlgGenTitle : "Препоръчително заглавие", +DlgGenContType : "Препоръчителен тип на съдържанието", +DlgGenLinkCharset : "Тип на свързания ресурс", +DlgGenStyle : "Стил", + +// Image Dialog +DlgImgTitle : "Параметри на изображението", +DlgImgInfoTab : "Информация за изображението", +DlgImgBtnUpload : "Прати към сървъра", +DlgImgURL : "Пълен път (URL)", +DlgImgUpload : "Качи", +DlgImgAlt : "Алтернативен текст", +DlgImgWidth : "Ширина", +DlgImgHeight : "Височина", +DlgImgLockRatio : "Запази пропорцията", +DlgBtnResetSize : "Възстанови размера", +DlgImgBorder : "Рамка", +DlgImgHSpace : "Хоризонтален отстъп", +DlgImgVSpace : "Вертикален отстъп", +DlgImgAlign : "Подравняване", +DlgImgAlignLeft : "Ляво", +DlgImgAlignAbsBottom: "Най-долу", +DlgImgAlignAbsMiddle: "Точно по средата", +DlgImgAlignBaseline : "По базовата линия", +DlgImgAlignBottom : "Долу", +DlgImgAlignMiddle : "По средата", +DlgImgAlignRight : "Дясно", +DlgImgAlignTextTop : "Върху текста", +DlgImgAlignTop : "Отгоре", +DlgImgPreview : "Изглед", +DlgImgAlertUrl : "Моля, въведете пълния път до изображението", +DlgImgLinkTab : "Връзка", + +// Flash Dialog +DlgFlashTitle : "Параметри на Flash обекта", +DlgFlashChkPlay : "Автоматично стартиране", +DlgFlashChkLoop : "Ново стартиране след завършването", +DlgFlashChkMenu : "Разрешено Flash меню", +DlgFlashScale : "Оразмеряване", +DlgFlashScaleAll : "Покажи целия обект", +DlgFlashScaleNoBorder : "Без рамка", +DlgFlashScaleFit : "Според мястото", + +// Link Dialog +DlgLnkWindowTitle : "Връзка", +DlgLnkInfoTab : "Информация за връзката", +DlgLnkTargetTab : "Цел", + +DlgLnkType : "Вид на връзката", +DlgLnkTypeURL : "Пълен път (URL)", +DlgLnkTypeAnchor : "Котва в текущата страница", +DlgLnkTypeEMail : "Е-поща", +DlgLnkProto : "Протокол", +DlgLnkProtoOther : "<друго>", +DlgLnkURL : "Пълен път (URL)", +DlgLnkAnchorSel : "Изберете котва", +DlgLnkAnchorByName : "По име на котвата", +DlgLnkAnchorById : "По идентификатор на елемент", +DlgLnkNoAnchors : "(Няма котви в текущия документ)", +DlgLnkEMail : "Адрес за е-поща", +DlgLnkEMailSubject : "Тема на писмото", +DlgLnkEMailBody : "Текст на писмото", +DlgLnkUpload : "Качи", +DlgLnkBtnUpload : "Прати на сървъра", + +DlgLnkTarget : "Цел", +DlgLnkTargetFrame : "<рамка>", +DlgLnkTargetPopup : "<дъщерен прозорец>", +DlgLnkTargetBlank : "Нов прозорец (_blank)", +DlgLnkTargetParent : "Родителски прозорец (_parent)", +DlgLnkTargetSelf : "Активния прозорец (_self)", +DlgLnkTargetTop : "Целия прозорец (_top)", +DlgLnkTargetFrameName : "Име на целевия прозорец", +DlgLnkPopWinName : "Име на дъщерния прозорец", +DlgLnkPopWinFeat : "Параметри на дъщерния прозорец", +DlgLnkPopResize : "С променливи размери", +DlgLnkPopLocation : "Поле за адрес", +DlgLnkPopMenu : "Меню", +DlgLnkPopScroll : "Плъзгач", +DlgLnkPopStatus : "Поле за статус", +DlgLnkPopToolbar : "Панел с бутони", +DlgLnkPopFullScrn : "Голям екран (MS IE)", +DlgLnkPopDependent : "Зависим (Netscape)", +DlgLnkPopWidth : "Ширина", +DlgLnkPopHeight : "Височина", +DlgLnkPopLeft : "Координати - X", +DlgLnkPopTop : "Координати - Y", + +DlnLnkMsgNoUrl : "Моля, напишете пълния път (URL)", +DlnLnkMsgNoEMail : "Моля, напишете адреса за е-поща", +DlnLnkMsgNoAnchor : "Моля, изберете котва", +DlnLnkMsgInvPopName : "The popup name must begin with an alphabetic character and must not contain spaces", //MISSING + +// Color Dialog +DlgColorTitle : "Изберете цвят", +DlgColorBtnClear : "Изчисти", +DlgColorHighlight : "Текущ", +DlgColorSelected : "Избран", + +// Smiley Dialog +DlgSmileyTitle : "Добави усмивка", + +// Special Character Dialog +DlgSpecialCharTitle : "Изберете специален символ", + +// Table Dialog +DlgTableTitle : "Параметри на таблицата", +DlgTableRows : "Редове", +DlgTableColumns : "Колони", +DlgTableBorder : "Размер на рамката", +DlgTableAlign : "Подравняване", +DlgTableAlignNotSet : "<Не е избрано>", +DlgTableAlignLeft : "Ляво", +DlgTableAlignCenter : "Център", +DlgTableAlignRight : "Дясно", +DlgTableWidth : "Ширина", +DlgTableWidthPx : "пиксели", +DlgTableWidthPc : "проценти", +DlgTableHeight : "Височина", +DlgTableCellSpace : "Разстояние между клетките", +DlgTableCellPad : "Отстъп на съдържанието в клетките", +DlgTableCaption : "Заглавие", +DlgTableSummary : "Резюме", + +// Table Cell Dialog +DlgCellTitle : "Параметри на клетката", +DlgCellWidth : "Ширина", +DlgCellWidthPx : "пиксели", +DlgCellWidthPc : "проценти", +DlgCellHeight : "Височина", +DlgCellWordWrap : "пренасяне на нов ред", +DlgCellWordWrapNotSet : "<Не е настроено>", +DlgCellWordWrapYes : "Да", +DlgCellWordWrapNo : "не", +DlgCellHorAlign : "Хоризонтално подравняване", +DlgCellHorAlignNotSet : "<Не е настроено>", +DlgCellHorAlignLeft : "Ляво", +DlgCellHorAlignCenter : "Център", +DlgCellHorAlignRight: "Дясно", +DlgCellVerAlign : "Вертикално подравняване", +DlgCellVerAlignNotSet : "<Не е настроено>", +DlgCellVerAlignTop : "Горе", +DlgCellVerAlignMiddle : "По средата", +DlgCellVerAlignBottom : "Долу", +DlgCellVerAlignBaseline : "По базовата линия", +DlgCellRowSpan : "повече от един ред", +DlgCellCollSpan : "повече от една колона", +DlgCellBackColor : "фонов цвят", +DlgCellBorderColor : "цвят на рамката", +DlgCellBtnSelect : "Изберете...", + +// Find and Replace Dialog +DlgFindAndReplaceTitle : "Find and Replace", //MISSING + +// Find Dialog +DlgFindTitle : "Търси", +DlgFindFindBtn : "Търси", +DlgFindNotFoundMsg : "Указания текст не беше намерен.", + +// Replace Dialog +DlgReplaceTitle : "Замести", +DlgReplaceFindLbl : "Търси:", +DlgReplaceReplaceLbl : "Замести с:", +DlgReplaceCaseChk : "Със същия регистър", +DlgReplaceReplaceBtn : "Замести", +DlgReplaceReplAllBtn : "Замести всички", +DlgReplaceWordChk : "Търси същата дума", + +// Paste Operations / Dialog +PasteErrorCut : "Настройките за сигурност на вашия бразуър не разрешават на редактора да изпълни изрязването. За целта използвайте клавиатурата (Ctrl+X).", +PasteErrorCopy : "Настройките за сигурност на вашия бразуър не разрешават на редактора да изпълни запаметяването. За целта използвайте клавиатурата (Ctrl+C).", + +PasteAsText : "Вмъкни като чист текст", +PasteFromWord : "Вмъкни от MS Word", + +DlgPasteMsg2 : "Вмъкнете тук съдъжанието с клавиатуарата (Ctrl+V) и натиснете OK.", +DlgPasteSec : "Because of your browser security settings, the editor is not able to access your clipboard data directly. You are required to paste it again in this window.", //MISSING +DlgPasteIgnoreFont : "Игнорирай шрифтовите дефиниции", +DlgPasteRemoveStyles : "Изтрий стиловите дефиниции", + +// Color Picker +ColorAutomatic : "По подразбиране", +ColorMoreColors : "Други цветове...", + +// Document Properties +DocProps : "Параметри на документа", + +// Anchor Dialog +DlgAnchorTitle : "Параметри на котвата", +DlgAnchorName : "Име на котвата", +DlgAnchorErrorName : "Моля, въведете име на котвата", + +// Speller Pages Dialog +DlgSpellNotInDic : "Липсва в речника", +DlgSpellChangeTo : "Промени на", +DlgSpellBtnIgnore : "Игнорирай", +DlgSpellBtnIgnoreAll : "Игнорирай всички", +DlgSpellBtnReplace : "Замести", +DlgSpellBtnReplaceAll : "Замести всички", +DlgSpellBtnUndo : "Отмени", +DlgSpellNoSuggestions : "- Няма предложения -", +DlgSpellProgress : "Извършване на проверката за правопис...", +DlgSpellNoMispell : "Проверката за правопис завършена: не са открити правописни грешки", +DlgSpellNoChanges : "Проверката за правопис завършена: няма променени думи", +DlgSpellOneChange : "Проверката за правопис завършена: една дума е променена", +DlgSpellManyChanges : "Проверката за правопис завършена: %1 думи са променени", + +IeSpellDownload : "Инструментът за проверка на правопис не е инсталиран. Желаете ли да го инсталирате ?", + +// Button Dialog +DlgButtonText : "Текст (Стойност)", +DlgButtonType : "Тип", +DlgButtonTypeBtn : "Button", //MISSING +DlgButtonTypeSbm : "Submit", //MISSING +DlgButtonTypeRst : "Reset", //MISSING + +// Checkbox and Radio Button Dialogs +DlgCheckboxName : "Име", +DlgCheckboxValue : "Стойност", +DlgCheckboxSelected : "Отметнато", + +// Form Dialog +DlgFormName : "Име", +DlgFormAction : "Действие", +DlgFormMethod : "Метод", + +// Select Field Dialog +DlgSelectName : "Име", +DlgSelectValue : "Стойност", +DlgSelectSize : "Размер", +DlgSelectLines : "линии", +DlgSelectChkMulti : "Разрешено множествено селектиране", +DlgSelectOpAvail : "Възможни опции", +DlgSelectOpText : "Текст", +DlgSelectOpValue : "Стойност", +DlgSelectBtnAdd : "Добави", +DlgSelectBtnModify : "Промени", +DlgSelectBtnUp : "Нагоре", +DlgSelectBtnDown : "Надолу", +DlgSelectBtnSetValue : "Настрой като избрана стойност", +DlgSelectBtnDelete : "Изтрий", + +// Textarea Dialog +DlgTextareaName : "Име", +DlgTextareaCols : "Колони", +DlgTextareaRows : "Редове", + +// Text Field Dialog +DlgTextName : "Име", +DlgTextValue : "Стойност", +DlgTextCharWidth : "Ширина на символите", +DlgTextMaxChars : "Максимум символи", +DlgTextType : "Тип", +DlgTextTypeText : "Текст", +DlgTextTypePass : "Парола", + +// Hidden Field Dialog +DlgHiddenName : "Име", +DlgHiddenValue : "Стойност", + +// Bulleted List Dialog +BulletedListProp : "Параметри на ненумерирания списък", +NumberedListProp : "Параметри на нумерирания списък", +DlgLstStart : "Start", //MISSING +DlgLstType : "Тип", +DlgLstTypeCircle : "Окръжност", +DlgLstTypeDisc : "Кръг", +DlgLstTypeSquare : "Квадрат", +DlgLstTypeNumbers : "Числа (1, 2, 3)", +DlgLstTypeLCase : "Малки букви (a, b, c)", +DlgLstTypeUCase : "Големи букви (A, B, C)", +DlgLstTypeSRoman : "Малки римски числа (i, ii, iii)", +DlgLstTypeLRoman : "Големи римски числа (I, II, III)", + +// Document Properties Dialog +DlgDocGeneralTab : "Общи", +DlgDocBackTab : "Фон", +DlgDocColorsTab : "Цветове и отстъпи", +DlgDocMetaTab : "Мета данни", + +DlgDocPageTitle : "Заглавие на страницата", +DlgDocLangDir : "Посока на речта", +DlgDocLangDirLTR : "От ляво на дясно", +DlgDocLangDirRTL : "От дясно на ляво", +DlgDocLangCode : "Код на езика", +DlgDocCharSet : "Кодиране на символите", +DlgDocCharSetCE : "Central European", //MISSING +DlgDocCharSetCT : "Chinese Traditional (Big5)", //MISSING +DlgDocCharSetCR : "Cyrillic", //MISSING +DlgDocCharSetGR : "Greek", //MISSING +DlgDocCharSetJP : "Japanese", //MISSING +DlgDocCharSetKR : "Korean", //MISSING +DlgDocCharSetTR : "Turkish", //MISSING +DlgDocCharSetUN : "Unicode (UTF-8)", //MISSING +DlgDocCharSetWE : "Western European", //MISSING +DlgDocCharSetOther : "Друго кодиране на символите", + +DlgDocDocType : "Тип на документа", +DlgDocDocTypeOther : "Друг тип на документа", +DlgDocIncXHTML : "Включи XHTML декларация", +DlgDocBgColor : "Цвят на фона", +DlgDocBgImage : "Пълен път до фоновото изображение", +DlgDocBgNoScroll : "Не-повтарящо се фоново изображение", +DlgDocCText : "Текст", +DlgDocCLink : "Връзка", +DlgDocCVisited : "Посетена връзка", +DlgDocCActive : "Активна връзка", +DlgDocMargins : "Отстъпи на страницата", +DlgDocMaTop : "Горе", +DlgDocMaLeft : "Ляво", +DlgDocMaRight : "Дясно", +DlgDocMaBottom : "Долу", +DlgDocMeIndex : "Ключови думи за документа (разделени със запетаи)", +DlgDocMeDescr : "Описание на документа", +DlgDocMeAuthor : "Автор", +DlgDocMeCopy : "Авторски права", +DlgDocPreview : "Изглед", + +// Templates Dialog +Templates : "Шаблони", +DlgTemplatesTitle : "Шаблони", +DlgTemplatesSelMsg : "Изберете шаблон
        (текущото съдържание на редактора ще бъде загубено):", +DlgTemplatesLoading : "Зареждане на списъка с шаблоните. Моля изчакайте...", +DlgTemplatesNoTpl : "(Няма дефинирани шаблони)", +DlgTemplatesReplace : "Replace actual contents", //MISSING + +// About Dialog +DlgAboutAboutTab : "За", +DlgAboutBrowserInfoTab : "Информация за браузъра", +DlgAboutLicenseTab : "License", //MISSING +DlgAboutVersion : "версия", +DlgAboutInfo : "За повече информация посетете" +}; Property changes on: announcement/trunk/src/main/webapp/fckeditor/editor/lang/bg.js ___________________________________________________________________ Name: svn:eol-style + native Added: announcement/trunk/src/main/webapp/fckeditor/editor/lang/bn.js =================================================================== --- announcement/trunk/src/main/webapp/fckeditor/editor/lang/bn.js (rev 0) +++ announcement/trunk/src/main/webapp/fckeditor/editor/lang/bn.js 2008-06-30 02:54:27 UTC (rev 1002) @@ -0,0 +1,515 @@ +?/* + * FCKeditor - The text editor for Internet - http://www.fckeditor.net + * Copyright (C) 2003-2008 Frederico Caldeira Knabben + * + * == BEGIN LICENSE == + * + * Licensed under the terms of any of the following licenses at your + * choice: + * + * - GNU General Public License Version 2 or later (the "GPL") + * http://www.gnu.org/licenses/gpl.html + * + * - GNU Lesser General Public License Version 2.1 or later (the "LGPL") + * http://www.gnu.org/licenses/lgpl.html + * + * - Mozilla Public License Version 1.1 or later (the "MPL") + * http://www.mozilla.org/MPL/MPL-1.1.html + * + * == END LICENSE == + * + * Bengali/Bangla language file. + */ + +var FCKLang = +{ +// Language direction : "ltr" (left to right) or "rtl" (right to left). +Dir : "ltr", + +ToolbarCollapse : "?????? ?????? ???", +ToolbarExpand : "?????? ????? ???", + +// Toolbar Items and Context Menu +Save : "??????? ??", +NewPage : "???? ???", +Preview : "???????", +Cut : "???", +Copy : "???", +Paste : "?????", +PasteText : "????? (???? ??????)", +PasteWord : "????? (????)", +Print : "???????", +SelectAll : "?? ??????? ??", +RemoveFormat : "????? ????", +InsertLinkLbl : "?????? ????? ???? ?????", +InsertLink : "???? ????? ??", +RemoveLink : "???? ????", +Anchor : "??????", +AnchorDelete : "Remove Anchor", //MISSING +InsertImageLbl : "???? ????? ????? ??", +InsertImage : "??? ????? ??", +InsertFlashLbl : "????? ????? ????? ??", +InsertFlash : "????? ????? ??", +InsertTableLbl : "??????? ????? ????? ??", +InsertTable : "????? ????? ??", +InsertLineLbl : "???? ????? ??", +InsertLine : "???? ????? ??", +InsertSpecialCharLbl: "????? ??????? ????? ????? ??", +InsertSpecialChar : "????? ????? ????? ??", +InsertSmileyLbl : "???????", +InsertSmiley : "??????? ????? ??", +About : "FCKeditor ?? ????????", +Bold : "?????", +Italic : "??????", +Underline : "??????????", +StrikeThrough : "???????? ????", +Subscript : "??????", +Superscript : "??????", +LeftJustify : "?? ???? ?????", +CenterJustify : "??? ????? ????", +RightJustify : "??? ???? ?????", +BlockJustify : "???? ?????????", +DecreaseIndent : "??????? ????", +IncreaseIndent : "??????? ?????", +Blockquote : "Blockquote", //MISSING +Undo : "????", +Redo : "??-??", +NumberedListLbl : "???????? ??????? ?????", +NumberedList : "???????? ?????", +BulletedListLbl : "????? ????? ?????", +BulletedList : "??????? ?????", +ShowTableBorders : "????? ??????", +ShowDetails : "?????? ?????", +Style : "??????", +FontFormat : "???? ?????", +Font : "????", +FontSize : "????", +TextColor : "??????? ??", +BGColor : "??????????? ??", +Source : "?????", +Find : "????", +Replace : "???????", +SpellCheck : "????? ???", +UniversalKeyboard : "????????? ???????", +PageBreakLbl : "??? ????? ?????", +PageBreak : "??? ?????", + +Form : "????", +Checkbox : "??? ?????", +RadioButton : "????? ????", +TextField : "?????? ?????", +Textarea : "?????? ?????", +HiddenField : "????? ?????", +Button : "????", +SelectionField : "????? ?????", +ImageButton : "???? ????", + +FitWindow : "?????? ??? ??", +ShowBlocks : "Show Blocks", //MISSING + +// Context Menu +EditLink : "???? ???????", +CellCM : "???", +RowCM : "??", +ColumnCM : "????", +InsertRowAfter : "Insert Row After", //MISSING +InsertRowBefore : "Insert Row Before", //MISSING +DeleteRows : "?? ???? ???", +InsertColumnAfter : "Insert Column After", //MISSING +InsertColumnBefore : "Insert Column Before", //MISSING +DeleteColumns : "???? ???? ???", +InsertCellAfter : "Insert Cell After", //MISSING +InsertCellBefore : "Insert Cell Before", //MISSING +DeleteCells : "??? ???? ???", +MergeCells : "??? ???? ???", +MergeRight : "Merge Right", //MISSING +MergeDown : "Merge Down", //MISSING +HorizontalSplitCell : "Split Cell Horizontally", //MISSING +VerticalSplitCell : "Split Cell Vertically", //MISSING +TableDelete : "????? ????? ??", +CellProperties : "????? ???????????", +TableProperties : "????? ??????????", +ImageProperties : "??? ??????????", +FlashProperties : "????? ??????????", + +AnchorProp : "???? ??????????", +ButtonProp : "???? ??????????", +CheckboxProp : "??? ???? ??????????", +HiddenFieldProp : "????? ????? ??????????", +RadioButtonProp : "????? ???? ??????????", +ImageButtonProp : "??? ???? ??????????", +TextFieldProp : "?????? ????? ??????????", +SelectionFieldProp : "????? ????? ??????????", +TextareaProp : "?????? ????? ??????????", +FormProp : "???? ??????????", + +FontFormats : "??????;????????;??????;?????? ?;?????? ?;?????? ?;?????? ?;?????? ?;?????? ?;?????? (DIV)", + +// Alerts and Messages +ProcessingXHTML : "XHTML ?????? ??? ?????", +Done : "??? ?????", +PasteWordConfirm : "?? ???????? ???? ????? ???? ??????? ??? ????? ???? ?????? ???? ??? ???? ???? ?? ????? ???? ??? ??? ???????? ???? ????", +NotCompatiblePaste : "?? ???????? ????????? ????????? ??????????? ?.? ?? ??? ???? ??????? ????? ?????? ???? ?? ???????? ?? ???? ????? ???? ????", +UnknownToolbarItem : "????? ?????? ????? \"%1\"", +UnknownCommand : "????? ?????? \"%1\"", +NotImplemented : "?????? ??????????? ??? ????", +UnknownToolbarSet : "?????? ??? \"%1\" ?? ???????? ???", +NoActiveX : "????? ?????????? ??????? ?????? ????? ??????? ???? ????? ????? ??? ???? ????? ?????? ?????? \"Run ActiveX controls and plug-ins\" ?????? ??? ???? ???? ???? ??????????? ???? ???? ??????? ?????????? ??????? ???? ??????", +BrowseServerBlocked : "??????? ???????? ???? ??? ??? ??????? ???? ?? ?? ???? ?????? ???? ??? ????", +DialogBlocked : "?????? ?????? ???? ??? ??? ??????? ???? ?? ?? ???? ?????? ???? ??? ????", + +// Dialogs +DlgBtnOK : "???", +DlgBtnCancel : "?????", +DlgBtnClose : "???? ??", +DlgBtnBrowseServer : "?????? ???????", +DlgAdvancedTag : "????????", +DlgOpOther : "", +DlgInfoTab : "????", +DlgAlertUrl : "??? ??? URL ????? ????", + +// General Dialogs Labels +DlgGenNotSet : "", +DlgGenId : "????", +DlgGenLangDir : "???? ????? ???", +DlgGenLangDirLtr : "??? ???? ??? (LTR)", +DlgGenLangDirRtl : "??? ???? ??? (RTL)", +DlgGenLangCode : "???? ???", +DlgGenAccessKey : "?????? ??", +DlgGenName : "???", +DlgGenTabIndex : "????? ????????", +DlgGenLongDescr : "URL ?? ????? ??????", +DlgGenClass : "??????-??? ?????", +DlgGenTitle : "??????? ??????", +DlgGenContType : "??????? ?????????? ??????", +DlgGenLinkCharset : "???? ??????? ?????????? ???", +DlgGenStyle : "??????", + +// Image Dialog +DlgImgTitle : "???? ??????????", +DlgImgInfoTab : "???? ????", +DlgImgBtnUpload : "????? ???????? ?????? ??", +DlgImgURL : "URL", +DlgImgUpload : "?????", +DlgImgAlt : "?????? ??????", +DlgImgWidth : "??????", +DlgImgHeight : "???????", +DlgImgLockRatio : "?????? ?? ??", +DlgBtnResetSize : "???? ???????????? ?????? ???", +DlgImgBorder : "??????", +DlgImgHSpace : "?????????? ?????", +DlgImgVSpace : "????????? ?????", +DlgImgAlign : "?????", +DlgImgAlignLeft : "????", +DlgImgAlignAbsBottom: "Abs ????", +DlgImgAlignAbsMiddle: "Abs ???", +DlgImgAlignBaseline : "??? ????", +DlgImgAlignBottom : "????", +DlgImgAlignMiddle : "????", +DlgImgAlignRight : "????", +DlgImgAlignTextTop : "?????? ???", +DlgImgAlignTop : "???", +DlgImgPreview : "???????", +DlgImgAlertUrl : "???????? ??? ???? URL ???? ????", +DlgImgLinkTab : "????", + +// Flash Dialog +DlgFlashTitle : "??????? ??????????", +DlgFlashChkPlay : "??? ????", +DlgFlashChkLoop : "???", +DlgFlashChkMenu : "??????? ???? ????? ??", +DlgFlashScale : "?????", +DlgFlashScaleAll : "?? ?????", +DlgFlashScaleNoBorder : "???? ?????? ???", +DlgFlashScaleFit : "?????? ???", + +// Link Dialog +DlgLnkWindowTitle : "????", +DlgLnkInfoTab : "???? ????", +DlgLnkTargetTab : "???????", + +DlgLnkType : "???? ??????", +DlgLnkTypeURL : "URL", +DlgLnkTypeAnchor : "?? ???? ???? ??", +DlgLnkTypeEMail : "?????", +DlgLnkProto : "????????", +DlgLnkProtoOther : "", +DlgLnkURL : "URL", +DlgLnkAnchorSel : "???? ?????", +DlgLnkAnchorByName : "?????? ??? ????", +DlgLnkAnchorById : "?????? ???? ????", +DlgLnkNoAnchors : "(No anchors available in the document)", //MISSING +DlgLnkEMail : "????? ??????", +DlgLnkEMailSubject : "??????? ????", +DlgLnkEMailBody : "??????? ???", +DlgLnkUpload : "?????", +DlgLnkBtnUpload : "??? ???????? ?????", + +DlgLnkTarget : "???????", +DlgLnkTargetFrame : "", +DlgLnkTargetPopup : "", +DlgLnkTargetBlank : "???? ?????? (_blank)", +DlgLnkTargetParent : "??? ?????? (_parent)", +DlgLnkTargetSelf : "?? ?????? (_self)", +DlgLnkTargetTop : "????? ?????? (_top)", +DlgLnkTargetFrameName : "??????? ??????? ???", +DlgLnkPopWinName : "???? ??????? ???", +DlgLnkPopWinFeat : "???? ?????? ????? ????", +DlgLnkPopResize : "?????? ??? ?????", +DlgLnkPopLocation : "?????? ???", +DlgLnkPopMenu : "?????? ???", +DlgLnkPopScroll : "?????? ???", +DlgLnkPopStatus : "????????? ???", +DlgLnkPopToolbar : "??? ???", +DlgLnkPopFullScrn : "????? ????? ???? (IE)", +DlgLnkPopDependent : "??????????? (Netscape)", +DlgLnkPopWidth : "??????", +DlgLnkPopHeight : "???????", +DlgLnkPopLeft : "????? ?????", +DlgLnkPopTop : "????? ?????", + +DlnLnkMsgNoUrl : "??????? ??? URL ???? ???? ????", +DlnLnkMsgNoEMail : "??????? ??? ????? ?????? ???? ????", +DlnLnkMsgNoAnchor : "??????? ??? ???? ????? ????", +DlnLnkMsgInvPopName : "The popup name must begin with an alphabetic character and must not contain spaces", //MISSING + +// Color Dialog +DlgColorTitle : "?? ????? ??", +DlgColorBtnClear : "???????? ??", +DlgColorHighlight : "???????", +DlgColorSelected : "?????????", + +// Smiley Dialog +DlgSmileyTitle : "??????? ????? ??", + +// Special Character Dialog +DlgSpecialCharTitle : "????? ??????????? ????? ??", + +// Table Dialog +DlgTableTitle : "????? ??????????", +DlgTableRows : "??", +DlgTableColumns : "????", +DlgTableBorder : "?????? ????", +DlgTableAlign : "??????????", +DlgTableAlignNotSet : "", +DlgTableAlignLeft : "????", +DlgTableAlignCenter : "???????", +DlgTableAlignRight : "????", +DlgTableWidth : "??????", +DlgTableWidthPx : "???????", +DlgTableWidthPc : "?????", +DlgTableHeight : "???????", +DlgTableCellSpace : "??? ?????", +DlgTableCellPad : "??? ???????", +DlgTableCaption : "??????", +DlgTableSummary : "??????", + +// Table Cell Dialog +DlgCellTitle : "??? ??????????", +DlgCellWidth : "??????", +DlgCellWidthPx : "???????", +DlgCellWidthPc : "?????", +DlgCellHeight : "???????", +DlgCellWordWrap : "?????? ???", +DlgCellWordWrapNotSet : "", +DlgCellWordWrapYes : "???", +DlgCellWordWrapNo : "??", +DlgCellHorAlign : "?????????? ??????????", +DlgCellHorAlignNotSet : "", +DlgCellHorAlignLeft : "????", +DlgCellHorAlignCenter : "???????", +DlgCellHorAlignRight: "????", +DlgCellVerAlign : "??????????? ??????????", +DlgCellVerAlignNotSet : "", +DlgCellVerAlignTop : "???", +DlgCellVerAlignMiddle : "????", +DlgCellVerAlignBottom : "????", +DlgCellVerAlignBaseline : "???????", +DlgCellRowSpan : "?? ???????", +DlgCellCollSpan : "???? ???????", +DlgCellBackColor : "????????????? ??", +DlgCellBorderColor : "???????? ??", +DlgCellBtnSelect : "????? ??", + +// Find and Replace Dialog +DlgFindAndReplaceTitle : "Find and Replace", //MISSING + +// Find Dialog +DlgFindTitle : "?????", +DlgFindFindBtn : "?????", +DlgFindNotFoundMsg : "????? ???????? ?????? ????? ?????", + +// Replace Dialog +DlgReplaceTitle : "???? ???", +DlgReplaceFindLbl : "?? ?????? ???:", +DlgReplaceReplaceLbl : "??? ???? ?????? ???:", +DlgReplaceCaseChk : "??? ?????", +DlgReplaceReplaceBtn : "???? ???", +DlgReplaceReplAllBtn : "?? ???? ???", +DlgReplaceWordChk : "???? ???? ?????", + +// Paste Operations / Dialog +PasteErrorCut : "????? ?????????? ??????? ?????? ??????? ???????? ??? ???? ?????? ?????? ??? ??? ?? ????? ???? ??????? ??????? ???? (Ctrl+X)?", +PasteErrorCopy : "????? ?????????? ??????? ?????? ??????? ???????? ??? ???? ?????? ?????? ??? ??? ?? ????? ???? ??????? ??????? ???? (Ctrl+C)?", + +PasteAsText : "???? ?????? ?????? ????? ??", +PasteFromWord : "?????? ???? ????? ??", + +DlgPasteMsg2 : "??????? ??? ????? ?????? ??????? ??????? ??? (Ctrl+V) ????? ???? ??? OK ??? ???", +DlgPasteSec : "Because of your browser security settings, the editor is not able to access your clipboard data directly. You are required to paste it again in this window.", //MISSING +DlgPasteIgnoreFont : "???? ??? ???????? ????? ????", +DlgPasteRemoveStyles : "?????? ???????? ????? ???", + +// Color Picker +ColorAutomatic : "????????", +ColorMoreColors : "??? ??...", + +// Document Properties +DocProps : "?????????? ??????????", + +// Anchor Dialog +DlgAnchorTitle : "?????? ??????????", +DlgAnchorName : "?????? ???", +DlgAnchorErrorName : "?????? ??? ???? ????", + +// Speller Pages Dialog +DlgSpellNotInDic : "???????? ???", +DlgSpellChangeTo : "??? ?????", +DlgSpellBtnIgnore : "????? ??", +DlgSpellBtnIgnoreAll : "?? ????? ??", +DlgSpellBtnReplace : "???? ???", +DlgSpellBtnReplaceAll : "?? ???? ???", +DlgSpellBtnUndo : "?????", +DlgSpellNoSuggestions : "- ??? ?????? ??? -", +DlgSpellProgress : "????? ??????? ????...", +DlgSpellNoMispell : "????? ??????? ???: ??? ??? ????? ????? ?????", +DlgSpellNoChanges : "????? ??????? ???: ??? ???? ???????? ??? ????", +DlgSpellOneChange : "????? ??????? ???: ???? ????? ???? ???????? ??? ?????", +DlgSpellManyChanges : "????? ??????? ???: %1 ???? ???? ???? ??????", + +IeSpellDownload : "????? ??????? ?????? ??? ???? ???? ?? ???? ??? ??????? ???? ????", + +// Button Dialog +DlgButtonText : "?????? (??????)", +DlgButtonType : "??????", +DlgButtonTypeBtn : "Button", //MISSING +DlgButtonTypeSbm : "Submit", //MISSING +DlgButtonTypeRst : "Reset", //MISSING + +// Checkbox and Radio Button Dialogs +DlgCheckboxName : "???", +DlgCheckboxValue : "??????", +DlgCheckboxSelected : "?????????", + +// Form Dialog +DlgFormName : "???", +DlgFormAction : "??????", +DlgFormMethod : "??????", + +// Select Field Dialog +DlgSelectName : "???", +DlgSelectValue : "??????", +DlgSelectSize : "????", +DlgSelectLines : "???? ????", +DlgSelectChkMulti : "?????? ??????? ???? ??", +DlgSelectOpAvail : "???????? ??????", +DlgSelectOpText : "??????", +DlgSelectOpValue : "??????", +DlgSelectBtnAdd : "?????", +DlgSelectBtnModify : "???? ???", +DlgSelectBtnUp : "???", +DlgSelectBtnDown : "????", +DlgSelectBtnSetValue : "????? ??? ?????? ?????? ??? ??", +DlgSelectBtnDelete : "?????", + +// Textarea Dialog +DlgTextareaName : "???", +DlgTextareaCols : "????", +DlgTextareaRows : "??", + +// Text Field Dialog +DlgTextName : "???", +DlgTextValue : "??????", +DlgTextCharWidth : "??????????? ?????????", +DlgTextMaxChars : "???????? ???????????", +DlgTextType : "????", +DlgTextTypeText : "??????", +DlgTextTypePass : "?????????", + +// Hidden Field Dialog +DlgHiddenName : "???", +DlgHiddenValue : "??????", + +// Bulleted List Dialog +BulletedListProp : "??????? ???? ??????????", +NumberedListProp : "???????? ???? ??????????", +DlgLstStart : "Start", //MISSING +DlgLstType : "??????", +DlgLstTypeCircle : "???", +DlgLstTypeDisc : "?????", +DlgLstTypeSquare : "??????", +DlgLstTypeNumbers : "?????? (1, 2, 3)", +DlgLstTypeLCase : "??? ????? (a, b, c)", +DlgLstTypeUCase : "?? ????? (A, B, C)", +DlgLstTypeSRoman : "??? ????? ?????? (i, ii, iii)", +DlgLstTypeLRoman : "?? ????? ?????? (I, II, III)", + +// Document Properties Dialog +DlgDocGeneralTab : "??????", +DlgDocBackTab : "?????????????", +DlgDocColorsTab : "?? ??? ???????", +DlgDocMetaTab : "????????", + +DlgDocPageTitle : "??? ??????", +DlgDocLangDir : "???? ????? ???", +DlgDocLangDirLTR : "??? ???? ???? (LTR)", +DlgDocLangDirRTL : "??? ???? ???? (RTL)", +DlgDocLangCode : "???? ???", +DlgDocCharSet : "??????????? ??? ???????", +DlgDocCharSetCE : "Central European", //MISSING +DlgDocCharSetCT : "Chinese Traditional (Big5)", //MISSING +DlgDocCharSetCR : "Cyrillic", //MISSING +DlgDocCharSetGR : "Greek", //MISSING +DlgDocCharSetJP : "Japanese", //MISSING +DlgDocCharSetKR : "Korean", //MISSING +DlgDocCharSetTR : "Turkish", //MISSING +DlgDocCharSetUN : "Unicode (UTF-8)", //MISSING +DlgDocCharSetWE : "Western European", //MISSING +DlgDocCharSetOther : "???? ??????????? ??? ???????", + +DlgDocDocType : "?????????? ???? ?????", +DlgDocDocTypeOther : "???? ?????????? ???? ?????", +DlgDocIncXHTML : "XHTML ?????????? ????? ??", +DlgDocBgColor : "????????????? ??", +DlgDocBgImage : "????????????? ???? URL", +DlgDocBgNoScroll : "????????? ?????????????", +DlgDocCText : "??????", +DlgDocCLink : "????", +DlgDocCVisited : "????? ??? ????", +DlgDocCActive : "?????? ????", +DlgDocMargins : "??? ???????", +DlgDocMaTop : "???", +DlgDocMaLeft : "????", +DlgDocMaRight : "????", +DlgDocMaBottom : "????", +DlgDocMeIndex : "?????????? ???????? ???????? (??? ?????? ?????????)", +DlgDocMeDescr : "?????????? ??????", +DlgDocMeAuthor : "????", +DlgDocMeCopy : "???????", +DlgDocPreview : "???????", + +// Templates Dialog +Templates : "????????", +DlgTemplatesTitle : "??????? ????????", +DlgTemplatesSelMsg : "??????? ??? ?????? ???? ???? ???? ???????? ????? ????
        (??? ??????? ?????? ????):", +DlgTemplatesLoading : "???????? ????? ?????? ????? ??????? ??? ??????? ????...", +DlgTemplatesNoTpl : "(??? ???????? ?????? ??? ???)", +DlgTemplatesReplace : "Replace actual contents", //MISSING + +// About Dialog +DlgAboutAboutTab : "?? ????????", +DlgAboutBrowserInfoTab : "?????????? ???????? ????", +DlgAboutLicenseTab : "????????", +DlgAboutVersion : "??????", +DlgAboutInfo : "??? ?????? ???? ???" +}; Property changes on: announcement/trunk/src/main/webapp/fckeditor/editor/lang/bn.js ___________________________________________________________________ Name: svn:eol-style + native Added: announcement/trunk/src/main/webapp/fckeditor/editor/lang/bs.js =================================================================== --- announcement/trunk/src/main/webapp/fckeditor/editor/lang/bs.js (rev 0) +++ announcement/trunk/src/main/webapp/fckeditor/editor/lang/bs.js 2008-06-30 02:54:27 UTC (rev 1002) @@ -0,0 +1,515 @@ +?/* + * FCKeditor - The text editor for Internet - http://www.fckeditor.net + * Copyright (C) 2003-2008 Frederico Caldeira Knabben + * + * == BEGIN LICENSE == + * + * Licensed under the terms of any of the following licenses at your + * choice: + * + * - GNU General Public License Version 2 or later (the "GPL") + * http://www.gnu.org/licenses/gpl.html + * + * - GNU Lesser General Public License Version 2.1 or later (the "LGPL") + * http://www.gnu.org/licenses/lgpl.html + * + * - Mozilla Public License Version 1.1 or later (the "MPL") + * http://www.mozilla.org/MPL/MPL-1.1.html + * + * == END LICENSE == + * + * Bosnian language file. + */ + +var FCKLang = +{ +// Language direction : "ltr" (left to right) or "rtl" (right to left). +Dir : "ltr", + +ToolbarCollapse : "Skupi trake sa alatima", +ToolbarExpand : "Otvori trake sa alatima", + +// Toolbar Items and Context Menu +Save : "Snimi", +NewPage : "Novi dokument", +Preview : "Prikaži", +Cut : "Izreži", +Copy : "Kopiraj", +Paste : "Zalijepi", +PasteText : "Zalijepi kao obièan tekst", +PasteWord : "Zalijepi iz Word-a", +Print : "Štampaj", +SelectAll : "Selektuj sve", +RemoveFormat : "Poništi format", +InsertLinkLbl : "Link", +InsertLink : "Ubaci/Izmjeni link", +RemoveLink : "Izbriši link", +Anchor : "Insert/Edit Anchor", //MISSING +AnchorDelete : "Remove Anchor", //MISSING +InsertImageLbl : "Slika", +InsertImage : "Ubaci/Izmjeni sliku", +InsertFlashLbl : "Flash", //MISSING +InsertFlash : "Insert/Edit Flash", //MISSING +InsertTableLbl : "Tabela", +InsertTable : "Ubaci/Izmjeni tabelu", +InsertLineLbl : "Linija", +InsertLine : "Ubaci horizontalnu liniju", +InsertSpecialCharLbl: "Specijalni karakter", +InsertSpecialChar : "Ubaci specijalni karater", +InsertSmileyLbl : "Smješko", +InsertSmiley : "Ubaci smješka", +About : "O FCKeditor-u", +Bold : "Boldiraj", +Italic : "Ukosi", +Underline : "Podvuci", +StrikeThrough : "Precrtaj", +Subscript : "Subscript", +Superscript : "Superscript", +LeftJustify : "Lijevo poravnanje", +CenterJustify : "Centralno poravnanje", +RightJustify : "Desno poravnanje", +BlockJustify : "Puno poravnanje", +DecreaseIndent : "Smanji uvod", +IncreaseIndent : "Poveæaj uvod", +Blockquote : "Blockquote", //MISSING +Undo : "Vrati", +Redo : "Ponovi", +NumberedListLbl : "Numerisana lista", +NumberedList : "Ubaci/Izmjeni numerisanu listu", +BulletedListLbl : "Lista", +BulletedList : "Ubaci/Izmjeni listu", +ShowTableBorders : "Pokaži okvire tabela", +ShowDetails : "Pokaži detalje", +Style : "Stil", +FontFormat : "Format", +Font : "Font", +FontSize : "Velièina", +TextColor : "Boja teksta", +BGColor : "Boja pozadine", +Source : "HTML kôd", +Find : "Naði", +Replace : "Zamjeni", +SpellCheck : "Check Spelling", //MISSING +UniversalKeyboard : "Universal Keyboard", //MISSING +PageBreakLbl : "Page Break", //MISSING +PageBreak : "Insert Page Break", //MISSING + +Form : "Form", //MISSING +Checkbox : "Checkbox", //MISSING +RadioButton : "Radio Button", //MISSING +TextField : "Text Field", //MISSING +Textarea : "Textarea", //MISSING +HiddenField : "Hidden Field", //MISSING +Button : "Button", //MISSING +SelectionField : "Selection Field", //MISSING +ImageButton : "Image Button", //MISSING + +FitWindow : "Maximize the editor size", //MISSING +ShowBlocks : "Show Blocks", //MISSING + +// Context Menu +EditLink : "Izmjeni link", +CellCM : "Cell", //MISSING +RowCM : "Row", //MISSING +ColumnCM : "Column", //MISSING +InsertRowAfter : "Insert Row After", //MISSING +InsertRowBefore : "Insert Row Before", //MISSING +DeleteRows : "Briši redove", +InsertColumnAfter : "Insert Column After", //MISSING +InsertColumnBefore : "Insert Column Before", //MISSING +DeleteColumns : "Briši kolone", +InsertCellAfter : "Insert Cell After", //MISSING +InsertCellBefore : "Insert Cell Before", //MISSING +DeleteCells : "Briši æelije", +MergeCells : "Spoji æelije", +MergeRight : "Merge Right", //MISSING +MergeDown : "Merge Down", //MISSING +HorizontalSplitCell : "Split Cell Horizontally", //MISSING +VerticalSplitCell : "Split Cell Vertically", //MISSING +TableDelete : "Delete Table", //MISSING +CellProperties : "Svojstva æelije", +TableProperties : "Svojstva tabele", +ImageProperties : "Svojstva slike", +FlashProperties : "Flash Properties", //MISSING + +AnchorProp : "Anchor Properties", //MISSING +ButtonProp : "Button Properties", //MISSING +CheckboxProp : "Checkbox Properties", //MISSING +HiddenFieldProp : "Hidden Field Properties", //MISSING +RadioButtonProp : "Radio Button Properties", //MISSING +ImageButtonProp : "Image Button Properties", //MISSING +TextFieldProp : "Text Field Properties", //MISSING +SelectionFieldProp : "Selection Field Properties", //MISSING +TextareaProp : "Textarea Properties", //MISSING +FormProp : "Form Properties", //MISSING + +FontFormats : "Normal;Formatted;Address;Heading 1;Heading 2;Heading 3;Heading 4;Heading 5;Heading 6", + +// Alerts and Messages +ProcessingXHTML : "Procesiram XHTML. Molim saèekajte...", +Done : "Gotovo", +PasteWordConfirm : "Tekst koji želite zalijepiti èini se da je kopiran iz Worda. Da li želite da se prvo oèisti?", +NotCompatiblePaste : "Ova komanda je podržana u Internet Explorer-u verzijama 5.5 ili novijim. Da li želite da izvršite lijepljenje teksta bez èišæenja?", +UnknownToolbarItem : "Nepoznata stavka sa trake sa alatima \"%1\"", +UnknownCommand : "Nepoznata komanda \"%1\"", +NotImplemented : "Komanda nije implementirana", +UnknownToolbarSet : "Traka sa alatima \"%1\" ne postoji", +NoActiveX : "Your browser's security settings could limit some features of the editor. You must enable the option \"Run ActiveX controls and plug-ins\". You may experience errors and notice missing features.", //MISSING +BrowseServerBlocked : "The resources browser could not be opened. Make sure that all popup blockers are disabled.", //MISSING +DialogBlocked : "It was not possible to open the dialog window. Make sure all popup blockers are disabled.", //MISSING + +// Dialogs +DlgBtnOK : "OK", +DlgBtnCancel : "Odustani", +DlgBtnClose : "Zatvori", +DlgBtnBrowseServer : "Browse Server", //MISSING +DlgAdvancedTag : "Naprednije", +DlgOpOther : "", //MISSING +DlgInfoTab : "Info", //MISSING +DlgAlertUrl : "Please insert the URL", //MISSING + +// General Dialogs Labels +DlgGenNotSet : "", +DlgGenId : "Id", +DlgGenLangDir : "Smjer pisanja", +DlgGenLangDirLtr : "S lijeva na desno (LTR)", +DlgGenLangDirRtl : "S desna na lijevo (RTL)", +DlgGenLangCode : "Jezièni kôd", +DlgGenAccessKey : "Pristupna tipka", +DlgGenName : "Naziv", +DlgGenTabIndex : "Tab indeks", +DlgGenLongDescr : "Dugaèki opis URL-a", +DlgGenClass : "Klase CSS stilova", +DlgGenTitle : "Advisory title", +DlgGenContType : "Advisory vrsta sadržaja", +DlgGenLinkCharset : "Linked Resource Charset", +DlgGenStyle : "Stil", + +// Image Dialog +DlgImgTitle : "Svojstva slike", +DlgImgInfoTab : "Info slike", +DlgImgBtnUpload : "Šalji na server", +DlgImgURL : "URL", +DlgImgUpload : "Šalji", +DlgImgAlt : "Tekst na slici", +DlgImgWidth : "Širina", +DlgImgHeight : "Visina", +DlgImgLockRatio : "Zakljuèaj odnos", +DlgBtnResetSize : "Resetuj dimenzije", +DlgImgBorder : "Okvir", +DlgImgHSpace : "HSpace", +DlgImgVSpace : "VSpace", +DlgImgAlign : "Poravnanje", +DlgImgAlignLeft : "Lijevo", +DlgImgAlignAbsBottom: "Abs dole", +DlgImgAlignAbsMiddle: "Abs sredina", +DlgImgAlignBaseline : "Bazno", +DlgImgAlignBottom : "Dno", +DlgImgAlignMiddle : "Sredina", +DlgImgAlignRight : "Desno", +DlgImgAlignTextTop : "Vrh teksta", +DlgImgAlignTop : "Vrh", +DlgImgPreview : "Prikaz", +DlgImgAlertUrl : "Molimo ukucajte URL od slike.", +DlgImgLinkTab : "Link", //MISSING + +// Flash Dialog +DlgFlashTitle : "Flash Properties", //MISSING +DlgFlashChkPlay : "Auto Play", //MISSING +DlgFlashChkLoop : "Loop", //MISSING +DlgFlashChkMenu : "Enable Flash Menu", //MISSING +DlgFlashScale : "Scale", //MISSING +DlgFlashScaleAll : "Show all", //MISSING +DlgFlashScaleNoBorder : "No Border", //MISSING +DlgFlashScaleFit : "Exact Fit", //MISSING + +// Link Dialog +DlgLnkWindowTitle : "Link", +DlgLnkInfoTab : "Link info", +DlgLnkTargetTab : "Prozor", + +DlgLnkType : "Tip linka", +DlgLnkTypeURL : "URL", +DlgLnkTypeAnchor : "Sidro na ovoj stranici", +DlgLnkTypeEMail : "E-Mail", +DlgLnkProto : "Protokol", +DlgLnkProtoOther : "", +DlgLnkURL : "URL", +DlgLnkAnchorSel : "Izaberi sidro", +DlgLnkAnchorByName : "Po nazivu sidra", +DlgLnkAnchorById : "Po Id-u elementa", +DlgLnkNoAnchors : "(Nema dostupnih sidra na stranici)", +DlgLnkEMail : "E-Mail Adresa", +DlgLnkEMailSubject : "Subjekt poruke", +DlgLnkEMailBody : "Poruka", +DlgLnkUpload : "Šalji", +DlgLnkBtnUpload : "Šalji na server", + +DlgLnkTarget : "Prozor", +DlgLnkTargetFrame : "", +DlgLnkTargetPopup : "", +DlgLnkTargetBlank : "Novi prozor (_blank)", +DlgLnkTargetParent : "Glavni prozor (_parent)", +DlgLnkTargetSelf : "Isti prozor (_self)", +DlgLnkTargetTop : "Najgornji prozor (_top)", +DlgLnkTargetFrameName : "Target Frame Name", //MISSING +DlgLnkPopWinName : "Naziv popup prozora", +DlgLnkPopWinFeat : "Moguænosti popup prozora", +DlgLnkPopResize : "Promjenljive velièine", +DlgLnkPopLocation : "Traka za lokaciju", +DlgLnkPopMenu : "Izborna traka", +DlgLnkPopScroll : "Scroll traka", +DlgLnkPopStatus : "Statusna traka", +DlgLnkPopToolbar : "Traka sa alatima", +DlgLnkPopFullScrn : "Cijeli ekran (IE)", +DlgLnkPopDependent : "Ovisno (Netscape)", +DlgLnkPopWidth : "Širina", +DlgLnkPopHeight : "Visina", +DlgLnkPopLeft : "Lijeva pozicija", +DlgLnkPopTop : "Gornja pozicija", + +DlnLnkMsgNoUrl : "Molimo ukucajte URL link", +DlnLnkMsgNoEMail : "Molimo ukucajte e-mail adresu", +DlnLnkMsgNoAnchor : "Molimo izaberite sidro", +DlnLnkMsgInvPopName : "The popup name must begin with an alphabetic character and must not contain spaces", //MISSING + +// Color Dialog +DlgColorTitle : "Izaberi boju", +DlgColorBtnClear : "Oèisti", +DlgColorHighlight : "Igled", +DlgColorSelected : "Selektovana", + +// Smiley Dialog +DlgSmileyTitle : "Ubaci smješka", + +// Special Character Dialog +DlgSpecialCharTitle : "Izaberi specijalni karakter", + +// Table Dialog +DlgTableTitle : "Svojstva tabele", +DlgTableRows : "Redova", +DlgTableColumns : "Kolona", +DlgTableBorder : "Okvir", +DlgTableAlign : "Poravnanje", +DlgTableAlignNotSet : "", +DlgTableAlignLeft : "Lijevo", +DlgTableAlignCenter : "Centar", +DlgTableAlignRight : "Desno", +DlgTableWidth : "Širina", +DlgTableWidthPx : "piksela", +DlgTableWidthPc : "posto", +DlgTableHeight : "Visina", +DlgTableCellSpace : "Razmak æelija", +DlgTableCellPad : "Uvod æelija", +DlgTableCaption : "Naslov", +DlgTableSummary : "Summary", //MISSING + +// Table Cell Dialog +DlgCellTitle : "Svojstva æelije", +DlgCellWidth : "Širina", +DlgCellWidthPx : "piksela", +DlgCellWidthPc : "posto", +DlgCellHeight : "Visina", +DlgCellWordWrap : "Vrapuj tekst", +DlgCellWordWrapNotSet : "", +DlgCellWordWrapYes : "Da", +DlgCellWordWrapNo : "Ne", +DlgCellHorAlign : "Horizontalno poravnanje", +DlgCellHorAlignNotSet : "", +DlgCellHorAlignLeft : "Lijevo", +DlgCellHorAlignCenter : "Centar", +DlgCellHorAlignRight: "Desno", +DlgCellVerAlign : "Vertikalno poravnanje", +DlgCellVerAlignNotSet : "", +DlgCellVerAlignTop : "Gore", +DlgCellVerAlignMiddle : "Sredina", +DlgCellVerAlignBottom : "Dno", +DlgCellVerAlignBaseline : "Bazno", +DlgCellRowSpan : "Spajanje æelija", +DlgCellCollSpan : "Spajanje kolona", +DlgCellBackColor : "Boja pozadine", +DlgCellBorderColor : "Boja okvira", +DlgCellBtnSelect : "Selektuj...", + +// Find and Replace Dialog +DlgFindAndReplaceTitle : "Find and Replace", //MISSING + +// Find Dialog +DlgFindTitle : "Naði", +DlgFindFindBtn : "Naði", +DlgFindNotFoundMsg : "Traženi tekst nije pronaðen.", + +// Replace Dialog +DlgReplaceTitle : "Zamjeni", +DlgReplaceFindLbl : "Naði šta:", +DlgReplaceReplaceLbl : "Zamjeni sa:", +DlgReplaceCaseChk : "Uporeðuj velika/mala slova", +DlgReplaceReplaceBtn : "Zamjeni", +DlgReplaceReplAllBtn : "Zamjeni sve", +DlgReplaceWordChk : "Uporeðuj samo cijelu rijeè", + +// Paste Operations / Dialog +PasteErrorCut : "Sigurnosne postavke vašeg pretraživaèa ne dozvoljavaju operacije automatskog rezanja. Molimo koristite kraticu na tastaturi (Ctrl+X).", +PasteErrorCopy : "Sigurnosne postavke Vašeg pretraživaèa ne dozvoljavaju operacije automatskog kopiranja. Molimo koristite kraticu na tastaturi (Ctrl+C).", + +PasteAsText : "Zalijepi kao obièan tekst", +PasteFromWord : "Zalijepi iz Word-a", + +DlgPasteMsg2 : "Please paste inside the following box using the keyboard (Ctrl+V) and hit OK.", //MISSING +DlgPasteSec : "Because of your browser security settings, the editor is not able to access your clipboard data directly. You are required to paste it again in this window.", //MISSING +DlgPasteIgnoreFont : "Ignore Font Face definitions", //MISSING +DlgPasteRemoveStyles : "Remove Styles definitions", //MISSING + +// Color Picker +ColorAutomatic : "Automatska", +ColorMoreColors : "Više boja...", + +// Document Properties +DocProps : "Document Properties", //MISSING + +// Anchor Dialog +DlgAnchorTitle : "Anchor Properties", //MISSING +DlgAnchorName : "Anchor Name", //MISSING +DlgAnchorErrorName : "Please type the anchor name", //MISSING + +// Speller Pages Dialog +DlgSpellNotInDic : "Not in dictionary", //MISSING +DlgSpellChangeTo : "Change to", //MISSING +DlgSpellBtnIgnore : "Ignore", //MISSING +DlgSpellBtnIgnoreAll : "Ignore All", //MISSING +DlgSpellBtnReplace : "Replace", //MISSING +DlgSpellBtnReplaceAll : "Replace All", //MISSING +DlgSpellBtnUndo : "Undo", //MISSING +DlgSpellNoSuggestions : "- No suggestions -", //MISSING +DlgSpellProgress : "Spell check in progress...", //MISSING +DlgSpellNoMispell : "Spell check complete: No misspellings found", //MISSING +DlgSpellNoChanges : "Spell check complete: No words changed", //MISSING +DlgSpellOneChange : "Spell check complete: One word changed", //MISSING +DlgSpellManyChanges : "Spell check complete: %1 words changed", //MISSING + +IeSpellDownload : "Spell checker not installed. Do you want to download it now?", //MISSING + +// Button Dialog +DlgButtonText : "Text (Value)", //MISSING +DlgButtonType : "Type", //MISSING +DlgButtonTypeBtn : "Button", //MISSING +DlgButtonTypeSbm : "Submit", //MISSING +DlgButtonTypeRst : "Reset", //MISSING + +// Checkbox and Radio Button Dialogs +DlgCheckboxName : "Name", //MISSING +DlgCheckboxValue : "Value", //MISSING +DlgCheckboxSelected : "Selected", //MISSING + +// Form Dialog +DlgFormName : "Name", //MISSING +DlgFormAction : "Action", //MISSING +DlgFormMethod : "Method", //MISSING + +// Select Field Dialog +DlgSelectName : "Name", //MISSING +DlgSelectValue : "Value", //MISSING +DlgSelectSize : "Size", //MISSING +DlgSelectLines : "lines", //MISSING +DlgSelectChkMulti : "Allow multiple selections", //MISSING +DlgSelectOpAvail : "Available Options", //MISSING +DlgSelectOpText : "Text", //MISSING +DlgSelectOpValue : "Value", //MISSING +DlgSelectBtnAdd : "Add", //MISSING +DlgSelectBtnModify : "Modify", //MISSING +DlgSelectBtnUp : "Up", //MISSING +DlgSelectBtnDown : "Down", //MISSING +DlgSelectBtnSetValue : "Set as selected value", //MISSING +DlgSelectBtnDelete : "Delete", //MISSING + +// Textarea Dialog +DlgTextareaName : "Name", //MISSING +DlgTextareaCols : "Columns", //MISSING +DlgTextareaRows : "Rows", //MISSING + +// Text Field Dialog +DlgTextName : "Name", //MISSING +DlgTextValue : "Value", //MISSING +DlgTextCharWidth : "Character Width", //MISSING +DlgTextMaxChars : "Maximum Characters", //MISSING +DlgTextType : "Type", //MISSING +DlgTextTypeText : "Text", //MISSING +DlgTextTypePass : "Password", //MISSING + +// Hidden Field Dialog +DlgHiddenName : "Name", //MISSING +DlgHiddenValue : "Value", //MISSING + +// Bulleted List Dialog +BulletedListProp : "Bulleted List Properties", //MISSING +NumberedListProp : "Numbered List Properties", //MISSING +DlgLstStart : "Start", //MISSING +DlgLstType : "Type", //MISSING +DlgLstTypeCircle : "Circle", //MISSING +DlgLstTypeDisc : "Disc", //MISSING +DlgLstTypeSquare : "Square", //MISSING +DlgLstTypeNumbers : "Numbers (1, 2, 3)", //MISSING +DlgLstTypeLCase : "Lowercase Letters (a, b, c)", //MISSING +DlgLstTypeUCase : "Uppercase Letters (A, B, C)", //MISSING +DlgLstTypeSRoman : "Small Roman Numerals (i, ii, iii)", //MISSING +DlgLstTypeLRoman : "Large Roman Numerals (I, II, III)", //MISSING + +// Document Properties Dialog +DlgDocGeneralTab : "General", //MISSING +DlgDocBackTab : "Background", //MISSING +DlgDocColorsTab : "Colors and Margins", //MISSING +DlgDocMetaTab : "Meta Data", //MISSING + +DlgDocPageTitle : "Page Title", //MISSING +DlgDocLangDir : "Language Direction", //MISSING +DlgDocLangDirLTR : "Left to Right (LTR)", //MISSING +DlgDocLangDirRTL : "Right to Left (RTL)", //MISSING +DlgDocLangCode : "Language Code", //MISSING +DlgDocCharSet : "Character Set Encoding", //MISSING +DlgDocCharSetCE : "Central European", //MISSING +DlgDocCharSetCT : "Chinese Traditional (Big5)", //MISSING +DlgDocCharSetCR : "Cyrillic", //MISSING +DlgDocCharSetGR : "Greek", //MISSING +DlgDocCharSetJP : "Japanese", //MISSING +DlgDocCharSetKR : "Korean", //MISSING +DlgDocCharSetTR : "Turkish", //MISSING +DlgDocCharSetUN : "Unicode (UTF-8)", //MISSING +DlgDocCharSetWE : "Western European", //MISSING +DlgDocCharSetOther : "Other Character Set Encoding", //MISSING + +DlgDocDocType : "Document Type Heading", //MISSING +DlgDocDocTypeOther : "Other Document Type Heading", //MISSING +DlgDocIncXHTML : "Include XHTML Declarations", //MISSING +DlgDocBgColor : "Background Color", //MISSING +DlgDocBgImage : "Background Image URL", //MISSING +DlgDocBgNoScroll : "Nonscrolling Background", //MISSING +DlgDocCText : "Text", //MISSING +DlgDocCLink : "Link", //MISSING +DlgDocCVisited : "Visited Link", //MISSING +DlgDocCActive : "Active Link", //MISSING +DlgDocMargins : "Page Margins", //MISSING +DlgDocMaTop : "Top", //MISSING +DlgDocMaLeft : "Left", //MISSING +DlgDocMaRight : "Right", //MISSING +DlgDocMaBottom : "Bottom", //MISSING +DlgDocMeIndex : "Document Indexing Keywords (comma separated)", //MISSING +DlgDocMeDescr : "Document Description", //MISSING +DlgDocMeAuthor : "Author", //MISSING +DlgDocMeCopy : "Copyright", //MISSING +DlgDocPreview : "Preview", //MISSING + +// Templates Dialog +Templates : "Templates", //MISSING +DlgTemplatesTitle : "Content Templates", //MISSING +DlgTemplatesSelMsg : "Please select the template to open in the editor
        (the actual contents will be lost):", //MISSING +DlgTemplatesLoading : "Loading templates list. Please wait...", //MISSING +DlgTemplatesNoTpl : "(No templates defined)", //MISSING +DlgTemplatesReplace : "Replace actual contents", //MISSING + +// About Dialog +DlgAboutAboutTab : "About", //MISSING +DlgAboutBrowserInfoTab : "Browser Info", //MISSING +DlgAboutLicenseTab : "License", //MISSING +DlgAboutVersion : "verzija", +DlgAboutInfo : "Za više informacija posjetite" +}; Property changes on: announcement/trunk/src/main/webapp/fckeditor/editor/lang/bs.js ___________________________________________________________________ Name: svn:eol-style + native Added: announcement/trunk/src/main/webapp/fckeditor/editor/lang/ca.js =================================================================== --- announcement/trunk/src/main/webapp/fckeditor/editor/lang/ca.js (rev 0) +++ announcement/trunk/src/main/webapp/fckeditor/editor/lang/ca.js 2008-06-30 02:54:27 UTC (rev 1002) @@ -0,0 +1,515 @@ +?/* + * FCKeditor - The text editor for Internet - http://www.fckeditor.net + * Copyright (C) 2003-2008 Frederico Caldeira Knabben + * + * == BEGIN LICENSE == + * + * Licensed under the terms of any of the following licenses at your + * choice: + * + * - GNU General Public License Version 2 or later (the "GPL") + * http://www.gnu.org/licenses/gpl.html + * + * - GNU Lesser General Public License Version 2.1 or later (the "LGPL") + * http://www.gnu.org/licenses/lgpl.html + * + * - Mozilla Public License Version 1.1 or later (the "MPL") + * http://www.mozilla.org/MPL/MPL-1.1.html + * + * == END LICENSE == + * + * Catalan language file. + */ + +var FCKLang = +{ +// Language direction : "ltr" (left to right) or "rtl" (right to left). +Dir : "ltr", + +ToolbarCollapse : "Redueix la barra d'eines", +ToolbarExpand : "Amplia la barra d'eines", + +// Toolbar Items and Context Menu +Save : "Desa", +NewPage : "Nova Pàgina", +Preview : "Visualització prèvia", +Cut : "Retalla", +Copy : "Copia", +Paste : "Enganxa", +PasteText : "Enganxa com a text no formatat", +PasteWord : "Enganxa des del Word", +Print : "Imprimeix", +SelectAll : "Selecciona-ho tot", +RemoveFormat : "Elimina Format", +InsertLinkLbl : "Enllaç", +InsertLink : "Insereix/Edita enllaç", +RemoveLink : "Elimina enllaç", +Anchor : "Insereix/Edita àncora", +AnchorDelete : "Elimina àncora", +InsertImageLbl : "Imatge", +InsertImage : "Insereix/Edita imatge", +InsertFlashLbl : "Flash", +InsertFlash : "Insereix/Edita Flash", +InsertTableLbl : "Taula", +InsertTable : "Insereix/Edita taula", +InsertLineLbl : "Línia", +InsertLine : "Insereix línia horitzontal", +InsertSpecialCharLbl: "Caràcter Especial", +InsertSpecialChar : "Insereix caràcter especial", +InsertSmileyLbl : "Icona", +InsertSmiley : "Insereix icona", +About : "Quant a l'FCKeditor", +Bold : "Negreta", +Italic : "Cursiva", +Underline : "Subratllat", +StrikeThrough : "Barrat", +Subscript : "Subíndex", +Superscript : "Superíndex", +LeftJustify : "Alinia a l'esquerra", +CenterJustify : "Centrat", +RightJustify : "Alinia a la dreta", +BlockJustify : "Justificat", +DecreaseIndent : "Redueix el sagnat", +IncreaseIndent : "Augmenta el sagnat", +Blockquote : "Bloc de cita", +Undo : "Desfés", +Redo : "Refés", +NumberedListLbl : "Llista numerada", +NumberedList : "Numeració activada/desactivada", +BulletedListLbl : "Llista de pics", +BulletedList : "Pics activats/descativats", +ShowTableBorders : "Mostra les vores de les taules", +ShowDetails : "Mostra detalls", +Style : "Estil", +FontFormat : "Format", +Font : "Tipus de lletra", +FontSize : "Mida", +TextColor : "Color de Text", +BGColor : "Color de Fons", +Source : "Codi font", +Find : "Cerca", +Replace : "Reemplaça", +SpellCheck : "Revisa l'ortografia", +UniversalKeyboard : "Teclat universal", +PageBreakLbl : "Salt de pàgina", +PageBreak : "Insereix salt de pàgina", + +Form : "Formulari", +Checkbox : "Casella de verificació", +RadioButton : "Botó d'opció", +TextField : "Camp de text", +Textarea : "Àrea de text", +HiddenField : "Camp ocult", +Button : "Botó", +SelectionField : "Camp de selecció", +ImageButton : "Botó d'imatge", + +FitWindow : "Maximiza la mida de l'editor", +ShowBlocks : "Mostra els blocs", + +// Context Menu +EditLink : "Edita l'enllaç", +CellCM : "Cel?la", +RowCM : "Fila", +ColumnCM : "Columna", +InsertRowAfter : "Insereix fila darrera", +InsertRowBefore : "Insereix fila abans de", +DeleteRows : "Suprimeix una fila", +InsertColumnAfter : "Insereix columna darrera", +InsertColumnBefore : "Insereix columna abans de", +DeleteColumns : "Suprimeix una columna", +InsertCellAfter : "Insereix cel?la darrera", +InsertCellBefore : "Insereix cel?la abans de", +DeleteCells : "Suprimeix les cel?les", +MergeCells : "Fusiona les cel?les", +MergeRight : "Fusiona cap a la dreta", +MergeDown : "Fusiona cap avall", +HorizontalSplitCell : "Divideix la cel?la horitzontalment", +VerticalSplitCell : "Divideix la cel?la verticalment", +TableDelete : "Suprimeix la taula", +CellProperties : "Propietats de la cel?la", +TableProperties : "Propietats de la taula", +ImageProperties : "Propietats de la imatge", +FlashProperties : "Propietats del Flash", + +AnchorProp : "Propietats de l'àncora", +ButtonProp : "Propietats del botó", +CheckboxProp : "Propietats de la casella de verificació", +HiddenFieldProp : "Propietats del camp ocult", +RadioButtonProp : "Propietats del botó d'opció", +ImageButtonProp : "Propietats del botó d'imatge", +TextFieldProp : "Propietats del camp de text", +SelectionFieldProp : "Propietats del camp de selecció", +TextareaProp : "Propietats de l'àrea de text", +FormProp : "Propietats del formulari", + +FontFormats : "Normal;Formatejat;Adreça;Encapçalament 1;Encapçalament 2;Encapçalament 3;Encapçalament 4;Encapçalament 5;Encapçalament 6;Normal (DIV)", + +// Alerts and Messages +ProcessingXHTML : "Processant XHTML. Si us plau esperi...", +Done : "Fet", +PasteWordConfirm : "El text que voleu enganxar sembla provenir de Word. Voleu netejar aquest text abans que sigui enganxat?", +NotCompatiblePaste : "Aquesta funció és disponible per a Internet Explorer versió 5.5 o superior. Voleu enganxar sense netejar?", +UnknownToolbarItem : "Element de la barra d'eines desconegut \"%1\"", +UnknownCommand : "Nom de comanda desconegut \"%1\"", +NotImplemented : "Mètode no implementat", +UnknownToolbarSet : "Conjunt de barra d'eines \"%1\" inexistent", +NoActiveX : "Les preferències del navegador poden limitar algunes funcions d'aquest editor. Cal habilitar l'opció \"Executa controls ActiveX i plug-ins\". Poden sorgir errors i poden faltar algunes funcions.", +BrowseServerBlocked : "El visualitzador de recursos no s'ha pogut obrir. Assegura't de que els bloquejos de finestres emergents estan desactivats.", +DialogBlocked : "No ha estat possible obrir una finestra de diàleg. Assegura't de que els bloquejos de finestres emergents estan desactivats.", + +// Dialogs +DlgBtnOK : "D'acord", +DlgBtnCancel : "Cancel?la", +DlgBtnClose : "Tanca", +DlgBtnBrowseServer : "Veure servidor", +DlgAdvancedTag : "Avançat", +DlgOpOther : "Altres", +DlgInfoTab : "Info", +DlgAlertUrl : "Si us plau, afegiu la URL", + +// General Dialogs Labels +DlgGenNotSet : "", +DlgGenId : "Id", +DlgGenLangDir : "Direcció de l'idioma", +DlgGenLangDirLtr : "D'esquerra a dreta (LTR)", +DlgGenLangDirRtl : "De dreta a esquerra (RTL)", +DlgGenLangCode : "Codi d'idioma", +DlgGenAccessKey : "Clau d'accés", +DlgGenName : "Nom", +DlgGenTabIndex : "Index de Tab", +DlgGenLongDescr : "Descripció llarga de la URL", +DlgGenClass : "Classes del full d'estil", +DlgGenTitle : "Títol consultiu", +DlgGenContType : "Tipus de contingut consultiu", +DlgGenLinkCharset : "Conjunt de caràcters font enllaçat", +DlgGenStyle : "Estil", + +// Image Dialog +DlgImgTitle : "Propietats de la imatge", +DlgImgInfoTab : "Informació de la imatge", +DlgImgBtnUpload : "Envia-la al servidor", +DlgImgURL : "URL", +DlgImgUpload : "Puja", +DlgImgAlt : "Text alternatiu", +DlgImgWidth : "Amplada", +DlgImgHeight : "Alçada", +DlgImgLockRatio : "Bloqueja les proporcions", +DlgBtnResetSize : "Restaura la mida", +DlgImgBorder : "Vora", +DlgImgHSpace : "Espaiat horit.", +DlgImgVSpace : "Espaiat vert.", +DlgImgAlign : "Alineació", +DlgImgAlignLeft : "Ajusta a l'esquerra", +DlgImgAlignAbsBottom: "Abs Bottom", +DlgImgAlignAbsMiddle: "Abs Middle", +DlgImgAlignBaseline : "Baseline", +DlgImgAlignBottom : "Bottom", +DlgImgAlignMiddle : "Middle", +DlgImgAlignRight : "Ajusta a la dreta", +DlgImgAlignTextTop : "Text Top", +DlgImgAlignTop : "Top", +DlgImgPreview : "Vista prèvia", +DlgImgAlertUrl : "Si us plau, escriviu la URL de la imatge", +DlgImgLinkTab : "Enllaç", + +// Flash Dialog +DlgFlashTitle : "Propietats del Flash", +DlgFlashChkPlay : "Reprodució automàtica", +DlgFlashChkLoop : "Bucle", +DlgFlashChkMenu : "Habilita menú Flash", +DlgFlashScale : "Escala", +DlgFlashScaleAll : "Mostra-ho tot", +DlgFlashScaleNoBorder : "Sense vores", +DlgFlashScaleFit : "Mida exacta", + +// Link Dialog +DlgLnkWindowTitle : "Enllaç", +DlgLnkInfoTab : "Informació de l'enllaç", +DlgLnkTargetTab : "Destí", + +DlgLnkType : "Tipus d'enllaç", +DlgLnkTypeURL : "URL", +DlgLnkTypeAnchor : "Àncora en aquesta pàgina", +DlgLnkTypeEMail : "Correu electrònic", +DlgLnkProto : "Protocol", +DlgLnkProtoOther : "", +DlgLnkURL : "URL", +DlgLnkAnchorSel : "Selecciona una àncora", +DlgLnkAnchorByName : "Per nom d'àncora", +DlgLnkAnchorById : "Per Id d'element", +DlgLnkNoAnchors : "(No hi ha àncores disponibles en aquest document)", +DlgLnkEMail : "Adreça de correu electrònic", +DlgLnkEMailSubject : "Assumpte del missatge", +DlgLnkEMailBody : "Cos del missatge", +DlgLnkUpload : "Puja", +DlgLnkBtnUpload : "Envia al servidor", + +DlgLnkTarget : "Destí", +DlgLnkTargetFrame : "", +DlgLnkTargetPopup : "", +DlgLnkTargetBlank : "Nova finestra (_blank)", +DlgLnkTargetParent : "Finestra pare (_parent)", +DlgLnkTargetSelf : "Mateixa finestra (_self)", +DlgLnkTargetTop : "Finestra Major (_top)", +DlgLnkTargetFrameName : "Nom del marc de destí", +DlgLnkPopWinName : "Nom finestra popup", +DlgLnkPopWinFeat : "Característiques finestra popup", +DlgLnkPopResize : "Redimensionable", +DlgLnkPopLocation : "Barra d'adreça", +DlgLnkPopMenu : "Barra de menú", +DlgLnkPopScroll : "Barres d'scroll", +DlgLnkPopStatus : "Barra d'estat", +DlgLnkPopToolbar : "Barra d'eines", +DlgLnkPopFullScrn : "Pantalla completa (IE)", +DlgLnkPopDependent : "Depenent (Netscape)", +DlgLnkPopWidth : "Amplada", +DlgLnkPopHeight : "Alçada", +DlgLnkPopLeft : "Posició esquerra", +DlgLnkPopTop : "Posició dalt", + +DlnLnkMsgNoUrl : "Si us plau, escrigui l'enllaç URL", +DlnLnkMsgNoEMail : "Si us plau, escrigui l'adreça correu electrònic", +DlnLnkMsgNoAnchor : "Si us plau, escrigui l'àncora", +DlnLnkMsgInvPopName : "El nom de la finestra emergent ha de començar amb una lletra i no pot tenir espais", + +// Color Dialog +DlgColorTitle : "Selecciona el color", +DlgColorBtnClear : "Neteja", +DlgColorHighlight : "Realça", +DlgColorSelected : "Selecciona", + +// Smiley Dialog +DlgSmileyTitle : "Insereix una icona", + +// Special Character Dialog +DlgSpecialCharTitle : "Selecciona el caràcter especial", + +// Table Dialog +DlgTableTitle : "Propietats de la taula", +DlgTableRows : "Files", +DlgTableColumns : "Columnes", +DlgTableBorder : "Mida vora", +DlgTableAlign : "Alineació", +DlgTableAlignNotSet : "", +DlgTableAlignLeft : "Esquerra", +DlgTableAlignCenter : "Centre", +DlgTableAlignRight : "Dreta", +DlgTableWidth : "Amplada", +DlgTableWidthPx : "píxels", +DlgTableWidthPc : "percentatge", +DlgTableHeight : "Alçada", +DlgTableCellSpace : "Espaiat de cel?les", +DlgTableCellPad : "Encoixinament de cel?les", +DlgTableCaption : "Títol", +DlgTableSummary : "Resum", + +// Table Cell Dialog +DlgCellTitle : "Propietats de la cel?la", +DlgCellWidth : "Amplada", +DlgCellWidthPx : "píxels", +DlgCellWidthPc : "percentatge", +DlgCellHeight : "Alçada", +DlgCellWordWrap : "Ajust de paraula", +DlgCellWordWrapNotSet : "", +DlgCellWordWrapYes : "Si", +DlgCellWordWrapNo : "No", +DlgCellHorAlign : "Alineació horitzontal", +DlgCellHorAlignNotSet : "", +DlgCellHorAlignLeft : "Esquerra", +DlgCellHorAlignCenter : "Centre", +DlgCellHorAlignRight: "Dreta", +DlgCellVerAlign : "Alineació vertical", +DlgCellVerAlignNotSet : "", +DlgCellVerAlignTop : "Top", +DlgCellVerAlignMiddle : "Middle", +DlgCellVerAlignBottom : "Bottom", +DlgCellVerAlignBaseline : "Baseline", +DlgCellRowSpan : "Rows Span", +DlgCellCollSpan : "Columns Span", +DlgCellBackColor : "Color de fons", +DlgCellBorderColor : "Color de la vora", +DlgCellBtnSelect : "Seleccioneu...", + +// Find and Replace Dialog +DlgFindAndReplaceTitle : "Cerca i reemplaça", + +// Find Dialog +DlgFindTitle : "Cerca", +DlgFindFindBtn : "Cerca", +DlgFindNotFoundMsg : "El text especificat no s'ha trobat.", + +// Replace Dialog +DlgReplaceTitle : "Reemplaça", +DlgReplaceFindLbl : "Cerca:", +DlgReplaceReplaceLbl : "Remplaça amb:", +DlgReplaceCaseChk : "Distingeix majúscules/minúscules", +DlgReplaceReplaceBtn : "Reemplaça", +DlgReplaceReplAllBtn : "Reemplaça-ho tot", +DlgReplaceWordChk : "Només paraules completes", + +// Paste Operations / Dialog +PasteErrorCut : "La seguretat del vostre navegador no permet executar automàticament les operacions de retallar. Si us plau, utilitzeu el teclat (Ctrl+X).", +PasteErrorCopy : "La seguretat del vostre navegador no permet executar automàticament les operacions de copiar. Si us plau, utilitzeu el teclat (Ctrl+C).", + +PasteAsText : "Enganxa com a text no formatat", +PasteFromWord : "Enganxa com a Word", + +DlgPasteMsg2 : "Si us plau, enganxeu dins del següent camp utilitzant el teclat (Ctrl+V) i premeu OK.", +DlgPasteSec : "A causa de la configuració de seguretat del vostre navegador, l'editor no pot accedir al porta-retalls directament. Enganxeu-ho un altre cop en aquesta finestra.", +DlgPasteIgnoreFont : "Ignora definicions de font", +DlgPasteRemoveStyles : "Elimina definicions d'estil", + +// Color Picker +ColorAutomatic : "Automàtic", +ColorMoreColors : "Més colors...", + +// Document Properties +DocProps : "Propietats del document", + +// Anchor Dialog +DlgAnchorTitle : "Propietats de l'àncora", +DlgAnchorName : "Nom de l'àncora", +DlgAnchorErrorName : "Si us plau, escriviu el nom de l'ancora", + +// Speller Pages Dialog +DlgSpellNotInDic : "No és al diccionari", +DlgSpellChangeTo : "Reemplaça amb", +DlgSpellBtnIgnore : "Ignora", +DlgSpellBtnIgnoreAll : "Ignora-les totes", +DlgSpellBtnReplace : "Canvia", +DlgSpellBtnReplaceAll : "Canvia-les totes", +DlgSpellBtnUndo : "Desfés", +DlgSpellNoSuggestions : "Cap suggeriment", +DlgSpellProgress : "Verificació ortogràfica en curs...", +DlgSpellNoMispell : "Verificació ortogràfica acabada: no hi ha cap paraula mal escrita", +DlgSpellNoChanges : "Verificació ortogràfica: no s'ha canviat cap paraula", +DlgSpellOneChange : "Verificació ortogràfica: s'ha canviat una paraula", +DlgSpellManyChanges : "Verificació ortogràfica: s'han canviat %1 paraules", + +IeSpellDownload : "Verificació ortogràfica no instal?lada. Voleu descarregar-ho ara?", + +// Button Dialog +DlgButtonText : "Text (Valor)", +DlgButtonType : "Tipus", +DlgButtonTypeBtn : "Botó", +DlgButtonTypeSbm : "Transmet formulari", +DlgButtonTypeRst : "Reinicia formulari", + +// Checkbox and Radio Button Dialogs +DlgCheckboxName : "Nom", +DlgCheckboxValue : "Valor", +DlgCheckboxSelected : "Seleccionat", + +// Form Dialog +DlgFormName : "Nom", +DlgFormAction : "Acció", +DlgFormMethod : "Mètode", + +// Select Field Dialog +DlgSelectName : "Nom", +DlgSelectValue : "Valor", +DlgSelectSize : "Mida", +DlgSelectLines : "Línies", +DlgSelectChkMulti : "Permet múltiples seleccions", +DlgSelectOpAvail : "Opcions disponibles", +DlgSelectOpText : "Text", +DlgSelectOpValue : "Valor", +DlgSelectBtnAdd : "Afegeix", +DlgSelectBtnModify : "Modifica", +DlgSelectBtnUp : "Amunt", +DlgSelectBtnDown : "Avall", +DlgSelectBtnSetValue : "Selecciona per defecte", +DlgSelectBtnDelete : "Elimina", + +// Textarea Dialog +DlgTextareaName : "Nom", +DlgTextareaCols : "Columnes", +DlgTextareaRows : "Files", + +// Text Field Dialog +DlgTextName : "Nom", +DlgTextValue : "Valor", +DlgTextCharWidth : "Amplada", +DlgTextMaxChars : "Nombre màxim de caràcters", +DlgTextType : "Tipus", +DlgTextTypeText : "Text", +DlgTextTypePass : "Contrasenya", + +// Hidden Field Dialog +DlgHiddenName : "Nom", +DlgHiddenValue : "Valor", + +// Bulleted List Dialog +BulletedListProp : "Propietats de la llista de pics", +NumberedListProp : "Propietats de llista numerada", +DlgLstStart : "Inici", +DlgLstType : "Tipus", +DlgLstTypeCircle : "Cercle", +DlgLstTypeDisc : "Disc", +DlgLstTypeSquare : "Quadrat", +DlgLstTypeNumbers : "Números (1, 2, 3)", +DlgLstTypeLCase : "Lletres minúscules (a, b, c)", +DlgLstTypeUCase : "Lletres majúscules (A, B, C)", +DlgLstTypeSRoman : "Números romans en minúscules (i, ii, iii)", +DlgLstTypeLRoman : "Números romans en majúscules (I, II, III)", + +// Document Properties Dialog +DlgDocGeneralTab : "General", +DlgDocBackTab : "Fons", +DlgDocColorsTab : "Colors i marges", +DlgDocMetaTab : "Metadades", + +DlgDocPageTitle : "Títol de la pàgina", +DlgDocLangDir : "Direcció idioma", +DlgDocLangDirLTR : "Esquerra a dreta (LTR)", +DlgDocLangDirRTL : "Dreta a esquerra (RTL)", +DlgDocLangCode : "Codi d'idioma", +DlgDocCharSet : "Codificació de conjunt de caràcters", +DlgDocCharSetCE : "Centreeuropeu", +DlgDocCharSetCT : "Xinès tradicional (Big5)", +DlgDocCharSetCR : "Ciríl?lic", +DlgDocCharSetGR : "Grec", +DlgDocCharSetJP : "Japonès", +DlgDocCharSetKR : "Coreà", +DlgDocCharSetTR : "Turc", +DlgDocCharSetUN : "Unicode (UTF-8)", +DlgDocCharSetWE : "Europeu occidental", +DlgDocCharSetOther : "Una altra codificació de caràcters", + +DlgDocDocType : "Capçalera de tipus de document", +DlgDocDocTypeOther : "Un altra capçalera de tipus de document", +DlgDocIncXHTML : "Incloure declaracions XHTML", +DlgDocBgColor : "Color de fons", +DlgDocBgImage : "URL de la imatge de fons", +DlgDocBgNoScroll : "Fons fixe", +DlgDocCText : "Text", +DlgDocCLink : "Enllaç", +DlgDocCVisited : "Enllaç visitat", +DlgDocCActive : "Enllaç actiu", +DlgDocMargins : "Marges de pàgina", +DlgDocMaTop : "Cap", +DlgDocMaLeft : "Esquerra", +DlgDocMaRight : "Dreta", +DlgDocMaBottom : "Peu", +DlgDocMeIndex : "Mots clau per a indexació (separats per coma)", +DlgDocMeDescr : "Descripció del document", +DlgDocMeAuthor : "Autor", +DlgDocMeCopy : "Copyright", +DlgDocPreview : "Vista prèvia", + +// Templates Dialog +Templates : "Plantilles", +DlgTemplatesTitle : "Contingut plantilles", +DlgTemplatesSelMsg : "Si us plau, seleccioneu la plantilla per obrir a l'editor
        (el contingut actual no serà enregistrat):", +DlgTemplatesLoading : "Carregant la llista de plantilles. Si us plau, espereu...", +DlgTemplatesNoTpl : "(No hi ha plantilles definides)", +DlgTemplatesReplace : "Reemplaça el contingut actual", + +// About Dialog +DlgAboutAboutTab : "Quant a", +DlgAboutBrowserInfoTab : "Informació del navegador", +DlgAboutLicenseTab : "Llicència", +DlgAboutVersion : "versió", +DlgAboutInfo : "Per a més informació aneu a" +}; Property changes on: announcement/trunk/src/main/webapp/fckeditor/editor/lang/ca.js ___________________________________________________________________ Name: svn:eol-style + native Added: announcement/trunk/src/main/webapp/fckeditor/editor/lang/cs.js =================================================================== --- announcement/trunk/src/main/webapp/fckeditor/editor/lang/cs.js (rev 0) +++ announcement/trunk/src/main/webapp/fckeditor/editor/lang/cs.js 2008-06-30 02:54:27 UTC (rev 1002) @@ -0,0 +1,515 @@ +?/* + * FCKeditor - The text editor for Internet - http://www.fckeditor.net + * Copyright (C) 2003-2008 Frederico Caldeira Knabben + * + * == BEGIN LICENSE == + * + * Licensed under the terms of any of the following licenses at your + * choice: + * + * - GNU General Public License Version 2 or later (the "GPL") + * http://www.gnu.org/licenses/gpl.html + * + * - GNU Lesser General Public License Version 2.1 or later (the "LGPL") + * http://www.gnu.org/licenses/lgpl.html + * + * - Mozilla Public License Version 1.1 or later (the "MPL") + * http://www.mozilla.org/MPL/MPL-1.1.html + * + * == END LICENSE == + * + * Czech language file. + */ + +var FCKLang = +{ +// Language direction : "ltr" (left to right) or "rtl" (right to left). +Dir : "ltr", + +ToolbarCollapse : "Skrýt panel nástrojů", +ToolbarExpand : "Zobrazit panel nástrojů", + +// Toolbar Items and Context Menu +Save : "Uložit", +NewPage : "Nová stránka", +Preview : "Náhled", +Cut : "Vyjmout", +Copy : "Kopírovat", +Paste : "Vložit", +PasteText : "Vložit jako čistý text", +PasteWord : "Vložit z Wordu", +Print : "Tisk", +SelectAll : "Vybrat vše", +RemoveFormat : "Odstranit formátování", +InsertLinkLbl : "Odkaz", +InsertLink : "Vložit/změnit odkaz", +RemoveLink : "Odstranit odkaz", +Anchor : "Vložít/změnit záložku", +AnchorDelete : "Odstranit kotvu", +InsertImageLbl : "Obrázek", +InsertImage : "Vložit/změnit obrázek", +InsertFlashLbl : "Flash", +InsertFlash : "Vložit/Upravit Flash", +InsertTableLbl : "Tabulka", +InsertTable : "Vložit/změnit tabulku", +InsertLineLbl : "Linka", +InsertLine : "Vložit vodorovnou linku", +InsertSpecialCharLbl: "Speciální znaky", +InsertSpecialChar : "Vložit speciální znaky", +InsertSmileyLbl : "Smajlíky", +InsertSmiley : "Vložit smajlík", +About : "O aplikaci FCKeditor", +Bold : "Tučné", +Italic : "Kurzíva", +Underline : "Podtržené", +StrikeThrough : "Přeškrtnuté", +Subscript : "Dolní index", +Superscript : "Horní index", +LeftJustify : "Zarovnat vlevo", +CenterJustify : "Zarovnat na střed", +RightJustify : "Zarovnat vpravo", +BlockJustify : "Zarovnat do bloku", +DecreaseIndent : "Zmenšit odsazení", +IncreaseIndent : "Zvětšit odsazení", +Blockquote : "Citace", +Undo : "Zpět", +Redo : "Znovu", +NumberedListLbl : "Číslování", +NumberedList : "Vložit/odstranit číslovaný seznam", +BulletedListLbl : "Odrážky", +BulletedList : "Vložit/odstranit odrážky", +ShowTableBorders : "Zobrazit okraje tabulek", +ShowDetails : "Zobrazit podrobnosti", +Style : "Styl", +FontFormat : "Formát", +Font : "Písmo", +FontSize : "Velikost", +TextColor : "Barva textu", +BGColor : "Barva pozadí", +Source : "Zdroj", +Find : "Hledat", +Replace : "Nahradit", +SpellCheck : "Zkontrolovat pravopis", +UniversalKeyboard : "Univerzální klávesnice", +PageBreakLbl : "Konec stránky", +PageBreak : "Vložit konec stránky", + +Form : "Formulář", +Checkbox : "Zaškrtávací políčko", +RadioButton : "Přepínač", +TextField : "Textové pole", +Textarea : "Textová oblast", +HiddenField : "Skryté pole", +Button : "Tlačítko", +SelectionField : "Seznam", +ImageButton : "Obrázkové tlačítko", + +FitWindow : "Maximalizovat velikost editoru", +ShowBlocks : "Ukázat bloky", + +// Context Menu +EditLink : "Změnit odkaz", +CellCM : "Buňka", +RowCM : "Řádek", +ColumnCM : "Sloupec", +InsertRowAfter : "Vložit řádek za", +InsertRowBefore : "Vložit řádek před", +DeleteRows : "Smazat řádky", +InsertColumnAfter : "Vložit sloupec za", +InsertColumnBefore : "Vložit sloupec před", +DeleteColumns : "Smazat sloupec", +InsertCellAfter : "Vložit buňku za", +InsertCellBefore : "Vložit buňku před", +DeleteCells : "Smazat buňky", +MergeCells : "Sloučit buňky", +MergeRight : "Sloučit doprava", +MergeDown : "Sloučit dolů", +HorizontalSplitCell : "Rozdělit buňky vodorovně", +VerticalSplitCell : "Rozdělit buňky svisle", +TableDelete : "Smazat tabulku", +CellProperties : "Vlastnosti buňky", +TableProperties : "Vlastnosti tabulky", +ImageProperties : "Vlastnosti obrázku", +FlashProperties : "Vlastnosti Flashe", + +AnchorProp : "Vlastnosti záložky", +ButtonProp : "Vlastnosti tlačítka", +CheckboxProp : "Vlastnosti zaškrtávacího políčka", +HiddenFieldProp : "Vlastnosti skrytého pole", +RadioButtonProp : "Vlastnosti přepínače", +ImageButtonProp : "Vlastností obrázkového tlačítka", +TextFieldProp : "Vlastnosti textového pole", +SelectionFieldProp : "Vlastnosti seznamu", +TextareaProp : "Vlastnosti textové oblasti", +FormProp : "Vlastnosti formuláře", + +FontFormats : "Normální;Naformátováno;Adresa;Nadpis 1;Nadpis 2;Nadpis 3;Nadpis 4;Nadpis 5;Nadpis 6;Normální (DIV)", + +// Alerts and Messages +ProcessingXHTML : "Probíhá zpracování XHTML. Prosím čekejte...", +Done : "Hotovo", +PasteWordConfirm : "Jak je vidět, vkládaný text je kopírován z Wordu. Chcete jej před vložením vyčistit?", +NotCompatiblePaste : "Tento příkaz je dostupný pouze v Internet Exploreru verze 5.5 nebo vyšší. Chcete vložit text bez vyčištění?", +UnknownToolbarItem : "Neznámá položka panelu nástrojů \"%1\"", +UnknownCommand : "Neznámý příkaz \"%1\"", +NotImplemented : "Příkaz není implementován", +UnknownToolbarSet : "Panel nástrojů \"%1\" neexistuje", +NoActiveX : "Nastavení bezpečnosti Vašeho prohlížeče omezuje funkčnost některých jeho možností. Je třeba zapnout volbu \"Spouštět ovládáací prvky ActiveX a moduly plug-in\", jinak nebude možné využívat všechny dosputné schopnosti editoru.", +BrowseServerBlocked : "Průzkumník zdrojů nelze otevřít. Prověřte, zda nemáte aktivováno blokování popup oken.", +DialogBlocked : "Nelze otevřít dialogové okno. Prověřte, zda nemáte aktivováno blokování popup oken.", + +// Dialogs +DlgBtnOK : "OK", +DlgBtnCancel : "Storno", +DlgBtnClose : "Zavřít", +DlgBtnBrowseServer : "Vybrat na serveru", +DlgAdvancedTag : "Rozšířené", +DlgOpOther : "", +DlgInfoTab : "Info", +DlgAlertUrl : "Prosím vložte URL", + +// General Dialogs Labels +DlgGenNotSet : "", +DlgGenId : "Id", +DlgGenLangDir : "Orientace jazyka", +DlgGenLangDirLtr : "Zleva do prava (LTR)", +DlgGenLangDirRtl : "Zprava do leva (RTL)", +DlgGenLangCode : "Kód jazyka", +DlgGenAccessKey : "Přístupový klíč", +DlgGenName : "Jméno", +DlgGenTabIndex : "Pořadí prvku", +DlgGenLongDescr : "Dlouhý popis URL", +DlgGenClass : "Třída stylu", +DlgGenTitle : "Pomocný titulek", +DlgGenContType : "Pomocný typ obsahu", +DlgGenLinkCharset : "Přiřazená znaková sada", +DlgGenStyle : "Styl", + +// Image Dialog +DlgImgTitle : "Vlastnosti obrázku", +DlgImgInfoTab : "Informace o obrázku", +DlgImgBtnUpload : "Odeslat na server", +DlgImgURL : "URL", +DlgImgUpload : "Odeslat", +DlgImgAlt : "Alternativní text", +DlgImgWidth : "Šířka", +DlgImgHeight : "Výška", +DlgImgLockRatio : "Zámek", +DlgBtnResetSize : "Původní velikost", +DlgImgBorder : "Okraje", +DlgImgHSpace : "H-mezera", +DlgImgVSpace : "V-mezera", +DlgImgAlign : "Zarovnání", +DlgImgAlignLeft : "Vlevo", +DlgImgAlignAbsBottom: "Zcela dolů", +DlgImgAlignAbsMiddle: "Doprostřed", +DlgImgAlignBaseline : "Na účaří", +DlgImgAlignBottom : "Dolů", +DlgImgAlignMiddle : "Na střed", +DlgImgAlignRight : "Vpravo", +DlgImgAlignTextTop : "Na horní okraj textu", +DlgImgAlignTop : "Nahoru", +DlgImgPreview : "Náhled", +DlgImgAlertUrl : "Zadejte prosím URL obrázku", +DlgImgLinkTab : "Odkaz", + +// Flash Dialog +DlgFlashTitle : "Vlastnosti Flashe", +DlgFlashChkPlay : "Automatické spuštění", +DlgFlashChkLoop : "Opakování", +DlgFlashChkMenu : "Nabídka Flash", +DlgFlashScale : "Zobrazit", +DlgFlashScaleAll : "Zobrazit vše", +DlgFlashScaleNoBorder : "Bez okraje", +DlgFlashScaleFit : "Přizpůsobit", + +// Link Dialog +DlgLnkWindowTitle : "Odkaz", +DlgLnkInfoTab : "Informace o odkazu", +DlgLnkTargetTab : "Cíl", + +DlgLnkType : "Typ odkazu", +DlgLnkTypeURL : "URL", +DlgLnkTypeAnchor : "Kotva v této stránce", +DlgLnkTypeEMail : "E-Mail", +DlgLnkProto : "Protokol", +DlgLnkProtoOther : "", +DlgLnkURL : "URL", +DlgLnkAnchorSel : "Vybrat kotvu", +DlgLnkAnchorByName : "Podle jména kotvy", +DlgLnkAnchorById : "Podle Id objektu", +DlgLnkNoAnchors : "(Ve stránce není definována žádná kotva!)", +DlgLnkEMail : "E-Mailová adresa", +DlgLnkEMailSubject : "Předmět zprávy", +DlgLnkEMailBody : "Tělo zprávy", +DlgLnkUpload : "Odeslat", +DlgLnkBtnUpload : "Odeslat na Server", + +DlgLnkTarget : "Cíl", +DlgLnkTargetFrame : "", +DlgLnkTargetPopup : "", +DlgLnkTargetBlank : "Nové okno (_blank)", +DlgLnkTargetParent : "Rodičovské okno (_parent)", +DlgLnkTargetSelf : "Stejné okno (_self)", +DlgLnkTargetTop : "Hlavní okno (_top)", +DlgLnkTargetFrameName : "Název cílového rámu", +DlgLnkPopWinName : "Název vyskakovacího okna", +DlgLnkPopWinFeat : "Vlastnosti vyskakovacího okna", +DlgLnkPopResize : "Měnitelná velikost", +DlgLnkPopLocation : "Panel umístění", +DlgLnkPopMenu : "Panel nabídky", +DlgLnkPopScroll : "Posuvníky", +DlgLnkPopStatus : "Stavový řádek", +DlgLnkPopToolbar : "Panel nástrojů", +DlgLnkPopFullScrn : "Celá obrazovka (IE)", +DlgLnkPopDependent : "Závislost (Netscape)", +DlgLnkPopWidth : "Šířka", +DlgLnkPopHeight : "Výška", +DlgLnkPopLeft : "Levý okraj", +DlgLnkPopTop : "Horní okraj", + +DlnLnkMsgNoUrl : "Zadejte prosím URL odkazu", +DlnLnkMsgNoEMail : "Zadejte prosím e-mailovou adresu", +DlnLnkMsgNoAnchor : "Vyberte prosím kotvu", +DlnLnkMsgInvPopName : "Název vyskakovacího okna musí začínat písmenem a nesmí obsahovat mezery", + +// Color Dialog +DlgColorTitle : "Výběr barvy", +DlgColorBtnClear : "Vymazat", +DlgColorHighlight : "Zvýrazněná", +DlgColorSelected : "Vybraná", + +// Smiley Dialog +DlgSmileyTitle : "Vkládání smajlíků", + +// Special Character Dialog +DlgSpecialCharTitle : "Výběr speciálního znaku", + +// Table Dialog +DlgTableTitle : "Vlastnosti tabulky", +DlgTableRows : "Řádky", +DlgTableColumns : "Sloupce", +DlgTableBorder : "Ohraničení", +DlgTableAlign : "Zarovnání", +DlgTableAlignNotSet : "", +DlgTableAlignLeft : "Vlevo", +DlgTableAlignCenter : "Na střed", +DlgTableAlignRight : "Vpravo", +DlgTableWidth : "Šířka", +DlgTableWidthPx : "bodů", +DlgTableWidthPc : "procent", +DlgTableHeight : "Výška", +DlgTableCellSpace : "Vzdálenost buněk", +DlgTableCellPad : "Odsazení obsahu", +DlgTableCaption : "Popis", +DlgTableSummary : "Souhrn", + +// Table Cell Dialog +DlgCellTitle : "Vlastnosti buňky", +DlgCellWidth : "Šířka", +DlgCellWidthPx : "bodů", +DlgCellWidthPc : "procent", +DlgCellHeight : "Výška", +DlgCellWordWrap : "Zalamování", +DlgCellWordWrapNotSet : "", +DlgCellWordWrapYes : "Ano", +DlgCellWordWrapNo : "Ne", +DlgCellHorAlign : "Vodorovné zarovnání", +DlgCellHorAlignNotSet : "", +DlgCellHorAlignLeft : "Vlevo", +DlgCellHorAlignCenter : "Na střed", +DlgCellHorAlignRight: "Vpravo", +DlgCellVerAlign : "Svislé zarovnání", +DlgCellVerAlignNotSet : "", +DlgCellVerAlignTop : "Nahoru", +DlgCellVerAlignMiddle : "Doprostřed", +DlgCellVerAlignBottom : "Dolů", +DlgCellVerAlignBaseline : "Na účaří", +DlgCellRowSpan : "Sloučené řádky", +DlgCellCollSpan : "Sloučené sloupce", +DlgCellBackColor : "Barva pozadí", +DlgCellBorderColor : "Barva ohraničení", +DlgCellBtnSelect : "Výběr...", + +// Find and Replace Dialog +DlgFindAndReplaceTitle : "Najít a nahradit", + +// Find Dialog +DlgFindTitle : "Hledat", +DlgFindFindBtn : "Hledat", +DlgFindNotFoundMsg : "Hledaný text nebyl nalezen.", + +// Replace Dialog +DlgReplaceTitle : "Nahradit", +DlgReplaceFindLbl : "Co hledat:", +DlgReplaceReplaceLbl : "Čím nahradit:", +DlgReplaceCaseChk : "Rozlišovat velikost písma", +DlgReplaceReplaceBtn : "Nahradit", +DlgReplaceReplAllBtn : "Nahradit vše", +DlgReplaceWordChk : "Pouze celá slova", + +// Paste Operations / Dialog +PasteErrorCut : "Bezpečnostní nastavení Vašeho prohlížeče nedovolují editoru spustit funkci pro vyjmutí zvoleného textu do schránky. Prosím vyjměte zvolený text do schránky pomocí klávesnice (Ctrl+X).", +PasteErrorCopy : "Bezpečnostní nastavení Vašeho prohlížeče nedovolují editoru spustit funkci pro kopírování zvoleného textu do schránky. Prosím zkopírujte zvolený text do schránky pomocí klávesnice (Ctrl+C).", + +PasteAsText : "Vložit jako čistý text", +PasteFromWord : "Vložit text z Wordu", + +DlgPasteMsg2 : "Do následujícího pole vložte požadovaný obsah pomocí klávesnice (Ctrl+V) a stiskněte OK.", +DlgPasteSec : "Z důvodů nastavení bezpečnosti Vašeho prohlížeče nemůže editor přistupovat přímo do schránky. Obsah schránky prosím vložte znovu do tohoto okna.", +DlgPasteIgnoreFont : "Ignorovat písmo", +DlgPasteRemoveStyles : "Odstranit styly", + +// Color Picker +ColorAutomatic : "Automaticky", +ColorMoreColors : "Více barev...", + +// Document Properties +DocProps : "Vlastnosti dokumentu", + +// Anchor Dialog +DlgAnchorTitle : "Vlastnosti záložky", +DlgAnchorName : "Název záložky", +DlgAnchorErrorName : "Zadejte prosím název záložky", + +// Speller Pages Dialog +DlgSpellNotInDic : "Není ve slovníku", +DlgSpellChangeTo : "Změnit na", +DlgSpellBtnIgnore : "Přeskočit", +DlgSpellBtnIgnoreAll : "Přeskakovat vše", +DlgSpellBtnReplace : "Zaměnit", +DlgSpellBtnReplaceAll : "Zaměňovat vše", +DlgSpellBtnUndo : "Zpět", +DlgSpellNoSuggestions : "- žádné návrhy -", +DlgSpellProgress : "Probíhá kontrola pravopisu...", +DlgSpellNoMispell : "Kontrola pravopisu dokončena: Žádné pravopisné chyby nenalezeny", +DlgSpellNoChanges : "Kontrola pravopisu dokončena: Beze změn", +DlgSpellOneChange : "Kontrola pravopisu dokončena: Jedno slovo změněno", +DlgSpellManyChanges : "Kontrola pravopisu dokončena: %1 slov změněno", + +IeSpellDownload : "Kontrola pravopisu není nainstalována. Chcete ji nyní stáhnout?", + +// Button Dialog +DlgButtonText : "Popisek", +DlgButtonType : "Typ", +DlgButtonTypeBtn : "Tlačítko", +DlgButtonTypeSbm : "Odeslat", +DlgButtonTypeRst : "Obnovit", + +// Checkbox and Radio Button Dialogs +DlgCheckboxName : "Název", +DlgCheckboxValue : "Hodnota", +DlgCheckboxSelected : "Zaškrtnuto", + +// Form Dialog +DlgFormName : "Název", +DlgFormAction : "Akce", +DlgFormMethod : "Metoda", + +// Select Field Dialog +DlgSelectName : "Název", +DlgSelectValue : "Hodnota", +DlgSelectSize : "Velikost", +DlgSelectLines : "Řádků", +DlgSelectChkMulti : "Povolit mnohonásobné výběry", +DlgSelectOpAvail : "Dostupná nastavení", +DlgSelectOpText : "Text", +DlgSelectOpValue : "Hodnota", +DlgSelectBtnAdd : "Přidat", +DlgSelectBtnModify : "Změnit", +DlgSelectBtnUp : "Nahoru", +DlgSelectBtnDown : "Dolů", +DlgSelectBtnSetValue : "Nastavit jako vybranou hodnotu", +DlgSelectBtnDelete : "Smazat", + +// Textarea Dialog +DlgTextareaName : "Název", +DlgTextareaCols : "Sloupců", +DlgTextareaRows : "Řádků", + +// Text Field Dialog +DlgTextName : "Název", +DlgTextValue : "Hodnota", +DlgTextCharWidth : "Šířka ve znacích", +DlgTextMaxChars : "Maximální počet znaků", +DlgTextType : "Typ", +DlgTextTypeText : "Text", +DlgTextTypePass : "Heslo", + +// Hidden Field Dialog +DlgHiddenName : "Název", +DlgHiddenValue : "Hodnota", + +// Bulleted List Dialog +BulletedListProp : "Vlastnosti odrážek", +NumberedListProp : "Vlastnosti číslovaného seznamu", +DlgLstStart : "Začátek", +DlgLstType : "Typ", +DlgLstTypeCircle : "Kružnice", +DlgLstTypeDisc : "Kruh", +DlgLstTypeSquare : "Čtverec", +DlgLstTypeNumbers : "Čísla (1, 2, 3)", +DlgLstTypeLCase : "Malá písmena (a, b, c)", +DlgLstTypeUCase : "Velká písmena (A, B, C)", +DlgLstTypeSRoman : "Malé římská číslice (i, ii, iii)", +DlgLstTypeLRoman : "Velké římské číslice (I, II, III)", + +// Document Properties Dialog +DlgDocGeneralTab : "Obecné", +DlgDocBackTab : "Pozadí", +DlgDocColorsTab : "Barvy a okraje", +DlgDocMetaTab : "Metadata", + +DlgDocPageTitle : "Titulek stránky", +DlgDocLangDir : "Směr jazyku", +DlgDocLangDirLTR : "Zleva do prava ", +DlgDocLangDirRTL : "Zprava doleva", +DlgDocLangCode : "Kód jazyku", +DlgDocCharSet : "Znaková sada", +DlgDocCharSetCE : "Středoevropské jazyky", +DlgDocCharSetCT : "Tradiční čínština (Big5)", +DlgDocCharSetCR : "Cyrilice", +DlgDocCharSetGR : "Řečtina", +DlgDocCharSetJP : "Japonština", +DlgDocCharSetKR : "Korejština", +DlgDocCharSetTR : "Turečtina", +DlgDocCharSetUN : "Unicode (UTF-8)", +DlgDocCharSetWE : "Západoevropské jazyky", +DlgDocCharSetOther : "Další znaková sada", + +DlgDocDocType : "Typ dokumentu", +DlgDocDocTypeOther : "Jiný typ dokumetu", +DlgDocIncXHTML : "Zahrnou deklarace XHTML", +DlgDocBgColor : "Barva pozadí", +DlgDocBgImage : "URL obrázku na pozadí", +DlgDocBgNoScroll : "Nerolovatelné pozadí", +DlgDocCText : "Text", +DlgDocCLink : "Odkaz", +DlgDocCVisited : "Navštívený odkaz", +DlgDocCActive : "Vybraný odkaz", +DlgDocMargins : "Okraje stránky", +DlgDocMaTop : "Horní", +DlgDocMaLeft : "Levý", +DlgDocMaRight : "Pravý", +DlgDocMaBottom : "Dolní", +DlgDocMeIndex : "Klíčová slova (oddělená čárkou)", +DlgDocMeDescr : "Popis dokumentu", +DlgDocMeAuthor : "Autor", +DlgDocMeCopy : "Autorská práva", +DlgDocPreview : "Náhled", + +// Templates Dialog +Templates : "Šablony", +DlgTemplatesTitle : "Šablony obsahu", +DlgTemplatesSelMsg : "Prosím zvolte šablonu pro otevření v editoru
        (aktuální obsah editoru bude ztracen):", +DlgTemplatesLoading : "Nahrávám přeheld šablon. Prosím čekejte...", +DlgTemplatesNoTpl : "(Není definována žádná šablona)", +DlgTemplatesReplace : "Nahradit aktuální obsah", + +// About Dialog +DlgAboutAboutTab : "O aplikaci", +DlgAboutBrowserInfoTab : "Informace o prohlížeči", +DlgAboutLicenseTab : "Licence", +DlgAboutVersion : "verze", +DlgAboutInfo : "Více informací získáte na" +}; Property changes on: announcement/trunk/src/main/webapp/fckeditor/editor/lang/cs.js ___________________________________________________________________ Name: svn:eol-style + native Added: announcement/trunk/src/main/webapp/fckeditor/editor/lang/da.js =================================================================== --- announcement/trunk/src/main/webapp/fckeditor/editor/lang/da.js (rev 0) +++ announcement/trunk/src/main/webapp/fckeditor/editor/lang/da.js 2008-06-30 02:54:27 UTC (rev 1002) @@ -0,0 +1,515 @@ +?/* + * FCKeditor - The text editor for Internet - http://www.fckeditor.net + * Copyright (C) 2003-2008 Frederico Caldeira Knabben + * + * == BEGIN LICENSE == + * + * Licensed under the terms of any of the following licenses at your + * choice: + * + * - GNU General Public License Version 2 or later (the "GPL") + * http://www.gnu.org/licenses/gpl.html + * + * - GNU Lesser General Public License Version 2.1 or later (the "LGPL") + * http://www.gnu.org/licenses/lgpl.html + * + * - Mozilla Public License Version 1.1 or later (the "MPL") + * http://www.mozilla.org/MPL/MPL-1.1.html + * + * == END LICENSE == + * + * Danish language file. + */ + +var FCKLang = +{ +// Language direction : "ltr" (left to right) or "rtl" (right to left). +Dir : "ltr", + +ToolbarCollapse : "Skjul værktøjslinier", +ToolbarExpand : "Vis værktøjslinier", + +// Toolbar Items and Context Menu +Save : "Gem", +NewPage : "Ny side", +Preview : "Vis eksempel", +Cut : "Klip", +Copy : "Kopier", +Paste : "Indsæt", +PasteText : "Indsæt som ikke-formateret tekst", +PasteWord : "Indsæt fra Word", +Print : "Udskriv", +SelectAll : "Vælg alt", +RemoveFormat : "Fjern formatering", +InsertLinkLbl : "Hyperlink", +InsertLink : "Indsæt/rediger hyperlink", +RemoveLink : "Fjern hyperlink", +Anchor : "Indsæt/rediger bogmærke", +AnchorDelete : "Remove Anchor", //MISSING +InsertImageLbl : "Indsæt billede", +InsertImage : "Indsæt/rediger billede", +InsertFlashLbl : "Flash", +InsertFlash : "Indsæt/rediger Flash", +InsertTableLbl : "Table", +InsertTable : "Indsæt/rediger tabel", +InsertLineLbl : "Linie", +InsertLine : "Indsæt vandret linie", +InsertSpecialCharLbl: "Symbol", +InsertSpecialChar : "Indsæt symbol", +InsertSmileyLbl : "Smiley", +InsertSmiley : "Indsæt smiley", +About : "Om FCKeditor", +Bold : "Fed", +Italic : "Kursiv", +Underline : "Understreget", +StrikeThrough : "Overstreget", +Subscript : "Sænket skrift", +Superscript : "Hævet skrift", +LeftJustify : "Venstrestillet", +CenterJustify : "Centreret", +RightJustify : "Højrestillet", +BlockJustify : "Lige margener", +DecreaseIndent : "Formindsk indrykning", +IncreaseIndent : "Forøg indrykning", +Blockquote : "Blockquote", //MISSING +Undo : "Fortryd", +Redo : "Annuller fortryd", +NumberedListLbl : "Talopstilling", +NumberedList : "Indsæt/fjern talopstilling", +BulletedListLbl : "Punktopstilling", +BulletedList : "Indsæt/fjern punktopstilling", +ShowTableBorders : "Vis tabelkanter", +ShowDetails : "Vis detaljer", +Style : "Typografi", +FontFormat : "Formatering", +Font : "Skrifttype", +FontSize : "Skriftstørrelse", +TextColor : "Tekstfarve", +BGColor : "Baggrundsfarve", +Source : "Kilde", +Find : "Søg", +Replace : "Erstat", +SpellCheck : "Stavekontrol", +UniversalKeyboard : "Universaltastatur", +PageBreakLbl : "Sidskift", +PageBreak : "Indsæt sideskift", + +Form : "Indsæt formular", +Checkbox : "Indsæt afkrydsningsfelt", +RadioButton : "Indsæt alternativknap", +TextField : "Indsæt tekstfelt", +Textarea : "Indsæt tekstboks", +HiddenField : "Indsæt skjult felt", +Button : "Indsæt knap", +SelectionField : "Indsæt liste", +ImageButton : "Indsæt billedknap", + +FitWindow : "Maksimer editor vinduet", +ShowBlocks : "Show Blocks", //MISSING + +// Context Menu +EditLink : "Rediger hyperlink", +CellCM : "Celle", +RowCM : "Række", +ColumnCM : "Kolonne", +InsertRowAfter : "Insert Row After", //MISSING +InsertRowBefore : "Insert Row Before", //MISSING +DeleteRows : "Slet række", +InsertColumnAfter : "Insert Column After", //MISSING +InsertColumnBefore : "Insert Column Before", //MISSING +DeleteColumns : "Slet kolonne", +InsertCellAfter : "Insert Cell After", //MISSING +InsertCellBefore : "Insert Cell Before", //MISSING +DeleteCells : "Slet celle", +MergeCells : "Flet celler", +MergeRight : "Merge Right", //MISSING +MergeDown : "Merge Down", //MISSING +HorizontalSplitCell : "Split Cell Horizontally", //MISSING +VerticalSplitCell : "Split Cell Vertically", //MISSING +TableDelete : "Slet tabel", +CellProperties : "Egenskaber for celle", +TableProperties : "Egenskaber for tabel", +ImageProperties : "Egenskaber for billede", +FlashProperties : "Egenskaber for Flash", + +AnchorProp : "Egenskaber for bogmærke", +ButtonProp : "Egenskaber for knap", +CheckboxProp : "Egenskaber for afkrydsningsfelt", +HiddenFieldProp : "Egenskaber for skjult felt", +RadioButtonProp : "Egenskaber for alternativknap", +ImageButtonProp : "Egenskaber for billedknap", +TextFieldProp : "Egenskaber for tekstfelt", +SelectionFieldProp : "Egenskaber for liste", +TextareaProp : "Egenskaber for tekstboks", +FormProp : "Egenskaber for formular", + +FontFormats : "Normal;Formateret;Adresse;Overskrift 1;Overskrift 2;Overskrift 3;Overskrift 4;Overskrift 5;Overskrift 6;Normal (DIV)", + +// Alerts and Messages +ProcessingXHTML : "Behandler XHTML...", +Done : "Færdig", +PasteWordConfirm : "Den tekst du forsøger at indsætte ser ud til at komme fra Word.
        Vil du rense teksten før den indsættes?", +NotCompatiblePaste : "Denne kommando er tilgændelig i Internet Explorer 5.5 eller senere.
        Vil du indsætte teksten uden at rense den ?", +UnknownToolbarItem : "Ukendt værktøjslinjeobjekt \"%1\"!", +UnknownCommand : "Ukendt kommandonavn \"%1\"!", +NotImplemented : "Kommandoen er ikke implementeret!", +UnknownToolbarSet : "Værktøjslinjen \"%1\" eksisterer ikke!", +NoActiveX : "Din browsers sikkerhedsindstillinger begrænser nogle af editorens muligheder.
        Slå \"Kør ActiveX-objekter og plug-ins\" til, ellers vil du opleve fejl og manglende muligheder.", +BrowseServerBlocked : "Browseren kunne ikke åbne de nødvendige ressourcer!
        Slå pop-up blokering fra.", +DialogBlocked : "Dialogvinduet kunne ikke åbnes!
        Slå pop-up blokering fra.", + +// Dialogs +DlgBtnOK : "OK", +DlgBtnCancel : "Annuller", +DlgBtnClose : "Luk", +DlgBtnBrowseServer : "Gennemse...", +DlgAdvancedTag : "Avanceret", +DlgOpOther : "", +DlgInfoTab : "Generelt", +DlgAlertUrl : "Indtast URL", + +// General Dialogs Labels +DlgGenNotSet : "", +DlgGenId : "Id", +DlgGenLangDir : "Tekstretning", +DlgGenLangDirLtr : "Fra venstre mod højre (LTR)", +DlgGenLangDirRtl : "Fra højre mod venstre (RTL)", +DlgGenLangCode : "Sprogkode", +DlgGenAccessKey : "Genvejstast", +DlgGenName : "Navn", +DlgGenTabIndex : "Tabulator indeks", +DlgGenLongDescr : "Udvidet beskrivelse", +DlgGenClass : "Typografiark", +DlgGenTitle : "Titel", +DlgGenContType : "Indholdstype", +DlgGenLinkCharset : "Tegnsæt", +DlgGenStyle : "Typografi", + +// Image Dialog +DlgImgTitle : "Egenskaber for billede", +DlgImgInfoTab : "Generelt", +DlgImgBtnUpload : "Upload", +DlgImgURL : "URL", +DlgImgUpload : "Upload", +DlgImgAlt : "Alternativ tekst", +DlgImgWidth : "Bredde", +DlgImgHeight : "Højde", +DlgImgLockRatio : "Lås størrelsesforhold", +DlgBtnResetSize : "Nulstil størrelse", +DlgImgBorder : "Ramme", +DlgImgHSpace : "HMargen", +DlgImgVSpace : "VMargen", +DlgImgAlign : "Justering", +DlgImgAlignLeft : "Venstre", +DlgImgAlignAbsBottom: "Absolut nederst", +DlgImgAlignAbsMiddle: "Absolut centreret", +DlgImgAlignBaseline : "Grundlinje", +DlgImgAlignBottom : "Nederst", +DlgImgAlignMiddle : "Centreret", +DlgImgAlignRight : "Højre", +DlgImgAlignTextTop : "Toppen af teksten", +DlgImgAlignTop : "Øverst", +DlgImgPreview : "Vis eksempel", +DlgImgAlertUrl : "Indtast stien til billedet", +DlgImgLinkTab : "Hyperlink", + +// Flash Dialog +DlgFlashTitle : "Egenskaber for Flash", +DlgFlashChkPlay : "Automatisk afspilning", +DlgFlashChkLoop : "Gentagelse", +DlgFlashChkMenu : "Vis Flash menu", +DlgFlashScale : "Skalér", +DlgFlashScaleAll : "Vis alt", +DlgFlashScaleNoBorder : "Ingen ramme", +DlgFlashScaleFit : "Tilpas størrelse", + +// Link Dialog +DlgLnkWindowTitle : "Egenskaber for hyperlink", +DlgLnkInfoTab : "Generelt", +DlgLnkTargetTab : "Mål", + +DlgLnkType : "Hyperlink type", +DlgLnkTypeURL : "URL", +DlgLnkTypeAnchor : "Bogmærke på denne side", +DlgLnkTypeEMail : "E-mail", +DlgLnkProto : "Protokol", +DlgLnkProtoOther : "", +DlgLnkURL : "URL", +DlgLnkAnchorSel : "Vælg et anker", +DlgLnkAnchorByName : "Efter anker navn", +DlgLnkAnchorById : "Efter element Id", +DlgLnkNoAnchors : "(Ingen bogmærker dokumentet)", +DlgLnkEMail : "E-mailadresse", +DlgLnkEMailSubject : "Emne", +DlgLnkEMailBody : "Brødtekst", +DlgLnkUpload : "Upload", +DlgLnkBtnUpload : "Upload", + +DlgLnkTarget : "Mål", +DlgLnkTargetFrame : "", +DlgLnkTargetPopup : "", +DlgLnkTargetBlank : "Nyt vindue (_blank)", +DlgLnkTargetParent : "Overordnet ramme (_parent)", +DlgLnkTargetSelf : "Samme vindue (_self)", +DlgLnkTargetTop : "Hele vinduet (_top)", +DlgLnkTargetFrameName : "Destinationsvinduets navn", +DlgLnkPopWinName : "Pop-up vinduets navn", +DlgLnkPopWinFeat : "Egenskaber for pop-up", +DlgLnkPopResize : "Skalering", +DlgLnkPopLocation : "Adresselinje", +DlgLnkPopMenu : "Menulinje", +DlgLnkPopScroll : "Scrollbars", +DlgLnkPopStatus : "Statuslinje", +DlgLnkPopToolbar : "Værktøjslinje", +DlgLnkPopFullScrn : "Fuld skærm (IE)", +DlgLnkPopDependent : "Koblet/dependent (Netscape)", +DlgLnkPopWidth : "Bredde", +DlgLnkPopHeight : "Højde", +DlgLnkPopLeft : "Position fra venstre", +DlgLnkPopTop : "Position fra toppen", + +DlnLnkMsgNoUrl : "Indtast hyperlink URL!", +DlnLnkMsgNoEMail : "Indtast e-mailaddresse!", +DlnLnkMsgNoAnchor : "Vælg bogmærke!", +DlnLnkMsgInvPopName : "The popup name must begin with an alphabetic character and must not contain spaces", //MISSING + +// Color Dialog +DlgColorTitle : "Vælg farve", +DlgColorBtnClear : "Nulstil", +DlgColorHighlight : "Markeret", +DlgColorSelected : "Valgt", + +// Smiley Dialog +DlgSmileyTitle : "Vælg smiley", + +// Special Character Dialog +DlgSpecialCharTitle : "Vælg symbol", + +// Table Dialog +DlgTableTitle : "Egenskaber for tabel", +DlgTableRows : "Rækker", +DlgTableColumns : "Kolonner", +DlgTableBorder : "Rammebredde", +DlgTableAlign : "Justering", +DlgTableAlignNotSet : "", +DlgTableAlignLeft : "Venstrestillet", +DlgTableAlignCenter : "Centreret", +DlgTableAlignRight : "Højrestillet", +DlgTableWidth : "Bredde", +DlgTableWidthPx : "pixels", +DlgTableWidthPc : "procent", +DlgTableHeight : "Højde", +DlgTableCellSpace : "Celleafstand", +DlgTableCellPad : "Cellemargen", +DlgTableCaption : "Titel", +DlgTableSummary : "Resume", + +// Table Cell Dialog +DlgCellTitle : "Egenskaber for celle", +DlgCellWidth : "Bredde", +DlgCellWidthPx : "pixels", +DlgCellWidthPc : "procent", +DlgCellHeight : "Højde", +DlgCellWordWrap : "Orddeling", +DlgCellWordWrapNotSet : "", +DlgCellWordWrapYes : "Ja", +DlgCellWordWrapNo : "Nej", +DlgCellHorAlign : "Vandret justering", +DlgCellHorAlignNotSet : "", +DlgCellHorAlignLeft : "Venstrestillet", +DlgCellHorAlignCenter : "Centreret", +DlgCellHorAlignRight: "Højrestillet", +DlgCellVerAlign : "Lodret justering", +DlgCellVerAlignNotSet : "", +DlgCellVerAlignTop : "Øverst", +DlgCellVerAlignMiddle : "Centreret", +DlgCellVerAlignBottom : "Nederst", +DlgCellVerAlignBaseline : "Grundlinje", +DlgCellRowSpan : "Højde i antal rækker", +DlgCellCollSpan : "Bredde i antal kolonner", +DlgCellBackColor : "Baggrundsfarve", +DlgCellBorderColor : "Rammefarve", +DlgCellBtnSelect : "Vælg...", + +// Find and Replace Dialog +DlgFindAndReplaceTitle : "Find and Replace", //MISSING + +// Find Dialog +DlgFindTitle : "Find", +DlgFindFindBtn : "Find", +DlgFindNotFoundMsg : "Søgeteksten blev ikke fundet!", + +// Replace Dialog +DlgReplaceTitle : "Erstat", +DlgReplaceFindLbl : "Søg efter:", +DlgReplaceReplaceLbl : "Erstat med:", +DlgReplaceCaseChk : "Forskel på store og små bogstaver", +DlgReplaceReplaceBtn : "Erstat", +DlgReplaceReplAllBtn : "Erstat alle", +DlgReplaceWordChk : "Kun hele ord", + +// Paste Operations / Dialog +PasteErrorCut : "Din browsers sikkerhedsindstillinger tillader ikke editoren at klippe tekst automatisk!
        Brug i stedet tastaturet til at klippe teksten (Ctrl+X).", +PasteErrorCopy : "Din browsers sikkerhedsindstillinger tillader ikke editoren at kopiere tekst automatisk!
        Brug i stedet tastaturet til at kopiere teksten (Ctrl+C).", + +PasteAsText : "Indsæt som ikke-formateret tekst", +PasteFromWord : "Indsæt fra Word", + +DlgPasteMsg2 : "Indsæt i feltet herunder (Ctrl+V) og klik OK.", +DlgPasteSec : "Because of your browser security settings, the editor is not able to access your clipboard data directly. You are required to paste it again in this window.", //MISSING +DlgPasteIgnoreFont : "Ignorer font definitioner", +DlgPasteRemoveStyles : "Ignorer typografi", + +// Color Picker +ColorAutomatic : "Automatisk", +ColorMoreColors : "Flere farver...", + +// Document Properties +DocProps : "Egenskaber for dokument", + +// Anchor Dialog +DlgAnchorTitle : "Egenskaber for bogmærke", +DlgAnchorName : "Bogmærke navn", +DlgAnchorErrorName : "Indtast bogmærke navn!", + +// Speller Pages Dialog +DlgSpellNotInDic : "Ikke i ordbogen", +DlgSpellChangeTo : "Forslag", +DlgSpellBtnIgnore : "Ignorer", +DlgSpellBtnIgnoreAll : "Ignorer alle", +DlgSpellBtnReplace : "Erstat", +DlgSpellBtnReplaceAll : "Erstat alle", +DlgSpellBtnUndo : "Tilbage", +DlgSpellNoSuggestions : "- ingen forslag -", +DlgSpellProgress : "Stavekontrolen arbejder...", +DlgSpellNoMispell : "Stavekontrol færdig: Ingen fejl fundet", +DlgSpellNoChanges : "Stavekontrol færdig: Ingen ord ændret", +DlgSpellOneChange : "Stavekontrol færdig: Et ord ændret", +DlgSpellManyChanges : "Stavekontrol færdig: %1 ord ændret", + +IeSpellDownload : "Stavekontrol ikke installeret.
        Vil du hente den nu?", + +// Button Dialog +DlgButtonText : "Tekst", +DlgButtonType : "Type", +DlgButtonTypeBtn : "Button", //MISSING +DlgButtonTypeSbm : "Submit", //MISSING +DlgButtonTypeRst : "Reset", //MISSING + +// Checkbox and Radio Button Dialogs +DlgCheckboxName : "Navn", +DlgCheckboxValue : "Værdi", +DlgCheckboxSelected : "Valgt", + +// Form Dialog +DlgFormName : "Navn", +DlgFormAction : "Handling", +DlgFormMethod : "Metod", + +// Select Field Dialog +DlgSelectName : "Navn", +DlgSelectValue : "Værdi", +DlgSelectSize : "Størrelse", +DlgSelectLines : "linier", +DlgSelectChkMulti : "Tillad flere valg", +DlgSelectOpAvail : "Valgmuligheder", +DlgSelectOpText : "Tekst", +DlgSelectOpValue : "Værdi", +DlgSelectBtnAdd : "Tilføj", +DlgSelectBtnModify : "Rediger", +DlgSelectBtnUp : "Op", +DlgSelectBtnDown : "Ned", +DlgSelectBtnSetValue : "Sæt som valgt", +DlgSelectBtnDelete : "Slet", + +// Textarea Dialog +DlgTextareaName : "Navn", +DlgTextareaCols : "Kolonner", +DlgTextareaRows : "Rækker", + +// Text Field Dialog +DlgTextName : "Navn", +DlgTextValue : "Værdi", +DlgTextCharWidth : "Bredde (tegn)", +DlgTextMaxChars : "Max antal tegn", +DlgTextType : "Type", +DlgTextTypeText : "Tekst", +DlgTextTypePass : "Adgangskode", + +// Hidden Field Dialog +DlgHiddenName : "Navn", +DlgHiddenValue : "Værdi", + +// Bulleted List Dialog +BulletedListProp : "Egenskaber for punktopstilling", +NumberedListProp : "Egenskaber for talopstilling", +DlgLstStart : "Start", //MISSING +DlgLstType : "Type", +DlgLstTypeCircle : "Cirkel", +DlgLstTypeDisc : "Udfyldt cirkel", +DlgLstTypeSquare : "Firkant", +DlgLstTypeNumbers : "Nummereret (1, 2, 3)", +DlgLstTypeLCase : "Små bogstaver (a, b, c)", +DlgLstTypeUCase : "Store bogstaver (A, B, C)", +DlgLstTypeSRoman : "Små romertal (i, ii, iii)", +DlgLstTypeLRoman : "Store romertal (I, II, III)", + +// Document Properties Dialog +DlgDocGeneralTab : "Generelt", +DlgDocBackTab : "Baggrund", +DlgDocColorsTab : "Farver og margen", +DlgDocMetaTab : "Metadata", + +DlgDocPageTitle : "Sidetitel", +DlgDocLangDir : "Sprog", +DlgDocLangDirLTR : "Fra venstre mod højre (LTR)", +DlgDocLangDirRTL : "Fra højre mod venstre (RTL)", +DlgDocLangCode : "Landekode", +DlgDocCharSet : "Tegnsæt kode", +DlgDocCharSetCE : "Central European", //MISSING +DlgDocCharSetCT : "Chinese Traditional (Big5)", //MISSING +DlgDocCharSetCR : "Cyrillic", //MISSING +DlgDocCharSetGR : "Greek", //MISSING +DlgDocCharSetJP : "Japanese", //MISSING +DlgDocCharSetKR : "Korean", //MISSING +DlgDocCharSetTR : "Turkish", //MISSING +DlgDocCharSetUN : "Unicode (UTF-8)", //MISSING +DlgDocCharSetWE : "Western European", //MISSING +DlgDocCharSetOther : "Anden tegnsæt kode", + +DlgDocDocType : "Dokumenttype kategori", +DlgDocDocTypeOther : "Anden dokumenttype kategori", +DlgDocIncXHTML : "Inkludere XHTML deklartion", +DlgDocBgColor : "Baggrundsfarve", +DlgDocBgImage : "Baggrundsbillede URL", +DlgDocBgNoScroll : "Fastlåst baggrund", +DlgDocCText : "Tekst", +DlgDocCLink : "Hyperlink", +DlgDocCVisited : "Besøgt hyperlink", +DlgDocCActive : "Aktivt hyperlink", +DlgDocMargins : "Sidemargen", +DlgDocMaTop : "Øverst", +DlgDocMaLeft : "Venstre", +DlgDocMaRight : "Højre", +DlgDocMaBottom : "Nederst", +DlgDocMeIndex : "Dokument index nøgleord (kommasepareret)", +DlgDocMeDescr : "Dokument beskrivelse", +DlgDocMeAuthor : "Forfatter", +DlgDocMeCopy : "Copyright", +DlgDocPreview : "Vis", + +// Templates Dialog +Templates : "Skabeloner", +DlgTemplatesTitle : "Indholdsskabeloner", +DlgTemplatesSelMsg : "Vælg den skabelon, som skal åbnes i editoren.
        (Nuværende indhold vil blive overskrevet!):", +DlgTemplatesLoading : "Henter liste over skabeloner...", +DlgTemplatesNoTpl : "(Der er ikke defineret nogen skabelon!)", +DlgTemplatesReplace : "Replace actual contents", //MISSING + +// About Dialog +DlgAboutAboutTab : "Om", +DlgAboutBrowserInfoTab : "Generelt", +DlgAboutLicenseTab : "Licens", +DlgAboutVersion : "version", +DlgAboutInfo : "For yderlig information gå til" +}; Property changes on: announcement/trunk/src/main/webapp/fckeditor/editor/lang/da.js ___________________________________________________________________ Name: svn:eol-style + native Added: announcement/trunk/src/main/webapp/fckeditor/editor/lang/de.js =================================================================== --- announcement/trunk/src/main/webapp/fckeditor/editor/lang/de.js (rev 0) +++ announcement/trunk/src/main/webapp/fckeditor/editor/lang/de.js 2008-06-30 02:54:27 UTC (rev 1002) @@ -0,0 +1,515 @@ +?/* + * FCKeditor - The text editor for Internet - http://www.fckeditor.net + * Copyright (C) 2003-2008 Frederico Caldeira Knabben + * + * == BEGIN LICENSE == + * + * Licensed under the terms of any of the following licenses at your + * choice: + * + * - GNU General Public License Version 2 or later (the "GPL") + * http://www.gnu.org/licenses/gpl.html + * + * - GNU Lesser General Public License Version 2.1 or later (the "LGPL") + * http://www.gnu.org/licenses/lgpl.html + * + * - Mozilla Public License Version 1.1 or later (the "MPL") + * http://www.mozilla.org/MPL/MPL-1.1.html + * + * == END LICENSE == + * + * German language file. + */ + +var FCKLang = +{ +// Language direction : "ltr" (left to right) or "rtl" (right to left). +Dir : "ltr", + +ToolbarCollapse : "Symbolleiste einklappen", +ToolbarExpand : "Symbolleiste ausklappen", + +// Toolbar Items and Context Menu +Save : "Speichern", +NewPage : "Neue Seite", +Preview : "Vorschau", +Cut : "Ausschneiden", +Copy : "Kopieren", +Paste : "Einfügen", +PasteText : "aus Textdatei einfügen", +PasteWord : "aus MS-Word einfügen", +Print : "Drucken", +SelectAll : "Alles auswählen", +RemoveFormat : "Formatierungen entfernen", +InsertLinkLbl : "Link", +InsertLink : "Link einfügen/editieren", +RemoveLink : "Link entfernen", +Anchor : "Anker einfügen/editieren", +AnchorDelete : "Anker entfernen", +InsertImageLbl : "Bild", +InsertImage : "Bild einfügen/editieren", +InsertFlashLbl : "Flash", +InsertFlash : "Flash einfügen/editieren", +InsertTableLbl : "Tabelle", +InsertTable : "Tabelle einfügen/editieren", +InsertLineLbl : "Linie", +InsertLine : "Horizontale Linie einfügen", +InsertSpecialCharLbl: "Sonderzeichen", +InsertSpecialChar : "Sonderzeichen einfügen/editieren", +InsertSmileyLbl : "Smiley", +InsertSmiley : "Smiley einfügen", +About : "Über FCKeditor", +Bold : "Fett", +Italic : "Kursiv", +Underline : "Unterstrichen", +StrikeThrough : "Durchgestrichen", +Subscript : "Tiefgestellt", +Superscript : "Hochgestellt", +LeftJustify : "Linksbündig", +CenterJustify : "Zentriert", +RightJustify : "Rechtsbündig", +BlockJustify : "Blocksatz", +DecreaseIndent : "Einzug verringern", +IncreaseIndent : "Einzug erhöhen", +Blockquote : "Zitatblock", +Undo : "Rückgängig", +Redo : "Wiederherstellen", +NumberedListLbl : "Nummerierte Liste", +NumberedList : "Nummerierte Liste einfügen/entfernen", +BulletedListLbl : "Liste", +BulletedList : "Liste einfügen/entfernen", +ShowTableBorders : "Zeige Tabellenrahmen", +ShowDetails : "Zeige Details", +Style : "Stil", +FontFormat : "Format", +Font : "Schriftart", +FontSize : "Größe", +TextColor : "Textfarbe", +BGColor : "Hintergrundfarbe", +Source : "Quellcode", +Find : "Suchen", +Replace : "Ersetzen", +SpellCheck : "Rechtschreibprüfung", +UniversalKeyboard : "Universal-Tastatur", +PageBreakLbl : "Seitenumbruch", +PageBreak : "Seitenumbruch einfügen", + +Form : "Formular", +Checkbox : "Checkbox", +RadioButton : "Radiobutton", +TextField : "Textfeld einzeilig", +Textarea : "Textfeld mehrzeilig", +HiddenField : "verstecktes Feld", +Button : "Klickbutton", +SelectionField : "Auswahlfeld", +ImageButton : "Bildbutton", + +FitWindow : "Editor maximieren", +ShowBlocks : "Blöcke anzeigen", + +// Context Menu +EditLink : "Link editieren", +CellCM : "Zelle", +RowCM : "Zeile", +ColumnCM : "Spalte", +InsertRowAfter : "Zeile unterhalb einfügen", +InsertRowBefore : "Zeile oberhalb einfügen", +DeleteRows : "Zeile entfernen", +InsertColumnAfter : "Spalte rechts danach einfügen", +InsertColumnBefore : "Spalte links davor einfügen", +DeleteColumns : "Spalte löschen", +InsertCellAfter : "Zelle danach einfügen", +InsertCellBefore : "Zelle davor einfügen", +DeleteCells : "Zelle löschen", +MergeCells : "Zellen verbinden", +MergeRight : "nach rechts verbinden", +MergeDown : "nach unten verbinden", +HorizontalSplitCell : "Zelle horizontal teilen", +VerticalSplitCell : "Zelle vertikal teilen", +TableDelete : "Tabelle löschen", +CellProperties : "Zellen-Eigenschaften", +TableProperties : "Tabellen-Eigenschaften", +ImageProperties : "Bild-Eigenschaften", +FlashProperties : "Flash-Eigenschaften", + +AnchorProp : "Anker-Eigenschaften", +ButtonProp : "Button-Eigenschaften", +CheckboxProp : "Checkbox-Eigenschaften", +HiddenFieldProp : "Verstecktes Feld-Eigenschaften", +RadioButtonProp : "Optionsfeld-Eigenschaften", +ImageButtonProp : "Bildbutton-Eigenschaften", +TextFieldProp : "Textfeld (einzeilig) Eigenschaften", +SelectionFieldProp : "Auswahlfeld-Eigenschaften", +TextareaProp : "Textfeld (mehrzeilig) Eigenschaften", +FormProp : "Formular-Eigenschaften", + +FontFormats : "Normal;Formatiert;Addresse;Überschrift 1;Überschrift 2;Überschrift 3;Überschrift 4;Überschrift 5;Überschrift 6;Normal (DIV)", + +// Alerts and Messages +ProcessingXHTML : "Bearbeite XHTML. Bitte warten...", +Done : "Fertig", +PasteWordConfirm : "Der Text, den Sie einfügen möchten, scheint aus MS-Word kopiert zu sein. Möchten Sie ihn zuvor bereinigen lassen?", +NotCompatiblePaste : "Diese Funktion steht nur im Internet Explorer ab Version 5.5 zur Verfügung. Möchten Sie den Text unbereinigt einfügen?", +UnknownToolbarItem : "Unbekanntes Menüleisten-Objekt \"%1\"", +UnknownCommand : "Unbekannter Befehl \"%1\"", +NotImplemented : "Befehl nicht implementiert", +UnknownToolbarSet : "Menüleiste \"%1\" existiert nicht", +NoActiveX : "Die Sicherheitseinstellungen Ihres Browsers beschränken evtl. einige Funktionen des Editors. Aktivieren Sie die Option \"ActiveX-Steuerelemente und Plugins ausführen\" in den Sicherheitseinstellungen, um diese Funktionen nutzen zu können", +BrowseServerBlocked : "Ein Auswahlfenster konnte nicht geöffnet werden. Stellen Sie sicher, das alle Popup-Blocker ausgeschaltet sind.", +DialogBlocked : "Das Dialog-Fenster konnte nicht geöffnet werden. Stellen Sie sicher, das alle Popup-Blocker ausgeschaltet sind.", + +// Dialogs +DlgBtnOK : "OK", +DlgBtnCancel : "Abbrechen", +DlgBtnClose : "Schließen", +DlgBtnBrowseServer : "Server durchsuchen", +DlgAdvancedTag : "Erweitert", +DlgOpOther : "", +DlgInfoTab : "Info", +DlgAlertUrl : "Bitte tragen Sie die URL ein", + +// General Dialogs Labels +DlgGenNotSet : "", +DlgGenId : "ID", +DlgGenLangDir : "Schreibrichtung", +DlgGenLangDirLtr : "Links nach Rechts (LTR)", +DlgGenLangDirRtl : "Rechts nach Links (RTL)", +DlgGenLangCode : "Sprachenkürzel", +DlgGenAccessKey : "Zugriffstaste", +DlgGenName : "Name", +DlgGenTabIndex : "Tab-Index", +DlgGenLongDescr : "Langform URL", +DlgGenClass : "Stylesheet Klasse", +DlgGenTitle : "Titel Beschreibung", +DlgGenContType : "Inhaltstyp", +DlgGenLinkCharset : "Ziel-Zeichensatz", +DlgGenStyle : "Style", + +// Image Dialog +DlgImgTitle : "Bild-Eigenschaften", +DlgImgInfoTab : "Bild-Info", +DlgImgBtnUpload : "Zum Server senden", +DlgImgURL : "Bildauswahl", +DlgImgUpload : "Upload", +DlgImgAlt : "Alternativer Text", +DlgImgWidth : "Breite", +DlgImgHeight : "Höhe", +DlgImgLockRatio : "Größenverhältniss beibehalten", +DlgBtnResetSize : "Größe zurücksetzen", +DlgImgBorder : "Rahmen", +DlgImgHSpace : "H-Abstand", +DlgImgVSpace : "V-Abstand", +DlgImgAlign : "Ausrichtung", +DlgImgAlignLeft : "Links", +DlgImgAlignAbsBottom: "Abs Unten", +DlgImgAlignAbsMiddle: "Abs Mitte", +DlgImgAlignBaseline : "Baseline", +DlgImgAlignBottom : "Unten", +DlgImgAlignMiddle : "Mitte", +DlgImgAlignRight : "Rechts", +DlgImgAlignTextTop : "Text Oben", +DlgImgAlignTop : "Oben", +DlgImgPreview : "Vorschau", +DlgImgAlertUrl : "Bitte geben Sie die Bild-URL an", +DlgImgLinkTab : "Link", + +// Flash Dialog +DlgFlashTitle : "Flash-Eigenschaften", +DlgFlashChkPlay : "autom. Abspielen", +DlgFlashChkLoop : "Endlosschleife", +DlgFlashChkMenu : "Flash-Menü aktivieren", +DlgFlashScale : "Skalierung", +DlgFlashScaleAll : "Alles anzeigen", +DlgFlashScaleNoBorder : "ohne Rand", +DlgFlashScaleFit : "Passgenau", + +// Link Dialog +DlgLnkWindowTitle : "Link", +DlgLnkInfoTab : "Link-Info", +DlgLnkTargetTab : "Zielseite", + +DlgLnkType : "Link-Typ", +DlgLnkTypeURL : "URL", +DlgLnkTypeAnchor : "Anker in dieser Seite", +DlgLnkTypeEMail : "E-Mail", +DlgLnkProto : "Protokoll", +DlgLnkProtoOther : "", +DlgLnkURL : "URL", +DlgLnkAnchorSel : "Anker auswählen", +DlgLnkAnchorByName : "nach Anker Name", +DlgLnkAnchorById : "nach Element Id", +DlgLnkNoAnchors : "(keine Anker im Dokument vorhanden)", +DlgLnkEMail : "E-Mail Addresse", +DlgLnkEMailSubject : "Betreffzeile", +DlgLnkEMailBody : "Nachrichtentext", +DlgLnkUpload : "Upload", +DlgLnkBtnUpload : "Zum Server senden", + +DlgLnkTarget : "Zielseite", +DlgLnkTargetFrame : "", +DlgLnkTargetPopup : "", +DlgLnkTargetBlank : "Neues Fenster (_blank)", +DlgLnkTargetParent : "Oberes Fenster (_parent)", +DlgLnkTargetSelf : "Gleiches Fenster (_self)", +DlgLnkTargetTop : "Oberstes Fenster (_top)", +DlgLnkTargetFrameName : "Ziel-Fenster-Name", +DlgLnkPopWinName : "Pop-up Fenster-Name", +DlgLnkPopWinFeat : "Pop-up Fenster-Eigenschaften", +DlgLnkPopResize : "Vergrößerbar", +DlgLnkPopLocation : "Adress-Leiste", +DlgLnkPopMenu : "Menü-Leiste", +DlgLnkPopScroll : "Rollbalken", +DlgLnkPopStatus : "Statusleiste", +DlgLnkPopToolbar : "Werkzeugleiste", +DlgLnkPopFullScrn : "Vollbild (IE)", +DlgLnkPopDependent : "Abhängig (Netscape)", +DlgLnkPopWidth : "Breite", +DlgLnkPopHeight : "Höhe", +DlgLnkPopLeft : "Linke Position", +DlgLnkPopTop : "Obere Position", + +DlnLnkMsgNoUrl : "Bitte geben Sie die Link-URL an", +DlnLnkMsgNoEMail : "Bitte geben Sie e-Mail Adresse an", +DlnLnkMsgNoAnchor : "Bitte wählen Sie einen Anker aus", +DlnLnkMsgInvPopName : "Der Name des Popups muss mit einem Buchstaben beginnen und darf keine Leerzeichen enthalten", + +// Color Dialog +DlgColorTitle : "Farbauswahl", +DlgColorBtnClear : "Keine Farbe", +DlgColorHighlight : "Vorschau", +DlgColorSelected : "Ausgewählt", + +// Smiley Dialog +DlgSmileyTitle : "Smiley auswählen", + +// Special Character Dialog +DlgSpecialCharTitle : "Sonderzeichen auswählen", + +// Table Dialog +DlgTableTitle : "Tabellen-Eigenschaften", +DlgTableRows : "Zeile", +DlgTableColumns : "Spalte", +DlgTableBorder : "Rahmen", +DlgTableAlign : "Ausrichtung", +DlgTableAlignNotSet : "", +DlgTableAlignLeft : "Links", +DlgTableAlignCenter : "Zentriert", +DlgTableAlignRight : "Rechts", +DlgTableWidth : "Breite", +DlgTableWidthPx : "Pixel", +DlgTableWidthPc : "%", +DlgTableHeight : "Höhe", +DlgTableCellSpace : "Zellenabstand außen", +DlgTableCellPad : "Zellenabstand innen", +DlgTableCaption : "Überschrift", +DlgTableSummary : "Inhaltsübersicht", + +// Table Cell Dialog +DlgCellTitle : "Zellen-Eigenschaften", +DlgCellWidth : "Breite", +DlgCellWidthPx : "Pixel", +DlgCellWidthPc : "%", +DlgCellHeight : "Höhe", +DlgCellWordWrap : "Umbruch", +DlgCellWordWrapNotSet : "", +DlgCellWordWrapYes : "Ja", +DlgCellWordWrapNo : "Nein", +DlgCellHorAlign : "Horizontale Ausrichtung", +DlgCellHorAlignNotSet : "", +DlgCellHorAlignLeft : "Links", +DlgCellHorAlignCenter : "Zentriert", +DlgCellHorAlignRight: "Rechts", +DlgCellVerAlign : "Vertikale Ausrichtung", +DlgCellVerAlignNotSet : "", +DlgCellVerAlignTop : "Oben", +DlgCellVerAlignMiddle : "Mitte", +DlgCellVerAlignBottom : "Unten", +DlgCellVerAlignBaseline : "Grundlinie", +DlgCellRowSpan : "Zeilen zusammenfassen", +DlgCellCollSpan : "Spalten zusammenfassen", +DlgCellBackColor : "Hintergrundfarbe", +DlgCellBorderColor : "Rahmenfarbe", +DlgCellBtnSelect : "Auswahl...", + +// Find and Replace Dialog +DlgFindAndReplaceTitle : "Suchen und Ersetzen", + +// Find Dialog +DlgFindTitle : "Finden", +DlgFindFindBtn : "Finden", +DlgFindNotFoundMsg : "Der gesuchte Text wurde nicht gefunden.", + +// Replace Dialog +DlgReplaceTitle : "Ersetzen", +DlgReplaceFindLbl : "Suche nach:", +DlgReplaceReplaceLbl : "Ersetze mit:", +DlgReplaceCaseChk : "Groß-Kleinschreibung beachten", +DlgReplaceReplaceBtn : "Ersetzen", +DlgReplaceReplAllBtn : "Alle Ersetzen", +DlgReplaceWordChk : "Nur ganze Worte suchen", + +// Paste Operations / Dialog +PasteErrorCut : "Die Sicherheitseinstellungen Ihres Browsers lassen es nicht zu, den Text automatisch auszuschneiden. Bitte benutzen Sie die System-Zwischenablage über STRG-X (ausschneiden) und STRG-V (einfügen).", +PasteErrorCopy : "Die Sicherheitseinstellungen Ihres Browsers lassen es nicht zu, den Text automatisch kopieren. Bitte benutzen Sie die System-Zwischenablage über STRG-C (kopieren).", + +PasteAsText : "Als Text einfügen", +PasteFromWord : "Aus Word einfügen", + +DlgPasteMsg2 : "Bitte fügen Sie den Text in der folgenden Box über die Tastatur (mit Strg+V) ein und bestätigen Sie mit OK.", +DlgPasteSec : "Aufgrund von Sicherheitsbeschränkungen Ihres Browsers kann der Editor nicht direkt auf die Zwischenablage zugreifen. Bitte fügen Sie den Inhalt erneut in diesem Fenster ein.", +DlgPasteIgnoreFont : "Ignoriere Schriftart-Definitionen", +DlgPasteRemoveStyles : "Entferne Style-Definitionen", + +// Color Picker +ColorAutomatic : "Automatisch", +ColorMoreColors : "Weitere Farben...", + +// Document Properties +DocProps : "Dokument-Eigenschaften", + +// Anchor Dialog +DlgAnchorTitle : "Anker-Eigenschaften", +DlgAnchorName : "Anker Name", +DlgAnchorErrorName : "Bitte geben Sie den Namen des Ankers ein", + +// Speller Pages Dialog +DlgSpellNotInDic : "Nicht im Wörterbuch", +DlgSpellChangeTo : "Ändern in", +DlgSpellBtnIgnore : "Ignorieren", +DlgSpellBtnIgnoreAll : "Alle Ignorieren", +DlgSpellBtnReplace : "Ersetzen", +DlgSpellBtnReplaceAll : "Alle Ersetzen", +DlgSpellBtnUndo : "Rückgängig", +DlgSpellNoSuggestions : " - keine Vorschläge - ", +DlgSpellProgress : "Rechtschreibprüfung läuft...", +DlgSpellNoMispell : "Rechtschreibprüfung abgeschlossen - keine Fehler gefunden", +DlgSpellNoChanges : "Rechtschreibprüfung abgeschlossen - keine Worte geändert", +DlgSpellOneChange : "Rechtschreibprüfung abgeschlossen - ein Wort geändert", +DlgSpellManyChanges : "Rechtschreibprüfung abgeschlossen - %1 Wörter geändert", + +IeSpellDownload : "Rechtschreibprüfung nicht installiert. Möchten Sie sie jetzt herunterladen?", + +// Button Dialog +DlgButtonText : "Text (Wert)", +DlgButtonType : "Typ", +DlgButtonTypeBtn : "Button", +DlgButtonTypeSbm : "Absenden", +DlgButtonTypeRst : "Zurücksetzen", + +// Checkbox and Radio Button Dialogs +DlgCheckboxName : "Name", +DlgCheckboxValue : "Wert", +DlgCheckboxSelected : "ausgewählt", + +// Form Dialog +DlgFormName : "Name", +DlgFormAction : "Action", +DlgFormMethod : "Method", + +// Select Field Dialog +DlgSelectName : "Name", +DlgSelectValue : "Wert", +DlgSelectSize : "Größe", +DlgSelectLines : "Linien", +DlgSelectChkMulti : "Erlaube Mehrfachauswahl", +DlgSelectOpAvail : "Mögliche Optionen", +DlgSelectOpText : "Text", +DlgSelectOpValue : "Wert", +DlgSelectBtnAdd : "Hinzufügen", +DlgSelectBtnModify : "Ändern", +DlgSelectBtnUp : "Hoch", +DlgSelectBtnDown : "Runter", +DlgSelectBtnSetValue : "Setze als Standardwert", +DlgSelectBtnDelete : "Entfernen", + +// Textarea Dialog +DlgTextareaName : "Name", +DlgTextareaCols : "Spalten", +DlgTextareaRows : "Reihen", + +// Text Field Dialog +DlgTextName : "Name", +DlgTextValue : "Wert", +DlgTextCharWidth : "Zeichenbreite", +DlgTextMaxChars : "Max. Zeichen", +DlgTextType : "Typ", +DlgTextTypeText : "Text", +DlgTextTypePass : "Passwort", + +// Hidden Field Dialog +DlgHiddenName : "Name", +DlgHiddenValue : "Wert", + +// Bulleted List Dialog +BulletedListProp : "Listen-Eigenschaften", +NumberedListProp : "Nummerierte Listen-Eigenschaften", +DlgLstStart : "Start", +DlgLstType : "Typ", +DlgLstTypeCircle : "Ring", +DlgLstTypeDisc : "Kreis", +DlgLstTypeSquare : "Quadrat", +DlgLstTypeNumbers : "Nummern (1, 2, 3)", +DlgLstTypeLCase : "Kleinbuchstaben (a, b, c)", +DlgLstTypeUCase : "Großbuchstaben (A, B, C)", +DlgLstTypeSRoman : "Kleine römische Zahlen (i, ii, iii)", +DlgLstTypeLRoman : "Große römische Zahlen (I, II, III)", + +// Document Properties Dialog +DlgDocGeneralTab : "Allgemein", +DlgDocBackTab : "Hintergrund", +DlgDocColorsTab : "Farben und Abstände", +DlgDocMetaTab : "Metadaten", + +DlgDocPageTitle : "Seitentitel", +DlgDocLangDir : "Schriftrichtung", +DlgDocLangDirLTR : "Links nach Rechts", +DlgDocLangDirRTL : "Rechts nach Links", +DlgDocLangCode : "Sprachkürzel", +DlgDocCharSet : "Zeichenkodierung", +DlgDocCharSetCE : "Zentraleuropäisch", +DlgDocCharSetCT : "traditionell Chinesisch (Big5)", +DlgDocCharSetCR : "Kyrillisch", +DlgDocCharSetGR : "Griechisch", +DlgDocCharSetJP : "Japanisch", +DlgDocCharSetKR : "Koreanisch", +DlgDocCharSetTR : "Türkisch", +DlgDocCharSetUN : "Unicode (UTF-8)", +DlgDocCharSetWE : "Westeuropäisch", +DlgDocCharSetOther : "Andere Zeichenkodierung", + +DlgDocDocType : "Dokumententyp", +DlgDocDocTypeOther : "Anderer Dokumententyp", +DlgDocIncXHTML : "Beziehe XHTML Deklarationen ein", +DlgDocBgColor : "Hintergrundfarbe", +DlgDocBgImage : "Hintergrundbild URL", +DlgDocBgNoScroll : "feststehender Hintergrund", +DlgDocCText : "Text", +DlgDocCLink : "Link", +DlgDocCVisited : "Besuchter Link", +DlgDocCActive : "Aktiver Link", +DlgDocMargins : "Seitenränder", +DlgDocMaTop : "Oben", +DlgDocMaLeft : "Links", +DlgDocMaRight : "Rechts", +DlgDocMaBottom : "Unten", +DlgDocMeIndex : "Schlüsselwörter (durch Komma getrennt)", +DlgDocMeDescr : "Dokument-Beschreibung", +DlgDocMeAuthor : "Autor", +DlgDocMeCopy : "Copyright", +DlgDocPreview : "Vorschau", + +// Templates Dialog +Templates : "Vorlagen", +DlgTemplatesTitle : "Vorlagen", +DlgTemplatesSelMsg : "Klicken Sie auf eine Vorlage, um sie im Editor zu öffnen (der aktuelle Inhalt wird dabei gelöscht!):", +DlgTemplatesLoading : "Liste der Vorlagen wird geladen. Bitte warten...", +DlgTemplatesNoTpl : "(keine Vorlagen definiert)", +DlgTemplatesReplace : "Aktuellen Inhalt ersetzen", + +// About Dialog +DlgAboutAboutTab : "Über", +DlgAboutBrowserInfoTab : "Browser-Info", +DlgAboutLicenseTab : "Lizenz", +DlgAboutVersion : "Version", +DlgAboutInfo : "Für weitere Informationen siehe" +}; Property changes on: announcement/trunk/src/main/webapp/fckeditor/editor/lang/de.js ___________________________________________________________________ Name: svn:eol-style + native Added: announcement/trunk/src/main/webapp/fckeditor/editor/lang/el.js =================================================================== --- announcement/trunk/src/main/webapp/fckeditor/editor/lang/el.js (rev 0) +++ announcement/trunk/src/main/webapp/fckeditor/editor/lang/el.js 2008-06-30 02:54:27 UTC (rev 1002) @@ -0,0 +1,515 @@ +?/* + * FCKeditor - The text editor for Internet - http://www.fckeditor.net + * Copyright (C) 2003-2008 Frederico Caldeira Knabben + * + * == BEGIN LICENSE == + * + * Licensed under the terms of any of the following licenses at your + * choice: + * + * - GNU General Public License Version 2 or later (the "GPL") + * http://www.gnu.org/licenses/gpl.html + * + * - GNU Lesser General Public License Version 2.1 or later (the "LGPL") + * http://www.gnu.org/licenses/lgpl.html + * + * - Mozilla Public License Version 1.1 or later (the "MPL") + * http://www.mozilla.org/MPL/MPL-1.1.html + * + * == END LICENSE == + * + * Greek language file. + */ + +var FCKLang = +{ +// Language direction : "ltr" (left to right) or "rtl" (right to left). +Dir : "ltr", + +ToolbarCollapse : "Απόκρυψη Μπάρας Εργαλείων", +ToolbarExpand : "Εμφάνιση Μπάρας Εργαλείων", + +// Toolbar Items and Context Menu +Save : "Αποθήκευση", +NewPage : "Νέα Σελίδα", +Preview : "Προεπισκόπιση", +Cut : "Αποκοπή", +Copy : "Αντιγραφή", +Paste : "Επικόλληση", +PasteText : "Επικόλληση (απλό κείμενο)", +PasteWord : "Επικόλληση από το Word", +Print : "Εκτύπωση", +SelectAll : "Επιλογή όλων", +RemoveFormat : "Αφαίρεση Μορφοποίησης", +InsertLinkLbl : "Σύνδεσμος (Link)", +InsertLink : "Εισαγωγή/Μεταβολή Συνδέσμου (Link)", +RemoveLink : "Αφαίρεση Συνδέσμου (Link)", +Anchor : "Εισαγωγή/επεξεργασία Anchor", +AnchorDelete : "Remove Anchor", //MISSING +InsertImageLbl : "Εικόνα", +InsertImage : "Εισαγωγή/Μεταβολή Εικόνας", +InsertFlashLbl : "Εισαγωγή Flash", +InsertFlash : "Εισαγωγή/επεξεργασία Flash", +InsertTableLbl : "Πίνακας", +InsertTable : "Εισαγωγή/Μεταβολή Πίνακα", +InsertLineLbl : "Γραμμή", +InsertLine : "Εισαγωγή Οριζόντιας Γραμμής", +InsertSpecialCharLbl: "Ειδικό Σύμβολο", +InsertSpecialChar : "Εισαγωγή Ειδικού Συμβόλου", +InsertSmileyLbl : "Smiley", +InsertSmiley : "Εισαγωγή Smiley", +About : "Περί του FCKeditor", +Bold : "Έντονα", +Italic : "Πλάγια", +Underline : "Υπογράμμιση", +StrikeThrough : "Διαγράμμιση", +Subscript : "Δείκτης", +Superscript : "Εκθέτης", +LeftJustify : "Στοίχιση Αριστερά", +CenterJustify : "Στοίχιση στο Κέντρο", +RightJustify : "Στοίχιση Δεξιά", +BlockJustify : "Πλήρης Στοίχιση (Block)", +DecreaseIndent : "Μείωση Εσοχής", +IncreaseIndent : "Αύξηση Εσοχής", +Blockquote : "Blockquote", //MISSING +Undo : "Αναίρεση", +Redo : "Επαναφορά", +NumberedListLbl : "Λίστα με Αριθμούς", +NumberedList : "Εισαγωγή/Διαγραφή Λίστας με Αριθμούς", +BulletedListLbl : "Λίστα με Bullets", +BulletedList : "Εισαγωγή/Διαγραφή Λίστας με Bullets", +ShowTableBorders : "Προβολή Ορίων Πίνακα", +ShowDetails : "Προβολή Λεπτομερειών", +Style : "Στυλ", +FontFormat : "Μορφή Γραμματοσειράς", +Font : "Γραμματοσειρά", +FontSize : "Μέγεθος", +TextColor : "Χρώμα Γραμμάτων", +BGColor : "Χρώμα Υποβάθρου", +Source : "HTML κώδικας", +Find : "Αναζήτηση", +Replace : "Αντικατάσταση", +SpellCheck : "Ορθογραφικός έλεγχος", +UniversalKeyboard : "Διεθνής πληκτρολόγιο", +PageBreakLbl : "Τέλος σελίδας", +PageBreak : "Εισαγωγή τέλους σελίδας", + +Form : "Φόρμα", +Checkbox : "Κουτί επιλογής", +RadioButton : "Κουμπί Radio", +TextField : "Πεδίο κειμένου", +Textarea : "Περιοχή κειμένου", +HiddenField : "Κρυφό πεδίο", +Button : "Κουμπί", +SelectionField : "Πεδίο επιλογής", +ImageButton : "Κουμπί εικόνας", + +FitWindow : "Μεγιστοποίηση προγράμματος", +ShowBlocks : "Show Blocks", //MISSING + +// Context Menu +EditLink : "Μεταβολή Συνδέσμου (Link)", +CellCM : "Κελί", +RowCM : "Σειρά", +ColumnCM : "Στήλη", +InsertRowAfter : "Insert Row After", //MISSING +InsertRowBefore : "Insert Row Before", //MISSING +DeleteRows : "Διαγραφή Γραμμών", +InsertColumnAfter : "Insert Column After", //MISSING +InsertColumnBefore : "Insert Column Before", //MISSING +DeleteColumns : "Διαγραφή Κολωνών", +InsertCellAfter : "Insert Cell After", //MISSING +InsertCellBefore : "Insert Cell Before", //MISSING +DeleteCells : "Διαγραφή Κελιών", +MergeCells : "Ενοποίηση Κελιών", +MergeRight : "Merge Right", //MISSING +MergeDown : "Merge Down", //MISSING +HorizontalSplitCell : "Split Cell Horizontally", //MISSING +VerticalSplitCell : "Split Cell Vertically", //MISSING +TableDelete : "Διαγραφή πίνακα", +CellProperties : "Ιδιότητες Κελιού", +TableProperties : "Ιδιότητες Πίνακα", +ImageProperties : "Ιδιότητες Εικόνας", +FlashProperties : "Ιδιότητες Flash", + +AnchorProp : "Ιδιότητες άγκυρας", +ButtonProp : "Ιδιότητες κουμπιού", +CheckboxProp : "Ιδιότητες κουμπιού επιλογής", +HiddenFieldProp : "Ιδιότητες κρυφού πεδίου", +RadioButtonProp : "Ιδιότητες κουμπιού radio", +ImageButtonProp : "Ιδιότητες κουμπιού εικόνας", +TextFieldProp : "Ιδιότητες πεδίου κειμένου", +SelectionFieldProp : "Ιδιότητες πεδίου επιλογής", +TextareaProp : "Ιδιότητες περιοχής κειμένου", +FormProp : "Ιδιότητες φόρμας", + +FontFormats : "Κανονικό;Μορφοποιημένο;Διεύθυνση;Επικεφαλίδα 1;Επικεφαλίδα 2;Επικεφαλίδα 3;Επικεφαλίδα 4;Επικεφαλίδα 5;Επικεφαλίδα 6", + +// Alerts and Messages +ProcessingXHTML : "Επεξεργασία XHTML. Παρακαλώ περιμένετε...", +Done : "Έτοιμο", +PasteWordConfirm : "Το κείμενο που θέλετε να επικολήσετε, φαίνεται πως προέρχεται από το Word. Θέλετε να καθαριστεί πριν επικοληθεί;", +NotCompatiblePaste : "Αυτή η επιλογή είναι διαθέσιμη στον Internet Explorer έκδοση 5.5+. Θέλετε να γίνει η επικόλληση χωρίς καθαρισμό;", +UnknownToolbarItem : "Άγνωστο αντικείμενο της μπάρας εργαλείων \"%1\"", +UnknownCommand : "Άγνωστή εντολή \"%1\"", +NotImplemented : "Η εντολή δεν έχει ενεργοποιηθεί", +UnknownToolbarSet : "Η μπάρα εργαλείων \"%1\" δεν υπάρχει", +NoActiveX : "Οι ρυθμίσεις ασφαλείας του browser σας μπορεί να περιορίσουν κάποιες ρυθμίσεις του προγράμματος. Χρειάζεται να ενεργοποιήσετε την επιλογή \"Run ActiveX controls and plug-ins\". Ίσως παρουσιαστούν λάθη και παρατηρήσετε ελειπείς λειτουργίες.", +BrowseServerBlocked : "Οι πόροι του browser σας δεν είναι προσπελάσιμοι. Σιγουρευτείτε ότι δεν υπάρχουν ενεργοί popup blockers.", +DialogBlocked : "Δεν ήταν δυνατό να ανοίξει το παράθυρο διαλόγου. Σιγουρευτείτε ότι δεν υπάρχουν ενεργοί popup blockers.", + +// Dialogs +DlgBtnOK : "OK", +DlgBtnCancel : "Ακύρωση", +DlgBtnClose : "Κλείσιμο", +DlgBtnBrowseServer : "Εξερεύνηση διακομιστή", +DlgAdvancedTag : "Για προχωρημένους", +DlgOpOther : "<Άλλα>", +DlgInfoTab : "Πληροφορίες", +DlgAlertUrl : "Παρακαλώ εισάγετε URL", + +// General Dialogs Labels +DlgGenNotSet : "<χωρίς>", +DlgGenId : "Id", +DlgGenLangDir : "Κατεύθυνση κειμένου", +DlgGenLangDirLtr : "Αριστερά προς Δεξιά (LTR)", +DlgGenLangDirRtl : "Δεξιά προς Αριστερά (RTL)", +DlgGenLangCode : "Κωδικός Γλώσσας", +DlgGenAccessKey : "Συντόμευση (Access Key)", +DlgGenName : "Όνομα", +DlgGenTabIndex : "Tab Index", +DlgGenLongDescr : "Αναλυτική περιγραφή URL", +DlgGenClass : "Stylesheet Classes", +DlgGenTitle : "Συμβουλευτικός τίτλος", +DlgGenContType : "Συμβουλευτικός τίτλος περιεχομένου", +DlgGenLinkCharset : "Linked Resource Charset", +DlgGenStyle : "Στύλ", + +// Image Dialog +DlgImgTitle : "Ιδιότητες Εικόνας", +DlgImgInfoTab : "Πληροφορίες Εικόνας", +DlgImgBtnUpload : "Αποστολή στον Διακομιστή", +DlgImgURL : "URL", +DlgImgUpload : "Αποστολή", +DlgImgAlt : "Εναλλακτικό Κείμενο (ALT)", +DlgImgWidth : "Πλάτος", +DlgImgHeight : "Ύψος", +DlgImgLockRatio : "Κλείδωμα Αναλογίας", +DlgBtnResetSize : "Επαναφορά Αρχικού Μεγέθους", +DlgImgBorder : "Περιθώριο", +DlgImgHSpace : "Οριζόντιος Χώρος (HSpace)", +DlgImgVSpace : "Κάθετος Χώρος (VSpace)", +DlgImgAlign : "Ευθυγράμμιση (Align)", +DlgImgAlignLeft : "Αριστερά", +DlgImgAlignAbsBottom: "Απόλυτα Κάτω (Abs Bottom)", +DlgImgAlignAbsMiddle: "Απόλυτα στη Μέση (Abs Middle)", +DlgImgAlignBaseline : "Γραμμή Βάσης (Baseline)", +DlgImgAlignBottom : "Κάτω (Bottom)", +DlgImgAlignMiddle : "Μέση (Middle)", +DlgImgAlignRight : "Δεξιά (Right)", +DlgImgAlignTextTop : "Κορυφή Κειμένου (Text Top)", +DlgImgAlignTop : "Πάνω (Top)", +DlgImgPreview : "Προεπισκόπιση", +DlgImgAlertUrl : "Εισάγετε την τοποθεσία (URL) της εικόνας", +DlgImgLinkTab : "Σύνδεσμος", + +// Flash Dialog +DlgFlashTitle : "Ιδιότητες flash", +DlgFlashChkPlay : "Αυτόματη έναρξη", +DlgFlashChkLoop : "Επανάληψη", +DlgFlashChkMenu : "Ενεργοποίηση Flash Menu", +DlgFlashScale : "Κλίμακα", +DlgFlashScaleAll : "Εμφάνιση όλων", +DlgFlashScaleNoBorder : "Χωρίς όρια", +DlgFlashScaleFit : "Ακριβής εφαρμογή", + +// Link Dialog +DlgLnkWindowTitle : "Σύνδεσμος (Link)", +DlgLnkInfoTab : "Link", +DlgLnkTargetTab : "Παράθυρο Στόχος (Target)", + +DlgLnkType : "Τύπος συνδέσμου (Link)", +DlgLnkTypeURL : "URL", +DlgLnkTypeAnchor : "Άγκυρα σε αυτή τη σελίδα", +DlgLnkTypeEMail : "E-Mail", +DlgLnkProto : "Προτόκολο", +DlgLnkProtoOther : "<άλλο>", +DlgLnkURL : "URL", +DlgLnkAnchorSel : "Επιλέξτε μια άγκυρα", +DlgLnkAnchorByName : "Βάσει του Ονόματος (Name) της άγκυρας", +DlgLnkAnchorById : "Βάσει του Element Id", +DlgLnkNoAnchors : "(Δεν υπάρχουν άγκυρες στο κείμενο)", +DlgLnkEMail : "Διεύθυνση Ηλεκτρονικού Ταχυδρομείου", +DlgLnkEMailSubject : "Θέμα Μηνύματος", +DlgLnkEMailBody : "Κείμενο Μηνύματος", +DlgLnkUpload : "Αποστολή", +DlgLnkBtnUpload : "Αποστολή στον Διακομιστή", + +DlgLnkTarget : "Παράθυρο Στόχος (Target)", +DlgLnkTargetFrame : "<πλαίσιο>", +DlgLnkTargetPopup : "<παράθυρο popup>", +DlgLnkTargetBlank : "Νέο Παράθυρο (_blank)", +DlgLnkTargetParent : "Γονικό Παράθυρο (_parent)", +DlgLnkTargetSelf : "Ίδιο Παράθυρο (_self)", +DlgLnkTargetTop : "Ανώτατο Παράθυρο (_top)", +DlgLnkTargetFrameName : "Όνομα πλαισίου στόχου", +DlgLnkPopWinName : "Όνομα Popup Window", +DlgLnkPopWinFeat : "Επιλογές Popup Window", +DlgLnkPopResize : "Με αλλαγή Μεγέθους", +DlgLnkPopLocation : "Μπάρα Τοποθεσίας", +DlgLnkPopMenu : "Μπάρα Menu", +DlgLnkPopScroll : "Μπάρες Κύλισης", +DlgLnkPopStatus : "Μπάρα Status", +DlgLnkPopToolbar : "Μπάρα Εργαλείων", +DlgLnkPopFullScrn : "Ολόκληρη η Οθόνη (IE)", +DlgLnkPopDependent : "Dependent (Netscape)", +DlgLnkPopWidth : "Πλάτος", +DlgLnkPopHeight : "Ύψος", +DlgLnkPopLeft : "Τοποθεσία Αριστερής Άκρης", +DlgLnkPopTop : "Τοποθεσία Πάνω Άκρης", + +DlnLnkMsgNoUrl : "Εισάγετε την τοποθεσία (URL) του υπερσυνδέσμου (Link)", +DlnLnkMsgNoEMail : "Εισάγετε την διεύθυνση ηλεκτρονικού ταχυδρομείου", +DlnLnkMsgNoAnchor : "Επιλέξτε ένα Anchor", +DlnLnkMsgInvPopName : "Το όνομα του popup πρέπει να αρχίζει με χαρακτήρα της αλφαβήτου και να μην περιέχει κενά", + +// Color Dialog +DlgColorTitle : "Επιλογή χρώματος", +DlgColorBtnClear : "Καθαρισμός", +DlgColorHighlight : "Προεπισκόπιση", +DlgColorSelected : "Επιλεγμένο", + +// Smiley Dialog +DlgSmileyTitle : "Επιλέξτε ένα Smiley", + +// Special Character Dialog +DlgSpecialCharTitle : "Επιλέξτε ένα Ειδικό Σύμβολο", + +// Table Dialog +DlgTableTitle : "Ιδιότητες Πίνακα", +DlgTableRows : "Γραμμές", +DlgTableColumns : "Κολώνες", +DlgTableBorder : "Μέγεθος Περιθωρίου", +DlgTableAlign : "Στοίχιση", +DlgTableAlignNotSet : "<χωρίς>", +DlgTableAlignLeft : "Αριστερά", +DlgTableAlignCenter : "Κέντρο", +DlgTableAlignRight : "Δεξιά", +DlgTableWidth : "Πλάτος", +DlgTableWidthPx : "pixels", +DlgTableWidthPc : "\%", +DlgTableHeight : "Ύψος", +DlgTableCellSpace : "Απόσταση κελιών", +DlgTableCellPad : "Γέμισμα κελιών", +DlgTableCaption : "Υπέρτιτλος", +DlgTableSummary : "Περίληψη", + +// Table Cell Dialog +DlgCellTitle : "Ιδιότητες Κελιού", +DlgCellWidth : "Πλάτος", +DlgCellWidthPx : "pixels", +DlgCellWidthPc : "\%", +DlgCellHeight : "Ύψος", +DlgCellWordWrap : "Με αλλαγή γραμμής", +DlgCellWordWrapNotSet : "<χωρίς>", +DlgCellWordWrapYes : "Ναι", +DlgCellWordWrapNo : "Όχι", +DlgCellHorAlign : "Οριζόντια Στοίχιση", +DlgCellHorAlignNotSet : "<χωρίς>", +DlgCellHorAlignLeft : "Αριστερά", +DlgCellHorAlignCenter : "Κέντρο", +DlgCellHorAlignRight: "Δεξιά", +DlgCellVerAlign : "Κάθετη Στοίχιση", +DlgCellVerAlignNotSet : "<χωρίς>", +DlgCellVerAlignTop : "Πάνω (Top)", +DlgCellVerAlignMiddle : "Μέση (Middle)", +DlgCellVerAlignBottom : "Κάτω (Bottom)", +DlgCellVerAlignBaseline : "Γραμμή Βάσης (Baseline)", +DlgCellRowSpan : "Αριθμός Γραμμών (Rows Span)", +DlgCellCollSpan : "Αριθμός Κολωνών (Columns Span)", +DlgCellBackColor : "Χρώμα Υποβάθρου", +DlgCellBorderColor : "Χρώμα Περιθωρίου", +DlgCellBtnSelect : "Επιλογή...", + +// Find and Replace Dialog +DlgFindAndReplaceTitle : "Find and Replace", //MISSING + +// Find Dialog +DlgFindTitle : "Αναζήτηση", +DlgFindFindBtn : "Αναζήτηση", +DlgFindNotFoundMsg : "Το κείμενο δεν βρέθηκε.", + +// Replace Dialog +DlgReplaceTitle : "Αντικατάσταση", +DlgReplaceFindLbl : "Αναζήτηση:", +DlgReplaceReplaceLbl : "Αντικατάσταση με:", +DlgReplaceCaseChk : "Έλεγχος πεζών/κεφαλαίων", +DlgReplaceReplaceBtn : "Αντικατάσταση", +DlgReplaceReplAllBtn : "Αντικατάσταση Όλων", +DlgReplaceWordChk : "Εύρεση πλήρους λέξης", + +// Paste Operations / Dialog +PasteErrorCut : "Οι ρυθμίσεις ασφαλείας του φυλλομετρητή σας δεν επιτρέπουν την επιλεγμένη εργασία αποκοπής. Χρησιμοποιείστε το πληκτρολόγιο (Ctrl+X).", +PasteErrorCopy : "Οι ρυθμίσεις ασφαλείας του φυλλομετρητή σας δεν επιτρέπουν την επιλεγμένη εργασία αντιγραφής. Χρησιμοποιείστε το πληκτρολόγιο (Ctrl+C).", + +PasteAsText : "Επικόλληση ως Απλό Κείμενο", +PasteFromWord : "Επικόλληση από το Word", + +DlgPasteMsg2 : "Παρακαλώ επικολήστε στο ακόλουθο κουτί χρησιμοποιόντας το πληκτρολόγιο (Ctrl+V) και πατήστε OK.", +DlgPasteSec : "Because of your browser security settings, the editor is not able to access your clipboard data directly. You are required to paste it again in this window.", //MISSING +DlgPasteIgnoreFont : "Αγνόηση προδιαγραφών γραμματοσειράς", +DlgPasteRemoveStyles : "Αφαίρεση προδιαγραφών στύλ", + +// Color Picker +ColorAutomatic : "Αυτόματο", +ColorMoreColors : "Περισσότερα χρώματα...", + +// Document Properties +DocProps : "Ιδιότητες εγγράφου", + +// Anchor Dialog +DlgAnchorTitle : "Ιδιότητες άγκυρας", +DlgAnchorName : "Όνομα άγκυρας", +DlgAnchorErrorName : "Παρακαλούμε εισάγετε όνομα άγκυρας", + +// Speller Pages Dialog +DlgSpellNotInDic : "Δεν υπάρχει στο λεξικό", +DlgSpellChangeTo : "Αλλαγή σε", +DlgSpellBtnIgnore : "Αγνόηση", +DlgSpellBtnIgnoreAll : "Αγνόηση όλων", +DlgSpellBtnReplace : "Αντικατάσταση", +DlgSpellBtnReplaceAll : "Αντικατάσταση όλων", +DlgSpellBtnUndo : "Αναίρεση", +DlgSpellNoSuggestions : "- Δεν υπάρχουν προτάσεις -", +DlgSpellProgress : "Ορθογραφικός έλεγχος σε εξέλιξη...", +DlgSpellNoMispell : "Ο ορθογραφικός έλεγχος ολοκληρώθηκε: Δεν βρέθηκαν λάθη", +DlgSpellNoChanges : "Ο ορθογραφικός έλεγχος ολοκληρώθηκε: Δεν άλλαξαν λέξεις", +DlgSpellOneChange : "Ο ορθογραφικός έλεγχος ολοκληρώθηκε: Μια λέξη άλλαξε", +DlgSpellManyChanges : "Ο ορθογραφικός έλεγχος ολοκληρώθηκε: %1 λέξεις άλλαξαν", + +IeSpellDownload : "Δεν υπάρχει εγκατεστημένος ορθογράφος. Θέλετε να τον κατεβάσετε τώρα;", + +// Button Dialog +DlgButtonText : "Κείμενο (Τιμή)", +DlgButtonType : "Τύπος", +DlgButtonTypeBtn : "Κουμπί", +DlgButtonTypeSbm : "Καταχώρηση", +DlgButtonTypeRst : "Επαναφορά", + +// Checkbox and Radio Button Dialogs +DlgCheckboxName : "Όνομα", +DlgCheckboxValue : "Τιμή", +DlgCheckboxSelected : "Επιλεγμένο", + +// Form Dialog +DlgFormName : "Όνομα", +DlgFormAction : "Δράση", +DlgFormMethod : "Μάθοδος", + +// Select Field Dialog +DlgSelectName : "Όνομα", +DlgSelectValue : "Τιμή", +DlgSelectSize : "Μέγεθος", +DlgSelectLines : "γραμμές", +DlgSelectChkMulti : "Πολλαπλές επιλογές", +DlgSelectOpAvail : "Διαθέσιμες επιλογές", +DlgSelectOpText : "Κείμενο", +DlgSelectOpValue : "Τιμή", +DlgSelectBtnAdd : "Προσθήκη", +DlgSelectBtnModify : "Αλλαγή", +DlgSelectBtnUp : "Πάνω", +DlgSelectBtnDown : "Κάτω", +DlgSelectBtnSetValue : "Προεπιλεγμένη επιλογή", +DlgSelectBtnDelete : "Διαγραφή", + +// Textarea Dialog +DlgTextareaName : "Όνομα", +DlgTextareaCols : "Στήλες", +DlgTextareaRows : "Σειρές", + +// Text Field Dialog +DlgTextName : "Όνομα", +DlgTextValue : "Τιμή", +DlgTextCharWidth : "Μήκος χαρακτήρων", +DlgTextMaxChars : "Μέγιστοι χαρακτήρες", +DlgTextType : "Τύπος", +DlgTextTypeText : "Κείμενο", +DlgTextTypePass : "Κωδικός", + +// Hidden Field Dialog +DlgHiddenName : "Όνομα", +DlgHiddenValue : "Τιμή", + +// Bulleted List Dialog +BulletedListProp : "Ιδιότητες λίστας Bulleted", +NumberedListProp : "Ιδιότητες αριθμημένης λίστας ", +DlgLstStart : "Αρχή", +DlgLstType : "Τύπος", +DlgLstTypeCircle : "Κύκλος", +DlgLstTypeDisc : "Δίσκος", +DlgLstTypeSquare : "Τετράγωνο", +DlgLstTypeNumbers : "Αριθμοί (1, 2, 3)", +DlgLstTypeLCase : "Πεζά γράμματα (a, b, c)", +DlgLstTypeUCase : "Κεφαλαία γράμματα (A, B, C)", +DlgLstTypeSRoman : "Μικρά λατινικά αριθμητικά (i, ii, iii)", +DlgLstTypeLRoman : "Μεγάλα λατινικά αριθμητικά (I, II, III)", + +// Document Properties Dialog +DlgDocGeneralTab : "Γενικά", +DlgDocBackTab : "Φόντο", +DlgDocColorsTab : "Χρώματα και περιθώρια", +DlgDocMetaTab : "Δεδομένα Meta", + +DlgDocPageTitle : "Τίτλος σελίδας", +DlgDocLangDir : "Κατεύθυνση γραφής", +DlgDocLangDirLTR : "αριστερά προς δεξιά (LTR)", +DlgDocLangDirRTL : "δεξιά προς αριστερά (RTL)", +DlgDocLangCode : "Κωδικός γλώσσας", +DlgDocCharSet : "Κωδικοποίηση χαρακτήρων", +DlgDocCharSetCE : "Κεντρικής Ευρώπης", +DlgDocCharSetCT : "Παραδοσιακά κινέζικα (Big5)", +DlgDocCharSetCR : "Κυριλλική", +DlgDocCharSetGR : "Ελληνική", +DlgDocCharSetJP : "Ιαπωνική", +DlgDocCharSetKR : "Κορεάτικη", +DlgDocCharSetTR : "Τουρκική", +DlgDocCharSetUN : "Διεθνής (UTF-8)", +DlgDocCharSetWE : "Δυτικής Ευρώπης", +DlgDocCharSetOther : "Άλλη κωδικοποίηση χαρακτήρων", + +DlgDocDocType : "Επικεφαλίδα τύπου εγγράφου", +DlgDocDocTypeOther : "Άλλη επικεφαλίδα τύπου εγγράφου", +DlgDocIncXHTML : "Να συμπεριληφθούν οι δηλώσεις XHTML", +DlgDocBgColor : "Χρώμα φόντου", +DlgDocBgImage : "Διεύθυνση εικόνας φόντου", +DlgDocBgNoScroll : "Φόντο χωρίς κύλιση", +DlgDocCText : "Κείμενο", +DlgDocCLink : "Σύνδεσμος", +DlgDocCVisited : "Σύνδεσμος που έχει επισκευθεί", +DlgDocCActive : "Ενεργός σύνδεσμος", +DlgDocMargins : "Περιθώρια σελίδας", +DlgDocMaTop : "Κορυφή", +DlgDocMaLeft : "Αριστερά", +DlgDocMaRight : "Δεξιά", +DlgDocMaBottom : "Κάτω", +DlgDocMeIndex : "Λέξεις κλειδιά δείκτες εγγράφου (διαχωρισμός με κόμμα)", +DlgDocMeDescr : "Περιγραφή εγγράφου", +DlgDocMeAuthor : "Συγγραφέας", +DlgDocMeCopy : "Πνευματικά δικαιώματα", +DlgDocPreview : "Προεπισκόπηση", + +// Templates Dialog +Templates : "Πρότυπα", +DlgTemplatesTitle : "Πρότυπα περιεχομένου", +DlgTemplatesSelMsg : "Παρακαλώ επιλέξτε πρότυπο για εισαγωγή στο πρόγραμμα
        (τα υπάρχοντα περιεχόμενα θα χαθούν):", +DlgTemplatesLoading : "Φόρτωση καταλόγου προτύπων. Παρακαλώ περιμένετε...", +DlgTemplatesNoTpl : "(Δεν έχουν καθοριστεί πρότυπα)", +DlgTemplatesReplace : "Αντικατάσταση υπάρχοντων περιεχομένων", + +// About Dialog +DlgAboutAboutTab : "Σχετικά", +DlgAboutBrowserInfoTab : "Πληροφορίες Browser", +DlgAboutLicenseTab : "Άδεια", +DlgAboutVersion : "έκδοση", +DlgAboutInfo : "Για περισσότερες πληροφορίες" +}; Property changes on: announcement/trunk/src/main/webapp/fckeditor/editor/lang/el.js ___________________________________________________________________ Name: svn:eol-style + native Added: announcement/trunk/src/main/webapp/fckeditor/editor/lang/en-au.js =================================================================== --- announcement/trunk/src/main/webapp/fckeditor/editor/lang/en-au.js (rev 0) +++ announcement/trunk/src/main/webapp/fckeditor/editor/lang/en-au.js 2008-06-30 02:54:27 UTC (rev 1002) @@ -0,0 +1,515 @@ +?/* + * FCKeditor - The text editor for Internet - http://www.fckeditor.net + * Copyright (C) 2003-2008 Frederico Caldeira Knabben + * + * == BEGIN LICENSE == + * + * Licensed under the terms of any of the following licenses at your + * choice: + * + * - GNU General Public License Version 2 or later (the "GPL") + * http://www.gnu.org/licenses/gpl.html + * + * - GNU Lesser General Public License Version 2.1 or later (the "LGPL") + * http://www.gnu.org/licenses/lgpl.html + * + * - Mozilla Public License Version 1.1 or later (the "MPL") + * http://www.mozilla.org/MPL/MPL-1.1.html + * + * == END LICENSE == + * + * English (Australia) language file. + */ + +var FCKLang = +{ +// Language direction : "ltr" (left to right) or "rtl" (right to left). +Dir : "ltr", + +ToolbarCollapse : "Collapse Toolbar", +ToolbarExpand : "Expand Toolbar", + +// Toolbar Items and Context Menu +Save : "Save", +NewPage : "New Page", +Preview : "Preview", +Cut : "Cut", +Copy : "Copy", +Paste : "Paste", +PasteText : "Paste as plain text", +PasteWord : "Paste from Word", +Print : "Print", +SelectAll : "Select All", +RemoveFormat : "Remove Format", +InsertLinkLbl : "Link", +InsertLink : "Insert/Edit Link", +RemoveLink : "Remove Link", +Anchor : "Insert/Edit Anchor", +AnchorDelete : "Remove Anchor", +InsertImageLbl : "Image", +InsertImage : "Insert/Edit Image", +InsertFlashLbl : "Flash", +InsertFlash : "Insert/Edit Flash", +InsertTableLbl : "Table", +InsertTable : "Insert/Edit Table", +InsertLineLbl : "Line", +InsertLine : "Insert Horizontal Line", +InsertSpecialCharLbl: "Special Character", +InsertSpecialChar : "Insert Special Character", +InsertSmileyLbl : "Smiley", +InsertSmiley : "Insert Smiley", +About : "About FCKeditor", +Bold : "Bold", +Italic : "Italic", +Underline : "Underline", +StrikeThrough : "Strike Through", +Subscript : "Subscript", +Superscript : "Superscript", +LeftJustify : "Left Justify", +CenterJustify : "Centre Justify", +RightJustify : "Right Justify", +BlockJustify : "Block Justify", +DecreaseIndent : "Decrease Indent", +IncreaseIndent : "Increase Indent", +Blockquote : "Blockquote", +Undo : "Undo", +Redo : "Redo", +NumberedListLbl : "Numbered List", +NumberedList : "Insert/Remove Numbered List", +BulletedListLbl : "Bulleted List", +BulletedList : "Insert/Remove Bulleted List", +ShowTableBorders : "Show Table Borders", +ShowDetails : "Show Details", +Style : "Style", +FontFormat : "Format", +Font : "Font", +FontSize : "Size", +TextColor : "Text Colour", +BGColor : "Background Colour", +Source : "Source", +Find : "Find", +Replace : "Replace", +SpellCheck : "Check Spelling", +UniversalKeyboard : "Universal Keyboard", +PageBreakLbl : "Page Break", +PageBreak : "Insert Page Break", + +Form : "Form", +Checkbox : "Checkbox", +RadioButton : "Radio Button", +TextField : "Text Field", +Textarea : "Textarea", +HiddenField : "Hidden Field", +Button : "Button", +SelectionField : "Selection Field", +ImageButton : "Image Button", + +FitWindow : "Maximize the editor size", +ShowBlocks : "Show Blocks", + +// Context Menu +EditLink : "Edit Link", +CellCM : "Cell", +RowCM : "Row", +ColumnCM : "Column", +InsertRowAfter : "Insert Row After", +InsertRowBefore : "Insert Row Before", +DeleteRows : "Delete Rows", +InsertColumnAfter : "Insert Column After", +InsertColumnBefore : "Insert Column Before", +DeleteColumns : "Delete Columns", +InsertCellAfter : "Insert Cell After", +InsertCellBefore : "Insert Cell Before", +DeleteCells : "Delete Cells", +MergeCells : "Merge Cells", +MergeRight : "Merge Right", +MergeDown : "Merge Down", +HorizontalSplitCell : "Split Cell Horizontally", +VerticalSplitCell : "Split Cell Vertically", +TableDelete : "Delete Table", +CellProperties : "Cell Properties", +TableProperties : "Table Properties", +ImageProperties : "Image Properties", +FlashProperties : "Flash Properties", + +AnchorProp : "Anchor Properties", +ButtonProp : "Button Properties", +CheckboxProp : "Checkbox Properties", +HiddenFieldProp : "Hidden Field Properties", +RadioButtonProp : "Radio Button Properties", +ImageButtonProp : "Image Button Properties", +TextFieldProp : "Text Field Properties", +SelectionFieldProp : "Selection Field Properties", +TextareaProp : "Textarea Properties", +FormProp : "Form Properties", + +FontFormats : "Normal;Formatted;Address;Heading 1;Heading 2;Heading 3;Heading 4;Heading 5;Heading 6;Normal (DIV)", + +// Alerts and Messages +ProcessingXHTML : "Processing XHTML. Please wait...", +Done : "Done", +PasteWordConfirm : "The text you want to paste seems to be copied from Word. Do you want to clean it before pasting?", +NotCompatiblePaste : "This command is available for Internet Explorer version 5.5 or more. Do you want to paste without cleaning?", +UnknownToolbarItem : "Unknown toolbar item \"%1\"", +UnknownCommand : "Unknown command name \"%1\"", +NotImplemented : "Command not implemented", +UnknownToolbarSet : "Toolbar set \"%1\" doesn't exist", +NoActiveX : "Your browser's security settings could limit some features of the editor. You must enable the option \"Run ActiveX controls and plug-ins\". You may experience errors and notice missing features.", +BrowseServerBlocked : "The resources browser could not be opened. Make sure that all popup blockers are disabled.", +DialogBlocked : "It was not possible to open the dialog window. Make sure all popup blockers are disabled.", + +// Dialogs +DlgBtnOK : "OK", +DlgBtnCancel : "Cancel", +DlgBtnClose : "Close", +DlgBtnBrowseServer : "Browse Server", +DlgAdvancedTag : "Advanced", +DlgOpOther : "", +DlgInfoTab : "Info", +DlgAlertUrl : "Please insert the URL", + +// General Dialogs Labels +DlgGenNotSet : "", +DlgGenId : "Id", +DlgGenLangDir : "Language Direction", +DlgGenLangDirLtr : "Left to Right (LTR)", +DlgGenLangDirRtl : "Right to Left (RTL)", +DlgGenLangCode : "Language Code", +DlgGenAccessKey : "Access Key", +DlgGenName : "Name", +DlgGenTabIndex : "Tab Index", +DlgGenLongDescr : "Long Description URL", +DlgGenClass : "Stylesheet Classes", +DlgGenTitle : "Advisory Title", +DlgGenContType : "Advisory Content Type", +DlgGenLinkCharset : "Linked Resource Charset", +DlgGenStyle : "Style", + +// Image Dialog +DlgImgTitle : "Image Properties", +DlgImgInfoTab : "Image Info", +DlgImgBtnUpload : "Send it to the Server", +DlgImgURL : "URL", +DlgImgUpload : "Upload", +DlgImgAlt : "Alternative Text", +DlgImgWidth : "Width", +DlgImgHeight : "Height", +DlgImgLockRatio : "Lock Ratio", +DlgBtnResetSize : "Reset Size", +DlgImgBorder : "Border", +DlgImgHSpace : "HSpace", +DlgImgVSpace : "VSpace", +DlgImgAlign : "Align", +DlgImgAlignLeft : "Left", +DlgImgAlignAbsBottom: "Abs Bottom", +DlgImgAlignAbsMiddle: "Abs Middle", +DlgImgAlignBaseline : "Baseline", +DlgImgAlignBottom : "Bottom", +DlgImgAlignMiddle : "Middle", +DlgImgAlignRight : "Right", +DlgImgAlignTextTop : "Text Top", +DlgImgAlignTop : "Top", +DlgImgPreview : "Preview", +DlgImgAlertUrl : "Please type the image URL", +DlgImgLinkTab : "Link", + +// Flash Dialog +DlgFlashTitle : "Flash Properties", +DlgFlashChkPlay : "Auto Play", +DlgFlashChkLoop : "Loop", +DlgFlashChkMenu : "Enable Flash Menu", +DlgFlashScale : "Scale", +DlgFlashScaleAll : "Show all", +DlgFlashScaleNoBorder : "No Border", +DlgFlashScaleFit : "Exact Fit", + +// Link Dialog +DlgLnkWindowTitle : "Link", +DlgLnkInfoTab : "Link Info", +DlgLnkTargetTab : "Target", + +DlgLnkType : "Link Type", +DlgLnkTypeURL : "URL", +DlgLnkTypeAnchor : "Link to anchor in the text", +DlgLnkTypeEMail : "E-Mail", +DlgLnkProto : "Protocol", +DlgLnkProtoOther : "", +DlgLnkURL : "URL", +DlgLnkAnchorSel : "Select an Anchor", +DlgLnkAnchorByName : "By Anchor Name", +DlgLnkAnchorById : "By Element Id", +DlgLnkNoAnchors : "(No anchors available in the document)", +DlgLnkEMail : "E-Mail Address", +DlgLnkEMailSubject : "Message Subject", +DlgLnkEMailBody : "Message Body", +DlgLnkUpload : "Upload", +DlgLnkBtnUpload : "Send it to the Server", + +DlgLnkTarget : "Target", +DlgLnkTargetFrame : "", +DlgLnkTargetPopup : "", +DlgLnkTargetBlank : "New Window (_blank)", +DlgLnkTargetParent : "Parent Window (_parent)", +DlgLnkTargetSelf : "Same Window (_self)", +DlgLnkTargetTop : "Topmost Window (_top)", +DlgLnkTargetFrameName : "Target Frame Name", +DlgLnkPopWinName : "Popup Window Name", +DlgLnkPopWinFeat : "Popup Window Features", +DlgLnkPopResize : "Resizable", +DlgLnkPopLocation : "Location Bar", +DlgLnkPopMenu : "Menu Bar", +DlgLnkPopScroll : "Scroll Bars", +DlgLnkPopStatus : "Status Bar", +DlgLnkPopToolbar : "Toolbar", +DlgLnkPopFullScrn : "Full Screen (IE)", +DlgLnkPopDependent : "Dependent (Netscape)", +DlgLnkPopWidth : "Width", +DlgLnkPopHeight : "Height", +DlgLnkPopLeft : "Left Position", +DlgLnkPopTop : "Top Position", + +DlnLnkMsgNoUrl : "Please type the link URL", +DlnLnkMsgNoEMail : "Please type the e-mail address", +DlnLnkMsgNoAnchor : "Please select an anchor", +DlnLnkMsgInvPopName : "The popup name must begin with an alphabetic character and must not contain spaces", + +// Color Dialog +DlgColorTitle : "Select Colour", +DlgColorBtnClear : "Clear", +DlgColorHighlight : "Highlight", +DlgColorSelected : "Selected", + +// Smiley Dialog +DlgSmileyTitle : "Insert a Smiley", + +// Special Character Dialog +DlgSpecialCharTitle : "Select Special Character", + +// Table Dialog +DlgTableTitle : "Table Properties", +DlgTableRows : "Rows", +DlgTableColumns : "Columns", +DlgTableBorder : "Border size", +DlgTableAlign : "Alignment", +DlgTableAlignNotSet : "", +DlgTableAlignLeft : "Left", +DlgTableAlignCenter : "Centre", +DlgTableAlignRight : "Right", +DlgTableWidth : "Width", +DlgTableWidthPx : "pixels", +DlgTableWidthPc : "percent", +DlgTableHeight : "Height", +DlgTableCellSpace : "Cell spacing", +DlgTableCellPad : "Cell padding", +DlgTableCaption : "Caption", +DlgTableSummary : "Summary", + +// Table Cell Dialog +DlgCellTitle : "Cell Properties", +DlgCellWidth : "Width", +DlgCellWidthPx : "pixels", +DlgCellWidthPc : "percent", +DlgCellHeight : "Height", +DlgCellWordWrap : "Word Wrap", +DlgCellWordWrapNotSet : "", +DlgCellWordWrapYes : "Yes", +DlgCellWordWrapNo : "No", +DlgCellHorAlign : "Horizontal Alignment", +DlgCellHorAlignNotSet : "", +DlgCellHorAlignLeft : "Left", +DlgCellHorAlignCenter : "Centre", +DlgCellHorAlignRight: "Right", +DlgCellVerAlign : "Vertical Alignment", +DlgCellVerAlignNotSet : "", +DlgCellVerAlignTop : "Top", +DlgCellVerAlignMiddle : "Middle", +DlgCellVerAlignBottom : "Bottom", +DlgCellVerAlignBaseline : "Baseline", +DlgCellRowSpan : "Rows Span", +DlgCellCollSpan : "Columns Span", +DlgCellBackColor : "Background Colour", +DlgCellBorderColor : "Border Colour", +DlgCellBtnSelect : "Select...", + +// Find and Replace Dialog +DlgFindAndReplaceTitle : "Find and Replace", + +// Find Dialog +DlgFindTitle : "Find", +DlgFindFindBtn : "Find", +DlgFindNotFoundMsg : "The specified text was not found.", + +// Replace Dialog +DlgReplaceTitle : "Replace", +DlgReplaceFindLbl : "Find what:", +DlgReplaceReplaceLbl : "Replace with:", +DlgReplaceCaseChk : "Match case", +DlgReplaceReplaceBtn : "Replace", +DlgReplaceReplAllBtn : "Replace All", +DlgReplaceWordChk : "Match whole word", + +// Paste Operations / Dialog +PasteErrorCut : "Your browser security settings don't permit the editor to automatically execute cutting operations. Please use the keyboard for that (Ctrl+X).", +PasteErrorCopy : "Your browser security settings don't permit the editor to automatically execute copying operations. Please use the keyboard for that (Ctrl+C).", + +PasteAsText : "Paste as Plain Text", +PasteFromWord : "Paste from Word", + +DlgPasteMsg2 : "Please paste inside the following box using the keyboard (Ctrl+V) and hit OK.", +DlgPasteSec : "Because of your browser security settings, the editor is not able to access your clipboard data directly. You are required to paste it again in this window.", +DlgPasteIgnoreFont : "Ignore Font Face definitions", +DlgPasteRemoveStyles : "Remove Styles definitions", + +// Color Picker +ColorAutomatic : "Automatic", +ColorMoreColors : "More Colours...", + +// Document Properties +DocProps : "Document Properties", + +// Anchor Dialog +DlgAnchorTitle : "Anchor Properties", +DlgAnchorName : "Anchor Name", +DlgAnchorErrorName : "Please type the anchor name", + +// Speller Pages Dialog +DlgSpellNotInDic : "Not in dictionary", +DlgSpellChangeTo : "Change to", +DlgSpellBtnIgnore : "Ignore", +DlgSpellBtnIgnoreAll : "Ignore All", +DlgSpellBtnReplace : "Replace", +DlgSpellBtnReplaceAll : "Replace All", +DlgSpellBtnUndo : "Undo", +DlgSpellNoSuggestions : "- No suggestions -", +DlgSpellProgress : "Spell check in progress...", +DlgSpellNoMispell : "Spell check complete: No misspellings found", +DlgSpellNoChanges : "Spell check complete: No words changed", +DlgSpellOneChange : "Spell check complete: One word changed", +DlgSpellManyChanges : "Spell check complete: %1 words changed", + +IeSpellDownload : "Spell checker not installed. Do you want to download it now?", + +// Button Dialog +DlgButtonText : "Text (Value)", +DlgButtonType : "Type", +DlgButtonTypeBtn : "Button", +DlgButtonTypeSbm : "Submit", +DlgButtonTypeRst : "Reset", + +// Checkbox and Radio Button Dialogs +DlgCheckboxName : "Name", +DlgCheckboxValue : "Value", +DlgCheckboxSelected : "Selected", + +// Form Dialog +DlgFormName : "Name", +DlgFormAction : "Action", +DlgFormMethod : "Method", + +// Select Field Dialog +DlgSelectName : "Name", +DlgSelectValue : "Value", +DlgSelectSize : "Size", +DlgSelectLines : "lines", +DlgSelectChkMulti : "Allow multiple selections", +DlgSelectOpAvail : "Available Options", +DlgSelectOpText : "Text", +DlgSelectOpValue : "Value", +DlgSelectBtnAdd : "Add", +DlgSelectBtnModify : "Modify", +DlgSelectBtnUp : "Up", +DlgSelectBtnDown : "Down", +DlgSelectBtnSetValue : "Set as selected value", +DlgSelectBtnDelete : "Delete", + +// Textarea Dialog +DlgTextareaName : "Name", +DlgTextareaCols : "Columns", +DlgTextareaRows : "Rows", + +// Text Field Dialog +DlgTextName : "Name", +DlgTextValue : "Value", +DlgTextCharWidth : "Character Width", +DlgTextMaxChars : "Maximum Characters", +DlgTextType : "Type", +DlgTextTypeText : "Text", +DlgTextTypePass : "Password", + +// Hidden Field Dialog +DlgHiddenName : "Name", +DlgHiddenValue : "Value", + +// Bulleted List Dialog +BulletedListProp : "Bulleted List Properties", +NumberedListProp : "Numbered List Properties", +DlgLstStart : "Start", +DlgLstType : "Type", +DlgLstTypeCircle : "Circle", +DlgLstTypeDisc : "Disc", +DlgLstTypeSquare : "Square", +DlgLstTypeNumbers : "Numbers (1, 2, 3)", +DlgLstTypeLCase : "Lowercase Letters (a, b, c)", +DlgLstTypeUCase : "Uppercase Letters (A, B, C)", +DlgLstTypeSRoman : "Small Roman Numerals (i, ii, iii)", +DlgLstTypeLRoman : "Large Roman Numerals (I, II, III)", + +// Document Properties Dialog +DlgDocGeneralTab : "General", +DlgDocBackTab : "Background", +DlgDocColorsTab : "Colours and Margins", +DlgDocMetaTab : "Meta Data", + +DlgDocPageTitle : "Page Title", +DlgDocLangDir : "Language Direction", +DlgDocLangDirLTR : "Left to Right (LTR)", +DlgDocLangDirRTL : "Right to Left (RTL)", +DlgDocLangCode : "Language Code", +DlgDocCharSet : "Character Set Encoding", +DlgDocCharSetCE : "Central European", +DlgDocCharSetCT : "Chinese Traditional (Big5)", +DlgDocCharSetCR : "Cyrillic", +DlgDocCharSetGR : "Greek", +DlgDocCharSetJP : "Japanese", +DlgDocCharSetKR : "Korean", +DlgDocCharSetTR : "Turkish", +DlgDocCharSetUN : "Unicode (UTF-8)", +DlgDocCharSetWE : "Western European", +DlgDocCharSetOther : "Other Character Set Encoding", + +DlgDocDocType : "Document Type Heading", +DlgDocDocTypeOther : "Other Document Type Heading", +DlgDocIncXHTML : "Include XHTML Declarations", +DlgDocBgColor : "Background Colour", +DlgDocBgImage : "Background Image URL", +DlgDocBgNoScroll : "Nonscrolling Background", +DlgDocCText : "Text", +DlgDocCLink : "Link", +DlgDocCVisited : "Visited Link", +DlgDocCActive : "Active Link", +DlgDocMargins : "Page Margins", +DlgDocMaTop : "Top", +DlgDocMaLeft : "Left", +DlgDocMaRight : "Right", +DlgDocMaBottom : "Bottom", +DlgDocMeIndex : "Document Indexing Keywords (comma separated)", +DlgDocMeDescr : "Document Description", +DlgDocMeAuthor : "Author", +DlgDocMeCopy : "Copyright", +DlgDocPreview : "Preview", + +// Templates Dialog +Templates : "Templates", +DlgTemplatesTitle : "Content Templates", +DlgTemplatesSelMsg : "Please select the template to open in the editor
        (the actual contents will be lost):", +DlgTemplatesLoading : "Loading templates list. Please wait...", +DlgTemplatesNoTpl : "(No templates defined)", +DlgTemplatesReplace : "Replace actual contents", + +// About Dialog +DlgAboutAboutTab : "About", +DlgAboutBrowserInfoTab : "Browser Info", +DlgAboutLicenseTab : "License", +DlgAboutVersion : "version", +DlgAboutInfo : "For further information go to" +}; Property changes on: announcement/trunk/src/main/webapp/fckeditor/editor/lang/en-au.js ___________________________________________________________________ Name: svn:eol-style + native Added: announcement/trunk/src/main/webapp/fckeditor/editor/lang/en-ca.js =================================================================== --- announcement/trunk/src/main/webapp/fckeditor/editor/lang/en-ca.js (rev 0) +++ announcement/trunk/src/main/webapp/fckeditor/editor/lang/en-ca.js 2008-06-30 02:54:27 UTC (rev 1002) @@ -0,0 +1,515 @@ +?/* + * FCKeditor - The text editor for Internet - http://www.fckeditor.net + * Copyright (C) 2003-2008 Frederico Caldeira Knabben + * + * == BEGIN LICENSE == + * + * Licensed under the terms of any of the following licenses at your + * choice: + * + * - GNU General Public License Version 2 or later (the "GPL") + * http://www.gnu.org/licenses/gpl.html + * + * - GNU Lesser General Public License Version 2.1 or later (the "LGPL") + * http://www.gnu.org/licenses/lgpl.html + * + * - Mozilla Public License Version 1.1 or later (the "MPL") + * http://www.mozilla.org/MPL/MPL-1.1.html + * + * == END LICENSE == + * + * English (Canadian) language file. + */ + +var FCKLang = +{ +// Language direction : "ltr" (left to right) or "rtl" (right to left). +Dir : "ltr", + +ToolbarCollapse : "Collapse Toolbar", +ToolbarExpand : "Expand Toolbar", + +// Toolbar Items and Context Menu +Save : "Save", +NewPage : "New Page", +Preview : "Preview", +Cut : "Cut", +Copy : "Copy", +Paste : "Paste", +PasteText : "Paste as plain text", +PasteWord : "Paste from Word", +Print : "Print", +SelectAll : "Select All", +RemoveFormat : "Remove Format", +InsertLinkLbl : "Link", +InsertLink : "Insert/Edit Link", +RemoveLink : "Remove Link", +Anchor : "Insert/Edit Anchor", +AnchorDelete : "Remove Anchor", +InsertImageLbl : "Image", +InsertImage : "Insert/Edit Image", +InsertFlashLbl : "Flash", +InsertFlash : "Insert/Edit Flash", +InsertTableLbl : "Table", +InsertTable : "Insert/Edit Table", +InsertLineLbl : "Line", +InsertLine : "Insert Horizontal Line", +InsertSpecialCharLbl: "Special Character", +InsertSpecialChar : "Insert Special Character", +InsertSmileyLbl : "Smiley", +InsertSmiley : "Insert Smiley", +About : "About FCKeditor", +Bold : "Bold", +Italic : "Italic", +Underline : "Underline", +StrikeThrough : "Strike Through", +Subscript : "Subscript", +Superscript : "Superscript", +LeftJustify : "Left Justify", +CenterJustify : "Centre Justify", +RightJustify : "Right Justify", +BlockJustify : "Block Justify", +DecreaseIndent : "Decrease Indent", +IncreaseIndent : "Increase Indent", +Blockquote : "Blockquote", +Undo : "Undo", +Redo : "Redo", +NumberedListLbl : "Numbered List", +NumberedList : "Insert/Remove Numbered List", +BulletedListLbl : "Bulleted List", +BulletedList : "Insert/Remove Bulleted List", +ShowTableBorders : "Show Table Borders", +ShowDetails : "Show Details", +Style : "Style", +FontFormat : "Format", +Font : "Font", +FontSize : "Size", +TextColor : "Text Colour", +BGColor : "Background Colour", +Source : "Source", +Find : "Find", +Replace : "Replace", +SpellCheck : "Check Spelling", +UniversalKeyboard : "Universal Keyboard", +PageBreakLbl : "Page Break", +PageBreak : "Insert Page Break", + +Form : "Form", +Checkbox : "Checkbox", +RadioButton : "Radio Button", +TextField : "Text Field", +Textarea : "Textarea", +HiddenField : "Hidden Field", +Button : "Button", +SelectionField : "Selection Field", +ImageButton : "Image Button", + +FitWindow : "Maximize the editor size", +ShowBlocks : "Show Blocks", + +// Context Menu +EditLink : "Edit Link", +CellCM : "Cell", +RowCM : "Row", +ColumnCM : "Column", +InsertRowAfter : "Insert Row After", +InsertRowBefore : "Insert Row Before", +DeleteRows : "Delete Rows", +InsertColumnAfter : "Insert Column After", +InsertColumnBefore : "Insert Column Before", +DeleteColumns : "Delete Columns", +InsertCellAfter : "Insert Cell After", +InsertCellBefore : "Insert Cell Before", +DeleteCells : "Delete Cells", +MergeCells : "Merge Cells", +MergeRight : "Merge Right", +MergeDown : "Merge Down", +HorizontalSplitCell : "Split Cell Horizontally", +VerticalSplitCell : "Split Cell Vertically", +TableDelete : "Delete Table", +CellProperties : "Cell Properties", +TableProperties : "Table Properties", +ImageProperties : "Image Properties", +FlashProperties : "Flash Properties", + +AnchorProp : "Anchor Properties", +ButtonProp : "Button Properties", +CheckboxProp : "Checkbox Properties", +HiddenFieldProp : "Hidden Field Properties", +RadioButtonProp : "Radio Button Properties", +ImageButtonProp : "Image Button Properties", +TextFieldProp : "Text Field Properties", +SelectionFieldProp : "Selection Field Properties", +TextareaProp : "Textarea Properties", +FormProp : "Form Properties", + +FontFormats : "Normal;Formatted;Address;Heading 1;Heading 2;Heading 3;Heading 4;Heading 5;Heading 6;Normal (DIV)", + +// Alerts and Messages +ProcessingXHTML : "Processing XHTML. Please wait...", +Done : "Done", +PasteWordConfirm : "The text you want to paste seems to be copied from Word. Do you want to clean it before pasting?", +NotCompatiblePaste : "This command is available for Internet Explorer version 5.5 or more. Do you want to paste without cleaning?", +UnknownToolbarItem : "Unknown toolbar item \"%1\"", +UnknownCommand : "Unknown command name \"%1\"", +NotImplemented : "Command not implemented", +UnknownToolbarSet : "Toolbar set \"%1\" doesn't exist", +NoActiveX : "Your browser's security settings could limit some features of the editor. You must enable the option \"Run ActiveX controls and plug-ins\". You may experience errors and notice missing features.", +BrowseServerBlocked : "The resources browser could not be opened. Make sure that all popup blockers are disabled.", +DialogBlocked : "It was not possible to open the dialog window. Make sure all popup blockers are disabled.", + +// Dialogs +DlgBtnOK : "OK", +DlgBtnCancel : "Cancel", +DlgBtnClose : "Close", +DlgBtnBrowseServer : "Browse Server", +DlgAdvancedTag : "Advanced", +DlgOpOther : "", +DlgInfoTab : "Info", +DlgAlertUrl : "Please insert the URL", + +// General Dialogs Labels +DlgGenNotSet : "", +DlgGenId : "Id", +DlgGenLangDir : "Language Direction", +DlgGenLangDirLtr : "Left to Right (LTR)", +DlgGenLangDirRtl : "Right to Left (RTL)", +DlgGenLangCode : "Language Code", +DlgGenAccessKey : "Access Key", +DlgGenName : "Name", +DlgGenTabIndex : "Tab Index", +DlgGenLongDescr : "Long Description URL", +DlgGenClass : "Stylesheet Classes", +DlgGenTitle : "Advisory Title", +DlgGenContType : "Advisory Content Type", +DlgGenLinkCharset : "Linked Resource Charset", +DlgGenStyle : "Style", + +// Image Dialog +DlgImgTitle : "Image Properties", +DlgImgInfoTab : "Image Info", +DlgImgBtnUpload : "Send it to the Server", +DlgImgURL : "URL", +DlgImgUpload : "Upload", +DlgImgAlt : "Alternative Text", +DlgImgWidth : "Width", +DlgImgHeight : "Height", +DlgImgLockRatio : "Lock Ratio", +DlgBtnResetSize : "Reset Size", +DlgImgBorder : "Border", +DlgImgHSpace : "HSpace", +DlgImgVSpace : "VSpace", +DlgImgAlign : "Align", +DlgImgAlignLeft : "Left", +DlgImgAlignAbsBottom: "Abs Bottom", +DlgImgAlignAbsMiddle: "Abs Middle", +DlgImgAlignBaseline : "Baseline", +DlgImgAlignBottom : "Bottom", +DlgImgAlignMiddle : "Middle", +DlgImgAlignRight : "Right", +DlgImgAlignTextTop : "Text Top", +DlgImgAlignTop : "Top", +DlgImgPreview : "Preview", +DlgImgAlertUrl : "Please type the image URL", +DlgImgLinkTab : "Link", + +// Flash Dialog +DlgFlashTitle : "Flash Properties", +DlgFlashChkPlay : "Auto Play", +DlgFlashChkLoop : "Loop", +DlgFlashChkMenu : "Enable Flash Menu", +DlgFlashScale : "Scale", +DlgFlashScaleAll : "Show all", +DlgFlashScaleNoBorder : "No Border", +DlgFlashScaleFit : "Exact Fit", + +// Link Dialog +DlgLnkWindowTitle : "Link", +DlgLnkInfoTab : "Link Info", +DlgLnkTargetTab : "Target", + +DlgLnkType : "Link Type", +DlgLnkTypeURL : "URL", +DlgLnkTypeAnchor : "Link to anchor in the text", +DlgLnkTypeEMail : "E-Mail", +DlgLnkProto : "Protocol", +DlgLnkProtoOther : "", +DlgLnkURL : "URL", +DlgLnkAnchorSel : "Select an Anchor", +DlgLnkAnchorByName : "By Anchor Name", +DlgLnkAnchorById : "By Element Id", +DlgLnkNoAnchors : "(No anchors available in the document)", +DlgLnkEMail : "E-Mail Address", +DlgLnkEMailSubject : "Message Subject", +DlgLnkEMailBody : "Message Body", +DlgLnkUpload : "Upload", +DlgLnkBtnUpload : "Send it to the Server", + +DlgLnkTarget : "Target", +DlgLnkTargetFrame : "", +DlgLnkTargetPopup : "", +DlgLnkTargetBlank : "New Window (_blank)", +DlgLnkTargetParent : "Parent Window (_parent)", +DlgLnkTargetSelf : "Same Window (_self)", +DlgLnkTargetTop : "Topmost Window (_top)", +DlgLnkTargetFrameName : "Target Frame Name", +DlgLnkPopWinName : "Popup Window Name", +DlgLnkPopWinFeat : "Popup Window Features", +DlgLnkPopResize : "Resizable", +DlgLnkPopLocation : "Location Bar", +DlgLnkPopMenu : "Menu Bar", +DlgLnkPopScroll : "Scroll Bars", +DlgLnkPopStatus : "Status Bar", +DlgLnkPopToolbar : "Toolbar", +DlgLnkPopFullScrn : "Full Screen (IE)", +DlgLnkPopDependent : "Dependent (Netscape)", +DlgLnkPopWidth : "Width", +DlgLnkPopHeight : "Height", +DlgLnkPopLeft : "Left Position", +DlgLnkPopTop : "Top Position", + +DlnLnkMsgNoUrl : "Please type the link URL", +DlnLnkMsgNoEMail : "Please type the e-mail address", +DlnLnkMsgNoAnchor : "Please select an anchor", +DlnLnkMsgInvPopName : "The popup name must begin with an alphabetic character and must not contain spaces", + +// Color Dialog +DlgColorTitle : "Select Colour", +DlgColorBtnClear : "Clear", +DlgColorHighlight : "Highlight", +DlgColorSelected : "Selected", + +// Smiley Dialog +DlgSmileyTitle : "Insert a Smiley", + +// Special Character Dialog +DlgSpecialCharTitle : "Select Special Character", + +// Table Dialog +DlgTableTitle : "Table Properties", +DlgTableRows : "Rows", +DlgTableColumns : "Columns", +DlgTableBorder : "Border size", +DlgTableAlign : "Alignment", +DlgTableAlignNotSet : "", +DlgTableAlignLeft : "Left", +DlgTableAlignCenter : "Centre", +DlgTableAlignRight : "Right", +DlgTableWidth : "Width", +DlgTableWidthPx : "pixels", +DlgTableWidthPc : "percent", +DlgTableHeight : "Height", +DlgTableCellSpace : "Cell spacing", +DlgTableCellPad : "Cell padding", +DlgTableCaption : "Caption", +DlgTableSummary : "Summary", + +// Table Cell Dialog +DlgCellTitle : "Cell Properties", +DlgCellWidth : "Width", +DlgCellWidthPx : "pixels", +DlgCellWidthPc : "percent", +DlgCellHeight : "Height", +DlgCellWordWrap : "Word Wrap", +DlgCellWordWrapNotSet : "", +DlgCellWordWrapYes : "Yes", +DlgCellWordWrapNo : "No", +DlgCellHorAlign : "Horizontal Alignment", +DlgCellHorAlignNotSet : "", +DlgCellHorAlignLeft : "Left", +DlgCellHorAlignCenter : "Centre", +DlgCellHorAlignRight: "Right", +DlgCellVerAlign : "Vertical Alignment", +DlgCellVerAlignNotSet : "", +DlgCellVerAlignTop : "Top", +DlgCellVerAlignMiddle : "Middle", +DlgCellVerAlignBottom : "Bottom", +DlgCellVerAlignBaseline : "Baseline", +DlgCellRowSpan : "Rows Span", +DlgCellCollSpan : "Columns Span", +DlgCellBackColor : "Background Colour", +DlgCellBorderColor : "Border Colour", +DlgCellBtnSelect : "Select...", + +// Find and Replace Dialog +DlgFindAndReplaceTitle : "Find and Replace", + +// Find Dialog +DlgFindTitle : "Find", +DlgFindFindBtn : "Find", +DlgFindNotFoundMsg : "The specified text was not found.", + +// Replace Dialog +DlgReplaceTitle : "Replace", +DlgReplaceFindLbl : "Find what:", +DlgReplaceReplaceLbl : "Replace with:", +DlgReplaceCaseChk : "Match case", +DlgReplaceReplaceBtn : "Replace", +DlgReplaceReplAllBtn : "Replace All", +DlgReplaceWordChk : "Match whole word", + +// Paste Operations / Dialog +PasteErrorCut : "Your browser security settings don't permit the editor to automatically execute cutting operations. Please use the keyboard for that (Ctrl+X).", +PasteErrorCopy : "Your browser security settings don't permit the editor to automatically execute copying operations. Please use the keyboard for that (Ctrl+C).", + +PasteAsText : "Paste as Plain Text", +PasteFromWord : "Paste from Word", + +DlgPasteMsg2 : "Please paste inside the following box using the keyboard (Ctrl+V) and hit OK.", +DlgPasteSec : "Because of your browser security settings, the editor is not able to access your clipboard data directly. You are required to paste it again in this window.", +DlgPasteIgnoreFont : "Ignore Font Face definitions", +DlgPasteRemoveStyles : "Remove Styles definitions", + +// Color Picker +ColorAutomatic : "Automatic", +ColorMoreColors : "More Colours...", + +// Document Properties +DocProps : "Document Properties", + +// Anchor Dialog +DlgAnchorTitle : "Anchor Properties", +DlgAnchorName : "Anchor Name", +DlgAnchorErrorName : "Please type the anchor name", + +// Speller Pages Dialog +DlgSpellNotInDic : "Not in dictionary", +DlgSpellChangeTo : "Change to", +DlgSpellBtnIgnore : "Ignore", +DlgSpellBtnIgnoreAll : "Ignore All", +DlgSpellBtnReplace : "Replace", +DlgSpellBtnReplaceAll : "Replace All", +DlgSpellBtnUndo : "Undo", +DlgSpellNoSuggestions : "- No suggestions -", +DlgSpellProgress : "Spell check in progress...", +DlgSpellNoMispell : "Spell check complete: No misspellings found", +DlgSpellNoChanges : "Spell check complete: No words changed", +DlgSpellOneChange : "Spell check complete: One word changed", +DlgSpellManyChanges : "Spell check complete: %1 words changed", + +IeSpellDownload : "Spell checker not installed. Do you want to download it now?", + +// Button Dialog +DlgButtonText : "Text (Value)", +DlgButtonType : "Type", +DlgButtonTypeBtn : "Button", +DlgButtonTypeSbm : "Submit", +DlgButtonTypeRst : "Reset", + +// Checkbox and Radio Button Dialogs +DlgCheckboxName : "Name", +DlgCheckboxValue : "Value", +DlgCheckboxSelected : "Selected", + +// Form Dialog +DlgFormName : "Name", +DlgFormAction : "Action", +DlgFormMethod : "Method", + +// Select Field Dialog +DlgSelectName : "Name", +DlgSelectValue : "Value", +DlgSelectSize : "Size", +DlgSelectLines : "lines", +DlgSelectChkMulti : "Allow multiple selections", +DlgSelectOpAvail : "Available Options", +DlgSelectOpText : "Text", +DlgSelectOpValue : "Value", +DlgSelectBtnAdd : "Add", +DlgSelectBtnModify : "Modify", +DlgSelectBtnUp : "Up", +DlgSelectBtnDown : "Down", +DlgSelectBtnSetValue : "Set as selected value", +DlgSelectBtnDelete : "Delete", + +// Textarea Dialog +DlgTextareaName : "Name", +DlgTextareaCols : "Columns", +DlgTextareaRows : "Rows", + +// Text Field Dialog +DlgTextName : "Name", +DlgTextValue : "Value", +DlgTextCharWidth : "Character Width", +DlgTextMaxChars : "Maximum Characters", +DlgTextType : "Type", +DlgTextTypeText : "Text", +DlgTextTypePass : "Password", + +// Hidden Field Dialog +DlgHiddenName : "Name", +DlgHiddenValue : "Value", + +// Bulleted List Dialog +BulletedListProp : "Bulleted List Properties", +NumberedListProp : "Numbered List Properties", +DlgLstStart : "Start", +DlgLstType : "Type", +DlgLstTypeCircle : "Circle", +DlgLstTypeDisc : "Disc", +DlgLstTypeSquare : "Square", +DlgLstTypeNumbers : "Numbers (1, 2, 3)", +DlgLstTypeLCase : "Lowercase Letters (a, b, c)", +DlgLstTypeUCase : "Uppercase Letters (A, B, C)", +DlgLstTypeSRoman : "Small Roman Numerals (i, ii, iii)", +DlgLstTypeLRoman : "Large Roman Numerals (I, II, III)", + +// Document Properties Dialog +DlgDocGeneralTab : "General", +DlgDocBackTab : "Background", +DlgDocColorsTab : "Colours and Margins", +DlgDocMetaTab : "Meta Data", + +DlgDocPageTitle : "Page Title", +DlgDocLangDir : "Language Direction", +DlgDocLangDirLTR : "Left to Right (LTR)", +DlgDocLangDirRTL : "Right to Left (RTL)", +DlgDocLangCode : "Language Code", +DlgDocCharSet : "Character Set Encoding", +DlgDocCharSetCE : "Central European", +DlgDocCharSetCT : "Chinese Traditional (Big5)", +DlgDocCharSetCR : "Cyrillic", +DlgDocCharSetGR : "Greek", +DlgDocCharSetJP : "Japanese", +DlgDocCharSetKR : "Korean", +DlgDocCharSetTR : "Turkish", +DlgDocCharSetUN : "Unicode (UTF-8)", +DlgDocCharSetWE : "Western European", +DlgDocCharSetOther : "Other Character Set Encoding", + +DlgDocDocType : "Document Type Heading", +DlgDocDocTypeOther : "Other Document Type Heading", +DlgDocIncXHTML : "Include XHTML Declarations", +DlgDocBgColor : "Background Colour", +DlgDocBgImage : "Background Image URL", +DlgDocBgNoScroll : "Nonscrolling Background", +DlgDocCText : "Text", +DlgDocCLink : "Link", +DlgDocCVisited : "Visited Link", +DlgDocCActive : "Active Link", +DlgDocMargins : "Page Margins", +DlgDocMaTop : "Top", +DlgDocMaLeft : "Left", +DlgDocMaRight : "Right", +DlgDocMaBottom : "Bottom", +DlgDocMeIndex : "Document Indexing Keywords (comma separated)", +DlgDocMeDescr : "Document Description", +DlgDocMeAuthor : "Author", +DlgDocMeCopy : "Copyright", +DlgDocPreview : "Preview", + +// Templates Dialog +Templates : "Templates", +DlgTemplatesTitle : "Content Templates", +DlgTemplatesSelMsg : "Please select the template to open in the editor
        (the actual contents will be lost):", +DlgTemplatesLoading : "Loading templates list. Please wait...", +DlgTemplatesNoTpl : "(No templates defined)", +DlgTemplatesReplace : "Replace actual contents", + +// About Dialog +DlgAboutAboutTab : "About", +DlgAboutBrowserInfoTab : "Browser Info", +DlgAboutLicenseTab : "License", +DlgAboutVersion : "version", +DlgAboutInfo : "For further information go to" +}; Property changes on: announcement/trunk/src/main/webapp/fckeditor/editor/lang/en-ca.js ___________________________________________________________________ Name: svn:eol-style + native Added: announcement/trunk/src/main/webapp/fckeditor/editor/lang/en-uk.js =================================================================== --- announcement/trunk/src/main/webapp/fckeditor/editor/lang/en-uk.js (rev 0) +++ announcement/trunk/src/main/webapp/fckeditor/editor/lang/en-uk.js 2008-06-30 02:54:27 UTC (rev 1002) @@ -0,0 +1,515 @@ +?/* + * FCKeditor - The text editor for Internet - http://www.fckeditor.net + * Copyright (C) 2003-2008 Frederico Caldeira Knabben + * + * == BEGIN LICENSE == + * + * Licensed under the terms of any of the following licenses at your + * choice: + * + * - GNU General Public License Version 2 or later (the "GPL") + * http://www.gnu.org/licenses/gpl.html + * + * - GNU Lesser General Public License Version 2.1 or later (the "LGPL") + * http://www.gnu.org/licenses/lgpl.html + * + * - Mozilla Public License Version 1.1 or later (the "MPL") + * http://www.mozilla.org/MPL/MPL-1.1.html + * + * == END LICENSE == + * + * English (United Kingdom) language file. + */ + +var FCKLang = +{ +// Language direction : "ltr" (left to right) or "rtl" (right to left). +Dir : "ltr", + +ToolbarCollapse : "Collapse Toolbar", +ToolbarExpand : "Expand Toolbar", + +// Toolbar Items and Context Menu +Save : "Save", +NewPage : "New Page", +Preview : "Preview", +Cut : "Cut", +Copy : "Copy", +Paste : "Paste", +PasteText : "Paste as plain text", +PasteWord : "Paste from Word", +Print : "Print", +SelectAll : "Select All", +RemoveFormat : "Remove Format", +InsertLinkLbl : "Link", +InsertLink : "Insert/Edit Link", +RemoveLink : "Remove Link", +Anchor : "Insert/Edit Anchor", +AnchorDelete : "Remove Anchor", +InsertImageLbl : "Image", +InsertImage : "Insert/Edit Image", +InsertFlashLbl : "Flash", +InsertFlash : "Insert/Edit Flash", +InsertTableLbl : "Table", +InsertTable : "Insert/Edit Table", +InsertLineLbl : "Line", +InsertLine : "Insert Horizontal Line", +InsertSpecialCharLbl: "Special Character", +InsertSpecialChar : "Insert Special Character", +InsertSmileyLbl : "Smiley", +InsertSmiley : "Insert Smiley", +About : "About FCKeditor", +Bold : "Bold", +Italic : "Italic", +Underline : "Underline", +StrikeThrough : "Strike Through", +Subscript : "Subscript", +Superscript : "Superscript", +LeftJustify : "Left Justify", +CenterJustify : "Centre Justify", +RightJustify : "Right Justify", +BlockJustify : "Block Justify", +DecreaseIndent : "Decrease Indent", +IncreaseIndent : "Increase Indent", +Blockquote : "Blockquote", +Undo : "Undo", +Redo : "Redo", +NumberedListLbl : "Numbered List", +NumberedList : "Insert/Remove Numbered List", +BulletedListLbl : "Bulleted List", +BulletedList : "Insert/Remove Bulleted List", +ShowTableBorders : "Show Table Borders", +ShowDetails : "Show Details", +Style : "Style", +FontFormat : "Format", +Font : "Font", +FontSize : "Size", +TextColor : "Text Colour", +BGColor : "Background Colour", +Source : "Source", +Find : "Find", +Replace : "Replace", +SpellCheck : "Check Spelling", +UniversalKeyboard : "Universal Keyboard", +PageBreakLbl : "Page Break", +PageBreak : "Insert Page Break", + +Form : "Form", +Checkbox : "Checkbox", +RadioButton : "Radio Button", +TextField : "Text Field", +Textarea : "Textarea", +HiddenField : "Hidden Field", +Button : "Button", +SelectionField : "Selection Field", +ImageButton : "Image Button", + +FitWindow : "Maximize the editor size", +ShowBlocks : "Show Blocks", + +// Context Menu +EditLink : "Edit Link", +CellCM : "Cell", +RowCM : "Row", +ColumnCM : "Column", +InsertRowAfter : "Insert Row After", +InsertRowBefore : "Insert Row Before", +DeleteRows : "Delete Rows", +InsertColumnAfter : "Insert Column After", +InsertColumnBefore : "Insert Column Before", +DeleteColumns : "Delete Columns", +InsertCellAfter : "Insert Cell After", +InsertCellBefore : "Insert Cell Before", +DeleteCells : "Delete Cells", +MergeCells : "Merge Cells", +MergeRight : "Merge Right", +MergeDown : "Merge Down", +HorizontalSplitCell : "Split Cell Horizontally", +VerticalSplitCell : "Split Cell Vertically", +TableDelete : "Delete Table", +CellProperties : "Cell Properties", +TableProperties : "Table Properties", +ImageProperties : "Image Properties", +FlashProperties : "Flash Properties", + +AnchorProp : "Anchor Properties", +ButtonProp : "Button Properties", +CheckboxProp : "Checkbox Properties", +HiddenFieldProp : "Hidden Field Properties", +RadioButtonProp : "Radio Button Properties", +ImageButtonProp : "Image Button Properties", +TextFieldProp : "Text Field Properties", +SelectionFieldProp : "Selection Field Properties", +TextareaProp : "Textarea Properties", +FormProp : "Form Properties", + +FontFormats : "Normal;Formatted;Address;Heading 1;Heading 2;Heading 3;Heading 4;Heading 5;Heading 6;Normal (DIV)", + +// Alerts and Messages +ProcessingXHTML : "Processing XHTML. Please wait...", +Done : "Done", +PasteWordConfirm : "The text you want to paste seems to be copied from Word. Do you want to clean it before pasting?", +NotCompatiblePaste : "This command is available for Internet Explorer version 5.5 or more. Do you want to paste without cleaning?", +UnknownToolbarItem : "Unknown toolbar item \"%1\"", +UnknownCommand : "Unknown command name \"%1\"", +NotImplemented : "Command not implemented", +UnknownToolbarSet : "Toolbar set \"%1\" doesn't exist", +NoActiveX : "Your browser's security settings could limit some features of the editor. You must enable the option \"Run ActiveX controls and plug-ins\". You may experience errors and notice missing features.", +BrowseServerBlocked : "The resources browser could not be opened. Make sure that all popup blockers are disabled.", +DialogBlocked : "It was not possible to open the dialog window. Make sure all popup blockers are disabled.", + +// Dialogs +DlgBtnOK : "OK", +DlgBtnCancel : "Cancel", +DlgBtnClose : "Close", +DlgBtnBrowseServer : "Browse Server", +DlgAdvancedTag : "Advanced", +DlgOpOther : "", +DlgInfoTab : "Info", +DlgAlertUrl : "Please insert the URL", + +// General Dialogs Labels +DlgGenNotSet : "", +DlgGenId : "Id", +DlgGenLangDir : "Language Direction", +DlgGenLangDirLtr : "Left to Right (LTR)", +DlgGenLangDirRtl : "Right to Left (RTL)", +DlgGenLangCode : "Language Code", +DlgGenAccessKey : "Access Key", +DlgGenName : "Name", +DlgGenTabIndex : "Tab Index", +DlgGenLongDescr : "Long Description URL", +DlgGenClass : "Stylesheet Classes", +DlgGenTitle : "Advisory Title", +DlgGenContType : "Advisory Content Type", +DlgGenLinkCharset : "Linked Resource Charset", +DlgGenStyle : "Style", + +// Image Dialog +DlgImgTitle : "Image Properties", +DlgImgInfoTab : "Image Info", +DlgImgBtnUpload : "Send it to the Server", +DlgImgURL : "URL", +DlgImgUpload : "Upload", +DlgImgAlt : "Alternative Text", +DlgImgWidth : "Width", +DlgImgHeight : "Height", +DlgImgLockRatio : "Lock Ratio", +DlgBtnResetSize : "Reset Size", +DlgImgBorder : "Border", +DlgImgHSpace : "HSpace", +DlgImgVSpace : "VSpace", +DlgImgAlign : "Align", +DlgImgAlignLeft : "Left", +DlgImgAlignAbsBottom: "Abs Bottom", +DlgImgAlignAbsMiddle: "Abs Middle", +DlgImgAlignBaseline : "Baseline", +DlgImgAlignBottom : "Bottom", +DlgImgAlignMiddle : "Middle", +DlgImgAlignRight : "Right", +DlgImgAlignTextTop : "Text Top", +DlgImgAlignTop : "Top", +DlgImgPreview : "Preview", +DlgImgAlertUrl : "Please type the image URL", +DlgImgLinkTab : "Link", + +// Flash Dialog +DlgFlashTitle : "Flash Properties", +DlgFlashChkPlay : "Auto Play", +DlgFlashChkLoop : "Loop", +DlgFlashChkMenu : "Enable Flash Menu", +DlgFlashScale : "Scale", +DlgFlashScaleAll : "Show all", +DlgFlashScaleNoBorder : "No Border", +DlgFlashScaleFit : "Exact Fit", + +// Link Dialog +DlgLnkWindowTitle : "Link", +DlgLnkInfoTab : "Link Info", +DlgLnkTargetTab : "Target", + +DlgLnkType : "Link Type", +DlgLnkTypeURL : "URL", +DlgLnkTypeAnchor : "Link to anchor in the text", +DlgLnkTypeEMail : "E-Mail", +DlgLnkProto : "Protocol", +DlgLnkProtoOther : "", +DlgLnkURL : "URL", +DlgLnkAnchorSel : "Select an Anchor", +DlgLnkAnchorByName : "By Anchor Name", +DlgLnkAnchorById : "By Element Id", +DlgLnkNoAnchors : "(No anchors available in the document)", +DlgLnkEMail : "E-Mail Address", +DlgLnkEMailSubject : "Message Subject", +DlgLnkEMailBody : "Message Body", +DlgLnkUpload : "Upload", +DlgLnkBtnUpload : "Send it to the Server", + +DlgLnkTarget : "Target", +DlgLnkTargetFrame : "", +DlgLnkTargetPopup : "", +DlgLnkTargetBlank : "New Window (_blank)", +DlgLnkTargetParent : "Parent Window (_parent)", +DlgLnkTargetSelf : "Same Window (_self)", +DlgLnkTargetTop : "Topmost Window (_top)", +DlgLnkTargetFrameName : "Target Frame Name", +DlgLnkPopWinName : "Popup Window Name", +DlgLnkPopWinFeat : "Popup Window Features", +DlgLnkPopResize : "Resizable", +DlgLnkPopLocation : "Location Bar", +DlgLnkPopMenu : "Menu Bar", +DlgLnkPopScroll : "Scroll Bars", +DlgLnkPopStatus : "Status Bar", +DlgLnkPopToolbar : "Toolbar", +DlgLnkPopFullScrn : "Full Screen (IE)", +DlgLnkPopDependent : "Dependent (Netscape)", +DlgLnkPopWidth : "Width", +DlgLnkPopHeight : "Height", +DlgLnkPopLeft : "Left Position", +DlgLnkPopTop : "Top Position", + +DlnLnkMsgNoUrl : "Please type the link URL", +DlnLnkMsgNoEMail : "Please type the e-mail address", +DlnLnkMsgNoAnchor : "Please select an anchor", +DlnLnkMsgInvPopName : "The popup name must begin with an alphabetic character and must not contain spaces", + +// Color Dialog +DlgColorTitle : "Select Colour", +DlgColorBtnClear : "Clear", +DlgColorHighlight : "Highlight", +DlgColorSelected : "Selected", + +// Smiley Dialog +DlgSmileyTitle : "Insert a Smiley", + +// Special Character Dialog +DlgSpecialCharTitle : "Select Special Character", + +// Table Dialog +DlgTableTitle : "Table Properties", +DlgTableRows : "Rows", +DlgTableColumns : "Columns", +DlgTableBorder : "Border size", +DlgTableAlign : "Alignment", +DlgTableAlignNotSet : "", +DlgTableAlignLeft : "Left", +DlgTableAlignCenter : "Centre", +DlgTableAlignRight : "Right", +DlgTableWidth : "Width", +DlgTableWidthPx : "pixels", +DlgTableWidthPc : "percent", +DlgTableHeight : "Height", +DlgTableCellSpace : "Cell spacing", +DlgTableCellPad : "Cell padding", +DlgTableCaption : "Caption", +DlgTableSummary : "Summary", + +// Table Cell Dialog +DlgCellTitle : "Cell Properties", +DlgCellWidth : "Width", +DlgCellWidthPx : "pixels", +DlgCellWidthPc : "percent", +DlgCellHeight : "Height", +DlgCellWordWrap : "Word Wrap", +DlgCellWordWrapNotSet : "", +DlgCellWordWrapYes : "Yes", +DlgCellWordWrapNo : "No", +DlgCellHorAlign : "Horizontal Alignment", +DlgCellHorAlignNotSet : "", +DlgCellHorAlignLeft : "Left", +DlgCellHorAlignCenter : "Centre", +DlgCellHorAlignRight: "Right", +DlgCellVerAlign : "Vertical Alignment", +DlgCellVerAlignNotSet : "", +DlgCellVerAlignTop : "Top", +DlgCellVerAlignMiddle : "Middle", +DlgCellVerAlignBottom : "Bottom", +DlgCellVerAlignBaseline : "Baseline", +DlgCellRowSpan : "Rows Span", +DlgCellCollSpan : "Columns Span", +DlgCellBackColor : "Background Colour", +DlgCellBorderColor : "Border Colour", +DlgCellBtnSelect : "Select...", + +// Find and Replace Dialog +DlgFindAndReplaceTitle : "Find and Replace", + +// Find Dialog +DlgFindTitle : "Find", +DlgFindFindBtn : "Find", +DlgFindNotFoundMsg : "The specified text was not found.", + +// Replace Dialog +DlgReplaceTitle : "Replace", +DlgReplaceFindLbl : "Find what:", +DlgReplaceReplaceLbl : "Replace with:", +DlgReplaceCaseChk : "Match case", +DlgReplaceReplaceBtn : "Replace", +DlgReplaceReplAllBtn : "Replace All", +DlgReplaceWordChk : "Match whole word", + +// Paste Operations / Dialog +PasteErrorCut : "Your browser security settings don't permit the editor to automatically execute cutting operations. Please use the keyboard for that (Ctrl+X).", +PasteErrorCopy : "Your browser security settings don't permit the editor to automatically execute copying operations. Please use the keyboard for that (Ctrl+C).", + +PasteAsText : "Paste as Plain Text", +PasteFromWord : "Paste from Word", + +DlgPasteMsg2 : "Please paste inside the following box using the keyboard (Ctrl+V) and hit OK.", +DlgPasteSec : "Because of your browser security settings, the editor is not able to access your clipboard data directly. You are required to paste it again in this window.", +DlgPasteIgnoreFont : "Ignore Font Face definitions", +DlgPasteRemoveStyles : "Remove Styles definitions", + +// Color Picker +ColorAutomatic : "Automatic", +ColorMoreColors : "More Colours...", + +// Document Properties +DocProps : "Document Properties", + +// Anchor Dialog +DlgAnchorTitle : "Anchor Properties", +DlgAnchorName : "Anchor Name", +DlgAnchorErrorName : "Please type the anchor name", + +// Speller Pages Dialog +DlgSpellNotInDic : "Not in dictionary", +DlgSpellChangeTo : "Change to", +DlgSpellBtnIgnore : "Ignore", +DlgSpellBtnIgnoreAll : "Ignore All", +DlgSpellBtnReplace : "Replace", +DlgSpellBtnReplaceAll : "Replace All", +DlgSpellBtnUndo : "Undo", +DlgSpellNoSuggestions : "- No suggestions -", +DlgSpellProgress : "Spell check in progress...", +DlgSpellNoMispell : "Spell check complete: No misspellings found", +DlgSpellNoChanges : "Spell check complete: No words changed", +DlgSpellOneChange : "Spell check complete: One word changed", +DlgSpellManyChanges : "Spell check complete: %1 words changed", + +IeSpellDownload : "Spell checker not installed. Do you want to download it now?", + +// Button Dialog +DlgButtonText : "Text (Value)", +DlgButtonType : "Type", +DlgButtonTypeBtn : "Button", +DlgButtonTypeSbm : "Submit", +DlgButtonTypeRst : "Reset", + +// Checkbox and Radio Button Dialogs +DlgCheckboxName : "Name", +DlgCheckboxValue : "Value", +DlgCheckboxSelected : "Selected", + +// Form Dialog +DlgFormName : "Name", +DlgFormAction : "Action", +DlgFormMethod : "Method", + +// Select Field Dialog +DlgSelectName : "Name", +DlgSelectValue : "Value", +DlgSelectSize : "Size", +DlgSelectLines : "lines", +DlgSelectChkMulti : "Allow multiple selections", +DlgSelectOpAvail : "Available Options", +DlgSelectOpText : "Text", +DlgSelectOpValue : "Value", +DlgSelectBtnAdd : "Add", +DlgSelectBtnModify : "Modify", +DlgSelectBtnUp : "Up", +DlgSelectBtnDown : "Down", +DlgSelectBtnSetValue : "Set as selected value", +DlgSelectBtnDelete : "Delete", + +// Textarea Dialog +DlgTextareaName : "Name", +DlgTextareaCols : "Columns", +DlgTextareaRows : "Rows", + +// Text Field Dialog +DlgTextName : "Name", +DlgTextValue : "Value", +DlgTextCharWidth : "Character Width", +DlgTextMaxChars : "Maximum Characters", +DlgTextType : "Type", +DlgTextTypeText : "Text", +DlgTextTypePass : "Password", + +// Hidden Field Dialog +DlgHiddenName : "Name", +DlgHiddenValue : "Value", + +// Bulleted List Dialog +BulletedListProp : "Bulleted List Properties", +NumberedListProp : "Numbered List Properties", +DlgLstStart : "Start", +DlgLstType : "Type", +DlgLstTypeCircle : "Circle", +DlgLstTypeDisc : "Disc", +DlgLstTypeSquare : "Square", +DlgLstTypeNumbers : "Numbers (1, 2, 3)", +DlgLstTypeLCase : "Lowercase Letters (a, b, c)", +DlgLstTypeUCase : "Uppercase Letters (A, B, C)", +DlgLstTypeSRoman : "Small Roman Numerals (i, ii, iii)", +DlgLstTypeLRoman : "Large Roman Numerals (I, II, III)", + +// Document Properties Dialog +DlgDocGeneralTab : "General", +DlgDocBackTab : "Background", +DlgDocColorsTab : "Colours and Margins", +DlgDocMetaTab : "Meta Data", + +DlgDocPageTitle : "Page Title", +DlgDocLangDir : "Language Direction", +DlgDocLangDirLTR : "Left to Right (LTR)", +DlgDocLangDirRTL : "Right to Left (RTL)", +DlgDocLangCode : "Language Code", +DlgDocCharSet : "Character Set Encoding", +DlgDocCharSetCE : "Central European", +DlgDocCharSetCT : "Chinese Traditional (Big5)", +DlgDocCharSetCR : "Cyrillic", +DlgDocCharSetGR : "Greek", +DlgDocCharSetJP : "Japanese", +DlgDocCharSetKR : "Korean", +DlgDocCharSetTR : "Turkish", +DlgDocCharSetUN : "Unicode (UTF-8)", +DlgDocCharSetWE : "Western European", +DlgDocCharSetOther : "Other Character Set Encoding", + +DlgDocDocType : "Document Type Heading", +DlgDocDocTypeOther : "Other Document Type Heading", +DlgDocIncXHTML : "Include XHTML Declarations", +DlgDocBgColor : "Background Colour", +DlgDocBgImage : "Background Image URL", +DlgDocBgNoScroll : "Nonscrolling Background", +DlgDocCText : "Text", +DlgDocCLink : "Link", +DlgDocCVisited : "Visited Link", +DlgDocCActive : "Active Link", +DlgDocMargins : "Page Margins", +DlgDocMaTop : "Top", +DlgDocMaLeft : "Left", +DlgDocMaRight : "Right", +DlgDocMaBottom : "Bottom", +DlgDocMeIndex : "Document Indexing Keywords (comma separated)", +DlgDocMeDescr : "Document Description", +DlgDocMeAuthor : "Author", +DlgDocMeCopy : "Copyright", +DlgDocPreview : "Preview", + +// Templates Dialog +Templates : "Templates", +DlgTemplatesTitle : "Content Templates", +DlgTemplatesSelMsg : "Please select the template to open in the editor
        (the actual contents will be lost):", +DlgTemplatesLoading : "Loading templates list. Please wait...", +DlgTemplatesNoTpl : "(No templates defined)", +DlgTemplatesReplace : "Replace actual contents", + +// About Dialog +DlgAboutAboutTab : "About", +DlgAboutBrowserInfoTab : "Browser Info", +DlgAboutLicenseTab : "License", +DlgAboutVersion : "version", +DlgAboutInfo : "For further information go to" +}; Property changes on: announcement/trunk/src/main/webapp/fckeditor/editor/lang/en-uk.js ___________________________________________________________________ Name: svn:eol-style + native Added: announcement/trunk/src/main/webapp/fckeditor/editor/lang/en.js =================================================================== --- announcement/trunk/src/main/webapp/fckeditor/editor/lang/en.js (rev 0) +++ announcement/trunk/src/main/webapp/fckeditor/editor/lang/en.js 2008-06-30 02:54:27 UTC (rev 1002) @@ -0,0 +1,515 @@ +?/* + * FCKeditor - The text editor for Internet - http://www.fckeditor.net + * Copyright (C) 2003-2008 Frederico Caldeira Knabben + * + * == BEGIN LICENSE == + * + * Licensed under the terms of any of the following licenses at your + * choice: + * + * - GNU General Public License Version 2 or later (the "GPL") + * http://www.gnu.org/licenses/gpl.html + * + * - GNU Lesser General Public License Version 2.1 or later (the "LGPL") + * http://www.gnu.org/licenses/lgpl.html + * + * - Mozilla Public License Version 1.1 or later (the "MPL") + * http://www.mozilla.org/MPL/MPL-1.1.html + * + * == END LICENSE == + * + * English language file. + */ + +var FCKLang = +{ +// Language direction : "ltr" (left to right) or "rtl" (right to left). +Dir : "ltr", + +ToolbarCollapse : "Collapse Toolbar", +ToolbarExpand : "Expand Toolbar", + +// Toolbar Items and Context Menu +Save : "Save", +NewPage : "New Page", +Preview : "Preview", +Cut : "Cut", +Copy : "Copy", +Paste : "Paste", +PasteText : "Paste as plain text", +PasteWord : "Paste from Word", +Print : "Print", +SelectAll : "Select All", +RemoveFormat : "Remove Format", +InsertLinkLbl : "Link", +InsertLink : "Insert/Edit Link", +RemoveLink : "Remove Link", +Anchor : "Insert/Edit Anchor", +AnchorDelete : "Remove Anchor", +InsertImageLbl : "Image", +InsertImage : "Insert/Edit Image", +InsertFlashLbl : "Flash", +InsertFlash : "Insert/Edit Flash", +InsertTableLbl : "Table", +InsertTable : "Insert/Edit Table", +InsertLineLbl : "Line", +InsertLine : "Insert Horizontal Line", +InsertSpecialCharLbl: "Special Character", +InsertSpecialChar : "Insert Special Character", +InsertSmileyLbl : "Smiley", +InsertSmiley : "Insert Smiley", +About : "About FCKeditor", +Bold : "Bold", +Italic : "Italic", +Underline : "Underline", +StrikeThrough : "Strike Through", +Subscript : "Subscript", +Superscript : "Superscript", +LeftJustify : "Left Justify", +CenterJustify : "Center Justify", +RightJustify : "Right Justify", +BlockJustify : "Block Justify", +DecreaseIndent : "Decrease Indent", +IncreaseIndent : "Increase Indent", +Blockquote : "Blockquote", +Undo : "Undo", +Redo : "Redo", +NumberedListLbl : "Numbered List", +NumberedList : "Insert/Remove Numbered List", +BulletedListLbl : "Bulleted List", +BulletedList : "Insert/Remove Bulleted List", +ShowTableBorders : "Show Table Borders", +ShowDetails : "Show Details", +Style : "Style", +FontFormat : "Format", +Font : "Font", +FontSize : "Size", +TextColor : "Text Color", +BGColor : "Background Color", +Source : "Source", +Find : "Find", +Replace : "Replace", +SpellCheck : "Check Spelling", +UniversalKeyboard : "Universal Keyboard", +PageBreakLbl : "Page Break", +PageBreak : "Insert Page Break", + +Form : "Form", +Checkbox : "Checkbox", +RadioButton : "Radio Button", +TextField : "Text Field", +Textarea : "Textarea", +HiddenField : "Hidden Field", +Button : "Button", +SelectionField : "Selection Field", +ImageButton : "Image Button", + +FitWindow : "Maximize the editor size", +ShowBlocks : "Show Blocks", + +// Context Menu +EditLink : "Edit Link", +CellCM : "Cell", +RowCM : "Row", +ColumnCM : "Column", +InsertRowAfter : "Insert Row After", +InsertRowBefore : "Insert Row Before", +DeleteRows : "Delete Rows", +InsertColumnAfter : "Insert Column After", +InsertColumnBefore : "Insert Column Before", +DeleteColumns : "Delete Columns", +InsertCellAfter : "Insert Cell After", +InsertCellBefore : "Insert Cell Before", +DeleteCells : "Delete Cells", +MergeCells : "Merge Cells", +MergeRight : "Merge Right", +MergeDown : "Merge Down", +HorizontalSplitCell : "Split Cell Horizontally", +VerticalSplitCell : "Split Cell Vertically", +TableDelete : "Delete Table", +CellProperties : "Cell Properties", +TableProperties : "Table Properties", +ImageProperties : "Image Properties", +FlashProperties : "Flash Properties", + +AnchorProp : "Anchor Properties", +ButtonProp : "Button Properties", +CheckboxProp : "Checkbox Properties", +HiddenFieldProp : "Hidden Field Properties", +RadioButtonProp : "Radio Button Properties", +ImageButtonProp : "Image Button Properties", +TextFieldProp : "Text Field Properties", +SelectionFieldProp : "Selection Field Properties", +TextareaProp : "Textarea Properties", +FormProp : "Form Properties", + +FontFormats : "Normal;Formatted;Address;Heading 1;Heading 2;Heading 3;Heading 4;Heading 5;Heading 6;Normal (DIV)", + +// Alerts and Messages +ProcessingXHTML : "Processing XHTML. Please wait...", +Done : "Done", +PasteWordConfirm : "The text you want to paste seems to be copied from Word. Do you want to clean it before pasting?", +NotCompatiblePaste : "This command is available for Internet Explorer version 5.5 or more. Do you want to paste without cleaning?", +UnknownToolbarItem : "Unknown toolbar item \"%1\"", +UnknownCommand : "Unknown command name \"%1\"", +NotImplemented : "Command not implemented", +UnknownToolbarSet : "Toolbar set \"%1\" doesn't exist", +NoActiveX : "Your browser's security settings could limit some features of the editor. You must enable the option \"Run ActiveX controls and plug-ins\". You may experience errors and notice missing features.", +BrowseServerBlocked : "The resources browser could not be opened. Make sure that all popup blockers are disabled.", +DialogBlocked : "It was not possible to open the dialog window. Make sure all popup blockers are disabled.", + +// Dialogs +DlgBtnOK : "OK", +DlgBtnCancel : "Cancel", +DlgBtnClose : "Close", +DlgBtnBrowseServer : "Browse Server", +DlgAdvancedTag : "Advanced", +DlgOpOther : "", +DlgInfoTab : "Info", +DlgAlertUrl : "Please insert the URL", + +// General Dialogs Labels +DlgGenNotSet : "", +DlgGenId : "Id", +DlgGenLangDir : "Language Direction", +DlgGenLangDirLtr : "Left to Right (LTR)", +DlgGenLangDirRtl : "Right to Left (RTL)", +DlgGenLangCode : "Language Code", +DlgGenAccessKey : "Access Key", +DlgGenName : "Name", +DlgGenTabIndex : "Tab Index", +DlgGenLongDescr : "Long Description URL", +DlgGenClass : "Stylesheet Classes", +DlgGenTitle : "Advisory Title", +DlgGenContType : "Advisory Content Type", +DlgGenLinkCharset : "Linked Resource Charset", +DlgGenStyle : "Style", + +// Image Dialog +DlgImgTitle : "Image Properties", +DlgImgInfoTab : "Image Info", +DlgImgBtnUpload : "Send it to the Server", +DlgImgURL : "URL", +DlgImgUpload : "Upload", +DlgImgAlt : "Alternative Text", +DlgImgWidth : "Width", +DlgImgHeight : "Height", +DlgImgLockRatio : "Lock Ratio", +DlgBtnResetSize : "Reset Size", +DlgImgBorder : "Border", +DlgImgHSpace : "HSpace", +DlgImgVSpace : "VSpace", +DlgImgAlign : "Align", +DlgImgAlignLeft : "Left", +DlgImgAlignAbsBottom: "Abs Bottom", +DlgImgAlignAbsMiddle: "Abs Middle", +DlgImgAlignBaseline : "Baseline", +DlgImgAlignBottom : "Bottom", +DlgImgAlignMiddle : "Middle", +DlgImgAlignRight : "Right", +DlgImgAlignTextTop : "Text Top", +DlgImgAlignTop : "Top", +DlgImgPreview : "Preview", +DlgImgAlertUrl : "Please type the image URL", +DlgImgLinkTab : "Link", + +// Flash Dialog +DlgFlashTitle : "Flash Properties", +DlgFlashChkPlay : "Auto Play", +DlgFlashChkLoop : "Loop", +DlgFlashChkMenu : "Enable Flash Menu", +DlgFlashScale : "Scale", +DlgFlashScaleAll : "Show all", +DlgFlashScaleNoBorder : "No Border", +DlgFlashScaleFit : "Exact Fit", + +// Link Dialog +DlgLnkWindowTitle : "Link", +DlgLnkInfoTab : "Link Info", +DlgLnkTargetTab : "Target", + +DlgLnkType : "Link Type", +DlgLnkTypeURL : "URL", +DlgLnkTypeAnchor : "Link to anchor in the text", +DlgLnkTypeEMail : "E-Mail", +DlgLnkProto : "Protocol", +DlgLnkProtoOther : "", +DlgLnkURL : "URL", +DlgLnkAnchorSel : "Select an Anchor", +DlgLnkAnchorByName : "By Anchor Name", +DlgLnkAnchorById : "By Element Id", +DlgLnkNoAnchors : "(No anchors available in the document)", +DlgLnkEMail : "E-Mail Address", +DlgLnkEMailSubject : "Message Subject", +DlgLnkEMailBody : "Message Body", +DlgLnkUpload : "Upload", +DlgLnkBtnUpload : "Send it to the Server", + +DlgLnkTarget : "Target", +DlgLnkTargetFrame : "", +DlgLnkTargetPopup : "", +DlgLnkTargetBlank : "New Window (_blank)", +DlgLnkTargetParent : "Parent Window (_parent)", +DlgLnkTargetSelf : "Same Window (_self)", +DlgLnkTargetTop : "Topmost Window (_top)", +DlgLnkTargetFrameName : "Target Frame Name", +DlgLnkPopWinName : "Popup Window Name", +DlgLnkPopWinFeat : "Popup Window Features", +DlgLnkPopResize : "Resizable", +DlgLnkPopLocation : "Location Bar", +DlgLnkPopMenu : "Menu Bar", +DlgLnkPopScroll : "Scroll Bars", +DlgLnkPopStatus : "Status Bar", +DlgLnkPopToolbar : "Toolbar", +DlgLnkPopFullScrn : "Full Screen (IE)", +DlgLnkPopDependent : "Dependent (Netscape)", +DlgLnkPopWidth : "Width", +DlgLnkPopHeight : "Height", +DlgLnkPopLeft : "Left Position", +DlgLnkPopTop : "Top Position", + +DlnLnkMsgNoUrl : "Please type the link URL", +DlnLnkMsgNoEMail : "Please type the e-mail address", +DlnLnkMsgNoAnchor : "Please select an anchor", +DlnLnkMsgInvPopName : "The popup name must begin with an alphabetic character and must not contain spaces", + +// Color Dialog +DlgColorTitle : "Select Color", +DlgColorBtnClear : "Clear", +DlgColorHighlight : "Highlight", +DlgColorSelected : "Selected", + +// Smiley Dialog +DlgSmileyTitle : "Insert a Smiley", + +// Special Character Dialog +DlgSpecialCharTitle : "Select Special Character", + +// Table Dialog +DlgTableTitle : "Table Properties", +DlgTableRows : "Rows", +DlgTableColumns : "Columns", +DlgTableBorder : "Border size", +DlgTableAlign : "Alignment", +DlgTableAlignNotSet : "", +DlgTableAlignLeft : "Left", +DlgTableAlignCenter : "Center", +DlgTableAlignRight : "Right", +DlgTableWidth : "Width", +DlgTableWidthPx : "pixels", +DlgTableWidthPc : "percent", +DlgTableHeight : "Height", +DlgTableCellSpace : "Cell spacing", +DlgTableCellPad : "Cell padding", +DlgTableCaption : "Caption", +DlgTableSummary : "Summary", + +// Table Cell Dialog +DlgCellTitle : "Cell Properties", +DlgCellWidth : "Width", +DlgCellWidthPx : "pixels", +DlgCellWidthPc : "percent", +DlgCellHeight : "Height", +DlgCellWordWrap : "Word Wrap", +DlgCellWordWrapNotSet : "", +DlgCellWordWrapYes : "Yes", +DlgCellWordWrapNo : "No", +DlgCellHorAlign : "Horizontal Alignment", +DlgCellHorAlignNotSet : "", +DlgCellHorAlignLeft : "Left", +DlgCellHorAlignCenter : "Center", +DlgCellHorAlignRight: "Right", +DlgCellVerAlign : "Vertical Alignment", +DlgCellVerAlignNotSet : "", +DlgCellVerAlignTop : "Top", +DlgCellVerAlignMiddle : "Middle", +DlgCellVerAlignBottom : "Bottom", +DlgCellVerAlignBaseline : "Baseline", +DlgCellRowSpan : "Rows Span", +DlgCellCollSpan : "Columns Span", +DlgCellBackColor : "Background Color", +DlgCellBorderColor : "Border Color", +DlgCellBtnSelect : "Select...", + +// Find and Replace Dialog +DlgFindAndReplaceTitle : "Find and Replace", + +// Find Dialog +DlgFindTitle : "Find", +DlgFindFindBtn : "Find", +DlgFindNotFoundMsg : "The specified text was not found.", + +// Replace Dialog +DlgReplaceTitle : "Replace", +DlgReplaceFindLbl : "Find what:", +DlgReplaceReplaceLbl : "Replace with:", +DlgReplaceCaseChk : "Match case", +DlgReplaceReplaceBtn : "Replace", +DlgReplaceReplAllBtn : "Replace All", +DlgReplaceWordChk : "Match whole word", + +// Paste Operations / Dialog +PasteErrorCut : "Your browser security settings don't permit the editor to automatically execute cutting operations. Please use the keyboard for that (Ctrl+X).", +PasteErrorCopy : "Your browser security settings don't permit the editor to automatically execute copying operations. Please use the keyboard for that (Ctrl+C).", + +PasteAsText : "Paste as Plain Text", +PasteFromWord : "Paste from Word", + +DlgPasteMsg2 : "Please paste inside the following box using the keyboard (Ctrl+V) and hit OK.", +DlgPasteSec : "Because of your browser security settings, the editor is not able to access your clipboard data directly. You are required to paste it again in this window.", +DlgPasteIgnoreFont : "Ignore Font Face definitions", +DlgPasteRemoveStyles : "Remove Styles definitions", + +// Color Picker +ColorAutomatic : "Automatic", +ColorMoreColors : "More Colors...", + +// Document Properties +DocProps : "Document Properties", + +// Anchor Dialog +DlgAnchorTitle : "Anchor Properties", +DlgAnchorName : "Anchor Name", +DlgAnchorErrorName : "Please type the anchor name", + +// Speller Pages Dialog +DlgSpellNotInDic : "Not in dictionary", +DlgSpellChangeTo : "Change to", +DlgSpellBtnIgnore : "Ignore", +DlgSpellBtnIgnoreAll : "Ignore All", +DlgSpellBtnReplace : "Replace", +DlgSpellBtnReplaceAll : "Replace All", +DlgSpellBtnUndo : "Undo", +DlgSpellNoSuggestions : "- No suggestions -", +DlgSpellProgress : "Spell check in progress...", +DlgSpellNoMispell : "Spell check complete: No misspellings found", +DlgSpellNoChanges : "Spell check complete: No words changed", +DlgSpellOneChange : "Spell check complete: One word changed", +DlgSpellManyChanges : "Spell check complete: %1 words changed", + +IeSpellDownload : "Spell checker not installed. Do you want to download it now?", + +// Button Dialog +DlgButtonText : "Text (Value)", +DlgButtonType : "Type", +DlgButtonTypeBtn : "Button", +DlgButtonTypeSbm : "Submit", +DlgButtonTypeRst : "Reset", + +// Checkbox and Radio Button Dialogs +DlgCheckboxName : "Name", +DlgCheckboxValue : "Value", +DlgCheckboxSelected : "Selected", + +// Form Dialog +DlgFormName : "Name", +DlgFormAction : "Action", +DlgFormMethod : "Method", + +// Select Field Dialog +DlgSelectName : "Name", +DlgSelectValue : "Value", +DlgSelectSize : "Size", +DlgSelectLines : "lines", +DlgSelectChkMulti : "Allow multiple selections", +DlgSelectOpAvail : "Available Options", +DlgSelectOpText : "Text", +DlgSelectOpValue : "Value", +DlgSelectBtnAdd : "Add", +DlgSelectBtnModify : "Modify", +DlgSelectBtnUp : "Up", +DlgSelectBtnDown : "Down", +DlgSelectBtnSetValue : "Set as selected value", +DlgSelectBtnDelete : "Delete", + +// Textarea Dialog +DlgTextareaName : "Name", +DlgTextareaCols : "Columns", +DlgTextareaRows : "Rows", + +// Text Field Dialog +DlgTextName : "Name", +DlgTextValue : "Value", +DlgTextCharWidth : "Character Width", +DlgTextMaxChars : "Maximum Characters", +DlgTextType : "Type", +DlgTextTypeText : "Text", +DlgTextTypePass : "Password", + +// Hidden Field Dialog +DlgHiddenName : "Name", +DlgHiddenValue : "Value", + +// Bulleted List Dialog +BulletedListProp : "Bulleted List Properties", +NumberedListProp : "Numbered List Properties", +DlgLstStart : "Start", +DlgLstType : "Type", +DlgLstTypeCircle : "Circle", +DlgLstTypeDisc : "Disc", +DlgLstTypeSquare : "Square", +DlgLstTypeNumbers : "Numbers (1, 2, 3)", +DlgLstTypeLCase : "Lowercase Letters (a, b, c)", +DlgLstTypeUCase : "Uppercase Letters (A, B, C)", +DlgLstTypeSRoman : "Small Roman Numerals (i, ii, iii)", +DlgLstTypeLRoman : "Large Roman Numerals (I, II, III)", + +// Document Properties Dialog +DlgDocGeneralTab : "General", +DlgDocBackTab : "Background", +DlgDocColorsTab : "Colors and Margins", +DlgDocMetaTab : "Meta Data", + +DlgDocPageTitle : "Page Title", +DlgDocLangDir : "Language Direction", +DlgDocLangDirLTR : "Left to Right (LTR)", +DlgDocLangDirRTL : "Right to Left (RTL)", +DlgDocLangCode : "Language Code", +DlgDocCharSet : "Character Set Encoding", +DlgDocCharSetCE : "Central European", +DlgDocCharSetCT : "Chinese Traditional (Big5)", +DlgDocCharSetCR : "Cyrillic", +DlgDocCharSetGR : "Greek", +DlgDocCharSetJP : "Japanese", +DlgDocCharSetKR : "Korean", +DlgDocCharSetTR : "Turkish", +DlgDocCharSetUN : "Unicode (UTF-8)", +DlgDocCharSetWE : "Western European", +DlgDocCharSetOther : "Other Character Set Encoding", + +DlgDocDocType : "Document Type Heading", +DlgDocDocTypeOther : "Other Document Type Heading", +DlgDocIncXHTML : "Include XHTML Declarations", +DlgDocBgColor : "Background Color", +DlgDocBgImage : "Background Image URL", +DlgDocBgNoScroll : "Nonscrolling Background", +DlgDocCText : "Text", +DlgDocCLink : "Link", +DlgDocCVisited : "Visited Link", +DlgDocCActive : "Active Link", +DlgDocMargins : "Page Margins", +DlgDocMaTop : "Top", +DlgDocMaLeft : "Left", +DlgDocMaRight : "Right", +DlgDocMaBottom : "Bottom", +DlgDocMeIndex : "Document Indexing Keywords (comma separated)", +DlgDocMeDescr : "Document Description", +DlgDocMeAuthor : "Author", +DlgDocMeCopy : "Copyright", +DlgDocPreview : "Preview", + +// Templates Dialog +Templates : "Templates", +DlgTemplatesTitle : "Content Templates", +DlgTemplatesSelMsg : "Please select the template to open in the editor
        (the actual contents will be lost):", +DlgTemplatesLoading : "Loading templates list. Please wait...", +DlgTemplatesNoTpl : "(No templates defined)", +DlgTemplatesReplace : "Replace actual contents", + +// About Dialog +DlgAboutAboutTab : "About", +DlgAboutBrowserInfoTab : "Browser Info", +DlgAboutLicenseTab : "License", +DlgAboutVersion : "version", +DlgAboutInfo : "For further information go to" +}; Property changes on: announcement/trunk/src/main/webapp/fckeditor/editor/lang/en.js ___________________________________________________________________ Name: svn:eol-style + native Added: announcement/trunk/src/main/webapp/fckeditor/editor/lang/eo.js =================================================================== --- announcement/trunk/src/main/webapp/fckeditor/editor/lang/eo.js (rev 0) +++ announcement/trunk/src/main/webapp/fckeditor/editor/lang/eo.js 2008-06-30 02:54:27 UTC (rev 1002) @@ -0,0 +1,515 @@ +?/* + * FCKeditor - The text editor for Internet - http://www.fckeditor.net + * Copyright (C) 2003-2008 Frederico Caldeira Knabben + * + * == BEGIN LICENSE == + * + * Licensed under the terms of any of the following licenses at your + * choice: + * + * - GNU General Public License Version 2 or later (the "GPL") + * http://www.gnu.org/licenses/gpl.html + * + * - GNU Lesser General Public License Version 2.1 or later (the "LGPL") + * http://www.gnu.org/licenses/lgpl.html + * + * - Mozilla Public License Version 1.1 or later (the "MPL") + * http://www.mozilla.org/MPL/MPL-1.1.html + * + * == END LICENSE == + * + * Esperanto language file. + */ + +var FCKLang = +{ +// Language direction : "ltr" (left to right) or "rtl" (right to left). +Dir : "ltr", + +ToolbarCollapse : "Kaŝi Ilobreton", +ToolbarExpand : "Vidigi Ilojn", + +// Toolbar Items and Context Menu +Save : "Sekurigi", +NewPage : "Nova Paĝo", +Preview : "Vidigi Aspekton", +Cut : "Eltondi", +Copy : "Kopii", +Paste : "Interglui", +PasteText : "Interglui kiel Tekston", +PasteWord : "Interglui el Word", +Print : "Presi", +SelectAll : "Elekti ĉion", +RemoveFormat : "Forigi Formaton", +InsertLinkLbl : "Ligilo", +InsertLink : "Enmeti/Ŝanĝi Ligilon", +RemoveLink : "Forigi Ligilon", +Anchor : "Enmeti/Ŝanĝi Ankron", +AnchorDelete : "Remove Anchor", //MISSING +InsertImageLbl : "Bildo", +InsertImage : "Enmeti/Ŝanĝi Bildon", +InsertFlashLbl : "Flash", //MISSING +InsertFlash : "Insert/Edit Flash", //MISSING +InsertTableLbl : "Tabelo", +InsertTable : "Enmeti/Ŝanĝi Tabelon", +InsertLineLbl : "Horizonta Linio", +InsertLine : "Enmeti Horizonta Linio", +InsertSpecialCharLbl: "Speciala Signo", +InsertSpecialChar : "Enmeti Specialan Signon", +InsertSmileyLbl : "Mienvinjeto", +InsertSmiley : "Enmeti Mienvinjeton", +About : "Pri FCKeditor", +Bold : "Grasa", +Italic : "Kursiva", +Underline : "Substreko", +StrikeThrough : "Trastreko", +Subscript : "Subskribo", +Superscript : "Superskribo", +LeftJustify : "Maldekstrigi", +CenterJustify : "Centrigi", +RightJustify : "Dekstrigi", +BlockJustify : "Ĝisrandigi Ambaŭflanke", +DecreaseIndent : "Malpligrandigi Krommarĝenon", +IncreaseIndent : "Pligrandigi Krommarĝenon", +Blockquote : "Blockquote", //MISSING +Undo : "Malfari", +Redo : "Refari", +NumberedListLbl : "Numera Listo", +NumberedList : "Enmeti/Forigi Numeran Liston", +BulletedListLbl : "Bula Listo", +BulletedList : "Enmeti/Forigi Bulan Liston", +ShowTableBorders : "Vidigi Borderojn de Tabelo", +ShowDetails : "Vidigi Detalojn", +Style : "Stilo", +FontFormat : "Formato", +Font : "Tiparo", +FontSize : "Grando", +TextColor : "Teksta Koloro", +BGColor : "Fona Koloro", +Source : "Fonto", +Find : "Serĉi", +Replace : "Anstataŭigi", +SpellCheck : "Literumada Kontrolilo", +UniversalKeyboard : "Universala Klavaro", +PageBreakLbl : "Page Break", //MISSING +PageBreak : "Insert Page Break", //MISSING + +Form : "Formularo", +Checkbox : "Markobutono", +RadioButton : "Radiobutono", +TextField : "Teksta kampo", +Textarea : "Teksta Areo", +HiddenField : "Kaŝita Kampo", +Button : "Butono", +SelectionField : "Elekta Kampo", +ImageButton : "Bildbutono", + +FitWindow : "Maximize the editor size", //MISSING +ShowBlocks : "Show Blocks", //MISSING + +// Context Menu +EditLink : "Modifier Ligilon", +CellCM : "Cell", //MISSING +RowCM : "Row", //MISSING +ColumnCM : "Column", //MISSING +InsertRowAfter : "Insert Row After", //MISSING +InsertRowBefore : "Insert Row Before", //MISSING +DeleteRows : "Forigi Liniojn", +InsertColumnAfter : "Insert Column After", //MISSING +InsertColumnBefore : "Insert Column Before", //MISSING +DeleteColumns : "Forigi Kolumnojn", +InsertCellAfter : "Insert Cell After", //MISSING +InsertCellBefore : "Insert Cell Before", //MISSING +DeleteCells : "Forigi Ĉelojn", +MergeCells : "Kunfandi Ĉelojn", +MergeRight : "Merge Right", //MISSING +MergeDown : "Merge Down", //MISSING +HorizontalSplitCell : "Split Cell Horizontally", //MISSING +VerticalSplitCell : "Split Cell Vertically", //MISSING +TableDelete : "Delete Table", //MISSING +CellProperties : "Atributoj de Ĉelo", +TableProperties : "Atributoj de Tabelo", +ImageProperties : "Atributoj de Bildo", +FlashProperties : "Flash Properties", //MISSING + +AnchorProp : "Ankraj Atributoj", +ButtonProp : "Butonaj Atributoj", +CheckboxProp : "Markobutonaj Atributoj", +HiddenFieldProp : "Atributoj de Kaŝita Kampo", +RadioButtonProp : "Radiobutonaj Atributoj", +ImageButtonProp : "Bildbutonaj Atributoj", +TextFieldProp : "Atributoj de Teksta Kampo", +SelectionFieldProp : "Atributoj de Elekta Kampo", +TextareaProp : "Atributoj de Teksta Areo", +FormProp : "Formularaj Atributoj", + +FontFormats : "Normala;Formatita;Adreso;Titolo 1;Titolo 2;Titolo 3;Titolo 4;Titolo 5;Titolo 6;Paragrafo (DIV)", + +// Alerts and Messages +ProcessingXHTML : "Traktado de XHTML. Bonvolu pacienci...", +Done : "Finita", +PasteWordConfirm : "La algluota teksto ŝajnas esti Word-devena. Ĉu vi volas purigi ĝin antaŭ ol interglui?", +NotCompatiblePaste : "Tiu ĉi komando bezonas almenaŭ Internet Explorer 5.5. Ĉu vi volas daŭrigi sen purigado?", +UnknownToolbarItem : "Ilobretero nekonata \"%1\"", +UnknownCommand : "Komandonomo nekonata \"%1\"", +NotImplemented : "Komando ne ankoraŭ realigita", +UnknownToolbarSet : "La ilobreto \"%1\" ne ekzistas", +NoActiveX : "Your browser's security settings could limit some features of the editor. You must enable the option \"Run ActiveX controls and plug-ins\". You may experience errors and notice missing features.", //MISSING +BrowseServerBlocked : "The resources browser could not be opened. Make sure that all popup blockers are disabled.", //MISSING +DialogBlocked : "It was not possible to open the dialog window. Make sure all popup blockers are disabled.", //MISSING + +// Dialogs +DlgBtnOK : "Akcepti", +DlgBtnCancel : "Rezigni", +DlgBtnClose : "Fermi", +DlgBtnBrowseServer : "Foliumi en la Servilo", +DlgAdvancedTag : "Speciala", +DlgOpOther : "", +DlgInfoTab : "Info", //MISSING +DlgAlertUrl : "Please insert the URL", //MISSING + +// General Dialogs Labels +DlgGenNotSet : "", +DlgGenId : "Id", +DlgGenLangDir : "Skribdirekto", +DlgGenLangDirLtr : "De maldekstro dekstren (LTR)", +DlgGenLangDirRtl : "De dekstro maldekstren (RTL)", +DlgGenLangCode : "Lingva Kodo", +DlgGenAccessKey : "Fulmoklavo", +DlgGenName : "Nomo", +DlgGenTabIndex : "Taba Ordo", +DlgGenLongDescr : "URL de Longa Priskribo", +DlgGenClass : "Klasoj de Stilfolioj", +DlgGenTitle : "Indika Titolo", +DlgGenContType : "Indika Enhavotipo", +DlgGenLinkCharset : "Signaro de la Ligita Rimedo", +DlgGenStyle : "Stilo", + +// Image Dialog +DlgImgTitle : "Atributoj de Bildo", +DlgImgInfoTab : "Informoj pri Bildo", +DlgImgBtnUpload : "Sendu al Servilo", +DlgImgURL : "URL", +DlgImgUpload : "Alŝuti", +DlgImgAlt : "Anstataŭiga Teksto", +DlgImgWidth : "Larĝo", +DlgImgHeight : "Alto", +DlgImgLockRatio : "Konservi Proporcion", +DlgBtnResetSize : "Origina Grando", +DlgImgBorder : "Bordero", +DlgImgHSpace : "HSpaco", +DlgImgVSpace : "VSpaco", +DlgImgAlign : "Ĝisrandigo", +DlgImgAlignLeft : "Maldekstre", +DlgImgAlignAbsBottom: "Abs Malsupre", +DlgImgAlignAbsMiddle: "Abs Centre", +DlgImgAlignBaseline : "Je Malsupro de Teksto", +DlgImgAlignBottom : "Malsupre", +DlgImgAlignMiddle : "Centre", +DlgImgAlignRight : "Dekstre", +DlgImgAlignTextTop : "Je Supro de Teksto", +DlgImgAlignTop : "Supre", +DlgImgPreview : "Vidigi Aspekton", +DlgImgAlertUrl : "Bonvolu tajpi la URL de la bildo", +DlgImgLinkTab : "Link", //MISSING + +// Flash Dialog +DlgFlashTitle : "Flash Properties", //MISSING +DlgFlashChkPlay : "Auto Play", //MISSING +DlgFlashChkLoop : "Loop", //MISSING +DlgFlashChkMenu : "Enable Flash Menu", //MISSING +DlgFlashScale : "Scale", //MISSING +DlgFlashScaleAll : "Show all", //MISSING +DlgFlashScaleNoBorder : "No Border", //MISSING +DlgFlashScaleFit : "Exact Fit", //MISSING + +// Link Dialog +DlgLnkWindowTitle : "Ligilo", +DlgLnkInfoTab : "Informoj pri la Ligilo", +DlgLnkTargetTab : "Celo", + +DlgLnkType : "Tipo de Ligilo", +DlgLnkTypeURL : "URL", +DlgLnkTypeAnchor : "Ankri en tiu ĉi paĝo", +DlgLnkTypeEMail : "Retpoŝto", +DlgLnkProto : "Protokolo", +DlgLnkProtoOther : "", +DlgLnkURL : "URL", +DlgLnkAnchorSel : "Elekti Ankron", +DlgLnkAnchorByName : "Per Ankronomo", +DlgLnkAnchorById : "Per Elementidentigilo", +DlgLnkNoAnchors : "", +DlgLnkEMail : "Retadreso", +DlgLnkEMailSubject : "Temlinio", +DlgLnkEMailBody : "Mesaĝa korpo", +DlgLnkUpload : "Alŝuti", +DlgLnkBtnUpload : "Sendi al Servilo", + +DlgLnkTarget : "Celo", +DlgLnkTargetFrame : "", +DlgLnkTargetPopup : "<ŝprucfenestro>", +DlgLnkTargetBlank : "Nova Fenestro (_blank)", +DlgLnkTargetParent : "Gepatra Fenestro (_parent)", +DlgLnkTargetSelf : "Sama Fenestro (_self)", +DlgLnkTargetTop : "Plej Supra Fenestro (_top)", +DlgLnkTargetFrameName : "Nomo de Kadro", +DlgLnkPopWinName : "Nomo de Ŝprucfenestro", +DlgLnkPopWinFeat : "Atributoj de la Ŝprucfenestro", +DlgLnkPopResize : "Grando Ŝanĝebla", +DlgLnkPopLocation : "Adresobreto", +DlgLnkPopMenu : "Menubreto", +DlgLnkPopScroll : "Rulumlisteloj", +DlgLnkPopStatus : "Statobreto", +DlgLnkPopToolbar : "Ilobreto", +DlgLnkPopFullScrn : "Tutekrane (IE)", +DlgLnkPopDependent : "Dependa (Netscape)", +DlgLnkPopWidth : "Larĝo", +DlgLnkPopHeight : "Alto", +DlgLnkPopLeft : "Pozicio de Maldekstro", +DlgLnkPopTop : "Pozicio de Supro", + +DlnLnkMsgNoUrl : "Bonvolu entajpi la URL-on", +DlnLnkMsgNoEMail : "Bonvolu entajpi la retadreson", +DlnLnkMsgNoAnchor : "Bonvolu elekti ankron", +DlnLnkMsgInvPopName : "The popup name must begin with an alphabetic character and must not contain spaces", //MISSING + +// Color Dialog +DlgColorTitle : "Elekti", +DlgColorBtnClear : "Forigi", +DlgColorHighlight : "Emfazi", +DlgColorSelected : "Elektita", + +// Smiley Dialog +DlgSmileyTitle : "Enmeti Mienvinjeton", + +// Special Character Dialog +DlgSpecialCharTitle : "Enmeti Specialan Signon", + +// Table Dialog +DlgTableTitle : "Atributoj de Tabelo", +DlgTableRows : "Linioj", +DlgTableColumns : "Kolumnoj", +DlgTableBorder : "Bordero", +DlgTableAlign : "Ĝisrandigo", +DlgTableAlignNotSet : "", +DlgTableAlignLeft : "Maldekstre", +DlgTableAlignCenter : "Centre", +DlgTableAlignRight : "Dekstre", +DlgTableWidth : "Larĝo", +DlgTableWidthPx : "Bitbilderoj", +DlgTableWidthPc : "elcentoj", +DlgTableHeight : "Alto", +DlgTableCellSpace : "Interspacigo de Ĉeloj", +DlgTableCellPad : "Ĉirkaŭenhava Plenigado", +DlgTableCaption : "Titolo", +DlgTableSummary : "Summary", //MISSING + +// Table Cell Dialog +DlgCellTitle : "Atributoj de Celo", +DlgCellWidth : "Larĝo", +DlgCellWidthPx : "bitbilderoj", +DlgCellWidthPc : "elcentoj", +DlgCellHeight : "Alto", +DlgCellWordWrap : "Linifaldo", +DlgCellWordWrapNotSet : "", +DlgCellWordWrapYes : "Jes", +DlgCellWordWrapNo : "Ne", +DlgCellHorAlign : "Horizonta Ĝisrandigo", +DlgCellHorAlignNotSet : "", +DlgCellHorAlignLeft : "Maldekstre", +DlgCellHorAlignCenter : "Centre", +DlgCellHorAlignRight: "Dekstre", +DlgCellVerAlign : "Vertikala Ĝisrandigo", +DlgCellVerAlignNotSet : "", +DlgCellVerAlignTop : "Supre", +DlgCellVerAlignMiddle : "Centre", +DlgCellVerAlignBottom : "Malsupre", +DlgCellVerAlignBaseline : "Je Malsupro de Teksto", +DlgCellRowSpan : "Linioj Kunfanditaj", +DlgCellCollSpan : "Kolumnoj Kunfanditaj", +DlgCellBackColor : "Fono", +DlgCellBorderColor : "Bordero", +DlgCellBtnSelect : "Elekti...", + +// Find and Replace Dialog +DlgFindAndReplaceTitle : "Find and Replace", //MISSING + +// Find Dialog +DlgFindTitle : "Serĉi", +DlgFindFindBtn : "Serĉi", +DlgFindNotFoundMsg : "La celteksto ne estas trovita.", + +// Replace Dialog +DlgReplaceTitle : "Anstataŭigi", +DlgReplaceFindLbl : "Serĉi:", +DlgReplaceReplaceLbl : "Anstataŭigi per:", +DlgReplaceCaseChk : "Kongruigi Usklecon", +DlgReplaceReplaceBtn : "Anstataŭigi", +DlgReplaceReplAllBtn : "Anstataŭigi Ĉiun", +DlgReplaceWordChk : "Tuta Vorto", + +// Paste Operations / Dialog +PasteErrorCut : "La sekurecagordo de via TTT-legilo ne permesas, ke la redaktilo faras eltondajn operaciojn. Bonvolu uzi la klavaron por tio (ctrl-X).", +PasteErrorCopy : "La sekurecagordo de via TTT-legilo ne permesas, ke la redaktilo faras kopiajn operaciojn. Bonvolu uzi la klavaron por tio (ctrl-C).", + +PasteAsText : "Interglui kiel Tekston", +PasteFromWord : "Interglui el Word", + +DlgPasteMsg2 : "Please paste inside the following box using the keyboard (Ctrl+V) and hit OK.", //MISSING +DlgPasteSec : "Because of your browser security settings, the editor is not able to access your clipboard data directly. You are required to paste it again in this window.", //MISSING +DlgPasteIgnoreFont : "Ignore Font Face definitions", //MISSING +DlgPasteRemoveStyles : "Remove Styles definitions", //MISSING + +// Color Picker +ColorAutomatic : "Aŭtomata", +ColorMoreColors : "Pli da Koloroj...", + +// Document Properties +DocProps : "Dokumentaj Atributoj", + +// Anchor Dialog +DlgAnchorTitle : "Ankraj Atributoj", +DlgAnchorName : "Ankra Nomo", +DlgAnchorErrorName : "Bv tajpi la ankran nomon", + +// Speller Pages Dialog +DlgSpellNotInDic : "Ne trovita en la vortaro", +DlgSpellChangeTo : "Ŝanĝi al", +DlgSpellBtnIgnore : "Malatenti", +DlgSpellBtnIgnoreAll : "Malatenti Ĉiun", +DlgSpellBtnReplace : "Anstataŭigi", +DlgSpellBtnReplaceAll : "Anstataŭigi Ĉiun", +DlgSpellBtnUndo : "Malfari", +DlgSpellNoSuggestions : "- Neniu propono -", +DlgSpellProgress : "Literumkontrolado daŭras...", +DlgSpellNoMispell : "Literumkontrolado finita: neniu fuŝo trovita", +DlgSpellNoChanges : "Literumkontrolado finita: neniu vorto ŝanĝita", +DlgSpellOneChange : "Literumkontrolado finita: unu vorto ŝanĝita", +DlgSpellManyChanges : "Literumkontrolado finita: %1 vortoj ŝanĝitaj", + +IeSpellDownload : "Literumada Kontrolilo ne instalita. Ĉu vi volas elŝuti ĝin nun?", + +// Button Dialog +DlgButtonText : "Teksto (Valoro)", +DlgButtonType : "Tipo", +DlgButtonTypeBtn : "Button", //MISSING +DlgButtonTypeSbm : "Submit", //MISSING +DlgButtonTypeRst : "Reset", //MISSING + +// Checkbox and Radio Button Dialogs +DlgCheckboxName : "Nomo", +DlgCheckboxValue : "Valoro", +DlgCheckboxSelected : "Elektita", + +// Form Dialog +DlgFormName : "Nomo", +DlgFormAction : "Ago", +DlgFormMethod : "Metodo", + +// Select Field Dialog +DlgSelectName : "Nomo", +DlgSelectValue : "Valoro", +DlgSelectSize : "Grando", +DlgSelectLines : "Linioj", +DlgSelectChkMulti : "Permesi Plurajn Elektojn", +DlgSelectOpAvail : "Elektoj Disponeblaj", +DlgSelectOpText : "Teksto", +DlgSelectOpValue : "Valoro", +DlgSelectBtnAdd : "Aldoni", +DlgSelectBtnModify : "Modifi", +DlgSelectBtnUp : "Supren", +DlgSelectBtnDown : "Malsupren", +DlgSelectBtnSetValue : "Agordi kiel Elektitan Valoron", +DlgSelectBtnDelete : "Forigi", + +// Textarea Dialog +DlgTextareaName : "Nomo", +DlgTextareaCols : "Kolumnoj", +DlgTextareaRows : "Vicoj", + +// Text Field Dialog +DlgTextName : "Nomo", +DlgTextValue : "Valoro", +DlgTextCharWidth : "Signolarĝo", +DlgTextMaxChars : "Maksimuma Nombro da Signoj", +DlgTextType : "Tipo", +DlgTextTypeText : "Teksto", +DlgTextTypePass : "Pasvorto", + +// Hidden Field Dialog +DlgHiddenName : "Nomo", +DlgHiddenValue : "Valoro", + +// Bulleted List Dialog +BulletedListProp : "Atributoj de Bula Listo", +NumberedListProp : "Atributoj de Numera Listo", +DlgLstStart : "Start", //MISSING +DlgLstType : "Tipo", +DlgLstTypeCircle : "Cirklo", +DlgLstTypeDisc : "Disc", //MISSING +DlgLstTypeSquare : "Kvadrato", +DlgLstTypeNumbers : "Ciferoj (1, 2, 3)", +DlgLstTypeLCase : "Minusklaj Literoj (a, b, c)", +DlgLstTypeUCase : "Majusklaj Literoj (A, B, C)", +DlgLstTypeSRoman : "Malgrandaj Romanaj Ciferoj (i, ii, iii)", +DlgLstTypeLRoman : "Grandaj Romanaj Ciferoj (I, II, III)", + +// Document Properties Dialog +DlgDocGeneralTab : "Ĝeneralaĵoj", +DlgDocBackTab : "Fono", +DlgDocColorsTab : "Koloroj kaj Marĝenoj", +DlgDocMetaTab : "Metadatumoj", + +DlgDocPageTitle : "Paĝotitolo", +DlgDocLangDir : "Skribdirekto de la Lingvo", +DlgDocLangDirLTR : "De maldekstro dekstren (LTR)", +DlgDocLangDirRTL : "De dekstro maldekstren (LTR)", +DlgDocLangCode : "Lingvokodo", +DlgDocCharSet : "Signara Kodo", +DlgDocCharSetCE : "Central European", //MISSING +DlgDocCharSetCT : "Chinese Traditional (Big5)", //MISSING +DlgDocCharSetCR : "Cyrillic", //MISSING +DlgDocCharSetGR : "Greek", //MISSING +DlgDocCharSetJP : "Japanese", //MISSING +DlgDocCharSetKR : "Korean", //MISSING +DlgDocCharSetTR : "Turkish", //MISSING +DlgDocCharSetUN : "Unicode (UTF-8)", //MISSING +DlgDocCharSetWE : "Western European", //MISSING +DlgDocCharSetOther : "Alia Signara Kodo", + +DlgDocDocType : "Dokumenta Tipo", +DlgDocDocTypeOther : "Alia Dokumenta Tipo", +DlgDocIncXHTML : "Inkluzivi XHTML Deklaroj", +DlgDocBgColor : "Fona Koloro", +DlgDocBgImage : "URL de Fona Bildo", +DlgDocBgNoScroll : "Neruluma Fono", +DlgDocCText : "Teksto", +DlgDocCLink : "Ligilo", +DlgDocCVisited : "Vizitita Ligilo", +DlgDocCActive : "Aktiva Ligilo", +DlgDocMargins : "Paĝaj Marĝenoj", +DlgDocMaTop : "Supra", +DlgDocMaLeft : "Maldekstra", +DlgDocMaRight : "Dekstra", +DlgDocMaBottom : "Malsupra", +DlgDocMeIndex : "Ŝlosilvortoj de la Dokumento (apartigita de komoj)", +DlgDocMeDescr : "Dokumenta Priskribo", +DlgDocMeAuthor : "Verkinto", +DlgDocMeCopy : "Kopirajto", +DlgDocPreview : "Aspekto", + +// Templates Dialog +Templates : "Templates", //MISSING +DlgTemplatesTitle : "Content Templates", //MISSING +DlgTemplatesSelMsg : "Please select the template to open in the editor
        (the actual contents will be lost):", //MISSING +DlgTemplatesLoading : "Loading templates list. Please wait...", //MISSING +DlgTemplatesNoTpl : "(No templates defined)", //MISSING +DlgTemplatesReplace : "Replace actual contents", //MISSING + +// About Dialog +DlgAboutAboutTab : "Pri", +DlgAboutBrowserInfoTab : "Informoj pri TTT-legilo", +DlgAboutLicenseTab : "License", //MISSING +DlgAboutVersion : "versio", +DlgAboutInfo : "Por pli da informoj, vizitu" +}; Property changes on: announcement/trunk/src/main/webapp/fckeditor/editor/lang/eo.js ___________________________________________________________________ Name: svn:eol-style + native Added: announcement/trunk/src/main/webapp/fckeditor/editor/lang/es.js =================================================================== --- announcement/trunk/src/main/webapp/fckeditor/editor/lang/es.js (rev 0) +++ announcement/trunk/src/main/webapp/fckeditor/editor/lang/es.js 2008-06-30 02:54:27 UTC (rev 1002) @@ -0,0 +1,515 @@ +?/* + * FCKeditor - The text editor for Internet - http://www.fckeditor.net + * Copyright (C) 2003-2008 Frederico Caldeira Knabben + * + * == BEGIN LICENSE == + * + * Licensed under the terms of any of the following licenses at your + * choice: + * + * - GNU General Public License Version 2 or later (the "GPL") + * http://www.gnu.org/licenses/gpl.html + * + * - GNU Lesser General Public License Version 2.1 or later (the "LGPL") + * http://www.gnu.org/licenses/lgpl.html + * + * - Mozilla Public License Version 1.1 or later (the "MPL") + * http://www.mozilla.org/MPL/MPL-1.1.html + * + * == END LICENSE == + * + * Spanish language file. + */ + +var FCKLang = +{ +// Language direction : "ltr" (left to right) or "rtl" (right to left). +Dir : "ltr", + +ToolbarCollapse : "Contraer Barra", +ToolbarExpand : "Expandir Barra", + +// Toolbar Items and Context Menu +Save : "Guardar", +NewPage : "Nueva Página", +Preview : "Vista Previa", +Cut : "Cortar", +Copy : "Copiar", +Paste : "Pegar", +PasteText : "Pegar como texto plano", +PasteWord : "Pegar desde Word", +Print : "Imprimir", +SelectAll : "Seleccionar Todo", +RemoveFormat : "Eliminar Formato", +InsertLinkLbl : "Vínculo", +InsertLink : "Insertar/Editar Vínculo", +RemoveLink : "Eliminar Vínculo", +Anchor : "Referencia", +AnchorDelete : "Eliminar Referencia", +InsertImageLbl : "Imagen", +InsertImage : "Insertar/Editar Imagen", +InsertFlashLbl : "Flash", +InsertFlash : "Insertar/Editar Flash", +InsertTableLbl : "Tabla", +InsertTable : "Insertar/Editar Tabla", +InsertLineLbl : "Línea", +InsertLine : "Insertar Línea Horizontal", +InsertSpecialCharLbl: "Caracter Especial", +InsertSpecialChar : "Insertar Caracter Especial", +InsertSmileyLbl : "Emoticons", +InsertSmiley : "Insertar Emoticons", +About : "Acerca de FCKeditor", +Bold : "Negrita", +Italic : "Cursiva", +Underline : "Subrayado", +StrikeThrough : "Tachado", +Subscript : "Subíndice", +Superscript : "Superíndice", +LeftJustify : "Alinear a Izquierda", +CenterJustify : "Centrar", +RightJustify : "Alinear a Derecha", +BlockJustify : "Justificado", +DecreaseIndent : "Disminuir Sangría", +IncreaseIndent : "Aumentar Sangría", +Blockquote : "Cita", +Undo : "Deshacer", +Redo : "Rehacer", +NumberedListLbl : "Numeración", +NumberedList : "Insertar/Eliminar Numeración", +BulletedListLbl : "Viñetas", +BulletedList : "Insertar/Eliminar Viñetas", +ShowTableBorders : "Mostrar Bordes de Tablas", +ShowDetails : "Mostrar saltos de Párrafo", +Style : "Estilo", +FontFormat : "Formato", +Font : "Fuente", +FontSize : "Tamaño", +TextColor : "Color de Texto", +BGColor : "Color de Fondo", +Source : "Fuente HTML", +Find : "Buscar", +Replace : "Reemplazar", +SpellCheck : "Ortografía", +UniversalKeyboard : "Teclado Universal", +PageBreakLbl : "Salto de Página", +PageBreak : "Insertar Salto de Página", + +Form : "Formulario", +Checkbox : "Casilla de Verificación", +RadioButton : "Botones de Radio", +TextField : "Campo de Texto", +Textarea : "Area de Texto", +HiddenField : "Campo Oculto", +Button : "Botón", +SelectionField : "Campo de Selección", +ImageButton : "Botón Imagen", + +FitWindow : "Maximizar el tamaño del editor", +ShowBlocks : "Mostrar bloques", + +// Context Menu +EditLink : "Editar Vínculo", +CellCM : "Celda", +RowCM : "Fila", +ColumnCM : "Columna", +InsertRowAfter : "Insertar fila en la parte inferior", +InsertRowBefore : "Insertar fila en la parte superior", +DeleteRows : "Eliminar Filas", +InsertColumnAfter : "Insertar columna a la derecha", +InsertColumnBefore : "Insertar columna a la izquierda", +DeleteColumns : "Eliminar Columnas", +InsertCellAfter : "Insertar celda a la derecha", +InsertCellBefore : "Insertar celda a la izquierda", +DeleteCells : "Eliminar Celdas", +MergeCells : "Combinar Celdas", +MergeRight : "Combinar a la derecha", +MergeDown : "Combinar hacia abajo", +HorizontalSplitCell : "Dividir la celda horizontalmente", +VerticalSplitCell : "Dividir la celda verticalmente", +TableDelete : "Eliminar Tabla", +CellProperties : "Propiedades de Celda", +TableProperties : "Propiedades de Tabla", +ImageProperties : "Propiedades de Imagen", +FlashProperties : "Propiedades de Flash", + +AnchorProp : "Propiedades de Referencia", +ButtonProp : "Propiedades de Botón", +CheckboxProp : "Propiedades de Casilla", +HiddenFieldProp : "Propiedades de Campo Oculto", +RadioButtonProp : "Propiedades de Botón de Radio", +ImageButtonProp : "Propiedades de Botón de Imagen", +TextFieldProp : "Propiedades de Campo de Texto", +SelectionFieldProp : "Propiedades de Campo de Selección", +TextareaProp : "Propiedades de Area de Texto", +FormProp : "Propiedades de Formulario", + +FontFormats : "Normal;Con formato;Dirección;Encabezado 1;Encabezado 2;Encabezado 3;Encabezado 4;Encabezado 5;Encabezado 6;Normal (DIV)", + +// Alerts and Messages +ProcessingXHTML : "Procesando XHTML. Por favor, espere...", +Done : "Hecho", +PasteWordConfirm : "El texto que desea parece provenir de Word. Desea depurarlo antes de pegarlo?", +NotCompatiblePaste : "Este comando está disponible sólo para Internet Explorer version 5.5 or superior. Desea pegar sin depurar?", +UnknownToolbarItem : "Item de barra desconocido \"%1\"", +UnknownCommand : "Nombre de comando desconocido \"%1\"", +NotImplemented : "Comando no implementado", +UnknownToolbarSet : "Nombre de barra \"%1\" no definido", +NoActiveX : "La configuración de las opciones de seguridad de su navegador puede estar limitando algunas características del editor. Por favor active la opción \"Ejecutar controles y complementos de ActiveX \", de lo contrario puede experimentar errores o ausencia de funcionalidades.", +BrowseServerBlocked : "La ventana de visualización del servidor no pudo ser abierta. Verifique que su navegador no esté bloqueando las ventanas emergentes (pop up).", +DialogBlocked : "No se ha podido abrir la ventana de diálogo. Verifique que su navegador no esté bloqueando las ventanas emergentes (pop up).", + +// Dialogs +DlgBtnOK : "OK", +DlgBtnCancel : "Cancelar", +DlgBtnClose : "Cerrar", +DlgBtnBrowseServer : "Ver Servidor", +DlgAdvancedTag : "Avanzado", +DlgOpOther : "", +DlgInfoTab : "Información", +DlgAlertUrl : "Inserte el URL", + +// General Dialogs Labels +DlgGenNotSet : "", +DlgGenId : "Id", +DlgGenLangDir : "Orientación", +DlgGenLangDirLtr : "Izquierda a Derecha (LTR)", +DlgGenLangDirRtl : "Derecha a Izquierda (RTL)", +DlgGenLangCode : "Cód. de idioma", +DlgGenAccessKey : "Clave de Acceso", +DlgGenName : "Nombre", +DlgGenTabIndex : "Indice de tabulación", +DlgGenLongDescr : "Descripción larga URL", +DlgGenClass : "Clases de hojas de estilo", +DlgGenTitle : "Título", +DlgGenContType : "Tipo de Contenido", +DlgGenLinkCharset : "Fuente de caracteres vinculado", +DlgGenStyle : "Estilo", + +// Image Dialog +DlgImgTitle : "Propiedades de Imagen", +DlgImgInfoTab : "Información de Imagen", +DlgImgBtnUpload : "Enviar al Servidor", +DlgImgURL : "URL", +DlgImgUpload : "Cargar", +DlgImgAlt : "Texto Alternativo", +DlgImgWidth : "Anchura", +DlgImgHeight : "Altura", +DlgImgLockRatio : "Proporcional", +DlgBtnResetSize : "Tamaño Original", +DlgImgBorder : "Borde", +DlgImgHSpace : "Esp.Horiz", +DlgImgVSpace : "Esp.Vert", +DlgImgAlign : "Alineación", +DlgImgAlignLeft : "Izquierda", +DlgImgAlignAbsBottom: "Abs inferior", +DlgImgAlignAbsMiddle: "Abs centro", +DlgImgAlignBaseline : "Línea de base", +DlgImgAlignBottom : "Pie", +DlgImgAlignMiddle : "Centro", +DlgImgAlignRight : "Derecha", +DlgImgAlignTextTop : "Tope del texto", +DlgImgAlignTop : "Tope", +DlgImgPreview : "Vista Previa", +DlgImgAlertUrl : "Por favor escriba la URL de la imagen", +DlgImgLinkTab : "Vínculo", + +// Flash Dialog +DlgFlashTitle : "Propiedades de Flash", +DlgFlashChkPlay : "Autoejecución", +DlgFlashChkLoop : "Repetir", +DlgFlashChkMenu : "Activar Menú Flash", +DlgFlashScale : "Escala", +DlgFlashScaleAll : "Mostrar todo", +DlgFlashScaleNoBorder : "Sin Borde", +DlgFlashScaleFit : "Ajustado", + +// Link Dialog +DlgLnkWindowTitle : "Vínculo", +DlgLnkInfoTab : "Información de Vínculo", +DlgLnkTargetTab : "Destino", + +DlgLnkType : "Tipo de vínculo", +DlgLnkTypeURL : "URL", +DlgLnkTypeAnchor : "Referencia en esta página", +DlgLnkTypeEMail : "E-Mail", +DlgLnkProto : "Protocolo", +DlgLnkProtoOther : "", +DlgLnkURL : "URL", +DlgLnkAnchorSel : "Seleccionar una referencia", +DlgLnkAnchorByName : "Por Nombre de Referencia", +DlgLnkAnchorById : "Por ID de elemento", +DlgLnkNoAnchors : "(No hay referencias disponibles en el documento)", +DlgLnkEMail : "Dirección de E-Mail", +DlgLnkEMailSubject : "Título del Mensaje", +DlgLnkEMailBody : "Cuerpo del Mensaje", +DlgLnkUpload : "Cargar", +DlgLnkBtnUpload : "Enviar al Servidor", + +DlgLnkTarget : "Destino", +DlgLnkTargetFrame : "", +DlgLnkTargetPopup : "", +DlgLnkTargetBlank : "Nueva Ventana(_blank)", +DlgLnkTargetParent : "Ventana Padre (_parent)", +DlgLnkTargetSelf : "Misma Ventana (_self)", +DlgLnkTargetTop : "Ventana primaria (_top)", +DlgLnkTargetFrameName : "Nombre del Marco Destino", +DlgLnkPopWinName : "Nombre de Ventana Emergente", +DlgLnkPopWinFeat : "Características de Ventana Emergente", +DlgLnkPopResize : "Ajustable", +DlgLnkPopLocation : "Barra de ubicación", +DlgLnkPopMenu : "Barra de Menú", +DlgLnkPopScroll : "Barras de desplazamiento", +DlgLnkPopStatus : "Barra de Estado", +DlgLnkPopToolbar : "Barra de Herramientas", +DlgLnkPopFullScrn : "Pantalla Completa (IE)", +DlgLnkPopDependent : "Dependiente (Netscape)", +DlgLnkPopWidth : "Anchura", +DlgLnkPopHeight : "Altura", +DlgLnkPopLeft : "Posición Izquierda", +DlgLnkPopTop : "Posición Derecha", + +DlnLnkMsgNoUrl : "Por favor tipee el vínculo URL", +DlnLnkMsgNoEMail : "Por favor tipee la dirección de e-mail", +DlnLnkMsgNoAnchor : "Por favor seleccione una referencia", +DlnLnkMsgInvPopName : "El nombre debe empezar con un caracter alfanumérico y no debe contener espacios", + +// Color Dialog +DlgColorTitle : "Seleccionar Color", +DlgColorBtnClear : "Ninguno", +DlgColorHighlight : "Resaltado", +DlgColorSelected : "Seleccionado", + +// Smiley Dialog +DlgSmileyTitle : "Insertar un Emoticon", + +// Special Character Dialog +DlgSpecialCharTitle : "Seleccione un caracter especial", + +// Table Dialog +DlgTableTitle : "Propiedades de Tabla", +DlgTableRows : "Filas", +DlgTableColumns : "Columnas", +DlgTableBorder : "Tamaño de Borde", +DlgTableAlign : "Alineación", +DlgTableAlignNotSet : "", +DlgTableAlignLeft : "Izquierda", +DlgTableAlignCenter : "Centrado", +DlgTableAlignRight : "Derecha", +DlgTableWidth : "Anchura", +DlgTableWidthPx : "pixeles", +DlgTableWidthPc : "porcentaje", +DlgTableHeight : "Altura", +DlgTableCellSpace : "Esp. e/celdas", +DlgTableCellPad : "Esp. interior", +DlgTableCaption : "Título", +DlgTableSummary : "Síntesis", + +// Table Cell Dialog +DlgCellTitle : "Propiedades de Celda", +DlgCellWidth : "Anchura", +DlgCellWidthPx : "pixeles", +DlgCellWidthPc : "porcentaje", +DlgCellHeight : "Altura", +DlgCellWordWrap : "Cortar Línea", +DlgCellWordWrapNotSet : "", +DlgCellWordWrapYes : "Si", +DlgCellWordWrapNo : "No", +DlgCellHorAlign : "Alineación Horizontal", +DlgCellHorAlignNotSet : "", +DlgCellHorAlignLeft : "Izquierda", +DlgCellHorAlignCenter : "Centrado", +DlgCellHorAlignRight: "Derecha", +DlgCellVerAlign : "Alineación Vertical", +DlgCellVerAlignNotSet : "", +DlgCellVerAlignTop : "Tope", +DlgCellVerAlignMiddle : "Medio", +DlgCellVerAlignBottom : "ie", +DlgCellVerAlignBaseline : "Línea de Base", +DlgCellRowSpan : "Abarcar Filas", +DlgCellCollSpan : "Abarcar Columnas", +DlgCellBackColor : "Color de Fondo", +DlgCellBorderColor : "Color de Borde", +DlgCellBtnSelect : "Seleccione...", + +// Find and Replace Dialog +DlgFindAndReplaceTitle : "Buscar y Reemplazar", + +// Find Dialog +DlgFindTitle : "Buscar", +DlgFindFindBtn : "Buscar", +DlgFindNotFoundMsg : "El texto especificado no ha sido encontrado.", + +// Replace Dialog +DlgReplaceTitle : "Reemplazar", +DlgReplaceFindLbl : "Texto a buscar:", +DlgReplaceReplaceLbl : "Reemplazar con:", +DlgReplaceCaseChk : "Coincidir may/min", +DlgReplaceReplaceBtn : "Reemplazar", +DlgReplaceReplAllBtn : "Reemplazar Todo", +DlgReplaceWordChk : "Coincidir toda la palabra", + +// Paste Operations / Dialog +PasteErrorCut : "La configuración de seguridad de este navegador no permite la ejecución automática de operaciones de cortado. Por favor use el teclado (Ctrl+X).", +PasteErrorCopy : "La configuración de seguridad de este navegador no permite la ejecución automática de operaciones de copiado. Por favor use el teclado (Ctrl+C).", + +PasteAsText : "Pegar como Texto Plano", +PasteFromWord : "Pegar desde Word", + +DlgPasteMsg2 : "Por favor pegue dentro del cuadro utilizando el teclado (Ctrl+V); luego presione OK.", +DlgPasteSec : "Debido a la configuración de seguridad de su navegador, el editor no tiene acceso al portapapeles. Es necesario que lo pegue de nuevo en esta ventana.", +DlgPasteIgnoreFont : "Ignorar definiciones de fuentes", +DlgPasteRemoveStyles : "Remover definiciones de estilo", + +// Color Picker +ColorAutomatic : "Automático", +ColorMoreColors : "Más Colores...", + +// Document Properties +DocProps : "Propiedades del Documento", + +// Anchor Dialog +DlgAnchorTitle : "Propiedades de la Referencia", +DlgAnchorName : "Nombre de la Referencia", +DlgAnchorErrorName : "Por favor, complete el nombre de la Referencia", + +// Speller Pages Dialog +DlgSpellNotInDic : "No se encuentra en el Diccionario", +DlgSpellChangeTo : "Cambiar a", +DlgSpellBtnIgnore : "Ignorar", +DlgSpellBtnIgnoreAll : "Ignorar Todo", +DlgSpellBtnReplace : "Reemplazar", +DlgSpellBtnReplaceAll : "Reemplazar Todo", +DlgSpellBtnUndo : "Deshacer", +DlgSpellNoSuggestions : "- No hay sugerencias -", +DlgSpellProgress : "Control de Ortografía en progreso...", +DlgSpellNoMispell : "Control finalizado: no se encontraron errores", +DlgSpellNoChanges : "Control finalizado: no se ha cambiado ninguna palabra", +DlgSpellOneChange : "Control finalizado: se ha cambiado una palabra", +DlgSpellManyChanges : "Control finalizado: se ha cambiado %1 palabras", + +IeSpellDownload : "Módulo de Control de Ortografía no instalado. ¿Desea descargarlo ahora?", + +// Button Dialog +DlgButtonText : "Texto (Valor)", +DlgButtonType : "Tipo", +DlgButtonTypeBtn : "Boton", +DlgButtonTypeSbm : "Enviar", +DlgButtonTypeRst : "Reestablecer", + +// Checkbox and Radio Button Dialogs +DlgCheckboxName : "Nombre", +DlgCheckboxValue : "Valor", +DlgCheckboxSelected : "Seleccionado", + +// Form Dialog +DlgFormName : "Nombre", +DlgFormAction : "Acción", +DlgFormMethod : "Método", + +// Select Field Dialog +DlgSelectName : "Nombre", +DlgSelectValue : "Valor", +DlgSelectSize : "Tamaño", +DlgSelectLines : "Lineas", +DlgSelectChkMulti : "Permitir múltiple selección", +DlgSelectOpAvail : "Opciones disponibles", +DlgSelectOpText : "Texto", +DlgSelectOpValue : "Valor", +DlgSelectBtnAdd : "Agregar", +DlgSelectBtnModify : "Modificar", +DlgSelectBtnUp : "Subir", +DlgSelectBtnDown : "Bajar", +DlgSelectBtnSetValue : "Establecer como predeterminado", +DlgSelectBtnDelete : "Eliminar", + +// Textarea Dialog +DlgTextareaName : "Nombre", +DlgTextareaCols : "Columnas", +DlgTextareaRows : "Filas", + +// Text Field Dialog +DlgTextName : "Nombre", +DlgTextValue : "Valor", +DlgTextCharWidth : "Caracteres de ancho", +DlgTextMaxChars : "Máximo caracteres", +DlgTextType : "Tipo", +DlgTextTypeText : "Texto", +DlgTextTypePass : "Contraseña", + +// Hidden Field Dialog +DlgHiddenName : "Nombre", +DlgHiddenValue : "Valor", + +// Bulleted List Dialog +BulletedListProp : "Propiedades de Viñetas", +NumberedListProp : "Propiedades de Numeraciones", +DlgLstStart : "Inicio", +DlgLstType : "Tipo", +DlgLstTypeCircle : "Círculo", +DlgLstTypeDisc : "Disco", +DlgLstTypeSquare : "Cuadrado", +DlgLstTypeNumbers : "Números (1, 2, 3)", +DlgLstTypeLCase : "letras en minúsculas (a, b, c)", +DlgLstTypeUCase : "letras en mayúsculas (A, B, C)", +DlgLstTypeSRoman : "Números Romanos (i, ii, iii)", +DlgLstTypeLRoman : "Números Romanos (I, II, III)", + +// Document Properties Dialog +DlgDocGeneralTab : "General", +DlgDocBackTab : "Fondo", +DlgDocColorsTab : "Colores y Márgenes", +DlgDocMetaTab : "Meta Información", + +DlgDocPageTitle : "Título de Página", +DlgDocLangDir : "Orientación de idioma", +DlgDocLangDirLTR : "Izq. a Derecha (LTR)", +DlgDocLangDirRTL : "Der. a Izquierda (RTL)", +DlgDocLangCode : "Código de Idioma", +DlgDocCharSet : "Codif. de Conjunto de Caracteres", +DlgDocCharSetCE : "Centro Europeo", +DlgDocCharSetCT : "Chino Tradicional (Big5)", +DlgDocCharSetCR : "Cirílico", +DlgDocCharSetGR : "Griego", +DlgDocCharSetJP : "Japonés", +DlgDocCharSetKR : "Coreano", +DlgDocCharSetTR : "Turco", +DlgDocCharSetUN : "Unicode (UTF-8)", +DlgDocCharSetWE : "Europeo occidental", +DlgDocCharSetOther : "Otra Codificación", + +DlgDocDocType : "Encabezado de Tipo de Documento", +DlgDocDocTypeOther : "Otro Encabezado", +DlgDocIncXHTML : "Incluir Declaraciones XHTML", +DlgDocBgColor : "Color de Fondo", +DlgDocBgImage : "URL de Imagen de Fondo", +DlgDocBgNoScroll : "Fondo sin rolido", +DlgDocCText : "Texto", +DlgDocCLink : "Vínculo", +DlgDocCVisited : "Vínculo Visitado", +DlgDocCActive : "Vínculo Activo", +DlgDocMargins : "Márgenes de Página", +DlgDocMaTop : "Tope", +DlgDocMaLeft : "Izquierda", +DlgDocMaRight : "Derecha", +DlgDocMaBottom : "Pie", +DlgDocMeIndex : "Claves de indexación del Documento (separados por comas)", +DlgDocMeDescr : "Descripción del Documento", +DlgDocMeAuthor : "Autor", +DlgDocMeCopy : "Copyright", +DlgDocPreview : "Vista Previa", + +// Templates Dialog +Templates : "Plantillas", +DlgTemplatesTitle : "Contenido de Plantillas", +DlgTemplatesSelMsg : "Por favor selecciona la plantilla a abrir en el editor
        (el contenido actual se perderá):", +DlgTemplatesLoading : "Cargando lista de Plantillas. Por favor, aguarde...", +DlgTemplatesNoTpl : "(No hay plantillas definidas)", +DlgTemplatesReplace : "Reemplazar el contenido actual", + +// About Dialog +DlgAboutAboutTab : "Acerca de", +DlgAboutBrowserInfoTab : "Información de Navegador", +DlgAboutLicenseTab : "Licencia", +DlgAboutVersion : "versión", +DlgAboutInfo : "Para mayor información por favor dirigirse a" +}; Property changes on: announcement/trunk/src/main/webapp/fckeditor/editor/lang/es.js ___________________________________________________________________ Name: svn:eol-style + native Added: announcement/trunk/src/main/webapp/fckeditor/editor/lang/et.js =================================================================== --- announcement/trunk/src/main/webapp/fckeditor/editor/lang/et.js (rev 0) +++ announcement/trunk/src/main/webapp/fckeditor/editor/lang/et.js 2008-06-30 02:54:27 UTC (rev 1002) @@ -0,0 +1,515 @@ +?/* + * FCKeditor - The text editor for Internet - http://www.fckeditor.net + * Copyright (C) 2003-2008 Frederico Caldeira Knabben + * + * == BEGIN LICENSE == + * + * Licensed under the terms of any of the following licenses at your + * choice: + * + * - GNU General Public License Version 2 or later (the "GPL") + * http://www.gnu.org/licenses/gpl.html + * + * - GNU Lesser General Public License Version 2.1 or later (the "LGPL") + * http://www.gnu.org/licenses/lgpl.html + * + * - Mozilla Public License Version 1.1 or later (the "MPL") + * http://www.mozilla.org/MPL/MPL-1.1.html + * + * == END LICENSE == + * + * Estonian language file. + */ + +var FCKLang = +{ +// Language direction : "ltr" (left to right) or "rtl" (right to left). +Dir : "ltr", + +ToolbarCollapse : "Voldi tööriistariba", +ToolbarExpand : "Laienda tööriistariba", + +// Toolbar Items and Context Menu +Save : "Salvesta", +NewPage : "Uus leht", +Preview : "Eelvaade", +Cut : "Lõika", +Copy : "Kopeeri", +Paste : "Kleebi", +PasteText : "Kleebi tavalise tekstina", +PasteWord : "Kleebi Wordist", +Print : "Prindi", +SelectAll : "Vali kõik", +RemoveFormat : "Eemalda vorming", +InsertLinkLbl : "Link", +InsertLink : "Sisesta link / Muuda linki", +RemoveLink : "Eemalda link", +Anchor : "Sisesta ankur / Muuda ankrut", +AnchorDelete : "Eemalda ankur", +InsertImageLbl : "Pilt", +InsertImage : "Sisesta pilt / Muuda pilti", +InsertFlashLbl : "Flash", +InsertFlash : "Sisesta flash / Muuda flashi", +InsertTableLbl : "Tabel", +InsertTable : "Sisesta tabel / Muuda tabelit", +InsertLineLbl : "Joon", +InsertLine : "Sisesta horisontaaljoon", +InsertSpecialCharLbl: "Erimärgid", +InsertSpecialChar : "Sisesta erimärk", +InsertSmileyLbl : "Emotikon", +InsertSmiley : "Sisesta emotikon", +About : "FCKeditor teave", +Bold : "Paks", +Italic : "Kursiiv", +Underline : "Allajoonitud", +StrikeThrough : "Läbijoonitud", +Subscript : "Allindeks", +Superscript : "Ülaindeks", +LeftJustify : "Vasakjoondus", +CenterJustify : "Keskjoondus", +RightJustify : "Paremjoondus", +BlockJustify : "Rööpjoondus", +DecreaseIndent : "Vähenda taanet", +IncreaseIndent : "Suurenda taanet", +Blockquote : "Blokktsitaat", +Undo : "Võta tagasi", +Redo : "Korda toimingut", +NumberedListLbl : "Nummerdatud loetelu", +NumberedList : "Sisesta/Eemalda nummerdatud loetelu", +BulletedListLbl : "Punktiseeritud loetelu", +BulletedList : "Sisesta/Eemalda punktiseeritud loetelu", +ShowTableBorders : "Näita tabeli jooni", +ShowDetails : "Näita üksikasju", +Style : "Laad", +FontFormat : "Vorming", +Font : "Kiri", +FontSize : "Suurus", +TextColor : "Teksti värv", +BGColor : "Tausta värv", +Source : "Lähtekood", +Find : "Otsi", +Replace : "Asenda", +SpellCheck : "Kontrolli õigekirja", +UniversalKeyboard : "Universaalne klaviatuur", +PageBreakLbl : "Lehepiir", +PageBreak : "Sisesta lehevahetuskoht", + +Form : "Vorm", +Checkbox : "Märkeruut", +RadioButton : "Raadionupp", +TextField : "Tekstilahter", +Textarea : "Tekstiala", +HiddenField : "Varjatud lahter", +Button : "Nupp", +SelectionField : "Valiklahter", +ImageButton : "Piltnupp", + +FitWindow : "Maksimeeri redaktori mõõtmed", +ShowBlocks : "Näita blokke", + +// Context Menu +EditLink : "Muuda linki", +CellCM : "Lahter", +RowCM : "Rida", +ColumnCM : "Veerg", +InsertRowAfter : "Sisesta rida peale", +InsertRowBefore : "Sisesta rida enne", +DeleteRows : "Eemalda read", +InsertColumnAfter : "Sisesta veerg peale", +InsertColumnBefore : "Sisesta veerg enne", +DeleteColumns : "Eemalda veerud", +InsertCellAfter : "Sisesta lahter peale", +InsertCellBefore : "Sisesta lahter enne", +DeleteCells : "Eemalda lahtrid", +MergeCells : "Ühenda lahtrid", +MergeRight : "Ühenda paremale", +MergeDown : "Ühenda alla", +HorizontalSplitCell : "Poolita lahter horisontaalselt", +VerticalSplitCell : "Poolita lahter vertikaalselt", +TableDelete : "Kustuta tabel", +CellProperties : "Lahtri atribuudid", +TableProperties : "Tabeli atribuudid", +ImageProperties : "Pildi atribuudid", +FlashProperties : "Flash omadused", + +AnchorProp : "Ankru omadused", +ButtonProp : "Nupu omadused", +CheckboxProp : "Märkeruudu omadused", +HiddenFieldProp : "Varjatud lahtri omadused", +RadioButtonProp : "Raadionupu omadused", +ImageButtonProp : "Piltnupu omadused", +TextFieldProp : "Tekstilahtri omadused", +SelectionFieldProp : "Valiklahtri omadused", +TextareaProp : "Tekstiala omadused", +FormProp : "Vormi omadused", + +FontFormats : "Tavaline;Vormindatud;Aadress;Pealkiri 1;Pealkiri 2;Pealkiri 3;Pealkiri 4;Pealkiri 5;Pealkiri 6;Tavaline (DIV)", + +// Alerts and Messages +ProcessingXHTML : "Töötlen XHTML'i. Palun oota...", +Done : "Tehtud", +PasteWordConfirm : "Tekst, mida soovid lisada paistab pärinevat Word'ist. Kas soovid seda enne kleepimist puhastada?", +NotCompatiblePaste : "See käsk on saadaval ainult Internet Explorer versioon 5.5 või uuema puhul. Kas soovid kleepida ilma puhastamata?", +UnknownToolbarItem : "Tundmatu tööriistarea üksus \"%1\"", +UnknownCommand : "Tundmatu käsunimi \"%1\"", +NotImplemented : "Käsku ei täidetud", +UnknownToolbarSet : "Tööriistariba \"%1\" ei eksisteeri", +NoActiveX : "Sinu veebisirvija turvalisuse seaded võivad limiteerida mõningaid tekstirdaktori kasutusvõimalusi. Sa peaksid võimaldama valiku \"Run ActiveX controls and plug-ins\" oma veebisirvija seadetes. Muidu võid sa täheldada vigu tekstiredaktori töös ja märgata puuduvaid funktsioone.", +BrowseServerBlocked : "Ressursside sirvija avamine ebaõnnestus. Võimalda pop-up akende avanemine.", +DialogBlocked : "Ei olenud võimalik avada dialoogi akent. Võimalda pop-up akende avanemine.", + +// Dialogs +DlgBtnOK : "OK", +DlgBtnCancel : "Loobu", +DlgBtnClose : "Sulge", +DlgBtnBrowseServer : "Sirvi serverit", +DlgAdvancedTag : "Täpsemalt", +DlgOpOther : "", +DlgInfoTab : "Info", +DlgAlertUrl : "Palun sisesta URL", + +// General Dialogs Labels +DlgGenNotSet : "", +DlgGenId : "Id", +DlgGenLangDir : "Keele suund", +DlgGenLangDirLtr : "Vasakult paremale (LTR)", +DlgGenLangDirRtl : "Paremalt vasakule (RTL)", +DlgGenLangCode : "Keele kood", +DlgGenAccessKey : "Juurdepääsu võti", +DlgGenName : "Nimi", +DlgGenTabIndex : "Tab indeks", +DlgGenLongDescr : "Pikk kirjeldus URL", +DlgGenClass : "Stiilistiku klassid", +DlgGenTitle : "Juhendav tiitel", +DlgGenContType : "Juhendava sisu tüüp", +DlgGenLinkCharset : "Lingitud ressurssi märgistik", +DlgGenStyle : "Laad", + +// Image Dialog +DlgImgTitle : "Pildi atribuudid", +DlgImgInfoTab : "Pildi info", +DlgImgBtnUpload : "Saada serverissee", +DlgImgURL : "URL", +DlgImgUpload : "Lae üles", +DlgImgAlt : "Alternatiivne tekst", +DlgImgWidth : "Laius", +DlgImgHeight : "Kõrgus", +DlgImgLockRatio : "Lukusta kuvasuhe", +DlgBtnResetSize : "Lähtesta suurus", +DlgImgBorder : "Joon", +DlgImgHSpace : "H. vaheruum", +DlgImgVSpace : "V. vaheruum", +DlgImgAlign : "Joondus", +DlgImgAlignLeft : "Vasak", +DlgImgAlignAbsBottom: "Abs alla", +DlgImgAlignAbsMiddle: "Abs keskele", +DlgImgAlignBaseline : "Baasjoonele", +DlgImgAlignBottom : "Alla", +DlgImgAlignMiddle : "Keskele", +DlgImgAlignRight : "Paremale", +DlgImgAlignTextTop : "Tekstit üles", +DlgImgAlignTop : "Üles", +DlgImgPreview : "Eelvaade", +DlgImgAlertUrl : "Palun kirjuta pildi URL", +DlgImgLinkTab : "Link", + +// Flash Dialog +DlgFlashTitle : "Flash omadused", +DlgFlashChkPlay : "Automaatne start ", +DlgFlashChkLoop : "Korduv", +DlgFlashChkMenu : "Võimalda flash menüü", +DlgFlashScale : "Mastaap", +DlgFlashScaleAll : "Näita kõike", +DlgFlashScaleNoBorder : "Äärist ei ole", +DlgFlashScaleFit : "Täpne sobivus", + +// Link Dialog +DlgLnkWindowTitle : "Link", +DlgLnkInfoTab : "Lingi info", +DlgLnkTargetTab : "Sihtkoht", + +DlgLnkType : "Lingi tüüp", +DlgLnkTypeURL : "URL", +DlgLnkTypeAnchor : "Ankur sellel lehel", +DlgLnkTypeEMail : "E-post", +DlgLnkProto : "Protokoll", +DlgLnkProtoOther : "", +DlgLnkURL : "URL", +DlgLnkAnchorSel : "Vali ankur", +DlgLnkAnchorByName : "Ankru nime järgi", +DlgLnkAnchorById : "Elemendi id järgi", +DlgLnkNoAnchors : "(Selles dokumendis ei ole ankruid)", +DlgLnkEMail : "E-posti aadress", +DlgLnkEMailSubject : "Sõnumi teema", +DlgLnkEMailBody : "Sõnumi tekst", +DlgLnkUpload : "Lae üles", +DlgLnkBtnUpload : "Saada serverisse", + +DlgLnkTarget : "Sihtkoht", +DlgLnkTargetFrame : "", +DlgLnkTargetPopup : "", +DlgLnkTargetBlank : "Uus aken (_blank)", +DlgLnkTargetParent : "Esivanem aken (_parent)", +DlgLnkTargetSelf : "Sama aken (_self)", +DlgLnkTargetTop : "Pealmine aken (_top)", +DlgLnkTargetFrameName : "Sihtmärk raami nimi", +DlgLnkPopWinName : "Hüpikakna nimi", +DlgLnkPopWinFeat : "Hüpikakna omadused", +DlgLnkPopResize : "Suurendatav", +DlgLnkPopLocation : "Aadressiriba", +DlgLnkPopMenu : "Menüüriba", +DlgLnkPopScroll : "Kerimisribad", +DlgLnkPopStatus : "Olekuriba", +DlgLnkPopToolbar : "Tööriistariba", +DlgLnkPopFullScrn : "Täisekraan (IE)", +DlgLnkPopDependent : "Sõltuv (Netscape)", +DlgLnkPopWidth : "Laius", +DlgLnkPopHeight : "Kõrgus", +DlgLnkPopLeft : "Vasak asukoht", +DlgLnkPopTop : "Ülemine asukoht", + +DlnLnkMsgNoUrl : "Palun kirjuta lingi URL", +DlnLnkMsgNoEMail : "Palun kirjuta E-Posti aadress", +DlnLnkMsgNoAnchor : "Palun vali ankur", +DlnLnkMsgInvPopName : "Hüpikakna nimi peab algama alfabeetilise tähega ja ei tohi sisaldada tühikuid", + +// Color Dialog +DlgColorTitle : "Vali värv", +DlgColorBtnClear : "Tühjenda", +DlgColorHighlight : "Märgi", +DlgColorSelected : "Valitud", + +// Smiley Dialog +DlgSmileyTitle : "Sisesta emotikon", + +// Special Character Dialog +DlgSpecialCharTitle : "Vali erimärk", + +// Table Dialog +DlgTableTitle : "Tabeli atribuudid", +DlgTableRows : "Read", +DlgTableColumns : "Veerud", +DlgTableBorder : "Joone suurus", +DlgTableAlign : "Joondus", +DlgTableAlignNotSet : "", +DlgTableAlignLeft : "Vasak", +DlgTableAlignCenter : "Kesk", +DlgTableAlignRight : "Parem", +DlgTableWidth : "Laius", +DlgTableWidthPx : "pikslit", +DlgTableWidthPc : "protsenti", +DlgTableHeight : "Kõrgus", +DlgTableCellSpace : "Lahtri vahe", +DlgTableCellPad : "Lahtri täidis", +DlgTableCaption : "Tabeli tiitel", +DlgTableSummary : "Kokkuvõte", + +// Table Cell Dialog +DlgCellTitle : "Lahtri atribuudid", +DlgCellWidth : "Laius", +DlgCellWidthPx : "pikslit", +DlgCellWidthPc : "protsenti", +DlgCellHeight : "Kõrgus", +DlgCellWordWrap : "Sõna ülekanne", +DlgCellWordWrapNotSet : "", +DlgCellWordWrapYes : "Jah", +DlgCellWordWrapNo : "Ei", +DlgCellHorAlign : "Horisontaaljoondus", +DlgCellHorAlignNotSet : "", +DlgCellHorAlignLeft : "Vasak", +DlgCellHorAlignCenter : "Kesk", +DlgCellHorAlignRight: "Parem", +DlgCellVerAlign : "Vertikaaljoondus", +DlgCellVerAlignNotSet : "", +DlgCellVerAlignTop : "Üles", +DlgCellVerAlignMiddle : "Keskele", +DlgCellVerAlignBottom : "Alla", +DlgCellVerAlignBaseline : "Baasjoonele", +DlgCellRowSpan : "Reaulatus", +DlgCellCollSpan : "Veeruulatus", +DlgCellBackColor : "Tausta värv", +DlgCellBorderColor : "Joone värv", +DlgCellBtnSelect : "Vali...", + +// Find and Replace Dialog +DlgFindAndReplaceTitle : "Otsi ja asenda", + +// Find Dialog +DlgFindTitle : "Otsi", +DlgFindFindBtn : "Otsi", +DlgFindNotFoundMsg : "Valitud teksti ei leitud.", + +// Replace Dialog +DlgReplaceTitle : "Asenda", +DlgReplaceFindLbl : "Leia mida:", +DlgReplaceReplaceLbl : "Asenda millega:", +DlgReplaceCaseChk : "Erista suur- ja väiketähti", +DlgReplaceReplaceBtn : "Asenda", +DlgReplaceReplAllBtn : "Asenda kõik", +DlgReplaceWordChk : "Otsi terviklike sõnu", + +// Paste Operations / Dialog +PasteErrorCut : "Sinu veebisirvija turvaseaded ei luba redaktoril automaatselt lõigata. Palun kasutage selleks klaviatuuri klahvikombinatsiooni (Ctrl+X).", +PasteErrorCopy : "Sinu veebisirvija turvaseaded ei luba redaktoril automaatselt kopeerida. Palun kasutage selleks klaviatuuri klahvikombinatsiooni (Ctrl+C).", + +PasteAsText : "Kleebi tavalise tekstina", +PasteFromWord : "Kleebi Wordist", + +DlgPasteMsg2 : "Palun kleebi järgnevasse kasti kasutades klaviatuuri klahvikombinatsiooni (Ctrl+V) ja vajuta seejärel OK.", +DlgPasteSec : "Sinu veebisirvija turvaseadete tõttu, ei oma redaktor otsest ligipääsu lõikelaua andmetele. Sa pead kleepima need uuesti siia aknasse.", +DlgPasteIgnoreFont : "Ignoreeri kirja definitsioone", +DlgPasteRemoveStyles : "Eemalda stiilide definitsioonid", + +// Color Picker +ColorAutomatic : "Automaatne", +ColorMoreColors : "Rohkem värve...", + +// Document Properties +DocProps : "Dokumendi omadused", + +// Anchor Dialog +DlgAnchorTitle : "Ankru omadused", +DlgAnchorName : "Ankru nimi", +DlgAnchorErrorName : "Palun sisest ankru nimi", + +// Speller Pages Dialog +DlgSpellNotInDic : "Puudub sõnastikust", +DlgSpellChangeTo : "Muuda", +DlgSpellBtnIgnore : "Ignoreeri", +DlgSpellBtnIgnoreAll : "Ignoreeri kõiki", +DlgSpellBtnReplace : "Asenda", +DlgSpellBtnReplaceAll : "Asenda kõik", +DlgSpellBtnUndo : "Võta tagasi", +DlgSpellNoSuggestions : "- Soovitused puuduvad -", +DlgSpellProgress : "Toimub õigekirja kontroll...", +DlgSpellNoMispell : "Õigekirja kontroll sooritatud: õigekirjuvigu ei leitud", +DlgSpellNoChanges : "Õigekirja kontroll sooritatud: ühtegi sõna ei muudetud", +DlgSpellOneChange : "Õigekirja kontroll sooritatud: üks sõna muudeti", +DlgSpellManyChanges : "Õigekirja kontroll sooritatud: %1 sõna muudetud", + +IeSpellDownload : "Õigekirja kontrollija ei ole installeeritud. Soovid sa selle alla laadida?", + +// Button Dialog +DlgButtonText : "Tekst (väärtus)", +DlgButtonType : "Tüüp", +DlgButtonTypeBtn : "Nupp", +DlgButtonTypeSbm : "Saada", +DlgButtonTypeRst : "Lähtesta", + +// Checkbox and Radio Button Dialogs +DlgCheckboxName : "Nimi", +DlgCheckboxValue : "Väärtus", +DlgCheckboxSelected : "Valitud", + +// Form Dialog +DlgFormName : "Nimi", +DlgFormAction : "Toiming", +DlgFormMethod : "Meetod", + +// Select Field Dialog +DlgSelectName : "Nimi", +DlgSelectValue : "Väärtus", +DlgSelectSize : "Suurus", +DlgSelectLines : "ridu", +DlgSelectChkMulti : "Võimalda mitu valikut", +DlgSelectOpAvail : "Võimalikud valikud", +DlgSelectOpText : "Tekst", +DlgSelectOpValue : "Väärtus", +DlgSelectBtnAdd : "Lisa", +DlgSelectBtnModify : "Muuda", +DlgSelectBtnUp : "Üles", +DlgSelectBtnDown : "Alla", +DlgSelectBtnSetValue : "Sea valitud olekuna", +DlgSelectBtnDelete : "Kustuta", + +// Textarea Dialog +DlgTextareaName : "Nimi", +DlgTextareaCols : "Veerge", +DlgTextareaRows : "Ridu", + +// Text Field Dialog +DlgTextName : "Nimi", +DlgTextValue : "Väärtus", +DlgTextCharWidth : "Laius (tähemärkides)", +DlgTextMaxChars : "Maksimaalselt tähemärke", +DlgTextType : "Tüüp", +DlgTextTypeText : "Tekst", +DlgTextTypePass : "Parool", + +// Hidden Field Dialog +DlgHiddenName : "Nimi", +DlgHiddenValue : "Väärtus", + +// Bulleted List Dialog +BulletedListProp : "Täpitud loetelu omadused", +NumberedListProp : "Nummerdatud loetelu omadused", +DlgLstStart : "Alusta", +DlgLstType : "Tüüp", +DlgLstTypeCircle : "Ring", +DlgLstTypeDisc : "Ketas", +DlgLstTypeSquare : "Ruut", +DlgLstTypeNumbers : "Numbrid (1, 2, 3)", +DlgLstTypeLCase : "Väiketähed (a, b, c)", +DlgLstTypeUCase : "Suurtähed (A, B, C)", +DlgLstTypeSRoman : "Väiksed Rooma numbrid (i, ii, iii)", +DlgLstTypeLRoman : "Suured Rooma numbrid (I, II, III)", + +// Document Properties Dialog +DlgDocGeneralTab : "Üldine", +DlgDocBackTab : "Taust", +DlgDocColorsTab : "Värvid ja veerised", +DlgDocMetaTab : "Meta andmed", + +DlgDocPageTitle : "Lehekülje tiitel", +DlgDocLangDir : "Kirja suund", +DlgDocLangDirLTR : "Vasakult paremale (LTR)", +DlgDocLangDirRTL : "Paremalt vasakule (RTL)", +DlgDocLangCode : "Keele kood", +DlgDocCharSet : "Märgistiku kodeering", +DlgDocCharSetCE : "Kesk-Euroopa", +DlgDocCharSetCT : "Hiina traditsiooniline (Big5)", +DlgDocCharSetCR : "Kirillisa", +DlgDocCharSetGR : "Kreeka", +DlgDocCharSetJP : "Jaapani", +DlgDocCharSetKR : "Korea", +DlgDocCharSetTR : "Türgi", +DlgDocCharSetUN : "Unicode (UTF-8)", +DlgDocCharSetWE : "Lääne-Euroopa", +DlgDocCharSetOther : "Ülejäänud märgistike kodeeringud", + +DlgDocDocType : "Dokumendi tüüppäis", +DlgDocDocTypeOther : "Teised dokumendi tüüppäised", +DlgDocIncXHTML : "Arva kaasa XHTML deklaratsioonid", +DlgDocBgColor : "Taustavärv", +DlgDocBgImage : "Taustapildi URL", +DlgDocBgNoScroll : "Mittekeritav tagataust", +DlgDocCText : "Tekst", +DlgDocCLink : "Link", +DlgDocCVisited : "Külastatud link", +DlgDocCActive : "Aktiivne link", +DlgDocMargins : "Lehekülje äärised", +DlgDocMaTop : "Ülaserv", +DlgDocMaLeft : "Vasakserv", +DlgDocMaRight : "Paremserv", +DlgDocMaBottom : "Alaserv", +DlgDocMeIndex : "Dokumendi võtmesõnad (eraldatud komadega)", +DlgDocMeDescr : "Dokumendi kirjeldus", +DlgDocMeAuthor : "Autor", +DlgDocMeCopy : "Autoriõigus", +DlgDocPreview : "Eelvaade", + +// Templates Dialog +Templates : "Šabloon", +DlgTemplatesTitle : "Sisu šabloonid", +DlgTemplatesSelMsg : "Palun vali šabloon, et avada see redaktoris
        (praegune sisu läheb kaotsi):", +DlgTemplatesLoading : "Laen šabloonide nimekirja. Palun oota...", +DlgTemplatesNoTpl : "(Ühtegi šablooni ei ole defineeritud)", +DlgTemplatesReplace : "Asenda tegelik sisu", + +// About Dialog +DlgAboutAboutTab : "Teave", +DlgAboutBrowserInfoTab : "Veebisirvija info", +DlgAboutLicenseTab : "Litsents", +DlgAboutVersion : "versioon", +DlgAboutInfo : "Täpsema info saamiseks mine" +}; Property changes on: announcement/trunk/src/main/webapp/fckeditor/editor/lang/et.js ___________________________________________________________________ Name: svn:eol-style + native Added: announcement/trunk/src/main/webapp/fckeditor/editor/lang/eu.js =================================================================== --- announcement/trunk/src/main/webapp/fckeditor/editor/lang/eu.js (rev 0) +++ announcement/trunk/src/main/webapp/fckeditor/editor/lang/eu.js 2008-06-30 02:54:27 UTC (rev 1002) @@ -0,0 +1,516 @@ +?/* + * FCKeditor - The text editor for Internet - http://www.fckeditor.net + * Copyright (C) 2003-2008 Frederico Caldeira Knabben + * + * == BEGIN LICENSE == + * + * Licensed under the terms of any of the following licenses at your + * choice: + * + * - GNU General Public License Version 2 or later (the "GPL") + * http://www.gnu.org/licenses/gpl.html + * + * - GNU Lesser General Public License Version 2.1 or later (the "LGPL") + * http://www.gnu.org/licenses/lgpl.html + * + * - Mozilla Public License Version 1.1 or later (the "MPL") + * http://www.mozilla.org/MPL/MPL-1.1.html + * + * == END LICENSE == + * + * Basque language file. + * Euskara hizkuntza fitxategia. + */ + +var FCKLang = +{ +// Language direction : "ltr" (left to right) or "rtl" (right to left). +Dir : "ltr", + +ToolbarCollapse : "Estutu Tresna Barra", +ToolbarExpand : "Hedatu Tresna Barra", + +// Toolbar Items and Context Menu +Save : "Gorde", +NewPage : "Orrialde Berria", +Preview : "Aurrebista", +Cut : "Ebaki", +Copy : "Kopiatu", +Paste : "Itsatsi", +PasteText : "Itsatsi testu bezala", +PasteWord : "Itsatsi Word-etik", +Print : "Inprimatu", +SelectAll : "Hautatu dena", +RemoveFormat : "Kendu Formatoa", +InsertLinkLbl : "Esteka", +InsertLink : "Txertatu/Editatu Esteka", +RemoveLink : "Kendu Esteka", +Anchor : "Aingura", +AnchorDelete : "Ezabatu Aingura", +InsertImageLbl : "Irudia", +InsertImage : "Txertatu/Editatu Irudia", +InsertFlashLbl : "Flasha", +InsertFlash : "Txertatu/Editatu Flasha", +InsertTableLbl : "Taula", +InsertTable : "Txertatu/Editatu Taula", +InsertLineLbl : "Lerroa", +InsertLine : "Txertatu Marra Horizontala", +InsertSpecialCharLbl: "Karaktere Berezia", +InsertSpecialChar : "Txertatu Karaktere Berezia", +InsertSmileyLbl : "Aurpegierak", +InsertSmiley : "Txertatu Aurpegierak", +About : "FCKeditor-ri buruz", +Bold : "Lodia", +Italic : "Etzana", +Underline : "Azpimarratu", +StrikeThrough : "Marratua", +Subscript : "Azpi-indize", +Superscript : "Goi-indize", +LeftJustify : "Lerrokatu Ezkerrean", +CenterJustify : "Lerrokatu Erdian", +RightJustify : "Lerrokatu Eskuman", +BlockJustify : "Justifikatu", +DecreaseIndent : "Txikitu Koska", +IncreaseIndent : "Handitu Koska", +Blockquote : "Aipamen blokea", +Undo : "Desegin", +Redo : "Berregin", +NumberedListLbl : "Zenbakidun Zerrenda", +NumberedList : "Txertatu/Kendu Zenbakidun zerrenda", +BulletedListLbl : "Buletdun Zerrenda", +BulletedList : "Txertatu/Kendu Buletdun zerrenda", +ShowTableBorders : "Erakutsi Taularen Ertzak", +ShowDetails : "Erakutsi Xehetasunak", +Style : "Estiloa", +FontFormat : "Formatoa", +Font : "Letra-tipoa", +FontSize : "Tamaina", +TextColor : "Testu Kolorea", +BGColor : "Atzeko kolorea", +Source : "HTML Iturburua", +Find : "Bilatu", +Replace : "Ordezkatu", +SpellCheck : "Ortografia", +UniversalKeyboard : "Teklatu Unibertsala", +PageBreakLbl : "Orrialde-jauzia", +PageBreak : "Txertatu Orrialde-jauzia", + +Form : "Formularioa", +Checkbox : "Kontrol-laukia", +RadioButton : "Aukera-botoia", +TextField : "Testu Eremua", +Textarea : "Testu-area", +HiddenField : "Ezkutuko Eremua", +Button : "Botoia", +SelectionField : "Hautespen Eremua", +ImageButton : "Irudi Botoia", + +FitWindow : "Maximizatu editorearen tamaina", +ShowBlocks : "Blokeak erakutsi", + +// Context Menu +EditLink : "Aldatu Esteka", +CellCM : "Gelaxka", +RowCM : "Errenkada", +ColumnCM : "Zutabea", +InsertRowAfter : "Txertatu Lerroa Ostean", +InsertRowBefore : "Txertatu Lerroa Aurretik", +DeleteRows : "Ezabatu Errenkadak", +InsertColumnAfter : "Txertatu Zutabea Ostean", +InsertColumnBefore : "Txertatu Zutabea Aurretik", +DeleteColumns : "Ezabatu Zutabeak", +InsertCellAfter : "Txertatu Gelaxka Ostean", +InsertCellBefore : "Txertatu Gelaxka Aurretik", +DeleteCells : "Kendu Gelaxkak", +MergeCells : "Batu Gelaxkak", +MergeRight : "Elkartu Eskumara", +MergeDown : "Elkartu Behera", +HorizontalSplitCell : "Banatu Gelaxkak Horizontalki", +VerticalSplitCell : "Banatu Gelaxkak Bertikalki", +TableDelete : "Ezabatu Taula", +CellProperties : "Gelaxkaren Ezaugarriak", +TableProperties : "Taularen Ezaugarriak", +ImageProperties : "Irudiaren Ezaugarriak", +FlashProperties : "Flasharen Ezaugarriak", + +AnchorProp : "Ainguraren Ezaugarriak", +ButtonProp : "Botoiaren Ezaugarriak", +CheckboxProp : "Kontrol-laukiko Ezaugarriak", +HiddenFieldProp : "Ezkutuko Eremuaren Ezaugarriak", +RadioButtonProp : "Aukera-botoiaren Ezaugarriak", +ImageButtonProp : "Irudi Botoiaren Ezaugarriak", +TextFieldProp : "Testu Eremuaren Ezaugarriak", +SelectionFieldProp : "Hautespen Eremuaren Ezaugarriak", +TextareaProp : "Testu-arearen Ezaugarriak", +FormProp : "Formularioaren Ezaugarriak", + +FontFormats : "Arrunta;Formateatua;Helbidea;Izenburua 1;Izenburua 2;Izenburua 3;Izenburua 4;Izenburua 5;Izenburua 6;Paragrafoa (DIV)", + +// Alerts and Messages +ProcessingXHTML : "XHTML Prozesatzen. Itxaron mesedez...", +Done : "Eginda", +PasteWordConfirm : "Itsatsi nahi duzun textua Wordetik hartua dela dirudi. Itsatsi baino lehen garbitu nahi duzu?", +NotCompatiblePaste : "Komando hau Internet Explorer 5.5 bertsiorako edo ondorengoentzako erabilgarria dago. Garbitu gabe itsatsi nahi duzu?", +UnknownToolbarItem : "Ataza barrako elementu ezezaguna \"%1\"", +UnknownCommand : "Komando izen ezezaguna \"%1\"", +NotImplemented : "Komando ez inplementatua", +UnknownToolbarSet : "Ataza barra \"%1\" taldea ez da existitzen", +NoActiveX : "Zure nabigatzailearen segustasun hobespenak editore honen zenbait ezaugarri mugatu ditzake. \"ActiveX kontrolak eta plug-inak\" aktibatu beharko zenituzke, bestela erroreak eta ezaugarrietan mugak egon daitezke.", +BrowseServerBlocked : "Baliabideen arakatzailea ezin da ireki. Ziurtatu popup blokeatzaileak desgaituta dituzula.", +DialogBlocked : "Ezin da elkarrizketa-leihoa ireki. Ziurtatu popup blokeatzaileak desgaituta dituzula.", + +// Dialogs +DlgBtnOK : "Ados", +DlgBtnCancel : "Utzi", +DlgBtnClose : "Itxi", +DlgBtnBrowseServer : "Zerbitzaria arakatu", +DlgAdvancedTag : "Aurreratua", +DlgOpOther : "", +DlgInfoTab : "Informazioa", +DlgAlertUrl : "Mesedez URLa idatzi ezazu", + +// General Dialogs Labels +DlgGenNotSet : "", +DlgGenId : "Id", +DlgGenLangDir : "Hizkuntzaren Norabidea", +DlgGenLangDirLtr : "Ezkerretik Eskumara(LTR)", +DlgGenLangDirRtl : "Eskumatik Ezkerrera (RTL)", +DlgGenLangCode : "Hizkuntza Kodea", +DlgGenAccessKey : "Sarbide-gakoa", +DlgGenName : "Izena", +DlgGenTabIndex : "Tabulazio Indizea", +DlgGenLongDescr : "URL Deskribapen Luzea", +DlgGenClass : "Estilo-orriko Klaseak", +DlgGenTitle : "Izenburua", +DlgGenContType : "Eduki Mota (Content Type)", +DlgGenLinkCharset : "Estekatutako Karaktere Multzoa", +DlgGenStyle : "Estiloa", + +// Image Dialog +DlgImgTitle : "Irudi Ezaugarriak", +DlgImgInfoTab : "Irudi informazioa", +DlgImgBtnUpload : "Zerbitzarira bidalia", +DlgImgURL : "URL", +DlgImgUpload : "Gora Kargatu", +DlgImgAlt : "Textu Alternatiboa", +DlgImgWidth : "Zabalera", +DlgImgHeight : "Altuera", +DlgImgLockRatio : "Erlazioa Blokeatu", +DlgBtnResetSize : "Tamaina Berrezarri", +DlgImgBorder : "Ertza", +DlgImgHSpace : "HSpace", +DlgImgVSpace : "VSpace", +DlgImgAlign : "Lerrokatu", +DlgImgAlignLeft : "Ezkerrera", +DlgImgAlignAbsBottom: "Abs Behean", +DlgImgAlignAbsMiddle: "Abs Erdian", +DlgImgAlignBaseline : "Oinan", +DlgImgAlignBottom : "Behean", +DlgImgAlignMiddle : "Erdian", +DlgImgAlignRight : "Eskuman", +DlgImgAlignTextTop : "Testua Goian", +DlgImgAlignTop : "Goian", +DlgImgPreview : "Aurrebista", +DlgImgAlertUrl : "Mesedez Irudiaren URLa idatzi", +DlgImgLinkTab : "Esteka", + +// Flash Dialog +DlgFlashTitle : "Flasharen Ezaugarriak", +DlgFlashChkPlay : "Automatikoki Erreproduzitu", +DlgFlashChkLoop : "Begizta", +DlgFlashChkMenu : "Flasharen Menua Gaitu", +DlgFlashScale : "Eskalatu", +DlgFlashScaleAll : "Dena erakutsi", +DlgFlashScaleNoBorder : "Ertzarik gabe", +DlgFlashScaleFit : "Doitu", + +// Link Dialog +DlgLnkWindowTitle : "Esteka", +DlgLnkInfoTab : "Estekaren Informazioa", +DlgLnkTargetTab : "Helburua", + +DlgLnkType : "Esteka Mota", +DlgLnkTypeURL : "URL", +DlgLnkTypeAnchor : "Aingura horrialde honentan", +DlgLnkTypeEMail : "ePosta", +DlgLnkProto : "Protokoloa", +DlgLnkProtoOther : "", +DlgLnkURL : "URL", +DlgLnkAnchorSel : "Aingura bat hautatu", +DlgLnkAnchorByName : "Aingura izenagatik", +DlgLnkAnchorById : "Elementuaren ID-gatik", +DlgLnkNoAnchors : "(Ez daude aingurak eskuragarri dokumentuan)", +DlgLnkEMail : "ePosta Helbidea", +DlgLnkEMailSubject : "Mezuaren Gaia", +DlgLnkEMailBody : "Mezuaren Gorputza", +DlgLnkUpload : "Gora kargatu", +DlgLnkBtnUpload : "Zerbitzarira bidali", + +DlgLnkTarget : "Target (Helburua)", +DlgLnkTargetFrame : "", +DlgLnkTargetPopup : "", +DlgLnkTargetBlank : "Lehio Berria (_blank)", +DlgLnkTargetParent : "Lehio Gurasoa (_parent)", +DlgLnkTargetSelf : "Lehio Berdina (_self)", +DlgLnkTargetTop : "Goiko Lehioa (_top)", +DlgLnkTargetFrameName : "Marko Helburuaren Izena", +DlgLnkPopWinName : "Popup Lehioaren Izena", +DlgLnkPopWinFeat : "Popup Lehioaren Ezaugarriak", +DlgLnkPopResize : "Tamaina Aldakorra", +DlgLnkPopLocation : "Kokaleku Barra", +DlgLnkPopMenu : "Menu Barra", +DlgLnkPopScroll : "Korritze Barrak", +DlgLnkPopStatus : "Egoera Barra", +DlgLnkPopToolbar : "Tresna Barra", +DlgLnkPopFullScrn : "Pantaila Osoa (IE)", +DlgLnkPopDependent : "Menpekoa (Netscape)", +DlgLnkPopWidth : "Zabalera", +DlgLnkPopHeight : "Altuera", +DlgLnkPopLeft : "Ezkerreko Posizioa", +DlgLnkPopTop : "Goiko Posizioa", + +DlnLnkMsgNoUrl : "Mesedez URL esteka idatzi", +DlnLnkMsgNoEMail : "Mesedez ePosta helbidea idatzi", +DlnLnkMsgNoAnchor : "Mesedez aingura bat aukeratu", +DlnLnkMsgInvPopName : "Popup lehioaren izenak karaktere alfabetiko batekin hasi behar du eta eta ezin du zuriunerik izan", + +// Color Dialog +DlgColorTitle : "Kolore Aukeraketa", +DlgColorBtnClear : "Garbitu", +DlgColorHighlight : "Nabarmendu", +DlgColorSelected : "Aukeratuta", + +// Smiley Dialog +DlgSmileyTitle : "Aurpegiera Sartu", + +// Special Character Dialog +DlgSpecialCharTitle : "Karaktere Berezia Aukeratu", + +// Table Dialog +DlgTableTitle : "Taularen Ezaugarriak", +DlgTableRows : "Lerroak", +DlgTableColumns : "Zutabeak", +DlgTableBorder : "Ertzaren Zabalera", +DlgTableAlign : "Lerrokatu", +DlgTableAlignNotSet : "", +DlgTableAlignLeft : "Ezkerrean", +DlgTableAlignCenter : "Erdian", +DlgTableAlignRight : "Eskuman", +DlgTableWidth : "Zabalera", +DlgTableWidthPx : "pixel", +DlgTableWidthPc : "ehuneko", +DlgTableHeight : "Altuera", +DlgTableCellSpace : "Gelaxka arteko tartea", +DlgTableCellPad : "Gelaxken betegarria", +DlgTableCaption : "Epigrafea", +DlgTableSummary : "Laburpena", + +// Table Cell Dialog +DlgCellTitle : "Gelaxken Ezaugarriak", +DlgCellWidth : "Zabalera", +DlgCellWidthPx : "pixel", +DlgCellWidthPc : "ehuneko", +DlgCellHeight : "Altuera", +DlgCellWordWrap : "Itzulbira", +DlgCellWordWrapNotSet : "", +DlgCellWordWrapYes : "Bai", +DlgCellWordWrapNo : "Ez", +DlgCellHorAlign : "Horizontal Alignment", +DlgCellHorAlignNotSet : "", +DlgCellHorAlignLeft : "Ezkerrean", +DlgCellHorAlignCenter : "Erdian", +DlgCellHorAlignRight: "Eskuman", +DlgCellVerAlign : "Lerrokatu Bertikalki", +DlgCellVerAlignNotSet : "", +DlgCellVerAlignTop : "Goian", +DlgCellVerAlignMiddle : "Erdian", +DlgCellVerAlignBottom : "Behean", +DlgCellVerAlignBaseline : "Oinan", +DlgCellRowSpan : "Lerroak Hedatu", +DlgCellCollSpan : "Zutabeak Hedatu", +DlgCellBackColor : "Atzeko Kolorea", +DlgCellBorderColor : "Ertzako Kolorea", +DlgCellBtnSelect : "Aukertau...", + +// Find and Replace Dialog +DlgFindAndReplaceTitle : "Bilatu eta Ordeztu", + +// Find Dialog +DlgFindTitle : "Bilaketa", +DlgFindFindBtn : "Bilatu", +DlgFindNotFoundMsg : "Idatzitako testua ez da topatu.", + +// Replace Dialog +DlgReplaceTitle : "Ordeztu", +DlgReplaceFindLbl : "Zer bilatu:", +DlgReplaceReplaceLbl : "Zerekin ordeztu:", +DlgReplaceCaseChk : "Maiuskula/minuskula", +DlgReplaceReplaceBtn : "Ordeztu", +DlgReplaceReplAllBtn : "Ordeztu Guztiak", +DlgReplaceWordChk : "Esaldi osoa bilatu", + +// Paste Operations / Dialog +PasteErrorCut : "Zure web nabigatzailearen segurtasun ezarpenak testuak automatikoki moztea ez dute baimentzen. Mesedez teklatua erabili ezazu (Ctrl+X).", +PasteErrorCopy : "Zure web nabigatzailearen segurtasun ezarpenak testuak automatikoki kopiatzea ez dute baimentzen. Mesedez teklatua erabili ezazu (Ctrl+C).", + +PasteAsText : "Testu Arrunta bezala Itsatsi", +PasteFromWord : "Word-etik itsatsi", + +DlgPasteMsg2 : "Mesedez teklatua erabilita (Ctrl+V) ondorego eremuan testua itsatsi eta OK sakatu.", +DlgPasteSec : "Nabigatzailearen segurtasun ezarpenak direla eta, editoreak ezin du arbela zuzenean erabili. Leiho honetan berriro itsatsi behar duzu.", +DlgPasteIgnoreFont : "Letra Motaren definizioa ezikusi", +DlgPasteRemoveStyles : "Estilo definizioak kendu", + +// Color Picker +ColorAutomatic : "Automatikoa", +ColorMoreColors : "Kolore gehiago...", + +// Document Properties +DocProps : "Dokumentuaren Ezarpenak", + +// Anchor Dialog +DlgAnchorTitle : "Ainguraren Ezaugarriak", +DlgAnchorName : "Ainguraren Izena", +DlgAnchorErrorName : "Idatzi ainguraren izena", + +// Speller Pages Dialog +DlgSpellNotInDic : "Ez dago hiztegian", +DlgSpellChangeTo : "Honekin ordezkatu", +DlgSpellBtnIgnore : "Ezikusi", +DlgSpellBtnIgnoreAll : "Denak Ezikusi", +DlgSpellBtnReplace : "Ordezkatu", +DlgSpellBtnReplaceAll : "Denak Ordezkatu", +DlgSpellBtnUndo : "Desegin", +DlgSpellNoSuggestions : "- Iradokizunik ez -", +DlgSpellProgress : "Zuzenketa ortografikoa martxan...", +DlgSpellNoMispell : "Zuzenketa ortografikoa bukatuta: Akatsik ez", +DlgSpellNoChanges : "Zuzenketa ortografikoa bukatuta: Ez da ezer aldatu", +DlgSpellOneChange : "Zuzenketa ortografikoa bukatuta: Hitz bat aldatu da", +DlgSpellManyChanges : "Zuzenketa ortografikoa bukatuta: %1 hitz aldatu dira", + +IeSpellDownload : "Zuzentzaile ortografikoa ez dago instalatuta. Deskargatu nahi duzu?", + +// Button Dialog +DlgButtonText : "Testua (Balorea)", +DlgButtonType : "Mota", +DlgButtonTypeBtn : "Botoia", +DlgButtonTypeSbm : "Bidali", +DlgButtonTypeRst : "Garbitu", + +// Checkbox and Radio Button Dialogs +DlgCheckboxName : "Izena", +DlgCheckboxValue : "Balorea", +DlgCheckboxSelected : "Hautatuta", + +// Form Dialog +DlgFormName : "Izena", +DlgFormAction : "Ekintza", +DlgFormMethod : "Method", + +// Select Field Dialog +DlgSelectName : "Izena", +DlgSelectValue : "Balorea", +DlgSelectSize : "Tamaina", +DlgSelectLines : "lerro kopurura", +DlgSelectChkMulti : "Hautaketa anitzak baimendu", +DlgSelectOpAvail : "Aukera Eskuragarriak", +DlgSelectOpText : "Testua", +DlgSelectOpValue : "Balorea", +DlgSelectBtnAdd : "Gehitu", +DlgSelectBtnModify : "Aldatu", +DlgSelectBtnUp : "Gora", +DlgSelectBtnDown : "Behera", +DlgSelectBtnSetValue : "Aukeratutako balorea ezarri", +DlgSelectBtnDelete : "Ezabatu", + +// Textarea Dialog +DlgTextareaName : "Izena", +DlgTextareaCols : "Zutabeak", +DlgTextareaRows : "Lerroak", + +// Text Field Dialog +DlgTextName : "Izena", +DlgTextValue : "Balorea", +DlgTextCharWidth : "Zabalera", +DlgTextMaxChars : "Zenbat karaktere gehienez", +DlgTextType : "Mota", +DlgTextTypeText : "Testua", +DlgTextTypePass : "Pasahitza", + +// Hidden Field Dialog +DlgHiddenName : "Izena", +DlgHiddenValue : "Balorea", + +// Bulleted List Dialog +BulletedListProp : "Buletdun Zerrendaren Ezarpenak", +NumberedListProp : "Zenbakidun Zerrendaren Ezarpenak", +DlgLstStart : "Hasiera", +DlgLstType : "Mota", +DlgLstTypeCircle : "Zirkulua", +DlgLstTypeDisc : "Diskoa", +DlgLstTypeSquare : "Karratua", +DlgLstTypeNumbers : "Zenbakiak (1, 2, 3)", +DlgLstTypeLCase : "Letra xeheak (a, b, c)", +DlgLstTypeUCase : "Letra larriak (A, B, C)", +DlgLstTypeSRoman : "Erromatar zenbaki zeheak (i, ii, iii)", +DlgLstTypeLRoman : "Erromatar zenbaki larriak (I, II, III)", + +// Document Properties Dialog +DlgDocGeneralTab : "Orokorra", +DlgDocBackTab : "Atzekaldea", +DlgDocColorsTab : "Koloreak eta Marjinak", +DlgDocMetaTab : "Meta Informazioa", + +DlgDocPageTitle : "Orriaren Izenburua", +DlgDocLangDir : "Hizkuntzaren Norabidea", +DlgDocLangDirLTR : "Ezkerretik eskumara (LTR)", +DlgDocLangDirRTL : "Eskumatik ezkerrera (RTL)", +DlgDocLangCode : "Hizkuntzaren Kodea", +DlgDocCharSet : "Karaktere Multzoaren Kodeketa", +DlgDocCharSetCE : "Erdialdeko Europakoa", +DlgDocCharSetCT : "Txinatar Tradizionala (Big5)", +DlgDocCharSetCR : "Zirilikoa", +DlgDocCharSetGR : "Grekoa", +DlgDocCharSetJP : "Japoniarra", +DlgDocCharSetKR : "Korearra", +DlgDocCharSetTR : "Turkiarra", +DlgDocCharSetUN : "Unicode (UTF-8)", +DlgDocCharSetWE : "Mendebaldeko Europakoa", +DlgDocCharSetOther : "Beste Karaktere Multzoko Kodeketa", + +DlgDocDocType : "Document Type Goiburua", +DlgDocDocTypeOther : "Beste Document Type Goiburua", +DlgDocIncXHTML : "XHTML Ezarpenak", +DlgDocBgColor : "Atzeko Kolorea", +DlgDocBgImage : "Atzeko Irudiaren URL-a", +DlgDocBgNoScroll : "Korritze gabeko Atzekaldea", +DlgDocCText : "Testua", +DlgDocCLink : "Estekak", +DlgDocCVisited : "Bisitatutako Estekak", +DlgDocCActive : "Esteka Aktiboa", +DlgDocMargins : "Orrialdearen marjinak", +DlgDocMaTop : "Goian", +DlgDocMaLeft : "Ezkerrean", +DlgDocMaRight : "Eskuman", +DlgDocMaBottom : "Behean", +DlgDocMeIndex : "Dokumentuaren Gako-hitzak (komarekin bananduta)", +DlgDocMeDescr : "Dokumentuaren Deskribapena", +DlgDocMeAuthor : "Egilea", +DlgDocMeCopy : "Copyright", +DlgDocPreview : "Aurrebista", + +// Templates Dialog +Templates : "Txantiloiak", +DlgTemplatesTitle : "Eduki Txantiloiak", +DlgTemplatesSelMsg : "Mesedez txantiloia aukeratu editorean kargatzeko
        (orain dauden edukiak galduko dira):", +DlgTemplatesLoading : "Txantiloiak kargatzen. Itxaron mesedez...", +DlgTemplatesNoTpl : "(Ez dago definitutako txantiloirik)", +DlgTemplatesReplace : "Ordeztu oraingo edukiak", + +// About Dialog +DlgAboutAboutTab : "Honi buruz", +DlgAboutBrowserInfoTab : "Nabigatzailearen Informazioa", +DlgAboutLicenseTab : "Lizentzia", +DlgAboutVersion : "bertsioa", +DlgAboutInfo : "Informazio gehiago eskuratzeko hona joan" +}; Property changes on: announcement/trunk/src/main/webapp/fckeditor/editor/lang/eu.js ___________________________________________________________________ Name: svn:eol-style + native Added: announcement/trunk/src/main/webapp/fckeditor/editor/lang/fa.js =================================================================== --- announcement/trunk/src/main/webapp/fckeditor/editor/lang/fa.js (rev 0) +++ announcement/trunk/src/main/webapp/fckeditor/editor/lang/fa.js 2008-06-30 02:54:27 UTC (rev 1002) @@ -0,0 +1,515 @@ +?/* + * FCKeditor - The text editor for Internet - http://www.fckeditor.net + * Copyright (C) 2003-2008 Frederico Caldeira Knabben + * + * == BEGIN LICENSE == + * + * Licensed under the terms of any of the following licenses at your + * choice: + * + * - GNU General Public License Version 2 or later (the "GPL") + * http://www.gnu.org/licenses/gpl.html + * + * - GNU Lesser General Public License Version 2.1 or later (the "LGPL") + * http://www.gnu.org/licenses/lgpl.html + * + * - Mozilla Public License Version 1.1 or later (the "MPL") + * http://www.mozilla.org/MPL/MPL-1.1.html + * + * == END LICENSE == + * + * Persian language file. + */ + +var FCKLang = +{ +// Language direction : "ltr" (left to right) or "rtl" (right to left). +Dir : "rtl", + +ToolbarCollapse : "?????? ?????????", +ToolbarExpand : "?????? ?????????", + +// Toolbar Items and Context Menu +Save : "?????", +NewPage : "????? ????", +Preview : "?????????", +Cut : "???", +Copy : "???", +Paste : "???????", +PasteText : "??????? ?? ????? ??? ?????", +PasteWord : "??????? ?? Word", +Print : "???", +SelectAll : "????? ???", +RemoveFormat : "??????? ????", +InsertLinkLbl : "?????", +InsertLink : "???????/?????? ??????", +RemoveLink : "??????? ?????", +Anchor : "???????/?????? ?????", +AnchorDelete : "Remove Anchor", //MISSING +InsertImageLbl : "?????", +InsertImage : "???????/?????? ??????", +InsertFlashLbl : "Flash", +InsertFlash : "???????/?????? ?Flash", +InsertTableLbl : "????", +InsertTable : "???????/?????? ?????", +InsertLineLbl : "??", +InsertLine : "??????? ?? ?????", +InsertSpecialCharLbl: "?????? ????", +InsertSpecialChar : "??????? ?????? ????", +InsertSmileyLbl : "??????", +InsertSmiley : "??????? ??????", +About : "??????? FCKeditor", +Bold : "????", +Italic : "?????", +Underline : "?????????", +StrikeThrough : "???????", +Subscript : "???????", +Superscript : "????????", +LeftJustify : "??????", +CenterJustify : "????????", +RightJustify : "????????", +BlockJustify : "????????", +DecreaseIndent : "???? ???????", +IncreaseIndent : "?????? ???????", +Blockquote : "Blockquote", //MISSING +Undo : "??????", +Redo : "???????", +NumberedListLbl : "????? ?????????", +NumberedList : "???????/??????? ????? ?????????", +BulletedListLbl : "????? ???????", +BulletedList : "???????/??????? ????? ???????", +ShowTableBorders : "????? ???? ????", +ShowDetails : "????? ??????", +Style : "???", +FontFormat : "????", +Font : "???", +FontSize : "??????", +TextColor : "??? ???", +BGColor : "??? ????????", +Source : "????", +Find : "?????", +Replace : "????????", +SpellCheck : "????? ????", +UniversalKeyboard : "????????? ?????", +PageBreakLbl : "?????? ?????? ?????", +PageBreak : "??????? ?????? ?????? ?????", + +Form : "???", +Checkbox : "????? ????????", +RadioButton : "????? ???????", +TextField : "???? ????", +Textarea : "?????? ????", +HiddenField : "???? ?????", +Button : "????", +SelectionField : "???? ???????????", +ImageButton : "????? ??????", + +FitWindow : "??????????? ???????? ????????", +ShowBlocks : "Show Blocks", //MISSING + +// Context Menu +EditLink : "?????? ?????", +CellCM : "????", +RowCM : "???", +ColumnCM : "????", +InsertRowAfter : "Insert Row After", //MISSING +InsertRowBefore : "Insert Row Before", //MISSING +DeleteRows : "??? ?????", +InsertColumnAfter : "Insert Column After", //MISSING +InsertColumnBefore : "Insert Column Before", //MISSING +DeleteColumns : "??? ??????", +InsertCellAfter : "Insert Cell After", //MISSING +InsertCellBefore : "Insert Cell Before", //MISSING +DeleteCells : "??? ??????", +MergeCells : "????? ??????", +MergeRight : "Merge Right", //MISSING +MergeDown : "Merge Down", //MISSING +HorizontalSplitCell : "Split Cell Horizontally", //MISSING +VerticalSplitCell : "Split Cell Vertically", //MISSING +TableDelete : "???????? ????", +CellProperties : "???????? ????", +TableProperties : "???????? ????", +ImageProperties : "???????? ?????", +FlashProperties : "???????? Flash", + +AnchorProp : "???????? ????", +ButtonProp : "???????? ????", +CheckboxProp : "???????? ????? ????????", +HiddenFieldProp : "???????? ???? ?????", +RadioButtonProp : "???????? ????? ???????", +ImageButtonProp : "???????? ????? ??????", +TextFieldProp : "???????? ???? ????", +SelectionFieldProp : "???????? ???? ???????????", +TextareaProp : "???????? ?????? ????", +FormProp : "???????? ???", + +FontFormats : "?????;????????;????;?????? 1;?????? 2;?????? 3;?????? 4;?????? 5;?????? 6;???;(DIV)", + +// Alerts and Messages +ProcessingXHTML : "?????? XHTML. ???? ??? ????...", +Done : "????? ??", +PasteWordConfirm : "???? ?? ????????? ???????? ?? ??? ?????? ?? Word ??? ??? ???. ??? ????????? ??? ?? ??????? ?? ?? ???????? ?????", +NotCompatiblePaste : "??? ????? ???? ?????? Internet Explorer ?? ????? 5.5 ?? ?????? ?? ????? ???. ??? ????????? ???? ????????? ??? ?? ?????????", +UnknownToolbarItem : "????? ????????? ???????? \"%1\"", +UnknownCommand : "??? ????? ???????? \"%1\"", +NotImplemented : "????? ???????????????", +UnknownToolbarSet : "??????? ????????? \"%1\" ???? ?????", +NoActiveX : "??????? ?????? ?????? ??? ???? ??? ?? ???? ?? ???????? ?????? ??????? ????? ???. ??? ???? ?????? \"Run ActiveX controls and plug-ins\" ?? ???? ????. ???? ??? ??? ?? ??????? ????? ????? ? ????? ????? ????????? ????.", +BrowseServerBlocked : "??????? ???????? ?????? ????? ????? ????. ??????? ???? ???? ?? ????? ?????????? ??????? ?? ????? popup ?? ?? ??? ????????????.", +DialogBlocked : "??????? ???????? ?????? ???? ?????? ????? ????. ??????? ???? ???? ?? ????? ?????????? ??????? ?? ????? popup ?? ?? ??? ????????????.", + +// Dialogs +DlgBtnOK : "?????", +DlgBtnCancel : "??????", +DlgBtnClose : "????", +DlgBtnBrowseServer : "??????????? ????", +DlgAdvancedTag : "???????", +DlgOpOther : "", +DlgInfoTab : "???????", +DlgAlertUrl : "????? URL ?? ???????", + +// General Dialogs Labels +DlgGenNotSet : "", +DlgGenId : "?????", +DlgGenLangDir : "???????? ????", +DlgGenLangDirLtr : "?? ?? ???? (LTR)", +DlgGenLangDirRtl : "???? ?? ?? (RTL)", +DlgGenLangCode : "?? ????", +DlgGenAccessKey : "???? ???????", +DlgGenName : "???", +DlgGenTabIndex : "?????? ?????? ?? Tab", +DlgGenLongDescr : "URL ????? ??????", +DlgGenClass : "??????? ?????????(Stylesheet)", +DlgGenTitle : "????? ????", +DlgGenContType : "??? ?????? ????", +DlgGenLinkCharset : "????????? ???? ?????????", +DlgGenStyle : "????(style)", + +// Image Dialog +DlgImgTitle : "???????? ?????", +DlgImgInfoTab : "??????? ?????", +DlgImgBtnUpload : "?? ???? ?????", +DlgImgURL : "URL", +DlgImgUpload : "?????? ?? ????", +DlgImgAlt : "??? ???????", +DlgImgWidth : "????", +DlgImgHeight : "?????", +DlgImgLockRatio : "???????? ?????", +DlgBtnResetSize : "???????? ??????", +DlgImgBorder : "???", +DlgImgHSpace : "?????? ????", +DlgImgVSpace : "?????? ?????", +DlgImgAlign : "????", +DlgImgAlignLeft : "??", +DlgImgAlignAbsBottom: "????? ????", +DlgImgAlignAbsMiddle: "??? ????", +DlgImgAlignBaseline : "???????", +DlgImgAlignBottom : "?????", +DlgImgAlignMiddle : "???", +DlgImgAlignRight : "????", +DlgImgAlignTextTop : "??? ????", +DlgImgAlignTop : "????", +DlgImgPreview : "?????????", +DlgImgAlertUrl : "???? URL ????? ?? ???????", +DlgImgLinkTab : "?????", + +// Flash Dialog +DlgFlashTitle : "???????? Flash", +DlgFlashChkPlay : "???? ???????", +DlgFlashChkLoop : "????? ?????", +DlgFlashChkMenu : "???????????? ???? Flash", +DlgFlashScale : "?????", +DlgFlashScaleAll : "????? ???", +DlgFlashScaleNoBorder : "???? ????", +DlgFlashScaleFit : "??????? ????", + +// Link Dialog +DlgLnkWindowTitle : "?????", +DlgLnkInfoTab : "??????? ?????", +DlgLnkTargetTab : "????", + +DlgLnkType : "??? ?????", +DlgLnkTypeURL : "URL", +DlgLnkTypeAnchor : "???? ?? ???? ????", +DlgLnkTypeEMail : "??? ??????????", +DlgLnkProto : "??????", +DlgLnkProtoOther : "", +DlgLnkURL : "URL", +DlgLnkAnchorSel : "?? ???? ????????", +DlgLnkAnchorByName : "?? ??? ????", +DlgLnkAnchorById : "?? ?????? ?????", +DlgLnkNoAnchors : "(?? ??? ??? ????? ??????? ????)", +DlgLnkEMail : "????? ??? ??????????", +DlgLnkEMailSubject : "????? ????", +DlgLnkEMailBody : "??? ????", +DlgLnkUpload : "?????? ?? ????", +DlgLnkBtnUpload : "?? ???? ?????", + +DlgLnkTarget : "????", +DlgLnkTargetFrame : "", +DlgLnkTargetPopup : "", +DlgLnkTargetBlank : "?????? ???? (_blank)", +DlgLnkTargetParent : "?????? ???? (_parent)", +DlgLnkTargetSelf : "???? ????? (_self)", +DlgLnkTargetTop : "???????? ????? (_top)", +DlgLnkTargetFrameName : "??? ???? ????", +DlgLnkPopWinName : "??? ?????? ?????", +DlgLnkPopWinFeat : "???????? ?????? ?????", +DlgLnkPopResize : "???? ????? ??????", +DlgLnkPopLocation : "???? ??????", +DlgLnkPopMenu : "???? ???", +DlgLnkPopScroll : "???????? ??????", +DlgLnkPopStatus : "???? ?????", +DlgLnkPopToolbar : "?????????", +DlgLnkPopFullScrn : "????????? (IE)", +DlgLnkPopDependent : "?????? (Netscape)", +DlgLnkPopWidth : "????", +DlgLnkPopHeight : "?????", +DlgLnkPopLeft : "?????? ???", +DlgLnkPopTop : "?????? ?????", + +DlnLnkMsgNoUrl : "???? URL ????? ?? ???????", +DlnLnkMsgNoEMail : "???? ????? ??? ?????????? ?? ???????", +DlnLnkMsgNoAnchor : "???? ????? ?? ????????", +DlnLnkMsgInvPopName : "??? ?????? ????? ???? ?? ?? ?????? ??????? ???? ???? ? ????? ????????? ???? ?? ?? ?????", + +// Color Dialog +DlgColorTitle : "????? ???", +DlgColorBtnClear : "????????", +DlgColorHighlight : "?????", +DlgColorSelected : "???????", + +// Smiley Dialog +DlgSmileyTitle : "??????? ??????", + +// Special Character Dialog +DlgSpecialCharTitle : "????? ???????????", + +// Table Dialog +DlgTableTitle : "???????? ????", +DlgTableRows : "?????", +DlgTableColumns : "??????", +DlgTableBorder : "??????? ???", +DlgTableAlign : "????", +DlgTableAlignNotSet : "", +DlgTableAlignLeft : "??", +DlgTableAlignCenter : "???", +DlgTableAlignRight : "????", +DlgTableWidth : "????", +DlgTableWidthPx : "?????", +DlgTableWidthPc : "????", +DlgTableHeight : "?????", +DlgTableCellSpace : "?????? ???? ??????", +DlgTableCellPad : "?????? ????? ?? ????", +DlgTableCaption : "?????", +DlgTableSummary : "?????", + +// Table Cell Dialog +DlgCellTitle : "???????? ????", +DlgCellWidth : "????", +DlgCellWidthPx : "?????", +DlgCellWidthPc : "????", +DlgCellHeight : "?????", +DlgCellWordWrap : "????? ???????", +DlgCellWordWrapNotSet : "", +DlgCellWordWrapYes : "???", +DlgCellWordWrapNo : "???", +DlgCellHorAlign : "???? ?????", +DlgCellHorAlignNotSet : "", +DlgCellHorAlignLeft : "??", +DlgCellHorAlignCenter : "???", +DlgCellHorAlignRight: "????", +DlgCellVerAlign : "???? ??????", +DlgCellVerAlignNotSet : "", +DlgCellVerAlignTop : "????", +DlgCellVerAlignMiddle : "????", +DlgCellVerAlignBottom : "?????", +DlgCellVerAlignBaseline : "???????", +DlgCellRowSpan : "??????? ?????", +DlgCellCollSpan : "??????? ??????", +DlgCellBackColor : "??? ????????", +DlgCellBorderColor : "??? ???", +DlgCellBtnSelect : "????????...", + +// Find and Replace Dialog +DlgFindAndReplaceTitle : "Find and Replace", //MISSING + +// Find Dialog +DlgFindTitle : "?????", +DlgFindFindBtn : "?????", +DlgFindNotFoundMsg : "??? ??????? ???? ???.", + +// Replace Dialog +DlgReplaceTitle : "????????", +DlgReplaceFindLbl : "?????? ?? ????????:", +DlgReplaceReplaceLbl : "???????? ??:", +DlgReplaceCaseChk : "?????? ?? ????? ? ????? ????????", +DlgReplaceReplaceBtn : "????????", +DlgReplaceReplAllBtn : "???????? ???? ????????", +DlgReplaceWordChk : "?????? ?? ????? ????", + +// Paste Operations / Dialog +PasteErrorCut : "??????? ?????? ?????? ??? ????? ??????? ?? ???????? ?? ??? ?????? ????????? ??? ?? ????? ???. ???? ?? ???????? ????????? ??? ??? ?? ????? ???? (Ctrl+X).", +PasteErrorCopy : "??????? ?????? ?????? ??? ????? ??????? ?? ???????? ?? ??? ?????? ????????? ???????? ?? ????? ???. ???? ?? ???????? ????????? ??? ??? ?? ????? ???? (Ctrl+C).", + +PasteAsText : "??????? ?? ????? ??? ?????", +PasteFromWord : "??????? ?? Word", + +DlgPasteMsg2 : "???? ??? ?? ?? ??????? (Ctrl+V) ?? ??? ????? ???? ???????? ? ????? ?? ?????.", +DlgPasteSec : "?? ???? ??????? ?????? ?????? ???? ???????? ????????? ?????? ?????? ?? ???????? clipboard ????? ????. ??? ???? ?????? ???? ?? ??? ????? ????????.", +DlgPasteIgnoreFont : "???????? ?? ?????? ??? ???", +DlgPasteRemoveStyles : "???????? ?? ?????? ??? (style)", + +// Color Picker +ColorAutomatic : "??????", +ColorMoreColors : "?????? ?????...", + +// Document Properties +DocProps : "???????? ???", + +// Anchor Dialog +DlgAnchorTitle : "???????? ????", +DlgAnchorName : "??? ????", +DlgAnchorErrorName : "???? ??? ???? ?? ???????", + +// Speller Pages Dialog +DlgSpellNotInDic : "?? ????????? ???? ???", +DlgSpellChangeTo : "????? ??", +DlgSpellBtnIgnore : "????????", +DlgSpellBtnIgnoreAll : "???????? ???", +DlgSpellBtnReplace : "????????", +DlgSpellBtnReplaceAll : "???????? ???", +DlgSpellBtnUndo : "??????", +DlgSpellNoSuggestions : "- ???????? ???? -", +DlgSpellProgress : "????? ???? ?? ??? ?????...", +DlgSpellNoMispell : "????? ???? ????? ??. ??? ?????????? ???? ???", +DlgSpellNoChanges : "????? ???? ????? ??. ??? ??????? ????? ?????", +DlgSpellOneChange : "????? ???? ????? ??. ?? ???? ????? ????", +DlgSpellManyChanges : "????? ???? ????? ??. %1 ???? ????? ????", + +IeSpellDownload : "???????????? ???? ??? ???? ???. ??? ????????? ?? ?? ???????? ?????? ?????", + +// Button Dialog +DlgButtonText : "??? (?????)", +DlgButtonType : "???", +DlgButtonTypeBtn : "????", +DlgButtonTypeSbm : "Submit", +DlgButtonTypeRst : "???????? (Reset)", + +// Checkbox and Radio Button Dialogs +DlgCheckboxName : "???", +DlgCheckboxValue : "?????", +DlgCheckboxSelected : "???????", + +// Form Dialog +DlgFormName : "???", +DlgFormAction : "??????", +DlgFormMethod : "???", + +// Select Field Dialog +DlgSelectName : "???", +DlgSelectValue : "?????", +DlgSelectSize : "??????", +DlgSelectLines : "????", +DlgSelectChkMulti : "????? ??????? ????? ????", +DlgSelectOpAvail : "????????? ???????", +DlgSelectOpText : "???", +DlgSelectOpValue : "?????", +DlgSelectBtnAdd : "??????", +DlgSelectBtnModify : "??????", +DlgSelectBtnUp : "????", +DlgSelectBtnDown : "?????", +DlgSelectBtnSetValue : "????? ?? ????? ????? ????????", +DlgSelectBtnDelete : "????????", + +// Textarea Dialog +DlgTextareaName : "???", +DlgTextareaCols : "??????", +DlgTextareaRows : "?????", + +// Text Field Dialog +DlgTextName : "???", +DlgTextValue : "?????", +DlgTextCharWidth : "????? ?????", +DlgTextMaxChars : "??????? ????????", +DlgTextType : "???", +DlgTextTypeText : "???", +DlgTextTypePass : "???????", + +// Hidden Field Dialog +DlgHiddenName : "???", +DlgHiddenValue : "?????", + +// Bulleted List Dialog +BulletedListProp : "???????? ????? ???????", +NumberedListProp : "???????? ????? ?????????", +DlgLstStart : "????", +DlgLstType : "???", +DlgLstTypeCircle : "?????", +DlgLstTypeDisc : "???", +DlgLstTypeSquare : "???????", +DlgLstTypeNumbers : "???????? (1? 2? 3)", +DlgLstTypeLCase : "????????? ???? (a? b? c)", +DlgLstTypeUCase : "????????? ???? (A? B? C)", +DlgLstTypeSRoman : "??????? ???? ???? (i? ii? iii)", +DlgLstTypeLRoman : "??????? ???? ???? (I? II? III)", + +// Document Properties Dialog +DlgDocGeneralTab : "?????", +DlgDocBackTab : "????????", +DlgDocColorsTab : "????? ? ????????", +DlgDocMetaTab : "???????", + +DlgDocPageTitle : "????? ????", +DlgDocLangDir : "??? ????", +DlgDocLangDirLTR : "?? ?? ???? (LTR(", +DlgDocLangDirRTL : "???? ?? ?? (RTL(", +DlgDocLangCode : "?? ????", +DlgDocCharSet : "???????? ?????????", +DlgDocCharSetCE : "?????? ?????", +DlgDocCharSetCT : "???? ???? (Big5)", +DlgDocCharSetCR : "???????", +DlgDocCharSetGR : "??????", +DlgDocCharSetJP : "?????", +DlgDocCharSetKR : "??????", +DlgDocCharSetTR : "????", +DlgDocCharSetUN : "??????? (UTF-8)", +DlgDocCharSetWE : "?????? ????", +DlgDocCharSetOther : "???????? ????????? ????", + +DlgDocDocType : "????? ??? ???", +DlgDocDocTypeOther : "????? ??? ??? ????", +DlgDocIncXHTML : "???? ?????? XHTML", +DlgDocBgColor : "??? ????????", +DlgDocBgImage : "URL ????? ????????", +DlgDocBgNoScroll : "????????? ?????????????", +DlgDocCText : "???", +DlgDocCLink : "?????", +DlgDocCVisited : "????? ??????????", +DlgDocCActive : "????? ????", +DlgDocMargins : "????????? ????", +DlgDocMaTop : "????", +DlgDocMaLeft : "??", +DlgDocMaRight : "????", +DlgDocMaBottom : "?????", +DlgDocMeIndex : "?????????? ??????????? ??? (?? ???? ??? ????)", +DlgDocMeDescr : "????? ???", +DlgDocMeAuthor : "???????", +DlgDocMeCopy : "????????", +DlgDocPreview : "?????????", + +// Templates Dialog +Templates : "??????", +DlgTemplatesTitle : "??????? ???????", +DlgTemplatesSelMsg : "???? ????? ??????? ?? ???? ??????? ?? ???????? ????????
        (??????? ????? ?? ??? ?????? ???):", +DlgTemplatesLoading : "???????? ????? ??????. ???? ??? ????...", +DlgTemplatesNoTpl : "(?????? ????? ???? ???)", +DlgTemplatesReplace : "??????? ????? ??????? ????", + +// About Dialog +DlgAboutAboutTab : "??????", +DlgAboutBrowserInfoTab : "??????? ??????", +DlgAboutLicenseTab : "?????????", +DlgAboutVersion : "?????", +DlgAboutInfo : "???? ????? ????? ?? ??? ????? ?????" +}; Property changes on: announcement/trunk/src/main/webapp/fckeditor/editor/lang/fa.js ___________________________________________________________________ Name: svn:eol-style + native Added: announcement/trunk/src/main/webapp/fckeditor/editor/lang/fi.js =================================================================== --- announcement/trunk/src/main/webapp/fckeditor/editor/lang/fi.js (rev 0) +++ announcement/trunk/src/main/webapp/fckeditor/editor/lang/fi.js 2008-06-30 02:54:27 UTC (rev 1002) @@ -0,0 +1,515 @@ +?/* + * FCKeditor - The text editor for Internet - http://www.fckeditor.net + * Copyright (C) 2003-2008 Frederico Caldeira Knabben + * + * == BEGIN LICENSE == + * + * Licensed under the terms of any of the following licenses at your + * choice: + * + * - GNU General Public License Version 2 or later (the "GPL") + * http://www.gnu.org/licenses/gpl.html + * + * - GNU Lesser General Public License Version 2.1 or later (the "LGPL") + * http://www.gnu.org/licenses/lgpl.html + * + * - Mozilla Public License Version 1.1 or later (the "MPL") + * http://www.mozilla.org/MPL/MPL-1.1.html + * + * == END LICENSE == + * + * Finnish language file. + */ + +var FCKLang = +{ +// Language direction : "ltr" (left to right) or "rtl" (right to left). +Dir : "ltr", + +ToolbarCollapse : "Piilota työkalurivi", +ToolbarExpand : "Näytä työkalurivi", + +// Toolbar Items and Context Menu +Save : "Tallenna", +NewPage : "Tyhjennä", +Preview : "Esikatsele", +Cut : "Leikkaa", +Copy : "Kopioi", +Paste : "Liitä", +PasteText : "Liitä tekstinä", +PasteWord : "Liitä Wordista", +Print : "Tulosta", +SelectAll : "Valitse kaikki", +RemoveFormat : "Poista muotoilu", +InsertLinkLbl : "Linkki", +InsertLink : "Lisää linkki/muokkaa linkkiä", +RemoveLink : "Poista linkki", +Anchor : "Lisää ankkuri/muokkaa ankkuria", +AnchorDelete : "Poista ankkuri", +InsertImageLbl : "Kuva", +InsertImage : "Lisää kuva/muokkaa kuvaa", +InsertFlashLbl : "Flash", +InsertFlash : "Lisää/muokkaa Flashia", +InsertTableLbl : "Taulu", +InsertTable : "Lisää taulu/muokkaa taulua", +InsertLineLbl : "Murtoviiva", +InsertLine : "Lisää murtoviiva", +InsertSpecialCharLbl: "Erikoismerkki", +InsertSpecialChar : "Lisää erikoismerkki", +InsertSmileyLbl : "Hymiö", +InsertSmiley : "Lisää hymiö", +About : "FCKeditorista", +Bold : "Lihavoitu", +Italic : "Kursivoitu", +Underline : "Alleviivattu", +StrikeThrough : "Yliviivattu", +Subscript : "Alaindeksi", +Superscript : "Yläindeksi", +LeftJustify : "Tasaa vasemmat reunat", +CenterJustify : "Keskitä", +RightJustify : "Tasaa oikeat reunat", +BlockJustify : "Tasaa molemmat reunat", +DecreaseIndent : "Pienennä sisennystä", +IncreaseIndent : "Suurenna sisennystä", +Blockquote : "Lainaus", +Undo : "Kumoa", +Redo : "Toista", +NumberedListLbl : "Numerointi", +NumberedList : "Lisää/poista numerointi", +BulletedListLbl : "Luottelomerkit", +BulletedList : "Lisää/poista luottelomerkit", +ShowTableBorders : "Näytä taulun rajat", +ShowDetails : "Näytä muotoilu", +Style : "Tyyli", +FontFormat : "Muotoilu", +Font : "Fontti", +FontSize : "Koko", +TextColor : "Tekstiväri", +BGColor : "Taustaväri", +Source : "Koodi", +Find : "Etsi", +Replace : "Korvaa", +SpellCheck : "Tarkista oikeinkirjoitus", +UniversalKeyboard : "Universaali näppäimistö", +PageBreakLbl : "Sivun vaihto", +PageBreak : "Lisää sivun vaihto", + +Form : "Lomake", +Checkbox : "Valintaruutu", +RadioButton : "Radiopainike", +TextField : "Tekstikenttä", +Textarea : "Tekstilaatikko", +HiddenField : "Piilokenttä", +Button : "Painike", +SelectionField : "Valintakenttä", +ImageButton : "Kuvapainike", + +FitWindow : "Suurenna editori koko ikkunaan", +ShowBlocks : "Näytä elementit", + +// Context Menu +EditLink : "Muokkaa linkkiä", +CellCM : "Solu", +RowCM : "Rivi", +ColumnCM : "Sarake", +InsertRowAfter : "Lisää rivi alapuolelle", +InsertRowBefore : "Lisää rivi yläpuolelle", +DeleteRows : "Poista rivit", +InsertColumnAfter : "Lisää sarake oikealle", +InsertColumnBefore : "Lisää sarake vasemmalle", +DeleteColumns : "Poista sarakkeet", +InsertCellAfter : "Lisää solu perään", +InsertCellBefore : "Lisää solu eteen", +DeleteCells : "Poista solut", +MergeCells : "Yhdistä solut", +MergeRight : "Yhdistä oikealla olevan kanssa", +MergeDown : "Yhdistä alla olevan kanssa", +HorizontalSplitCell : "Jaa solu vaakasuunnassa", +VerticalSplitCell : "Jaa solu pystysuunnassa", +TableDelete : "Poista taulu", +CellProperties : "Solun ominaisuudet", +TableProperties : "Taulun ominaisuudet", +ImageProperties : "Kuvan ominaisuudet", +FlashProperties : "Flash ominaisuudet", + +AnchorProp : "Ankkurin ominaisuudet", +ButtonProp : "Painikkeen ominaisuudet", +CheckboxProp : "Valintaruudun ominaisuudet", +HiddenFieldProp : "Piilokentän ominaisuudet", +RadioButtonProp : "Radiopainikkeen ominaisuudet", +ImageButtonProp : "Kuvapainikkeen ominaisuudet", +TextFieldProp : "Tekstikentän ominaisuudet", +SelectionFieldProp : "Valintakentän ominaisuudet", +TextareaProp : "Tekstilaatikon ominaisuudet", +FormProp : "Lomakkeen ominaisuudet", + +FontFormats : "Normaali;Muotoiltu;Osoite;Otsikko 1;Otsikko 2;Otsikko 3;Otsikko 4;Otsikko 5;Otsikko 6", + +// Alerts and Messages +ProcessingXHTML : "Prosessoidaan XHTML:ää. Odota hetki...", +Done : "Valmis", +PasteWordConfirm : "Teksti, jonka haluat liittää, näyttää olevan kopioitu Wordista. Haluatko puhdistaa sen ennen liittämistä?", +NotCompatiblePaste : "Tämä komento toimii vain Internet Explorer 5.5:ssa tai uudemmassa. Haluatko liittää ilman puhdistusta?", +UnknownToolbarItem : "Tuntemanton työkalu \"%1\"", +UnknownCommand : "Tuntematon komento \"%1\"", +NotImplemented : "Komentoa ei ole liitetty sovellukseen", +UnknownToolbarSet : "Työkalukokonaisuus \"%1\" ei ole olemassa", +NoActiveX : "Selaimesi turvallisuusasetukset voivat rajoittaa joitain editorin ominaisuuksia. Sinun pitää ottaa käyttöön asetuksista \"Suorita ActiveX komponentit ja -plugin-laajennukset\". Saatat kohdata virheitä ja huomata puuttuvia ominaisuuksia.", +BrowseServerBlocked : "Resurssiselainta ei voitu avata. Varmista, että ponnahdusikkunoiden estäjät eivät ole päällä.", +DialogBlocked : "Apuikkunaa ei voitu avaata. Varmista, että ponnahdusikkunoiden estäjät eivät ole päällä.", + +// Dialogs +DlgBtnOK : "OK", +DlgBtnCancel : "Peruuta", +DlgBtnClose : "Sulje", +DlgBtnBrowseServer : "Selaa palvelinta", +DlgAdvancedTag : "Lisäominaisuudet", +DlgOpOther : "Muut", +DlgInfoTab : "Info", +DlgAlertUrl : "Lisää URL", + +// General Dialogs Labels +DlgGenNotSet : "", +DlgGenId : "Tunniste", +DlgGenLangDir : "Kielen suunta", +DlgGenLangDirLtr : "Vasemmalta oikealle (LTR)", +DlgGenLangDirRtl : "Oikealta vasemmalle (RTL)", +DlgGenLangCode : "Kielikoodi", +DlgGenAccessKey : "Pikanäppäin", +DlgGenName : "Nimi", +DlgGenTabIndex : "Tabulaattori indeksi", +DlgGenLongDescr : "Pitkän kuvauksen URL", +DlgGenClass : "Tyyliluokat", +DlgGenTitle : "Avustava otsikko", +DlgGenContType : "Avustava sisällön tyyppi", +DlgGenLinkCharset : "Linkitetty kirjaimisto", +DlgGenStyle : "Tyyli", + +// Image Dialog +DlgImgTitle : "Kuvan ominaisuudet", +DlgImgInfoTab : "Kuvan tiedot", +DlgImgBtnUpload : "Lähetä palvelimelle", +DlgImgURL : "Osoite", +DlgImgUpload : "Lisää kuva", +DlgImgAlt : "Vaihtoehtoinen teksti", +DlgImgWidth : "Leveys", +DlgImgHeight : "Korkeus", +DlgImgLockRatio : "Lukitse suhteet", +DlgBtnResetSize : "Alkuperäinen koko", +DlgImgBorder : "Raja", +DlgImgHSpace : "Vaakatila", +DlgImgVSpace : "Pystytila", +DlgImgAlign : "Kohdistus", +DlgImgAlignLeft : "Vasemmalle", +DlgImgAlignAbsBottom: "Aivan alas", +DlgImgAlignAbsMiddle: "Aivan keskelle", +DlgImgAlignBaseline : "Alas (teksti)", +DlgImgAlignBottom : "Alas", +DlgImgAlignMiddle : "Keskelle", +DlgImgAlignRight : "Oikealle", +DlgImgAlignTextTop : "Ylös (teksti)", +DlgImgAlignTop : "Ylös", +DlgImgPreview : "Esikatselu", +DlgImgAlertUrl : "Kirjoita kuvan osoite (URL)", +DlgImgLinkTab : "Linkki", + +// Flash Dialog +DlgFlashTitle : "Flash ominaisuudet", +DlgFlashChkPlay : "Automaattinen käynnistys", +DlgFlashChkLoop : "Toisto", +DlgFlashChkMenu : "Näytä Flash-valikko", +DlgFlashScale : "Levitä", +DlgFlashScaleAll : "Näytä kaikki", +DlgFlashScaleNoBorder : "Ei rajaa", +DlgFlashScaleFit : "Tarkka koko", + +// Link Dialog +DlgLnkWindowTitle : "Linkki", +DlgLnkInfoTab : "Linkin tiedot", +DlgLnkTargetTab : "Kohde", + +DlgLnkType : "Linkkityyppi", +DlgLnkTypeURL : "Osoite", +DlgLnkTypeAnchor : "Ankkuri tässä sivussa", +DlgLnkTypeEMail : "Sähköposti", +DlgLnkProto : "Protokolla", +DlgLnkProtoOther : "", +DlgLnkURL : "Osoite", +DlgLnkAnchorSel : "Valitse ankkuri", +DlgLnkAnchorByName : "Ankkurin nimen mukaan", +DlgLnkAnchorById : "Ankkurin ID:n mukaan", +DlgLnkNoAnchors : "(Ei ankkureita tässä dokumentissa)", +DlgLnkEMail : "Sähköpostiosoite", +DlgLnkEMailSubject : "Aihe", +DlgLnkEMailBody : "Viesti", +DlgLnkUpload : "Lisää tiedosto", +DlgLnkBtnUpload : "Lähetä palvelimelle", + +DlgLnkTarget : "Kohde", +DlgLnkTargetFrame : "", +DlgLnkTargetPopup : "", +DlgLnkTargetBlank : "Uusi ikkuna (_blank)", +DlgLnkTargetParent : "Emoikkuna (_parent)", +DlgLnkTargetSelf : "Sama ikkuna (_self)", +DlgLnkTargetTop : "Päällimmäisin ikkuna (_top)", +DlgLnkTargetFrameName : "Kohdekehyksen nimi", +DlgLnkPopWinName : "Popup ikkunan nimi", +DlgLnkPopWinFeat : "Popup ikkunan ominaisuudet", +DlgLnkPopResize : "Venytettävä", +DlgLnkPopLocation : "Osoiterivi", +DlgLnkPopMenu : "Valikkorivi", +DlgLnkPopScroll : "Vierityspalkit", +DlgLnkPopStatus : "Tilarivi", +DlgLnkPopToolbar : "Vakiopainikkeet", +DlgLnkPopFullScrn : "Täysi ikkuna (IE)", +DlgLnkPopDependent : "Riippuva (Netscape)", +DlgLnkPopWidth : "Leveys", +DlgLnkPopHeight : "Korkeus", +DlgLnkPopLeft : "Vasemmalta (px)", +DlgLnkPopTop : "Ylhäältä (px)", + +DlnLnkMsgNoUrl : "Linkille on kirjoitettava URL", +DlnLnkMsgNoEMail : "Kirjoita sähköpostiosoite", +DlnLnkMsgNoAnchor : "Valitse ankkuri", +DlnLnkMsgInvPopName : "Popup-ikkunan nimi pitää alkaa aakkosella ja ei saa sisältää välejä", + +// Color Dialog +DlgColorTitle : "Valitse väri", +DlgColorBtnClear : "Tyhjennä", +DlgColorHighlight : "Kohdalla", +DlgColorSelected : "Valittu", + +// Smiley Dialog +DlgSmileyTitle : "Lisää hymiö", + +// Special Character Dialog +DlgSpecialCharTitle : "Valitse erikoismerkki", + +// Table Dialog +DlgTableTitle : "Taulun ominaisuudet", +DlgTableRows : "Rivit", +DlgTableColumns : "Sarakkeet", +DlgTableBorder : "Rajan paksuus", +DlgTableAlign : "Kohdistus", +DlgTableAlignNotSet : "", +DlgTableAlignLeft : "Vasemmalle", +DlgTableAlignCenter : "Keskelle", +DlgTableAlignRight : "Oikealle", +DlgTableWidth : "Leveys", +DlgTableWidthPx : "pikseliä", +DlgTableWidthPc : "prosenttia", +DlgTableHeight : "Korkeus", +DlgTableCellSpace : "Solujen väli", +DlgTableCellPad : "Solujen sisennys", +DlgTableCaption : "Otsikko", +DlgTableSummary : "Yhteenveto", + +// Table Cell Dialog +DlgCellTitle : "Solun ominaisuudet", +DlgCellWidth : "Leveys", +DlgCellWidthPx : "pikseliä", +DlgCellWidthPc : "prosenttia", +DlgCellHeight : "Korkeus", +DlgCellWordWrap : "Tekstikierrätys", +DlgCellWordWrapNotSet : "", +DlgCellWordWrapYes : "Kyllä", +DlgCellWordWrapNo : "Ei", +DlgCellHorAlign : "Vaakakohdistus", +DlgCellHorAlignNotSet : "", +DlgCellHorAlignLeft : "Vasemmalle", +DlgCellHorAlignCenter : "Keskelle", +DlgCellHorAlignRight: "Oikealle", +DlgCellVerAlign : "Pystykohdistus", +DlgCellVerAlignNotSet : "", +DlgCellVerAlignTop : "Ylös", +DlgCellVerAlignMiddle : "Keskelle", +DlgCellVerAlignBottom : "Alas", +DlgCellVerAlignBaseline : "Tekstin alas", +DlgCellRowSpan : "Rivin jatkuvuus", +DlgCellCollSpan : "Sarakkeen jatkuvuus", +DlgCellBackColor : "Taustaväri", +DlgCellBorderColor : "Rajan väri", +DlgCellBtnSelect : "Valitse...", + +// Find and Replace Dialog +DlgFindAndReplaceTitle : "Etsi ja korvaa", + +// Find Dialog +DlgFindTitle : "Etsi", +DlgFindFindBtn : "Etsi", +DlgFindNotFoundMsg : "Etsittyä tekstiä ei löytynyt.", + +// Replace Dialog +DlgReplaceTitle : "Korvaa", +DlgReplaceFindLbl : "Etsi mitä:", +DlgReplaceReplaceLbl : "Korvaa tällä:", +DlgReplaceCaseChk : "Sama kirjainkoko", +DlgReplaceReplaceBtn : "Korvaa", +DlgReplaceReplAllBtn : "Korvaa kaikki", +DlgReplaceWordChk : "Koko sana", + +// Paste Operations / Dialog +PasteErrorCut : "Selaimesi turva-asetukset eivät salli editorin toteuttaa leikkaamista. Käytä näppäimistöä leikkaamiseen (Ctrl+X).", +PasteErrorCopy : "Selaimesi turva-asetukset eivät salli editorin toteuttaa kopioimista. Käytä näppäimistöä kopioimiseen (Ctrl+C).", + +PasteAsText : "Liitä tekstinä", +PasteFromWord : "Liitä Wordista", + +DlgPasteMsg2 : "Liitä painamalla (Ctrl+V) ja painamalla OK.", +DlgPasteSec : "Selaimesi turva-asetukset eivät salli editorin käyttää leikepöytää suoraan. Sinun pitää suorittaa liittäminen tässä ikkunassa.", +DlgPasteIgnoreFont : "Jätä huomioimatta fonttimääritykset", +DlgPasteRemoveStyles : "Poista tyylimääritykset", + +// Color Picker +ColorAutomatic : "Automaattinen", +ColorMoreColors : "Lisää värejä...", + +// Document Properties +DocProps : "Dokumentin ominaisuudet", + +// Anchor Dialog +DlgAnchorTitle : "Ankkurin ominaisuudet", +DlgAnchorName : "Nimi", +DlgAnchorErrorName : "Ankkurille on kirjoitettava nimi", + +// Speller Pages Dialog +DlgSpellNotInDic : "Ei sanakirjassa", +DlgSpellChangeTo : "Vaihda", +DlgSpellBtnIgnore : "Jätä huomioimatta", +DlgSpellBtnIgnoreAll : "Jätä kaikki huomioimatta", +DlgSpellBtnReplace : "Korvaa", +DlgSpellBtnReplaceAll : "Korvaa kaikki", +DlgSpellBtnUndo : "Kumoa", +DlgSpellNoSuggestions : "Ei ehdotuksia", +DlgSpellProgress : "Tarkistus käynnissä...", +DlgSpellNoMispell : "Tarkistus valmis: Ei virheitä", +DlgSpellNoChanges : "Tarkistus valmis: Yhtään sanaa ei muutettu", +DlgSpellOneChange : "Tarkistus valmis: Yksi sana muutettiin", +DlgSpellManyChanges : "Tarkistus valmis: %1 sanaa muutettiin", + +IeSpellDownload : "Oikeinkirjoituksen tarkistusta ei ole asennettu. Haluatko ladata sen nyt?", + +// Button Dialog +DlgButtonText : "Teksti (arvo)", +DlgButtonType : "Tyyppi", +DlgButtonTypeBtn : "Painike", +DlgButtonTypeSbm : "Lähetä", +DlgButtonTypeRst : "Tyhjennä", + +// Checkbox and Radio Button Dialogs +DlgCheckboxName : "Nimi", +DlgCheckboxValue : "Arvo", +DlgCheckboxSelected : "Valittu", + +// Form Dialog +DlgFormName : "Nimi", +DlgFormAction : "Toiminto", +DlgFormMethod : "Tapa", + +// Select Field Dialog +DlgSelectName : "Nimi", +DlgSelectValue : "Arvo", +DlgSelectSize : "Koko", +DlgSelectLines : "Rivit", +DlgSelectChkMulti : "Salli usea valinta", +DlgSelectOpAvail : "Ominaisuudet", +DlgSelectOpText : "Teksti", +DlgSelectOpValue : "Arvo", +DlgSelectBtnAdd : "Lisää", +DlgSelectBtnModify : "Muuta", +DlgSelectBtnUp : "Ylös", +DlgSelectBtnDown : "Alas", +DlgSelectBtnSetValue : "Aseta valituksi", +DlgSelectBtnDelete : "Poista", + +// Textarea Dialog +DlgTextareaName : "Nimi", +DlgTextareaCols : "Sarakkeita", +DlgTextareaRows : "Rivejä", + +// Text Field Dialog +DlgTextName : "Nimi", +DlgTextValue : "Arvo", +DlgTextCharWidth : "Leveys", +DlgTextMaxChars : "Maksimi merkkimäärä", +DlgTextType : "Tyyppi", +DlgTextTypeText : "Teksti", +DlgTextTypePass : "Salasana", + +// Hidden Field Dialog +DlgHiddenName : "Nimi", +DlgHiddenValue : "Arvo", + +// Bulleted List Dialog +BulletedListProp : "Luettelon ominaisuudet", +NumberedListProp : "Numeroinnin ominaisuudet", +DlgLstStart : "Alku", +DlgLstType : "Tyyppi", +DlgLstTypeCircle : "Kehä", +DlgLstTypeDisc : "Ympyrä", +DlgLstTypeSquare : "Neliö", +DlgLstTypeNumbers : "Numerot (1, 2, 3)", +DlgLstTypeLCase : "Pienet kirjaimet (a, b, c)", +DlgLstTypeUCase : "Isot kirjaimet (A, B, C)", +DlgLstTypeSRoman : "Pienet roomalaiset numerot (i, ii, iii)", +DlgLstTypeLRoman : "Isot roomalaiset numerot (Ii, II, III)", + +// Document Properties Dialog +DlgDocGeneralTab : "Yleiset", +DlgDocBackTab : "Tausta", +DlgDocColorsTab : "Värit ja marginaalit", +DlgDocMetaTab : "Meta-tieto", + +DlgDocPageTitle : "Sivun nimi", +DlgDocLangDir : "Kielen suunta", +DlgDocLangDirLTR : "Vasemmalta oikealle (LTR)", +DlgDocLangDirRTL : "Oikealta vasemmalle (RTL)", +DlgDocLangCode : "Kielikoodi", +DlgDocCharSet : "Merkistökoodaus", +DlgDocCharSetCE : "Keskieurooppalainen", +DlgDocCharSetCT : "Kiina, perinteinen (Big5)", +DlgDocCharSetCR : "Kyrillinen", +DlgDocCharSetGR : "Kreikka", +DlgDocCharSetJP : "Japani", +DlgDocCharSetKR : "Korealainen", +DlgDocCharSetTR : "Turkkilainen", +DlgDocCharSetUN : "Unicode (UTF-8)", +DlgDocCharSetWE : "Länsieurooppalainen", +DlgDocCharSetOther : "Muu merkistökoodaus", + +DlgDocDocType : "Dokumentin tyyppi", +DlgDocDocTypeOther : "Muu dokumentin tyyppi", +DlgDocIncXHTML : "Lisää XHTML julistukset", +DlgDocBgColor : "Taustaväri", +DlgDocBgImage : "Taustakuva", +DlgDocBgNoScroll : "Paikallaanpysyvä tausta", +DlgDocCText : "Teksti", +DlgDocCLink : "Linkki", +DlgDocCVisited : "Vierailtu linkki", +DlgDocCActive : "Aktiivinen linkki", +DlgDocMargins : "Sivun marginaalit", +DlgDocMaTop : "Ylä", +DlgDocMaLeft : "Vasen", +DlgDocMaRight : "Oikea", +DlgDocMaBottom : "Ala", +DlgDocMeIndex : "Hakusanat (pilkulla erotettuna)", +DlgDocMeDescr : "Kuvaus", +DlgDocMeAuthor : "Tekijä", +DlgDocMeCopy : "Tekijänoikeudet", +DlgDocPreview : "Esikatselu", + +// Templates Dialog +Templates : "Pohjat", +DlgTemplatesTitle : "Sisältöpohjat", +DlgTemplatesSelMsg : "Valitse pohja editoriin
        (aiempi sisältö menetetään):", +DlgTemplatesLoading : "Ladataan listaa pohjista. Hetkinen...", +DlgTemplatesNoTpl : "(Ei määriteltyjä pohjia)", +DlgTemplatesReplace : "Korvaa editorin koko sisältö", + +// About Dialog +DlgAboutAboutTab : "Editorista", +DlgAboutBrowserInfoTab : "Selaimen tiedot", +DlgAboutLicenseTab : "Lisenssi", +DlgAboutVersion : "versio", +DlgAboutInfo : "Lisää tietoa osoitteesta" +}; Property changes on: announcement/trunk/src/main/webapp/fckeditor/editor/lang/fi.js ___________________________________________________________________ Name: svn:eol-style + native Added: announcement/trunk/src/main/webapp/fckeditor/editor/lang/fo.js =================================================================== --- announcement/trunk/src/main/webapp/fckeditor/editor/lang/fo.js (rev 0) +++ announcement/trunk/src/main/webapp/fckeditor/editor/lang/fo.js 2008-06-30 02:54:27 UTC (rev 1002) @@ -0,0 +1,515 @@ +?/* + * FCKeditor - The text editor for Internet - http://www.fckeditor.net + * Copyright (C) 2003-2008 Frederico Caldeira Knabben + * + * == BEGIN LICENSE == + * + * Licensed under the terms of any of the following licenses at your + * choice: + * + * - GNU General Public License Version 2 or later (the "GPL") + * http://www.gnu.org/licenses/gpl.html + * + * - GNU Lesser General Public License Version 2.1 or later (the "LGPL") + * http://www.gnu.org/licenses/lgpl.html + * + * - Mozilla Public License Version 1.1 or later (the "MPL") + * http://www.mozilla.org/MPL/MPL-1.1.html + * + * == END LICENSE == + * + * Faroese language file. + */ + +var FCKLang = +{ +// Language direction : "ltr" (left to right) or "rtl" (right to left). +Dir : "ltr", + +ToolbarCollapse : "Fjal amboðsbjálkan", +ToolbarExpand : "Vís amboðsbjálkan", + +// Toolbar Items and Context Menu +Save : "Goym", +NewPage : "Nýggj síða", +Preview : "Frumsýning", +Cut : "Kvett", +Copy : "Avrita", +Paste : "Innrita", +PasteText : "Innrita reinan tekst", +PasteWord : "Innrita frá Word", +Print : "Prenta", +SelectAll : "Markera alt", +RemoveFormat : "Strika sniðgeving", +InsertLinkLbl : "Tilknýti", +InsertLink : "Ger/broyt tilknýti", +RemoveLink : "Strika tilknýti", +Anchor : "Ger/broyt marknastein", +AnchorDelete : "Remove Anchor", //MISSING +InsertImageLbl : "Myndir", +InsertImage : "Set inn/broyt mynd", +InsertFlashLbl : "Flash", +InsertFlash : "Set inn/broyt Flash", +InsertTableLbl : "Tabell", +InsertTable : "Set inn/broyt tabell", +InsertLineLbl : "Linja", +InsertLine : "Ger vatnrætta linju", +InsertSpecialCharLbl: "Sertekn", +InsertSpecialChar : "Set inn sertekn", +InsertSmileyLbl : "Smiley", +InsertSmiley : "Set inn Smiley", +About : "Um FCKeditor", +Bold : "Feit skrift", +Italic : "Skráskrift", +Underline : "Undirstrikað", +StrikeThrough : "Yvirstrikað", +Subscript : "Lækkað skrift", +Superscript : "Hækkað skrift", +LeftJustify : "Vinstrasett", +CenterJustify : "Miðsett", +RightJustify : "Høgrasett", +BlockJustify : "Javnir tekstkantar", +DecreaseIndent : "Minka reglubrotarinntriv", +IncreaseIndent : "Økja reglubrotarinntriv", +Blockquote : "Blockquote", //MISSING +Undo : "Angra", +Redo : "Vend aftur", +NumberedListLbl : "Talmerktur listi", +NumberedList : "Ger/strika talmerktan lista", +BulletedListLbl : "Punktmerktur listi", +BulletedList : "Ger/strika punktmerktan lista", +ShowTableBorders : "Vís tabellbordar", +ShowDetails : "Vís í smálutum", +Style : "Typografi", +FontFormat : "Skriftsnið", +Font : "Skrift", +FontSize : "Skriftstødd", +TextColor : "Tekstlitur", +BGColor : "Bakgrundslitur", +Source : "Kelda", +Find : "Leita", +Replace : "Yvirskriva", +SpellCheck : "Kanna stavseting", +UniversalKeyboard : "Knappaborð", +PageBreakLbl : "Síðuskift", +PageBreak : "Ger síðuskift", + +Form : "Formur", +Checkbox : "Flugubein", +RadioButton : "Radioknøttur", +TextField : "Tekstteigur", +Textarea : "Tekstumráði", +HiddenField : "Fjaldur teigur", +Button : "Knøttur", +SelectionField : "Valskrá", +ImageButton : "Myndaknøttur", + +FitWindow : "Set tekstviðgera til fulla stødd", +ShowBlocks : "Show Blocks", //MISSING + +// Context Menu +EditLink : "Broyt tilknýti", +CellCM : "Meski", +RowCM : "Rað", +ColumnCM : "Kolonna", +InsertRowAfter : "Insert Row After", //MISSING +InsertRowBefore : "Insert Row Before", //MISSING +DeleteRows : "Strika røðir", +InsertColumnAfter : "Insert Column After", //MISSING +InsertColumnBefore : "Insert Column Before", //MISSING +DeleteColumns : "Strika kolonnur", +InsertCellAfter : "Insert Cell After", //MISSING +InsertCellBefore : "Insert Cell Before", //MISSING +DeleteCells : "Strika meskar", +MergeCells : "Flætta meskar", +MergeRight : "Merge Right", //MISSING +MergeDown : "Merge Down", //MISSING +HorizontalSplitCell : "Split Cell Horizontally", //MISSING +VerticalSplitCell : "Split Cell Vertically", //MISSING +TableDelete : "Strika tabell", +CellProperties : "Meskueginleikar", +TableProperties : "Tabelleginleikar", +ImageProperties : "Myndaeginleikar", +FlashProperties : "Flash eginleikar", + +AnchorProp : "Eginleikar fyri marknastein", +ButtonProp : "Eginleikar fyri knøtt", +CheckboxProp : "Eginleikar fyri flugubein", +HiddenFieldProp : "Eginleikar fyri fjaldan teig", +RadioButtonProp : "Eginleikar fyri radioknøtt", +ImageButtonProp : "Eginleikar fyri myndaknøtt", +TextFieldProp : "Eginleikar fyri tekstteig", +SelectionFieldProp : "Eginleikar fyri valskrá", +TextareaProp : "Eginleikar fyri tekstumráði", +FormProp : "Eginleikar fyri Form", + +FontFormats : "Vanligt;Sniðgivið;Adressa;Yvirskrift 1;Yvirskrift 2;Yvirskrift 3;Yvirskrift 4;Yvirskrift 5;Yvirskrift 6", + +// Alerts and Messages +ProcessingXHTML : "XHTML verður viðgjørt. Bíða við...", +Done : "Liðugt", +PasteWordConfirm : "Teksturin, royndur verður at seta inn, tykist at stava frá Word. Vilt tú reinsa tekstin, áðrenn hann verður settur inn?", +NotCompatiblePaste : "Hetta er bert tøkt í Internet Explorer 5.5 og nýggjari. Vilt tú seta tekstin inn kortini - óreinsaðan?", +UnknownToolbarItem : "Ókendur lutur í amboðsbjálkanum \"%1\"", +UnknownCommand : "Ókend kommando \"%1\"", +NotImplemented : "Hetta er ikki tøkt í hesi útgávuni", +UnknownToolbarSet : "Amboðsbjálkin \"%1\" finst ikki", +NoActiveX : "Trygdaruppsetingin í alnótskaganum kann sum er avmarka onkrar hentleikar í tekstviðgeranum. Tú mást loyva møguleikanum \"Run/Kør ActiveX controls and plug-ins\". Tú kanst uppliva feilir og ávaringar um tvørrandi hentleikar.", +BrowseServerBlocked : "Ambætarakagin kundi ikki opnast. Tryggja tær, at allar pop-up forðingar eru óvirknar.", +DialogBlocked : "Tað eyðnaðist ikki at opna samskiftisrútin. Tryggja tær, at allar pop-up forðingar eru óvirknar.", + +// Dialogs +DlgBtnOK : "Góðkent", +DlgBtnCancel : "Avlýst", +DlgBtnClose : "Lat aftur", +DlgBtnBrowseServer : "Ambætarakagi", +DlgAdvancedTag : "Fjølbroytt", +DlgOpOther : "", +DlgInfoTab : "Upplýsingar", +DlgAlertUrl : "Vinarliga veit ein URL", + +// General Dialogs Labels +DlgGenNotSet : "", +DlgGenId : "Id", +DlgGenLangDir : "Tekstkós", +DlgGenLangDirLtr : "Frá vinstru til høgru (LTR)", +DlgGenLangDirRtl : "Frá høgru til vinstru (RTL)", +DlgGenLangCode : "Málkoda", +DlgGenAccessKey : "Snarvegisknappur", +DlgGenName : "Navn", +DlgGenTabIndex : "Inntriv indeks", +DlgGenLongDescr : "Víðkað URL frágreiðing", +DlgGenClass : "Typografi klassar", +DlgGenTitle : "Vegleiðandi heiti", +DlgGenContType : "Vegleiðandi innihaldsslag", +DlgGenLinkCharset : "Atknýtt teknsett", +DlgGenStyle : "Typografi", + +// Image Dialog +DlgImgTitle : "Myndaeginleikar", +DlgImgInfoTab : "Myndaupplýsingar", +DlgImgBtnUpload : "Send til ambætaran", +DlgImgURL : "URL", +DlgImgUpload : "Send", +DlgImgAlt : "Alternativur tekstur", +DlgImgWidth : "Breidd", +DlgImgHeight : "Hædd", +DlgImgLockRatio : "Læs lutfallið", +DlgBtnResetSize : "Upprunastødd", +DlgImgBorder : "Bordi", +DlgImgHSpace : "Høgri breddi", +DlgImgVSpace : "Vinstri breddi", +DlgImgAlign : "Justering", +DlgImgAlignLeft : "Vinstra", +DlgImgAlignAbsBottom: "Abs botnur", +DlgImgAlignAbsMiddle: "Abs miðja", +DlgImgAlignBaseline : "Basislinja", +DlgImgAlignBottom : "Botnur", +DlgImgAlignMiddle : "Miðja", +DlgImgAlignRight : "Høgra", +DlgImgAlignTextTop : "Tekst toppur", +DlgImgAlignTop : "Ovast", +DlgImgPreview : "Frumsýning", +DlgImgAlertUrl : "Rita slóðina til myndina", +DlgImgLinkTab : "Tilknýti", + +// Flash Dialog +DlgFlashTitle : "Flash eginleikar", +DlgFlashChkPlay : "Avspælingin byrjar sjálv", +DlgFlashChkLoop : "Endurspæl", +DlgFlashChkMenu : "Ger Flash skrá virkna", +DlgFlashScale : "Skalering", +DlgFlashScaleAll : "Vís alt", +DlgFlashScaleNoBorder : "Eingin bordi", +DlgFlashScaleFit : "Neyv skalering", + +// Link Dialog +DlgLnkWindowTitle : "Tilknýti", +DlgLnkInfoTab : "Tilknýtis upplýsingar", +DlgLnkTargetTab : "Mál", + +DlgLnkType : "Tilknýtisslag", +DlgLnkTypeURL : "URL", +DlgLnkTypeAnchor : "Tilknýti til marknastein í tekstinum", +DlgLnkTypeEMail : "Teldupostur", +DlgLnkProto : "Protokoll", +DlgLnkProtoOther : "", +DlgLnkURL : "URL", +DlgLnkAnchorSel : "Vel ein marknastein", +DlgLnkAnchorByName : "Eftir navni á marknasteini", +DlgLnkAnchorById : "Eftir element Id", +DlgLnkNoAnchors : "(Eingir marknasteinar eru í hesum dokumentið)", +DlgLnkEMail : "Teldupost-adressa", +DlgLnkEMailSubject : "Evni", +DlgLnkEMailBody : "Breyðtekstur", +DlgLnkUpload : "Send til ambætaran", +DlgLnkBtnUpload : "Send til ambætaran", + +DlgLnkTarget : "Mál", +DlgLnkTargetFrame : "", +DlgLnkTargetPopup : "", +DlgLnkTargetBlank : "Nýtt vindeyga (_blank)", +DlgLnkTargetParent : "Upphavliga vindeygað (_parent)", +DlgLnkTargetSelf : "Sama vindeygað (_self)", +DlgLnkTargetTop : "Alt vindeygað (_top)", +DlgLnkTargetFrameName : "Vís navn vindeygans", +DlgLnkPopWinName : "Popup vindeygans navn", +DlgLnkPopWinFeat : "Popup vindeygans víðkaðu eginleikar", +DlgLnkPopResize : "Kann broyta stødd", +DlgLnkPopLocation : "Adressulinja", +DlgLnkPopMenu : "Skrábjálki", +DlgLnkPopScroll : "Rullibjálki", +DlgLnkPopStatus : "Støðufrágreiðingarbjálki", +DlgLnkPopToolbar : "Amboðsbjálki", +DlgLnkPopFullScrn : "Fullur skermur (IE)", +DlgLnkPopDependent : "Bundið (Netscape)", +DlgLnkPopWidth : "Breidd", +DlgLnkPopHeight : "Hædd", +DlgLnkPopLeft : "Frástøða frá vinstru", +DlgLnkPopTop : "Frástøða frá íerva", + +DlnLnkMsgNoUrl : "Vinarliga skriva tilknýti (URL)", +DlnLnkMsgNoEMail : "Vinarliga skriva teldupost-adressu", +DlnLnkMsgNoAnchor : "Vinarliga vel marknastein", +DlnLnkMsgInvPopName : "Popup navnið má byrja við bókstavi og má ikki hava millumrúm", + +// Color Dialog +DlgColorTitle : "Vel lit", +DlgColorBtnClear : "Strika alt", +DlgColorHighlight : "Framhevja", +DlgColorSelected : "Valt", + +// Smiley Dialog +DlgSmileyTitle : "Vel Smiley", + +// Special Character Dialog +DlgSpecialCharTitle : "Vel sertekn", + +// Table Dialog +DlgTableTitle : "Eginleikar fyri tabell", +DlgTableRows : "Røðir", +DlgTableColumns : "Kolonnur", +DlgTableBorder : "Bordabreidd", +DlgTableAlign : "Justering", +DlgTableAlignNotSet : "", +DlgTableAlignLeft : "Vinstrasett", +DlgTableAlignCenter : "Miðsett", +DlgTableAlignRight : "Høgrasett", +DlgTableWidth : "Breidd", +DlgTableWidthPx : "pixels", +DlgTableWidthPc : "prosent", +DlgTableHeight : "Hædd", +DlgTableCellSpace : "Fjarstøða millum meskar", +DlgTableCellPad : "Meskubreddi", +DlgTableCaption : "Tabellfrágreiðing", +DlgTableSummary : "Samandráttur", + +// Table Cell Dialog +DlgCellTitle : "Mesku eginleikar", +DlgCellWidth : "Breidd", +DlgCellWidthPx : "pixels", +DlgCellWidthPc : "prosent", +DlgCellHeight : "Hædd", +DlgCellWordWrap : "Orðkloyving", +DlgCellWordWrapNotSet : "", +DlgCellWordWrapYes : "Ja", +DlgCellWordWrapNo : "Nei", +DlgCellHorAlign : "Vatnrøtt justering", +DlgCellHorAlignNotSet : "", +DlgCellHorAlignLeft : "Vinstrasett", +DlgCellHorAlignCenter : "Miðsett", +DlgCellHorAlignRight: "Høgrasett", +DlgCellVerAlign : "Lodrøtt justering", +DlgCellVerAlignNotSet : "", +DlgCellVerAlignTop : "Ovast", +DlgCellVerAlignMiddle : "Miðjan", +DlgCellVerAlignBottom : "Niðast", +DlgCellVerAlignBaseline : "Basislinja", +DlgCellRowSpan : "Røðir, meskin fevnir um", +DlgCellCollSpan : "Kolonnur, meskin fevnir um", +DlgCellBackColor : "Bakgrundslitur", +DlgCellBorderColor : "Litur á borda", +DlgCellBtnSelect : "Vel...", + +// Find and Replace Dialog +DlgFindAndReplaceTitle : "Find and Replace", //MISSING + +// Find Dialog +DlgFindTitle : "Finn", +DlgFindFindBtn : "Finn", +DlgFindNotFoundMsg : "Leititeksturin varð ikki funnin", + +// Replace Dialog +DlgReplaceTitle : "Yvirskriva", +DlgReplaceFindLbl : "Finn:", +DlgReplaceReplaceLbl : "Yvirskriva við:", +DlgReplaceCaseChk : "Munur á stórum og smáðum bókstavum", +DlgReplaceReplaceBtn : "Yvirskriva", +DlgReplaceReplAllBtn : "Yvirskriva alt", +DlgReplaceWordChk : "Bert heil orð", + +// Paste Operations / Dialog +PasteErrorCut : "Trygdaruppseting alnótskagans forðar tekstviðgeranum í at kvetta tekstin. vinarliga nýt knappaborðið til at kvetta tekstin (CTRL+X).", +PasteErrorCopy : "Trygdaruppseting alnótskagans forðar tekstviðgeranum í at avrita tekstin. Vinarliga nýt knappaborðið til at avrita tekstin (CTRL+C).", + +PasteAsText : "Innrita som reinan tekst", +PasteFromWord : "Innrita fra Word", + +DlgPasteMsg2 : "Vinarliga koyr tekstin í hendan rútin við knappaborðinum (CTRL+V) og klikk á Góðtak.", +DlgPasteSec : "Because of your browser security settings, the editor is not able to access your clipboard data directly. You are required to paste it again in this window.", //MISSING +DlgPasteIgnoreFont : "Forfjóna Font definitiónirnar", +DlgPasteRemoveStyles : "Strika Styles definitiónir", + +// Color Picker +ColorAutomatic : "Av sær sjálvum", +ColorMoreColors : "Fleiri litir...", + +// Document Properties +DocProps : "Eginleikar fyri dokument", + +// Anchor Dialog +DlgAnchorTitle : "Eginleikar fyri marknastein", +DlgAnchorName : "Heiti marknasteinsins", +DlgAnchorErrorName : "Vinarliga rita marknasteinsins heiti", + +// Speller Pages Dialog +DlgSpellNotInDic : "Finst ikki í orðabókini", +DlgSpellChangeTo : "Broyt til", +DlgSpellBtnIgnore : "Forfjóna", +DlgSpellBtnIgnoreAll : "Forfjóna alt", +DlgSpellBtnReplace : "Yvirskriva", +DlgSpellBtnReplaceAll : "Yvirskriva alt", +DlgSpellBtnUndo : "Angra", +DlgSpellNoSuggestions : "- Einki uppskot -", +DlgSpellProgress : "Rættstavarin arbeiðir...", +DlgSpellNoMispell : "Rættstavarain liðugur: Eingin feilur funnin", +DlgSpellNoChanges : "Rættstavarain liðugur: Einki orð varð broytt", +DlgSpellOneChange : "Rættstavarain liðugur: Eitt orð er broytt", +DlgSpellManyChanges : "Rættstavarain liðugur: %1 orð broytt", + +IeSpellDownload : "Rættstavarin er ikki tøkur í tekstviðgeranum. Vilt tú heinta hann nú?", + +// Button Dialog +DlgButtonText : "Tekstur", +DlgButtonType : "Slag", +DlgButtonTypeBtn : "Knøttur", +DlgButtonTypeSbm : "Send", +DlgButtonTypeRst : "Nullstilla", + +// Checkbox and Radio Button Dialogs +DlgCheckboxName : "Navn", +DlgCheckboxValue : "Virði", +DlgCheckboxSelected : "Valt", + +// Form Dialog +DlgFormName : "Navn", +DlgFormAction : "Hending", +DlgFormMethod : "Háttur", + +// Select Field Dialog +DlgSelectName : "Navn", +DlgSelectValue : "Virði", +DlgSelectSize : "Stødd", +DlgSelectLines : "Linjur", +DlgSelectChkMulti : "Loyv fleiri valmøguleikum samstundis", +DlgSelectOpAvail : "Tøkir møguleikar", +DlgSelectOpText : "Tekstur", +DlgSelectOpValue : "Virði", +DlgSelectBtnAdd : "Legg afturat", +DlgSelectBtnModify : "Broyt", +DlgSelectBtnUp : "Upp", +DlgSelectBtnDown : "Niður", +DlgSelectBtnSetValue : "Set sum valt virði", +DlgSelectBtnDelete : "Strika", + +// Textarea Dialog +DlgTextareaName : "Navn", +DlgTextareaCols : "kolonnur", +DlgTextareaRows : "røðir", + +// Text Field Dialog +DlgTextName : "Navn", +DlgTextValue : "Virði", +DlgTextCharWidth : "Breidd (sjónlig tekn)", +DlgTextMaxChars : "Mest loyvdu tekn", +DlgTextType : "Slag", +DlgTextTypeText : "Tekstur", +DlgTextTypePass : "Loyniorð", + +// Hidden Field Dialog +DlgHiddenName : "Navn", +DlgHiddenValue : "Virði", + +// Bulleted List Dialog +BulletedListProp : "Eginleikar fyri punktmerktan lista", +NumberedListProp : "Eginleikar fyri talmerktan lista", +DlgLstStart : "Byrjan", +DlgLstType : "Slag", +DlgLstTypeCircle : "Sirkul", +DlgLstTypeDisc : "Fyltur sirkul", +DlgLstTypeSquare : "Fjórhyrningur", +DlgLstTypeNumbers : "Talmerkt (1, 2, 3)", +DlgLstTypeLCase : "Smáir bókstavir (a, b, c)", +DlgLstTypeUCase : "Stórir bókstavir (A, B, C)", +DlgLstTypeSRoman : "Smá rómaratøl (i, ii, iii)", +DlgLstTypeLRoman : "Stór rómaratøl (I, II, III)", + +// Document Properties Dialog +DlgDocGeneralTab : "Generelt", +DlgDocBackTab : "Bakgrund", +DlgDocColorsTab : "Litir og breddar", +DlgDocMetaTab : "META-upplýsingar", + +DlgDocPageTitle : "Síðuheiti", +DlgDocLangDir : "Tekstkós", +DlgDocLangDirLTR : "Frá vinstru móti høgru (LTR)", +DlgDocLangDirRTL : "Frá høgru móti vinstru (RTL)", +DlgDocLangCode : "Málkoda", +DlgDocCharSet : "Teknsett koda", +DlgDocCharSetCE : "Miðeuropa", +DlgDocCharSetCT : "Kinesiskt traditionelt (Big5)", +DlgDocCharSetCR : "Cyrilliskt", +DlgDocCharSetGR : "Grikst", +DlgDocCharSetJP : "Japanskt", +DlgDocCharSetKR : "Koreanskt", +DlgDocCharSetTR : "Turkiskt", +DlgDocCharSetUN : "UNICODE (UTF-8)", +DlgDocCharSetWE : "Vestureuropa", +DlgDocCharSetOther : "Onnur teknsett koda", + +DlgDocDocType : "Dokumentslag yvirskrift", +DlgDocDocTypeOther : "Annað dokumentslag yvirskrift", +DlgDocIncXHTML : "Viðfest XHTML deklaratiónir", +DlgDocBgColor : "Bakgrundslitur", +DlgDocBgImage : "Leið til bakgrundsmynd (URL)", +DlgDocBgNoScroll : "Læst bakgrund (rullar ikki)", +DlgDocCText : "Tekstur", +DlgDocCLink : "Tilknýti", +DlgDocCVisited : "Vitjaði tilknýti", +DlgDocCActive : "Virkin tilknýti", +DlgDocMargins : "Síðubreddar", +DlgDocMaTop : "Ovast", +DlgDocMaLeft : "Vinstra", +DlgDocMaRight : "Høgra", +DlgDocMaBottom : "Niðast", +DlgDocMeIndex : "Dokument index lyklaorð (sundurbýtt við komma)", +DlgDocMeDescr : "Dokumentlýsing", +DlgDocMeAuthor : "Høvundur", +DlgDocMeCopy : "Upphavsrættindi", +DlgDocPreview : "Frumsýning", + +// Templates Dialog +Templates : "Skabelónir", +DlgTemplatesTitle : "Innihaldsskabelónir", +DlgTemplatesSelMsg : "Vinarliga vel ta skabelón, ið skal opnast í tekstviðgeranum
        (Hetta yvirskrivar núverandi innihald):", +DlgTemplatesLoading : "Heinti yvirlit yvir skabelónir. Vinarliga bíða við...", +DlgTemplatesNoTpl : "(Ongar skabelónir tøkar)", +DlgTemplatesReplace : "Yvirskriva núverandi innihald", + +// About Dialog +DlgAboutAboutTab : "Um", +DlgAboutBrowserInfoTab : "Upplýsingar um alnótskagan", +DlgAboutLicenseTab : "License", +DlgAboutVersion : "version", +DlgAboutInfo : "Fyri fleiri upplýsingar, far til" +}; Property changes on: announcement/trunk/src/main/webapp/fckeditor/editor/lang/fo.js ___________________________________________________________________ Name: svn:eol-style + native Added: announcement/trunk/src/main/webapp/fckeditor/editor/lang/fr-ca.js =================================================================== --- announcement/trunk/src/main/webapp/fckeditor/editor/lang/fr-ca.js (rev 0) +++ announcement/trunk/src/main/webapp/fckeditor/editor/lang/fr-ca.js 2008-06-30 02:54:27 UTC (rev 1002) @@ -0,0 +1,515 @@ +?/* + * FCKeditor - The text editor for Internet - http://www.fckeditor.net + * Copyright (C) 2003-2008 Frederico Caldeira Knabben + * + * == BEGIN LICENSE == + * + * Licensed under the terms of any of the following licenses at your + * choice: + * + * - GNU General Public License Version 2 or later (the "GPL") + * http://www.gnu.org/licenses/gpl.html + * + * - GNU Lesser General Public License Version 2.1 or later (the "LGPL") + * http://www.gnu.org/licenses/lgpl.html + * + * - Mozilla Public License Version 1.1 or later (the "MPL") + * http://www.mozilla.org/MPL/MPL-1.1.html + * + * == END LICENSE == + * + * Canadian French language file. + */ + +var FCKLang = +{ +// Language direction : "ltr" (left to right) or "rtl" (right to left). +Dir : "ltr", + +ToolbarCollapse : "Masquer Outils", +ToolbarExpand : "Afficher Outils", + +// Toolbar Items and Context Menu +Save : "Sauvegarder", +NewPage : "Nouvelle page", +Preview : "Previsualiser", +Cut : "Couper", +Copy : "Copier", +Paste : "Coller", +PasteText : "Coller en tant que texte", +PasteWord : "Coller en tant que Word (formaté)", +Print : "Imprimer", +SelectAll : "Tout sélectionner", +RemoveFormat : "Supprimer le formatage", +InsertLinkLbl : "Lien", +InsertLink : "Insérer/modifier le lien", +RemoveLink : "Supprimer le lien", +Anchor : "Insérer/modifier l'ancre", +AnchorDelete : "Supprimer l'ancre", +InsertImageLbl : "Image", +InsertImage : "Insérer/modifier l'image", +InsertFlashLbl : "Animation Flash", +InsertFlash : "Insérer/modifier l'animation Flash", +InsertTableLbl : "Tableau", +InsertTable : "Insérer/modifier le tableau", +InsertLineLbl : "Séparateur", +InsertLine : "Insérer un séparateur", +InsertSpecialCharLbl: "Caractères spéciaux", +InsertSpecialChar : "Insérer un caractère spécial", +InsertSmileyLbl : "Emoticon", +InsertSmiley : "Insérer un Emoticon", +About : "A propos de FCKeditor", +Bold : "Gras", +Italic : "Italique", +Underline : "Souligné", +StrikeThrough : "Barrer", +Subscript : "Indice", +Superscript : "Exposant", +LeftJustify : "Aligner à gauche", +CenterJustify : "Centrer", +RightJustify : "Aligner à Droite", +BlockJustify : "Texte justifié", +DecreaseIndent : "Diminuer le retrait", +IncreaseIndent : "Augmenter le retrait", +Blockquote : "Citation", +Undo : "Annuler", +Redo : "Refaire", +NumberedListLbl : "Liste numérotée", +NumberedList : "Insérer/supprimer la liste numérotée", +BulletedListLbl : "Liste à puces", +BulletedList : "Insérer/supprimer la liste à puces", +ShowTableBorders : "Afficher les bordures du tableau", +ShowDetails : "Afficher les caractères invisibles", +Style : "Style", +FontFormat : "Format", +Font : "Police", +FontSize : "Taille", +TextColor : "Couleur de caractère", +BGColor : "Couleur de fond", +Source : "Source", +Find : "Chercher", +Replace : "Remplacer", +SpellCheck : "Orthographe", +UniversalKeyboard : "Clavier universel", +PageBreakLbl : "Saut de page", +PageBreak : "Insérer un saut de page", + +Form : "Formulaire", +Checkbox : "Case à cocher", +RadioButton : "Bouton radio", +TextField : "Champ texte", +Textarea : "Zone de texte", +HiddenField : "Champ caché", +Button : "Bouton", +SelectionField : "Champ de sélection", +ImageButton : "Bouton image", + +FitWindow : "Edition pleine page", +ShowBlocks : "Afficher les blocs", + +// Context Menu +EditLink : "Modifier le lien", +CellCM : "Cellule", +RowCM : "Ligne", +ColumnCM : "Colonne", +InsertRowAfter : "Insérer une ligne après", +InsertRowBefore : "Insérer une ligne avant", +DeleteRows : "Supprimer des lignes", +InsertColumnAfter : "Insérer une colonne après", +InsertColumnBefore : "Insérer une colonne avant", +DeleteColumns : "Supprimer des colonnes", +InsertCellAfter : "Insérer une cellule après", +InsertCellBefore : "Insérer une cellule avant", +DeleteCells : "Supprimer des cellules", +MergeCells : "Fusionner les cellules", +MergeRight : "Fusionner à droite", +MergeDown : "Fusionner en bas", +HorizontalSplitCell : "Scinder la cellule horizontalement", +VerticalSplitCell : "Scinder la cellule verticalement", +TableDelete : "Supprimer le tableau", +CellProperties : "Propriétés de cellule", +TableProperties : "Propriétés du tableau", +ImageProperties : "Propriétés de l'image", +FlashProperties : "Propriétés de l'animation Flash", + +AnchorProp : "Propriétés de l'ancre", +ButtonProp : "Propriétés du bouton", +CheckboxProp : "Propriétés de la case à cocher", +HiddenFieldProp : "Propriétés du champ caché", +RadioButtonProp : "Propriétés du bouton radio", +ImageButtonProp : "Propriétés du bouton image", +TextFieldProp : "Propriétés du champ texte", +SelectionFieldProp : "Propriétés de la liste/du menu", +TextareaProp : "Propriétés de la zone de texte", +FormProp : "Propriétés du formulaire", + +FontFormats : "Normal;Formaté;Adresse;En-tête 1;En-tête 2;En-tête 3;En-tête 4;En-tête 5;En-tête 6;Normal (DIV)", + +// Alerts and Messages +ProcessingXHTML : "Calcul XHTML. Veuillez patienter...", +Done : "Terminé", +PasteWordConfirm : "Le texte à coller semble provenir de Word. Désirez-vous le nettoyer avant de coller?", +NotCompatiblePaste : "Cette commande nécessite Internet Explorer version 5.5 et plus. Souhaitez-vous coller sans nettoyage?", +UnknownToolbarItem : "Élément de barre d'outil inconnu \"%1\"", +UnknownCommand : "Nom de commande inconnu \"%1\"", +NotImplemented : "Commande indisponible", +UnknownToolbarSet : "La barre d'outils \"%1\" n'existe pas", +NoActiveX : "Les paramètres de sécurité de votre navigateur peuvent limiter quelques fonctionnalités de l'éditeur. Veuillez activer l'option \"Exécuter les contrôles ActiveX et les plug-ins\". Il se peut que vous rencontriez des erreurs et remarquiez quelques limitations.", +BrowseServerBlocked : "Le navigateur n'a pas pu être ouvert. Assurez-vous que les bloqueurs de popups soient désactivés.", +DialogBlocked : "La fenêtre de dialogue n'a pas pu s'ouvrir. Assurez-vous que les bloqueurs de popups soient désactivés.", + +// Dialogs +DlgBtnOK : "OK", +DlgBtnCancel : "Annuler", +DlgBtnClose : "Fermer", +DlgBtnBrowseServer : "Parcourir le serveur", +DlgAdvancedTag : "Avancée", +DlgOpOther : "", +DlgInfoTab : "Info", +DlgAlertUrl : "Veuillez saisir l'URL", + +// General Dialogs Labels +DlgGenNotSet : "", +DlgGenId : "Id", +DlgGenLangDir : "Sens d'écriture", +DlgGenLangDirLtr : "De gauche à droite (LTR)", +DlgGenLangDirRtl : "De droite à gauche (RTL)", +DlgGenLangCode : "Code langue", +DlgGenAccessKey : "Équivalent clavier", +DlgGenName : "Nom", +DlgGenTabIndex : "Ordre de tabulation", +DlgGenLongDescr : "URL de description longue", +DlgGenClass : "Classes de feuilles de style", +DlgGenTitle : "Titre", +DlgGenContType : "Type de contenu", +DlgGenLinkCharset : "Encodage de caractère", +DlgGenStyle : "Style", + +// Image Dialog +DlgImgTitle : "Propriétés de l'image", +DlgImgInfoTab : "Informations sur l'image", +DlgImgBtnUpload : "Envoyer sur le serveur", +DlgImgURL : "URL", +DlgImgUpload : "Télécharger", +DlgImgAlt : "Texte de remplacement", +DlgImgWidth : "Largeur", +DlgImgHeight : "Hauteur", +DlgImgLockRatio : "Garder les proportions", +DlgBtnResetSize : "Taille originale", +DlgImgBorder : "Bordure", +DlgImgHSpace : "Espacement horizontal", +DlgImgVSpace : "Espacement vertical", +DlgImgAlign : "Alignement", +DlgImgAlignLeft : "Gauche", +DlgImgAlignAbsBottom: "Abs Bas", +DlgImgAlignAbsMiddle: "Abs Milieu", +DlgImgAlignBaseline : "Bas du texte", +DlgImgAlignBottom : "Bas", +DlgImgAlignMiddle : "Milieu", +DlgImgAlignRight : "Droite", +DlgImgAlignTextTop : "Haut du texte", +DlgImgAlignTop : "Haut", +DlgImgPreview : "Prévisualisation", +DlgImgAlertUrl : "Veuillez saisir l'URL de l'image", +DlgImgLinkTab : "Lien", + +// Flash Dialog +DlgFlashTitle : "Propriétés de l'animation Flash", +DlgFlashChkPlay : "Lecture automatique", +DlgFlashChkLoop : "Boucle", +DlgFlashChkMenu : "Activer le menu Flash", +DlgFlashScale : "Affichage", +DlgFlashScaleAll : "Par défaut (tout montrer)", +DlgFlashScaleNoBorder : "Sans bordure", +DlgFlashScaleFit : "Ajuster aux dimensions", + +// Link Dialog +DlgLnkWindowTitle : "Propriétés du lien", +DlgLnkInfoTab : "Informations sur le lien", +DlgLnkTargetTab : "Destination", + +DlgLnkType : "Type de lien", +DlgLnkTypeURL : "URL", +DlgLnkTypeAnchor : "Ancre dans cette page", +DlgLnkTypeEMail : "E-Mail", +DlgLnkProto : "Protocole", +DlgLnkProtoOther : "", +DlgLnkURL : "URL", +DlgLnkAnchorSel : "Sélectionner une ancre", +DlgLnkAnchorByName : "Par nom", +DlgLnkAnchorById : "Par id", +DlgLnkNoAnchors : "(Pas d'ancre disponible dans le document)", +DlgLnkEMail : "Adresse E-Mail", +DlgLnkEMailSubject : "Sujet du message", +DlgLnkEMailBody : "Corps du message", +DlgLnkUpload : "Télécharger", +DlgLnkBtnUpload : "Envoyer sur le serveur", + +DlgLnkTarget : "Destination", +DlgLnkTargetFrame : "", +DlgLnkTargetPopup : "", +DlgLnkTargetBlank : "Nouvelle fenêtre (_blank)", +DlgLnkTargetParent : "Fenêtre mère (_parent)", +DlgLnkTargetSelf : "Même fenêtre (_self)", +DlgLnkTargetTop : "Fenêtre supérieure (_top)", +DlgLnkTargetFrameName : "Nom du cadre de destination", +DlgLnkPopWinName : "Nom de la fenêtre popup", +DlgLnkPopWinFeat : "Caractéristiques de la fenêtre popup", +DlgLnkPopResize : "Taille modifiable", +DlgLnkPopLocation : "Barre d'adresses", +DlgLnkPopMenu : "Barre de menu", +DlgLnkPopScroll : "Barres de défilement", +DlgLnkPopStatus : "Barre d'état", +DlgLnkPopToolbar : "Barre d'outils", +DlgLnkPopFullScrn : "Plein écran (IE)", +DlgLnkPopDependent : "Dépendante (Netscape)", +DlgLnkPopWidth : "Largeur", +DlgLnkPopHeight : "Hauteur", +DlgLnkPopLeft : "Position à partir de la gauche", +DlgLnkPopTop : "Position à partir du haut", + +DlnLnkMsgNoUrl : "Veuillez saisir l'URL", +DlnLnkMsgNoEMail : "Veuillez saisir l'adresse e-mail", +DlnLnkMsgNoAnchor : "Veuillez sélectionner une ancre", +DlnLnkMsgInvPopName : "Le nom de la fenêtre popup doit commencer par une lettre et ne doit pas contenir d'espace", + +// Color Dialog +DlgColorTitle : "Sélectionner", +DlgColorBtnClear : "Effacer", +DlgColorHighlight : "Prévisualisation", +DlgColorSelected : "Sélectionné", + +// Smiley Dialog +DlgSmileyTitle : "Insérer un Emoticon", + +// Special Character Dialog +DlgSpecialCharTitle : "Insérer un caractère spécial", + +// Table Dialog +DlgTableTitle : "Propriétés du tableau", +DlgTableRows : "Lignes", +DlgTableColumns : "Colonnes", +DlgTableBorder : "Taille de la bordure", +DlgTableAlign : "Alignement", +DlgTableAlignNotSet : "", +DlgTableAlignLeft : "Gauche", +DlgTableAlignCenter : "Centré", +DlgTableAlignRight : "Droite", +DlgTableWidth : "Largeur", +DlgTableWidthPx : "pixels", +DlgTableWidthPc : "pourcentage", +DlgTableHeight : "Hauteur", +DlgTableCellSpace : "Espacement", +DlgTableCellPad : "Contour", +DlgTableCaption : "Titre", +DlgTableSummary : "Résumé", + +// Table Cell Dialog +DlgCellTitle : "Propriétés de la cellule", +DlgCellWidth : "Largeur", +DlgCellWidthPx : "pixels", +DlgCellWidthPc : "pourcentage", +DlgCellHeight : "Hauteur", +DlgCellWordWrap : "Retour à la ligne", +DlgCellWordWrapNotSet : "", +DlgCellWordWrapYes : "Oui", +DlgCellWordWrapNo : "Non", +DlgCellHorAlign : "Alignement horizontal", +DlgCellHorAlignNotSet : "", +DlgCellHorAlignLeft : "Gauche", +DlgCellHorAlignCenter : "Centré", +DlgCellHorAlignRight: "Droite", +DlgCellVerAlign : "Alignement vertical", +DlgCellVerAlignNotSet : "", +DlgCellVerAlignTop : "Haut", +DlgCellVerAlignMiddle : "Milieu", +DlgCellVerAlignBottom : "Bas", +DlgCellVerAlignBaseline : "Bas du texte", +DlgCellRowSpan : "Lignes fusionnées", +DlgCellCollSpan : "Colonnes fusionnées", +DlgCellBackColor : "Couleur de fond", +DlgCellBorderColor : "Couleur de bordure", +DlgCellBtnSelect : "Sélectionner...", + +// Find and Replace Dialog +DlgFindAndReplaceTitle : "Chercher et Remplacer", + +// Find Dialog +DlgFindTitle : "Chercher", +DlgFindFindBtn : "Chercher", +DlgFindNotFoundMsg : "Le texte indiqué est introuvable.", + +// Replace Dialog +DlgReplaceTitle : "Remplacer", +DlgReplaceFindLbl : "Rechercher:", +DlgReplaceReplaceLbl : "Remplacer par:", +DlgReplaceCaseChk : "Respecter la casse", +DlgReplaceReplaceBtn : "Remplacer", +DlgReplaceReplAllBtn : "Tout remplacer", +DlgReplaceWordChk : "Mot entier", + +// Paste Operations / Dialog +PasteErrorCut : "Les paramètres de sécurité de votre navigateur empêchent l'éditeur de couper automatiquement vos données. Veuillez utiliser les équivalents claviers (Ctrl+X).", +PasteErrorCopy : "Les paramètres de sécurité de votre navigateur empêchent l'éditeur de copier automatiquement vos données. Veuillez utiliser les équivalents claviers (Ctrl+C).", + +PasteAsText : "Coller comme texte", +PasteFromWord : "Coller à partir de Word", + +DlgPasteMsg2 : "Veuillez coller dans la zone ci-dessous en utilisant le clavier (Ctrl+V) et appuyer sur OK.", +DlgPasteSec : "A cause des paramètres de sécurité de votre navigateur, l'éditeur ne peut accéder au presse-papier directement. Vous devez coller à nouveau le contenu dans cette fenêtre.", +DlgPasteIgnoreFont : "Ignorer les polices de caractères", +DlgPasteRemoveStyles : "Supprimer les styles", + +// Color Picker +ColorAutomatic : "Automatique", +ColorMoreColors : "Plus de couleurs...", + +// Document Properties +DocProps : "Propriétés du document", + +// Anchor Dialog +DlgAnchorTitle : "Propriétés de l'ancre", +DlgAnchorName : "Nom de l'ancre", +DlgAnchorErrorName : "Veuillez saisir le nom de l'ancre", + +// Speller Pages Dialog +DlgSpellNotInDic : "Pas dans le dictionnaire", +DlgSpellChangeTo : "Changer en", +DlgSpellBtnIgnore : "Ignorer", +DlgSpellBtnIgnoreAll : "Ignorer tout", +DlgSpellBtnReplace : "Remplacer", +DlgSpellBtnReplaceAll : "Remplacer tout", +DlgSpellBtnUndo : "Annuler", +DlgSpellNoSuggestions : "- Pas de suggestion -", +DlgSpellProgress : "Vérification d'orthographe en cours...", +DlgSpellNoMispell : "Vérification d'orthographe terminée: pas d'erreur trouvée", +DlgSpellNoChanges : "Vérification d'orthographe terminée: Pas de modifications", +DlgSpellOneChange : "Vérification d'orthographe terminée: Un mot modifié", +DlgSpellManyChanges : "Vérification d'orthographe terminée: %1 mots modifiés", + +IeSpellDownload : "Le Correcteur d'orthographe n'est pas installé. Souhaitez-vous le télécharger maintenant?", + +// Button Dialog +DlgButtonText : "Texte (Valeur)", +DlgButtonType : "Type", +DlgButtonTypeBtn : "Bouton", +DlgButtonTypeSbm : "Soumettre", +DlgButtonTypeRst : "Réinitialiser", + +// Checkbox and Radio Button Dialogs +DlgCheckboxName : "Nom", +DlgCheckboxValue : "Valeur", +DlgCheckboxSelected : "Sélectionné", + +// Form Dialog +DlgFormName : "Nom", +DlgFormAction : "Action", +DlgFormMethod : "Méthode", + +// Select Field Dialog +DlgSelectName : "Nom", +DlgSelectValue : "Valeur", +DlgSelectSize : "Taille", +DlgSelectLines : "lignes", +DlgSelectChkMulti : "Sélection multiple", +DlgSelectOpAvail : "Options disponibles", +DlgSelectOpText : "Texte", +DlgSelectOpValue : "Valeur", +DlgSelectBtnAdd : "Ajouter", +DlgSelectBtnModify : "Modifier", +DlgSelectBtnUp : "Monter", +DlgSelectBtnDown : "Descendre", +DlgSelectBtnSetValue : "Valeur sélectionnée", +DlgSelectBtnDelete : "Supprimer", + +// Textarea Dialog +DlgTextareaName : "Nom", +DlgTextareaCols : "Colonnes", +DlgTextareaRows : "Lignes", + +// Text Field Dialog +DlgTextName : "Nom", +DlgTextValue : "Valeur", +DlgTextCharWidth : "Largeur en caractères", +DlgTextMaxChars : "Nombre maximum de caractères", +DlgTextType : "Type", +DlgTextTypeText : "Texte", +DlgTextTypePass : "Mot de passe", + +// Hidden Field Dialog +DlgHiddenName : "Nom", +DlgHiddenValue : "Valeur", + +// Bulleted List Dialog +BulletedListProp : "Propriétés de liste à puces", +NumberedListProp : "Propriétés de liste numérotée", +DlgLstStart : "Début", +DlgLstType : "Type", +DlgLstTypeCircle : "Cercle", +DlgLstTypeDisc : "Disque", +DlgLstTypeSquare : "Carré", +DlgLstTypeNumbers : "Nombres (1, 2, 3)", +DlgLstTypeLCase : "Lettres minuscules (a, b, c)", +DlgLstTypeUCase : "Lettres majuscules (A, B, C)", +DlgLstTypeSRoman : "Chiffres romains minuscules (i, ii, iii)", +DlgLstTypeLRoman : "Chiffres romains majuscules (I, II, III)", + +// Document Properties Dialog +DlgDocGeneralTab : "Général", +DlgDocBackTab : "Fond", +DlgDocColorsTab : "Couleurs et Marges", +DlgDocMetaTab : "Méta-Données", + +DlgDocPageTitle : "Titre de la page", +DlgDocLangDir : "Sens d'écriture", +DlgDocLangDirLTR : "De la gauche vers la droite (LTR)", +DlgDocLangDirRTL : "De la droite vers la gauche (RTL)", +DlgDocLangCode : "Code langue", +DlgDocCharSet : "Encodage de caractère", +DlgDocCharSetCE : "Europe Centrale", +DlgDocCharSetCT : "Chinois Traditionnel (Big5)", +DlgDocCharSetCR : "Cyrillique", +DlgDocCharSetGR : "Grecque", +DlgDocCharSetJP : "Japonais", +DlgDocCharSetKR : "Coréen", +DlgDocCharSetTR : "Turcque", +DlgDocCharSetUN : "Unicode (UTF-8)", +DlgDocCharSetWE : "Occidental", +DlgDocCharSetOther : "Autre encodage de caractère", + +DlgDocDocType : "Type de document", +DlgDocDocTypeOther : "Autre type de document", +DlgDocIncXHTML : "Inclure les déclarations XHTML", +DlgDocBgColor : "Couleur de fond", +DlgDocBgImage : "Image de fond", +DlgDocBgNoScroll : "Image fixe sans défilement", +DlgDocCText : "Texte", +DlgDocCLink : "Lien", +DlgDocCVisited : "Lien visité", +DlgDocCActive : "Lien activé", +DlgDocMargins : "Marges", +DlgDocMaTop : "Haut", +DlgDocMaLeft : "Gauche", +DlgDocMaRight : "Droite", +DlgDocMaBottom : "Bas", +DlgDocMeIndex : "Mots-clés (séparés par des virgules)", +DlgDocMeDescr : "Description", +DlgDocMeAuthor : "Auteur", +DlgDocMeCopy : "Copyright", +DlgDocPreview : "Prévisualisation", + +// Templates Dialog +Templates : "Modèles", +DlgTemplatesTitle : "Modèles de contenu", +DlgTemplatesSelMsg : "Sélectionner le modèle à ouvrir dans l'éditeur
        (le contenu actuel sera remplacé):", +DlgTemplatesLoading : "Chargement de la liste des modèles. Veuillez patienter...", +DlgTemplatesNoTpl : "(Aucun modèle disponible)", +DlgTemplatesReplace : "Remplacer tout le contenu actuel", + +// About Dialog +DlgAboutAboutTab : "Á propos de", +DlgAboutBrowserInfoTab : "Navigateur", +DlgAboutLicenseTab : "License", +DlgAboutVersion : "Version", +DlgAboutInfo : "Pour plus d'informations, visiter" +}; Property changes on: announcement/trunk/src/main/webapp/fckeditor/editor/lang/fr-ca.js ___________________________________________________________________ Name: svn:eol-style + native Added: announcement/trunk/src/main/webapp/fckeditor/editor/lang/fr.js =================================================================== --- announcement/trunk/src/main/webapp/fckeditor/editor/lang/fr.js (rev 0) +++ announcement/trunk/src/main/webapp/fckeditor/editor/lang/fr.js 2008-06-30 02:54:27 UTC (rev 1002) @@ -0,0 +1,515 @@ +?/* + * FCKeditor - The text editor for Internet - http://www.fckeditor.net + * Copyright (C) 2003-2008 Frederico Caldeira Knabben + * + * == BEGIN LICENSE == + * + * Licensed under the terms of any of the following licenses at your + * choice: + * + * - GNU General Public License Version 2 or later (the "GPL") + * http://www.gnu.org/licenses/gpl.html + * + * - GNU Lesser General Public License Version 2.1 or later (the "LGPL") + * http://www.gnu.org/licenses/lgpl.html + * + * - Mozilla Public License Version 1.1 or later (the "MPL") + * http://www.mozilla.org/MPL/MPL-1.1.html + * + * == END LICENSE == + * + * French language file. + */ + +var FCKLang = +{ +// Language direction : "ltr" (left to right) or "rtl" (right to left). +Dir : "ltr", + +ToolbarCollapse : "Masquer Outils", +ToolbarExpand : "Afficher Outils", + +// Toolbar Items and Context Menu +Save : "Enregistrer", +NewPage : "Nouvelle page", +Preview : "Prévisualisation", +Cut : "Couper", +Copy : "Copier", +Paste : "Coller", +PasteText : "Coller comme texte", +PasteWord : "Coller de Word", +Print : "Imprimer", +SelectAll : "Tout sélectionner", +RemoveFormat : "Supprimer le format", +InsertLinkLbl : "Lien", +InsertLink : "Insérer/modifier le lien", +RemoveLink : "Supprimer le lien", +Anchor : "Insérer/modifier l'ancre", +AnchorDelete : "Supprimer l'ancre", +InsertImageLbl : "Image", +InsertImage : "Insérer/modifier l'image", +InsertFlashLbl : "Animation Flash", +InsertFlash : "Insérer/modifier l'animation Flash", +InsertTableLbl : "Tableau", +InsertTable : "Insérer/modifier le tableau", +InsertLineLbl : "Séparateur", +InsertLine : "Insérer un séparateur", +InsertSpecialCharLbl: "Caractères spéciaux", +InsertSpecialChar : "Insérer un caractère spécial", +InsertSmileyLbl : "Smiley", +InsertSmiley : "Insérer un Smiley", +About : "A propos de FCKeditor", +Bold : "Gras", +Italic : "Italique", +Underline : "Souligné", +StrikeThrough : "Barré", +Subscript : "Indice", +Superscript : "Exposant", +LeftJustify : "Aligné à gauche", +CenterJustify : "Centré", +RightJustify : "Aligné à Droite", +BlockJustify : "Texte justifié", +DecreaseIndent : "Diminuer le retrait", +IncreaseIndent : "Augmenter le retrait", +Blockquote : "Citation", +Undo : "Annuler", +Redo : "Refaire", +NumberedListLbl : "Liste numérotée", +NumberedList : "Insérer/supprimer la liste numérotée", +BulletedListLbl : "Liste à puces", +BulletedList : "Insérer/supprimer la liste à puces", +ShowTableBorders : "Afficher les bordures du tableau", +ShowDetails : "Afficher les caractères invisibles", +Style : "Style", +FontFormat : "Format", +Font : "Police", +FontSize : "Taille", +TextColor : "Couleur de caractère", +BGColor : "Couleur de fond", +Source : "Source", +Find : "Chercher", +Replace : "Remplacer", +SpellCheck : "Orthographe", +UniversalKeyboard : "Clavier universel", +PageBreakLbl : "Saut de page", +PageBreak : "Insérer un saut de page", + +Form : "Formulaire", +Checkbox : "Case à cocher", +RadioButton : "Bouton radio", +TextField : "Champ texte", +Textarea : "Zone de texte", +HiddenField : "Champ caché", +Button : "Bouton", +SelectionField : "Liste/menu", +ImageButton : "Bouton image", + +FitWindow : "Edition pleine page", +ShowBlocks : "Afficher les blocs", + +// Context Menu +EditLink : "Modifier le lien", +CellCM : "Cellule", +RowCM : "Ligne", +ColumnCM : "Colonne", +InsertRowAfter : "Insérer une ligne après", +InsertRowBefore : "Insérer une ligne avant", +DeleteRows : "Supprimer des lignes", +InsertColumnAfter : "Insérer une colonne après", +InsertColumnBefore : "Insérer une colonne avant", +DeleteColumns : "Supprimer des colonnes", +InsertCellAfter : "Insérer une cellule après", +InsertCellBefore : "Insérer une cellule avant", +DeleteCells : "Supprimer des cellules", +MergeCells : "Fusionner les cellules", +MergeRight : "Fusionner à droite", +MergeDown : "Fusionner en bas", +HorizontalSplitCell : "Scinder la cellule horizontalement", +VerticalSplitCell : "Scinder la cellule verticalement", +TableDelete : "Supprimer le tableau", +CellProperties : "Propriétés de cellule", +TableProperties : "Propriétés du tableau", +ImageProperties : "Propriétés de l'image", +FlashProperties : "Propriétés de l'animation Flash", + +AnchorProp : "Propriétés de l'ancre", +ButtonProp : "Propriétés du bouton", +CheckboxProp : "Propriétés de la case à cocher", +HiddenFieldProp : "Propriétés du champ caché", +RadioButtonProp : "Propriétés du bouton radio", +ImageButtonProp : "Propriétés du bouton image", +TextFieldProp : "Propriétés du champ texte", +SelectionFieldProp : "Propriétés de la liste/du menu", +TextareaProp : "Propriétés de la zone de texte", +FormProp : "Propriétés du formulaire", + +FontFormats : "Normal;Formaté;Adresse;En-tête 1;En-tête 2;En-tête 3;En-tête 4;En-tête 5;En-tête 6;Normal (DIV)", + +// Alerts and Messages +ProcessingXHTML : "Calcul XHTML. Veuillez patienter...", +Done : "Terminé", +PasteWordConfirm : "Le texte à coller semble provenir de Word. Désirez-vous le nettoyer avant de coller?", +NotCompatiblePaste : "Cette commande nécessite Internet Explorer version 5.5 minimum. Souhaitez-vous coller sans nettoyage?", +UnknownToolbarItem : "Elément de barre d'outil inconnu \"%1\"", +UnknownCommand : "Nom de commande inconnu \"%1\"", +NotImplemented : "Commande non encore écrite", +UnknownToolbarSet : "La barre d'outils \"%1\" n'existe pas", +NoActiveX : "Les paramètres de sécurité de votre navigateur peuvent limiter quelques fonctionnalités de l'éditeur. Veuillez activer l'option \"Exécuter les contrôles ActiveX et les plug-ins\". Il se peut que vous rencontriez des erreurs et remarquiez quelques limitations.", +BrowseServerBlocked : "Le navigateur n'a pas pu être ouvert. Assurez-vous que les bloqueurs de popups soient désactivés.", +DialogBlocked : "La fenêtre de dialogue n'a pas pu s'ouvrir. Assurez-vous que les bloqueurs de popups soient désactivés.", + +// Dialogs +DlgBtnOK : "OK", +DlgBtnCancel : "Annuler", +DlgBtnClose : "Fermer", +DlgBtnBrowseServer : "Parcourir le serveur", +DlgAdvancedTag : "Avancé", +DlgOpOther : "", +DlgInfoTab : "Info", +DlgAlertUrl : "Veuillez saisir l'URL", + +// General Dialogs Labels +DlgGenNotSet : "", +DlgGenId : "Id", +DlgGenLangDir : "Sens d'écriture", +DlgGenLangDirLtr : "De gauche à droite (LTR)", +DlgGenLangDirRtl : "De droite à gauche (RTL)", +DlgGenLangCode : "Code langue", +DlgGenAccessKey : "Equivalent clavier", +DlgGenName : "Nom", +DlgGenTabIndex : "Ordre de tabulation", +DlgGenLongDescr : "URL de description longue", +DlgGenClass : "Classes de feuilles de style", +DlgGenTitle : "Titre", +DlgGenContType : "Type de contenu", +DlgGenLinkCharset : "Encodage de caractère", +DlgGenStyle : "Style", + +// Image Dialog +DlgImgTitle : "Propriétés de l'image", +DlgImgInfoTab : "Informations sur l'image", +DlgImgBtnUpload : "Envoyer sur le serveur", +DlgImgURL : "URL", +DlgImgUpload : "Télécharger", +DlgImgAlt : "Texte de remplacement", +DlgImgWidth : "Largeur", +DlgImgHeight : "Hauteur", +DlgImgLockRatio : "Garder les proportions", +DlgBtnResetSize : "Taille originale", +DlgImgBorder : "Bordure", +DlgImgHSpace : "Espacement horizontal", +DlgImgVSpace : "Espacement vertical", +DlgImgAlign : "Alignement", +DlgImgAlignLeft : "Gauche", +DlgImgAlignAbsBottom: "Abs Bas", +DlgImgAlignAbsMiddle: "Abs Milieu", +DlgImgAlignBaseline : "Bas du texte", +DlgImgAlignBottom : "Bas", +DlgImgAlignMiddle : "Milieu", +DlgImgAlignRight : "Droite", +DlgImgAlignTextTop : "Haut du texte", +DlgImgAlignTop : "Haut", +DlgImgPreview : "Prévisualisation", +DlgImgAlertUrl : "Veuillez saisir l'URL de l'image", +DlgImgLinkTab : "Lien", + +// Flash Dialog +DlgFlashTitle : "Propriétés de l'animation Flash", +DlgFlashChkPlay : "Lecture automatique", +DlgFlashChkLoop : "Boucle", +DlgFlashChkMenu : "Activer le menu Flash", +DlgFlashScale : "Affichage", +DlgFlashScaleAll : "Par défaut (tout montrer)", +DlgFlashScaleNoBorder : "Sans bordure", +DlgFlashScaleFit : "Ajuster aux dimensions", + +// Link Dialog +DlgLnkWindowTitle : "Propriétés du lien", +DlgLnkInfoTab : "Informations sur le lien", +DlgLnkTargetTab : "Destination", + +DlgLnkType : "Type de lien", +DlgLnkTypeURL : "URL", +DlgLnkTypeAnchor : "Ancre dans cette page", +DlgLnkTypeEMail : "E-Mail", +DlgLnkProto : "Protocole", +DlgLnkProtoOther : "", +DlgLnkURL : "URL", +DlgLnkAnchorSel : "Sélectionner une ancre", +DlgLnkAnchorByName : "Par nom", +DlgLnkAnchorById : "Par id", +DlgLnkNoAnchors : "(Pas d'ancre disponible dans le document)", +DlgLnkEMail : "Adresse E-Mail", +DlgLnkEMailSubject : "Sujet du message", +DlgLnkEMailBody : "Corps du message", +DlgLnkUpload : "Télécharger", +DlgLnkBtnUpload : "Envoyer sur le serveur", + +DlgLnkTarget : "Destination", +DlgLnkTargetFrame : "", +DlgLnkTargetPopup : "", +DlgLnkTargetBlank : "Nouvelle fenêtre (_blank)", +DlgLnkTargetParent : "Fenêtre mère (_parent)", +DlgLnkTargetSelf : "Même fenêtre (_self)", +DlgLnkTargetTop : "Fenêtre supérieure (_top)", +DlgLnkTargetFrameName : "Nom du cadre de destination", +DlgLnkPopWinName : "Nom de la fenêtre popup", +DlgLnkPopWinFeat : "Caractéristiques de la fenêtre popup", +DlgLnkPopResize : "Taille modifiable", +DlgLnkPopLocation : "Barre d'adresses", +DlgLnkPopMenu : "Barre de menu", +DlgLnkPopScroll : "Barres de défilement", +DlgLnkPopStatus : "Barre d'état", +DlgLnkPopToolbar : "Barre d'outils", +DlgLnkPopFullScrn : "Plein écran (IE)", +DlgLnkPopDependent : "Dépendante (Netscape)", +DlgLnkPopWidth : "Largeur", +DlgLnkPopHeight : "Hauteur", +DlgLnkPopLeft : "Position à partir de la gauche", +DlgLnkPopTop : "Position à partir du haut", + +DlnLnkMsgNoUrl : "Veuillez saisir l'URL", +DlnLnkMsgNoEMail : "Veuillez saisir l'adresse e-mail", +DlnLnkMsgNoAnchor : "Veuillez sélectionner une ancre", +DlnLnkMsgInvPopName : "Le nom de la fenêtre popup doit commencer par une lettre et ne doit pas contenir d'espace", + +// Color Dialog +DlgColorTitle : "Sélectionner", +DlgColorBtnClear : "Effacer", +DlgColorHighlight : "Prévisualisation", +DlgColorSelected : "Sélectionné", + +// Smiley Dialog +DlgSmileyTitle : "Insérer un Smiley", + +// Special Character Dialog +DlgSpecialCharTitle : "Insérer un caractère spécial", + +// Table Dialog +DlgTableTitle : "Propriétés du tableau", +DlgTableRows : "Lignes", +DlgTableColumns : "Colonnes", +DlgTableBorder : "Bordure", +DlgTableAlign : "Alignement", +DlgTableAlignNotSet : "", +DlgTableAlignLeft : "Gauche", +DlgTableAlignCenter : "Centré", +DlgTableAlignRight : "Droite", +DlgTableWidth : "Largeur", +DlgTableWidthPx : "pixels", +DlgTableWidthPc : "pourcentage", +DlgTableHeight : "Hauteur", +DlgTableCellSpace : "Espacement", +DlgTableCellPad : "Contour", +DlgTableCaption : "Titre", +DlgTableSummary : "Résumé", + +// Table Cell Dialog +DlgCellTitle : "Propriétés de la cellule", +DlgCellWidth : "Largeur", +DlgCellWidthPx : "pixels", +DlgCellWidthPc : "pourcentage", +DlgCellHeight : "Hauteur", +DlgCellWordWrap : "Retour à la ligne", +DlgCellWordWrapNotSet : "", +DlgCellWordWrapYes : "Oui", +DlgCellWordWrapNo : "Non", +DlgCellHorAlign : "Alignement horizontal", +DlgCellHorAlignNotSet : "", +DlgCellHorAlignLeft : "Gauche", +DlgCellHorAlignCenter : "Centré", +DlgCellHorAlignRight: "Droite", +DlgCellVerAlign : "Alignement vertical", +DlgCellVerAlignNotSet : "", +DlgCellVerAlignTop : "Haut", +DlgCellVerAlignMiddle : "Milieu", +DlgCellVerAlignBottom : "Bas", +DlgCellVerAlignBaseline : "Bas du texte", +DlgCellRowSpan : "Lignes fusionnées", +DlgCellCollSpan : "Colonnes fusionnées", +DlgCellBackColor : "Fond", +DlgCellBorderColor : "Bordure", +DlgCellBtnSelect : "Choisir...", + +// Find and Replace Dialog +DlgFindAndReplaceTitle : "Chercher et Remplacer", + +// Find Dialog +DlgFindTitle : "Chercher", +DlgFindFindBtn : "Chercher", +DlgFindNotFoundMsg : "Le texte indiqué est introuvable.", + +// Replace Dialog +DlgReplaceTitle : "Remplacer", +DlgReplaceFindLbl : "Rechercher:", +DlgReplaceReplaceLbl : "Remplacer par:", +DlgReplaceCaseChk : "Respecter la casse", +DlgReplaceReplaceBtn : "Remplacer", +DlgReplaceReplAllBtn : "Tout remplacer", +DlgReplaceWordChk : "Mot entier", + +// Paste Operations / Dialog +PasteErrorCut : "Les paramètres de sécurité de votre navigateur empêchent l'éditeur de couper automatiquement vos données. Veuillez utiliser les équivalents claviers (Ctrl+X).", +PasteErrorCopy : "Les paramètres de sécurité de votre navigateur empêchent l'éditeur de copier automatiquement vos données. Veuillez utiliser les équivalents claviers (Ctrl+C).", + +PasteAsText : "Coller comme texte", +PasteFromWord : "Coller à partir de Word", + +DlgPasteMsg2 : "Veuillez coller dans la zone ci-dessous en utilisant le clavier (Ctrl+V) et cliquez sur OK.", +DlgPasteSec : "A cause des paramètres de sécurité de votre navigateur, l'éditeur ne peut accéder au presse-papier directement. Vous devez coller à nouveau le contenu dans cette fenêtre.", +DlgPasteIgnoreFont : "Ignorer les polices de caractères", +DlgPasteRemoveStyles : "Supprimer les styles", + +// Color Picker +ColorAutomatic : "Automatique", +ColorMoreColors : "Plus de couleurs...", + +// Document Properties +DocProps : "Propriétés du document", + +// Anchor Dialog +DlgAnchorTitle : "Propriétés de l'ancre", +DlgAnchorName : "Nom de l'ancre", +DlgAnchorErrorName : "Veuillez saisir le nom de l'ancre", + +// Speller Pages Dialog +DlgSpellNotInDic : "Pas dans le dictionnaire", +DlgSpellChangeTo : "Changer en", +DlgSpellBtnIgnore : "Ignorer", +DlgSpellBtnIgnoreAll : "Ignorer tout", +DlgSpellBtnReplace : "Remplacer", +DlgSpellBtnReplaceAll : "Remplacer tout", +DlgSpellBtnUndo : "Annuler", +DlgSpellNoSuggestions : "- Aucune suggestion -", +DlgSpellProgress : "Vérification d'orthographe en cours...", +DlgSpellNoMispell : "Vérification d'orthographe terminée: Aucune erreur trouvée", +DlgSpellNoChanges : "Vérification d'orthographe terminée: Pas de modifications", +DlgSpellOneChange : "Vérification d'orthographe terminée: Un mot modifié", +DlgSpellManyChanges : "Vérification d'orthographe terminée: %1 mots modifiés", + +IeSpellDownload : "Le Correcteur n'est pas installé. Souhaitez-vous le télécharger maintenant?", + +// Button Dialog +DlgButtonText : "Texte (valeur)", +DlgButtonType : "Type", +DlgButtonTypeBtn : "Bouton", +DlgButtonTypeSbm : "Envoyer", +DlgButtonTypeRst : "Réinitialiser", + +// Checkbox and Radio Button Dialogs +DlgCheckboxName : "Nom", +DlgCheckboxValue : "Valeur", +DlgCheckboxSelected : "Sélectionné", + +// Form Dialog +DlgFormName : "Nom", +DlgFormAction : "Action", +DlgFormMethod : "Méthode", + +// Select Field Dialog +DlgSelectName : "Nom", +DlgSelectValue : "Valeur", +DlgSelectSize : "Taille", +DlgSelectLines : "lignes", +DlgSelectChkMulti : "Sélection multiple", +DlgSelectOpAvail : "Options disponibles", +DlgSelectOpText : "Texte", +DlgSelectOpValue : "Valeur", +DlgSelectBtnAdd : "Ajouter", +DlgSelectBtnModify : "Modifier", +DlgSelectBtnUp : "Monter", +DlgSelectBtnDown : "Descendre", +DlgSelectBtnSetValue : "Valeur sélectionnée", +DlgSelectBtnDelete : "Supprimer", + +// Textarea Dialog +DlgTextareaName : "Nom", +DlgTextareaCols : "Colonnes", +DlgTextareaRows : "Lignes", + +// Text Field Dialog +DlgTextName : "Nom", +DlgTextValue : "Valeur", +DlgTextCharWidth : "Largeur en caractères", +DlgTextMaxChars : "Nombre maximum de caractères", +DlgTextType : "Type", +DlgTextTypeText : "Texte", +DlgTextTypePass : "Mot de passe", + +// Hidden Field Dialog +DlgHiddenName : "Nom", +DlgHiddenValue : "Valeur", + +// Bulleted List Dialog +BulletedListProp : "Propriétés de liste à puces", +NumberedListProp : "Propriétés de liste numérotée", +DlgLstStart : "Début", +DlgLstType : "Type", +DlgLstTypeCircle : "Cercle", +DlgLstTypeDisc : "Disque", +DlgLstTypeSquare : "Carré", +DlgLstTypeNumbers : "Nombres (1, 2, 3)", +DlgLstTypeLCase : "Lettres minuscules (a, b, c)", +DlgLstTypeUCase : "Lettres majuscules (A, B, C)", +DlgLstTypeSRoman : "Chiffres romains minuscules (i, ii, iii)", +DlgLstTypeLRoman : "Chiffres romains majuscules (I, II, III)", + +// Document Properties Dialog +DlgDocGeneralTab : "Général", +DlgDocBackTab : "Fond", +DlgDocColorsTab : "Couleurs et marges", +DlgDocMetaTab : "Métadonnées", + +DlgDocPageTitle : "Titre de la page", +DlgDocLangDir : "Sens d'écriture", +DlgDocLangDirLTR : "De la gauche vers la droite (LTR)", +DlgDocLangDirRTL : "De la droite vers la gauche (RTL)", +DlgDocLangCode : "Code langue", +DlgDocCharSet : "Encodage de caractère", +DlgDocCharSetCE : "Europe Centrale", +DlgDocCharSetCT : "Chinois Traditionnel (Big5)", +DlgDocCharSetCR : "Cyrillique", +DlgDocCharSetGR : "Grec", +DlgDocCharSetJP : "Japonais", +DlgDocCharSetKR : "Coréen", +DlgDocCharSetTR : "Turc", +DlgDocCharSetUN : "Unicode (UTF-8)", +DlgDocCharSetWE : "Occidental", +DlgDocCharSetOther : "Autre encodage de caractère", + +DlgDocDocType : "Type de document", +DlgDocDocTypeOther : "Autre type de document", +DlgDocIncXHTML : "Inclure les déclarations XHTML", +DlgDocBgColor : "Couleur de fond", +DlgDocBgImage : "Image de fond", +DlgDocBgNoScroll : "Image fixe sans défilement", +DlgDocCText : "Texte", +DlgDocCLink : "Lien", +DlgDocCVisited : "Lien visité", +DlgDocCActive : "Lien activé", +DlgDocMargins : "Marges", +DlgDocMaTop : "Haut", +DlgDocMaLeft : "Gauche", +DlgDocMaRight : "Droite", +DlgDocMaBottom : "Bas", +DlgDocMeIndex : "Mots-clés (séparés par des virgules)", +DlgDocMeDescr : "Description", +DlgDocMeAuthor : "Auteur", +DlgDocMeCopy : "Copyright", +DlgDocPreview : "Prévisualisation", + +// Templates Dialog +Templates : "Modèles", +DlgTemplatesTitle : "Modèles de contenu", +DlgTemplatesSelMsg : "Veuillez sélectionner le modèle à ouvrir dans l'éditeur
        (le contenu actuel sera remplacé):", +DlgTemplatesLoading : "Chargement de la liste des modèles. Veuillez patienter...", +DlgTemplatesNoTpl : "(Aucun modèle disponible)", +DlgTemplatesReplace : "Remplacer tout le contenu", + +// About Dialog +DlgAboutAboutTab : "A propos de", +DlgAboutBrowserInfoTab : "Navigateur", +DlgAboutLicenseTab : "Licence", +DlgAboutVersion : "Version", +DlgAboutInfo : "Pour plus d'informations, aller à" +}; Property changes on: announcement/trunk/src/main/webapp/fckeditor/editor/lang/fr.js ___________________________________________________________________ Name: svn:eol-style + native Added: announcement/trunk/src/main/webapp/fckeditor/editor/lang/gl.js =================================================================== --- announcement/trunk/src/main/webapp/fckeditor/editor/lang/gl.js (rev 0) +++ announcement/trunk/src/main/webapp/fckeditor/editor/lang/gl.js 2008-06-30 02:54:27 UTC (rev 1002) @@ -0,0 +1,515 @@ +?/* + * FCKeditor - The text editor for Internet - http://www.fckeditor.net + * Copyright (C) 2003-2008 Frederico Caldeira Knabben + * + * == BEGIN LICENSE == + * + * Licensed under the terms of any of the following licenses at your + * choice: + * + * - GNU General Public License Version 2 or later (the "GPL") + * http://www.gnu.org/licenses/gpl.html + * + * - GNU Lesser General Public License Version 2.1 or later (the "LGPL") + * http://www.gnu.org/licenses/lgpl.html + * + * - Mozilla Public License Version 1.1 or later (the "MPL") + * http://www.mozilla.org/MPL/MPL-1.1.html + * + * == END LICENSE == + * + * Galician language file. + */ + +var FCKLang = +{ +// Language direction : "ltr" (left to right) or "rtl" (right to left). +Dir : "ltr", + +ToolbarCollapse : "Ocultar Ferramentas", +ToolbarExpand : "Mostrar Ferramentas", + +// Toolbar Items and Context Menu +Save : "Gardar", +NewPage : "Nova Páxina", +Preview : "Vista Previa", +Cut : "Cortar", +Copy : "Copiar", +Paste : "Pegar", +PasteText : "Pegar como texto plano", +PasteWord : "Pegar dende Word", +Print : "Imprimir", +SelectAll : "Seleccionar todo", +RemoveFormat : "Eliminar Formato", +InsertLinkLbl : "Ligazón", +InsertLink : "Inserir/Editar Ligazón", +RemoveLink : "Eliminar Ligazón", +Anchor : "Inserir/Editar Referencia", +AnchorDelete : "Remove Anchor", //MISSING +InsertImageLbl : "Imaxe", +InsertImage : "Inserir/Editar Imaxe", +InsertFlashLbl : "Flash", +InsertFlash : "Inserir/Editar Flash", +InsertTableLbl : "Tabla", +InsertTable : "Inserir/Editar Tabla", +InsertLineLbl : "Liña", +InsertLine : "Inserir Liña Horizontal", +InsertSpecialCharLbl: "Carácter Special", +InsertSpecialChar : "Inserir Carácter Especial", +InsertSmileyLbl : "Smiley", +InsertSmiley : "Inserir Smiley", +About : "Acerca de FCKeditor", +Bold : "Negrita", +Italic : "Cursiva", +Underline : "Sub-raiado", +StrikeThrough : "Tachado", +Subscript : "Subíndice", +Superscript : "Superíndice", +LeftJustify : "Aliñar á Esquerda", +CenterJustify : "Centrado", +RightJustify : "Aliñar á Dereita", +BlockJustify : "Xustificado", +DecreaseIndent : "Disminuir Sangría", +IncreaseIndent : "Aumentar Sangría", +Blockquote : "Blockquote", //MISSING +Undo : "Desfacer", +Redo : "Refacer", +NumberedListLbl : "Lista Numerada", +NumberedList : "Inserir/Eliminar Lista Numerada", +BulletedListLbl : "Marcas", +BulletedList : "Inserir/Eliminar Marcas", +ShowTableBorders : "Mostrar Bordes das Táboas", +ShowDetails : "Mostrar Marcas Parágrafo", +Style : "Estilo", +FontFormat : "Formato", +Font : "Tipo", +FontSize : "Tamaño", +TextColor : "Cor do Texto", +BGColor : "Cor do Fondo", +Source : "Código Fonte", +Find : "Procurar", +Replace : "Substituir", +SpellCheck : "Corrección Ortográfica", +UniversalKeyboard : "Teclado Universal", +PageBreakLbl : "Salto de Páxina", +PageBreak : "Inserir Salto de Páxina", + +Form : "Formulario", +Checkbox : "Cadro de Verificación", +RadioButton : "Botón de Radio", +TextField : "Campo de Texto", +Textarea : "Área de Texto", +HiddenField : "Campo Oculto", +Button : "Botón", +SelectionField : "Campo de Selección", +ImageButton : "Botón de Imaxe", + +FitWindow : "Maximizar o tamaño do editor", +ShowBlocks : "Show Blocks", //MISSING + +// Context Menu +EditLink : "Editar Ligazón", +CellCM : "Cela", +RowCM : "Fila", +ColumnCM : "Columna", +InsertRowAfter : "Insert Row After", //MISSING +InsertRowBefore : "Insert Row Before", //MISSING +DeleteRows : "Borrar Filas", +InsertColumnAfter : "Insert Column After", //MISSING +InsertColumnBefore : "Insert Column Before", //MISSING +DeleteColumns : "Borrar Columnas", +InsertCellAfter : "Insert Cell After", //MISSING +InsertCellBefore : "Insert Cell Before", //MISSING +DeleteCells : "Borrar Cela", +MergeCells : "Unir Celas", +MergeRight : "Merge Right", //MISSING +MergeDown : "Merge Down", //MISSING +HorizontalSplitCell : "Split Cell Horizontally", //MISSING +VerticalSplitCell : "Split Cell Vertically", //MISSING +TableDelete : "Borrar Táboa", +CellProperties : "Propriedades da Cela", +TableProperties : "Propriedades da Táboa", +ImageProperties : "Propriedades Imaxe", +FlashProperties : "Propriedades Flash", + +AnchorProp : "Propriedades da Referencia", +ButtonProp : "Propriedades do Botón", +CheckboxProp : "Propriedades do Cadro de Verificación", +HiddenFieldProp : "Propriedades do Campo Oculto", +RadioButtonProp : "Propriedades do Botón de Radio", +ImageButtonProp : "Propriedades do Botón de Imaxe", +TextFieldProp : "Propriedades do Campo de Texto", +SelectionFieldProp : "Propriedades do Campo de Selección", +TextareaProp : "Propriedades da Área de Texto", +FormProp : "Propriedades do Formulario", + +FontFormats : "Normal;Formateado;Enderezo;Enacabezado 1;Encabezado 2;Encabezado 3;Encabezado 4;Encabezado 5;Encabezado 6;Paragraph (DIV)", + +// Alerts and Messages +ProcessingXHTML : "Procesando XHTML. Por facor, agarde...", +Done : "Feiro", +PasteWordConfirm : "Parece que o texto que quere pegar está copiado do Word.¿Quere limpar o formato antes de pegalo?", +NotCompatiblePaste : "Este comando está disponible para Internet Explorer versión 5.5 ou superior. ¿Quere pegalo sen limpar o formato?", +UnknownToolbarItem : "Ítem de ferramentas descoñecido \"%1\"", +UnknownCommand : "Nome de comando descoñecido \"%1\"", +NotImplemented : "Comando non implementado", +UnknownToolbarSet : "O conxunto de ferramentas \"%1\" non existe", +NoActiveX : "As opcións de seguridade do seu navegador poderían limitar algunha das características de editor. Debe activar a opción \"Executar controis ActiveX e plug-ins\". Pode notar que faltan características e experimentar erros", +BrowseServerBlocked : "Non se poido abrir o navegador de recursos. Asegúrese de que están desactivados os bloqueadores de xanelas emerxentes", +DialogBlocked : "Non foi posible abrir a xanela de diálogo. Asegúrese de que están desactivados os bloqueadores de xanelas emerxentes", + +// Dialogs +DlgBtnOK : "OK", +DlgBtnCancel : "Cancelar", +DlgBtnClose : "Pechar", +DlgBtnBrowseServer : "Navegar no Servidor", +DlgAdvancedTag : "Advanzado", +DlgOpOther : "", +DlgInfoTab : "Info", +DlgAlertUrl : "Por favor, insira a URL", + +// General Dialogs Labels +DlgGenNotSet : "", +DlgGenId : "Id", +DlgGenLangDir : "Orientación do Idioma", +DlgGenLangDirLtr : "Esquerda a Dereita (LTR)", +DlgGenLangDirRtl : "Dereita a Esquerda (RTL)", +DlgGenLangCode : "Código do Idioma", +DlgGenAccessKey : "Chave de Acceso", +DlgGenName : "Nome", +DlgGenTabIndex : "Índice de Tabulación", +DlgGenLongDescr : "Descrición Completa da URL", +DlgGenClass : "Clases da Folla de Estilos", +DlgGenTitle : "Título", +DlgGenContType : "Tipo de Contido", +DlgGenLinkCharset : "Fonte de Caracteres Vinculado", +DlgGenStyle : "Estilo", + +// Image Dialog +DlgImgTitle : "Propriedades da Imaxe", +DlgImgInfoTab : "Información da Imaxe", +DlgImgBtnUpload : "Enviar ó Servidor", +DlgImgURL : "URL", +DlgImgUpload : "Carregar", +DlgImgAlt : "Texto Alternativo", +DlgImgWidth : "Largura", +DlgImgHeight : "Altura", +DlgImgLockRatio : "Proporcional", +DlgBtnResetSize : "Tamaño Orixinal", +DlgImgBorder : "Límite", +DlgImgHSpace : "Esp. Horiz.", +DlgImgVSpace : "Esp. Vert.", +DlgImgAlign : "Aliñamento", +DlgImgAlignLeft : "Esquerda", +DlgImgAlignAbsBottom: "Abs Inferior", +DlgImgAlignAbsMiddle: "Abs Centro", +DlgImgAlignBaseline : "Liña Base", +DlgImgAlignBottom : "Pé", +DlgImgAlignMiddle : "Centro", +DlgImgAlignRight : "Dereita", +DlgImgAlignTextTop : "Tope do Texto", +DlgImgAlignTop : "Tope", +DlgImgPreview : "Vista Previa", +DlgImgAlertUrl : "Por favor, escriba a URL da imaxe", +DlgImgLinkTab : "Ligazón", + +// Flash Dialog +DlgFlashTitle : "Propriedades Flash", +DlgFlashChkPlay : "Auto Execución", +DlgFlashChkLoop : "Bucle", +DlgFlashChkMenu : "Activar Menú Flash", +DlgFlashScale : "Escalar", +DlgFlashScaleAll : "Amosar Todo", +DlgFlashScaleNoBorder : "Sen Borde", +DlgFlashScaleFit : "Encaixar axustando", + +// Link Dialog +DlgLnkWindowTitle : "Ligazón", +DlgLnkInfoTab : "Información da Ligazón", +DlgLnkTargetTab : "Referencia a esta páxina", + +DlgLnkType : "Tipo de Ligazón", +DlgLnkTypeURL : "URL", +DlgLnkTypeAnchor : "Referencia nesta páxina", +DlgLnkTypeEMail : "E-Mail", +DlgLnkProto : "Protocolo", +DlgLnkProtoOther : "", +DlgLnkURL : "URL", +DlgLnkAnchorSel : "Seleccionar unha Referencia", +DlgLnkAnchorByName : "Por Nome de Referencia", +DlgLnkAnchorById : "Por Element Id", +DlgLnkNoAnchors : "(Non hai referencias disponibles no documento)", +DlgLnkEMail : "Enderezo de E-Mail", +DlgLnkEMailSubject : "Asunto do Mensaxe", +DlgLnkEMailBody : "Corpo do Mensaxe", +DlgLnkUpload : "Carregar", +DlgLnkBtnUpload : "Enviar ó servidor", + +DlgLnkTarget : "Destino", +DlgLnkTargetFrame : "", +DlgLnkTargetPopup : "", +DlgLnkTargetBlank : "Nova Xanela (_blank)", +DlgLnkTargetParent : "Xanela Pai (_parent)", +DlgLnkTargetSelf : "Mesma Xanela (_self)", +DlgLnkTargetTop : "Xanela Primaria (_top)", +DlgLnkTargetFrameName : "Nome do Marco Destino", +DlgLnkPopWinName : "Nome da Xanela Emerxente", +DlgLnkPopWinFeat : "Características da Xanela Emerxente", +DlgLnkPopResize : "Axustable", +DlgLnkPopLocation : "Barra de Localización", +DlgLnkPopMenu : "Barra de Menú", +DlgLnkPopScroll : "Barras de Desplazamento", +DlgLnkPopStatus : "Barra de Estado", +DlgLnkPopToolbar : "Barra de Ferramentas", +DlgLnkPopFullScrn : "A Toda Pantalla (IE)", +DlgLnkPopDependent : "Dependente (Netscape)", +DlgLnkPopWidth : "Largura", +DlgLnkPopHeight : "Altura", +DlgLnkPopLeft : "Posición Esquerda", +DlgLnkPopTop : "Posición dende Arriba", + +DlnLnkMsgNoUrl : "Por favor, escriba a ligazón URL", +DlnLnkMsgNoEMail : "Por favor, escriba o enderezo de e-mail", +DlnLnkMsgNoAnchor : "Por favor, seleccione un destino", +DlnLnkMsgInvPopName : "The popup name must begin with an alphabetic character and must not contain spaces", //MISSING + +// Color Dialog +DlgColorTitle : "Seleccionar Color", +DlgColorBtnClear : "Nengunha", +DlgColorHighlight : "Destacado", +DlgColorSelected : "Seleccionado", + +// Smiley Dialog +DlgSmileyTitle : "Inserte un Smiley", + +// Special Character Dialog +DlgSpecialCharTitle : "Seleccione Caracter Especial", + +// Table Dialog +DlgTableTitle : "Propiedades da Táboa", +DlgTableRows : "Filas", +DlgTableColumns : "Columnas", +DlgTableBorder : "Tamaño do Borde", +DlgTableAlign : "Aliñamento", +DlgTableAlignNotSet : "", +DlgTableAlignLeft : "Esquerda", +DlgTableAlignCenter : "Centro", +DlgTableAlignRight : "Ereita", +DlgTableWidth : "Largura", +DlgTableWidthPx : "pixels", +DlgTableWidthPc : "percent", +DlgTableHeight : "Altura", +DlgTableCellSpace : "Marxe entre Celas", +DlgTableCellPad : "Marxe interior", +DlgTableCaption : "Título", +DlgTableSummary : "Sumario", + +// Table Cell Dialog +DlgCellTitle : "Propriedades da Cela", +DlgCellWidth : "Largura", +DlgCellWidthPx : "pixels", +DlgCellWidthPc : "percent", +DlgCellHeight : "Altura", +DlgCellWordWrap : "Axustar Liñas", +DlgCellWordWrapNotSet : "", +DlgCellWordWrapYes : "Si", +DlgCellWordWrapNo : "Non", +DlgCellHorAlign : "Aliñamento Horizontal", +DlgCellHorAlignNotSet : "", +DlgCellHorAlignLeft : "Esquerda", +DlgCellHorAlignCenter : "Centro", +DlgCellHorAlignRight: "Dereita", +DlgCellVerAlign : "Aliñamento Vertical", +DlgCellVerAlignNotSet : "", +DlgCellVerAlignTop : "Arriba", +DlgCellVerAlignMiddle : "Medio", +DlgCellVerAlignBottom : "Abaixo", +DlgCellVerAlignBaseline : "Liña de Base", +DlgCellRowSpan : "Ocupar Filas", +DlgCellCollSpan : "Ocupar Columnas", +DlgCellBackColor : "Color de Fondo", +DlgCellBorderColor : "Color de Borde", +DlgCellBtnSelect : "Seleccionar...", + +// Find and Replace Dialog +DlgFindAndReplaceTitle : "Find and Replace", //MISSING + +// Find Dialog +DlgFindTitle : "Procurar", +DlgFindFindBtn : "Procurar", +DlgFindNotFoundMsg : "Non te atopou o texto indicado.", + +// Replace Dialog +DlgReplaceTitle : "Substituir", +DlgReplaceFindLbl : "Texto a procurar:", +DlgReplaceReplaceLbl : "Substituir con:", +DlgReplaceCaseChk : "Coincidir Mai./min.", +DlgReplaceReplaceBtn : "Substituir", +DlgReplaceReplAllBtn : "Substitiur Todo", +DlgReplaceWordChk : "Coincidir con toda a palabra", + +// Paste Operations / Dialog +PasteErrorCut : "Os axustes de seguridade do seu navegador non permiten que o editor realice automáticamente as tarefas de corte. Por favor, use o teclado para iso (Ctrl+X).", +PasteErrorCopy : "Os axustes de seguridade do seu navegador non permiten que o editor realice automáticamente as tarefas de copia. Por favor, use o teclado para iso (Ctrl+C).", + +PasteAsText : "Pegar como texto plano", +PasteFromWord : "Pegar dende Word", + +DlgPasteMsg2 : "Por favor, pegue dentro do seguinte cadro usando o teclado (Ctrl+V) e pulse OK.", +DlgPasteSec : "Because of your browser security settings, the editor is not able to access your clipboard data directly. You are required to paste it again in this window.", //MISSING +DlgPasteIgnoreFont : "Ignorar as definicións de Tipografía", +DlgPasteRemoveStyles : "Eliminar as definicións de Estilos", + +// Color Picker +ColorAutomatic : "Automático", +ColorMoreColors : "Máis Cores...", + +// Document Properties +DocProps : "Propriedades do Documento", + +// Anchor Dialog +DlgAnchorTitle : "Propriedades da Referencia", +DlgAnchorName : "Nome da Referencia", +DlgAnchorErrorName : "Por favor, escriba o nome da referencia", + +// Speller Pages Dialog +DlgSpellNotInDic : "Non está no diccionario", +DlgSpellChangeTo : "Cambiar a", +DlgSpellBtnIgnore : "Ignorar", +DlgSpellBtnIgnoreAll : "Ignorar Todas", +DlgSpellBtnReplace : "Substituir", +DlgSpellBtnReplaceAll : "Substituir Todas", +DlgSpellBtnUndo : "Desfacer", +DlgSpellNoSuggestions : "- Sen candidatos -", +DlgSpellProgress : "Corrección ortográfica en progreso...", +DlgSpellNoMispell : "Corrección ortográfica rematada: Non se atoparon erros", +DlgSpellNoChanges : "Corrección ortográfica rematada: Non se substituiu nengunha verba", +DlgSpellOneChange : "Corrección ortográfica rematada: Unha verba substituida", +DlgSpellManyChanges : "Corrección ortográfica rematada: %1 verbas substituidas", + +IeSpellDownload : "O corrector ortográfico non está instalado. ¿Quere descargalo agora?", + +// Button Dialog +DlgButtonText : "Texto (Valor)", +DlgButtonType : "Tipo", +DlgButtonTypeBtn : "Button", //MISSING +DlgButtonTypeSbm : "Submit", //MISSING +DlgButtonTypeRst : "Reset", //MISSING + +// Checkbox and Radio Button Dialogs +DlgCheckboxName : "Nome", +DlgCheckboxValue : "Valor", +DlgCheckboxSelected : "Seleccionado", + +// Form Dialog +DlgFormName : "Nome", +DlgFormAction : "Acción", +DlgFormMethod : "Método", + +// Select Field Dialog +DlgSelectName : "Nome", +DlgSelectValue : "Valor", +DlgSelectSize : "Tamaño", +DlgSelectLines : "liñas", +DlgSelectChkMulti : "Permitir múltiples seleccións", +DlgSelectOpAvail : "Opcións Disponibles", +DlgSelectOpText : "Texto", +DlgSelectOpValue : "Valor", +DlgSelectBtnAdd : "Engadir", +DlgSelectBtnModify : "Modificar", +DlgSelectBtnUp : "Subir", +DlgSelectBtnDown : "Baixar", +DlgSelectBtnSetValue : "Definir como valor por defecto", +DlgSelectBtnDelete : "Borrar", + +// Textarea Dialog +DlgTextareaName : "Nome", +DlgTextareaCols : "Columnas", +DlgTextareaRows : "Filas", + +// Text Field Dialog +DlgTextName : "Nome", +DlgTextValue : "Valor", +DlgTextCharWidth : "Tamaño do Caracter", +DlgTextMaxChars : "Máximo de Caracteres", +DlgTextType : "Tipo", +DlgTextTypeText : "Texto", +DlgTextTypePass : "Chave", + +// Hidden Field Dialog +DlgHiddenName : "Nome", +DlgHiddenValue : "Valor", + +// Bulleted List Dialog +BulletedListProp : "Propriedades das Marcas", +NumberedListProp : "Propriedades da Lista de Numeración", +DlgLstStart : "Start", //MISSING +DlgLstType : "Tipo", +DlgLstTypeCircle : "Círculo", +DlgLstTypeDisc : "Disco", +DlgLstTypeSquare : "Cuadrado", +DlgLstTypeNumbers : "Números (1, 2, 3)", +DlgLstTypeLCase : "Letras Minúsculas (a, b, c)", +DlgLstTypeUCase : "Letras Maiúsculas (A, B, C)", +DlgLstTypeSRoman : "Números Romanos en minúscula (i, ii, iii)", +DlgLstTypeLRoman : "Números Romanos en Maiúscula (I, II, III)", + +// Document Properties Dialog +DlgDocGeneralTab : "Xeral", +DlgDocBackTab : "Fondo", +DlgDocColorsTab : "Cores e Marxes", +DlgDocMetaTab : "Meta Data", + +DlgDocPageTitle : "Título da Páxina", +DlgDocLangDir : "Orientación do Idioma", +DlgDocLangDirLTR : "Esquerda a Dereita (LTR)", +DlgDocLangDirRTL : "Dereita a Esquerda (RTL)", +DlgDocLangCode : "Código de Idioma", +DlgDocCharSet : "Codificación do Xogo de Caracteres", +DlgDocCharSetCE : "Central European", //MISSING +DlgDocCharSetCT : "Chinese Traditional (Big5)", //MISSING +DlgDocCharSetCR : "Cyrillic", //MISSING +DlgDocCharSetGR : "Greek", //MISSING +DlgDocCharSetJP : "Japanese", //MISSING +DlgDocCharSetKR : "Korean", //MISSING +DlgDocCharSetTR : "Turkish", //MISSING +DlgDocCharSetUN : "Unicode (UTF-8)", //MISSING +DlgDocCharSetWE : "Western European", //MISSING +DlgDocCharSetOther : "Outra Codificación do Xogo de Caracteres", + +DlgDocDocType : "Encabezado do Tipo de Documento", +DlgDocDocTypeOther : "Outro Encabezado do Tipo de Documento", +DlgDocIncXHTML : "Incluir Declaracións XHTML", +DlgDocBgColor : "Cor de Fondo", +DlgDocBgImage : "URL da Imaxe de Fondo", +DlgDocBgNoScroll : "Fondo Fixo", +DlgDocCText : "Texto", +DlgDocCLink : "Ligazóns", +DlgDocCVisited : "Ligazón Visitada", +DlgDocCActive : "Ligazón Activa", +DlgDocMargins : "Marxes da Páxina", +DlgDocMaTop : "Arriba", +DlgDocMaLeft : "Esquerda", +DlgDocMaRight : "Dereita", +DlgDocMaBottom : "Abaixo", +DlgDocMeIndex : "Palabras Chave de Indexación do Documento (separadas por comas)", +DlgDocMeDescr : "Descripción do Documento", +DlgDocMeAuthor : "Autor", +DlgDocMeCopy : "Copyright", +DlgDocPreview : "Vista Previa", + +// Templates Dialog +Templates : "Plantillas", +DlgTemplatesTitle : "Plantillas de Contido", +DlgTemplatesSelMsg : "Por favor, seleccione a plantilla a abrir no editor
        (o contido actual perderase):", +DlgTemplatesLoading : "Cargando listado de plantillas. Por favor, espere...", +DlgTemplatesNoTpl : "(Non hai plantillas definidas)", +DlgTemplatesReplace : "Replace actual contents", //MISSING + +// About Dialog +DlgAboutAboutTab : "Acerca de", +DlgAboutBrowserInfoTab : "Información do Navegador", +DlgAboutLicenseTab : "Licencia", +DlgAboutVersion : "versión", +DlgAboutInfo : "Para máis información visitar:" +}; Property changes on: announcement/trunk/src/main/webapp/fckeditor/editor/lang/gl.js ___________________________________________________________________ Name: svn:eol-style + native Added: announcement/trunk/src/main/webapp/fckeditor/editor/lang/gu.js =================================================================== --- announcement/trunk/src/main/webapp/fckeditor/editor/lang/gu.js (rev 0) +++ announcement/trunk/src/main/webapp/fckeditor/editor/lang/gu.js 2008-06-30 02:54:27 UTC (rev 1002) @@ -0,0 +1,515 @@ +?/* + * FCKeditor - The text editor for Internet - http://www.fckeditor.net + * Copyright (C) 2003-2008 Frederico Caldeira Knabben + * + * == BEGIN LICENSE == + * + * Licensed under the terms of any of the following licenses at your + * choice: + * + * - GNU General Public License Version 2 or later (the "GPL") + * http://www.gnu.org/licenses/gpl.html + * + * - GNU Lesser General Public License Version 2.1 or later (the "LGPL") + * http://www.gnu.org/licenses/lgpl.html + * + * - Mozilla Public License Version 1.1 or later (the "MPL") + * http://www.mozilla.org/MPL/MPL-1.1.html + * + * == END LICENSE == + * + * Gujarati language file. + */ + +var FCKLang = +{ +// Language direction : "ltr" (left to right) or "rtl" (right to left). +Dir : "ltr", + +ToolbarCollapse : "?????? ????? ?????", +ToolbarExpand : "?????? ????? ?????", + +// Toolbar Items and Context Menu +Save : "???", +NewPage : "??? ?????", +Preview : "??????????", +Cut : "??????", +Copy : "???", +Paste : "?????", +PasteText : "????? (???? ???????)", +PasteWord : "????? (??? ???????)", +Print : "???????", +SelectAll : "???? ???? ?????", +RemoveFormat : "?????? ??????", +InsertLinkLbl : "??????, ????", +InsertLink : "???? ???????/???? ????", +RemoveLink : "???? ?????", +Anchor : "???? ???????/???? ????", +AnchorDelete : "???? ?????", +InsertImageLbl : "?????", +InsertImage : "????? ???????/???? ?????", +InsertFlashLbl : "?????", +InsertFlash : "????? ???????/???? ?????", +InsertTableLbl : "????, ????", +InsertTable : "????, ???? ???????/???? ?????", +InsertLineLbl : "????", +InsertLine : "???????? ???? ???????/???? ????", +InsertSpecialCharLbl: "??????? ?????", +InsertSpecialChar : "??????? ????? ???????/???? ?????", +InsertSmileyLbl : "???????", +InsertSmiley : "??????? ???????/???? ????", +About : "FCKeditor?? ????", +Bold : "?????/??????", +Italic : "??????, ???????", +Underline : "??????????, ???? ????", +StrikeThrough : "???? ??????", +Subscript : "?? ??????? ???? ?????? ????? ?????", +Superscript : "?? ????? ??? ?????? ????? ?????.", +LeftJustify : "???? ?????/???? ???", +CenterJustify : "?????????/????????", +RightJustify : "???? ?????/???? ???", +BlockJustify : "?????, ?????? ????????", +DecreaseIndent : "???????? ?????? ??????? ????? ??????", +IncreaseIndent : "????????, ?????? ??????? ????? ??????", +Blockquote : "?????-???, ???????????", +Undo : "?? ?????; ?????? ??? ??? ?????? ???? ?????", +Redo : "????; ??? ??? ??? ?????? ???? ?????", +NumberedListLbl : "????????? ????", +NumberedList : "????????? ???? ???????/???? ????", +BulletedListLbl : "????? ????", +BulletedList : "????? ???? ???????/???? ????", +ShowTableBorders : "????, ?????? ????(??????) ??????", +ShowDetails : "??????? ??????? ???????", +Style : "????/???", +FontFormat : "????? ??????, ?????? ????", +Font : "?????", +FontSize : "????? ????/??", +TextColor : "?????? ???", +BGColor : "??????????? ???,", +Source : "??? ?? ???????? ????????", +Find : "??????", +Replace : "???????/??????", +SpellCheck : "????? (????????) ??????", +UniversalKeyboard : "?????????/??????????? ???????", +PageBreakLbl : "????????/?????? ??? ?????", +PageBreak : "??????? ????????/?????? ??? ?????/???? ?????", + +Form : "?????/?????", +Checkbox : "??? ?????", +RadioButton : "????? ???", +TextField : "??????? ?????, ???? ???????", +Textarea : "??????? ????, ???? ???????", +HiddenField : "????? ???????", +Button : "???", +SelectionField : "?????? ???????", +ImageButton : "????? ???", + +FitWindow : "??????? ???? ?????? ????", +ShowBlocks : "????? ???????", + +// Context Menu +EditLink : " ???? ????/??? ?????? ????", +CellCM : "????? ????", +RowCM : "???????? ????", +ColumnCM : "????/??? ????", +InsertRowAfter : "??? ?????? ??????", +InsertRowBefore : "?????? ?????? ??????", +DeleteRows : "??????? ?????/???? ?????", +InsertColumnAfter : "??? ????/??? ???? ??????", +InsertColumnBefore : "?????? ????/??? ???? ??????", +DeleteColumns : "????/??? ???? ?????/???? ?????", +InsertCellAfter : "??? ??? ??????", +InsertCellBefore : "?????? ??? ??????", +DeleteCells : "??? ?????/???? ?????", +MergeCells : "??? ???? ????", +MergeRight : "???? ???? ???? ????", +MergeDown : "???? ???? ????", +HorizontalSplitCell : "????? ???????? ?????? ?????", +VerticalSplitCell : "????? ????? ?? ???? ?????? ?????", +TableDelete : "???? ?????/???? ??????", +CellProperties : "????? ???", +TableProperties : "?????? ???", +ImageProperties : "??????? ???", +FlashProperties : "??????? ???", + +AnchorProp : "?????? ???", +ButtonProp : "????? ???", +CheckboxProp : "??? ????? ???", +HiddenFieldProp : "????? ????????? ???", +RadioButtonProp : "????? ????? ???", +ImageButtonProp : "????? ????? ???", +TextFieldProp : "??????? ?????, ???? ????????? ???", +SelectionFieldProp : "?????? ????????? ???", +TextareaProp : "??????? ?????, ???? ????????? ???", +FormProp : "?????/??????? ???", + +FontFormats : "???????;????????;???????;?????? 1;?????? 2;?????? 3;?????? 4;?????? 5;?????? 6;?????? (DIV)", + +// Alerts and Messages +ProcessingXHTML : "XHTML ????????? ???? ??. ???????? ????? ??? ????...", +Done : "??? ????", +PasteWordConfirm : "??? ?? ??????? ????? ???? ????? ??, ?? ???????? ???? ????? ???? ??. ????? ???? ?????? ??????? ??? ???? ???", +NotCompatiblePaste : "? ?????? ??????? ??????????(Internet Explorer) 5.5 ???? ??? ????? ????? ????? ??. ????????? ??? ???? ?????? ????? ???? ???", +UnknownToolbarItem : "????? ?????? ???? \"%1\"", +UnknownCommand : "?????? ?????? \"%1\"", +NotImplemented : "?????? ??????????? ??? ?????", +UnknownToolbarSet : "?????? ??? \"%1\" ?????? ???", +NoActiveX : "????? ????????? ??????? ??????? ??????? ???? ?????? ??????? ???? ???. ????? \"Run ActiveX controls and plug-ins\" ???????? ?????/????? ???. ????? ?????????? ??? ????????? ?????? ????? ?? ??? ??. ????? ???-?? ?????? ?????? ???.", +BrowseServerBlocked : "??????? ??????? ???? ? ??????.", +DialogBlocked : "?????? ?????? ???? ? ??????. ????? ???-?? ?????? ?????? ???.", + +// Dialogs +DlgBtnOK : "??? ??", +DlgBtnCancel : "?? ?????", +DlgBtnClose : "??? ?????", +DlgBtnBrowseServer : "????? ?????? ???", +DlgAdvancedTag : "?????????", +DlgOpOther : "", +DlgInfoTab : "?????", +DlgAlertUrl : "URL ??????? ???", + +// General Dialogs Labels +DlgGenNotSet : "", +DlgGenId : "Id", +DlgGenLangDir : "???? ??????? ??????", +DlgGenLangDirLtr : "???? ?? ???? (LTR)", +DlgGenLangDirRtl : "???? ?? ???? (RTL)", +DlgGenLangCode : "???? ???", +DlgGenAccessKey : "?????? ??", +DlgGenName : "???", +DlgGenTabIndex : "??? ????????", +DlgGenLongDescr : "????? ?????? ???? URL", +DlgGenClass : "??????-??? ?????", +DlgGenTitle : "????? ??????", +DlgGenContType : "????? ???????? ??????", +DlgGenLinkCharset : "???? ??????? ???????? ???", +DlgGenStyle : "??????", + +// Image Dialog +DlgImgTitle : "??????? ???", +DlgImgInfoTab : "????? ?? ???????", +DlgImgBtnUpload : "? ??????? ???????", +DlgImgURL : "URL", +DlgImgUpload : "?????", +DlgImgAlt : "???????? ???????", +DlgImgWidth : "??????", +DlgImgHeight : "?????", +DlgImgLockRatio : "??? ????????", +DlgBtnResetSize : "????? ????", +DlgImgBorder : "??????", +DlgImgHSpace : "???????? ?????", +DlgImgVSpace : "?????? ?????", +DlgImgAlign : "??????????? ???????", +DlgImgAlignLeft : "???? ???? ???????", +DlgImgAlignAbsBottom: "Abs ????", +DlgImgAlignAbsMiddle: "Abs ???", +DlgImgAlignBaseline : "???? ????", +DlgImgAlignBottom : "????", +DlgImgAlignMiddle : "?????", +DlgImgAlignRight : "????", +DlgImgAlignTextTop : "??????? ???", +DlgImgAlignTop : "???", +DlgImgPreview : "??????????", +DlgImgAlertUrl : "??????? URL ???? ???", +DlgImgLinkTab : "????", + +// Flash Dialog +DlgFlashTitle : "????? ???", +DlgFlashChkPlay : "???/????? ????", +DlgFlashChkLoop : "???", +DlgFlashChkMenu : "????? ?????? ?? ?????? ???", +DlgFlashScale : "?????", +DlgFlashScaleAll : "????? ??/??? ?????", +DlgFlashScaleNoBorder : "????? ?????? ???", +DlgFlashScaleFit : "????? ???? ???", + +// Link Dialog +DlgLnkWindowTitle : "????", +DlgLnkInfoTab : "???? ????? ???", +DlgLnkTargetTab : "???????/?????? ???", + +DlgLnkType : "???? ??????", +DlgLnkTypeURL : "URL", +DlgLnkTypeAnchor : "? ????? ????", +DlgLnkTypeEMail : "?-???", +DlgLnkProto : "?????????", +DlgLnkProtoOther : "", +DlgLnkURL : "URL", +DlgLnkAnchorSel : "???? ???? ???", +DlgLnkAnchorByName : "???? ????? ???? ???", +DlgLnkAnchorById : "???? ??????? Id ?? ???? ???", +DlgLnkNoAnchors : "(????????????? ?????? ??????)", +DlgLnkEMail : "?-??? ???????", +DlgLnkEMailSubject : "?-??? ????", +DlgLnkEMailBody : "?????", +DlgLnkUpload : "?????", +DlgLnkBtnUpload : "? ??????? ???????", + +DlgLnkTarget : "???????/??????", +DlgLnkTargetFrame : "", +DlgLnkTargetPopup : "", +DlgLnkTargetBlank : "??? ?????? (_blank)", +DlgLnkTargetParent : "??? ?????? (_parent)", +DlgLnkTargetSelf : "?? ?????? (_self)", +DlgLnkTargetTop : "????? ?????? (_top)", +DlgLnkTargetFrameName : "??????? ????? ??? ???", +DlgLnkPopWinName : "???-?? ?????? ??? ???", +DlgLnkPopWinFeat : "???-?? ?????? ??????", +DlgLnkPopResize : "???? ???? ???? ??", +DlgLnkPopLocation : "?????? ???", +DlgLnkPopMenu : "?????? ???", +DlgLnkPopScroll : "??????? ???", +DlgLnkPopStatus : "?????? ???", +DlgLnkPopToolbar : "??? ???", +DlgLnkPopFullScrn : "??? ??????? (IE)", +DlgLnkPopDependent : "?????????? (Netscape)", +DlgLnkPopWidth : "??????", +DlgLnkPopHeight : "?????", +DlgLnkPopLeft : "???? ????", +DlgLnkPopTop : "???? ????", + +DlnLnkMsgNoUrl : "???? URL ???? ???", +DlnLnkMsgNoEMail : "?-??? ??????? ???? ???", +DlnLnkMsgNoAnchor : "???? ???? ???", +DlnLnkMsgInvPopName : "???-?? ?????? ??? ??? ????????? ??? ???? ??? ????? ?????? ? ???? ????", + +// Color Dialog +DlgColorTitle : "??? ???? ???", +DlgColorBtnClear : "??? ???", +DlgColorHighlight : "???????", +DlgColorSelected : "?????????/???? ?????", + +// Smiley Dialog +DlgSmileyTitle : "??????? ???? ???", + +// Special Character Dialog +DlgSpecialCharTitle : "???????? ??????? ????? ???? ???", + +// Table Dialog +DlgTableTitle : "????, ??????? ??????", +DlgTableRows : "???????? ????", +DlgTableColumns : "????/??? ????", +DlgTableBorder : "?????? ????(??????) ????", +DlgTableAlign : "?????????/?????????? ", +DlgTableAlignNotSet : "", +DlgTableAlignLeft : "???? ????", +DlgTableAlignCenter : "???? ??????", +DlgTableAlignRight : "???? ????", +DlgTableWidth : "??????", +DlgTableWidthPx : "?????", +DlgTableWidthPc : "???????", +DlgTableHeight : "?????", +DlgTableCellSpace : "??? ????", +DlgTableCellPad : "??? ??????", +DlgTableCaption : "??????/?????? ", +DlgTableSummary : "????? ??????", + +// Table Cell Dialog +DlgCellTitle : "???????? ?????? ???", +DlgCellWidth : "??????", +DlgCellWidthPx : "?????", +DlgCellWidthPc : "???????", +DlgCellHeight : "?????", +DlgCellWordWrap : "???? ???", +DlgCellWordWrapNotSet : "", +DlgCellWordWrapYes : "??", +DlgCellWordWrapNo : "??", +DlgCellHorAlign : "???????? ???????", +DlgCellHorAlignNotSet : "", +DlgCellHorAlignLeft : "???? ????", +DlgCellHorAlignCenter : "???? ??????", +DlgCellHorAlignRight: "???? ????", +DlgCellVerAlign : "?????? ???????", +DlgCellVerAlignNotSet : "", +DlgCellVerAlignTop : "???", +DlgCellVerAlignMiddle : "???? ??????", +DlgCellVerAlignBottom : "????", +DlgCellVerAlignBaseline : "??? ????", +DlgCellRowSpan : "?????? ?????", +DlgCellCollSpan : "????/??? ???? ?????", +DlgCellBackColor : "??????????? ???", +DlgCellBorderColor : "???????? ???", +DlgCellBtnSelect : "???? ???...", + +// Find and Replace Dialog +DlgFindAndReplaceTitle : "?????? ??? ??????", + +// Find Dialog +DlgFindTitle : "??????", +DlgFindFindBtn : "??????", +DlgFindNotFoundMsg : "??? ?????? ??????? ??? ???", + +// Replace Dialog +DlgReplaceTitle : "??????", +DlgReplaceFindLbl : "? ????", +DlgReplaceReplaceLbl : "????? ????", +DlgReplaceCaseChk : "??? ???? ????", +DlgReplaceReplaceBtn : "??????", +DlgReplaceReplAllBtn : "??? ???? ", +DlgReplaceWordChk : "??? ???? ???? ????", + +// Paste Operations / Dialog +PasteErrorCut : "????? ??????? ?? ???????? ??????? ?? ?????? ??????? ??? ????. (Ctrl+X) ?? ????? ???.", +PasteErrorCopy : "????? ??????? ?? ???????? ??????? ???? ?????? ??????? ??? ????. (Ctrl+C) ?? ?????? ?????", + +PasteAsText : "????? (???????)", +PasteFromWord : "????? (???? ??)", + +DlgPasteMsg2 : "Ctrl+V ?? ?????? ??? ????? ???", +DlgPasteSec : "????? ??????? ?? ???????? ????????? ?????,????? ????? ?????????? ???? ?? ???? ??? ??? ????. ????? ? ????????? ????? ????? ????? ????.", +DlgPasteIgnoreFont : "???????? ?????????? ??????", +DlgPasteRemoveStyles : "?????? ???????? ???? ?????", + +// Color Picker +ColorAutomatic : "????????", +ColorMoreColors : "?? ???...", + +// Document Properties +DocProps : "?????????? ???/??????????", + +// Anchor Dialog +DlgAnchorTitle : "???? ???/??????????", +DlgAnchorName : "??????? ???", +DlgAnchorErrorName : "??????? ??? ???? ???", + +// Speller Pages Dialog +DlgSpellNotInDic : "?????????? ???", +DlgSpellChangeTo : "????? ??????", +DlgSpellBtnIgnore : "??????/?????? ????", +DlgSpellBtnIgnoreAll : "????? ??????/?????? ????", +DlgSpellBtnReplace : "??????", +DlgSpellBtnReplaceAll : "??? ???? ???", +DlgSpellBtnUndo : "?????", +DlgSpellNoSuggestions : "- ?? ????? ??? -", +DlgSpellProgress : "?????? ?????/????? ??? ???? ??...", +DlgSpellNoMispell : "?????? ?????/????? ??? ?????: ???? ????? ??? ???", +DlgSpellNoChanges : "?????? ?????/????? ??? ?????: ???? ???? ????? ???", +DlgSpellOneChange : "?????? ?????/????? ??? ?????: ?? ???? ????? ??", +DlgSpellManyChanges : "?????? ?????/????? ??? ?????: %1 ???? ????? ??", + +IeSpellDownload : "?????-???? ???????? ???. ??? ??? ??????? ???? ????? ???", + +// Button Dialog +DlgButtonText : "??????? (??????)", +DlgButtonType : "??????", +DlgButtonTypeBtn : "???", +DlgButtonTypeSbm : "??????", +DlgButtonTypeRst : "?????", + +// Checkbox and Radio Button Dialogs +DlgCheckboxName : "???", +DlgCheckboxValue : "??????", +DlgCheckboxSelected : "?????????", + +// Form Dialog +DlgFormName : "???", +DlgFormAction : "??????", +DlgFormMethod : "??????", + +// Select Field Dialog +DlgSelectName : "???", +DlgSelectValue : "??????", +DlgSelectSize : "????", +DlgSelectLines : "?????", +DlgSelectChkMulti : "???? ????? ???? ??? ???", +DlgSelectOpAvail : "?????? ??????", +DlgSelectOpText : "???????", +DlgSelectOpValue : "??????", +DlgSelectBtnAdd : "???????", +DlgSelectBtnModify : "??????", +DlgSelectBtnUp : "???", +DlgSelectBtnDown : "????", +DlgSelectBtnSetValue : "???? ???? ?????? ??? ???", +DlgSelectBtnDelete : "?? ?????", + +// Textarea Dialog +DlgTextareaName : "???", +DlgTextareaCols : "????/??? ????", +DlgTextareaRows : "???????", + +// Text Field Dialog +DlgTextName : "???", +DlgTextValue : "??????", +DlgTextCharWidth : "?????????? ??????", +DlgTextMaxChars : "?????? ????????", +DlgTextType : "????", +DlgTextTypeText : "???????", +DlgTextTypePass : "???????", + +// Hidden Field Dialog +DlgHiddenName : "???", +DlgHiddenValue : "??????", + +// Bulleted List Dialog +BulletedListProp : "????? ???? ???", +NumberedListProp : "??????????? ???? ???", +DlgLstStart : "???????", +DlgLstType : "??????", +DlgLstTypeCircle : "??????", +DlgLstTypeDisc : "?????", +DlgLstTypeSquare : "????", +DlgLstTypeNumbers : "?????? (1, 2, 3)", +DlgLstTypeLCase : "???? ????? (a, b, c)", +DlgLstTypeUCase : "???? ????? (A, B, C)", +DlgLstTypeSRoman : "???? ???? ??? (i, ii, iii)", +DlgLstTypeLRoman : "???? ???? ??? (I, II, III)", + +// Document Properties Dialog +DlgDocGeneralTab : "??????", +DlgDocBackTab : "???????????", +DlgDocColorsTab : "??? ??? ???????/?????", +DlgDocMetaTab : "????????", + +DlgDocPageTitle : "??? ??????/?????", +DlgDocLangDir : "???? ??????? ??????", +DlgDocLangDirLTR : "???? ?? ???? (LTR)", +DlgDocLangDirRTL : "???? ?? ???? (RTL)", +DlgDocLangCode : "???? ???", +DlgDocCharSet : "???????? ??? ?????????", +DlgDocCharSetCE : "???? ???????? (Central European)", +DlgDocCharSetCT : "?????? (Chinese Traditional Big5)", +DlgDocCharSetCR : "??????? (Cyrillic)", +DlgDocCharSetGR : "????? (Greek)", +DlgDocCharSetJP : "??????? (Japanese)", +DlgDocCharSetKR : "?????? (Korean)", +DlgDocCharSetTR : "????? (Turkish)", +DlgDocCharSetUN : "??????? (UTF-8)", +DlgDocCharSetWE : "?????? ???????? (Western European)", +DlgDocCharSetOther : "???? ???????? ??? ?????????", + +DlgDocDocType : "?????????? ?????? ??????", +DlgDocDocTypeOther : "???? ?????????? ?????? ??????", +DlgDocIncXHTML : "XHTML ????? ???????? ????", +DlgDocBgColor : "??????????? ???", +DlgDocBgImage : "??????????? ????? URL", +DlgDocBgNoScroll : "??????? ? ??? ????? ???????????", +DlgDocCText : "???????", +DlgDocCLink : "????", +DlgDocCVisited : "??????? ????", +DlgDocCActive : "?????? ????", +DlgDocMargins : "??? ???????", +DlgDocMaTop : "???", +DlgDocMaLeft : "????", +DlgDocMaRight : "????", +DlgDocMaBottom : "????", +DlgDocMeIndex : "?????????? ???????? ????????? (????????? (,) ?? ??? ???)", +DlgDocMeDescr : "?????????? ?????", +DlgDocMeAuthor : "????", +DlgDocMeCopy : "????????", +DlgDocPreview : "??????????", + +// Templates Dialog +Templates : "?????????", +DlgTemplatesTitle : "???????? ?????????", +DlgTemplatesSelMsg : "???????? ??? ???? ????????? ???? ??? (??????? ???????? ??? ???? ???):", +DlgTemplatesLoading : "????????? ???? ??? ??? ??. ??? ???...", +DlgTemplatesNoTpl : "(??? ????????? ?????? ???)", +DlgTemplatesReplace : "??? ?????? ????", + +// About Dialog +DlgAboutAboutTab : "FCKEditor ?? ????", +DlgAboutBrowserInfoTab : "??????? ?? ????", +DlgAboutLicenseTab : "???????", +DlgAboutVersion : "?????", +DlgAboutInfo : "????? ?????? ????:" +}; Property changes on: announcement/trunk/src/main/webapp/fckeditor/editor/lang/gu.js ___________________________________________________________________ Name: svn:eol-style + native Added: announcement/trunk/src/main/webapp/fckeditor/editor/lang/he.js =================================================================== --- announcement/trunk/src/main/webapp/fckeditor/editor/lang/he.js (rev 0) +++ announcement/trunk/src/main/webapp/fckeditor/editor/lang/he.js 2008-06-30 02:54:27 UTC (rev 1002) @@ -0,0 +1,515 @@ +?/* + * FCKeditor - The text editor for Internet - http://www.fckeditor.net + * Copyright (C) 2003-2008 Frederico Caldeira Knabben + * + * == BEGIN LICENSE == + * + * Licensed under the terms of any of the following licenses at your + * choice: + * + * - GNU General Public License Version 2 or later (the "GPL") + * http://www.gnu.org/licenses/gpl.html + * + * - GNU Lesser General Public License Version 2.1 or later (the "LGPL") + * http://www.gnu.org/licenses/lgpl.html + * + * - Mozilla Public License Version 1.1 or later (the "MPL") + * http://www.mozilla.org/MPL/MPL-1.1.html + * + * == END LICENSE == + * + * Hebrew language file. + */ + +var FCKLang = +{ +// Language direction : "ltr" (left to right) or "rtl" (right to left). +Dir : "rtl", + +ToolbarCollapse : "????? ???? ?????", +ToolbarExpand : "????? ???? ?????", + +// Toolbar Items and Context Menu +Save : "?????", +NewPage : "?? ???", +Preview : "????? ??????", +Cut : "?????", +Copy : "?????", +Paste : "?????", +PasteText : "????? ????? ????", +PasteWord : "????? ?-????", +Print : "?????", +SelectAll : "????? ???", +RemoveFormat : "???? ??????", +InsertLinkLbl : "?????", +InsertLink : "?????/????? ?????", +RemoveLink : "???? ??????", +Anchor : "?????/????? ????? ?????", +AnchorDelete : "??? ????? ?????", +InsertImageLbl : "?????", +InsertImage : "?????/????? ?????", +InsertFlashLbl : "????", +InsertFlash : "????/???? ????", +InsertTableLbl : "????", +InsertTable : "?????/????? ????", +InsertLineLbl : "??", +InsertLine : "????? ?? ?????", +InsertSpecialCharLbl: "?? ?????", +InsertSpecialChar : "????? ?? ?????", +InsertSmileyLbl : "??????", +InsertSmiley : "????? ??????", +About : "????? FCKeditor", +Bold : "?????", +Italic : "????", +Underline : "?? ?????", +StrikeThrough : "???? ????", +Subscript : "???? ?????", +Superscript : "???? ?????", +LeftJustify : "????? ?????", +CenterJustify : "?????", +RightJustify : "????? ?????", +BlockJustify : "????? ???????", +DecreaseIndent : "????? ?????????", +IncreaseIndent : "????? ?????????", +Blockquote : "???? ?????", +Undo : "????? ??? ?????", +Redo : "???? ?? ??? ?????", +NumberedListLbl : "????? ???????", +NumberedList : "?????/???? ????? ???????", +BulletedListLbl : "????? ??????", +BulletedList : "?????/???? ????? ??????", +ShowTableBorders : "???? ????? ?????", +ShowDetails : "???? ?????", +Style : "?????", +FontFormat : "?????", +Font : "????", +FontSize : "????", +TextColor : "??? ????", +BGColor : "??? ???", +Source : "????", +Find : "?????", +Replace : "?????", +SpellCheck : "????? ????", +UniversalKeyboard : "????? ??????????", +PageBreakLbl : "????? ??", +PageBreak : "???? ????? ??", + +Form : "????", +Checkbox : "???? ?????", +RadioButton : "???? ????????", +TextField : "??? ????", +Textarea : "????? ????", +HiddenField : "??? ????", +Button : "?????", +SelectionField : "??? ?????", +ImageButton : "????? ?????", + +FitWindow : "???? ?? ???? ?????", +ShowBlocks : "??? ??????", + +// Context Menu +EditLink : "????? ?????", +CellCM : "??", +RowCM : "????", +ColumnCM : "?????", +InsertRowAfter : "???? ???? ????", +InsertRowBefore : "???? ???? ????", +DeleteRows : "????? ?????", +InsertColumnAfter : "???? ????? ????", +InsertColumnBefore : "???? ????? ????", +DeleteColumns : "????? ??????", +InsertCellAfter : "???? ?? ????", +InsertCellBefore : "???? ?? ????", +DeleteCells : "????? ????", +MergeCells : "????? ????", +MergeRight : "??? ?????", +MergeDown : "??? ????", +HorizontalSplitCell : "??? ?? ??????", +VerticalSplitCell : "??? ?? ?????", +TableDelete : "??? ????", +CellProperties : "?????? ???", +TableProperties : "?????? ?????", +ImageProperties : "?????? ??????", +FlashProperties : "??????? ????", + +AnchorProp : "??????? ????? ?????", +ButtonProp : "??????? ?????", +CheckboxProp : "??????? ???? ?????", +HiddenFieldProp : "?????? ??? ????", +RadioButtonProp : "??????? ???? ????????", +ImageButtonProp : "?????? ????? ?????", +TextFieldProp : "??????? ??? ????", +SelectionFieldProp : "??????? ??? ?????", +TextareaProp : "?????? ????? ????", +FormProp : "?????? ????", + +FontFormats : "??????;???;?????;?????;????? 2;????? 3;????? 4;????? 5;????? 6", + +// Alerts and Messages +ProcessingXHTML : "???? XHTML, ?? ??????...", +Done : "?????? ??????", +PasteWordConfirm : "???? ????? ???????? ?????? ????? ????? ????. ??? ?????? ????? ???? ??? ???????", +NotCompatiblePaste : "????? ?? ????? ?????? ??????? ???????? ?????? 5.5 ?????. ??? ?????? ?????? ??? ???????", +UnknownToolbarItem : "???? ?? ???? ????? ????? \"%1\"", +UnknownCommand : "?? ????? ?? ???? \"%1\"", +NotImplemented : "?????? ?? ??????", +UnknownToolbarSet : "???? ???? ????? \"%1\" ?? ?????", +NoActiveX : "?????? ????? ?? ?????? ?????? ????? ?? ???????? ??????.?? ????? ?? ??????? \"??? ????? ?????? ???????\". ???? ????? ?????? ??????? ?? ???????? ??????.", +BrowseServerBlocked : "?? ???? ???? ?????? ??????.??? ???? ????? ?????? ??????? ?? ????.", +DialogBlocked : "?? ??? ???? ????? ???? ??????. ??? ???? ????? ?????? ?????? ?? ????.", + +// Dialogs +DlgBtnOK : "?????", +DlgBtnCancel : "?????", +DlgBtnClose : "?????", +DlgBtnBrowseServer : "???? ????", +DlgAdvancedTag : "???????? ???????", +DlgOpOther : "", +DlgInfoTab : "????", +DlgAlertUrl : "??? ??? URL", + +// General Dialogs Labels +DlgGenNotSet : "", +DlgGenId : "????? (Id)", +DlgGenLangDir : "????? ???", +DlgGenLangDirLtr : "???? ????? (LTR)", +DlgGenLangDirRtl : "???? ????? (RTL)", +DlgGenLangCode : "??? ???", +DlgGenAccessKey : "??? ????", +DlgGenName : "??", +DlgGenTabIndex : "???? ???", +DlgGenLongDescr : "????? ?????? ?????", +DlgGenClass : "???????? ????? ??????", +DlgGenTitle : "????? ?????", +DlgGenContType : "Content Type ????", +DlgGenLinkCharset : "????? ????? ??????", +DlgGenStyle : "?????", + +// Image Dialog +DlgImgTitle : "?????? ??????", +DlgImgInfoTab : "???? ?? ??????", +DlgImgBtnUpload : "????? ????", +DlgImgURL : "????? (URL)", +DlgImgUpload : "?????", +DlgImgAlt : "???? ?????", +DlgImgWidth : "????", +DlgImgHeight : "????", +DlgImgLockRatio : "????? ????", +DlgBtnResetSize : "????? ?????", +DlgImgBorder : "?????", +DlgImgHSpace : "????? ?????", +DlgImgVSpace : "????? ????", +DlgImgAlign : "?????", +DlgImgAlignLeft : "?????", +DlgImgAlignAbsBottom: "?????? ??????????", +DlgImgAlignAbsMiddle: "????? ????????", +DlgImgAlignBaseline : "??? ??????", +DlgImgAlignBottom : "??????", +DlgImgAlignMiddle : "?????", +DlgImgAlignRight : "?????", +DlgImgAlignTextTop : "???? ?????", +DlgImgAlignTop : "?????", +DlgImgPreview : "????? ??????", +DlgImgAlertUrl : "?? ?????? ?? ????? ??????", +DlgImgLinkTab : "?????", + +// Flash Dialog +DlgFlashTitle : "?????? ????", +DlgFlashChkPlay : "??? ???????", +DlgFlashChkLoop : "?????", +DlgFlashChkMenu : "???? ????? ????", +DlgFlashScale : "????", +DlgFlashScaleAll : "??? ???", +DlgFlashScaleNoBorder : "??? ??????", +DlgFlashScaleFit : "????? ??????", + +// Link Dialog +DlgLnkWindowTitle : "?????", +DlgLnkInfoTab : "???? ?? ??????", +DlgLnkTargetTab : "????", + +DlgLnkType : "??? ?????", +DlgLnkTypeURL : "????? (URL)", +DlgLnkTypeAnchor : "???? ????? ??", +DlgLnkTypeEMail : "???''?", +DlgLnkProto : "????????", +DlgLnkProtoOther : "", +DlgLnkURL : "????? (URL)", +DlgLnkAnchorSel : "????? ????", +DlgLnkAnchorByName : "??''? ?? ?????", +DlgLnkAnchorById : "??''? ????? (Id) ?????", +DlgLnkNoAnchors : "(??? ?????? ?????? ???)", +DlgLnkEMail : "????? ????''?", +DlgLnkEMailSubject : "???? ??????", +DlgLnkEMailBody : "??? ??????", +DlgLnkUpload : "?????", +DlgLnkBtnUpload : "????? ????", + +DlgLnkTarget : "????", +DlgLnkTargetFrame : "", +DlgLnkTargetPopup : "", +DlgLnkTargetBlank : "???? ??? (_blank)", +DlgLnkTargetParent : "???? ??? (_parent)", +DlgLnkTargetSelf : "????? ????? (_self)", +DlgLnkTargetTop : "???? ???? (_top)", +DlgLnkTargetFrameName : "?? ????? ????", +DlgLnkPopWinName : "?? ????? ?????", +DlgLnkPopWinFeat : "?????? ????? ?????", +DlgLnkPopResize : "??? ???? ???? ??????", +DlgLnkPopLocation : "???? ?????", +DlgLnkPopMenu : "???? ?????", +DlgLnkPopScroll : "???? ??????", +DlgLnkPopStatus : "???? ?????", +DlgLnkPopToolbar : "???? ?????", +DlgLnkPopFullScrn : "??? ??? (IE)", +DlgLnkPopDependent : "???? (Netscape)", +DlgLnkPopWidth : "????", +DlgLnkPopHeight : "????", +DlgLnkPopLeft : "????? ?? ????", +DlgLnkPopTop : "????? ?? ?????", + +DlnLnkMsgNoUrl : "?? ?????? ?? ????? ?????? (URL)", +DlnLnkMsgNoEMail : "?? ?????? ?? ????? ????''?", +DlnLnkMsgNoAnchor : "?? ????? ???? ?????", +DlnLnkMsgInvPopName : "?? ????? ????? ???? ?????? ??????? ????? ????? ??????", + +// Color Dialog +DlgColorTitle : "????? ???", +DlgColorBtnClear : "?????", +DlgColorHighlight : "?????", +DlgColorSelected : "????", + +// Smiley Dialog +DlgSmileyTitle : "????? ??????", + +// Special Character Dialog +DlgSpecialCharTitle : "????? ?? ?????", + +// Table Dialog +DlgTableTitle : "?????? ????", +DlgTableRows : "?????", +DlgTableColumns : "??????", +DlgTableBorder : "???? ?????", +DlgTableAlign : "?????", +DlgTableAlignNotSet : "", +DlgTableAlignLeft : "????", +DlgTableAlignCenter : "????", +DlgTableAlignRight : "????", +DlgTableWidth : "????", +DlgTableWidthPx : "???????", +DlgTableWidthPc : "????", +DlgTableHeight : "????", +DlgTableCellSpace : "????? ??", +DlgTableCellPad : "????? ??", +DlgTableCaption : "?????", +DlgTableSummary : "?????", + +// Table Cell Dialog +DlgCellTitle : "?????? ??", +DlgCellWidth : "????", +DlgCellWidthPx : "???????", +DlgCellWidthPc : "????", +DlgCellHeight : "????", +DlgCellWordWrap : "????? ?????", +DlgCellWordWrapNotSet : "", +DlgCellWordWrapYes : "??", +DlgCellWordWrapNo : "??", +DlgCellHorAlign : "????? ?????", +DlgCellHorAlignNotSet : "", +DlgCellHorAlignLeft : "????", +DlgCellHorAlignCenter : "????", +DlgCellHorAlignRight: "????", +DlgCellVerAlign : "????? ????", +DlgCellVerAlignNotSet : "", +DlgCellVerAlignTop : "?????", +DlgCellVerAlignMiddle : "?????", +DlgCellVerAlignBottom : "??????", +DlgCellVerAlignBaseline : "?? ?????", +DlgCellRowSpan : "???? ?????", +DlgCellCollSpan : "???? ??????", +DlgCellBackColor : "??? ???", +DlgCellBorderColor : "??? ?????", +DlgCellBtnSelect : "?????...", + +// Find and Replace Dialog +DlgFindAndReplaceTitle : "??? ?????", + +// Find Dialog +DlgFindTitle : "?????", +DlgFindFindBtn : "?????", +DlgFindNotFoundMsg : "????? ?????? ?? ????.", + +// Replace Dialog +DlgReplaceTitle : "?????", +DlgReplaceFindLbl : "????? ??????:", +DlgReplaceReplaceLbl : "????? ???????:", +DlgReplaceCaseChk : "????? ??? ?????? (Case)", +DlgReplaceReplaceBtn : "?????", +DlgReplaceReplAllBtn : "????? ??? ?????", +DlgReplaceWordChk : "????? ????? ?????", + +// Paste Operations / Dialog +PasteErrorCut : "?????? ?????? ?????? ??? ?? ??????? ????? ???? ?????? ????? ?????????. ?? ?????? ?????? ??? ?? (Ctrl+X).", +PasteErrorCopy : "?????? ?????? ?????? ??? ?? ??????? ????? ???? ?????? ????? ?????????. ?? ?????? ?????? ??? ?? (Ctrl+C).", + +PasteAsText : "????? ????? ????", +PasteFromWord : "????? ?-????", + +DlgPasteMsg2 : "??? ???? ???? ?????? ??????? (Ctrl+V) ???? ?? ?????.", +DlgPasteSec : "??? ?????? ????? ??????, ?? ???? ???? ?? ??? ??????? (clipboard) ????? ?????.??? ??? ???? ??? ????? ??.", +DlgPasteIgnoreFont : "????? ??????? ??? ????", +DlgPasteRemoveStyles : "??? ?????? ?????", + +// Color Picker +ColorAutomatic : "???????", +ColorMoreColors : "????? ??????...", + +// Document Properties +DocProps : "?????? ????", + +// Anchor Dialog +DlgAnchorTitle : "?????? ????? ?????", +DlgAnchorName : "?? ?????? ?????", +DlgAnchorErrorName : "??? ??? ?? ?????? ?????", + +// Speller Pages Dialog +DlgSpellNotInDic : "?? ???? ??????", +DlgSpellChangeTo : "??? ?", +DlgSpellBtnIgnore : "?????", +DlgSpellBtnIgnoreAll : "????? ????", +DlgSpellBtnReplace : "????", +DlgSpellBtnReplaceAll : "???? ???", +DlgSpellBtnUndo : "????", +DlgSpellNoSuggestions : "- ??? ????? -", +DlgSpellProgress : "?????? ???? ?????? ....", +DlgSpellNoMispell : "?????? ???? ???????: ?? ????? ?????? ????", +DlgSpellNoChanges : "?????? ???? ???????: ?? ????? ?? ????", +DlgSpellOneChange : "?????? ???? ???????: ????? ???? ???", +DlgSpellManyChanges : "?????? ???? ???????: %1 ????? ????", + +IeSpellDownload : "???? ????? ?? ?????, ??? ??? ??????? ???????", + +// Button Dialog +DlgButtonText : "???? (???)", +DlgButtonType : "???", +DlgButtonTypeBtn : "?????", +DlgButtonTypeSbm : "???", +DlgButtonTypeRst : "???", + +// Checkbox and Radio Button Dialogs +DlgCheckboxName : "??", +DlgCheckboxValue : "???", +DlgCheckboxSelected : "????", + +// Form Dialog +DlgFormName : "??", +DlgFormAction : "??? ??", +DlgFormMethod : "??? ?????", + +// Select Field Dialog +DlgSelectName : "??", +DlgSelectValue : "???", +DlgSelectSize : "????", +DlgSelectLines : "?????", +DlgSelectChkMulti : "???? ?????? ??????", +DlgSelectOpAvail : "???????? ??????", +DlgSelectOpText : "????", +DlgSelectOpValue : "???", +DlgSelectBtnAdd : "????", +DlgSelectBtnModify : "???", +DlgSelectBtnUp : "?????", +DlgSelectBtnDown : "????", +DlgSelectBtnSetValue : "??? ?????? ????", +DlgSelectBtnDelete : "???", + +// Textarea Dialog +DlgTextareaName : "??", +DlgTextareaCols : "??????", +DlgTextareaRows : "?????", + +// Text Field Dialog +DlgTextName : "??", +DlgTextValue : "???", +DlgTextCharWidth : "???? ???????", +DlgTextMaxChars : "??????? ??????", +DlgTextType : "???", +DlgTextTypeText : "????", +DlgTextTypePass : "?????", + +// Hidden Field Dialog +DlgHiddenName : "??", +DlgHiddenValue : "???", + +// Bulleted List Dialog +BulletedListProp : "??????? ?????", +NumberedListProp : "??????? ????? ???????", +DlgLstStart : "?????", +DlgLstType : "???", +DlgLstTypeCircle : "?????", +DlgLstTypeDisc : "????", +DlgLstTypeSquare : "?????", +DlgLstTypeNumbers : "?????? (1, 2, 3)", +DlgLstTypeLCase : "?????? ????? (a, b, c)", +DlgLstTypeUCase : "?????? ?????? (A, B, C)", +DlgLstTypeSRoman : "????? ??????? ????? (i, ii, iii)", +DlgLstTypeLRoman : "????? ??????? ?????? (I, II, III)", + +// Document Properties Dialog +DlgDocGeneralTab : "????", +DlgDocBackTab : "???", +DlgDocColorsTab : "????? ???????", +DlgDocMetaTab : "????? META", + +DlgDocPageTitle : "????? ??", +DlgDocLangDir : "????? ???", +DlgDocLangDirLTR : "???? ????? (LTR)", +DlgDocLangDirRTL : "???? ????? (RTL)", +DlgDocLangCode : "??? ???", +DlgDocCharSet : "????? ??????", +DlgDocCharSetCE : "???? ??????", +DlgDocCharSetCT : "???? ?????? (Big5)", +DlgDocCharSetCR : "??????", +DlgDocCharSetGR : "??????", +DlgDocCharSetJP : "?????", +DlgDocCharSetKR : "???????", +DlgDocCharSetTR : "??????", +DlgDocCharSetUN : "???? ??? (UTF-8)", +DlgDocCharSetWE : "???? ??????", +DlgDocCharSetOther : "????? ?????? ???", + +DlgDocDocType : "?????? ??? ????", +DlgDocDocTypeOther : "?????? ??? ???? ?????", +DlgDocIncXHTML : "???? ?????? XHTML", +DlgDocBgColor : "??? ???", +DlgDocBgImage : "URL ?????? ???", +DlgDocBgNoScroll : "??? ??? ?????", +DlgDocCText : "????", +DlgDocCLink : "?????", +DlgDocCVisited : "????? ?????", +DlgDocCActive : " ????? ????", +DlgDocMargins : "?????? ??", +DlgDocMaTop : "?????", +DlgDocMaLeft : "?????", +DlgDocMaRight : "?????", +DlgDocMaBottom : "????", +DlgDocMeIndex : "???? ??????? ?? ????? )????? ?????(", +DlgDocMeDescr : "???? ????", +DlgDocMeAuthor : "????", +DlgDocMeCopy : "?????? ??????", +DlgDocPreview : "????? ??????", + +// Templates Dialog +Templates : "??????", +DlgTemplatesTitle : "????? ????", +DlgTemplatesSelMsg : "??? ??? ????? ?????? ?????
        ????? ?????? ????:", +DlgTemplatesLoading : "???? ????? ?????? ??? ????", +DlgTemplatesNoTpl : "(?? ?????? ??????)", +DlgTemplatesReplace : "????? ???? ????", + +// About Dialog +DlgAboutAboutTab : "?????", +DlgAboutBrowserInfoTab : "????? ?????", +DlgAboutLicenseTab : "?????", +DlgAboutVersion : "?????", +DlgAboutInfo : "???? ???? ???? ????? ???:" +}; Property changes on: announcement/trunk/src/main/webapp/fckeditor/editor/lang/he.js ___________________________________________________________________ Name: svn:eol-style + native Added: announcement/trunk/src/main/webapp/fckeditor/editor/lang/hi.js =================================================================== --- announcement/trunk/src/main/webapp/fckeditor/editor/lang/hi.js (rev 0) +++ announcement/trunk/src/main/webapp/fckeditor/editor/lang/hi.js 2008-06-30 02:54:27 UTC (rev 1002) @@ -0,0 +1,515 @@ +?/* + * FCKeditor - The text editor for Internet - http://www.fckeditor.net + * Copyright (C) 2003-2008 Frederico Caldeira Knabben + * + * == BEGIN LICENSE == + * + * Licensed under the terms of any of the following licenses at your + * choice: + * + * - GNU General Public License Version 2 or later (the "GPL") + * http://www.gnu.org/licenses/gpl.html + * + * - GNU Lesser General Public License Version 2.1 or later (the "LGPL") + * http://www.gnu.org/licenses/lgpl.html + * + * - Mozilla Public License Version 1.1 or later (the "MPL") + * http://www.mozilla.org/MPL/MPL-1.1.html + * + * == END LICENSE == + * + * Hindi language file. + */ + +var FCKLang = +{ +// Language direction : "ltr" (left to right) or "rtl" (right to left). +Dir : "ltr", + +ToolbarCollapse : "?????? ????????", +ToolbarExpand : "?????? ?? ??????? ????", + +// Toolbar Items and Context Menu +Save : "???", +NewPage : "??? ???", +Preview : "????????", +Cut : "??", +Copy : "????", +Paste : "?????", +PasteText : "????? (???? ???????)", +PasteWord : "????? (???? ??)", +Print : "???????", +SelectAll : "?? ??????? ????", +RemoveFormat : "??????? ??????", +InsertLinkLbl : "????", +InsertLink : "???? ???????/??????", +RemoveLink : "???? ??????", +Anchor : "???? ???????/??????", +AnchorDelete : "???? ??????", +InsertImageLbl : "??????", +InsertImage : "?????? ???????/??????", +InsertFlashLbl : "?????", +InsertFlash : "????? ???????/??????", +InsertTableLbl : "????", +InsertTable : "???? ???????/??????", +InsertLineLbl : "????", +InsertLine : "?????????? ???? ??????? ????", +InsertSpecialCharLbl: "????? ???????", +InsertSpecialChar : "????? ??????? ??????? ????", +InsertSmileyLbl : "???????", +InsertSmiley : "??????? ??????? ????", +About : "FCKeditor ?? ???? ???", +Bold : "?????", +Italic : "??????", +Underline : "???????", +StrikeThrough : "???????? ????", +Subscript : "??????", +Superscript : "??????", +LeftJustify : "????? ???", +CenterJustify : "??? ???", +RightJustify : "????? ???", +BlockJustify : "????? ????????", +DecreaseIndent : "???????? ?? ????", +IncreaseIndent : "???????? ??????", +Blockquote : "?????-???", +Undo : "?????", +Redo : "????", +NumberedListLbl : "????? ????", +NumberedList : "????? ???? ???????/??????", +BulletedListLbl : "????? ????", +BulletedList : "????? ???? ???????/??????", +ShowTableBorders : "???? ????????? ???????", +ShowDetails : "?????? ???????", +Style : "??????", +FontFormat : "???????", +Font : "?????", +FontSize : "????", +TextColor : "??????? ???", +BGColor : "???????????? ???", +Source : "?????", +Find : "?????", +Replace : "???????", +SpellCheck : "?????? (????????) ????", +UniversalKeyboard : "????????? ???????", +PageBreakLbl : "??? ?????", +PageBreak : "??? ????? ???????? ????", + +Form : "?????", +Checkbox : "??? ?????", +RadioButton : "????? ???", +TextField : "??????? ?????", +Textarea : "??????? ?????", +HiddenField : "????? ?????", +Button : "???", +SelectionField : "????? ?????", +ImageButton : "?????? ???", + +FitWindow : "????? ???? ?? ??? ???? ?? ??????", +ShowBlocks : "????? ???????", + +// Context Menu +EditLink : "???? ??????", +CellCM : "????", +RowCM : "??????", +ColumnCM : "????", +InsertRowAfter : "??? ??? ?????? ?????", +InsertRowBefore : "???? ?????? ?????", +DeleteRows : "????????? ????? ????", +InsertColumnAfter : "??? ??? ???? ?????", +InsertColumnBefore : "???? ???? ?????", +DeleteColumns : "???? ????? ????", +InsertCellAfter : "??? ??? ??? ?????", +InsertCellBefore : "???? ??? ?????", +DeleteCells : "??? ????? ????", +MergeCells : "??? ???????", +MergeRight : "????? ????", +MergeDown : "???? ???? ????", +HorizontalSplitCell : "??? ?? ??????? ?????? ??? ??????? ????", +VerticalSplitCell : "??? ?? ???????? ??? ??????? ????", +TableDelete : "???? ????? ????", +CellProperties : "??? ??????????", +TableProperties : "???? ??????????", +ImageProperties : "?????? ??????????", +FlashProperties : "????? ??????????", + +AnchorProp : "???? ??????????", +ButtonProp : "??? ??????????", +CheckboxProp : "??? ????? ??????????", +HiddenFieldProp : "????? ????? ??????????", +RadioButtonProp : "????? ??? ??????????", +ImageButtonProp : "?????? ??? ??????????", +TextFieldProp : "??????? ????? ??????????", +SelectionFieldProp : "????? ????? ??????????", +TextareaProp : "??????? ????? ??????????", +FormProp : "????? ??????????", + +FontFormats : "??????;?????????;???;?????? 1;?????? 2;?????? 3;?????? 4;?????? 5;?????? 6;?????? (DIV)", + +// Alerts and Messages +ProcessingXHTML : "XHTML ??????? ?? ??? ??? ??? ?????...", +Done : "???? ???", +PasteWordConfirm : "?? ?? ??????? ????? ???? ????? ???, ?? ???? ?? ???? ???? ??? ?? ??? ??? ???? ????? ???? ?? ???? ?? ??? ??? ???? ????????", +NotCompatiblePaste : "?? ????? ???????? ???????????(Internet Explorer) 5.5 ?? ???? ??? ?? ????? ?? ??? ?? ?????? ??? ???? ?? ???? ??? ??? ????? ???? ????????", +UnknownToolbarItem : "????? ?????? ???? \"%1\"", +UnknownCommand : "????? ?????? \"%1\"", +NotImplemented : "?????? ???????????? ???? ???? ??? ??", +UnknownToolbarSet : "?????? ??? \"%1\" ?????? ???? ??", +NoActiveX : "???? ???????? ?? ??????? ????????? ????? ?? ???? ?????? ?? ????? ??? ???? ???? ??????? \"Run ActiveX controls and plug-ins\" ?????? ?? ????? ????. ???? ?????? ?? ???? ??????? ?? ????? ?? ???? ???", +BrowseServerBlocked : "????????? ???????? ???? ???? ?? ???? ??????? ??? ????-??? ????????? ?? ?????? ?????", +DialogBlocked : "????? ?????? ???? ???? ?? ???? ??????? ??? ????-??? ????????? ?? ?????? ?????", + +// Dialogs +DlgBtnOK : "??? ??", +DlgBtnCancel : "???? ????", +DlgBtnClose : "???? ????", +DlgBtnBrowseServer : "????? ?????? ????", +DlgAdvancedTag : "??????????", +DlgOpOther : "", +DlgInfoTab : "?????", +DlgAlertUrl : "URL ??????? ????", + +// General Dialogs Labels +DlgGenNotSet : "", +DlgGenId : "Id", +DlgGenLangDir : "???? ????? ?? ????", +DlgGenLangDirLtr : "????? ?? ????? (LTR)", +DlgGenLangDirRtl : "????? ?? ????? (RTL)", +DlgGenLangCode : "???? ???", +DlgGenAccessKey : "?????? ??", +DlgGenName : "???", +DlgGenTabIndex : "??? ????????", +DlgGenLongDescr : "???? ????? ?? ??? URL", +DlgGenClass : "??????-??? ?????", +DlgGenTitle : "??????? ??????", +DlgGenContType : "??????? ???????? ??????", +DlgGenLinkCharset : "???? ??????? ??????? ???", +DlgGenStyle : "??????", + +// Image Dialog +DlgImgTitle : "?????? ??????????", +DlgImgInfoTab : "?????? ?? ???????", +DlgImgBtnUpload : "??? ????? ?? ?????", +DlgImgURL : "URL", +DlgImgUpload : "?????", +DlgImgAlt : "???????? ???????", +DlgImgWidth : "?????", +DlgImgHeight : "?????", +DlgImgLockRatio : "??? ??????", +DlgBtnResetSize : "????? ????", +DlgImgBorder : "??????", +DlgImgHSpace : "?????????? ?????", +DlgImgVSpace : "??????? ?????", +DlgImgAlign : "?????", +DlgImgAlignLeft : "?????", +DlgImgAlignAbsBottom: "Abs ????", +DlgImgAlignAbsMiddle: "Abs ???", +DlgImgAlignBaseline : "??? ????", +DlgImgAlignBottom : "????", +DlgImgAlignMiddle : "????", +DlgImgAlignRight : "?????", +DlgImgAlignTextTop : "??????? ???", +DlgImgAlignTop : "???", +DlgImgPreview : "????????", +DlgImgAlertUrl : "?????? ?? URL ???? ???? ", +DlgImgLinkTab : "????", + +// Flash Dialog +DlgFlashTitle : "????? ??????????", +DlgFlashChkPlay : "??? ????", +DlgFlashChkLoop : "???", +DlgFlashChkMenu : "????? ?????? ?? ?????? ????", +DlgFlashScale : "?????", +DlgFlashScaleAll : "??? ???????", +DlgFlashScaleNoBorder : "??? ?????? ????", +DlgFlashScaleFit : "??????? ???", + +// Link Dialog +DlgLnkWindowTitle : "????", +DlgLnkInfoTab : "???? ", +DlgLnkTargetTab : "???????", + +DlgLnkType : "???? ??????", +DlgLnkTypeURL : "URL", +DlgLnkTypeAnchor : "?? ??? ?? ????", +DlgLnkTypeEMail : "?-???", +DlgLnkProto : "?????????", +DlgLnkProtoOther : "", +DlgLnkURL : "URL", +DlgLnkAnchorSel : "???? ?????", +DlgLnkAnchorByName : "???? ??? ??", +DlgLnkAnchorById : "???????? Id ??", +DlgLnkNoAnchors : "(??????????? ??? ?????? ?? ??????)", +DlgLnkEMail : "?-??? ???", +DlgLnkEMailSubject : "????? ????", +DlgLnkEMailBody : "?????", +DlgLnkUpload : "?????", +DlgLnkBtnUpload : "??? ????? ?? ?????", + +DlgLnkTarget : "???????", +DlgLnkTargetFrame : "", +DlgLnkTargetPopup : "", +DlgLnkTargetBlank : "??? ?????? (_blank)", +DlgLnkTargetParent : "??? ?????? (_parent)", +DlgLnkTargetSelf : "??? ?????? (_self)", +DlgLnkTargetTop : "????? ?????? (_top)", +DlgLnkTargetFrameName : "??????? ????? ?? ???", +DlgLnkPopWinName : "???-?? ?????? ?? ???", +DlgLnkPopWinFeat : "???-?? ?????? ??????", +DlgLnkPopResize : "???? ???? ?? ???? ??", +DlgLnkPopLocation : "?????? ???", +DlgLnkPopMenu : "?????? ???", +DlgLnkPopScroll : "??????? ???", +DlgLnkPopStatus : "?????? ???", +DlgLnkPopToolbar : "??? ???", +DlgLnkPopFullScrn : "??? ??????? (IE)", +DlgLnkPopDependent : "??????????? (Netscape)", +DlgLnkPopWidth : "?????", +DlgLnkPopHeight : "?????", +DlgLnkPopLeft : "????? ???", +DlgLnkPopTop : "????? ???", + +DlnLnkMsgNoUrl : "???? URL ???? ????", +DlnLnkMsgNoEMail : "?-??? ??? ???? ????", +DlnLnkMsgNoAnchor : "???? ?????", +DlnLnkMsgInvPopName : "???-?? ?? ??? ???????? ?? ???? ???? ?????? ?? ????? ????? ???? ???? ?????", + +// Color Dialog +DlgColorTitle : "??? ?????", +DlgColorBtnClear : "??? ????", +DlgColorHighlight : "???????", +DlgColorSelected : "?????????", + +// Smiley Dialog +DlgSmileyTitle : "??????? ??????? ????", + +// Special Character Dialog +DlgSpecialCharTitle : "????? ??????? ?????", + +// Table Dialog +DlgTableTitle : "???? ??????????", +DlgTableRows : "?????????", +DlgTableColumns : "????", +DlgTableBorder : "?????? ????", +DlgTableAlign : "???????????", +DlgTableAlignNotSet : "", +DlgTableAlignLeft : "?????", +DlgTableAlignCenter : "??? ???", +DlgTableAlignRight : "?????", +DlgTableWidth : "?????", +DlgTableWidthPx : "???????", +DlgTableWidthPc : "???????", +DlgTableHeight : "?????", +DlgTableCellSpace : "??? ????", +DlgTableCellPad : "??? ??????", +DlgTableCaption : "??????", +DlgTableSummary : "??????", + +// Table Cell Dialog +DlgCellTitle : "??? ??????????", +DlgCellWidth : "?????", +DlgCellWidthPx : "???????", +DlgCellWidthPc : "???????", +DlgCellHeight : "?????", +DlgCellWordWrap : "???? ???", +DlgCellWordWrapNotSet : "", +DlgCellWordWrapYes : "???", +DlgCellWordWrapNo : "????", +DlgCellHorAlign : "?????????? ???????????", +DlgCellHorAlignNotSet : "", +DlgCellHorAlignLeft : "?????", +DlgCellHorAlignCenter : "??? ???", +DlgCellHorAlignRight: "?????", +DlgCellVerAlign : "??????? ???????????", +DlgCellVerAlignNotSet : "", +DlgCellVerAlignTop : "???", +DlgCellVerAlignMiddle : "????", +DlgCellVerAlignBottom : "????", +DlgCellVerAlignBaseline : "???????", +DlgCellRowSpan : "?????? ?????", +DlgCellCollSpan : "???? ?????", +DlgCellBackColor : "???????????? ???", +DlgCellBorderColor : "?????? ?? ???", +DlgCellBtnSelect : "?????...", + +// Find and Replace Dialog +DlgFindAndReplaceTitle : "????? ?? ?????", + +// Find Dialog +DlgFindTitle : "?????", +DlgFindFindBtn : "?????", +DlgFindNotFoundMsg : "???? ?????? ???? ??? ??????? ???? ????", + +// Replace Dialog +DlgReplaceTitle : "???????", +DlgReplaceFindLbl : "?? ?????:", +DlgReplaceReplaceLbl : "???? ??????? ????:", +DlgReplaceCaseChk : "??? ???????", +DlgReplaceReplaceBtn : "???????", +DlgReplaceReplAllBtn : "??? ??????? ????", +DlgReplaceWordChk : "???? ???? ???????", + +// Paste Operations / Dialog +PasteErrorCut : "???? ??????? ?? ??????? ????????? ?? ?? ???? ?? ?????? ???? ?????? ?? ??? (Ctrl+X) ?? ?????? ?????", +PasteErrorCopy : "???? ???????? ?? ??????? ????????? ?? ???? ???? ?? ?????? ???? ?????? ?? ??? (Ctrl+C) ?? ?????? ?????", + +PasteAsText : "????? (???? ???????)", +PasteFromWord : "????? (???? ??)", + +DlgPasteMsg2 : "Ctrl+V ?? ?????? ???? ????? ???? ?? ??? ?? ????.", +DlgPasteSec : "???? ??????? ?? ??????? ???? ??????? ?? ???K? ?????? ?? ????, ????? ???? ?????????? ???? ?? ???? ?? ???? ??. ???? ??? ?? ?????? ??? ?????? ????? ???? ????.", +DlgPasteIgnoreFont : "????? ??????? ???????", +DlgPasteRemoveStyles : "?????? ??????? ???????", + +// Color Picker +ColorAutomatic : "????????", +ColorMoreColors : "?? ???...", + +// Document Properties +DocProps : "??????????? ??????????", + +// Anchor Dialog +DlgAnchorTitle : "???? ??????????", +DlgAnchorName : "???? ?? ???", +DlgAnchorErrorName : "???? ?? ??? ???? ????", + +// Speller Pages Dialog +DlgSpellNotInDic : "??????? ??? ????", +DlgSpellChangeTo : "????? ?????", +DlgSpellBtnIgnore : "??????", +DlgSpellBtnIgnoreAll : "??? ?????? ????", +DlgSpellBtnReplace : "???????", +DlgSpellBtnReplaceAll : "??? ??????? ????", +DlgSpellBtnUndo : "?????", +DlgSpellNoSuggestions : "- ??? ????? ???? -", +DlgSpellProgress : "?????? ?? ???? (?????-???) ???? ??...", +DlgSpellNoMispell : "?????? ?? ???? : ??? ??? ?????? (????????) ???? ??? ??", +DlgSpellNoChanges : "?????? ?? ???? :??? ???? ???? ???? ???", +DlgSpellOneChange : "?????? ?? ???? : ?? ???? ???? ???", +DlgSpellManyChanges : "?????? ?? ???? : %1 ???? ???? ???", + +IeSpellDownload : "?????-???? ???????? ???? ???? ??? ??? ???? ?? ??? ???????? ???? ????????", + +// Button Dialog +DlgButtonText : "??????? (??????)", +DlgButtonType : "??????", +DlgButtonTypeBtn : "???", +DlgButtonTypeSbm : "??????", +DlgButtonTypeRst : "?????", + +// Checkbox and Radio Button Dialogs +DlgCheckboxName : "???", +DlgCheckboxValue : "??????", +DlgCheckboxSelected : "?????????", + +// Form Dialog +DlgFormName : "???", +DlgFormAction : "??????", +DlgFormMethod : "?????", + +// Select Field Dialog +DlgSelectName : "???", +DlgSelectValue : "??????", +DlgSelectSize : "????", +DlgSelectLines : "?????????", +DlgSelectChkMulti : "?? ?? ?????? ?????? ????? ???", +DlgSelectOpAvail : "?????? ??????", +DlgSelectOpText : "???????", +DlgSelectOpValue : "??????", +DlgSelectBtnAdd : "?????", +DlgSelectBtnModify : "?????", +DlgSelectBtnUp : "???", +DlgSelectBtnDown : "????", +DlgSelectBtnSetValue : "???? ?? ?????? ??? ????", +DlgSelectBtnDelete : "?????", + +// Textarea Dialog +DlgTextareaName : "???", +DlgTextareaCols : "????", +DlgTextareaRows : "?????????", + +// Text Field Dialog +DlgTextName : "???", +DlgTextValue : "??????", +DlgTextCharWidth : "??????? ?? ?????", +DlgTextMaxChars : "?????? ???????", +DlgTextType : "????", +DlgTextTypeText : "???????", +DlgTextTypePass : "????????", + +// Hidden Field Dialog +DlgHiddenName : "???", +DlgHiddenValue : "??????", + +// Bulleted List Dialog +BulletedListProp : "????? ???? ??????????", +NumberedListProp : "????? ???? ??????????", +DlgLstStart : "????????", +DlgLstType : "??????", +DlgLstTypeCircle : "???", +DlgLstTypeDisc : "?????", +DlgLstTypeSquare : "?????", +DlgLstTypeNumbers : "??? (1, 2, 3)", +DlgLstTypeLCase : "???? ????? (a, b, c)", +DlgLstTypeUCase : "??? ????? (A, B, C)", +DlgLstTypeSRoman : "???? ???? ??? (i, ii, iii)", +DlgLstTypeLRoman : "??? ???? ??? (I, II, III)", + +// Document Properties Dialog +DlgDocGeneralTab : "??", +DlgDocBackTab : "????????????", +DlgDocColorsTab : "??? ?? ???????", +DlgDocMetaTab : "????????", + +DlgDocPageTitle : "??? ??????", +DlgDocLangDir : "???? ????? ?? ????", +DlgDocLangDirLTR : "????? ?? ????? (LTR)", +DlgDocLangDirRTL : "????? ?? ????? (RTL)", +DlgDocLangCode : "???? ???", +DlgDocCharSet : "??????? ??? ?????????", +DlgDocCharSetCE : "???? ??????? (Central European)", +DlgDocCharSetCT : "???? (Chinese Traditional Big5)", +DlgDocCharSetCR : "??????? (Cyrillic)", +DlgDocCharSetGR : "??? (Greek)", +DlgDocCharSetJP : "?????? (Japanese)", +DlgDocCharSetKR : "?????? (Korean)", +DlgDocCharSetTR : "?????? (Turkish)", +DlgDocCharSetUN : "??????? (UTF-8)", +DlgDocCharSetWE : "?????? ??????? (Western European)", +DlgDocCharSetOther : "???? ??????? ??? ?????????", + +DlgDocDocType : "??????????? ?????? ??????", +DlgDocDocTypeOther : "???? ??????????? ?????? ??????", +DlgDocIncXHTML : "XHTML ????? ???????? ????", +DlgDocBgColor : "???????????? ???", +DlgDocBgImage : "???????????? ?????? URL", +DlgDocBgNoScroll : "??????? ? ???? ???? ????????????", +DlgDocCText : "???????", +DlgDocCLink : "????", +DlgDocCVisited : "????? ???? ??? ????", +DlgDocCActive : "?????? ????", +DlgDocMargins : "??? ???????", +DlgDocMaTop : "???", +DlgDocMaLeft : "?????", +DlgDocMaRight : "?????", +DlgDocMaBottom : "????", +DlgDocMeIndex : "??????????? ???????? ????????? (????????? ?? ??? ????)", +DlgDocMeDescr : "??????????? ????????", +DlgDocMeAuthor : "????", +DlgDocMeCopy : "????????", +DlgDocPreview : "????????", + +// Templates Dialog +Templates : "?????????", +DlgTemplatesTitle : "???????? ?????????", +DlgTemplatesSelMsg : "????? ??? ??? ???? ???? ????????? ?????(??????? ???????? ??? ???? ?????):", +DlgTemplatesLoading : "????????? ???? ??? ?? ?? ??? ??? ??? ?????...", +DlgTemplatesNoTpl : "(??? ????????? ?????? ???? ???? ??? ??)", +DlgTemplatesReplace : "??? ?????? ?? ?????", + +// About Dialog +DlgAboutAboutTab : "FCKEditor ?? ???? ???", +DlgAboutBrowserInfoTab : "??????? ?? ???? ???", +DlgAboutLicenseTab : "????????", +DlgAboutVersion : "?????", +DlgAboutInfo : "???? ??????? ?? ???? ???? ?????:" +}; Property changes on: announcement/trunk/src/main/webapp/fckeditor/editor/lang/hi.js ___________________________________________________________________ Name: svn:eol-style + native Added: announcement/trunk/src/main/webapp/fckeditor/editor/lang/hr.js =================================================================== --- announcement/trunk/src/main/webapp/fckeditor/editor/lang/hr.js (rev 0) +++ announcement/trunk/src/main/webapp/fckeditor/editor/lang/hr.js 2008-06-30 02:54:27 UTC (rev 1002) @@ -0,0 +1,515 @@ +?/* + * FCKeditor - The text editor for Internet - http://www.fckeditor.net + * Copyright (C) 2003-2008 Frederico Caldeira Knabben + * + * == BEGIN LICENSE == + * + * Licensed under the terms of any of the following licenses at your + * choice: + * + * - GNU General Public License Version 2 or later (the "GPL") + * http://www.gnu.org/licenses/gpl.html + * + * - GNU Lesser General Public License Version 2.1 or later (the "LGPL") + * http://www.gnu.org/licenses/lgpl.html + * + * - Mozilla Public License Version 1.1 or later (the "MPL") + * http://www.mozilla.org/MPL/MPL-1.1.html + * + * == END LICENSE == + * + * Croatian language file. + */ + +var FCKLang = +{ +// Language direction : "ltr" (left to right) or "rtl" (right to left). +Dir : "ltr", + +ToolbarCollapse : "Smanji trake s alatima", +ToolbarExpand : "Proširi trake s alatima", + +// Toolbar Items and Context Menu +Save : "Snimi", +NewPage : "Nova stranica", +Preview : "Pregledaj", +Cut : "Izreži", +Copy : "Kopiraj", +Paste : "Zalijepi", +PasteText : "Zalijepi kao čisti tekst", +PasteWord : "Zalijepi iz Worda", +Print : "Ispiši", +SelectAll : "Odaberi sve", +RemoveFormat : "Ukloni formatiranje", +InsertLinkLbl : "Link", +InsertLink : "Ubaci/promijeni link", +RemoveLink : "Ukloni link", +Anchor : "Ubaci/promijeni sidro", +AnchorDelete : "Ukloni sidro", +InsertImageLbl : "Slika", +InsertImage : "Ubaci/promijeni sliku", +InsertFlashLbl : "Flash", +InsertFlash : "Ubaci/promijeni Flash", +InsertTableLbl : "Tablica", +InsertTable : "Ubaci/promijeni tablicu", +InsertLineLbl : "Linija", +InsertLine : "Ubaci vodoravnu liniju", +InsertSpecialCharLbl: "Posebni karakteri", +InsertSpecialChar : "Ubaci posebne znakove", +InsertSmileyLbl : "Smješko", +InsertSmiley : "Ubaci smješka", +About : "O FCKeditoru", +Bold : "Podebljaj", +Italic : "Ukosi", +Underline : "Potcrtano", +StrikeThrough : "Precrtano", +Subscript : "Subscript", +Superscript : "Superscript", +LeftJustify : "Lijevo poravnanje", +CenterJustify : "Središnje poravnanje", +RightJustify : "Desno poravnanje", +BlockJustify : "Blok poravnanje", +DecreaseIndent : "Pomakni ulijevo", +IncreaseIndent : "Pomakni udesno", +Blockquote : "Blockquote", +Undo : "Poništi", +Redo : "Ponovi", +NumberedListLbl : "Brojčana lista", +NumberedList : "Ubaci/ukloni brojčanu listu", +BulletedListLbl : "Obična lista", +BulletedList : "Ubaci/ukloni običnu listu", +ShowTableBorders : "Prikaži okvir tablice", +ShowDetails : "Prikaži detalje", +Style : "Stil", +FontFormat : "Format", +Font : "Font", +FontSize : "Veličina", +TextColor : "Boja teksta", +BGColor : "Boja pozadine", +Source : "Kôd", +Find : "Pronađi", +Replace : "Zamijeni", +SpellCheck : "Provjeri pravopis", +UniversalKeyboard : "Univerzalna tipkovnica", +PageBreakLbl : "Prijelom stranice", +PageBreak : "Ubaci prijelom stranice", + +Form : "Form", +Checkbox : "Checkbox", +RadioButton : "Radio Button", +TextField : "Text Field", +Textarea : "Textarea", +HiddenField : "Hidden Field", +Button : "Button", +SelectionField : "Selection Field", +ImageButton : "Image Button", + +FitWindow : "Povećaj veličinu editora", +ShowBlocks : "Prikaži blokove", + +// Context Menu +EditLink : "Promijeni link", +CellCM : "Ćelija", +RowCM : "Red", +ColumnCM : "Kolona", +InsertRowAfter : "Ubaci red poslije", +InsertRowBefore : "Ubaci red prije", +DeleteRows : "Izbriši redove", +InsertColumnAfter : "Ubaci kolonu poslije", +InsertColumnBefore : "Ubaci kolonu prije", +DeleteColumns : "Izbriši kolone", +InsertCellAfter : "Ubaci ćeliju poslije", +InsertCellBefore : "Ubaci ćeliju prije", +DeleteCells : "Izbriši ćelije", +MergeCells : "Spoji ćelije", +MergeRight : "Spoji desno", +MergeDown : "Spoji dolje", +HorizontalSplitCell : "Podijeli ćeliju vodoravno", +VerticalSplitCell : "Podijeli ćeliju okomito", +TableDelete : "Izbriši tablicu", +CellProperties : "Svojstva ćelije", +TableProperties : "Svojstva tablice", +ImageProperties : "Svojstva slike", +FlashProperties : "Flash svojstva", + +AnchorProp : "Svojstva sidra", +ButtonProp : "Image Button svojstva", +CheckboxProp : "Checkbox svojstva", +HiddenFieldProp : "Hidden Field svojstva", +RadioButtonProp : "Radio Button svojstva", +ImageButtonProp : "Image Button svojstva", +TextFieldProp : "Text Field svojstva", +SelectionFieldProp : "Selection svojstva", +TextareaProp : "Textarea svojstva", +FormProp : "Form svojstva", + +FontFormats : "Normal;Formatted;Address;Heading 1;Heading 2;Heading 3;Heading 4;Heading 5;Heading 6;Normal (DIV)", + +// Alerts and Messages +ProcessingXHTML : "Obrađujem XHTML. Molimo pričekajte...", +Done : "Završio", +PasteWordConfirm : "Tekst koji želite zalijepiti čini se da je kopiran iz Worda. Želite li prije očistiti tekst?", +NotCompatiblePaste : "Ova naredba je dostupna samo u Internet Exploreru 5.5 ili novijem. Želite li nastaviti bez čišćenja?", +UnknownToolbarItem : "Nepoznati član trake s alatima \"%1\"", +UnknownCommand : "Nepoznata naredba \"%1\"", +NotImplemented : "Naredba nije implementirana", +UnknownToolbarSet : "Traka s alatima \"%1\" ne postoji", +NoActiveX : "Vaše postavke pretraživača mogle bi ograničiti neke od mogućnosti editora. Morate uključiti opciju \"Run ActiveX controls and plug-ins\" u postavkama. Ukoliko to ne učinite, moguće su razliite greške tijekom rada.", +BrowseServerBlocked : "Pretraivač nije moguće otvoriti. Provjerite da li je uključeno blokiranje pop-up prozora.", +DialogBlocked : "Nije moguće otvoriti novi prozor. Provjerite da li je uključeno blokiranje pop-up prozora.", + +// Dialogs +DlgBtnOK : "OK", +DlgBtnCancel : "Poništi", +DlgBtnClose : "Zatvori", +DlgBtnBrowseServer : "Pretraži server", +DlgAdvancedTag : "Napredno", +DlgOpOther : "", +DlgInfoTab : "Info", +DlgAlertUrl : "Molimo unesite URL", + +// General Dialogs Labels +DlgGenNotSet : "", +DlgGenId : "Id", +DlgGenLangDir : "Smjer jezika", +DlgGenLangDirLtr : "S lijeva na desno (LTR)", +DlgGenLangDirRtl : "S desna na lijevo (RTL)", +DlgGenLangCode : "Kôd jezika", +DlgGenAccessKey : "Pristupna tipka", +DlgGenName : "Naziv", +DlgGenTabIndex : "Tab Indeks", +DlgGenLongDescr : "Dugački opis URL", +DlgGenClass : "Stylesheet klase", +DlgGenTitle : "Advisory naslov", +DlgGenContType : "Advisory vrsta sadržaja", +DlgGenLinkCharset : "Kodna stranica povezanih resursa", +DlgGenStyle : "Stil", + +// Image Dialog +DlgImgTitle : "Svojstva slika", +DlgImgInfoTab : "Info slike", +DlgImgBtnUpload : "Pošalji na server", +DlgImgURL : "URL", +DlgImgUpload : "Pošalji", +DlgImgAlt : "Alternativni tekst", +DlgImgWidth : "Širina", +DlgImgHeight : "Visina", +DlgImgLockRatio : "Zaključaj odnos", +DlgBtnResetSize : "Obriši veličinu", +DlgImgBorder : "Okvir", +DlgImgHSpace : "HSpace", +DlgImgVSpace : "VSpace", +DlgImgAlign : "Poravnaj", +DlgImgAlignLeft : "Lijevo", +DlgImgAlignAbsBottom: "Abs dolje", +DlgImgAlignAbsMiddle: "Abs sredina", +DlgImgAlignBaseline : "Bazno", +DlgImgAlignBottom : "Dolje", +DlgImgAlignMiddle : "Sredina", +DlgImgAlignRight : "Desno", +DlgImgAlignTextTop : "Vrh teksta", +DlgImgAlignTop : "Vrh", +DlgImgPreview : "Pregledaj", +DlgImgAlertUrl : "Unesite URL slike", +DlgImgLinkTab : "Link", + +// Flash Dialog +DlgFlashTitle : "Flash svojstva", +DlgFlashChkPlay : "Auto Play", +DlgFlashChkLoop : "Ponavljaj", +DlgFlashChkMenu : "Omogući Flash izbornik", +DlgFlashScale : "Omjer", +DlgFlashScaleAll : "Prikaži sve", +DlgFlashScaleNoBorder : "Bez okvira", +DlgFlashScaleFit : "Točna veličina", + +// Link Dialog +DlgLnkWindowTitle : "Link", +DlgLnkInfoTab : "Link Info", +DlgLnkTargetTab : "Meta", + +DlgLnkType : "Link vrsta", +DlgLnkTypeURL : "URL", +DlgLnkTypeAnchor : "Sidro na ovoj stranici", +DlgLnkTypeEMail : "E-Mail", +DlgLnkProto : "Protokol", +DlgLnkProtoOther : "", +DlgLnkURL : "URL", +DlgLnkAnchorSel : "Odaberi sidro", +DlgLnkAnchorByName : "Po nazivu sidra", +DlgLnkAnchorById : "Po Id elementa", +DlgLnkNoAnchors : "(Nema dostupnih sidra)", +DlgLnkEMail : "E-Mail adresa", +DlgLnkEMailSubject : "Naslov", +DlgLnkEMailBody : "Sadržaj poruke", +DlgLnkUpload : "Pošalji", +DlgLnkBtnUpload : "Pošalji na server", + +DlgLnkTarget : "Meta", +DlgLnkTargetFrame : "", +DlgLnkTargetPopup : "", +DlgLnkTargetBlank : "Novi prozor (_blank)", +DlgLnkTargetParent : "Roditeljski prozor (_parent)", +DlgLnkTargetSelf : "Isti prozor (_self)", +DlgLnkTargetTop : "Vršni prozor (_top)", +DlgLnkTargetFrameName : "Ime ciljnog okvira", +DlgLnkPopWinName : "Naziv popup prozora", +DlgLnkPopWinFeat : "Mogućnosti popup prozora", +DlgLnkPopResize : "Promjenljive veličine", +DlgLnkPopLocation : "Traka za lokaciju", +DlgLnkPopMenu : "Izborna traka", +DlgLnkPopScroll : "Scroll traka", +DlgLnkPopStatus : "Statusna traka", +DlgLnkPopToolbar : "Traka s alatima", +DlgLnkPopFullScrn : "Cijeli ekran (IE)", +DlgLnkPopDependent : "Ovisno (Netscape)", +DlgLnkPopWidth : "Širina", +DlgLnkPopHeight : "Visina", +DlgLnkPopLeft : "Lijeva pozicija", +DlgLnkPopTop : "Gornja pozicija", + +DlnLnkMsgNoUrl : "Molimo upišite URL link", +DlnLnkMsgNoEMail : "Molimo upišite e-mail adresu", +DlnLnkMsgNoAnchor : "Molimo odaberite sidro", +DlnLnkMsgInvPopName : "Ime popup prozora mora početi sa slovom i ne smije sadržavati razmake", + +// Color Dialog +DlgColorTitle : "Odaberite boju", +DlgColorBtnClear : "Obriši", +DlgColorHighlight : "Osvijetli", +DlgColorSelected : "Odaberi", + +// Smiley Dialog +DlgSmileyTitle : "Ubaci smješka", + +// Special Character Dialog +DlgSpecialCharTitle : "Odaberite posebni karakter", + +// Table Dialog +DlgTableTitle : "Svojstva tablice", +DlgTableRows : "Redova", +DlgTableColumns : "Kolona", +DlgTableBorder : "Veličina okvira", +DlgTableAlign : "Poravnanje", +DlgTableAlignNotSet : "", +DlgTableAlignLeft : "Lijevo", +DlgTableAlignCenter : "Središnje", +DlgTableAlignRight : "Desno", +DlgTableWidth : "Širina", +DlgTableWidthPx : "piksela", +DlgTableWidthPc : "postotaka", +DlgTableHeight : "Visina", +DlgTableCellSpace : "Prostornost ćelija", +DlgTableCellPad : "Razmak ćelija", +DlgTableCaption : "Naslov", +DlgTableSummary : "Sažetak", + +// Table Cell Dialog +DlgCellTitle : "Svojstva ćelije", +DlgCellWidth : "Širina", +DlgCellWidthPx : "piksela", +DlgCellWidthPc : "postotaka", +DlgCellHeight : "Visina", +DlgCellWordWrap : "Word Wrap", +DlgCellWordWrapNotSet : "", +DlgCellWordWrapYes : "Da", +DlgCellWordWrapNo : "Ne", +DlgCellHorAlign : "Vodoravno poravnanje", +DlgCellHorAlignNotSet : "", +DlgCellHorAlignLeft : "Lijevo", +DlgCellHorAlignCenter : "Središnje", +DlgCellHorAlignRight: "Desno", +DlgCellVerAlign : "Okomito poravnanje", +DlgCellVerAlignNotSet : "", +DlgCellVerAlignTop : "Gornje", +DlgCellVerAlignMiddle : "Srednišnje", +DlgCellVerAlignBottom : "Donje", +DlgCellVerAlignBaseline : "Bazno", +DlgCellRowSpan : "Spajanje redova", +DlgCellCollSpan : "Spajanje kolona", +DlgCellBackColor : "Boja pozadine", +DlgCellBorderColor : "Boja okvira", +DlgCellBtnSelect : "Odaberi...", + +// Find and Replace Dialog +DlgFindAndReplaceTitle : "Pronađi i zamijeni", + +// Find Dialog +DlgFindTitle : "Pronađi", +DlgFindFindBtn : "Pronađi", +DlgFindNotFoundMsg : "Traženi tekst nije pronađen.", + +// Replace Dialog +DlgReplaceTitle : "Zamijeni", +DlgReplaceFindLbl : "Pronađi:", +DlgReplaceReplaceLbl : "Zamijeni s:", +DlgReplaceCaseChk : "Usporedi mala/velika slova", +DlgReplaceReplaceBtn : "Zamijeni", +DlgReplaceReplAllBtn : "Zamijeni sve", +DlgReplaceWordChk : "Usporedi cijele riječi", + +// Paste Operations / Dialog +PasteErrorCut : "Sigurnosne postavke Vašeg pretraživača ne dozvoljavaju operacije automatskog izrezivanja. Molimo koristite kraticu na tipkovnici (Ctrl+X).", +PasteErrorCopy : "Sigurnosne postavke Vašeg pretraživača ne dozvoljavaju operacije automatskog kopiranja. Molimo koristite kraticu na tipkovnici (Ctrl+C).", + +PasteAsText : "Zalijepi kao čisti tekst", +PasteFromWord : "Zalijepi iz Worda", + +DlgPasteMsg2 : "Molimo zaljepite unutar doljnjeg okvira koristeći tipkovnicu (Ctrl+V) i kliknite OK.", +DlgPasteSec : "Zbog sigurnosnih postavki Vašeg pretraživača, editor nema direktan pristup Vašem međuspremniku. Potrebno je ponovno zalijepiti tekst u ovaj prozor.", +DlgPasteIgnoreFont : "Zanemari definiciju vrste fonta", +DlgPasteRemoveStyles : "Ukloni definicije stilova", + +// Color Picker +ColorAutomatic : "Automatski", +ColorMoreColors : "Više boja...", + +// Document Properties +DocProps : "Svojstva dokumenta", + +// Anchor Dialog +DlgAnchorTitle : "Svojstva sidra", +DlgAnchorName : "Ime sidra", +DlgAnchorErrorName : "Molimo unesite ime sidra", + +// Speller Pages Dialog +DlgSpellNotInDic : "Nije u rječniku", +DlgSpellChangeTo : "Promijeni u", +DlgSpellBtnIgnore : "Zanemari", +DlgSpellBtnIgnoreAll : "Zanemari sve", +DlgSpellBtnReplace : "Zamijeni", +DlgSpellBtnReplaceAll : "Zamijeni sve", +DlgSpellBtnUndo : "Vrati", +DlgSpellNoSuggestions : "-Nema preporuke-", +DlgSpellProgress : "Provjera u tijeku...", +DlgSpellNoMispell : "Provjera završena: Nema grešaka", +DlgSpellNoChanges : "Provjera završena: Nije napravljena promjena", +DlgSpellOneChange : "Provjera završena: Jedna riječ promjenjena", +DlgSpellManyChanges : "Provjera završena: Promijenjeno %1 riječi", + +IeSpellDownload : "Provjera pravopisa nije instalirana. Želite li skinuti provjeru pravopisa?", + +// Button Dialog +DlgButtonText : "Tekst (vrijednost)", +DlgButtonType : "Vrsta", +DlgButtonTypeBtn : "Gumb", +DlgButtonTypeSbm : "Pošalji", +DlgButtonTypeRst : "Poništi", + +// Checkbox and Radio Button Dialogs +DlgCheckboxName : "Ime", +DlgCheckboxValue : "Vrijednost", +DlgCheckboxSelected : "Odabrano", + +// Form Dialog +DlgFormName : "Ime", +DlgFormAction : "Akcija", +DlgFormMethod : "Metoda", + +// Select Field Dialog +DlgSelectName : "Ime", +DlgSelectValue : "Vrijednost", +DlgSelectSize : "Veličina", +DlgSelectLines : "linija", +DlgSelectChkMulti : "Dozvoli višestruki odabir", +DlgSelectOpAvail : "Dostupne opcije", +DlgSelectOpText : "Tekst", +DlgSelectOpValue : "Vrijednost", +DlgSelectBtnAdd : "Dodaj", +DlgSelectBtnModify : "Promijeni", +DlgSelectBtnUp : "Gore", +DlgSelectBtnDown : "Dolje", +DlgSelectBtnSetValue : "Postavi kao odabranu vrijednost", +DlgSelectBtnDelete : "Obriši", + +// Textarea Dialog +DlgTextareaName : "Ime", +DlgTextareaCols : "Kolona", +DlgTextareaRows : "Redova", + +// Text Field Dialog +DlgTextName : "Ime", +DlgTextValue : "Vrijednost", +DlgTextCharWidth : "Širina", +DlgTextMaxChars : "Najviše karaktera", +DlgTextType : "Vrsta", +DlgTextTypeText : "Tekst", +DlgTextTypePass : "Šifra", + +// Hidden Field Dialog +DlgHiddenName : "Ime", +DlgHiddenValue : "Vrijednost", + +// Bulleted List Dialog +BulletedListProp : "Svojstva liste", +NumberedListProp : "Svojstva brojčane liste", +DlgLstStart : "Početak", +DlgLstType : "Vrsta", +DlgLstTypeCircle : "Krug", +DlgLstTypeDisc : "Disk", +DlgLstTypeSquare : "Kvadrat", +DlgLstTypeNumbers : "Brojevi (1, 2, 3)", +DlgLstTypeLCase : "Mala slova (a, b, c)", +DlgLstTypeUCase : "Velika slova (A, B, C)", +DlgLstTypeSRoman : "Male rimske brojke (i, ii, iii)", +DlgLstTypeLRoman : "Velike rimske brojke (I, II, III)", + +// Document Properties Dialog +DlgDocGeneralTab : "Općenito", +DlgDocBackTab : "Pozadina", +DlgDocColorsTab : "Boje i margine", +DlgDocMetaTab : "Meta Data", + +DlgDocPageTitle : "Naslov stranice", +DlgDocLangDir : "Smjer jezika", +DlgDocLangDirLTR : "S lijeva na desno", +DlgDocLangDirRTL : "S desna na lijevo", +DlgDocLangCode : "Kôd jezika", +DlgDocCharSet : "Enkodiranje znakova", +DlgDocCharSetCE : "Središnja Europa", +DlgDocCharSetCT : "Tradicionalna kineska (Big5)", +DlgDocCharSetCR : "Ćirilica", +DlgDocCharSetGR : "Grčka", +DlgDocCharSetJP : "Japanska", +DlgDocCharSetKR : "Koreanska", +DlgDocCharSetTR : "Turska", +DlgDocCharSetUN : "Unicode (UTF-8)", +DlgDocCharSetWE : "Zapadna Europa", +DlgDocCharSetOther : "Ostalo enkodiranje znakova", + +DlgDocDocType : "Zaglavlje vrste dokumenta", +DlgDocDocTypeOther : "Ostalo zaglavlje vrste dokumenta", +DlgDocIncXHTML : "Ubaci XHTML deklaracije", +DlgDocBgColor : "Boja pozadine", +DlgDocBgImage : "URL slike pozadine", +DlgDocBgNoScroll : "Pozadine se ne pomiče", +DlgDocCText : "Tekst", +DlgDocCLink : "Link", +DlgDocCVisited : "Posjećeni link", +DlgDocCActive : "Aktivni link", +DlgDocMargins : "Margine stranice", +DlgDocMaTop : "Vrh", +DlgDocMaLeft : "Lijevo", +DlgDocMaRight : "Desno", +DlgDocMaBottom : "Dolje", +DlgDocMeIndex : "Ključne riječi dokumenta (odvojene zarezom)", +DlgDocMeDescr : "Opis dokumenta", +DlgDocMeAuthor : "Autor", +DlgDocMeCopy : "Autorska prava", +DlgDocPreview : "Pregledaj", + +// Templates Dialog +Templates : "Predlošci", +DlgTemplatesTitle : "Predlošci sadržaja", +DlgTemplatesSelMsg : "Molimo odaberite predložak koji želite otvoriti
        (stvarni sadržaj će biti izgubljen):", +DlgTemplatesLoading : "Učitavam listu predložaka. Molimo pričekajte...", +DlgTemplatesNoTpl : "(Nema definiranih predložaka)", +DlgTemplatesReplace : "Zamijeni trenutne sadržaje", + +// About Dialog +DlgAboutAboutTab : "O FCKEditoru", +DlgAboutBrowserInfoTab : "Podaci o pretraživaču", +DlgAboutLicenseTab : "Licenca", +DlgAboutVersion : "inačica", +DlgAboutInfo : "Za više informacija posjetite" +}; Property changes on: announcement/trunk/src/main/webapp/fckeditor/editor/lang/hr.js ___________________________________________________________________ Name: svn:eol-style + native Added: announcement/trunk/src/main/webapp/fckeditor/editor/lang/hu.js =================================================================== --- announcement/trunk/src/main/webapp/fckeditor/editor/lang/hu.js (rev 0) +++ announcement/trunk/src/main/webapp/fckeditor/editor/lang/hu.js 2008-06-30 02:54:27 UTC (rev 1002) @@ -0,0 +1,515 @@ +?/* + * FCKeditor - The text editor for Internet - http://www.fckeditor.net + * Copyright (C) 2003-2008 Frederico Caldeira Knabben + * + * == BEGIN LICENSE == + * + * Licensed under the terms of any of the following licenses at your + * choice: + * + * - GNU General Public License Version 2 or later (the "GPL") + * http://www.gnu.org/licenses/gpl.html + * + * - GNU Lesser General Public License Version 2.1 or later (the "LGPL") + * http://www.gnu.org/licenses/lgpl.html + * + * - Mozilla Public License Version 1.1 or later (the "MPL") + * http://www.mozilla.org/MPL/MPL-1.1.html + * + * == END LICENSE == + * + * Hungarian language file. + */ + +var FCKLang = +{ +// Language direction : "ltr" (left to right) or "rtl" (right to left). +Dir : "ltr", + +ToolbarCollapse : "Eszköztár elrejtése", +ToolbarExpand : "Eszköztár megjelenítése", + +// Toolbar Items and Context Menu +Save : "Mentés", +NewPage : "Új oldal", +Preview : "Előnézet", +Cut : "Kivágás", +Copy : "Másolás", +Paste : "Beillesztés", +PasteText : "Beillesztés formázás nélkül", +PasteWord : "Beillesztés Word-ből", +Print : "Nyomtatás", +SelectAll : "Mindent kijelöl", +RemoveFormat : "Formázás eltávolítása", +InsertLinkLbl : "Hivatkozás", +InsertLink : "Hivatkozás beillesztése/módosítása", +RemoveLink : "Hivatkozás törlése", +Anchor : "Horgony beillesztése/szerkesztése", +AnchorDelete : "Horgony eltávolítása", +InsertImageLbl : "Kép", +InsertImage : "Kép beillesztése/módosítása", +InsertFlashLbl : "Flash", +InsertFlash : "Flash beillesztése, módosítása", +InsertTableLbl : "Táblázat", +InsertTable : "Táblázat beillesztése/módosítása", +InsertLineLbl : "Vonal", +InsertLine : "Elválasztóvonal beillesztése", +InsertSpecialCharLbl: "Speciális karakter", +InsertSpecialChar : "Speciális karakter beillesztése", +InsertSmileyLbl : "Hangulatjelek", +InsertSmiley : "Hangulatjelek beillesztése", +About : "FCKeditor névjegy", +Bold : "Félkövér", +Italic : "Dőlt", +Underline : "Aláhúzott", +StrikeThrough : "Áthúzott", +Subscript : "Alsó index", +Superscript : "Felső index", +LeftJustify : "Balra", +CenterJustify : "Középre", +RightJustify : "Jobbra", +BlockJustify : "Sorkizárt", +DecreaseIndent : "Behúzás csökkentése", +IncreaseIndent : "Behúzás növelése", +Blockquote : "Idézet blokk", +Undo : "Visszavonás", +Redo : "Ismétlés", +NumberedListLbl : "Számozás", +NumberedList : "Számozás beillesztése/törlése", +BulletedListLbl : "Felsorolás", +BulletedList : "Felsorolás beillesztése/törlése", +ShowTableBorders : "Táblázat szegély mutatása", +ShowDetails : "Részletek mutatása", +Style : "Stílus", +FontFormat : "Formátum", +Font : "Betűtípus", +FontSize : "Méret", +TextColor : "Betűszín", +BGColor : "Háttérszín", +Source : "Forráskód", +Find : "Keresés", +Replace : "Csere", +SpellCheck : "Helyesírás-ellenőrzés", +UniversalKeyboard : "Univerzális billentyűzet", +PageBreakLbl : "Oldaltörés", +PageBreak : "Oldaltörés beillesztése", + +Form : "Űrlap", +Checkbox : "Jelölőnégyzet", +RadioButton : "Választógomb", +TextField : "Szövegmező", +Textarea : "Szövegterület", +HiddenField : "Rejtettmező", +Button : "Gomb", +SelectionField : "Legördülő lista", +ImageButton : "Képgomb", + +FitWindow : "Maximalizálás", +ShowBlocks : "Blokkok megjelenítése", + +// Context Menu +EditLink : "Hivatkozás módosítása", +CellCM : "Cella", +RowCM : "Sor", +ColumnCM : "Oszlop", +InsertRowAfter : "Sor beillesztése az aktuális sor mögé", +InsertRowBefore : "Sor beillesztése az aktuális sor elé", +DeleteRows : "Sorok törlése", +InsertColumnAfter : "Oszlop beillesztése az aktuális oszlop mögé", +InsertColumnBefore : "Oszlop beillesztése az aktuális oszlop elé", +DeleteColumns : "Oszlopok törlése", +InsertCellAfter : "Cella beillesztése az aktuális cella mögé", +InsertCellBefore : "Cella beillesztése az aktuális cella elé", +DeleteCells : "Cellák törlése", +MergeCells : "Cellák egyesítése", +MergeRight : "Cellák egyesítése jobbra", +MergeDown : "Cellák egyesítése lefelé", +HorizontalSplitCell : "Cellák szétválasztása vízszintesen", +VerticalSplitCell : "Cellák szétválasztása függőlegesen", +TableDelete : "Táblázat törlése", +CellProperties : "Cella tulajdonságai", +TableProperties : "Táblázat tulajdonságai", +ImageProperties : "Kép tulajdonságai", +FlashProperties : "Flash tulajdonságai", + +AnchorProp : "Horgony tulajdonságai", +ButtonProp : "Gomb tulajdonságai", +CheckboxProp : "Jelölőnégyzet tulajdonságai", +HiddenFieldProp : "Rejtett mező tulajdonságai", +RadioButtonProp : "Választógomb tulajdonságai", +ImageButtonProp : "Képgomb tulajdonságai", +TextFieldProp : "Szövegmező tulajdonságai", +SelectionFieldProp : "Legördülő lista tulajdonságai", +TextareaProp : "Szövegterület tulajdonságai", +FormProp : "Űrlap tulajdonságai", + +FontFormats : "Normál;Formázott;Címsor;Fejléc 1;Fejléc 2;Fejléc 3;Fejléc 4;Fejléc 5;Fejléc 6;Bekezdés (DIV)", + +// Alerts and Messages +ProcessingXHTML : "XHTML feldolgozása. Kérem várjon...", +Done : "Kész", +PasteWordConfirm : "A beilleszteni kívánt szöveg Word-ből van másolva. El kívánja távolítani a formázást a beillesztés előtt?", +NotCompatiblePaste : "Ez a parancs csak Internet Explorer 5.5 verziótól használható. Megpróbálja beilleszteni a szöveget az eredeti formázással?", +UnknownToolbarItem : "Ismeretlen eszköztár elem \"%1\"", +UnknownCommand : "Ismeretlen parancs \"%1\"", +NotImplemented : "A parancs nem hajtható végre", +UnknownToolbarSet : "Az eszközkészlet \"%1\" nem létezik", +NoActiveX : "A böngésző biztonsági beállításai korlátozzák a szerkesztő lehetőségeit. Engedélyezni kell ezt az opciót: \"Run ActiveX controls and plug-ins\". Ettől függetlenül előfordulhatnak hibaüzenetek ill. bizonyos funkciók hiányozhatnak.", +BrowseServerBlocked : "Nem lehet megnyitni a fájlböngészőt. Bizonyosodjon meg róla, hogy a felbukkanó ablakok engedélyezve vannak.", +DialogBlocked : "Nem lehet megnyitni a párbeszédablakot. Bizonyosodjon meg róla, hogy a felbukkanó ablakok engedélyezve vannak.", + +// Dialogs +DlgBtnOK : "Rendben", +DlgBtnCancel : "Mégsem", +DlgBtnClose : "Bezárás", +DlgBtnBrowseServer : "Böngészés a szerveren", +DlgAdvancedTag : "További opciók", +DlgOpOther : "Egyéb", +DlgInfoTab : "Alaptulajdonságok", +DlgAlertUrl : "Illessze be a webcímet", + +// General Dialogs Labels +DlgGenNotSet : "", +DlgGenId : "Azonosító", +DlgGenLangDir : "Írás iránya", +DlgGenLangDirLtr : "Balról jobbra", +DlgGenLangDirRtl : "Jobbról balra", +DlgGenLangCode : "Nyelv kódja", +DlgGenAccessKey : "Billentyűkombináció", +DlgGenName : "Név", +DlgGenTabIndex : "Tabulátor index", +DlgGenLongDescr : "Részletes leírás webcíme", +DlgGenClass : "Stíluskészlet", +DlgGenTitle : "Súgócimke", +DlgGenContType : "Súgó tartalomtípusa", +DlgGenLinkCharset : "Hivatkozott tartalom kódlapja", +DlgGenStyle : "Stílus", + +// Image Dialog +DlgImgTitle : "Kép tulajdonságai", +DlgImgInfoTab : "Alaptulajdonságok", +DlgImgBtnUpload : "Küldés a szerverre", +DlgImgURL : "Hivatkozás", +DlgImgUpload : "Feltöltés", +DlgImgAlt : "Buborék szöveg", +DlgImgWidth : "Szélesség", +DlgImgHeight : "Magasság", +DlgImgLockRatio : "Arány megtartása", +DlgBtnResetSize : "Eredeti méret", +DlgImgBorder : "Keret", +DlgImgHSpace : "Vízsz. táv", +DlgImgVSpace : "Függ. táv", +DlgImgAlign : "Igazítás", +DlgImgAlignLeft : "Bal", +DlgImgAlignAbsBottom: "Legaljára", +DlgImgAlignAbsMiddle: "Közepére", +DlgImgAlignBaseline : "Alapvonalhoz", +DlgImgAlignBottom : "Aljára", +DlgImgAlignMiddle : "Középre", +DlgImgAlignRight : "Jobbra", +DlgImgAlignTextTop : "Szöveg tetejére", +DlgImgAlignTop : "Tetejére", +DlgImgPreview : "Előnézet", +DlgImgAlertUrl : "Töltse ki a kép webcímét", +DlgImgLinkTab : "Hivatkozás", + +// Flash Dialog +DlgFlashTitle : "Flash tulajdonságai", +DlgFlashChkPlay : "Automata lejátszás", +DlgFlashChkLoop : "Folyamatosan", +DlgFlashChkMenu : "Flash menü engedélyezése", +DlgFlashScale : "Méretezés", +DlgFlashScaleAll : "Mindent mutat", +DlgFlashScaleNoBorder : "Keret nélkül", +DlgFlashScaleFit : "Teljes kitöltés", + +// Link Dialog +DlgLnkWindowTitle : "Hivatkozás tulajdonságai", +DlgLnkInfoTab : "Alaptulajdonságok", +DlgLnkTargetTab : "Megjelenítés", + +DlgLnkType : "Hivatkozás típusa", +DlgLnkTypeURL : "Webcím", +DlgLnkTypeAnchor : "Horgony az oldalon", +DlgLnkTypeEMail : "E-Mail", +DlgLnkProto : "Protokoll", +DlgLnkProtoOther : "", +DlgLnkURL : "Webcím", +DlgLnkAnchorSel : "Horgony választása", +DlgLnkAnchorByName : "Horgony név szerint", +DlgLnkAnchorById : "Azonosító szerint", +DlgLnkNoAnchors : "(Nincs horgony a dokumentumban)", +DlgLnkEMail : "E-Mail cím", +DlgLnkEMailSubject : "Üzenet tárgya", +DlgLnkEMailBody : "Üzenet", +DlgLnkUpload : "Feltöltés", +DlgLnkBtnUpload : "Küldés a szerverre", + +DlgLnkTarget : "Tartalom megjelenítése", +DlgLnkTargetFrame : "", +DlgLnkTargetPopup : "", +DlgLnkTargetBlank : "Új ablakban (_blank)", +DlgLnkTargetParent : "Szülő ablakban (_parent)", +DlgLnkTargetSelf : "Azonos ablakban (_self)", +DlgLnkTargetTop : "Legfelső ablakban (_top)", +DlgLnkTargetFrameName : "Keret neve", +DlgLnkPopWinName : "Felugró ablak neve", +DlgLnkPopWinFeat : "Felugró ablak jellemzői", +DlgLnkPopResize : "Méretezhető", +DlgLnkPopLocation : "Címsor", +DlgLnkPopMenu : "Menü sor", +DlgLnkPopScroll : "Gördítősáv", +DlgLnkPopStatus : "Állapotsor", +DlgLnkPopToolbar : "Eszköztár", +DlgLnkPopFullScrn : "Teljes képernyő (csak IE)", +DlgLnkPopDependent : "Szülőhöz kapcsolt (csak Netscape)", +DlgLnkPopWidth : "Szélesség", +DlgLnkPopHeight : "Magasság", +DlgLnkPopLeft : "Bal pozíció", +DlgLnkPopTop : "Felső pozíció", + +DlnLnkMsgNoUrl : "Adja meg a hivatkozás webcímét", +DlnLnkMsgNoEMail : "Adja meg az E-Mail címet", +DlnLnkMsgNoAnchor : "Válasszon egy horgonyt", +DlnLnkMsgInvPopName : "A felbukkanó ablak neve alfanumerikus karakterrel kezdôdjön, valamint ne tartalmazzon szóközt", + +// Color Dialog +DlgColorTitle : "Színválasztás", +DlgColorBtnClear : "Törlés", +DlgColorHighlight : "Előnézet", +DlgColorSelected : "Kiválasztott", + +// Smiley Dialog +DlgSmileyTitle : "Hangulatjel beszúrása", + +// Special Character Dialog +DlgSpecialCharTitle : "Speciális karakter választása", + +// Table Dialog +DlgTableTitle : "Táblázat tulajdonságai", +DlgTableRows : "Sorok", +DlgTableColumns : "Oszlopok", +DlgTableBorder : "Szegélyméret", +DlgTableAlign : "Igazítás", +DlgTableAlignNotSet : "", +DlgTableAlignLeft : "Balra", +DlgTableAlignCenter : "Középre", +DlgTableAlignRight : "Jobbra", +DlgTableWidth : "Szélesség", +DlgTableWidthPx : "képpont", +DlgTableWidthPc : "százalék", +DlgTableHeight : "Magasság", +DlgTableCellSpace : "Cella térköz", +DlgTableCellPad : "Cella belső margó", +DlgTableCaption : "Felirat", +DlgTableSummary : "Leírás", + +// Table Cell Dialog +DlgCellTitle : "Cella tulajdonságai", +DlgCellWidth : "Szélesség", +DlgCellWidthPx : "képpont", +DlgCellWidthPc : "százalék", +DlgCellHeight : "Magasság", +DlgCellWordWrap : "Sortörés", +DlgCellWordWrapNotSet : "", +DlgCellWordWrapYes : "Igen", +DlgCellWordWrapNo : "Nem", +DlgCellHorAlign : "Vízsz. igazítás", +DlgCellHorAlignNotSet : "", +DlgCellHorAlignLeft : "Balra", +DlgCellHorAlignCenter : "Középre", +DlgCellHorAlignRight: "Jobbra", +DlgCellVerAlign : "Függ. igazítás", +DlgCellVerAlignNotSet : "", +DlgCellVerAlignTop : "Tetejére", +DlgCellVerAlignMiddle : "Középre", +DlgCellVerAlignBottom : "Aljára", +DlgCellVerAlignBaseline : "Egyvonalba", +DlgCellRowSpan : "Sorok egyesítése", +DlgCellCollSpan : "Oszlopok egyesítése", +DlgCellBackColor : "Háttérszín", +DlgCellBorderColor : "Szegélyszín", +DlgCellBtnSelect : "Kiválasztás...", + +// Find and Replace Dialog +DlgFindAndReplaceTitle : "Keresés és csere", + +// Find Dialog +DlgFindTitle : "Keresés", +DlgFindFindBtn : "Keresés", +DlgFindNotFoundMsg : "A keresett szöveg nem található.", + +// Replace Dialog +DlgReplaceTitle : "Csere", +DlgReplaceFindLbl : "Keresett szöveg:", +DlgReplaceReplaceLbl : "Csere erre:", +DlgReplaceCaseChk : "kis- és nagybetű megkülönböztetése", +DlgReplaceReplaceBtn : "Csere", +DlgReplaceReplAllBtn : "Az összes cseréje", +DlgReplaceWordChk : "csak ha ez a teljes szó", + +// Paste Operations / Dialog +PasteErrorCut : "A böngésző biztonsági beállításai nem engedélyezik a szerkesztőnek, hogy végrehajtsa a kivágás műveletet. Használja az alábbi billentyűkombinációt (Ctrl+X).", +PasteErrorCopy : "A böngésző biztonsági beállításai nem engedélyezik a szerkesztőnek, hogy végrehajtsa a másolás műveletet. Használja az alábbi billentyűkombinációt (Ctrl+X).", + +PasteAsText : "Beillesztés formázatlan szövegként", +PasteFromWord : "Beillesztés Word-ből", + +DlgPasteMsg2 : "Másolja be az alábbi mezőbe a Ctrl+V billentyűk lenyomásával, majd nyomjon Rendben-t.", +DlgPasteSec : "A böngésző biztonsági beállításai miatt a szerkesztő nem képes hozzáférni a vágólap adataihoz. Illeszd be újra ebben az ablakban.", +DlgPasteIgnoreFont : "Betű formázások megszüntetése", +DlgPasteRemoveStyles : "Stílusok eltávolítása", + +// Color Picker +ColorAutomatic : "Automatikus", +ColorMoreColors : "További színek...", + +// Document Properties +DocProps : "Dokumentum tulajdonságai", + +// Anchor Dialog +DlgAnchorTitle : "Horgony tulajdonságai", +DlgAnchorName : "Horgony neve", +DlgAnchorErrorName : "Kérem adja meg a horgony nevét", + +// Speller Pages Dialog +DlgSpellNotInDic : "Nincs a szótárban", +DlgSpellChangeTo : "Módosítás", +DlgSpellBtnIgnore : "Kihagyja", +DlgSpellBtnIgnoreAll : "Mindet kihagyja", +DlgSpellBtnReplace : "Csere", +DlgSpellBtnReplaceAll : "Összes cseréje", +DlgSpellBtnUndo : "Visszavonás", +DlgSpellNoSuggestions : "Nincs javaslat", +DlgSpellProgress : "Helyesírás-ellenőrzés folyamatban...", +DlgSpellNoMispell : "Helyesírás-ellenőrzés kész: Nem találtam hibát", +DlgSpellNoChanges : "Helyesírás-ellenőrzés kész: Nincs változtatott szó", +DlgSpellOneChange : "Helyesírás-ellenőrzés kész: Egy szó cserélve", +DlgSpellManyChanges : "Helyesírás-ellenőrzés kész: %1 szó cserélve", + +IeSpellDownload : "A helyesírás-ellenőrző nincs telepítve. Szeretné letölteni most?", + +// Button Dialog +DlgButtonText : "Szöveg (Érték)", +DlgButtonType : "Típus", +DlgButtonTypeBtn : "Gomb", +DlgButtonTypeSbm : "Küldés", +DlgButtonTypeRst : "Alaphelyzet", + +// Checkbox and Radio Button Dialogs +DlgCheckboxName : "Név", +DlgCheckboxValue : "Érték", +DlgCheckboxSelected : "Kiválasztott", + +// Form Dialog +DlgFormName : "Név", +DlgFormAction : "Adatfeldolgozást végző hivatkozás", +DlgFormMethod : "Adatküldés módja", + +// Select Field Dialog +DlgSelectName : "Név", +DlgSelectValue : "Érték", +DlgSelectSize : "Méret", +DlgSelectLines : "sor", +DlgSelectChkMulti : "több sor is kiválasztható", +DlgSelectOpAvail : "Elérhető opciók", +DlgSelectOpText : "Szöveg", +DlgSelectOpValue : "Érték", +DlgSelectBtnAdd : "Hozzáad", +DlgSelectBtnModify : "Módosít", +DlgSelectBtnUp : "Fel", +DlgSelectBtnDown : "Le", +DlgSelectBtnSetValue : "Legyen az alapértelmezett érték", +DlgSelectBtnDelete : "Töröl", + +// Textarea Dialog +DlgTextareaName : "Név", +DlgTextareaCols : "Karakterek száma egy sorban", +DlgTextareaRows : "Sorok száma", + +// Text Field Dialog +DlgTextName : "Név", +DlgTextValue : "Érték", +DlgTextCharWidth : "Megjelenített karakterek száma", +DlgTextMaxChars : "Maximális karakterszám", +DlgTextType : "Típus", +DlgTextTypeText : "Szöveg", +DlgTextTypePass : "Jelszó", + +// Hidden Field Dialog +DlgHiddenName : "Név", +DlgHiddenValue : "Érték", + +// Bulleted List Dialog +BulletedListProp : "Felsorolás tulajdonságai", +NumberedListProp : "Számozás tulajdonságai", +DlgLstStart : "Start", +DlgLstType : "Formátum", +DlgLstTypeCircle : "Kör", +DlgLstTypeDisc : "Lemez", +DlgLstTypeSquare : "Négyzet", +DlgLstTypeNumbers : "Számok (1, 2, 3)", +DlgLstTypeLCase : "Kisbetűk (a, b, c)", +DlgLstTypeUCase : "Nagybetűk (A, B, C)", +DlgLstTypeSRoman : "Kis római számok (i, ii, iii)", +DlgLstTypeLRoman : "Nagy római számok (I, II, III)", + +// Document Properties Dialog +DlgDocGeneralTab : "Általános", +DlgDocBackTab : "Háttér", +DlgDocColorsTab : "Színek és margók", +DlgDocMetaTab : "Meta adatok", + +DlgDocPageTitle : "Oldalcím", +DlgDocLangDir : "Írás iránya", +DlgDocLangDirLTR : "Balról jobbra", +DlgDocLangDirRTL : "Jobbról balra", +DlgDocLangCode : "Nyelv kód", +DlgDocCharSet : "Karakterkódolás", +DlgDocCharSetCE : "Közép-Európai", +DlgDocCharSetCT : "Kínai Tradicionális (Big5)", +DlgDocCharSetCR : "Cyrill", +DlgDocCharSetGR : "Görög", +DlgDocCharSetJP : "Japán", +DlgDocCharSetKR : "Koreai", +DlgDocCharSetTR : "Török", +DlgDocCharSetUN : "Unicode (UTF-8)", +DlgDocCharSetWE : "Nyugat-Európai", +DlgDocCharSetOther : "Más karakterkódolás", + +DlgDocDocType : "Dokumentum típus fejléc", +DlgDocDocTypeOther : "Más dokumentum típus fejléc", +DlgDocIncXHTML : "XHTML deklarációk beillesztése", +DlgDocBgColor : "Háttérszín", +DlgDocBgImage : "Háttérkép cím", +DlgDocBgNoScroll : "Nem gördíthető háttér", +DlgDocCText : "Szöveg", +DlgDocCLink : "Cím", +DlgDocCVisited : "Látogatott cím", +DlgDocCActive : "Aktív cím", +DlgDocMargins : "Oldal margók", +DlgDocMaTop : "Felső", +DlgDocMaLeft : "Bal", +DlgDocMaRight : "Jobb", +DlgDocMaBottom : "Alsó", +DlgDocMeIndex : "Dokumentum keresőszavak (vesszővel elválasztva)", +DlgDocMeDescr : "Dokumentum leírás", +DlgDocMeAuthor : "Szerző", +DlgDocMeCopy : "Szerzői jog", +DlgDocPreview : "Előnézet", + +// Templates Dialog +Templates : "Sablonok", +DlgTemplatesTitle : "Elérhető sablonok", +DlgTemplatesSelMsg : "Válassza ki melyik sablon nyíljon meg a szerkesztőben
        (a jelenlegi tartalom elveszik):", +DlgTemplatesLoading : "Sablon lista betöltése. Kis türelmet...", +DlgTemplatesNoTpl : "(Nincs sablon megadva)", +DlgTemplatesReplace : "Kicseréli a jelenlegi tartalmat", + +// About Dialog +DlgAboutAboutTab : "Névjegy", +DlgAboutBrowserInfoTab : "Böngésző információ", +DlgAboutLicenseTab : "Licensz", +DlgAboutVersion : "verzió", +DlgAboutInfo : "További információkért látogasson el ide:" +}; Property changes on: announcement/trunk/src/main/webapp/fckeditor/editor/lang/hu.js ___________________________________________________________________ Name: svn:eol-style + native Added: announcement/trunk/src/main/webapp/fckeditor/editor/lang/it.js =================================================================== --- announcement/trunk/src/main/webapp/fckeditor/editor/lang/it.js (rev 0) +++ announcement/trunk/src/main/webapp/fckeditor/editor/lang/it.js 2008-06-30 02:54:27 UTC (rev 1002) @@ -0,0 +1,515 @@ +?/* + * FCKeditor - The text editor for Internet - http://www.fckeditor.net + * Copyright (C) 2003-2008 Frederico Caldeira Knabben + * + * == BEGIN LICENSE == + * + * Licensed under the terms of any of the following licenses at your + * choice: + * + * - GNU General Public License Version 2 or later (the "GPL") + * http://www.gnu.org/licenses/gpl.html + * + * - GNU Lesser General Public License Version 2.1 or later (the "LGPL") + * http://www.gnu.org/licenses/lgpl.html + * + * - Mozilla Public License Version 1.1 or later (the "MPL") + * http://www.mozilla.org/MPL/MPL-1.1.html + * + * == END LICENSE == + * + * Italian language file. + */ + +var FCKLang = +{ +// Language direction : "ltr" (left to right) or "rtl" (right to left). +Dir : "ltr", + +ToolbarCollapse : "Nascondi la barra degli strumenti", +ToolbarExpand : "Mostra la barra degli strumenti", + +// Toolbar Items and Context Menu +Save : "Salva", +NewPage : "Nuova pagina vuota", +Preview : "Anteprima", +Cut : "Taglia", +Copy : "Copia", +Paste : "Incolla", +PasteText : "Incolla come testo semplice", +PasteWord : "Incolla da Word", +Print : "Stampa", +SelectAll : "Seleziona tutto", +RemoveFormat : "Elimina formattazione", +InsertLinkLbl : "Collegamento", +InsertLink : "Inserisci/Modifica collegamento", +RemoveLink : "Elimina collegamento", +Anchor : "Inserisci/Modifica Ancora", +AnchorDelete : "Rimuovi Ancora", +InsertImageLbl : "Immagine", +InsertImage : "Inserisci/Modifica immagine", +InsertFlashLbl : "Oggetto Flash", +InsertFlash : "Inserisci/Modifica Oggetto Flash", +InsertTableLbl : "Tabella", +InsertTable : "Inserisci/Modifica tabella", +InsertLineLbl : "Riga orizzontale", +InsertLine : "Inserisci riga orizzontale", +InsertSpecialCharLbl: "Caratteri speciali", +InsertSpecialChar : "Inserisci carattere speciale", +InsertSmileyLbl : "Emoticon", +InsertSmiley : "Inserisci emoticon", +About : "Informazioni su FCKeditor", +Bold : "Grassetto", +Italic : "Corsivo", +Underline : "Sottolineato", +StrikeThrough : "Barrato", +Subscript : "Pedice", +Superscript : "Apice", +LeftJustify : "Allinea a sinistra", +CenterJustify : "Centra", +RightJustify : "Allinea a destra", +BlockJustify : "Giustifica", +DecreaseIndent : "Riduci rientro", +IncreaseIndent : "Aumenta rientro", +Blockquote : "Blockquote", //MISSING +Undo : "Annulla", +Redo : "Ripristina", +NumberedListLbl : "Elenco numerato", +NumberedList : "Inserisci/Modifica elenco numerato", +BulletedListLbl : "Elenco puntato", +BulletedList : "Inserisci/Modifica elenco puntato", +ShowTableBorders : "Mostra bordi tabelle", +ShowDetails : "Mostra dettagli", +Style : "Stile", +FontFormat : "Formato", +Font : "Font", +FontSize : "Dimensione", +TextColor : "Colore testo", +BGColor : "Colore sfondo", +Source : "Codice Sorgente", +Find : "Trova", +Replace : "Sostituisci", +SpellCheck : "Correttore ortografico", +UniversalKeyboard : "Tastiera universale", +PageBreakLbl : "Interruzione di pagina", +PageBreak : "Inserisci interruzione di pagina", + +Form : "Modulo", +Checkbox : "Checkbox", +RadioButton : "Radio Button", +TextField : "Campo di testo", +Textarea : "Area di testo", +HiddenField : "Campo nascosto", +Button : "Bottone", +SelectionField : "Menu di selezione", +ImageButton : "Bottone immagine", + +FitWindow : "Massimizza l'area dell'editor", +ShowBlocks : "Visualizza Blocchi", + +// Context Menu +EditLink : "Modifica collegamento", +CellCM : "Cella", +RowCM : "Riga", +ColumnCM : "Colonna", +InsertRowAfter : "Inserisci Riga Dopo", +InsertRowBefore : "Inserisci Riga Prima", +DeleteRows : "Elimina righe", +InsertColumnAfter : "Inserisci Colonna Dopo", +InsertColumnBefore : "Inserisci Colonna Prima", +DeleteColumns : "Elimina colonne", +InsertCellAfter : "Inserisci Cella Dopo", +InsertCellBefore : "Inserisci Cella Prima", +DeleteCells : "Elimina celle", +MergeCells : "Unisce celle", +MergeRight : "Unisci a Destra", +MergeDown : "Unisci in Basso", +HorizontalSplitCell : "Dividi Cella Orizzontalmente", +VerticalSplitCell : "Dividi Cella Verticalmente", +TableDelete : "Cancella Tabella", +CellProperties : "Proprietà cella", +TableProperties : "Proprietà tabella", +ImageProperties : "Proprietà immagine", +FlashProperties : "Proprietà Oggetto Flash", + +AnchorProp : "Proprietà ancora", +ButtonProp : "Proprietà bottone", +CheckboxProp : "Proprietà checkbox", +HiddenFieldProp : "Proprietà campo nascosto", +RadioButtonProp : "Proprietà radio button", +ImageButtonProp : "Proprietà bottone immagine", +TextFieldProp : "Proprietà campo di testo", +SelectionFieldProp : "Proprietà menu di selezione", +TextareaProp : "Proprietà area di testo", +FormProp : "Proprietà modulo", + +FontFormats : "Normale;Formattato;Indirizzo;Titolo 1;Titolo 2;Titolo 3;Titolo 4;Titolo 5;Titolo 6;Paragrafo (DIV)", + +// Alerts and Messages +ProcessingXHTML : "Elaborazione XHTML in corso. Attendere prego...", +Done : "Completato", +PasteWordConfirm : "Il testo da incollare sembra provenire da Word. Desideri pulirlo prima di incollare?", +NotCompatiblePaste : "Questa funzione è disponibile solo per Internet Explorer 5.5 o superiore. Desideri incollare il testo senza pulirlo?", +UnknownToolbarItem : "Elemento della barra strumenti sconosciuto \"%1\"", +UnknownCommand : "Comando sconosciuto \"%1\"", +NotImplemented : "Comando non implementato", +UnknownToolbarSet : "La barra di strumenti \"%1\" non esiste", +NoActiveX : "Le impostazioni di sicurezza del tuo browser potrebbero limitare alcune funzionalità dell'editor. Devi abilitare l'opzione \"Esegui controlli e plug-in ActiveX\". Potresti avere errori e notare funzionalità mancanti.", +BrowseServerBlocked : "Non è possibile aprire la finestra di espolorazione risorse. Verifica che tutti i blocca popup siano bloccati.", +DialogBlocked : "Non è possibile aprire la finestra di dialogo. Verifica che tutti i blocca popup siano bloccati.", + +// Dialogs +DlgBtnOK : "OK", +DlgBtnCancel : "Annulla", +DlgBtnClose : "Chiudi", +DlgBtnBrowseServer : "Cerca sul server", +DlgAdvancedTag : "Avanzate", +DlgOpOther : "", +DlgInfoTab : "Info", +DlgAlertUrl : "Devi inserire l'URL", + +// General Dialogs Labels +DlgGenNotSet : "", +DlgGenId : "Id", +DlgGenLangDir : "Direzione scrittura", +DlgGenLangDirLtr : "Da Sinistra a Destra (LTR)", +DlgGenLangDirRtl : "Da Destra a Sinistra (RTL)", +DlgGenLangCode : "Codice Lingua", +DlgGenAccessKey : "Scorciatoia
        da tastiera", +DlgGenName : "Nome", +DlgGenTabIndex : "Ordine di tabulazione", +DlgGenLongDescr : "URL descrizione estesa", +DlgGenClass : "Nome classe CSS", +DlgGenTitle : "Titolo", +DlgGenContType : "Tipo della risorsa collegata", +DlgGenLinkCharset : "Set di caretteri della risorsa collegata", +DlgGenStyle : "Stile", + +// Image Dialog +DlgImgTitle : "Proprietà immagine", +DlgImgInfoTab : "Informazioni immagine", +DlgImgBtnUpload : "Invia al server", +DlgImgURL : "URL", +DlgImgUpload : "Carica", +DlgImgAlt : "Testo alternativo", +DlgImgWidth : "Larghezza", +DlgImgHeight : "Altezza", +DlgImgLockRatio : "Blocca rapporto", +DlgBtnResetSize : "Reimposta dimensione", +DlgImgBorder : "Bordo", +DlgImgHSpace : "HSpace", +DlgImgVSpace : "VSpace", +DlgImgAlign : "Allineamento", +DlgImgAlignLeft : "Sinistra", +DlgImgAlignAbsBottom: "In basso assoluto", +DlgImgAlignAbsMiddle: "Centrato assoluto", +DlgImgAlignBaseline : "Linea base", +DlgImgAlignBottom : "In Basso", +DlgImgAlignMiddle : "Centrato", +DlgImgAlignRight : "Destra", +DlgImgAlignTextTop : "In alto al testo", +DlgImgAlignTop : "In Alto", +DlgImgPreview : "Anteprima", +DlgImgAlertUrl : "Devi inserire l'URL per l'immagine", +DlgImgLinkTab : "Collegamento", + +// Flash Dialog +DlgFlashTitle : "Proprietà Oggetto Flash", +DlgFlashChkPlay : "Avvio Automatico", +DlgFlashChkLoop : "Cicla", +DlgFlashChkMenu : "Abilita Menu di Flash", +DlgFlashScale : "Ridimensiona", +DlgFlashScaleAll : "Mostra Tutto", +DlgFlashScaleNoBorder : "Senza Bordo", +DlgFlashScaleFit : "Dimensione Esatta", + +// Link Dialog +DlgLnkWindowTitle : "Collegamento", +DlgLnkInfoTab : "Informazioni collegamento", +DlgLnkTargetTab : "Destinazione", + +DlgLnkType : "Tipo di Collegamento", +DlgLnkTypeURL : "URL", +DlgLnkTypeAnchor : "Ancora nella pagina", +DlgLnkTypeEMail : "E-Mail", +DlgLnkProto : "Protocollo", +DlgLnkProtoOther : "", +DlgLnkURL : "URL", +DlgLnkAnchorSel : "Scegli Ancora", +DlgLnkAnchorByName : "Per Nome", +DlgLnkAnchorById : "Per id elemento", +DlgLnkNoAnchors : "(Nessuna ancora disponibile nel documento)", +DlgLnkEMail : "Indirizzo E-Mail", +DlgLnkEMailSubject : "Oggetto del messaggio", +DlgLnkEMailBody : "Corpo del messaggio", +DlgLnkUpload : "Carica", +DlgLnkBtnUpload : "Invia al Server", + +DlgLnkTarget : "Destinazione", +DlgLnkTargetFrame : "", +DlgLnkTargetPopup : "", +DlgLnkTargetBlank : "Nuova finestra (_blank)", +DlgLnkTargetParent : "Finestra padre (_parent)", +DlgLnkTargetSelf : "Stessa finestra (_self)", +DlgLnkTargetTop : "Finestra superiore (_top)", +DlgLnkTargetFrameName : "Nome del riquadro di destinazione", +DlgLnkPopWinName : "Nome finestra popup", +DlgLnkPopWinFeat : "Caratteristiche finestra popup", +DlgLnkPopResize : "Ridimensionabile", +DlgLnkPopLocation : "Barra degli indirizzi", +DlgLnkPopMenu : "Barra del menu", +DlgLnkPopScroll : "Barre di scorrimento", +DlgLnkPopStatus : "Barra di stato", +DlgLnkPopToolbar : "Barra degli strumenti", +DlgLnkPopFullScrn : "A tutto schermo (IE)", +DlgLnkPopDependent : "Dipendente (Netscape)", +DlgLnkPopWidth : "Larghezza", +DlgLnkPopHeight : "Altezza", +DlgLnkPopLeft : "Posizione da sinistra", +DlgLnkPopTop : "Posizione dall'alto", + +DlnLnkMsgNoUrl : "Devi inserire l'URL del collegamento", +DlnLnkMsgNoEMail : "Devi inserire un'indirizzo e-mail", +DlnLnkMsgNoAnchor : "Devi selezionare un'ancora", +DlnLnkMsgInvPopName : "Il nome del popup deve iniziare con una lettera, e non può contenere spazi", + +// Color Dialog +DlgColorTitle : "Seleziona colore", +DlgColorBtnClear : "Vuota", +DlgColorHighlight : "Evidenziato", +DlgColorSelected : "Selezionato", + +// Smiley Dialog +DlgSmileyTitle : "Inserisci emoticon", + +// Special Character Dialog +DlgSpecialCharTitle : "Seleziona carattere speciale", + +// Table Dialog +DlgTableTitle : "Proprietà tabella", +DlgTableRows : "Righe", +DlgTableColumns : "Colonne", +DlgTableBorder : "Dimensione bordo", +DlgTableAlign : "Allineamento", +DlgTableAlignNotSet : "", +DlgTableAlignLeft : "Sinistra", +DlgTableAlignCenter : "Centrato", +DlgTableAlignRight : "Destra", +DlgTableWidth : "Larghezza", +DlgTableWidthPx : "pixel", +DlgTableWidthPc : "percento", +DlgTableHeight : "Altezza", +DlgTableCellSpace : "Spaziatura celle", +DlgTableCellPad : "Padding celle", +DlgTableCaption : "Intestazione", +DlgTableSummary : "Indice", + +// Table Cell Dialog +DlgCellTitle : "Proprietà cella", +DlgCellWidth : "Larghezza", +DlgCellWidthPx : "pixel", +DlgCellWidthPc : "percento", +DlgCellHeight : "Altezza", +DlgCellWordWrap : "A capo automatico", +DlgCellWordWrapNotSet : "", +DlgCellWordWrapYes : "Si", +DlgCellWordWrapNo : "No", +DlgCellHorAlign : "Allineamento orizzontale", +DlgCellHorAlignNotSet : "", +DlgCellHorAlignLeft : "Sinistra", +DlgCellHorAlignCenter : "Centrato", +DlgCellHorAlignRight: "Destra", +DlgCellVerAlign : "Allineamento verticale", +DlgCellVerAlignNotSet : "", +DlgCellVerAlignTop : "In Alto", +DlgCellVerAlignMiddle : "Centrato", +DlgCellVerAlignBottom : "In Basso", +DlgCellVerAlignBaseline : "Linea base", +DlgCellRowSpan : "Righe occupate", +DlgCellCollSpan : "Colonne occupate", +DlgCellBackColor : "Colore sfondo", +DlgCellBorderColor : "Colore bordo", +DlgCellBtnSelect : "Scegli...", + +// Find and Replace Dialog +DlgFindAndReplaceTitle : "Cerca e Sostituisci", + +// Find Dialog +DlgFindTitle : "Trova", +DlgFindFindBtn : "Trova", +DlgFindNotFoundMsg : "L'elemento cercato non è stato trovato.", + +// Replace Dialog +DlgReplaceTitle : "Sostituisci", +DlgReplaceFindLbl : "Trova:", +DlgReplaceReplaceLbl : "Sostituisci con:", +DlgReplaceCaseChk : "Maiuscole/minuscole", +DlgReplaceReplaceBtn : "Sostituisci", +DlgReplaceReplAllBtn : "Sostituisci tutto", +DlgReplaceWordChk : "Solo parole intere", + +// Paste Operations / Dialog +PasteErrorCut : "Le impostazioni di sicurezza del browser non permettono di tagliare automaticamente il testo. Usa la tastiera (Ctrl+X).", +PasteErrorCopy : "Le impostazioni di sicurezza del browser non permettono di copiare automaticamente il testo. Usa la tastiera (Ctrl+C).", + +PasteAsText : "Incolla come testo semplice", +PasteFromWord : "Incolla da Word", + +DlgPasteMsg2 : "Incolla il testo all'interno dell'area sottostante usando la scorciatoia di tastiere (Ctrl+V) e premi OK.", +DlgPasteSec : "A causa delle impostazioni di sicurezza del browser,l'editor non è in grado di accedere direttamente agli appunti. E' pertanto necessario incollarli di nuovo in questa finestra.", +DlgPasteIgnoreFont : "Ignora le definizioni di Font", +DlgPasteRemoveStyles : "Rimuovi le definizioni di Stile", + +// Color Picker +ColorAutomatic : "Automatico", +ColorMoreColors : "Altri colori...", + +// Document Properties +DocProps : "Proprietà del Documento", + +// Anchor Dialog +DlgAnchorTitle : "Proprietà ancora", +DlgAnchorName : "Nome ancora", +DlgAnchorErrorName : "Inserici il nome dell'ancora", + +// Speller Pages Dialog +DlgSpellNotInDic : "Non nel dizionario", +DlgSpellChangeTo : "Cambia in", +DlgSpellBtnIgnore : "Ignora", +DlgSpellBtnIgnoreAll : "Ignora tutto", +DlgSpellBtnReplace : "Cambia", +DlgSpellBtnReplaceAll : "Cambia tutto", +DlgSpellBtnUndo : "Annulla", +DlgSpellNoSuggestions : "- Nessun suggerimento -", +DlgSpellProgress : "Controllo ortografico in corso", +DlgSpellNoMispell : "Controllo ortografico completato: nessun errore trovato", +DlgSpellNoChanges : "Controllo ortografico completato: nessuna parola cambiata", +DlgSpellOneChange : "Controllo ortografico completato: 1 parola cambiata", +DlgSpellManyChanges : "Controllo ortografico completato: %1 parole cambiate", + +IeSpellDownload : "Contollo ortografico non installato. Lo vuoi scaricare ora?", + +// Button Dialog +DlgButtonText : "Testo (Value)", +DlgButtonType : "Tipo", +DlgButtonTypeBtn : "Bottone", +DlgButtonTypeSbm : "Invio", +DlgButtonTypeRst : "Annulla", + +// Checkbox and Radio Button Dialogs +DlgCheckboxName : "Nome", +DlgCheckboxValue : "Valore", +DlgCheckboxSelected : "Selezionato", + +// Form Dialog +DlgFormName : "Nome", +DlgFormAction : "Azione", +DlgFormMethod : "Metodo", + +// Select Field Dialog +DlgSelectName : "Nome", +DlgSelectValue : "Valore", +DlgSelectSize : "Dimensione", +DlgSelectLines : "righe", +DlgSelectChkMulti : "Permetti selezione multipla", +DlgSelectOpAvail : "Opzioni disponibili", +DlgSelectOpText : "Testo", +DlgSelectOpValue : "Valore", +DlgSelectBtnAdd : "Aggiungi", +DlgSelectBtnModify : "Modifica", +DlgSelectBtnUp : "Su", +DlgSelectBtnDown : "Gi", +DlgSelectBtnSetValue : "Imposta come predefinito", +DlgSelectBtnDelete : "Rimuovi", + +// Textarea Dialog +DlgTextareaName : "Nome", +DlgTextareaCols : "Colonne", +DlgTextareaRows : "Righe", + +// Text Field Dialog +DlgTextName : "Nome", +DlgTextValue : "Valore", +DlgTextCharWidth : "Larghezza", +DlgTextMaxChars : "Numero massimo di caratteri", +DlgTextType : "Tipo", +DlgTextTypeText : "Testo", +DlgTextTypePass : "Password", + +// Hidden Field Dialog +DlgHiddenName : "Nome", +DlgHiddenValue : "Valore", + +// Bulleted List Dialog +BulletedListProp : "Proprietà lista puntata", +NumberedListProp : "Proprietà lista numerata", +DlgLstStart : "Inizio", +DlgLstType : "Tipo", +DlgLstTypeCircle : "Tondo", +DlgLstTypeDisc : "Disco", +DlgLstTypeSquare : "Quadrato", +DlgLstTypeNumbers : "Numeri (1, 2, 3)", +DlgLstTypeLCase : "Caratteri minuscoli (a, b, c)", +DlgLstTypeUCase : "Caratteri maiuscoli (A, B, C)", +DlgLstTypeSRoman : "Numeri Romani minuscoli (i, ii, iii)", +DlgLstTypeLRoman : "Numeri Romani maiuscoli (I, II, III)", + +// Document Properties Dialog +DlgDocGeneralTab : "Genarale", +DlgDocBackTab : "Sfondo", +DlgDocColorsTab : "Colori e margini", +DlgDocMetaTab : "Meta Data", + +DlgDocPageTitle : "Titolo pagina", +DlgDocLangDir : "Direzione scrittura", +DlgDocLangDirLTR : "Da Sinistra a Destra (LTR)", +DlgDocLangDirRTL : "Da Destra a Sinistra (RTL)", +DlgDocLangCode : "Codice Lingua", +DlgDocCharSet : "Set di caretteri", +DlgDocCharSetCE : "Europa Centrale", +DlgDocCharSetCT : "Cinese Tradizionale (Big5)", +DlgDocCharSetCR : "Cirillico", +DlgDocCharSetGR : "Greco", +DlgDocCharSetJP : "Giapponese", +DlgDocCharSetKR : "Coreano", +DlgDocCharSetTR : "Turco", +DlgDocCharSetUN : "Unicode (UTF-8)", +DlgDocCharSetWE : "Europa Occidentale", +DlgDocCharSetOther : "Altro set di caretteri", + +DlgDocDocType : "Intestazione DocType", +DlgDocDocTypeOther : "Altra intestazione DocType", +DlgDocIncXHTML : "Includi dichiarazione XHTML", +DlgDocBgColor : "Colore di sfondo", +DlgDocBgImage : "Immagine di sfondo", +DlgDocBgNoScroll : "Sfondo fissato", +DlgDocCText : "Testo", +DlgDocCLink : "Collegamento", +DlgDocCVisited : "Collegamento visitato", +DlgDocCActive : "Collegamento attivo", +DlgDocMargins : "Margini", +DlgDocMaTop : "In Alto", +DlgDocMaLeft : "A Sinistra", +DlgDocMaRight : "A Destra", +DlgDocMaBottom : "In Basso", +DlgDocMeIndex : "Chiavi di indicizzazione documento (separate da virgola)", +DlgDocMeDescr : "Descrizione documento", +DlgDocMeAuthor : "Autore", +DlgDocMeCopy : "Copyright", +DlgDocPreview : "Anteprima", + +// Templates Dialog +Templates : "Modelli", +DlgTemplatesTitle : "Contenuto dei modelli", +DlgTemplatesSelMsg : "Seleziona il modello da aprire nell'editor
        (il contenuto attuale verrà eliminato):", +DlgTemplatesLoading : "Caricamento modelli in corso. Attendere prego...", +DlgTemplatesNoTpl : "(Nessun modello definito)", +DlgTemplatesReplace : "Cancella il contenuto corrente", + +// About Dialog +DlgAboutAboutTab : "Informazioni", +DlgAboutBrowserInfoTab : "Informazioni Browser", +DlgAboutLicenseTab : "Licenza", +DlgAboutVersion : "versione", +DlgAboutInfo : "Per maggiori informazioni visitare" +}; Property changes on: announcement/trunk/src/main/webapp/fckeditor/editor/lang/it.js ___________________________________________________________________ Name: svn:eol-style + native Added: announcement/trunk/src/main/webapp/fckeditor/editor/lang/ja.js =================================================================== --- announcement/trunk/src/main/webapp/fckeditor/editor/lang/ja.js (rev 0) +++ announcement/trunk/src/main/webapp/fckeditor/editor/lang/ja.js 2008-06-30 02:54:27 UTC (rev 1002) @@ -0,0 +1,515 @@ +?/* + * FCKeditor - The text editor for Internet - http://www.fckeditor.net + * Copyright (C) 2003-2008 Frederico Caldeira Knabben + * + * == BEGIN LICENSE == + * + * Licensed under the terms of any of the following licenses at your + * choice: + * + * - GNU General Public License Version 2 or later (the "GPL") + * http://www.gnu.org/licenses/gpl.html + * + * - GNU Lesser General Public License Version 2.1 or later (the "LGPL") + * http://www.gnu.org/licenses/lgpl.html + * + * - Mozilla Public License Version 1.1 or later (the "MPL") + * http://www.mozilla.org/MPL/MPL-1.1.html + * + * == END LICENSE == + * + * Japanese language file. + */ + +var FCKLang = +{ +// Language direction : "ltr" (left to right) or "rtl" (right to left). +Dir : "ltr", + +ToolbarCollapse : "ツールバーを隠す", +ToolbarExpand : "ツールバーを表示", + +// Toolbar Items and Context Menu +Save : "保存", +NewPage : "新しいページ", +Preview : "プレビュー", +Cut : "切り取り", +Copy : "コピー", +Paste : "貼り付け", +PasteText : "プレーンテキスト貼り付け", +PasteWord : "ワード文章から貼り付け", +Print : "印刷", +SelectAll : "すべて選択", +RemoveFormat : "フォーマット削除", +InsertLinkLbl : "リンク", +InsertLink : "リンク挿入/編集", +RemoveLink : "リンク削除", +Anchor : "アンカー挿入/編集", +AnchorDelete : "アンカー削除", +InsertImageLbl : "イメージ", +InsertImage : "イメージ挿入/編集", +InsertFlashLbl : "Flash", +InsertFlash : "Flash挿入/編集", +InsertTableLbl : "テーブル", +InsertTable : "テーブル挿入/編集", +InsertLineLbl : "ライン", +InsertLine : "横罫線", +InsertSpecialCharLbl: "特殊文字", +InsertSpecialChar : "特殊文字挿入", +InsertSmileyLbl : "絵文字", +InsertSmiley : "絵文字挿入", +About : "FCKeditorヘルプ", +Bold : "太字", +Italic : "斜体", +Underline : "下線", +StrikeThrough : "打ち消し線", +Subscript : "添え字", +Superscript : "上付き文字", +LeftJustify : "左揃え", +CenterJustify : "中央揃え", +RightJustify : "右揃え", +BlockJustify : "両端揃え", +DecreaseIndent : "インデント解除", +IncreaseIndent : "インデント", +Blockquote : "ブロック引用", +Undo : "元に戻す", +Redo : "やり直し", +NumberedListLbl : "段落番号", +NumberedList : "段落番号の追加/削除", +BulletedListLbl : "箇条書き", +BulletedList : "箇条書きの追加/削除", +ShowTableBorders : "テーブルボーダー表示", +ShowDetails : "詳細表示", +Style : "スタイル", +FontFormat : "フォーマット", +Font : "フォント", +FontSize : "サイズ", +TextColor : "テキスト色", +BGColor : "背景色", +Source : "ソース", +Find : "検索", +Replace : "置き換え", +SpellCheck : "スペルチェック", +UniversalKeyboard : "ユニバーサル・キーボード", +PageBreakLbl : "改ページ", +PageBreak : "改ページ挿入", + +Form : "フォーム", +Checkbox : "チェックボックス", +RadioButton : "ラジオボタン", +TextField : "1行テキスト", +Textarea : "テキストエリア", +HiddenField : "不可視フィールド", +Button : "ボタン", +SelectionField : "選択フィールド", +ImageButton : "画像ボタン", + +FitWindow : "エディタサイズを最大にします", +ShowBlocks : "ブロック表示", + +// Context Menu +EditLink : "リンク編集", +CellCM : "セル", +RowCM : "行", +ColumnCM : "カラム", +InsertRowAfter : "列の後に挿入", +InsertRowBefore : "列の前に挿入", +DeleteRows : "行削除", +InsertColumnAfter : "カラムの後に挿入", +InsertColumnBefore : "カラムの前に挿入", +DeleteColumns : "列削除", +InsertCellAfter : "セルの後に挿入", +InsertCellBefore : "セルの前に挿入", +DeleteCells : "セル削除", +MergeCells : "セル結合", +MergeRight : "右に結合", +MergeDown : "下に結合", +HorizontalSplitCell : "セルを水平方向分割", +VerticalSplitCell : "セルを垂直方向に分割", +TableDelete : "テーブル削除", +CellProperties : "セル プロパティ", +TableProperties : "テーブル プロパティ", +ImageProperties : "イメージ プロパティ", +FlashProperties : "Flash プロパティ", + +AnchorProp : "アンカー プロパティ", +ButtonProp : "ボタン プロパティ", +CheckboxProp : "チェックボックス プロパティ", +HiddenFieldProp : "不可視フィールド プロパティ", +RadioButtonProp : "ラジオボタン プロパティ", +ImageButtonProp : "画像ボタン プロパティ", +TextFieldProp : "1行テキスト プロパティ", +SelectionFieldProp : "選択フィールド プロパティ", +TextareaProp : "テキストエリア プロパティ", +FormProp : "フォーム プロパティ", + +FontFormats : "標準;書式付き;アドレス;見出し 1;見出し 2;見出し 3;見出し 4;見出し 5;見出し 6;標準 (DIV)", + +// Alerts and Messages +ProcessingXHTML : "XHTML処理中. しばらくお待ちください...", +Done : "完了", +PasteWordConfirm : "貼り付けを行うテキストは、ワード文章からコピーされようとしています。貼り付ける前にクリーニングを行いますか?", +NotCompatiblePaste : "このコマンドはインターネット・エクスプローラーバージョン5.5以上で利用可能です。クリーニングしないで貼り付けを行いますか?", +UnknownToolbarItem : "未知のツールバー項目 \"%1\"", +UnknownCommand : "未知のコマンド名 \"%1\"", +NotImplemented : "コマンドはインプリメントされませんでした。", +UnknownToolbarSet : "ツールバー設定 \"%1\" 存在しません。", +NoActiveX : "エラー、警告メッセージなどが発生した場合、ブラウザーのセキュリティ設定によりエディタのいくつかの機能が制限されている可能性があります。セキュリティ設定のオプションで\"ActiveXコントロールとプラグインの実行\"を有効にするにしてください。", +BrowseServerBlocked : "サーバーブラウザーを開くことができませんでした。ポップアップ・ブロック機能が無効になっているか確認してください。", +DialogBlocked : "ダイアログウィンドウを開くことができませんでした。ポップアップ・ブロック機能が無効になっているか確認してください。", + +// Dialogs +DlgBtnOK : "OK", +DlgBtnCancel : "キャンセル", +DlgBtnClose : "閉じる", +DlgBtnBrowseServer : "サーバーブラウザー", +DlgAdvancedTag : "高度な設定", +DlgOpOther : "<その他>", +DlgInfoTab : "情報", +DlgAlertUrl : "URLを挿入してください", + +// General Dialogs Labels +DlgGenNotSet : "<なし>", +DlgGenId : "Id", +DlgGenLangDir : "文字表記の方向", +DlgGenLangDirLtr : "左から右 (LTR)", +DlgGenLangDirRtl : "右から左 (RTL)", +DlgGenLangCode : "言語コード", +DlgGenAccessKey : "アクセスキー", +DlgGenName : "Name属性", +DlgGenTabIndex : "タブインデックス", +DlgGenLongDescr : "longdesc属性(長文説明)", +DlgGenClass : "スタイルシートクラス", +DlgGenTitle : "Title属性", +DlgGenContType : "Content Type属性", +DlgGenLinkCharset : "リンクcharset属性", +DlgGenStyle : "スタイルシート", + +// Image Dialog +DlgImgTitle : "イメージ プロパティ", +DlgImgInfoTab : "イメージ 情報", +DlgImgBtnUpload : "サーバーに送信", +DlgImgURL : "URL", +DlgImgUpload : "アップロード", +DlgImgAlt : "代替テキスト", +DlgImgWidth : "幅", +DlgImgHeight : "高さ", +DlgImgLockRatio : "ロック比率", +DlgBtnResetSize : "サイズリセット", +DlgImgBorder : "ボーダー", +DlgImgHSpace : "横間隔", +DlgImgVSpace : "縦間隔", +DlgImgAlign : "行揃え", +DlgImgAlignLeft : "左", +DlgImgAlignAbsBottom: "下部(絶対的)", +DlgImgAlignAbsMiddle: "中央(絶対的)", +DlgImgAlignBaseline : "ベースライン", +DlgImgAlignBottom : "下", +DlgImgAlignMiddle : "中央", +DlgImgAlignRight : "右", +DlgImgAlignTextTop : "テキスト上部", +DlgImgAlignTop : "上", +DlgImgPreview : "プレビュー", +DlgImgAlertUrl : "イメージのURLを入力してください。", +DlgImgLinkTab : "リンク", + +// Flash Dialog +DlgFlashTitle : "Flash プロパティ", +DlgFlashChkPlay : "再生", +DlgFlashChkLoop : "ループ再生", +DlgFlashChkMenu : "Flashメニュー可能", +DlgFlashScale : "拡大縮小設定", +DlgFlashScaleAll : "すべて表示", +DlgFlashScaleNoBorder : "外が見えない様に拡大", +DlgFlashScaleFit : "上下左右にフィット", + +// Link Dialog +DlgLnkWindowTitle : "ハイパーリンク", +DlgLnkInfoTab : "ハイパーリンク 情報", +DlgLnkTargetTab : "ターゲット", + +DlgLnkType : "リンクタイプ", +DlgLnkTypeURL : "URL", +DlgLnkTypeAnchor : "このページのアンカー", +DlgLnkTypeEMail : "E-Mail", +DlgLnkProto : "プロトコル", +DlgLnkProtoOther : "<その他>", +DlgLnkURL : "URL", +DlgLnkAnchorSel : "アンカーを選択", +DlgLnkAnchorByName : "アンカー名", +DlgLnkAnchorById : "エレメントID", +DlgLnkNoAnchors : "(ドキュメントにおいて利用可能なアンカーはありません。)", +DlgLnkEMail : "E-Mail アドレス", +DlgLnkEMailSubject : "件名", +DlgLnkEMailBody : "本文", +DlgLnkUpload : "アップロード", +DlgLnkBtnUpload : "サーバーに送信", + +DlgLnkTarget : "ターゲット", +DlgLnkTargetFrame : "<フレーム>", +DlgLnkTargetPopup : "<ポップアップウィンドウ>", +DlgLnkTargetBlank : "新しいウィンドウ (_blank)", +DlgLnkTargetParent : "親ウィンドウ (_parent)", +DlgLnkTargetSelf : "同じウィンドウ (_self)", +DlgLnkTargetTop : "最上位ウィンドウ (_top)", +DlgLnkTargetFrameName : "目的のフレーム名", +DlgLnkPopWinName : "ポップアップウィンドウ名", +DlgLnkPopWinFeat : "ポップアップウィンドウ特徴", +DlgLnkPopResize : "リサイズ可能", +DlgLnkPopLocation : "ロケーションバー", +DlgLnkPopMenu : "メニューバー", +DlgLnkPopScroll : "スクロールバー", +DlgLnkPopStatus : "ステータスバー", +DlgLnkPopToolbar : "ツールバー", +DlgLnkPopFullScrn : "全画面モード(IE)", +DlgLnkPopDependent : "開いたウィンドウに連動して閉じる (Netscape)", +DlgLnkPopWidth : "幅", +DlgLnkPopHeight : "高さ", +DlgLnkPopLeft : "左端からの座標で指定", +DlgLnkPopTop : "上端からの座標で指定", + +DlnLnkMsgNoUrl : "リンクURLを入力してください。", +DlnLnkMsgNoEMail : "メールアドレスを入力してください。", +DlnLnkMsgNoAnchor : "アンカーを選択してください。", +DlnLnkMsgInvPopName : "ポップ・アップ名は英字で始まる文字で指定してくだい。ポップ・アップ名にスペースは含めません", + +// Color Dialog +DlgColorTitle : "色選択", +DlgColorBtnClear : "クリア", +DlgColorHighlight : "ハイライト", +DlgColorSelected : "選択色", + +// Smiley Dialog +DlgSmileyTitle : "顔文字挿入", + +// Special Character Dialog +DlgSpecialCharTitle : "特殊文字選択", + +// Table Dialog +DlgTableTitle : "テーブル プロパティ", +DlgTableRows : "行", +DlgTableColumns : "列", +DlgTableBorder : "ボーダーサイズ", +DlgTableAlign : "キャプションの整列", +DlgTableAlignNotSet : "<なし>", +DlgTableAlignLeft : "左", +DlgTableAlignCenter : "中央", +DlgTableAlignRight : "右", +DlgTableWidth : "テーブル幅", +DlgTableWidthPx : "ピクセル", +DlgTableWidthPc : "パーセント", +DlgTableHeight : "テーブル高さ", +DlgTableCellSpace : "セル内余白", +DlgTableCellPad : "セル内間隔", +DlgTableCaption : "キャプション", +DlgTableSummary : "テーブル目的/構造", + +// Table Cell Dialog +DlgCellTitle : "セル プロパティ", +DlgCellWidth : "幅", +DlgCellWidthPx : "ピクセル", +DlgCellWidthPc : "パーセント", +DlgCellHeight : "高さ", +DlgCellWordWrap : "折り返し", +DlgCellWordWrapNotSet : "<なし>", +DlgCellWordWrapYes : "Yes", +DlgCellWordWrapNo : "No", +DlgCellHorAlign : "セル横の整列", +DlgCellHorAlignNotSet : "<なし>", +DlgCellHorAlignLeft : "左", +DlgCellHorAlignCenter : "中央", +DlgCellHorAlignRight: "右", +DlgCellVerAlign : "セル縦の整列", +DlgCellVerAlignNotSet : "<なし>", +DlgCellVerAlignTop : "上", +DlgCellVerAlignMiddle : "中央", +DlgCellVerAlignBottom : "下", +DlgCellVerAlignBaseline : "ベースライン", +DlgCellRowSpan : "縦幅(行数)", +DlgCellCollSpan : "横幅(列数)", +DlgCellBackColor : "背景色", +DlgCellBorderColor : "ボーダーカラー", +DlgCellBtnSelect : "選択...", + +// Find and Replace Dialog +DlgFindAndReplaceTitle : "検索して置換", + +// Find Dialog +DlgFindTitle : "検索", +DlgFindFindBtn : "検索", +DlgFindNotFoundMsg : "指定された文字列は見つかりませんでした。", + +// Replace Dialog +DlgReplaceTitle : "置き換え", +DlgReplaceFindLbl : "検索する文字列:", +DlgReplaceReplaceLbl : "置換えする文字列:", +DlgReplaceCaseChk : "部分一致", +DlgReplaceReplaceBtn : "置換え", +DlgReplaceReplAllBtn : "すべて置換え", +DlgReplaceWordChk : "単語単位で一致", + +// Paste Operations / Dialog +PasteErrorCut : "ブラウザーのセキュリティ設定によりエディタの切り取り操作が自動で実行することができません。実行するには手動でキーボードの(Ctrl+X)を使用してください。", +PasteErrorCopy : "ブラウザーのセキュリティ設定によりエディタのコピー操作が自動で実行することができません。実行するには手動でキーボードの(Ctrl+C)を使用してください。", + +PasteAsText : "プレーンテキスト貼り付け", +PasteFromWord : "ワード文章から貼り付け", + +DlgPasteMsg2 : "キーボード(Ctrl+V)を使用して、次の入力エリア内で貼って、OKを押してください。", +DlgPasteSec : "ブラウザのセキュリティ設定により、エディタはクリップボード・データに直接アクセスすることができません。このウィンドウは貼り付け操作を行う度に表示されます。", +DlgPasteIgnoreFont : "FontタグのFace属性を無視します。", +DlgPasteRemoveStyles : "スタイル定義を削除します。", + +// Color Picker +ColorAutomatic : "自動", +ColorMoreColors : "その他の色...", + +// Document Properties +DocProps : "文書 プロパティ", + +// Anchor Dialog +DlgAnchorTitle : "アンカー プロパティ", +DlgAnchorName : "アンカー名", +DlgAnchorErrorName : "アンカー名を必ず入力してください。", + +// Speller Pages Dialog +DlgSpellNotInDic : "辞書にありません", +DlgSpellChangeTo : "変更", +DlgSpellBtnIgnore : "無視", +DlgSpellBtnIgnoreAll : "すべて無視", +DlgSpellBtnReplace : "置換", +DlgSpellBtnReplaceAll : "すべて置換", +DlgSpellBtnUndo : "やり直し", +DlgSpellNoSuggestions : "- 該当なし -", +DlgSpellProgress : "スペルチェック処理中...", +DlgSpellNoMispell : "スペルチェック完了: スペルの誤りはありませんでした", +DlgSpellNoChanges : "スペルチェック完了: 語句は変更されませんでした", +DlgSpellOneChange : "スペルチェック完了: 1語句変更されました", +DlgSpellManyChanges : "スペルチェック完了: %1 語句変更されました", + +IeSpellDownload : "スペルチェッカーがインストールされていません。今すぐダウンロードしますか?", + +// Button Dialog +DlgButtonText : "テキスト (値)", +DlgButtonType : "タイプ", +DlgButtonTypeBtn : "ボタン", +DlgButtonTypeSbm : "送信", +DlgButtonTypeRst : "リセット", + +// Checkbox and Radio Button Dialogs +DlgCheckboxName : "名前", +DlgCheckboxValue : "値", +DlgCheckboxSelected : "選択済み", + +// Form Dialog +DlgFormName : "フォーム名", +DlgFormAction : "アクション", +DlgFormMethod : "メソッド", + +// Select Field Dialog +DlgSelectName : "名前", +DlgSelectValue : "値", +DlgSelectSize : "サイズ", +DlgSelectLines : "行", +DlgSelectChkMulti : "複数項目選択を許可", +DlgSelectOpAvail : "利用可能なオプション", +DlgSelectOpText : "選択項目名", +DlgSelectOpValue : "選択項目値", +DlgSelectBtnAdd : "追加", +DlgSelectBtnModify : "編集", +DlgSelectBtnUp : "上へ", +DlgSelectBtnDown : "下へ", +DlgSelectBtnSetValue : "選択した値を設定", +DlgSelectBtnDelete : "削除", + +// Textarea Dialog +DlgTextareaName : "名前", +DlgTextareaCols : "列", +DlgTextareaRows : "行", + +// Text Field Dialog +DlgTextName : "名前", +DlgTextValue : "値", +DlgTextCharWidth : "サイズ", +DlgTextMaxChars : "最大長", +DlgTextType : "タイプ", +DlgTextTypeText : "テキスト", +DlgTextTypePass : "パスワード入力", + +// Hidden Field Dialog +DlgHiddenName : "名前", +DlgHiddenValue : "値", + +// Bulleted List Dialog +BulletedListProp : "箇条書き プロパティ", +NumberedListProp : "段落番号 プロパティ", +DlgLstStart : "開始文字", +DlgLstType : "タイプ", +DlgLstTypeCircle : "白丸", +DlgLstTypeDisc : "黒丸", +DlgLstTypeSquare : "四角", +DlgLstTypeNumbers : "アラビア数字 (1, 2, 3)", +DlgLstTypeLCase : "英字小文字 (a, b, c)", +DlgLstTypeUCase : "英字大文字 (A, B, C)", +DlgLstTypeSRoman : "ローマ数字小文字 (i, ii, iii)", +DlgLstTypeLRoman : "ローマ数字大文字 (I, II, III)", + +// Document Properties Dialog +DlgDocGeneralTab : "全般", +DlgDocBackTab : "背景", +DlgDocColorsTab : "色とマージン", +DlgDocMetaTab : "メタデータ", + +DlgDocPageTitle : "ページタイトル", +DlgDocLangDir : "言語文字表記の方向", +DlgDocLangDirLTR : "左から右に表記(LTR)", +DlgDocLangDirRTL : "右から左に表記(RTL)", +DlgDocLangCode : "言語コード", +DlgDocCharSet : "文字セット符号化", +DlgDocCharSetCE : "Central European", +DlgDocCharSetCT : "Chinese Traditional (Big5)", +DlgDocCharSetCR : "Cyrillic", +DlgDocCharSetGR : "Greek", +DlgDocCharSetJP : "Japanese", +DlgDocCharSetKR : "Korean", +DlgDocCharSetTR : "Turkish", +DlgDocCharSetUN : "Unicode (UTF-8)", +DlgDocCharSetWE : "Western European", +DlgDocCharSetOther : "他の文字セット符号化", + +DlgDocDocType : "文書タイプヘッダー", +DlgDocDocTypeOther : "その他文書タイプヘッダー", +DlgDocIncXHTML : "XHTML宣言をインクルード", +DlgDocBgColor : "背景色", +DlgDocBgImage : "背景画像 URL", +DlgDocBgNoScroll : "スクロールしない背景", +DlgDocCText : "テキスト", +DlgDocCLink : "リンク", +DlgDocCVisited : "アクセス済みリンク", +DlgDocCActive : "アクセス中リンク", +DlgDocMargins : "ページ・マージン", +DlgDocMaTop : "上部", +DlgDocMaLeft : "左", +DlgDocMaRight : "右", +DlgDocMaBottom : "下部", +DlgDocMeIndex : "文書のキーワード(カンマ区切り)", +DlgDocMeDescr : "文書の概要", +DlgDocMeAuthor : "文書の作者", +DlgDocMeCopy : "文書の著作権", +DlgDocPreview : "プレビュー", + +// Templates Dialog +Templates : "テンプレート(雛形)", +DlgTemplatesTitle : "テンプレート内容", +DlgTemplatesSelMsg : "エディターで使用するテンプレートを選択してください。
        (現在のエディタの内容は失われます):", +DlgTemplatesLoading : "テンプレート一覧読み込み中. しばらくお待ちください...", +DlgTemplatesNoTpl : "(テンプレートが定義されていません)", +DlgTemplatesReplace : "現在のエディタの内容と置換えをします", + +// About Dialog +DlgAboutAboutTab : "バージョン情報", +DlgAboutBrowserInfoTab : "ブラウザ情報", +DlgAboutLicenseTab : "ライセンス", +DlgAboutVersion : "バージョン", +DlgAboutInfo : "より詳しい情報はこちらで" +}; Property changes on: announcement/trunk/src/main/webapp/fckeditor/editor/lang/ja.js ___________________________________________________________________ Name: svn:eol-style + native Added: announcement/trunk/src/main/webapp/fckeditor/editor/lang/km.js =================================================================== --- announcement/trunk/src/main/webapp/fckeditor/editor/lang/km.js (rev 0) +++ announcement/trunk/src/main/webapp/fckeditor/editor/lang/km.js 2008-06-30 02:54:27 UTC (rev 1002) @@ -0,0 +1,515 @@ +?/* + * FCKeditor - The text editor for Internet - http://www.fckeditor.net + * Copyright (C) 2003-2008 Frederico Caldeira Knabben + * + * == BEGIN LICENSE == + * + * Licensed under the terms of any of the following licenses at your + * choice: + * + * - GNU General Public License Version 2 or later (the "GPL") + * http://www.gnu.org/licenses/gpl.html + * + * - GNU Lesser General Public License Version 2.1 or later (the "LGPL") + * http://www.gnu.org/licenses/lgpl.html + * + * - Mozilla Public License Version 1.1 or later (the "MPL") + * http://www.mozilla.org/MPL/MPL-1.1.html + * + * == END LICENSE == + * + * Khmer language file. + */ + +var FCKLang = +{ +// Language direction : "ltr" (left to right) or "rtl" (right to left). +Dir : "ltr", + +ToolbarCollapse : "???????????????", +ToolbarExpand : "??????????????", + +// Toolbar Items and Context Menu +Save : "????????", +NewPage : "?????????", +Preview : "??????????", +Cut : "??????", +Copy : "??????", +Paste : "????????", +PasteText : "??????????????????????", +PasteWord : "?????????? Word", +Print : "????????", +SelectAll : "???????????????", +RemoveFormat : "?????? ???????", +InsertLinkLbl : "??????", +InsertLink : "??????/?????? ??????", +RemoveLink : "?????????", +Anchor : "??????/?????? ??????", +AnchorDelete : "Remove Anchor", //MISSING +InsertImageLbl : "??????", +InsertImage : "??????/?????? ??????", +InsertFlashLbl : "Flash", +InsertFlash : "??????/?????? Flash", +InsertTableLbl : "?????", +InsertTable : "??????/?????? ?????", +InsertLineLbl : "???????", +InsertLine : "??????????????????", +InsertSpecialCharLbl: "??????????", +InsertSpecialChar : "????????????????", +InsertSmileyLbl : "??????", +InsertSmiley : "?????? ??????", +About : "???? FCKeditor", +Bold : "??????????", +Italic : "??????????", +Underline : "??????????????????????", +StrikeThrough : "?????????????????????????", +Subscript : "?????????????", +Superscript : "??????????", +LeftJustify : "??????????", +CenterJustify : "???????????", +RightJustify : "??????????", +BlockJustify : "??????????", +DecreaseIndent : "??????????????????", +IncreaseIndent : "???????????????????", +Blockquote : "Blockquote", //MISSING +Undo : "?????????", +Redo : "??????????", +NumberedListLbl : "????????????", +NumberedList : "??????/??? ????????????", +BulletedListLbl : "????????????????", +BulletedList : "??????/??? ????????????????", +ShowTableBorders : "???????????????", +ShowDetails : "?????????????", +Style : "????", +FontFormat : "????", +Font : "?????", +FontSize : "????", +TextColor : "????????", +BGColor : "???????????????", +Source : "???", +Find : "???????", +Replace : "?????", +SpellCheck : "????????????????????", +UniversalKeyboard : "??????????????????", +PageBreakLbl : "??????????????", +PageBreak : "?????? ??????????????", + +Form : "?????", +Checkbox : "??????????????", +RadioButton : "???????????????", +TextField : "??????????????", +Textarea : "????????????????", +HiddenField : "???????", +Button : "??????", +SelectionField : "???????????", +ImageButton : "????????????", + +FitWindow : "Maximize the editor size", //MISSING +ShowBlocks : "Show Blocks", //MISSING + +// Context Menu +EditLink : "????????????", +CellCM : "Cell", //MISSING +RowCM : "Row", //MISSING +ColumnCM : "Column", //MISSING +InsertRowAfter : "Insert Row After", //MISSING +InsertRowBefore : "Insert Row Before", //MISSING +DeleteRows : "???????????", +InsertColumnAfter : "Insert Column After", //MISSING +InsertColumnBefore : "Insert Column Before", //MISSING +DeleteColumns : "????????", +InsertCellAfter : "Insert Cell After", //MISSING +InsertCellBefore : "Insert Cell Before", //MISSING +DeleteCells : "??????", +MergeCells : "?????????", +MergeRight : "Merge Right", //MISSING +MergeDown : "Merge Down", //MISSING +HorizontalSplitCell : "Split Cell Horizontally", //MISSING +VerticalSplitCell : "Split Cell Vertically", //MISSING +TableDelete : "????????", +CellProperties : "???????????", +TableProperties : "?????????????", +ImageProperties : "??????????????", +FlashProperties : "???????? Flash", + +AnchorProp : "??????????????", +ButtonProp : "???????? ??????", +CheckboxProp : "??????????????????????", +HiddenFieldProp : "???????????????", +RadioButtonProp : "????????????????????", +ImageButtonProp : "????????????????????", +TextFieldProp : "?????????????????", +SelectionFieldProp : "???????????????????", +TextareaProp : "?????????????????????????", +FormProp : "?????????????", + +FontFormats : "Normal;Formatted;Address;Heading 1;Heading 2;Heading 3;Heading 4;Heading 5;Heading 6;Normal (DIV)", + +// Alerts and Messages +ProcessingXHTML : "????????????? XHTML ? ????????...", +Done : "??????????", +PasteWordConfirm : "????????????????????????????? ?????????????????????????????????Word?? ?????????????????????????????????????", +NotCompatiblePaste : "??????????????????????????? Internet Explorer ????? 5.5 ?? ?????? ? ?????????????????????????????????????????", +UnknownToolbarItem : "???????????????? ????????? \"%1\"", +UnknownCommand : "??????????????? ????????? \"%1\"", +NotImplemented : "?????????? ?????????????", +UnknownToolbarSet : "????????? \"%1\" ?????? ?", +NoActiveX : "????????????????????????????????????????????? ????????????????????????????????????????????????????????????????????? ? ???????????????????? \"ActiveX ?????????????????????? (plug-ins)\" ??????????? ? ????????????????????? ????? ????????????????????????????????????????????????????????????? ?", +BrowseServerBlocked : "The resources browser could not be opened. Make sure that all popup blockers are disabled.", //MISSING +DialogBlocked : "???????????????????? ? ?????????????????????????? ????????? (popup) ?????????????????? ?", + +// Dialogs +DlgBtnOK : "???????", +DlgBtnCancel : "??????????", +DlgBtnClose : "???", +DlgBtnBrowseServer : "???", +DlgAdvancedTag : "??????????", +DlgOpOther : "", +DlgInfoTab : "??????", +DlgAlertUrl : "???????? URL", + +// General Dialogs Labels +DlgGenNotSet : "", +DlgGenId : "Id", +DlgGenLangDir : "?????????", +DlgGenLangDirLtr : "??????????????(LTR)", +DlgGenLangDirRtl : "??????????????(RTL)", +DlgGenLangCode : "??????????", +DlgGenAccessKey : "?? ?????????", +DlgGenName : "?????", +DlgGenTabIndex : "??? Tab", +DlgGenLongDescr : "???????? URL ???", +DlgGenClass : "Stylesheet Classes", +DlgGenTitle : "??????? ????????", +DlgGenContType : "???????????? ????????", +DlgGenLinkCharset : "?????????????????????", +DlgGenStyle : "????", + +// Image Dialog +DlgImgTitle : "??????????????", +DlgImgInfoTab : "????????????????", +DlgImgBtnUpload : "????????????????????????????", +DlgImgURL : "URL", +DlgImgUpload : "?????", +DlgImgAlt : "???????????", +DlgImgWidth : "????", +DlgImgHeight : "?????", +DlgImgLockRatio : "????????", +DlgBtnResetSize : "???????????????", +DlgImgBorder : "????", +DlgImgHSpace : "?????????", +DlgImgVSpace : "???????????", +DlgImgAlign : "???????????", +DlgImgAlignLeft : "???????", +DlgImgAlignAbsBottom: "Abs Bottom", //MISSING +DlgImgAlignAbsMiddle: "Abs Middle", //MISSING +DlgImgAlignBaseline : "?????????????????", +DlgImgAlignBottom : "????????", +DlgImgAlignMiddle : "??????", +DlgImgAlignRight : "????????", +DlgImgAlignTextTop : "????????", +DlgImgAlignTop : "?????", +DlgImgPreview : "??????????", +DlgImgAlertUrl : "????????????????????????????", +DlgImgLinkTab : "??????", + +// Flash Dialog +DlgFlashTitle : "???????? Flash", +DlgFlashChkPlay : "??????????????????", +DlgFlashChkLoop : "???????", +DlgFlashChkMenu : "?????? ????????? Flash", +DlgFlashScale : "????", +DlgFlashScaleAll : "?????????????", +DlgFlashScaleNoBorder : "?????????????", +DlgFlashScaleFit : "?????????", + +// Link Dialog +DlgLnkWindowTitle : "??????", +DlgLnkInfoTab : "????????????????", +DlgLnkTargetTab : "?????", + +DlgLnkType : "????????????", +DlgLnkTypeURL : "URL", +DlgLnkTypeAnchor : "?????????????????????", +DlgLnkTypeEMail : "??????", +DlgLnkProto : "?????????", +DlgLnkProtoOther : "", +DlgLnkURL : "URL", +DlgLnkAnchorSel : "??????????????", +DlgLnkAnchorByName : "??????????????????", +DlgLnkAnchorById : "??? Id", +DlgLnkNoAnchors : "(No anchors available in the document)", //MISSING +DlgLnkEMail : "??????", +DlgLnkEMailSubject : "?????????????", +DlgLnkEMailBody : "??????", +DlgLnkUpload : "?????", +DlgLnkBtnUpload : "?????", + +DlgLnkTarget : "?????", +DlgLnkTargetFrame : "", +DlgLnkTargetPopup : "", +DlgLnkTargetBlank : "?????????? (_blank)", +DlgLnkTargetParent : "???????? (_parent)", +DlgLnkTargetSelf : "?????????? (_self)", +DlgLnkTargetTop : "????????????(_top)", +DlgLnkTargetFrameName : "??????????????????????", +DlgLnkPopWinName : "??????????????", +DlgLnkPopWinFeat : "???????????????????", +DlgLnkPopResize : "??????????????????", +DlgLnkPopLocation : "??? ??????", +DlgLnkPopMenu : "??? ?????", +DlgLnkPopScroll : "??? ???", +DlgLnkPopStatus : "??? ??????", +DlgLnkPopToolbar : "??? ??????", +DlgLnkPopFullScrn : "??????????(IE)", +DlgLnkPopDependent : "????????? (Netscape)", +DlgLnkPopWidth : "????", +DlgLnkPopHeight : "?????", +DlgLnkPopLeft : "??????????????", +DlgLnkPopTop : "???????????", + +DlnLnkMsgNoUrl : "???????? ?????????? URL", +DlnLnkMsgNoEMail : "???????? ?????????? ??????", +DlnLnkMsgNoAnchor : "??????????? ??????", +DlnLnkMsgInvPopName : "The popup name must begin with an alphabetic character and must not contain spaces", //MISSING + +// Color Dialog +DlgColorTitle : "???????? ???", +DlgColorBtnClear : "???", +DlgColorHighlight : "???????", +DlgColorSelected : "???????????", + +// Smiley Dialog +DlgSmileyTitle : "????????????", + +// Special Character Dialog +DlgSpecialCharTitle : "????????????", + +// Table Dialog +DlgTableTitle : "???????? ?????", +DlgTableRows : "????????", +DlgTableColumns : "?????", +DlgTableBorder : "????????", +DlgTableAlign : "??????????????", +DlgTableAlignNotSet : "", +DlgTableAlignLeft : "????????", +DlgTableAlignCenter : "??????", +DlgTableAlignRight : "????????", +DlgTableWidth : "????", +DlgTableWidthPx : "??????", +DlgTableWidthPc : "?????", +DlgTableHeight : "?????", +DlgTableCellSpace : "????????", +DlgTableCellPad : "??????", +DlgTableCaption : "???????", +DlgTableSummary : "?????????????", + +// Table Cell Dialog +DlgCellTitle : "???????? ???", +DlgCellWidth : "????", +DlgCellWidthPx : "??????", +DlgCellWidthPc : "?????", +DlgCellHeight : "?????", +DlgCellWordWrap : "???????????????????", +DlgCellWordWrapNotSet : "", +DlgCellWordWrapYes : "???(??)", +DlgCellWordWrapNo : "??", +DlgCellHorAlign : "??????????", +DlgCellHorAlignNotSet : "", +DlgCellHorAlignLeft : "????????", +DlgCellHorAlignCenter : "??????", +DlgCellHorAlignRight: "Right", //MISSING +DlgCellVerAlign : "???????", +DlgCellVerAlignNotSet : "", +DlgCellVerAlignTop : "?????", +DlgCellVerAlignMiddle : "??????", +DlgCellVerAlignBottom : "????????", +DlgCellVerAlignBaseline : "?????????????????", +DlgCellRowSpan : "??????????????", +DlgCellCollSpan : "???????????", +DlgCellBackColor : "????????????????", +DlgCellBorderColor : "???????", +DlgCellBtnSelect : "????????...", + +// Find and Replace Dialog +DlgFindAndReplaceTitle : "Find and Replace", //MISSING + +// Find Dialog +DlgFindTitle : "???????", +DlgFindFindBtn : "???????", +DlgFindNotFoundMsg : "???????? ?????????? ?", + +// Replace Dialog +DlgReplaceTitle : "?????", +DlgReplaceFindLbl : "???????????:", +DlgReplaceReplaceLbl : "??????????:", +DlgReplaceCaseChk : "???????????", +DlgReplaceReplaceBtn : "?????", +DlgReplaceReplAllBtn : "????????????", +DlgReplaceWordChk : "?????????????????", + +// Paste Operations / Dialog +PasteErrorCut : "????????????????????????????????????????????? ??????????????????????????????????? ????????????????????????????????? ? ?????????????????? ???????? (Ctrl+X) ?", +PasteErrorCopy : "????????????????????????????????????????????? ??????????????????????????????????? ????????????????????????????????? ? ?????????????????? ???????? (Ctrl+C)?", + +PasteAsText : "????????????????????", +PasteFromWord : "??????????????????? Word", + +DlgPasteMsg2 : "?????????????????????????????????????????????????????? ?? ?(Ctrl+V) ?????? OK ?", +DlgPasteSec : "Because of your browser security settings, the editor is not able to access your clipboard data directly. You are required to paste it again in this window.", //MISSING +DlgPasteIgnoreFont : "??????????????????????????", +DlgPasteRemoveStyles : "???????", + +// Color Picker +ColorAutomatic : "????????????", +ColorMoreColors : "???????????..", + +// Document Properties +DocProps : "???????? ?????", + +// Anchor Dialog +DlgAnchorTitle : "????????????????????????", +DlgAnchorName : "??????????????", +DlgAnchorErrorName : "???????? ??????????????", + +// Speller Pages Dialog +DlgSpellNotInDic : "????????????????????", +DlgSpellChangeTo : "?????????????", +DlgSpellBtnIgnore : "??????????????", +DlgSpellBtnIgnoreAll : "?????????????? ???????", +DlgSpellBtnReplace : "?????", +DlgSpellBtnReplaceAll : "????????????", +DlgSpellBtnUndo : "?????????", +DlgSpellNoSuggestions : "- ?????????? -", +DlgSpellProgress : "?????????????????????????...", +DlgSpellNoMispell : "?????????????????????????????: ??????????", +DlgSpellNoChanges : "?????????????????????????????: ?????????????????", +DlgSpellOneChange : "?????????????????????????????: ???????????????????????????", +DlgSpellManyChanges : "?????????????????????????????: %1 ???????????????????", + +IeSpellDownload : "?????????????????????????????????? ? ???????????????", + +// Button Dialog +DlgButtonText : "??????(????)", +DlgButtonType : "??????", +DlgButtonTypeBtn : "Button", //MISSING +DlgButtonTypeSbm : "Submit", //MISSING +DlgButtonTypeRst : "Reset", //MISSING + +// Checkbox and Radio Button Dialogs +DlgCheckboxName : "?????", +DlgCheckboxValue : "????", +DlgCheckboxSelected : "???????????", + +// Form Dialog +DlgFormName : "?????", +DlgFormAction : "????????", +DlgFormMethod : "????", + +// Select Field Dialog +DlgSelectName : "?????", +DlgSelectValue : "????", +DlgSelectSize : "????", +DlgSelectLines : "???????", +DlgSelectChkMulti : "????????????????????????", +DlgSelectOpAvail : "???????????????? ??????????????", +DlgSelectOpText : "?????", +DlgSelectOpValue : "????", +DlgSelectBtnAdd : "??????", +DlgSelectBtnModify : "???????????", +DlgSelectBtnUp : "??", +DlgSelectBtnDown : "?????", +DlgSelectBtnSetValue : "Set as selected value", //MISSING +DlgSelectBtnDelete : "???", + +// Textarea Dialog +DlgTextareaName : "?????", +DlgTextareaCols : "?????", +DlgTextareaRows : "????????", + +// Text Field Dialog +DlgTextName : "?????", +DlgTextValue : "????", +DlgTextCharWidth : "???? ?????", +DlgTextMaxChars : "?????????????", +DlgTextType : "??????", +DlgTextTypeText : "?????", +DlgTextTypePass : "???????????", + +// Hidden Field Dialog +DlgHiddenName : "?????", +DlgHiddenValue : "????", + +// Bulleted List Dialog +BulletedListProp : "????????????????", +NumberedListProp : "??????????????", +DlgLstStart : "Start", //MISSING +DlgLstType : "??????", +DlgLstTypeCircle : "??????", +DlgLstTypeDisc : "Disc", +DlgLstTypeSquare : "????", +DlgLstTypeNumbers : "???(1, 2, 3)", +DlgLstTypeLCase : "????????(a, b, c)", +DlgLstTypeUCase : "???????(A, B, C)", +DlgLstTypeSRoman : "??????????????(i, ii, iii)", +DlgLstTypeLRoman : "?????????????(I, II, III)", + +// Document Properties Dialog +DlgDocGeneralTab : "????", +DlgDocBackTab : "?????????????", +DlgDocColorsTab : "????????? ????", +DlgDocMetaTab : "??????????", + +DlgDocPageTitle : "????????????", +DlgDocLangDir : "??????????????", +DlgDocLangDirLTR : "??????????????(LTR)", +DlgDocLangDirRTL : "??????????????(RTL)", +DlgDocLangCode : "??????????", +DlgDocCharSet : "???????????????", +DlgDocCharSetCE : "Central European", //MISSING +DlgDocCharSetCT : "Chinese Traditional (Big5)", //MISSING +DlgDocCharSetCR : "Cyrillic", //MISSING +DlgDocCharSetGR : "Greek", //MISSING +DlgDocCharSetJP : "Japanese", //MISSING +DlgDocCharSetKR : "Korean", //MISSING +DlgDocCharSetTR : "Turkish", //MISSING +DlgDocCharSetUN : "Unicode (UTF-8)", //MISSING +DlgDocCharSetWE : "Western European", //MISSING +DlgDocCharSetOther : "???????????????????????", + +DlgDocDocType : "????????????????", +DlgDocDocTypeOther : "????????????????????????", +DlgDocIncXHTML : "?????? XHTML", +DlgDocBgColor : "???????????", +DlgDocBgImage : "URL ??????????????????", +DlgDocBgNoScroll : "??????????????????", +DlgDocCText : "??????", +DlgDocCLink : "??????", +DlgDocCVisited : "????????????", +DlgDocCActive : "??????????????", +DlgDocMargins : "?????????", +DlgDocMaTop : "??", +DlgDocMaLeft : "?????", +DlgDocMaRight : "?????", +DlgDocMaBottom : "?????", +DlgDocMeIndex : "????????????????? (????????????????????)", +DlgDocMeDescr : "????????????????????????????", +DlgDocMeAuthor : "??????????", +DlgDocMeCopy : "????????????", +DlgDocPreview : "??????????", + +// Templates Dialog +Templates : "?????????", +DlgTemplatesTitle : "????????? ???????????", +DlgTemplatesSelMsg : "???????????????????? ?????????????????????????????????????
        (????????????????):", +DlgTemplatesLoading : "?????????????????????? ? ????????...", +DlgTemplatesNoTpl : "(????????????????????????????)", +DlgTemplatesReplace : "Replace actual contents", //MISSING + +// About Dialog +DlgAboutAboutTab : "????", +DlgAboutBrowserInfoTab : "???????????????????", +DlgAboutLicenseTab : "License", //MISSING +DlgAboutVersion : "??????", +DlgAboutInfo : "???????????????????? ?????????" +}; Property changes on: announcement/trunk/src/main/webapp/fckeditor/editor/lang/km.js ___________________________________________________________________ Name: svn:eol-style + native Added: announcement/trunk/src/main/webapp/fckeditor/editor/lang/ko.js =================================================================== --- announcement/trunk/src/main/webapp/fckeditor/editor/lang/ko.js (rev 0) +++ announcement/trunk/src/main/webapp/fckeditor/editor/lang/ko.js 2008-06-30 02:54:27 UTC (rev 1002) @@ -0,0 +1,515 @@ +?/* + * FCKeditor - The text editor for Internet - http://www.fckeditor.net + * Copyright (C) 2003-2008 Frederico Caldeira Knabben + * + * == BEGIN LICENSE == + * + * Licensed under the terms of any of the following licenses at your + * choice: + * + * - GNU General Public License Version 2 or later (the "GPL") + * http://www.gnu.org/licenses/gpl.html + * + * - GNU Lesser General Public License Version 2.1 or later (the "LGPL") + * http://www.gnu.org/licenses/lgpl.html + * + * - Mozilla Public License Version 1.1 or later (the "MPL") + * http://www.mozilla.org/MPL/MPL-1.1.html + * + * == END LICENSE == + * + * Korean language file. + */ + +var FCKLang = +{ +// Language direction : "ltr" (left to right) or "rtl" (right to left). +Dir : "ltr", + +ToolbarCollapse : "?? ???", +ToolbarExpand : "?? ???", + +// Toolbar Items and Context Menu +Save : "????", +NewPage : "? ??", +Preview : "????", +Cut : "????", +Copy : "????", +Paste : "????", +PasteText : "???? ????", +PasteWord : "MS Word ???? ????", +Print : "????", +SelectAll : "????", +RemoveFormat : "?? ???", +InsertLinkLbl : "??", +InsertLink : "?? ??/??", +RemoveLink : "?? ??", +Anchor : "??? ??/??", +AnchorDelete : "Remove Anchor", //MISSING +InsertImageLbl : "???", +InsertImage : "??? ??/??", +InsertFlashLbl : "???", +InsertFlash : "??? ??/??", +InsertTableLbl : "?", +InsertTable : "? ??/??", +InsertLineLbl : "???", +InsertLine : "??? ??", +InsertSpecialCharLbl: "???? ??", +InsertSpecialChar : "???? ??", +InsertSmileyLbl : "???", +InsertSmiley : "??? ??", +About : "FCKeditor? ???", +Bold : "???", +Italic : "???", +Underline : "??", +StrikeThrough : "???", +Subscript : "?? ??", +Superscript : "? ??", +LeftJustify : "?? ??", +CenterJustify : "??? ??", +RightJustify : "??? ??", +BlockJustify : "?? ??", +DecreaseIndent : "????", +IncreaseIndent : "????", +Blockquote : "Blockquote", //MISSING +Undo : "??", +Redo : "???", +NumberedListLbl : "???? ??", +NumberedList : "???? ??", +BulletedListLbl : "???? ??", +BulletedList : "???? ??", +ShowTableBorders : "? ??? ??", +ShowDetails : "???? ??", +Style : "???", +FontFormat : "??", +Font : "??", +FontSize : "?? ??", +TextColor : "?? ??", +BGColor : "?? ??", +Source : "??", +Find : "??", +Replace : "???", +SpellCheck : "????", +UniversalKeyboard : "??? ???", +PageBreakLbl : "Page Break", //MISSING +PageBreak : "Insert Page Break", //MISSING + +Form : "?", +Checkbox : "????", +RadioButton : "?????", +TextField : "????", +Textarea : "????", +HiddenField : "????", +Button : "??", +SelectionField : "????", +ImageButton : "?????", + +FitWindow : "??? ???", +ShowBlocks : "Show Blocks", //MISSING + +// Context Menu +EditLink : "?? ??", +CellCM : "?/?(Cell)", +RowCM : "?(Row)", +ColumnCM : "?(Column)", +InsertRowAfter : "?? ? ??", +InsertRowBefore : "?? ? ??", +DeleteRows : "??? ??", +InsertColumnAfter : "?? ? ??", +InsertColumnBefore : "?? ? ??", +DeleteColumns : "??? ??", +InsertCellAfter : "?? ?/? ??", +InsertCellBefore : "?? ?/? ??", +DeleteCells : "? ??", +MergeCells : "? ???", +MergeRight : "??? ???", +MergeDown : "?? ???", +HorizontalSplitCell : "?? ???", +VerticalSplitCell : "?? ???", +TableDelete : "? ??", +CellProperties : "? ??", +TableProperties : "? ??", +ImageProperties : "??? ??", +FlashProperties : "??? ??", + +AnchorProp : "??? ??", +ButtonProp : "?? ??", +CheckboxProp : "???? ??", +HiddenFieldProp : "???? ??", +RadioButtonProp : "????? ??", +ImageButtonProp : "????? ??", +TextFieldProp : "???? ??", +SelectionFieldProp : "???? ??", +TextareaProp : "???? ??", +FormProp : "? ??", + +FontFormats : "Normal;Formatted;Address;Heading 1;Heading 2;Heading 3;Heading 4;Heading 5;Heading 6", + +// Alerts and Messages +ProcessingXHTML : "XHTML ???. ??? ???????.", +Done : "??", +PasteWordConfirm : "???? ? ???? MS Word?? ??? ????. ???? ?? MS Word ??? ?????????", +NotCompatiblePaste : "? ??? ???????? 5.5 ?? ????? ?????. ??? ???? ?? ???? ???????", +UnknownToolbarItem : "???? ?????. : \"%1\"", +UnknownCommand : "???? ?????. : \"%1\"", +NotImplemented : "??? ???? ?????.", +UnknownToolbarSet : "?? ??? ????. : \"%1\"", +NoActiveX : "????? ?? ???? ?? ?? ??? ??? ??? ?? ? ????. \"???-?? ??? ??? ?\" ??? ???? ??? ??? ??? ??? ? ????.", +BrowseServerBlocked : "???? ??? ??? ????. ???? ??? ????? ???? ????.", +DialogBlocked : "??? ???? ? ? ????. ???? ??? ????? ???? ????.", + +// Dialogs +DlgBtnOK : "?", +DlgBtnCancel : "???", +DlgBtnClose : "??", +DlgBtnBrowseServer : "?? ??", +DlgAdvancedTag : "???", +DlgOpOther : "", +DlgInfoTab : "??", +DlgAlertUrl : "URL? ??????", + +// General Dialogs Labels +DlgGenNotSet : "", +DlgGenId : "ID", +DlgGenLangDir : "?? ??", +DlgGenLangDirLtr : "???? ??? (LTR)", +DlgGenLangDirRtl : "????? ?? (RTL)", +DlgGenLangCode : "?? ??", +DlgGenAccessKey : "??? ?", +DlgGenName : "Name", +DlgGenTabIndex : "? ??", +DlgGenLongDescr : "URL ??", +DlgGenClass : "Stylesheet Classes", +DlgGenTitle : "Advisory Title", +DlgGenContType : "Advisory Content Type", +DlgGenLinkCharset : "Linked Resource Charset", +DlgGenStyle : "Style", + +// Image Dialog +DlgImgTitle : "??? ??", +DlgImgInfoTab : "??? ??", +DlgImgBtnUpload : "??? ??", +DlgImgURL : "URL", +DlgImgUpload : "???", +DlgImgAlt : "??? ??", +DlgImgWidth : "??", +DlgImgHeight : "??", +DlgImgLockRatio : "?? ??", +DlgBtnResetSize : "?? ???", +DlgImgBorder : "???", +DlgImgHSpace : "????", +DlgImgVSpace : "????", +DlgImgAlign : "??", +DlgImgAlignLeft : "??", +DlgImgAlignAbsBottom: "???(Abs Bottom)", +DlgImgAlignAbsMiddle: "???(Abs Middle)", +DlgImgAlignBaseline : "???", +DlgImgAlignBottom : "??", +DlgImgAlignMiddle : "??", +DlgImgAlignRight : "???", +DlgImgAlignTextTop : "????", +DlgImgAlignTop : "?", +DlgImgPreview : "????", +DlgImgAlertUrl : "??? URL? ??????", +DlgImgLinkTab : "??", + +// Flash Dialog +DlgFlashTitle : "??? ????", +DlgFlashChkPlay : "????", +DlgFlashChkLoop : "??", +DlgFlashChkMenu : "????? ??", +DlgFlashScale : "??", +DlgFlashScaleAll : "????", +DlgFlashScaleNoBorder : "?????", +DlgFlashScaleFit : "??????", + +// Link Dialog +DlgLnkWindowTitle : "??", +DlgLnkInfoTab : "?? ??", +DlgLnkTargetTab : "??", + +DlgLnkType : "?? ??", +DlgLnkTypeURL : "URL", +DlgLnkTypeAnchor : "???", +DlgLnkTypeEMail : "???", +DlgLnkProto : "????", +DlgLnkProtoOther : "", +DlgLnkURL : "URL", +DlgLnkAnchorSel : "??? ??", +DlgLnkAnchorByName : "??? ??", +DlgLnkAnchorById : "??? ID", +DlgLnkNoAnchors : "(??? ???? ????.)", +DlgLnkEMail : "??? ??", +DlgLnkEMailSubject : "??", +DlgLnkEMailBody : "??", +DlgLnkUpload : "???", +DlgLnkBtnUpload : "??? ??", + +DlgLnkTarget : "??", +DlgLnkTargetFrame : "", +DlgLnkTargetPopup : "", +DlgLnkTargetBlank : "? ? (_blank)", +DlgLnkTargetParent : "?? ? (_parent)", +DlgLnkTargetSelf : "?? ? (_self)", +DlgLnkTargetTop : "? ?? ? (_top)", +DlgLnkTargetFrameName : "?? ??? ??", +DlgLnkPopWinName : "??? ??", +DlgLnkPopWinFeat : "??? ??", +DlgLnkPopResize : "????", +DlgLnkPopLocation : "?????", +DlgLnkPopMenu : "???", +DlgLnkPopScroll : "????", +DlgLnkPopStatus : "???", +DlgLnkPopToolbar : "??", +DlgLnkPopFullScrn : "???? (IE)", +DlgLnkPopDependent : "Dependent (Netscape)", +DlgLnkPopWidth : "??", +DlgLnkPopHeight : "??", +DlgLnkPopLeft : "?? ??", +DlgLnkPopTop : "?? ??", + +DlnLnkMsgNoUrl : "?? URL? ??????.", +DlnLnkMsgNoEMail : "?????? ??????.", +DlnLnkMsgNoAnchor : "????? ??????.", +DlnLnkMsgInvPopName : "???? ???? ??? ???? ????.", + +// Color Dialog +DlgColorTitle : "?? ??", +DlgColorBtnClear : "???", +DlgColorHighlight : "??", +DlgColorSelected : "???", + +// Smiley Dialog +DlgSmileyTitle : "??? ??", + +// Special Character Dialog +DlgSpecialCharTitle : "???? ??", + +// Table Dialog +DlgTableTitle : "? ??", +DlgTableRows : "???", +DlgTableColumns : "???", +DlgTableBorder : "??? ??", +DlgTableAlign : "??", +DlgTableAlignNotSet : "", +DlgTableAlignLeft : "??", +DlgTableAlignCenter : "???", +DlgTableAlignRight : "???", +DlgTableWidth : "??", +DlgTableWidthPx : "??", +DlgTableWidthPc : "???", +DlgTableHeight : "??", +DlgTableCellSpace : "? ??", +DlgTableCellPad : "? ??", +DlgTableCaption : "??", +DlgTableSummary : "Summary", //MISSING + +// Table Cell Dialog +DlgCellTitle : "? ??", +DlgCellWidth : "??", +DlgCellWidthPx : "??", +DlgCellWidthPc : "???", +DlgCellHeight : "??", +DlgCellWordWrap : "???", +DlgCellWordWrapNotSet : "", +DlgCellWordWrapYes : "?", +DlgCellWordWrapNo : "???", +DlgCellHorAlign : "?? ??", +DlgCellHorAlignNotSet : "", +DlgCellHorAlignLeft : "??", +DlgCellHorAlignCenter : "???", +DlgCellHorAlignRight: "???", +DlgCellVerAlign : "?? ??", +DlgCellVerAlignNotSet : "", +DlgCellVerAlignTop : "?", +DlgCellVerAlignMiddle : "??", +DlgCellVerAlignBottom : "??", +DlgCellVerAlignBaseline : "???", +DlgCellRowSpan : "?? ???", +DlgCellCollSpan : "?? ???", +DlgCellBackColor : "?? ??", +DlgCellBorderColor : "??? ??", +DlgCellBtnSelect : "??", + +// Find and Replace Dialog +DlgFindAndReplaceTitle : "?? & ???", + +// Find Dialog +DlgFindTitle : "??", +DlgFindFindBtn : "??", +DlgFindNotFoundMsg : "???? ?? ? ????.", + +// Replace Dialog +DlgReplaceTitle : "???", +DlgReplaceFindLbl : "?? ???:", +DlgReplaceReplaceLbl : "?? ???:", +DlgReplaceCaseChk : "???? ??", +DlgReplaceReplaceBtn : "???", +DlgReplaceReplAllBtn : "?? ???", +DlgReplaceWordChk : "??? ??", + +// Paste Operations / Dialog +PasteErrorCut : "????? ??????? ???? ??? ??? ? ????. ??? ??? ??????. (Ctrl+X).", +PasteErrorCopy : "????? ??????? ???? ??? ??? ? ????. ??? ??? ??????. (Ctrl+C).", + +PasteAsText : "???? ????", +PasteFromWord : "MS Word ???? ????", + +DlgPasteMsg2 : "???? (Ctrl+V) ? ???? ???? ???? OK ? ????.", +DlgPasteSec : "???? ?? ???? ??, ????? ??? ?? ??? ? ????. ? ?? ?? ???? ????.", +DlgPasteIgnoreFont : "?? ?? ??", +DlgPasteRemoveStyles : "??? ?? ??", + +// Color Picker +ColorAutomatic : "????", +ColorMoreColors : "????...", + +// Document Properties +DocProps : "?? ??", + +// Anchor Dialog +DlgAnchorTitle : "??? ??", +DlgAnchorName : "??? ??", +DlgAnchorErrorName : "??? ??? ??????.", + +// Speller Pages Dialog +DlgSpellNotInDic : "??? ?? ??", +DlgSpellChangeTo : "??? ??", +DlgSpellBtnIgnore : "???", +DlgSpellBtnIgnoreAll : "?? ???", +DlgSpellBtnReplace : "??", +DlgSpellBtnReplaceAll : "?? ??", +DlgSpellBtnUndo : "??", +DlgSpellNoSuggestions : "- ???? ?? -", +DlgSpellProgress : "????? ??????...", +DlgSpellNoMispell : "???? ??: ??? ??? ????.", +DlgSpellNoChanges : "???? ??: ??? ??? ????.", +DlgSpellOneChange : "???? ??: ??? ???????.", +DlgSpellManyChanges : "???? ??: %1 ??? ???????.", + +IeSpellDownload : "?? ???? ???? ?????. ?? ???????????", + +// Button Dialog +DlgButtonText : "????(?)", +DlgButtonType : "????", +DlgButtonTypeBtn : "Button", //MISSING +DlgButtonTypeSbm : "Submit", //MISSING +DlgButtonTypeRst : "Reset", //MISSING + +// Checkbox and Radio Button Dialogs +DlgCheckboxName : "??", +DlgCheckboxValue : "?", +DlgCheckboxSelected : "???", + +// Form Dialog +DlgFormName : "???", +DlgFormAction : "????(Action)", +DlgFormMethod : "??(Method)", + +// Select Field Dialog +DlgSelectName : "??", +DlgSelectValue : "?", +DlgSelectSize : "????", +DlgSelectLines : "?", +DlgSelectChkMulti : "???? ?? ??", +DlgSelectOpAvail : "????", +DlgSelectOpText : "??", +DlgSelectOpValue : "?", +DlgSelectBtnAdd : "??", +DlgSelectBtnModify : "??", +DlgSelectBtnUp : "??", +DlgSelectBtnDown : "???", +DlgSelectBtnSetValue : "?????? ??", +DlgSelectBtnDelete : "??", + +// Textarea Dialog +DlgTextareaName : "??", +DlgTextareaCols : "??", +DlgTextareaRows : "??", + +// Text Field Dialog +DlgTextName : "??", +DlgTextValue : "?", +DlgTextCharWidth : "?? ??", +DlgTextMaxChars : "?? ???", +DlgTextType : "??", +DlgTextTypeText : "???", +DlgTextTypePass : "????", + +// Hidden Field Dialog +DlgHiddenName : "??", +DlgHiddenValue : "?", + +// Bulleted List Dialog +BulletedListProp : "???? ?? ??", +NumberedListProp : "???? ?? ??", +DlgLstStart : "Start", //MISSING +DlgLstType : "??", +DlgLstTypeCircle : "?(Circle)", +DlgLstTypeDisc : "Disc", //MISSING +DlgLstTypeSquare : "???(Square)", +DlgLstTypeNumbers : "?? (1, 2, 3)", +DlgLstTypeLCase : "??? (a, b, c)", +DlgLstTypeUCase : "??? (A, B, C)", +DlgLstTypeSRoman : "??? ??? (i, ii, iii)", +DlgLstTypeLRoman : "??? ??? (I, II, III)", + +// Document Properties Dialog +DlgDocGeneralTab : "??", +DlgDocBackTab : "??", +DlgDocColorsTab : "?? ? ??", +DlgDocMetaTab : "?????", + +DlgDocPageTitle : "????", +DlgDocLangDir : "?? ????", +DlgDocLangDirLTR : "???? ??? (LTR)", +DlgDocLangDirRTL : "????? ?? (RTL)", +DlgDocLangCode : "????", +DlgDocCharSet : "???? ???", +DlgDocCharSetCE : "Central European", //MISSING +DlgDocCharSetCT : "Chinese Traditional (Big5)", //MISSING +DlgDocCharSetCR : "Cyrillic", //MISSING +DlgDocCharSetGR : "Greek", //MISSING +DlgDocCharSetJP : "Japanese", //MISSING +DlgDocCharSetKR : "Korean", //MISSING +DlgDocCharSetTR : "Turkish", //MISSING +DlgDocCharSetUN : "Unicode (UTF-8)", //MISSING +DlgDocCharSetWE : "Western European", //MISSING +DlgDocCharSetOther : "?? ???? ???", + +DlgDocDocType : "?? ??", +DlgDocDocTypeOther : "?? ????", +DlgDocIncXHTML : "XHTML ???? ??", +DlgDocBgColor : "????", +DlgDocBgImage : "????? URL", +DlgDocBgNoScroll : "??????? ??", +DlgDocCText : "???", +DlgDocCLink : "??", +DlgDocCVisited : "??? ??(Visited)", +DlgDocCActive : "???? ??(Active)", +DlgDocMargins : "??? ??", +DlgDocMaTop : "?", +DlgDocMaLeft : "??", +DlgDocMaRight : "???", +DlgDocMaBottom : "??", +DlgDocMeIndex : "?? ??? (??? ??)", +DlgDocMeDescr : "?? ??", +DlgDocMeAuthor : "???", +DlgDocMeCopy : "???", +DlgDocPreview : "????", + +// Templates Dialog +Templates : "???", +DlgTemplatesTitle : "?? ???", +DlgTemplatesSelMsg : "????? ??? ???? ??????.
        (???? ??? ??? ?????.):", +DlgTemplatesLoading : "??? ??? ????????. ??? ???????.", +DlgTemplatesNoTpl : "(???? ????.)", +DlgTemplatesReplace : "?? ?? ???", + +// About Dialog +DlgAboutAboutTab : "About", +DlgAboutBrowserInfoTab : "???? ??", +DlgAboutLicenseTab : "License", //MISSING +DlgAboutVersion : "??", +DlgAboutInfo : "? ?? ??? ???? ?? ???? ????." +}; Property changes on: announcement/trunk/src/main/webapp/fckeditor/editor/lang/ko.js ___________________________________________________________________ Name: svn:eol-style + native Added: announcement/trunk/src/main/webapp/fckeditor/editor/lang/lt.js =================================================================== --- announcement/trunk/src/main/webapp/fckeditor/editor/lang/lt.js (rev 0) +++ announcement/trunk/src/main/webapp/fckeditor/editor/lang/lt.js 2008-06-30 02:54:27 UTC (rev 1002) @@ -0,0 +1,515 @@ +?/* + * FCKeditor - The text editor for Internet - http://www.fckeditor.net + * Copyright (C) 2003-2008 Frederico Caldeira Knabben + * + * == BEGIN LICENSE == + * + * Licensed under the terms of any of the following licenses at your + * choice: + * + * - GNU General Public License Version 2 or later (the "GPL") + * http://www.gnu.org/licenses/gpl.html + * + * - GNU Lesser General Public License Version 2.1 or later (the "LGPL") + * http://www.gnu.org/licenses/lgpl.html + * + * - Mozilla Public License Version 1.1 or later (the "MPL") + * http://www.mozilla.org/MPL/MPL-1.1.html + * + * == END LICENSE == + * + * Lithuanian language file. + */ + +var FCKLang = +{ +// Language direction : "ltr" (left to right) or "rtl" (right to left). +Dir : "ltr", + +ToolbarCollapse : "Sutraukti mygtukų juostą", +ToolbarExpand : "Išplėsti mygtukų juostą", + +// Toolbar Items and Context Menu +Save : "Išsaugoti", +NewPage : "Naujas puslapis", +Preview : "Peržiūra", +Cut : "Iškirpti", +Copy : "Kopijuoti", +Paste : "Įdėti", +PasteText : "Įdėti kaip gryną tekstą", +PasteWord : "Įdėti iš Word", +Print : "Spausdinti", +SelectAll : "Pažymėti viską", +RemoveFormat : "Panaikinti formatą", +InsertLinkLbl : "Nuoroda", +InsertLink : "Įterpti/taisyti nuorodą", +RemoveLink : "Panaikinti nuorodą", +Anchor : "Įterpti/modifikuoti žymę", +AnchorDelete : "Remove Anchor", //MISSING +InsertImageLbl : "Vaizdas", +InsertImage : "Įterpti/taisyti vaizdą", +InsertFlashLbl : "Flash", +InsertFlash : "Įterpti/taisyti Flash", +InsertTableLbl : "Lentelė", +InsertTable : "Įterpti/taisyti lentelę", +InsertLineLbl : "Linija", +InsertLine : "Įterpti horizontalią liniją", +InsertSpecialCharLbl: "Spec. simbolis", +InsertSpecialChar : "Įterpti specialų simbolį", +InsertSmileyLbl : "Veideliai", +InsertSmiley : "Įterpti veidelį", +About : "Apie FCKeditor", +Bold : "Pusjuodis", +Italic : "Kursyvas", +Underline : "Pabrauktas", +StrikeThrough : "Perbrauktas", +Subscript : "Apatinis indeksas", +Superscript : "Viršutinis indeksas", +LeftJustify : "Lygiuoti kairę", +CenterJustify : "Centruoti", +RightJustify : "Lygiuoti dešinę", +BlockJustify : "Lygiuoti abi puses", +DecreaseIndent : "Sumažinti įtrauką", +IncreaseIndent : "Padidinti įtrauką", +Blockquote : "Blockquote", //MISSING +Undo : "Atšaukti", +Redo : "Atstatyti", +NumberedListLbl : "Numeruotas sąrašas", +NumberedList : "Įterpti/Panaikinti numeruotą sąrašą", +BulletedListLbl : "Suženklintas sąrašas", +BulletedList : "Įterpti/Panaikinti suženklintą sąrašą", +ShowTableBorders : "Rodyti lentelės rėmus", +ShowDetails : "Rodyti detales", +Style : "Stilius", +FontFormat : "Šrifto formatas", +Font : "Šriftas", +FontSize : "Šrifto dydis", +TextColor : "Teksto spalva", +BGColor : "Fono spalva", +Source : "Šaltinis", +Find : "Rasti", +Replace : "Pakeisti", +SpellCheck : "Rašybos tikrinimas", +UniversalKeyboard : "Universali klaviatūra", +PageBreakLbl : "Puslapių skirtukas", +PageBreak : "Įterpti puslapių skirtuką", + +Form : "Forma", +Checkbox : "Žymimasis langelis", +RadioButton : "Žymimoji akutė", +TextField : "Teksto laukas", +Textarea : "Teksto sritis", +HiddenField : "Nerodomas laukas", +Button : "Mygtukas", +SelectionField : "Atrankos laukas", +ImageButton : "Vaizdinis mygtukas", + +FitWindow : "Maximize the editor size", //MISSING +ShowBlocks : "Show Blocks", //MISSING + +// Context Menu +EditLink : "Taisyti nuorodą", +CellCM : "Cell", //MISSING +RowCM : "Row", //MISSING +ColumnCM : "Column", //MISSING +InsertRowAfter : "Insert Row After", //MISSING +InsertRowBefore : "Insert Row Before", //MISSING +DeleteRows : "Šalinti eilutes", +InsertColumnAfter : "Insert Column After", //MISSING +InsertColumnBefore : "Insert Column Before", //MISSING +DeleteColumns : "Šalinti stulpelius", +InsertCellAfter : "Insert Cell After", //MISSING +InsertCellBefore : "Insert Cell Before", //MISSING +DeleteCells : "Šalinti langelius", +MergeCells : "Sujungti langelius", +MergeRight : "Merge Right", //MISSING +MergeDown : "Merge Down", //MISSING +HorizontalSplitCell : "Split Cell Horizontally", //MISSING +VerticalSplitCell : "Split Cell Vertically", //MISSING +TableDelete : "Šalinti lentelę", +CellProperties : "Langelio savybės", +TableProperties : "Lentelės savybės", +ImageProperties : "Vaizdo savybės", +FlashProperties : "Flash savybės", + +AnchorProp : "Žymės savybės", +ButtonProp : "Mygtuko savybės", +CheckboxProp : "Žymimojo langelio savybės", +HiddenFieldProp : "Nerodomo lauko savybės", +RadioButtonProp : "Žymimosios akutės savybės", +ImageButtonProp : "Vaizdinio mygtuko savybės", +TextFieldProp : "Teksto lauko savybės", +SelectionFieldProp : "Atrankos lauko savybės", +TextareaProp : "Teksto srities savybės", +FormProp : "Formos savybės", + +FontFormats : "Normalus;Formuotas;Kreipinio;Antraštinis 1;Antraštinis 2;Antraštinis 3;Antraštinis 4;Antraštinis 5;Antraštinis 6", + +// Alerts and Messages +ProcessingXHTML : "Apdorojamas XHTML. Prašome palaukti...", +Done : "Baigta", +PasteWordConfirm : "Įdedamas tekstas yra panašus į kopiją iš Word. Ar Jūs norite prieš įdėjimą išvalyti jį?", +NotCompatiblePaste : "Ši komanda yra prieinama tik per Internet Explorer 5.5 ar aukštesnę versiją. Ar Jūs norite įterpti be valymo?", +UnknownToolbarItem : "Nežinomas mygtukų juosta elementas \"%1\"", +UnknownCommand : "Nežinomas komandos vardas \"%1\"", +NotImplemented : "Komanda nėra įgyvendinta", +UnknownToolbarSet : "Mygtukų juostos rinkinys \"%1\" neegzistuoja", +NoActiveX : "Jūsų naršyklės saugumo nuostatos gali riboti kai kurias redaktoriaus savybes. Jūs turite aktyvuoti opciją \"Run ActiveX controls and plug-ins\". Kitu atveju Jums bus pranešama apie klaidas ir trūkstamas savybes.", +BrowseServerBlocked : "Neįmanoma atidaryti naujo naršyklės lango. Įsitikinkite, kad iškylančių langų blokavimo programos neveiksnios.", +DialogBlocked : "Neįmanoma atidaryti dialogo lango. Įsitikinkite, kad iškylančių langų blokavimo programos neveiksnios.", + +// Dialogs +DlgBtnOK : "OK", +DlgBtnCancel : "Nutraukti", +DlgBtnClose : "Uždaryti", +DlgBtnBrowseServer : "Naršyti po serverį", +DlgAdvancedTag : "Papildomas", +DlgOpOther : "", +DlgInfoTab : "Informacija", +DlgAlertUrl : "Prašome įrašyti URL", + +// General Dialogs Labels +DlgGenNotSet : "", +DlgGenId : "Id", +DlgGenLangDir : "Teksto kryptis", +DlgGenLangDirLtr : "Iš kairės į dešinę (LTR)", +DlgGenLangDirRtl : "Iš dešinės į kairę (RTL)", +DlgGenLangCode : "Kalbos kodas", +DlgGenAccessKey : "Prieigos raktas", +DlgGenName : "Vardas", +DlgGenTabIndex : "Tabuliavimo indeksas", +DlgGenLongDescr : "Ilgas aprašymas URL", +DlgGenClass : "Stilių lentelės klasės", +DlgGenTitle : "Konsultacinė antraštė", +DlgGenContType : "Konsultacinio turinio tipas", +DlgGenLinkCharset : "Susietų išteklių simbolių lentelė", +DlgGenStyle : "Stilius", + +// Image Dialog +DlgImgTitle : "Vaizdo savybės", +DlgImgInfoTab : "Vaizdo informacija", +DlgImgBtnUpload : "Siųsti į serverį", +DlgImgURL : "URL", +DlgImgUpload : "Nusiųsti", +DlgImgAlt : "Alternatyvus Tekstas", +DlgImgWidth : "Plotis", +DlgImgHeight : "Aukštis", +DlgImgLockRatio : "Išlaikyti proporciją", +DlgBtnResetSize : "Atstatyti dydį", +DlgImgBorder : "Rėmelis", +DlgImgHSpace : "Hor.Erdvė", +DlgImgVSpace : "Vert.Erdvė", +DlgImgAlign : "Lygiuoti", +DlgImgAlignLeft : "Kairę", +DlgImgAlignAbsBottom: "Absoliučią apačią", +DlgImgAlignAbsMiddle: "Absoliutų vidurį", +DlgImgAlignBaseline : "Apatinę liniją", +DlgImgAlignBottom : "Apačią", +DlgImgAlignMiddle : "Vidurį", +DlgImgAlignRight : "Dešinę", +DlgImgAlignTextTop : "Teksto viršūnę", +DlgImgAlignTop : "Viršūnę", +DlgImgPreview : "Peržiūra", +DlgImgAlertUrl : "Prašome įvesti vaizdo URL", +DlgImgLinkTab : "Nuoroda", + +// Flash Dialog +DlgFlashTitle : "Flash savybės", +DlgFlashChkPlay : "Automatinis paleidimas", +DlgFlashChkLoop : "Ciklas", +DlgFlashChkMenu : "Leisti Flash meniu", +DlgFlashScale : "Mastelis", +DlgFlashScaleAll : "Rodyti visą", +DlgFlashScaleNoBorder : "Be rėmelio", +DlgFlashScaleFit : "Tikslus atitikimas", + +// Link Dialog +DlgLnkWindowTitle : "Nuoroda", +DlgLnkInfoTab : "Nuorodos informacija", +DlgLnkTargetTab : "Paskirtis", + +DlgLnkType : "Nuorodos tipas", +DlgLnkTypeURL : "URL", +DlgLnkTypeAnchor : "Žymė šiame puslapyje", +DlgLnkTypeEMail : "El.paštas", +DlgLnkProto : "Protokolas", +DlgLnkProtoOther : "", +DlgLnkURL : "URL", +DlgLnkAnchorSel : "Pasirinkite žymę", +DlgLnkAnchorByName : "Pagal žymės vardą", +DlgLnkAnchorById : "Pagal žymės Id", +DlgLnkNoAnchors : "(Šiame dokumente žymių nėra)", +DlgLnkEMail : "El.pašto adresas", +DlgLnkEMailSubject : "Žinutės tema", +DlgLnkEMailBody : "Žinutės turinys", +DlgLnkUpload : "Siųsti", +DlgLnkBtnUpload : "Siųsti į serverį", + +DlgLnkTarget : "Paskirties vieta", +DlgLnkTargetFrame : "", +DlgLnkTargetPopup : "", +DlgLnkTargetBlank : "Naujas langas (_blank)", +DlgLnkTargetParent : "Pirminis langas (_parent)", +DlgLnkTargetSelf : "Tas pats langas (_self)", +DlgLnkTargetTop : "Svarbiausias langas (_top)", +DlgLnkTargetFrameName : "Paskirties kadro vardas", +DlgLnkPopWinName : "Paskirties lango vardas", +DlgLnkPopWinFeat : "Išskleidžiamo lango savybės", +DlgLnkPopResize : "Keičiamas dydis", +DlgLnkPopLocation : "Adreso juosta", +DlgLnkPopMenu : "Meniu juosta", +DlgLnkPopScroll : "Slinkties juostos", +DlgLnkPopStatus : "Būsenos juosta", +DlgLnkPopToolbar : "Mygtukų juosta", +DlgLnkPopFullScrn : "Visas ekranas (IE)", +DlgLnkPopDependent : "Priklausomas (Netscape)", +DlgLnkPopWidth : "Plotis", +DlgLnkPopHeight : "Aukštis", +DlgLnkPopLeft : "Kairė pozicija", +DlgLnkPopTop : "Viršutinė pozicija", + +DlnLnkMsgNoUrl : "Prašome įvesti nuorodos URL", +DlnLnkMsgNoEMail : "Prašome įvesti el.pašto adresą", +DlnLnkMsgNoAnchor : "Prašome pasirinkti žymę", +DlnLnkMsgInvPopName : "The popup name must begin with an alphabetic character and must not contain spaces", //MISSING + +// Color Dialog +DlgColorTitle : "Pasirinkite spalvą", +DlgColorBtnClear : "Trinti", +DlgColorHighlight : "Paryškinta", +DlgColorSelected : "Pažymėta", + +// Smiley Dialog +DlgSmileyTitle : "Įterpti veidelį", + +// Special Character Dialog +DlgSpecialCharTitle : "Pasirinkite specialų simbolį", + +// Table Dialog +DlgTableTitle : "Lentelės savybės", +DlgTableRows : "Eilutės", +DlgTableColumns : "Stulpeliai", +DlgTableBorder : "Rėmelio dydis", +DlgTableAlign : "Lygiuoti", +DlgTableAlignNotSet : "", +DlgTableAlignLeft : "Kairę", +DlgTableAlignCenter : "Centrą", +DlgTableAlignRight : "Dešinę", +DlgTableWidth : "Plotis", +DlgTableWidthPx : "taškais", +DlgTableWidthPc : "procentais", +DlgTableHeight : "Aukštis", +DlgTableCellSpace : "Tarpas tarp langelių", +DlgTableCellPad : "Trapas nuo langelio rėmo iki teksto", +DlgTableCaption : "Antraštė", +DlgTableSummary : "Santrauka", + +// Table Cell Dialog +DlgCellTitle : "Langelio savybės", +DlgCellWidth : "Plotis", +DlgCellWidthPx : "taškais", +DlgCellWidthPc : "procentais", +DlgCellHeight : "Aukštis", +DlgCellWordWrap : "Teksto laužymas", +DlgCellWordWrapNotSet : "", +DlgCellWordWrapYes : "Taip", +DlgCellWordWrapNo : "Ne", +DlgCellHorAlign : "Horizontaliai lygiuoti", +DlgCellHorAlignNotSet : "", +DlgCellHorAlignLeft : "Kairę", +DlgCellHorAlignCenter : "Centrą", +DlgCellHorAlignRight: "Dešinę", +DlgCellVerAlign : "Vertikaliai lygiuoti", +DlgCellVerAlignNotSet : "", +DlgCellVerAlignTop : "Viršų", +DlgCellVerAlignMiddle : "Vidurį", +DlgCellVerAlignBottom : "Apačią", +DlgCellVerAlignBaseline : "Apatinę liniją", +DlgCellRowSpan : "Eilučių apjungimas", +DlgCellCollSpan : "Stulpelių apjungimas", +DlgCellBackColor : "Fono spalva", +DlgCellBorderColor : "Rėmelio spalva", +DlgCellBtnSelect : "Pažymėti...", + +// Find and Replace Dialog +DlgFindAndReplaceTitle : "Find and Replace", //MISSING + +// Find Dialog +DlgFindTitle : "Paieška", +DlgFindFindBtn : "Surasti", +DlgFindNotFoundMsg : "Nurodytas tekstas nerastas.", + +// Replace Dialog +DlgReplaceTitle : "Pakeisti", +DlgReplaceFindLbl : "Surasti tekstą:", +DlgReplaceReplaceLbl : "Pakeisti tekstu:", +DlgReplaceCaseChk : "Skirti didžiąsias ir mažąsias raides", +DlgReplaceReplaceBtn : "Pakeisti", +DlgReplaceReplAllBtn : "Pakeisti viską", +DlgReplaceWordChk : "Atitikti pilną žodį", + +// Paste Operations / Dialog +PasteErrorCut : "Jūsų naršyklės saugumo nustatymai neleidžia redaktoriui automatiškai įvykdyti iškirpimo operacijų. Tam prašome naudoti klaviatūrą (Ctrl+X).", +PasteErrorCopy : "Jūsų naršyklės saugumo nustatymai neleidžia redaktoriui automatiškai įvykdyti kopijavimo operacijų. Tam prašome naudoti klaviatūrą (Ctrl+C).", + +PasteAsText : "Įdėti kaip gryną tekstą", +PasteFromWord : "Įdėti iš Word", + +DlgPasteMsg2 : "Žemiau esančiame įvedimo lauke įdėkite tekstą, naudodami klaviatūrą (Ctrl+V) ir spūstelkite mygtuką OK.", +DlgPasteSec : "Because of your browser security settings, the editor is not able to access your clipboard data directly. You are required to paste it again in this window.", //MISSING +DlgPasteIgnoreFont : "Ignoruoti šriftų nustatymus", +DlgPasteRemoveStyles : "Pašalinti stilių nustatymus", + +// Color Picker +ColorAutomatic : "Automatinis", +ColorMoreColors : "Daugiau spalvų...", + +// Document Properties +DocProps : "Dokumento savybės", + +// Anchor Dialog +DlgAnchorTitle : "Žymės savybės", +DlgAnchorName : "Žymės vardas", +DlgAnchorErrorName : "Prašome įvesti žymės vardą", + +// Speller Pages Dialog +DlgSpellNotInDic : "Žodyne nerastas", +DlgSpellChangeTo : "Pakeisti į", +DlgSpellBtnIgnore : "Ignoruoti", +DlgSpellBtnIgnoreAll : "Ignoruoti visus", +DlgSpellBtnReplace : "Pakeisti", +DlgSpellBtnReplaceAll : "Pakeisti visus", +DlgSpellBtnUndo : "Atšaukti", +DlgSpellNoSuggestions : "- Nėra pasiūlymų -", +DlgSpellProgress : "Vyksta rašybos tikrinimas...", +DlgSpellNoMispell : "Rašybos tikrinimas baigtas: Nerasta rašybos klaidų", +DlgSpellNoChanges : "Rašybos tikrinimas baigtas: Nėra pakeistų žodžių", +DlgSpellOneChange : "Rašybos tikrinimas baigtas: Vienas žodis pakeistas", +DlgSpellManyChanges : "Rašybos tikrinimas baigtas: Pakeista %1 žodžių", + +IeSpellDownload : "Rašybos tikrinimas neinstaliuotas. Ar Jūs norite jį dabar atsisiųsti?", + +// Button Dialog +DlgButtonText : "Tekstas (Reikšmė)", +DlgButtonType : "Tipas", +DlgButtonTypeBtn : "Button", //MISSING +DlgButtonTypeSbm : "Submit", //MISSING +DlgButtonTypeRst : "Reset", //MISSING + +// Checkbox and Radio Button Dialogs +DlgCheckboxName : "Vardas", +DlgCheckboxValue : "Reikšmė", +DlgCheckboxSelected : "Pažymėtas", + +// Form Dialog +DlgFormName : "Vardas", +DlgFormAction : "Veiksmas", +DlgFormMethod : "Metodas", + +// Select Field Dialog +DlgSelectName : "Vardas", +DlgSelectValue : "Reikšmė", +DlgSelectSize : "Dydis", +DlgSelectLines : "eilučių", +DlgSelectChkMulti : "Leisti daugeriopą atranką", +DlgSelectOpAvail : "Galimos parinktys", +DlgSelectOpText : "Tekstas", +DlgSelectOpValue : "Reikšmė", +DlgSelectBtnAdd : "Įtraukti", +DlgSelectBtnModify : "Modifikuoti", +DlgSelectBtnUp : "Aukštyn", +DlgSelectBtnDown : "Žemyn", +DlgSelectBtnSetValue : "Laikyti pažymėta reikšme", +DlgSelectBtnDelete : "Trinti", + +// Textarea Dialog +DlgTextareaName : "Vardas", +DlgTextareaCols : "Ilgis", +DlgTextareaRows : "Plotis", + +// Text Field Dialog +DlgTextName : "Vardas", +DlgTextValue : "Reikšmė", +DlgTextCharWidth : "Ilgis simboliais", +DlgTextMaxChars : "Maksimalus simbolių skaičius", +DlgTextType : "Tipas", +DlgTextTypeText : "Tekstas", +DlgTextTypePass : "Slaptažodis", + +// Hidden Field Dialog +DlgHiddenName : "Vardas", +DlgHiddenValue : "Reikšmė", + +// Bulleted List Dialog +BulletedListProp : "Suženklinto sąrašo savybės", +NumberedListProp : "Numeruoto sąrašo savybės", +DlgLstStart : "Start", //MISSING +DlgLstType : "Tipas", +DlgLstTypeCircle : "Apskritimas", +DlgLstTypeDisc : "Diskas", +DlgLstTypeSquare : "Kvadratas", +DlgLstTypeNumbers : "Skaičiai (1, 2, 3)", +DlgLstTypeLCase : "Mažosios raidės (a, b, c)", +DlgLstTypeUCase : "Didžiosios raidės (A, B, C)", +DlgLstTypeSRoman : "Romėnų mažieji skaičiai (i, ii, iii)", +DlgLstTypeLRoman : "Romėnų didieji skaičiai (I, II, III)", + +// Document Properties Dialog +DlgDocGeneralTab : "Bendros savybės", +DlgDocBackTab : "Fonas", +DlgDocColorsTab : "Spalvos ir kraštinės", +DlgDocMetaTab : "Meta duomenys", + +DlgDocPageTitle : "Puslapio antraštė", +DlgDocLangDir : "Kalbos kryptis", +DlgDocLangDirLTR : "Iš kairės į dešinę (LTR)", +DlgDocLangDirRTL : "Iš dešinės į kairę (RTL)", +DlgDocLangCode : "Kalbos kodas", +DlgDocCharSet : "Simbolių kodavimo lentelė", +DlgDocCharSetCE : "Central European", //MISSING +DlgDocCharSetCT : "Chinese Traditional (Big5)", //MISSING +DlgDocCharSetCR : "Cyrillic", //MISSING +DlgDocCharSetGR : "Greek", //MISSING +DlgDocCharSetJP : "Japanese", //MISSING +DlgDocCharSetKR : "Korean", //MISSING +DlgDocCharSetTR : "Turkish", //MISSING +DlgDocCharSetUN : "Unicode (UTF-8)", //MISSING +DlgDocCharSetWE : "Western European", //MISSING +DlgDocCharSetOther : "Kita simbolių kodavimo lentelė", + +DlgDocDocType : "Dokumento tipo antraštė", +DlgDocDocTypeOther : "Kita dokumento tipo antraštė", +DlgDocIncXHTML : "Įtraukti XHTML deklaracijas", +DlgDocBgColor : "Fono spalva", +DlgDocBgImage : "Fono paveikslėlio nuoroda (URL)", +DlgDocBgNoScroll : "Neslenkantis fonas", +DlgDocCText : "Tekstas", +DlgDocCLink : "Nuoroda", +DlgDocCVisited : "Aplankyta nuoroda", +DlgDocCActive : "Aktyvi nuoroda", +DlgDocMargins : "Puslapio kraštinės", +DlgDocMaTop : "Viršuje", +DlgDocMaLeft : "Kairėje", +DlgDocMaRight : "Dešinėje", +DlgDocMaBottom : "Apačioje", +DlgDocMeIndex : "Dokumento indeksavimo raktiniai žodžiai (atskirti kableliais)", +DlgDocMeDescr : "Dokumento apibūdinimas", +DlgDocMeAuthor : "Autorius", +DlgDocMeCopy : "Autorinės teisės", +DlgDocPreview : "Peržiūra", + +// Templates Dialog +Templates : "Šablonai", +DlgTemplatesTitle : "Turinio šablonai", +DlgTemplatesSelMsg : "Pasirinkite norimą šabloną
        (Dėmesio! esamas turinys bus prarastas):", +DlgTemplatesLoading : "Įkeliamas šablonų sąrašas. Prašome palaukti...", +DlgTemplatesNoTpl : "(Šablonų sąrašas tuščias)", +DlgTemplatesReplace : "Replace actual contents", //MISSING + +// About Dialog +DlgAboutAboutTab : "Apie", +DlgAboutBrowserInfoTab : "Naršyklės informacija", +DlgAboutLicenseTab : "License", //MISSING +DlgAboutVersion : "versija", +DlgAboutInfo : "Papildomą informaciją galima gauti" +}; Property changes on: announcement/trunk/src/main/webapp/fckeditor/editor/lang/lt.js ___________________________________________________________________ Name: svn:eol-style + native Added: announcement/trunk/src/main/webapp/fckeditor/editor/lang/lv.js =================================================================== --- announcement/trunk/src/main/webapp/fckeditor/editor/lang/lv.js (rev 0) +++ announcement/trunk/src/main/webapp/fckeditor/editor/lang/lv.js 2008-06-30 02:54:27 UTC (rev 1002) @@ -0,0 +1,515 @@ +?/* + * FCKeditor - The text editor for Internet - http://www.fckeditor.net + * Copyright (C) 2003-2008 Frederico Caldeira Knabben + * + * == BEGIN LICENSE == + * + * Licensed under the terms of any of the following licenses at your + * choice: + * + * - GNU General Public License Version 2 or later (the "GPL") + * http://www.gnu.org/licenses/gpl.html + * + * - GNU Lesser General Public License Version 2.1 or later (the "LGPL") + * http://www.gnu.org/licenses/lgpl.html + * + * - Mozilla Public License Version 1.1 or later (the "MPL") + * http://www.mozilla.org/MPL/MPL-1.1.html + * + * == END LICENSE == + * + * Latvian language file. + */ + +var FCKLang = +{ +// Language direction : "ltr" (left to right) or "rtl" (right to left). +Dir : "ltr", + +ToolbarCollapse : "Samazināt rīku joslu", +ToolbarExpand : "Paplašināt rīku joslu", + +// Toolbar Items and Context Menu +Save : "Saglabāt", +NewPage : "Jauna lapa", +Preview : "Pārskatīt", +Cut : "Izgriezt", +Copy : "Kopēt", +Paste : "Ievietot", +PasteText : "Ievietot kā vienkāršu tekstu", +PasteWord : "Ievietot no Worda", +Print : "Drukāt", +SelectAll : "Iezīmēt visu", +RemoveFormat : "Noņemt stilus", +InsertLinkLbl : "Hipersaite", +InsertLink : "Ievietot/Labot hipersaiti", +RemoveLink : "Noņemt hipersaiti", +Anchor : "Ievietot/Labot iezīmi", +AnchorDelete : "Remove Anchor", //MISSING +InsertImageLbl : "Attēls", +InsertImage : "Ievietot/Labot Attēlu", +InsertFlashLbl : "Flash", +InsertFlash : "Ievietot/Labot Flash", +InsertTableLbl : "Tabula", +InsertTable : "Ievietot/Labot Tabulu", +InsertLineLbl : "Atdalītājsvītra", +InsertLine : "Ievietot horizontālu Atdalītājsvītru", +InsertSpecialCharLbl: "Īpašs simbols", +InsertSpecialChar : "Ievietot speciālo simbolu", +InsertSmileyLbl : "Smaidiņi", +InsertSmiley : "Ievietot smaidiņu", +About : "Īsumā par FCKeditor", +Bold : "Treknu šriftu", +Italic : "Slīprakstā", +Underline : "Apakšsvītra", +StrikeThrough : "Pārsvītrots", +Subscript : "Zemrakstā", +Superscript : "Augšrakstā", +LeftJustify : "Izlīdzināt pa kreisi", +CenterJustify : "Izlīdzināt pret centru", +RightJustify : "Izlīdzināt pa labi", +BlockJustify : "Izlīdzināt malas", +DecreaseIndent : "Samazināt atkāpi", +IncreaseIndent : "Palielināt atkāpi", +Blockquote : "Blockquote", //MISSING +Undo : "Atcelt", +Redo : "Atkārtot", +NumberedListLbl : "Numurēts saraksts", +NumberedList : "Ievietot/Noņemt numerēto sarakstu", +BulletedListLbl : "Izcelts saraksts", +BulletedList : "Ievietot/Noņemt izceltu sarakstu", +ShowTableBorders : "Parādīt tabulas robežas", +ShowDetails : "Parādīt sīkāku informāciju", +Style : "Stils", +FontFormat : "Formāts", +Font : "Šrifts", +FontSize : "Izmērs", +TextColor : "Teksta krāsa", +BGColor : "Fona krāsa", +Source : "HTML kods", +Find : "Meklēt", +Replace : "Nomainīt", +SpellCheck : "Pareizrakstības pārbaude", +UniversalKeyboard : "Universāla klaviatūra", +PageBreakLbl : "Lapas pārtraukums", +PageBreak : "Ievietot lapas pārtraukumu", + +Form : "Forma", +Checkbox : "Atzīmēšanas kastīte", +RadioButton : "Izvēles poga", +TextField : "Teksta rinda", +Textarea : "Teksta laukums", +HiddenField : "Paslēpta teksta rinda", +Button : "Poga", +SelectionField : "Iezīmēšanas lauks", +ImageButton : "Attēlpoga", + +FitWindow : "Maksimizēt redaktora izmēru", +ShowBlocks : "Show Blocks", //MISSING + +// Context Menu +EditLink : "Labot hipersaiti", +CellCM : "Šūna", +RowCM : "Rinda", +ColumnCM : "Kolonna", +InsertRowAfter : "Insert Row After", //MISSING +InsertRowBefore : "Insert Row Before", //MISSING +DeleteRows : "Dzēst rindas", +InsertColumnAfter : "Insert Column After", //MISSING +InsertColumnBefore : "Insert Column Before", //MISSING +DeleteColumns : "Dzēst kolonnas", +InsertCellAfter : "Insert Cell After", //MISSING +InsertCellBefore : "Insert Cell Before", //MISSING +DeleteCells : "Dzēst rūtiņas", +MergeCells : "Apvienot rūtiņas", +MergeRight : "Merge Right", //MISSING +MergeDown : "Merge Down", //MISSING +HorizontalSplitCell : "Split Cell Horizontally", //MISSING +VerticalSplitCell : "Split Cell Vertically", //MISSING +TableDelete : "Dzēst tabulu", +CellProperties : "Rūtiņas īpašības", +TableProperties : "Tabulas īpašības", +ImageProperties : "Attēla īpašības", +FlashProperties : "Flash īpašības", + +AnchorProp : "Iezīmes īpašības", +ButtonProp : "Pogas īpašības", +CheckboxProp : "Atzīmēšanas kastītes īpašības", +HiddenFieldProp : "Paslēptās teksta rindas īpašības", +RadioButtonProp : "Izvēles poga īpašības", +ImageButtonProp : "Attēlpogas īpašības", +TextFieldProp : "Teksta rindas īpašības", +SelectionFieldProp : "Iezīmēšanas lauka īpašības", +TextareaProp : "Teksta laukuma īpašības", +FormProp : "Formas īpašības", + +FontFormats : "Normāls teksts;Formatēts teksts;Adrese;Virsraksts 1;Virsraksts 2;Virsraksts 3;Virsraksts 4;Virsraksts 5;Virsraksts 6;Rindkopa (DIV)", + +// Alerts and Messages +ProcessingXHTML : "Tiek apstrādāts XHTML. Lūdzu uzgaidiet...", +Done : "Darīts", +PasteWordConfirm : "Teksta fragments, kas tiek ievietots, izskatās, ka būtu sagatavots Word'ā. Vai vēlaties to apstrādāt pirms ievietošanas?", +NotCompatiblePaste : "Šī darbība ir pieejama Internet Explorer'ī, kas jaunāks par 5.5 versiju. Vai vēlaties ievietot bez apstrādes?", +UnknownToolbarItem : "Nezināms rīku joslas objekts \"%1\"", +UnknownCommand : "Nezināmas darbības nosaukums \"%1\"", +NotImplemented : "Darbība netika paveikta", +UnknownToolbarSet : "Rīku joslas komplekts \"%1\" neeksistē", +NoActiveX : "Interneta pārlūkprogrammas drošības uzstādījumi varētu ietekmēt dažas no redaktora īpašībām. Jābūt aktivizētai sadaļai \"Run ActiveX controls and plug-ins\". Savādāk ir iespējamas kļūdas darbībā un kļūdu paziņojumu parādīšanās.", +BrowseServerBlocked : "Resursu pārlūks nevar tikt atvērts. Pārliecinieties, ka uznirstošo logu bloķētāji ir atslēgti.", +DialogBlocked : "Nav iespējams atvērt dialoglogu. Pārliecinieties, ka uznirstošo logu bloķētāji ir atslēgti.", + +// Dialogs +DlgBtnOK : "Darīts!", +DlgBtnCancel : "Atcelt", +DlgBtnClose : "Aizvērt", +DlgBtnBrowseServer : "Skatīt servera saturu", +DlgAdvancedTag : "Izvērstais", +DlgOpOther : "", +DlgInfoTab : "Informācija", +DlgAlertUrl : "Lūdzu, ievietojiet hipersaiti", + +// General Dialogs Labels +DlgGenNotSet : "